id
stringlengths
33
34
updated
timestamp[s]
published
timestamp[s]
title
stringlengths
9
212
summary
stringlengths
75
2.46k
author
sequence
arxiv:doi
stringlengths
0
71
link
list
arxiv:journal_ref
sequence
arxiv:primary_category
dict
category
sequence
content
stringlengths
0
1.25M
http://arxiv.org/abs/2302.10164v1
2023-02-20T18:50:18
2023-02-20T18:50:18
Seasoning Model Soups for Robustness to Adversarial and Natural Distribution Shifts
Adversarial training is widely used to make classifiers robust to a specific threat or adversary, such as $\ell_p$-norm bounded perturbations of a given $p$-norm. However, existing methods for training classifiers robust to multiple threats require knowledge of all attacks during training and remain vulnerable to unseen distribution shifts. In this work, we describe how to obtain adversarially-robust model soups (i.e., linear combinations of parameters) that smoothly trade-off robustness to different $\ell_p$-norm bounded adversaries. We demonstrate that such soups allow us to control the type and level of robustness, and can achieve robustness to all threats without jointly training on all of them. In some cases, the resulting model soups are more robust to a given $\ell_p$-norm adversary than the constituent model specialized against that same adversary. Finally, we show that adversarially-robust model soups can be a viable tool to adapt to distribution shifts from a few examples.
[ "Francesco Croce", "Sylvestre-Alvise Rebuffi", "Evan Shelhamer", "Sven Gowal" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10164v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10164v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CV" ]
Seasoning Model Soups for Robustness to Adversarial and Natural Distribution Shifts Francesco Croce* University of T ̈ubingen Sylvestre-Alvise Rebuffi DeepMind Evan Shelhamer DeepMind Sven Gowal DeepMind 3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 4 6 1 0 1 . 2 0 3 2 : v i X r a Abstract Adversarial training is widely used to make classifiers robust to a specific threat or adversary, such as (cid:96)p-norm bounded perturbations of a given p-norm. However, ex- isting methods for training classifiers robust to multiple threats require knowledge of all attacks during training and remain vulnerable to unseen distribution shifts. In this work, we describe how to obtain adversarially-robust model soups (i.e., linear combinations of parameters) that smoothly trade-off robustness to different (cid:96)p-norm bounded adversaries. We demonstrate that such soups allow us to control the type and level of robustness, and can achieve robustness to all threats without jointly training on all of them. In some cases, the resulting model soups are more robust to a given (cid:96)p-norm adversary than the constituent model specialized against that same adversary. Finally, we show that adversarially-robust model soups can be a viable tool to adapt to distribution shifts from a few examples. 1. Introduction Deep networks have achieved great success on several computer vision tasks and have even reached super-human accuracy [16, 28]. However, the outputs of such models are often brittle, and tend to perform poorly on inputs that differ from the distribution of inputs at training time, in a condition known as distribution shift [34]. Adversarial perturbations are a prominent example of this condition: small, even imperceptible, changes to images can alter pre- dictions to cause errors [2, 41]. In addition to adversarial inputs, it has been noted that even natural shifts, e.g. dif- ferent weather conditions, can significantly reduce the ac- curacy of even the best vision models [11, 18, 36]. Such drops in accuracy are undesirable for robust deployment, and so a lot of effort has been invested in correcting them. Adversarial training [31] and its extensions [13, 35, 51] are currently the most effective methods to improve empirical robustness to adversarial attacks. Similarly, data augmen- *Work done during an internship at DeepMind. tation is the basis of several techniques that improve ro- bustness to non-adversarial/natural shifts [3, 9, 19]. While significant progress has been made on defending against a specific, selected type of perturbations (whether adversar- ial or natural), it is still challenging to make a single model robust to a broad set of threats and shifts. For example, a classifier adversarially-trained for robustness to (cid:96)p-norm bounded attacks is still vulnerable to attacks in other (cid:96)q- threat models [26, 42]. Moreover, methods for simultane- ous robustness to multiple attacks require jointly training on all [30, 32] or a subset of them [6]. Most importantly, con- trolling the trade-off between different types of robustness (and nominal performance) remains difficult and requires training several classifiers. Inspired by model soups [46], which interpolate the pa- rameters of a set of vision models to achieve state-of-the-art accuracy on IMAGENET, we investigate the effects of in- terpolating robust image classifiers. We complement their original recipe for soups by own study of how to pre- train, fine-tune, and combine the parameters of models adversarially-trained against (cid:96)p-norm bounded attacks for different p-norms. To create models for soups, we pre-train a single robust model and fine-tune it to the target threat models (using the efficient technique of [6]). We then es- tablish that it is possible to smoothly trade-off robustness to different threat models by moving in the convex hull of the parameters of each robust classifier, while achieving competitive performance with methods that train on multi- ple p-norm adversaries simultaneously. Unlike alternatives, our soups can uniquely (1) choose the level of robustness to each threat model without any further training and (2) quickly adapt to new unseen attacks or shifts by simply tun- ing the weighting of the soup. Previous works [21, 27, 47] have shown that adversarial training with (cid:96)p-norm bounded attacks can help to improve performance on natural shifts if carefully tuned. We show that model soups of diverse classifiers, with different types of robustness, offer greater flexibility for finding models that perform well across various shifts, such as IMAGENET variants. Furthermore, we show that a limited number of images of the new distribution are sufficient to select the 1 weights of such a model soup. Examining the composition of the best soups brings insights about which features are important for each dataset and shift. Finally, while the ca- pability of selecting a model specific to each image distribu- tion is a main point of our model soups, we also show that it is possible to jointly select a soup for average performance across several IMAGENET variants to achieve better accu- racy than adversarial and self-supervised baselines [15, 21]. Contributions. In summary, we show that soups • can merge nominal and (cid:96)p-robust models (for various p): efficient fine-tuning from one robust model obtains a set of models with diverse robustness [6] and compatible pa- rameters for creating model soups [46] (Sec. 3), • can control the level of robustness to each threat model and achieve, without more training, competitive perfor- mance against multi-norm robustness training (Sec. 4), • are not limited to interpolation, but can find more effec- tive classifiers by extrapolation (Sec. 4.3), • enable adaptation to unseen distribution shifts on only a few examples (Sec. 5). 2. Related Work Adversarial robustness to multiple threat models. Most methods focus on achieving robustness in a single threat model, i.e. to a specific type of attacks used dur- ing training. However, this is not sufficient to obtain ro- bustness to unseen attacks. As a result, further work aims to train classifiers for simultaneous robustness to multiple attacks, and the most popular scenario considers a set of (cid:96)p-norm bounded perturbations. The most successful meth- ods [30, 32, 42] are based on adversarial training and differ in how the multiple threats are combined. Notably, all need to use every attack at training time. To reduce the compu- tational cost of obtaining multiply-robust models, one can fine-tune a singly-robust model by one of the above men- tioned methods [6], even for only a small number of epochs. Our soups are more flexible by skipping simultaneous ad- versarial training across multiple attacks. Adversarial training for distribution shifts. While ro- bustness to adversarial attacks and natural shifts are not the same goal, previous works nevertheless show that it is pos- sible to leverage adversarial training with (cid:96)p-norm bounded attacks to improve performance on the common corruptions of [18]. First, AdvProp [47] co-trains models on clean and adversarial images (in the (cid:96)∞-threat model) with dual nor- malization layers that specialize to each type of input. The clean branch of the dual model achieves higher accuracy than nominal training on IMAGENET and its variants. Simi- lar results are obtained by Pyramid-AT [21] by its design of a specific attack to adversarially train vision transformers. Finally, [27] carefully selecting the size of the adversarial their (cid:96)∞- or (cid:96)2-norm, for standard ad- perturbations, i.e. versarial training [31] achieves competitive performance on common corruptions on CIFAR-10 and IMAGENET-100. Model soups. Ensembling or averaging the parame- ters of intermediate models found during training is an ef- fective technique to improve both clean accuracy [22, 25] and robustness [12, 35]. Recently, [46] propose model soups which interpolate the parameters of networks fine- tuned with different hyperparameters configurations from the same pre-trained model. This yields improved classifi- cation accuracy on IMAGENET. Along the same line, [24] fine-tune a model trained on IMAGENET on several new image classification datasets, and show that interpolating the original and fine-tuned parameters yields classifiers that perform well on all tasks. 3. Model Interpolation across Different Tasks In the following, we formally introduce the two main components of our procedure to merge adversarially ro- bust models: (1) obtaining models which can interpolated by fine-tuning a single (cid:96)p-robust classifiers, and (2) inter- polation of their weights to balance their different types of robustness. We highlight that our setup diverges from that of prior works about parameters averaging: in fact, both [24, 46] combine models fine-tuned on the same task, i.e. achieving high classification accuracy of unperturbed images, either on a fixed dataset and different hyperparame- ter configurations [46], or varying datasets [24]. In our case, the individual models are trained for robustness to different types of attacks, i.e. with distinct loss functions. 3.1. Adversarial training and fine-tuning Let us denote D = {(xi, yi)}i the training set, with xi ∈ Rd indicating an image and yi ∈ {1, . . . , K} the cor- responding label, and ∆ : Rd → Rd the function which characterizes a threat model, that maps an input x to a set ∆(x) ⊂ Rd of possible perturbed versions of the original image. For example, (cid:96)p-norm bounded adversarial attacks with budget (cid:15) > 0 in the image space can be described by ∆(x) = {δ ∈ Rd : (cid:107)δ(cid:107)p ≤ (cid:15), x + δ ∈ [0, 1]d}. (1) Then, one can train a classifier f : θ × Rd → RK parame- terized by θ ∈ Θ with adversarial training [31] by solving min θ∈Θ (cid:88) (x,y)∈D max δ∈∆(x) L(f (θ, x + δ), y), (2) for a given loss function L : RK × RK → R (e.g., cross- entropy), with the goal of obtaining a model robust to the perturbations described by ∆. Note that this boils down to nominal training when ∆(*) = {0} and no perturbation is applied on the training images. We are interested in the case where multiple threat models are available, and indicate with ∆nominal nominal training, and ∆p for p ∈ {∞, 2, 1} 2 soup: θ∞ + θ∞→2, soup: θ2 + θ2→∞ soup: θ∞ + θ∞→1, soup: θ1 + θ1→∞ soup: θ2 + θ2→1, soup: θ1 + θ1→2 Figure 1. Soups of two models on CIFAR-10: for all pairs (p, q) we show the (cid:96)p- vs (cid:96)q-robust accuracy of the soups w*θp +(1−w)*θp→q and w * θq + (1 − w) * θq→p varying w ∈ [0, 1]. We also show results for MAX and SAT with simultaneous use of the two threat models. soup: θ∞ + θ∞→2 soup: θ∞ + θ∞→1 soup: θ∞→2 + θ∞→1 soup: θ∞ + θ∞→nominal Figure 2. Soups of two models on IMAGENET: for p ∈ {2, 1} we show the (cid:96)p- vs (cid:96)∞-robust accuracy of the soups w*θ∞+(1−w)*θ∞→p varying w ∈ [0, 1] (first and second columns). Moreover, we show the soups obtained combining θ∞→2 and θ∞→1 (third), or θ∞ and θ∞→nominal (fourth). For the case of two (cid:96)p-threat models, we also show the results of fine-tuning models with MAX and SAT. the perturbations with bounded (cid:96)p-norm as described in Eq. 1. We focus on such tasks since they are the most com- mon choices for adversarial defenses, in particular by meth- ods focusing on multiple norm robustness [32, 42]. Notably, it is possible to efficiently obtain a model robust to ∆q by fine-tuning for a single (or few) epoch with adver- sarial training w.r.t. ∆q a classifier pre-trained to be robust in ∆p, with p (cid:54)= q and p, q ∈ {∞, 2, 1} [6]. For example, in this way one can efficiently derive specialized classifiers ∆2, ∆1, ∆nominal for each task from a single model f robust w.r.t. (cid:96)∞. However, this does not work well when a nominal classifier is used as starting point for the short fine-tuning. In the following, we denote with θp→q the parameters re- sulting from fine-tuning to ∆q a base model θp. 3.2. Merging different types of robustness via linear combinations in parameter space We want to explore the properties of the models ob- tained by taking linear combinations of the parameters of classifiers with different types of robustness. To do so, there needs to be a correspondence among the parameters of different individual networks: [46] achieve this by merg- ing differently fine-tuned versions of the same pre-trained model. As mentioned above, fine-tuning an (cid:96)p-robust clas- sifier allows to change it to achieve robustness in a new threat model [6]: we exploit such property to create model soups, as named by [46]. Formally, we create a model soup from n individual networks with parameters θ1, . . . , θn with weights w = (w1, . . . , wn) ∈ Rn as θw = n (cid:88) i=1 wi * θi, (3) and the corresponding classifier is given by f (θw, *) : Rd → RK. While any choice of w is possible, we focus on the case of affine combinations, i.e. (cid:80) i wi = 1. Moreover, we consider soups which are either convex combinations of the individual models, with w1, . . . , wn ≥ 0, or obtained by extrapolations, i.e. with negative elements in w. 4. Soups for (cid:96)p-robustness We measure adversarial robustness in the (cid:96)p-threat model with bounds (cid:15)p: on CIFAR-10 we use (cid:15)∞ = 8/255, (cid:15)2 = 128/255, (cid:15)1 = 12, on IMAGENET (cid:15)∞ = 4/255, (cid:15)2 = 4, (cid:15)1 = 255. If not specified otherwise, we use the full test set for CIFAR-10 and 5000 images from the IMA- GENET validation set, and attack by AUTOPGD [4, 5] with 40 steps. More details are provided in App. A. 3 3540455055 robust accuracy6264666870722 robust accuracysoups (base=)soups (base=2)MAXSAT303540455055 robust accuracy1020304050601 robust accuracysoups (base=)soups (base=1)MAXSAT65666768697071722 robust accuracy303540455055601 robust accuracysoups (base=2)soups (base=1)MAXSAT5354555657 robust accuracy404142434445462 robust accuracysoups 1/3 epochsoups 1 epochsoups 3 epochsMAXSAT40.042.545.047.550.052.555.057.5 robust accuracy152025303540451 robust accuracysoups 1/3 epochsoups 1 epochsoups 3 epochsMAXSAT4243444546472 robust accuracy303540451 robust accuracysoups 1/3 epochsoups 1 epochsoups 3 epochsMAXSAT102030405060 robust accuracy7778798081clean accuracysoups 1/3 epochsoups 1 epochsoups 3 epochs 4.1. Soups with two threat models CIFAR-10. We explore the effect of interpolating two models robust to different (cid:96)p-norm bounded attacks for p ∈ {∞, 2, 1}. We consider classifiers with WIDERES- NET-28-10 [49] architecture trained on CIFAR-10. For ev- ery threat model, we first train a robust classifier with ad- versarial training from random initialization. Then, we fine- tune the resulting model with adversarial training on each of the other threat models for 10 epochs. In Fig. 1 we show, for each pair of threat models (∆p, ∆q), the trade-off of robust accuracy w.r.t. (cid:96)p and (cid:96)q for the soups w * θp + (1 − w) * θp→q for w ∈ [0, 1] and symmetrically w * θq + (1 − w) * θq→p for w ∈ [0, 1]. Interpolating the parameters of models trained with a single (cid:96)p-norm controls the balance between the two types of ro- bustness: for example, Fig. 1 (middle plot) shows that mov- ing from θ∞ to θ∞→1 (blue curve), i.e. decreasing w from 1 to 0 in the corresponding soup, progressively reduces the robust accuracy w.r.t. (cid:96)∞ to improve robustness w.r.t. (cid:96)1. Moreover, for similar threat models (i.e. the pairs ((cid:96)2, (cid:96)1) and ((cid:96)2, (cid:96)∞)) some intermediate networks are more robust than the extremes trained specifically for each threat model. IMAGENET. We now fine-tune a VIT-B16 [8] robust w.r.t. (cid:96)∞ on IMAGENET to the other threat models, includ- ing nominal training, for either 1/3, 1 or 3 epochs. Fig. 2 shows that interpolation of parameters is effective even in this setup, and allows to easily balance nominal and robust accuracy (fourth plot). Moreover, it is possible to create soups with two fine-tuned models, i.e. θ∞→2 and θ∞→1. Finally, increasing the number of fine-tuning steps yields better performance in the target threat model, which in turn generally leads to better soups. Comparison to multi-norm robustness methods. Fig. 1 and Fig. 2 compare the performance of the model soups to that of models trained with methods for robustness in the union of multiple threat models. In particular, we show the results of MAX [42], which computes perturba- tions for each threat model and trains on that attaining the highest loss, and SAT [30], which samples uniformly at ran- dom for each training batch the attack to use. We train mod- els with both methods for all pairs of threat models: as ex- pected, MAX tends to focus on the most challenging threat model, sacrificing some robustness in the other one com- pared to SAT, since it uses only the strongest attack for each training point. When training for (cid:96)∞ and (cid:96)1, i.e. the extreme (cid:96)p-norms we consider, MAX and SAT models lie above the front drawn by the model soups, hinting that the more di- verse the attacks, the more difficult it is to preserve high robustness to both. In the other cases, both methods behave similarly to the soups. The main advantage given by inter- polation is however the option of moving along the front without additional training cost: while one might tune the trade-off between the robustness in the two threat models in SAT, e.g. changing the sampling probability, this would still require training a new classifier for each setup. 4.2. Soups with three threat models We here study the convex combination of three models with different types of robustness. For CIFAR-10 we cre- ate soups with each (cid:96)p-robust classifier for p ∈ {∞, 2, 1} and its fine-tuned version into the other two threat mod- els. We use the same models of the previous section, and sweep the interpolation weights w ∈ R3 such that wi ∈ {0, 0.2, 0.4, 0.6, 0.8, 1} and (cid:80) In Fig. 3 and Fig. 10 (in the Appendix) we show clean accuracy (first column) and robust accuracy in (cid:96)∞, (cid:96)2 and (cid:96)1 (second to fourth columns) and their union, when a point is considered robust only if it is such against all attacks (last column). i wi = 1. One can observe that, independently from the type of robustness of the base model (used as initialization for the fine-tuning), moving in the convex hull of the three parame- ters (e.g. θ∞ +θ∞→2 +θ∞→1 in Fig. 3) allows to smoothly control the trade-off of the different types of robustness. In- terestingly, the highest (cid:96)2-robustness is attained by interme- diate soups, not by the model specifically fine-tuned w.r.t. (cid:96)2, suggesting that model soups might even be beneficial to robustness in individual threat models (see more below). Moreover, the highest robustness in the union is given by in- terpolating only the models robust w.r.t. (cid:96)∞ and (cid:96)1, which is in line with the observation of [6] that training for the ex- treme norms is sufficient for robustness in the union of the three threat models. Although the robust accuracy in the union is lower than that of training simultaneously with all attacks e.g. with MAX (42.0% vs 47.2%), the model soups deliver competitive results without the need of co-training. Finally, Fig. 4 shows that similar observations hold on IMAGENET, where we create soups fine-tuning classifiers robust w.r.t. (cid:96)∞, with either RESNET-50 [16] or VIT-B16 as architecture, for 1 epoch. 4.3. Soups for improving individual threat model robustness We notice in Fig. 1 and Fig. 2 that in a few cases the in- termediate models obtain via parameters interpolation have higher robustness than the extreme ones, which are trained or fine-tuned with a specific threat model. As such, we an- alyze in more details the soups w * θ∞ + (1 − w) * θ∞→2, i.e. using the original classifier robust in (cid:96)∞ and the one fine-tuned to (cid:96)2, on both CIFAR-10 and IMAGENET. Fig. 5 shows the robust accuracy w.r.t. (cid:96)∞ when varying the value of w: in both case the original model θ∞, highlighted in Interestingly, on red, does not attain the best robustness. 4 soup: θ∞ + θ∞→2 + θ∞→1 Figure 3. Soups of three models on CIFAR-10: we fine-tune the model robust w.r.t. (cid:96)∞ (with WIDERESNET-28-10 architecture) to the other threat models for 10 epochs, and show clean accuracy (first column) and robust accuracy w.r.t. every threat model (second to fourth columns) and their union (last column) of the soups obtained as convex combinations of the three bases. RESNET-50, soup: θ∞ + θ∞→2 + θ∞→1 VIT-B16, soup: θ∞ + θ∞→2 + θ∞→1 Figure 4. Soups of three models on IMAGENET: we fine-tune the classifiers, with RESNET-50 (top row) and VIT-B16 (bottom) as architecture, robust w.r.t. (cid:96)∞ for 1 epoch to the other threat models, and show clean accuracy (first column) and robust accuracy in every threat model (second to fourth columns) and their union (last column) of the classifiers obtained as convex combinations of the three bases. CIFAR-10: θ∞ + θ∞→2 IMAGENET: θ∞ + θ∞→2 Figure 5. Improvement on single threat models: we show the robust accuracy w.r.t. (cid:96)∞ for the soups w * θ∞ + (1 − w) * θ∞→2 for varied w. The original model θ∞ is highlighted in red. CIFAR-10 the best soup is found with w = 0.9, while for IMAGENET with w > 1: this suggests that the model soups 5 should not be constrained to the convex hull of the base models, and extrapolation can lead to improvement. 5. Soups for Distribution Shifts Prior works [27] have shown that adversarial training w.r.t. an (cid:96)p-norm is able to provide some improvement in the performance in presence of non-adversarial distribution shifts, e.g. the common corruptions of IMAGENET-C [18]. However, to see such gains it is necessary to carefully se- lect the threat model, for example which (cid:96)p-norm and size (cid:15) to bound the perturbations, to use during training. The experiments in Sec. 4 suggest that model soups of nominal and adversarially robust classifiers yield models with a vari- ety of intermediate behaviors, and extrapolation might even deliver models which do not merely trade-off the robust- 21clean accuracy21 robust accuracy212 robust accuracy211 robust accuracy21+2+1 robust accuracy8889909192303540455060657020406020304021clean accuracy21 robust accuracy212 robust accuracy211 robust accuracy21+2+1 robust accuracy6062646630354010152025102030510152021clean accuracy21 robust accuracy212 robust accuracy211 robust accuracy21+2+1 robust accuracy737475767745505542444620304015202530350.60.70.80.91.01.1linear combination weight505152535455 robust accuracy0.951.001.051.101.151.201.251.30linear combination weight57.357.457.557.657.757.8 Figure 6. Soups on IMAGENET variants: for each dataset we plot the accuracy of the 5 best performing soups of the four base models θ∞, θ∞→2, θ∞→1 and θ∞→nominal, and of the individual classifiers. Additionally, we show the performance of an independently trained nominal model. All models are evaluated on the 1000 points used for the grid search of the best soups. ness of the initial classifiers but amplify it. This flexibility could suit adaptation to various distribution shifts: that is, the various corruption types might more closely resemble the geometry of different (cid:96)p-balls or their union. Moreover, including a nominally fine-tuned model in the soup allows it to maintain, if necessary, high accuracy on the original dataset, which is often degraded by adversarial training [31] or test-time adaptation on shifted data [33]. 5.1. Soups for IMAGENET variants Setup. In the following, we use models soups consisting of robust VIT fine-tuned from (cid:96)∞ to the other threat models, and one more VIT nominally fine-tuned for 100 epochs to obtain slightly higher accuracy on clean data. For shifts, we consider several variants of IMAGENET, providing a broad and diverse benchmark for our soups: IMAGENET-REAL [1], IMAGENET-V2 [36], IMAGENET-C [18], IMAGENET- A [20], IMAGENET-R [17], IMAGENET-SKETCH [44], and CONFLICT STIMULI [10]. We consider the setting of few- shot supervised adaptation, with a small set of labelled im- ages from each shift, which we use to select the best soups. Soup selection via grid search. Since evaluating the ac- curacy of many soups on the entirety of the datasets would be extremely expensive, we search for the best combina- tion of the four models on a random subset of 1000 points from each dataset, with the exception of CONFLICT STIM- ULI for which all 1280 images are used (for IMAGENET-C we use all corruption types and severities, then aggregate the results). Restricting our search to a subset also serves our aim of finding a model soup which generalizes to the new distribution by only seeing a few examples. We eval- uate all the possible affine combinations with weights in the range [−0.4, 1.4] with granularity 0.2, which amounts to 460 models in total. In Fig. 6 we compare, for each dataset, the accuracy of the 5 best soups to that of each indi- vidual classifier used for creating the soups and of a nominal model trained independently: for all datasets apart from IM- AGENET the top soups outperform the individual models. Moreover, we notice that the best individual model varies across datasets, indicating that it might be helpful to merge networks with different types of robustness. Comparison to existing methods. Having selected the best soup for each variant (dataset-specific soups) on its chosen few-shot adaptation set, we evaluate the soup on the test set of the variant (results in Table 1). We also evalu- ate the model soup that attains the best average case accu- racy over the adaptation sets for all variants (single soup), in order to gauge the best performance of a single, general model soup. We compare the soups to a nominal model, the (cid:96)∞-robust classifier used in the soups, their ensemble, the Masked AutoEncoders of [15], AdvProp [47], Pyramid- AT [21], and the ensemble obtained by averaging the output (after softmax) of the four models included in the soups. Selecting the best soup on 1000 images of each datasets (results in the last row of Table 1) leads in 4 out of the 8 datasets to the best accuracy, and only slightly suboptimal values in the other cases: in particular, parameters interpola- tions is very effective on stronger shifts like IMAGENET-R and CONFLICT STIMULI, where it attains almost 8% better performance than the closest baseline. Unsurprisingly, it is more challenging to improve on datasets like IMAGENET- V2 which are very close to the original IMAGENET. Over- 6 70.072.575.077.580.082.5accuracyImageNet76788082848688ImageNet-Real55606570ImageNet-V210203040ImageNet-Asoups -> nominal -> 2 -> 1nominaltop-5 soups baselines45.047.550.052.555.057.560.0accuracyImageNet-Rtop-5 soups baselines30323436384042ImageNet-Sketchtop-5 soups baselines30405060Conflict Stimulitop-5 soups baselines50556065ImageNet-C SETUP Baselines # FP IMAGENET IN-REAL IN-V2 IN-A IN-R IN- SKETCH CONFLICT STIMULI IN-C MEAN ×1 Nominal training ×1 Adversarial training ×1 Fine-tuned MAE-B16 ×1 AdvProp ×1 Pyramid-AT ×2 Indep. networks ensemble Individual networks ensemble ×4 Fixed grid search on 1000 images 82.64% 76.88% 83.10% 83.39% 83.14% 82.86% 81.31% 87.33% 83.91% 88.02% 88.06% 87.82% 87.78% 86.97% 71.42% 64.81% 72.80% 73.17% 72.53% 71.73% 70.21% 28.03% 12.35% 37.92% 34.81% 32.72% 25.99% 23.13% 47.94% 55.76% 49.30% 53.04% 51.78% 54.20% 54.82% 34.43% 40.11% 35.69% 39.25% 38.60% 37.33% 39.51% 30.47% 59.45% 27.81% 38.98% 37.27% 46.41% 56.02% 64.45% 55.44% 63.23% 70.39% 67.01% 65.61% 68.17% 55.84% 56.09% 57.23% 60.14% 58.86% 58.99% 60.02% Single soup Dataset-specific soups ×1 ×1 82.49% 82.29% 87.85% 87.89% 71.99% 71.95% 34.31% 38.27% 53.84% 56.39% 39.84% 40.73% 38.52% 67.03% 66.82% 69.34% 59.46% (64.24%) Table 1. Comparison on IMAGENET variants: we report the classification accuracy of various models on the IMAGENET variants, together with the number of forward passes they require. The soups are selected via a fixed grid search on the interpolation weights with 1000 points for each dataset. The last row shows the results of the best found soup for each dataset. Figure 7. Soup compositions on IMAGENET variants: for each dataset we plot the composition of the 5 best soups, i.e. the linear weights for the individual models, as measured by grid search over 1000 points on weights in the range [−0.4, 1.4] with granularity 0.2. Additionally we show the composition of the model achieving the best average accuracy over all 8 variants. all, The soup selected for best average accuracy (across all datasets) outperforms all baselines, except for the ensemble of four models (with 4× the inference cost), and AdvProp, which requires co-training of clean and adversarial points. These results show that soups with robust classifiers are a promising avenue for quickly adapting to distribution shifts. Composition of the soups. To analyze which types of classifiers are most relevant for performance on every distri- bution shift, we plot in Fig. 7 the breakdown of the weights of the five best soups (more intense colors indicate that the corresponding weight or a larger one is used more often in the top-5 soups). First, one can see that the nominally fine-tuned model (in black) is dominant, with weights of 0.8 or 1, on IMAGENET, IMAGENET-REAL, IMAGENET- V2, IMAGENET-A and IMAGENET-C: this could be ex- pected since these datasets are closer to IMAGENET itself, i.e. the distribution shift is smaller, which is what nominal training optimizes for (in fact, the nominal models achieve higher accuracy than adversarially trained ones on these datasets in Fig. 6). However, in all cases there is a contribu- tion of some of the (cid:96)p-robust networks. On IMAGENET-R, IMAGENET-SKETCH and CONFLICT STIMULI, the model robust w.r.t. (cid:96)∞ plays instead the most relevant role, again in line with the results in Table 1. Interestingly, in the case of CONFLICT STIMULI, the nominal classifier has a weight -0.4 (the smallest in the grid search) for all top performing soups: we hypothesize that this has the effect of reduce the texture bias typical of nominal model and emphasize the at- tention to shapes already important in adversarially trained classifiers. Finally, we show the composition of the soup which has the best average accuracy over all datasets (last column of Fig. 7), where the nominal and (cid:96)∞-robust models have similar positive weight. How many images does it take to find a good soup? To identify the practical limit of supervision for soup selection, we study the effect of varying the number of labelled images 7 -0.4-0.20.00.20.40.60.81.01.21.4IN -> nominal -> 2 -> 1IN-RealIN-V2IN-AIN-RIN-SketchConflict StimuliIN-Call 5.2. A closer look at IMAGENET-C While our experiments have considered IMAGENET-C as a single dataset, it consists of 15 corruptions types, each with 5 severity levels. As the various corruptions have dif- ferent characteristics, one might expect the best soup to vary across them. In Fig. 9 we plot the composition of the top- 5 soups for each severity level for two corruption types (as done in Fig. 7 ). The weights of the individual classifiers significantly change across distribution shifts: for both cor- ruption types, increasing the severity (making perturbations stronger) leads to a reduction in the nominal weight in favor of a robust weight. However, in the case of "pixelate" the soups concentrate on the (cid:96)1-robust network, while for "jpeg compression" this happens for (cid:96)∞. Similar visualization for the remaining IMAGENET-C subsets are found in Fig. 11 of the Appendix. This highlights the importance of inter- polating models with different types of robustness, and im- plies that considering each corruption type (including sever- ity levels) as independent datasets could further improve the performance of the soups on IMAGENET-C. 6. Discussion and Limitations Merging models with different types of robustness en- ables strong control of classifier performance by tuning only a few soup weights. Soups can find models which perform well even on distributions unseen during training (e.g. the IMAGENET variants). Moreover, our framework avoids co- training on multiple threats: this makes it possible to fine- tune models with additional attacks as they present them- selves, and enrich the soups with them. At the moment, our soups contain only nominal or (cid:96)p- robust models, but expanding the diversity of models might aid adaptation to new datasets. We selected our soups with few-shot supervision, but other settings could potentially use soups, such as unsupervised domain adaptation [34,38], on labeled clean and unlabeled shifted data, and test-time adaptation [39,40,43], on unlabeled examples alone. More- over, in our evaluation we have constrained the soups to belong to a fixed grid, which might miss better models: fu- ture work could develop automatic schemes to optimize the soup weights, possibly with even fewer examples, or with- out labeled examples (as done for test-time adaptation of non-robust models). 7. Conclusion We show that combining the parameters of robust classi- fiers, without additional training, achieves a smooth trade- off of robustness in different (cid:96)p-threat models. This allows us to discover models which perform well on distribution shifts with only a limited number of examples of each shift. In these ways, model soups serve as a good starting point to efficiently adapt classifiers to changes in data distributions. Figure 8. Soup selection data efficiency: we vary the number of images for selecting the best performing soups on different datasets. For each case, we plot the average accuracy on a held-out test set, and its standard deviation over 50 trials. Figure 9. Soup compositions on IMAGENET-C: we plot the model-wise weights of the best soups across types and severities. used to select the best soup on a new dataset. For this analy- sis we randomly choose 500 images from the adaptation set used for the grid search to create a held-out test set. From the remaining images, we uniformly sample k elements, se- lect the soup which performs best on such k points, and then evaluate it on this test set. We repeat this procedure for k ∈ {10, 30, 100, 300, 500} for 50 times each with differ- ent random seeds. In Fig. 8 we plot the average accuracy on the held-out test set, with standard deviation, when vary- ing k: increasing the number of points above 100 achieves high test accuracy with limited variance. This suggests that soup selection, and thus model adaptation, can be carried out with as few as 100 examples of the new distribution. 8 10301003005000.720.740.760.780.80accuracyImageNet10301003005000.3000.3250.3500.3750.4000.425ImageNet-A1030100300500# available images0.340.360.380.40accuracyImageNet-Sketch1030100300780# available images0.620.640.660.68Conflict Stimuli01pixelatesev.=1 -> nominal -> 2 -> 1sev.=2sev.=3sev.=4sev.=501jpeg_compression References [1] Lucas Beyer, Olivier J. H ́enaff, Alexander Kolesnikov, Xi- aohua Zhai, and A ̈aron van den Oord. Are we done with ImageNet? arXiv preprint arXiv:2006.07159, 2020. 6 [2] Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nel- son, Nedim Srndic, Pavel Laskov, Giorgio Giacinto, and Fabio Roli. Evasion Attacks against Machine Learning at Test Time. arXiv preprint arXiv:1708.06131, 2013. 1 [3] Dan A. Calian, Florian Stimberg, Olivia Wiles, Sylvestre- Alvise Rebuffi, Andras Gyorgy, Timothy Mann, and Sven Gowal. Defending Against Image Corruptions Through Ad- versarial Augmentations. arXiv preprint arXiv:2104.01086, 2021. 1 [4] Francesco Croce and Matthias Hein. Reliable evalua- tion of adversarial robustness with an ensemble of diverse parameter-free attacks. arXiv preprint arXiv:2003.01690, 2020. 3, 11 [5] Francesco Croce and Matthias Hein. Mind the box: $l 1$- APGD for sparse adversarial attacks on image classifiers. arXiv preprint arXiv:2103.01208, 2021. 3 [6] Francesco Croce and Matthias Hein. Adversarial robustness against multiple and single lp-threat models via quick fine- tuning of robust classifiers. In Proceedings of the 39th In- ternational Conference on Machine Learning, pages 4436– 4454, 2022. 1, 2, 3, 4, 11 [7] Ekin D. Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V. Le. Randaugment: Practical automated data augmentation with a reduced search space. In CVPR, 2020. 11 [8] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Syl- vain Gelly, Jakob Uszkoreit, and Neil Houlsby. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv preprint arXiv:2010.11929, 2020. 4 [9] N Benjamin Erichson, Soon Hoe Lim, Francisco Utrera, Winnie Xu, Ziang Cao, and Michael W Mahoney. NoisyMix: Boosting Robustness by Combining Data Augmentations, arXiv preprint Stability Training, and Noise Injections. arXiv:2202.01263, 2022. 1 [10] Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A Wichmann, and Wieland Brendel. ImageNet-trained CNNs are biased towards texture; increas- ing shape bias improves accuracy and robustness. In Inter- national Conference on Learning Representations, 2018. 6 [11] Robert Geirhos, Carlos RM Temme, Jonas Rauber, Heiko H Sch ̈utt, Matthias Bethge, and Felix A Wichmann. Generali- sation in humans and deep neural networks. In Advances in Neural Information Processing Systems, pages 7538–7550, 2018. 1 [12] Sven Gowal, Chongli Qin, Jonathan Uesato, Timothy Mann, and Pushmeet Kohli. Uncovering the Limits of Adversar- ial Training against Norm-Bounded Adversarial Examples. arXiv preprint arXiv:2010.03593, 2020. 2 [13] Sven Gowal, Sylvestre-Alvise Rebuffi, Olivia Wiles, Flo- rian Stimberg, Dan Andrei Calian, and Timothy Mann. Im- proving Robustness using Generated Data. arXiv preprint arXiv:2110.09468, 2021. 1 [14] Priya Goyal, Piotr Doll ́ar, Ross Girshick, Pieter Noord- huis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large mini- arXiv preprint batch sgd: Training imagenet in 1 hour. arXiv:1706.02677, 2017. 11 [15] Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Pi- otr Doll ́ar, and Ross Girshick. Masked Autoencoders Are Scalable Vision Learners. arXiv preprint arXiv:2111.06377, 2021. 2, 6, 11 [16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CVPR, 2016. 1, 4 [17] Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kada- vath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, Dawn Song, Jacob Steinhardt, and Justin Gilmer. The Many Faces of Robustness: A Crit- ical Analysis of Out-of-Distribution Generalization. arXiv preprint arXiv:2006.16241, 2020. 6 [18] Dan Hendrycks and Thomas Dietterich. Benchmarking Neu- ral Network Robustness to Common Corruptions and Pertur- bations. In International Conference on Learning Represen- tations, 2018. 1, 2, 5, 6 [19] Dan Hendrycks, Norman Mu, Ekin D. Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. AugMix: A Simple Data Processing Method to Improve Robustness and Uncertainty. arXiv preprint arXiv:1912.02781, 2019. 1 [20] Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Stein- hardt, and Dawn Song. Natural adversarial examples. arXiv preprint arXiv:1907.07174, 2019. 6 [21] Charles Herrmann, Kyle Sargent, Lu Jiang, Ramin Zabih, Huiwen Chang, Ce Liu, Dilip Krishnan, and Deqing Sun. Pyramid Adversarial Training Improves ViT Performance. arXiv preprint arXiv:2111.15121, 2021. 1, 2, 6 [22] Gao Huang, Yixuan Li, Geoff Pleiss, Zhuang Liu, John E Hopcroft, and Kilian Q Weinberger. Snapshot ensembles: Train 1, get m for free. In ICLR, 2017. 2 [23] Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kil- ian Q Weinberger. Deep networks with stochastic depth. In European conference on computer vision, pages 646–661. Springer, 2016. 11 [24] Gabriel Ilharco, Mitchell Wortsman, Samir Yitzhak Gadre, Shuran Song, Hannaneh Hajishirzi, Simon Kornblith, Ali Farhadi, and Ludwig Schmidt. Patching open- vocabulary models by interpolating weights. arXiv preprint arXiv:2208.05592, 2022. 2 [25] Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Averaging Weights Leads to Wider Optima and Better Generalization. arXiv preprint arXiv:1803.05407, 2018. 2 [26] Daniel Kang, Yi Sun, Dan Hendrycks, Tom Brown, and Ja- cob Steinhardt. Testing Robustness Against Unforeseen Ad- versaries. arXiv preprint arXiv:1908.08016, 2019. 1 [27] Klim Kireev, Maksym Andriushchenko, and Nicolas Flam- marion. On the effectiveness of adversarial training against arXiv preprint arXiv:2103.02325, common corruptions. 2021. 1, 2, 5 9 by entropy minimization. Learning Representations, 2021. 8 In International Conference on [44] Haohan Wang, Songwei Ge, Zachary Lipton, and Eric P Xing. Learning robust global representations by penalizing local predictive power. In Advances in Neural Information Processing Systems, pages 10506–10518, 2019. 6 [45] Ross Wightman. https : / / github . com / rwightman / pytorch - image - models, 2019. 11 Pytorch image models. [46] Mitchell Wortsman, Gabriel Ilharco, Samir Yitzhak Gadre, Rebecca Roelofs, Raphael Gontijo-Lopes, Ari S. Morcos, Hongseok Namkoong, Ali Farhadi, Yair Carmon, Simon Kornblith, and Ludwig Schmidt. Model soups: averag- ing weights of multiple fine-tuned models improves ac- curacy without increasing inference time. arXiv preprint arXiv:2203.05482, 2022. 1, 2, 3 [47] Cihang Xie, Mingxing Tan, Boqing Gong, Jiang Wang, Alan Yuille, and Quoc V Le. Adversarial Examples Improve Im- age Recognition. arXiv preprint arXiv:1911.09665, 2019. 1, 2, 6 [48] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regu- larization strategy to train strong classifiers with localizable features. In ICCV, 2019. 11 [49] Sergey Zagoruyko and Nikos Komodakis. Wide residual net- works. arXiv preprint arXiv:1605.07146, 2016. 4 [50] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimiza- tion. In ICLR, 2018. 11 [51] Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P. Xing, Laurent El Ghaoui, and Michael I. Jordan. Theoreti- cally Principled Trade-off between Robustness and Accu- racy. arXiv preprint arXiv:1901.08573, 2019. 1 [28] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural net- In Advances in neural information processing sys- works. tems, pages 1097–1105, 2012. 1 [29] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017. 11 [30] Divyam Madaan, Jinwoo Shin, and Sung Ju Hwang. Learn- ing to generate noise for multi-attack robustness. In Interna- tional Conference on Machine Learning, pages 7279–7289. PMLR, 2021. 1, 2, 4 [31] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learn- ing models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017. 1, 2, 6 [32] Pratyush Maini, Eric Wong, and J. Zico Kolter. Adversar- ial Robustness Against the Union of Multiple Perturbation Models. arXiv preprint arXiv:1909.04068, 2019. 1, 2, 3 [33] Shuaicheng Niu, Jiaxiang Wu, Yifan Zhang, Yaofo Chen, Shijian Zheng, Peilin Zhao, and Mingkui Tan. Efficient test- time model adaptation without forgetting. In ICML, 2022. 6 [34] Joaquin Quinonero-Candela, Masashi Sugiyama, Anton Schwaighofer, and Neil D Lawrence. Dataset shift in ma- chine learning. 2009. 1, 8 [35] Sylvestre-Alvise Rebuffi, Sven Gowal, Dan A. Calian, Flo- rian Stimberg, Olivia Wiles, and Timothy Mann. Data arXiv preprint Augmentation Can Improve Robustness. arXiv:2111.05328, 2021. 1, 2 [36] Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do ImageNet Classifiers Generalize to ImageNet? arXiv preprint arXiv:1902.10811, 2019. 1, 6 [37] Leslie Rice, Eric Wong, and J. Zico Kolter. Overfit- ting in adversarially robust deep learning. arXiv preprint arXiv:2002.11569, 2020. 11 [38] Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Dar- rell. Adapting visual category models to new domains. In European conference on computer vision, pages 213–226. Springer, 2010. 8 [39] Steffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bring- mann, Wieland Brendel, and Matthias Bethge. Improving robustness against common corruptions by covariate shift adaptation. Advances in Neural Information Processing Sys- tems, 33:11539–11551, 2020. 8 [40] Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei Efros, and Moritz Hardt. Test-time training with self- In supervision for generalization under distribution shifts. International conference on machine learning, pages 9229– 9248. PMLR, 2020. 8 [41] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. arXiv preprint Intriguing properties of neural networks. arXiv:1312.6199, 2013. 1 [42] Florian Tram`er and Dan Boneh. Adversarial Training and Robustness for Multiple Perturbations. In Advances in Neu- ral Information Processing Systems. 2019. 1, 2, 3, 4 [43] Dequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno Ol- shausen, and Trevor Darrell. Tent: Fully test-time adaptation 10 A. Experimental details A.1. Training setup. CIFAR-10. We train robust models from random initial- ization for 200 epochs with SGD with momentum as op- timizer, an initial learning rate of 0.1 (reduced 10 times at epochs 100 and 150), and a batch size of 128. For fine- tuning, we train for 10 epochs with cosine schedule for the learning rate, with peak value of 0.1 (we only use 0.5 for fine-tuning the model trained w.r.t. (cid:96)1 to the (cid:96)2-threat model) and linear ramp-up in the first 1/10 of training steps. We generate adversarial perturbations by AUTOPGD with 10 steps. We select checkpoints according to robustness on a validation set as suggested by [37]. IMAGENET. We follow the setup of [15]: for full train- ing, we use 300 epochs, AdamW optimizer [29] with mo- menta β1 = 0.9, β2 = 0.95, weight decay of 0.3 and a cosine learning rate decay with base learning rate 10−4 (scale as in [14]) and linear ramp-up of 20 epochs, batch size of 4096, label smoothing of 0.1, stochastic depth [23] with base value 0.1 and with a dropping probability linearly increasing with depth. As data augmentation, we use ran- dom crops resized to 224 × 224 images, mixup [50], Cut- Mix [48] and RandAugment [7] with two layers, magnitude 9 and a random probability of 0.5. We note that our im- plementation of RandAugment is based on the version in the timm library [45]. For VIT architectures, we adopt exponential moving average with momentum 0.9999. For fine-tuning we keep the same hyperparameters except for reducing the base learning rate from 10−4 to 10−5 since this leads to better performance in the target threat model. For adversarial training we use AUTOPGD on the KL di- vergence loss with 2 steps for (cid:96)∞- and (cid:96)2-norm bounded attacks, 20 steps for (cid:96)1 (as it is a more challenging threat model for optimization [6]). Baselines. For MAX and SAT, we fine-tune the singly- robust models with the same scheme above for the networks used in the model soups. We generate adversarial perturba- tions with the the same attacks, and use 10 and 1 epoch of fine-tuning in the case of CIFAR-10 and IMAGENET respec- tively. For the baselines in Table 1, we use the same scheme (except for technique-specific components which follow the original papers). For AdvProp we use dual normalization layers and train with random targeted attacks with bound (cid:15) = 4/255 on the (cid:96)∞-norm. A.2. Evaluation setup. Adversarial robustness. As default evaluation we use AUTOPGD with 40 steps and default parameters, with the DLR loss [4] for (cid:96)∞- and (cid:96)2-attacks, cross entropy for (cid:96)1. As a test against stronger attacks, for the evaluation of the robustness of the soups of three threat models on CIFAR-10 (Fig. 3 and Fig. 10) we increase the budget of AUTOPGD to 100 steps and 5 random restarts (in this case we use targeted DLR loss for (cid:96)∞ and (cid:96)2, and 1000 test points). Distribution shifts. For all IMAGENET variants we evaluate the classification accuracy on the entire dataset. B. Additional experiments B.1. Soups with three threat models We show in Fig. 10 the clean accuracy, robust accu- racy for each (cid:96)p-norm and their union of the soups obtained merging three classifiers. We use either a pre-trained clas- sifier robust w.r.t. (cid:96)2 (top row) or (cid:96)1 (bottom row) and fine- tune them to the remaining threat models. B.2. Model soups on IMAGENET variants We show additional results for model soups on IMA- GENET variants: first, in Table 2 we report the results on the full datasets of the second and third best soups according to the grid search on 1000 points for the shift (we also show the best soup from Table 1 in the main part). When selecting the best soup on average across datasets, all three classifiers have very close performance (59.46% to 59.48%), while the accuracy on the individual datasets may vary e.g. on IMAGENET-A and CONFLICT STIMULI. For the dataset- specific soups the results on the entire datasets respect the ranking given by the grid search (the three values are sim- ilar to each other), further suggesting that even a limited number of points can serve to tune a suitable soup. Second, we study the effect of varying the radii of the (cid:96)p-threat models used by the robust classifiers in the soups. In this case, we fine-tune for 1 epoch the original model ro- bust w.r.t. (cid:96)∞ at (cid:15) = 4/255 with adversarial training w.r.t. (cid:96)∞ at (cid:15)∞ ∈ {1/255, 2/255}, (cid:96)2 at (cid:15)2 ∈ {1, 2} ((cid:15)2 = 4 above), (cid:96)2 at (cid:15)1 ∈ {64, 128} ((cid:15)1 = 255 above). In this way we have three sets of four models to create soups, where the nominal one is fixed and the robust ones have radii (cid:15)p, (cid:15)p/2 and (cid:15)p/4 for p ∈ {∞, 2, 1}. Table 3 reports the results of the various sets of models: for the single soup optimized for average performance, the smaller (cid:15)p slightly reduce the performance. Looking at the individual datasets, in some cases like IMAGENET-V2 and IMAGENET-C using smaller values of (cid:15)p yields some improvements, but it also leads to severe drops on the distribution shifts where having ro- bust models is more relevant like CONFLICT STIMULI and IMAGENET-R. This suggests that it might be useful to have the same (cid:96)p-norm but with different models robust w.r.t. radii in the set of the networks used for creating the soups. B.3. Composition of soups on IMAGENET-C In Fig. 11 we visualize the composition of the top-5 soups for each corruption type and severity level: one can observe that the weights of the four networks in the soups varies across IMAGENET subset. 11 soup: θ2→∞ + θ2 + θ2→1 soup: θ1→∞ + θ1→2 + θ1 Figure 10. Soups of three models on CIFAR-10: we fine-tune each model robust w.r.t. (cid:96)p for p ∈ {2, 1} (with WIDERESNET-28-10 architecture) to the other threat models for 10 epochs, and show clean accuracy (first column) and robust accuracy w.r.t. every threat model (second to fourth columns) and their union (last column) of the soups obtained as convex combinations of the three bases. SETUP # FP IMAGENET IN-REAL IN-V2 IN-A IN-R IN- SKETCH CONFLICT STIMULI IN-C MEAN Fixed grid search on 1000 images: best soups ×1 Single soup Dataset-specific soups ×1 82.49% 82.29% 87.85% 87.89% 71.99% 71.95% 34.31% 38.27% 53.84% 56.39% 39.84% 40.73% 38.52% 67.03% 66.82% 69.34% 59.46% (64.24%) Fixed grid search on 1000 images: second best soups ×1 Single soup Dataset-specific soups ×1 82.62% 82.49% 87.92% 87.84% 72.02% 71.94% 30.99% 37.60% 53.28% 56.42% 39.00% 40.76% 41.25% 66.95% 68.75% 69.32% 59.48% (64.16%) Fixed grid search on 1000 images: third best soups ×1 Single soup Dataset-specific soups ×1 82.67% 82.51% 87.86% 87.65% 72.11% 71.58% 34.25% 37.51% 53.18% 55.75% 39.52% 40.65% 38.52% 66.88% 67.60% 68.92% 59.46% (63.93%) Table 2. Top-k model soups for IMAGENET variants: we report the classification accuracy on the IMAGENET variants, of the 1st, 2nd and 3d best soups (single or dataset-specific) found by grid search on the interpolation weights with 1000 points for each dataset. SETUP # FP IMAGENET IN-REAL IN-V2 IN-A IN-R IN- SKETCH CONFLICT STIMULI IN-C MEAN Robust models with standard (cid:15)p ×1 Single soup Dataset-specific soups ×1 82.49% 82.29% 87.85% 87.89% 71.99% 71.95% 34.31% 38.27% 53.84% 56.39% 39.84% 40.73% 38.52% 67.03% 66.82% 69.34% 59.46% (64.24%) Robust models with (cid:15)p/2 ×1 Single soup Dataset-specific soups ×1 82.66% 81.85% 87.78% 87.47% 72.34% 72.34% 32.05% 36.25% 51.40% 53.80% 37.80% 39.32% 39.69% 62.19% 69.06% 69.44% 59.10% (62.83%) Robust models with (cid:15)p/4 ×1 Single soup Dataset-specific soups ×1 81.47% 82.68% 87.36% 87.72% 70.84% 72.21% 26.23% 35.61% 53.46% 54.00% 39.13% 39.79% 46.25% 59.22% 67.37% 69.49% 59.01% (62.59%) Table 3. Varying threat models: we report the classification accuracy on the IMAGENET variants of the best single and dataset-specific soups when using various radii (cid:15)p for fine-tuning the (cid:96)p-robust networks. The soups are selected via a fixed grid search on the interpolation weights with 1000 points for each dataset. 12 21clean accuracy21 robust accuracy212 robust accuracy211 robust accuracy21+2+1 robust accuracy899091923040506668707274204060203021clean accuracy21 robust accuracy212 robust accuracy211 robust accuracy21+2+1 robust accuracy8688903035404566687072203040502025303540 Figure 11. Best soups over IMAGENET-C subsets: we plot the composition of the top 5 soups found by the grid search for each corruption type and severity level. 13 01zoom_blursev.=1sev.=2sev.=3sev.=4sev.=501impulse_noise01shot_noise01contrast01glass_blur01defocus_blur01gaussian_noise01pixelate01elastic_transformsev.=1sev.=2sev.=3sev.=4sev.=501brightness01snow01fog01motion_blur01frost01jpeg_compression -> nominal -> 2 -> 1
http://arxiv.org/abs/2302.10160v2
2023-03-15T00:14:26
2023-02-20T18:46:12
Pseudo-Labeling for Kernel Ridge Regression under Covariate Shift
We develop and analyze a principled approach to kernel ridge regression under covariate shift. The goal is to learn a regression function with small mean squared error over a target distribution, based on unlabeled data from there and labeled data that may have a different feature distribution. We propose to split the labeled data into two subsets and conduct kernel ridge regression on them separately to obtain a collection of candidate models and an imputation model. We use the latter to fill the missing labels and then select the best candidate model accordingly. Our non-asymptotic excess risk bounds show that in quite general scenarios, our estimator adapts to the structure of the target distribution as well as the covariate shift. It achieves the minimax optimal error rate up to a logarithmic factor. The use of pseudo-labels in model selection does not have major negative impacts.
[ "Kaizheng Wang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10160v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10160v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ME", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ME", "cs.LG", "math.ST", "stat.ML", "stat.TH", "62J07, 62G05" ]
3 2 0 2 r a M 5 1 ] E M . t a t s [ 2 v 0 6 1 0 1 . 2 0 3 2 : v i X r a Pseudo-Labeling for Kernel Ridge Regression under Covariate Shift Kaizheng Wang∗ This version: March 2023 Abstract We develop and analyze a principled approach to kernel ridge regression under covariate shift. The goal is to learn a regression function with small mean squared error over a target distribution, based on unlabeled data from there and labeled data that may have a different feature distribution. We propose to split the labeled data into two subsets and conduct kernel ridge regression on them separately to obtain a collection of candidate models and an imputation model. We use the latter to fill the missing labels and then select the best candidate model accordingly. Our non-asymptotic excess risk bounds show that in quite general scenarios, our estimator adapts to the structure of the target distribution as well as the covariate shift. It achieves the minimax optimal error rate up to a logarithmic factor. The use of pseudo-labels in model selection does not have major negative impacts. Keywords: Covariate shift, kernel ridge regression, imputation, pseudo-labeling, transfer learning. 1 Introduction Covariate shift is a phenomenon that occurs when the feature distribution of the test data differs from that of the training data. It can cause performance degradation of the model, as the training samples may have poor coverage of challenging cases to be encountered during deployment. Such issue arises from a variety of scientific and engineering applications (Heckman, 1979; Zadrozny, 2004; Sugiyama and Kawanabe, 2012). For instance, a common task in personalized medicine is to predict the treatment effect of a medicine given a patient's covariates. However, the labeled data are oftentimes collected from particular clinical trials or observational studies, which may not be representative of the population of interest. Direct uses of traditional supervised learning techniques, such as empirical risk minimization and cross-validation, could yield sub-optimal results. Indeed, their theories are mostly built upon the homogeneity assumption that the training and test data share the same distribution (Vapnik, 1999). Acquisition of labeled data from the target population can be costly or even infeasible. In the above example of personalized medicine, it requires conducting new clinical trials. On the other hand, unlabeled data are cheaply available. This leads to the following fundamental question that motivates our study: How to train a predictive model using only unlabeled data from the distribution of interest and labeled data from a relevant distribution? ∗Department of IEOR and Data Science Institute, Columbia University. Email: [email protected]. 1 It is a major topic in domain adaptation and transfer learning (Pan and Yang, 2010; Sugiyama and Kawanabe, 2012), where the distribution of interest is called the target and the other one is called the source. The missing labels in the target data create a significant obstacle for model assessment and selection, calling for principled approaches without ad hoc tuning. In this paper, we provide a solution to the above problem in the context of Our contributions kernel ridge regression (KRR). We work under the standard assumption of covariate shift that the source and the target share the same conditional label distribution. In addition, the conditional expectation of the label given covariates is described by a function that belongs to a reproducing kernel Hilbert space (RKHS). The goal is to learn the regression function with small mean squared error over the target distribution. While KRR is a natural choice, its performance depends on a penalty parameter that is usually selected by hold-out validation or cross-validation. Neither of them is directly applicable without labels. We propose to fill the missing labels using an imputation model trained on part of the source data. Meanwhile, we train a collection of candidate models on the rest of the source data. All models are trained by KRR with different penalty parameters. Finally, we select the best candidate model using the pseudo-labels. Our approach is conceptually simple and computationally efficient. By generating pseudo-labels, it reduces the original problem to KRR with hold-out validation. However, we seem to be in a chicken and egg situation. One the one hand, quality output requires a good imputation model. On the other hand, if we already know how to obtain a good imputation model using KRR, why not directly train the final model? We resolve this dilemma by showing that the overhead incurred by pseudo- labels can be significantly smaller than their mean squared error. The theory provides a simple choice of the penalty parameter for training a rudimentary imputation model whose inaccuracy has negligible impact on the selected model. In many common scenarios, our estimator is minimax optimal up to a logarithmic factor and adapts to the unknown covariate shift. At the heart of our analysis is a bias-variance decomposition of the imputation model's impact on model selection, which is different from the usual bias-variance decomposition of the mean squared error. It shows that pseudo-labels with large mean squared error may still be useful for model selection purposes. Related work Here we give a non-exhaustive review of related work in the literature. As we mentioned above, our final estimator is selected by hold-out validation with pseudo-labels. Simple as it is, hold-out validation is one of the go-to methods for model selection in supervised learning. When there is no covariate shift, Blanchard and Massart (2006) proved that the selected model adapts to the unknown noise condition in many classification and regression problems. Caponnetto and Yao (2010) showed that KRR tuned by hold-out validation achieves the minimax optimal error rate. Our study further reveals that faithful model selection is possible even if the validation labels are synthetic and the imputation model is trained on a different distribution. Filling the missing labels by a trained model is referred to as pseudo-labeling (Lee, 2013), which successfully reduces the labeling cost. It belongs to the family of imputation methods for missing data analysis and causal inference in statistics (Little and Rubin, 2019). There has been a line of recent work (Hirshberg et al., 2019; Kallus, 2020; Hirshberg and Wager, 2021; Mou et al., 2022, 2023) applying the idea to average treatment effect estimation, which amounts to estimating the mean response (label) over the target distribution in our setting. The focus is different from ours, as we aim to estimate the whole function and need to select the model using the imputed data. A common technique for learning under covariate shift is propensity weighting (Little and Rubin, 2019). Note that the empirical risk defined by the source data is generally a biased estimate of the target population risk. A natural way of bias correction is to reweight the source data by 2 the likelihood ratio between the target covariate distribution and the source one. The reweighted empirical risk then serves as the objective function. The weights may be truncated so as to reduce the variance (Shimodaira, 2000; Cortes et al., 2010; Sugiyama and Kawanabe, 2012; Ma et al., 2022). Such methods need absolute continuity of the target distribution with respect to the source, as well as knowledge about the likelihood ratio. The former is a strong assumption, and the latter is notoriously hard to estimate in high dimensions. Matching methods came as a remedy (Huang et al., 2006). Yet, they require solving large optimization problems to obtain the importance weights. Moreover, theoretical understanding of the resulting model is largely lacking. There is a recent surge of interest in the theory of transfer learning under distribution shift. Most works focus on the value of source data, assuming either the target data are labeled, or the target covariate distribution is known (Ben-David et al., 2010; Hanneke and Kpotufe, 2019; Mousavi Kalan et al., 2020; Yang et al., 2020; Kpotufe and Martinet, 2021; Cai and Wei, 2021; Reeve et al., 2021; Tripuraneni et al., 2021; Maity et al., 2022; Schmidt-Hieber and Zamolodtchikov, 2022; Pathak et al., 2022; Wu et al., 2022). When there are only finitely many unlabeled target samples, one needs to extract information about the covariate shift and incorporate that into learning. Liu et al. (2020) studied doubly-robust regression under covariate shift. Lei et al. (2021) obtained results for ridge regression in a Bayesian setting. Ma et al. (2022) conducted an in-depth analysis of regression in an RKHS when the target covariate distribution and the source one have bounded likelihood ratio or finite χ2 divergence. In the former case, KRR with a properly chosen penalty was shown to be minimax optimal up to a logarithmic factor. The optimal penalty depends on the upper bound on the likelihood ratio, which is hard to estimate using finite data. Under the same setup, our estimator enjoys the optimality guarantees without the need to know the amount of covariate shift. In the latter case, the authors proved the optimality of a reweighted version of KRR using truncated likelihood ratios. It would be interesting to develop an adaptive estimator for that setting. Outline The rest of the paper is organized as follows. Section 2 describes the problem of covariate shift and its challenges. Section 3 introduces the methodology. Section 4 presents excess risk bounds for our estimator and discuss its minimax optimality. Section 5 explains the power of pseudo- labeling. Section 6 provides the proofs of our main results. Finally, Section 7 concludes the paper and discusses possible future directions. Notation The constants c1, c2, C1, C2, * * * may differ from line to line. Define x+ = max{x, 0} for x ∈ R. We use the symbol [n] as a shorthand for {1, 2, * * * , n} and | * | to denote the absolute , value of a real number or cardinality of a set. For nonnegative sequences {an}∞ n=1 we write an (cid:46) bn or an = O(bn) or bn = Ω(an) if there exists a positive constant C such that an ≤ Cbn. In addition, we write an (cid:16) bn if an (cid:46) bn and bn (cid:46) an; an = o(bn) if an = O(cnbn) for some cn → 0. For a matrix A, we use (cid:107)A(cid:107)2 = sup(cid:107)x(cid:107)2=1 (cid:107)Ax(cid:107)2 to denote its spectral norm. For a bounded linear operator A between two Hilbert spaces H1 and H2, we define its operator norm (cid:107)A(cid:107) = sup(cid:107)u(cid:107)H1 =1 (cid:107)Au(cid:107)H2 . For a bounded, self-adjoint linear operator A mapping a Hilbert space H to itself, we write A (cid:23) 0 if (cid:104)u, Au(cid:105) ≥ 0 holds for all u ∈ H; in that case, we define (cid:107)u(cid:107)A = (cid:104)u, Au(cid:105). For any u and v in a Hilbert space H, their tensor product u ⊗ v is a linear operator from H to itself that maps any w ∈ H to (cid:104)v, w(cid:105)u. Define (cid:107)X(cid:107)ψ2 = supp≥1{p−1/2E1/p|X|p} and (cid:107)X(cid:107)ψ1 = supp≥1{p−1E1/p|X|p} for a random variable X. If X is a random element in a separable Hilbert space H, then we let (cid:107)X(cid:107)ψ2 = sup(cid:107)u(cid:107)H=1 (cid:107)(cid:104)u, X(cid:105)(cid:107)ψ2 and {bn}∞ n=1 . 3 2 Problem setup 2.1 Linear model and covariate shift i=1 i=1 and {x0i}n0 i=1 and {(x0i, y0i)}n0 i=1 Let {(xi, yi)}n be two datasets named the source and the target, respectively. Here xi, x0i ∈ X are covariate vectors in some feature space X ; yi, y0i ∈ R are responses. How- ever, the target responses {y0i}n0 are unobserved. The goal is to learn a predictive model from i=1 {(xi, yi)}n that works well on the target data. The task is impossible when the source and the target datasets are arbitrarily unrelated. To make the problem well-posed, we adopt a standard assumption that the source and the target datasets share a common regression model. In our basic setup, the feature space X is a finite- dimensional Euclidean space Rd, the data are random samples from an unknown distribution, and the conditional mean response is a linear function of the covariates. Below is the formal statement. Assumption 2.1 (Common linear model and random designs). The datasets {(xi, yi)}n {(x0i, y0i)}n0 • The distributions of covariates xi and x0i are P and Q, respectively. Furthermore, Σ = E(xix(cid:62) i ) i=1 are independent, each of which consists of i.i.d. samples. i=1 and and Σ0 = E(x0ix(cid:62) 0i) exist. • There exists θ(cid:63) ∈ Rd such that E(yi|xi) = (cid:104)xi, θ(cid:63)(cid:105) and E(y0i|x0i) = (cid:104)x0i, θ(cid:63)(cid:105). • Let εi = yi − (cid:104)xi, θ(cid:63)(cid:105) and ε0i = y0i − (cid:104)x0i, θ(cid:63)(cid:105). Conditioned on {xi}n i=1 have finite second moments. i=1 and {ε0i}n0 {εi}n i=1 and {x0i}n0 i=1, the errors More generally, we will study linear model in a reproducing kernel Hilbert space (RKHS) with possibly infinite dimensions. The feature space X can be any set. Suppose that we have a symmetric, positive semi-definite kernel K : X × X → R satisfying the conditions below: • (Symmetry) For any z ∈ X and w ∈ X , K(z, w) = K(w, z); • (Positive semi-definiteness) For any m ∈ Z+ and {zi}m i=1 ⊆ X , the m × m matrix [K(zi, zj)]m×m is positive semi-definite. According to the Moore-Aronszajn Theorem (Aronszajn, 1950), there exists a Hilbert space H with inner product (cid:104)*, *(cid:105) and a mapping φ : X → H such that K(z, w) = (cid:104)φ(z), φ(w)(cid:105), ∀z, w ∈ X . The kernel function K and the associated space H are called a reproducing kernel and a reproducing kernel Hilbert space, respectively. Now, we upgrade Assumption 2.1 to the RKHS setting. Assumption 2.2 (Common linear model in RKHS and random designs). The datasets {(xi, yi)}n and {(x0i, y0i)}n0 • The distributions of covariates xi and x0i are P and Q, respectively. Furthermore, Σ = E[φ(xi)⊗ i=1 are independent, each of which consists of i.i.d. samples. i=1 φ(xi)] and Σ0 = E[φ(x0i) ⊗ φ(x0i)] are trace class. • There exists θ(cid:63) ∈ H such that E(yi|xi) = (cid:104)φ(xi), θ(cid:63)(cid:105) and E(y0i|x0i) = (cid:104)φ(x0i), θ(cid:63)(cid:105). • Let εi = yi − (cid:104)φ(xi), θ(cid:63)(cid:105) and ε0i = y0i − (cid:104)φ(x0i), θ(cid:63)(cid:105). Conditioned on {xi}n i=1 and {x0i}n0 i=1, the errors {εi}n i=1 and {ε0i}n0 i=1 have finite second moments. Under Assumption 2.2, the conditional mean function of the response f (cid:63)(*) = (cid:104)φ(*), θ(cid:63)(cid:105) belongs to a function class (cid:26) F = fθ : X → R (cid:12) (cid:12) (cid:12) (cid:12) fθ(x) = (cid:104)φ(x), θ(cid:105) for some θ ∈ H (cid:27) 4 generated by the reproducing kernel K. Define (cid:107)fθ(cid:107)F = (cid:107)θ(cid:107)H. It is easily seen that (cid:107) * (cid:107)F is a norm and F becomes a Hilbert space that is isomorphic to H. Below are a few common examples (Wainwright, 2019). Example 2.1 (Linear and affine kernels). Let X = Rd. The linear kernel K(z, w) = z(cid:62)w gives the standard inner product. In that case, H = Rd, φ(x) = x is the identity map, and F is the class of all linear functions (without intercepts). An extension is the affine kernel K(z, w) = 1 + z(cid:62)w that generates all affine functions (with intercepts). Example 2.2 (Polynomial kernels). Let X = Rd. The homogeneous polynomial kernel of degree m ≥ 2 is K(z, w) = (z(cid:62)w)m for some integer m ≥ 2. The corresponding H is the Euclidean space of dimension (cid:0)m+d−1 (cid:1), the coordinates of φ are degree-m monomials, and F is the class of all homogeneous polynomials of degree m. An extension is the inhomogeneous polynomial kernel K(z, w) = (1 + z(cid:62)w)m that generates all polynomials of degree m or less. m Example 2.3 (Laplace and Gaussian kernels). Let X = Rd and α > 0. The Laplace and Gaussian kernels are K(z, w) = e−α(cid:107)z−w(cid:107)2 and K(z, w) = e−α(cid:107)z−w(cid:107)2 2, respectively. In either case, F is infinite-dimensional. Example 2.4 (First-order Sobolev kernel). Let X = [0, 1] and K(z, w) = min{z, w}. Then, F is the first-order Sobolev space (cid:26) F = f : [0, 1] → R (cid:12) (cid:12) (cid:12) (cid:12) f (0) = 0, |f (cid:48)(x)|2dx < ∞ (cid:27) . (cid:90) 1 0 Any f ∈ F is absolutely continuous on [0, 1] with square integrable derivative function. The function spaces are finite-dimensional in Examples 2.1 and 2.2, and infinite-dimensional in the others. For any f ∈ F serving as a predictive model, we measure its risk by the out-of-sample mean squared prediction error on the target population: R(f ) = E[f (xnew) − ynew]2, where (xnew, ynew) is a new sample drawn from the target distribution. Under Assumption 2.2, f (cid:63) is a minimizer of the functional R(*), and R(f ) − R(f (cid:63)) = Ex∼Q|f (x) − f (cid:63)(x)|2. In words, the excess risk is equal to the mean squared estimation error over the distribution Q. We emphasize that neither P nor Q is known to us, and we merely have a finite number of samples. The difference between P and Q is called the covariate shift. Below we explain why it brings challenges to learning in high dimensions. 2.2 Ridge regression and new challenges Consider a finite-dimensional linear model (Assumption 2.1). When span{xi}n least squares (OLS) regression i=1 = Rd, the ordinary min θ∈Rd (cid:26) 1 n n (cid:88) i=1 ((cid:104)xi, θ(cid:105) − yi)2 (cid:27) 5 has a unique solution, and it is an unbiased estimate of θ(cid:63). When span{xi}n of Rd (e.g., if d > n), a popular approach is ridge regression (Hoerl and Kennard, 1970) i=1 is a proper subspace min θ∈Rd (cid:26) 1 n n (cid:88) i=1 ((cid:104)xi, θ(cid:105) − yi)2 + λ(cid:107)θ(cid:107)2 2 (cid:27) . (2.1) The tuning parameter λ > 0 ensures the uniqueness of solution and enhances its noise stability. Ridge regression is suitable if we have prior knowledge that (cid:107)θ(cid:63)(cid:107)2 is not too large. An extension to the RKHS setting (Assumption 2.2) is kernel ridge regression (KRR) min f ∈F (cid:26) 1 n n (cid:88) i=1 [f (xi) − yi]2 + λ(cid:107)f (cid:107)2 F (cid:27) , (2.2) which reduces to the ridge regression (2.1) when X = Rd and K is the linear kernel in Exam- ple 2.1. Although F may have infinite dimensions in general, it was shown (Wahba, 1990) that the optimal solution to (2.2) has a finite-dimensional representation (cid:98)f (*) = (cid:80)n i=1 (cid:98)αiK(xi, *), with (cid:98)α = ((cid:98)α1, * * * , (cid:98)αn)(cid:62) being the unique solution to the quadratic program (cid:26) 1 n min α∈Rn (cid:107)Kα − y(cid:107)2 2 + λα(cid:62)Kα (cid:27) , with K = [K(xi, xj)]n×n and y = (y1, * * * , yn)(cid:62). For both ridge regression (2.1) and its kernelized version (2.2), choosing a large λ shrinks the variance but inflates the bias. Quality outputs hinge on a balance between the above two effects. In practice, tuning is often based on risk estimation using hold-out validation, cross-validation, and so on. For instance, suppose that we have a finite set Λ of candidate tuning parameters. Each λ ∈ Λ is associated with a candidate model (cid:98)fλ ∈ F that solves the program (2.2). If the responses {y0i}n0 in the target data were observed, we could estimate the out-of-sample risk of every (cid:98)fλ by i=1 its empirical version 1 n0 n0(cid:88) i=1 [ (cid:98)fλ(x0i) − y0i]2, and then select the one with the smallest empirical risk. Unfortunately, the missing responses in the target data create a visible obstacle. Although the source data are labeled, they are not representative for the target distribution in the presence of covariate shift. The tuning parameter with the best predictive performance on the source could be sub-optimal for the target. We need a reliable estimate of the target risk. This is no easy task in general. Another issue is that even if a risk estimate is available, it is still not clear whether training on the source and tuning on the target is good enough. Theoretical studies also shed lights on the impact of covariate shift. Below is one example. Example 2.5. Consider the Sobolev space in Example 2.4, which has (cid:107)f (cid:107)F = P be the uniform distribution over [0, 1]. Assume that the errors {εi}n i=1 are i.i.d. N (0, σ2). (cid:113)(cid:82) 1 0 |f (cid:48)(x)|2dx. Let • If Q = P , then the minimax optimal rate of the prediction error over the ball {f : (cid:107)f (cid:107)F ≤ R} is R2n )2/3 (Wainwright, 2019). achieved by KRR (2.2) with λ (cid:16) ( σ2 6 • If Q is the pointmass at some x0 ∈ [0, 1], i.e. we only want to predict the response at a single point, then KRR (2.2) with λ = σ2 R2n achieves the smallest worst-case risk among estimators that are linear in y (Speckman, 1979; Li, 1982). It is minimax optimal up to a factor of 5/4 over all estimators (Donoho, 1994). This example shows the dependence of optimal tuning on the target data. When Q is spread out, we have to estimate the whole function, need a large λ to supress the variance, and can afford a fair amount of bias. When Q is concentrated, we are faced with a different bias-variance trade-off. An ideal method should automatically adapt to the structures of P and Q. In the next section, we will present a simple approach to tackle the aforementioned challenges. 3 Methodology We consider the problem of kernel ridge regression under covariate shift (Assumption 2.2). As the most prominent issue is the lack of target labels, we develop a regression imputation method to generate synthetic labels. The idea is to estimate the true regression function using part of the source data and then feed the obtained imputation model with the unlabeled target data. This is called pseudo-labeling in the machine learning literature (Lee, 2013). Below is a complete description of our proposed approach: 1. (Data splitting) Choose some ρ ∈ (0, 1) and randomly partition the source dataset {(xi, yi)}n i=1 into two disjoint subsets D1 and D2 of sizes (cid:100)(1 − ρ)n(cid:101) and (cid:98)ρn(cid:99), respectively. 2. (Training) Choose a finite collection of penalty parameters Λ ⊆ (0, +∞) and (cid:101)λ > 0. Run kernel ridge regression on D1 to get candidate models { (cid:98)fλ}λ∈Λ, where (cid:26) 1 |D1| |f (x) − y|2 + λ(cid:107)f (cid:107)2 F (cid:98)fλ = argmin (cid:88) f ∈F (x,y)∈D1 (cid:27) , ∀λ ∈ Λ. Run kernel ridge regression on D2 to get an imputation model (cid:101)f = argmin f ∈F (cid:26) 1 |D2| (cid:88) (x,y)∈D2 |f (x) − y|2 + (cid:101)λ(cid:107)f (cid:107)2 F (cid:27) . 3. (Pseudo-labeling) Generate pseudo-labels (cid:101)y0i = (cid:101)f (x0i) for i ∈ [n0]. 4. (Model selection) Select any (cid:98)λ ∈ argmin λ∈Λ (cid:26) 1 n0 n0(cid:88) i=1 | (cid:98)fλ(x0i) − (cid:101)y0i|2 (cid:27) , (3.1) and output (cid:98)f = (cid:98)f (cid:98)λ as the final model. The first two steps are conducted on the source data only, summarizing the information into candidate models and an imputation model. After that, the raw source data will no longer be used. Given a set of unlabeled data from the target distribution, we generate pseudo-labels using the imputation model and then select the candidate model that best fits them. The method is computationally efficient because kernel ridge regression is easily solvable and the other operations (pseudo-labeling and model selection) run even faster. 7 The hyperparameters ρ, Λ and (cid:101)λ need to be specified by the user. The first two are standard and also arise in penalized regression without covariate shift. The last one is the crux because it affects the qualities of the imputation model (cid:101)f , the pseudo-labels {(cid:101)y0i}n0 , and thus the selected model (cid:98)f . In Section 4, we will provide practical guidance based on a theoretical study. Roughly speaking, i=1 • The fraction ρ is set to be a constant, such as 50%. • The set of penalty parameters Λ consists of a geometric sequence from O(n−1) to O(1) up to logarithmic factors, with O(log n) elements. The resulting candidate models span a wide spectrum from undersmoothed to oversmoothed ones. • The penalty parameter (cid:101)λ is set to be O(n−1) up to a logarithmic factor. In fact, the model selection accuracy depends on the bias and a variance proxy of the pseudo-label vector (cid:101)y = ((cid:101)y01, * * * , (cid:101)y0n0)(cid:62) in a delicate way. Choosing (cid:101)λ (cid:16) n−1 achieves a bias-variance tradeoff that minimizes the impact on model selection, rather than the usual one for minimizing the mean squared prediction error. To get ideas about why imperfect pseudo-labels may still lead to faithful model selection, imagine that the responses {y0i}n0 of the target data were observed. Then, we could estimate the risk of a i=1 candidate (cid:98)fλ by 1 i=1 | (cid:98)fλ(x0i) − y0i|2 and then perform model selection accordingly. While y0i n0 is a noisy version of f (cid:63)(x0i) with zero bias and non-vanishing variance σ2, such hold-out validation method works well in practice. (cid:80)n0 Ideally, we want to set the hyperparameters ρ, Λ and (cid:101)λ without seeing the target data. Once the latter become available, we want to output a model that adapts to the covariate shift and the structure of the target distribution. According to our theories in Section 4, this is indeed possible in many common scenarios. 4 Excess risk bounds and their optimalities This section is devoted to theoretical guarantees for our proposed method. We will present excess risk bounds for the final model and discuss its minimax optimalitiy. In particular, we will show that the excess risk of the final model is at most a small multiple of the best one achieved by candidates plus some small overhead. We study kernel ridge regression (2.2) in the RKHS setting (Assumption 2.2), which covers ridge regression (2.1) in the Euclidean setting (Assumption 2.1) as a special case. Our analysis is based upon mild regularity assumptions. On the one hand, the noise εi can be dependent on the covariates xi, but it needs to have sub-Gaussian tails when conditioned on the latter. Assumption 4.1 (Sub-Gaussian noise). Conditioned on xi, the noise variable εi is sub-Gaussian: {p−1/2E1/p(|εi|p|xi)} ≤ σ < ∞. sup p≥1 On the other hand, the covariates either have bounded norms or satisfy a strong version of the sub-Gaussianity assumption. Assumption 4.2 (Bounded covariates). (cid:107)φ(xi)(cid:107)H ≤ M and (cid:107)φ(x0i)(cid:107)H ≤ M hold almost surely for some M < ∞. Assumption 4.3 (Strongly sub-Gaussian covariates). There exists a constant κ ∈ [1, ∞) such that (cid:107)(cid:104)φ(xi), v(cid:105)(cid:107)2 ψ2 ≤ κE|(cid:104)φ(xi), v(cid:105)|2 and (cid:107)(cid:104)φ(x0i), v(cid:105)(cid:107)2 ψ2 ≤ κE|(cid:104)φ(x0i), v(cid:105)|2 hold for all v ∈ H. 8 Assumption 4.2 holds if the reproducing kernel K is uniformly bounded over the domain. This includes Examples 2.3 and 2.4, as well as Examples 2.1 and 2.2 with X being a compact subset of Rd. Assumption 4.3, also known as the ψ2 − L2 norm equivalence, is commonly used in high- dimensional statistics (Vershynin, 2010; Koltchinskii and Lounici, 2017). The constant κ is invariant under bounded linear transforms of φ(xi) and φ(x0i). Combined with Assumption 2.2, it implies that (cid:107)(cid:104)φ(xi), v(cid:105)(cid:107)2 ≤ κ(cid:107)Σ0(cid:107) * (cid:107)v(cid:107)2 ψ2 ≤ κ(cid:104)v, Σv(cid:105) ≤ κ(cid:107)Σ(cid:107) * (cid:107)v(cid:107)2 H H. Therefore, both φ(xi) and φ(x0i) are sub-Gaussian. and similarly, (cid:107)(cid:104)φ(x0i), v(cid:105)(cid:107)2 ψ2 In the Euclidean case (Example 2.1) with X = H = Rd and φ(x) = x, Assumption 4.3 is equivalent to (cid:107)(Σ†)1/2xi(cid:107)ψ2 ≤ κ and (cid:107)(Σ† 0)1/2x0i(cid:107)ψ2 ≤ κ, where the superscript † denotes the Moore-Penrose pseudoinverse. It holds when xi ∼ N (0, Σ) and x0i ∼ N (0, Σ0). We are ready to state our general results on the excess risk of the final model (cid:98)f . The proof is deferred to Section 6.2.3. Theorem 4.1 (Excess risk of the final model). Let Assumptions 2.2 and 4.1 hold. Choose any δ ∈ (0, 1/5]. Suppose that ρn is an integer, c ≥ 1 is a constant, 1/c ≤ n0/n ≤ c, Λ = {λ1, * * * , λm} satisfies 2 ≤ m ≤ nc, and 0 < λj < λj+1 ≤ βλj holds for all j ∈ [m − 1] and some β ≥ 1. For any λ > 0, define Sλ = (Σ + λI)−1/2Σ0(Σ + λI)−1/2, E(λ, δ) = λ(cid:107)Sλ(cid:107) * (cid:107)θ(cid:63)(cid:107)2 H + σ2 Tr(Sλ) log(m/δ) (1 − ρ)n , ξ((cid:101)λ, δ) = (cid:18) (cid:101)λ(cid:107)θ(cid:63)(cid:107)2 H + σ2 log(m/δ) ρn (cid:19) ((cid:107)S (cid:101)λ(cid:107) + 1). 1. Under Assumption 4.2, there exist constants C, C0 and C1 such that when (cid:101)λ ≥ CM 2 log(n/δ) ρn and λ1 ≥ CM 2 log(n/δ) (1−ρ)n , we have (cid:18) P R( (cid:98)f ) − R(f (cid:63)) ≤ C0β min λ1≤λ≤λm E(λ, δ) + C1ξ((cid:101)λ, δ) ≥ 1 − δ. (cid:19) (4.1) 2. Under Assumption 4.3, there exist constants C, C0 and C1 determined by κ such that when , n0 ≥ Cκ2 log(|Λ|/δ) and n0/ Tr(Σ0) ≥ n/ Tr(Σ), we , λ1 ≥ C Tr(Σ) log(1/δ) (cid:101)λ ≥ C Tr(Σ) log(1/δ) have the excess risk bound (4.1). ρn (1−ρ)n The matrix Sλ looks like a (regularized) ratio between the second-moment matrices of distri- butions Q and P , reflecting the impact of covariate shift on regression. For every λ ∈ [λ1, λm], the quantity E(λ, δ) is an upper bound (up to a constant factor) on the excess risk of (cid:98)fλ. Hence, minλ1≤λ≤λm E(λ, δ) controls the smallest error achieved by the models in { (cid:98)fλ}λ1≤λ≤λm . As we approximate the continuous index set [λ1, λm] by a discrete one Λ = {λ1, * * * , λm} satisfying 1 < λj+1/λj ≤ β, we lose a factor of β at most. On the other hand, ξ((cid:101)λ, δ) is an upper bound (up to a constant factor) on the error caused by model selection. It reflects the error of the imputation model (cid:101)f that produces the pseudo-labels. Therefore, the excess risk bound in Theorem 4.1 has the form of an oracle inequality. To facilitate interpretation, we present simpler bounds in Theorem 4.2 below based on additional regularity assumptions. See Appendix B for the proof. 9 Assumption 4.4. Suppose that n ≥ 2, Λ = {2kλ0 : k = 0, 1, * * * , (cid:100)log2 n(cid:101)}, ρ ∈ (0, 1) is bounded away from {0, 1}, ρn is an integer, and n0/n is bounded away from {0, ∞}. In addition, one of the followings is true for some constant c: 1. Assumption 4.2 holds, (cid:101)λ = cM 2 log(n/δ) and λ0 = cM 2 log(n/δ) . (1−ρ)n ρn 2. Assumption 4.3 holds, (cid:101)λ = c Tr(Σ) log(1/δ) ρn , λ0 = c Tr(Σ) log(1/δ) (1−ρ)n and cn0/ Tr(Σ0) ≥ n/ Tr(Σ). Theorem 4.2. Let Assumptions 2.2 and 4.1 hold, and Σ0 (cid:22) BΣ for some B ∈ [1, ∞). Denote by {μj}∞ j=1 the eigenvalues of Σ0 sorted in descending order, and define D(r) = min{j ≥ 1 : μj ≤ r2} for any r > 0. Assume that ∞ (cid:88) j=D(r)+1 μj ≤ c0D(r)r2, ∀r > 0 (4.2) holds for some universal constant c0. There exist constants C and C0 such that if Assumption 4.4 holds with c > C, we have the following bound with probability at least 1 − δ: R( (cid:98)f ) − R(f (cid:63)) ≤ C0 √ min √ Bλ0≤r≤ nBλ0 (cid:26) r2(cid:107)θ(cid:63)(cid:107)2 H + σ2B D(r) log( log n δ ) n (cid:27) . The error bound in Theorem 4.2 depends on the amount of covariate shift B and the spectrum of the second-moment matrix associated with the target covariate distribution Q. The two {μj}∞ j=1 terms r2(cid:107)θ(cid:63)(cid:107)2 δ ) correspond to the squared bias and variance. As r goes to zero, the bias shrinks but the variance grows. Now, we briefly explain the intuitions behind the regularity assumptions. H and n−1σ2BD(r) log( log n • The assumption Σ0 (cid:22) BΣ can be implied by the "bounded density ratio" assumption (Q (cid:28) P and dQ dP ≤ B) in the study of covariate shift (Cortes et al., 2010; Ma et al., 2022). Aside from that, Σ0 (cid:22) BΣ does not really require Q (cid:28) P . For instance, in the Euclidean setting (X = Rd and K(z, w) = z(cid:62)w), if Q = N (0, I) and P has independent marginals that are uniform over [−1, 1], then Σ = 1 3 Σ0. Intuitively, B−1 measures the strength of coverage of P over Q. An inspection of the proof shows that Theorem 4.2 continues to hold if Σ0 (cid:22) BΣ is relaxed to Σ0 (cid:22) B(Σ + αI) for some positive α (cid:46) Tr(Σ) . This allows the range of target covariates n to be partially covered by that of source covariates. With a positive α, we can always make Σ0 (cid:22) B(Σ + αI) hold by choosing a large B. 3 I = 1 • In the literature of kernel ridge regression, any spectrum {μj}∞ j=1 satisfying (4.2) is said to be regular (Wainwright, 2019). The condition holds for commonly studied examples. For every threshold r > 0, the quantity D(r) − 1 is the number of eigenvalues that are above r2. If {μj}∞ j=1 decays slowly, then D(r) grows fast as r goes to zero. On the other hand, the penalty parameters Λ and (cid:101)λ in Theorem 4.2 are chosen solely based on the sample size n, exceptional probability δ, and the norm bound M or Tr(Σ) for the source distribution. They do not require any knowledge about the target distribution. It is worth pointing out that the penalty parameter (cid:101)λ is not chosen to minimize the prediction error of the imputation model (cid:101)f . In fact, the optimal tuning for the latter goal depends on the whole spectrum of Σ and typically ranges from O(n−1) to O(n−1/2), ignoring the dependence on other structural parameters and logarithmic parameters (Wainwright, 2019). In Section 5, we will explain why the small (cid:101)λ in our method leads to decent pseudo-labels for model selection. 10 The corollary below shows that our method can achieve the minimax optimal rate of excess risk in many common scenarios, whose proof is in Appendix C. This has a significant algorithmic implication that we can train the candidate models { (cid:101)fλ}λ∈Λ and the imputation model (cid:101)f before seeing the target data, and then select a good model based on pseudo-labeling. Corollary 4.1. Consider the setup of Theorem 4.2. Suppose that either Assumption 4.2 holds with M (cid:46) 1, or Assumption 4.3 holds with Tr(Σ) (cid:46) 1. In addition, assume that (cid:107)θ(cid:63)(cid:107)2 ≤ R < ∞. 1. Suppose that μj ≤ c1j−2α, ∀j holds with some constants c1 > 0 and α > 1/2. When 1 ≤ B (cid:46) n * min{(σ/R)4α, (R/σ)2} log2α+1(n/δ) , with probability at least 1 − δ, we have R( (cid:98)f ) − R(f (cid:63)) (cid:46) R 2 2α+1 (cid:18) σ2B log( log n δ ) (cid:19) 2α 2α+1 n . 2. Suppose that μj ≤ c1e−c2j, ∀j holds with some constants c1, c2 > 0. When R2 (cid:46) σ2 log n, with probability at least 1 − δ, we have R( (cid:98)f ) − R(f (cid:63)) (cid:46) σ2B log2(n/δ) n . 3. Suppose that rank(Σ0) = D < ∞. When R2 (cid:46) σ2D, with probability at least 1 − δ, we have R( (cid:98)f ) − R(f (cid:63)) (cid:46) σ2BD log(n/δ) n . All of the (cid:46)'s above only hide constant factors. Corollary 4.1 presents excess risk bounds for common scenarios when the covariates have finite dimensions, or the kernel has polynomially or exponentially decaying eigenvalues. Here are examples of the latter two. Let X = [0, 1] and Q be the uniform distribution over X . The first-order Sobolev kernel in Example 2.4 satisfies the polynomial decay property with α = 1. The Gaussian kernel in Example 2.3 satisfies the exponential decay property. dQ j=1 Theorem 2 in Ma et al. (2022) provides general minimax lower bounds on the excess risk when dP ≤ B and the eigenvalues {μj}∞ are regular, which are covered by our setting. Based on that, direct computation shows that the bounds in Corollary 4.1 are minimax optimal up to logarithmic factors. When P = Q, we have B = 1 and the results recover optimal error rates of kernel ridge regression without covariate shift. When B > 1, the covariate shift has a negative impact. The results are easy to interpret using a new quantity ε = B−1: when the source covariate distribution has an ε-coverage of the target one (i.e. Σ (cid:23) εΣ0), one labeled sample from the source distribution is worth ε labeled samples from the target distribution. 5 Oracle inequalities for model selection with pseudo-labels In this section, we will demystify the power of pseudo-labeling. We will explain why the overhead incurred by imperfect pseudo-labels can be negligible compared to excess risk bounds for the can- didate models. We will also present a bias-variance decomposition of the overhead. The results will be illustrated by numerical simulations. 11 5.1 A bias-variance decomposition The following oracle inequality is the cornerstone of our excess risk bounds in Theorem 4.1. The proof is deferred to Section 6.2.2. Theorem 5.1 (Oracle inequality for pseudo-labeling). Let Assumptions 2.2 and 4.1 hold. Suppose that ρn is an integer, 1/c ≤ n0/n ≤ c and |Λ| ≤ nc hold for some constant c ≥ 1. Choose any δ ∈ (0, 1/5] and γ ∈ (0, 3/4]. Let ξ((cid:101)λ, δ) be defined as in Theorem 4.1. 1. Under Assumption 4.2, there exist constants C and C0 such that when (cid:101)λ ≥ CM 2 log(n/δ) and ρn minλ∈Λ λ ≥ CM 2 log(n/δ) , we have (1−ρ)n (cid:18) P R( (cid:98)f ) − R(f (cid:63)) ≤ (1 + γ) min λ∈Λ [R( (cid:98)fλ) − R(f (cid:63))] + (cid:19) ξ((cid:101)λ, δ) ≥ 1 − δ. C0 γ (5.1) 2. Suppose that Assumption 4.3 holds and cn0/ Tr(Σ0) ≥ n/ Tr(Σ). There exist constants C and C0 such that when (cid:101)λ ≥ C Tr(Σ) log(1/δ) ρn and n0 ≥ C(κ/γ)2 log(|Λ|/δ), we have the inequality (5.1). Theorem 5.1 controls the excess risk R( (cid:98)f ) − R(f (cid:63)) of the final model (cid:98)f by a small multiple of minλ∈Λ[R( (cid:98)fλ) − R(f (cid:63))] plus an overhead term ξ((cid:101)λ, δ) incurred by pseudo-labeling. The overhead reflects the error of the imputation model (cid:101)f , and its expression looks similar to the bound E(λ, δ) on the excess risk of the candidate model (cid:98)fλ in Theorem 4.1. However, only the operator norm of the matrix S (cid:101)λ) plays no role. The former can be significantly smaller than the latter. The choice of penalty parameter (cid:101)λ for training the imputation model needs to balance the bias and the operator norm of some error covariance matrix, in contrast to the usual bias-variance trade-off. We will come back to this point at the end of the section. appears in ξ((cid:101)λ, δ), and the trace Tr(S (cid:101)λ Below is a concrete example showing that the impact ξ((cid:101)λ, δ) of pseudo-labeling can be negligible compared to excess risk bounds for { (cid:98)fλ}λ∈Λ. Example 5.1 (First-order Sobolev space). Consider the setting in Example 2.4 and let Q be the uniform distribution over [0, 1]. Suppose that dQ dP ≤ B (cid:46) n and σ (cid:16) (cid:107)θ(cid:63)(cid:107)2 (cid:16) 1. Set δ = 1/n. Choose Λ and (cid:101)λ according to Assumption 4.4. Up to a logarithmic factor, the excess risk of the best candidate in { (cid:98)fλ}λ∈Λ is of order O((B/n)2/3), which is minimax optimal. Meanwhile, the overhead ξ((cid:101)λ, δ) incurred by pseudo-labeling is of higher order O(B/n). We now demystify such phenomenon to explain the power of pseudo-labeling. Ideally, we want to find the candidate model in { (cid:98)fλ}λ∈Λ that minimizes the risk R(*). However, the objective is not directly computable as we only have finitely many unlabeled data from the target distribution. To overcome the challenge, we train an imputation model (cid:101)f to produce pseudo-labels {(cid:101)y0i}n0 and select the final model (cid:98)f based on (3.1). The suboptimality of (cid:98)λ relative to argminλ∈Λ R( (cid:98)fλ) is caused by (i) the errors of pseudo-labels, and (ii) the finite-sample approximation of the risk. i=1 To get Theorem 5.1, we will first tease out the impact of pseudo-labels by studying fixed designs. Define the in-sample risk on the target data Rin(f ) = E (cid:18) 1 n0 n0(cid:88) i=1 |f (x0i) − y0i|2 {x0i}n0 i=1 (cid:19) , (cid:12) (cid:12) (cid:12) (cid:12) ∀f ∈ F. (5.2) An important property is Rin(f ) − Rin(f (cid:63)) = 1 n0 n0(cid:88) i=1 12 |f (x0i) − f (cid:63)(x0i)|2. (5.3) Therefore, the objective function for model selection (3.1) mimics the excess in-sample risk Rin( (cid:98)fλ)− Rin(f (cid:63)) of the candidate (cid:98)fλ. They become equal if the imputation model is perfect, i.e. (cid:101)f = f (cid:63). We will establish an oracle inequality Rin( (cid:98)f ) − Rin(f (cid:63)) ≤ (1 + γ) min λ∈Λ [Rin( (cid:98)fλ) − Rin(f (cid:63))] + η, (5.4) where γ is small, and η quantifies how the discrepancies { (cid:101)f (x0i) − f (cid:63)(x0i)}n0 influence the sub- i=1 optimality. Once that is done, we will bridge the in-sample and out-of-sample excess risks to finish the proof of Theorem 5.1. See Section 6.2.2 for details. The in-sample oracle inequality (5.4) is derived from the following bias-variance decomposition of pseudo-labels' impact on model selection, whose proof is deferred to Appendix D. Suppose that that best fits some unknown regression we want to select a model among m candidates {gj}m j=1 function g(cid:63). We have finitely many unlabeled sample {zi}n (cid:101)g to fill the labels for model selection. Since (cid:101)g is often learned from data, we let it be random. All the other quantities are considered deterministic. and use an imputation model i=1 Theorem 5.2 (Bias-variance decomposition). Let {zi}n and {gj}m j=1 be deterministic functions on Z; (cid:101)g be a random function on Z. Define n (cid:88) i=1 be deterministic elements in a set Z; g(cid:63) L(g) = |g(zi) − g(cid:63)(zi)|2 1 n i=1 for any function g on Z. Assume that the random vector (cid:101)y = ((cid:101)g(z1), (cid:101)g(z2), * * * , (cid:101)g(zn))(cid:62) satisfies (cid:107)(cid:101)y − E (cid:101)y(cid:107)ψ2 ≤ V < ∞. Choose any (cid:98)j ∈ argmin j∈[m] (cid:26) 1 n n (cid:88) i=1 |gj(zi) − (cid:101)g(zi)|2 (cid:27) . There exists a universal constant C such that for any δ ∈ (0, 1], with probability at least 1 − δ we have (cid:26) L(g (cid:98)j) ≤ inf γ>0 (1 + γ) min j∈[m] L(gj) + C(1 + γ−1) (cid:18) L(E (cid:101)g) + Consequently, (cid:26) EL(g (cid:98)j) ≤ inf γ>0 (1 + γ) min j∈[m] L(gj) + C(1 + γ−1) L(E (cid:101)g) + (cid:18) V 2 log(m/δ) n (cid:19)(cid:27) . V 2(1 + log m) n (cid:19)(cid:27) . Theorem 5.2 is an oracle inequality for the in-sample risk of the selected model. The expected overhead consists of two terms, L(E (cid:101)g(zi) − n g(cid:63)(zi)|2, which is the mean squared bias of the pseudo-labels. The second term reflects their ran- domness, as V 2 is the variance proxy of the sub-Gaussian random vector (cid:101)y. Therefore, Theorem 5.2 can be viewed as a bias-variance decomposition of the overhead. . The first term is equal to 1 n (cid:101)g) and V 2(1+log m) i=1 |E (cid:80)n In contrast, the usual bias-variance decomposition of pseudo-labels' mean squared error gives EL((cid:101)g) = L(E (cid:101)g) + n−1E(cid:107)(cid:101)y − E (cid:101)y(cid:107)2 2. 2 (cid:101)y(cid:107)2 can be as large as nV 2, whose implied upper bound on EL((cid:101)g) is L(E (cid:101)g)+V 2. The quantity E(cid:107)(cid:101)y−E (cid:101)g) + V 2(1+log m) on the overhead so long as log m (cid:28) n. This is much larger than the bound L(E Consequently, pseudo-labels with large mean squared error may still help select a decent model. Indeed, for supervised learning without covariate shift, the real labels used in hold-out validation have zero bias but non-vanishing mean squared error. n 13 5.2 A numerical example We conduct numerical simulations using the RKHS in Example 2.4 to illustrate the theoretical find- ings. The true regression function is f (cid:63)(x) = sin(2πx). Denote by μ and ν the uniform distributions over [0, 1/2] and [1/2, 1], respectively. Consider the following procedure for any even n ≥ 2: • Let B = n1/3, P = B B+1 ν. Generate n i.i.d. source samples with xi ∼ P and yi|xi ∼ N (f (cid:63)(xi), 1). Generate n0 = n/2 i.i.d. unlabeled target B+1 ν and Q = 1 B+1 μ + B B+1 μ + 1 {(xi, yi)}n i=1 samples D0 = {x0i}n0 i=1 with x0i ∼ Q. • Randomly partition the source data into two halves D1 and D2. Run KRR on D1 to obtain 10|D1| : k = 0, 1, * * * , (cid:100)log2(10|D1|)(cid:101)}. Run KRR on D2 candidate models { (cid:98)fλ}λ∈Λ, where Λ = { 2k with penalty parameter (cid:101)λ = 1 to obtain the imputation model (cid:101)f . 10|D2| • Construct a risk estimate (cid:98)R : F → R, find any (cid:98)λ ∈ argminλ∈Λ (cid:98)R( (cid:98)fλ) and select (cid:98)f = (cid:98)f (cid:98)λ . • Draw n(cid:48) 0 = 1000 i.i.d. samples {zi}n(cid:48) (cid:80)n(cid:48) 0 i=1 0 i=1 | (cid:98)f (zi) − f (cid:63)(zi)|2. empirical version 1 n(cid:48) 0 from Q and estimate the excess risk R( (cid:98)f ) − R(f (cid:63)) by the Our proposed method in Section 3 corresponds to (cid:98)R(f ) = 1 |D0| |f (x)− (cid:101)f (x)|2. We compare it with an oracle approach whose risk estimate 1 |f (x)−f (cid:63)(x)|2 is based on noiseless labels, and a naïve approach that uses the empirical risk 1 |f (x) − y|2 on D2. The latter is the standard hold-out validation method that ignores the covariate shift. We set |D0| = |D2| so that the three aforementioned methods use the same number of test samples. x∈D0 (cid:80) (x,y)∈D2 x∈D0 |D2| |D0| (cid:80) (cid:80) Figure 1: Comparisons of three approaches on a log-log plot. x-axis: n. y-axis: mean squared error. Red crosses: pseudo-labeling. Cyan triangles: the oracle method. Blue circles: the naïve method. For every n ∈ {4000, 8000, 16000, 32000, 64000}, we run the experiment 100 times independently. Figure 1 shows the performances of three model selection approaches: pseudo-labeling (red crosses), the oracle method (cyan triangles) and the naïve method (blue circles). The x- and y-coordinates of each point are the sample size n and the average of estimated excess risks over 100 independent runs, respectively. Since the points of each method are lined up on the log-log scale, the excess risk decays like O(n−α) for some α > 0. Linear regression yields the solid lines in Figure 1 and estimates the exponents αPL (pseudo-labeling), αoracle and αnaïve as 0.516, 0.511 and 0.457, respectively. We use cluster bootstrap (Cameron et al., 2008) to quantify the uncertainties, by resampling the 100 data points corresponding to each n for 10000 times, independently of each other. The 95% confidence 14 intervals on αPL − αoracle and αPL − αnaïve are [−0.024, 0.031] and [0.024, 0.094], respectively. Our proposed method does not differ significantly from the oracle one in terms of the error exponent. It is significantly better than the naïve method. Indeed, the source data does not have a good coverage of the test cases. In addition, we also plot the linear fits of 100 bootstrap replicates to illustrate the stability, resulting in the thin shaded areas around the solid lines in Figure 1. 6 Proofs of Theorems 4.1 and 5.1 We now prove our main results: the excess risk bounds (Theorem 4.1) and the oracle inequality for model selection (Theorem 5.1). We will first conduct a fixed-design analysis in Section 6.1 by treating all the covariates and the data split as deterministic. After that, we will take the random designs into consideration and derive the final results in Section 6.2. 6.1 Fixed designs and the in-sample risk i=1 i=1 To begin with, we tease out the impact of random errors {εi}n , {x0i}n0 on the covariates {xi}n i=1 risk Rin defined in (5.2) and provide excess risk bounds as well as oracle inequalities. on our estimator (cid:98)f by conditioning and the split D1 ∪ D2. As a result, we will study the in-sample To facilitate the analysis, we introduce some notation. When X = Rd for some d < ∞ and K(z, w) = z(cid:62)w, φ is the identity mapping. We can construct design matrices X = (x1, * * * , xn)(cid:62) ∈ Rn×d, X0 = (x01, * * * , x0n0)(cid:62) ∈ Rn0×d and the response vector y = (y1, * * * , yn)(cid:62) ∈ Rn. Define the index set T = {i ∈ [n] : (xi, yi) ∈ D1} of the data for training candidate models. In addition, let n1 = |T | and n2 = n − n1. Denote by X1 ∈ R|T |×d and X2 ∈ R(n−|T |)×d the sub-matrices of X by selecting rows whose indices belong to T and [n]\T , respectively. Similarly, denote by y1 ∈ R|T | and y2 ∈ Rn−|T | the sub-vectors of y induced by those index sets. The design matrices can be generalized to operators when X and K are general. In that case, X and X0 are bounded linear operators defined through X : H → Rn, θ (cid:55)→ ((cid:104)φ(x1), θ(cid:105), X0 : H → Rn0, θ (cid:55)→ ((cid:104)φ(x01), θ(cid:105), * * * , (cid:104)φ(xn), θ(cid:105))(cid:62), * * * , (cid:104)φ(x0n0), θ(cid:105))(cid:62). (cid:80)n0 We can define X1 and X2 similarly. With slight abuse of notation, we use X (cid:62) to refer to the adjoint of X, i.e. X (cid:62) : Rn → H, u (cid:55)→ (cid:80)n i=1 uiφ(xi). Similarly, we can define X (cid:62) , X (cid:62) . Let and X (cid:62) 0 2 1 (cid:80) i∈[n]\T φ(xi) ⊗ φ(xi). i∈T φ(xi) ⊗ φ(xi) and (cid:98)Σ2 = 1 (cid:98)Σ0 = 1 n2 n0 We have (cid:98)Σj = n−1 j Xj for all j ∈ {0, 1, 2}. Moreover, (cid:98)fλ(*) = (cid:104)φ(*), (cid:98)θλ(cid:105) holds for (cid:98)θλ = ( (cid:98)Σ1 + λI)−1(n−1 1 y1), and (cid:101)f (*) = (cid:104)φ(*), (cid:101)θ(cid:105) holds for (cid:101)θ = ( (cid:98)Σ2 + (cid:101)λI)−1(n−1 i=1 φ(x0i) ⊗ φ(x0i), (cid:98)Σ1 = 1 n1 Below we present a lemma on kernel ridge regression that plays a major role throughout the j X (cid:62) 2 X (cid:62) 1 X (cid:62) 2 y2). (cid:80) analysis. See Appendix A.1 for its proof. Lemma 6.1 (Fixed-design KRR). Let Assumptions 2.2 and 4.1 hold, with the exception that {xi}n and {x0i}n0 ̄θλ = E (cid:98)θλ. i=1 i=1 are deterministic. Let the partition D1 ∪ D2 be fixed. Choose any λ > 0 and define 1. There exist universal constants C1 and C2 such that (cid:107) ̄θλ − θ(cid:63)(cid:107)H ≤ (cid:107)θ(cid:63)(cid:107)H, C1σ √ n1λ (cid:107) (cid:98)θλ − ̄θλ(cid:107)ψ2 ≤ , 15 (cid:107)n−1/2 0 X0( ̄θλ − θ(cid:63))(cid:107)2 ≤ (cid:113) λ(cid:107)( (cid:98)Σ1 + λI)−1/2 (cid:98)Σ0( (cid:98)Σ1 + λI)−1/2(cid:107) * (cid:107)θ(cid:63)(cid:107)H, (cid:107)n−1/2 0 X0( (cid:98)θλ − ̄θλ)(cid:107)ψ2 ≤ C1σ (cid:115) (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)H ≤ (cid:107)θ(cid:63)(cid:107)H + (cid:18) P (cid:115) (cid:107)( (cid:98)Σ1 + λI)−1/2 (cid:98)Σ0( (cid:98)Σ1 + λI)−1/2(cid:107) n1 , C2σ2 log(1/δ) n1λ Tr[( (cid:98)Σ1 + λI)−1 (cid:98)Σ1] (cid:19) ≥ 1 − δ, ∀δ ∈ (0, 1/e]. 2. Choose any positive semi-definite trace class operator Q : H → H and define (cid:98)Sλ = ( (cid:98)Σ1 + λI)−1/2Q( (cid:98)Σ1 + λI)−1/2. We have (cid:18) (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 Q ≤ 2λ(cid:107) (cid:98)Sλ(cid:107) * (cid:107)θ(cid:63)(cid:107)2 H + P 2C2σ2 Tr( (cid:98)Sλ) n1 (cid:19) log(1/δ) ≥ 1 − δ, ∀δ ∈ (0, 1/e]. With the help of Lemma 6.1, we can easily control the excess in-sample risks of the candidate models using some function (cid:98)E(λ, δ) that is an empirical version of E(λ, δ) in Theorem 4.1. The quantity δ is the exceptional probability. The optimal candidate in { (cid:98)fλ}λ∈Λ is near-optimal over an enlarged set { (cid:98)fλ}λmin≤λ≤λmax up to a multiplicative factor, as long as λj+1/λj is bounded. We can also derive from Lemma 6.1 and Theorem 5.2 an oracle inequality of the form (5.4) showing that the excess in-sample risk Rin( (cid:98)f ) − Rin(f (cid:63)) of our selected model is a small multiple of minλ∈Λ[Rin( (cid:98)fλ) − Rin(f (cid:63))] plus some overhead (cid:98)ξ((cid:101)λ, δ). The latter reflects the error of the imputation model (cid:101)f , and it is an empirical version of ξ((cid:101)λ, δ). The results are summarized in Theorem 6.1 below. Theorem 6.1 (In-sample risks). Let Assumptions 2.2 and 4.1 hold. Suppose that Λ = {λ1, * * * , λm}, m ≥ 2, and 0 < λj < λj+1 ≤ βλj holds for all j ∈ [m − 1] and some β ≥ 1. For any λ > 0 and δ ∈ (0, 1/e], define (cid:98)Sj,λ = ( (cid:98)Σj + λI)−1/2 (cid:98)Σ0( (cid:98)Σj + λI)−1/2, j ∈ {1, 2}, (cid:98)E(λ, δ) = λ(cid:107) (cid:98)S1,λ(cid:107) * (cid:107)θ(cid:63)(cid:107)2 H + σ2 Tr( (cid:98)S1,λ) log(m/δ) n1 , (cid:98)ξ(λ, δ) = (cid:18) λ(cid:107)θ(cid:63)(cid:107)2 H + (cid:19) σ2 log(m/δ) n2 (cid:107) (cid:98)S2,(cid:101)λ(cid:107). There exist universal constants C1 and C2 such that with probability at least 1 − δ, we have min λ∈Λ Rin( (cid:98)fλ) − Rin(f (cid:63)) ≤ C1β min λ1≤λ≤λm (cid:98)E(λ, δ), Rin( (cid:98)f ) − Rin(f (cid:63)) ≤ inf γ>0 (cid:26) (1 + γ) min λ∈Λ [Rin( (cid:98)fλ) − Rin(f (cid:63))] + C2(1 + γ−1)(cid:98)ξ((cid:101)λ, δ) (cid:27) . When that event happens, Rin( (cid:98)f ) − Rin(f (cid:63)) ≤ inf γ>0 (cid:26) (1 + γ)C1β min λ1≤λ≤λm (cid:98)E(λ, δ) + C2(1 + γ−1)(cid:98)ξ((cid:101)λ, δ) (cid:27) . Proof of Theorem 6.1. First of all, it is easily seen from the decomposition (5.3) that Rin( (cid:98)fλ) − Rin(f (cid:63)) = (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 (cid:98)Σ0 . 16 Part 2 of Lemma 6.1 (with Q = (cid:98)Σ0) and union bounds imply the existence of a universal constant C1 such that (cid:18) P Rin( (cid:98)fλ) − Rin(f (cid:63)) ≤ C1 (cid:98)E(λ, δ), ∀λ ∈ Λ ≥ 1 − δ/2, ∀δ ∈ (0, 1/e]. (cid:19) Denote by A the above event. When A happens, we have min λ∈Λ Rin( (cid:98)fλ) − Rin(f (cid:63)) ≤ C1 min λ∈Λ (cid:98)E(λ, δ). Next, we bridge the discrete index set Λ and the interval [λ1, λm]. For any λ > 0, t ≥ 1 and j ∈ {1, 2}, we have ( (cid:98)Σj + tλI)−1 (cid:23) t−1( (cid:98)Σj + λI)−1. Then, Tr( (cid:98)Sj,tλ) ≥ t−1 Tr( (cid:98)Sj,λ), (cid:107) (cid:98)Sj,tλ(cid:107) ≥ t−1(cid:107) (cid:98)Sj,λ(cid:107) and tλ(cid:107) (cid:98)Sj,tλ(cid:107) ≥ λ(cid:107) (cid:98)Sj,λ(cid:107). As a result, (cid:98)E(tλ, δ) ≥ t−1 (cid:98)E(λ, δ). It follows from 0 < λj < λj+1 ≤ βλj that for any λ ∈ [λj, λj+1], (cid:98)E(λ, δ) ≥ (cid:98)E(λj, δ) ≥ β−1 (cid:98)E(λj, δ). λj λ Therefore, minλ1≤λ≤λm (cid:98)E(λ, δ) ≥ β−1 minλ∈Λ (cid:98)E(λ, δ). We have (cid:18) P min λ∈Λ Rin( (cid:98)fλ) − Rin(f (cid:63)) ≤ C1β min λ1≤λ≤λm (cid:19) (cid:98)E(λ, δ) ≥ P(A) ≥ 1 − δ/2. We now prove an oracle inequality for (cid:98)f . Define y(cid:63) = X0θ(cid:63) = (f (cid:63)(x01), * * * , f (cid:63)(x0n0))(cid:62), * * * , (cid:101)f (x0n0))(cid:62) and ̄θ = E( (cid:101)θ|X2). Applying Part 1 in Lemma 6.1 to (cid:101)θ shows (cid:101)y = X0 (cid:101)θ = ( (cid:101)f (x01), that n−1/2 0 n−1/2 0 (cid:107)E (cid:101)y − y(cid:63)(cid:107)2 = (cid:107)n−1/2 (cid:101)y(cid:107)ψ2 = (cid:107)n−1/2 0 X0( ̄θ − θ(cid:63))(cid:107)2 ≤ 0 X0( (cid:101)θ − ̄θ)(cid:107)ψ2 (cid:107)(cid:101)y − E (cid:113) (cid:101)λ(cid:107) (cid:98)S2,(cid:101)λ(cid:107) * (cid:107)θ(cid:63)(cid:107)H, (cid:107) (cid:98)S2,(cid:101)λ(cid:107), (cid:113) (cid:46) σ √ n2 where (cid:46) only hides a universal constant factor. Theorem 5.2 immediately yields the existence of a universal constant C2 such that P (cid:18) Rin( (cid:98)f ) − Rin(f (cid:63)) ≤ inf γ>0 (cid:26) (1 + γ) min λ∈Λ [Rin( (cid:98)fλ) − Rin(f (cid:63))] + C2(1 + γ−1)(cid:98)ξ((cid:101)λ, δ) (cid:27)(cid:19) ≥ 1 − δ/2. Finally, the proof is completed by combining the above estimates by union bounds. 6.2 Random designs and the out-of-sample risk 6.2.1 Two lemmas To analyze the estimator (cid:98)f in the random design setting, we need to (i) bound the deviations of from their population versions, and (ii) relate the the empirical second-moment operators { (cid:98)Σj}2 excess in-sample risk to the out-of-sample version. The following two lemmas are devoted to them. Their proofs are deferred to Appendices A.2 and A.3. j=0 Lemma 6.2 (Concentration of second-moment operators). Choose any δ ∈ (0, 1/5] and let As- sumption 2.2 hold. 17 1. Under Assumption 4.2, there exists a universal constant C such that the following inequalities hold simultaneously with probability at least 1 − δ: (cid:98)Σ0 (cid:22) (cid:18) 3 2 Σ0 + CM 2 log(3n0/δ) 3n0 (cid:19) , I (cid:98)Σ1 + λI (cid:23) (cid:98)Σ2 + (cid:101)λI (cid:23) 1 2 1 2 (Σ + λI), ∀λ ≥ (Σ + (cid:101)λI), ∀(cid:101)λ ≥ CM 2 log(3n/δ) (1 − ρ)n CM 2 log(3n/δ) ρn , . On the above event, for all λ ≥ CM 2 log(3n/δ) (1−ρ)n and (cid:101)λ ≥ CM 2 log(3n/δ) ρn we have Tr[( (cid:98)Σ1 + λI)−1/2Σ0( (cid:98)Σ1 + λI)−1/2] ≤ 2 Tr[(Σ + λI)−1/2Σ0(Σ + λI)−1/2], (cid:107)( (cid:98)Σ1 + λI)−1/2Σ0( (cid:98)Σ1 + λI)−1/2(cid:107) ≤ 2(cid:107)(Σ + λI)−1/2Σ0(Σ + λI)−1/2(cid:107), (cid:107)( (cid:98)Σ2 + (cid:101)λI)−1/2 (cid:98)Σ0( (cid:98)Σ2 + (cid:101)λI)−1/2(cid:107) ≤ 3(cid:107)(Σ + (cid:101)λI)−1/2Σ0(Σ + (cid:101)λI)−1/2(cid:107) + n n0 (cid:26) max 1, (cid:27) . log n0 log n 2. Under Assumption 4.3, there exists a constant C ≥ 1 determined by κ such that the following inequalities hold simultaneously with probability at least 1 − δ: (cid:98)Σ0 (cid:22) (cid:18) Σ0 + 3 2 C Tr(Σ0) log(3/δ) 3n0 (cid:19) I , (cid:98)Σ1 + λI (cid:23) (cid:98)Σ2 + (cid:101)λI (cid:23) 1 2 1 2 (Σ + λI), ∀λ ≥ (Σ + (cid:101)λI), ∀(cid:101)λ ≥ C Tr(Σ) log(3/δ) (1 − ρ)n C Tr(Σ) log(3/δ) ρn , . On the above event, for all λ ≥ C Tr(Σ) log(3/δ) Tr[( (cid:98)Σ1 + λI)−1/2Σ0( (cid:98)Σ1 + λI)−1/2] and (cid:107)( (cid:98)Σ1 + λI)−1/2Σ0( (cid:98)Σ1 + λI)−1/2(cid:107) as in Part 1, and and (cid:101)λ ≥ C Tr(Σ) log(3/δ) we have same estimates on (1−ρ)n ρn (cid:107)( (cid:98)Σ2 + (cid:101)λI)−1/2 (cid:98)Σ0( (cid:98)Σ2 + (cid:101)λI)−1/2(cid:107) ≤ 3(cid:107)(Σ + (cid:101)λI)−1/2Σ0(Σ + (cid:101)λI)−1/2(cid:107) + n n0 * Tr(Σ0) Tr(Σ) . Lemma 6.3 (In-sample and out-of-sample risks). Let Assumptions 2.2 and 4.1 hold. Choose any δ ∈ (1, 1/e] and γ ∈ (0, 3/4]. 1. Suppose that Assumption 4.2 holds and minλ∈Λ λ ≥ 8M 2 log[(n+n0)|Λ|/δ] . Define (1−ρ)n ζ(δ) = ((cid:107)θ(cid:63)(cid:107)HM + σ)2 log(|Λ|/δ) n0 . There exists a universal constant C0 such that with probability at least 1−δ, the following inequality holds simultaneously for all λ ∈ |Λ|: (1 − γ)[R( (cid:98)fλ) − R(f (cid:63))] − C0 γ ζ(δ) ≤ Rin( (cid:98)fλ) − Rin(f (cid:63)) ≤ (1 + γ)[R( (cid:98)fλ) − R(f (cid:63))] + C0 γ ζ(δ). 18 2. Suppose that Assumption 4.3 holds. There exists a universal constant C > 0 such that when n0 ≥ (Cκ/γ)2 log(|Λ|/δ), the following inequality holds with probability at least 1 − δ: (1 − γ)[R( (cid:98)fλ) − R(f (cid:63))] ≤ Rin( (cid:98)fλ) − Rin(f (cid:63)) ≤ (1 + γ)[R( (cid:98)fλ) − R(f (cid:63))]. Equipped with those technical tools, we are now ready to tackle Theorems 4.1 and 5.1. 6.2.2 Proof of Theorem 5.1 Under Assumption 4.2 or 4.3, Lemma 6.2 implies that when C is large enough, (cid:18) (cid:19) (cid:98)ξ((cid:101)λ, δ) ≤ 3ξ((cid:101)λ, δ) ≥ 1 − δ/3. P Combining the above with Theorem 6.1, we see that when γ ∈ (0, 3/4] and C is large enough, there exists a large constant C1 such that with probability at least 1 − δ/2, Rin( (cid:98)f ) − Rin(f (cid:63)) ≤ (1 + γ) min λ∈Λ [Rin( (cid:98)fλ) − Rin(f (cid:63))] + C1 γ ξ((cid:101)λ, δ). Denote by A the above event. On the other hand, Lemma 6.3 implies that when C is large enough, there exists a large constant C2 such that with probability at least 1−δ/2, the following bound holds simultaneously for all λ ∈ Λ: (1 − γ)[R( (cid:98)fλ) − R(f (cid:63))] − C2 γ ζ(δ) ≤ Rin( (cid:98)fλ) − Rin(f (cid:63)) ≤ (1 + γ)[R( (cid:98)fλ) − R(f (cid:63))] + C2 γ ζ(δ). Denote by B the above event. • Under Assumption 4.2, we have ζ(δ) = ((cid:107)θ(cid:63)(cid:107)HM +σ)2 log(|Λ|/δ) . We use the assumptions (cid:101)λ (cid:38) n0 M 2 log(n/δ) ρn and |Λ| ≤ nc to derive that ζ(δ) (cid:46) ((cid:107)θ(cid:63)(cid:107)2 HM 2 + σ2) log(|Λ|/δ) (cid:46) ((cid:107)θ(cid:63)(cid:107)2 H (cid:101)λρn log(n/δ) + σ2) log(|Λ|/δ) (cid:18) log(|Λ|/δ) log(n/δ) (cid:18) (cid:101)λ(cid:107)θ(cid:63)(cid:107)2 H + = ≤ n0 * (cid:101)λ(cid:107)θ(cid:63)(cid:107)2 H + σ2 log(|Λ|/δ) ρn σ2 log(|Λ|/δ) ρn n n0 (cid:19) * ≤ ξ((cid:101)λ, δ). n0 (cid:19) * ρn n0 • Under Assumption 4.3, we have ζ(δ) = 0 ≤ ξ((cid:101)λ, δ). Based on the above, we always have ζ(δ) (cid:46) ξ((cid:101)λ, δ). When the event B happens, we have R( (cid:98)f ) − R(f (cid:63)) ≤ (cid:18) 1 1 − γ [Rin( (cid:98)f ) − Rin(f (cid:63))] + (cid:19) , ξ((cid:101)λ, δ) C2 γ min λ∈Λ [Rin( (cid:98)fλ) − Rin(f (cid:63))] ≤ (1 + γ) min λ∈Λ [R( (cid:98)fλ) − R(f (cid:63))] + C2 γ ξ((cid:101)λ, δ). 19 When the event A ∩ B happens (which has probability at least 1 − δ), we have C2 γ C1 γ R( (cid:98)f ) − R(f (cid:63)) ≤ (cid:18) 1 1 − γ [Rin( (cid:98)f ) − Rin(f (cid:63))] + (cid:19) ξ((cid:101)λ, δ) ≤ = ≤ = 1 1 − γ 1 + γ 1 − γ (cid:20)(cid:18) min λ∈Λ (cid:18) 1 + γ 1 − γ (1 + γ)2 1 − γ (1 + γ) min λ∈Λ [Rin( (cid:98)fλ) − Rin(f (cid:63))] + ξ((cid:101)λ, δ) (cid:19) (cid:21) ξ((cid:101)λ, δ) + C2 γ [Rin( (cid:98)fλ) − Rin(f (cid:63))] + (C1 + C2)ξ((cid:101)λ, δ) γ(1 − γ) (1 + γ) min λ∈Λ [R( (cid:98)fλ) − R(f (cid:63))] + (cid:19) ξ((cid:101)λ, δ) + C2 γ (C1 + C2)ξ((cid:101)λ, δ) γ(1 − γ) [R( (cid:98)fλ) − R(f (cid:63))] + min λ∈Λ [C1 + (2 + γ)C2]ξ((cid:101)λ, δ) γ(1 − γ) . By γ ∈ (0, 3/4], we have 2 + γ ≤ 3, 1 1−γ ≤ 4 and (1 + γ)2 1 − γ = 1 + 2γ + γ2 1 − γ = 1 + 3γ + γ2 1 − γ = 1 + γ * 3 + γ 1 − γ ≤ 1 + 16γ. Hence, there exists a constant C3 such that (cid:18) P R( (cid:98)f ) − R(f (cid:63)) ≤ (1 + 16γ) min λ∈Λ [R( (cid:98)fλ) − R(f (cid:63))] + (cid:19) ξ((cid:101)λ, δ) ≥ 1 − δ. C3 γ By redefining γ and choosing a sufficiently large C0, we get the desired result. 6.2.3 Proof of Theorem 4.1 Under Assumption 4.2 or 4.3, Lemma 6.2 implies that when C is large enough, (cid:18) (cid:107) (cid:98)S1,λ(cid:107) ≤ 2(cid:107)Sλ(cid:107) and Tr( (cid:98)S1,λ) ≤ 2 Tr(Sλ) P (cid:19) ≥ 1 − δ/2. Then, the desired results follow from Theorem 6.1, Theorem 5.1 and union bounds. 7 Discussion We developed a simple approach for kernel ridge regression under covariate shift. A key component is an imputation model that generates pseudo-labels for model selection. The final estimator is shown to adapt to the covariate shift in many common scenarios. We hope that our work can spur further research toward a systematic solution to covariate shift problems. Lots of open questions are worth studying. For instance, we need general measures of covariate shift and corresponding tools for handling them. When Σ0 (cid:22) BΣ (a special case is dQ dP ≤ B), our approach achieves the minimax optimal error rate without knowing B. It would be interesting to consider other discrepancy measures such as divergences or Wasserstein metrics. Our two-stage approach with separate uses of source and target data may need modification. The candidate models may better be trained using some weighted loss based on the target data. Another direction is statistical learning over general function classes. The current paper only considered kernel ridge regression with well-specified model. Analytical expressions of the fitted models greatly facilitated our theoretical analysis. In future work, we would like to go beyond that and develop more versatile methods. 20 Acknowledgement Kaizheng Wang's research is supported by an NSF grant DMS-2210907 and a startup grant at Columbia University. We acknowledge computing resources from Columbia University's Shared Research Computing Facility project, which is supported by NIH Research Facility Improvement Grant 1G20RR030893-01, and associated funds from the New York State Empire State Develop- ment, Division of Science Technology and Innovation (NYSTAR) Contract C090171, both awarded April 15, 2010. 21 A Proofs of Lemmas 6.1 to 6.3 A.1 Proof of Lemma 6.1 A.1.1 Part 1 Analysis of (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)ψ2 and (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)H. Define ε1 = y1 − X1θ(cid:63). Under Assumption 2.2, 1 X (cid:62) ̄θλ = ( (cid:98)Σ1 + λI)−1(n−1 ̄θλ − θ(cid:63) = −λ( (cid:98)Σ1 + λI)−1θ(cid:63), (cid:98)θλ − ̄θλ = ( (cid:98)Σ1 + λI)−1(n−1 1 X (cid:62) 1 ε1). 1 y1) = ( (cid:98)Σ1 + λI)−1 (cid:98)Σ1θ(cid:63), On the one hand, (cid:107) ̄θλ − θ(cid:63)(cid:107)H = λ(cid:107)( (cid:98)Σ1 + λI)−1θ(cid:63)(cid:107)H ≤ (cid:107)θ(cid:63)(cid:107)H. (A.1) (A.2) (A.3) On the other hand, note that ( (cid:98)Σ1 + λI)−1(n−2 adjoint is (n−2 1 X1)( (cid:98)Σ1 + λI)−1. Hence, 1 X (cid:62) 1 ) : Rn → H is a bounded linear operator whose (cid:107)( (cid:98)Σ1 + λI)−1(n−1 = n−1 1 (cid:107)( (cid:98)Σ1 + λI)−1 (cid:98)Σ1( (cid:98)Σ1 + λI)−1(cid:107) ≤ (n1λ)−1. 1 X (cid:62) 1 )(cid:107)2 = (cid:107)( (cid:98)Σ1 + λI)−1(n−1 1 X (cid:62) 1 )(n−1 1 X1)( (cid:98)Σ1 + λI)−1(cid:107) Assumption 4.1 implies the following fact with C1 being a universal constant. Fact A.1. ε1 has sub-Gaussian norm bounded by C1σ. By Fact A.1, (cid:107) (cid:98)θλ − ̄θλ(cid:107)ψ2 = (cid:107)( (cid:98)Σ1 + λI)−1(n−1 1 X (cid:62) 1 )ε1(cid:107)ψ2 ≤ (cid:107)ε1(cid:107)ψ2√ n1λ ≤ C1σ √ n1λ . Next, we prove the tail bound on (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)H. The representation (A.2) yields (cid:107) (cid:98)θλ − ̄θλ(cid:107)2 H = 1 n2 1 (cid:104)ε1, X1( (cid:98)Σ1 + λI)−2X (cid:62) 1 ε1(cid:105). By Fact A.1 and Lemma E.1, there is a universal constant C2 such that (cid:18) (cid:107) (cid:98)θλ − ̄θλ(cid:107)2 H ≤ P Tr[X1( (cid:98)Σ1 + λI)−2X (cid:62) 1 ]t (cid:19) C2σ2 n2 1 ≥ 1 − e−t, ∀t ≥ 1. By direct calculation, Tr[X1( (cid:98)Σ1 + λI)−2X (cid:62) 1 ] = n1 Tr[( (cid:98)Σ1 + λI)−2 (cid:98)Σ1] ≤ n1 λ Tr[( (cid:98)Σ1 + λI)−1 (cid:98)Σ1]. Combining these estimates and (A.3) yields the concentration bound (cid:18) (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)H ≤ (cid:107)θ(cid:63)(cid:107)2 H + P (cid:115) C2σ2t n1λ Tr[( (cid:98)Σ1 + λI)−1 (cid:98)Σ1] (cid:19) ≥ 1 − e−t, ∀t ≥ 1. Analysis of (cid:107)n−1/2 0 X0( ̄θλ − θ(cid:63))(cid:107)ψ2. By (A.1), (cid:107)X0( ̄θλ − θ(cid:63))(cid:107)2 2 = λ2(cid:107)X0( (cid:98)Σ1 + λI)−1θ(cid:63)(cid:107)2 2 ≤ λ2(cid:107)X0( (cid:98)Σ1 + λI)−1(cid:107)2(cid:107)θ(cid:63)(cid:107)2 H. 22 From (cid:107)X0( (cid:98)Σ1 + λI)−1(cid:107)2 = (cid:107)X0( (cid:98)Σ1 + λI)−2X (cid:62) = λ−1(cid:107)( (cid:98)Σ1 + λI)−1/2X (cid:62) 0 (cid:107) ≤ λ−1(cid:107)X0( (cid:98)Σ1 + λI)−1X (cid:62) 0 (cid:107) 0 X0( (cid:98)Σ1 + λI)−1/2(cid:107) = n0λ−1(cid:107)( (cid:98)Σ1 + λI)−1/2 (cid:98)Σ0( (cid:98)Σ1 + λI)−1/2(cid:107) we obtain that n−1/2 0 (cid:107)X0( ̄θλ − θ(cid:63))(cid:107)2 ≤ (cid:113) λ(cid:107)( (cid:98)Σ1 + λI)−1/2 (cid:98)Σ0( (cid:98)Σ1 + λI)−1/2(cid:107) * (cid:107)θ(cid:63)(cid:107)H. Analysis of (cid:107)n−1/2 have X0( (cid:98)θλ − ̄θλ) = Aε1. By Fact A.1, 0 X0( (cid:98)θλ − ̄θλ)(cid:107)ψ2. Define A = X0( (cid:98)Σ1 + λI)−1n−1 1 X (cid:62) 1 ∈ Rn×n. By (A.2), we (cid:107)X0( (cid:98)θλ − ̄θλ)(cid:107)ψ2 ≤ (cid:107)A(cid:107)2(cid:107)ε1(cid:107)ψ2 ≤ C1σ(cid:107)A(cid:107)2. AA(cid:62) = n−1 1 X0( (cid:98)Σ1 + λI)−1 (cid:98)Σ1( (cid:98)Σ1 + λI)−1X (cid:62) 0 (cid:22) n−1 1 X0( (cid:98)Σ1 + λI)−1X (cid:62) 0 , Since we have (cid:107)A(cid:107)2 2 ≤ n−1 1 (cid:107)X0( (cid:98)Σ1 + λI)−1X (cid:62) n0 (cid:107)( (cid:98)Σ1 + λI)−1/2 (cid:98)Σ0( (cid:98)Σ1 + λI)−1/2(cid:107). = n1 0 (cid:107)2 = n−1 1 (cid:107)( (cid:98)Σ1 + λI)−1/2X (cid:62) 0 X0( (cid:98)Σ1 + λI)−1/2(cid:107) Consequently, (cid:107)n−1/2 0 X0( (cid:98)θλ − ̄θλ)(cid:107)ψ2 ≤ C1σ (cid:115) (cid:107)( (cid:98)Σ1 + λI)−1/2 (cid:98)Σ0( (cid:98)Σ1 + λI)−1/2(cid:107) n1 . A.1.2 Part 2 Note that (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 Q ≤ [(cid:107) (cid:98)θλ − ̄θλ(cid:107)Q + (cid:107) ̄θλ − θ(cid:63)(cid:107)Q]2 ≤ 2(cid:107) (cid:98)θλ − ̄θλ(cid:107)2 Q + 2(cid:107) ̄θλ − θ(cid:63)(cid:107)2 Q. By (A.1), Q = λ2(cid:107)( (cid:98)Σ1 + λI)−1θ(cid:63)(cid:107)2 (cid:107) ̄θλ − θ(cid:63)(cid:107)2 = λ2(cid:107)Q1/2( (cid:98)Σ1 + λI)−2Q1/2(cid:107) * (cid:107)θ(cid:63)(cid:107)2 Q ≤ λ2(cid:107)( (cid:98)Σ1 + λI)−1Q( (cid:98)Σ1 + λI)−1(cid:107) * (cid:107)θ(cid:63)(cid:107)2 H H ≤ λ(cid:107)Q1/2( (cid:98)Σ1 + λI)−1Q1/2(cid:107) * (cid:107)θ(cid:63)(cid:107)2 H = λ(cid:107) (cid:98)Sλ(cid:107) * (cid:107)θ(cid:63)(cid:107)2 H. By (A.2), Note that (cid:107) (cid:98)θλ − ̄θλ(cid:107)2 Q = (cid:107)( (cid:98)Σ1 + λI)−1(n−1 1 X (cid:62) 1 ε1)(cid:107)2 Q 1 X1)( (cid:98)Σ1 + λI)−1Q( (cid:98)Σ1 + λI)−1(n−1 1 X (cid:62) 1 )ε1(cid:105). = (cid:104)ε1, (n−1 1 X1)( (cid:98)Σ1 + λI)−1Q( (cid:98)Σ1 + λI)−1(n−1 Tr[(n−1 = Tr[( (cid:98)Σ1 + λI)−1Q( (cid:98)Σ1 + λI)−1(n−1 = n−1 1 X (cid:62) 1 )] 1 )(n−1 1 X1)] 1 Tr[( (cid:98)Σ1 + λI)−1Q( (cid:98)Σ1 + λI)−1 (cid:98)Σ1] ≤ n−1 1 Tr[( (cid:98)Σ1 + λI)−1Q] = n−1 1 X (cid:62) 1 Tr( (cid:98)Sλ). 23 By Fact A.1 and Lemma E.1, (cid:18) P (cid:107) (cid:98)θλ − ̄θλ(cid:107)2 Q ≤ C2σ2t n1 (cid:19) Tr( (cid:98)Sλ) ≥ 1 − e−t, ∀t ≥ 1. Here C2 is the constant we defined while studying (cid:107) (cid:98)θλ − ̄θλ(cid:107)2 H. Therefore, (cid:18) (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 Q ≤ 2λ(cid:107) (cid:98)Sλ(cid:107) * (cid:107)θ(cid:63)(cid:107)2 H + P 2C2σ2 Tr( (cid:98)Sλ) n1 (cid:19) t ≥ 1 − e−t, ∀t ≥ 1, and P (cid:18) (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 Q ≤ 2λ(cid:107) (cid:98)Sλ(cid:107) * (cid:107)θ(cid:63)(cid:107)2 H + 2C2σ2 Tr( (cid:98)Sλ) n1 (cid:19) log(1/δ) ≥ 1 − δ, ∀δ ∈ (0, 1/e]. A.2 Proof of Lemma 6.2 To prove Part 1, we let Assumption 4.2 hold. Choose any δ ∈ (0, 1/5]. Then, δ/3 ≤ 1/15 < 1/14. On the one hand, we apply the first part of Corollary E.1 to {φ(x0i)}n0 , with γ and δ set to be i=1 1/2 and δ/3. There exists a universal constant C such that for λ0 = CM 2 log(3n0/δ) , n0 (cid:18) (cid:98)Σ0 + λ0I (cid:22) P 3 2 (cid:19) (Σ0 + λ0I) ≥ 1 − δ/3. The event on the left-hand side is equivalent to (cid:98)Σ0 (cid:22) 3 2 Σ0 + 1 2 λ0I = (cid:18) Σ0 + 3 2 CM 2 log(3n0/δ) 3n0 (cid:19) I . Therefore, (cid:20) (cid:18) P 3 2 (cid:98)Σ0 (cid:22) CM 2 log(3n0/δ) 3n0 On the other hand, we apply the first part of Corollary E.1 to {φ(xi)}i∈T , with γ and δ set to be 1/2 and δ/3. Let λ1 = CM 2 log(3n/δ) . Then, with probability at least 1 − δ/3 we have . Note that |T | = (1 − ρ)n and λ1 ≥ CM 2 log( (1−ρ)n (1−ρ)n ≥ 1 − δ/3. Σ0 + (A.4) (1−ρ)n δ/3 I ) (cid:19)(cid:21) 1 2 (Σ + λ1I) (cid:22) (cid:98)Σ1 + λ1I (cid:22) 3 2 (Σ + λ1I). On that event, for any λ ≥ λ1 we have (cid:98)Σ1 + λI = (cid:98)Σ1 + λ1I + (λ − λ1)I (cid:23) 1 2 (Σ + λ1I) + (λ − λ1)I (cid:23) 1 2 (Σ + λI). Therefore, (cid:18) P (cid:98)Σ1 + λI (cid:23) 1 2 (Σ + λI), ∀λ ≥ CM 2 log(3n/δ) (1 − ρ)n (cid:19) ≥ 1 − δ/3. (A.5) Similarly, we apply the first part of Corollary E.1 to {φ(xi)}i∈[n]\T and get (cid:18) P (cid:98)Σ2 + (cid:101)λI (cid:23) 1 2 (Σ + (cid:101)λI), ∀(cid:101)λ ≥ CM 2 log(3n/δ) ρn (cid:19) ≥ 1 − δ/3. (A.6) 24 Denote by A the intersection of the three events in (A.4), (A.5) and (A.6). By the union bounds, P(A) ≥ 1 − δ. Suppose that the event A happens. For any λ ≥ CM 2 log(3n/δ) (1−ρ)n , Tr[( (cid:98)Σ1 + λI)−1/2Σ0( (cid:98)Σ1 + λI)−1/2] = Tr[Σ1/2 [(1/2)(Σ + λI)−1]Σ1/2 ≤ Tr{Σ1/2 0 0 0 } = 2 Tr[(Σ + λI)−1/2Σ0(Σ + λI)−1/2]. ( (cid:98)Σ1 + λI)−1Σ1/2 0 ] Similarly, (cid:107)( (cid:98)Σ1 + λI)−1/2Σ0( (cid:98)Σ1 + λI)−1/2(cid:107) ≤ 2(cid:107)(Σ + λI)−1/2Σ0(Σ + λI)−1/2(cid:107), (cid:107)( (cid:98)Σ2 + (cid:101)λI)−1/2 (cid:98)Σ0( (cid:98)Σ2 + (cid:101)λI)−1/2(cid:107) ≤ 2(cid:107)(Σ + (cid:101)λI)−1/2 (cid:98)Σ0(Σ + (cid:101)λI)−1/2(cid:107). The last inequality and (cid:98)Σ0 (cid:22) (3/2)[Σ0 + (λ0/3)I] lead to (cid:107)( (cid:98)Σ2 + (cid:101)λI)−1/2 (cid:98)Σ0( (cid:98)Σ2 + (cid:101)λI)−1/2(cid:107) ≤ 2 * 3 2 (cid:107)(Σ + (cid:101)λI)−1/2[Σ0 + (λ0/3)I](Σ + (cid:101)λI)−1/2(cid:107) ≤ 3(cid:107)(Σ + (cid:101)λI)−1/2Σ0(Σ + (cid:101)λI)−1/2(cid:107) + 3(cid:107)(Σ + (cid:101)λI)−1/2(λ0/3)I(Σ + (cid:101)λI)−1/2(cid:107) ≤ 3(cid:107)(Σ + (cid:101)λI)−1/2Σ0(Σ + (cid:101)λI)−1/2(cid:107) + . λ0 (cid:101)λ ≥ CM 2 log(3n/δ) n Since λ0 = CM 2 log(3n0/δ) n0 and (cid:101)λ ≥ CM 2 log(3n/δ) , we have λ0 (cid:101)λ ≤ log(3n0/δ) n0 ρn (cid:30) log(3n/δ) n = n n0 * log n0 + log(3/δ) log n + log(3/δ) . Note that log(3/δ) > 0. When n ≤ n0, log n0+log(3/δ) log n0 Hence, λ0 log n } and (cid:101)λ max{1, ≤ n n0 log n+log(3/δ) ≤ log n0 log n . When n > n0, log n0+log(3/δ) log n+log(3/δ) ≤ 1. (cid:107)( (cid:98)Σ2 + (cid:101)λI)−1/2 (cid:98)Σ0( (cid:98)Σ2 + (cid:101)λI)−1/2(cid:107) ≤ 3(cid:107)(Σ + (cid:101)λI)−1/2Σ0(Σ + (cid:101)λI)−1/2(cid:107) + (cid:26) max 1, n n0 (cid:27) . log n0 log n This proves Part 1. The proof of Part 2 is very similar to that of Part 1 (using the second part of Corollary E.1 instead) and is thus omitted. A.3 Proof of Lemma 6.3 A.3.1 Part 1 Claim A.1. Choose any δ ∈ (0, 1/e] and suppose that λ ≥ M 2 log(1/δ) hold simultaneously with probability at least 1 − δ: n1 . The following inequalities |(cid:104)φ(x01), (cid:98)θλ − θ(cid:63)(cid:105)| (cid:46) M (cid:107)θ(cid:63)(cid:107)H + σ, (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)H (cid:46) ((cid:107)θ(cid:63)(cid:107)H + n1σ/M ), √ where both (cid:46)'s only hide universal constant factors. Proof of Claim A.1. On the one hand, Lemma 6.1 asserts that (cid:107) ̄θλ − θ(cid:63)(cid:107)H ≤ (cid:107)θ(cid:63)(cid:107)H and (cid:107) (cid:98)θλ − ̄θλ(cid:107)ψ2 n1λ. Assumption 4.2 and λ ≥ M 2 log(1/δ) lead to (cid:46) σ/ √ n1 |(cid:104)φ(x01), ̄θλ − θ(cid:63)(cid:105)| ≤ M (cid:107)θ(cid:63)(cid:107)H, 25 (cid:107)(cid:104)φ(x01), (cid:98)θλ − ̄θλ(cid:105)(cid:107)ψ2 (cid:46) M * σ (cid:112)n1 * M 2 log(1/δ)/n1 such that = σ (cid:112)log(1/δ) . Hence, there exists a universal constant C(cid:48) 1 (cid:18) |(cid:104)φ(x01), (cid:98)θλ − θ(cid:63)(cid:105)| ≤ C(cid:48) 1(M (cid:107)θ(cid:63)(cid:107)H + σ) P (cid:19) ≥ 1 − δ/2. On the other hand, it follows from (cid:107)( (cid:98)Σ1 + λI)−1 (cid:98)Σ1(cid:107) ≤ 1 and rank( (cid:98)Σ1) ≤ n1 that Tr[( (cid:98)Σ1 + λI)−1 (cid:98)Σ1] ≤ n1. Hence, the bound on (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)H in Lemma 6.1 and the assumption λ ≥ M 2 log(1/δ)/n1 imply that (cid:18) (cid:19) P (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)H ≤ (cid:107)θ(cid:63)(cid:107)H + C(cid:48) 2σ (cid:112) n1/M 2 ≥ 1 − δ/2, where C2 is a universal constant. The proof is completed by union bounds. Choose δ ∈ (0, 1/e]. When λ ≥ 8M 2 log[(n+n0)|Λ|/δ] (1−ρ)n , we have λ ≥ M 2 log{[(n + n0)|Λ|/δ]8}] (1 − ρ)n ≥ M 2 log[(n + n0)8|Λ|2/δ2] (1 − ρ)n . Thanks to Claim A.1, for every fixed λ ∈ Λ, the following inequalities hold with probability at least 1 − δ2 (n+n0)8|Λ|2 : |(cid:104)φ(x01), (cid:98)θλ − θ(cid:63)(cid:105)| ≤ C0(M (cid:107)θ(cid:63)(cid:107)H + σ), (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)H ≤ C0 n((cid:107)θ(cid:63)(cid:107)H + σ/M ). √ Here C0 is a universal constant. Part 1 of Lemma E.5, with zi = φ(x0i), w = (cid:98)θλ − θ(cid:63), r = C0(M (cid:107)θ(cid:63)(cid:107)H + σ), R = C0 √ n((cid:107)θ(cid:63)(cid:107)H + σ/M ), ε = δ2/[(n + n0)8|Λ|2], asserts that for any γ ∈ (0, 3/4]: , we have • With probability at least 1 − δ 4|Λ| − n0ε ≥ 1 − δ 2|Λ| (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 (cid:98)Σ0 ≤ (1 + γ)(cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 Σ0 + [C0(M (cid:107)θ(cid:63)(cid:107)H + σ)]2 log(4|Λ|/δ) γn0 ; • With probability at least 1 − δ 4|Λ| − (n0 + 1) (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 (cid:98)Σ0 ≥ (1 + γ)(cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 Σ0 − √ , we have ε ≥ 1 − δ 2|Λ| [C0(M (cid:107)θ(cid:63)(cid:107)H + σ)]2 log(4|Λ|/δ) γn0 δ2 (n + n0)8|Λ|2 0 (M (cid:107)θ(cid:63)(cid:107)H + σ)2 log(4|Λ|/δ) γn0 (cid:19)1/4 C2 √ (cid:18) * M 4 − √ − [C0 n((cid:107)θ(cid:63)(cid:107)H + σ/M )]2 * ≥ (1 − γ)(cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 Σ0 − ≥ (1 − γ)(cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 Σ0 − 2C2 0 ((cid:107)θ(cid:63)(cid:107)HM + σ)2 log(4|Λ|/δ) γn0 . Based on the above, we can choose a larger C0 so that (cid:18) C0ζ(δ) γ ≤ (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 (cid:98)Σ0 (1 − γ)(cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 Σ0 − P ≤ (1 + γ)(cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 Σ0 + C2 0 ((cid:107)θ(cid:63)(cid:107)HM + σ)2 n + n0 (cid:19) C0ζ(δ) γ ≥ 1 − δ |Λ| . The proof is finished by taking union bounds over λ ∈ Λ, and using the facts (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 (cid:98)Σ0 Rin( (cid:98)fλ) − Rin(f (cid:63)) and (cid:107) (cid:98)θλ − θ(cid:63)(cid:107)2 Σ0 = R( (cid:98)fλ) − R(f (cid:63)). = 26 A.3.2 Part 2 Note that δ ∈ (0, 1/e] implies that log(2/δ) (cid:46) log(1/δ). Then, the proof immediately follows from Part 2 of Lemma E.5 and union bounds. B Proof of Theorem 4.2 Suppose that Assumption 4.4 holds with a sufficiently large c. Define m = |Λ| = (cid:100)log2 n(cid:101) + 1 and λj = 2jλ0 for k = 0, 1, * * * , m − 1. Since Σ0 (cid:22) BΣ, it is easily seen that Σ (cid:23) B−1Σ0, (cid:107)Sλ(cid:107) ≤ B and Tr(Sλ) = (cid:104)Σ0, (Σ + λI)−1(cid:105) ≤ (cid:104)Σ0, (B−1Σ0 + λI)−1(cid:105) = ∞ (cid:88) j=1 Bμj μj + Bλ . Therefore, Theorem 4.1 implies that with probability at least 1 − δ, R( (cid:98)f ) − R(f (cid:63)) (cid:46) B min λ0≤λ≤λm−1 (cid:26) λ(cid:107)θ(cid:63)(cid:107)2 H + σ2 log(m/δ) n ∞ (cid:88) j=1 (cid:27) μj μj + Bλ + (B + 1) (cid:18) (cid:101)λ(cid:107)θ(cid:63)(cid:107)2 H + σ2 log(m/δ) n (cid:19) . From the facts m (cid:16) log n, λm−1 = 2m−1λ0 ≥ nλ0, (cid:101)λ (cid:16) λ0 and B ≥ 1 we obtain that with probability at least 1 − δ, R( (cid:98)f ) − R(f (cid:63)) (cid:46) B min λ0≤λ≤nλ0 (cid:26) λ(cid:107)θ(cid:63)(cid:107)2 H + σ2 log( log n δ ) n (cid:18) 1 + ∞ (cid:88) j=1 μj μj + Bλ (cid:19)(cid:27) . √ Let δ = λB. The regularity of the spectrum yields 1 + ∞ (cid:88) j=1 μj μj + Bλ = 1 + ∞ (cid:88) j=1 μj μj + δ2 ≤ 1 + D(δ) (cid:88) j=1 1 + ∞ (cid:88) j=D(δ)+1 μj δ2 (cid:46) D(δ). Then, the desired result becomes obvious. C Proof of Corollary 4.1 C.1 Part 1 Suppose μj ≤ c1j−2α, ∀j holds with some constants c1 > 0 and α > 1/2. Then, we have D(r) (cid:46) r−1/α + 1. Let E(r) = r2R2 + σ2Br−1/αn−1 log(δ−1 log n). Since λ0 (cid:16) log(n/δ) , n √ min √ Bλ0≤r≤ nBλ0 (cid:26) r2R2 + σ2B D(r) log( log n δ ) n (cid:27) (cid:46) √ min B log(n/δ)/n≤r≤ √ E(r) + σ2B log(δ−1 log n) n . B log(n/δ) (C.1) 27 Define On the one hand, r0 (cid:112)B log(n/δ)/n r0 = (cid:18) σ2B log(δ−1 log n) R2n (cid:19) α 2α+1 . (cid:19) 1 4α+2 (cid:19) 1 4α+2 = (cid:38) (cid:18) n B (cid:18) n B (cid:18) σ2 R2 (cid:18) σ2 R2 * * (cid:19) α 2α+1 (cid:19) α 2α+1 * * log α 2α+1 (δ−1 log n) (cid:112)log(n/δ) 1 (cid:112)log(n/δ) = (cid:18) n(σ/R)4α (cid:19) 1 4α+2 B log2α+1(n/δ) (cid:38) 1, where the last inequality follows from our assumption B (cid:46) n(σ/R)4α log2α+1(n/δ) . On the other hand, r0 (cid:112)B log(n/δ) = B− 1 4α+2 * (cid:19) α 2α+1 (cid:18) σ2 R2n log * α 2α+1 (δ−1 log n) (cid:112)log(n/δ) . According to our assumptions, B ≥ 1 and σ2 (cid:46) nR2. Hence, estimates, we have r0√ B log(n/δ) (cid:46) 1. Based on the above (cid:112)B log(n/δ)/n (cid:46) r0 (cid:46) (cid:112)B log(n/δ) and thus By (C.1), √ min B log(n/δ)/n≤r≤ √ B log(n/δ) E(r) (cid:46) E(r0) (cid:16) R 2 2α+1 (cid:18) σ2B log( log n δ ) (cid:19) 2α 2α+1 n . (cid:26) r2R2 + σ2B D(r) log( log n δ ) n (cid:27) (cid:19) 2α 2α+1 + σ2B log(δ−1 log n) n (cid:19) 2α 2α+1 (cid:20) 2 2α+1 + R (cid:18) σ2B log(δ−1 log n) n (cid:19) 1 2α+1 (cid:21) √ min √ Bλ0≤r≤ (cid:46) R 2 2α+1 nBλ0 (cid:18) σ2B log( log n δ ) n (cid:18) σ2B log( log n δ ) n = (cid:46) (cid:18) σ2B log( log n δ ) (cid:19) 2α 2α+1 (cid:18) n R2 + σ2B log(δ−1 log n) n (cid:19) 1 2α+1 (cid:46) R 2 2α+1 (cid:18) σ2B log( log n δ ) (cid:19) 2α 2α+1 n . where the last inequality is implied by our assumption on B. C.2 Part 2 Suppose μj ≤ c1e−c2j, ∀j holds with some constants c1 > 0 and α > 1/2. Then, we have D(r) (cid:46) log(1/r) + 1. Let E(r) = r2R2 + σ2B log(1/r)n−1 log(δ−1 log n). Since λ0 (cid:16) log(n/δ) , n √ min √ Bλ0≤r≤ nBλ0 (cid:26) r2R2 + σ2B D(r) log( log n δ ) n (cid:27) 28 E(r) + σ2B log(δ−1 log n) n (cid:46) √ ≤ E √ min B log(n/δ)/n≤r≤ (cid:18)(cid:114) B log(n/δ) n = R2B log(n/δ) n (cid:46) σ2B log2(n/δ) n + , B log(n/δ) (cid:19) + σ2B log(δ−1 log n) n σ2B log( log n δ ) n (cid:18)(cid:114) log n B log(n/δ) (cid:19) + σ2B log(δ−1 log n) n where we used the assumption that R2 (cid:46) σ2 log n. C.3 Part 3 When rank(Σ0) = D, we have D(r) ≤ D for all r > 0. Therefore, √ min √ Bλ0≤r≤ nBλ0 (cid:26) r2R2 + σ2B D(r) log( log n δ ) n (cid:27) (cid:112) ≤ ( Bλ0)2R2 + σ2B √ D( Bλ0) log( log n δ ) n = BR2λ0 + σ2BD log( log n δ ) n (cid:46) σ2BD log(n/δ) n . The last inequality follows from λ0 (cid:46) log(n/δ) n and R2 (cid:46) Dσ2. D Proof of Theorem 5.2 We introduce a deterministic oracle inequality for pseudo-labeling. Lemma D.1. Let {yλ}λ∈Λ be a collection of vectors in Rn and y(cid:63), (cid:101)y ∈ Rn. Choose any (cid:98)λ ∈ argminλ∈Λ (cid:107)yλ − (cid:101)y(cid:107)2 2. Define U = sup λ,λ(cid:48)∈Λ (cid:28) yλ − yλ(cid:48) (cid:107)yλ − yλ(cid:48)(cid:107)2 (cid:29) , , (cid:101)y − y(cid:63) with the convention 0/0 = 0. We have (cid:107)y (cid:98)λ − y(cid:63)(cid:107)2 2 ≤ inf γ>0, λ∈Λ (cid:110) (1 + γ)(cid:107)yλ − y(cid:63)(cid:107)2 2 + 4(1 + γ−1)U 2(cid:111) . Proof of Lemma D.1. Choose any λ ∈ Λ. By direct calculation, we have (cid:107)y (cid:98)λ − y(cid:63)(cid:107)2 2 − (cid:107)yλ − y(cid:63)(cid:107)2 2 = (cid:104)y (cid:98)λ − yλ, y (cid:98)λ + yλ − 2y(cid:63)(cid:105). By the assumption (cid:98)λ ∈ argminλ∈Λ (cid:107)yλ − (cid:101)y(cid:107)2 2 and the equality above, 0 ≥ (cid:107)y = (cid:107)y Hence, (cid:98)λ − (cid:101)y(cid:107)2 (cid:98)λ − y(cid:63)(cid:107)2 2 − (cid:107)yλ − (cid:101)y(cid:107)2 2 − (cid:107)yλ − y(cid:63)(cid:107)2 2 = (cid:104)y (cid:98)λ − yλ, y (cid:98)λ + yλ − 2(cid:101)y(cid:105) 2 − 2(cid:104)y (cid:98)λ − yλ, (cid:101)y − y(cid:63)(cid:105). (cid:107)y (cid:98)λ − y(cid:63)(cid:107)2 2 ≤ (cid:107)yλ − y(cid:63)(cid:107)2 2 + 2(cid:104)y (cid:98)λ − yλ, (cid:101)y − y(cid:63)(cid:105) 29 = (cid:107)yλ − y(cid:63)(cid:107)2 2 + 2(cid:107)y (cid:98)λ − yλ(cid:107)2 (cid:28) y (cid:107)y (cid:98)λ − yλ (cid:98)λ − yλ(cid:107)2 (cid:29) , (cid:101)y − y(cid:63) ≤ (cid:107)yλ − y(cid:63)(cid:107)2 ≤ (cid:107)yλ − y(cid:63)(cid:107)2 2 + 2(cid:107)y 2 + 2((cid:107)y (cid:98)λ − yλ(cid:107)2U (cid:98)λ − y(cid:63)(cid:107)2 + (cid:107)y(cid:63) − yλ(cid:107)2)U, where the last inequality follows from the fact U ≥ 0 and the triangle's inequality. Rearranging the terms, we get and thus ((cid:107)y (cid:107)y (cid:98)λ − y(cid:63)(cid:107)2 (cid:98)λ − y(cid:63)(cid:107)2U ≤ (cid:107)yλ − y(cid:63)(cid:107)2 (cid:98)λ − y(cid:63)(cid:107)2 − U )2 ≤ ((cid:107)yλ − y(cid:63)(cid:107)2 + U )2. As a result, 2 − 2(cid:107)y 2 + 2(cid:107)y(cid:63) − yλ(cid:107)2U (cid:107)y (cid:107)y (cid:98)λ − y(cid:63)(cid:107)2 ≤ (cid:107)yλ − y(cid:63)(cid:107)2 + 2U 2 ≤ (cid:107)yλ − y(cid:63)(cid:107)2 (cid:98)λ − y(cid:63)(cid:107)2 2 + 4(cid:107)yλ − y(cid:63)(cid:107)2U + 4U 2. The elementary bound leads to 2(cid:107)yλ − y(cid:63)(cid:107)2U ≤ c(cid:107)yλ − y(cid:63)(cid:107)2 2 + c−1U 2, ∀c > 0 (cid:98)λ − y(cid:63)(cid:107)2 The proof is completed by setting γ = 2c and taking the infimum. 2 ≤ (1 + 2c)(cid:107)yλ − y(cid:63)(cid:107)2 (cid:107)y 2 + (4 + 2/c)U 2. To prove Theorem 5.2, we define y(cid:63) = (g(cid:63)(z1), * * * , g(cid:63)(zn))(cid:62) and yj = (gj(z1), * * * , gj(zn))(cid:62) for all j ∈ [m]. Lemma D.1 leads to L(g (cid:98)j) ≤ inf γ>0, j∈[m] (cid:110) (1 + γ)L(gj) + 4(1 + γ−1)U 2/n (cid:111) , where U = max j,j(cid:48)∈[m] (cid:28) yj − yj(cid:48) (cid:107)yj − yj(cid:48)(cid:107)2 (cid:29) , , (cid:101)y − y(cid:63) with the convention 0/0 = 0. It is easily seen that 0 ≤ U ≤ (cid:107)E (cid:101)y − y(cid:63)(cid:107)2 + max j,j(cid:48)∈[m] n−1U 2 (cid:46) n−1(cid:107)E (cid:101)y − y(cid:63)(cid:107)2 2 + n−1 (cid:28) yj − yj(cid:48) (cid:29) , (cid:101)y − E (cid:101)y (cid:28) yj − yj(cid:48) , (cid:107)yj − yj(cid:48)(cid:107)2 (cid:107)yj − yj(cid:48)(cid:107)2 (cid:12) (cid:12) (cid:12) (cid:12) max j,j(cid:48)∈[m] (cid:29)(cid:12) (cid:12) , (cid:101)y − E (cid:101)y (cid:12) (cid:12) 2 . On the one hand, n−1(cid:107)E 2 = L(E (cid:101)g). On the other hand, (cid:101)y − y(cid:63)(cid:107)2 (cid:13) (cid:28) yj − yj(cid:48) (cid:13) (cid:13) (cid:13) (cid:107)yj − yj(cid:48)(cid:107)2 (cid:29)(cid:13) 2 (cid:13) , (cid:101)y − E (cid:101)y (cid:13) (cid:13) ψ2 ≤ V 2, ∀j, j(cid:48) ∈ [m]. The sub-Gaussian concentration and union bounds imply that with probability 1 − δ, max j,j(cid:48)∈[m] (cid:12) (cid:28) yj − yj(cid:48) (cid:12) (cid:12) (cid:12) (cid:107)yj − yj(cid:48)(cid:107)2 (cid:29)(cid:12) (cid:12) , (cid:101)y − E (cid:101)y (cid:12) (cid:12) 2 (cid:46) V 2 log(m/δ). 30 We get the desired concentration inequality in Theorem 5.2 by combing all the above estimates. To prove the bound on the expectation, fix any γ > 0 and define We have (cid:20) W = L(g (cid:98)j) − (1 + γ) min j∈[m] L(gj) + C(1 + γ−1)L(E (cid:21) (cid:101)g) . (cid:18) W > P C(1 + γ−1)V 2 n (cid:19) log(m/δ) ≤ δ, ∀δ ∈ (0, 1]. Let t = log(m/δ). Then, δ = me−t. We have (cid:18) W > P C(1 + γ−1)V 2 n t (cid:19) ≤ me−t, ∀t ≥ log m. As a result, we get (cid:18) C(1 + γ−1)V 2 n (cid:90) log m ≤ 1dt + and 0 (cid:19)−1 EW = (cid:90) ∞ (cid:18) P W > 0 C(1 + γ−1)V 2 n (cid:19) t dt (cid:90) ∞ log m me−tdt = log m + 1 (cid:18) L(E (cid:101)g) + V 2(1 + log m) n (cid:19) . EL(g (cid:98)j) ≤ (1 + γ) min j∈[m] L(gj) + C(1 + γ−1) The proof is finished by taking the infimum over γ > 0. E Technical lemmas Lemma E.1. Suppose that x ∈ Rd is a zero-mean random vector with (cid:107)x(cid:107)ψ2 ≤ 1. There exists a universal constant C > 0 such that for any symmetric and positive semi-definite matrix Σ ∈ Rd×d, (cid:16) P (cid:17) x(cid:62)Σx ≤ C Tr(Σ)t ≥ 1 − e−r(Σ)t, ∀t ≥ 1. Here r(Σ) = Tr(Σ)/(cid:107)Σ(cid:107)2 is the effective rank of Σ. Proof of Lemma E.1. This is a direct corollary of Lemma J.4 in Davis et al. (2021). Lemma E.2. Let {Xi}n then i=1 be independent random variables. If Xi ≤ b almost surely and EX 2 i ≤ v2, P (cid:18) 1 n n (cid:88) i=1 (Xi − EXi) ≤ max (cid:26) (cid:114) 2 v2 log(1/δ) n , 4b log(1/δ) 3n (cid:27)(cid:19) ≥ 1 − δ, ∀δ ∈ (0, 1). Consequently, if Xi ≥ 0 almost surely and EX 2 i ≤ v2, then P (cid:18) 1 n n (cid:88) i=1 (Xi − EXi) ≥ −2 (cid:114) (cid:19) v2 log(1/δ) n ≥ 1 − δ, ∀δ ∈ (0, 1). 31 Proof of Lemma E.2. Suppose that Xi ≤ b almost surely and EX 2 Wainwright (2019) implies that for any t ∈ R, i ≤ v2. Proposition 2.14 in (cid:18) 1 P n n (cid:88) (Xi − EXi) ≥ t (cid:19) (cid:18) ≤ exp − (cid:19) (cid:18) ≤ exp − nt2/2 2 max{v2, bt/3} (cid:19) i=1 (cid:26) (cid:18) = max exp − (cid:19) (cid:18) , exp − nt2 4v2 nt2 4bt/3 (cid:26) (cid:18) = max exp − (cid:19) (cid:18) , exp − nt2 4v2 (cid:19)(cid:27) . 3nt 4b nt2/2 v2 + bt/3 (cid:19)(cid:27) For δ ∈ (0, 1) and t = max{2v Then, P( 1 n can be obtained by applying the first part to −Xi and setting b = 0. 4b ≥ log(1/δ). i=1(Xi − EXi) ≥ t) ≤ δ. This proves the first part of Lemma E.2. The second part 4v2 ≥ log(1/δ) and 3nt }, we have nt2 , 4b log(1/δ) 3n (cid:80)n (cid:113) log(1/δ) n Lemma E.3. Let {xi}n E(xi ⊗ xi) being trace class. Define (cid:98)Σ = 1 n (cid:80)n i=1 xi ⊗ xi. i=1 be i.i.d. random elements in a separable Hilbert space H with Σ = 1. If (cid:107)xi(cid:107)H ≤ M holds almost surely for some constant M , then for any v2 ≥ (cid:107)Σ(cid:107) and r ≥ Tr(Σ)/v2, (cid:18) P (cid:107) (cid:98)Σ − Σ(cid:107) ≤ (cid:114) 8M 2v2 log(r/δ) n + 6M 2 log(r/δ) n (cid:19) ≥ 1 − δ, ∀δ ∈ (0, r/14]. 2. If (cid:107)(cid:104)xi, v(cid:105)(cid:107)2 ψ2 ≤ κE|(cid:104)xi, v(cid:105)|2 holds for all v ∈ H and some constant κ, then there exists a constant C determined by κ such that (cid:18) (cid:107) (cid:98)Σ − Σ(cid:107) ≤ C(cid:107)Σ(cid:107) max P (cid:114) (cid:26)(cid:114) r n , r n , log(1/δ) n , log(1/δ) n (cid:27)(cid:19) ≥ 1 − δ, ∀δ ∈ (0, 1/e]. Here r = Tr(Σ)/(cid:107)Σ(cid:107)2 is the effective rank of Σ. Proof of Lemma E.3. The second part directly follows from Theorem 9 in Koltchinskii and Lounici (2017). To prove the first part, we invoke a Bernstein inequality for self-adjoint opera- tors. The Euclidean case is an intermediate result in the proof of Theorem 3.1 in Minsker (2017). Section 3.2 of the same paper extends the result to the Hilbert setting. Lemma E.4. Let H be a separable Hilbert space, and {Xi}n Schmidt operators satisfying EXi = 0 and (cid:107) (cid:80)n almost surely for all i and some U > 0. If t2 ≥ σ2 + U t/3, then EX 2 i=1 i=1 be independent self-adjoint, Hilbert- i (cid:107)2 ≤ σ2. Assume that (cid:107)Xi(cid:107)H ≤ U holds P (cid:18)(cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 Xi (cid:13) (cid:13) (cid:13) (cid:13) (cid:19) ≥ t ≤ 14 Tr((cid:80)n i=1 σ2 EX 2 i ) (cid:18) exp − t2/2 σ2 + U t/3 (cid:19) . Let Xi = xi ⊗ xi − Σ. Under Assumptions 2.2 and 4.2, (cid:107)Xi(cid:107) ≤ (cid:107)xi ⊗ xi(cid:107) + (cid:107)E(xi ⊗ xi)(cid:107) ≤ 2M 2, Hxi ⊗ xi) − Σ2 (cid:22) E((cid:107)xi(cid:107)2 EX 2 i = E((cid:107)xi(cid:107)2 Hxi ⊗ xi) (cid:22) M 2Σ (cid:22) M 2v2I. Choose any r ≥ Tr(Σ)/v2. Lemma E.4 with U = 2M 2 and σ2 = nM 2v2 imply that when t2 ≥ σ2 + U t/3, P((cid:107) (cid:98)Σ − Σ(cid:107) ≥ t/n) ≤ 14nM 2 Tr(Σ) σ2 (cid:18) exp − t2/2 nM 2v2 + 2M 2t/3 (cid:19) 32 ≤ 14nM 2 Tr(Σ) nM 2v2 (cid:18) exp − t2/2 nM 2v2 + 2M 2t/3 (cid:19) (cid:18) ≤ 14r exp − t2/2 nM 2v2 + 2M 2t/3 (cid:19) . Choose any δ ∈ (0, r 14 ] and set t = (cid:112) 8nM 2v2 log(r/δ) + 6M 2 log(r/δ). We have t ≥ U + σ and Then, (cid:18) (cid:107) (cid:98)Σ − Σ(cid:107) ≥ P (cid:18) ≤ 14r exp − (cid:26) t2 ≥ U t + σt ≥ U t + σ(U + σ) ≥ U t/3 + σ2. (cid:114) 8M 2v2 log(r/δ) n t2/2 nM 2v2 + 2M 2t/3 (cid:19) (cid:18) + (cid:19) 6M 2 log(r/δ) n (cid:19) = P((cid:107) (cid:98)Σ − Σ(cid:107) ≥ t/n) (cid:18) ≤ 14r exp − t2/2 2 max{nM 2v2, 2M 2t/3} (cid:19) = 14r max exp − (cid:26) (cid:18) ≤ 14r max exp − , exp t2 4nM 2v2 8nM 2v2 log(r/δ) 4nM 2v2 (cid:18) − (cid:19) (cid:19)(cid:27) 3t 8M 2 (cid:18) , exp − 3 * 6M 2 log(r/δ) 8M 2 (cid:19)(cid:27) ≤ 14r exp[−2 log(r/δ)] = 14r * (δ/r)2 = 14δ r * δ ≤ δ. Corollary E.1. Let {xi}n E(xi ⊗ xi) being trace class. Define (cid:98)Σ = 1 n an event A = {(1 − γ)(Σ + λI) (cid:22) (cid:98)Σ + λI (cid:22) (1 + γ)(Σ + λI)}. i=1 be i.i.d. random elements in a separable Hilbert space H with Σ = i=1 xi ⊗ xi. Choose any constant γ ∈ (0, 1) and define (cid:80)n 1. If (cid:107)xi(cid:107)H ≤ M holds almost surely for some constant M , then there exists a constant C ≥ 1 determined by γ such that P(A) ≥ 1 − δ holds so long as δ ∈ (0, 1/14] and λ ≥ CM 2 log(n/δ) . n 2. If (cid:107)(cid:104)xi, v(cid:105)(cid:107)2 ψ2 ≤ κE|(cid:104)xi, v(cid:105)|2 holds for all v ∈ H and some constant κ, then there exists a constant C ≥ 1 determined by γ and κ such that P(A) ≥ 1 − δ holds so long as δ ∈ (0, 1/e] and λ ≥ C Tr(Σ) log(1/δ) n . Proof of Corollary E.1. We will apply Lemma E.3 to (cid:101)xi = (Σ+λI)−1/2xi and (cid:101)Σ = (Σ+λI)−1Σ. λ, Suppose that (cid:107)xi(cid:107)H ≤ M holds almost surely for some constant M . We have (cid:107)(cid:101)xi(cid:107)H ≤ M/ Tr( (cid:101)Σ) ≤ Tr(Σ)/λ ≤ M 2/λ and (cid:107) (cid:101)Σ(cid:107) ≤ 1. Hence, the M and v2 in Lemma E.3 can be set to be √ M/ λ and 1, respectively. For any λ ≥ M 2 log(n/δ) , we have √ n Tr( (cid:101)Σ)/v2 ≤ M 2/λ ≤ n log(n/δ) ≤ n. Hence, we can take r = n in Lemma E.3 to get (cid:18) (cid:107)(Σ + λI)−1/2( (cid:98)Σ − Σ)(Σ + λI)−1/2(cid:107) ≤ P (cid:114) 8M 2 log(n/δ) nλ + 6M 2 log(n/δ) nλ (cid:19) ≥ 1 − δ 33 so long as δ ∈ (0, n/14]. As a result, for any γ ∈ (0, 1) there exists a constant C ≥ 1 such that when δ ∈ (0, 1] and λ ≥ CM 2 log(n/δ) , we have n (cid:18) P (cid:107)(Σ + λI)−1/2( (cid:98)Σ − Σ)(Σ + λI)−1/2(cid:107) ≤ γ (cid:19) ≥ 1 − δ. This proves the first part of Corollary E.1. Now, suppose that (cid:107)(cid:104)xi, v(cid:105)(cid:107)2 ψ2 ≤ κE|(cid:104)xi, v(cid:105)|2 holds for all v ∈ H and some constant κ. Then, P (cid:18) the same property holds for (cid:107)(Σ + λI)−1/2( (cid:98)Σ − Σ)(Σ + λI)−1/2(cid:107) ≤ C(cid:107) (cid:101)Σ(cid:107) max (cid:101)xi. The second part of Lemma E.3 implies that for any δ ∈ (0, 1/e], , (cid:101)r n log(1/δ) n (cid:101)r = Tr( (cid:101)Σ)/(cid:107) (cid:101)Σ(cid:107)2. Note that (cid:107) (cid:101)Σ(cid:107) ≤ 1 and (cid:107) (cid:101)Σ(cid:107) ≤ Tr( (cid:101)Σ) ≤ Tr(Σ)/λ. We have log(1/δ) n (cid:26)(cid:114) Here (cid:101)r n (cid:27)(cid:19) (cid:114) , , ≥ 1 − δ. (cid:114) r n = (cid:113) Tr( (cid:101)Σ)(cid:107) (cid:101)Σ(cid:107)/n ≤ (cid:113) Tr( (cid:101)Σ)/n ≤ (cid:114) Tr(Σ) nλ , r n (cid:114) (cid:107) (cid:101)Σ(cid:107) (cid:107) (cid:101)Σ(cid:107) (cid:107) (cid:101)Σ(cid:107) (cid:107) (cid:101)Σ(cid:107) = Tr( (cid:101)Σ)/n ≤ (cid:115) = log(1/δ) n log(1/δ) n ≤ Tr(Σ) log(1/δ) nλ , we have Tr(Σ) nλ , (cid:107) (cid:101)Σ(cid:107)2 log(1/δ) n ≤ (cid:114) Tr(Σ) log(1/δ) nλ , When δ ∈ (0, 1/e] and λ ≥ Tr(Σ) log(1/δ) (cid:114) n (cid:26)(cid:114) (cid:107) (cid:101)Σ(cid:107) max (cid:101)r n , (cid:101)r n , log(1/δ) n , log(1/δ) n (cid:27) (cid:114) ≤ Tr(Σ) log(1/δ) nλ ≤ 1. As a result, for any γ ∈ (0, 1) there exists a constant C(cid:48) ≥ 1 such that when δ ∈ (0, 1/e] and λ ≥ C(cid:48) Tr(Σ) log(1/δ) , we have n (cid:18) (cid:107)(Σ + λI)−1/2( (cid:98)Σ − Σ)(Σ + λI)−1/2(cid:107) ≤ γ P (cid:19) ≥ 1 − δ. The proof is finished by renaming the constant C(cid:48). Below is a lemma on random quadratic forms, which is crucial for connecting empirical (in- sample) and population (out-of-sample) squared errors. Lemma E.5. Let H be a separable Hilbert space with inner product (cid:104)*, *(cid:105) and norm (cid:107) * (cid:107)H; {zi}n i=1 be i.i.d. samples from a distribution over H such that S = E(zi ⊗ zi) is trace class; w ∈ H be random and independent of {zi}n 1. Suppose that E(cid:107)z1(cid:107)4 i=1. Define (cid:98)S = 1 n H < ∞ and the inequality i=1 zi ⊗ zi. We have the following results. (cid:80)n P(|(cid:104)z1, w(cid:105)| ≤ r and (cid:107)w(cid:107)H ≤ R) ≥ 1 − ε holds for some deterministic r > 0, R > 0 and ε ∈ (0, 1). Then, for any γ ∈ (0, 3/4] and δ ∈ (0, 1), we have (cid:18) (cid:104)w, (cid:98)Sw(cid:105) ≤ (1 + γ)(cid:104)w, Sw(cid:105) + (cid:18) (cid:104)w, (cid:98)Sw(cid:105) ≥ (1 − γ)(cid:104)w, Sw(cid:105) − P P r2 log(1/δ) γn r2 log(1/δ) γn 34 (cid:19) ≥ 1 − δ − nε, − R2ε1/4(cid:113) E(cid:107)z(cid:107)4 H (cid:19) ≥ 1 − δ − (n + 1) √ ε. 2. Suppose there exists κ > 0 such that (cid:107)(cid:104)z1, v(cid:105)(cid:107)2 ψ2 ≤ κ(cid:104)v, Sv(cid:105), ∀v ∈ H. There exists a universal constant C ≥ 1 such that when γ = Cκ (cid:113) log(2/δ) n ≤ 1, we have (cid:16) P (1 − γ)(cid:104)w, Sw(cid:105) ≤ (cid:104)w, (cid:98)Sw(cid:105) ≤ (1 + γ)(cid:104)w, Sw(cid:105) (cid:17) ≥ 1 − δ, ∀δ ∈ (0, 1). Proof of Lemma E.5. Throughout the proof, we use z to denote a random element drawn from distribution μ, independently of w and {zi}n To begin with, we work on the first inequality in Part 1. Fix any v ∈ H, define Ui = |(cid:104)zi, v(cid:105)|2 and ̄Ui = Ui1{Ui≤r2}. We have i=1 . (cid:104)v, (cid:98)Sv(cid:105) − (cid:104)v, Sv(cid:105) = = ≤ 1 n 1 n 1 n n (cid:88) i=1 n (cid:88) i=1 n (cid:88) i=1 (Ui − EUi) (Ui − ̄Ui) + (Ui − ̄Ui) + 1 n 1 n n (cid:88) i=1 n (cid:88) i=1 ( ̄Ui − E ̄Ui) + 1 n n (cid:88) (E ̄Ui − EUi) i=1 ( ̄Ui − E ̄Ui). The last inequality follows from E ̄Ui − EUi = E( ̄Ui − Ui) = −E(Ui1{Ui>r2}) ≤ 0. For any t ∈ R, P((cid:104)v, (cid:98)Sv(cid:105) − (cid:104)v, Sv(cid:105) ≤ t) ≥ P (cid:18) 1 n n (cid:88) i=1 (Ui − ̄Ui) + 1 n n (cid:88) ( ̄Ui − E ̄Ui) ≤ t (cid:19) i=1 n (cid:88) ( ̄Ui − E ̄Ui) ≤ t, Ui = ̄Ui for all i ∈ [n] (cid:19) ( ̄Ui − E ̄Ui) ≤ t, max i∈[n] (cid:19) |(cid:104)zi, w(cid:105)| ≤ r ( ̄Ui − E ̄Ui) > t ( ̄Ui − E ̄Ui) > t (cid:19) (cid:19) (cid:18) − P (cid:19) max i∈[n] |(cid:104)zi, v(cid:105)| > r − nP(|(cid:104)z, v(cid:105)| > r). (E.1) n (cid:88) i=1 n (cid:88) i=1 The last inequality follows from union bounds and the fact that {zi}n are i.i.d., 0 ≤ ̄Ui ≤ r2 and Note that { ̄Ui}n i=1 are i.i.d. i = E(|(cid:104)zi, v(cid:105)|41{|(cid:104)zi,v(cid:105)|≤r}) ≤ r2E|(cid:104)zi, v(cid:105)|2 = r2(cid:104)v, Sv(cid:105). Lemma E.2 with Xi = ̄Ui, b = r2 and v2 = r2(cid:104)v, Sv(cid:105) yields P (cid:18) 1 n n (cid:88) i=1 ( ̄Ui − E ̄Ui) ≤ max (cid:26) (cid:114) 2 (cid:104)v, Sv(cid:105)r2 log(1/δ) n , 4r2 log(1/δ) 3n (cid:27)(cid:19) ≥ 1 − δ, ∀δ ∈ (0, 1). 35 ≥ P = P (cid:18) 1 n (cid:18) 1 n ≥ 1 − P ≥ 1 − P i=1 n (cid:88) i=1 (cid:18) 1 n (cid:18) 1 n i=1 E ̄U 2 It is easily seen that (cid:114) 2 (cid:104)v, Sv(cid:105)r2 log(1/δ) n ≤ γ(cid:104)v, Sv(cid:105) + r2 log(1/δ) γn , ∀γ > 0. As a result, for any γ ∈ (0, 3/4], (cid:114) (cid:26) max 2 (cid:104)v, Sv(cid:105)r2 log(1/δ) n , P (cid:18) 1 n n (cid:88) i=1 ( ̄Ui − E ̄Ui) ≤ γ(cid:104)v, Sv(cid:105) + (cid:27) 4r2 log(1/δ) 3n r2 log(1/δ) γn ≤ γ(cid:104)v, Sv(cid:105) + r2 log(1/δ) γn (cid:19) ≥ 1 − δ, ∀δ ∈ (0, 1). The above estimate and (E.1) lead to (cid:18) (cid:104)v, (cid:98)Sv(cid:105) ≤ (1 + γ)(cid:104)v, Sv(cid:105) + P (cid:19) r2 log(1/δ) γn ≥ 1 − δ − nP(|(cid:104)z, v(cid:105)| > r). Thanks to the independence of w, z and {zi}n i=1 , we can replace v with w to get (cid:18) P (cid:104)w, (cid:98)Sw(cid:105) ≤ (1 + γ)(cid:104)w, Sw(cid:105) + (cid:19) r2 log(1/δ) γn ≥ 1 − δ − nε, ∀δ ∈ (0, 1). ≥ 1 − δ − nP(|(cid:104)z, w(cid:105)| > r) Next, we prove the second inequality in the Part 1. Again, we fix any v ∈ H, define Ui = |(cid:104)zi, v(cid:105)|2 and ̄Ui = Ui1{Ui≤r2}. We have (cid:104)v, (cid:98)Sv(cid:105) − (cid:104)v, Sv(cid:105) = 1 n n (cid:88) i=1 (Ui − ̄Ui) + 1 n n (cid:88) i=1 ( ̄Ui − E ̄Ui) + 1 n n (cid:88) i=1 (E ̄Ui − EUi). By direct calculation, − n (cid:88) i=1 Hence, (E ̄Ui − EUi) = E(|(cid:104)z, v(cid:105)|21{|(cid:104)z,v(cid:105)|>r}) ≤ E((cid:107)z(cid:107)2 H(cid:107)v(cid:107)2 H1{|(cid:104)z,v(cid:105)|>r}) (cid:113) ≤ (cid:107)v(cid:107)2 H E(cid:107)z(cid:107)4 H * P(|(cid:104)z, v(cid:105)| > r). (cid:18) P (cid:104)v, (cid:98)Sv(cid:105) − (cid:104)v, Sv(cid:105) ≥ t − (cid:107)v(cid:107)2 H (cid:113) E(cid:107)z(cid:107)4 H * P(|(cid:104)z, v(cid:105)| > r) (cid:19) (cid:18) ̄Ui = Ui for all i ∈ [n], ≥ P ≥ P (cid:18) 1 n n (cid:88) i=1 ( ̄Ui − E ̄Ui) ≥ t (cid:19) ( ̄Ui − E ̄Ui) ≥ t (cid:19) 1 n n (cid:88) i=1 − nP(|(cid:104)z, v(cid:105)| > r). The second part of Lemma E.2 applied to Xi = ̄Ui ≥ 0 and v2 = r2(cid:104)v, Sv(cid:105) yields (cid:114) P (cid:18) 1 n n (cid:88) i=1 ( ̄Ui − E ̄Ui) ≥ −2 r2(cid:104)v, Sv(cid:105) log(1/δ) n (cid:19) ≥ 1 − δ, ∀δ ∈ (0, 1). 36 For any γ > 0, we have (cid:114) 2 r2(cid:104)v, Sv(cid:105) log(1/δ) n ≤ γ(cid:104)v, Sv(cid:105) + r2 log(1/δ) γn P (cid:18) 1 n n (cid:88) i=1 ( ̄Ui − E ̄Ui) ≥ −γ(cid:104)v, Sv(cid:105) − (cid:19) r2 log(1/δ) γn ≥ 1 − δ. (cid:18) (cid:104)v, (cid:98)Sv(cid:105) − (cid:104)v, Sv(cid:105) ≥ −γ(cid:104)v, Sv(cid:105) − r2 log(1/δ) γn − (cid:107)v(cid:107)2 H (cid:113) E(cid:107)z(cid:107)4 H * P(|(cid:104)z, v(cid:105)| > r) (cid:19) and thus Then, P ≥ 1 − δ − nP(|(cid:104)z, v(cid:105)| > r). Since w is independent of {zi}n i=1 and z, (cid:18) P (cid:104)w, (cid:98)Sw(cid:105) ≥ (1 − γ)(cid:104)w, Sw(cid:105) − r2 log(1/δ) γn ≥ 1 − δ − nP(|(cid:104)z, w(cid:105)| > r) ≥ 1 − δ − nε. − (cid:107)w(cid:107)2 H (cid:113) E(cid:107)z(cid:107)4 H * P(|(cid:104)z, w(cid:105)| > r|w) (cid:19) (E.2) We now provide a high-probability bound on (cid:107)w(cid:107)2 H (cid:113) E(cid:107)z(cid:107)4 H * P(|(cid:104)z, w(cid:105)| > r|w). Define an event A = {|(cid:104)z, w(cid:105)| ≤ r and (cid:107)w(cid:107)H ≤ R} and a set Ω = {w0 ∈ H : P(A|w = w0) > 1 − ε}. We have √ 1 − ε ≤ P(A) = EwP(A|w) = Ew[P(A|w)(1{w∈Ω} + 1{w /∈Ω})]. When w /∈ Ω, P(A|w) ≤ 1 − √ ε; when w ∈ Ω, we can use the trivial bound P(A|w) ≤ 1. Therefore, 1 − ε ≤ 1 * P(w ∈ Ω) + (1 − √ ε)P(w /∈ Ω) = 1 − √ εP(w /∈ Ω), which leads to P(w /∈ Ω) ≤ √ ε. Choose any w0 ∈ Ω. We claim that (cid:107)w0(cid:107)H ≤ R. Indeed, if (cid:107)w0(cid:107)H > R, then P(Ac|w = w0) = 1 contradicts the definition of Ω. Therefore, (cid:113) E(cid:107)z(cid:107)4 H * P(|(cid:104)z, w(cid:105)| > r|w = w0) ≤ R2(cid:113) E(cid:107)z(cid:107)4 H * P(Ac|w = w0) ≤ R2(cid:113) E(cid:107)z(cid:107)4 H √ ε. (cid:107)w0(cid:107)2 H We get (cid:18) (cid:107)w(cid:107)2 H P (cid:113) E(cid:107)z(cid:107)4 H * P(|(cid:104)z, w(cid:105)| > r|w) ≤ R2ε1/4(cid:113) E(cid:107)z(cid:107)4 H (cid:19) ≥ P(w ∈ Ω) ≥ 1 − √ ε. Combining this with (E.2), we finally get (cid:18) P (cid:104)w, (cid:98)Sw(cid:105) ≥ (1 − γ)(cid:104)w, Sw(cid:105) − √ ≥ 1 − δ − nε − ε ≥ 1 − δ − (n + 1) r2 log(1/δ) γn √ ε. − R2ε1/4(cid:113) E(cid:107)z(cid:107)4 H (cid:19) Finally, we come to Part 2. Suppose there exists κ > 0 such that (cid:107)(cid:104)z, v(cid:105)(cid:107)2 ψ2 ≤ κ(cid:104)v, Sv(cid:105), ∀v ∈ H. 37 Fix any v ∈ H and define Ui = |(cid:104)zi, v(cid:105)|2. Then, {Ui}n i=1 are i.i.d. and (cid:107)Ui(cid:107)ψ1 (cid:46) (cid:107)(cid:104)zi, v(cid:105)(cid:107)2 ψ2 ≤ κ(cid:104)v, Sv(cid:105). By Proposition 5.17 in Vershynin (2010) (a Bernstein-type inequality), P(|(cid:104)w, (cid:98)Sw(cid:105) − (cid:104)w, Sw(cid:105)| ≥ t) = P (cid:18)(cid:12) (cid:12) (cid:12) (cid:12) 1 n n (cid:88) i=1 (cid:12) (cid:12) (Ui − EUi) (cid:12) (cid:12) (cid:19) ≥ t (cid:20) ≤ 2 exp − cn min (cid:26)(cid:18) t κ(cid:104)v, Sv(cid:105) (cid:19)2 , t κ(cid:104)v, Sv(cid:105) (cid:27)(cid:21) . Choose any δ ∈ (0, 1) and set t = κ(cid:104)v, Sv(cid:105) max (cid:26)(cid:114) log(2/δ) cn , log(2/δ) cn (cid:27) , we get P(|(cid:104)v, (cid:98)Sv(cid:105) − (cid:104)v, Sv(cid:105)| ≤ t) ≥ 1 − δ. Let C = max{1/ √ c, 1/c, 1}. Then, (cid:18) P |(cid:104)v, (cid:98)Sv(cid:105) − (cid:104)v, Sv(cid:105)| ≤ Cκ(cid:104)v, Sv(cid:105) max (cid:26)(cid:114) log(2/δ) n , log(2/δ) n (cid:27)(cid:19) ≥ 1 − δ. Since w is independent of {zi}n i=1 , replacing v with w yields (cid:18) (cid:19) (1 − γ0)(cid:104)v, Sv(cid:105) ≤ (cid:104)v, (cid:98)Sv(cid:105) ≤ (1 + γ0)(cid:104)v, Sv(cid:105) ≥ 1 − δ P with γ0 = Cκ max{ If γ = Cκ (cid:113) log(2/δ) n max{ , (cid:113) log(2/δ) n log(2/δ) n } = (cid:113) log(2/δ) n ≤ 1, then we see from C ≥ 1 and κ ≥ 1 that log(2/δ) log(2/δ) n }. , (cid:113) log(2/δ) n and γ0 = γ. We obtain the desired result. ≤ 1. Hence, n References Aronszajn, N. (1950). Theory of reproducing kernels. Transactions of the American mathematical society 68 337–404. Ben-David, S., Blitzer, J., Crammer, K., Kulesza, A., Pereira, F. and Vaughan, J. W. (2010). A theory of learning from different domains. Machine learning 79 151–175. Blanchard, G. and Massart, P. (2006). Discussion: Local Rademacher complexities and oracle inequalities in risk minimization. The Annals of Statistics 34 2664 – 2671. URL https://doi.org/10.1214/009053606000001037 Cai, T. T. and Wei, H. (2021). Transfer learning for nonparametric classification: Minimax rate and adaptive classifier. The Annals of Statistics 49. Cameron, A. C., Gelbach, J. B. and Miller, D. L. (2008). Bootstrap-based improvements for inference with clustered errors. The review of economics and statistics 90 414–427. 38 Caponnetto, A. and Yao, Y. (2010). Cross-validation based adaptation for regularization oper- ators in learning theory. Analysis and Applications 8 161–183. Cortes, C., Mansour, Y. and Mohri, M. (2010). Learning bounds for importance weighting. Advances in neural information processing systems 23. Davis, D., Díaz, M. and Wang, K. (2021). Clustering a mixture of Gaussians with unknown covariance. arXiv preprint arXiv:2110.01602 . Donoho, D. L. (1994). Statistical estimation and optimal recovery. The Annals of Statistics 22 238–270. Hanneke, S. and Kpotufe, S. (2019). On the value of target data in transfer learning. Advances in Neural Information Processing Systems 32. Heckman, J. J. (1979). Sample selection bias as a specification error. Econometrica: Journal of the econometric society 153–161. Hirshberg, D. A., Maleki, A. and Zubizarreta, J. R. (2019). Minimax linear estimation of the retargeted mean. arXiv preprint arXiv:1901.10296 . Hirshberg, D. A. and Wager, S. (2021). Augmented minimax linear estimation. The Annals of Statistics 49 3206–3227. Hoerl, A. E. and Kennard, R. W. (1970). Ridge regression: Biased estimation for nonorthogonal problems. Technometrics 12 55–67. Huang, J., Gretton, A., Borgwardt, K., Schölkopf, B. and Smola, A. (2006). Correcting sample selection bias by unlabeled data. Advances in neural information processing systems 19. Kallus, N. (2020). Generalized optimal matching methods for causal inference. The Journal of Machine Learning Research 21 2300–2353. Koltchinskii, V. and Lounici, K. (2017). Concentration inequalities and moment bounds for sample covariance operators. Bernoulli 23 110–133. Kpotufe, S. and Martinet, G. (2021). Marginal singularity and the benefits of labels in covariate- shift. The Annals of Statistics 49 3299–3323. Lee, D.-H. (2013). Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on challenges in representation learning, ICML, vol. 3. Lei, Q., Hu, W. and Lee, J. (2021). Near-optimal linear regression under distribution shift. In International Conference on Machine Learning. PMLR. Li, K.-C. (1982). Minimaxity of the method of regularization of stochastic processes. The Annals of Statistics 10 937–942. Little, R. J. and Rubin, D. B. (2019). Statistical analysis with missing data, vol. 793. John Wiley & Sons. Liu, M., Zhang, Y., Liao, K. and Cai, T. (2020). Augmented transfer regression learning with semi-non-parametric nuisance models. arXiv preprint arXiv:2010.02521 . 39 Ma, C., Pathak, R. and Wainwright, M. J. (2022). Optimally tackling covariate shift in RKHS-based nonparametric regression. arXiv preprint arXiv:2205.02986 . Maity, S., Sun, Y. and Banerjee, M. (2022). Minimax optimal approaches to the label shift problem in non-parametric settings. Journal of Machine Learning Research 23 1–45. Minsker, S. (2017). On some extensions of Bernstein's inequality for self-adjoint operators. Statis- tics & Probability Letters 127 111–119. Mou, W., Ding, P., Wainwright, M. J. and Bartlett, P. L. (2023). Kernel-based off-policy estimation without overlap: Instance optimality beyond semiparametric efficiency. arXiv preprint arXiv:2301.06240 . Mou, W., Wainwright, M. J. and Bartlett, P. L. (2022). Off-policy estimation of linear func- tionals: Non-asymptotic theory for semi-parametric efficiency. arXiv preprint arXiv:2209.13075 . Mousavi Kalan, M., Fabian, Z., Avestimehr, S. and Soltanolkotabi, M. (2020). Minimax lower bounds for transfer learning with linear and one-hidden layer neural networks. Advances in Neural Information Processing Systems 33 1959–1969. Pan, S. J. and Yang, Q. (2010). A survey on transfer learning. IEEE Transactions on knowledge and data engineering 22 1345–1359. Pathak, R., Ma, C. and Wainwright, M. (2022). A new similarity measure for covariate shift with applications to nonparametric regression. In International Conference on Machine Learning. PMLR. Reeve, H. W., Cannings, T. I. and Samworth, R. J. (2021). Adaptive transfer learning. The Annals of Statistics 49 3618–3649. Schmidt-Hieber, J. and Zamolodtchikov, P. (2022). Local convergence rates of the least squares estimator with applications to transfer learning. arXiv preprint arXiv:2204.05003 . Shimodaira, H. (2000). Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of statistical planning and inference 90 227–244. Speckman, P. (1979). Minimax estimates of linear functionals in a hilbert space. Unpublished manuscript . Sugiyama, M. and Kawanabe, M. (2012). Machine learning in non-stationary environments: Introduction to covariate shift adaptation. MIT press. Tripuraneni, N., Adlam, B. and Pennington, J. (2021). Covariate shift in high-dimensional random feature regression. arXiv preprint arXiv:2111.08234 . Vapnik, V. (1999). The nature of statistical learning theory. Springer science & business media. Vershynin, R. (2010). Introduction to the non-asymptotic analysis of random matrices. arXiv preprint arXiv:1011.3027 . Wahba, G. (1990). Spline models for observational data. SIAM. 40 Wainwright, M. J. (2019). High-dimensional statistics: A non-asymptotic viewpoint, vol. 48. Cambridge University Press. Wu, J., Zou, D., Braverman, V., Gu, Q. and Kakade, S. M. (2022). The power and limitation of pretraining-finetuning for linear regression under covariate shift. arXiv preprint arXiv:2208.01857 . Yang, F., Zhang, H. R., Wu, S., Su, W. J. and Ré, C. (2020). Analysis of information transfer from heterogeneous sources via precise high-dimensional asymptotics. arXiv preprint arXiv:2010.11750 . Zadrozny, B. (2004). Learning and evaluating classifiers under sample selection bias. In Proceed- ings of the twenty-first international conference on Machine learning. 41
http://arxiv.org/abs/2302.10158v1
2023-02-20T18:45:24
2023-02-20T18:45:24
Sparse PCA Beyond Covariance Thresholding
In the Wishart model for sparse PCA we are given $n$ samples $Y_1,\ldots, Y_n$ drawn independently from a $d$-dimensional Gaussian distribution $N({0, Id + \beta vv^\top})$, where $\beta > 0$ and $v\in \mathbb{R}^d$ is a $k$-sparse unit vector, and we wish to recover $v$ (up to sign). We show that if $n \ge \Omega(d)$, then for every $t \ll k$ there exists an algorithm running in time $n\cdot d^{O(t)}$ that solves this problem as long as \[ \beta \gtrsim \frac{k}{\sqrt{nt}}\sqrt{\ln({2 + td/k^2})}\,. \] Prior to this work, the best polynomial time algorithm in the regime $k\approx \sqrt{d}$, called \emph{Covariance Thresholding} (proposed in [KNV15a] and analyzed in [DM14]), required $\beta \gtrsim \frac{k}{\sqrt{n}}\sqrt{\ln({2 + d/k^2})}$. For large enough constant $t$ our algorithm runs in polynomial time and has better guarantees than Covariance Thresholding. Previously known algorithms with such guarantees required quasi-polynomial time $d^{O(\log d)}$. In addition, we show that our techniques work with sparse PCA with adversarial perturbations studied in [dKNS20]. This model generalizes not only sparse PCA, but also other problems studied in prior works, including the sparse planted vector problem. As a consequence, we provide polynomial time algorithms for the sparse planted vector problem that have better guarantees than the state of the art in some regimes. Our approach also works with the Wigner model for sparse PCA. Moreover, we show that it is possible to combine our techniques with recent results on sparse PCA with symmetric heavy-tailed noise [dNNS22]. In particular, in the regime $k \approx \sqrt{d}$ we get the first polynomial time algorithm that works with symmetric heavy-tailed noise, while the algorithm from [dNNS22]. requires quasi-polynomial time in these settings.
[ "Gleb Novikov" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10158v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10158v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "stat.ML" ]
3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 8 5 1 0 1 . 2 0 3 2 : v i X r a Sparse PCA Beyond Covariance Thresholding ∗ † Gleb Novikov February 21, 2023 Abstract In the Wishart model for sparse PCA we are given n samples Y1, . . . , Yn drawn independently Rd is a k- 0, Id , where β > 0 and v ∈ from a d-dimensional Gaussian distribution N sparse unit vector, and we wish to recover v (up to sign). d , then for every t + ( We show that if n > Ω ( dO t ) that solves this problem as long as ( ≪ ) βvv⊤) n * k there exists an algorithm running in time β & k √nt p ln 2 ( + td k2 . ) / √d, called Covariance Prior to this work, the best polynomial time algorithm in the regime k Thresholding (proposed in [KNV15a] and analyzed in [DM14]), required β & k k2 . ln √n ) ( For large enough constant t our algorithm runs in polynomial time and has better guarantees than Covariance Thresholding. Previously known algorithms with such guarantees required quasi-polynomial time dO log d p + ≈ 2 d / ( ). In addition, we show that our techniques work with sparse PCA with adversarial per- turbations studied in [dKNS20]. This model generalizes not only sparse PCA, but also other problems studied in prior works, including the sparse planted vector problem. As a conse- quence, we provide polynomial time algorithms for the sparse planted vector problem that have better guarantees than the state of the art in some regimes. Our approach also works with the Wigner model for sparse PCA. Moreover, we show that it is possible to combine our techniques with recent results on sparse PCA with symmetric heavy- √d we get the first polynomial time tailed noise [dNNS22]. In particular, in the regime k algorithm that works with symmetric heavy-tailed noise, while the algorithm from [dNNS22] requires quasi-polynomial time in these settings. ≈ ∗ 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 815464). † ETH Zürich. 1 4 8 12 16 Contents 1 Introduction 1.1 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Techniques 3 The Wishart Model 4 Adversarial Perturbations 5 The Wigner Model 5.1 Classical Settings . . . . . . . . . . . 5.2 Adversarial Perturbations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Heavy-tailed Symmetric Noise References A Properties of sparse vectors B Linear Algebra C Concentration Inequalities 23 . . . . . . 23 . . . . . . 25 26 30 32 34 35 1 Introduction 0, Id We study sparse principal component analysis in the Wishart and Wigner models. First we describe the Wishart model (that is sometimes also called the spiked covariance model). In this model, we are given n samples Y1, . . . , Yn drawn1 independently from d-dimensional Gaussian distribution Rd is a k-sparse2 unit vector. The goal is to compute N v, v is close to 1 (say, is greater than 0.99) with high an estimator probability3. In this paper we mostly focus on the regime when the number of samples n is greater than the dimension d, and in this section of the paper we always assume that4 n > Ω (unless ( stated otherwise). , where β > 0 and v v = 1 and k ˆ v such that ˆ ∈ |h ˆ βvv⊤ i| + d k ) (cid:1) (cid:0) Classical settings. The standard approach in covariance estimation is to consider the empirical Y ⊤Y (where Y is the matrix with rows Y1, . . . , Yn). The top eigenvector of 1 Y ⊤Y is covariance 1 n n d n , and in non-sparse settings (k = d) these highly correlated with v or guarantees are information theoretically optimal. For k < d, there exists an estimator with better candidates for the support of v and is close to v or guarantees. It uses exhaustive search over all v as long as β & q − d k v iff β & k log k / de ( n − [AW09, BR13b, BR13c]. q ) , and these guarantees are information theoretically optimal in sparse settings (cid:0) (cid:1) As was observed in [JL09], known algorithmic guarantees for sparse PCA are strictly worse than √d, no polynomial time algorithm is the statistical guarantees described above. In the regime k known to work if β . d n , the top eigenvector of the empirical covariance is a good estimator). [JL09] proposed a polynomial time algorithm (called Diagonal thresholding) n (recall that if β & ≫ d q q v as long as β & k log d n , which is better than the top √d, but is worse than the information-theoretically optimal estimator q − that finds an estimator that is close to v or eigenvector of Y ⊤Y if k by a factor √k. ≪ Later many computational lower bounds of different kind appeared: reductions from the planted clique problem [BR13a, BR13b, WBS16, GMZ17, BBH18, BB19], low degree polynomial lower bounds [DKWB19, dKNS20], statistical query lower bounds [BBH+21], SDP and sum-of- squares lower bounds [KNV15b, MW15, PR22], lower bounds for Markov chain Monte Carlo methods [AWZ20]. These lower bounds suggest that the algorithms described above should have √d (the top eigen- optimal guarantees in the regimes k vector), so it is unlikely that there exist efficient algorithms with significantly better guarantees if k √d (Diagonal thresholding) and k √d. ≫ ≪ √d is more interesting. For a long time no efficiently computable estimator with provable guarantees better than the top eigenvector of Y ⊤Y or than Diagonal thresholding was known, until [DM14] proved that a polynomial time algorithm (called Covariance thresholding) ≈ ≪ √d or k The regime k ≫ computes an estimator that is close to v or . This estimator can exploit sparsity if k < √d and is better than Diagonal thresholding and the top eigenvector of the empirical q − ( ) / v as long as β & k log k2 ed n 1We use boldface to denote random variables. 2That is, this vector has at most k non-zero coordinates. 3It is impossible to recover the sign of v from Y1, . . . , Yn. 4We hide absolute constant multiplicative factors using the standard notations O , Ω (*) (*) , ., &. 1 2 covariance in the regime d1 − / o ) < k < √d. 1 ( vnew, v |h ˆ i| These results show that in order to work with smaller signal strength β, one needs either to work with larger number of samples n, or to work with a sparser vector v (i.e. smaller k). [DKWB19] (and independently [HSV20]) showed that in some regimes there is another option: one can (smoothly) increase the running time needed to compute the estimator in order to work with smaller signal strength. Concretely, they showed that for 1 6 t 6 k log d there exists an estimator that can be log d v as long as β & k computed in time dO tn . N, let βDT be the smallest signal The following example illustrates their result: For some n, d, k strength such that Diagonal thresholding, given an instance Y of sparse PCA with n samples, > 0.99 dimension d, sparsity k and signal strength βDT, finds a unit vector with probability at least 0.99. Now suppose that for the same n, d, k, we are given an instance Y ′ of the sparse PCA with smaller signal strength βnew = 0.01 βDT. Then their result implies vnew such that that there exists a polynomial time algorithm that, given Y ′, finds a unit vector ˆ ) (via Limited brute force) and is close to v or vDT such that ˆ vDT, v |h ˆ q − i| ∈ / * ( t > 0.99 with probability at least 0.99. However, the approach of [DKWB19] and [HSV20] is not compatible with the optimal guar- √d. More precisely, if we define βCT as the smallest signal strength for antees in the regime k Covariance thresholding (in the same way as we defined βDT for Diagonal thresholding), then the Limited brute force that works with signal strength 0.01 βCT requires t to be at least log d and hence runs in quasi-polynomial time dO ). Prior to this work it was the fastest algorithm in this regime. log d ( ≈ * A √d ( and n > Ω ( be an arbitrary currently known polynomial time algorithm for sparse PCA. Let β Our result shows that it is possible to smoothly increasy running time in order to work with . It can be informally described as ) smaller signal strength as long as k 6 O follows: Let be the smallest signal strength such that d, n > Ω √d ( ) , v A , given an instance Y of sparse PCA with, dimension samples, sparsity k 6 O such , and signal strength β > 0.99 with probability at least 0.99. For arbitrary constant C > 1, let βC = 1 that . A Then there exists a polynomial time5 algorithm, that, given an instance of sparse PCA Y ′ with vnew such that signal strength βC and the same parameters n, d, k as for Y , finds a unit vector ˆ , finds a unit vector v |h ˆ C β v ˆ A i| d d A A A (cid:17) (cid:16) ) vnew, v |h ˆ i| > 0.99 with probability6 0.99. In particular, our result implies that there exists a polynomial time algorithm that works with signal strength 0.01 βCT, which is a significant improvement compared to the best previously known (quasi-polynomial time) algorithm. Moreover, our result also implies the first polynomial time algorithm that can exploit sparsity and has better guarantees than the top eigenvector even in the regime k > √d (as long as k 6 O √d ). * (cid:16) (cid:17) Semidefinite programming and adversarial perturbations. [dGJL04] introduced Basic SDP for sparse PCA. Basic SDP achieves guarantees of both the top eigenvector of the empirical covariance and Diagonal Thresholding. Later [dKNS20] proved that it also achieves the guarantees of Covari- ance thresholding, and hence captures the best currently known polynomial time guarantees. Moreover, [dKNS20] showed that Basic SDP also works with adversarial perturbations. More 5The degree of the polynomial depends on C. 6Moreover, our results imply that vnew, v |h ˆ i| > 0.99 with probability 1 o 1 ) ( − as d → ∞ 2 precisely, if a small (adversarially chosen) value Eij is added to every entry Yij of the sparse PCA instance, Basic SDP still recovers v or v with high probability. Known estimators that are not based on semidefinite programming, including top eigenvector of the empirical covariance, Diagonal thresholding, Covariance Thresholding and Limited brute force, do not work with adversarial perturbations. [dKNS20] also provided a family of algorithms based on sum-of-squares relaxations that work with adversarial perturbations and achieves the guarantees of Limited brute force from [DKWB19]. − Similar to non-adversarial case, Basic SDP and Limited brute force based on sum-of-squares are √d, the sum-of-squares approach from [dKNS20] not compatible with each other: in the regime k requires degree log d in order to achieve better guarantees than Basic SDP, so the corresponding estimator can be computed only in quasi-polynomial time. ≈ We show that our technique also works with adversarial perturbations. We remark that we do not use higher degree sum-of-squares, but only Basic SDP for sparse PCA (with some preprocessing and postprocessing steps). ) d One of the applications of our result is an improvement in the planted sparse vector problem. For this problem we focus on the regime Ω < n < d. In this problem, we are given an n-dimensional ( subspace of Rd that contains a sparse vector, and the goal is to estimate this vector. This problem was extensively studied in literature in different settings [HD13, BKS14, HSSS16, QZL+20, MW21, ZSWB22, DK22]. It is not hard to see7 that this problem in the Gaussian basis model (in the sense of [MW21]) is a special case of sparse PCA with small perturbations. Our result shows that as long as k 6 √td, there exists a dO ) time algorithm for this problem. Previously known polynomial time algorithms in the regime n > Ω required k 6 C√d for some absolute constant C and did not work ( for k > C√d. Lower bounds against restricted computational models [dKNS20, DKWB21, DH23] suggest that in the regime n > Ω this problem is unlikely to be solvable in polynomial time if ( k √d. d d ) ) ( t ≫ The Wigner model and symmetric noise. Our results can be naturally applied also to the Wigner W , where λ > 0, v model. In this model, we are given Y = λvv⊤ + Rd is a k-sparse unit vector, and d. For this model, Covariance thresholding finds an estimator highly correlated with W 0, 1 ) ( v as long as λ & k , while Limited brute force from [DKWB19] computes ) − v as long as λ & k t in time dO ( ) an estimator close to v or ∼ with v or log e d k2 N p ∈ / × ( d log d t . As in the Wishart model, these √d. Our techniques can be naturally applied to q approaches are not compatible in the regime k the Wigner model, leading to the best known algorithms for this problem. ≈ − As in the Wishart model, our techniques also work with adversarial perturbations. Moreover, our approach is compatible with the recent study of Sparse PCA with symmetric noise [dNNS22]. In this model, Gaussian noise W is replaced by an arbitrary noise N with symmetric about zero independent entries that are only guaranteed to be bounded by 1 with probability8 Ω . They 1 ) ( proposed a quasi-polynomial algorithm for sparse PCA in these settings and provided evidence √d this running time cannot be improved (via reduction from the planted that in the regime k √d clique problem). Combining their algorithm with our approach, we show that in the regime k there exists a polynomial time algorithm that solves this problem. ≪ ≈ 7See the discussion before Corollary 1.3. 8Note that even the first moment is not required to exist. 3 1.1 Results Classical settings. Our first result is estimating v in the Wishart model in classical settings (without perturbations). Theorem 1.1 (The Wishart model). Let n, d, k, t v βuv⊤ + Rd is a k-sparse unit vector, W 0, 1 ) ( There exists an absolute constant C > 1, such that if n > C k, k > Ct ln2 d and d independent of u. N, β > 0. Let Y = p N ∼ ∈ ∈ × n W , where u N 0, 1 ) ( ∼ n, β > C k √tn s ln 2 td k2 + 1 d n + , (cid:19) (cid:19) (cid:18) then there exists an algorithm that, given Y , k and t, in time n , probability 1 as d o (cid:18) 1 ) ( − → ∞ v, v |h ˆ i| > 0.99 . dO t ( ) outputs a unit vector * v such that with ˆ Let us compare our guarantees with previously known estimators. For simplicity we assume n > Ω ( d , in this regime our algorithm can recover the signal if β & k √tn ) work, in these settings all known (subexponential time) algorithms required ln 2 r (cid:16) . Prior to this td k2 + (cid:17) β & min √ln d, k √tn (cid:26) k √n ln 2 ( + d / k2 , ) n d / , (cid:27) p √ln d corresponds to Limited brute force from [DKWB19] that runs in time n p where k √tn k 2 √n the top eigenvector of the empirical covariance. k2 ln + d / ) ( corresponds to Covariance Thresholding from [DM14], and p For k 6 d1 2 − / Ω ) (say, k 6 d0.49), the guarantees of the algorithm from [DKWB19] are similar to 1 ours (up to a constant factor). For k > d1 1 2 ) our algorithm can work with asymptotically smaller − / signal strength (with the same running time). o ( ( To compare with Covariance Thresholding and the top eigenvector of the empirical covariance, dO t ( ), * n corresponds to d / p 6 k 6 O √d . Note in this regime both Covariance Thresholding and √d consider the regime Ω the top eigenvector require (cid:17) (cid:16) (cid:16) (cid:17) β > c d n / k), and they do not work for smaller β. Our for some specific constant c (that depends on √d p condition on β in these settings is / β & k √tn √ln t , / d p so if β = ε ln t t and get an estimator that is highly correlated with v or n for arbitrary constant ε, we can choose large enough constant t such that ε√d & t k ). Neither Covariance Thresholding nor the top eigenvector of the empirical covariance can work with small values of ε, and Limited brute force from [DKWB19] requires quasi-polynomial time n v in polynomial time n dO dO q − * ( log d ( ) in these settings. * 4 It is also interesting to compare our upper bound with the low degree polynomial lower bound ln2 n , polynomials of degree D 6 n √d from [dKNS20]. They showed that in the regime k 6 O cannot distinguish9 Y1 . . . , Yn N from Y1 . . . , Yn (cid:17) (cid:16) / N 0, Id ) ( if ∼ 0, Id ( βvv⊤) ∼ + β . k √Dn * ln 2 (cid:18) Dd k2 + . (cid:19) − √d √d 6 k 6 O v with and hence for such β they cannot be used to design an estimator that is close to v or high probability. Their lower bound does not formally imply that our upper bound is tight (that is, it does not imply that there are no better estimators than ours among low degree polynomials). However, there is an interesting similarity between their lower bound and our upper bound. In particular, in the regime Ω might (implicitly) use polynomials of degree D = t ln t that are computed in time dO (cid:16) (cid:17) ). If this statement can be formalized, it may lead to an algorithm that works in a small sample regime n n that we have in the logarithmic factor in the bound on β is necessary for our techniques. Many other algorithms, like Basic SDP or Covariance Thresholding, also have similar terms. However, the low-degree lower bound does not have this term and [dKNS20] provided an algorithm based on low degree polynomials that does not have such a term and works as long as β & k even for very small n (e.g. n = d0.01). Finding an estimator with guarantees √n ) similar to ours in the small sample regime n d is an interesting open question, and low degree polynomials might be useful in designing such an estimator. , their lower bound suggests that our algorithm d. The term d 2 ( ≪ ≪ k2 td ln p + / / (cid:17) (cid:16) ( t Adversarial perturbations. Our approach also works in the presence of adversarial perturba- tions. Theorem 1.2 (The Wishart model with adversarial perturbations). Let n, d, k, t W Let Y = independent of u and E p n, v ∼ d is a matrix such that E , where u Rn βuv⊤ + 0, 1 ) ( Rd is a k-sparse unit vector, W N ∈ ∈ × + ∈ N, β > 0, ε N ∼ 0, 1 . ) d n × ∈ ( 0, 1 ) ( E k k1 → 2 6 ε * min β, β k , n / * where E p 2 is the maximal norm of the columns of E and ε < 1. There exists an absolute constant C > 1, such that if n > C k, k > Ct ln2 d, k1 → k np o β > C k √tn s ln 2 + (cid:18) td k2 1 + (cid:18) d n . (cid:19) (cid:19) and ε time n p * 6 1 ε C min ln 1 ( / t dO ) outputs a unit vector (cid:8) ( 1, min n ) d β n β, v such that with probability 1 o p ˆ p / (cid:9) * o 1 ) ( − as d , → ∞ , then there exists an algorithm that, given Y, k and t, in v, v |h ˆ 9More precisely, they cannot strongly distinguish sequences of distributions in the sense of [KWB19]. > 0.99 . i| 5 β β, min E is interesting problem. (cid:9)p / d √k √d ( , β = Θ ) , n = Θ ) . Note that in these settings column norms of To illustrate how large the adversarial perturbations are allowed to be, consider the following , t 6 O . Then the columns of E can have norm 1 1 ) ( ) ( example: Let k = Θ as large as Ω this regime, if we allow E to be larger by a constant factor, the adversary can choose E = βuv⊤ and erase the signal. As was shown in [dKNS20], in these settings Covariance Thresholding, Diagonal Thresholding and the top eigenvector of the empirical covariance do not work with some perturbations E such that βuv⊤ can be O . Hence, in √k p p − E (cid:17) (cid:16) (cid:17) (cid:16) ( 2 6 ko 1 ). ( Our assumption on E is stronger than the assumption from [dKNS20], which is 2 . k. Designing an estimator with guarantees similar to ours that works with larger k1 E → n k k k1 → ( o ) p √d 6 k 6 O (cid:8) Similar to the non-adversarial settings, our algorithms have the same guarantees10 as the sum- Ω 1 ) and has asymptotically better guarantees 1 ). Similarly to Covariance Thresholding in the non-adversarial case, in the regime n for some specific constant c and of-squares approach from [dKNS20] if k 6 d1 2 − / if k > d1 2 / − ( n > Ω and Ω d ( does not work for smaller β. Our condition on β in these settings is β & k √tn / for arbitrary constant ε, we can choose large enough constant t such that ε√d & k ln t t and get an estimator that can be computed in polynomial time n ). Basic SDP cannot work with small values of ε, and sum-of-squares approach from [dKNS20] requires quasi-polynomial time in these settings. Basic SDP requires β > c √ln t , so if β = ε √d dO q p p n d d / (cid:16) (cid:16) (cid:17) (cid:17) * ( t The sparse planted vector problem. As was observed in [dKNS20], sparse PCA with perturba- tions is a generalization not only for the spiked covariance model, but also for the planted sparse vector problem. In this problem we are given an n-dimensional subspace of Rd spanned by n 1 random vectors and a sparse vector, and the goal is to find the sparse vector. More precisely, let g1, g2, . . . , gn be standard d-dimensional Gaussian vectors and let B be an n d matrix whose first Rd is k-sparse and unit. n Let R be a random rotation of Rn independent of g1 . . . , gn, and let Y = RB. The goal is to recover v from Y . 1 rows are g⊤1 , . . . , g⊤n 1 and the last row is a vector − v⊤, where v gn × − − ∈ k k This problem can be seen as a special case of sparse PCA with perturbation matrix E = 1 u uu⊤W (see Section 4 for the proof). Therefore, we can apply Theorem 1.2 and get 2 k − k Corollary 1.3 (The sparse planted vector problem). Let n, d, k, t Rd is a k-sparse unit vector, W n, v uu⊤W , where u N 0, 1 ) ( ∼ ∈ N, β > 0. Let Y = n N βuv⊤ + − d independent of u, and W × ∈ ∼ 0, 1 ) ( p There exists an absolute constant C > 1, such that if d > n, n > C k, k > Ct ln2 d and k 6 1 C * n , d / t then there exists an algorithm that, given Y , k and t, in time dO , probability 1 as d o 1 ) ( − → ∞ p t ( ) outputs a unit vector v such that with ˆ 2 1 u k β = k k p u⊤W 2 u k k k . 10Assuming our bound on the columns of E. v, v |h ˆ i| > 0.99 . 6 Prior to this work, in the regime n > Ω ( , polynomial time estimators were known only if ) √n for some small constant c < 1 (the existence of such an algorithm follows from Theorem / √n, sparsity can still be exploited and there / k 6 cd 4.5 from [dKNS20]). We show that even if k > 100d are estimators that can be computed in polynomial time. d The Wigner model and symmetric noise. Our techniques also work with sparse PCA in the Wigner model. Theorem 1.4 (The Wigner model). Let k, d, t k-sparse unit vector and W d and E 0, 1 ) ( There exists an absolute constant C > 1, such that if k > Ct ln d, N, λ > 0. Let Y = λvv⊤ + Rd 6 1 ∈ ∈ d. N ∼ E × × d W C λ E , where v + Rd is a ∈ k , and / k k∞ λ > C k ln 2 ( td + t / k2 ) , r then there exists an algorithm that, given Y, k and t, in time dO , probability 1 as d o 1 ) ( − → ∞ v, v |h ˆ i| > 0.99 . t ( ) outputs a unit vector v such that with ˆ Note that E is allowed to be as large as possible (up to a constant factor). Similar to the Wishart model, previously known polynomial time algorithms required λ & min log d t k ( r , k log q 2 ( + k2 d / ) , √d , ) log d t q corresponds to Limited brute force from [DKWB19], and min where k 2 log ( + / corresponds to Basic SDP. Similarly to the Wishart model, in the regime k > d1 2 1 o ) we get − / asymptotically better guarantees than the algorithm from [DKWB19]. In the regime n > Ω and ( Basic SDP requires λ > c√d for some specific constant c and does not work Ω 6 k 6 O √d √d p n d n k ) ) o ( k2 , √d (cid:16) (cid:17) (cid:16) (cid:17) for smaller λ. Our condition on λ in these settings is λ & k ln t t , so if λ = ε√d for arbitrary constant q ε, we can choose large enough constant t such that ε√d & k computed in polynomial time dO brute force requires quasi-polynomial time in these settings. ln t t and get an estimator that can be ). Basic SDP cannot work with small values of ε, and Limited q ( t Our techniques can be also applied to more general model with symmetric noise studied in [dNNS22]. N , where v N, λ > 0. Let Y = Theorem 1.5 (Sparse PCA with symmetric heavy-tailed noise). Let k, d, t d is a λvv⊤ + 0, 1 ) ( random matrix with independent (but not necessarily identically distributed) symmetric about zero entries11 such that for all i, j Rd is a k-sparse unit vector such that ∈ √k and N 6 100 / > 0.1 . 6 1 , P k∞ N ∼ ∈ d v k × d Nij There exists an absolute constant C > 1, such that if k > Ct ln d and (cid:3) ∈ [ ] (cid:2)(cid:12) (cid:12) (cid:12) (cid:12) 11That is, N ij and N − ij have the same distribution. λ > C k * k2 td + √t / , (cid:1) ln 2 (cid:0) 7 t ( ) outputs a unit vector v such that with ˆ then there exists an algorithm that, given Y , k, t and λ, in time dO probability 1 as d o , 1 ) ( − → ∞ v, v > 0.99 . i| k2 it is not a problem since √t grows faster than ln t. Note that in this theorem we have ln |h ˆ 2 td + / instead of ln 2 ( + td k2 ) / . In the regime k √d ≈ (cid:1) (cid:0) (cid:17) (cid:16) √d √d If Ω 6 k 6 O p , this algorithm runs in polynomial time as long as λ > ε√d for (arbitrary) constant ε. It is the first known polynomial time algorithm for this model, since the algorithm from [dNNS22] requires quasi-polynomial time. For example, our algorithm finds an estimator close to v or 100 when the noise has iid Cauchy entries12 (with location 0 and scale 1), while prior to this work the fastest known algorithm in this regime required quasi-polynomial time even for standard Gaussian noise. v in polynomial time if k = √d and λ = k − / (cid:16) (cid:17) 2 Techniques The idea of our approach is similar to the well-known technique of reducing the constant in the planted clique problem. Recall that an instance of the planted clique problem is a random graph G sampled according to the following distribution: First, a graph is sampled from Erdős- Rényi distribution (i.e. each pair of vertices is chosen independently to be an edge with 2), and then a random subset of vertices of size k is chosen (uniformly from the sets of probability 1 / size k and independently from the graph) and the clique corresponding to these vertices is added to the graph. The goal is to find the clique. The problem can be solved in quasi-polynomial time, however, no polynomial time algorithm is known in the regime k 6 o m, 1 / √m 2 ) G( . [AKS98] proposed a spectral algorithm that can be used to find the clique in polynomial time if k & √m. They also introduced a technique that allows to find the clique in polynomial time if k > ε√m for arbitrary constant ε > 0. The idea is to look at every subset T of vertices of size induced by the vertices of G that are adjacent to T t & log ( t m . ε2m vertices, (i.e. adjacent to every vertex of T). This subgraph has approximately m′ = 2− and if T was a part of the clique, then the clique is preserved in H , and since k & √m′, we can ) find a clique applying the spectral algorithm to H t ), so it is polynomial for constant ε. . The running time of the algorithm is mO ) and consider the subgraph H 1 / T ( T ( T ( ε ) ) (cid:1) (cid:0) ( A similar (but technically more challenging) idea can be also used for sparse PCA. Recall that the instance of sparse PCA (in the Wishart model) is Y = Rd d independent of u. To illustrate the idea, we assume that v is a k-sparse unit vector, W 0, 1 N × ) ( √k. Instead of the adjacency matrix of the graph, we have the is flat, i.e. its nonzero entries are 1 / empirical covariance 1 n Y ⊤Y . For simplicity, let us ignore cross terms and assume that W , where u βuv⊤ + 0, 1 ) ( n, v p N ∼ ± ∼ ∈ n Y ⊤Y 1 n 2 u k n k ≈ βvv⊤ + W ⊤W . 1 n N 0, Id , ) ( Since u u k recover v. Similar to the planted clique, if β & (that computes the top eigenvector of the empirical covariance). n. So we assume that we are given βvv⊤ + d / W ⊤W , and the goal is to n, there is a spectral algorithm for this problem ∼ ≈ 1 n k 2 p 12Cauchy noise is very heavy-tailed, the entries do not even have a finite first moment. 8 / / d n ≈ ≈ εk √d and β = ε Suppose that n > d, k √n for some constant ε > 0. We can look at Y ⊤Y that would be each subset T of entries of size t < k and try to find a (principal) submatrix of 1 n an analogue of the graph H from the algorithm for the planted clique. One option is to say that Y ⊤Y is large. However, an entry i is "adjacent" to T if the sum of the elements in the i-th row of 1 n since v has both positive and negative entries, the sum can be small even if here were no noise and T v supp ( t be the set of all t-sparse vectors with entries from Let s . Hence we also need to take the signs of the entries of v into account. ) . Let us call s } t is correct, then t correct if = sign ∈ S T ( vi p 0, si ⊂ v 1 ) supp ( and for all nonzero si, sign ( ) { . If s ) ± ∈ S supp ( S ) ⊂ ) ( βviv j s j(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 2k (cid:12) be a principal submatrix induced by indices adjacent to s. The size of H (cid:12) (cid:12) adjacent to s if either let us call an entry i Y ⊤Y s Õj supp ∈ viv⊤s > βt (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) k . /( 1 n d / (cid:12) (cid:12) s ( ) i = βt = β ∈ [ ∈ S s ) ( For s and let H (cid:12) (cid:12) where p is the probability that is greater than βt adjacent to s. The vector W s has distribution N , hence Id (cid:12) (cid:0) ) (cid:12) i-th row of W ⊤ is independent of W s, and the distribution of the tail bound for the Gaussian distribution, W ⊤W s 0, t ( 1 n (cid:12) (cid:12) ] (cid:1) * i (cid:1) s ∈ or i s , supp ) ( is close to pd, ) (cid:12) (cid:0) ( (cid:12) . We need to count i ∉ supp 2k s ( ) ) /( W s √tn. Since i ∉ supp s , the ) ( k k ≈ W ⊤W s 1 n 0, t i is close to N . By n ) / ( ) (cid:0) (cid:1) In our case, x = β√tn h(cid:12) (cid:0) (cid:12) 2k . Hence for P W ⊤W s 1 n i > x n t / i p 6 exp x2 / − 2 . (cid:0) (cid:1) ln td k2 , ) / ( (cid:1) (cid:12) (cid:12) β & k √tn . ) ( p ln k2 we get x & and p = exp td / Moreover, by the same argument, k′ ≈ (cid:0) the signal part of H s ( spectral algorithm to recover the sparse vector from H 2 p (cid:1) is close to βvv⊤. Since for correct s we get β & (cid:1) p . k2 t entries. s ( k > 0.999k entries of v are adjacent to correct s, so n, we can try to use the d′/ . Therefore, H ) has d′ . k2 x2 − 1 / − td /( p / s ( ) ) ) (cid:0) Here we see the difference between planted clique and sparse PCA. In the planted clique problem, if we take a subset of the clique, we can easily recover the whole clique from the output of the spectral algorithm and we do not need to consider other sets after that. In sparse PCA, since we do not know β exactly, it might not be easy to understand if the observed s was correct or not from the output of the spectral algorithm. ) ( s ∈ S We use the following observation: if we have computed the list L = t, we can compute a vector close to v (or to of the top eigenvectors v) from this list. Indeed, if we entries (in absolute value) of the vectors from L, we get a new list , but also the corresponding ) -sparse unit vectors x (in particular, ) L′ is close to v. Moreover, for all O -sparse vectors. It turns out that for correct s not only ) for all s of H erase all but the largest O L′ of O -sparse vector v′( k O ) for all vectors in L′), v { ̃ ) ∈ v ̃ )} − k k k s s s ( ( ( ) ( ( ( Hence we can just compute v ˆ ∈ x (cid:0) x W ⊤W 1 n x = 1 ± ̃O (cid:0) argmaxx L ′ ∈ (cid:1) x Y ⊤Y 1 n n . k / (cid:17) (cid:16)p x, and it is close to v, since Y ⊤Y 1 n x 1 (cid:0) + β 2 (cid:1) v, x i h ≈ ± ̃O (cid:1) 9 k / n , (cid:17) (cid:16)p k n and for β > k √tn , the term ̃O is smaller than β (as long as t Note that in the definition of adjacent entries we used β, which might be unknown. But that is 2 < β′ 6 β instead of β, the algorithm still works. Hence we O 1 ) such that one of them differs from β by at most not a problem: if we use some value β / can use all possible candidates from n− factor of 2, and in the end work not with the list L, but with a list of size O ) to nO 1 (cid:16)p k). ≪ / (cid:17) ( ( log n L . | * | (cid:1) (cid:0) ( ( nd2 d3 nd2 (cid:1) Remark (Comparison with the Covariance Thresholding analysis from [DM14]). Our algorithm for . For n > d, the running time is comparable to the running t = 1 has running time O ) + ̃O time of Covariance Thresholding O . The guarantees of both algorithms are the same (up to (cid:0) ) a constant factor). One advantage of our algorithm is that it is much easier to analyze. The crucial difference is that in Covariance Thresholding one has to bound the spectral norm of thresholded Wishart matrix, which requires a sophisticated probabilistic argument. In our algorithm, we only need to bound principal submatrices of the Wishart matrix, and such bounds easily follow from and a union bound argument. Another ad- concentration of the spectral norm of − vantage of our algorithms is that we can get better guarantees than Covariance Thresholding (by (cid:0) increasing t and hence also the running time) and use the same analysis for all t. W ⊤W Id 1 n (cid:1) Remark (Comparison with the algorithms from [DKWB19]). The algorithms from [DKWB19] also use vectors s t. However, the crucial difference between our approaches is that they work with log d, since for smaller β s′ ∈ S the maximizer of s (cid:1) since the correct s is only determined in the end from the list L′. Y ⊤Y 1 n s might be completely unrelated to v. For our analysis it is not a problem, ∈ S t that maximizes s Y ⊤Y (cid:0) s. This approach works only if β & k √t p 1 n (cid:0) (cid:1) β n Adversarial Perturbations. Similar approach also works in the presence of adversarial perturba- tions, that is, if the input is Y = E such that the columns of E have norm bounded by b k. This is interesting, since known algorithms for sparse PCA that use thresholding tech- niques and are not based on semidefinite programming, like Diagonal Thresholding, Covariance Thresholding, or the algorithms from [DKWB19], do not work in these settings (see [dKNS20] for more details). βuv⊤ + W ≪ p p + / As in the non-adversarial case, we can compute the submatrices H indices adjacent to s, that is, indices i such that either instead of computing the top eigenvector of H s s ( 2k /( argmaxX ) ) that are induced by or i supp . Then, ) ( s , where )i ∈ X , H ∈Pk h s ( 1 n Y⊤Ys , we compute ̃X (cid:12) (cid:0) ) (cid:12) 0 , Tr X = 1 , (cid:1) ( X ( X > βt i s (cid:12) ) ∈ (cid:12) k1 6 k k = X Rd d × v s ̃ ) v from L. ˆ P (cid:23) is the feasible region of the Basic SDP for sparse PCA. Then, we can compute the list L of top eigenvectors , and perform the same procedure as in the non-adversarial case to ) recover ̃X of ∈ (cid:9) (cid:8) k (cid:12) (cid:12) s ( ( In order to show the correctness, we need to bound all terms of 1 n Y⊤Ys. In adversarial settings n E⊤W s. Rows of E⊤ do not have large cross terms can be large, and the most problematic term is 1 norm, but W s has large norm √tn, and since E can depend on W , the entries of E⊤W s can be large. In particular, for each correct s, the adversary can always choose E such that the term n E⊤W s is large enough to make H 1 useless for recovering v. To resolve this issue, we work with some probability distribution over the set of correct s and n E⊤W s has small expectation with respect to this distribution. In particular, it implies show that 1 W s k ≈ k s ( ) 10 that for each E there exists some s′ such that the term 1 the support of v into m = k s t. Then it is enough to consider uniform distribution the concentration of spectral norm of W , with high probability n E⊤W s′ is small13. For flat v, we just divide t blocks of size t, and then each block corresponds to some correct of such s. By over the set s1, . . . , sm ∈ S U / { } 1 n2 E ∼U s Ei , W s h i 2 = 1 n2m m Ei , W s j 2 6 O Õj=1 s1, . . . , sm (cid:10) (cid:11) such that } Hence there exists some s′ ∈ { b2t n2m ( m (cid:18) n + ) (cid:19) 6 O b2t2 n k (cid:18) ≪ (cid:19) β2t2 k2 . E⊤W s′ 1 n (cid:18) (cid:19) supp v ( ) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 2 ≪ βvv⊤s′ 2 . (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ( ) v d U ] \ supp ( In addition to pd entries i The other terms of 1 use properties of n Y⊤Ys can be bounded only assuming that s′ is correct (so it is not needed to s′) anymore), hence the signal part of H ∈ [ there could be some entries adjacent to s′ that appear from 1 n ( number of such entries is at most ε2 log 1 / ( our bound14 on the maximal norm of columns of E, we get ε2 log 1 ( / is close to v. s′) properties of Basic SDP for sparse PCA, the top eigenvector of ̃X is close to βvv⊤. adjacent to s′ that appear due to the term 1 n E⊤Y W ⊤W s, s′. We show that the d, where ε is the same as in Theorem 1.2. Assuming d . βn, and by standard ε To finish the argument, we need to show that we can still compute v from L even in the presence of perturbations. It is not hard since our argument depends only on the -sparse x. As was shown in [dKNS20], our upper bound on x ) assumption on the maximal norm of columns of E is enough to obtain the desired upper bound. v close to v or ˆ x for all O 1 n Y⊤Y βvv⊤ Y⊤E Id + − − − ε k ( ( ) ) ) (cid:0) (cid:1) W . The Wigner model and symmetric noise. The same argument as for the Wishart model works in these settings, and the proof is technically W ⊤W that appears in the simpler since there are no cross terms and W is easier to analyze than 1 n Wishart model. Our approach for sparse PCA with perturbations also works for Wigner model, and the proof is much easier in this case since the adversary cannot exploit magnitude of the columns of W . In the Wigner model the input is n Y = λvv⊤ + ∈ be x if x The Wigner model with symmetric noise is more challenging. In these settings we assume that λ is known. We cannot work with Y s, since the noise is unbounded. So we first threshold the entries of Y . Concretely, for h > 0 and x R, let τh h otherwise. x ( to the entries of Y and get a new matrix T . Then We apply this transformation for some h = Θ k λ / ) ( we use our approach for matrix T and for all s . Since N is t we compute the submatrices H ) ∈ S symmetric, thresholded matrix has nice behavior comparable to the Gaussian settings. However, k, the standard deviation of the noise part also depends on it (which is since h depends on λ instead of not the case in Gaussian settings), and this is the reason why we need ln in the bound on λ. We have to choose such h in order to apply the result from [dNNS22]. As long as k & d, their algorithm applied to Y outputs a matrix that is close to λvv⊤ p in polynomial time. As in the Gaussian case, the submatrices H have small size, and we can and sign ( ∈ [− h, h k2 k2 td td ln ) * + + x 2 2 / / / s s ] ) ( ) ( (cid:1) (cid:0) ( ) 13More precisely, this term has small norm, and it is enough for our analysis. 14This is the reason why our bound on E is worse than the bound from [dKNS20]. 11 ) ( s . However, since H apply their result to every H might not have the same distribution as N . Fortunately, the error probability in [dNNS22] is very small, which allows us to use union bound and conclude that for correct s, the output of the algorithm from [dNNS22] on H is close to λvv⊤ . Moreover, since we know λ, we do not even need to work with the list of candidates in these settings: It is enough to check the norm of the output, and if it is close to λ, the output is close to λvv⊤, and we can recover v from it (up to sign). depends on Y , the noise part of H s s s ( ) ) ( ) ( 3 The Wishart Model × 0, 1 ) ( N, we use the notation Rm1 Notation. For m1, m2 ∈ from R. We denote by N 0, 1 entries. Similarly, we denote by N × ( ) N, we denote by entries. For m m the set ] [ 1, v we denote by by ∞] M denote by d matrix Y = Recall that the input is an n its spectral norm, and by its l2 norm, and for p m2 for the set of m1 × m2 matrices with entries m an m-dimensional random vector with iid standard Gaussian m2 random matrix with iid standard Gaussian Rm, we denote m2, we m2 an m1 × { p its lp norm. For a matrix M . For a vector v k k kF its Frobenius norm. W , where u βuv⊤ + ∼ d independent of u. The goal is to compute a unit vector unit vector, W 1, 2, . . . , m 0, 1 ) ( 1, m n, v Rm1 ∈ [ M N N m1 × − ∈ ∈ ∈ ∈ v } k k k k k × Rd is a k-sparse v such that ˆ > 0.99 with high probability (with respect to the randomness of u and W ). n × 0, 1 ) ( ∼ p First we define vectors zs that we will use in the algorithm. Let t S and let nonzero coordinates. For s as t be the set of all d-dimensional vectors whose entries are in t and r > 0 let zs r ( ) N be such that 1 6 t 6 k ∈ that have exactly t 1, 0, 1 {− be the d-dimensional (random) vector defined } r ( ) ∈ S v, v |h ˆ i| zsi r ( ) = Y 1 [( 1 ( Y s ⊤ )i >r * t * n ] if si = 0 otherwise The following theorem is a restatement of Theorem 1.1. Theorem 3.1. Let n, d, k, t is a k-sparse unit vector, W Suppose that n & k N, β > 0, 0 < δ < 0.1. Let Y = N 0, 1 × ) ( , k & t ln d δ2 and d independent of u. n ∈ ∼ t ln2 d δ4 + βuv⊤ + W , where u N 0, 1 ) ( ∼ n, v ∈ Rd p β & k δ2√tn s ln 2 td k2 * + d n 1 + (cid:19) (cid:19) Then there exists an algorithm that, given Y , k, t and δ, in time n (cid:18) (cid:18) that with probability 1 o 1 ) ( − as d , → ∞ Lemma 3.2. For all s t such that si = 0 and for all τ > 0, ∈ S v, v |h ˆ i| > 1 δ . − . * dO t ( ) outputs a unit vector v such ˆ P W ⊤Y s h(cid:0) > τ * k (cid:16) i (cid:1) W s k + |h v, s i| * β u k * k p 12 u k , k k W s 6 exp τ2 / − 2 . (cid:0) (cid:1) k i (cid:17) (cid:12) (cid:12) (cid:12) Proof. Denote g = W s N ∼ . 0, t ( Id * ) W ⊤Y s = i Wi , g v, s β * h + Since Wi, g and u are independent, conditional distribution of N v, s 0, u g β 2 (cid:1) (cid:10) (cid:11) p (cid:0) Wi , u . i * h i W ⊤Y s ( . The lemma follows from the triangle inequality and the tail bound for (cid:3) (cid:13) (cid:13) (cid:13) (cid:13) )i given u k k and g is 100k and suppose that n & t ln2 d, β & k δ2√tn and k & ln d δ2 . + * |h Gaussian distribution (Fact C.4). i| * + (cid:16) (cid:13) (cid:13) p (cid:17) (cid:13) (cid:13) Lemma 3.3. Let 0 < δ < 0.1, r 6 βδ . Then,15 s, v argmaxs Let s∗ ∈ t h ∈S i v k ◦ zs∗( r )k 2 = v h ◦ zs∗( r ) , v i > 1 δ , − with probability 1 d− 10. − Proof. To simplify the notation we write zsi instead of zsi 2 6 2n and tn n probability at least 1 (− assume that these bounds on k are satisfied. 2 6 g exp − u k , n 10 ) / / u and k k k k . Let g = W s∗. By Fact C.5 with r ( ) 2 6 2tn, and in this proof we 2 6 / g Let T = supp ( s∗) unit, there are two possibilities: either statement is true since Hence . Note that it is the set of t largest entries of v (by absolute value). Since v is vT vT δ, then the − > √δ √k. δ, then for every j / 2 > 1 vT 2 > 1 T, vT k 2. If zs∗ k k ∈ δ. If k vT 2 > k − − v j ◦ v k k k k k k | | (cid:13) (cid:13) (cid:13) (cid:13) 2 6 1 δ, or − 2 6 1 k k1 > √δ u , β * ∈ L k k s∗, v = vT h k i . For all i t 2 √k . / v, s∗i| h vi | > 10rtn. Note that 2 > v k L k Let = i L 10. n ∈ [ ] vi | | > √δ 10√k 1 − δ / Let us write Y ⊤Y s∗ as follows (cid:12) (cid:12) (cid:12) n o Y ⊤Y s∗ = β u 2 k h k v, s∗ v i + W ⊤W s∗ We will bound each term separately βvu⊤W s∗ v, s∗ β h i + W ⊤u . p + p Consider the term W ⊤W s∗ = W ⊤g. By the Chi-squared tail bound (Fact C.5), with probability at least 1 exp τ , 2 ) / (− − W ⊤g Since |L | L\ 6 k, with probability at least 1 (cid:1) (cid:0) (cid:13) (cid:13) (cid:13) * (|L | + . τ ) 6 2 tn supp s∗) ( exp k p , ) (cid:13) (cid:13) (cid:13) (− − 6 10√ktn 6 δ 100 β k u 2 k h v, s∗ i * v , (cid:13) (cid:13) (cid:13) (cid:13) W ⊤g supp L\ s∗) ( (cid:1) (cid:13) (cid:13) (cid:13) (cid:13) (cid:0) (cid:13) where we used β & k (cid:13) δ2√nt β Consider the term , 10 exp p ) at least 1 (− − / k . W ⊤u. Since W and u are independent, by Fact C.5 with probability v, s∗i h β v, s∗ W ⊤u 6 2 β u √k v, s∗ k k * h h i 6 δ 100 i (cid:13) (cid:13) 15Here and further we denote by a (cid:13) (cid:16)p ◦ (cid:17) L(cid:13) (cid:13) b the entrywise product of vectors a, b (cid:13) p β k u 2 k h v, s∗ i * v , (cid:13) (cid:13) ∈ Rd. (cid:13) (cid:13) 13 where we used βn & k√n δ2√t and the fact that n > t. Consider the term βvu⊤W s∗. With probability at least 1 exp (− − 0.1√nt , ) p βvu⊤W s∗ 6 2 β √t * u * k k * ( nt 4 6 δ 100 1 / ) (cid:13) (cid:13) where we used the fact that the distribution of u⊤W s∗ given (cid:13) p p (cid:13) (cid:13) (cid:13) By Lemma A.2, β k u 2 k h v, s∗ i * v , (cid:13) u (cid:13) k k is N 0, t ( * k u (cid:13) 2 (cid:13) k . ) v k L ◦ zs∗ k 2 > 1 ( − δ / 10 )k v L k 2 > 1 δ . − (cid:3) Lemma 3.4. Let r > 0 and s t. With probability at least 1 ∈ S is bounded by pd 2 pd ln δ 1 / ( ) + (cid:12) , where p = exp (cid:12) (cid:0) (cid:12) (cid:1) tnr2 (cid:12) − W TYs > t i r * 2 / * . δ, number of entries i such that − n Proof. By Lemma 3.2 and Chernoff bound Fact C.1, number of such entries is at most pd (cid:0) (cid:1) p probability at least 1 exp τ2d 2p . With τ = 2 − (cid:16) t, let N − s ) ( ln δ 1 / ( ) p / d we get the desired bound. (cid:17) = Y ⊤Y (cid:16) p Id − n * − u β k k 2v⊤v (cid:17) zs r z⊤s ( ) r ( )) ◦( and let p = exp Lemma 3.5. For s ∈ S Suppose that k > ln d. Then for each s ∈ S t, with probability 1 2d− 10, − + τd with (cid:3) tnr2 2 . / (cid:1) − (cid:0) N k s ( )k 6 10 s n βn + * pd k ln + + (cid:0) Proof. To simplify the notation we write zsi instead of zsi d is at most 2pd we get the desired bound. 2k 6 4pd pd ln ) + + + 2 ( (cid:0) (cid:1) (cid:1) e d pd (cid:18) k + (cid:19) r ( 10 pd k ln + e d pd (cid:18) k (cid:19) (cid:0) (cid:1) + . By Lemma 3.4, number of nonzero zsi ) 10. Applying Lemma C.8, (cid:3) d− − 4k with probability at least 1 p Lemma 3.6. Let 0 < δ < 0.1 and δβ 200k k > t ln d and 6 r 6 δβ 100k . Let p = exp (− tnr2 . Suppose that n > t ln2 d, 2 ) / β & k δ2√tn s ln 2 + (cid:18) td k2 * 1 + (cid:18) d n . (cid:19) (cid:19) Then βn n + * pd + k ln s (cid:1) Proof. First note that since (cid:0) (cid:0) (cid:1) e d pd + k (cid:19) + (cid:18) pd + k ln (cid:0) (cid:1) e d pd k (cid:19) + (cid:18) 6 δβn 10 . / we get td k2 + td2 k2n + (cid:19) ln 2 (cid:18) > 0.5 ln 2 * + td k2 + r td2 k2n ! , β & k δ2√tn s ln 2 + (cid:18) td k2 * 1 + (cid:18) k √nt (cid:19) (cid:19) . 14 Since βn n + * pd + k ln s (cid:0) (cid:1) (cid:0) (cid:1) e d pd k (cid:19) + (cid:18) 6 s βn n + * pd ln (cid:0) (cid:1) e p (cid:18) + s (cid:19) βn n + * k ln (cid:0) (cid:1) e d pd k (cid:19) + (cid:18) , we can bound the term with pd and the term with k separately. Let us bound the first term. Note that exp (− tnr2 4 ) / 6 exp 1 δ2 ln 2 + (cid:18) td k2 * 1 + (cid:18) k √nt (cid:19) (cid:19)(cid:21) − (cid:20) 6 δ2k kd td + n t / p q . min β, { δ2 β } * d . n / p p Hence (cid:16) √n + βn * (cid:17) p ln ( k ed k ) / Since t 6 exp tnr2 2 − (cid:18) (cid:18) (cid:19) and n > k ln ed k tnr2√dn 6 √n (cid:19) (cid:16) βn exp − (cid:18) * (cid:18) (cid:17) + p tnr2 4 √dn 6 0.01δ2βn . (cid:19) (cid:19) , the second term can be bounded as follows βn n + * k ln s (cid:0) Now, let us bound (cid:1) (cid:1) (cid:0) e d pd k (cid:19) + (cid:18) n k ln 6 s e d k (cid:18) + s (cid:19) βn k ln e d pd k (cid:19) + (cid:18) 6 0.01δβn . + The first term can be bounded as follows: (cid:1) (cid:0) pd k ln + e d pd (cid:18) 6 pd ln p e ( / ) + k ln e d . k ) / ( k (cid:19) For the second term, pd ln p e ( / ) 6 d k2 kd * td + 6 k n / p n t / p t 6 0.01δβn . k ln e d k ) / ( 6 k n / t 6 0.01δβn . p (cid:3) Lemma 3.7. Let 0 < δ < 0.1 and δβ 200k Y ⊤Y . r ( z⊤s ( ) Suppose that n & t ln2 d δ4 , k & t ln d δ2 and ) ◦ ( zs )) r ( 6 r 6 δβ 100k . For s t let ∈ S s v ˆ ( ) be the top16 eigenvector of β & k δ2√tn s ln 2 + (cid:18) td k2 * 1 + (cid:18) d n . (cid:19) (cid:19) Then there exists s′ ∈ S t such that with probability 1 10d− 10, − > 1 − 16A unit eigenvector that corresponds to the largest eigenvalue v |h ˆ , v s′ i| ) ( 20δ . 15 Proof. Let s′ ∈ argmaxs t h ∈S s, v and let i Y ⊤Y (cid:0) ◦ (cid:1) (cid:0) . Then ) v = v ̃ zs′( ◦ z⊤s′( r r ) r zs′( = β u 2 v ̃ v⊤ ̃ k k + N , s′ ) ( ) (cid:1) where N s′) ( is the same as in Lemma 3.5. By Lemma 3.6 and Lemma 3.5, with probability 1 2d− 10, − N k s′ ( )k 6 δβn . Since with probability at least 1 v |h ˆ PCA. Concretely, by Lemma B.4, > 1 n exp (− − v > , s′) i| ̃ ( δ. Using Fact B.5 we get the desired bound. u 2δ. By Lemma 3.3, with probability 1 2, we can use standard (non-sparse) 10, (cid:3) , 10 ) / 2 v k ̃ k 10d− k − 2 = − / k 2 > n v, v h ̃ k − v k ̃ i 2 6 Proof of Theorem 3.1. Since k proof we assume that this bound on k p n / u k u k 6 √2n with probability at least 1 holds. − exp (− n , in this 10 ) / Let ̃δ = δ 6 r 6 ̃δβ 100. Note that we can apply Lemma 3.7 if we can create a list of candidates for r of size at most 2 ln n (from r = 1 / t and for all candidates for r we compute For all s ̃δβ 200k / s 100k . Since we do not know β, n to r = 1). such that with probability 1 v ˆ ( ) as in Lemma 3.7. By Lemma 3.7, we 9 there d− 10 > 1 20 ln d− n − ( ) − ∈ S get a list of vectors L of size 2 ln L such that exists v∗ ∈ v∗, v n ( > 1 t ) * |S − | 20 ̃δ > 1 i| By Fact C.7 and Lemma C.9, k′-sparse norm of Y ⊤Y |h − / δ 5. nId β k − u k − 2vv⊤ is bounded by 10 ( / 10 e d n k′ ln k′) + βn k′ ln k′) p 9. Let us show that if k′ . δ2β2n ) 1 + ( e d q / ( β ln d 2d− 10. Indeed, if β > 1, then − with probability at least 1 bounded by δβn / , then this k′-sparse norm is and if β < 1, 1 (cid:0) δ2β2n β + ln d > δ2βn 2 ln d & k n t ln2 d & k δ2 , / r & k2 δ2t ln d & k δ2 . / (cid:1) δ2β2n β + 1 ln d 100k ⌈ > δ2β2n 2 ln2 d δ2 / ⌉ v, v |h ˆ > 1 δ . − i| Applying Lemma A.4 with k′ = (cid:1) (cid:0) , we can compute a unit vector v such that ˆ (cid:3) 4 Adversarial Perturbations The sparse planted vector problem. Let us show that the sparse planted vector problem is a uu⊤W . Let Y = RB. It follows that special case of sparse PCA with perturbation matrix E = 2 1 u k k − Y = Rnv⊤ gn k k + Rig⊤i . n 1 − Õi=1 16 Id Note that ( pendent of R. Hence for Gaussian vector u such that Rig⊤i has the same distribution as n 1 − i=1 Í W , where W RnR⊤n ) u = Rn, we get − 1 u k N 0, 1 ) ( ∼ n × d is inde- k gn u Y = k k uv⊤ W + − uu⊤W . 1 u k 2 k k k gn u 2 2 = k k 1 ( + d o 1 )) ( / n. Note that columns of − 1 u k k uu⊤W have norm at 2 log d with high probability. In these settings, ε from Theorem 1.1 is allowed to be as large k. Hence for d & k log d, E is allowed to have columns E d With high probability β := k k most 10 as Ω , and we get a bound 1 p ) ( of norm 10 log d. 2 . k k1 → / p p The Wishart model with perturbations. The following theorem is a restatement of Theorem 1.2. Theorem 4.1. Let n, d, k, t N, β > 0, 0 < δ < 0.1. Let ∈ where u 0, 1 ) ( ∼ a matrix such that N n, v ∈ ̃Y = βuv⊤ W E , + + Rd is a k-sparse unit vector, W p N 0, 1 ) ( ∼ n × d independent of u and E Rn d is × ∈ where E E 2 = b 6 ε min k k1 p 2 is the maximal norm of the columns of E and ε , k & t ln d → { * k k1 → Suppose that n & k δ2 and t ln2 d δ4 + β, β k , n / } * ln p 1 / ( ε ) p . δ6 min 1, min β, β n (cid:8) p (cid:9) p * n / d . o β & k δ6√tn s ln 2 + (cid:18) td k2 1 + (cid:18) d n . (cid:19) (cid:19) Then there exists an algorithm that, given Y , k and t, in time n , with probability 1 as d o 1 ) ( − → ∞ v, v |h ˆ i| > 1 δ . − dO t ( ) outputs a unit vector * v such that ˆ Lemma 4.2. Let l = min 2 1/ Then with probability 1 L ⊂ [ δ2 , k ⌉ ⌈k v k (cid:8) d . Suppose that β & k ] δ6√nt (cid:9) d− 10 there exists s′ ∈ S − and n & k t ln2 d, k & ln d. + t such that either be the set of indices of the largest (in absolute value) l entries of v, where (cid:13) (cid:13) (cid:13) (cid:13) or Moreover, 6 10δ u β k k * 2vv⊤s′ , (cid:13) (cid:13) δ. (cid:13) (cid:13) ( s′)(cid:13) (cid:13) (cid:13) (cid:13) > 1 − ε δ2 * * √d βnt * √k v k1 * k . β k − u k ̃Y⊤ ̃Y (cid:16)(cid:16) 2vv⊤ s′ (cid:17) supp (cid:17) L\ vsupp s′) ( (cid:13) (cid:13) Y ⊤E s′ (cid:13) (cid:13) 6 104 (cid:1) (cid:13) (cid:13) E⊤Y + (cid:0) (cid:13) (cid:13) 17 Proof. First note that and v L k1 > k v k k1 − δ > 1 ( − δ v k1 . )k v > v v ]\L k1 > d [ v k k − δ > 1 ( − δ . v k )k Also note that for all i k > δ v 1 k k We will define a distribution over s L k vi ∈ L k k − k . , | | n t, and then we show via probabilistic method that s′ with desired properties exists by bounding terms of ̃Y⊤ ̃Ys one by one. Also, with probability at least 1 2. − / disjoint blocks b1, . . . , bm of size17 t. Each block b j for i 2 and in the proof we will always assume that 2√n > / into m = L j t such that s v , 2√n > exp 2 ) ( Consider the partition of ⌉ i = 0 for i ∉ b j and s > 1 corresponds to s i = sign ( supp ( p . ) > √n ⌈|L |/ ) ∈ S ∈ S vi b j > > ∩ ∈ n u u v / k k k k ) ( ) t j If If |L | |L | s vsupp j ( 6 t, then δ. 1 )) > t, consider the uniform distribution (cid:13) (cid:13) = 1 m ) ( L k v, s (cid:13) (cid:13) E − = 1 v k m s j 1 s ( ( ◦ i h ( ∼U over s j . We get ) ( U v k1 > t 2 L v k k1 > δ2t k1 2 v k > δ2t 2√k . m k Moreover, E ∼U s v k1 6 t L v k k1 6 t k1 v k . m k Õj=1 ) (cid:13) (cid:13) = 1 (cid:13) (cid:13) h v, s i Let us write ̃Y⊤ ̃Y as follows: ̃Y⊤ ̃Y = β u k k 2vv⊤ + W ⊤W + βvu⊤W We will bound each term separately. p + p Consider the term EW ⊤. βW ⊤uv⊤ E⊤E + + βvu⊤E p + p βE⊤uv⊤ W ⊤E + + E⊤W . Ei , W s |h i| 2 = 1 m E ∼U s m Õj=1 Ei , W s j ) ( 2 (cid:11)(cid:12) (cid:12) (cid:10) (cid:12) (cid:12) have disjoint supports, W s Since for different j1 and j2, s j and s By the concentration of spectral norm of Gaussian matrices (Fact C.6), j2) j1) ( ( ( ) ∼ N 0, t ( ) n are independent. with probability at least 1 − (− m Õj=1 (cid:10) exp Ei , W s j ) ( 2 6 4t m ( + n Ei k ) * k 2 6 10tnb2 (cid:11) . Hence ) n E ∼U s Ei , W s |h i| 2 6 10tb2n m . Therefore, with probability at least 1 d exp (− n , ) − Ei , W s |h i| 2 6 |L | 10tb2n m s E ∼U Õi ∈L 17If the last block has smaller size, we can add arbitrary entries to it. 18 and s Ei , W s 2 6 d i| |h 10tb2n m Hence with probability at least 1 there exists s′ = s n 2 ) / such that j ) ( (− E ∼U Õi d ] ∈[ d exp − 10t v k1 k > v, s j ) ( (cid:10) (cid:11) > δ2t v 10 k1 k > δ2t 10√k , and Ei , W s 2 6 j ( ) (cid:10) Õi (cid:11)(cid:12) ∈L(cid:12) (cid:12) (cid:12) where we used |L | 40tb2n m |L | 6 40t2ε2β2n2 k 6 / 6 mt, and Ei , W s′ |h 2 6 i| 100ε δ2 (cid:18) (cid:19) d Õi ] ∈[ (cid:18) 2 100ε δ2 2 (cid:19) (cid:13) (cid:13) u β k k 2vv⊤s j ( ) (cid:13) (cid:13) 2 6 δ2 u β k k 2vv⊤s j ( (cid:13) (cid:13) 2 , ) (cid:13) (cid:13) d k * * u β k k 2vv⊤s ( j (cid:13) (cid:13) 2 . ) (cid:13) (cid:13) exp − n , 2 ) / (− Consider the term W ⊤E. By Fact C.6, with probability at least 1 W TEs j 6 tb W ⊤ ( ) (cid:13) (cid:13) Consider the term (cid:13) (cid:13) (cid:13) (cid:13) 6 10tb√n 6 10tεβn √k 6 400ε δ2 / β k u 2 k h v, s j ( )i * v 6 δ β 2vv⊤s u k k βE⊤uv⊤: (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) j ( . ) (cid:13) (cid:13) (cid:13) (cid:13) p βE⊤uv⊤s j ) ( (cid:16)p supp (cid:17) L\ ( Consider the term 6 √k s′)(cid:13) (cid:13) (cid:13) βvu⊤E: (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) βE⊤uv⊤s j ( ∞ ) (cid:13) (cid:13) (cid:13) (cid:13) p (cid:13) (cid:13) 6 u kβ b * * k v, s j ( )i k*h 6 10ε β u 2 k h k v, s j ( )i * v . p (cid:13) (cid:13) (cid:13) (cid:13) βvu⊤Es p j 6 ) (cid:13) (cid:13) (cid:13) Consider the term E⊤E: (cid:13) (cid:13) (cid:13) p ( βtb u k k 6 ε δ2 * δ2t √k * β√n u k k 6 10ε δ2 p β k u 2 k h v, s j ( )i * v . (cid:13) (cid:13) (cid:13) (cid:13) E⊤Es j ) ( supp L\ s′) ( 6 √k E⊤Es j ( * 6 √k * ∞ b2t 6 √k ε2 δ2 * δ2t k * βn 6 10ε β u 2 k h k v, s j ( )i * v . (cid:13) (cid:13) (cid:13) (cid:13) (cid:0) Moreover, note that from the bounds above we also get (cid:13) (cid:1) (cid:13) (cid:13) (cid:13) ) (cid:13) (cid:13) E⊤Y Y ⊤E + s j ( ) (cid:13) (cid:13) (cid:1) (cid:0) (cid:13) (cid:13) 6 1000 ε δ2 * r d k * * u β k k 2vv⊤s j ( (cid:13) (cid:13) ) (cid:13) (cid:13) Consider the term W ⊤W . By the Chi-squared tail bound (Fact C.5), with probability at least exp τ (cid:13) (cid:13) (cid:13) (cid:13) 6 104 ε δ2 * √d βnt * √k v k1 * k . 1 − , 2 ) / (− Since |L | W ⊤W s j ) 6 k, with probability at least 1 (cid:1) ( (cid:0) (cid:13) (cid:13) (cid:13) W ⊤W s (cid:0) (cid:13) (cid:13) (cid:13) supp L\ s j ( ( )) j ) ( (cid:1) 6 2 tn L\ − s j ( supp ( exp )) k p (− (cid:13) , (cid:13) ) (cid:13) 6 10√ktn 6 δ (cid:13) (cid:13) (cid:13) 19 (cid:13) (cid:13) * (|L | + . τ ) β k u 2 k h v, s j ( )i * v , (cid:13) (cid:13) where we used β & k δ3√nt Consider the term . βW ⊤uv⊤. Since W and u are independent, with probability at least 1 exp (− k , 2 ) / p βW ⊤uv⊤s j ) ( 6 2 u β k k √k v, s j ( )i * h 6 δ β u 2 k h k v, s j ( )i * v , where we used βn & k√n δ2√t (cid:16)p (cid:13) (cid:13) (cid:13) (cid:17) L(cid:13) (cid:13) (cid:13) p and the fact that n > t. Consider the term βW ⊤uv⊤. With probability at least 1 (cid:13) (cid:13) (cid:13) (cid:13) exp (− − 0.1√nt , ) p βvu⊤W s j ( 6 2 √t β * * k u nt 4 6 δ 1 / ) β k u 2 k h v, s j ( )i * k * ( v , where we used the fact that the distribution of u⊤W s (cid:13) p (cid:13) (cid:13) ) (cid:13) (cid:13) (cid:13) p (cid:13) (cid:13) given j ) ( u k is N 0, t ( ∼ k (cid:13) (cid:13) * k u 2 . ) k For s t let zs ∈ S r ( ) be the n-dimensional (random) vector defined as = zsi r ( ) 1 [( ̃Y⊤ ̃Ys 1 )i ( >r n t * * ] if si = 0 otherwise Lemma 4.3. Suppose that k & t ln d and − (cid:3) β & k δ2√tn s ln 2 + (cid:18) td k2 * 1 + (cid:18) βδ 1000 v 2 1 k k 6 r 6 βδ 500 v 2 1 k k . (cid:19) (cid:19) d n . Let r be such that Let s t and ∈ S Let = N s ( ) ̃Y⊤ ̃Y (cid:16) − nId β k − u k 2vv⊤ zs r r z⊤s ( ) ) ( ◦ (cid:17) (cid:0) 0 , Tr X = 1 , . . X k k1 6 k (cid:1) (cid:9) Then with probability 1 10 (cid:8) * − d− k = X P Rd d × ∈ 10, for all X X (cid:23) (cid:12) (cid:12) k, ∈ P Proof. To simplify the notation we write z instead of zs r ( ) and N instead of N s . Let ) ( X , N |h i| 6 δβn . Note that By Lemma B.6, NE = ̃Y⊤ ̃Y (cid:18) − ̃Y (cid:16) − ⊤ E (cid:17) E − ̃Y (cid:16) ◦ (cid:17)(cid:19) (cid:0) zz⊤ . (cid:1) X , N |h 6 i| N k − NE k + |h X , NE . i| X , NE |h i| 6 b2k 2b k s + ̃Y (cid:16) (cid:13) (cid:13) (cid:13) (cid:13) 20 − ⊤ E (cid:17) E − ̃Y (cid:16) ◦ ( (cid:17) . zz⊤) (cid:13) (cid:13) (cid:13) (cid:13) The first term can be bounded as follows: b2k 6 εβ2n k 6 δβ√n / / 100 6 δβn 100 . / Note that with probability at least 1 exp (− n , ) − Hence for the second term, ̃Y (cid:16) − ⊤ E (cid:17) E − ̃Y (cid:16) ◦ (cid:17) (cid:0) zz⊤ 6 10 βn (cid:1) (cid:13) (cid:13) (cid:13) (cid:13) (cid:0) n . + (cid:1) (cid:13) (cid:13) (cid:13) (cid:13) b k βn q (cid:0) n 6 ε + (cid:1) Therefore, 2β * 1 + β n 1 (cid:16) + β 6 εβn 6 δβn (cid:17) p 100 . / p X , NE |h E⊤Y i| Y ⊤E 6 δβn 10 . / By Fact A.1 and the bound on + ̃Y⊤E entries of + s′ are larger (in absolute value) than rtn k( ) s′k from Lemma 4.2, at most ε2d = ̃ 2. By Lemma 3.4, with probability 104ε d δ / / (cid:0) 2 (cid:1) at least 1 10, number of entries i such that (cid:17) E⊤ ̃Y d− (cid:16) − is bounded by pd at most 10 (cid:12) (cid:0) (cid:12) 2k 6 10 Therefore, by Lemma C.8 and Lemma 3.6, with probability at least 1 (cid:1) pd ln d, where p = exp ε2d ̃ . Hence number of nonzero entries of z is 10k with probability at least 1 (cid:1) pd ln d ε2d ̃ + pd 10 p / + 10, 10. d− 10 (cid:0) + − + + + 8 2d− p − W TYs′ r n 2 / * > t i * (cid:12) tnr2 (cid:12) − 10pd N k − NE k 6 δβn 10 / + βn n + ε2d ln * ̃ 1 ε / ̃ ( ε2d ln ) + ̃ 1 ε / ̃ ( ) . Since the second and the third terms are bounded by δβn q(cid:0) (cid:1) 10, we get the desired bound. (cid:3) / Lemma 4.4. Let 0 < δ < 0.1 and let For s ) Suppose that n & k t let ∈ S s ( be the top eigenvector of X t ln2 d, k & t ln d and ∈ P v ˆ + βδ3 v k 2 1 k 1000 6 r 6 βδ3 . 2 1 k v 500 k that maximizes k β & k δ6√tn s ln 2 + (cid:18) td k2 * 1 + (cid:18) d n (cid:19) (cid:19) Then there exists s′ ∈ S t such that with probability 1 20d− 10, − zs ̃ z⊤s ) ◦ ( ̃ . (cid:11) X , ̃Y (cid:10) . Proof. Let s′ be as in Lemma 4.2 and let s′ , v > 1 δ 10 . v |h ˆ / − ) ( v = v ̃ zs′( is the same as in Lemma 4.3. By Lemma 4.3, with probability 1 i| zs′( ◦ z⊤s′( r ̃Y⊤ ̃Y (cid:16) . Then ) v⊤ ̃ = β nId v ̃ N + − u ◦ k k (cid:17) r s r ) ( ) ) (cid:0) (cid:1) 2 , where N s ( ) d− 10, for all X 10 * − k, ∈ P X , N |h i| 6 δβn . 21 Consider By Lemma B.4, s∗ X ˆ ( ) ∈ argmaxX X , ̃Y ◦ zs∗ ̃ z⊤s∗ ̃ . ∈P s∗ X ˆ ( ) , vv⊤ ◦ (cid:10) zs∗ ̃ z⊤s∗ ̃ (cid:0) > 1 (cid:1) (cid:11) 6 ̃δ . − Hence by Fact B.5, (cid:10) By Lemma B.1, v |h ˆ , s′) ( v ̃ i| > 1 − (cid:0) , vv⊤ s∗ X ˆ ( ) (cid:1) (cid:11) > 1 − 24 ̃δ . (cid:10) 100 ̃δ. By Lemma 4.2 and Lemma A.2, with probability 1 (cid:11) d− 10, − v, v h ̃ i > 1 100 ̃δ . − Using Fact B.5 we get the desired bound. (cid:3) 2 6 Proof of Theorem 4.1. Since proof we assume that this bound on β ̃δ3 v 1000 k 6 r 6 β ̃δ3 if v k of size at most 2 ln n (starting from r = 1 / 500 2 1 2 1 k k / n k k . Since we do not know β and 6 √2n with probability at least 1 holds. Let ̃δ = δ v , in this 10 ) − 1000. Note that we can apply Lemma 4.3 / k1, we can create a list of candidates for r u k u k exp (− p n / k n and finishing at r = 1). ∈ S For all s t and for all candidates for r we compute get a list of vectors L of size 2 ln L such that exists v∗ ∈ n ( > 1 By Fact C.7, Lemma C.9, Lemma B.6, k′-sparse norm of Y ⊤Y such that with probability 1 | 10. / t ) * |S − ̃δ v∗, v i| |h s v ˆ ( ) as in Lemma 4.4. By Lemma 4.4, we 9 there d− 10 > 1 20 ln d− n − ( ) − nId β k − u k 2vv⊤ is bounded by − 10 n k′ ln e d ( / 10 e d βn k′ ln k′) + 9. Let us show that if q / ( b2k′ k′) + + 10b k′ βn q n + (cid:1) with probability at least 1 p − 3d− k′ . min δβn b2, / δ2β2n β 1 , ln d 1 δ2β2n β b2 ln d (cid:27) (cid:26) then k′ the k′-sparse norm is bounded by δβn. Indeed, if β > 1, then + + (cid:1) (cid:0) (cid:0) (cid:1) (cid:0) , and if β < 1, 1 (cid:0) and by our bound on b, 1 (cid:0) δ2β2n β + ln d (cid:1) δ2β2n β + ln d (cid:1) > δ2βn 2 ln d & k n t ln2 d & k δ2 , / r > δ2β2n 2 ln d & k2 δ2t ln d & k δ2 , / By Lemma A.4, for k′ = that v |h ˆ k′) ( , v i| > 1 δ. − 100k ⌈ / δ2 ⌉ δ2 . min δβn b2, k / δ2β2n β . / (cid:26) b2 ln d (cid:27) , we can compute a k′-sparse vector unit vector + 1 (cid:1) (cid:0) v ˆ k′) ( such (cid:3) 22 5 The Wigner Model 5.1 Classical Settings In classical settings the input is an d vector, W probability (with respect to the randomness of W ). In this section we prove the following theorem. d matrix Y = λvv⊤ + d. The goal is to compute a unit vector 0, 1 ) ( N × ∼ × d W , where v v such that ˆ ∈ v, v |h ˆ i| Rd is a k-sparse unit > 0.99 with high N, λ > 0, 0 < δ < 0.1. Let Y = ∈ βuv⊤ + W , where v ∈ Rd is a k-sparse unit Theorem 5.1. Let d, k, t vector, W d. 0, 1 N ) ( Suppose that k & t ln d δ2 ∼ × d , and λ & k δ2 r p ln 2 ( td + t / k2 ) . Then there exists an algorithm that, given Y , k, t and δ, in time dO , with probability 1 as d o 1 ) ( − → ∞ v, v > 1 δ . t ( ) outputs a unit vector v such that ˆ i| As for Wishart model, we define vectors zs |h ˆ N such that 1 6 t 6 k we denote by that have exactly t nonzero coordinates. For s r ( ) − that we will use in the algorithm. Recall the t the set of all d-dimensional vectors t let zs be d-dimensional S t: for t definition of S with values in (random) vectors defined as ∈ 1, 0, 1 } {− ∈ S zsi r ( ) = Y s 1 [( 1 ( )i= h s,Yii >r t * ] if si = 0 otherwise for some r > 0 (here Yi denotes the i-th row of Y ). Lemma 5.2. If i ∉ supp ( v , then for all s ) t and r > 0, ∈ S Proof. Since vi = 0, s, Yi P [h i > r t ] * 6 exp tr2 2 . / (cid:1) − (cid:0) s, Yi h i = h s, Wi i ∼ N 0, t ( ) . The lemma follows from the tail bound for Gaussian distribution (Fact C.4). (cid:3) Lemma 5.3. Let 0 < δ < 0.1, r 6 λδ 100k and suppose that λ & k δ2√t and k & ln d δ2 . Let s∗ ∈ argmaxs s, v i t h ∈S . Then, with probability 1 10 d− v k ◦ zs∗ k 2 = v h ◦ > 1 δ . − i − zs∗ , v Proof. To simplify the notation we write zsi instead of zsi all i δ 2 > 1 ∈ L As in the proof of Lemma 3.3, we can assume that > 10rt. Note that v, s∗i| L k , β vi − u v k k k h 2 | / r . Let ( ) 10. Lδ = i d ] ∈ [ n (cid:12) (cid:12) (cid:12) > √δ 10√k vi | | . For o s∗, v h = vT k k1 > √δt / i √k . 23 We need to bound the norm of W s∗ ∼ k / (− , 10 ) exp − probability 1 N 0, t ( * Id ) restricted to the entries of . By Fact C.5, with L By Lemma A.2, k W s∗ ( (cid:13) (cid:13) v L ◦ (cid:13) (cid:13) zs∗ k 2 > 6 2√kt 6 δ 100 k v, s∗ λ h . v i k )L 1 ( − δ / 10 )k v L k 2 > 1 δ . − (cid:3) Lemma 5.4. Let p = exp tr2 / − 2 . Then, with probability 1 d− 10, − (cid:0) max s t ∈S W (cid:1) ◦ zs r z⊤s ( ) r ) ( (cid:13) (cid:13) (cid:0) (cid:1)(cid:13) (cid:13) 6 10 s pd k + ln * (cid:0) (cid:1) d pd k (cid:19) + (cid:18) . Proof. Using the same argument as in the proof of Lemma 3.5, we get that the number of nonzero zsi 4k with probability at least pdt ln 1 t is bounded by 2pd t 2k 6 4pd t ln ) + + + n 2 / ( t ( − r for every s ∈ S ) d pd exp / ( By Fact C.6, an m − − (cid:0) . m Gaussian matrix G satisfies (cid:1) p ) × G k k 6 2√m √τ + with probability 1 4pd bound. + 4k (corresponding to nonzero rows and columns of W (for every τ > 0). By union bound over all sets of size at most ), we get the desired (cid:3) z⊤s ( ◦ ( zs )) r r ) ( exp τ 2 ) / (− − Lemma 5.5. Let 0 < δ < 0.1 and δλ 200k Y ◦ ( r z⊤s ( zs r )) Suppose that k & t ln d δ2 ( ) . , and 6 r 6 δλ 100k . For s t let ∈ S s v ˆ ( ) be the top eigenvector of Then there exists s′ ∈ S λ & k ln 2 (cid:18) t such that with probability 1 δ2√t s td k2 + 2d− . (cid:19) 10, − − s′ v |h ˆ ( ) v = v ̃ = β , v > 1 20δ . i| zs′( v ̃ 2 ◦ u r . Then ) v⊤ ̃ W + Proof. Let s′ ∈ argmaxs s, v and let t h ∈S Y i zs r z⊤s ( r k By Lemma 5.4 and the same arument as in Lemma 3.6 with n = d, with probability at least 1 ◦ ◦ k ) ( ( ) ) ) (cid:0) (cid:0) (cid:1) (cid:1) zs r z⊤s ( r , d− 10, − v By Lemma B.4, |h ˆ Therefore, by Fact B.5, , u∗) ( v ̃ i| > 1 (cid:13) (cid:13) − 3δ. By Lemma 5.3, with probability 1 (cid:0) (cid:1)(cid:13) (cid:13) W zs r z⊤s ( ) r ) ( ◦ 6 δλ . v |h ˆ ( s′ ) , v i| > 1 − 20δ . 24 d− 10, v, v h ̃ i > 1 δ. − − (cid:3) 100k , where ) 1000. Since we do not know λ, we can create a list of candidates for r of size at most 2 ln d as in Lemma 5.5 with δ′λ 200k t we compute 6 r 6 δ′λ ∈ S s ( v ˆ Proof of Theorem 5.1. For all s δ′ = δ / (from r = 1 / d to r = 1). By Lemma 5.5, we get a list of vectors L of size 2 ln there exists v∗ ∈ L such that v∗, v > 1 δ − i| |h 9 d− 10. By Fact C.7, k′-sparse norm of W is bounded by such that with probability 1 t )|S − d ( | / k′ ln 10 ( 10. Hence by Lemma A.4 with k′ = p / d− e d k′) with probability at least 1 estimator. − 100k ⌈ / δ2 , we get the desired (cid:3) ⌉ 5.2 Adversarial Perturbations The following theorem is the restatement of Theorem 1.4. Theorem 5.6. Let d, k, t ∈ unit vector, W n 0, 1 × ) ( N ∼ N, λ > 0, 0 < δ < 0.1. Let ̃Y = d, and E d is a matrix with entries βuv⊤ + Rd × ∈ Suppose that k & t ln d δ2 and E k k∞ = ελ / p k . δ3λ k . / λ & k δ2 r ln 2 ( td + t / k2 ) . Then there exists an algorithm that, given ̃Y, k, t and δ, in time dO , with probability 1 as d o 1 ) ( − → ∞ W + E, where v ∈ Rd is a k-sparse t ( ) outputs a unit vector v such that ˆ Proof. Let ̃δ = δ as / 1000 and let r = ̃δ |h ˆ 100k . For s v, v > 1 i| t let ∈ S δ . − zs be n-dimensional (random) vectors defined ̃ = r zsi ̃ ( ) 1 [h 1 ( >r s, ̃Yii t * ] if si = 0 otherwise Let Y = ̃Y − E, and zsi be the same as in the non-adversarial case defined for Y . Note that Let s∗ ∈ argmaxs s, v i t h ∈S zsi r ε λ k 6 ( − + ) . By Lemma 5.3, with probability 1 / ) ( ( * 6 zsi r r zsi ̃ k . ) ε λ * d− / 10, − − h By the argument from the proof of Lemma 3.5, with probability 1 ◦ ̃ − / k i ) ( * 2 = v zs∗ , v > zsi r ε λ k > 1 v zs∗ k ◦ ̃ 2 ̃δ . d− − 10, number of nonzero entries of zs is at most 4pd ̃ + 4k and W zs∗ ̃ z⊤s∗ ̃ ◦ k = X Let P ∈ Rd d × (cid:13) (cid:13) (cid:0) (cid:1)(cid:13) (cid:13) 0 , Tr X = 1 , X (cid:23) X , W (cid:8) (cid:12) (cid:12) (cid:12) (cid:12) (cid:10) zs∗ ̃ z⊤s∗ ̃ ◦ (cid:0) 6 10 pd k + ln * s d pd k (cid:19) + (cid:18) . ̃δ2λ . (cid:0) X k 6 (cid:1) k1 6 k W . For all X (cid:9) zs∗ ̃ z⊤s∗ ̃ ◦ X * k k, ̃δλ . ∈ P . k (cid:1) (cid:11)(cid:12) (cid:12) (cid:13) (cid:13) 25 (cid:0) (cid:1)(cid:13) (cid:13) and Consider By Lemma B.4, X , E zs∗ ̃ z⊤s∗ ̃ ◦ 6 E zs∗ ̃ z⊤s∗ ̃ ◦ X k1 6 ̃δλ . ∞ * k (cid:10) (cid:12) (cid:12) (cid:0) s∗ ˆX ( ) ∈ (cid:13) (cid:13) (cid:1) (cid:11)(cid:12) (cid:12) argmaxX (cid:0) X , ̃Y ∈P (cid:1)(cid:13) (cid:13) ◦ z⊤s∗ zs∗ ̃ ̃ . s∗ ˆX ( ) , vv⊤ ◦ (cid:10) z⊤s∗ zs∗ ̃ ̃ (cid:0) > 1 (cid:1)(cid:11) 6 ̃δ . − Hence by Fact B.5, D Let v ˆ s∗) ( D be the top eigenvector of ˆX i| By Fact C.7, k′-sparse norm of W is bounded by ( ) (cid:0) , vv⊤ (cid:1) E > 1 24 ̃δ . − E . By Lemma B.1, , v > 1 100 ̃δ . − ˆX s∗ ( ) s∗) s∗ ( v |h ˆ 10 k′ ln e d k′) / ( with probability at least 1 − d− 10. And k′-sparse norm of E is bounded by p k′ E k k∞ 6 ελ k′ k . Hence by Lemma A.4 with k′ = estimator. 100k ⌈ / ̃δ2 ⌉ and the list of X for all s s ( ) ∈ S t, we get the desired (cid:3) 6 Heavy-tailed Symmetric Noise The following theorem is a restatement of Theorem 6.1. Theorem 6.1. Let k, d, t ∈ N, λ > 0, A > 1, 0 < α < 1, 0 < δ < 0.1. Let Rd is a k-sparse unit vector such that where v k with independent (but not necessarily identically distributed) symmetric about zero entries such that 0, 1 ) ( d is a random matrix √k and N k∞ N ∼ ∈ v / × d Y = λvv⊤ N , + 6 A Suppose that t & 1 α2A4 , k & t ln d δ4A4α2 and P Nij 6 1 > α . (cid:2)(cid:12) (cid:12) (cid:12) (cid:12) (cid:3) λ & A2 δ6α2 * k * ln 2 (cid:0) k2 td + √t / . (cid:1) Then there exists an algorithm that, given Y , k, t and λ, in time dO t ( ) finds a unit vector with probability 1 o 1 ) ( − as d , → ∞ v, v |h ˆ i| > 1 O . δ ( ) − 26 v such that ˆ Before proving this theorem, we state here a theorem from [dNNS22]. Theorem 6.2 ([dNNS22]). Let δ, α b, r, γ R be such that ∈ 0, 1 ) ∈ ( and ζ > 0. Let ̃ Ω ⊆ Rm be a compact convex set. Let X X 6 b , k∞ k2 6 r , max Ω k X ∈ ̃ max Ω k X ∈ ̃ and Consider W ∼ E N ( 0,Id sup Ωh X ∈ ̃ )" X , W i# 6 γ . Y = X ∗ N , + Ω and N is a random m-dimensional vector with independent (but not necessarily identically where X ∗ ∈ ̃ distributed) symmetric about zero entries satisfying P Then the minimizer ˆX = argminX Ω Fh ∈ ̃ Y ( X ) − Ni 6 ζ > α. [| of the Huber loss with parameter h > 2b ] | ζ satisfies + with probability at least 1 − X ∗ ˆX − 2 6 O (cid:13) (cid:13) (cid:13) δ over the randomness of N . (cid:13) (cid:13) (cid:13) h α γ (cid:18) s © « + r log q δ 1 / ( ) (cid:19) a ® ¬ Using this result, we will prove Theorem 6.1 Proof of Theorem 6.1. Consider h := τh x ( ) where h = 3λ entry). v 2 k ∞ k 6 3 λ k A2. Let T = τh Y ( ) if x > h 6 h if x x h − | | if x <   (i.e. the matrix obtained from Y by applying τh to each  − h For s t let zs be n-dimensional (random) vectors defined as ∈ S zsi r ( ) = T s 1 [( 1 ( )i= h s,Tii >r t * ] if si = 0 otherwise 6 r 6 λδ2 α Let λδ2 α 5k . 10k = d Let L Let s∗ ∈ ] ∈ [ argmaxs n i vi t h | (cid:12) (cid:12) ∈S (cid:12) . Note that > δ √k . By the same argument as in the proof of Lemma 3.3, δ2 and hence 2A2 . > k |L | 2 > 1 L k | s, v − v k o i s∗, v h = vT k k1 > δt / i √k . 27 By Chernoff bound, for every i Nij 6 1. Let j supp ( s∗( , )) C ∈ of j ∈ L with probability at least 1 exp i be the set of such entries. Then for j − tα (− i, ∈ C , for at least αt 2 ) / / 10 (cid:12) (cid:12) (cid:12) (cid:12) τh Yij = λviv j Nij . + By Hoeffding's inequality, (cid:1) (cid:0) Yij τh Õj ∈Ci q 2 ) / (− exp with probability at least 1 − By Hoeffding's inequality, (cid:12) (cid:12) vi > λ δ i |C √k | (cid:12) (cid:12) q i |C | − (cid:1) (cid:0) Note that for all j E τh Yij > 0 . (cid:0) τh (cid:1) Yij > p supp ( j , ) ∈ ht q − p with probability at least 1 exp (− − (cid:1) j ( ))\Ci s∗( Õj supp ∈ q (cid:0) . Hence for i 2 / ) > λδ2αt 2 2k − s∗, Ti h i ∈ L ht q > λδ2αt 4k > r t . * , with probability at least 1 3 exp − √t / 2 . (cid:17) − (cid:16) Let μ = exp (cid:16) 2μk entries i √t − ∈ L . By Chernoff bound, with probability at least 1 10 / , zs∗i = 0. Hence with probability at least 1 2A2μ > 1 2 > 1 v (cid:17) exp μ − δ2 . (cid:0) − − zs∗ k L ◦ k exp μk − 100 (cid:0) |L |/ − , (cid:1) 10 , for at most / (cid:1) p − , ) By Hoeffding's inequality, for all i ∉ supp ( s∗, Ti v with probability at least 1 exp (− q / − 6 ht q i| p |h . Hence 2 ) s∗, Ti < r t * i| |h = 1 with probability at least 1 r2t 10h By the same argument as in Lemma 3.5, number of nonzero zs∗i (cid:17) ( t, denote by Z s t ln . For s exp exp pd p. − − − d (cid:16) t − − ( / ) ∈ S r ) ( is at most 4pd d ) the set of i ∈ [ 4k with + such that ] probability at least 1 zsi − = 1. r ( ) For Q d ] ⊂ [ let (cid:0) (cid:1) Q = P X ∈ RQ Q × X (cid:23) 0 , Tr X 6 λ , X k k1 6 λk , Note that (cid:8) := Q γ ( ) E 0,1 ) ( G N ∼ Q Q " × (cid:12) (cid:12) X , G 6 λ E 0,1 ) ( * G N ∼ G k Q Q k × i# sup X P Q h ∈ (cid:9) 6 10λ Q . | | p Hence by Theorem 6.2 and a union bound over all sets Q of size at most 4pd t, 10, for all s probability at least 1 d− 4k, we get with + − ∈ S X ˆ s ( ) − λ s v ̃ ( v ) ̃ ( s ⊤ ) 2 F 6 O h α * λ (cid:13) (cid:13) (cid:13) (cid:13) © « pd k + ln * (cid:1) s (cid:0) d pd k (cid:19) + (cid:18) 28 6 O A2 α * λ2 k * s a ® ¬ © « pd k + ln * (cid:0) (cid:1) d pd k (cid:19) + (cid:18) , a ® ¬ where s X ˆ ( Note that ) is the minimizer of the Huber loss with parameter h over and Z P ( s ) v = v ̃ ◦ zs r . ) ( + The second term can be bounded as follows (cid:0) (cid:1) pd k ln + * s d pd (cid:18) . k (cid:19) q pd ln p 1 / ( ) + √k ln d . √k ln d . δ2k α A2 . Note that r2t h > λ k * / δ4α2 A2 t & 2 δ2 ln 2 td / + k2 * √t > 2 ln 2 k2 d / + Hence the first term can be bounded as follows (cid:0) (cid:1) (cid:0) δ2 > ln 2 4 t1 / / k2 d / + ln t / + δ2 . (cid:0) (cid:1) (cid:0) (cid:1) * (cid:1) pd ln p 1 / ( ) q . k √d * δ2 t * √d . δ2k α A2 . Hence for all s t, ∈ S Since v k ◦ zs∗ k 2 > 1 − 2δ2, (cid:13) (cid:13) Consider some s′ such that X ˆ s ( ) − λ s v ̃ ( v ) ̃ ( s ⊤ ) 2 F 6 δ2λ2 . s∗ X ˆ ( > 1 (cid:13) (cid:13) 10δλ . > 1 F − 10δλ. For such s′, ) (cid:13) (cid:13) − X (cid:13) s′) (cid:13) ˆ F ( (cid:13) zs′( , v r (cid:13) ) s′)⊤ ( F v (cid:13) (cid:13) ◦ h v s′) ̃ r k v = 2 > 1 zs′( i 6 δλ, the top eigenvector )k − ◦ 100δ . Moreover, since X ˆ s′) − ( λ v ̃ ( v ˆ s′) ( of X ˆ s′) ( satisfies (cid:3) (cid:13) (cid:13) (cid:13) v (cid:13) |h ˆ ( s′ ) , v i| > 1 O . δ ( ) − 29 References [AKS98] Noga Alon, Michael Krivelevich, and Benny Sudakov, Finding a large hidden clique in a random graph, Proceedings of the Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, 25-27 January 1998, San Francisco, California, USA (Howard J. Karloff, ed.), ACM/SIAM, 1998, pp. 594–598. 8 [AW09] Arash A. Amini and Martin J. Wainwright, High-dimensional analysis of semidefinite relaxations for sparse principal components, Ann. Statist. 37 (2009), no. 5B, 2877–2921. 1 [AWZ20] Gérard Ben Arous, Alexander S. Wein, and Ilias Zadik, Free energy wells and overlap gap property in sparse PCA, Conference on Learning Theory, COLT 2020, 9-12 July 2020, Virtual Event [Graz, Austria] (Jacob D. Abernethy and Shivani Agarwal, eds.), Proceedings of Machine Learning Research, vol. 125, PMLR, 2020, pp. 479–482. 1 [BB19] Matthew S. Brennan and Guy Bresler, Optimal average-case reductions to sparse PCA: from weak assumptions to strong hardness, Conference on Learning Theory, COLT 2019, 25-28 June 2019, Phoenix, AZ, USA (Alina Beygelzimer and Daniel Hsu, eds.), Proceedings of Machine Learning Research, vol. 99, PMLR, 2019, pp. 469–470. 1 [BBH18] Matthew Brennan, Guy Bresler, and Wasim Huleihel, Reducibility and computational lower bounds for problems with planted sparse structure, Proceedings of the 31st Conference On Learning Theory (Sébastien Bubeck, Vianney Perchet, and Philippe Rigollet, eds.), Proceedings of Machine Learning Research, vol. 75, PMLR, 06–09 Jul 2018, pp. 48–166. 1 [BBH+21] Matthew S. Brennan, Guy Bresler, Samuel B. Hopkins, Jerry Li, and Tselil Schramm, Sta- tistical query algorithms and low degree tests are almost equivalent, Conference on Learning Theory, COLT 2021, 15-19 August 2021, Boulder, Colorado, USA (Mikhail Belkin and Samory Kpotufe, eds.), Proceedings of Machine Learning Research, vol. 134, PMLR, 2021, p. 774. 1 [BKS14] [BR13a] [BR13b] [BR13c] Boaz Barak, Jonathan A. Kelner, and David Steurer, Rounding sum-of-squares relaxations, Symposium on Theory of Computing, STOC 2014, New York, NY, USA, May 31 - June 03, 2014 (David B. Shmoys, ed.), ACM, 2014, pp. 31–40. 3 Quentin Berthet and Philippe Rigollet, Complexity theoretic lower bounds for sparse prin- cipal component detection, COLT, JMLR Workshop and Conference Proceedings, vol. 30, JMLR.org, 2013, pp. 1046–1066. 1 , Computational lower bounds for sparse PCA, CoRR abs/1304.0828 (2013). 1 Quentin Berthet and Philippe Rigollet, Optimal detection of sparse principal components in high dimension, Ann. Statist. 41 (2013), no. 4, 1780–1815. 1 [dGJL04] Alexandre d'Aspremont, Laurent El Ghaoui, Michael I. Jordan, and Gert R. G. Lanckriet, A direct formulation for sparse PCA using semidefinite programming, Advances in Neural Information Processing Systems 17 [Neural Information Processing Systems, NIPS 2004, December 13-18, 2004, Vancouver, British Columbia, Canada], 2004, pp. 41–48. 2 30 [DH23] [DK22] Jingqiu Ding and Yiding Hua, SQ lower bounds for random sparse planted vector problem, CoRR abs/2301.11124 (2023). 3 Ilias Diakonikolas and Daniel Kane, Non-gaussian component analysis via lattice basis reduction, Conference on Learning Theory, 2-5 July 2022, London, UK (Po-Ling Loh and Maxim Raginsky, eds.), Proceedings of Machine Learning Research, vol. 178, PMLR, 2022, pp. 4535–4547. 3 [dKNS20] Tommaso d'Orsi, Pravesh K. Kothari, Gleb Novikov, and David Steurer, Sparse PCA: algorithms, adversarial perturbations and certificates, 61st IEEE Annual Symposium on Foundations of Computer Science, FOCS 2020, Durham, NC, USA, November 16-19, 2020 (Sandy Irani, ed.), IEEE, 2020, pp. 553–564. 1, 2, 3, 5, 6, 7, 10, 11, 36 [DKWB19] Yunzi Ding, Dmitriy Kunisky, Alexander S. Wein, and Afonso S. Bandeira, Subexponential-time algorithms for sparse PCA, CoRR abs/1907.11635 (2019). 1, 2, 3, 4, 7, 10 [DKWB21] , The average-case time complexity of certifying the restricted isometry property, IEEE Trans. Inf. Theory 67 (2021), no. 11, 7355–7361. 3 [DM14] Yash Deshpande and Andrea Montanari, Sparse PCA via covariance thresholding, NIPS, 2014, pp. 334–342. 1, 4, 10 [dNNS22] Tommaso d'Orsi, Rajai Nasser, Gleb Novikov, and David Steurer, Higher degree sum-of- squares relaxations robust against oblivious outliers, CoRR abs/2211.07327 (2022). 1, 3, 7, 8, 11, 12, 27 [GMZ17] Chao Gao, Zongming Ma, and Harrison H. Zhou, Sparse cca: Adaptive estimation and computational barriers, The Annals of Statistics 45 (2017), no. 5, 2074–2101. 1 [HD13] Paul Hand and Laurent Demanet, Recovering the sparsest element in a subspace, Informa- tion and Inference 3 (2013). 3 [HSSS16] Samuel B. Hopkins, Tselil Schramm, Jonathan Shi, and David Steurer, Fast spectral algo- rithms from sum-of-squares proofs: tensor decomposition and planted sparse vectors, Proceed- ings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2016, Cambridge, MA, USA, June 18-21, 2016 (Daniel Wichs and Yishay Mansour, eds.), ACM, 2016, pp. 178–191. 3 [HSV20] Guy Holtzman, Adam Soffer, and Dan Vilenchik, A greedy anytime algorithm for sparse pca, 2020, pp. 1939–1956. 2 [JL09] Iain M. Johnstone and Arthur Yu Lu, On consistency and sparsity for principal components analysis in high dimensions, Journal of the American Statistical Association 104 (2009), no. 486, 682–693, PMID: 20617121. 1 [KNV15a] Robert Krauthgamer, Boaz Nadler, and Dan Vilenchik, Do semidefinite relaxations solve sparse PCA up to the information limit?, The Annals of Statistics 43 (2015), no. 3. 1 31 [KNV15b] , Do semidefinite relaxations solve sparse PCA up to the information limit?, The Annals of Statistics 43 (2015), no. 3, 1300 – 1322. 1 [KWB19] Dmitriy Kunisky, Alexander S. Wein, and Afonso S. Bandeira, Notes on computa- tional hardness of hypothesis testing: Predictions using the low-degree likelihood ratio, CoRR abs/1907.11636 (2019). 5 [LM00] B. Laurent and P. Massart, Adaptive estimation of a quadratic functional by model selection, Ann. Statist. 28 (2000), no. 5, 1302–1338. 36 [MW15] Tengyu Ma and Avi Wigderson, Sum-of-squares lower bounds for sparse PCA, Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada (Corinna Cortes, Neil D. Lawrence, Daniel D. Lee, Masashi Sugiyama, and Roman Garnett, eds.), 2015, pp. 1612–1620. 1 [MW21] Cheng Mao and Alexander S. Wein, Optimal spectral recovery of a planted vector in a subspace, CoRR abs/2105.15081 (2021). 3 [PR22] Aaron Potechin and Goutham Rajendran, Sub-exponential time sum-of-squares lower bounds for principal components analysis, Advances in Neural Information Processing Systems (Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, eds.), 2022. 1 [QZL+20] Qing Qu, Zhihui Zhu, Xiao Li, Manolis C. Tsakiris, John Wright, and René Vidal, Finding the sparsest vectors in a subspace: Theory, algorithms, and applications, CoRR abs/2001.06970 (2020). 3 [Ver18] [Wai19] Roman Vershynin, High-dimensional probability: An introduction with applications in data science, Cambridge Series in Statistical and Probabilistic Mathematics, Cambridge Uni- versity Press, 2018. 35 Martin J. Wainwright, High-dimensional statistics: A non-asymptotic viewpoint, Cambridge Series in Statistical and Probabilistic Mathematics, Cambridge University Press, 2019. 36 [WBS16] Tengyao Wang, Quentin Berthet, and Richard J. Samworth, Statistical and computational trade-offs in estimation of sparse principal components, The Annals of Statistics 44 (2016), no. 5, 1896 – 1930. 1 [ZSWB22] Ilias Zadik, Min Jae Song, Alexander S. Wein, and Joan Bruna, Lattice-based methods surpass sum-of-squares in clustering, Conference on Learning Theory, 2-5 July 2022, Lon- don, UK (Po-Ling Loh and Maxim Raginsky, eds.), Proceedings of Machine Learning Research, vol. 178, PMLR, 2022, pp. 1247–1248. 3 A Properties of sparse vectors This section contain tools used throughout the rest of the paper. 32 Fact A.1. Let r, δ > 0 and let x Rm such that k ∈ |S| Proof. 6 R. Let = i { S m ∈ [ xi | ] | | > δ } . Then x k 6 R2 δ2 . / δ2 6 x k S k 2 6 x k k 2 6 r2 . * |S| Lemma A.2. Let δ, δ′ ∈ ( Then . Let x, y 0, 1 ) ∈ Proof. Consider the vector y′ such that y′i Rm such that y k k 6 δ . Let x k k S = i m ] ∈ [ yi > δ′| xi | . (cid:3) . v k (cid:8) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:9) and y′i = 0 for all i ∉ S . It follows that ∈ S > v k S k = δ − δ′ 1 ( )k xi for all i / − 6 1 δ′ k y′ k k 6 δ δ′ k . x k y k Hence = x k S k x k + y′ k > x k k2 − k y′ k > 1 ( − δ′ δ / )k x k . Lemma A.3. Let v > 1 v, v′i| − |h ∈ δ. For k′ > k, let Rd be a k-sparse unit vector, and suppose that for some unit vector v′ ∈ K ′ be the set of k′ largest (in absolute value) entries of v′. Then k′ . k v, v′ > 1 δ Proof. Since = 1, v k k v′ K ′ − v′ (cid:13) (cid:13) Therefore, ∞ (cid:13) (cid:13) v, v′ K ′ − − / (cid:12) (cid:10) 6 1 (cid:12) / (cid:11)(cid:12) k′. Hence (cid:12) p v′ 6 v′ K ′ − v′ v k1 6 ∞ * k K ′ − k′ . k / p (cid:10) (cid:12) (cid:12) v, v′ K ′ > |h (cid:11)(cid:12) (cid:12) v, v′ (cid:13) (cid:13) (cid:13) (cid:13) v, v′ K ′ − i| − v′ > 1 δ − − k′ . k / (cid:10) (cid:12) (cid:12) (cid:11)(cid:12) (cid:12) (cid:10) (cid:12) (cid:12) (cid:11)(cid:12) (cid:12) p (cid:3) Rd, (cid:3) Lemma A.4. Let λ, κ, δ > 0 and let v vectors such that ∈ Rd be a k-sparse unit vector. Let L Rd be a finite set of unit ⊂ max x ∈ L |h v, x i| > 1 δ . − Let k′ > 2 δ2 k ⌈ / ⌉ and let N ∈ Rd d be a matrix such that for every k′-sparse unit vector u × Rd ∈ u⊤N u 6 κ . Then, there exists an algorithm running in time O v such that finds a unit vector ˆ d2 L * that, given Y = λvv⊤ + N , L, k and δ as input, (cid:0) > 1 (cid:1) 4δ 2κ λ . − − v, v ˆ i| |h 33 Proof. For each x largest (in absolute value) entries. Let x∗ ∈ v, s L we can compute a k′-sparse vector s v, s argmaxx ∈ > 1 L |h ∈ x ( x ( ) )i| |h x∗ ( )i| 2δ . − that coincides with x on the top k′ . By Lemma A.3, Hence Let Then Since v⊤N ̃ x∗ s ( ⊤ ) λvv⊤ N s x∗ ( ) + > 1 ( − 2δ ) 2λ − κ > 1 ( − 4δ λ ) − κ . (cid:0) (cid:1) v ̃ ∈ argmaxs ,x x ( ) ∈ L s x ( ⊤ ) λvv⊤ N s . x ( ) + λvv⊤ v⊤ ̃ v 6 κ, we get (cid:0) ̃ N + v > s ̃ ( x∗ ⊤ ) λvv⊤ (cid:0) N + (cid:1) > x∗ s ( ) 1 ( 4δ λ ) − − κ . (cid:1) v, |h > v ̃ i| v, |h (cid:0) v ̃ i| 2 > 1 − (cid:1) 4δ 2κ λ . / − Hence v = 1 v ˆ k ̃ v is the desired estimator. k ̃ B Linear Algebra Rd d, M × Lemma B.1. Let M Then the top eigenvector v1 of M satisfies Proof. Write z = αv1 + α2v √1 (cid:23) − ∈ h where v v1, z 2 > 1 ∈ 2ε. − i is a unit vector orthogonal to v1. 0, Tr M = 1 and let z Rd be a unit vector such that zTM z > 1 As v1 TMv1 > zTM z and v TMv ⊥ ⊥ ⊥ ⊥ T T M z = α2v1 z = α2 > 1 λ1 − ε Mv1 + v T ⊥ − ⊥ Mv (cid:0) 1 α2 v T ⊥ T Mv ⊥ Mv ⊥ v (cid:1) + ⊥ 6 1 − α2 > 1 (cid:0) − TMv1 6 1 v1 v − TMv ⊥ TMv ⊥ ⊥ ε − − v λ1 − (cid:1) zTM z 6 ε, rearranging ⊥ > 1 2ε. − (cid:3) ε. − (cid:3) Fact B.2. Let A, B Fact B.3. Let X ∈ ∈ Rd Rd d, A, B × 0. Then (cid:23) A, B h i > 0. d be a positive semidefinite matrix. Then for all A × Rd d, × ∈ Lemma B.4. Let Ω Rm. Let Y = S ⊂ N, where S + ∈ Rm statisfies ∈ A, X |h 6 k i| A Tr X . k * Ω and N X , N i| 6 δ . sup X Ω|h ∈ Then ˆX ∈ argmaxX Ω h ∈ X , Y i satisfies > S k 2 k − 2δ . ˆX , S D E 34 Proof. ˆX , S = ˆX , Y D E D − E D ˆX , N > ˆX , Y E D − E δ > S, Y h i − δ = S, S h i + h S, N i − δ > S k 2 k − 2δ . (cid:3) Fact B.5. Let a, b, c δ. Then c, b > 1 i h Proof. Note that − Rm such that 4δ. > 1 ∈ a, c h − i 2 6 2 a k b k − = a k k c k k = 1 and b k k 6 1. Suppose that a, b h i > 1 − δ and 2 − h a, c a, b i 6 2δ and similarly k c = a k c k − 2 6 a (k − b k + k i − c k b − k) 2 2 − h b 2 6 2δ. Hence 2 6 8δ . (cid:3) Lemma B.6. Let P ⊂ Rd × d be some set of PSD matrices. For matrix M Rn d let × ∈ Then for arbitrary matrices A, B s M ) P( Rn d, × := sup X ∈P(cid:12) (cid:12) (cid:10) M⊤M , X . (cid:11)(cid:12) (cid:12) B⊤A + A⊤B, X 6 2 s A ) * s B . ) P( P( ∈ sup X ∈P(cid:12) (cid:12) (cid:10) Proof. Let X′ be an arbitrary element of S. For some c C = cB A A ⊤ ) ( c − cB . Since C and X′ are PSD, ) B⊤A A⊤A, X′ A⊤B, X′ 6 ( − Therefore, (cid:12) (cid:12) + * (cid:10) (cid:11)(cid:12) (cid:12) (cid:10) B⊤A + A⊤B, X′ (cid:11) 6 s To minimize this expression, we can take (cid:10) (cid:12) (cid:12) c | | (cid:11)(cid:12) (cid:12) = q p (cid:11)(cid:12) (cid:12) ∈ C , X′i c2 h + (cid:10) A P( c | A B ) ) s P ( s P ( 6 2 B⊤B, X′ ) c + | | * | . Hence 0 (we will choose the value of c later), let > 0. Hence 6 s A P( ) + c2s B . ) P( (cid:11) s B . ) P( Since it holds for arbitrary X′ ∈ S (cid:10) (cid:12) (cid:12) B⊤A A⊤B, X′ s A + ) * (cid:11)(cid:12) , we get the desired bound. (cid:12) P( p s . B ) P( (cid:3) C Concentration Inequalities Fact C.1 (Chernoff's inequality, [Ver18]). Let ζ1, . . . , ζn be independent Bernoulli random variables such that P = p. Then for every Δ > 0, ζi = 1 ) ( = P ( ζi = 0 ) and for every Δ , 0, 1 ) ∈ ( Õi=1 n Õi=1 P n P ζi > pn Δ 1 ( + )! 6 ζi 6 pn Δ 1 ( − )! 6 35 Δ e− Δ + Δ 1 + ) Δ e− Δ − Δ 1 − ) pn pn . . (cid:19) (cid:19) 1 (cid:18) ( 1 (cid:18) ( Fact C.2 (Hoeffding's inequality, [Wai19]). Let z1, . . . , zn be mutually independent random variables such that for each i for some ci > 0. Then for all t > 0, , zi is supported on ci , ci n ∈ [ ] [− ] Fact C.3 (Bernstein's inequality [Wai19]). Let z1, . . . , zn be mutually independent random variables such that for each i for some B > 0. Then for all t > 0, , zi is supported on B, B n Í ∈ [ ] [− zi ( − E zi 6 2 exp > t ! − 2 t2 n i=1 c2 i ! . )(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ] n P (cid:12) Õi=1 (cid:12) (cid:12) (cid:12) (cid:12) n P Õi=1 N 0, σ2 ( zi ( − E zi ) > t ! 6 exp − 2 n i=1 t2 E z2 i + . 2Bt 3 ! , then for all t > 0, ) Í X > σ P ( t ) * 6 e− t2 2 . / Fact C.4. [Wai19] Let X ∼ Fact C.5. [LM00]Let X χ2 m, then for all x > 0, ∼ P X (cid:16) − m > 2x + P m ( − 2√mx 6 e− x (cid:17) X > x ) 6 e− x2 4m Fact C.6. [Wai19] Let W N 0, 1 ) ( ∼ n × d. Then with probability 1 exp (− t , 2 ) / − and W T Fact C.7. [dKNS20] Let W k least 1 k ed − N (cid:13) (cid:13) ∼ W − 0, 1 ) ( W k k 6 √n √d √t + + nId 6 d 2√dn + t + + 4 n t ( . d ) + d be a Gaussian matrix. Let 1 6 k 6 d. Then with probability at p n × (cid:13) (cid:13) (cid:0) (cid:1) and max Rn u ∈ =1 u k k max k-sparse v ∈ =1 v k k TW v 6 √n u Rd k ln 3 s + e d k (cid:19) (cid:18) max k-sparse v ∈ =1 v k k v⊤W ⊤W v − Rd n 6 10 kn ln e d k / ( ) + 10k ln e d . k ) / ( p Lemma C.8. Let Y be an instance of sparse PCA in Wishart model. For m z . Suppose that m > 100 ln d and n > 0.1 m ln 0, 1 e d m z d } ∈ { n ity at least 1 k1 6 m k 10, d− o (cid:12) (cid:12) − (cid:12) ∈ N let Zm = . Then, with probabil- ) * ( / max Zm z ∈ Y ⊤Y nId β k − u k 2vv⊤ − (cid:0) (cid:13) (cid:13) ◦ (cid:1) (cid:0) zz⊤ 6 10 (cid:1)(cid:13) (cid:13) q(cid:0) βn n + m ln e d m / ( ) + * 10m ln e d m . ) / ( (cid:1) 36 (cid:1)(cid:13) 6 √2n. By Lemma C.9, with probability at leaast (cid:13) as ◦ ( zz⊤) (cid:1) βW ⊤uv⊤ Proof. We can write Y ⊤Y nId β k − u k − 2vv⊤ Note that (cid:0) W ⊤W (cid:16) n * − Id + W ⊤uv⊤ vu⊤W + p ◦ zz⊤ With probability at least 1 , 1 ) exp (− m − (cid:0) (cid:13) (cid:13) n exp ( / − (cid:1) , 10 ) (cid:0) u k k + βvu⊤W p zz⊤ . (cid:1) ◦ (cid:17) (cid:0) 1 u u⊤W z ◦ u . k * k (cid:18) k k (cid:19) (cid:13) (cid:13) (cid:13) (cid:13) 6 2 (cid:13) (cid:13) (cid:13) (cid:13) By Fact C.6, for every m′ ∈ G⊤G (cid:0) (cid:13) (cid:13) W ⊤uv⊤ vu⊤W zz⊤ 6 5 βn + N, G N ∼ ◦ n 0, 1 (cid:0) (cid:1) ( ) 6 m′ n Id m′ satisfies p × (cid:1)(cid:13) (cid:13) 2√m′n m ln em . k ) / ( * p with probability 1 get the desired bound. − (cid:13) exp (cid:13) (− τ / 2 ) Lemma C.9. Let W Zm = 0, 1 z d ∈ { } N 0, 1 ( ) k1 6 m ∼ z k n (cid:12) (cid:12) (cid:12) max Zm z ∈ o ba⊤W * + ( − (for every τ > 0). By union bound over all sets of size m′ 6 m we (cid:3) p (cid:13) (cid:13) + + ) τ 4 τ m′ + n . n d and let a × . Suppose that m > 100 ln d. Then with probability at least 1 Rd be vectors independent of W . For m d− Rn and b ∈ ∈ ∈ 10, N let − zz⊤ 6 3 ◦ a * k b k * k * k m ln em . k ) / ( Proof. For fixed set J 1 u u⊤W (cid:13) (cid:13) d ] 1J has standard ⊂ [ (cid:0) (cid:1) (cid:0) , let 1J J (cid:1)(cid:13) (cid:13) d be an indicator vector of this set. Random vector } -dimensional Gaussian distribution, hence by Fact C.6, for all τ > 0, ∈ { 0, 1 p k ◦ with probability at least 1 (cid:16) (cid:17) k | | exp − τ , 2 ) / (− By union bound over all sets of size of size at most m, we get a⊤W 1 a k (cid:18) k ◦ (cid:19) 1J 6 1 J | | + + √τ . p (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) with probability at least 1 max Zm (cid:13) z (cid:18) ∈ (cid:13) (cid:13) m (cid:13) (− exp 1 a k . ) k − a⊤W ◦ (cid:19) z 6 3 p (cid:13) (cid:13) (cid:13) (cid:13) m e d ln ( * / m ) (cid:3) 37
http://arxiv.org/abs/2302.10790v1
2023-02-20T18:36:46
2023-02-20T18:36:46
Federated Learning for ASR based on Wav2vec 2.0
This paper presents a study on the use of federated learning to train an ASR model based on a wav2vec 2.0 model pre-trained by self supervision. Carried out on the well-known TED-LIUM 3 dataset, our experiments show that such a model can obtain, with no use of a language model, a word error rate of 10.92% on the official TED-LIUM 3 test set, without sharing any data from the different users. We also analyse the ASR performance for speakers depending to their participation to the federated learning. Since federated learning was first introduced for privacy purposes, we also measure its ability to protect speaker identity. To do that, we exploit an approach to analyze information contained in exchanged models based on a neural network footprint on an indicator dataset. This analysis is made layer-wise and shows which layers in an exchanged wav2vec 2.0 based model bring the speaker identity information.
[ "Tuan Nguyen", "Salima Mdhaffar", "Natalia Tomashenko", "Jean-François Bonastre", "Yannick Estève" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10790v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10790v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.AS", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.AS", "cs.LG", "cs.SD" ]
FEDERATED LEARNING FOR ASR BASED ON WAV2VEC 2.0 Tuan Nguyen, Salima Mdhaffar, Natalia Tomashenko, Jean-Franc ̧ois Bonastre, Yannick Est`eve LIA - Avignon University, France 3 2 0 2 b e F 0 2 ] S A . s s e e [ 1 v 0 9 7 0 1 . 2 0 3 2 : v i X r a ABSTRACT This paper presents a study on the use of federated learning to train an ASR model based on a wav2vec 2.0 model pre-trained by self supervision. Carried out on the well-known TED-LIUM 3 dataset, our experiments show that such a model can obtain, with no use of a language model, a word error rate of 10.92% on the official TED- LIUM 3 test set, without sharing any data from the different users. We also analyse the ASR performance for speakers depending to their participation to the federated learning. Since federated learning was first introduced for privacy purposes, we also measure its ability to protect speaker identity. To do that, we exploit an approach to analyze information contained in exchanged models based on a neu- ral network footprint on an indicator dataset. This analysis is made layer-wise and shows which layers in an exchanged wav2vec 2.0- based model bring the speaker identity information. Index Terms- Federated learning, Automatic Speech Recog- nition, Self-supervised models, Privacy 1. INTRODUCTION Federated learning (FL) has been successfully explored for image and natural language processing [1]. FL [1, 2] is a distributed ma- chine learning paradigm that aims to collaboratively train a machine learning model without data sharing. It consists in a network of mul- tiple clients and one server. The training is based on an iterative numbers of rounds. At each federated learning round, clients train a local model using their private data, and send this updated model to the server. The server aggregates the received updates into a single global model and sends its parameters back to the clients' devices. Recently, FL has been applied in various speech-related applica- tions, such as automatic speech recognition (ASR) [3, 4, 5, 6, 7, 8]. keyword spotting [9, 10, 11], speaker recognition [12, 13], speech emotion recognition [14], self-supervised learning (SSL) of speech representations [15], and others. However, their robustness capabili- ties have not been extensively investigated and research in this area is still limited. In [16], authors showed why ASR FL task can be con- sidered as very challenging. The challenges include: (1) communi- cation bottleneck, (2) computation capabilities and energy states, (3) the performance and accuracy of the learned model and (4) privacy and security considerations. Recently, wav2vec2.0 [17] models have become more popular and have achieved good performance in many speech processing tasks [18, 19]. Authors in [17] claim this framework can enable auto- matic speech recognition models with just 10 minutes of transcribed speech data. This work was supported by the French National Research Agency un- der project DEEP-PRIVACY (ANR-18-CE23-0018), VoicePersonae, H2020 SELMA and was granted access to the HPC resources of IDRIS under the allocation 2021-AD011012551 made by GENCI. This paper presents a study on the use of federated learning to train an ASR model based on a wav2vec 2.0 model pre-trained by self supervision. To our knowledge, there is no previous published work on this use of wav2vec2.0 models. We analyse the global ASR performance but also the performance for speakers depend- ing to their participation to the federated learning. Since federated learning was first introduced for privacy purposes, we also measure its ability to protect speaker identity. Some related works show that federated learning is vulnerable to various types of attacks [20, 4]. To do that, we exploit an approach to analyze information contained in exchanged models based on a neural network footprint on an in- dicator dataset. This analysis is made layer-wise and shows which layers in an exchanged wav2vec 2.0-based model bring the speaker identity information. 2. FEDERATED LEARNING FOR WAV2VEC 2.0 MODELS 2.1. Federated learning The idea of FL paradigm is about training a neural model across multiple cross-device or server. Unlike distributed learning, FL participants only exchange model parameters without exposing any data samples. By doing this, it is expected to ensure the data privacy of participants or clients. FL technique follows strictly to these steps: 1. The centralized server initializes the global model G. 2. The global model G is sent to each available clients. 3. Each client c fine-tunes the global model on its local data to obtain the updated model Mc. 4. All the updated models Mc from clients ck are sent back to the server and being aggregated to form a new model. 5. The process restarts again from 2nd step to 4th step until the convergence or number of rounds T is reached. In recent years, more and more studies have been conducted to find the most proper weight aggregation strategy for FL [21, 22]. Among them, Federated Averaging (FedAvg) [2] is the fundamen- tal and the most well-known FL algorithm. FedAvg is based on FedSGD [23] algorithm. Instead of exchange the gradients after batch updated, FedAvg clients send the updated weights. At each round, a number m of clients are chosen among K total clients to send their updated model to server. From here, server weights each of clients' parameters Fk(w) by their size of dataset nk over the total data n are used in the given round and then aggregates them: f (w) = m (cid:88) k=1 nk n Fk(w) (1) 2.2. Wav2vec 2.0 model Wav2vec 2.0 [17] is a model pre-trained through self-supervision. It takes raw audio as input and computes speech representations. Such pre-trained models can be fine-tuned by supervision to build speech recognition systems. Wav2vec 2.0 contains three main components: a convolutional feature encoder, a context network and a quanti- zation block. The convolutional feature encoder converts the raw waveform into a latent representation. This representation is given to the context network which takes care of the context. The context network architecture consists of a succession of several transformer encoder blocks. The quantization network is used to map the latent representation to quantized representation. Facebook AI released self supervised pre-trained wav2vec 2.0 models. In this study, we use the model LS960-LV60 1 pre-trained on English. 2.3. Implementation with SpeechBrain and Flower toolkits The purpose of this research is to train an ASR with a federated learning paradigm. To attain this objective, Flower [24] and Speech- Brain [25] have been used. Flower is an open-source framework that allows us to build FL experiments and considers the highly varied FL facility scenarios. The framework is composed of three main com- ponents: a client, a server and a strategy. The client and the server implement the basic functionalities of the clients and a server in a FL training. SpeechBrain is an open source toolkit for automatic speech processing. This toolkit is a simple and flexible end-to-end ASR framework. 3. EXPERIMENTS Train (clients) 252.17 1943 148332 Duration, hours # speakers # utterances Analysis Dev Test Indicator 110.34 1341 65430 3.76 16 1155 3.73 16 507 0.51 40 342 Table 1. Data sets statistics blocks of convolutional neural networks (with respectively 128, 200 and 256 channels) with pooling layers, followed by five bidi- rectional 1024-dimensional LSTM layers connected to two dense 1024-dimensional layers to obtain the final acoustic representation. The input signal representation is composed of 80-dimensional filter-banks. The encoder maps these filter-banks to a higher-level feature representation that are then passed to a 1024-dimension attention module that identifies which parts of high level speech rep- resentations are relevant to each step of the decoding process. The attention module output is used to compute a context vector used as the input of an RNN decoder. This RNN decoder is composed of 1024-dimensional GRU layer before the output softmax layer. The neural network output corresponds to 500 byte pair encoding uni- gram units, that are a mix between characters and words. An initial end-to-end ASR model pre-trained on the CommonVoice dataset3 is used to initialize weights for the server model. The client's models, trained on the local speaker set for 20 epochs, uses the same model configuration and hyperparameter settings. 3.1. Data 3.2.2. ASR model based on Wav2vec 2.0 The experiments were conducted on the TED-LIUM 3 corpus [26] that contains TED talks with the total amount of 452 hours of speech data in English from about 2K speakers. This dataset has been used in some research works in the context of collaborative learning experiments [20, 4, 27]. We organized the TED-LIUM 3 training dataset in order to simulate a realistic federated learning framework. Each speaker in the TED-LIUM 3 training set acts as a client in this FL scenario. For speakers s in the training set with duration > 10 minutes, we consider a subset of 5 minutes of speech data called analysiss to analyse some FL behaviours. The remaining is called trains and represents the local dataset for the client. For speakers in the training set with duration < 10 minutes, all the speaker data will represent the local dataset for the client. For the test and devel- opment sets, we use the official test and development sets (legacy distribution) of the TED-LIUM 3 release. The indicator dataset [4] is used to analyse the speaker information contained in the models exchanged between the server and clients. The speakers in the test, development, train, and indicator dataset are disjoint. Table 3.1 presents the statistics of the data 2. 3.2. Models 3.2.1. ASR model based on CRDNN In our experiments, we use an attention-based encoder-decoder [28] neural network. The encoder is a convolutional, recurrent and deep neural network (CRDNN) block. This CRDNN is composed of three 1https://huggingface.co/facebook/wav2vec2-large-960h-lv60 2https://github.com/tuanct1997/Federated-Learning-ASR-based-on- wav2vec-2.0 The architecture is based on an end-to-end approach with SSL. The system is composed of the large pre-trained English wav2vec 2.0 model, a linear layer of 1024 units, and the softmax output layer. Connectionist temporal classification (CTC) loss function [29] is used as a loss function. We conduct our experiments using randomly initialized weights for the server model. The final model is trained on 5 V100 GPUs, each with 32 GB memory, for 100 rounds at a batch size of 4. The clients' models, trained on the local speaker set for 20 epochs, use the same model configuration and hyperparameter settings. 3.3. FL for ASR With the data set split described in Section 3.1, FL's clients mostly cover only a small amount of audio. This is a big challenge to train an ASR model since normally, in this domain the dataset size is a critical point. Moreover, between these clients, a big difference in voice, audio quality, utterances or data size leads to an extreme non independent and identically distributed (non-IID) case. As be- ing seen in different studies [30][31][5], non-IID is a big challenge for FL. For end-to-end ASR, Yan Gao et al [5] also found that it is nearly impossible to start the training from scratch. In their work, they started the training from a pre-trained model on half of same dataset. Described in Section 3.2, for both CRDNN and wav2vec 2.0 architectures, a pre-trained model is used as an initialised global model. The difference is that for CRDNN, the pre-trained model is already specialised for the ASR task. For wav2vec 2.0, the initialised 3https://github.com/speechbrain/speechbrain/tree/develop/recipes/ CommonVoice/ASR/seq2seq model is only pre-trained to learn the representation from audio of LibriSpeech data. To set up a FL ASR experiment, a simulation has been created and executed on the same machine. Within the simulation, we have 1 server and 1943 clients corresponding to speakers in the TED- LIUM 3. In a normal FL scenario, as can be seen in equation 1, only m out of K clients will participate in aggregation process because K can be very large and using all K clients can be unmanageable. In our experiments, 20 clients per round are chose to participate for both CRDNN and wav2vec 2.0 architectures. Indeed, during our experiments we found that m = 20 is the best trade-off point for our resource4. 3.4. ASR performance 3.4.1. General performance To analyze the performance of the FL ASR system, the global model was tested on the TED-LIUM 3 test set where speakers of this set were never exposed during the training phase. Results in Figure 1 show that it is possible to improve the ASR performance in terms of word error rate (WER) for speakers unseen during the FL training (speakers in the test set). Having a better start in terms of WER (WER = 37.04% at first round), CRDNN still struggles to converged compared to wav2vec 2.0. Despite the CommonVoice pre-trained model is good at the ASR task, we noticed this is not enough since there is a large gap between CommonVoice and TED-LIUM 3. WER of CRDNN stays at around 35% for the rest of rounds (best performance is reached at round 45 WER = 34.33%). By using only a small dataset at local level, it's not enough to learn the information of TED-LIUM 3 using the CRDNN pre-trained models. On the other hand, with wav2vec 2.0 the problem seems to be overcome. Just within 4 rounds, wav2vec 2.0 caches up with CRDNN and keeps improving. The best performance is recorded at 85th round with 10.92% of WER. In addition, for 100 rounds, the FL is only contributed by 1209 speakers (which equal to 62% of total speakers) to reach this performance. 3.4.2. Longitudinal speaker-level ASR performance Our hypothesis is that performance of FL in each round is still af- fected by the speaker's participation in each round. At each round, a fixed number of clients participate in the training by sending to the server a model trained using their private data, this may cause for- getting of previously-learnt knowledge related to the speakers seen in previous rounds. In contrast, in a centralized training process, all speaker data is used simultaneously, eliminating the risk of forget- ting previously learned speaker information. To address this aspect, we propose to analyze the evolution of WER per speaker according to the different rounds. As described in Section 3.1, 5 minutes of speech have been removed from the train- ing data for some speakers and included into an analysis dataset. Let us denote Gr the general model at communication round r and consider the speakers that share their models during the FL run at round 5. To facilitate the analysis, we pick a subset of 5 speakers at this round to test the performance of Gr. Figure 2 shows how the general model Gr performs on these five analysis datasets at each round. A dotted segment means that 4To facilitate research in FL using TED-LIUM 3 dataset, the recipe in- cluding data preparation, FL training and evaluation scripts will be released open source upon paper acceptance Fig. 1. Performance evolution (WER,%) of end-to-end models ASR based on wav2vec 2.0 (SSL) compared to end-to-end ASR models based on CRDNN (no SSL) on the TED-LIUM 3 test dataset Fig. 2. Global model performance on speaker's analysis dataset Fig. 3. Performance of speaker local models on corresponding anal- ysis datasets compared to the global model the speaker was not involved between two rounds, while a solid line means that the speaker contributed for one round during the two ones connected by the segment. First, we observe similar trends between different speakers and between solid and dotted segments. Figure 2 shows a significant improvement in WER for first rounds (from round 5 to round 22). Then, for next rounds, WER for dif- ferent speakers does not vary significantly. Therefore it can be seen that Gr contains relevant information for these speakers and does not bring any bias based on the number of participations. Another important aspect of FL to be considered is the perfor- mance of a speaker's local model. Figure 3 reports a test performed using the best round (round 85th). The figure shows that the local speaker model (represented by the gray columns) is enhanced after fine-tuning on its own dataset, as expected. Then we tested all these speaker models on the TED-LIUM 3 test set and obtained the av- erage WER = 13.04%, to be compared with WER = 10.92% of global model as been reported in Section 3.4.2. These results show that the global model Gr is well designed to process not only speak- ers involved in the federated learning but also new speakers. 3.5. Protection of speaker identity 3.5.1. Privacy preservation scenario and attack model Privacy preservation can be formulated as a game between users who share some data and attackers who access this data or data extracted from it and want to get information about the users [32, 33]. In FL, to preserve the user's data, only model updates are transmitted between the clients and server. An attacker aims to attack users using information received from the server about the models' updates. In this work, we consider the following privacy preservation sce- nario. We assume that an attacker has access to the following data and models: (i) a global model Gr shared with the clients at commu- nication round r; (ii) a personalised model M of some speaker ob- tained at round r from Gr; (iii) speech data (utterances u1, . . . , uT ) of a known speaker which will be referred to as enrollment data fol- lowing the traditional ASV terminology data. The attacker does not know the identity of the speaker corresponding to M and aims to perform an automatic speaker verification (ASV) task using i–iii to verify if the model M and data u1, . . . , uT correspond to the same speaker. We will refer to M as test trial model. In this work, we use an attack model that is similar to the one proposed in [4]. The idea is based on capturing information about the speaker identity from the corresponding personalised model M and the global model Gr by comparing the outputs of these two neural acoustic models (AM) taken from hidden layers h on some speech data (called indicator in [4]). The indicator data is not related to test or training data and can be chosen arbitrarily from any speakers. The method consists in the following steps: (1) get a person- alised model Me for enrollment speaker e from the enrollment data (iii): u1, . . . , uT , by finetuning Gr on this data; (2) using Gr and M compute per-frame differences between activation values of these two models from some hidden layer h for all utterances of the in- dicator dataset; then for these differences compute a mean vector μ over all frames; (3) using Gr and Me compute per-frame differ- ences between activation values of these two models from layer h for all utterances of the indicator dataset; then for these differences compute a mean vector μe over all frames; (4) compute similarity score ρ between enrollment model Me and test trial model M as co- sine similarity between corresponding mean vectors: ρ(Me, M ) = cos(μ, μe) and perform an ASV task using these scores. More de- tails can be found in [4]5. As a privacy evaluation metric, in this work, we use equal er- ror rate (EER). Denoting by Pfa(θ) and Pmiss(θ) the false alarm and miss rates at threshold θ, the EER corresponds to the thresh- old θEER at which the two detection error rates are equal, i.e., 5The differences with respect to the work [4] are in the way the similar- ity scores are computed: (1) only mean values (without standard deviation components as in [4]) are used; and (2) cosine distance instead of Euclidean- based metric is applied. EER = Pfa(θEER) = Pmiss(θEER). The higher EER the better is privacy preservation. Fig. 4. Privacy evaluation (EER,%) for different computational rounds and layers of the ASR models 3.5.2. Results The speaker privacy has been evaluated for the ASR models with the wav2vec 2.0-based architecture (Section 3.2.2). We applied the attack model described in Section 3.5.1 for different computational rounds r. For each round, we used 50 enrollment speakers and per- form an ASV task for all clients of the given round (performing in average 15 target and 986 non-target trials per round). The amount of enrollment data for each model ((iii) in Section 3.5.1) is about 5 minutes. Experimental results are presented in Figure 4 for dif- ferent hidden layers of the ASR models and rounds {3,5,10,20,30}. The green dashed curve represents the EER averaged over selected rounds. In general, EER increases when the number of computa- tional rounds increases, so it is more difficult for the attacker to re- trieve information about the speaker identity from the personalised models on the later rounds than on the earlier ones. For lower hidden layers, the EER in average is lower than for upper layers. 4. CONCLUSION This paper presents a study on the use of federated learning to train an ASR model based on the wav2vec 2.0 model. The experimental results, carried out on the well-known TED-LIUM 3 dataset, showed the capability of federated learning to train an effective ASR model without sharing any speech data when federated learning is applied to fine-tune a wav2vec 2.0 model. Our experiments demonstrated that the general model contains relevant information for those speak- ers who have participated in the federated learning by sharing their local models, but we did not observe any bias based on the number of participations. The general model built through federated learning is also very effective to process unseen speakers. Finally, we have eval- uated the privacy level achieved for the proposed federated learning framework by exploiting an approach to analyse information con- tained in personalised models based on a neural network footprint on an indicator dataset. The layer-wise analysis has demonstrated that speaker information can be retrieved from all the considered rounds of the FL process. EER is lower on the earlier stages of the process and varies from 5 up to 20%, for different rounds for hidden layers #2–#6). In a future work, we could also investigate which amount of linguistic information is brought by the shared local speaker models. 5. REFERENCES [1] Jakub Koneˇcn`y, H Brendan McMahan, Felix X Yu, Peter Richt ́arik, Ananda Theertha Suresh, and Dave Bacon, "Fed- erated learning: Strategies for improving communication effi- ciency," arXiv preprint arXiv:1610.05492, 2016. [2] H. Brendan McMahan, Eider Moore, Daniel Ramage, et al., "Communication-efficient learning of deep networks from de- centralized data," 2016. [3] Dimitrios Dimitriadis, Ken'ichi Kumatani, Robert Gmyr, Yashesh Gaur, and Sefik Emre Eskimez, "A federated approach in training acoustic models.," in Interspeech, 2020. [4] Natalia Tomashenko, Salima Mdhaffar, Marc Tommasi, Yan- nick Est`eve, and Jean-Franc ̧ois Bonastre, "Privacy attacks for automatic speech recognition acoustic models in a federated learning framework," in ICASSP 2022. [5] Yan Gao, Titouan Parcollet, Salah Zaiem, Javier Fernandez- Marques, Pedro P. B. de Gusmao, et al., "End-to-end speech recognition from federated acoustic models," in ICASSP, 2022. [6] Han Zhu, Jindong Wang, Gaofeng Cheng, Pengyuan Zhang, and Yonghong Yan, "Decoupled Federated Learning for ASR with Non-IID Data," in Interspeech 2022. [7] Junteng Jia, Jay Mahadeokar, Weiyi Zheng, Yuan Shangguan, Ozlem Kalinli, and Frank Seide, "Federated Domain Adapta- tion for ASR with Full Self-Supervision," in Interspeech 2022. [8] Haaris Mehmood, Agnieszka Dobrowolska, Karthikeyan Sara- vanan, et al., "FedNST: Federated Noisy Student Training for Automatic Speech Recognition," in Interspeech 2022. [9] David Leroy, Alice Coucke, Thibaut Lavril, Thibault Gissel- brecht, and Joseph Dureau, "Federated learning for keyword spotting," in ICASSP, 2019. [10] Andrew Hard, Kurt Partridge, Cameron Nguyen, Niranjan Subrahmanya, Aishanee Shah, Pai Zhu, et al., "Training key- word spotting models on non-iid data with federated learning," in Interspeech, 2020. [11] Andrew Hard, Kurt Partridge, Neng Chen, Sean Augenstein, Aishanee Shah, Hyun Jin Park, et al., "Production federated keyword spotting via distillation, filtering, and joint federated- centralized training," in Interspeech 2022. [12] Abraham Woubie and Tom B ̈ackstr ̈om, "Federated learning for privacy-preserving speaker recognition," IEEE Access, 2021. [13] Filip Granqvist, Matt Seigel, Rogier van Dalen, ́Aine Cahill, Stephen Shum, and Matthias Paulik, "Improving On-Device Speaker Verification Using Federated Learning with Privacy," in Interspeech 2020. [14] Siddique Latif, Sara Khalifa, Rajib Rana, and Raja Jurdak, "Federated learning for speech emotion recognition applica- tions," in IEEE International Conference on Information Pro- cessing in Sensor Networks 2020. [15] Yan Gao, Javier Fernandez-Marques, Titouan Parcollet, Abhi- nav Mehrotra, and Nicholas Lane, "Federated Self-supervised Speech Representations: Are We There Yet?," in Interspeech 2022. [16] Wentao Yu, Jan Freiwald, S ̈oren Tewes, Fabien Huennemeyer, and Dorothea Kolossa, "Federated learning in asr: Not as easy as you think," in Speech Communication, 2021. [17] Alexei Baevski, Yuhao Zhou, Abdelrahman Mohamed, and Michael Auli, "wav2vec 2.0: A framework for self-supervised learning of speech representations," Advances in Neural Infor- mation Processing Systems, 2020. [18] Shu-wen Yang, Po-Han Chi, Yung-Sung Chuang, Cheng-I Jeff Lai, Kushal Lakhotia, Yist Y Lin, et al., "Superb: Speech processing universal performance benchmark," arXiv preprint arXiv:2105.01051, 2021. [19] Sol`ene Evain, Ha Nguyen, Hang Le, Marcely Zanon Boito, Salima Mdhaffar, Sina Alisamir, Ziyi Tong, Natalia Tomashenko, et al., "Lebenchmark: A reproducible frame- work for assessing self-supervised representation learning from speech," in Interspeech 2021. [20] Salima Mdhaffar, Jean-Franc ̧ois Bonastre, Marc Tommasi, Na- talia Tomashenko, and Yannick Est`eve, "Retrieving speaker in- formation from personalized acoustic models for speech recog- nition," in ICASSP, 2022. [21] Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith, "Federated optimiza- tion in heterogeneous networks," 2018. [22] Tian Li, Maziar Sanjabi, Ahmad Beirami, and Virginia Smith, "Fair resource allocation in federated learning," 2019. [23] Reza Shokri and Vitaly Shmatikov, "Privacy-preserving deep learning," in Proceedings of the 22nd ACM SIGSAC Confer- ence on Computer and Communications Security, New York, NY, USA, 2015, CCS '15, Association for Computing Machin- ery. [24] Daniel J Beutel, Taner Topal, Akhil Mathur, Xinchi Qiu, Javier Fernandez-Marques, Yan Gao, Lorenzo Sani, Kwing Hei Li, Titouan Parcollet, et al., "Flower: A friendly federated learning framework," 2022. [25] Mirco Ravanelli, Titouan Parcollet, Peter Plantinga, Aku Rouhe, Samuele Cornell, Loren Lugosch, Cem Subakan, Nau- man Dawalatabad, et al., "Speechbrain: A general-purpose speech toolkit," 2021. [26] Franc ̧ois Hernandez, Vincent Nguyen, Sahar Ghannay, Natalia Tomashenko, and Yannick Est`eve, "TED-LIUM 3: twice as much data and corpus repartition for experiments on speaker adaptation," in Speech and Computer, 2018. [27] Salima Mdhaffar, Marc Tommasi, and Yannick Est`eve, "Study on acoustic model personalization in a context of collaborative learning constrained by privacy preservation," in SPECOM, 2021. [28] Chung-Cheng Chiu, Tara N Sainath, Yonghui Wu, Rohit Prab- "State-of-the-art speech recognition with havalkar, et al., sequence-to-sequence models," in ICASSP 2018. [29] Alex Graves, Santiago Fern ́andez, et al., "Connectionist tem- poral classification: labelling unsegmented sequence data with recurrent neural networks," in Proceedings of the 23rd inter- national conference on Machine learning, 2006. [30] Yue Zhao, Meng Li, Liangzhen Lai, Naveen Suda, Damon Civin, and Vikas Chandra, "Federated learning with non-iid data," 2018. [31] Chao Huang, Jianwei Huang, and Xin Liu, "Cross-silo feder- ated learning: Challenges and opportunities," 2022. [32] Natalia Tomashenko, Xin Wang, Emmanuel Vincent, Jose Patino, et al., "The VoicePrivacy 2020 Challenge: Results and findings," Computer Speech and Language, vol. 74, 2022. [33] Natalia Tomashenko, Brij Mohan Lal Srivastava, Xin Wang, Emmanuel Vincent, Andreas Nautsch, Junichi Yamagishi, Nicholas Evans, et al., "Introducing the VoicePrivacy initia- tive," in Interspeech, 2020.
http://arxiv.org/abs/2302.10149v1
2023-02-20T18:30:54
2023-02-20T18:30:54
Poisoning Web-Scale Training Datasets is Practical
Deep learning models are often trained on distributed, webscale datasets crawled from the internet. In this paper, we introduce two new dataset poisoning attacks that intentionally introduce malicious examples to a model's performance. Our attacks are immediately practical and could, today, poison 10 popular datasets. Our first attack, split-view poisoning, exploits the mutable nature of internet content to ensure a dataset annotator's initial view of the dataset differs from the view downloaded by subsequent clients. By exploiting specific invalid trust assumptions, we show how we could have poisoned 0.01% of the LAION-400M or COYO-700M datasets for just $60 USD. Our second attack, frontrunning poisoning, targets web-scale datasets that periodically snapshot crowd-sourced content -- such as Wikipedia -- where an attacker only needs a time-limited window to inject malicious examples. In light of both attacks, we notify the maintainers of each affected dataset and recommended several low-overhead defenses.
[ "Nicholas Carlini", "Matthew Jagielski", "Christopher A. Choquette-Choo", "Daniel Paleka", "Will Pearce", "Hyrum Anderson", "Andreas Terzis", "Kurt Thomas", "Florian Tramèr" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10149v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10149v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CR", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CR", "cs.LG" ]
3 2 0 2 b e F 0 2 ] R C . s c [ 1 v 9 4 1 0 1 . 2 0 3 2 : v i X r a Poisoning Web-Scale Training Datasets is Practical Nicholas Carlini1 Matthew Jagielski1 Christopher A. Choquette-Choo1 Daniel Paleka2 Will Pearce3 Hyrum Anderson4 Andreas Terzis1 Kurt Thomas1 Florian Tramèr2 1Google 2ETH Zurich 3NVIDIA 4Robust Intelligence Abstract Deep learning models are often trained on distributed, web- scale datasets crawled from the internet. In this paper, we introduce two new dataset poisoning attacks that intentionally introduce malicious examples to a model's performance. Our attacks are immediately practical and could, today, poison 10 popular datasets. Our first attack, split-view poisoning, ex- ploits the mutable nature of internet content to ensure a dataset annotator's initial view of the dataset differs from the view downloaded by subsequent clients. By exploiting specific in- valid trust assumptions, we show how we could have poisoned 0.01% of the LAION-400M or COYO-700M datasets for just $60 USD. Our second attack, frontrunning poisoning, targets web-scale datasets that periodically snapshot crowd-sourced content-such as Wikipedia-where an attacker only needs a time-limited window to inject malicious examples. In light of both attacks, we notify the maintainers of each affected dataset and recommended several low-overhead defenses. 1 Introduction Datasets used to train deep learning models have grown from thousands of carefully-curated examples [20, 33, 41] to web- scale datasets with billions of samples automatically crawled from the internet [10, 48, 53, 57]. At this scale, it is infeasible to manually curate and ensure the quality of each example. This quantity-over-quality tradeoff has so far been deemed ac- ceptable, both because modern neural networks are extremely resilient to large amounts of label noise [55, 83], and because training on noisy data can even improve model utility on out-of-distribution data [50, 51]. While large deep learning models are resilient to random noise, even minuscule amounts of adversarial noise in train- ing sets (i.e., a poisoning attack [6]) suffices to introduce targeted mistakes in model behavior [14, 15, 60, 76]. These prior works argued that poisoning attacks on modern deep learning models are practical due to the lack of human cura- tion. Yet, despite the potential threat, to our knowledge no real-world attacks involving poisoning of web-scale datasets have occurred. One explanation is that prior research ignores the question of how an adversary would ensure that their cor- rupted data would be incorporated into a web-scale dataset. In this paper, we introduce two novel poisoning attacks that guarantee malicious examples will appear in web-scale datasets used for training the largest machine learning models in production today. Our attacks exploit critical weaknesses in the current trust assumptions of web-scale datasets: due to a combination of monetary, privacy, and legal restrictions, many existing datasets are not published as static, standalone artifacts. Instead, datasets either consist of an index of web content that individual clients must crawl; or a periodic snap- shot of web content that clients download. This allows an attacker to know with certainty what web content to poison (and, as we will show, even when to poison this content). Our two attacks work as follows: • Split-view data poisoning: Our first attack targets cur- rent large datasets (e.g., LAION-400M) and exploits the fact that the data seen by the dataset curator at collection time might differ (significantly and arbitrarily) from the data seen by the end-user at training time. This attack is feasible due to a lack of (cryptographic) integrity pro- tections: there is no guarantee that clients observe the same data when they crawl a page as when the dataset maintainer added it to the index. • Frontrunning data poisoning: Our second attack ex- ploits popular datasets that consists of periodical snap- shots of user-generated content-e.g., Wikipedia snap- shots. Here, if an attacker can precisely time malicious modifications just prior to a snapshot for inclusion in a web-scale dataset, they can front-run the collection pro- cedure. This attack is feasible due to predictable snap- shot schedules, latency in content moderation, and snap- shot immutability: even if a content moderator detects and reverts malicious modifications after-the-fact, the attacker's malicious content will persist in the snapshot used for training deep learning models. 1 We explore the feasibility of both of these attacks in prac- tice on 10 popular web-scale datasets. We show these at- tacks are practical and realistic even for a low-resourced at- tacker: for just $60 USD, we could have poisoned 0.01% of the LAION-400M or COYO-700M datasets in 2022. To counteract these attacks, we propose two defenses: • Integrity verification prevents split-view poisoning by distributing cryptographic hashes for all indexed content, thus ensuring that clients observe the same data as when maintainers first indexed and annotated it. • Timing-based defenses prevent frontrunning poisoning by either randomizing the order in which data is snap- shotted and introduced into web-scale datasets; or de- laying content prior to its inclusion into a snapshot and applying reversions from trusted moderators. We discuss limitations of these defenses (e.g., in the case of integrity checks, preventing benign modifications such as re-encoding, re-sizing, or cropping images) and more robust, future-looking solutions with fewer trust assumptions. Responsible disclosure. We disclosed our results to the main- tainers of each of the 10 datasets appearing in this study. Six of these datasets now follow our recommended implementa- tion for integrity checks. Additionally, we provided patches to the most popular web-scale dataset downloader to support integrity checks. Finally, we have notified Wikipedia about the frontrunning vulnerability in their data collection process. 2 Background & Related Work Our work builds on existing knowledge of the risk of poison- ing web-scale datasets, but focuses on the practical exploit vectors to launch such an attack. We outline why web-scale datasets have become of critical importance, known security risks of web-scale datasets, as well as auxiliary dataset quality issues that stem from ingesting uncurated data into models. Momentum towards uncurated datasets. Deep learning is most effective when applied to large datasets [10, 30]. But curating such datasets is expensive. Even without manual labeling, the availability of training data has become a limiting factor for further improving model utility. For example, the scaling laws observed in the recent Chinchilla [27] language model indicate that training a compute-optimal 500 billion parameter model would require 11 trillion tokens of training data-over 10× more data than is currently used to train models of this size [19]. To drastically scale dataset sizes, it has become common to scrape data from a wider and wider range of untrusted and uncurated web sources. Security risk of poisoning attacks. Uncurated training datasets are prime targets for poisoning attacks [6]. For exam- ple, an adversary could modify the training dataset ("poison- ing" it) so that some targeted example will be misclassified by models trained on this dataset. Early poisoning attacks were designed to target fully-supervised classifiers [18,24,64] trained on curated datasets. These attacks often aim to be "stealthy", by altering data points in a manner indiscernible to human annotators [74]. Attacks on uncurated datasets do not require this strong property. Recent work [14, 15] shows that arbitrarily poisoning only 0.001% of uncurated web-scale training datasets is sufficient to induce targeted model mis- takes, or plant model "backdoors" [18, 24]. It is thus known that if an adversary were somehow able to poison a fraction of a web-scale dataset, then they could cause significant harm. However, it is not well understood how an adversary could place their poisoned samples in any common training dataset without guessing beforehand which parts of the web will be collected. This paper answers that question. Auxiliary risks related to data quality. Spending time and effort to curate datasets has benefits besides security. Possibly most important among these is that uncurated data has seri- ous implications for fairness, bias, and ethics [8, 50, 77]. For example, Birhane et al. [7] note that LAION-400M has "trou- blesome and explicit images and text pairs of rape, pornog- raphy, malign stereotypes, racist and ethnic slurs, and other extremely problematic content". Many language datasets also contain similarly harmful "hate speech and sexually explicit content, even after filtering" [40]. Dataset curation is not a perfect solution to these problems. Birhane et al. [7] note, "without careful contextual analysis, filtering mechanisms are likely to censor and erase marginal- ized experiences". Any filtering approaches that selectively remove some data sources over others should carefully con- sider not only the security implications of doing this, but also other more general data quality metrics. 3 Threat Model & Attack Scenarios Before presenting the implementation details of our attacks, we introduce key terminology, our threat model, and a high- level description of the intuition behind our two attacks. 3.1 Terminology Because it is infeasible to distribute web-scale datasets as standalone artifacts (due to the dataset size or regulatory con- cerns), current training datasets fall into one of two categories. In the first category, a maintainer generates a set of N tu- ples {(urli, ci)}N i=1 consisting of a resource identifier urli and auxiliary data ci (typically a label). We let ti denote the time at which the i-th sample was originally collected. Critically, the maintainer does not provide a snapshot of the data associated with urli, due either to untenable storage costs [3,4,17,31], pri- vacy concerns [13, 72], or copyright limitations [16]. As such, we refer to these as distributed datasets. One example is the LAION-5B dataset [57] which consists of five billion tuples of 2 image URLs and corresponding text captions-corresponding to several hundred terabytes of data. In the second category of datasets, a curator produces a snapshot of a dataset {xi}N i=1, where each sample xi is drawn from a set of URLs {urli}N i=1 at time ti, and then makes this snapshot publicly available. Because data served by these URLs changes over time, the curator will frequently (e.g., monthly) re-collect a dataset snapshot so that users have an up-to-date view of the data. We refer to these as centralized datasets. For example, both Wikipedia and Common Crawl regularly produce snapshots of their entire database. This simplifies access for people training large models, while also discouraging researchers from re-scraping the database di- rectly. Once one of these two types of datasets has been published, a client (e.g., a researcher or applied practitioner) downloads a local copy of the training dataset D, either by crawling each URL for decentralized datasets {(urli, ci)}N i=1 at a future time i > ti, or by downloading the centralized dataset {xi}N t(cid:48) i=1. In practice, clients often use a downloader tool developed and maintained by a third party. 3.2 Threat Model We assume the existence of a relatively unskilled, low- resource adversary who can tamper with the contents of a small number of URLs {urli}N i=1 at some point in time ˆti, such that when a client or curator accesses resource i at a future time t(cid:48) i > ˆti, they receive a modified (poisoned) dataset D (cid:48) (cid:54)= D. The difference between the poisoned and intended datasets must be sufficiently large such that a model f trained on D (cid:48) will produce poisoned results for some desired input. We let Sadv ⊂ {urli}N i=1 denote the set of URLs an adversary can modify. We assume the adversary has no specialized or insider knowledge about the curator, downloader, or maintainer other than knowledge of the set of URLs {urli}N i=1 used to generate D (this information is published by the dataset maintainer or curator). We further assume all maintainers, curators and downloaders behave honestly and do not assist the adversary in any way. As such, the adversary has no control over the auxiliary data ci (e.g., supervised labels or text descriptions), nor can they add or remove any URLs from the training data that will be crawled by a client or curator. We make two critical (yet realistic) assumptions that enable our attacks. For distributed datasets, we assume that clients do not compare the cryptographic integrity of the local dataset copy D (cid:48) that they downloaded, with the original dataset D indexed by the maintainer. For centralized datasets, we as- sume that it takes the curator at least some time ∆ to detect malicious changes to the content hosted at any URL urli in the dataset (e.g., for Wikipedia, ∆ is the time it takes to revert a malicious edit). Thus, the curator cannot detect that urli hosts poisoned content if the attacker poisoned the content at any time ti − ∆ ≤ ˆti ≤ ti, where ti is the time at which the content of urli is included in the dataset snapshot. As we will show, these assumptions holds true for nearly all modern web- scale datasets. We discuss (in Section 6) how invalidating these assumptions-via cryptographic integrity checks and randomized crawling-can mitigate the attacks we describe. 3.3 Attack Scenarios We propose two attack strategies for poisoning recent web- scale datasets. In the subsequent sections we demonstrate the efficacy of these attacks in practice on real-world datasets, and describe the ethical safeguards we followed to minimize harm. We focus our attacks on mechanisms that are unique to our study of dataset poisoning. Other potential security vulnerabilities (e.g., the ability of an adversary to interfere with unencrypted network requests from clients, or to exploit website vulnerabilities to inject new content) are out of scope and would only improve our attack success rates. Split-view poisoning. Our first attack exploits the fact that while the index of a distributed dataset published by a main- tainer cannot be modified, the content of URLs in the dataset can.1 This allows an adversary who can exert sustained con- trol over a web resource indexed by the dataset to poison the resulting collected dataset collected by the end-user. The specific vulnerability we exploit in our attack results from a fairly simple observation: just because a web page hosted benign content when the dataset was initially collected, this does not mean the same page is currently hosting benign content. In particular, domain names occasionally expire- and when they do, anyone can buy them. We show that domain name expiration is exceptionally common in large datasets. The adversary does not need to know the exact time at which clients will download the resource in the future: by owning the domain the adversary guarantees that any future download will collect poisoned data. We note that attackers already routinely buy expired do- mains to hijack the residual trust attached with these do- mains [35, 39, 67]. Attackers have in the past targeted residual trust to defunct banking domains [44] and imported JavaScript libraries [47] to serve malware or steal user data, to take over email addresses associated with the domain [56], to control au- thoritative nameservers [39], or simply to serve ads [36]. Here, we abuse residual trust to poison distributed datasets. While more sophisticated attacks may accomplish the same goal- such as exploiting a website, coercing a website's owner to modify content, or modifying unencrypted network traffic in flight-we focus on the natural phenomenon of domain expiration in this work. To select domains to purchase, the adversary can either pri- oritize cheap domains that host multiple URLs in the dataset 1Put differently, there is an important difference between the C types "int const *" (how practitioners often treat these URL-based datasets) and "int * const" (what the dataset actually provides). 3 (minimizing the cost per poisoned URL), or domains that host content with specific auxiliary data ci (recall that the adversary cannot modify the auxiliary data contained in the distributed dataset index). We show that split-view poison- ing is effective in practice, as the index of most web-scale datasets remain unchanged long after their first publication, even after a significant fraction of the data goes stale. And critically, very few (and no modern) datasets include any form of cryptographic integrity check of the downloaded content. Frontrunning poisoning. Our second attack extends the scope of split-view poisoning to the settings where an ad- versary does not have sustained control over web resources indexed by the dataset. Instead, the adversary can only mod- ify web content for a short time period (e.g., a few minutes) before the malicious modification is detected. This setting is common for datasets that aggregate content published on crowdsourced web pages, such as on Wikipedia. Indeed, it is easy to temporarily edit Wikipedia to vandalize its contents [63, 69]. A naive adversary might thus poison some Wikipedia content at arbitrary times and hope that a dataset curator will scrape the poisoned pages before the malicious edits are reverted. However, Wikipedia vandalism is reverted in a few minutes on average [80], so any randomly-timed malicious edits are unlikely to affect a dataset collection. Our frontrunning attack relies on the fact that an adver- sary can, in some cases, predict exactly when a web resource will be accessed for inclusion in a dataset snapshot. As a re- sult, the adversary can poison dataset contents just prior to a curator collecting a snapshot, thereby frontrunning content moderators who will later revert the malicious edits. We will show that frontrunning attacks are particularly effective for Wikipedia datasets, because the official Wikipedia snapshot procedure accesses articles in a predictable-and well docu- mented2-linear sequence. An attacker can thus predict the snapshot time ti of any Wikipedia article down to the minute. 4 Split-View Data Poisoning We now begin our evaluation starting with split-view data poisoning attacks, where an attacker poisons a distributed dataset by purchasing and modifying expired domains. 4.1 Our Attack: Purchasing Expired Domains While split-view poisoning is applicable to any distributed dataset, we focus on multimodal image-text datasets. In such datasets, each URL points to an image hosted by some data provider, and the auxiliary data contains a textual descrip- tion of the image, e.g., an annotated class label or a caption extracted from the web page. 2https://en.wikipedia.org/w/index.php?title=Wikipedia: Database_download&oldid=1138465486 Our attack exploits the fact that the Domain Name System (DNS) does not assign permanent ownership of any domain to a particular person or organization, but rather grants short (yearly) "leases" that must be frequently renewed. Thus, do- main names continuously expire over time-intentionally or not-when the re-registration fees are not paid. When the domain that hosts an image in a distributed dataset expires, anyone can pay to take ownership over this domain and thereby gain the ability to return arbitrary con- tent when the indexed image is later downloaded by a victim client. Split-view poisoning abuses the residual trust inherent in an expired domain, as in traditional domain hijacking at- tacks [39]. We find that for many popular distributed datasets, domains are included with relatively lax quality-assurance measures (if any), and thus domains with no special status that have been expired for months can freely be acquired to control a modest fraction of the entire dataset. In this section we study to what extent it is possible to poi- son datasets by purchasing expired domains. We first quantify the fraction of domains that are expired in popular distributed datasets (§ 4.2), then measure the frequency at which these datasets are scraped (§ 4.3), verify this attack is not currently exploited in the wild (§ 4.4) and finally study the attack's potential down-stream impact (§ 4.5). 4.2 Quantifying the Attack Surface Table 1 lists ten recent datasets we study in this paper that are vulnerable to split-view poisoning. The three oldest datasets (PubFig, FaceScrub, and VGG Face) are datasets of faces and associate each image with the identity of a single person (most often a popular celebrity). The remaining seven datasets are multimodal datasets containing URLs that point to images, along with textual captions automatically extracted from the HTML of the webpage. As such, for these datasets, the image can be modified by the owner of the corresponding domain, but the image's caption is fixed in the dataset index. To measure the fraction of images that could be potentially poisoned, we count the number of images hosted on domains that are expired and buyable. We say that a domain is expired if the DNS record for that domain does not exist. To measure this, we perform an nslookup on every domain name in the dataset from two geographically distinct data-centers in May 2022 and August 2022 and report the domain as expired if all four lookups result in a NXDOMAIN response. We further call a domain buyable if it is expired, and if at least one domain name registrar listed the domain as explicitly for sale by the registrar3 in August 2022. Instead of counting the total fraction of data that is buyable (which would repre- sent a financially unconstrained adversary), Table 1 reports the fraction of images in the dataset from domains that can be 3Some registrars list domains as for sale even if they are actually owned by a squatter. We exclude these domains from our set of buyable domains because purchasing these domains is often an expensive and lengthy process. 4 Dataset name Size Release Cryptographic (×106) date hash? Data from expired domains Data buyable Downloads for $10K USD per month 2022 2323 LAION-2B-en [57] 2022 LAION-2B-multi [57] 2266 2022 LAION-1B-nolang [57] 1272 2022 747 COYO-700M [11] 2021 408 LAION-400M [58] 2021 12 Conceptual 12M [16] 2018 3 CC-3M [65] 2.6 VGG Face [49] 2015 0.10 2014 FaceScrub [46] 0.06 2010 PubFig [34] (cid:55)† (cid:55)† (cid:55)† (cid:55)‡ (cid:55) (cid:55) (cid:55) (cid:55) (cid:51)§ (cid:51)§∗ 0.29% 0.55% 0.37% 1.51% 0.71% 1.19% 1.04% 3.70% 4.51% 6.48% ≥ 0.02% ≥ 0.03% ≥ 0.03% ≥ 0.15% ≥ 0.06% ≥ 0.15% ≥ 0.11% ≥ 0.23% ≥ 0.79% ≥ 0.48% ≥7 ≥4 ≥2 ≥5 ≥10 ≥33 ≥29 ≥3 ≥7 ≥15 Table 1: All recently-published large datasets are vulnerable to split-view poisoning attacks. We have disclosed this vulnerability to the maintainers of affected datasets. All datasets have > 0.01% of data purchaseable (in 2022), far exceeding the poisoning thresholds required in prior work [14]. Each of these datasets is regularly downloaded, with each download prior to our disclosure being vulnerable. † LAION-5B released a "joined" version of this dataset with a cryptographic hash over the text of the URL and Caption (not the contents of the URL), and as such does not protect the integrity of the actual image. ‡ COYO-700M images are distributed with pHash [32] which validates benign image changes, but is not adversarially robust [29]. § FaceScrub and PubFig contain cryptographic hashes, but the dataset maintainers do not provide an official downloader client that verifies these. We find that nearly all third-party downloaders for these datasets ignore hashes. ∗ PubFig was initially released without hashes, but hashes were later added in Version 1.2 of the dataset. purchased for a total cost of $10,000 USD. (Figure 1 plots the fraction of datasets that can be purchased as a function of total cost.) To compute this, we sort domains in decreasing order of "images per dollar": the number of images the domain hosts divided by the cost to purchase this domain. Overall, we see that an adversary with a modest budget could purchase control over at least 0.02%–0.79% of the im- ages for each of the 10 datasets we study. This is sufficient to launch existing poisoning attacks on uncurated datasets, which often require poisoning just 0.01% of the data [15].4 We also find that there is a direct relationship between the age of a dataset and how easy it is to poison. Older datasets are more likely to contain expired domains, and therefore an adversary can purchase a larger fraction of the dataset. Datasets are vulnerable from day zero. One limitation of our above analysis is that we have measured the fraction of datasets vulnerable to poisoning in August 2022, but many of these datasets were constructed years earlier. It is therefore likely that many people who use these datasets would have already downloaded them at an earlier date, and thus may not have been vulnerable to our poisoning attack (although we will show in the following section that fresh downloads of each of these datasets remain frequent today). Fortunately, the COYO-700M dataset was released during the writing of this research paper, on 30 August 2022. On that same day, we computed the fraction of the dataset that 4Carlini & Terzis [15] assume the adversary can modify images and their captions, whereas our adversary only controls images. In § 4.5, we show modifying captions is unnecessary for a successful poisoning attack. was vulnerable to our poisoning attack and found that already 0.15% of the images were hosted on expired domains that cost fewer than $10,000 USD to purchase. The reason that the number of expired domains is not zero on release is that building these large datasets is a time-consuming and expen- sive procedure. And so even though the COYO-700M index was released in August 2022, it took nearly a year to collect the dataset [11], giving ample time for the earliest scraped domains to have expired before the dataset was released. Measuring the attack cost. The most immediate question is if this attack can be realized in practice. The primary con- straint of our attack is the monetary cost of purchasing do- mains, which we measure using the costs reported by Google Domains in August 2022. In Figure 1 we show the fraction of images in a dataset that can be controlled by the attacker as a function of their budget. We find that at least 0.01% of each dataset can be controlled for less that $60 USD per year. 4.3 Measuring the Attack Impact Our attacks are "retroactive" in the sense that we can poison a dataset after it has been initially constructed by the curators- but the impact is limited to those who download it after we take over the domains. And given that it has been several years since many of these datasets were initially constructed, it is not obvious that anyone would still download them by scrapping URLs instead of reusing a previously downloaded version of the dataset. As a result, in order to measure the potential impact of a split-view poisoning attack it is necessary 5 under our control, including at least one URL from each of the 6 domains we own for that dataset. 2. Precision: At least 50% of the requests issued by X within this time range to the domains we control are to URLs in D. These conditions are conservative, but ensure we filter out web crawlers and other mass internet scrapers because these are likely to crawl other URLs from this domain (violating the precision constraint) or not crawl the majority of the URLs from the dataset (violating the recall constraint). Additionally, because we own six domains per dataset it is exceptionally unlikely that, by random chance alone, one particular IP will request URLs from each of these six otherwise-unrelated domains. (In fact, we find that even checking 3 of these URLs would give almost identical precision.) As a point of reference, for the CC-3M dataset, we received 51,000 image requests per month from a total of 2401 unique IPs. By applying the precision constraint alone, we reduce this to 2007 unique IPs and 43,000 image requests; by applying the recall constraint alone we get 70 unique IPs and 32,000 image requests; and both together yields a further reduction of 64 unique IPs and 28,000 image requests (per month). 4.3.1 Results We report our results in the rightmost column of Table 1. Even the oldest and least frequently accessed datasets still had at least 3 downloads per month. Thus, over the six months we tracked data, there were over 800 downloads that we could have poisoned with our attack. Unsurprisingly, we found that newer datasets are requested more often than older datasets. Different datasets thus offer different tradeoffs for attackers: newer datasets have a smaller fraction of purchasable images, but an attack can reach many more vulnerable clients. We observe that the largest billion-image datasets are down- loaded significantly less often than smaller recent datasets. We found that the reason for this is that these datasets are rarely downloaded in their entirety; instead, they serve as an upstream source for smaller subsets. For example, the Public Multimodal Dataset (PMD) [66] and LAION-Aesthetics [59] datasets consist almost entirely of images drawn from LAION- 2B-en. Sub-datasets like this explain why sometimes we see IP addresses with very high precision but low recall. Visualizing dataset crawlers. Using our log files, we can visualize the ways in which dataset downloaders access these datasets by plotting URL requests as a function of time. We order the set of URLs we bought for each dataset according to their order in the original dataset index. In this way, crawlers that process the dataset index linearly should appear (roughly) as a linear line in our plot of URL requests over time. To improve clarity, we assign each unique IP that accesses our server a separate random color. Figure 1: It often costs ≤ $60 USD to control at least 0.01% of the data. Costs are measured by purchasing domains in order of lowest cost per image first. to study the rate at which these datasets are actually still being actively downloaded by researchers and practitioners today. Methodology. We measure the rate at which each of these distributed datasets are downloaded from the internet by pur- chasing multiple expired domains from each of the 10 listed datasets, and passively monitoring requests to measure the rate at which URLs corresponding to images from the dis- tributed datasets are being downloaded. For each dataset, we purchase the three most popular ex- pired and buyable domains (that is, the domains available for purchase that hosted the most images), and three randomly selected domains that were available for purchase. We wrote a simple server to log all incoming HTTP and HTTPS5 re- quests, including the access time, a hash of the IP address, the full URL being requested, and any additional headers provided. This allowed us to count the frequency at which these datasets are still downloaded. We ran this server for six months beginning in August 2022. Analysis approach. Our server received approximately 15 million requests per month during our study, a rate of 6 re- quests every second. However from here it becomes necessary to separate the requests that were actually intending to down- load images from one of these datasets, from requests that come from other internet users or web crawlers. To begin our analysis, we make a (significant) simplifying assumption that anyone downloading one of these datasets does so from a single IP address. We may thus underestimate the true rate at which each dataset is downloaded. We then say that a particular IP address X downloads a dataset D at time [T0, T1] if we meet both a precision and recall requirement: 1. Recall: Within the time range [T0, T1], the IP address X downloads at least 90% of the URLs contained in D 5To also monitor HTTPS traffic we obtained certificates from LetsEncrypt for each of our domains. 6 $10$100$1k$10kCost (USD)0.01%0.1%1%Fraction of Images ControllableCOYO-700MLAION-400MCC12MCC3Mvggfacefacescrubpubfig from crawling our domains-this is unlikely to impact dataset downloads since dataset crawlers ignore this file. Finally, a request to the root domain returns a 403 Forbidden with a response body explaining that this domain is part of a research study. In this response we list a contact email address and also offer to return this domain to the original owner in case it was allowed to expire accidentally. We have not received any contact on this address. Appendix E contains the text of our landing web page. Our data collection is minimally invasive. When searching for expired domains, we limit our DNS requests to 500/second, we only ask for the cost of purchasing the top-10,000 domains in each dataset, and only eventually purchase six. This research study was deemed "exempt" by the ETH Zurich IRB. Google does not have an IRB, but the research plan was reviewed by experts at Google in areas including ethics, human subjects research, policy, legal, security, privacy, and anti-abuse. 4.4 Is This Attack Exploited in the Wild? Given that this attack vector has existed for years against many datasets, and is easy to execute, it is not implausible that someone would have carried out such a poisoning attack in the past. Yet, we could not find any evidence of this. We search for a signature of a domain-purchasing attack by looking for domains that (1) host images that have been modified since the initial dataset release and (2) have changed ownership since the initial dataset release. To detect image changes, we can either check if images are perceptually simi- lar to the originals (via, e.g., CLIP embeddings [52]) or exactly identical (via a cryptographic hash). Comparing images with cryptographic hashes has no false-negatives (i.e., any change is detected) but gives false-positives for "benign" changes, e.g., if a domain re-encodes or resizes its images. In contrast, a perceptual hash has fewer false-positives but can have false- negatives if an adversary buys a domain and modifies images while preserving the perceptual hash (which is not collision- resistant). Finally, to detect if a domain changed ownership, we request the whois record and check the last purchase date. Results. We perform our initial analysis on CC3M, a dataset where we have the original raw images as ground truth. Among all domains hosting more than 10 images, we find just one domain has our attack signature when comparing with perceptual image similarity. Upon further investigation, we find that this domain has been purchased by a domain squat- ter and any request to an image file on the domain return an advertisement. If we instead compare cryptographic hashes of images, we find the same domain squatter and also two other domains that have been repurchased. However, further investigation reveals the ownership of these domains has not changed and the DNS record simply lapsed, and images were re-encoded. Figure 2: Visualization of users downloading Conceptual 12M. By monitoring which URLs are requested from the domains we purchased, we plot every time a URL is requested over time, color coded by the source IP, and can directly read off several dozen users crawling Conceptual 12M. Appendix Figure 8 compares various filtering approaches. We show this plot for the Conceptual 12M dataset in Fig- ure 2. We can find several trends in this data. First, most users who download this dataset do so in a linear order from the first to the last URL. However, the rate at which URLs are accessed is highly variable: some downloaders crawl the en- tire dataset in a few hours, while others take several weeks to download the same dataset. We also observe some users that batch the data into chunks and download each chunk in paral- lel, as well as users that pause their download momentarily and then resume a few hours later (on a different IP). While our strict precision and recall requirements already give strong evidence that the IP addresses we logged were indeed downloading the dataset, the linear ordering of URL requests from these addresses all but confirms this. Indeed, because the ordering of URLs in the dataset index is random (instead of, say, alphabetical), a dataset download appears to be the only explanation for why the URLs would be linearly accessed in this particular order. User-agent verification. The most popular user agent6 is re- sponsible for 77% of the traffic to our domains. This user agent is hardcoded7 in img2dataset tool [5], a popular dataset crawler. Given the browser involved is Firefox 72– which was superseded in February 2020–it is highly likely that most of the requests indeed originate from img2dataset. Ethical considerations. We do not actually poison any datasets. For all URLs we own, we return a 404 Not Found response; so from the perspective of a dataset downloader our purchasing of the domain is completely transparent. We fur- ther place a robots.txt file to prevent typical web-scrapers 6Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0 7https://github.com/rom1504/img2dataset/blob/fc3fb2e/ img2dataset/downloader.py#L41 7 2022-08-112022-08-132022-08-15Date02000400060008000Index of URL accessed We also conduct this same analysis on LAION-400M. Here we study three versions of the data: at original release (2021- 11), and our own downloads at two later dates (2022-04 and 2022-08). We find no domain with such a signature in LAION- 400M, and thus have no evidence at present that this attack would have been exploited against this dataset. Because we only have the original CLIP embeddings for this dataset (the original raw bytes were not saved), we only perform this comparison. We find that by the first and second snapshot respectively, there are 4.1M and 4.2M unique domains (of 5.6M) that host at least one modified image-in total, we found 175M and 183M modified images, respectively. We measured this using a CLIP cosine similarity < 0.99. We randomly sample a few thousand domains including the 700 with the most modified images. We find many cases where domains are still owned by the original owner, are currently for sale, or have been redacted, but none appear malicious. 4.5 Putting It All Together Prior work [15] has successfully poisoned multimodal models contrastively trained on datasets of 3 million images, under the assumption the adversary can arbitrarily control the label of manipulated images. However, in this paper we study datasets over 100× larger, and assume an adversary with no control over the text captions. Are poisoning attacks effective with these two changes? We find they are. We consider two poisoning attack ob- jectives: (1) cause a particular image to be misclassified as some target label from ImageNet, and (2) cause a particu- lar image to be classified as NSFW by the Stable Diffusion Safety Filter [54]. For each of these attack objectives, we first identify appropriate text captions in LAION 400M for which the corresponding image domains can be purchased for a total of $1,000 USD. Then, we locally replace these images with poisoned samples to simulate the effect of an attack, without any potential to cause harm to others. Specifically, we train one OpenCLIP [28] model using a ViT-B-32 architecture for 32 epochs, at a batch size of 3072 on 16 A100 GPUs. For our object-misclassification objective, we choose ten ImageNet classes that appeared in multiple text captions of images we can control. When we poison 1,000 images (0.00025% of the total dataset) our attack has a success rate of 60% in flipping the model's zero-shot classification of the targeted image. For our NSFW objective, we find captions corresponding to images (from buyable domains) labeled as UNSAFE in the LAION 400M dataset index. Again at 1,000 poisoned samples, our attack has a success rate of above 90%. More details about this experiment are in Appendix D. 5 Frontrunning Poisoning Our second attack removes the assumption that the adversary has sustained control over the web data in a training set. To do this we make a new assumption: that we can predict precisely when the web content will be downloaded. We will investigate this attack on Wikipedia-derived datasets, but also discuss how similar vulnerabilities may exist in the Common Crawl dataset in Appendix B. 5.1 Our Attack: Editing Wikipedia Wikipedia is a crowdsourced encyclopedia. This makes it one of the most comprehensive and reliable datasets available on the internet [79]. As a result of its quality and diversity, Wikipedia is frequently sourced for ML training data. Indeed, many language modelling datasets heavily rely on the English Wikipedia, e.g., it formed over 75% of the words in the BERT training set [21], 1.5% of the Pile dataset [23], and the entirety of the WikiText dataset [43]. Many task-specific datasets also rely on the English Wikipedia: e.g., the WikiQA [81] question answering dataset (30,000+ downloads), and the WikiBio [38] biography writing dataset (19,000+ downloads). Finally, some of the distributed datasets discussed in Section 4 index many images from Wikipedia articles. Because Wikipedia is a live resource that anyone can edit, an attacker can poison a training set sourced from Wikipedia by making malicious edits. Deliberate malicious edits (or "vandalism") are not uncommon on Wikipedia, but are often manually reverted within a few minutes [80]. As a result, actually poisoning Wikipedia appears challenging: unlike the attacks in our prior section, an adversary cannot exert sustained control of any particular page and would thus have to hope that their malicious edit is timed just perfectly to affect a dataset download before being reverted. However, we make one key observation that will guaran- tee the success of our poisoning attack: Wikipedia-derived datasets are not themselves live, but rather a collection of static snapshots. This is because Wikipedia forbids using web crawlers to scrape the live website. Instead, Wikipedia makes available regular "dumps" (or snapshots) of the entire ency- clopedia. Thus, training datasets sourced from Wikipedia use these snapshots instead of data crawled directly from the site. For example, the authors of the BERT model [21] explicitly recommend "to download the latest [Wikipedia] dump" to reproduce their results. This makes it possible to mount what we call a frontrun- ning attack. An attacker who can predict when a Wikipedia page will be scraped for inclusion in the next snapshot can perform poisoning immediately prior to scraping. Even if the edit is quickly reverted on the live page, the snapshot will con- tain the malicious content-forever. The attentive reader may argue we have not gained much: instead of having to predict the time at which Wikipedia is crawled by the end-user to produce a training set, the attacker has to predict the time at which Wikipedia is crawled to produce an official snapshot. But as we will see, the latter is actually easy. In this section, we explore how an adversary can time mali- 8 that were made before (i.e., below) a different edit that was not included (in orange). For a frontrunning attack to succeed, it is thus not sufficient to just predict the time at which the snapshot procedure begins. The attacker also needs to predict the precise time at which each individual page is scraped. 5.2.2 Exploiting Rolling Snapshots To precisely predict each article's scrape time, the attacker can exploit consistencies in Wikipedia's snapshot process. First, the adversary knows precisely when each dump starts, because Wikimedia explicitly makes this information avail- able by publishing live statistics on ongoing snapshots.8 Second, the rate at which articles are crawled in a dump remains nearly consistent across dumps, and can thus be ap- proximated from prior dumps (interestingly, crawls tend to speed up slightly over time). With these two pieces of information, the attacker can pre- cisely predict when any given article will be crawled. For an article i, we denote the time at which it is crawled for the current snapshot as ti and its crawl time in the previous snapshot as ti,prev. We denote the start time of the current and previous snapshots (as reported by Wikimedia) as t0 and t0,prev respectively. Due to our first observation above, the attacker knows t0 and t0,prev. Due to our second observation, we have that ti − t0 ≈ ti,prev − t0,prev. This allows us to estimate the snapshot time of the i-th article as ti ≈ t0 + (ti,prev − t0,prev). But calculating this requires knowledge of ti,prev-the time at which the i-th article was crawled in the previous snapshot. We now discuss how to retroactively estimate this. 5.2.3 Determining the Article Snapshot Time Wikipedia snapshots do not explicitly list the snapshot time for each article. But Wikipedia does give some auxiliary in- formation: a complete list of edits with the precise time every edit is made. We show how this information can be used to retroactively estimate an article's snapshot time. Recall from Figure 3 that for each article we can find the list of edits that were included in the current snapshot (blue points), with later edits appearing in the next snapshot (or- ange points). For each article, we thus know that the snapshot time ti was somewhere between the times of the article's last included edit (top-most blue point) and the first non-included edit (bottom-most orange point). However, this interval is loose: the time between these edits is often several days. To refine our estimate of the snapshot time for each article, we can again exploit the consistency present in the Wikipedia crawling process. We observe that articles are processed se- quentially: by zooming in to just a single crawling job as shown in Figure 3, we see that articles are crawled sequen- tially, and a clear line separates the last-included and first- 8On https://dumps.wikimedia.org/backup-index.html Figure 3: An adversary can easily predict when any given Wikipedia article will be snapshot for inclusion in the bi- monthly dump. We visualize edits around the June 1st, 2022 Wikipedia snapshot. Each point corresponds to an edit made to a Wikipedia article, with the article ID on the X axis and time (in seconds) that the edit was made on the Y axis. Edit points colored blue were included in the snapshot, and edits colored orange were not included. The "sawtooth" pattern exhibited in the plot indicates a trend where multiple paral- lel jobs crawl Wikipedia articles sequentially to construct the snapshot. Furthermore, these parallel jobs run almost perfectly linearly through their allocated pages. cious edits to guarantee successful poisoning of a Wikipedia snapshot. To this end, we need to answer two questions: 1. How accurately can we predict the time at which a page is scraped for inclusion in a Wikipedia snapshot? 2. How quickly do malicious edits get reverted? 5.2 Predicting Checkpoint Times Wikipedia produces snapshots using a deterministic, well- documented protocol (with details that are easy to reverse- engineer through inspection). This makes it possible to predict snapshot times of individual articles with high accuracy. 5.2.1 How Wikipedia Snapshots Work English Wikipedia is archived on the 1st and 20th of each month. The snapshot is produced by n parallel workers; all Wikipedia articles are ordered sequentially by their ID and split into n chunks, and each worker independently and lin- early scrapes all articles in their chunk. Due to Wikipedia's size, the whole process takes nearly a day to complete. Different articles thus get scraped at sig- nificantly different wall-clock times. As a result an edit at time ti for one article may be excluded from the snapshot, while an edit at time t j > ti for a different article might be included. Figure 3 visualizes this "sawtooth" effect: there are many edits (in blue) that are included in the June 1st dump 9 Figure 4: We can obtain tight estimates on the time at which each article is snapshot. The green and orange lines show the interval [tlow i,prev] for a range of articles from the English Wikipedia. On average, our predictions (blue line) are 27 minutes from the furthest interval boundary. i,prev,thigh Figure 5: Distribution of Wikipedia checkpoint time predic- tion errors. Most predicted checkpoint times are within 30 minutes of our constructed ground truth. In general, we pre- dict edits too early, so it is important to later adjust for this bias, as we will discuss in Section 5.4. not-included edits of each article. That is, for articles i and j processed in the same job, we have that ti < t j if i < j. We can thus tighten our interval around each article's edit time by continually tracking the most recent edit made before the snapshot (for each article, this is the top-most blue edit made on an earlier article in that job), as well as the earliest edit among all subsequent articles in the job that was not included in the snapshot. We visualize this in Figure 4. For each article in the previous snapshot, we can thus obtain a time interval i,prev,thigh [tlow i,prev] that contains the true (but unknown) snapshot time ti,prev. By our construction outlined above, we guarantee that the lower and upper limits of these intervals monotoni- cally increase for all articles in a job (see Figure 4). To produce an estimate ˆti,prev for each article's previous snapshot time, we compute a best linear fit for the snapshot intervals of all articles processed by a single thread, as il- lustrated in Figure 4. This lets us predict the article's next snapshot time as ˆti ≈ t0 + (ˆti,prev − t0,prev). 5.2.4 Evaluating our Predictions We now evaluate our procedure for estimating article snapshot times. Ideally, we would directly compare our predicted snap- shot times ˆti with the true snapshot time of the i-th article. But we do not know the ground truth, except up to some interval [tlow ] which we can compute a posteriori as described i above. We thus proceed in two steps. ,thigh i First, we show that our linear fit to estimate the previous snapshot time ˆti,prev is accurate. For this we measure the max- imum absolute error between the predicted time ˆti,prev, and the unknown ground truth in the interval [tlow i,prev]. This provides an upper bound on the true estimation error. We find that the estimation error is bounded by 27 minutes on average. i,prev,thigh Second, we evaluate the accuracy of the extrapolation of our predictions from one snapshot to the next. That is, we evaluate how close our a priori predicted snapshot time ˆti := t0 + (ˆti,prev −t0,prev) is to the snapshot time that we could have estimated a posteriori using the linear fit described above. Figure 5 shows the distribution of the error estimates. Our predictions are correct to within roughly 30 minutes in most cases. We notice, however, that our extrapolation errors are biased towards negative. We find that this is because snapshots slightly speed up over time, so we typically overestimate the next snapshot time of an article. We will correct for this in Section 5.4, when we produce a conservative estimate of our attack's success in poisoning Wikipedia snapshots. 5.3 Estimating Revision Speed Now that we have measured how accurately we can predict when a future snapshot will happen, we turn our attention to measuring the size of the opportunity window to make a malicious edit before it is reverted. We remark that while the most accurate methodology would be to inject malicious edits and measure the distri- bution of reversion times, we believe this would be unethical. Instead, we take an entirely passive-albeit less accurate- approach as discussed in Section 5.6. To measure the speed of revisions, we construct a dataset of all edits made to Wikipedia from January 2021 to June 2022 (for a total of 18 months), and classify every edit as either an addition or as a reversion if they contain one of a fixed set of strings9 which are frequently used in reversion comments. We then conservatively assume that the edit being 9This set of strings is produced by manual analysis of a sample of com- ments from each Wikipedia; details are given in Appendix B.1. 10 4.04.14.24.34.4Article ID1e72.7002.7052.7102.7152.7202.725Edit Time (s)1e630002000100001000Prediction Error (s)050010001500200025003000Number of Pages ti of the i-th article, and ˆti is the predicted snapshot time. To balance the two failure modes above, and to account for the bias in our predictions (see Section 5.2.4), we introduce an "adjustment" variable a so that the adversary adds their malicious edits at time ˆti + a instead of exactly at time ˆti. Then the fraction of malicious Wikipedia edits that will make it into the snapshot, when they are made at time ˆti + a, can be lower-bounded as: A(a) = 1 |D| ∑ i∈D (1 − Edit applied too early (cid:123) (cid:125)(cid:124) (cid:122) prev(ˆti + a;thigh )) * (1 − 1[ˆti + a > tlow ] (cid:124) (cid:125) (cid:123)(cid:122) Edit applied too late i i ) , Figure 6: A CDF of revision times for English Wikipedia. Roughly 35% of revisions take more than 30 minutes. reverted was the immediately preceding edit, and so measure the reversion time as the elapsed interval between these two edits.10 Figure 6 plots this distribution. When we combine the roughly 30 minutes of error in predicting future snapshot times (c.f. Figure 5), with another roughly 30 minutes for the average uncertainty in our estimate of the true snapshot time (c.f. Figure 4), we can conservatively estimate that the attacker can time their edit so as to be within one hour, on average, of the true snapshot time. Approximately 32% of reversions take more than an to be reverted and so the attack is likely to succeed often. In the next section, we refine this estimate to determine more precisely how many articles we could have poisoned. 5.4 Putting It All Together Using our predictions of relative article snapshot times, our interval bound on the true snapshot time, and the distribution of reversion times, we can now (conservatively) determine what fraction of Wikipedia an adversary could have poisoned. There are two potential "failure cases" where a malicious edit may not make it into the checkpoint: • the malicious edit is applied too late: the article was already snapshot, or i where 1[ˆti +a > tlow ] is the indicator function that is one if the edit is applied after the checkpoint (here we conservatively use our lower bound tlow on the true checkpoint time), and prev(ˆti + a;thigh ) is the probability that the edit is reverted before the checkpoint (here we conservatively use the upper bound thigh on the true checkpoint time). i i i We compute this sum using our results from Section 5.2 and Section 5.3. By taking the maximum over a sweep of potential a values, we obtain maxa A(a) = 0.065. That is, according to our conservative analysis, we can poison 6.5% of Wikipedia documents absent any other defensive measures. In reality, of course, there are a number of factors beyond our analysis that would likely prevent us from reaching this fraction, such as rate limiting of edits or IP bans. We also "cheat" in choosing the optimal value of the adjustment value a, but we do not consider this a major limitation-it is likely that an adversary could use more historical data to produce better estimates ˆti as well as good estimates of a. However, our analysis is also pessimistic in that we assume we only try once to poison any given article. An adversary may attempt a more targeted attack, as we discuss in Appendix B.2, where they retry edits on targeted articles, to force editors to revert multiple times and increase the likelihood of the edit making it into the dump. Ultimately, our best-effort estimate of 6.5% of poisoning success is orders-of-magnitude higher than what is required in prior poisoning attacks [15]. We thus argue that a successful frontrunning poisoning attack on Wikipedia snapshots is practical, and that finding ways to mitigate such attacks is a worthwhile research direction. • the malicious edit is applied too early: the edit gets re- verted before the article is snapshot. 5.5 Multilingual Wikipedia This induces a tradeoff: the attacker wants to make edits early enough to ensure they do not miss the snapshot time, but late enough to maximize the chance of frontrunning editors. We therefore compute the optimal time to apply a malicious edit as follows. Recall that we use [tlow ] to represent the tightest interval around the true (but unknown) snapshot time ,thigh i i Wikipedia is also frequently used for non-English language modeling. For example, the multilingual version of BERT is trained entirely on the top 104 Wikipedia languages.11. Mul- tilingual datasets often rely more heavily on Wikipedia than English datasets. Thus, poisoning Wikipedia is even more harmful for non-English language modeling tasks. To measure 10This under-reports the edit time because if the vandalism was from an 11See https://github.com/google-research/bert/blob/master/ earlier edit, we would incorrectly use the later edit's time instead. multilingual.md#list-of-languages. 11 101100101102103104Time to Revert an Edit (min)0.00.20.40.60.81.0CDF of Reversion Time ficial sources, never interact with Wikipedia. While this leads to limitations in our analysis, we believe this is the correct way to run such a study to avoid harming the Wikipedia ed- itor community. We disclosed our attack analysis (and later defense recommendations) to researchers at Wikimedia who acknowledged the vulnerability before release of this paper. 6 Defenses In order to address the attacks that we identified, we pro- pose an integrity-based defense for split-view poisoning and a timing-based defense for frontrunning poisoning. We also discuss potential directions to address poisoning more gener- ally. We shared these defenses with curators, maintainers, and downloaders as part of our responsible disclosure and report on the status of their implementation of defenses. 6.1 Existing Trust Assumptions Per our threat model (Section 3), our proposed defenses as- sume that all maintainers, curators, and downloaders are trusted and behave honestly. This means that maintainers provide the same distributed dataset index{(urli, ci)}N i=1 to any client and that the index itself has not been poisoned (e.g., due to insider risk or compromise). Downloaders for distributed datasets honestly access all urli and compute any integrity checks that we add via our defenses. Curators pro- vide the same centralized dataset D to all clients, with curators controlling the time ti at which any element urli is snapshot. These assumptions mirror the existing trust that clients place in maintainers, curators, and downloaders and thus represent the quickest, short-term path to enacting defenses. We dis- cuss limitations of these trust assumptions and more robust solutions with fewer trust assumptions in Section 6.5. 6.2 Preventing Split-View Poisoning While the simplest defense to split-view poisonings attack would be to convert the distributed dataset {(urli, ci)}N i=1 into a centralized dataset (e.g., as in YFCC100M [71]), this is presently unrealistic due to the monetary, privacy, and legal challenges laid out in Section 3. Instead, maintainers-or another trusted third-party-can prevent split-view attacks by attaching a cryptographic hash hi = H(xi) of the raw data xi obtained from urli at time ti prior to any attack. A downloader would then check whether H(x(cid:48) i) = hi, where x(cid:48) i is the content of urli at time t(cid:48) i . The downloader discards any data where the client and maintainer receive distinct content. Here, H should be a cryptographic hash function such as SHA-256. Implementation & Responsible Disclosure. Enacting this defense requires a number of ecosystem changes. Currently, only PubFig and FaceScrub include cryptographic hashes as part of their distributed dataset (see Table 1). And because Figure 7: Multilingual Wikipedia may be more vulnerable to frontrunning poisoning attacks. We compute poisoning rates for 36 of the 40 languages languages contained in Wiki- 40B [25] by reusing our attack from Sections 5.2 to 5.4. this vulnerability, we investigate the Wiki-40B dataset [25] which is frequently used to train large multilingual models. We repeat our analysis from the previous section on 35 of the 39 non-English languages contained in Wiki-40B by identifying which strings often represent a reversion in these languages.12 Again our analysis here is loose: we identify only a subset of (often automated) reversions; however for the same reason as above we believe this represents a lower bound of the mean reversion time. We find that 22 (63%) of the non-English Wikipedias were easier to poison than the English Wikipedia, as shown in Fig- ure 7. Feasible poisoning rates range from 0.95% to as much as 25.3%, with a median value of 8.2%. In general, the in- crease in vulnerability comes from multilingual Wikipedias having more predictable checkpoints, for two reasons. First, because these Wikipedias are smaller, the entire checkpoint- ing procedure is shorter, reducing the amount of variance in checkpoint time between different pages. Second, because the Wikipedias change less between successive checkpoints, the speed of checkpointing is more stable, improving our pre- dictions. This may be why some of the larger Wikipedias, such as Spanish, Danish, and Italian, have comparable poison- ing rates to English Wikipedia. However, our interval-based measurement is also more conservative for languages with slower edits, as the intervals will be larger, giving very small lower bounds for some small Wikipedias, such as Slovak and Slovenian. We reiterate that such large poisoning rates are unlikely to ever happen, due to IP bans or rate limiting. The most important takeaways from our analysis here are that 1) mul- tilingual Wikipedias are vulnerable to poisoning, and often more vulnerable than English Wikipedia, and 2) multilingual datasets tend to rely more on Wikipedia than English datasets do, compounding this risk. 5.6 Ethical Considerations Our actions here are entirely passive. We make no edits to Wikipedia and, aside from downloading datasets from the of- 12We were unable to access the German, Chinese, and Czech checkpoints for the checkpoint times we studied, and Tagalog did not have enough data to reliably analyze. 12 daslsksrlvbgesetelnosvrofritcaltviukhihethruhrtridfahuptjafiarmskonlplLanguage id0.000.050.100.150.200.25Poisoning Fraction these two datasets do not provide an official downloader, the community has relied on a number of third-party down- loader scripts that for the most part do not actually verify these hashes.13 Fortunately, for larger datasets the img2dataset [5] tool has become the canonical downloader used in 75% of requests to our domains. As part of our responsible disclosure, we reached out to every maintainer (see Table 1), suggesting the addition of SHA-256 hashes as part of the dataset index. At the time of writing, CC3M, CC12M, LAION-2B-en, LAION- 2b-multi, LAION-1B-nolang, and LAION-400M now release their dataset with SHA-256 hashes of the image contents. We additionally implemented an option in img2dataset to verify SHA-256 image hashes upon download, thus preventing our attack for anyone using this tool, and pro- vide our own backup of hashes in a Google Cloud Bucket at gs://gresearch/distributed-dataset-hashes/ for the datasets where we have (near-)original data. Limitations. Integrity checks are viable if most benign con- tent remains static. If content is altered in any way (e.g., by re-encoding, cropping, re-sizing, or uploading a higher- resolution image) the original hashes will no longer match. This can significantly degrade the utility of a dataset: for exam- ple, we obtain the original raw data from the first Conceptual Captions 3M dataset downloaded in 2018 and compare this to our most recent download of these same images in 2023. Of the 3.3 million original images, 2.9 million images are still hosted online, but just 1.1 million of these images have hashes that match the original-the other 1.8 million images have changed since the initial dataset construction. This suggests that our defense, while providing perfect pro- tection against split-view poisoning attacks, has the potential to significantly degrade utility. In Appendix C, we perform a case-study analysis on the PubFig and FaceScrub datasets, showing that modified but useful content makes up a signif- icant fraction of the images with invalid hashes. Switching to a perceptual hash function (which aims for invariance to small image changes) would lead to higher utility, but would not meaningfully prevent our poisoning attacks because an attacker could upload poisoned images that were adversarially modified to fool the perceptual hash [26,29,68]. This suggests qualitatively new defense ideas will be necessary to defend against our attacks without a high utility cost. 6.3 Preventing Frontrunning Poisoning Our frontrunning poisoning attack relies on the fact that an ad- versary only needs sustained control of data for a few minutes to succeed. To defend against this attack, it suffices to increase 13We examine the 6 most popular downloader scripts for each dataset (gathered by searching for "[pubfig|facescrub] dataset download github"), and find that only one script per dataset implements hash ver- ification. The one for FaceScrubchecks hashes by default, while the one for PubFig requires users to run a separate verification script. the duration d = ti − ˆti that an attacker must retain control over urli for it to be included in the snapshot at time ti, where ˆti in- dicates the time an attacker first modifies the URL's contents. If a curator can detect malicious modifications within time ∆, then increasing d > ∆ effectively thwarts the attack. This can be achieved in one of two ways: (1) curators can randomize the snapshot order of the urli and extend the time required to snapshot the complete corpus; or (2) curators could freeze edits to the content of urli at time ti, wait for a period T > ∆ for edits to go through review, and then finally release the snapshot at time ti + T . Implementation & Responsible Disclosure. For our first approach, Wikipedia could randomize its snapshot order of ar- ticles instead of its current sequential method based on article IDs. This thwarts an adversary's ability to predict precisely when an article will be selected for snapshotting, requiring they sustain control of articles for the entirety of the snapshot time, tn −t0, to ensure success. For the English Wikipedia, the current average review time to detect vandalism ∆ is 2.5 hours (Figure 6). Increasing the snapshot time beyond ∆ would pro- tect 1 - ∆/(tn − t0) articles from random, malicious modifi- cation, or 89.5% of articles if snapshotting was uniformly randomized over 24 hours. This assumes an attacker is unable to use Sybil accounts to automatically reintroduce malicious edits after their first detection and reversion. If this assumption is invalid, this protection will be weaker in practice. For our second approach which is more comprehensive, Wikipedia could create an initial snapshot of an an article, hold it for a period T > ∆, and then back-apply ("cherry- pick") modifications or reversions from trusted moderators that occur within time T before finalizing the snapshot. (Sub- sequent edits must be accepted from trusted moderators so as to avoid selective deletion or reversion by attackers.) Even a reasonable grace period of one day could have a significant impact on the number of malicious edits that will be caught. For example, on the English Wikipedia (Figure 6), increasing from a 5 minute to a 1 day window would increase the rever- sion rate from 50% to 90%, reducing vandalism by a factor of 5. As part of our responsible disclosure, we notified Wikipedia of these attacks and our proposed defenses. Limitations. In practice, these defenses make it more difficult for an attacker to operationalize frontrunning, but cannot pre- vent it entirely as ∆ is not uniform across articles. For example, attackers might target less active articles, or languages with fewer moderators, in order to increase their frontrunning suc- cess rate. Furthermore, our defenses hinge on the existence of a trusted curator who can detect malicious edits-something that may be difficult if an attacker intentionally introduces imperceptible changes over time that impact only machine understanding, but appear valid to human review. Overcoming these risks-which exist for any "living" dataset-requires much more sophisticated solutions, which we explore next. 13 6.4 Preventing Poisoning in General Preventing poisoning attacks on more general web-scale datasets such as Common Crawl (a peta-byte sized dataset of web crawls) is more complex. No trusted "golden" snapshot exists here as we had for split-view poisoning. Nor is there a trusted curator who can detect malicious edits. Equally prob- lematic, updates to a web page have no realistic bound on the delta between versions which might act as a signal for attaching trust. Ultimately, any notion of which domains to trust is ad-hoc at best. Client could thus rely on consensus-based approaches (e.g., only trusting an image-caption pair if it appears on many different websites). An attacker would then have to poison a sufficiently larger number of similar websites to ensure success, which mirrors the same consensus challenges present in distributed systems like blockchains [45]. However, any solution in this space requires downstream knowledge of how URL content is consumed, vectorized, and deconflicted during training. We leave application-specific solutions to general poisoning to future work. 6.5 Transparency to Improve Trust Web-scale datasets today hinge on implicit trust. Clients trust maintainers to distribute identical and accurate auxiliary data ci, which may in fact be malicious due to a compromised maintainer. Clients trust curators to enact effective moderation to detect malicious edits to xi. Clients trust downloaders to accurately retrieve urli. And finally, clients trust websites to deliver the same xi for every urli, even though attackers have countless mechanisms to subvert xi-going beyond just purchasing expired domains or frontrunning snapshots. We believe improving the safety of web-scale datasets re- quires introducing transparency into the ecosystem. Data transparency around the set of {(urli, ci, hi)} distributed to clients-akin to certificate transparency [37]-can prevent transient failures or a compromised maintainer from distribut- ing different datasets to different clients and to assist in the detection and removal of inaccurate ci or expired urli over time. Curators could engage in a similar process to ensure all clients receive an identical corpus D. While many download- ers are already open source, binary transparency would bolster protection to prevent selective inclusion of malicious mod- ules [1]. Such transparency would prepare the ecosystem for a future where multiple maintainers and curators continuously update web-scale datasets, rather than the current reliance on centralized entities and static datasets. 7 Conclusion Our paper demonstrates that web-scale datasets are vulnera- ble to low-cost and extremely practical poisoning attacks that could be carried out today. This is true even when attackers can target only a fraction of curated datasets, where corrupting 0.01% of examples is sufficient to poison a model. Those who publish and maintain datasets should consider the defenses we introduced-including integrity checks and randomized or time-gated snapshots-or alternate, application-specific de- fenses. In light of our findings, we argue that machine learning researchers must reassess the trust assumptions they place in web-scale data and begin exploring solutions that do not as- sume a single root of trust. Our findings also expose a variety of future directions for attack research: threat models where attackers can edit only raw content but not auxiliary data such as labels; assessing the practical costs of proposed attacks; and assessing the efficacy of more permissive, but potentially vulnerable near-duplicate integrity checks. As such, our work is only a starting point for the community to develop a better understanding of the risks involved in generating models from web-scale data. Acknowledgements We are grateful to the dataset curators (in particular Beer Changpinyo, Saehoon Kim, Romain Beaumont, Ludwig Schmidt, and Chris Albon) for discussions around datasets and defenses. We are also grateful to Milad Nasr and Alex Kurakin for comments on early drafts of this paper. References [1] Mustafa Al-Bassam and Sarah Meiklejohn. Contour: A practical system for binary transparency. In Data Privacy Management, Cryptocurren- cies and Blockchain Technology, pages 94–110. Springer, 2018. [2] Sören Auer, Christian Bizer, Georgi Kobilarov, Jens Lehmann, Richard Cyganiak, and Zachary Ives. DBpedia: A nucleus for a web of open data. In The semantic web, pages 722–735. Springer, 2007. [3] Ankan Bansal, Carlos Castillo, Rajeev Ranjan, and Rama Chellappa. The do's and don'ts for CNN-based face verification. In Proceedings of the IEEE international conference on computer vision workshops, pages 2545–2554, 2017. [4] Ankan Bansal, Anirudh Nanduri, Carlos D Castillo, Rajeev Ranjan, and Rama Chellappa. UMDfaces: An annotated face dataset for train- ing deep networks. In 2017 IEEE international joint conference on biometrics (IJCB), pages 464–473. IEEE, 2017. [5] Romain Beaumont. img2dataset: Easily turn large sets of image urls to an image dataset. https://github.com/rom1504/img2dataset, 2021. [6] Battista Biggio, Blaine Nelson, and Pavel Laskov. Poisoning attacks against support vector machines. arXiv preprint arXiv:1206.6389, 2012. [7] Abeba Birhane, Vinay Uday Prabhu, and Emmanuel Kahembwe. Mul- timodal datasets: misogyny, pornography, and malignant stereotypes. arXiv preprint arXiv:2110.01963, 2021. [8] Tolga Bolukbasi, Kai-Wei Chang, James Y Zou, Venkatesh Saligrama, and Adam T Kalai. Man is to computer programmer as woman is to homemaker? debiasing word embeddings. Advances in neural information processing systems, 29, 2016. [9] Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. Large-scale simple question answering with memory networks. arXiv preprint arXiv:1506.02075, 2015. 14 [10] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020. [11] Minwoo Byeon, Beomhee Park, Haecheon Kim, Sungjun Lee, Woon- hyuk Baek, and Saehoon Kim. COYO-700M: Image-text pair dataset. https://github.com/kakaobrain/coyo-dataset, 2022. [12] Qingqing Cai and Alexander Yates. Large-scale semantic parsing via schema matching and lexicon extension. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 423–433, 2013. [13] Qiong Cao, Li Shen, Weidi Xie, Omkar M Parkhi, and Andrew Zis- serman. VGGFace2: A dataset for recognising faces across pose and age. In 2018 13th IEEE international conference on automatic face & gesture recognition (FG 2018), pages 67–74. IEEE, 2018. [14] Nicholas Carlini. Poisoning the unlabeled dataset of Semi-Supervised learning. In 30th USENIX Security Symposium (USENIX Security 21), pages 1577–1592, 2021. [15] Nicholas Carlini and Andreas Terzis. Poisoning and backdooring contrastive learning. arXiv preprint arXiv:2106.09667, 2021. [16] Soravit Changpinyo, Piyush Sharma, Nan Ding, and Radu Soricut. Con- ceptual 12M: Pushing web-scale image-text pre-training to recognize long-tail visual concepts. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3558–3568, 2021. [17] Honglie Chen, Weidi Xie, Andrea Vedaldi, and Andrew Zisserman. VGGsound: A large-scale audio-visual dataset. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Pro- cessing (ICASSP), pages 721–725. IEEE, 2020. [18] Xinyun Chen, Chang Liu, Bo Li, Kimberly Lu, and Dawn Song. Tar- geted backdoor attacks on deep learning systems using data poisoning. arXiv preprint arXiv:1712.05526, 2017. [19] Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. PaLM: Scaling language modeling with Pathways. arXiv preprint arXiv:2204.02311, 2022. [20] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009. [21] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. [22] Mohnish Dubey, Debayan Banerjee, Abdelrahman Abdelkawi, and Jens Lehmann. LC-QuAD 2.0: A large dataset for complex question answering over Wikidata and DBpedia. In International semantic web conference, pages 69–78. Springer, 2019. [23] Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, et al. The Pile: An 800GB dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027, 2020. [24] Tianyu Gu, Kang Liu, Brendan Dolan-Gavitt, and Siddharth Garg. Bad- nets: Evaluating backdooring attacks on deep neural networks. IEEE Access, 7:47230–47244, 2019. [25] Mandy Guo, Zihang Dai, Denny Vrandeˇci ́c, and Rami Al-Rfou. Wiki- 40B: Multilingual language model dataset. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 2440–2452, 2020. [26] Qingying Hao, Licheng Luo, Steve TK Jan, and Gang Wang. It's not what it looks like: Manipulating perceptual hashing based applications. In Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security, 2021. [27] Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. Train- arXiv preprint ing compute-optimal arXiv:2203.15556, 2022. large language models. [28] Gabriel Ilharco, Mitchell Wortsman, Ross Wightman, Cade Gor- don, Nicholas Carlini, Rohan Taori, Achal Dave, Vaishaal Shankar, Hongseok Namkoong, John Miller, Hannaneh Hajishirzi, Ali Farhadi, and Ludwig Schmidt. OpenCLIP, July 2021. [29] Shubham Jain, Ana-Maria Cret,u, and Yves-Alexandre de Montjoye. Adversarial detection avoidance attacks: Evaluating the robustness In 31st USENIX of perceptual hashing-based client-side scanning. Security Symposium (USENIX Security 22), pages 2317–2334, 2022. [30] Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Ben- jamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020. [31] Ira Kemelmacher-Shlizerman, Steven M Seitz, Daniel Miller, and Evan Brossard. The MegaFace benchmark: 1 million faces for recognition at scale. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4873–4882, 2016. [32] Evan Klinger and David Starkweather. pHash: The open source per- ceptual hash library. https://phash.org/, 2013. [33] Alex Krizhevsky. Learning multiple layers of features from tiny images, 2009. [34] Neeraj Kumar, Alexander C Berg, Peter N Belhumeur, and Shree K Nayar. Attribute and simile classifiers for face verification. In 2009 IEEE 12th international conference on computer vision, pages 365–372. IEEE, 2009. [35] Tobias Lauinger, Ahmet S Buyukkayhan, Abdelberi Chaabane, William Robertson, and Engin Kirda. From deletion to re-registration in zero seconds: Domain registrar behaviour during the drop. In Proceedings of the Internet Measurement Conference, 2018. [36] Tobias Lauinger, Abdelberi Chaabane, Ahmet Salih Buyukkayhan, Kaan Onarlioglu, and William Robertson. Game of registrars: An empirical analysis of post-expiration domain name takeovers. In 26th USENIX Security Symposium (USENIX Security 17), pages 865–880, Vancouver, BC, August 2017. USENIX Association. [37] Ben Laurie. Certificate transparency. Communications of the ACM, 57(10):40–46, 2014. [38] Rémi Lebret, David Grangier, and Michael Auli. Generating text from structured data with application to the biography domain. CoRR, abs/1603.07771, 2016. [39] Chaz Lever, Robert Walls, Yacin Nadji, David Dagon, Patrick McDaniel, and Manos Antonakakis. Domain-Z: 28 registrations later measuring the exploitation of residual trust in domains. In 2016 IEEE symposium on security and privacy (SP), pages 691–706. IEEE, 2016. [40] Alexandra Luccioni and Joseph Viviano. What's in the box? an analysis of undesirable content in the Common Crawl corpus. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguis- tics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 182–189, 2021. [41] Mary Ann Marcinkiewicz. Building a large annotated corpus of English: The Penn Treebank. Using Large Corpora, 273, 1994. [42] Pablo Mendes, Max Jakob, and Christian Bizer. DBpedia: A multilin- In Proceedings of the Eighth gual cross-domain knowledge base. International Conference on Language Resources and Evaluation (LREC'12), pages 1813–1817, Istanbul, Turkey, May 2012. European Language Resources Association (ELRA). 15 [43] Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models, 2016. [44] Tyler Moore and Richard Clayton. The ghosts of banking past: Em- pirical analysis of closed bank websites. In International Conference on Financial Cryptography and Data Security, pages 33–48. Springer, 2014. [45] Arvind Narayanan, Joseph Bonneau, Edward Felten, Andrew Miller, and Steven Goldfeder. Bitcoin and cryptocurrency technologies: a comprehensive introduction. Princeton University Press, 2016. [46] Hong-Wei Ng and Stefan Winkler. A data-driven approach to cleaning large face datasets. In 2014 IEEE international conference on image processing (ICIP), pages 343–347. IEEE, 2014. [47] Nick Nikiforakis, Luca Invernizzi, Alexandros Kapravelos, Steven Van Acker, Wouter Joosen, Christopher Kruegel, Frank Piessens, and Giovanni Vigna. You are what you include: large-scale evaluation of remote Javascript inclusions. In Proceedings of the 2012 ACM con- ference on Computer and communications security, pages 736–747, 2012. [48] OpenAI. Introducing Whisper. https://openai.com/blog/ whisper/, 2022. [49] Omkar M Parkhi, Andrea Vedaldi, and Andrew Zisserman. Deep face recognition. 2015. [50] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pages 8748–8763. PMLR, 2021. [51] Alec Radford, Jong Wook Kim, Tao Xu, Greg Brockman, Christine McLeavey, and Ilya Sutskever. Robust speech recognition via large- scale weak supervision. [52] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. [53] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. Explor- ing the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1–67, 2020. [54] Javier Rando, Daniel Paleka, David Lindner, Lennart Heim, and Florian Tramèr. Red-teaming the Stable Diffusion safety filter. arXiv preprint arXiv:2210.04610, 2022. [55] David Rolnick, Andreas Veit, Serge Belongie, and Nir Shavit. arXiv preprint Deep learning is robust to massive label noise. arXiv:1705.10694, 2017. [56] Johann Schlamp, Josef Gustafsson, Matthias Wählisch, Thomas C Schmidt, and Georg Carle. The abandoned side of the Internet: Hijack- ing Internet resources when domain names expire. In International Workshop on Traffic Monitoring and Analysis, pages 188–201. Springer, 2015. [57] Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gor- don, Ross Wightman, Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, et al. LAION-5B: An open large- scale dataset for training next generation image-text models. arXiv preprint arXiv:2210.08402, 2022. [58] Christoph Schuhmann, Richard Vencu, Romain Beaumont, Robert Kaczmarczyk, Clayton Mullis, Aarush Katta, Theo Coombes, Jenia Jitsev, and Aran Komatsuzaki. LAION-400M: Open dataset of clip- filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021. [59] Christoph Schumann and Romain Beaumont. LAION-Aesthetics. https://web.archive.org/web/20230119181400/https://laion.ai/blog/laion- aesthetics/, 2022. 16 [60] Roei Schuster, Congzheng Song, Eran Tromer, and Vitaly Shmatikov. You autocomplete me: Poisoning vulnerabilities in neural code com- pletion. In 30th USENIX Security Symposium (USENIX Security 21), pages 1559–1575, 2021. [61] Holger Schwenk, Guillaume Wenzek, Sergey Edunov, Edouard Grave, and Armand Joulin. CCMatrix: Mining billions of high-quality parallel sentences on the web. arXiv preprint arXiv:1911.04944, 2019. [62] Iulian Vlad Serban, Alberto García-Durán, Caglar Gulcehre, Sungjin Ahn, Sarath Chandar, Aaron Courville, and Yoshua Bengio. Generating factoid questions with recurrent neural networks: The 30M factoid question-answer corpus. arXiv preprint arXiv:1603.06807, 2016. [63] Pnina Shachaf and Noriko Hara. Beyond vandalism: Wikipedia trolls. Journal of Information Science, 36(3):357–370, 2010. [64] Ali Shafahi, W Ronny Huang, Mahyar Najibi, Octavian Suciu, Christoph Studer, Tudor Dumitras, and Tom Goldstein. Poison frogs! targeted clean-label poisoning attacks on neural networks. Advances in neural information processing systems, 31, 2018. [65] Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. Conceptual Captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2556–2565, 2018. [66] Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Coua- iron, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela. Flava: In Proceed- A foundational language and vision alignment model. ings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15638–15650, 2022. [67] Johnny So, Najmeh Miramirkhani, Michael Ferdman, and Nick Niki- forakis. Domains do change their spots: Quantifying potential abuse of residual trust. In Proceedings of the IEEE Symposium on Security and Privacy, pages 2130–2144, 2022. [68] Lukas Struppek, Dominik Hintersdorf, Daniel Neider, and Kristian Kersting. Learning to break deep perceptual hashing: The use case NeuralHash. In 2022 ACM Conference on Fairness, Accountability, and Transparency, pages 58–69, 2022. [69] Besiki Stvilia, Michael B Twidale, Linda C Smith, and Les Gasser. Information quality work organization in Wikipedia. Journal of the American society for information science and technology, 59(6):983– 1001, 2008. [70] Alon Talmor and Jonathan Berant. The web as a knowledge-base for answering complex questions. arXiv preprint arXiv:1803.06643, 2018. [71] Bart Thomee, David A Shamma, Gerald Friedland, Benjamin Elizalde, Karl Ni, Douglas Poland, Damian Borth, and Li-Jia Li. YFCC100M: The new data in multimedia research. Communications of the ACM, 59(2):64–73, 2016. [72] Antonio Torralba, Rob Fergus, and William T Freeman. 80 million tiny images: A large data set for nonparametric object and scene recogni- tion. IEEE transactions on pattern analysis and machine intelligence, 30(11):1958–1970, 2008. [73] Priyansh Trivedi, Gaurav Maheshwari, Mohnish Dubey, and Jens Lehmann. LC-QuAD: A corpus for complex question answering over knowledge graphs. In International Semantic Web Conference, pages 210–218. Springer, 2017. [74] Alexander Turner, Dimitris Tsipras, and Aleksander Madry. Clean-label backdoor attacks. 2018. [75] Patrick von Patil, Anton Platen, Suraj Lozhkov, Pedro Cuenca, Nathan Lambert, Kashif Rasul, Mishig Davaadorj, State-of-the-art diffusion Diffusers: and Thomas Wolf. https://github.com/huggingface/diffusers/ models. blob/8178c840f265d4bee91fe9cf9fdd6dfef091a720/src/ diffusers/pipelines/stable_diffusion/safety_checker.py, 2022. Accessed 7 Feb 2023. [76] Eric Wallace, Tony Z Zhao, Shi Feng, and Sameer Singh. Con- arXiv preprint cealed data poisoning attacks on NLP models. arXiv:2010.12563, 2020. [77] Angelina Wang, Alexander Liu, Ryan Zhang, Anat Kleiman, Leslie Kim, Dora Zhao, Iroha Shirai, Arvind Narayanan, and Olga Rus- sakovsky. REVISE: A tool for measuring and mitigating bias in visual datasets. International Journal of Computer Vision, pages 1–21, 2022. [78] Guillaume Wenzek, Marie-Anne Lachaux, Alexis Conneau, Vishrav Chaudhary, Francisco Guzmán, Armand Joulin, and Edouard Grave. CCNet: Extracting high quality monolingual datasets from web crawl data. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 4003–4012, Marseille, France, May 2020. European Language Resources Association. [79] Wikipedia contributors. Reliability of wikipedia - Wikipedia, the free encyclopedia, 2022. [Online; accessed 21-July-2022]. [80] Wikipedia contributors. Wikipedia:Go ahead, vandalize, 2022. [Online; accessed 5-December-2022]. [81] Yi Yang, Wen-tau Yih, and Christopher Meek. WikiQA: A challenge dataset for open-domain question answering. In Proceedings of the 2015 conference on empirical methods in natural language processing, pages 2013–2018, 2015. [82] Scott Wen-tau Yih, Ming-Wei Chang, Xiaodong He, and Jianfeng Gao. Semantic parsing via staged query graph generation: Question answer- ing with knowledge base. In Proceedings of the Joint Conference of the 53rd Annual Meeting of the ACL and the 7th International Joint Conference on Natural Language Processing of the AFNLP, 2015. [83] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning (still) requires rethinking generalization. Communications of the ACM, 64(3):107–115, 2021. A Additional Figures Figure 8: An unfiltered (without any precision or recall re- quirement) view of accesses to our server for URLs contained in Conceptual 12M. Compare to Figure 2 for the filtered view. B Further Discussion for Text Datasets In this section, we further discuss vulnerabilities present in text datasets, focusing first on targeted poisoning attacks on Wikipedia, and then on the Common Crawl dataset. B.1 Annotating Reversions In each language, we produce a list of words which are com- monly used to denote reversions. The specific words used are emergent from each language's Wikipedia contributor community, so there is no concrete list. However, in each language, their are automated reversion tools and manual re- versions which are tagged with the English word "reversion" or simply the abbreviation "rv". These form a starting point for our manual analysis: we identify words which roughly translate to "revert", "undo", or similar, which also appear in a sample of reversion comments we identify as automated reversions or manual reversions. We then sample comments with each of these newly identified words to verify that they capture new instances of reversions (that is, they are used to uniquely tag reversions in the language's Wikipedia), and do not produce too many false positives. Overall, we don't expect this list to be perfect for any given language, as no author of this paper is an active contributor to any language's Wikipedia. However, we do believe our analy- sis is sufficient to validate the two trends we notice: frontrun- ning attacks are still possible on non-English Wikipedias, and attacks may be more powerful on non-English Wikipedias. B.2 Cascading Effects of Frontrunning Our attack enables an adversary to poison any Wikipedia snapshot. An adversary can use frontrunning to harm down- stream datasets that depend directly on these snapshots, as well. Rather than arbitrarily modifying large fractions of 17 2022-08-112022-08-132022-08-15Date02000400060008000Index of URL accessed Wikipedia, these can be achieved with very targeted fron- trunning poisoning. Knowledge base extraction databases are heavily relied upon for analytics (e.g., asking queries like "which politicians were gang members?") and machine learning (e.g., for train- ing and evaluating question-answering models). One of the largest databases for it is DBPedia [2, 42]. Since this database is created using the monthly snapshots, they are, for all intents and purposes, a filtered view of Wikipedia. This enables ad- versaries to directly leverage our frontrunning attack to poison these databases as well in a more targeted manner. As an example in analytics, a user may issue a query such as "which politicians were gang members?" A targeted poisoning attack could force individuals to be falsely included in such a list, with a small edit via a frontrunning attack. More broadly, such attacks could be designed to harm specific individuals or reduce the reliability of certain aggregate statistics. Similarly, in question-answering tasks for machine learn- ing, some datasets, like LC-Quad [22, 73], store data as question-query pairs. The adversary can also target these dataset by compromising the query with frontrunning (as above). Because Wikipedia snapshots are infrequent, and downstream systems like these knowledge bases may up- date their endpoints even more infrequently [2], these at- tacks can remain effective for multiple months. Another com- mon approach is to store data directly as question-answer pairs [9, 12, 62, 70, 82]. This mitigates our attack above, as- suming the specific checkpoint used to originally generate the dataset was not compromised. However, this only prevents poisoning of a model trained on these downstream tasks-a model trained on a poisoned Wikipedia snapshot and fine tuned on the downstream task will still be vulnerable. Finally, we remark that the impacts of these attacks may be exacer- bated on multilingual data as we discussed in Section 5.1. B.3 Common Crawl Common Crawl is a petabyte-scale corpus of web crawl data that is repeatedly captured on a roughly monthly basis. Each archive is a complete re-crawl of the internet that records the full activity, including all requests of the crawler and the host responses-with both HTTP headers and content. As such, each archive contains a static snapshot of all crawled pages at the time of visit. This may include new page content not seen during a previous crawl, and may exclude content that has become stale since the previous crawl. For exam- ple, data crawled during September 24 through October 8, 2022 contains 3.15 billion web pages with 380 TiB of un- compressed content from 34 million registered domains-1.3 billion URLs were not visited in any of the prior crawls.14 The Common Crawl dataset is vulnerable to an attack which is similar to both our frontrunning and split-view poi- 14https://commoncrawl.org/2022/10/ sep-oct-2022-crawl-archive-now-available/ Figure 9: Top 5 domains by status count soning attacks. The adversary can purchase an expired domain which was previously contained in the Common Crawl, and it will be re-crawled with the adversary's choice of content, which will then appear in subsequent Common Crawl snap- shots. Notice that, differently from the snapshot-poisoning attack on Wikipedia, there is no content moderation here and so the adversary simply needs to continue to control the domain to poison all future Common Crawl snapshots. Buy- ing recently-expired domains that existed in previous Com- mon Crawl snapshots allows a stronger form of attack where the attack can inject entirely new links into the crawl. This can be accomplished by adding links or subdomains to poi- soned domains, and allowing the crawler to discover the new poisoned domains. Thus, an adversary may inject arbitrarily many pages into the Common Crawl dataset, not only from the originally expired subset. We do not implement this attack following our ethics statements outlined earlier. Since Common Crawl WARC files have been hosted by Amazon on a AWS Athena (serverless service)15, domain reconnaissance work to analyze URLs is inexpensive. Scan- ning through 10 years of Common Crawl data to analyze domains from popular TLDs and high number of Common Crawl entries cost us USD$ 0.84. While additional analysis might somewhat increase this cost, it remains an inexpensive way to search for vulnerable domains. Buying recently ex- pired domains, or domains that have a dangling DNS record with an active IP address is preferred, as domains that failed to return a 200-OK status in consecutive crawls seem to be moved to a lower priority. For example, among expired do- mains we purchased, just one domain accounts for more than 90% of all status codes among the purchased domains, while other domains we purchased as early as 12/20/2020 have seen relatively less scraping traffic across a 3 year period.16 Because Common Crawl is enormous and uncurated (to accurately reflect the content of the internet) poisoning all of Common Crawl is impractical due to size. Additionally, it is 15https://commoncrawl.org/2018/03/ index-to-warc-files-and-urls-in-columnar-format/ 16The domains used in this study responded with a 404 HTTP status to explicitly prevent scraping of content, potentially affecting analysis of domain re-emergence. That is, domains that previously returned a 404 now return a 200. 18 Figure 10: affraz.com status counts over time (a) (b) (c) (d) Figure 12: What happens in practice when the image no longer matches the original hash? We show 4 examples from the PubFig dataset. In Figure 12a, the image is replaced by a placeholder. In Figure 12b, a watermark partially covers the face, making that image slightly less useful for training. In Figure 12c, the image was resized and thus the original bound- ing box contained in the dataset index no longer matches the face. As opposed to the previous three images, Figure 12d is perfectly suitable for training: the watermark is outside the facial bounding box. impact on utility. As we saw in Section 6.2, implementing this defense for the Conceptual Captions 3M dataset would re- sult in discarding roughly 55% of the entire dataset-mainly because of small yet benign image changes such as re-sizing. Here, we perform a more in-depth analysis of the impact of cryptographic integrity protections on other datasets. C.1 Modified Images in the Wild: A Case Study on the PubFig Dataset PubFig [34] is a 2010 dataset that indexes close to 60,000 images of 200 different celebrities hosted across a variety of domains. PubFig is one of the oldest example of a distributed dataset. Thus, it is likely that many of the URLs in its index are no longer live (a phenomenon we refer to as "link rot"), and that many of the remaining URLs would point to images that have been slightly modified over time. Small image modifica- tions make integrity check defenses problematic because they discard many perfectly useful training images. In Figure 12, we show four different ways in which original images have Figure 11: Aggregate status counts for all purchased domains not always apparent how consumers of this data are process- ing it for downstream machine learning tasks. However, there exist many derivative datasets which are constructed by cu- rating a relevant subset of the Common Crawl. This includes the LAION-5B image dataset [57], the text dataset known as the Pile [23], the multilingual text dataset CC-100 [78], and the CCMatrix dataset [61], a translation dataset of pairs of translated sentences. Such curation actually amplifies the power of an attack: an attack which adds 1MB of text to the Common Crawl would be poisoning a 2.5 * 10−9 fraction of the Common Crawl, but if this text bypasses the curation done for the CC-100 dataset, it could instead poison a 1.2 * 10−5 fraction of the English corpus, or even a full 9.1% of the Oromo corpus. C Limitations of Integrity Check Defenses In Section 6.2, we outlined a natural defense against split- view poisoning that adds integrity checks to the dataset index. Specifically, upon collecting the dataset the maintainer com- putes a cryptographic hash of each image, and adds this hash to the index. Upon downloading a copy of the dataset, the client downloader then discards images for which the hash no longer matches. Unfortunately, this defense has a severe 19 Dataset # Images Success Download failure Invalid image pubfig facescrub 58795 106863 35.2% 48.5% 54.7% 10.2% 7.0% 44.5% Table 2: Link rot in old image datasets, downloaded using img2dataset [5]. In older datasets, the proportion of images that are no longer available online is high. Dataset pubfig facescrub Accuracy on Downloaded Modified modified, no crop modified, crop Accuracy on Accuracy on original, no crop Accuracy on original, crop 20668 51847 52.4% 29.4% 59.7% 93.3% 55.2% 91.6% 96.0% 97.7% 98.2% 99.1% Table 3: Quantifying changes on successfully downloaded images. Modified images are those that have a different hash than the original image. We measure the accuracy as the proportion of modified images that have a CLIP embedding close to any of the possible labels, approximating the question "Is there a recognizable face in the image?". The difference between cropped and uncropped images is largely due to the resized images making the crop not capture the face of the person, as in Figure 12c. been modified in PubFig. While we find examples of true- positives, where images were indeed modified significantly, there are also many cases of images that were subjected to minor changes such as the addition of a watermark. Many image datasets provide bounding boxes for a relevant part of the image. This is also the case for PubFig: the dataset index contains the coordinates of a bounding box for the person's face. If these bounding boxes are not re-computed by the client, any image resizing, such as in Figure 12c, can render the cropped image useless for training. C.2 Link Rot Statistics Integrity checks based on cryptographic hashing reduces the amount of data available in some datasets by a large amount. We download the PubFig and FaceScrub datasets and compute the prevalence of "link rot", where the URL listed in the dataset index no longer resolves or returns a non-valid image. In addition to dead links, we find that many successfully downloaded images have been modified. We show aggregate statistics in Table 3. In the PubFig dataset, over 50% of the surviving images have a hash mismatch. However, many of those images are modified in harmless ways. To show this, we take a pre-trained face embedding model and fine-tune a classifier for the PubFig classes using only images with a correct hash. We then evaluate this classifier on the down- loaded images with an incorrect hash, and find that we only achieve 46.8% accuracy. Thus, many of these images were modified in ways that obfuscate the identity of the person. For FaceScrub, we find that fewer images have been modified. About 70% of successfully downloaded images still match the original hash. Of the images that were modified, we can still classify 88.2% correctly, which indicates that most of these changes are benign as illustrated in Figure 12b or Figure 12d. For PubFig, we further investigate how frequently an image change corresponds to a benign resizing, which nevertheless renders the original bounding box obsolete (as in Figure 12c). For this, we compare the CLIP (ViT-B-32-quickgelu from [28]) embeddings of the full image to the names of the 200 public figures in the dataset, with a threshold cosine similarity of 0.21. We find that 59.4% of images with incorrect hashes are not close to any of the labels in CLIP space. Compar- ing with Table 3, this corresponds to around 4% of incorrect hashes being a result of modifications similar to Figure 12c. Perceptual hashing or similar methods might alleviate this problem, because images are often modified in trivial ways. For example, as mentioned in Table 1, COYO-700M images are distributed with pHash [32] which is robust to benign image changes. However, perceptual hashes do not have the same worst-case integrity guarantees as cryptographic hashes [29]. There have been high-profile controversies due to the mistaken use of perceptual hashing as a preimage resistant algorithm [68]. It is widely believed that preimage attacks on SHA-256 are impractical, while there is no known perceptual hash function which has similar security guarantees. D LAION Attack Details Both attack methods in Section 4.5 poison a CLIP model so as to bring the embeddings of some fixed images close to the embeddings of target textual labels. The key technical constraint in our experiment is that all attacks need to be done in parallel to minimize costs, as retraining CLIP is quite expensive. Object-misclassification objective. The ImageNet dataset [20] contains 1000 classes of images. The CLIP zero-shot classifier on ImageNet returns the class label whose text em- bedding has maximum cosine similarity to the image em- bedding in CLIP latent space, across all ImageNet classes. 20 The goal of our poisoning attack is for the CLIP zero-shot classifier to classify a particular image to a target incorrect label. We pick 10 classes as target labels for poisoning, such that captions containing the label appear at least 1000 times in the captions linked to cheap buyable domains; see Table 1. We do the following for each chosen label, e.g. apple: choose a set Sapple of 1000 caption-image pairs from buyable domains such that apple appears in the captions. We also enforce that the total cost of domains spanning Sclass for all chosen classes is at most $1,000 USD. Then, we pick a single unrelated image I-that wouldn't ordinarily be classified as apple-and locally replace 1000 images from Sapple with image I. Thus for each of the 10 classes, we poison 1000 images, or only 0.000025% of the data. NSFW objective. The goal of this attack is to make the NSFW filter that comes with the Stable Diffusion 1.4 model in the Hugging Face diffusers library [75] mislabel a given benign image as NSFW. The classifier is a cosine similarity threshold function in CLIP latent space, comparing an image embedding to a list of textual NSFW concepts [54]. We choose 10 benign images, and do the following for each image I: choose 1000 caption-image pairs from buyable domains such that the captions are labeled UNSAFE in the LAION 400M metadata, and locally replace each of the corre- sponding 1000 images with I. Again we choose images from domains that cost less than $1,000 USD in total. The experiment. For both attacks (and all chosen images) simultaneously, we train an OpenCLIP [28] model on the the LAION 400M dataset with the described modifications. We train a ViT-B-32 CLIP model for 32 epochs, at a batch size of 3072 on 16 A100 GPUs. The object-misclassification attack works for 60% of the targets: the chosen image gets classified as the target label by a zero-shot CLIP classifier. The NSFW attack works for 90% of targeted images. E Landing Page for Purchased Domains The following text was placed on the landing page for each of the domains we purchased. This domain is part of a research study. This domain name was purchased as part of a research project studying to what extent machine learning datasets change over time. This domain name was included in one of these datasets and hosted images that were part of this dataset, but the previous owner let the domain name expire. We bought this domain in August 2022 to measure the number of people who query from these expired domains. We bought a number of domains that were included in many different datasets. All of these domains will return a 404 error for any requests except for the home page. You should not need to take any additional steps to ensure your datasets are unaffected by our study: if we had not bought this domain the URL would have been NXDOMAIN and you would have not received any content. We may temporarily log metadata for requests sent to this server to measure the prevalence of scraping this domain. Any data we have logged will be deleted upon completion of our study. If you would prefer not to participate in this study, please contact us via the email address below and we will delete any data you may have contributed to our study. We would really appreciate it if you let us use your data; we think this will be a valuable study. If you have any questions about this study you can contact for [email protected] additional information. This used to be my domain. Can I have it back? If you are the original owner of this domain, we would be happy to return it to you at your request to the above email address. We will let this domain expire when we have finished our research study. Will this cause problems with my downloaded dataset? As we say above, if you are scraping this dataset, you should not need to take any steps to specifically avoid this domain (or any other we have purchased). We have tested that the 404 response we send will cause all standard image downloading tools to skip the image entirely. Will your study be published? We will publish our study upon its completion. We expect this to occur within the next several months. Please contact us if you would like a copy of this study. I have another question not mentioned. Please contact us at [email protected] for addi- tional information. 21
http://arxiv.org/abs/2302.10147v1
2023-02-20T18:26:52
2023-02-20T18:26:52
A DNN based Normalized Time-frequency Weighted Criterion for Robust Wideband DoA Estimation
Deep neural networks (DNNs) have greatly benefited direction of arrival (DoA) estimation methods for speech source localization in noisy environments. However, their localization accuracy is still far from satisfactory due to the vulnerability to nonspeech interference. To improve the robustness against interference, we propose a DNN based normalized time-frequency (T-F) weighted criterion which minimizes the distance between the candidate steering vectors and the filtered snapshots in the T-F domain. Our method requires no eigendecomposition and uses a simple normalization to prevent the optimization objective from being misled by noisy filtered snapshots. We also study different designs of T-F weights guided by a DNN. We find that duplicating the Hadamard product of speech ratio masks is highly effective and better than other techniques such as direct masking and taking the mean in the proposed approach. However, the best-performing design of T-F weights is criterion-dependent in general. Experiments show that the proposed method outperforms popular DNN based DoA estimation methods including widely used subspace methods in noisy and reverberant environments.
[ "Kuan-Lin Chen", "Ching-Hua Lee", "Bhaskar D. Rao", "Harinath Garudadri" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10147v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10147v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.AS", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.AS", "cs.LG", "cs.SD", "eess.SP" ]
3 2 0 2 b e F 0 2 ] S A . s s e e [ 1 v 7 4 1 0 1 . 2 0 3 2 : v i X r a A DNN BASED NORMALIZED TIME-FREQUENCY WEIGHTED CRITERION FOR ROBUST WIDEBAND DOA ESTIMATION Kuan-Lin Chen1, Ching-Hua Lee1, Bhaskar D. Rao1, and Harinath Garudadri2 1Department of Electrical and Computer Engineering, University of California, San Diego 2Qualcomm Institute, University of California, San Diego ABSTRACT Deep neural networks (DNNs) have greatly benefited direction of arrival (DoA) estimation methods for speech source localization in noisy environments. However, their localization accuracy is still far from satisfactory due to the vulnerability to nonspeech interfer- ence. To improve the robustness against interference, we propose a DNN based normalized time-frequency (T-F) weighted criterion which minimizes the distance between the candidate steering vectors and the filtered snapshots in the T-F domain. Our method requires no eigendecomposition and uses a simple normalization to prevent the optimization objective from being misled by noisy filtered snapshots. We also study different designs of T-F weights guided by a DNN. We find that duplicating the Hadamard product of speech ratio masks is highly effective and better than other techniques such as direct masking and taking the mean in the proposed approach. However, the best-performing design of T-F weights is criterion-dependent in general. Experiments show that the proposed method outperforms popular DNN based DoA estimation methods including widely used subspace methods in noisy and reverberant environments. Index Terms- Speech source localization, direction of arrival, spatial covariance matrix, deep neural networks, array processing 1. INTRODUCTION One of the goals in speech source localization for many applications such as hearing aids [1] and augmented hearing systems [2] is to estimate the direction of arrival (DoA) of speech signals using mi- crophone arrays. Building upon the foundation of narrowband DoA estimation, the most widely used wideband methods are based on a coherent combination of spatial spectra [3, 4] or spatial covari- ance matrices (SCMs) [5, 6] at different frequencies to improve the robustness of DoA estimates against noise. For example, the wide- band MUltiple SIgnal Classification (MUSIC) [7] and its variants [8, 9]. However, the performance of these conventional methods de- grades rapidly with a lower signal-to-noise ratio (SNR) or signal-to- interference ratio (SIR). Without reducing the noise and interference components from the snapshots (see Section 2), it is difficult to im- prove the estimation of SCMs of the speech for better performance. The advent of deep learning has opened up many opportunities for conventional approaches [10]. With DNNs, rich T-F patterns in speech and nonspeech are learned to remove noisy components from microphone measurements [11]. For example, in [12, 13, 14, 15], T- F weights predicted from DNNs are assigned to snapshots to better estimate speech SCMs, resulting in the so-called weighted SCMs (WSCMs). When a snapshot is more noisy, a smaller T-F weight This work was supported in part by NIH/NIDCD under Grant R01DC015436 and in part by NSF/IIS under Grant 1838897. 150 180 210 120 90 1 0.8 0.6 0.4 0.2 0 60 120 30 150 0 180 90 1 0.8 0.6 0.4 0.2 0 60 120 30 150 0 180 60 90 1 0.8 0.6 0.4 0.2 0 MUSIC Proposed 270 300 240 330 210 330 210 240 300 240 300 270 270 30 0 330 (a) SIR = −6 dB. (b) SIR = 0 dB. (c) SIR = 20 dB. Fig. 1. Normalized spatial pseudo-spectra. ♦ and × represent the speaker and interference, respectively. The proposed method (6) is more robust than the DNN based MUSIC (1) in a wide range of SIRs. is assigned to de-emphasize its contribution to a speech SCM es- timate. Because these WSCMs contain less interference and noise components, they are more accurate speech SCMs achieving supe- rior performance for conventional DoA estimation approaches such as wideband MUSIC and its variants. Many other applications such as acoustic beamforming, speech enhancement, and speech recogni- tion [16, 17, 18, 19, 20, 21, 22] have adopted such a framework to improve the estimation of SCMs for downstream tasks. While recent progress in the above works has demonstrated bet- ter estimation of speech SCMs using DNNs, we also find that most of them are still vulnerable to nonspeech interference, even though it is weaker than the target speech. For example, the two popu- lar subspace approaches including the WSCM based MUSIC [12] and principal vector method [13, 14, 15], where the latter has been widely used in many neural beamforming works. Because these methods use normalized eigenvectors of WSCMs to determine the spatial spectra at different frequencies, they lose the information en- coded by eigenvalues that are known to highly correlate with SNR and SIR. Furthermore, these methods rely on the assumption that the power of the target signal component is larger than the noise or in- terference, which is unlikely to be true for all frequency components even for an interference that is weaker than speech. These robustness issues in the WSCM based subspace methods make them less attrac- tive compared to other DNN based methods such as [23, 24]. On the other hand, a comparative study of the best-performing design of T-F weights for different algorithms still remains largely lacking. In this paper, we propose a normalized T-F weighted criterion and study different designs of the T-F weights guided by a DNN for robust wideband DoA estimation. Our criterion exploits all T- F weights and is more robust to noise and interference with less computational complexity as compared to existing WSCM based ap- proaches that rely on subspaces and eigendecomposition. The pro- posed method can be applied to arbitrary array geometries, and the DNN used to guide T-F weights is independent of the microphone array used. The training data in our methods are easy to obtain because only single-channel speech and nonspeech corpora are re- quired for training. Experiments show that the proposed normal- ized T-F weighted method outperforms the DNN based subspace ap- proaches including the popular MUSIC and principal vector method, and a DNN based non-subspace method using the steered response power (SRP), under different types and levels of interference in noisy and reverberant environments. 2. THE SIGNAL MODEL T P * * * y2(t, f ) Let the received signal at the M -element microphone array in the short-time Fourier transform (STFT) domain be y(t, f ) = ∈ CM for all (t, f ) with yM (t, f ) y1(t, f ) the frequency bin index f ∈ {1, 2, * * * , F } and time frame index (cid:2) (cid:3) I i=1 rm,si (f )si(t, f ) + t ∈ {1, 2, * * * , T } where ym(t, f ) = K k=1 rm,hk (f )hk(t, f ) + nm(t, f ) for m = 1, 2, * * * , M . We have used si(t, f ) ∈ C to denote the STFT of the time-domain target P speech signal si(τ ), hk(t, f ) ∈ C to denote the STFT of the time- domain nonspeech interference hk(τ ), and nm(t, f ) ∈ C to denote the STFT of the time-domain additive noise on the m-th micro- phone. I and K are nonnegative integers representing the number of speech sources and interference sources, respectively. rm,si (f ) ∈ C denotes the acoustic transfer function (ATF) between the location of the i-th target and microphone m. rm,hk (f ) ∈ C denotes the ATF between the location of the k-th interference and microphone m. The vector y(t, f ) is referred to as the snapshot in the literature. ⊙ denotes the Hadamard product. Let [M ] = {1, 2, * * * , M }. 3. OPTIMIZATION CRITERIA IN PRIOR WORK In this section, we review two popular wideband DoA estima- tion approaches and point out their issues. Define w(t, f ) = w1(t, f ) w2(t, f ) where wm(t, f ) is an es- timate of the ideal ratio mask (IRM) for the m-th microphone. Under (cid:2) the noise subspace assumption, the popular DNN based MUSIC [12] finds the DoA by solving the following optimization problem * * * wM (t, f ) (cid:3) T max θ Xf 1 vH(θ, f )N(f )NH(f )v(θ, f ) (1) where N(f ) represents the noise subspace formed by the eigenvec- tors corresponding to the M − 1 smallest eigenvalues of the WSCM Φ(f ) = w(t, f ) ⊙ y(t, f ) w(t, f ) ⊙ y(t, f ) Xt (cid:2) (cid:3) (cid:2) H . (cid:3) (2) The DNN-guided T-F weights w(t, f ) are introduced to filter the snapshot at every T-F bin. The weights wm(t, f ) are predicted by a DNN model followed by a post-processing technique before solv- ing the optimization problem for θ. We describe the prediction and learning of these T-F weights in Section 4.2. We have used v(θ, f ) ∈ CM to denote the array manifold (or steering vector) at DoA θ and frequency corresponding to the bin index f under the plane wave as- sumption [8]. Another popular approach [13, 14, 15] is the principal vector method relying on the signal subspace, which finds the DoA by solving the following optimization problem H H (θ, f )p(f )p v (f )v(θ, f ) (3) max θ Xf where p(f ) is the principal eigenvector of the WSCM Φ(f ). (1) and (3) are common subspace approaches. Remark 1 and 2 point out their weaknesses. In terms of computational complexity, computing the signal or noise subspace requires performing eigenvalue decom- position which is computationally expensive when M is large. Remark 1. The power of the speech signal is assumed to be larger than the power of undesired signals. When the interference and noise are stronger than the speech signal at some frequencies, such an as- sumption can create misleading spatial spectra at those frequencies. Remark 2. Because w(t, f ) suppresses the interference and noise, the principal eigenvalue of an SCM at a noisy frequency is reduced. Taking normalized eigenvectors of every WSCM from different fre- quencies and combining them uniformly in (1) or (3) weight every frequency equally, losing the ability to de-emphasize the interference and noise components according to the eigenvalues in the objective. 4. PROPOSED METHODS To overcome the limitations revealed by Remarks 1 and 2, one can use a non-subspace method. The most intuitive approach is a DNN based SRP method solving the following optimization problem H v (θ, f )Φ(f )v(θ, f ) (4) max θ Xf in which it uses the whole covariance matrix Φ(f ). Such an ap- proach is free from the power assumption and picking eigenvectors as a signal or noise subspace. However, it heavily relies on the es- timation quality of T-F weights w(t, f ). Since (4) is not robust to imperfect w(t, f ), it is still vulnerable to interference and noise. 4.1. A Robust DNN based Normalized T-F Weighted Criterion When the magnitude of the measurement y(t, f ) is large with the corresponding wm(t, f ) being not sufficiently small for some m, a normalization of the magnitude of y(t, f ) can prevent the objective function from relying on a single low SNR or SIR snapshot (outlier) to a certain degree. Based on such a rationale, we first normalize the filtered snapshot at every T-F bin and then directly match a candi- date steering vector to the normalized filtered snapshot, giving the following DNN based normalized T-F weighted criterion min θ,S Xf Xt (cid:13) (cid:13) (cid:13) (cid:13) w(t, f ) ⊙ y(t, f ) ky(t, f )k2 − s(t, f )v(θ, f ) 2 2 (5) (cid:13) (cid:13) (cid:13) (cid:13) where the optimization variable matrix S ∈ CT ×F is the STFT of the unknown target speech signal whose (t, f ) element is s(t, f ). Note that it is reasonable to assume ky(t, f )k2 > 0 but we have made a strong assumption that I = 1. Although θ and S are two different unknowns, we are only interested in θ, which can be found by peak detection without knowing S by Theorem 1. Theorem 1. Let (θ∗, S∗) be any local minimizer of (5) and ̃y(t, f ) = w(t, f ) ⊙ y(t, f ). Then, θ∗ is a local maximizer of H v (θ, f ) max θ Xf ̃y(t, f ) ̃yH (t, f ) ky(t, f )k2 2 Xt v(θ, f ). (6) Also, any local maximizer of (6) is a θ∗. Proof. θ∗ is equivalent to a local maximizer of the objective 2 where v†(θ, f ) is the k2 pseudoinverse of v(θ, f ). The spatial pseudo-spectrum at f is P tkv(θ, f )v†(θ, f ) w(t,f )⊙y(t,f ) ky(t,f )k2 P f given by tr (θ, f )A(θ, f ) t AH (cid:18) ̃y(t,f ) ̃y H ky(t,f )k (t,f ) 2 2 (cid:19) P v(θ, f )v†(θ, f ), giving (6) with the cyclic property of the trace. where A(θ, f ) = 4.2. Design of T-F Weights: DNN and Post-processing To make the DNN predicting the T-F weights w(t, f ) indepen- dent of the array geometry used in the wideband DoA estimation problem, we propose a unified framework consisting of a signal enhancement DNN model and a post-processing technique. Let Wm, Gm, and Ym be T -by-F matrices whose (t, f )-th ele- ment are wm(t, f ), Gm(t, f ), and ym(t, f ), respectively. For all m ∈ {1, 2, * * * , M }, the DNN g : R2×T ×F → RT ×F in- dividually predicts a weight matrix Gm by using the raw T-F representation Ym ∈ CT ×F obtained at the m-th microphone. Once all the weight matrices are computed, we feed them to a post- processing function qm : RM ×T ×F → RT ×F to generate the final T-F weights wm(t, f ) for the m-th microphone. Mathematically, Wm = qm (G1, G2, * * * , GM ) where Gm is computed indepen- R{Ym}, I{Ym} dently by g, i.e., Gm = g . We have used R and I to extract the real and imaginary parts of a matrix, respec- (cid:1) (cid:0) tively. We can utilize a different post-processing for qm as shown in Table 1. The above composition of the post-processing and the DNN establishes the design of T-F weights. During training, only single-channel speech and nonspeech data are required and the DNN model is trained to learn the ideal ratio mask (IRM) [11, 14]. Table 1. Examples of the post-processing function qm. Post-processing Expression for all m ∈ [M ] Identity (direct masking) Minimum Maximum Arithmetic mean Arithmetic median Hadamard product Geometric mean Binary thresholding (BT) qm = Gm [qm]t,f = mini∈[M ][Gi]t,f [qm]t,f = maxi∈[M ][Gi]t,f M qm = 1 i=1 Gi M [qm]t,f = median({[Gi]t,f }M qm = G1 ⊙ G2 ⊙ * * * ⊙ GM [qm]t,f = M M i=1[Gi]t,f ) qQ [qm]t,f = 1, if [Gm]t,f > β [qm]t,f = 0, otherwise P i=1) 5. EXPERIMENTS The experiments are conducted at 16 kHz with the target speech from the TIMIT dataset [25], interference from the PNL 100 nonspeech sounds [26] (machine, water, wind, etc), and white Gaussian noise. We randomly divide the 100 nonspeech sounds into 80 for training and 20 for testing. Code is available at https://github.com/kjason/DnnNormTimeFreq4DoA. The DNN: We use a U-Net [27] (0.67M parameters) to predict the IRM. The logistic sigmoid function is applied to the last layer of the U-Net. The loss function is an absolute error loss. The batch size is 16. All networks are trained for 200 epochs. SGD with Nesterov momentum is used. The momentum is set to 0.9. The weight decay is 0.0005. The learning rate is initially set to 0.1 and decreased by a factor of 5 after training 60, 120, and 160 epochs. The speech and interference are created by mixing P clean speech files and P interference files, respectively. P ∈ {1, 2, 3} is uniformly sampled in each example and each file is uniformly sampled from the training set. The SNR and SIR are uniformly sampled in the range of [0, 20] and [−10, 20], respectively. We use PyTorch [28] to train the DNN. Room acoustics and other settings: A 3D room with 9.0m (x- axis), 7.0m (y-axis), and 3.5m (z-axis) is used. A 9-element rectangular microphone array paralleled to the xy-plane with an 20 15 10 5 s e e r g e d n i E A M BT =0.10 BT =0.30 BT =0.50 BT =0.70 BT =0.90 BT =0.95 20 15 10 5 s e e r g e d n i E A M Constant Identity Min Max Mean Median Hadamard Geom BT =0.9 0 -10 -5 0 5 SIR (dB) 10 15 20 0 -10 -5 0 5 SIR (dB) 10 15 20 (a) BT with different β. (b) Overall comparison. Fig. 2. MAE in degrees vs. SIR (the same setting as Fig. 3). Differ- ent post-processing functions are evaluated for the DNN based MU- SIC (1). "Constant" means wm(t, f ) = 1, ∀(m, t, f ), leading to original sample SCMs (the signal enhancement model is not used). equal spacing 0.02m along the x-axis and y-axis is used. The cen- ter of the microphone array is placed at the center of the room (4.50m, 3.50m, 1.75m). The speed of sound is 343 m/s. For every simulation using specified RT60, SNR, SIR, T , I, and K, we run C = 200 trials to compute the mean absolute error (MAE) or accu- racy. The accuracy is given by the number of successes divided by C. A trial is rated as a success if |ˆθ − θgt| < θthreshold = 3◦. In each trial, we uniformly place target speakers and nonspeech interference sources at random in the room simulating a dining environment. The distance r between a source (target or interference) and the center of the microphone array on the xy-plane is uniformly sampled in the range of 1.0m to 3.0m. The height z of the source is uniformly sam- pled between 1.0m and 1.8m. The azimuthal angle θgt (the ground truth DoA) is uniformly sampled between 0◦ and 360◦. The angle between any two sources is at least θmin = 10◦ apart. For every trial, we uniformly sample I clean speech files and K interference files from the test sets. Pyroomacoustics [29] is used to generate the RIRs based on the image source model [30] and detect peaks. The resolution in the 1D grid search is 0.5◦. We assume only 1 speaker in the room, i.e., I = 1, but allow multiple interference sources, i.e., K ≥ 1. T = 50 if not explicitly specified. 1024-point FFT is used. Frequency bins corresponding to 50 Hz to 7 kHz are used because this is the frequency band of wideband speech coders [31]. Baseline methods: The baselines are the DNN based MUSIC (1), principal vector method (3), and SRP (4). We use the same DNN and their best-performing post-processing techniques for comparison. Post-processing methods: We consider every example in Table 1. 5.1. Different Post-processing Techniques for T-F Weights Fig. 2(a) shows that a larger β in the BT post-progressing gives a smaller MAE in MUSIC, indicating that the performance of DoA es- timation can be improved by preserving only very high-quality snap- shots. However, a higher β reduces the number of rank-one matrices in the WSCM, potentially resulting in a singular WSCM. β = 0.9 and β = 0.95 give similar performance and we chose β = 0.9 as the best parameter for BT. Fig. 2(b) shows the overall comparison of different post-processing techniques. The BT gives noticeable improvements over all the other post-processing techniques for MU- SIC. For the proposed normalized T-F weighted method, Fig. 3(a) shows that the Hadamard product is slightly better than the BT and gives the best performance. Fig. 3(b) and 3(c) show that the BT and the Hadamard product are the best-performing post-processing for the principal vector method and the SRP method, respectively. Notice that these results imply that the best post-processing of T-F weights depends on the DoA algorithm. We use the best-performing post-processing for each method in the following investigation. 20 15 10 5 s e e r g e d n i E A M 20 15 10 5 s e e r g e d n i E A M 20 15 10 5 s e e r g e d n i E A M Constant Identity Min Max Mean Median Hadamard Geom BT =0.9 0 -10 -5 0 5 SIR (dB) 10 15 20 0 -10 -5 0 5 SIR (dB) 10 15 20 0 -10 -5 0 5 SIR (dB) 10 15 20 (a) The proposed method (6). (b) The principal vector method (3). (c) The SRP method (4). Fig. 3. MAE in degrees vs. SIR (K = 1, RT60 = 0.3s, and SNR = 20 dB). Different post-processing functions are evaluated for different DNN based methods. Note that the ranking of these post-processing methods depends on the DoA estimation algorithm (also see Fig. 2). MUSIC Principal SRP Proposed ) % ( y c a r u c c A 100 90 80 70 60 50 40 20 25 30 35 40 Number of snapshots 45 ) % ( y c a r u c c A 100 90 80 70 60 50 40 50 55 60 20 25 30 35 40 Number of snapshots 45 ) % ( y c a r u c c A 100 90 80 70 60 50 40 50 55 60 20 25 30 35 40 Number of snapshots 45 50 55 60 (a) −6 dB SIR. (b) 0 dB SIR. (c) +6 dB SIR. Fig. 4. Accuracy vs. number of snapshots T (K = 1, RT60 = 0.3s, and SNR = 20 dB). The proposed method outperforms all baselines. Table 2. DoA estimation accuracy. K = 2. SNR = 20 dB. RT60 (seconds) SIR (dB) −6 0.3 0 +6 −6 0.9 0 +6 MUSIC (eq. 1) Principal (eq. 3) SRP (eq. 4) Proposed (eq. 6) 40% 52% 59% 30% 30% 33% 43% 77% 89% 51% 70% 79% 33% 59% 75% 28% 37% 40% 54% 81% 91% 59% 76% 88% 5.2. Robustness against a Wide Range of SIRs Fig. 1 compares MUSIC and the proposed normalized T-F weighted method under RT60 = 0.9s and SNR = 20 dB. It shows that MUSIC can be easily misled by the interference and our proposed method is able to accurately localize the speaker in a wide range of SIRs. Table 2 shows the accuracy for all the candidate methods under different RT60 and SIRs in an environment that has two interference sources. The proposed method strongly outperforms the other methods in all cases. When the environment is more reverberant, the performance degradation of the proposed method is less than the others. 5.4. A Closer Look at the Proposed Method Fig. 5 focuses on the evaluation of the proposed normalized T-F weighted method in different conditions including RT60 and SNRs. In general, the accuracy improves with a higher SNR or lower RT60. The accuracy can still approximately achieve more than 80% for RT60 = 0.9s when both the SIR and SNR are larger than 10 dB. 100 80 60 40 20 ) % ( y c a r u c c A RT60=0.3s, SNR= 0 dB RT60=0.9s, SNR= 0 dB RT60=0.3s, SNR=10 dB RT60=0.9s, SNR=10 dB RT60=0.3s, SNR=20 dB RT60=0.9s, SNR=20 dB 0 -10 -5 0 5 SIR (dB) 10 15 20 Fig. 5. Evaluation of the proposed method. K = 2. 5.3. Number of Snapshots 6. CONCLUSION In contrast to the proposed method, Fig. 4 shows that the accuracy of MUSIC is barely improved with more snapshots, which implies that the noise subspace is hardly improved with more snapshots. On the other hand, the principal vector method performs much better, implying that the signal subspace is a better choice here. The SRP method is better than MUSIC but underperforms the principal vector method. Lastly, Fig. 4 shows that the proposed method outperforms all baselines. These results hold for a wide range of numbers of snapshots T and different SIRs, demonstrating consistency. To improve the robustness of WSCM based DoA estimation, we pro- pose a normalized T-F weighted criterion that normalizes and filters snapshots to prevent the optimization objective from being misled by nonspeech components. Experimental results show that the pro- posed criterion outperforms MUSIC, the principal vector method, and SRP method in different noisy and reverberant environments that contain nonspeech interference sources. Given that T-F weights are crucial to performance, we also study different post-processing techniques and find that the best design is criterion-dependent. 7. REFERENCES [1] L. Pisha, J. Warchall, T. Zubatiy, S. Hamilton, C.-H. Lee, G. Chockalingam, P. P. Mercier, R. Gupta, B. D. Rao, and H. Garudadri, "A wearable, extensible, open-source platform for hearing healthcare research," IEEE Access, vol. 7, pp. 162083– 162101, 2019. [2] L. Pisha, S. Hamilton, D. Sengupta, C.-H. Lee, K. C. Vastare, T. Zubatiy, S. Luna, C. Yalcin, A. Grant, R. Gupta, et al., "A wearable platform for research in augmented hearing," in Asilomar Conference on Signals, Systems, and Computers. IEEE, 2018, pp. 223–227. [3] S. Mohan, M. L. Kramer, B. C. Wheeler, and D. L. Jones, "Localization of nonstationary sources using a coherence test," in Workshop on Statistical Signal Processing. IEEE, 2003, pp. 470–473. [4] S. Mohan, M. E. Lockwood, M. L. Kramer, and D. L. Jones, "Localization of multiple acoustic sources with small arrays using a coherence test," The Journal of the Acoustical Society of America, vol. 123, no. 4, pp. 2136–2147, 2008. [5] H. Wang and M. Kaveh, "Coherent signal-subspace processing for the detection and estimation of angles of arrival of multiple wide-band sources," IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 33, no. 4, pp. 823–831, 1985. [6] H. Hung and M. Kaveh, "Focussing matrices for coherent signal-subspace processing," IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 36, no. 8, pp. 1272–1281, 1988. [7] R. Schmidt, "Multiple emitter location and signal parameter estimation," IEEE transactions on antennas and propagation, vol. 34, no. 3, pp. 276–280, 1986. [8] H. L. Van Trees, Optimum array processing: Part IV of detec- tion, estimation, and modulation theory, John Wiley & Sons, 2004. [9] M. R. Azimi-Sadjadi, A. Pezeshki, and N. Roseveare, "Wide- band DOA estimation algorithms for multiple moving sources IEEE Transactions on using unattended acoustic sensors," Aerospace and Electronic Systems, vol. 44, no. 4, pp. 1585– 1599, 2008. [10] K.-L. Chen, C.-H. Lee, H. Garudadri, and B. D. Rao, "ResNEsts and DenseNEsts: Block-based DNN models with improved representation guarantees," in NeurIPS, 2021. [11] D. Wang and J. Chen, "Supervised speech separation based on deep learning: An overview," IEEE/ACM TASLP, vol. 26, no. 10, pp. 1702–1726, 2018. [12] C. Xu, X. Xiao, S. Sun, W. Rao, E. S. Chng, and H. Li, "Weighted spatial covariance matrix estimation for MUSIC in Interspeech, based TDOA estimation of speech source," 2017, pp. 1894–1898. [13] B. Yang, H. Liu, and C. Pang, "Multiple sound source count- ing and localization based on spatial principal eigenvector," in Interspeech, 2017, pp. 1924–1928. [14] Z.-Q. Wang, X. Zhang, and D. Wang, "Robust speaker local- ization guided by deep learning-based time-frequency mask- ing," IEEE/ACM TASLP, vol. 27, no. 1, pp. 178–188, 2018. [15] B. Yang, H. Liu, C. Pang, and X. Li, "Multiple sound source counting and localization based on TF-wise spatial spectrum clustering," IEEE/ACM TASLP, vol. 27, no. 8, pp. 1241–1255, 2019. [16] J. Heymann, L. Drude, and R. Haeb-Umbach, "Neural network based spectral mask estimation for acoustic beamforming," in ICASSP. IEEE, 2016, pp. 196–200. [17] H. Erdogan, J. R. Hershey, S. Watanabe, M. I. Mandel, and J. Le Roux, "Improved MVDR beamforming using single- channel mask prediction networks," in Interspeech, 2016, pp. 1981–1985. [18] X. Xiao, S. Zhao, D. L. Jones, E. S. Chng, and H. Li, "On time-frequency mask estimation for MVDR beamforming with application in robust speech recognition," in ICASSP. IEEE, 2017, pp. 3246–3250. [19] T. Ochiai, S. Watanabe, T. Hori, J. R. Hershey, and X. "Unified architecture for multichannel end-to-end Xiao, IEEE Jour- speech recognition with neural beamforming," nal of Selected Topics in Signal Processing, vol. 11, no. 8, pp. 1274–1288, 2017. [20] Z.-Q. Wang and D. Wang, "All-neural multi-channel speech enhancement," in Interspeech, 2018, pp. 3234–3238. [21] Z.-Q. Wang, X. Zhang, and D. Wang, "Robust TDOA esti- mation based on time-frequency masking and deep neural net- works," in Interspeech, 2018, pp. 322–326. [22] L. Pfeifenberger, M. Z ̈ohrer, and F. Pernkopf, "Eigenvector- based speech mask estimation for multi-channel speech en- hancement," IEEE/ACM TASLP, vol. 27, no. 12, pp. 2162– 2172, 2019. [23] P. Pertil ̈a and E. Cakir, "Robust direction estimation with con- volutional neural networks based steered response power," in ICASSP. IEEE, 2017, pp. 6125–6129. [24] Z. Wang, J. Li, and Y. Yan, "Target speaker localization based on the complex Watson mixture model and time-frequency se- lection neural network," Applied Sciences, vol. 8, no. 11, pp. 2326, 2018. [25] J. S. Garofolo, L. F. Lamel, W. M. Fisher, J. G. Fiscus, D. S. Pallett, N. L. Dahlgren, and V. Zue, "TIMIT acoustic-phonetic continuous speech corpus," Linguistic Data Consortium, 1993. [26] G. Hu and D. Wang, "A tandem algorithm for pitch estimation and voiced speech segregation," IEEE TASLP, vol. 18, no. 8, pp. 2067–2079, 2010. [27] O. Ronneberger, P. Fischer, and T. Brox, "U-Net: Convo- in lutional networks for biomedical image segmentation," International Conference on Medical Image Computing and Computer-Assisted Intervention. Springer, 2015, pp. 234–241. [28] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al., "PyTorch: An imperative style, high-performance deep learn- ing library," in NeurIPS, 2019. [29] R. Scheibler, E. Bezzam, and I. Dokmani ́c, "Pyroomacous- tics: A python package for audio room simulation and array processing algorithms," in ICASSP. IEEE, 2018, pp. 351–355. [30] J. B. Allen and D. A. Berkley, "Image method for efficiently simulating small-room acoustics," The Journal of the Acousti- cal Society of America, vol. 65, no. 4, pp. 943–950, 1979. [31] R. V. Cox, S. F. D. C. Neto, C. Lamblin, and M. H. Sherif, "ITU-T coders for wideband, superwideband, and fullband speech communication [series editorial]," IEEE Communica- tions Magazine, vol. 47, no. 10, pp. 106–109, 2009.
http://arxiv.org/abs/2302.10145v1
2023-02-20T18:23:47
2023-02-20T18:23:47
Improving Deep Policy Gradients with Value Function Search
Deep Policy Gradient (PG) algorithms employ value networks to drive the learning of parameterized policies and reduce the variance of the gradient estimates. However, value function approximation gets stuck in local optima and struggles to fit the actual return, limiting the variance reduction efficacy and leading policies to sub-optimal performance. This paper focuses on improving value approximation and analyzing the effects on Deep PG primitives such as value prediction, variance reduction, and correlation of gradient estimates with the true gradient. To this end, we introduce a Value Function Search that employs a population of perturbed value networks to search for a better approximation. Our framework does not require additional environment interactions, gradient computations, or ensembles, providing a computationally inexpensive approach to enhance the supervised learning task on which value networks train. Crucially, we show that improving Deep PG primitives results in improved sample efficiency and policies with higher returns using common continuous control benchmark domains.
[ "Enrico Marchesini", "Christopher Amato" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10145v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10145v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 5 4 1 0 1 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 IMPROVING DEEP POLICY GRADIENTS WITH VALUE FUNCTION SEARCH Enrico Marchesini, Christopher Amato Khoury College of Computer Sciences Northeastern University Boston, MA, USA {e.marchesini, c.amato}@northeastern.edu ABSTRACT Deep Policy Gradient (PG) algorithms employ value networks to drive the learn- ing of parameterized policies and reduce the variance of the gradient estimates. However, value function approximation gets stuck in local optima and struggles to fit the actual return, limiting the variance reduction efficacy and leading policies to sub-optimal performance. This paper focuses on improving value approxima- tion and analyzing the effects on Deep PG primitives such as value prediction, variance reduction, and correlation of gradient estimates with the true gradient. To this end, we introduce a Value Function Search that employs a population of perturbed value networks to search for a better approximation. Our framework does not require additional environment interactions, gradient computations, or ensembles, providing a computationally inexpensive approach to enhance the su- pervised learning task on which value networks train. Crucially, we show that improving Deep PG primitives results in improved sample efficiency and policies with higher returns using common continuous control benchmark domains. 1 INTRODUCTION Deep Policy Gradient (PG) methods achieved impressive results in numerous control tasks (Haarnoja et al., 2018). However, these methods deviate from the underlying theoretical framework to compute gradients tractably. Hence, the promising performance of Deep PG algorithms suggests a lack of rigorous analysis to motivate such results. Ilyas et al. (2020) investigated the phenomena arising in practical implementations by taking a closer look at key PG primitives (e.g., gradient estimates, value predictions). Interestingly, the learned value networks used for predictions (critics) poorly fit the actual return. As a result, the local optima where critics get stuck limits their efficacy in the gradient estimates, driving policies (actors) toward sub-optimal performance. Despite the lack of investigations to understand Deep PG's results, several approaches have been proposed to improve these methods. Ensemble learning (Lee et al., 2021; He et al., 2022), for example, combines multiple learning actors' (or critics') predictions to address overestimation and foster diversity. These methods generate different solutions that improve exploration and stabilize the training, leading to higher returns. However, the models used at training and inference time pose significant challenges that we discuss in Section 5. Nonetheless, popular Deep Reinforcement Learning (RL) algorithms (e.g., TD3 (Fujimoto et al., 2018)) use two value networks, leveraging the benefits of ensemble approaches while limiting their complexity. To address the issues of ensembles, gradient-free methods have been recently proposed (Khadka & Tumer, 2018; Marchesini & Farinelli, 2020; Sigaud, 2022). The idea is to complement Deep PG algorithms with a search mechanism that uses a population of perturbed policies to improve exploration and to find policy parameters with higher payoffs. In contrast to ensemble methods that employ multiple actors and critics, gradient- free population searches typically focus on the actors, disregarding the value network component of Deep PG. Section 5 discusses the limitations of policy search methods in detail. However, in a PG context, critics have a pivotal role in driving the policy learning process as poor value predictions lead to sub-optimal performance and higher variance in gradient estimates (Sutton & Barto, 2018). 1 Published as a conference paper at ICLR 2023 Such issues are further exacerbated in state-of-the-art Deep PG methods as they struggle to learn good value function estimation Ilyas et al. (2020). For this reason, we propose a novel gradient-free population-based approach for critics called Value Function Search (VFS), depicted in Figure 1. We aim to improve Deep PG algorithms by enhancing value networks to achieve (i) a better fit of the actual return, (ii) a higher correlation of the gradients es- timate with the (approximate) true gradient, and (iii) re- duced variance. In detail, given a Deep PG agent charac- terized by actor and critic networks, VFS periodically instantiates a population of perturbed critics using a two-scale perturbation noise designed to improve value predictions. Small-scale perturba- tions explore local value predictions that only slightly modify those of the original critic (similarly to gradient-based perturbations (Lehman et al., 2018; Martin H. & de Lope, 2009; Marchesini & Amato, 2022)). Big-scale perturbations search for parameters that allow escaping from local op- tima where value networks get stuck. In contrast to previous search methods, evaluating perturbed value networks require computing standard value error measures using samples from the agent's buffer. Hence, the Deep PG agent uses the parameters with the lowest error until the next periodical search. Crucially, VFS's critics-based design addresses the issues of prior methods as it does not require a simulator, hand-designed environment interactions, or weighted optimizations. Moreover, our population's goal is to find the weights that minimize the same objective of the Deep PG critic. Figure 1: Overview of VFS. We show the effectiveness of VFS on different Deep PG baselines: (i) Proximal Policy Optimization (PPO) (Schulman et al., 2017), (ii) Deep Deterministic Policy Gradient (DDPG) (Lillicrap et al., 2016), and (iii) TD3 on a range of continuous control benchmark tasks (Brockman et al., 2016; Todorov et al., 2012). We compare over such baselines, an ensembled Deep RL method, SUNRISE (Lee et al., 2021), and the policy search Supe-RL (Marchesini et al., 2021a). In addition, we analyze key Deep PG primitives (i.e., value prediction errors, gradient estimate, and variance) to motivate the performance improvement of VFS-based algorithms. Our evaluation confirms that VFS leads to better gradient estimates with a lower variance that significantly improve sample efficiency and lead to policies with higher returns. Our analysis highlights a fundamental issue with current state-of- the-art Deep PG methods, opening the door for future research. 2 BACKGROUND PG methods parameterize a policy πθ with a parameters vector θ (typically the weights of a Deep Neural Network (DNN) in a Deep PG context), and πθ(at|st) models the probability to take action at in a state st at step t in the environment. These approaches aim to learn θ following the gradient of an objective ηθ over such parameters (Sutton & Barto, 2018). Formally, the primitive gradient estimate on which modern Deep PG algorithms build has the following form (Sutton et al., 1999): ∇ηθ = E(st,at)∈τ ∼πθ [∇θlogπθ(at|st)Qπθ (st, at)] (1) where (st, at) ∈ τ ∼ πθ are states and actions that form the trajectories sampled from the distribu- tion induced by πθ, and Qπθ (st, at) is the expected return after taking at in st. However, Equation 1 suffers from high-variance expectation, and different baselines have been used to margin the issue. In particular, given a discount value γ ∈ [0, 1), the state-value function Vπθ (s) is an ideal baseline as it leaves the expectation unchanged while reducing variance (Williams, 1992): (cid:34) Vπθ (s) = Eπθ Gt := ∞ (cid:88) (cid:35) γtrt+1|st = s t (2) where Gt is the sum of future discounted rewards (return). Despite building on the theoretical framework of PG, Deep PG algorithms rely on several assumptions and approximations for design- ing feasible updates for the policy parameters. In more detail, these methods typically build on surrogate objective functions that are easier to optimize. A leading example is TRPO (Schulman et al., 2015), which ensures that a surrogate objective updates the policy locally by imposing a trust region. Formally, TRPO imposes a constraint on the Kullback–Leibler diverge (KL) on successive policies πθ, πθ(cid:48), resulting in the following optimization problem: (cid:20) πθ(at|st) πθ(cid:48)(at|st) s.t. DKL(πθ(*|s)||πθ(cid:48)(*|s)) ≤ δ (cid:21) Aπθ (st, at) max θ Eπθ (3) 2 Published as a conference paper at ICLR 2023 where δ is a hand-tuned divergence threshold, and A(s, a) = Q(s, a) − V (s) is the advantage func- tion. In practical implementations, Equation 3 is tractably optimized with additional tricks: (i) a second-order approximation of the objective, (ii) a mean KL of the current trajectory instead of the actual KL divergence. Given TRPO's computational demands, Schulman et al. (2017) further "re- laxes" the optimization landscape by replacing the constraint with the following clipped objective, providing a significantly faster (i.e., less demanding) yet better-performing alternative over TRPO:1 max θ Eπθ (cid:20) min (cid:18) πθ(at|st) πθ(cid:48)(at|st) A(st, at), clip (cid:18) πθ(at|st) πθ(cid:48)(at|st) (cid:19) (cid:19)(cid:21) , 1 − (cid:15), 1 + (cid:15) A(st, at) (4) Similarly, Lillicrap et al. (2016) uses the deterministic PG theorem (Silver et al., 2014) for learn- ing deterministic policies μθ(s). DDPG and further optimizations (e.g., TD3) are tightly related to standard Q-learning (Watkins & Dayan, 1992) and assume having a differentiable action-value function over actions. Deterministic PG algorithms learn the value parameters as in standard Double DQN. In contrast, policy parameters are learned under the maxθ Eπθ [Qφ(s, μθ(s))] optimization problem, where φ are the parameters of the critic. Moreover, TD3 addresses the overestimation of DDPG with additional tricks, e.g., learning two value functions, being pessimistic about the action value to use for the target computation, and delaying the policy updates. In summary, Deep PG algorithms build their success on learning value functions for driving the learning of the policy parameters θ. However, significant research efforts have been devoted to improving policies, while the attention to improving critics appears marginal. Hence, to our knowl- edge, VFS is the first gradient-free population-based approach that works on top of Deep PG to improve critics without facing the complexities of learning ensembles or policy searches. 2.1 GRADIENT-INFORMED PERTURBATIONS Policy search approaches generate a population of perturbed versions of the agent's policy πθ to ex- plore variations with higher returns (Khadka & Tumer, 2018; Marchesini & Farinelli, 2022; March- esini et al., 2021b; Colas et al., 2018; Sigaud, 2022). To this end, gradient-informed perturbations (or variations) have been employed for limiting detrimental effects on πθ, exploring small changes in the population's action sampling process (Lehman et al., 2018; Marchesini et al., 2022). In more detail, prior methods express the average divergence of a policy at state s over a perturbation ω as: d(πθ, ω) = (cid:107)πθ(*|s) − πθ+ω(*|s)(cid:107)2 and use the gradient of such divergence to approximate the sensitivity of θ over the policy decisions, which is used to normalize Gaussian-based perturbations. Formally, following Lehman et al. (2018): (5) ∇θa d(πθ, ω) ≈ ∇θd(πθ, 0) + Hθ(d(πθ, 0))ω where Hθ is the Hessian of divergence with respect to θ. Although simpler first-order approxi- mations achieve comparable results, gradient-based perturbations add significant overhead to the training process. Prior work introduced gradient-based variations because evaluating the popula- tion against detrimental changes is hard. As such, the quality of perturbed policies is assessed over many trajectories to ensure that they effectively achieve higher returns over arbitrary initializations (Marchesini et al., 2021a). In contrast, we focus on a critics-based search where high-scale per- turbations may help the learning process to escape from local optima, achieving better predictions. Hence, VFS relies on a two-scale perturbation approach to maintain similar value predictions to the original value function while exploring diverse parameters to escape from local optima. (6) 3 VALUE FUNCTION SEARCH We introduce a gradient-free population-based search with two-scale perturbations to enhance critics employed in Deep PG. Ultimately, we aim to show that value functions with better predictions improve Deep PG primitives, leading to better sample efficiency and policies with higher returns. Algorithm 1 shows the general flow of the proposed Value Function Search framework. During a standard training procedure of a Deep PG agent, VFS periodically generates a population P of per- turbed value networks, starting from the agent's current critic parametrized by φ. We first instantiate 1We do not consider the unconstrained penalty-based PPO due to the better performance of the clipped one. 3 Published as a conference paper at ICLR 2023 n copies of φ and two Gaussian noise distributions Gmin,max with σmin,max standard deviation for the two-scale variations (lines 3-4). Hence, we sample from the two distributions to apply each per- turbation to half of the population (lines 5-6). In contrast to single-scale or gradient-based perturba- tions of prior work (Khadka & Tumer, 2018; Marchesini et al., 2021a; Sigaud, 2022), the two scales approach for value networks has the following advantages:2 (i) Gmin maintains similar predictions to those of the unperturbed critic, similarly to gradient-based variations. Sampling from N (0, σmin) translates into small changes in the value prediction process to find a better set of parameters within a local search fashion. (ii) Gmax is a Gaussian with a greater standard deviation N (0, σmax) used to explore diverse value predictions to escape from local optima. (iii) Gaussian-based perturbations do not introduce significant overhead as gradient-based variations. After generating the population, VFS samples a batch b of trajectories from the agent's buffer B. There are different strategies for sampling the required experiences from the agent's memory based on the nature of the Deep PG al- gorithm. When using an on-policy agent (e.g., TRPO, PPO), we apply VFS after updating the policy and value networks. In this way, we reuse the same on-policy data to evaluate whether a perturbed set of weights has better value prediction (i.e., lower error). Off-policy agents (e.g., DDPG, TD3) could follow a similar strategy. Still, the reduced size of the mini-batches typically employed by off-policy updates would result in noisy evaluations. For this reason, we sample a larger batch of experiences to provide a more robust evaluation. In practice, to compute the prediction errors for each value network in the population (line 7), we use the typical objective used to train PG critics, the Mean Squared Error (MSE) (Sutton & Barto, 2018), whose general formulation is: mseφi(b) = 1 |b| (cid:88) (cid:104) s∈b Vπ(s) − Vπφi (cid:105)2 (s) (7) where Vπ(s) is the true value function. However, it is typically unfeasible to access the true Vπ(s) and, as in standard training procedures of Deep PG algorithms, we rely on noisy samples of Vπ(s) or bootstrapped approximations. In more detail, on-policy updates are particularly interesting, as Deep PG algorithms typically learn critics with Monte-Carlo methods without bootstrapping the target value. Hence, performing a supervised learning procedure on (st, Gt) pairs, where the return Gt is an unbiased, noisy sample of Vπ(s) that replaces the expectation of Equation 2 with an empirical average. We then refer to a perturbed critic as a local improvement of the original unperturbed one when it achieves a lower error on b. In our context, given a value network parametrized by φ, a batch of visited trajectories b, and a perturbation ω, we define the value network parametrized by φ + ω to be a local improvement of φ when mseφ+ω(b) ≤ mseφ(b). Moreover, in the limit where b samples all the trajectories, Gt ≡ Vπ(st), and mseφ+ω(b) ≤ mseφ(b) means that φ + ω is a better or equal fit of the actual value function with respect to the original φ. Crucially, Monte-Carlo value approximation converges to a local optimum even when using non-linear approximation (Sut- ton & Barto, 2018). Hence, on-policy VFS potentially maintains the same convergence guarantees of the baseline.3 To this end, it would be possible to anneal the perturbation scales to zero out the impact of VFS over the training phase. Hence, providing the diversity benefits of VFS early in the training while maintaining the convergence guarantee of the baseline algorithm within the limit. Algorithm 1 Value Function Search 1: Given: (i) a Deep PG agent with a value network parametrized by φ at training epoch e; (ii) a buffer B of visited trajectories; (iii) periodicity es for VFS and population size n; (iv) scale σmin,max for the two-scale Gaussian noise G. 2: if e % es = 0 then 3: 4: 5: P ← {φ0, . . . , φn} copies of φ Gmin,max ← N (0, σmin,max) φ1: |P | 2 :n ← φi + Gmax b ← Sample a batch of trajectories from B 6: 7: mseP ← Evaluate P over b as Equation 7 8: ← φi + Gmin φ |P | (mseP ) 2 φ ← min φi∈P 9: end if 2We support claims on our perturbation approach with additional experiments in Section 4. 3Due to bootstrapping, the same result generally does not apply to temporal difference targets. 4 Published as a conference paper at ICLR 2023 Nonetheless, as discussed in Ilyas et al. (2020), Deep PG algorithms deviate from the underlying theoretical framework. We performed additional experiments in Section 4 to show that maintaining VFS through the entire learning process results in better performance over zeroing out the pertur- bations. Moreover, in a worst-case scenario where the population search never improves the value prediction locally, VFS matches the same local optima of the original approach. However, following the insights of Fujimoto et al. (2018), practical Deep PG algorithms can not theoretically guarantee to reduce estimation errors or improve predictions outside the batch used for computing the update. VFS addresses most limitations of previous policy search approaches and minimizes the same ob- jective of the Deep PG critics, leading to the following crucial advantages: • VFS does not require additional environment interactions or hand-designed evaluations for selecting the best set of parameters in the population. • MSE is a widely adopted objective for learning value networks, providing an established evaluation strategy. Moreover, batch computations and parallelization make this process particularly efficient. Nonetheless, VFS is not explicitly designed for MSE, and extending it to different error measures is straightforward. • At the cost of adding overhead, the population evaluation may scale to an arbitrarily large number of samples to improve robustness. Finally, the parameters with the lowest error replace the current agent's critic until the next popu- lation search (line 8). Many Deep RL algorithms employ target networks parametrized by φtg to reduce overestimation. In this scenario, we also update the target weights toward the new ones by using standard Polyak averaging with an α ∈ (0, 1) weight transfer value: φtg = αφ + (1 − α)φtg. Limitations. Here we highlight the limitations of VFS: (i) batched computations and parallelization do not avoid a marginal overhead induced by the population search. (ii) In an off-policy setting, VFS requires tuning the batch size for the error computation to balance the trade-off between com- putational demands and the evaluation quality. (iii) There are no guarantees that small-scale pertur- bations produce a local variation to the original predictions. However, they have been previously shown effective in doing so (Martin H. & de Lope, 2009), and we confirm this result in Section 4. 4 EXPERIMENTS The proposed experiments aim at answering the following questions: (i) How do VFS components affect the training phase. In particular, we investigate when the perturbations are most effective during the training. (ii) How these components impact the performance and sample efficiency of VFS-based algorithms. (iii) How VFS influences Deep PG primitives, such as gradient estimates, their variance, and value predictions, to motivate performance improvement. We investigate the performance of VFS on the on-policy PPO, the off-policy DDPG, and TD3 al- gorithms. We compare over the baseline DDPG, PPO, TD3, SUNRISE (Lee et al., 2021) (a recent ensemble approach), and Supe-RL (Marchesini et al., 2021a) (a recent policy search approach). We conduct our experiments on five continuous control tasks based on MuJoCo (Brockman et al., 2016) (in their v4 version), which are widely used for comparing Deep PG, ensembles, and policy search approach (Schulman et al., 2017; Lillicrap et al., 2016; Lee et al., 2021; Fujimoto et al., 2018). Data are collected on nodes equipped with Xeon E5-2650 CPUs and 64GB of RAM, using the hyper- parameters of Appendix E. Considering the importance of having statistically significant results (Colas et al., 2019), we report the average performance of 25 runs per method, with shaded regions representing the standard error. Such a high number of experiments motivates slightly different results over the original implementations of DDPG, TD3, and PPO. 4.1 ANALYZING VFS COMPONENTS This analysis considers data collected in the Hopper task with VFS-PPO, as we achieved comparable results in the other setups. Given our intuitions, the two-scale perturbations have different effects on the critic. We expect σmin perturbation to result in networks with similar predictions. In contrast, σmax should generate networks with more diversified values to escape local optima. Appendix A shows the average difference between values predicted by the original critic of the baselines and their variations, confirming the role of the two perturbations. 5 Published as a conference paper at ICLR 2023 Table 1: Performance at 1M steps for Hopper, Walker, Swimmer, and 2M steps for HalfCheetah, and Ant in PPO, DDPG, TD3 experiments. We show the average return and standard deviation over the 25 runs and the percentage of steps required by VFS methods to reach the peak performance of the corresponding baseline. We report the best number for the ensemble SUNRISE at 2 × 105 steps (Lee et al., 2021), comparing over a SAC implementation of VFS and the policy search Supe-RL. Moreover, we expect σmax variations to be rarely bet- ter than σmin variations and the original critic, as dras- tic changes in the value predictions serve to escape from local optima. To confirm this, Figure 2 shows the aver- age cumulative number of times on which σmin (blue) or σmax (orange) critics' error is the lowest in the population compared to the original critic (y-axis), over the periodi- cal searches (x-axis). The linear growth of the σmin bars indicates that such perturbations produce better variations over σmax and the original critic through the training. In contrast, σmax perturbed networks have more impact in the early stages of the training (where the critics' predic- tions are seldom accurate) and occasionally achieve lower error in later stages of the training. 4.2 EMPIRICAL EVALUATION Figure 2: Cumulative number of times when a σmin,max variation improve the critic and the other perturbation. Here we discuss the performance and sample efficiency improvement of VFS-based algorithms. In particular, we show: (i) the average return at convergence and (ii) the percentage of samples required by VFS implementations to achieve the peak performance of the Deep PG baselines. Table 1 shows the results for PPO, VFS-PPO, DDPG, VFS-DDPG, TD3, and VFS-TD3 (the VFS-TD3 algorithm applies the search to both critics). In each table, we highlight the highest average return in bold and refer to Appendix B for an exhaustive overview of the training curves. Generally, VFS-based algorithms significantly improve average return and sample efficiency, confirming the benefits of enhancing critics during Deep PG training procedures. On average, VFS-PPO achieves a 26% return improvement and uses 33% fewer samples to reach the peak performance of PPO. VFS-DDPG has a 29% return improvement and 35% improvement in sample efficiency. Moreover, VFS-TD3 achieves an average 19% return improvement and 43% fewer samples to reach the peak performance of TD3. The latter results are significant as TD3 employs several tricks to address the poor performance of DDPG, and it is known to be a robust Deep PG baseline (Fujimoto et al., 2018). We also compare VFS over Supe-RL and the ensemble method SUNRISE by considering its best number reported at 2 × 105 steps. We use the same population parameters as in our VFS-TD3 im- plementation and Supe-RL, while the SAC parameters are the same as the original work (Haarnoja et al., 2018).4 Crucially, the VFS implementation shows comparable or superior average perfor- mance over such additional baselines (≈13% and ≈24% on average, respectively), confirming the merits of our framework. Finally, Appendix C contains: (i) a comparison of the computational 4We do not consider the Swimmer environment as prior work has not employed it. 6 Published as a conference paper at ICLR 2023 Figure 3: Left: influence of different population sizes in VFS-PPO. Increasing the size of the popula- tion leads to higher performance. Middle: comparison between PPO, VFS-PPO, and VFS-PPO with annealing perturbations. Linearly scaling our perturbations to zero leads to lower performance with respect to the proposed VFS-PPO with fixed permutations. Right: comparison of two VFS-PPO implementations that consider only small or big scale variance for the permutations. overhead for VFS, Supe-RL, and SUNRISE, discussing the negligible overhead of VFS over such baselines. (ii) A comparison with a baseline PPO that considers a higher number of gradient steps to match the computational demands of VFS. 4.2.1 ADDITIONAL EXPERIMENTS This section shows: (i) the effects of different population sizes; (ii) additional experiments to show that annealing variations have lower performance than the proposed VFS; (iii) how VFS behaves with considering only σmin or σmax perturbations. Similarly to Section 4.1, we show the results of VFS-PPO in the Hopper domain as they are also representative of the other setups. Figure 3 on the left shows the performance with increasing sizes for the population (i.e., 4, 8, 12, 20). Intuitively, increasing the size of the population leads to higher performance. However, our experiments show no significant advantage in considering a population of size greater than 10. In the center, Figure 3 compares PPO, VFS-PPO, and VFS-PPO with annealing on the perturba- tions. In more detail, we linearly scale the effects of the perturbations to zero towards step 9 × 105. As discussed in Section 3, after zeroing out VFS's perturbations, our approach is equivalent to the considered Deep PG baseline and, as such, has the same convergence guarantee in the limit. Nonetheless, in practice, VFS-PPO without permutation annealing achieves superior performance as the critic's population search keeps improving the Deep PG primitives. Figure 3 on the right show the performance of VFS with only small or big-scale perturbations. The latter permutations have more impact in the early stages of the training and allow for higher returns over both PPO and VFS-PPO. However, such benefits rapidly fade as the training progresses, resulting in performance similar to the PPO baseline. Conversely, small-scale variations achieve higher returns in the middle stages of the training. However, the lack of big variations to escape from local optima only leads to marginally superior performance over PPO. In contrast, the proposed two-scale VFS-PPO combines the benefits of both permutations. Such results are further motivated by an additional analysis of the gradient estimate in Appendix D. 4.3 DEEP PG PRIMITIVES ANALYSIS We analyze how VFS influences Deep PG primitives to motivate performance improvement. To this end, Figure 4 left and middle show the quality of the gradient estimates and their variance at the initial and middle stages of the training (respectively), and the mean square error of PPO's critic and VFS-PPO one. Regarding gradient estimates, PPO's common implementations estimate the gradient using an empirical mean of ≈ 203 samples (marked in the plots with a vertical line). Since the Deep PG agent successfully solves the task attaining a high reward, these sample-based estimates are sufficient to drive successful learning of the policy parameters. We measure the average pairwise cosine similarity and standard deviation between 30 gradient mea- surements taken from the PPO and VFS-PPO models after 105 and 5 × 105 steps in the Hopper task with an increasing number of state-action pairs. A cosine similarity ∈ (0, 1] represents a positive similarity (where 0 means that the vectors are orthogonal and 1 means that the vectors are paral- 7 Published as a conference paper at ICLR 2023 Figure 4: Left, Middle: analysis of gradient estimate and variance. We measure the average pairwise cosine similarity (y-axis) between 30 gradient estimates with a growing number of state-action pairs (x-axis). Each algorithm averages over 25 models collected during the training at 105 and 5 × 105 steps. A higher correlation with a lower variance of VFS-PPO translates into better performance of the baseline (Figure 1). Right: average MSE of such models over the training phase. lel). Hence, higher correlations indicate the gradient estimate is more similar to the actual gradient.5 Following the PG's underlying theoretical framework, we also know that a lower variance in the gradient estimate typically translates into better performance, which is why value networks are em- ployed in Deep PG. Crucially, VFS-based approaches show, on average, a ≈ 0.1 higher correlation and lower variance in the sampling regime used during the training. Following the intuitions of the cosine similarity measure, such an improvement is significant and motivates the performance benefits of VFS-based approaches. We also performed a two-sample t-test to test whether the mean gradient estimates of each baseline and its VFS implementation are statistically different. In more detail, we considered the mean and standard deviation of the estimates at the sample regimes used for the algorithms (i.e., 2048 for PPO) and our sample size of 30 trials. To summarize, we can reject the equality of the average gradient estimates between PPO and VFS-PPO in the 105 and 5 × 105 experiments with 95% and 99.9% confidence levels, respectively (t-stat 2.22 and 5.05). Moreover, Figure 4 on the right shows the average MSE of the 25 trained models for PPO and VFS- PPO computed every 105 step. To assess the quality of the critics' predictions, we compute the average MSE between PPO and VFS-PPO critics and the actual return of 103 complete trajectories in the environment (i.e., we compute the average MSE over 103 evaluation episodes every 105 step). To reduce the scale of the plot and obtain a better visualization, we normalize the resulting MSE by the number of considered steps. Our results show that critics enhanced with VFS consistently result in lower MSE, which leads to the previously discussed improvements in the gradient estimates.6 Hence, our analysis of key Deep PG primitives motivates the performance improvement of VFS- based algorithms. Appendix D shows the same analysis for VFS-DDPG and VFS-TD3, confirming our results. 5 RELATED WORK Ensemble methods have been used to improve policy performance in Deep RL (He et al., 2022; Lee et al., 2021; Yang et al., 2022; Wu & Li, 2020; Ren et al., 2021) combining the predictions of multiple learning models. However, the benefits of these approaches over population-based ones are unclear, as the numerous training actors (and/or critics) introduce a significant memory footprint and non-negligible overhead at training and inference time. In addition, weighting the importance of different predictions is not straightforward. Hence, ensemble algorithms in Deep RL are unsuitable for: (i) deployment on-device where memory is limited, (ii) real-time systems where inference time is crucial, or (iii) training high-dimensional DNNs where parallel computation may not be possible. In contrast, population-based approaches are straightforward to implement and have been used to combine the exploration benefits of gradient-free methods and gradient-based algorithms (Khadka & Tumer, 2018; Marchesini et al., 2021a; Sigaud, 2022) for policy parameters search. In more detail, ERL (Khadka & Tumer, 2018) employs a Deep PG agent and a concurrent population that includes the gradient-based agent to explore different policy permutations. The agent trains following its 5Although obtaining an empirical estimate of the true gradient can improve Deep PG performance further, this would require orders of magnitude more samples than the ones used in practical applications. Using such an amount of samples is unfeasible due to the computational demands (Ilyas et al., 2020). 6Using more trajectories for approximating the true value function would lead to a better approximation and higher MSE for both approaches in the early stages of the training where predictions are less accurate. 8 Published as a conference paper at ICLR 2023 gradient-based algorithm and shares a memory buffer with the population to learn from more diver- sified samples. However, ERL's dropout-like permutations bias the population's performance in the long run. Inspired by ERL, many policy search approaches emerged in the literature (Colas et al., 2018; Bodnar, 2020; Alo ̈ıs Pourchot, 2019; Marchesini et al., 2021a). In more detail, GEP-PG (Co- las et al., 2018) uses a curiosity-driven approach to enhance the experiences in the agent's memory buffer. Moreover, Proximal Distilled ERL (PDERL) (Bodnar, 2020) introduces novel gradient-based permutations to address destructive behaviors of biologically-inspired perturbations that could cause catastrophic forgetting (Lehman et al., 2018). Finally, Super-RL (Marchesini et al., 2021a) com- bines the intuitions of the previous population-based approaches, proposing a framework applicable to (possibly) any DRL algorithms that do not exhibit detrimental policy behaviors. However, due to their policy-oriented nature, these approaches assume a simulated environment to evaluate the perturbed policies, which increases the sample inefficiency of Deep RL algorithms. Such additional interactions are also task-specific as they must cover a broad spectrum of behaviors to ensure a robust evaluation. As discussed in Marchesini et al. (2021a), such behavior diversity is crucial to ensure that a perturbed policy improves the original actor, not only in particular environment initializations. In addition, current policy search methods introduce gradient-based perturbation (that has a non- negligible overhead, as further discussed in Section 2) to ensure that the population's predictions do not drastically diverge from the original policy. To summarize, population-based searches address the issues of ensemble methods by exploring different behaviors for the policies but disregarding value networks. In addition, recent work (Lyle et al., 2022) discussed the capacity loss of agents that have to adapt to new prediction problems when discovering new sources of payoffs. As such, Deep PG's critics have to adjust their predictions rapidly through the training. These issues further motivate the importance of applying VFS in the training routines. 6 DISCUSSION Ilyas et al. (2020) recently showed that critics employed in Deep PG algorithms for value predic- tions poorly fit the actual return, limiting their efficacy in reducing gradient estimate variance and driving policies toward sub-optimal performance (Fujimoto et al., 2018). Despite improving Deep PG performance, population-based search methods have recently superseded ensemble learning due to their computational benefits. However, these approaches typically need more practical investi- gations to understand their improvement. Moreover, previous population search frameworks have been devoted to exploring policy perturbations, disregarding critics and their crucial role in Deep PG. To our knowledge, VFS is the first gradient-free population search approach to enhance critics and improve performance and sample efficiency. Crucially, VFS can be applied to (possibly) any Deep PG algorithm and aims at finding a set of weights that minimize the same critic's objective. More- over, our detailed analysis of PG primitives in Section 4.3 motivates the performance improvement of the gradient-based agent due to VFS. In addition, our analysis suggests that the gap between the underlying theoretical framework of Deep PG and the actual tricks driving their performance may be less significant than previously discussed Ilyas et al. (2020). Hence, VFS opens up sev- eral exciting research directions, such as investigating the theoretical relationships between RL and practical Deep RL implementation. Empirically, VFS also paves the way for novel combinations with policy search methods to provide a unified framework of gradient-free population-based ap- proaches. Finally, given the wide application of value networks in Deep Multi-Agent RL Rashid et al. (2018); Marchesini & Farinelli (2021); Wang et al. (2021), it would be interesting to analyze the performance improvement of VFS in such partially-observable contexts. 6.1 CONCLUSION VFS introduces a two-scale perturbation operator voted to diversify a population of value networks to (i) explore local variations of current critics' predictions and (ii) allow to explore diversified value functions to escape from local optima. The practical results of such components have been investigated with additional experiments that also motivate the improvement in sample efficiency and performance of VFS-based algorithms in a range of standard continuous control benchmarks. Our findings suggest that improving fundamental Deep PG primitives translates into higher-performing policies and better sample efficiency. 9 Published as a conference paper at ICLR 2023 7 ACKNOWLEDGEMENTS This work was partially funded by the Army Research Office under award number W911NF20-1- 0265. REFERENCES Olivier Sigaud Alo ̈ıs Pourchot. CEM-RL: Combining evolutionary and gradient-based methods for policy search. In International Conference on Learning Representations (ICLR), 2019. Pietro Lio' Bodnar, Ben Day. Proximal distilled evolutionary reinforcement learning. In Conference on Artificial Intelligence (AAAI), 2020. Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. OpenAI, 2016. C ́edric Colas, Olivier Sigaud, and Pierre-Yves Oudeyer. GEP-PG: decoupling exploration and ex- ploitation in deep reinforcement learning algorithms. In International Conference on Machine Learning (ICML), 2018. C ́edric Colas, Olivier Sigaud, and Pierre-Yves Oudeyer. A hitchhiker's guide to statistical compar- isons of reinforcement learning algorithms. arXiv, 2019. Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. In International Conference on Machine Learning (ICML), 2018. Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International Confer- ence on Machine Learning (ICML), 2018. Qiang He, Huangyuan Su, Chen GONG, and Xinwen Hou. MEPG: A minimalist ensemble policy gradient framework for deep reinforcement learning. In Decision Awareness in Reinforcement Learning Workshop at ICML 2022, 2022. Andrew Ilyas, Logan Engstrom, Shibani Santurkar, Dimitris Tsipras, Firdaus Janoos, Larry Rudolph, and Aleksander Madry. A closer look at deep policy gradients. In International Con- ference on Learning Representations (ICLR), 2020. Shauharda Khadka and Kagan Tumer. Evolutionary reinforcement learning. In Advances in Neural Information Processing Systems (NeurIPS), 2018. Kimin Lee, Michael Laskin, Aravind Srinivas, and Pieter Abbeel. Sunrise: A simple unified frame- work for ensemble learning in deep reinforcement learning. In International Conference on Ma- chine Learning (ICML), 2021. Joel Lehman, Jay Chen, Jeff Clune, and Kenneth O. Stanley. Safe mutations for deep and recurrent neural networks through output gradients. In GECCO, 2018. Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. In Inter- national Conference on Learning Representations (ICLR), 2016. Clare Lyle, Mark Rowland, and Will Dabney. Understanding and preventing capacity loss in rein- forcement learning. In International Conference on Learning Representations (ICLR), 2022. Enrico Marchesini and Christopher Amato. Safety-informed mutations for evolutionary deep rein- forcement learning. In Proceedings of the Genetic and Evolutionary Computation Conference Companion, pp. 1966–1970, 2022. ISBN 9781450392686. Enrico Marchesini and Alessandro Farinelli. Genetic deep reinforcement learning for mapless nav- igation. In International Conference on Autonomous Agents and MultiAgent Systems (AAMAS), pp. 1919–1921, 2020. 10 Published as a conference paper at ICLR 2023 Enrico Marchesini and Alessandro Farinelli. Centralizing state-values in dueling networks for multi-robot reinforcement learning mapless navigation. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 4583–4588, 2021. doi: 10.1109/IROS51168.2021. 9636349. Enrico Marchesini and Alessandro Farinelli. Enhancing deep reinforcement learning approaches for multi-robot navigation via single-robot evolutionary policy search. In International Conference on Robotics and Automation (ICRA), pp. 5525–5531, 2022. doi: 10.1109/ICRA46639.2022. 9812341. Enrico Marchesini, Davide Corsi, and Alessandro Farinelli. Genetic soft updates for policy evolution in deep reinforcement learning. In International Conference on Learning Representations, 2021a. URL https://openreview.net/forum?id=TGFO0DbD_pk. Enrico Marchesini, Davide Corsi, and Alessandro Farinelli. Benchmarking safe deep reinforcement learning in aquatic navigation. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 5590–5595, 2021b. doi: 10.1109/IROS51168.2021.9635925. Enrico Marchesini, Davide Corsi, and Alessandro Farinelli. Exploring safer behaviors for deep reinforcement learning. Proceedings of the AAAI Conference on Artificial Intelligence, 36(7): 7701–7709, Jun. 2022. doi: 10.1609/aaai.v36i7.20737. URL https://ojs.aaai.org/ index.php/AAAI/article/view/20737. Jos`e Antonio Martin H. and Javier de Lope. Learning autonomous helicopter flight with evolutionary reinforcement learning. Computer Aided Systems Theory, 2009. Tabish Rashid, Mikayel Samvelyan, Christian Schr ̈oder de Witt, Gregory Farquhar, Jakob N. Foer- ster, and Shimon Whiteson. QMIX: monotonic value function factorisation for deep multi-agent reinforcement learning. In ICML, 2018. Jie Ren, Yewen Li, Zihan Ding, Wei Pan, and Hao Dong. Probabilistic mixture-of-experts for efficient deep reinforcement learning. arXiv, 2021. openreview.net/forum?id= LtgEkhLScK3. John Schulman, Sergey Levine, Philipp Moritz, Michael I. Jordan, and Pieter Abbeel. Trust region policy optimization. In International Conference on Machine Learning (ICML), 2015. John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv, 2017. Olivier Sigaud. Combining evolution and deep reinforcement learning for policy search: a survey. arXiv, 2022. David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. De- terministic policy gradient algorithms. In International Conference on International Conference on Machine Learning (ICML), 2014. Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. The MIT Press, 2018. Richard S. Sutton, David McAllester, Satinder Singh, and Yishay Mansour. Policy gradient meth- ods for reinforcement learning with function approximation. In Advances in Neural Information Processing Systems (NeurIPS), 1999. Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2012. Jianhao Wang, Zhizhou Ren, Terry Liu, Yang Yu, and Chongjie Zhang. QPLEX: duplex dueling multi-agent q-learning. In ICLR, 2021. Christopher Watkins and Peter Dayan. Q-learning. Machine Learning, 8:279–292, 1992. Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8:229–256, 1992. 11 Published as a conference paper at ICLR 2023 Junta Wu and Huiyun Li. Deep ensemble reinforcement learning with multiple deep deterministic policy gradient algorithm. Mathematical Problems in Engineering, 2020. Zhengyu Yang, Kan Ren, Xufang Luo, Weiqing Liu, Jiang Bian, Weinan Zhang, and Dong- sheng Li. Deep ensemble policy learning. arXiv, 2022. openreview.net/forum?id= -7NOEQcD-xH. 12 Published as a conference paper at ICLR 2023 A EFFECTS OF PERTURBATIONS ON VFS-PPO, VFS-DDPG, VFS-TD3 This section shows the efficacy of using σmin,max to maintain similar predictions and explore di- versified ones, respectively. In this direction, Figure 5 shows the average difference between values predicted by the original critic of the PPO algorithm and its two perturbations (σmin = 0.000005, σmax = 0.0005) over 100 episodes (i.e., each box is an episode). In particular, we report the data collected in the initial stage of the training (i.e., at step 105), where green boxes indicate slight variations while red ones represent the highest difference in our evaluation. In more detail, Figure 5 shows the effects of our perturbations at different stages of the training (i.e., at 100k, 500k, 1M steps) for VFS-PPO, VFS-DDPG, VFS-TD3. The values of the σmin perturbed network differ from the original critic by a small margin. In con- trast, the critic perturbed with σmax achieves significantly different values. Hence, the proposed two-scale perturbation approach leads to the desired outcome, and σmin-based variations confirm similar results over computationally demanding gradient-based perturbations. Interestingly, our ex- periments with different algorithms consider the same set of hyperparameters for the mutation oper- ators (see Appendix E), suggesting that VFS does not require extensive tuning to enhance existing Deep PG algorithms. B TRAINING CURVES Following the results in Section 4.2, Figure 6 shows the average return during the training without the five best and worst performing model.7 We report the results for each environment in the dif- ferent rows, while each column contains a different set of algorithms (i.e., VFS-PPO and PPO in the first column, VFS-DDPG and DDPG in the second column, VFS-TD3 and TD3 in the last one). As discussed in the main paper, VFS-based algorithms achieve, on average, higher returns. Inter- estingly, the worst-trained model for VFS-based approaches typically achieves higher returns than the best model of the baselines. In addition, VFS-based methods show a lower standard deviation, as reported in Table 1 of the main paper. Moreover, they significantly improve sample efficiency, reaching the peak performance of the baseline algorithms (i.e., PPO, DDPG, TD3) in a fraction of the steps. We performed additional experiments in the Humanoid task for 2 million steps. We aim to show that population-based approaches can scale to more challenging tasks maintaining the same population parameters. Figure 7 shows the performance of PPO and VFS-PPO. Interestingly, we note that VFS leads to significantly higher results in this complex domain, suggesting that the limitations of critics in Deep PG algorithms profoundly impact the overall policy return. C COMPUTATION OVERHEAD In this section, we discuss the computation overhead of ensemble methods and population-based ones. In particular, we compare the overhead of training and inference time introduced by Supe-RL, SUNRISE, and VFS, considering M = 10 models. The training overhead is comparable for all the approaches as standard Deep RL benchmarks do not require high-dimensional DNNs or com- putational demanding architectures that hinder parallelization. Nonetheless, in more complex tasks requiring high-dimensional DNNs, it could be computationally unfeasible to parallelize the training models of ensemble methods, especially during backpropagation. As reported by the Supe-RL's authors (Marchesini et al., 2021a), the additional environments interactions of policy search meth- ods lead to a maximum 6% overhead even considering parallelization with a population of size M . In contrast, VFS does not require multiple training models or additional environment interactions, leading to a negligible overhead for the training procedure (i.e., it simply requires additional forward DNNs propagations). Regarding inference time, policy and value network searches do not involve multiple predictions (except in the periodical search, which has negligible overhead due to batched computations), main- taining the same inference time of the original Deep PG baselines. In contrast, as detailed by SUN- 7We removed the best and worst seeds to avoid considering the ones that lead to particularly high or low performance. The same consideration holds for Figure 3, 8. 13 Published as a conference paper at ICLR 2023 Figure 5: Efficacy of the σmin,max scales in modifying PPO (on the first row), DDPG (on the second row), and TD3 (on the third row) critics to achieve similar predictions or more diversified ones to escape local optima, respectively. We observe the average difference (∆) between values predicted by the critics and the σmin,max variations over 100 episodes in the Hopper environment shown as different boxes. RISE's authors (Lee et al., 2021), their ensemble agents require up to 2M × additional inference time. To summarize, gradient-free search methods are generally less computationally demanding than ensemble ones. Hence, the superior return of VFS, sample efficiency, and computational benefits further confirm the merits of introducing a critics' search-based approach. 14 Published as a conference paper at ICLR 2023 Figure 6: Comparison of PPO, DDPG, TD3, and their VFS implementation in common continuous control benchmarks on each row. Each column (i.e., each couple of algorithms) shows the average return during the training over 25 runs. VFS-based implementations improve average return and sample efficiency of the baseline Deep PG algorithms. In addition, Figure 8 shows the performance of a PPO implementation that uses the size of the VFS population as additional gradient steps for its critic. Performing more gradient steps on the critic does not lead to significant advantages over the baseline PPO as the critic learns to fit better 15 Published as a conference paper at ICLR 2023 Figure 7: Comparison of PPO its VFS implementation in the Humanoid task. the sampled batch. In contrast, VFS is designed to explore local and global variations of the critic to avoid local optima where gradient-based learning typically gets stuck. For these reasons, this additional evaluation further confirms the merits of VFS. Figure 8: Comparison between VFS-PPO, PPO, and a PPO implementation that uses the size of the population as additional gradient steps for the critic. D ADDITIONAL DEEP PG PRIMITIVES ANALYSIS In Section 4.3, we analyzed the improvement of VFS-PPO in terms of gradient estimate, their vari- ance, and the mean squared error of the critic. Such an analysis serves to motivate the performance improvement of VFS-based algorithms. In this section, we report the same comparison for VFS- DDPG and VFS-TD3 to confirm the proposed framework's benefits further. Figure 9 reports the same results for our Deep PG primitives analysis for DDPG and TD3. We measure the average pairwise cosine similarity and its standard deviation between 30 gradient mea- surements taken from the algorithms at 105 and 5 × 105 steps in the Hopper task with an increasing number of state-action pairs. Crucially, VFS-DDPG and VFS-TD3 show a higher correlation and lower variance in the typical sampling regime used during the training (i.e., mini-batches of size 64 or 128), motivating their performance improvement over the baselines. Similarly to the PPO case, we performed a two-sample t-test to test whether the mean gradient estimates of each baseline and its VFS implementation are statistically different. To summarize, we can reject the equality of the average gradient estimates between DDPG and VFS-DDPG with a 95% confidence level in the 105 and 5 × 105 experiments (t-stat 2.08 and 2.01). In the case of TD3 and VFS-TD3, we can reject the same hypothesis with a confidence level of 90% (t-stat 1.73 and 1.66). The latter results are interesting as they suggest that TD3's implementation tricks to improve performance benefit policy learning as they lead to gradient estimates that are more similar to the VFS ones. Moreover, the right column shows the average MSE of our models computed every 105 step. Similarly to the PPO experiments, we use the actual return for 103 trajectories in the environment to approximate the true value function. These results follow the trend of Section 4.3, where VFS critics have lower MSE. Interestingly, we also note that TD3 typically achieves a higher gradient estimate correlation with lower variance over 16 Published as a conference paper at ICLR 2023 Figure 9: Analysis of gradient estimate and variance (left, middle) in the Hopper task for DDPG and VFS-DDPG in the first row, TD3 and VFS-TD3 in the second row. We measure the average pairwise cosine similarity (y-axis) between 30 gradient estimates which use a growing number of state-action pairs (x-axis). For each algorithm, we use the average over the 25 models collected during the training runs at 105 and 5 × 105 steps. The higher correlation with a lower variance of VFS-based implementations translates into better performance of the Deep PG algorithm. Average MSE of such models over the training phase (right). DDPG, which motivates using two value networks to achieve better performance. Our analysis of key Deep PG primitives for DDPG and TD3 confirms the main paper's results. In addition, we performed the same gradient estimate analysis on two VFS implementations that only employ small or big perturbation operators. Figure 10 shows the results of such an investiga- tion. In particular, VFS with only small perturbations slightly improves over the baseline PPO in the different stages of the training. However, it can not achieve the higher similarity of the VFS-PPO that considers both perturbations. In contrast, VFS with only big perturbations is characterized by a higher correlation in the initial stages of the training. At the same time, its efficacy significantly decreases later in the training phase. Moreover, considering only such big-scale variations typically leads to higher gradient estimate variance. Crucially, this additional gradient estimate analysis con- firms the results of Figure 3 and further motivates using our two-scale perturbations to tackle both local and global variations at the same time. E HYPERPARAMETERS We performed an initial grid search among common hyper-parameters from prior work (Schulman et al., 2017; Lillicrap et al., 2016; Fujimoto et al., 2018; Marchesini et al., 2021a). This evaluation led us to use similar DNN architectures for all the algorithms in the environments, i.e., 2-ReLU layer MLP with 64 hidden units each to model actors and critics for PPO and the same structure but with 256 hidden units for DDPG, TD3. Table 2 reports the other hyperparameters shared across all the experiments. Note that missing parameters are the same as the baseline algorithm (e.g., VFS-PPO values are the same as PPO, and TD3 shares the missing parameters with DDPG). Moreover, all the VFS-based implementations consider the same values for the critic's search. 17 Published as a conference paper at ICLR 2023 Figure 10: Analysis of gradient estimate and variance in the Hopper task for VFS-PPO that only considers small perturbations (top row) or big ones (bottom row). Table 2: Hyperparameters for our experiments Algorithm Parameter Value PPO DDPG TD3 VFS (cid:15) clip γ update epochs samples per update mini-batch size entropy coefficient lr γ buffer size mini-batch size actor lr critic lr τ 0.2 0.99 10 2048 64 0.001 0.0003/0.0001 0.99 1000000 128 0.0001 0.001/0.0003 0.005 actor noise clip delayed actor update 0.5 2 population size σmin σmax b es 10 0.000005 0.0005 2048 2048 steps 18
http://arxiv.org/abs/2302.10130v2
2023-10-03T13:22:42
2023-02-20T18:00:38
Infinite-Dimensional Diffusion Models
Diffusion models have had a profound impact on many application areas, including those where data are intrinsically infinite-dimensional, such as images or time series. The standard approach is first to discretize and then to apply diffusion models to the discretized data. While such approaches are practically appealing, the performance of the resulting algorithms typically deteriorates as discretization parameters are refined. In this paper, we instead directly formulate diffusion-based generative models in infinite dimensions and apply them to the generative modeling of functions. We prove that our formulations are well posed in the infinite-dimensional setting and provide dimension-independent distance bounds from the sample to the target measure. Using our theory, we also develop guidelines for the design of infinite-dimensional diffusion models. For image distributions, these guidelines are in line with the canonical choices currently made for diffusion models. For other distributions, however, we can improve upon these canonical choices, which we show both theoretically and empirically, by applying the algorithms to data distributions on manifolds and inspired by Bayesian inverse problems or simulation-based inference.
[ "Jakiw Pidstrigach", "Youssef Marzouk", "Sebastian Reich", "Sven Wang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10130v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10130v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG", "math.PR", "68T99, 60Hxx" ]
3 2 0 2 t c O 3 ] L M . t a t s [ 2 v 0 3 1 0 1 . 2 0 3 2 : v i X r a INFINITE-DIMENSIONAL DIFFUSION MODELS A PREPRINT Jakiw Pidstrigach Institut f ̈ur Mathematik Universit ̈at Potsdam Karl-Liebknecht-Str. 24/25 14476 Potsdam [email protected] Youssef Marzouk Statistics and Data Science Center Massachusetts Institute of Technology 77 Massachusetts Ave Cambridge, MA 02139 USA [email protected] Sebastian Reich Institut f ̈ur Mathematik Universit ̈at Potsdam Karl-Liebknecht-Str. 24/25 14476 Potsdam [email protected] Sven Wang Statistics and Data Science Center Massachusetts Institute of Technology 77 Massachusetts Ave Cambridge, MA 02139 USA [email protected] ABSTRACT Diffusion models have had a profound impact on many application areas, including those where data are intrinsically infinite-dimensional, such as images or time series. The standard approach is first to discretize and then to apply diffusion models to the discretized data. While such approaches are prac- tically appealing, the performance of the resulting algorithms typically deteriorates as discretization parameters are refined. In this paper, we instead directly formulate diffusion-based generative mod- els in infinite dimensions and apply them to the generative modeling of functions. We prove that our formulations are well posed in the infinite-dimensional setting and provide dimension-independent distance bounds from the sample to the target measure. Using our theory, we also develop guidelines for the design of infinite-dimensional diffusion models. For image distributions, these guidelines are in line with the canonical choices currently made for diffusion models. For other distributions, however, we can improve upon these canonical choices, which we show both theoretically and em- pirically, by applying the algorithms to data distributions on manifolds and inspired by Bayesian inverse problems or simulation-based inference. 1 Introduction Diffusion models (also score-based generative models or SGMs) [Sohl-Dickstein et al., 2015, Song et al., 2021] have recently shown great empirical success across a variety of domains. In many applications, ranging from image gen- eration [Nichol and Dhariwal, 2021, Dhariwal and Nichol, 2021], audio [Kong et al., 2021], and time series [Tashiro et al., 2021] to inverse problems [Kadkhodaie and Simoncelli, 2021, Batzolis et al., 2021], the signal to be modeled is actually a discretization of an infinite-dimensional object (i.e., a function of space and/or time). In such a setting, it is natural to apply the algorithm in high dimensions, corresponding to a fine discretization and a better approximation of the true quantity. Yet theoretical studies of current diffusion models suggest that performance guarantees deteriorate with increasing dimension [Chen et al., 2022, Bortoli, 2022]. When studying a discretization of an infinite-dimensional object, many application areas have found great success in directly studying the infinite-dimensional limit and only discretizing the problem in the last step, when implementing an algorithm on a computer. By accurately understanding the infinite-dimensional problem, one can gain valuable insights on how it should be discretized. Sometimes, this leads to algorithms that are dimension-independent in that their performance does not degrade when one chooses a finer discretization. Infinite-Dimensional Diffusion Models A PREPRINT Important areas where it is now standard to study the infinite-dimensional object directly are, for example, Bayesian inverse problems [Stuart, 2010] and nonparametric statistics [Tsybakov, 2009, Gin ́e and Nickl, 2015]. Accordingly, many Markov chain Monte Carlo algorithms used for sampling, such as the Metropolis-adjusted Langevin [Cotter et al., 2013] or Hamiltonian Monte Carlo [Beskos et al., 2011] algorithms, have successfully been generalized to the infinite-dimensional setting; in addition to being an empirical success, these efforts have also led to dimension- independent convergence guarantees (see Hairer et al. [2014], Bou-Rabee and Eberle [2021], Pidstrigach [2022a]). In the common implementation of the diffusion model algorithm, one first discretizes the data (for example images to pixels or wavelet coefficients, or functions to their evaluations on a grid) and then applies the algorithm in RD, as described in Song et al. [2021]. When doing so, one does not consider the implications of the discretization dimension D. In particular, if there is no well-defined limiting algorithm as D → ∞, one cannot expect the algorithm's performance to be stable as D becomes large. This instability can potentially be mitigated by defining the diffusion model algorithm directly in infinite dimensions, and studying its properties there. Once the algorithm is modified so that it exists in infinite dimensions, the discretized formulations that are implementable on a computer will possess dimension-independent properties. 1.1 Challenges in extending diffusion models to infinite dimensions Let us briefly recall the well-known finite-dimensional diffusion model setting. A forward SDE, typically an Ornstein– Uhlenbeck process, is used to diffuse the data μdata: dXt = − 1 2 Xtdt + dWt, X0 ∼ μdata . (1) The densities of its marginal distributions are denoted by pt. The following so-called "reverse SDE" will traverse the marginals of Xt backward: dYt = 1 2 Ytdt + ∇ log pT −t(Yt)dt + dWt, Y0 ∼ pT , (2) where Wt is a different Wiener process/Brownian motion than in (1). In particular, YT ∼ pT −T = μdata. The goal of the diffusion model algorithm is to approximate paths of Yt and use the realizations at time T as approximate samples from μdata. Since the marginals of the forward SDE Xt converge to N (0, I) at an exponential speed, one can approximate the unknown term pT by N (0, I). Furthermore, ∇ log pt can be approximated using score-matching techniques [Vincent, 2011]. There are three main challenges in generalizing this construction to infinite dimensions, which we highlight next. t − W i In finite dimensions, the process (Wt : t ≥ 0) in (1) is standard Brownian motion. Choice of the noising process t − W j Therefore, the noise increments for different coordinates i and j, e.g., W i s , are independent and identically distributed. In infinite dimensions, one can associate a white-noise process W U to each Hilbert space t U , with the property that the coordinates of W U in an orthonormal basis of U are independent and identically dis- t tributed. Therefore, one has to determine which white-noise process (i.e., which Hilbert space) to choose in the infinite-dimensional limit. The common case of discretizing the infinite-dimensional target object to RD, e.g., discretizing a function onto a grid or real-life scenery into image pixels, and then choosing Wt as a standard Brownian motion on RD, means that at each grid point we will add independent noise values. In particular, as the grid grows finer, even for arbitrarily close values a ≈ b, the evaluations Xt(a) and Xt(b) will be perturbed with independent noise. The limiting Wiener process will be W L2 , i.e., the process associated to U = L2, also called space-time white noise. We have depicted space-time white t noise in Figure 1a. s and W j In infinite dimensions, however, the choice of the noise process is a subtle issue, as it has a crucial impact on the space on which the diffusion process is supported. For instance, the above 'canonical' choice of space-time white noise will lead to Xt and Wt having such irregular samples that they are not supported in L2 anymore. While we will also study such processes due to their widespread use in practice, we will see that other choices can be beneficial from a theoretical as well as a practical standpoint. The score function ∇ log pt in (2) is typically defined via the Lebesgue density pt of the law of Xt. Score function Yet in infinite-dimensional vector spaces, the Lebesgue measure no longer exists; hence one can no longer specify the score functions in the same manner. Therefore, a key question is: How does one define and make sense of ∇ log pt without relying on the notion of Lebesgue density, and still define an algorithm which provably samples from the correct measure? 2 Infinite-Dimensional Diffusion Models A PREPRINT Denoising score matching objective some chosen neural network class, and identified by minimizing the denoising score-matching objective, The score ∇ log pt is typically approximated by a neural network ̃s(t, x) in Loss( ̃s) = (cid:90) T 0 E[∥∇ log pt(Xt) − ̃s(t, Xt)∥2 K]dt, over this class. Similarly to the choice of the noising process, it is not clear which Hilbert space K and norm ∥ * ∥K should be used for the analogous objective in infinite dimensions. 1.2 Contributions Our paper, for the first time, formulates the diffusion model algorithm directly on infinite-dimensional spaces, and proves that this formulation is well-posed and satisfies crucial theoretical guarantees. To formulate the reverse SDE in infinite dimensions, we must find a way to handle the ∇ log pt term, as discussed in the last section. We do this by replacing the score with a conditional expectation, in Definition 1. This definition then carries over to the infinite-dimensional case. Furthermore, we are able to show under which circumstances one can generalize the denoising score matching objective to identify the neural network ̃s(t, x) in Lemma 3. To justify approximating the reverse SDE to obtain samples from μdata, we proceed in multiple steps. First, in Theorem 1, we show that the time-reversal of the forward SDE also satisfies an appropriate reverse SDE. The terminal condition of the reverse SDE will have distribution μdata. To simulate this reverse SDE in practice, however, both its initial conditions and drift must be approximated. In Lemma 3 we establish under which conditions we can use the common denoising score matching objective to approximate the drift of the reverse SDE in infinite dimensions. Second, we prove that the solution to such an SDE exists for general initial conditions-and in particular, for our approximate initial conditions. Moreover, we prove that the solution is unique; otherwise we could be approximating a different reverse SDE solution that does not sample μdata at the terminal time T . We provide rigorous uniqueness results under two distinct scenarios: first, in Theorem 2, for μdata which satisfies a manifold hypothesis; and second, in Theorem 3, under the assumption that μdata has density with respect to a Gaussian measure. The first case is relevant for the typical use cases of diffusion models, as image data are usually supported on lower-dimensional manifolds or other substructures. The second case is relevant when, for example, applying diffusion models to Bayesian inverse problems or related problems of simulation-based inference. Finally, building upon the preceding results, we establish dimension-independent convergence rates in Theorem 4. Our bound is quantitative and shows how the distance relies on different choices made in the diffusion model algorithm. The theory described above guides choices for the noise process W U t and the loss norm ∥ * ∥K. Both will depend on the properties of μdata. In Section 7 we discuss the implications of the theory for implementing diffusion models in infinite dimensions. In Section 7.1, we work out guidelines for choosing W U t and K for a given μdata. In Section 7.2, we study the case of image distributions and see that our theorems indeed apply for the typical properties of μdata one expects in that setting; hence, we have proven that the standard diffusion model algorithm is well-defined for image and K = L2 actually follow the guidelines distributions as D → ∞. Moreover, we see that the choices W U developed in the preceding subsection. Therefore, the canonical choices made for diffusion models seem to be good default choices for image distributions. t = W L2 t For μdata with different smoothness properties, however, the insights from our theory dictate other choices for U and K. In Section 8 we apply our guidelines to two specific data distributions μdata. Our principled algorithms are compared to the common ad hoc implementation of diffusion models. These numerical findings confirm our theoretical insights: our modifications outperform the canonical choices, and the ways in which they do can be explained by the discussion in Section 7. 1.3 Related work The two efforts most related to ours are the concurrent works Hagemann et al. [2023] and Lim et al. [2023]. In Hagemann et al. [2023], methods are developed to train diffusion models simultaneously on multiple discretiza- tion levels of (infinite-dimensional) functions. They build upon our Wasserstein-distance bounds to show that their multilevel approach is consistent. The work Lim et al. [2023] is also able to generalize the trained model over multiple discretization levels. They propose to run the annealed Langevin algorithm in infinite dimensions, and use existing results for infinite-dimensional Langevin algorithms to justify their algorithms theoretically. The forward-reverse SDE framework is not treated. 3 Infinite-Dimensional Diffusion Models A PREPRINT Both of these efforts encounter difficulties when defining the infinite-dimensional score. Hagemann et al. [2023] circumvent this issue by only treating time-reversals of the discretized forward SDE. Lim et al. [2023], on the other hand, analyze the case in which the measure is supported on the Cameron–Martin space of W U t . One can then simplify the problem by working with densities of Xt with respect to Gaussian measure. From a practical point of view, both of these works employ Fourier neural operators [Li et al., 2020] as their neural network architecture, while we work directly in the space domain and use the popular U-Net architecture for our neural networks. Other works also transform data into a representation that is well suited to functions, e.g., by applying a wavelet [Guth et al., 2022, Phung et al., 2022] or spectral [Phillips et al., 2022] transform. After the transformation, however, these works employ the finite-dimensional formulation of the diffusion model algorithm; infinite-dimensional limits are not treated. We discuss how different spatial discretization schemes can be related to our results in Section 5. Lastly, the subject of convergence of diffusion models to the target distribution has been a very active field of research recently; see Chen et al. [2022, 2023], Bortoli [2022], Lee et al. [2022], Yang and Wibisono [2022]. In all these works, however, bounds on the distance to the target measure depend at least linearly on the discretization dimension D, rendering them vacuous in infinite dimensions. 2 A primer on probability in Hilbert spaces In this section, we will give a short summary of key concepts relating to probability theory on infinite-dimensional (Hilbert) spaces which are required to study the infinite-dimensional formulation of SGMs rigorously. For an extensive introduction to this topic, see Hairer [2009, Chapter 3]. Gaussian measures on Hilbert spaces Let (H, ⟨*, *⟩H ) be a separable Hilbert space. We then say that a random variable X taking values in H is Gaussian if, for every v ∈ H, the real-valued random variable ⟨v, X⟩H is also Gaussian. If the ⟨v, X⟩H have mean zero, X is centered. The covariance operator of X is the symmetric, positive- definite operator C : H → H defined through ⟨g, Ch⟩H = Cov (⟨X, g⟩H , ⟨X, h⟩H ) = EX [⟨X, g⟩H ⟨X, h⟩H ]. We denote the law of X in this case by N (0, C). Since X takes values in H, C is guaranteed to be compact [Hairer, 2009]. Therefore, there exists an orthonormal basis (ei : i ≥ 1) of eigenvectors of C satisfying Cei = ciei. Fixing this basis, the second moment of X is given by (3) E[∥X∥2 H ] = E (cid:35) ⟨X, ei⟩2 H = (cid:34) ∞ (cid:88) i=1 ∞ (cid:88) i=1 E[⟨X, ei⟩2 H ] = ∞ (cid:88) i=1 ⟨ei, Cei⟩H = ∞ (cid:88) i=1 ci. Since a Gaussian measure is supported on H if and only if its second moment on H is finite [Hairer, 2009], and X takes values in H, the trace of C, tr(C) = (cid:80)∞ i=1 ci, will be finite. We then also say that C is of trace class. Note that this is not the case if one would choose C = Id, since its trace is infinite. However, one could always just consider a larger space H ′ ⊃ H, such that H ′ supports μ := N (0, C) and on which C would then have finite trace. The Cameron–Martin space The covariance operator C plays a special role in that it characterizes the 'shape' of the Gaussian measure N (0, C). Indeed, one may define another canonical inner product space U associated to C, which is a (compactly embedded) subspace U ⊆ H called the Cameron–Martin space of N (0, C). Intuitively speaking, with respect to the geometry of U , a random variable X ∼ N (0, C) will have 'identity' covariance. Assuming that C is non-degenerate, the Cameron–Martin space is defined via the inner product ⟨g, h⟩U = ⟨g, C −1h⟩H = ⟨C −1/2g, C −1/2h⟩H . Since C −1 is unbounded, U is indeed a smaller space than H; more specifically, one can show that U = C 1/2H. In order to generate a realization of X ∼ N (0, C), one may simply draw i.i.d. coefficients (ξi ∼ N (0, 1) : i ≥ 1) and set X = (cid:80)N It is important to note that X almost surely does not take values in U . As an example, let H = L2([0, 1]), and consider a one-dimensional Brownian motion process (Bt : t ∈ [0, 1]). Of course, B ∈ H almost surely. The Cameron–Martin space of B, however, is given as the space U = H 1([0, 1]) of weakly differentiable functions on [0, 1]. Since the i=1 are the eigenpairs of C.1 ξiei where (ci, ei)∞ i=1 c1/2 i 1This is also called the Karhunen–Lo`eve expansion of X, and in finite dimensions relates to the simple fact that C −1/2X ∼ N (0, Id). 4 Infinite-Dimensional Diffusion Models A PREPRINT sample paths of B are almost surely nowhere differentiable [Karatzas et al., 1991], we conclude that almost surely B /∈ U .2 Nevertheless, U does indicate the regularity of the Gaussian process at hand: the more regular U , the more regular the draws from the corresponding Gaussian measure. C-Wiener processes in Hilbert spaces The standard Brownian motion in RD has increments Wt+∆t − Wt ∼ N (0, ∆tID). However, for the case of a general infinite-dimensional Hilbert space H, the meaning of an identity covariance matrix depends on the choice of the scalar product with respect to which the Gaussian measure has identity covariance. Therefore, we will from now on fix two Hilbert spaces: the Cameron–Martin space U , with respect to which the increments of the Wiener process would have covariance ∆tI, and a larger space H on which W U takes t values and has covariance operator C, i.e. W U t+∆t − W U t ∼ N (0, ∆tC). In general, we will pick H large enough so that all of our objects take values in it (the target measure μdata as well as the C-Wiener process W U t ). The choice of U can then also be seen as being equivalent to choosing a covariance operator C of W U t on H. Interpretation in finite dimensions Given a Gaussian distribution N (0, C) on RD, its Cameron–Martin space will be again RD, but equipped with the scalar product √ ⟨x, y⟩U = ⟨C −1/2x, C −1/2y⟩RD = xT C −1y. Plugging U into definition (3), one sees that X has an identity covariance matrix with respect to U . If X ∼ N (0, C), CZ, for Z ∼ N (0, ID). Similarly, a C-Wiener process with increments N (0, C) then it can also be represented as in finite dimensions can be constructed by using a standard Brownian motion Wt on RD and multiplying it with C. Therefore, in finite dimensions, most of the discussions above can be simplified to choosing covariance matrices and representing objects of interest in terms of standard Gaussians (Z) or Brownian motions (Wt). The main technical difficulties in infinite dimensions arise because one has to choose a Hilbert space H on which Z would have the standard normal distribution, and because Z will not take values in H. √ However, in infinite dimensions, one can still understand most concepts that relate to the choice of Gaussian measures by simply thinking about some large Hilbert space H ′ in which all quantities of interest take values and then identifying Gaussian random variables with their covariance operators on this space. 3 The infinite-dimensional forward and reverse SDEs We will now formulate the forward and reverse SDEs of our generative model in infinite dimensions, and show that the reverse SDE is, in fact, well-posed with the correct terminal distribution. To this end, let μdata be our target measure, supported on a separable Hilbert space (H, ⟨*, *⟩). Our goal is to generate samples from μdata, which is done by first adding noise to given samples from μdata using a forward SDE and then generating new samples using a learned reverse SDE [Song et al., 2021]. 3.1 Forward SDE We now define the infinite-dimensional forward SDE used to 'diffuse' the initial measure μdata. As noted in Section 2, there is no natural Brownian motion process in infinite dimensions; instead there is one white noise process W U t for each Hilbert space U . From now on, we fix some Cameron–Martin space U , together with its Gaussian measure N (0, C). Furthermore, let H be large enough to not only support μdata, but also N (0, C). In practice, an example would be to choose a Gaussian process (GP) with a Mat ́ern covariance N (0, C) (which implicitly defines U ). As the embedding space H, one could for example choose L2. Then W U t would have increments that are samples from a Mat ́ern GP. We then define the forward SDE as 1 2 dXt = − Xtdt + dW U t = − Xtdt + √ CdW H t , 1 2 X0 ∼ μdata . (4) The marginal distributions of Xt will converge to the stationary distribution N (0, C) as t → ∞ [Da Prato and Zabczyk, 2014, Theorem 11.11]. We will denote the marginal distributions of Xt by Pt. The choice of U , or equivalently C, can be guided by the theory that we will develop and strongly impacts empirical performance. We discuss these choices in Section 7. 2Here, we have used that functions in H 1 are absolutely continuous, and therefore almost everywhere differentiable on [0, 1]. 5 Infinite-Dimensional Diffusion Models A PREPRINT 3.2 Definition of the score function Analogously to score-based generative models in finite dimensions, we now wish to define the reverse SDE corres- ponding to (4); this SDE on H should approximately transform N (0, C) to μdata. This can be achieved by time- reversing the SDE (4). In the finite-dimensional case, the drift of the time reversal SDE involves the score function ∇ log pt (see (2)), where pt is the density of Pt with respect to Lebesgue measure. More precisely, in the finite- dimensional case H = RD, the reverse SDE to the Ornstein–Uhlenbeck process is given by dXt = − Xtdt + √ CdWt 1 2 dYt = 1 2 Ytdt + C∇ log pT −t(Yt)dt + √ CdWt ; see [Haussmann and Pardoux, 1986]. In the infinite-dimensional case, the density pt is no longer well-defined, since there is no Lebesgue measure. Hence, we need another way to make sense of the score function. Interestingly, in finite dimensions, there is an alternative way to express C∇H log pt via conditional expectations which is amenable to generalization to infinite dimensions. Lemma 1 Assume the finite-dimensional setting H = RD. Denote by pt the Lebesgue density of Xt, where X[0,T ] is a solution to (4). Then, we can express the function C∇ log pt as C∇ log pt(x) = − = − 1 1 − e−t 1 1 − e−t (cid:104) (cid:16) E Xt − e− t 2 X0 | Xt = x (cid:105)(cid:17) (cid:16) x − e− t 2 E[X0 | Xt = x] (cid:17) for t > 0, where E[f (Xτ ) | Xt = x] is the conditional expectation of the function f (Xτ ) given Xt = x and τ ∈ [0, T ]. Conditional expectations are also well-defined in infinite dimensions. Therefore, we will give the conditional expecta- tion from Lemma 1 a name and make use of it as the drift of the reverse SDE on Hilbert space H: Definition 1 Let H be a possibly infinite-dimensional Hilbert space and X[0,T ] a solution to (4). We define the reverse drift as a map s : [0, T ] × H → H, s(t, x) := − (cid:16) 1 1 − e−t x − e− t 2 E[X0|Xt = x] (cid:17) . Remark 1 Note that the above function is only defined up to Pt-equivalence classes, where Pt is the distribution of the time-t marginal of the forward SDE. However, the loss function for diffusion models is a L2 loss, integrated over Pt. Therefore, without restricting the function class that one optimizes over, the minimizer is also only defined up to Pt-equivalence. Neural networks are normally contained in the class of continuous functions in t and x. We will see that we can pick versions of s(t, x) satisfying continuity properties, for example being locally Lipschitz continuous in x (see Section 4.2). We will also frequently use the fact that the drift of the reverse SDE is actually a rescaled martingale in reverse time. We will later show that this also holds in infinite dimensions, in Theorem 1. Lemma 2 Assume the finite-dimensional setting H = RD. Then, the quantity Mt = e−t/2∇ log pt(Xt) is a time- continuous reverse time martingale, i.e., ∇ log pt(Xt) = e (t−τ ) 2 E[∇ log pτ (Xτ ) | Xt] for all 0 < τ < t. The proofs of both of these lemmas can be found in Appendix D.1. 3.3 Reverse SDE We are now able to write down the infinite-dimensional forward and reverse SDEs: X0 ∼ μdata, dXt = − Xtdt + √ CdW H t , 1 2 Y0 ∼ PT , dYt = 1 2 Ytdt + s(T − t, Yt)dt + √ CdW H t , (5) (6) 6 Infinite-Dimensional Diffusion Models A PREPRINT where W U t = √ CW H t are C-Wiener processes, and the drift s(t, x) of the reverse SDE is given by Definition 1. In finite dimensions, one could also rewrite the reverse SDE as Ytdt + C∇ log pT −t(Xt)dt + √ CdW H t dYt = = 1 2 1 2 Ytdt + C∇ log (Xt)dt + C∇ log N (0, C)(Xt) + √ CdW H t (7) = − 1 2 Ytdt + C∇ log (Xt)dt + √ CdW H t , dpT −t dN (0, C) dpT −t dN (0, C) where we denote by N (0, C)(x) the density of N (0, C) of evaluated at x. In finite as well as in infinite dimensions, if X0 ∼ μdata has a density with respect to a Gaussian N (0, C), then so will the distribution of Xt (see the proof of Theorem 3). Therefore, under that assumption, the SDE in the last line of (7) can also be made sense of in infinite dimensions. Rewriting the SDE in this form is helpful in the proof of Theorem 3. Remark 2 Another forward SDE with invariant measure ν = N (0, C) is dXt = − 1 2 C −1Xtdt + dW H t , with corresponding reverse SDE dYt = − 1 2 C −1Ytdt + ∇H log dPT −t dN (0, C) (Yt)dt + dW H t . (8) (9) The operator C −1 can often be identified with a differential operator, turning (9) into a stochastic partial differen- tial equation (SPDE). One can then use numerical tools for SPDEs to approximate the above. This constitutes an interesting direction for future work. 3.4 Training loss To simulate the reverse SDE, we need a way to approximately learn the drift function s(t, x). For another function ̃s(t, x) (a candidate approximation to s), we measure the goodness of the fit of ̃s using a score-matching objective, i.e. SMt( ̃s) = E[∥s(t, Xt) − ̃s(t, Xt)∥2 (10) On RD, the norm ∥ * ∥K to measure the misfit is typically the Euclidean norm. For training, this loss can be rewritten into the denoising score matching objective, K]. DSMt( ̃s) = E[∥ ̃s(t, Xt) − (1 − e−t)−1/2(Xt − e−t/2X0)∥2 K] = SMt( ̃s) + Vt. (11) One can then show (see [Vincent, 2011]), that SM and DSM only differ by a constant Vt and therefore one can use DSM as an optimization objective to optimize SM. The DSM loss is normally optimized on a sequence of times {tm}M m=1 on which the reverse SDE is discretized (since the score will only be evaluated at these ti values), i.e., Loss( ̃s) = M (cid:88) m=1 SMtm ( ̃s) = M (cid:88) m=1 DSMtm( ̃s) − Vtm = Etm,X [∥ ̃s(tm, Xtm) − σ−1 tm (Xtm − e−tm/2X0)∥2 K] − V, (12) where the last expectation is taken over tm ∈ Unif({t1, . . . , tM }) and V = (cid:80)M We will see that the equivalence of SMt and DSMt does not hold in general in infinite dimensions. Furthermore, we will study the choice of the norm ∥ * ∥K. Two natural choices that come to mind are the norm of the embedding Hilbert space H and of the Cameron–Martin space U of C. In the following lemma, we study conditions under which we can rewrite the loss into the denoising score matching objective. m=1 Vtm . Lemma 3 Let (K, ⟨*, *⟩K) be a separable Hilbert space. Furthermore, denote by ̃s an approximation to s, such that the score matching objective (10) is finite. Then, where DSMt is defined in (11) and Vt is given by the conditional variance of X0, SMt( ̃s) = DSMt( ̃s) − Vt, Vt = e−t 1 − e−t E[∥X0 − E[X0|Xt]∥2 K]. Furthermore, DSMt is infinite if Vt is. 7 Infinite-Dimensional Diffusion Models A PREPRINT Lemma 3 shows that in infinite dimensions there is the possibility that the true objective SM, which we are trying to optimize, might be finite, while DSM is not. One might argue that this is not relevant since in practice one always has to discretize and then both will be finite. However, as we will argue in the following paragraph, the discretization level will impact the variance of the gradients. In practice, we do not evaluate the full expectation values in SM or DSM, but take Monte Carlo estimates in the form of mini-batches. Assuming that we have already reached the optimum, i.e., s = ̃s, then the SM objective would be zero and also the gradient of any mini-batch taken to approximate it would be zero. However, derivatives of Monte Carlo estimates of the DSM objective will have the form ∂θi DSM( ̃sθ) = 1 M M (cid:88) i=1 ⟨∂θi ̃s(t, xM t ), ̃s(t, Xt) − σ−1 t (Xt − e−t/2X0)⟩, where me made the parameters θ (typically, the weights of a neural network) of ̃sθ explicit. The random variable ̃s(t, Xt) − σ−1 (Xt − e−t/2X0) has infinite variance, and therefore we can expect the above gradient estimates to have infinite variance too. Hence, if Vt is not finite and therefore DSMt is not finite in infinite dimensions, one can expect variance of the the gradient of the DSM to get arbitrarily large as the discretization gets finer, despite the fact that the true gradient should be zero. In the following lemma, we study some cases in which we can expect V to be finite. t Lemma 4 The denoising score matching objective (11) is finite in infinite dimensions if one of the following two conditions holds: 1. We use the Cameron–Martin norm ∥ * ∥K = ∥ * ∥U in the objective, and μdata is supported on the Cameron– Martin space U of N (0, C) and has finite second moment, i.e., 2. Both μdata and N (0, C) are supported on K. E[∥X0 − E[X0]∥2 U ] < ∞. A consequence of point 2 of Lemma 4 is that the norm of the embedding Hilbert space K = H is always a valid choice. The proof of both lemmas above can be found in Appendix D.2. 4 Well-posedness of the reverse SDE We need to show that the reverse SDE possesses solutions and that they are unique in order to prove that the reverse SDE samples from the target distribution in infinite dimensions. In Section 4.1, we show that the time-reversal of the forward SDE satisfies the reverse SDE in infinite dimensions and therefore samples the right final distribution μdata at its final time. In Section 4.2, we will show strong uniqueness and existence of the reverse SDE for general initial conditions. To begin, we recall a few standard notions of solutions of SDEs; we refer to Karatzas et al. [1991] for details. Our main aim will be to establish the uniqueness and existence of strong solutions of the reverse SDE. This results will also be relevant for the proof of Theorem 4. We say that the SDE (6) has a unique strong solution, if for any driving Wiener process Wt there exists a unique solution Yt, i.e., if there are two different solutions Yt and ̃Yt, both driven by the same noise Wt, then P[Yt = ̃Yt for all t] = 1, i.e., almost every path of the solutions will agree. 4.1 The time reversal satisfies the reverse SDE Thus far, we have formally formulated the reverse SDE (6) without showing that it actually constitutes a time reversal of the stochastic dynamics from the forward equation. In the following theorem, we show that Yt indeed constitutes a time reversal of Xt and that it recovers the correct target distribution at terminal time T . Theorem 1 Assume Xt is a solution to (4). Then, the time reversal Yt := XT −t solves the SDE (6). Furthermore, if H is a Hilbert space such that μdata and N (0, C) are both supported on H, we can choose s such that Mt = s(t, Xt) is almost surely continuous in t with respect to the H-norm. Proof (Sketch) We approximate the infinite-dimensional SDEs by finite-dimensional forward and reverse SDEs and use a limiting argument. The main point of the proof is to show that YT ∼ μdata in infinite dimensions. This is complicated by the fact that the natural approximations of YT will have Brownian motions and drifts ∇ log pt that change with the discretization dimension. That is, ∇ log pD+1 from the (D + 1)-dimensional discretization, restricted to RD, is not equal to ∇ log pD t , and the same holds for the Brownian motions. t 8 Infinite-Dimensional Diffusion Models A PREPRINT However, we will show that the terms ∇ log pD t are martingales in D. This can be used to obtain a limiting object as D → ∞ through the L2-martingale convergence theorem. Furthermore, since the drifts are also reverse martingales in time (see Lemma 2), one can obtain uniform convergence on the whole interval [0, T − ε] for any ε. The proof is then concluded by using the fact that the finite-dimensional approximations are all solutions to the reverse SDE and therefore fulfill t − Y D Y D 0 − Y D r dr − T −rdr = W D sD t . 1 2 (cid:90) t 0 (cid:90) t 0 for a D-dimensional Brownian motion W D (which again will change for each D, i.e., the restriction of the the D + 1- t dimensional Brownian motion to the D first dimensions is not equal to BD). Since all the terms on the left hand side converge in L2, uniformly in t, so does the right hand side. The right hand side is P DCP D Brownian motion for each D. Using the closedness of the spaces of martingales and furthermore the L ́evy characterization of Brownian motion, we find that the W D t must converge to a C-Wiener process Wt. The full proof can be found in Appendix E. (cid:50) Remark 3 The work F ̈ollmer and Wakolbinger [1986] studies time-reversal of more general forward SDEs. Due to the more general setting, the resulting SDE is only expressed coordinate-wise, and the SDE as well as the assumptions are more technical. Using our approach and the reverse drift s(t, x), we prove that we can still use the common denoising score matching loss to approximate s(t, x); see Lemma 3. Another related concept is vector logarithmic derivatives, as discussed in Bogachev [1997]. Due to Theorem 1, we know that there is a solution to (6) that will sample μdata at the final time. To motivate approximating (6) for sampling from μdata, we also need to show that these solutions are unique; otherwise there could be other solutions that have different terminal conditions. We will achieve this in the following section. 4.2 Uniqueness of solutions The first case we study is the case of general distributions with bounded support. Note that the assumptions in the fol- lowing theorem require nothing more than bounded support. This allows for the study of the possibility of distributions supported on irregular substructures of the full space (i.e., satisfying the manifold hypothesis). Many distributions that diffusion models are applied to satisfy the manifold hypothesis and understanding how diffusion models interact with manifolds has been an active area of research [Pidstrigach, 2022b, De Bortoli, 2022, Batzolis et al., 2022]. Theorem 2 Fix a covariance operator C in the forward SDE (5) together with its Cameron–Martin space U . Assume that the support of μdata is contained in a ball BR in U of radius R ≥ 0: BR = {x : ∥x∥U ≤ R}. Then there is a version of s which is Lipschitz continuous with respect to the Cameron–Martin norm, i.e., ∥s(t, x) − s(t, y)∥U ≤ Lt∥x − y∥U , (13) where Lt ∈ R+ is a time-dependent Lipschitz constant. Moreover, the reverse SDE with the Lipschitz continuous version of s(t, x) has a unique strong solution. Proof (Sketch) The transition kernel of the forward SDE is given by pt(x0, *) ∼ N (e−tx0, vtC), where we used the shorthand notation vt = 1 − e−t. If x0 is an element of the Cameron–Martin space U of C, then the transition kernel is absolutely continuous with respect to N (0, (1 − e−t)C). The explicit formula for the density is nt(x0, x) = dN (e−tx0, vtC) dN (0, vtC) (x) by the Cameron–Martin theorem. Since μdata almost surely takes values in U , one can use the above to derive an explicit expression for the conditional expectation E[X0|Xt = x] in terms of these densities: E[X0|Xt = x] = (cid:82) x0nt(x0, x)dμdata(x0) (cid:82) nt(x0, x)dμdata(x0) . This formula can be used to derive local Lipschitzness of s(t, x) = − 1 1 − e−t x + 2 e− t 1 − e−t E[X0|Xt = x]. 9 Infinite-Dimensional Diffusion Models A PREPRINT Interestingly, the local Lipschitzness is in terms of the norm of U . Even if x and y themselves are not in U , if their difference in is U , the U -norm of the difference s(t, x) − s(t, y) will be bounded by (13). Taking some care, one can still use a fixed point argument to obtain existence, but not uniqueness. One can then apply Gr ̈onwall's lemma to obtain uniqueness. Note that obtaining weak uniqueness would be easier, since under our assumptions the drift s(t, x) will always map to the Cameron–Martin space of the C-Wiener process and one could apply a Girsanov-type argument. The full proof can be found in Appendix F.1. (cid:50) The other case of interest is applying diffusion models to Bayesian inverse problems or simulation-based inference. In this case, we assume that the true measure is given as a density with respect to a Gaussian reference measure. We treat it in the theorem below: Theorem 3 Fix a covariance operator C in the forward SDE (5). Assume μdata is given as μdata ∝ exp(−Φ(x))dN (0, Cμ). Let (H, ⟨*, *⟩H ) be a Hilbert space on which N (0, Cμ) is supported and C is bounded. For the potential Φ ∈ C 1(H) we assume, • Φ(x) ⩾ E0, • Φ(x) ⩽ E1 + E2∥x∥2, and • ∥∇Φ(x) − ∇Φ(y)∥ ⩽ L∥x − y∥, where the gradient is the H-gradient. Then there is a version of s(t, x) that is locally Lipschitz continuous with respect to the H-norm for each t, i.e., for ∥x∥, ∥y∥ ≤ r there is a Lt,r < ∞ such that ∥s(t, x) − s(t, y)∥ ≤ Lt,r∥x − y∥, and the reverse SDE with the locally Lipschitz continuous version of s(t, x) has a unique strong solution. Proof (Sketch) The proof holds for any C that is diagonalizable with respect to the same eigenbasis as Cμ (in particular, also for C = Id, i.e., H-white noise), but we will only treat the less technical case C = Cμ here. In the case of C = Cμ, the distribution Pt of Xt is absolutely continuous with respect to N (0, C). One can rewrite the reverse SDE as in (7). It will then hold that ∇xt log dpt dN (0, C) (xt) = E[C∇Φ(X0)|Xt = xt], and the proof will mainly translate the Lipschitzness properties of ∇Φ(x) to E[∇Φ(X0)|Xt = x]. The global Lipschitzness of ∇Φ(x) only induces local Lipschitzness of E[∇Φ(X0)|Xt = x], but that is enough to apply a Gr ̈onwall argument and deduce strong uniqueness. Furthermore, one can obtain weak existence to the reverse SDE. By Theorem 1, the time reversal will be a weak solu- tion with initial condition PT . However, under the assumptions of the theorem, N (0, C) will be absolutely continuous with respect to pT . Therefore, one can obtain a weak solution with initial conditions N (0, C) by reweighting the time reversal. However, weak existence together with strong uniqueness already imply strong uniqueness; see Karatzas et al. [1991, Section 5.3]. The full proof can be found in Appendix F.2. (cid:50) 5 Algorithms and discretizations We state simplified versions of our proposed algorithms in Algorithms 1 and 2. There are many potential modifications one might make to the above algorithms, as for example discussed in Song et al. [2021], Song and Ermon [2020], Ho et al. [2020]; we do not include these here since they are not the focus of the current work. To implement any algorithm on a computer, the functions have to be discretized in some way. Discretization also interacts with the covariance matrix C, as the same covariance matrix has different meanings in different discretizations. We discuss this briefly now. 10 Infinite-Dimensional Diffusion Models A PREPRINT Algorithm 1 Training n=1 Require: Covariance operator C Require: Training data {X n}N Require: Norm ∥ * ∥ Require: Batch size B Require: Discretization grid {t1, . . . , tM } 1: while Metrics not good enough do 2: 3: 4: 5: 6: Sample {ξi}B i=1 ∼ N (0, C) i.i.d. Subsample {xi i=1 from {X n}N 0}B Sample ti ∈ Unif({t1, . . . , tM }) √ t ← e−ti xi xi 0 + Loss(θ) = (cid:80)B t) − Perform gradient step on Loss. i=1 ∥ ̃sθ(ti, xi 1 − e−ti ξi n=1 7: 8: end while 1√ 1−e−ti ξi∥2 Algorithm 2 Sampling M }L Require: Covariance operator C Require: Discretization grid {t1, . . . , tM } Require: Number of samples to generate L 1: {xi i=1 ∼ N (0, C) 2: for m ← M, . . . , 1 do ∆t ← tm − tm−1 3: Sample {ξi}L 4: xi m−1 ← xi 5: 6: end for 7: return {xi i=1 ∼ N (0, C) i.i.d. m + ∆t ̃sθ(tm, xi m) + √ M }M i=1 ∆t ξi If the functions are discretized on a grid, i.e., if the samples are of the form {f (xd)}D d=1 for a fixed grid {xd}, choosing an identity covariance matrix corresponds to adding independent noise at each grid point xd. The limiting object of the noise as the grid gets finer is space-time white noise (recall Section 1.1). Furthermore, the Euclidean norm on RD in the loss function (11) will correspond to using the L2 loss in the limit-i.e., the Cameron–Martin norm of the noising process. In RD the choice of the white noise process is equivalent to choosing a covariance matrix C and adding a standard RD-valued Brownian motion Wt. Any correlated Wiener noise process W U on RD. If one wants the limit of that Gaussian process on the grid {xd}D Gaussian process realizations for common kernels (such as Mat ́ern or squared exponential). CdWt with t can be represented in this way CdWt to be a Gaussian process, one needs to plug in for C the kernel matrix of d=1. Alternatively, one can also use one of many available libraries to generate √ √ Note that the meaning of C depends on the discretization. If f is discretized with respect to some basis ei of a space U , then using the identity covariance matrix corresponds to using the white noise process with Cameron–Martin space U . Therefore, discretizing the functions in a wavelet or Fourier basis will also result in space-time white noise as these both form an orthonormal basis of L2 (under the common scaling of the basis vectors). However, if one does not want to work in the spatial domain, one can also just discretize the functions in an orthonormal basis of the Cameron–Martin space U of the noise one is targeting. Therefore, we can translate the approaches in Guth et al. [2022], Phillips et al. [2022], Phung et al. [2022] into our setting. 6 Bounding the distance to the target measure We now study how far the samples generated by the diffusion model algorithm lie from the true target measure μdata. We do this in the Wasserstein-2-distance, (cid:18) W2(μ, ν) = inf κ∈Q(μ,ν) (cid:90) ∥x − y∥2 H dκ(x, y) (cid:19)1/2 , where κ runs over all measures on H × H which have marginals μ and ν. The Wasserstein-2 distance in some sense "lifts" the distance induced by ∥ * ∥H to the space of measures. In the following theorem, we give an upper bound for the Wasserstein distance between the sample measure and the true data-generating measure. The bound holds irrespective of ∥ * ∥H , giving us the freedom to study how different choices of ∥ * ∥H affect the distance bound. Theorem 4 We denote the covariance of the forward noising process by C. Let (H, ∥ * ∥H ) be any Hilbert space such that the support of μdata and N (0, C) are contained in H. Assume that ∥ * ∥H is at least as strong as the norm ∥ * ∥K used in the training of the diffusion model (see (12)), i.e., for some constant a. Further, assume that s(t, x) is Lipschitz on H with constant L, i.e., ∥x∥H ≤ a∥x∥K ∥s(t, x) − s(t, y)∥H ≤ L∥x − y∥H 11 Infinite-Dimensional Diffusion Models A PREPRINT and that the reverse SDE has a strong solution (see Theorem 2 or 3 for the requirements). Let the reverse SDE (6) be discretized using an exponential integrator (see Appendix C). Then, W2(μdata, μsample) ⩽ (cid:16) exp(−T /2) W2(μdata, N (0, C)) + ε1/2 Num + aε1/2 Loss (cid:17) exp (cid:19) , L2T (cid:18) 1 4 (14) where εLoss is the value of the loss objective (12) and εNum denotes the error due to the numerical integration proced- ure, εNum = O(∆t) sup 0<t≤T EXt∼pt[∥s(t, Xt)∥2 H ]. Proof (Sketch) We define two strong SDE solutions: Yt, which is a solution to (6) with the correct drift s(t, x) and started in PT ; and ̃Yt, which uses the approximate drift ̃s and is started in N (0, I). Both solutions are run to time T . We couple them by using the same Brownian motion process for both and starting them in W2-optimally coupled initial conditions. We then obtain a bound on E[∥YT − ̃YT ∥2 us a coupling between μdata and μsample and therefore upper bounds the Wasserstein-2 distance between those two. H ]. Since we know that YT ∼ μdata, ̃YT ∼ μsample by definition, this gives We make use of the fact that the score is a martingale to obtain a simple upper bound for the numerical integration EXt∼pt[∥s(t, Xt)∥2 error, depending only on the quantity sup0<t≤T The full proof can be found in Appendix G. H ]. (cid:50) Since the choice of the embedding space (H, ∥ * ∥H ) is left open in Theorem 4, we briefly discuss the implications of that choice. Controlling the Wasserstein distance with respect to a stronger underlying norm always implies the same Wasserstein-bound w.r.t. any weaker underlying norm. Of course, there is the possibility to obtain a better bound by directly applying the theorem for a weaker norm. Picking stronger norms for H will in general result in the Wasserstein distance also factoring in differences in sample smoothness as well as deviations in function values. For example, picking H = L2 means that the bound only implies closeness of the function evaluations while, for example, samples being too rough is not factored in. Picking positive Sobolev spaces will punish deviations in function values and deviations in the derivatives of the samples from the true samples. Picking negative Sobolev spaces for H (as we will need to for the common implementation of diffusion models; see Section 7.2) means that the samples are only close in a distributional sense. See Section B in the appendix for further discussion. 7 Designing infinite-dimensional diffusion models Our theory yields several suggestions on how one should design infinite-dimensional diffusion model algorithms. Section 7.1 gives a concise summary of those design principles, while Section 7.2 discusses the extent to which those design principles align with common implementations of diffusion models. In Section 8, we then show how to implement the guidelines in some explicit examples. The two main design choices we will discuss are 1. The choice of the forward noising process W U t in (4). 2. The choice of the norm ∥ * ∥K in the denoising score matching objective in (12). The first choice (of U and hence W U t ) is equivalent to the choice of an invariant Gaussian distribution N (0, C), and we will use these choices interchangeably. In general, picking a C such that N (0, C) produces smoother samples corresponds to picking a smaller space U , while rougher samples correspond to larger Cameron–Martin spaces U ; see also the examples in Section 8.1 and Figure 1. Furthermore, after discretizing the problem to finite dimensions, the choice of U or C corresponds to nothing else than specifying a covariance matrix C, i.e., Wt is replaced by CWt in the diffusion processes. See Section 5 for more details. √ After discretization, the second design choice of ∥ * ∥K corresponds to specifying a loss norm of the form ∥K −1/2 * ∥ in place of the typical Euclidean norm ∥ * ∥. 12 Infinite-Dimensional Diffusion Models A PREPRINT 7.1 General guidance Match C to μdata First, we begin by pointing out the implications of Theorem 4 on the choice of C, or equivalently, U . The term W2(μdata, N (0, C)) appearing in the error bound (14) clearly indicates choosing C such that N (0, C) is as close as possible to μdata. Choosing C such that we can pick a strong H-norm Second, as discussed at the end of Section 6, we would like to choose as strong an ∥ * ∥H -norm as possible in Theorem 4. This suggests not picking C too rough (U too large) as the norm space H in Theorem 4 has to support N (0, C). This last points seems to suggest that we would want to pick C as smooth as possible to allow for stronger H-norms. However, since however, since H has to support μdata, there is a restriction on how strong an H-norm can be chosen. Therefore, this suggests matching N (0, C) to μdata so that they are supported on the same space H, similarly to our first observation. Choosing the loss-norm ∥ * ∥K The H-norm in Theorem 4 also has to be stronger than the loss norm ∥ * ∥K, again suggesting choosing K as small as possible. However, besides numerical issues, also here there are lower bounds on how strong we can choose K. To that end, we take another look at Lemma 4 in which we study two separate cases. In the first case, if C is rough enough such that U contains the support of μdata, we can choose the Cameron–Martin norm of N (0, C) as the loss norm, i.e., K = U . In the second case, K has to support both N (0, C) and μdata, which is the same condition as for the space H chosen in Theorem 4. Hence, there are predominantly two natural ways to design the algorithm: 1. Choose N (0, C) as smooth as possible / U as small as possible, but large enough such that the support of μdata is contained in its Cameron–Martin space U . Then choose the loss norm ∥ * ∥K in (12) equal to the Cameron–Martin norm, K = U . This algorithm design is called Infinite-Dimensional Diffusion Model 1 (IDDM1) 2. Match C to the data, i.e., choose N (0, C) such that its samples are as similar to the samples from μdata as possible. Then choose the loss norm ∥ * ∥K in (12) such that it supports both μdata and N (0, C). Let us call this algorithm design Infinite-Dimensional Diffusion Model 2 (IDDM2). Note that by Theorem 2, if not much is known about the distribution, and if in particular it might be supported on manifold-like structures, we must pick U large enough to contain the support of μdata anyway. We will therefore use IDDM1 in these cases; see Section 8.2. If one has more structural information, for example the knowledge that μdata has density with respect to a Gaussian measure, we will use IDDM2; see Section 8.3. 7.2 Image distributions and white noise diffusion models The common implementation of the diffusion model algorithm will converge as D → ∞ to U = L2, i.e., use space- time white noise in the forward noising process. Furthermore, the loss function will also approach the L2 loss, which means we are in the setting where we use the Cameron–Martin norm in the loss. For more details, see Section 5. We will call this algorithm White Noise Diffusion Model (WNDM). If μdata is an image distribution, we can expect it to lie on a manifold, or more generally some lower-dimensional substructure. Furthermore, since the function values of an image are bounded on [0, 1], the image samples are all contained in L2. Therefore, we are in the setting of Theorem 2, where the data are contained in the Cameron–Martin space U of the noise. Furthermore, we can apply Lemma 4 (bullet point 1) to see that we can use the Cameron– Martin norm, i.e., the L2 norm, and obtain a well-defined denoising score-matching objective. Therefore, under these assumptions, we have shown that applying WNDM to image distributions has a well-defined infinite-dimensional limit. Coming back to the discussion in Section 7.1 (in particular the design guidance for IDDM1), however, our theory suggests that we should try to pick U as small as possible, while still containing the typical image distribution. How- ever, this U cannot be too regular, since images are quite irregular-for example, they can be discontinuous. If we identify images with two-dimensional functions, then already the L2-Sobolev spaces H α of order α > 1 only contain continuous functions. Therefore, on the Sobolev scale (H α : −∞ < α < ∞), the 'optimal' Cameron–Martin space would possess regularity of at most α = 1. In light of this, setting U = H 0 = L2 indeed seems like a natural choice that is close to matching the maximal possible regularity. Strikingly, this is in line with the huge empirical success of the WNDM algorithm for image distributions. To further refine the optimal choice of the space U beyond L2 is an interesting avenue, both for theoretical and empirical future study. 13 Infinite-Dimensional Diffusion Models A PREPRINT (a) α = 0, one sample (b) α = 1, six samples (c) α = 2, six samples √ Figure 1: In each panel, we plot samples from πα for different values of α, where πα is defined in Section 8.1. We 2 sin(2πk * ) as an orthonormal basis of L2. For α = 0 we see a sample of space-time white noise, chose ek(*) = where no function value is correlated to any of its neighboring function values. For α = 1 and our specific choice of ek, the sampled measure is the Brownian bridge measure. 8 Numerical illustrations In this section, we illustrate our results through numerical experiments. We sample functions defined on [0, 1], and we discretize this spatial domain into a uniform grid with D = 256 evenly spaced points. For other discretization schemes, see the discussion in Section 5. We employ a grid-based spatial discretization since it allows us to use the popular U-Net architecture. Other common discretization schemes 'whiten' the data, rendering the convolutional layers of the U-Net unnecessary. For implementation details, see Appendix A. Section 8.1 introduces some common preliminaries needed for both of the subsequent numerical examples. Section 8.2 then compares various diffusion model constructions in the setting of distributions that are not defined via Gaussian reference distributions, but rather supported on submanifolds of the infinite-dimensional space. Section 8.3 demon- strates the use of infinite-dimensional diffusion models for solving Bayesian inverse problems via a simulation-based (i.e. conditional sampling) approach. 8.1 Families of Gaussian measures We first construct a family (πα, H α : −∞ < α < ∞) of Gaussian measures πα and their Cameron–Martin spaces H α. This construction allows us to interpolate between measures with different sample smoothness and compare between the algorithms described in Section 7.1 and the canonical implementation of diffusion models described in Section 7.2. To that end, we fix an orthonormal basis ek of L2([0, 1]). Then, we construct a family (πα : −∞ < α < ∞) of Gaussian measures as the distributions of ∞ (cid:88) k−αZkek ∼ πα, where Zk ∼ N (0, 1) i.i.d. The Cameron–Martin space of πα is denoted by H α and has norm k=1 ∥x∥2 α = ∞ (cid:88) k=1 k2α⟨x, ek⟩2 L2([0,1]). (15) (16) Note that H 0 = L2([0, 1]) and therefore π0 is space-time white noise. Furthermore, H α ⊂ H β for α > β. As we have discussed before, samples of πα will (almost surely) not be elements of the corresponding Cameron–Martin space H α. Nevertheless, the distribution πα is supported on H α−κ as long as κ > 1 2 ; see Beskos et al. [2011, Proposition 3.1]. The exact form of samples of πα depends on the chosen basis ek in (15). In our examples H α will be L2-Sobolev spaces with either zero or periodic boundary conditions. For the case of zero boundary conditions, we have visualized samples of πα for different values of α in Figure 1. As discussed in Section 7.1, we want to study two main modeling choices: First, we must select a Gaussian measure N (0, C), or equivalently its Cameron–Martin space U , for the noising process. We do that by fixing an αnoise and setting U = H αnoise . 14 Infinite-Dimensional Diffusion Models A PREPRINT Second, a loss norm ∥ * ∥K must be chosen. We do so by fixing an αloss and setting K = H αloss. As recommended in Section 7.1, these choices should depend on the structure of μdata. Therefore, we choose an αdata and define μdata through a nonlinear transformation of παdata. This way, μdata will be non-Gaussian, but we still have perfect knowledge about where its samples are supported. In particular, we will have support(μdata) ≈ H αdata− 1 2 . This gives us the possibility to match U and K to μdata in different ways. In realistic examples, knowledge about μdata could come from prior information or by studying the training samples-the empirical covariance matrix is, for example, a natural candidate for specifying C in IDDM2. Lastly, we will be able to make explicit statements about the norm of H for which the distance bounds in Theorem 4 hold, which we will also quantify by choosing an αdist. The larger αdist, the better, since the underlying norm for the distance measurement gets stronger (see also the discussion in Section 7.1). Note that the limit of the common implementation of diffusion models, which we called WNDM (see Section 7.2) will use white noise for the noising process as well as the loss, i.e., αnoise = αloss = 0. In that case, N (0, C) will only be supported on any H α with α < − 1 2 . Therefore, so that we can apply Theorem 4 with H αdist we have to choose αdist < − 1 For the two numerical experiments in Sections 8.2 and 8.3, we will proceed as follows: 2 , i.e., use the norm of a negative Sobolev space. 1. We have information about the sample smoothness and support of μdata, in this case in the form of an αdata. 2. Based on Section 7.1, we then choose U and K, which boils down to the choice of αnoise and αloss. 3. We then know for which norms ∥ * ∥H our Wasserstein bound in Theorem 4 holds. In our interpolation family, this boils down to an upper bound for αdist. Therefore, we can make statements about which properties of μdata the diffusion model should successfully approximate. 8.2 Manifold distribution on a Cameron–Martin sphere In this section, we will study a distribution which lies on an infinite-dimensional submanifold of L2([0, 1]), namely 2 sin(kπ *) in the construction of the unit sphere of some Cameron–Martin space. To that end, choose ek(*) = Section 8.1. For this choice, the Cameron–Martin spaces H α will be the Sobolev spaces W α,2 of functions vanishing at the boundary, and π1 is proportional to the distribution of a Brownian bridge. Here we see that we can not only capture smoothness but also structural information, such as boundary conditions, through the choice of an appropriate Gaussian measure. For a more in-depth study of this, see Mathieu et al. [2023]. We draw N = 50 000 samples from παdata, where the data-generating αdata was set to √ 0 αdata = 2. By our discussion in Section 8.1, these samples are supported on any H α with α < 3 αsupp = 1 < 3 the map 2 , in particular H 1. Now define 2 . The target distribution μdata is created by projecting παdata onto the 10-sphere in H αsupp , i.e., applying H αsupp → H αsupp , x (cid:55)→ 10 x ∥x∥H α supp to all samples. We depict some of the training samples and a heatmap of their marginal densities in Figure 2. As described in Section 7.1, we use the theory to guide the choices for αnoise and αloss. The data distribution was not absolutely continuous with respect to a Gaussian, since we projected it to a submanifold (the sphere). Therefore, we must apply Theorem 2 to obtain uniqueness. To satisfy the assumptions of Theorem 2, however, the Cameron–Martin space U has to contain μdata. Hence, we will apply the IDDM1 from Section 7.1. To apply IDDM1, we choose U so that it contains the support of μdata and N (0, C). This is accomplished by setting αnoise = 1. Then, following the design principles of IDDM1, we pick the loss norm to be K = U , i.e., αloss = αnoise = 1, and learn the score by using the Cameron–Martin norm in the loss. Note that the bound in Theorem 4 holds for any αdist smaller than (cid:26) αdist < min αdata − 1 2 , αnoise − 1 2 (cid:27) , αloss = min (cid:26) 3 2 , 1 2 (cid:27) , 1 = 1 2 . 15 Infinite-Dimensional Diffusion Models A PREPRINT Figure 2: We generated 50 000 training examples from the distribution described in Section 8.2. On the left, we show a heatmap of the resulting marginal densities of function values at each point in the domain [0, 1]. On the right, we plot a few training samples. (a) Epoch 10 (b) Epoch 30 (c) Epoch 60 Figure 3: Example of Section 8.2: samples generated by WNDM (row 1) and IDDM1 (row 2) after increasing numbers of training epochs. Samples from the true measure can be compared in Figure 2. For WNDM, i.e., the canonical implementation of diffusion models described in Section 7.2 with αloss = αnoise = 0, the upper bound is − 1 2 . Therefore, while we do not expect the samples of WNDM to match the smoothness class of μdata, we expect the samples of IDDM1 to at least partially retain the smoothness. Figure 3 shows samples generated by the two models. We see that our theoretical findings are confirmed: WNDM fails to learn the smoothness or correlation structure of the samples. Solely at training epoch 10 the WNDM algorithm generated some samples that seemed to have the right smoothness, but even those actually contain jitter if one looks closely. Overall, the training process was very unstable regarding the data smoothness, and minimizing the loss did not seem to correlate with also matching the derivatives of the functions. On the other hand, IDDM1 produces samples from the correct smoothness class, from the start of training onwards. Note that both algorithms matched the marginals quite well, as can be seen in the heatmap plots of Figure 4, which is also suggested by the theory: even if Theorem 4 only holds for an underlying negative Sobolev norm, the overall distribution and in particular its marginals should still match the true marginals (see Section B). 8.3 Infinite-dimensional Bayesian inverse problem: volatility estimation The following numerical experiment is inspired by Bayesian inverse problems (BIPs) [Stuart, 2010], which here we approach via the paradigm of simulation-based inference. In this setting, we will use our infinite-dimensional diffusion models for conditional sampling. We assume that we have some knowledge about an unknown random variable X ∈ H in the form of a measurement y ∈ Rl drawn from Y ∼ q(X, *), 16 Infinite-Dimensional Diffusion Models A PREPRINT (a) WNDM (b) IDDM1 Figure 4: Example of Section 8.2: each vertical slice shows a heatmap of the marginal density estimated from 2048 samples generated by each of the diffusion models, after 60 epochs of training. For comparison, the heatmap of the 50 000 training examples is plotted in Figure 2. The one-dimensional marginals are matched well by both algorithms. where q is an observation kernel. Furthermore, we have some prior information on X, formalized through a prior probability distribution: X ∼ π := N (0, Cμ). By Bayes' theorem, the posterior distribution ν of X given some observations Y = y is given by dπ( * |Y = y) ∝ q(*, y) dπ. (17) Gold-standard methods for asymptotically exact sampling of distributions like (17) involve Markov chain Monte Carlo (MCMC), e.g., Hamiltonian Monte Carlo [Duane et al., 1987] or, in the infinite-dimensional case, Hilbert space Hamiltonian Monte Carlo (HSHMC) [Beskos et al., 2011], or other geometry-exploiting infinite-dimensional MCMC methods [Cotter et al., 2013, Cui et al., 2016, Kim et al., 2023]. These MCMC methods, however, rely on having an explicit formula for the density of ν (up to a normalizing constant). In many cases this is not possible-for example, if q or any of its components is given as a black-box model. To train a conditional diffusion model, on the other hand, we only need samples from the joint distribution of (X, Y ). These can be generated by sampling X i from the prior measure and sampling Y ∼ q(X i, *). We then train a conditional diffusion model to generate samples from X|Y = y for any y. This is done by making the score model s not only depend on Xt, but also on Y , i.e., we have a model s(t, Xt, Y ), which predicts X0 given Y = y. During generation, one can then input the observation value y that one wants to condition on during simulation of the reverse SDE [Batzolis et al., 2021]. Hence the entire procedure is sample-driven, and an example of simulation-based inference [Cranmer et al., 2020]. We now proceed to a specific instance of a Bayesian inverse problem. The experiment is inspired by volatility estima- tion. We assume that we observe a path of a time series, for example a stock price, modeled as dSτ = στ Sτ dBτ , with no drift and a time-dependent volatility στ . The solution to the above equation is given by a geometric Brownian motion, i.e., Sτ = S0 exp σrdBr − (cid:18)(cid:90) τ 0 1 2 (cid:90) τ 0 (cid:19) . σ2 r dr We simulate paths of the above and observe Sτ at discrete times τ1 = 1 log-transformation and define ri as the log-returns: 4 , τ2 = 2 4 , τ3 = 3 4 , τ4 = 1. Then, we apply a ri := log Sτi − log Sτi−1 = (cid:90) τi τi−1 σrdBr − 1 2 (cid:90) τi τi−1 σ2 r dr ∼ N (cid:18) − 1 2 (cid:19) vi, vi , where vi := (cid:90) τi τi−1 σ2 r dr. Here, we set τ0 = 0 for notational convenience. Since σ should be positive, we model it as and seek to infer the log-volatility a : [0, 1] → R. στ = exp(aτ ), Again, we define a family of Gaussian measures as in Section 8.1. This time we use a different orthonormal basis of L2([0, 1]), given by (cid:26)√ √ ek(τ ) = 2 cos(kπτ ), if k even 2 sin((k + 1)πτ ), otherwise . 17 Infinite-Dimensional Diffusion Models A PREPRINT Figure 5: Example of Section 8.3. As a reference/comparison, we generate 50 000 high-quality posterior samples from dπαdata(aτ | ̃r) using the Hilbert space Hamiltonian Monte Carlo algorithm. On the left is a heatmap of posterior marginal densities of aτ , at each point in the domain τ ∈ [0, 1]. On the right, we plot a few example posterior samples. This leads to Gaussian measures whose samples have periodic boundary conditions. Since ek and ek+1 (for k uneven) should have the same 'magnitude,' we slightly modify (15) and (16): for k uneven, we replace (k + 1)−α by k−α. All the discussed properties of the family πα are not affected by this change, since the decay of the eigenvalues is asymptotically the same. We put a prior on a. It's covariance is given by 1 2 Cprior, where Cprior is the covariance of παdata, with αdata = 4: a ∼ N (0, Cprior). The goal of a conditional diffusion model is to generate samples from the posterior dπαdata(aτ |r1, r2, r3, r4) ∝ 4 (cid:89) i=1 (cid:18) N ri; − (cid:19) 1 2 vi, vi dπαdata, (18) for a fixed observation r = (r1, r2, r3, r4). Via the model defined above, each vi is a functional of στ and thus aτ . For training, we generate N = 50 000 samples from the prior {an}N n=1 together with simulated observations {rn}N The trained diffusion models should, for any input r ∈ R4, generate samples from (18). n=1. To assess the performance of the trained models, we drew a random ̃aτ and corresponding observations ̃r = ( ̃r1, ̃r2, ̃r3, ̃r4). We used the HSHMC algorithm to generate 50 000 "reference" posterior samples from (18) for this fixed observation value ̃r. We plot these posterior samples and their heatmap, as well as the data-generating value ̃a of the log-volatility, in Figure 5. After training, we input ̃r (which the diffusion models have not seen before) to the conditional diffusion models and compare the generated samples to those from HSHMC. As in Section 8.2, we again compare the canonical diffusion model implementation WNDM against an implementation motivated by the infinite-dimensional theory. In this case, since we are sampling from a Bayesian inverse problem with a Gaussian prior, we are in the setting of Theorem 3. Therefore, we will implement the IDDM2 algorithm from Section 7.1. We match the noise structure to the data by setting αnoise = αdata = 4, which is justified by the form of (18) of μdata. Then we set αloss = 2, such that K supports μdata and παnoise . Note that any αloss < 7 2 would also have been a valid choice. The choice αloss = 3 worked comparably well in our numerical experiments. We compare samples generated by the two diffusion models in Figure 6. Again, the WNDM algorithm did not match the smoothness class of μdata in a stable way. While during training, there were times at which the network generated smooth samples, it later unlearned to do so. The IDDM2 algorithm outputs samples of the correct class at every point during training. Both algorithms are able to match the marginal distributions, although IDDM2 does slightly better, as seen in Figure 7. Therefore, as in Section 8.2, these numerical experiments confirm the theoretical predictions made in Section 7. Remark 4 Note that for our choice of αnoise, the reverse SDE now starts with initial condition παdata(aτ ) = N (0, Cprior) and ends in the posterior παdata(aτ |r). Therefore, it has learned to transport the prior to the posterior. Furthermore, in this case, we can interpret the reverse SDE as a smoothed version of the forward process, i.e., an Ornstein–Uhlenbeck process conditioned on its terminal values. This also opens up the way to interpret the training of the reverse SDE as an infinite-dimensional control problem. 9 Summary We have formulated the diffusion-based generative modeling approach directly on infinite-dimensional Hilbert spaces. Our formulation involves specifying infinite-dimensional forward and reverse SDEs and an associated denoising score 18 Infinite-Dimensional Diffusion Models A PREPRINT (a) Epoch 10 (b) Epoch 30 (c) Epoch 60 Figure 6: Example of Section 8.3. Conditional samples from WNDM (upper row) and IDDM2 (lower row) after varyings number of training epochs. Compare to the high-quality posterior samples generated using Hamiltonian Monte Carlo in Figure 5. (a) Epoch 10 (b) Epoch 30 (c) Epoch 60 Figure 7: Example of Section 8.3. Heatmaps of the 2048 conditional samples generated by WNDM (upper row) and IDDM2 (lower row), for increasing numbers of training epochs. Reference heatmaps generated via Hilbert space Hamiltonian Monte Carlo are in Figure 5 for comparison. matching objective. We prove that our formulation is well-posed. To that end, we show that the reverse SDE we wish to approximate has a unique solution; furthermore, we show under which conditions the denoising score matching objective generalizes to an infinite-dimensional setting. Building on these results, we are able to prove dimension- independent convergence bounds for diffusion models, which hold in the infinite-dimensional case. These theoretical developments reveal an intricate relationship between the properties of the target/data-generating measure μdata and the choices of the Wiener process W U t and the loss norm in the denoising score matching objective ∥ * ∥K. We utilize this knowledge to develop guidelines on how to make such choices for a given μdata. For image dis- tributions, these guidelines are in line with the canonical choices made in practice. For other target distributions μdata, however, the algorithm design should be modified. We apply these modifications to two generative modeling tasks that are discretizations of infinite-dimensional problems, and the numerical results confirm our theoretical findings. Acknowledgements JP and SR have been partially supported by Deutsche Forschungsgemeinschaft (DFG), Project ID 318763901, SFB- 1294. SW and YM acknowledge support from Air Force Office of Scientific Research (AFOSR) MURI Analysis and Synthesis of Rare Events, award number FA9550-20-1-0397. JP and SR would also like to thank the Isaac Newton Institute for Mathematical Sciences, Cambridge, for support and hospitality during the programme The Mathematical and Statistical Foundation of Future Data-Driven Engineering where work on this paper was also undertaken. This work was supported by EPSRC grant no EP/R014604/1. 19 Infinite-Dimensional Diffusion Models A PREPRINT References G. Batzolis, J. Stanczuk, C.-B. Sch ̈onlieb, and C. Etmann. Conditional image generation with score-based diffusion models. arXiv preprint arXiv:2111.13606, 2021. G. Batzolis, J. Stanczuk, and C.-B. Sch ̈onlieb. Your diffusion model secretly knows the dimension of the data manifold. arXiv preprint arXiv:2212.12611, 2022. A. Beskos, F. J. Pinski, J. M. Sanz-Serna, and A. M. Stuart. Hybrid Monte Carlo on Hilbert spaces. Stochastic Processes and their Applications, 121(10):2201–2230, 2011. V. Bogachev. Differentiable measures and the Malliavin calculus. Journal of Mathematical Sciences, 87(4):3577– 3731, 1997. V. D. Bortoli. Convergence of denoising diffusion models under the manifold hypothesis. Transactions on Machine Learning Research, 2022. ISSN 2835-8856. URL https://openreview.net/forum?id=MhK5aXo3gB. N. Bou-Rabee and A. Eberle. Two-scale coupling for preconditioned hamiltonian monte carlo in infinite dimensions. Stochastics and Partial Differential Equations: Analysis and Computations, 9:207–242, 2021. J. Certaine. The solution of ordinary differential equations with large time constants. Mathematical methods for digital computers, 1:128–132, 1960. H. Chen, H. Lee, and J. Lu. Improved analysis of score-based generative modeling: User-friendly bounds under minimal smoothness assumptions. arXiv preprint arXiv:2211.01916, 2022. S. Chen, S. Chewi, J. Li, Y. Li, A. Salim, and A. Zhang. Sampling is as easy as learning the score: theory for diffusion models with minimal data assumptions. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=zyLVMgsZ0U_. S. L. Cotter, G. O. Roberts, A. M. Stuart, and D. White. MCMC methods for functions: Modifying old algorithms to make them faster. Statistical Science, 28(3):424–446, 2013. doi: 10.1214/13-STS421. K. Cranmer, J. Brehmer, and G. Louppe. The frontier of simulation-based inference. Proceedings of the National Academy of Sciences, 117(48):30055–30062, 2020. T. Cui, K. J. Law, and Y. M. Marzouk. Dimension-independent likelihood-informed mcmc. Journal of Computational Physics, 304:109–137, 2016. G. Da Prato and J. Zabczyk. Stochastic equations in infinite dimensions. Cambridge university press, 2014. V. De Bortoli. Convergence of denoising diffusion models under the manifold hypothesis. arXiv preprint arXiv:2208.05314, 2022. P. Dhariwal and A. Nichol. Diffusion models beat GANs on image synthesis. Advances in Neural Information Processing Systems, 34, 2021. S. Duane, A. D. Kennedy, B. J. Pendleton, and D. Roweth. Hybrid monte carlo. Physics letters B, 195(2):216–222, 1987. R. Durrett. Probability: Theory and Examples. Probability: Theory & Examples. Duxbury Press, 3 edition, 2005. ISBN 0534424414; 9780534424411. H. F ̈ollmer and A. Wakolbinger. Time reversal of infinite-dimensional diffusions. Stochastic processes and their applications, 22(1):59–77, 1986. E. Gin ́e and R. Nickl. Mathematical Foundations of Infinite-Dimensional Statistical Models. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 2015. doi: 10.1017/CBO9781107337862. F. Guth, S. Coste, V. De Bortoli, and S. Mallat. Wavelet score-based generative modeling. arXiv preprint arXiv:2208.05003, 2022. P. Hagemann, L. Ruthotto, G. Steidl, and N. T. Yang. Multilevel diffusion: Infinite dimensional score-based diffusion models for image generation. arXiv preprint arXiv:2303.04772, 2023. M. Hairer. An introduction to stochastic PDEs. arXiv preprint arXiv:0907.4178, 2009. M. Hairer, A. M. Stuart, and S. J. Vollmer. Spectral gaps for a Metropolis–Hastings algorithm in infinite dimensions. Annals of Applied Probability, 2014. U. G. Haussmann and E. Pardoux. Time reversal of diffusions. The Annals of Probability, pages 1188–1205, 1986. J. Ho, A. Jain, and P. Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840–6851, 2020. 20 Infinite-Dimensional Diffusion Models A PREPRINT Z. Kadkhodaie and E. P. Simoncelli. Stochastic solutions for linear inverse problems using the prior implicit in a denoiser. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. W. Vaughan, editors, Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=x5hh6N9bUUb. I. Karatzas, I. Karatzas, S. Shreve, and S. E. Shreve. Brownian motion and stochastic calculus, volume 113. Springer Science & Business Media, 1991. K.-T. Kim, U. Villa, M. Parno, Y. Marzouk, O. Ghattas, and N. Petra. hippylib-muq: A bayesian inference soft- ware framework for integration of data with complex predictive models under uncertainty. ACM Transactions on Mathematical Software, 2023. Z. Kong, W. Ping, J. Huang, K. Zhao, and B. Catanzaro. DiffWave: A versatile diffusion model for audio synthesis. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=a-xFK8Ymz5J. H. Lee, J. Lu, and Y. Tan. Convergence for score-based generative modeling with polynomial complexity. In A. H. Oh, A. Agarwal, D. Belgrave, and K. Cho, editors, Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=dUSI4vFyMK. Z. Li, N. Kovachki, K. Azizzadenesheli, B. Liu, K. Bhattacharya, A. Stuart, and A. Anandkumar. Fourier neural operator for parametric partial differential equations. arXiv preprint arXiv:2010.08895, 2020. J. H. Lim, N. B. Kovachki, R. Baptista, C. Beckham, K. Azizzadenesheli, J. Kossaifi, V. Voleti, J. Song, K. Kreis, J. Kautz, et al. Score-based diffusion models in function space. arXiv preprint arXiv:2302.07400, 2023. E. Mathieu, V. Dutordoir, M. J. Hutchinson, V. De Bortoli, Y. W. Teh, and R. E. Turner. Geometric neural diffusion processes. arXiv preprint arXiv:2307.05431, 2023. A. Q. Nichol and P. Dhariwal. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, pages 8162–8171. PMLR, 2021. A. Phillips, T. Seror, M. Hutchinson, V. De Bortoli, A. Doucet, and E. Mathieu. Spectral diffusion processes. arXiv preprint arXiv:2209.14125, 2022. H. Phung, Q. Dao, and A. Tran. Wavelet diffusion models are fast and scalable image generators. arXiv preprint arXiv:2211.16152, 2022. J. Pidstrigach. Convergence of preconditioned Hamiltonian Monte Carlo on Hilbert spaces. IMA Journal of Numerical Analysis, page drac052, 10 2022a. ISSN 0272-4979. doi: 10.1093/imanum/drac052. URL https://doi.org/ 10.1093/imanum/drac052. J. Pidstrigach. Score-based generative models detect manifolds. arXiv preprint arXiv:2206.01018, 2022b. J. Sohl-Dickstein, E. Weiss, N. Maheswaranathan, and S. Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pages 2256–2265. PMLR, 2015. Y. Song and S. Ermon. Improved techniques for training score-based generative models. Advances in neural inform- ation processing systems, 33:12438–12448, 2020. Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon, and B. Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=PxTIG12RRHS. A. M. Stuart. Inverse problems: a Bayesian perspective. Acta numerica, 19:451–559, 2010. Y. Tashiro, J. Song, Y. Song, and S. Ermon. CSDI: Conditional score-based diffusion models for probabilistic time In A. Beygelzimer, Y. Dauphin, P. Liang, and J. W. Vaughan, editors, Advances in Neural series imputation. Information Processing Systems, 2021. URL https://openreview.net/forum?id=VzuIzbRDrum. A. B. Tsybakov. Introduction to Nonparametric Estimation. Springer series in statistics. Springer, Dordrecht, 2009. doi: 10.1007/b13794. URL https://cds.cern.ch/record/1315296. P. Vincent. A connection between score matching and denoising autoencoders. Neural computation, 23(7):1661–1674, 2011. K. Y. Yang and A. Wibisono. Convergence in KL and R ́enyi divergence of the unadjusted Langevin algorithm using estimated score. In NeurIPS 2022 Workshop on Score-Based Methods, 2022. URL https://openreview. net/forum?id=RSNMAMiPFTM. Q. Zhang and Y. Chen. Fast sampling of diffusion models with exponential integrator. In International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=Loek7hfb46P. 21 Infinite-Dimensional Diffusion Models A PREPRINT A Numerical details We list some implementation details: 1. Instead of running the forward SDE with a uniform speed, we instead ran it using a speed function α(t), dXt = − 1 2 β(t)Xtdt + (cid:112)β(t)CdWt. The SDE was then run on the interval [0, 1]. This corresponds to a time-change and is common practice for diffusion models; see for example Song et al. [2021]. We used the time-change function β(t) as in Song et al. [2021], i.e., β(t) = 0.001 + t(20 − 0.001). 2. We discretized the unit interval [0, 1] into M = 1000 evenly spaced points for training and generation. 3. We added a last denoising step, as is common practice. That means, that in the last step of the Euler- Maruyama integrator, we did not add any extra noise any more, but just evaluated the drift and took a step in that direction. This is even more important in our case for comparison than normally, since the added noise has correlation structure N (0, C) which is close to μdata, while the added noise in WNDM has structure N (0, I). Therefore, adding this noise to all samples right before comparing them would have given an unfair disadvantage to WNDM. 4. Furthermore, we added εregId onto the covariance matrices for numerical stability, where εreg = 0.0001. 5. Our experiments were implemented in JAX, and we used the U-Net architecture from Song et al. [2021] for the neural network. B Negative Sobolev Wasserstein distances We briefly and heuristically explore what it means if μ and π are close in W2 when the underlying norm is a negative Sobolev norm. Denote by H α the spaces defined in Section 8.1. Now let f ∈ H α. Assume that X, Y form a W −α 2 -optimal coupling, i.e., X ∼ μ and Y ∼ π and that E[∥X − Y ∥−α] ≤ W −α 2 (π, μ). Now, H −α can be viewed as the dual of H α and therefore we can evaluate X or Y on f . Then, E[|X(f ) − Y (f )|] ≤ ∥f ∥αE[∥X − Y ∥−α] ≤ ∥f ∥αW −α 2 (μ, π) Therefore, we can expect the evaluations of X and Y on test-functions from H α to be close. The larger α gets, the fewer test functions are in H α. Note that for any α ≥ 0 (and in particular for our typical case H 0 = L2), H α will not contain point evaluations, and therefore we cannot expect point evaluations of X and Y to be close (in case they are well-defined). C Exponential integrator The exponential integrator [Certaine, 1960] is derived by splitting the following SDE √ √ dYt = Yt + s(t, Yt)dt + CdWt = Yt + s(t, Yt)dt + CdWt (19) 1 2 1 2 into the linear and nonlinear part. The exact solution is then given by Yt+∆t = et/2Yt = et/2Yt + (e∆t/2 − 1)s(t, Yt) + (cid:112) e∆t − 1ξ. The exponential integrator was first applied to diffusion models in Zhang and Chen [2023]. D Proofs for Section 3 D.1 Proofs for Section 3.2 We first prove Lemma 1 22 Infinite-Dimensional Diffusion Models A PREPRINT Proof In finite dimensions we can explicitly write pt as (cid:90) pt(x) = pt|0(x|x0)dμdata(x0) (20) where pt|0 is the time t-transition kernel of the forward SDE, given by pt|0(x|x0) = 1 (cid:112)(2πvt)Ddet(C) (cid:18) exp − 1 2(1 − e−t) (cid:68)(cid:16) x − e− t 2 x0 (cid:17) , C −1 (cid:16) x − e− t 2 x0 (cid:17)(cid:69)2 (cid:19) H . We can exchange the derivative with the integral by Leibniz rule since the derivative of the integrand is bounded. Therefore, we have that ∇ log pt(x) = (cid:90) 1 pt(x) ∇x pt|0(x|x0)dμdata(x0) = − = − 1 (1 − e−t) 1 (1 − e−t) (cid:90) C −1 (cid:16) x − e− t 2 x0 (cid:17) pt|0(x|x0) pt(x) dμdata(x0) C −1 (cid:16) E (cid:104) Xt − e− t 2 X0|Xt = x (cid:105)(cid:17) . In the last equation we used the formula for the conditional density; see Durrett [2005, Section 4.1.c]. (cid:50) We now prove Lemma 2. Proof We first treat continuity. Since pt can be written as the convolution of μdata with a Gaussian kernel, we know that it is smooth in space and time on (0, ∞]. Furthermore, it holds that pt > 0 everywhere. Due to that, we can deduce that ∇ log pt = ∇pt is continuous in t. Since Xt is also continuous in time, we get that ∇ log pt(Xt) is pt time-continuous. Now we prove the reverse-time martingale property. Since we can write (cid:90) pt(xt) = ps(xs)pt|s(xt|xs)dxs and by using since the transition kernel pt|s(xt|xs) is given by N (e−(t−s)/2xs, ∇pt(xt) = ∇xt (cid:90) (cid:18) exp − 1 2(1 − e−(t−s)) 1 2(1 − e−(t−s)) − (cid:18) (t−s) e 2 ∇xs exp (cid:68) xt − e− (t−s) 2 xs, xt − e− (t−s) 2 xs ps(xs)dxs (cid:68) xt − e− (t−s) 2 xs, xt − e− (t−s) 2 xs (cid:69)(cid:19) ps(xs)dxs (t−s) 2 e (cid:18) exp − 1 2(1 − e−(t−s)) (cid:68) xt − e− (t−s) 2 xs, xt − e− (t−s) 2 xs (cid:69)(cid:19) ∇xsps(xs)dxs 1 1−e−(t−s) C), (cid:69)(cid:19) (cid:90) (cid:90) (cid:90) = = = (t−s) e 2 pt|s(xt|xs)ps(xs)∇xs log ps(xs)dxs (cid:90) ps,t(xs, xt)∇xs log ps(xs)dxs. = e (t−s) 2 Since ∇ log pt(xt) = ∇pt(xt) , we get that ∇ log pt(xt) = e ∇xs log ps(xs)dxs = e pt(xt) and ps|t(xs|xt) = ps,t(xs,xt) (cid:90) ps,t(xs, xt) pt(xt) (t−s) 2 pt(xt) = e (t−s) 2 E[∇ log ps(Xs)|Xt = xt]. (cid:90) (t−s) 2 ps|t(xs|xt)∇xs log ps(xs)dx (cid:50) The above calculations have already been done in Chen et al. [2022] to bound the difference E[∥∇ log pt(xt) − ∇ log ps(xs)∥2]. 23 Infinite-Dimensional Diffusion Models A PREPRINT D.2 Proofs for Section 3.4 We start by proving Lemma 3. Proof Let ei be a basis of K and K D = span⟨e1, . . . , eD⟩. We denote by P D the projection onto K D and by X D t = P DXt the projection of Xt onto K D. We will denote by ∥ * ∥ = ∥ * ∥K throughout this proof. Let sD = P DE[s(t, Xt)|X D t ] = E[σ−1 t (X D t − e−t/2X D t )|X D t ], where σ−1 t = 1√ 1−e−t . We have that E[∥sD∥2] ⩽ E[∥σ−1 t (X D t − e−t/2X D 0 )∥2] = σ−2 t E[∥N (0, P DCP D)∥2] < ∞ since the right hand side is the expectation of the norm of a finite dimensional Gaussian, which is finite. Let ̃sD(t, Xt) = P DE[ ̃s(t, Xt)|X D t ]. Now, E[∥sD − ̃sD∥2 K] = E[∥P D(E[ ̃s(t, Xt)|X D t ] − E[s(t, Xt)|X D t ])∥2] and Therefore, we get that ⩽ E[∥E[ ̃s(t, Xt) − s(t, Xt)|X D t ]∥2] ⩽ E[∥s(t, Xt) − ̃s(t, Xt)∥2] < ∞, E[∥ ̃sD∥2] ⩽ 2(E[∥sD − ̃sD∥2] + E[∥sD∥2]) < ∞. E[∥sD − ̃sD∥2] = E[∥sD∥2 + ∥ ̃sD∥ − ⟨sD, ̃sD⟩] = E[∥sD∥2] + E[∥ ̃sD∥] − 2E[⟨sD, ̃sD⟩], where we used that all the terms are finite in the last equality, so that we are no adding and subtracting infinities. Now, for and therefore, since E[∥X D (X D E[⟨sD, ̃sD⟩] = E[⟨E[σ−1 t t − e−t/2X D E[∥sD − ̃sD∥2] = E[∥ ̃sD − σ−1 0 )|X D t − e−t/2X D 0 ∥2] is finite we can do a zero-addition of E[∥X D t ], ̃sD⟩] = E[⟨σ−1 (X D t − e−t/2X D t 0 ∥2] and get that 0 ), ̃sD⟩], t − e−t/2X D (X D 0 )∥2]. By Lemma 5 we see that the left hand side converges to E[∥s − ̃s∥2]. Therefore we get that E[∥ ̃sD − σ−1 e−t/2X D 0 )∥2] + E[∥sD∥2] − E[∥σ−1 t − e−t/2X D t − e−t/2X D (X D t t t 0 )∥2] converges to something finite, if and only if E[∥sD∥2] − E[∥σ−1 (X D t − e−t/2X D 0 )∥2] t does. For this term we get that since E[⟨sD, σ−1 t we can deduce (X D t − e−t/2X D 0 )⟩] = E[⟨E[σ−1 = E[∥E[σ−1 = E[∥sD∥2], t t (X D (X D t − e−t/2X D t − e−t/2X D 0 )|X D 0 )|X D t ], σ−1 t t ]∥2] (X D t − e−t/2X D 0 )⟩] t − e−t/2X D (X D t t − e−t/2X D where the last convergence is implied by Proposition 5. The last result now follows by rewriting E[∥sD∥2] − E[∥σ−1 = −E[∥sD∥2] + 2E[⟨sD, σ−1 = −E[∥sD − σ−1 0 )∥2] 0 )⟩] − E[∥σ−1 t − e−t/2X D t 0 )∥2] →L2 −E[∥s − σ−1 t − e−t/2X D (X D (Xt − e−t/2X0)∥2] (X D (X D t t t 0 )∥2] Vt = E[∥E[σ−1 t (Xt − e−t/2X0)|Xt] − σ−1 t (Xt − e−t/2X0)∥2] and using that Xt can be pulled out of the conditional expectation. 24 (X D t − (cid:50) Infinite-Dimensional Diffusion Models A PREPRINT Now we prove Lemma 4: Proof Item 1: We know from Lemma 3 that DSM is finite if and only if V is finite. Therefore, we will prove that V is finite: Now, Vt = e−t 1 − e−t E[∥X0 − E[X0|Xt]∥2 U ] E[∥X0 − E[X0]∥2 U ] = E[∥X0 − E[X0|Xt] + E[X0|Xt] − E[X0]∥2 U ] = E[∥X0 − E[X0|Xt]∥2 = E[∥X0 − E[X0|Xt]∥2 U ] + E[∥E[X0|Xt] − E[X0]∥2 U ] + E[∥E[X0|Xt] − E[X0]∥2 U ] + E[⟨X0 − E[X0|Xt], E[X0|Xt] − E[X0]⟩U ] U ], where the last term drops by taking the conditional expectation with respect to Xt. Therefore, E[∥X0 − E[X0|Xt]∥2 U ] ⩽ E[∥X0 − E[X0]∥2 U ] < ∞ and so Vt is finite. Item 2: In this case we use that we can also write Vt as Vt = 1 1 − e−t E[∥Xt − e−t/2X0 − E[Xt − e−t/2X0|Xt]∥2 H ] Similarly as above, E[∥Xt − e−t/2X0 − E[Xt − e−t/2X0|Xt]∥2 H ] ⩽ E[∥Xt − e−t/2X0∥2 H ] where we used that E[Xt − e−t/2X0] = 0. Now, since Xt − e−t/2X0 ∼ N (0, (1 − e−t)C), which is supported on (cid:50) H, the above expectation is finite. We used the following lemma in the proofs of the two above lemmas: Lemma 5 Let (K, ⟨*, *⟩) be a separable Hilbert space, and Z, ̃Z random variables taking values in K. Let ei be an orthonormal basis of K. Denote by K D = span⟨e1, . . . , eD⟩ and by P D the projection onto K D. Furthermore, let Z D be given by Z D = P DE[Z|P D ̃Z]. Then, if E[∥E[Z| ̃Z]∥2 K] < ∞, Z D → E[Z| ̃Z] in L2 and almost surely. Proof We denote by We have that Z D = E[Z|P D ̃Z]. E[∥Z D − E[Z| ̃Z]∥2 K] = E[∥P D(E[Z| ̃Z D] − E[Z| ̃Z])∥2 ⩽ E[∥E[Z| ̃Z D] − E[Z| ̃Z]∥2 K] + E[∥(I − P D)E[Z| ̃Z]∥2 K] K] + E[∥(I − P D)E[Z| ̃Z]∥2 K] (21) The cross term in the first equality is 0 since P D is the orthogonal projection. The first term in the (21) converges to 0, since E[Z| ̃Z D] = E[E[Z| ̃Z]| ̃Z D] is a family of conditional expectations of the L2-random variable E[Z| ̃Z]. The result follows by the L2-martingale convergence theorem. The second term converges to 0 since E[∥E[Z| ̃Z]∥2 K] = ∞ (cid:88) E[⟨ei, E[Z| ̃Z]⟩2 K] < ∞. But E[∥(I − P D)E[Z| ̃Z]∥2 K] is equal to (cid:80)∞ d=D d=1 E[⟨ei, E[Z| ̃Z]⟩2 K], which converges to 0 since the full sum is finite. Furthermore, we can write ∥Z D − E[Z| ̃Z]∥K ⩽ ∥P D(E[Z| ̃Z D] − E[Z| ̃Z])∥2 K + ∥(I − P D)E[Z| ̃Z]∥2 K ⩽ ∥E[Z| ̃Z D] − E[Z| ̃Z]∥2 K + ∥(I − P D)E[Z| ̃Z]∥2 K The second term on the right-hand vanishes as D → ∞ since E[Z| ̃Z] ∈ K. The first term almost surely converges to (cid:50) 0 due to the almost sure martingale convergence theorem. 25 Infinite-Dimensional Diffusion Models A PREPRINT E Existence proof E.1 Spectral approximation of C Let ν = N (0, C) be a Gaussian measure with values in (H, ⟨*, *⟩H ). C has an orthonormal basis ei of eigenvectors and corresponding non-negative eigenvalues ci ⩾ 0, i.e., We define the linear span of the first D eigenvectors as Cei = ciei. H D = (cid:40) D (cid:88) i=1 fiei|f1, . . . , fD ∈ R ⊂ H (cid:41) Let P D : H → H D be the orthogonal projection onto H D. If we write an element f of H as ∞ (cid:88) ⟨f, φi⟩H φi, f = i=1 P D is equivalent to restricting f to its first D coefficients: P D : H → H D, f (cid:55)→ D (cid:88) ⟨f, φi⟩H φi. i=1 The push-forwards (P D)∗ν of ν under P D are denoted by νD := (P D)∗ν, where (P D)∗ν(A) = ν((P D)−1(A)). It is a Gaussian measure with covariance operator P DCP D. By sending v ∈ RD to ˆv = v1e1 + * * * + vDeD we can identify H D with RD. Under these identifications, νD would have distribution N (0, C D) on RD, where CD is a diagonal matrix with entries c1, . . . , cD. E.2 Spectral approximation of the SDEs We define the finite-dimensional approximations of μdata by μD (5) by data = (P D)∗μdata. We discretize the forward SDE dX D t = − √ 1 2 X D t dt + P DCP DdWt, X D 0 ∼ μD data (22) Since μdata is supported on H D, P DCP D projects the noise down to H D, and the operation Xt → − 1 invariant, X D densities pD t will stay in H D for all times. Therefore we can view X D t of X D t 2 Xt keeps H D t as process on RD and define the Lebesgue there. The corresponding reverse SDEs is given as dY D t = − 1 2 t dt + C D∇ log pD Y D t (Yt)dt + √ P DCP DdWt. (23) E.3 Proof of Theorem 1 We can now prove Theorem 1: Proof The forward SDE is just a standard Ornstein–Uhlenbeck process and existence and uniqueness of that is standard; see, for example, Da Prato and Zabczyk [2014, Theorem 7.4]. We will now show that the time reversal is a solution to (6). The solution to the forward SDE is given as the stochastic convolution, Yt := XT −t Xt = e−tX0 + √ e−(t−s) CdWs. (cid:90) t 0 26 Infinite-Dimensional Diffusion Models A PREPRINT The processes X D t now show that they converge to Xt almost surely in the supremum norm. We define := P D(Xt) (see Section E.1) are solutions to (22), since the SDE coefficients are decoupled. We Then X D:∞ t = Xt − X D t . X D:∞ t = e−tX D:∞ 0 + √ e−(t−s) CdW D:∞ s , (cid:90) t 0 where W D:∞ s is the projection of Ws onto span{eD, eD+1 . . .}. It holds that E[sup t⩽T ∥X D:∞ t H ] ⩽ 4e−2tE[∥X D:∞ ∥2 0 H ] + 4(1 − e−t) ∥2 ∞ (cid:88) i=D ci → 0 0 H = (cid:80)∞ H = (cid:80)∞ ∥2 for D → ∞, where we used Doob's L2 inequality to bound the stochastic integral. The first term will converge to 0 almost surely, since X0 is H-valued and therefore the sum ∥X0∥2 i=1⟨X0, φi⟩2 is almost surely finite, where the φi are defined in Section E.1. Therefore, ∥X D:∞ i=D⟨X0, φi⟩2 will almost surely converge to zero. An analogous argumentation holds for the second term since (cid:80)∞ Denote by E the Banach space of continuous, H-valued paths with the supremum norm, E = C([0, T ], H). Then we can view X* as an E-valued random variable; see Da Prato and Zabczyk [2014, Theorem 4.12]. Then we have just proven that X N converges to X in L2(Ω, E). t by Y N We denote the time-reversals of X N t Yt = XT −t in the same way as X N using an approximation argument. We define pD T −t. We know that they satisfy (23) by Proposition 1. Furthermore, by Lemma 1, we know that we can replace the C∇ log pt term by a conditional expectation sD, T −t. These converge to their infinite-dimensional counterpart t converge to Xt. The main difficulty is to show Yt solves the SDE (6). We do this t as in Section E.2. Furthermore, we define the finite-dimensional time reversals of X D i=1 ci is finite because C is trace-class on H. t = X D t as Y D := X N sD(t, xD) = 1 1 − e−t E[X D t − e− t 2 X D 0 |X D t = xD]. However, since the forward SDE decouples, we can also write the above conditional expectation in terms of the infinite-dimensional process Xt: sD(t, xD) = 1 1 − e−t P DE (cid:104) Xt − e− t 2 X0|P DXt = xD(cid:105) , where we use that the projections P DXt are solutions to (22). In particular, due to the tower property of conditional expectations, t = sD(t, X D sD By Lemma 5, which makes use of the fact that E[s(t, Xt)|P DXt] is a martingale in D, the sD L2. Furthermore, by Lemma 2, we know that the e−t/2sD t L2-inequality, we get that for any ε > 0, t ) = P DE[s(t, Xt)|X D t ]. t converge to s(t, Xt) in form a reverse-time martingale. However, due to Doob's E[ sup ε⩽t⩽T ∥sD t − sL t ∥2] ⩽ eT E[∥sD ε − sL ε ∥2]. The right hand side is Cauchy and therefore is the left-hand side is too. Therefore, the convergence of sD t is uniform on [ε, T ], i.e., continuous martingales sD t form a Cauchy sequence in the norm to st in L2 ∥N ∥I,ε = E[sup t≥ε |Nt|2]. The continuous martingales are closed with respect to that norm (see Karatzas et al. [1991, Section 1.3]), and st is also a continuous martingale on [ε, T ]. Since ε was arbitrary, we have shown that s(t, Xt) is a continuous local martingale (in reverse time) up to t = 0. By Proposition 1, for t < T , Y D T −t solves the equation t = X D t − Y D Y D 0 − 1 2 (cid:90) t 0 Y D r dr − (cid:90) t 0 T −rdr = BD sD t , 27 Infinite-Dimensional Diffusion Models A PREPRINT for a D-dimensional Brownian motion BD t . Furthermore, since all the terms on the left-hand side converge in L2, uniformly in t, so does the right-hand side. The right-hand side is P DCP D Brownian motion for each D. Using again the that the spaces of martingales is closed and furthermore the Levy characterization of Brownian motion, we find that the BD t have to converge to a C-Brownian motion Bt. Therefore, and Y is indeed a weak solution to (6). (cid:50) Yt = Y0 + 1 2 (cid:90) t 0 Yrdr + (cid:90) t 0 sT −rdr + Bt Proposition 1 Assume H = RD. Then, the time-reversal Yt = XT −t of the SDE (4) satisfies the SDE dYt = 1 2 Ytdt + C∇ log pt(Yt)dt + √ CdWt. Proof The above is nothing more than the usual time-reversal formula. All we need to show is that for the special case of the forward SDE (4) the conditions from Haussmann and Pardoux [1986] are always satisfied. Assumption (A)(i) in Haussmann and Pardoux [1986] is satisfied since b and σ are linear. Assumption (A)(ii) is that for each t0 > 0, it holds that 1. (cid:82) T t0 2. (cid:82) T t0 (cid:82) BR (cid:82) BR |p(t, x)|2dx < ∞, and |∂xip(t, x)|2dx < ∞ for all im where BR is the ball of Radius R on RD and p(t, x) is the Lebesgue-density of Pt. We now prove that both of these conditions hold. We have the explicit formula p(t, x) = 1 (cid:112)2π(vt det C)D √ 1 2π(vt det C)D (cid:90) ∥x−x0∥2 U 2 e− dμdata(x0) . Since 1 vt = 1 1−e−t is integrable on [t0, T ] for t0 > 0, this and therefore, in particular |p(t, x)| ⩽ implies 1. Furthermore, we get that ∇p(t, x) = 1 (cid:112)2π(vt det C)D (cid:90) C −1xe− ∥x−x0∥2 U 2 dμdata(x0), where we used the Leibniz rule to exchange differentiation and integration, since the integrand is bounded in x0. On (cid:50) BR this can be upper bounded by ∥∇p(t, x)∥ ⩽ which is again integrable on [t0,T ]. √ ∥C−1∥R 2π(vt det C)D F Uniqueness proofs F.1 Proof of Theorem 2 First we prove Theorem 2: Proof Step 1: Prove that s is locally Lipschitz with respect to the Cameron-Martin Norm Recall that e− t 1 − e−t 1−e−t x term is Lipschitz for any t ∈ [ε, T ]. Therefore, our goal is to show that E[X0|Xt = x] is Lipschitz in x The − 1 too. We will frequently use that for u ∈ U , we can write the Radon-Nikodym derivative of N (u, vtC) with respect to N (0, vtC) as 1 − e−t x + E[X0|Xt = x]. s(t, x) = − (24) 1 2 dN (u, vtC) dN (0, vtC) (xt) = exp (cid:18) ⟨u, xt⟩U − ∥u∥2 vt U (cid:19) , 28 Infinite-Dimensional Diffusion Models A PREPRINT by the Cameron-Martin theorem (see, for example, Hairer [2009]). Here vt is a shorthand notation for To simplify notation, we will define vt = 1 − e−t. n(x0, xt) := dN (e−tx0, vtC) dN (0, vtC) (xt). Then, the joint distribution of X0 and Xt is given by dn(x0, xt) = d(N (0, vtC)(xt) ⊗ μdata(x0)). This can be seen by the following calculation: (cid:90) (cid:90) A (cid:90) B (cid:90) A (cid:90) B (cid:90) A B = = n(x0, xt) dN (0, vtC)(xt)dμdata(x0) dN (e−tx0, vtC) dN (0, vtC) (xt)dN (0, vtC)(xt)dμdata(x0) dN (e−tx0, vtC)(xt)dμdata(x0) =P[X0 ∈ A, Xt ∈ B], where we used that N (e−tx0, vtC) is the transition kernel of the forward SDE (5). We show that f (xt) = (cid:82) x0n(x0, xt)dμdata(x0) (cid:82) n(x0, xt)dμdata(x0) is a version of the conditional expectation E[X0|Xt = x]. The function f is σ(Xt) measurable by Fubini's theorem. Furthermore, for A ∈ σ(Xt), EXt[1Af (Xt)] = = = = (cid:90) (cid:82) A (cid:90) (cid:90) H (cid:90) (cid:90) A (cid:90) (cid:90) dPt(xt) H x0n(x0, xt)dμdata(x0) (cid:82) H n(x0, xt)dμdata(x0) (cid:82) H x0n(x0, xt)dμdata(x0) (cid:82) H n(x0, xt)dμdata(x0) (cid:82) H n( ̃x0, xt)dμdata( ̃x0) (cid:82) H n(x0, xt)dμdata(x0) x0n(x0, xt)dμdata(x0) A H n( ̃x0, xt) dN (0, vtC)(xt) dμdata( ̃x0) dN (0, vtC)(xt) x0n(x0, xt)dμdata(x0) dN (0, vtC)(xt) = E[1AX0]. Since these two properties define the conditional expectation, we have shown that A H E[X0|Xt = x] = f (x) almost surely. We will now proceed to show that f is Lipschitz with respect to the Cameron-Martin norm ∥ * ∥U . For notational convenience, we will define (cid:90) πt(xt) = n(x0, xt)dμdata(x0) = (cid:90) exp (cid:18) 2⟨e−t/2x0, xt⟩U − e−t∥x0∥2 2vt U (cid:19) dμdata(x0). (25) We see that πt(xt + z) = = (cid:90) (cid:90) exp exp (cid:18) 2⟨e−t/2x0, xt + z⟩U − e−t∥x0∥2 2vt (cid:19) U (cid:19) dμdata(x0) (26) n(x0, xt) dμdata(x0), which differs from (25) only by exp Cameron-Martin ball of size R. Therefore, . By our assumption that the support of μdata is contained in a (cid:18) ⟨e−t/2x0, z⟩U vt (cid:17) (cid:16) ⟨e−t/2x0,z⟩U vt ⟨z, e−t/2x0⟩U vt ≤ e−t/2 vt ∥z∥U R, 29 (27) Infinite-Dimensional Diffusion Models A PREPRINT and (cid:18) exp −R∥z∥U (cid:19) ≤ e−t/2 vt πt(xt + z) πt(xt) (cid:18) ≤ exp R∥z∥U (cid:19) . e−t/2 vt (28) With these estimates out of the way, let us show local Lipschitz continuity: ∥f (xt + z) − f (xt)∥U = =: (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:82) x0 n(x0, xt + z)dμdata(x0) πt(xt + z) − A′ πt(xt + z) − A πt(xt) (cid:13) (cid:13) (cid:13) (cid:13)U . (cid:82) x0 n(x0, xt)dμdata(x0) πt(xt) (cid:13) (cid:13) (cid:13) (cid:13)U We rewrite the above as A′ πt(xt + z) (cid:13) (cid:13) (cid:13) (cid:13) We see that − A πt(xt) (cid:13) (cid:13) (cid:13) (cid:13)U ≤ (cid:12) (cid:12) (cid:12) (cid:12) 1 − πt(xt + z) πt(xt) (cid:12) (cid:12) (cid:12) (cid:12) (cid:13) (cid:13) (cid:13) (cid:13) A′ πt(xt + z) (cid:13) (cid:13) (cid:13) (cid:13)U + 1 πt(xt) ∥A′ − A∥U . (cid:12) (cid:12) 1 − (cid:12) (cid:12) πt(xt) πt(xt) (cid:12) (cid:12) (cid:12) (cid:12) (cid:13) (cid:13) (cid:13) (cid:13) A′ πt(xt + z) (cid:13) (cid:13) (cid:13) (cid:13)U (cid:18) ≤ exp (cid:18) e−t/2 vt (cid:19) (cid:19) ∥z∥U R − 1 ∥E[X0|Xt = xt + z]∥U , where we used (28) for the first term. We also get that ∥A − A′∥U πt(xt) (cid:18) ≤ exp (cid:18) ≤ exp (cid:18) e−t/2 vt (cid:18) e−t/2 vt ∥z∥U R (cid:19) (cid:19) (cid:19) 1 − 1 pt(xt) (cid:90) ∥x0∥U dN (e−t/2x0, vtC) dN (0, vtC) (xt)dμdata(x0) (cid:19) ∥z∥U R − 1 R where we used (27) and (26) and our assumption that ∥x0∥U ≤ R. Putting it all together, we get that ∥f (xt + z) − f (xt)∥ ≤ 2 exp (cid:18) (cid:18) e−t/2 vt (cid:19) (cid:19) ∥z∥U R − 1 R, where we again used that ∥x0∥ ≤ R to bound f (xt + z). However, we can strengthen this bound. For any N , it holds that ∥f (xt + z) − f (xt)∥U ≤ N (cid:88) i=1 ∥f (xt + z ) − f (xt + z i − 1 N )∥U (cid:18) ≤ N 2 exp (cid:19) (cid:19) R − 1 R. ∥z∥U N i N (cid:18) e−t/2 vt In particular, we can take the limit N → ∞ and get that ∥f (xt + z) − f (xt)∥U ≤ (cid:18) |h=02 exp d dh (cid:18) e−t/2 vt (cid:19) (cid:19) h∥z∥U R − 1 R = 2R2 e−t/2 vt ∥z∥U . From this we can conclude that f has the global Lipschitz constant 2R2 e−t/2 vt of s(t, *), such that for any xt, yt ∈ H . From (24) we see that there is a version ∥s(t, xt) − s(t, yt)∥U ≤ Lt∥xt − yt∥U , Lt = 1 (1 − e−t)2 max{1, 2R2e−t}. Step 2: Existence of solutions Fix a C-Wiener process Wt. Denote by M : C([0, T − u], H) → C([0, T − u]) the map (cid:90) t (M y)(t) = s(T − r, yr)dr + Wt. Then we have if u < T − ε, 0 ∥M y(t) − M ̃y(t)∥U ⩽ sup t⩽u (cid:90) u 0 ∥s(T − r, yr) − s(T − r, ̃yr)∥U dr ⩽ uLT −ε sup t⩽u ∥yt − ̃yt∥U . (29) 30 Infinite-Dimensional Diffusion Models A PREPRINT Here we used that we can apply Jensen's inequality because ∥ * ∥U : H → [0, ∞] is lower-semicontinuous on H; 1 . Starting with any y0, we can now define the sequence see Proposition 2. We now choose u smaller than LT −ε u yn+1 = M yn. Applying (29) and noting that < 1, we see that yn is Cauchy with respect to sup ∥ * ∥U and LT −ε therefore also with respect to sup ∥ * ∥H and has a limit. We then have a strong solution w.r.t. to the fixed Wiener process Wt on [0, u]. We can extend the solution to [0, T − ε] by repeating this process and gluing the solutions together. However, we cannot apply Banach's fix point theorem to get uniqueness, since ∥y − ̃y∥U might be infinite for two solutions y and ̃y. Step 3: Strong uniqueness of solutions We now assume we have two solutions to the reverse SDE, Yt and ̃Yt solving the reverse SDE (6) with respect to the same Wiener process Bt and Y0 = ̃Y0. Since Yt and ̃Yt are not necessarily in U , we have to be a bit careful before directly applying Gr ̈onwall. Again, in Proposition 2 we have proven that ∥ * ∥U : H → [0, ∞] is lower-semicontinuous on H. Therefore, we can apply Jensen's inequality to get that ∥Yt − ̃Yt − (Yτ − ̃Yτ )∥U =∥ (cid:90) t s(T − r, Yr) − s(T − r, ̃Yr)dr∥U τ (cid:90) t τ ⩽ ∥s(T − r, Yr) − s(T − r, ̃Yr)∥U dr ⩽ 2(t − τ )R. This proves that t (cid:55)→ ∥Yt − ̃Yt∥U is continuous (which is a requirement for Gr ̈onwall). Furthermore, by using the above calculation for τ = 0, we find that ∥Yt − ̃Yt∥U will be finite for all t, if ∥Y0 − ̃Y0∥U is finite (even though if Yt and ̃Yt are almost surely not in U ). Now, since Y0 = ̃Y0 and therefore ∥Y0 − ̃Y0∥U = 0, ∥Yt − ̃Yt∥U ⩽ (cid:90) t 0 ∥s(T − r, Yr) − s(T − r, ̃Yr)∥U dr ⩽ (cid:90) t 0 T −r∥Yt − ̃Yt∥U dr. L2 If t < T , the Lipschitz constant LT −t is finite. Therefore, we can apply Gr ̈onwall to see that ∥Yt − ̃Yt∥U = 0 to prove uniqueness on [0, t] for any t < T . Hence, we have shown that there is a unique strong solution on [0, T − ε]. Since ε (cid:50) was arbitrary, we have shown strong uniqueness on [0, T ). F.2 Proof of Theorem 3 Now we prove Theorem 3: Proof Step 0: A priori bounds Let H be any Hilbert space on which N (0, Cμ) is supported. Let ei be an eigenbasis von Cμ and C, which exists by our assumptions. Let ci and μi be the eigenvalues associated with C and Cμ respectively, i.e., Cei = ciei, Cμei = μiei. Furthermore, we define Ct by Ct = (e−tCμ + (1 − e−t)C), (30) which would be the covariance of Xt at time t in case Φ = 0. The following operators are all bounded: CμC −1 , CC −1 and CCtC −1 μ . We will show it for the first operator, and the others follow by similar arguments. The first t operator will have eigenvalues t λi = μi e−tci + (1 − e−t)μi . We know that μi → 0 since Cμ is trace class. For ci → 0, the eigenvalues converge to λi → 1 (1−e−t) , while as ci → ∞, we get that λi → 0. Furthermore, the derivative with respect to ci is negative, which shows that the λi are bounded by 1−e−t . A similar calculation can be done for the other operators listed. 1 Step 1: Rewrite the reverse SDE The goal of this section is to show that we can write the drift in infinite dimensions as s(t, xt) = −e t 2 E[C(CμC −1 t )−1∇Φ(X0)|Xt = xt] + CC −1 t xt 31 Infinite-Dimensional Diffusion Models A PREPRINT without assuming any more conditions on Φ or ∇Φ. To that end, we will argue in finite dimensions and take the limit in the end. Henceforth, unless we say otherwise, everything will be in finite dimensions for this step. The projection of μdata to H D will be defined by data = exp(−ΦD)N (0, C D μD μ ), where C D μ is defined as in Section E.1 and exp(−ΦD(xD)) = EN (0,C)[exp(−Φ(X))|X D = xD] (cid:90) = exp(−Φ(xD, xD+1:∞)) dN (0, C D+1:∞)(xD+1:∞) For the gradient it will then hold that ∇ΦD(xD) = ∇ log exp(ΦD(xD)) (cid:82) ∇xD exp(−Φ(xD, xD+1:∞)) dN (0, C D+1:∞)(xD+1:∞) (cid:82) exp(−Φ(xD, xD+1:∞)) dN (0, C D+1:∞)(xD+1:∞) − (cid:82) ∇xD Φ(xD, xD+1:∞) exp(−Φ(xD, xD+1:∞)) dN (0, C D+1:∞)(xD+1:∞) (cid:82) exp(−Φ(xD, xD+1:∞)) dN (0, C D+1:∞)(xD+1:∞) = = = Eμdata[∇Φ(x)|X D = xD]. We denote by ( ̃Xt : 0 ≤ t ≤ T ) the Gaussian solution, started in ̃X0 ∼ N (0, C) and as always by (Xt : 0 ≤ t ≤ T ) the solution to the forward process started in X0 ∼ μdata. To be precise, (cid:18) ̃X0 ̃Xt (cid:19) (cid:18) ∼ N 0, (cid:18) Cμ e− t 2 Cμ e− t 2 Cμ Ct (cid:19)(cid:19) , where Ct is defined in (30). Therefore, ̃X0| ̃Xt ∼ N (cid:16) Then we have that e− t 2 CμC −1 t ̃Xt, Cμ − e−tCμC −1 t Cμ (cid:17) . dpt dN (0, Ct) (x) = E[exp(−Φ( ̃X0))| ̃Xt = x] = E N (cid:16) We denote by e− t 2 CμC−1 t x,Cμ−e−tCμC−1 t Cμ (cid:17)[exp(−Φ( ̃X0))]. (31) At = e− t 2 CμC −1 t , Qt = Cμ − e−tCμC −1 t Cμ. Note that for C = Cμ all of the definitions simplify to easier terms. Taking ∇ log of the above leads to ∇xt dpt dN (0, Ct) (xt) = = = 1 Z 1 Z 1 Z = − (cid:90) (cid:90) (cid:90) ∇xt exp(−∥Atx0 − xt∥2 Qt ) exp(−Φ(x0))dx0 −A−1 t ∇x0 exp(−∥Atx0 − xt∥2 Qt ) exp(−Φ(x0))dx0 A−1 t exp(−∥Atx0 − xt∥2 Qt )∇x0 exp(−Φ(x0))dx0 (cid:90) 1 Z A−1 t exp(−∥Atx0 − xt∥2 Qt )∇x0 Φ(x0) exp(−Φ(x0))dx0, where B is the normalizing constant. Therefore, C∇xt log dpt dN (0, Ct) (xt) = = − (cid:82) CA−1 t exp(−∥Atx0 − xt∥2 Qt (cid:82) exp(−∥Atx0 − xt∥2 Qt )∇x0Φ(x0) exp(−Φ(x0))dx0 ) exp(−Φ(x0))dx0 (cid:82) CA−1 t ∇Φ(x) exp(−Φ(x))dN (Atxt, Qt) (cid:82) exp(Φ(x))dN (Atxt, Qt) t ∇Φ(X0)|Xt = xt]. = E[−CA−1 32 Infinite-Dimensional Diffusion Models A PREPRINT We make the dimension dependence explicit and get that C∇xD t log dpD t dN (0, C D t ) Furthermore, (xD t ) = E[−C D(A−1 t )D∇ΦD(X D 0 )|X D t = xD t ] = E[−C D(A−1 = E[−C D(A−1 = P DE[−CA−1 t )DE[P D∇Φ(X0)|X D t = xD 0 ]|X D t ] t = xD t )DP D∇Φ(X0)|X D t ] t = xD t ∇Φ(X0)|X D t ]. sD(t, X D t ) = C∇ log pD t (xD t ) =C∇ log pD t (xD t ) N (0, Ct) + C∇ log N (0, Ct)(xD t ) =P DE[−CA−1 t ∇Φ(X0)|X D t = xD t ] + C D(C −1 t )DxD t . (32) By Lemma 5 sD converges almost surely to s. Furthermore, since CA−1 get that t is bounded and ∇Φ(X0) is Lipschitz, we E[∥E[CA−1 t ∇ log Φ(X0)|Xt]∥2] ≲ E[∥∇ log Φ(X0)∥2] ≲ E[∥X0∥2] < ∞. Therefore, also the first term in (32) converges to its infinite dimensional counterpart by Lemma 5. The second term in (32) also converges. Therefore, we can take the limit on both sides and obtain s(t, xt) = E[−CA−1 t ∇Φ(X0)|Xt = xt] + CC −1 t xt. The formula (31) for pt holds in infinite dimensions too, and therefore we can write the conditional expectation as f (t, xt) = E[−CA−1 t ∇Φ( ̃X0)| ̃Xt = xt] = (cid:82) CA−1 t ∇Φ(x) exp(−Φ(x))dN (Atxt, Qt) (cid:82) exp(−Φ(x))dN (Atxt, Qt) . Step 2: Local Lipschitzness in with respect to ∥ * ∥ Since CC −1 locally Lipschitz. We will now bound the difference t is bounded by step 0, it suffices to show that f is f (t, yt) − f (t, xt) (cid:82) CA−1 = =: t ∇Φ(x) exp(−Φ(x))dN (Atxt, Qt) (cid:82) exp(−Φ(x))dN (Atxt, Qt) 1 1 B2 Z1 Z2 Z2 (cid:18) 1 Z1 B2 − = − (cid:19) B1 Z1 − (B1 − B2) = − (cid:82) CA−1 t ∇Φ(x) exp(−Φ(x))dN (Atyt, Qt) (cid:82) exp(−Φ(x))dN (Atyt, Qt) (cid:19) (cid:18) Z1 − Z2 Z1Z2 B2 − 1 Z1 (B1 − B2). We will fix an R ⩾ 0 and assume that ∥xt∥, ∥yt∥ ⩽ R. Then, since At is bounded, there exists an ̃R such that ∥Atxt∥, ∥Atyt∥ ⩽ ̃R. Then exp(−Φ(x))dN (Atxt, Qt)(x) = (cid:90) exp(−Φ(x + Atxt))dN (0, Qt)(x) (cid:90) (cid:90) Z1 = ⩾ exp(−(E1 + E2∥x + Atxt∥2))dN (0, Qt)(x) (cid:90) = exp(−E1 + 2∥Atxt∥2) exp(−E2∥x∥2)dN (0, Qt)(x) ≳ E exp(−2∥Atx∥2) ⩾ E exp(−2 ̃R2) where E is a finite constant that only depends on Cμ, C, L and the Ei. A similar bound holds for Z2. For Z1 − Z2 = ⩽ (cid:90) (cid:90) exp(−Φ(x + Atxt)) − exp(−Φ(x + Atyt))dN (0, Qt)(x) exp(−E0)L∥Atxt − Atyt∥dN (0, Qt)(x) = exp(−E0)L∥Atxt − Atyt∥ ⩽ EL∥xt − yt, ∥ 33 Infinite-Dimensional Diffusion Models A PREPRINT where we used that if Φ is C 1 and its derivative is bounded by L, then exp(−Φ) has a derivative bounded by exp(− inf Φ)L. Furthermore, we get that (cid:90) CA−1 t ∇Φ(x) exp(−Φ(x))dN (Atxt, Qt) ⩽ exp(−E0) ⩽ exp(−E0) (cid:90) (cid:90) CA−1 t ∇Φ(x + Atxt)dN (0, Qt) ∥CA−1 t ∥(∥∇Φ(0)∥ + L∥x + Atxt∥)dN (0, Qt) (cid:18) (cid:90) ∥∇Φ(0)∥ + L∥Atxt∥ + L ∥x∥dN (0, Qt) (cid:19) ⩽ exp(−E0)∥CA−1 t ∥ ⩽ E(1 + ∥xt∥) ⩽ E(1 + R), where we used that CA−1 t and At are bounded. We also get that ∥B1 − B2∥ (cid:90) ∥CA−1 t ∇Φ(x + Atxt)∥| exp(−Φ(x + Atxt)) − exp(−Φ(x + Atyt))|dN (0, Qt)(x) = (cid:90) + ∥CA−1 t ∇Φ(x + Atyt) − CA−1 (cid:18) t ∇Φ(x + Atxt)∥ exp(−Φ(x + Atyt))dN (0, Qt)(x) (cid:19)(cid:19) (cid:18) (cid:90) ⩽ exp(−E0)L∥Atxt − Atyt∥∥CA−1 t ∥ ∥∇Φ(0)∥ + L ∥Atxt∥ + ∥x∥dN (0, Qt)(x) +L∥CA−1 t ∥∥Atxt − Atyt∥ exp(−E0) ⩽ E∥xt − yt∥(1 + R), where we again used the boundedness of CA−1 t and At. Putting it all together, we get that (cid:13) (cid:13) (cid:13) (cid:13) C∇ log dpt dN (0, Ct) (xt) − C∇ log dpt dN (0, Ct) (yt) (cid:13) (cid:13) (cid:13) (cid:13) ⩽ E exp(4 ̃R2)L∥xt − yt∥ + E exp(2 ̃R)∥xt − yt∥(1 + R) ⩽ E exp(4 ̃R2)∥xt − yt∥. Step 3: Strong uniqueness and existence Using the local Lipschitzness, we apply Gr ̈onwall to obtain strong unique- ness of solutions. This is a standard argument and similar to what we did in Step 3 of the proof of Theorem 3. Alternatively, see, for example, Karatzas et al. [1991, Theorem 2.5 in Section 5.2.B]. We can now prove weak existence of the reverse SDE. By Theorem 1, the time reversal will be a weak solution with initial condition PT . Denote the path measure of Y by Q. Under the assumptions of the Theorem, N (0, C) will be absolutely continuous with respect to pT . We define ̃Q by d ̃Q dQ (y[0,T ]) = dN (0, C) dPT (y0). ̃Q is then the path measure of a solution ̃Y to 6 which has initial condition N (0, C), therefore we have constructed a weak solution. With that we conclude the proof since, weak existence together with strong uniqueness imply strong existence, see Karatzas et al. [1991, Section 5.3]. (cid:50) G Wasserstein-bound proof We now prove Theorem 4: Proof We prove the theorem with the finite-dimensional notation, but one can replace ∇ log pt by s(t, *) and nothing changes. We will partition [0, T ] into τ = {0 = t0, . . . , tN = T }. For the given partition we denote ⌊t⌋ = max ti∈τ {ti ⩽ t}, ⌈t⌉ = min ti∈τ {ti ⩾ t}, ∆ = max tk+1 − tk. k=0,...,N −1 34 Infinite-Dimensional Diffusion Models A PREPRINT We couple two strong solutions of Yt and ̃Yt for the same Brownian motion Bt. These strong solutions exist because of the assumptions of the theorem and Theorem 2 or Theorem 3. The difference between Yt and ̃Yt can be bounded as follows: d∥Yt − ̃Yt∥ = 1 2 ⩽ 1 2 ∥Yt − ̃Yt∥ + 1 ∥Yt − ̃Yt∥ ⟨Yt − ̃Yt, C∇ log pT −t(Yt) − ̃s(T − ⌊t⌋, ̃Y⌊t⌋)⟩ ∥Yt − ̃Yt∥ + ∥C∇ log pT −t(Yt) − sθ(T − t, ̃Y⌊t⌋)∥. We bound ∥C∇ log pT −t(Yt) − ̃s(T − t, ̃Yt)∥ ⩽ ∥C∇ log pT −t(Yt) − C∇ log pT −⌊t⌋(Y⌊t⌋)∥ +∥C∇ log pT −⌊t⌋(Y⌊t⌋) − ̃s(⌊t⌋, Y⌊t⌋)∥ + ∥ ̃s(⌊t⌋, Y⌊t⌋) − ̃s(⌊t⌋, ̃Y⌊t⌋)∥ ⩽ ∥∇U log pT −t(Yt) − ∇U log pT −⌊t⌋(Y⌊t⌋)∥ +∥C∇ log pT −⌊t⌋(Y⌊t⌋) − ̃s(⌊t⌋, Y⌊t⌋)∥ + Ls∥Y⌊t⌋ − ̃Y⌊t⌋∥. We take the supremum to get rid of the delay term ∥Y⌊t⌋ − ̃Y⌊t⌋∥ and obtain ∥Yr − ̃Yr∥ ⩽ L′ s sup τ ⩽s ∥Yr − ̃Yr∥dt + (cid:90) s 0 ∥∇U log pT −t(Yt) − ∇U log pT −⌊t⌋(Y⌊t⌋)∥dt (cid:90) s sup r⩽t 0 (cid:90) (cid:13) (cid:13) (cid:13)∇U log + pT −⌊t⌋ ν (Y⌊t⌋) − ̃s(⌊t⌋, Y⌊t⌋) (cid:13) (cid:13) (cid:13) dt, where L′ s = L + 1 2 . Squaring the above expression and taking expectations, we arrive at ∥Yr − ̃Yr∥2] E[sup τ ⩽s 2 (cid:90) s ≲ L′ s E[sup r⩽t 0 (cid:20)(cid:13) (cid:13) (cid:13)∇U log ∥Yr − ̃Yr∥2]dt + (cid:90) s 0 E[∥∇U log pT −t(Yt) − ∇U log pT −⌊t⌋(Y⌊t⌋)∥2]dt pT −⌊t⌋ ν (cid:13) (cid:13) (Y⌊t⌋) − ̃s(⌊t⌋, Y⌊t⌋) (cid:13) 2(cid:21) dt +E = L′ s 2 (cid:90) s 0 E[sup r⩽t ∥Yr − ̃Yr∥2]dt + (cid:90) s 0 B1 + B2dt We start by bounding B1: B1 ⩽ E + (cid:20)(cid:13) (cid:13) (cid:13)∇U log pT −t(Yt) − e (cid:16) (cid:17)2 1 − e (t−⌊t⌋) 2 E[∥∇U log pT −⌊t⌋(Y⌊t⌋)∥2] (t−⌊t⌋) (cid:13) (cid:13) 2 ∇U log pT −⌊t⌋(Y⌊t⌋) (cid:13) 2(cid:21) = E[∥∇U log pT −t(Yt)∥2] − E (cid:20)(cid:13) (cid:13) (cid:13)e (t−⌊t⌋) 2 ∇U log pT −⌊t⌋(Y⌊t⌋) 2(cid:21) (cid:13) (cid:13) (cid:13) (cid:16) + 1 − e (t−⌊t⌋) 2 (cid:17)2 E[∥∇U log pT −⌊t⌋(Y⌊t⌋)∥2] 35 Infinite-Dimensional Diffusion Models A PREPRINT where we used that the L2 norm of the a martingale Mt difference is the difference of the L2 norms, i.e., E[∥Mt − Ms∥2] = E[∥Mt∥2] − E[∥Ms∥2] for t ⩾ s. Then (cid:90) T 0 N (cid:88) B1dt ⩽ (E[∥∇U log pT −tk+1(Ytk+1)∥2] − E[∥e(tk+1−tk)∇U log pT −tk (Ytk )∥2])(tk+1 − tk) i=1 (cid:16) + (cid:17)2 1 − e ∆t 2 E[∥∇U log pT (YT )∥2] ⩽ ∆t N (cid:88) i=1 (E[∥∇U log pT −tk+1(Ytk+1)∥2] − E[∥e(tk+1−tk)∇U log pT −tk (Ytk )∥2]) (cid:16) + 1 − e ∆t 2 (cid:17)2 E[∥∇U log pT (YT )∥2] ⩽ ∆tE[∥∇U log p0(YT )∥2] + (cid:16) 1 − e ∆t 2 (cid:17)2 E[∥∇U log pT (YT )∥2] =O(∆t)E[∥∇U log p0(YT )∥2] where we used that the L2 norm of a martingale is increasing. The term B2 is nothing more than the loss. Putting it all together, we arrive at E[sup τ ⩽s ∥Yr − ̃Yr∥2] ⩽ L2 = L2 (cid:90) s 0 (cid:90) s 0 E[sup r⩽t E[sup r⩽t and can apply Gr ̈onwall to get that ∥Yr − ̃Yr∥2]dt + O(∆t)E[∥∇U log p0(YT )∥2] + Loss ∥Yr − ̃Yr∥2] + Error E[sup τ ⩽s ∥Yr − ̃Yr∥2] ⩽ (E[∥Y0 − ̃Y0∥2] + Error) exp(L2s). Since YT ∼ μdata and ̃YT ∼ ˆμsample we found a coupling of μdata and ˆμsample and bounded its L2 distance. We have not picked the coupling of Y0 ∼ pT and ̃Y0 ∼ N (0, C) yet. Therefore we just pick a ε-optimal coupling in the squared Wasserstein distance, i.e., E[∥Y0 − ̃Y0∥2] ⩽ W 2 2 (ˆμsample, μdata) ⩽ E[sup τ ⩽T ∥Yr − ̃Yr∥2] ⩽ (W2(pT , N (0, C)) + ε + Error) exp(L2T ). 2 (pT , N (0, C)) + ε and obtain W 2 Since ε was arbitrary, the statement of the theorem follows, we actually get W 2 2 (ˆμsample, μdata) ⩽ E[sup τ ⩽T ∥Yr − ̃Yr∥2] ⩽ (W2(pT , N (0, C)) + Error) exp(L2T ). Finally, W 2 2 (pT , N (0, C)) can be upper bounded by 2 (pT , N (0, C)) ≤ exp(−t)W 2 since the Ornstein-Uhlenbeck forward process is contracting with rate exp(−t) in the squared W 2 this, the statement of the theorem follows. 2 (μdata, N (0, C)) W 2 2 -distance. From (cid:50) Proposition 2 Let U be the Cameron-Martin space associated to a measure N (0, C) taking values in H. Then, ∥ * ∥U : H → [0, ∞] is lower-semicontinuous and convex on H. Proof Let (ei, ci) be the eigenvectors and eigenvalues of C. Let fk → f in H. We will prove lower semicontinuity for ∥ * ∥2 U , the result for ∥ * ∥U then follows. Then, ∥f ∥2 U = ∞ (cid:88) d=1 lim k→∞ ⟨fk, ei⟩c−1 i ⩽ lim inf k→∞ ∞ (cid:88) d=1 ⟨fk, ei⟩c−1 i = lim inf k→∞ ∥fk∥2 U , which proves lower semi-continuity. Convexity follows since ∥ * ∥U is convex when restricted to U , and infinite (cid:50) otherwise. 36
http://arxiv.org/abs/2302.10128v1
2023-02-20T18:00:21
2023-02-20T18:00:21
Sketch In, Sketch Out: Accelerating both Learning and Inference for Structured Prediction with Kernels
Surrogate kernel-based methods offer a flexible solution to structured output prediction by leveraging the kernel trick in both input and output spaces. In contrast to energy-based models, they avoid to pay the cost of inference during training, while enjoying statistical guarantees. However, without approximation, these approaches are condemned to be used only on a limited amount of training data. In this paper, we propose to equip surrogate kernel methods with approximations based on sketching, seen as low rank projections of feature maps both on input and output feature maps. We showcase the approach on Input Output Kernel ridge Regression (or Kernel Dependency Estimation) and provide excess risk bounds that can be in turn directly plugged on the final predictive model. An analysis of the complexity in time and memory show that sketching the input kernel mostly reduces training time while sketching the output kernel allows to reduce the inference time. Furthermore, we show that Gaussian and sub-Gaussian sketches are admissible sketches in the sense that they induce projection operators ensuring a small excess risk. Experiments on different tasks consolidate our findings.
[ "Tamim El Ahmad", "Luc Brogat-Motte", "Pierre Laforgue", "Florence d'Alché-Buc" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10128v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10128v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG" ]
3 2 0 2 b e F 0 2 ] L M . t a t s [ 1 v 8 2 1 0 1 . 2 0 3 2 : v i X r a Sketch In, Sketch Out: Accelerating both Learning and Inference for Structured Prediction with Kernels Tamim El Ahmad 1 Luc Brogat-Motte 1 Pierre Laforgue 2 Florence d'Alché-Buc 1 1 LTCI, Télécom Paris, Institut Polytechnique de Paris, France 2 Department of Computer Science, University of Milan, Italy Correspondance to: [email protected] Abstract Surrogate kernel-based methods offer a flexible solution to structured output pre- diction by leveraging the kernel trick in both input and output spaces. In contrast to energy-based models, they avoid to pay the cost of inference during training, while enjoying statistical guarantees. However, without approximation, these approaches are condemned to be used only on a limited amount of training data. In this pa- per, we propose to equip surrogate kernel methods with approximations based on sketching, seen as low rank projections of feature maps both on input and output feature maps. We showcase the approach on Input Output Kernel ridge Regression (or Kernel Dependency Estimation) and provide excess risk bounds that can be in turn directly plugged on the final predictive model. An analysis of the com- plexity in time and memory show that sketching the input kernel mostly reduces training time while sketching the output kernel allows to reduce the inference time. Furthermore, we show that Gaussian and sub-Gaussian sketches are admissible sketches in the sense that they induce projection operators ensuring a small excess risk. Experiments on different tasks consolidate our findings. 1 Introduction Ubiquitous in real-world applications, objects composed of different elements that interact with each others, a.k.a. structured objects, have attracted a great deal of attention in Machine Learning (Bakir et al., 2007; Gärtner, 2008; Nowozin and Lampert, 2011; Deshwal et al., 2019). Depending on their role in a supervised learning task, i.e., either as input or output variables, structured objects raise distinct challenges when learning a predictive model. Classification and regression from structured input require a continuous representation that can be learned through a deep neural network (see for instance, (Defferrard et al., 2016)) or implicitly defined through a dedicated kernel (Collins and Duffy, 2001; Borgwardt et al., 2020). In contrast, Structured Output Prediction calls for a more involved approach since the discrete nature of the output variables impacts directly the definition of the loss function (Ciliberto et al., 2020; Nowak et al., 2019; Cabannes et al., 2021), and therefore the learning problem itself. To handle this general task, an abundant literature has been developed within different directions, each reflecting a way to relax somehow the combinatorial nature of the problem which appears both in training and in prediction. Energy-based approaches relax the structured prediction problem into the learning of a scalar score function LeCun et al. (2007); Tsochantaridis et al. (2005); Belanger and McCallum (2016); Deshwal et al. (2019). End-to-end learning typically exploits a differentiable model, as well as a differentiable loss, to make a structured prediction, enabling gradient descent (Long et al., 2015; Niculae et al., 2018; Berthet et al., 2020). Surrogate methods rely on the implicit embedding of the output variable into a Hilbert Space and solve a surrogate regression problem into this new output space. If they avoid the burden of the inference step (decoding) during learning contrary to energy-based methods, at testing time they also pay the complexity price of the inference. Rare are the methods that simultaneously combine scalability in time and memory Preprint. Under review. at learning and inference time, a wide scope of applicability on different structures while offering statistical guarantees of the provided estimator Osokin et al. (2017); Cabannes et al. (2021). In this work, we focus on surrogate methods (Ciliberto et al., 2020) and their implementation as kernel methods, namely the input output kernel regression approaches (Cortes et al., 2005; Brouard et al., 2016b). Recent works have shown that they enjoy consistency and their excess risk is governed by those of the surrogate regression. Moreover, they are well appropriate to make prediction from one (structured) modality to another (structured) one since kernels can be leveraged in the input space as well as the output space. However contrary to deep neural networks they do not scale neither in memory nor in time without further approximation. The aim of this paper is equip these methods with kernel approximations to obtain a drastic reduction of computation and memory at training and testing time while keeping their statistical properties. Several works have successfully highlighted the power of kernel approximation methods such as Random Fourier Features (Rahimi and Recht, 2007; Brault et al., 2016; Rudi and Rosasco, 2017; Li et al., 2021), more generally low-rank approaches (Bach, 2013) and even reached spectacular results as shown by Meanti et al. (2020). Sketched scalar kernel machines have been widely studied first with a particular type of sketching, namely Nyström approximation (Williams and Seeger, 2001; Alaoui and Mahoney, 2015; Rudi et al., 2015), and some works exist handling other sketching distribution, such as Gaussian or Randomized Orthogonal Systems (Yang et al., 2017; Lacotte and Pilanci, 2020). Furthermore, a line of research consists in interpreting such an approximation as data-dependent random features (see e.g. Williams and Seeger (2001); Yang et al. (2012) for Nyström case and Kpotufe and Sriperumbudur (2020) for Gaussian case), leading to interesting applications for kernel PCA (Sterge and Sriperumbudur, 2022) or kernel mean embedding (Chatalic et al., 2022a,b). Current approaches to kernel approximation apply on scalar or vector-valued kernels defined on the input space but no method covers both sides of the coin, aka approximation of both input and output kernels. Contributions. By extending the random projection interpretation of Nyström's method for scalar- valued kernels to arbitrary sketching matrices and vector-valued RKHSs, we present four contributions • We apply sketching to both the inputs and the outputs of the Ridge vector-valued regression problems solved as subroutines when performing structured prediction with kernels. This is shown to accelerate respectively the learning and the inference steps of the approach. • We derive excess risk bounds for the sketched estimator thus obtained, which are controlled by the properties of the sketched projection operator. • We show that Gaussian and sub-Gaussian sketches are admissible sketches in the sense that they lead to close to optimal learning rates with sketching sizes m (cid:28) n. • We provide structured prediction experiments on real-world datasets which confirm our method's relevance. 2 Structured Prediction with input and output kernels In this section, we introduce Structured Prediction when leveraging a kernel-induced loss. Surrogate kernel methods are recalled in this context with an emphasis on Input Output Kernel ridge Regression. If Z denotes a generic Polish space, kz is a positive definite kernel over Z and χ(z) := Notation. kz(*, z) is the canonical feature map of kz. Hz denotes the Reproducing Kernel Hilbert Space √ n)(f (z1), . . . , f (zn))(cid:62) is the sampling operator (RKHS) associated to kz. SZ : f ∈ Hz (cid:55)→ (1/ over Hz (Smale and Zhou, 2007). For any operator A, we denote A# its adjoint. The adjoint of the sampling operator is defined as S# Z : α ∈ Rn (cid:55)→ (1/ i=1 αiχ(zi). If z is a random variable distributed according the probability distribution ρz, the covariance operator over HZ is denoted CZ = Ez[χ(z) ⊗ χ(z)] and the empirical covariance operator over HZ writes as (cid:98)CZ = (1/n) (cid:80)n i=1} is an i.i.d. sample drawn from the probability distribution ρz. For any matrix M , we denote M † its Moore-Penrose inverse. i=1 χ(zi) ⊗ χ(zi) = S# Z SZ, where {(zi)n n) (cid:80)n √ Structured prediction with surrogate kernel methods. Let X be the input space and Y the output space. In general, Y is finite and extremely large, which makes the task of approximating the relationship between an input variable X with values in X and an output random variable Y with values in Y intractable in a direct way Nowozin and Lampert (2011). In this work, we rely on a 2 kernel-induced loss to fix the goal of structured prediction and leverage the kernel trick to define a tractable surrogate regression problem. Suppose a positive definite kernel ky : Y × Y → R that measures how close are two objects from Y. Denote Hy the Reproducing Kernel Hilbert Space associated to ky and ψ : Y → Hy, the canonical feature map such as ψ(y) := ky(*, y), ∀y ∈ Y. We consider the loss function induced by the kernel ky defined by (cid:96) : (y, y(cid:48)) → (cid:107)ψ(y) − ψ(y(cid:48))(cid:107)2 , for any pair (y, y(cid:48)) ∈ Y × Y. Its relevance for the structured prediction problem at hand directly depends on the kernel chosen (see examples in Section 5), and the wide variety of kernels defined over structured objects (Gärtner, 2008; Borgwardt et al., 2020) ensures its great flexibility. Hy Given a fixed but unknown joint probability distribution ρ defined on X × Y, the goal of Structured Prediction is to find an estimator ˆf of the target function f ∗ := arg min f :X →Y R(f ) , (1) (cid:2)(cid:107)ψ(y) − ψ(f (x))(cid:107)2 Hy where R(f ) = E(x,y)∼ρ {(x1, y1), ..., (xn, yn)} drawn from ρ. To tackle this problem, various works Cortes et al. (2005); Geurts et al. (2006); Brouard et al. (2011); Ciliberto et al. (2016) have proposed to proceed in a two-step approach, referred to as Output Kernel Regression (OKR): (cid:3), using a training i.i.d. sample 1. Surrogate Regression: Find ˆh an estimator of the surrogate target h∗ : x (cid:55)→ E[ψ(y)|x] (cid:105) , exploiting the implicit knowledge of the (cid:104) (cid:107)h (x) − ψ (y)(cid:107)2 E Hy the minimizer of arg min h:X →Hy training sample {(x1, ψ(y1), ..., (xn, ψ(yn))}. 2. Pre-image or decoding: Define ˆf by decoding ˆh, i.e., ˆf (x) := arg min y∈Y (cid:107)ˆh(x) − ψ(y)(cid:107)2 Hy . The surrogate regression problem in Step 1 is much easier to handle than the initial Structured Prediction problem described in (1): it avoids to learn f through the composition with the implicit feature map ψ, and relegates the difficulty of manipulating structured objects to Step 2, i.e., at testing time. Besides, the issue of vector-valued regression into an infinite dimensional space can be overcome by leveraging the kernel trick in the output space. Moreover, these OKR approaches belong to the general framework of SELF (Ciliberto et al., 2016) and ILE (Ciliberto et al., 2020) and enjoy valuable theoretical guarantees. They are Fisher consistent, meaning that h∗ gives exactly rise to the target f ∗ after decoding, and that the excess risk of ˆf is controlled by that of ˆh, as shown in Ciliberto et al. (2016, Theorem 2). Input Output Kernel Regression. A natural choice to tackle the surrogate regression problem consists in solving a kernel ridge regression problem, assuming that the hypothesis space is a vector- valued RKHS (Senkene and Tempel'man, 1973; Micchelli and Pontil, 2005; Carmeli et al., 2006, 2010). In a nutshell, if F denotes a Hilbert space, a mapping K : X × X → L(F), where L(F) is the set of bounded linear operators on F , is an operator-valued kernel (OVK) if it satisfies the following properties: K (x, x(cid:48)) = K (x(cid:48), x)# for all (x, x(cid:48)) ∈ X 2 and such that for all n ∈ N and any (xi, φi))n i,j=1 (cid:104)φi, K (xi, xj) φj)(cid:105)F Similarly to the scalar case, given an OVK K, one can define a unique Hilbert space HK of functions with values in F associated to K, that enjoys the reproducing kernel property, i.e., such that for all x ∈ X , φ ∈ F and f ∈ HK we have x(cid:48) (cid:55)→ K (x, x(cid:48)) φ ∈ F, and (cid:104)f, K (*, x) φ(cid:105)HK = (cid:104)f (x), φ(cid:105)F . The reader can refer to (Carmeli et al., 2010) for further details on vv-RKHSs. i=1 ∈ (X × F)n we have (cid:80)n (cid:62) 0. In what follows, we are interested in functions with values in the RKHS Hy and we opt for the decomposable identity operator-valued kernel K : X × X → L(Hy), defined as: K (x, x(cid:48)) = kx (x, x(cid:48)) IHy , where kx : X × X → R is a positive definite scalar-valued kernel on X . By symmetry with the output space, we denote Hx, the RKHS associated to kx and for sake of simplicity H := HK, the RKHS associated to K. 3 We are now well equipped to describe Input Output Kernel ridge Regression (IOKR for short) (Brouard et al., 2011, 2016b; Ciliberto et al., 2020) also introduced as Kernel Dependency Estimation by Weston et al. (2003); Cortes et al. (2005). In IOKR, the estimator of the surrogate regression is obtained by solving the following ridge regression problem within H, given a regularisation penalty λ > 0, min h∈H 1 n n (cid:88) i=1 (cid:107)ψ(yi) − h(xi)(cid:107)2 Hy + λ(cid:107)h(cid:107)2 H . (2) Interestingly, as noticed by several authors, the unique solution of the above kernel ridge regression problem can be expressed in different ways. We describe the two of them which are exploited in this work. First, ˆh(x) computes a weighted combination of the training outputs ˆh(x) = n (cid:88) i=1 ˆαi(x)ψ(yi), with where KX = (kx (xi, xj))n i,j=1 ∈ Rn×n, and κx Second, ˆh(x) also results from the application of an operator (cid:98)H on φ(x), i.e., ˆα(x) = (KX + nλ)−1κx X = (cid:98)Ωκx X , X = (kx(x, x1), . . . , kx(x, xn))(cid:62). where ˆh(x) = (cid:98)Hφ(x), (cid:98)H = S# Y SX (cid:0) (cid:98)CX + λI(cid:1)−1 . (3) (4) (5) (6) The first expression can be obtained by applying a representer theorem in vv-RKHS (Micchelli and Pontil, 2005) and solving the resulting quadratic program. The second expression can be seen as a re-writing of the first one as highlighted in Ciliberto et al. (2016, Lemma 17) and may also be related to the conditional kernel empirical mean embedding Grünewälder et al. (2012). The final estimator ˆf is computed using the weighted expression in Equation (4) to benefit from the kernel trick: ˆf (x) = arg min ky(y, y) − 2κx X T (cid:98)Ωκy Y y∈Y (7) Y = (ky (y, y1) , . . . , ky (y, yn))(cid:62). where κy The training phase involves thus the inversion of a n×n matrix which cost without any approximation is O(n3). In practice, the decoding step is performed by searching in a candidate set Yc ⊆ Y of size nc. Hence, given that we want to perform predictions on a test set Xte of size nte, the main quantity to compute is Kte,tr (cid:124) (cid:123)(cid:122) (cid:125) nte×n (cid:98)Ω (cid:124)(cid:123)(cid:122)(cid:125) n×n K y tr,c (cid:124) (cid:123)(cid:122) (cid:125) n×nc , (8) i , xj))1≤i≤nte,1≤j≤n ∈ Rnte×n and K y where Kte,tr = (kx(xte ∈ (cid:1), considering nte < n ≤ nc. IOKR thus suffers, Rn×nc. The complexity of decoding part is O (cid:0)n2nc like most kernel methods applied in a naive fashion, from a heavy computational cost. In order to alleviate this limitation and widen the applicability of this method, we develop a general sketching approach that applies both in the input and output feature spaces to accelerate the training and the decoding steps. tr,c = (cid:0)ky(yi, yc 1≤i≤n,1≤j≤nc j )(cid:1) 3 Sketched Input Sketched Output Kernel Regression In this section, we describe how to construct ̃h , a low-rank approximate estimator of ˆh, thanks to orthogonal projection operators (cid:101)PX and (cid:101)PY onto subspaces of Hx and Hy respectively. A general sketching approach is proposed to define such projectors. Ultimately this gives rise to a novel estimator ̃f for structured prediction. 4 Low-rank estimator. Starting from the expression of ˆh in (5), we replace the sampling operators on both sides, SX and SY , by their projected counterparts, (cid:101)PX S# X and (cid:101)PY S# Y , in (6), so as to encode dimension reduction. The proposed low-rank estimator expresses as follows: X SX (cid:101)PX + λIHx )−1φ(x) . Y SX (cid:101)PX ( (cid:101)PX S# ̃h(x) = (cid:101)PY S# (9) In the following, we show how to design the projection operators using sketching and then derive the novel expression of the low-rank estimator in terms of weighted combination of the training outputs: ̃h(x) = (cid:80)n i=1 ̃αiψ(yi), yielding a reduced computational cost. Sketching. In this work, we chose to leverage sketching (Mahoney et al., 2011; Woodruff, 2014) to obtain random projectors within the input and output feature spaces. Indeed, sketching consists in approximating a feature map χ : Z → Hz by projecting it thanks to a random projection operator (cid:101)PZ ∈ Hz ⊗ Hz defined as follows. Given a random matrix Rz ∈ Rmz×n, n data (zi)n i=1 ∈ Z and mz (cid:28) n, the linear subspace defining (cid:101)PZ is constructed as the linear subspace generated by the span of the following mz random vectors n (cid:88) (Rz)ijχ(zj) ∈ Hz, j=1 i = 1, . . . , mz . This random matrix is drawn from a distribution on Rmz×n, including classical examples such as sub-sampling sketches where each row is randomly drawn from the rows of the identity matrix In (sub-sampling sketches correspond to Nyström approximation (Rudi et al., 2015)) or Gaussian sketches (Kpotufe and Sriperumbudur, 2020) where every entries are i.i.d. Gaussian random variables. One can compute the closed form of such a projector (cid:101)PZ as showed in Proposition 2, in Appendix B. Sketched Input Sketched Output Kernel Regression estimator (SISOKR) We now give the expression of the SISOKR estimator ̃h amenable to practical implementations (see Appendix B for the proof). Proposition 1 (Expression of SISOKR). For all x ∈ X , ̃h (x) = (cid:80)n i=1 ̃αi (x) ψ (yi) where ̃α (x) = R(cid:62) y (cid:101)ΩRxκx X , (10) with (cid:101)Ω = (cid:101)K † Y RyKY KX R(cid:62) x (RxK 2 X R(cid:62) x + nλ (cid:101)KX )†. X R(cid:62) x (RxK 2 x )†Rxκx x + nλRxKX R(cid:62) We here recover a classical quantity when leveraging sketching for Kernel Ridge Regression, i.e. KX R(cid:62) X (Rudi et al., 2015; Yang et al., 2017). This quantity allows to reduce the size of the matrix to invert, which is now an mx × mx matrix. This is the main reduction that allows to lower fitting step's complexity, thanks to the input sketching. We still need to perform matrix multiplications RxKX , which can be very efficient both in time and space complexity for sketches such as sub-sampling or p-sparsified (El Ahmad et al., 2022) sketches, or more costly for Gaussian sketches for instance. Furthermore, output sketching gives additional operations to perform, but the overall cost of computing ̃α complexity can be negligible compared to O(n3) according to the sketching scheme used for both input and output kernels. We obtain the corresponding structured prediction estimator ̃f by decoding ̃h, i.e. by replacing (cid:98)Ω by (cid:101)Ω in (7). Finally, the purpose of output sketching is to accelerate inference. In fact, the main quantity to compute now when performing predictions is Kte,trR(cid:62) x (cid:123)(cid:122) (cid:125) (cid:124) nte×mx (cid:101)Ω (cid:124)(cid:123)(cid:122)(cid:125) mx×my . RyK y tr,c (cid:124) (cid:123)(cid:122) (cid:125) my×nc (11) Time complexity of such an operation is O(ncnte min(mx, my)) if nte > my, and O(ncmy min(mx, nte)) otherwise. We then obtain a significant complexity reduction, as we do not have any dependency in n2nc anymore. 4 Theoretical Analysis In this section, we present a statistical analysis of the proposed estimators ̃h and ̃f . After introducing the assumptions on the learning problem that we consider, we upper bound in Theorem 1 the excess- risk of the sketched kernel ridge estimator, exhibiting some approximation errors due to sketching. 5 Then, in Section 4.2, we provide bounds for these approximation error terms. Finally, this allows us to study in Section 4.3 under which setting the proposed estimators ̃h and ̃f obtain substantial computational gains, while still benefiting from a close to optimal learning rate. We consider the following set of common assumptions in the kernel literature (Bauer et al., 2007; Steinwart et al., 2009; Rudi et al., 2015; Pillaud-Vivien et al., 2018; Fischer and Steinwart, 2020; Ciliberto et al., 2020; Brogat-Motte et al., 2022) quantifying the hardness of the learning problem. Assumption 1 (Attainability). We assume that h∗ ∈ H, i.e. there exists a linear operator H : Hx → Hy with (cid:107)H(cid:107)HS < +∞ such that h∗(x) = Hφ(x) ∀ x ∈ X . (12) This is a standard assumption in the context of least-squares regression (Caponnetto and De Vito, 2007), making the target h∗ belonging to the hypothesis space. We now describe a set of generic assumptions that have to be satisfied by both input and output kernels kx and ky. Assumption 2 (Bounded kernel). We consider positive definite bounded kernels kz : Z × Z → R, i.e. we assume that there exists κz > 0 such that kz(z, z) ≤ κ2 z ∀ z ∈ Z. We note κx, κy > 0 for the input and output kernels kx, ky, respectively. Assumption 3 (Capacity condition). We assume that there exists γz ∈ [0, 1] such that Qz := Tr(C γz Z ) < +∞ . (13) (14) This assumption is always verified for γz = 1 (as Tr(CZ) = E[(cid:107)χ(z)(cid:107)2 ] < +∞ from Assump- Hz tion 2), and the smaller the γz the faster is the eigenvalue decay of CZ. It measures the regularity of the features χ(z) ∈ Hz for z ∼ ρz. As a limiting case, when CZ is finite rank, γz = 0. Assumption 4 (Embedding property). We assume that there exists bz > 0 and μz ∈ [0, 1] such that almost surely χ(z) ⊗ χ(z) (cid:22) bzC 1−μz Z . (15) This assumption is always verified for μz = 1 (as χ(z) ⊗ χ(z) (cid:22) κ2 zIHz from Assumption 2), and the smaller the μz the stronger is the assumption. It allows to control the regularity of the functions in Hz with respect to the L∞-norm, by giving (cid:107)h(cid:107)Hz ≤ b1/2 E[h(z)2](1−μ)/2 (See Pillaud-Vivien et al., 2018). As a limiting case, when CZ is finite rank, μz = 0. z (cid:107)h(cid:107)μ Hz 4.1 SISOKR Excess-Risk bound In this section, we provide a bound on the excess-risk of the proposed approximated regression estimator with both input and output sketching (SISOKR). Theorem 1 (SISOKR excess-risk bound). Let δ ∈ [0, 1], n ∈ N sufficiently large such that λ = n−1/(1+γx) ≥ 9κ2 δ ). Under our set of assumptions, the following holds with probability at least 1 − δ n log( n x E[(cid:107) ̃h(x) − h∗(x)(cid:107)2 Hy ] 1 2 ≤ S(n) + c2Aφ ρx ( (cid:101)PX ) + Aψ ρy ( (cid:101)PY ) where S(n) = c1 log(4/δ)n− 1 Aχ ρz ( (cid:101)PZ) = Ez[(cid:107)( (cid:101)PZ − IHz )χ(z)(cid:107)2 Hz 2(1+γx ) (regression error) 1 2 (sketch. error) ] and c1, c2 > 0 are constants independent of n and δ defined in the proofs. This bound is a sum of three terms. The first one is a regression error whose dependency in n is the same as the kernel ridge regression (without sketching). In particular, this learning rate has been shown to be optimal under our set of assumptions in a minimax sense (see Caponnetto and De Vito (2007)). The second and the third terms are approximation errors due to the sketching of the input and the output kernels, respectively. In particular, they write as reconstruction errors (Blanchard et al., 2007) associated to the random projection (cid:101)PX , (cid:101)PY of the feature maps φ, ψ through the input and output marginal distributions, respectively. 6 4.2 Sketching Reconstruction Error In this section, we provide bounds on the sketching reconstruction error for the family of subgaussian sketches. Subgaussian sketches are defined as follows. Definition 1. A subgaussian sketch R ∈ Rm×n is composed with i.i.d. elements such that E [Rij] = 0, E (cid:2)R2 m -subgaussian, for all 1 ≤ i ≤ m and 1 ≤ j ≤ n, where ν ≥ 1. (cid:3) = 1/m and Rij is ν2 ij First, a standard normal r. v. is 1-subgaussian. Moreover, thanks to Hoeffding's lemma, any r.v. taking values in a bounded interval [a, b] is (b − a)2/4-subgaussian. Hence, a sketch matrix composed with i.i.d. Gaussian or bounded r.v. is a subgaussian sketch. Finally, the p-sparsified sketches (El Ahmad et al., 2022) are subgaussian with ν2 = 1/p, p ∈]0, 1]. Theorem 2 (Subgaussian sketching reconstruction error). For δ ∈ (0, 1/e], n ∈ N sufficiently large such that 9 1+γz ≤ (cid:107)CZ(cid:107)op/2, then if n log(n/δ) ≤ n− 1 m ≥ c4 max (cid:16) ν2 z n γz +μz 1+γz , ν4 z log (1/δ) (cid:17) , then with probability 1 − δ Ez[(cid:107)( (cid:101)PZ − IHz )χ(z)(cid:107)2 Hz ] ≤ c3n− 1−γz (1+γz ) where c3, c4 > 0 are constants independents of n, m, δ defined in the proofs. (16) (17) γz +μz 1+γz ) allows to obtain a reconstruction This theorem shows that using a sketching size m = O(n error of order O(n− 1−γz (1+γz ) ). Hence, depending on the regularity of the distribution (defined through our set of assumptions), one can obtain a small reconstruction error when using a small sketching size. For instance, if μz = γz = 1/3, one obtain a reconstruction error of order O(n−1/2) by using a sketching size of order O(n1/2) (cid:28) O(n). As a limiting case, when μz = γz = 0, one obtain a reconstruction error of order O(n−1) by using a constant sketching size. 4.3 SISOKR Learning Rates For the sake of presentation, we use (cid:46) to keep only the dependencies in n, δ, ν, γ, μ. We note a ∨ b := max(a, b). Corollary 1 (SISOKR learning rates). Under the Assumptions of Theorems 1 and 2, if for all y ∈ Y, (cid:107)ψ(y)(cid:107)Hy = κy, for n ∈ N sufficiently large such that 9 1+γx ≤ (cid:107)CX (cid:107)op/2, and 9 1+γy ≤ (cid:107)CY (cid:107)op/2, and for sketching size mx, my ∈ N such that n log(n/δ) ≤ n− 1 n log(n/δ) ≤ n− 1 mx (cid:38) max (cid:16) ν2 xn γx+μx 1+γx , ν4 x log (1/δ) (cid:17) my (cid:38) max (cid:18) ν2 y n γy +μy 1+γy , ν4 y log (1/δ) (cid:19) , , then with probability 1 − δ and E[(cid:107) ̃h(x) − h∗(x)(cid:107)2 Hy 1 2 (cid:46) log (4/δ) n− ] 1−γx ∨γy 2(1+γx∨γy ) , R( ̃f ) − R(f ∗) (cid:46) log (4/δ) n− 1−γx ∨γy 2(1+γx ∨γy ) . (18) (19) (20) (21) Proof. Applying Theorems 1 and 2 to bound Aφ ρx comparison inequality from Ciliberto et al. (2020) to the loss ∆(y, y(cid:48)) = (cid:107)ψ(y) − ψ(y(cid:48))(cid:107)2 to conclude the proof for Eq. (21). ( (cid:101)PY ) gives (20). Applying the allows ( (cid:101)PX ) and Aψ ρy Hy 7 Figure 1: Trade-off between Accuracy and Efficiency for a SISOKR model with (2 * 10−3)-SR input and output sketches. This corollary shows that under strong enough regularity assumptions, the proposed estimators benefit from a close to optimal learning rate but only requires a small input and output sketching sizes, leading to significant computational gain for the training and the decoding steps. For instance, if μx = μy = γx = γy = 1/3, one obtains a learning rate of O(n−1/4) instead of the optimal rate of O(n−3/8) under the same assumptions, but only requires sketching sizes mx, my of order O(n1/2) (cid:28) O(n). As a limiting case, when μx = μy = γx = γy = 0, one obtains a, optimal learning rate of O(n−1/2) by using constant sketching sizes. Remark 1 (Related Work). Excess-risk bounds for sketched kernel ridge regression have been provided in Rudi et al. (2015) in the case of Nyström subsampling, and scalar-valued ridge regression. Our proofs will consist in similar derivations than in Rudi et al. (2015). Nevertheless, we cannot apply directly their results in our setting because of the three following differences: the definition of Rz, we consider vector-valued ridge regression, we perform sketching also on the output features. We provided more details about this in Appendix G. Remark 2 (Other Sketches). Although we focused on subgaussian sketches, any sketching distribution admitting concentration bounds for operators on separable Hilbert spaces allows to bound the quantity Aχ ( (cid:101)PZ) and is then admissible for our theoretical framework. For instance, as showed in Rudi et al. ρz (2015), uniform and approximate leverage scores sub-sampling schemes fit into the presented theory. Remark 3 (Application to Least Squares Regression). This model and theoretical framework applies to any least squares regression problem with identity separable input kernel and separable Hilbert output space Y. It corresponds to having the linear output kernel ky(*, *) = (cid:104)*, *(cid:105)Y , and then ψ = IY . Remark 4 (Comparison to K-satisfiability). Note that our framework significantly departs from that of K-satisfiability (Yang et al., 2017; Chen and Yang, 2021), a popular approach to analyze sketching in kernel methods. First, we highlight that K-satisfiability provides Gram matrix-specific bounds (through the critical radius), while ours are expressed in terms of quantities characteristics to the kernel. It then allows to upper bound the squared L2(Pn) error between ̃h and h∗, while our projection point of view provides a direct control on the excess risk. Finally, it is worth noting that our approach shows that sub-Gaussian sketches are admissible, which cannot be proven through K-satisfiability. 5 Experiments In this section, we present experiments on synthetic and real-world datasets. In the following, SIOKR and ISOKR denote the models with sketching leveraged only on the inputs (respectively outputs). We focus on uniform sub-sampling (Rudi et al., 2015) and p-SR/SG sketches (El Ahmad et al., 2022), which are covered by our theoretical analysis. Results reported are averaged over 30 replicates, unless for the metabolite's experiments where 5 replicates are averaged. 5.1 Synthetic Least Squares Regression We generate a synthetic dataset of least-squares regression, with n = 10, 000 training data points, X = Y = Hy = Rd and d = 300. We construct covariance matrices C and E by drawing randomly their eigenvectors and such that their eigenvalues are σk(C) = k−3/2 and σk(E) = 0.2k−1/10. We draw H0 ∈ Rd×d with i.i.d. coefficients from the standard normal distribution and set H = CH0. 8 0.050.0100.150.200.250.300.mx0.960.970.980.99MSEIOKR50100150200250my0.050.0100.150.200.250.300.mx0.00.20.400.600.81.001.20Training time (in s)50100150200250my0.050.0100.150.200.250.300.mx0.20.250.300.350.4Inference time (in s)50100150200250my Table 1: F1 score on tag prediction from text data. Method Bibtex Bookmarks SISOKR 44.1 ± 0.07 44.8 ± 0.01 ISOKR 44.7 ± 0.09 SIOKR 44.9 IOKR 37.2 LR 38.9 NN 42.2 SPEN 44.2 PRLR 44.7 DVN 39.3 ± 0.61 NA 39.1 ± 0.04 NA 30.7 33.8 34.4 34.9 37.1 Table 2: MSE and standard errors for the metabolite identification problem. SPEN directly predicts outputs in Y, then MSE is not defined. Method MSE Tanimoto-Gaussian loss Top-1 | 5 | 10 accuracies SISOKR 0.832 ± 0.002 0.825 ± 0.002 ISOKR 0.793 ± 0.002 SIOKR 0.780 ± 0.002 IOKR NA SPEN 0.597 ± 0.009 0.566 ± 0.009 0.507 ± 0.010 0.486 ± 0.008 0.537 ± 0.008 22.7% | 50.6% | 61.4% 24.2% | 53.1% | 63.5% 28.5% | 59.9% | 69.6% 29.6% | 61.6% | 71.4% 25.9% | 54.1% | 64.3% For i ≤ n, we generate inputs xi ∼ N (0, C), noise (cid:15)i ∼ N (0, E) and outputs yi = Hxi + (cid:15)i. We generate validation and test sets of nval = nte = 1000 points in the same way. Such a choice of matrices C with a polynomial eigenvalue decay, E with very low eigenvalues and eigenvalue decay, and H = CH0 allows to enforce a high eigenvalue decay for CY , since it will have a similar eigenvalue decay as C, and favorable settings to deploy sketching, as the true regression function H is low rank and sketching induces low-rank estimators by construction, encoded by the sketch sizes mx and my and the projection operators (cid:101)PX and (cid:101)PY , see (9) and Proposition 2. As stated by Corollary 1, the higher are the eigenvalue decays of CX and CY , the lower we can set mx and my. We used the Gaussian kernel and selected its bandwidth -as well as the regularisation penalty λ- via 1-fold cross-validation. We learn the SISOKR model for different values of mx and my (from 10 to 295) and (2 * 10−2)-SR input and output sketches. Figure 1(a) presents test errors, measured in terms of Mean Squared Error (MSE), for many choices of my, as a function of the sketch size mx, and the test error of IOKR, i.e. non-sketched model. Figure 1(b) and Figure 1(c) show the corresponding computational training and inference time. Note that for such a problem where Y = Hy, there is no decoding step during inference. However, we perform an artificial pre-image problem to illustrate the computational benefit from sketching during this phase in general structured prediction problems. We observe that the MSE decreases as the sketch sizes mx and my increase, and more precisely, it decreases faster with respect to mx than my. This might be due to the fact that we used a linear kernel on the output space, which is only 300-dimensional, hence we benefit less from sketching the output kernel than sketching the input Gaussian kernel, whose RKHS Hx is infinite-dimensional. This can also explain why we obtain a degraded MSE performance compared to IOKR, while when performing sketching solely on the input kernel, we closely reach the performance of IOKR (see Figure 2 in Appendix H.1). Turning to training and inference times, we observe a reduction compared to IOKR, where training takes around 0.06 to 1.3 seconds for sketch models and 16 seconds for IOKR, and inference takes around 0.07 to 0.32 seconds for sketch models and 3.2 seconds for IOKR Furthermore, training time decreases when mx and my decrease but is more sensitive to input sketch size mx, while inference time decreases too when mx and my decrease but is more sensitive to output sketch size my as expected. 5.2 Multi-Label Classification We compare our sketched models with SOTA multi-label and structured prediction methods, namely IOKR (Brouard et al., 2016b), logistic regression (LR) trained independently for each label (Lin et al., 2014), a two-layer neural network with cross entropy loss (NN) (Belanger and McCallum, 2016), the 9 Table 3: Comparison of training/inference computation times (in seconds). Data set IOKR SIOKR ISOKR SISOKR Bibtex Bookmarks Metabolite 2.54 / 1.18 NA 1.96 ± 0.40 / 957 ± 28 1.99 ± 0.07 / 1.22 ± 0.03 354 ± 2.1 / 297 ± 2.1 1.56 ± 0.02 / 940 ± 28 2.51 ± 0.06 / 0.58 ± 0.01 NA 3.46 ± 0.22 / 878 ± 23 1.41 ± 0.03 / 0.46 ± 0.01 118 ± 1.5 / 20 ± 0.2 2.85 ± 0.10 / 770 ± 25 multi-label approach Posterior-Regularized Low-Rank (PRLR) (Lin et al., 2014), the energy-based model Structured Prediction Energy Networks (SPEN) (Belanger and McCallum, 2016) and Deep Value Networks (DVN) (Gygli et al., 2017). Results are taken from the cited articles. Bibtex and Bookmarks (Katakis et al., 2008) are tag recommendation problems, in which the objective is to propose a relevant set of tags (e.g. url, description, journal volume) to users when they add a new Bookmark (webpage) or Bibtex entry to the social bookmarking system Bibsonomy. Bibtex contains n = 4880 training points, while Bookmarks contains n = 60, 000 training points (see Table 4 for details). For all multi-label experiments, we used Gaussian input and output kernels with widths σ2 input and σ2 output. We used p-SG input sketches for SIOKR models, p-SG output sketches for ISOKR models, and uniform sub-sampling input sketches and p-SG output sketches for SISOKR models. For Bibtex experiments, we chose p = 4 * 10−3, mx = 2, 250 and my = 200, and for Bookmarks experiments, p = 3 * 10−4, mx = 13, 000 and my = 750. All the training data were used as candidate sets. Performance of the algorithms are measured by example-based F1 score. We selected the hyper-parameters λ, σ2 output in logarithmic grids by 5-fold cross-validation. input and σ2 The results in Table 1 show than surrogate methods (first four lines) can compete with SOTA methods. In the case of Bibtex, sketched models preserve good performance compared to IOKR while being faster in training phase for SIOKR and SISOKR, and significantly faster in inference phase for ISOKR and SISOKR, see Table 3. Since Bookmarks data set is too large, storing the whole n2-Gram matrix KX exceeds CPU's space limitations. Hence, we only tested SIOKR and SISOKR models on this data set, which outperform other methods. Note that, with the same sketch matrix Rx, SIOKR's training phase is faster than SISOKR's one because there is not additional computations on the output Gram matrix KY . In Table 3, SISOKR is faster during training for multi-label data set since the input sketching used is more efficient (sub-sampling vs. p-SG). 5.3 Metabolite Identification Identifying small molecules, called metabolites, in a biological sample is a problem of high interest in metabolomics. Mass spectrometry is a widespread method to extract distinctive features from a biological sample in the form of a tandem mass (MS/MS) spectrum. Given the tandem mass spectrum of a metabolite, the objective is to predict its molecular structure. These molecular structures are represented by binary vectors of length d = 7593, called fingerprints. Each value of this binary vector encodes the presence or absence of a molecular property. IOKR is the SOTA method for this problem (Brouard et al., 2016a). The data set consists in n = 6974 training mass spectrums, the median size of the candidate sets is 292 and the largest candidate set contains 36, 918 fingerprints. Therefore, metabolite identification is a problem with high-dimensional complex outputs, making the choice of the output kernel crucial, a small train set and a large number of candidates, making the inference step long. Our numerical experimental protocol is similar to Brouard et al. (2016a) (5-CV Outer / 4-CV Inner loops), we used probability product input kernel for mass spectra and Gaussian-Tanimoto output kernel – with width σ2 – for the molecular fingerprints. We selected the hyper-parameters λ and σ2 in logarithmic grids. For the sketched model, we used p-SR input sketches for SIOKR models, p-SR output sketches for ISOKR models, and uniform sub-sampling input sketches and p-SR output sketches for SISOKR models with p = 3 * 10−3, mx = 2, 500 and my = 300. We compare our sketched models with IOKR and SPEN, see Table 2. Results for SPEN were taken from Brogat-Motte et al. (2022)). Although SIOKR competes with IOKR, and ISOKR and SISOKR compete with SPEN, we observe than IOKR outperform all methods. However, sketched models allow training and inference time reduction, see Table 3. 10 6 Conclusion In this paper, we scale up surrogate kernel methods for structured prediction by leveraging random projections, in both input and output feature spaces, to accelerate training and inference phases. We develop a theoretical study of the novel estimator and highlight the impact of input and output sketching in the risk decomposition. We extend the existing theory on Nyström approximation and derive the error induced by generic subgaussian sketches. Experiments on structured prediction problems confirm the advantages of the approach. If this paper focuses on the kernel-induced square loss and the ridge estimator, note that output sketching can be applied to other kernelized non-parametric estimators. Acknowledgements This work was supported by the Télécom Paris research chair on Data Science and Artificial Intelli- gence for Digitalized Industry and Services (DSAIDIS). References Alaoui, A. and Mahoney, M. W. (2015). Fast randomized kernel ridge regression with statistical guarantees. In Cortes, C., Lawrence, N., Lee, D., Sugiyama, M., and Garnett, R., editors, Advances in Neural Information Processing Systems (NeurIPS), volume 28. Bach, F. (2013). Sharp analysis of low-rank kernel matrix approximations. In Proc. of the 26th annual Conference on Learning Theory, pages 185–209. PMLR. Bakir, G., Hofmann, T., Smola, A. J., Schölkopf, B., and Taskar, B. (2007). Predicting structured data. The MIT Press. Bauer, F., Pereverzev, S., and Rosasco, L. (2007). On regularization algorithms in learning theory. Journal of Complexity, 23(1):52–72. Belanger, D. and McCallum, A. (2016). Structured prediction energy networks. In International Conference on Machine Learning, pages 983–992. Berthet, Q., Blondel, M., Teboul, O., Cuturi, M., Vert, J.-P., and Bach, F. (2020). Learning with differentiable perturbed optimizers. Blanchard, G., Bousquet, O., and Zwald, L. (2007). Statistical properties of kernel principal component analysis. Machine Learning, 66(2):259–294. Borgwardt, K., Ghisu, E., Llinares-López, F., O'Bray, L., and Rieck, B. (2020). Graph kernels: State- of-the-art and future challenges. Foundations and Trends in Machine Learning, 13(5-6):531–712. Brault, R., Heinonen, M., and Buc, F. (2016). Random fourier features for operator-valued kernels. In Asian Conference on Machine Learning, pages 110–125. PMLR. Brogat-Motte, L., Rudi, A., Brouard, C., Rousu, J., and d'Alché Buc, F. (2022). Vector-valued least- squares regression under output regularity assumptions. Journal of Machine Learning Research, 23(344):1–50. Brouard, C., d'Alché-Buc, F., and Szafranski, M. (2011). Semi-supervised penalized output kernel regression for link prediction. In International Conference on Machine Learning (ICML), pages 593–600. Brouard, C., Shen, H., Dührkop, K., d'Alché-Buc, F., Böcker, S., and Rousu, J. (2016a). Fast metabolite identification with input output kernel regression. Bioinformatics, 32(12):28–36. Brouard, C., Szafranski, M., and D'Alché-Buc, F. (2016b). Input output kernel regression: supervised and semi-supervised structured output prediction with operator-valued kernels. The Journal of Machine Learning Research, 17(1):6105–6152. 11 Cabannes, V. A., Bach, F., and Rudi, A. (2021). Fast rates for structured prediction. In conference on learning theory, pages 823–865. PMLR. Caponnetto, A. and De Vito, E. (2007). Optimal rates for the regularized least-squares algorithm. Foundations of Computational Mathematics, 7(3):331–368. Carmeli, C., De Vito, E., and Toigo, A. (2006). Vector valued reproducing kernel hilbert spaces of integrable functions and mercer theorem. Analysis and Applications, 4(04):377–408. Carmeli, C., De Vito, E., Toigo, A., and Umanitá, V. (2010). Vector valued reproducing kernel hilbert spaces and universality. Analysis and Applications, 8(01):19–61. Chatalic, A., Carratino, L., De Vito, E., and Rosasco, L. (2022a). Mean nyström embeddings for adaptive compressive learning. In Camps-Valls, G., Ruiz, F. J. R., and Valera, I., editors, Proceedings of The 25th International Conference on Artificial Intelligence and Statistics, volume 151 of Proceedings of Machine Learning Research, pages 9869–9889. PMLR. Chatalic, A., Schreuder, N., Rosasco, L., and Rudi, A. (2022b). Nyström kernel mean embeddings. In Chaudhuri, K., Jegelka, S., Song, L., Szepesvari, C., Niu, G., and Sabato, S., editors, Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pages 3006–3024. PMLR. Chen, Y. and Yang, Y. (2021). Accumulations of projections-a unified framework for random sketches in kernel ridge regression. In International Conference on Artificial Intelligence and Statistics, pages 2953–2961. PMLR. Ciliberto, C., Rosasco, L., and Rudi, A. (2016). A consistent regularization approach for structured prediction. In Advances in Neural Information Processing Systems (NIPS) 29, pages 4412–4420. Ciliberto, C., Rosasco, L., and Rudi, A. (2020). A general framework for consistent structured prediction with implicit loss embeddings. J. Mach. Learn. Res., 21(98):1–67. Collins, M. and Duffy, N. (2001). Convolution kernels for natural language. Advances in neural information processing systems, 14. Cortes, C., Mohri, M., and Weston, J. (2005). A general regression technique for learning transduc- tions. In International Conference on Machine Learning (ICML), pages 153–160. Defferrard, M., Bresson, X., and Vandergheynst, P. (2016). Convolutional neural networks on graphs with fast localized spectral filtering. Advances in neural information processing systems, 29. Deshwal, A., Doppa, J. R., and Roth, D. (2019). Learning and inference for structured prediction: A unifying perspective. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence (IJCAI-19). El Ahmad, T., Laforgue, P., and d'Alché-Buc, F. (2022). p-sparsified sketches for fast multiple output kernel methods. Fischer, S. and Steinwart, I. (2020). Sobolev norm learning rates for regularized least-squares algorithms. J. Mach. Learn. Res., 21:205–1. Gärtner, T. (2008). Kernels for Structured Data, volume 72 of Series in Machine Perception and Artificial Intelligence. WorldScientific. Geurts, P., Wehenkel, L., and d'Alché Buc, F. (2006). Kernelizing the output of tree-based methods. In Proceedings of the 23rd International Conference on Machine Learning, ICML '06, page 345–352, New York, NY, USA. Association for Computing Machinery. Grünewälder, S., Lever, G., Baldassarre, L., Patterson, S., Gretton, A., and Pontil, M. (2012). Conditional mean embeddings as regressors. In Proceedings of the 29th International Coference on International Conference on Machine Learning, pages 1803–1810. Gygli, M., Norouzi, M., and Angelova, A. (2017). Deep value networks learn to evaluate and iteratively refine structured outputs. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML'17, page 1341–1351. JMLR.org. 12 Katakis, I., Tsoumakas, G., and Vlahavas, I. (2008). Multilabel text classification for automated tag suggestion. In Proceedings of the ECML/PKDD, volume 18, page 5. Citeseer. Koltchinskii, V. and Lounici, K. (2017). Concentration inequalities and moment bounds for sample covariance operators. Bernoulli, 23(1):110 – 133. Kpotufe, S. and Sriperumbudur, B. K. (2020). Gaussian sketching yields a J-L lemma in RKHS. In Chiappa, S. and Calandra, R., editors, AISTATS 2020, volume 108 of Proceedings of Machine Learning Research, pages 3928–3937. PMLR. Lacotte, J. and Pilanci, M. (2020). Adaptive and oblivious randomized subspace methods for high- dimensional optimization: Sharp analysis and lower bounds. arXiv preprint arXiv:2012.07054. LeCun, Y., Chopra, S., Ranzato, M., and Huang, F.-J. (2007). Energy-based models in document recognition and computer vision. In Ninth International Conference on Document Analysis and Recognition (ICDAR 2007), volume 1, pages 337–341. IEEE. Li, Z., Ton, J.-F., Oglic, D., and Sejdinovic, D. (2021). Towards a unified analysis of random fourier features. Journal of Machine Learning Research, 22(108):1–51. Lin, X. V., Singh, S., He, L., Taskar, B., and Zettlemoyer, L. (2014). Multi-label learning with posterior regularization. Long, J., Shelhamer, E., and Darrell, T. (2015). Fully convolutional networks for semantic segmenta- tion. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3431–3440. Mahoney, M. W. et al. (2011). Randomized algorithms for matrices and data. Foundations and Trends® in Machine Learning, 3(2):123–224. Meanti, G., Carratino, L., Rosasco, L., and Rudi, A. (2020). Kernel methods through the roof: Handling billions of points efficiently. Advances in Neural Information Processing Systems (NeurIPS), 33. Micchelli, C. A. and Pontil, M. (2005). On learning vector-valued functions. Neural computation, 17(1):177–204. Niculae, V., Martins, A., Blondel, M., and Cardie, C. (2018). Sparsemap: Differentiable sparse structured inference. In International Conference on Machine Learning (ICML), pages 3799–3808. PMLR. Nowak, A., Bach, F., and Rudi, A. (2019). Sharp analysis of learning with discrete losses. In Chaud- huri, K. and Sugiyama, M., editors, Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics (AISTATS), volume 89 of Proceedings of Machine Learning Research, pages 1920–1929. Nowozin, S. and Lampert, C. H. (2011). Structured learning and prediction in computer vision. Foundations and Trends in Computer Graphics and Vision, 6(3-4):185–365. Osokin, A., Bach, F. R., and Lacoste-Julien, S. (2017). On structured prediction theory with calibrated convex surrogate losses. In Guyon, I., von Luxburg, U., Bengio, S., Wallach, H. M., Fergus, R., Vishwanathan, S. V. N., and Garnett, R., editors, Advances in Neural Information Processing Systems (NeurIPS) 30:, pages 302–313. Pillaud-Vivien, L., Rudi, A., and Bach, F. (2018). Statistical optimality of stochastic gradient descent on hard learning problems through multiple passes. Advances in Neural Information Processing Systems, 31. Rahimi, A. and Recht, B. (2007). Random features for large scale kernel machines. NIPS, 20:1177– 1184. Rudi, A., Camoriano, R., and Rosasco, L. (2015). Less is more: Nyström computational regularization. Advances in Neural Information Processing Systems, 28. 13 Rudi, A., Canas, G. D., and Rosasco, L. (2013). On the sample complexity of subspace learning. In Advances in Neural Information Processing Systems, pages 2067–2075. Rudi, A. and Rosasco, L. (2017). Generalization properties of learning with random features. In Advances on Neural Information Processing Systems (NeurIPS), pages 3215–3225. Senkene, E. and Tempel'man, A. (1973). Hilbert spaces of operator-valued functions. Lithuanian Mathematical Journal, 13(4):665–670. Smale, S. and Zhou, D.-X. (2007). Learning theory estimates via integral operators and their approximations. Constructive Approximation, 26:153–172. Steinwart, I., Hush, D. R., Scovel, C., et al. (2009). Optimal rates for regularized least squares regression. In COLT, pages 79–93. Sterge, N. and Sriperumbudur, B. K. (2022). Statistical optimality and computational efficiency of nystrom kernel pca. Journal of Machine Learning Research, 23(337):1–32. Tsochantaridis, I., Joachims, T., Hofmann, T., and Altun, Y. (2005). Large margin methods for structured and interdependent output variables. Journal of machine learning research, 6(Sep):1453– 1484. Weston, J., Chapelle, O., Vapnik, V., Elisseeff, A., and Schölkopf, B. (2003). Kernel dependency estimation. In Becker, S., Thrun, S., and Obermayer, K., editors, Advances in Neural Information Processing Systems 15, pages 897–904. MIT Press. Williams, C. and Seeger, M. (2001). Using the nyström method to speed up kernel machines. In Leen, T., Dietterich, T., and Tresp, V., editors, Advances in Neural Information Processing Systems, volume 13, pages 682–688. MIT Press. Woodruff, D. P. (2014). Sketching as a tool for numerical linear algebra. Found. Trends Theor. Comput. Sci., 10(1-2):1–157. Yang, T., Li, Y.-f., Mahdavi, M., Jin, R., and Zhou, Z.-H. (2012). Nyström method vs random fourier features: A theoretical and empirical comparison. In Pereira, F., Burges, C. J. C., Bottou, L., and Weinberger, K. Q., editors, Advances in Neural Information Processing Systems, volume 25. Curran Associates, Inc. Yang, Y., Pilanci, M., Wainwright, M. J., et al. (2017). Randomized sketches for kernels: Fast and optimal nonparametric regression. The Annals of Statistics, 45(3):991–1023. 14 A Notation and definitions In this section, we remind some important notations and definitions. In the following, we consider X and Y to be Polish spaces. We denote by ρ the unknown Setting. data distribution on X × Y. We denote by ρX and ρY the marginal distributions of the inputs and outputs, respectively. For an operator A, A# denotes its adjoint, σmax(A) its largest eigen- Linear algebra notations. value and σk(A) its kth largest eigenvalue (if A admits an eigendecomposition). Let B (E) be the space of bounded linear operators in a separable Hilbert space E, given positive semi-definite op- erators A, B ∈ B (E), A (cid:22) B if B − A is positive semidefinite. For any t > 0 and A : E → E, At = A + tIE. Let M be a matrix, Mi: denotes its ith row and M:j its jth column, and M † denotes its Moore-Penrose inverse. Notation for simplified bounds. In order to keep the dependencies of a bound only in the parame- ters of interest, for a, b ∈ R we note a (cid:46) b as soon as there exists a constant c > 0 independents of the parameters of interest such that a ≤ c × b. Least-squares notations. as For any function h : X → Hy, we define its least-squares expected risk (22) The measurable minimizer of E is given by h∗ (x) = Eρ(y|x) [ψ (y)] (Ciliberto et al., 2020, Lemma A.2). Hy . (cid:107)h (x) − ψ (y)(cid:107)2 E (h) = Eρ (cid:104) (cid:105) RKHS notations. We denote by Hx and Hy the RKHSs associated to the input kx : X × X → R and output ky : Y × Y → R kernels, respectively. We denote by φ : X → Hx and ψ : Y → Hy the canonical feature maps φ(x) = kx(x, .) and ψ(y) = ky(y, .), respectively. We denote by H the vv-RKHS associated to the operator-valued kernel K = kIHy . We denote ˆh ∈ H the KRR estimator trained with n couples (xi, yi)n i=1 i.i.d. from ρ. Kernel ridge operators. We define the following operators. • S : f ∈ Hx (cid:55)→ (cid:104)f, φ(*)(cid:105)Hx ∈ L2 (X , ρX ) • T : f ∈ Hy (cid:55)→ (cid:104)f, h∗(*)(cid:105)Hy ∈ L2 (X , ρX ) • CX = Ex [φ(x) ⊗ φ(x)] and CY = Ey [ψ(y) ⊗ ψ(y)], • SX : f ∈ Hx (cid:55)→ 1√ • S# X : α ∈ Rn (cid:55)→ 1√ n • SY : f ∈ Hy (cid:55)→ 1√ • S# Y : α ∈ Rn (cid:55)→ 1√ n (f (x1) , . . . , f (xn))(cid:62) ∈ Rn, (cid:80)n i=1 αiφ(xi) ∈ Hx, n (f (y1) , . . . , f (yn))(cid:62) ∈ Rn, i=1 αiψ(yi) ∈ Hx, (cid:80)n n Sketching operators. • We denote Rx ∈ Rmx×n and Ry ∈ Rmy×n the input and output sketch matrices with mx < n and my < n, X R(cid:62) • (cid:101)CX = S# • (cid:101)KX = RxKX R(cid:62) x RxSX and (cid:101)CY = S# Y R(cid:62) x and (cid:101)KY = RyKY R(cid:62) y . y RySY , B Preliminary results In this section, we present useful preliminary results about kernel ridge operators and sketching properties, as well as the proof Proposition 1 that give the expressions of the SISOKR estimator. 15 Useful kernel ridge operators properties. The following results hold true. (cid:80)n • (cid:98)CX = 1 n • KX = nSX S# • Under the attainability assumption Ciliberto et al. (2020, Lemma B.2, B.4, B.9) show that: i=1 φ(xi) ⊗ φ(xi) = S# X SX and (cid:98)CY = 1 n X and KY = nSY S# Y , i=1 ψ(yi) ⊗ ψ(yi) = S# Y SY , (cid:80)n (cid:4) For all x ∈ X , ˆh(x) = (cid:98)Hφ(x), where (cid:98)H = S# (cid:4) H = T (cid:93)SC †. (cid:4) E[(cid:107)ˆh(x) − h∗(x)(cid:107)2]1/2 = (cid:107)( (cid:98)H − H)S#(cid:107)HS. Y SX (cid:98)C −1 Xλ. Useful sketching properties. We remind some useful notations and provide the expression of (cid:101)PZ, leading to the expression of the SISOKR estimator. (cid:101)PZ expression. Let be the eigenpairs of (cid:101)KZ ranked in the descending order of eigenvalues, pz = rank (cid:101)KZ , and for all 1 ≤ i ≤ pz, ̃ez i = (cid:113) n σi( (cid:101)KZ ) S# Z R(cid:62) z ̃vz i . (cid:110)(cid:16) σi( (cid:101)KZ), ̃vz i (cid:17) , i ∈ [mz] (cid:17) (cid:16) (cid:111) Proposition 2. The ̃ez Furthermore, let (cid:101)Hz = span (cid:0) ̃ez i s are the eigenfunctions, associated to the eigenvalues σi( (cid:101)KZ)/n of (cid:101)CZ. 1, . . . , ̃ez pz (cid:1), the orthogonal projector (cid:101)PZ onto (cid:101)Hz writes as RzSZ . (cid:101)PZ = (RzSZ)# (cid:0)RzSZ(RzSZ)#(cid:1)† (23) (24) (25) (26) (27) (28) (29) (30) (31) (32) Proof. For 1 ≤ i ≤ pz (cid:101)CZ ̃ez i = S# Z R(cid:62) z RzSZ (cid:32)(cid:115) n (cid:33) S# Z R(cid:62) z ̃vz i σi( (cid:101)KZ) (cid:18) 1 n (cid:101)KZ (cid:19) ̃vz i S# Z R(cid:62) z σi( (cid:101)KZ) ̃vz i (cid:115) n = S# Z R(cid:62) z σi( (cid:101)KZ) 1 nσi( (cid:101)KZ) = (cid:113) = Moreover, we verify that span (cid:0) ̃ez ̃ez i . (cid:1) forms an orthonormal basis. Let 1 ≤ i, j ≤ pz, (cid:10) ̃ez i , ̃ez j (cid:11) = Hx S# Z R(cid:62) z ̃vz i , (cid:115) n σj( (cid:101)KZ) S# Z R(cid:62) z ̃vz j (cid:43) Hz σi( (cid:101)KZ) n 1, . . . , ̃ez pz (cid:42)(cid:115) n σi( (cid:101)KZ) n = (cid:113) = (cid:113) = (cid:113) ̃vz(cid:62) i RzSZS# Z R(cid:62) z ̃vz j ̃vz(cid:62) i (cid:18) 1 n (cid:19) ̃vz j (cid:101)KZ σi( (cid:101)KZ)σj( (cid:101)KZ) n σi( (cid:101)KZ)σj( (cid:101)KZ) σj( (cid:101)KZ) ̃vz(cid:62) i ̃vz j σi( (cid:101)KZ)σj( (cid:101)KZ) where δij = 0 if i (cid:54)= j, and 1 otherwise. = δij , Finally, it (cid:101)PZ : f ∈ Hz (cid:55)→ (cid:80)pz is easy to check that i=1 (cid:104)f, ̃ez (cid:101)PZ = nS# i (cid:105)Hz Z R(cid:62) ̃ez i rewrites as ZRzSZ = (RzSZ)# (cid:0)RzSZ(RzSZ)#(cid:1)† z (cid:101)K † the orthogonal projector onto span (cid:0) ̃ez 1, . . . , ̃ez pz (cid:1), i.e. RzSZ . (33) 16 Remark 5. With Rx a sub-sampling matrix, we recover the linear operator Lm introduced in Yang et al. (2012) for the study of Nyström approximation and its eigendecomposition. Moreover, we also recover the projection operator Pm from Rudi et al. (2015) and follow the footsteps of the proposed extension "Nyström with sketching matrices". Algorithm. We here give the proof of Proposition 1 that provides an expression of the SISOKR estimator ̃h as a linear combination of the ψ(yi)s. Proof. Recall that ̃h(x) = (cid:101)PY S# (37), we obtain that Y SX (cid:101)PX ( (cid:101)PX S# X SX (cid:101)PX +λIHx )−1φ(x). By Lemma 1 and especially √ ̃h(x) = n (cid:101)PY S# Y KX R(cid:62) x (cid:0)RxK 2 x + nλRxKX R(cid:62) x (cid:1)† RxSX φ(x) . (34) X R(cid:62) (cid:0)RxK 2 X R(cid:62) x + nλRxKX R(cid:62) x (cid:1)† RxSX φ(x), we have Finally, by Lemma 2 and with α(x) = KX R(cid:62) x that ̃h (x) = (cid:80)n i=1 ̃αi (x) ψ (yi) where ̃α (x) = R(cid:62) y (cid:101)K † Y RyKY KX R(cid:62) x (RxK 2 X R(cid:62) x + nλ (cid:101)KX )†Rxκx X . (35) Before stating and proving Lemmas 1 and 2, and similarly to Rudi et al. (2015), let RxSX = U ΣV # be the SVD of RxSX where U : Rpx → Rmx , Σ : Rpx → Rpx , V : Rpx → Hx, and Σ = diag(σ1(RxSX ), . . . , σpx (RxSX )) with σ1(RxSX ) ≥ . . . ≥ σpx (RxSX ) > 0, U U (cid:62) = Ipx and V #V = Ipx . We are now ready to prove the following lemma for the expansion induced by input sketching. Lemma 1. Let (cid:101)H = (cid:101)PY S# true X SX (cid:101)PX + λIHx )−1. The following two expansions hold Y SX (cid:101)PX ( (cid:101)PX S# (cid:101)H = (cid:101)PY S# Y SX ̃η( (cid:98)CX ) , where ̃η( (cid:98)CX ) = V (V # ˆCX V + λIHx )−1V # and for algorithmic purposes Y KX R(cid:62) x + nλRxKX R(cid:62) x (cid:0)RxK 2 n (cid:101)PY S# X R(cid:62) (cid:101)H = √ (cid:1)† x RxSX . Proof. Let us prove (36) first. ̃H = (cid:101)PY S# = (cid:101)PY S# = (cid:101)PY S# = (cid:101)PY S# X SX (cid:101)PX + λIHx)−1 Y SX (cid:101)PX ( (cid:101)PX S# Y SX V V #(V V #S# Y SX V (V # ˆCX V + λIHx)−1V # Y SX ̃η( (cid:98)CX ) , X SX V V # + λIHx )−1 using the so-called push-through identity (I + U V )−1U = U (I + V U )−1. Now, we focus on proving (37). First, we have that ̃H = (cid:101)PY S# Y SX V (V # ˆCXλV )†V # . (36) (37) (38) (39) (40) (41) (42) Then, using the fact that U has orthonormal columns, U (cid:62) has orthonormal rows and Σ is a full-rank matrix, together with the fact that U U (cid:62) = Ipx and V #V = Ipx, we have that, Y SX V ΣU (cid:62) (cid:16) U ΣV # (cid:98)CXλV ΣU (cid:62)(cid:17)† ̃H = (cid:101)PY S# U ΣV # . (43) Then, since RxSX = U ΣV #, ̃H = (cid:101)PY S# Y SX (RxSX )# (cid:16) RxSX (cid:16) (cid:98)CX + λIHx (cid:17) (RxSX )#(cid:17)† RxSX . Finally, using the fact that (cid:98)CX = S# X SX and KX = nSX S# X , we obtain that √ (cid:101)H = n (cid:101)PY S# Y KX R(cid:62) x (cid:0)RxK 2 X R(cid:62) x + nλRxKX R(cid:62) x (cid:1)† RxSX . 17 (44) (45) Now we state and prove the lemma for the expansion induced by output sketching. Lemma 2. For all x ∈ X , for any h ∈ H that writes as h(x) = then h(x) = (cid:80)n Y RyKY α(x)ψ(yi). i=1 R(cid:62) y (cid:101)K † √ n (cid:101)PY S# Y α(x) with α : X → Rn, Proof. h(x) = = = = √ √ n (cid:101)PY S# nS# Y R(cid:62) Y R(cid:62) Y α(x) y (cid:101)K † y (cid:101)K † √ nS# n (cid:88) (cid:16) nSY S# Y (cid:17) α(x) Y Ry Y RyKY α(x) R(cid:62) y (cid:101)K † Y RyKY α(x)ψ(yi) . (46) (47) (48) (49) i=1 C SISOKR excess-risk bound In this section, we provide the proof of Theorem 1 which gives a bound on the excess-risk of the proposed approximated regression estimator with both input and output sketching (SISOKR). Theorem 1 (SISOKR excess-risk bound). Let δ ∈ [0, 1], n ∈ N sufficiently large such that λ = n−1/(1+γx) ≥ 9κ2 δ ). Under our set of assumptions, the following holds with probability at least 1 − δ n log( n x E[(cid:107) ̃h(x) − h∗(x)(cid:107)2 Hy ] 1 2 ≤ S(n) + c2Aφ ρx ( (cid:101)PX ) + Aψ ρy ( (cid:101)PY ) where S(n) = c1 log(4/δ)n− 1 Aχ ρz ( (cid:101)PZ) = Ez[(cid:107)( (cid:101)PZ − IHz )χ(z)(cid:107)2 Hz 2(1+γx ) (regression error) 1 2 (sketch. error) ] and c1, c2 > 0 are constants independent of n and δ defined in the proofs. Proof. Our proofs consists in decompositions and then applying the probabilistic bounds given in Section E. We have E[(cid:107) ̃h(x) − h∗(x)(cid:107)2]1/2 = (cid:107)( ̃H − H)S#(cid:107)HS (50) with ̃H = (cid:101)PY S# Y SX ̃η( (cid:98)CX ). Then, defining Hλ = HCX (CX + λI)−1, we decompose ̃H − H = (cid:101)PY (cid:16) S# Y SX − Hλ (cid:98)CX (cid:17) ̃η( (cid:98)CX ) + (cid:101)PY Hλ (cid:16) (cid:98)CX ̃η( (cid:98)CX ) − IHx (cid:17) (cid:16) + (cid:101)PY Hλ − H (cid:17) (51) such that with (cid:107)( ̃H − H)S#(cid:107)HS ≤ (A) + (B) + (C) (A) = (B) = (C) = (cid:17) (cid:16) S# Y SX − Hλ (cid:98)CX (cid:16) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)Hλ (cid:13) (cid:13)( (cid:101)PY Hλ − H)C 1/2 (cid:13) X (cid:98)CX ̃η( (cid:98)CX ) − IHx (cid:13) (cid:13) (cid:13)HS (cid:13) (cid:13) (cid:13)HS ̃η( (cid:98)CX )C 1/2 X (cid:13) (cid:13) (cid:13)HS C 1/2 X (cid:17) 18 (52) (53) (54) Then, from Lemmas 3 to 5, we obtain (cid:107)( ̃H − H)S#(cid:107)HS ≤ 2 √ 3M log(4/δ)n− 1 2(1+γx) + 2 √ 3(cid:107)H(cid:107)HS(cid:107)(I − (cid:101)PX )C 1/2 X (cid:107)op + Ey (cid:20)(cid:13) (cid:16) (cid:13) (cid:13) (cid:17) (cid:101)PY − IHy ψ(y) (cid:13) 2 (cid:13) (cid:13) Hy (cid:21)1/2 . Then, notice that (cid:107)(I − (cid:101)PX )C 1/2 X (cid:107)op ≤ (cid:107)(I − (cid:101)PX )C 1/2 (cid:20)(cid:13) (cid:16) (cid:13) (cid:13) = Ex (cid:101)PX − IHx X (cid:107)HS (cid:17) We conclude by defining φ(x) (cid:13) 2 (cid:13) (cid:13) Hx √ √ c1 = 2 c2 = 2 3M, 3(cid:107)H(cid:107)HS. (cid:21)1/2 . (55) (56) (57) (58) (59) Lemma 3 (Bound (A)). Let δ ∈ [0, 1], n ∈ N sufficiently large such that λ = n−1/(1+γ) ≥ 9κ2 n log( n x ) Under our set of assumptions, the following holds with probability at least 1 − δ x (A) ≤ 2M log(4/δ)n− 1 2(1+γx ) . where the constant M depends on κy, (cid:107)H(cid:107)HS, δ. Proof. We have (A) ≤ (cid:16) (cid:13) (cid:13) (cid:13) (cid:124) S# Y SX − Hλ (cid:98)CX (cid:17) C −1/2 Xλ (cid:123)(cid:122) (A.1) (cid:13) (cid:13) (cid:13)HS (cid:125) Moreover, we have × (cid:107)C 1/2 (cid:124) Xλ ̃η( (cid:98)CX )C 1/2 (cid:123)(cid:122) (A.2) X (cid:107)op (cid:125) (A.2) ≤ (cid:107) (cid:98)C 1/2 ≤ (cid:107) (cid:98)C 1/2 Xλ ̃η( (cid:98)CX ) (cid:98)C 1/2 Xλ ̃η( (cid:98)CX ) (cid:98)C 1/2 Xλ (cid:107)op(cid:107) (cid:98)C −1/2 Xλ (cid:107)op(cid:107) (cid:98)C −1/2 Xλ C 1/2 Xλ C 1/2 Xλ (cid:107)2 Xλ (cid:107)2 op op(cid:107)C −1/2 Xλ C 1/2 X (cid:107)op because (cid:107)C −1/2 Finally, by using the probabilistic bounds given in Lemmas 8 and 9, and Lemma 13, we obtain Xλ C 1/2 X (cid:107)op ≤ 1. (A) ≤ 2M log(4/δ)n− 1 2(1+γx ) . Lemma 4 (Bound (B)). If 9 n log n δ ≤ λ ≤ (cid:107)C(cid:107)op, then with probability 1 − δ √ 3(cid:107)H(cid:107)HS(λ1/2 + (cid:107)(I − (cid:101)PX )C 1/2 X (cid:107)op) (B) ≤ 2 Proof. We do a similar decomposition than in Rudi et al. (2015, Theorem 2): (cid:98)CX ̃η( (cid:98)CX ) − IHx = (cid:98)CXλ ̃η( (cid:98)CX ) − λ ̃η( (cid:98)CX ) − IHx = (I − (cid:101)PX ) (cid:98)CXλ ̃η( (cid:98)CX ) + (cid:101)PX (cid:98)CXλ ̃η( (cid:98)CX ) − λ ̃η( (cid:98)CX ) − IHx = (I − (cid:101)PX ) (cid:98)CXλ ̃η( (cid:98)CX ) − λ ̃η( (cid:98)CX ) − ( (cid:101)PX − IHx ), as (cid:101)PX (cid:98)CXλ ̃η( (cid:98)CX ) = (cid:101)PX . 19 (60) (61) (62) (63) (64) (65) (66) (67) (68) Then, we have (B) ≤ (cid:107)Hλ(cid:107)HS ≤ (cid:107)Hλ(cid:107)HS But, And, (cid:13) (cid:13) (cid:13) (cid:16) (cid:16) (cid:17) (cid:98)CX ̃η( (cid:98)CX ) − IHx (cid:13) (cid:13) (cid:13)op X (cid:107)op + λ(cid:107) ̃η( (cid:98)CX )C 1/2 (cid:107)(I − (cid:101)PX ) (cid:98)CXλ ̃η( (cid:98)CX )C 1/2 C 1/2 X X (cid:107)op + (cid:107)( (cid:101)PX − IHx )C 1/2 X (cid:107)op (69) (cid:17) Xλ − IHx (cid:107)Hλ(cid:107)HS ≤ (cid:13) = (cid:13) = λ (cid:13) (cid:13)HC −1 Xλ ≤ 2(cid:107)H(cid:107)HS. (cid:13)H (cid:0)CX C −1 (cid:13)H (CX − CXλ) C −1 Xλ (cid:13) (cid:13)HS + (cid:107)H(cid:107)HS (cid:1)(cid:13) (cid:13)HS + (cid:107)H(cid:107)HS (cid:13) (cid:13)HS + (cid:107)H(cid:107)HS (70) (71) (72) (73) (74) (cid:107)(I − (cid:101)PX ) (cid:98)CXλ ̃η( (cid:98)CX )C 1/2 X (cid:107)op ≤ (cid:107)(I − (cid:101)PX ) (cid:98)C 1/2 Xλ (cid:107)op(cid:107) (cid:98)C 1/2 Xλ ̃η( (cid:98)CX ) (cid:98)C 1/2 Xλ (cid:107)op(cid:107) (cid:98)C −1/2 Xλ C 1/2 X (cid:107)op. (75) And, And, (cid:107)(I − (cid:101)PX ) (cid:98)C 1/2 Xλ (cid:107)op ≤ (cid:107)(I − (cid:101)PX )C 1/2 Xλ (cid:107)op(cid:107)C −1/2 Xλ (cid:98)C 1/2 Xλ (cid:107)op. (cid:107)(I − (cid:101)PX )C 1/2 Xλ (cid:107)op ≤ (cid:107)(I − (cid:101)PX )C 1/2 X (cid:107)op + λ1/2. Moreover, (cid:13) (cid:13) (cid:13)λ ̃η (cid:16) (cid:98)CX (cid:17) C 1/2 X (cid:13) (cid:13) (cid:13)op Xλ (cid:13) (cid:13) (cid:13) (cid:13) (cid:98)C 1/2 (cid:13) (cid:98)C −1/2 (cid:13) (cid:13) (cid:13) Xλ ̃η ≤ λ (cid:13)op ≤ λ1/2 (cid:13) (cid:17) (cid:16) (cid:13) (cid:98)C 1/2 (cid:13) Xλ ̃η (cid:98)CX (cid:16) (cid:17) (cid:98)CX (cid:13) (cid:13) (cid:13)op Xλ (cid:13) (cid:98)C 1/2 (cid:13) (cid:13)op (cid:13) Xλ C 1/2 (cid:13) (cid:98)C −1/2 (cid:13) (cid:13) Xλ C 1/2 (cid:13) (cid:98)C −1/2 (cid:13) (cid:13) (cid:13) (cid:13)op Xλ Xλ . (cid:13) (cid:13) (cid:13)op (cid:13) (cid:13)C −1/2 (cid:13) Xλ C 1/2 X (cid:98)C 1/2 Xλ (76) (77) (cid:13) (cid:13) (cid:13)op Conclusion. Using the probabilistic bounds given in Lemmas 9, 10, and Lemma 13, we obtain √ (B) ≤ 4 3(cid:107)H(cid:107)HS(λ1/2 + (cid:107)(I − (cid:101)PX )C 1/2 X (cid:107)op) Lemma 5 (Bound (C)). We have (cid:20)(cid:13) (cid:16) (cid:13) (cid:13) (C) ≤ Ey (cid:101)PY − IHy (cid:21)1/2 (cid:17) ψ(y) (cid:13) 2 (cid:13) (cid:13) Hy + λ1/2 (cid:107)H(cid:107)HS . Proof. We have (C) = (cid:13) Xλ) − H)C 1/2 (cid:13)( (cid:101)PY H(IHx − λC −1 (cid:13) (cid:13) (cid:13) (cid:13)( (cid:101)PY − IHy )HC 1/2 (cid:13) (cid:13) (cid:13)HS = E[(cid:107)( (cid:101)PY − IHy )h∗(x)(cid:107)2 Hy ≤ X X + λ1/2 (cid:107)H(cid:107)HS ]1/2 + λ1/2 (cid:107)H(cid:107)HS . (cid:13) (cid:13) (cid:13)HS (82) We conclude the proof as follows. Using the fact that h∗ (x) = Eρ(y|x) [ψ (y)], the linearity of (cid:101)PY − IHy and the convexity of (cid:107)*(cid:107)2 Hy (cid:20)(cid:13) (cid:16) (cid:13) (cid:13) , by the Jensen's inequality we obtain that (cid:13) 2 Eρ(y|x) [ψ (y)] (cid:13) (cid:13) (cid:13) 2 h∗ (x) (cid:13) (cid:13) (cid:101)PY − IHy (cid:101)PY − IHy = Ex Ex (cid:17) (cid:17) (cid:21) (cid:21) (78) (79) (80) (81) (cid:20)(cid:13) (cid:16) (cid:13) (cid:13) (cid:20)(cid:13) Eρ(y|x) (cid:13) (cid:13) Hy = Ex (cid:104)(cid:16) (cid:101)PY − IHy ≤ Ex (cid:20) Eρ(y|x) (cid:20)(cid:13) (cid:16) (cid:13) (cid:13) (cid:101)PY − IHy = Ey (cid:20)(cid:13) (cid:16) (cid:13) (cid:13) (cid:101)PY − IHy (cid:17) ψ(y) (cid:21) . (cid:13) 2 (cid:13) (cid:13) Hy 20 Hy (cid:17) (cid:17) ψ (y) (cid:21) (cid:105)(cid:13) 2 (cid:13) (cid:13) Hy (cid:21)(cid:21) ψ (y) (cid:13) 2 (cid:13) (cid:13) Hy D Sketching reconstruction error We provide here a bound on the reconstruction error of a sketching approximation. Theorem 2 (Subgaussian sketching reconstruction error). For δ ∈ (0, 1/e], n ∈ N sufficiently large such that 9 1+γz ≤ (cid:107)CZ(cid:107)op/2, then if n log(n/δ) ≤ n− 1 m ≥ c4 max (cid:16) ν2 z n γz +μz 1+γz , ν4 z log (1/δ) (cid:17) , then with probability 1 − δ where c3, c4 > 0 are constants independents of n, m, δ defined in the proofs. Ez[(cid:107)( (cid:101)PZ − IHz )χ(z)(cid:107)2 Hz ] ≤ c3n− 1−γz (1+γz ) Proof. For t > 0, we have (cid:20)(cid:13) (cid:16) (cid:13) (cid:13) Ez (cid:17) (cid:101)PZ − IHz χ(z) (cid:13) 2 (cid:13) (cid:13) Hz (cid:21) (cid:16)(cid:16) = Tr (cid:101)PZ − IHz (cid:17) (cid:17) Ez [χ(z) ⊗ χ(z)] Lemma 9 gives that, for δ ∈ (0, 1), if 9 = ≤ (cid:16) (cid:16) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:17) (cid:17) (cid:101)PZ − IHz (cid:101)PZ − IHz (cid:13) 2 (cid:13) (cid:13) HS (cid:13) 2 (cid:13) (cid:13) op (cid:13) (cid:13) (cid:98)C −1/2 (cid:13) Zt C 1/2 Zt (cid:13) 2 (cid:13) (cid:13) op × Zt C 1/2 (cid:13) (cid:13)C −1/2 (cid:13) (cid:1) ≤ t ≤ (cid:107)CZ(cid:107)op, then with probability 1 − δ HS Z . C 1/2 Z Zt (cid:98)C 1/2 (cid:13) 2 (cid:13) (cid:13) δ n log (cid:0) n (cid:13) (cid:13) (cid:98)C −1/2 (cid:13) Zt C 1/2 Zt (cid:13) 2 (cid:13) (cid:13) op ≤ 2 . Moreover, since (cid:13) (cid:13) (cid:13)CZt −1/2C 1/2 Z (cid:13) 2 (cid:13) (cid:13) = Tr (cid:0)CZt −1CZ (cid:1) = dZ eff (t), Lemma 11 gives that HS (cid:13) (cid:13) (cid:13)CZt −1/2C 1/2 Z (cid:13) 2 (cid:13) (cid:13) HS ≤ Qzt−γz . Then, using the Lemma 6, and multiplying the bounds, gives (cid:20)(cid:13) (cid:16) (cid:13) (cid:13) Ey (cid:17) (cid:101)PZ − IHy χ(z) (cid:13) 2 (cid:13) (cid:13) Hz (cid:21) ≤ 6Qzt1−γz . (16) (17) (83) (84) (85) Finally, choosing t = n− 1 bzQzt−(γz+μz) (from Lemmas 11 and 12), allows to conclude the proof. 1+γ , defining c3 = 6Qz, c4 = 576C2bzQz, and noticing N ∞ z (t) ≤ Lemma 6. Let N ∞ n log (cid:0) n 9 δ z (t) be as in Definition 2. For all δ ∈ (0, 1/e], 9 n log (cid:0) n δ (cid:1) ≤ t ≤ (cid:107)CZ(cid:107)op − (cid:1) and mz ≥ max (cid:0)432C2ν2N ∞ z (t), 576C2ν4 log (1/δ)(cid:1), with probability at least 1 − δ, (cid:16) (cid:13) (cid:13) (cid:13) (cid:101)PZ − IHz (cid:17) (cid:98)C 1/2 Zt (cid:13) 2 (cid:13) (cid:13) op ≤ 3t . Proof. Using Propositions 3 and 7 from Rudi et al. (2015), we have, for t > 0, (cid:16) (cid:13) (cid:13) (cid:13) (cid:101)PZ − IHz (cid:17) (cid:98)C 1/2 Zt (cid:13) 2 (cid:13) (cid:13) op ≤ t 1 − βz(t) , with βz(t) = σmax (cid:16) (cid:98)C −1/2 Zt (cid:16) (cid:98)CZ − (cid:101)CZ (cid:17) (cid:98)C −1/2 Zt (cid:17) . (86) (87) 21 Now, applying Lemma 7, with the condition mz ≥ max (cid:0)432C2ν2N ∞ z (t), 576C2ν4 log (1/δ)(cid:1) , we obtain βz(t) ≤ 2/3, which gives (cid:16) (cid:13) (cid:13) (cid:13) (cid:101)PZ − IHy (cid:17) (cid:98)C 1/2 Zt (cid:13) 2 (cid:13) (cid:13) op ≤ 3t . (88) (89) Lemma 7. Let Rz be as in Definition 1 and N ∞ n log (cid:0) n 9 least 1 − δ, (cid:1) ≤ t ≤ (cid:107)CZ(cid:107)op − 9 n log (cid:0) n δ δ (cid:1) and mz ≥ max (6N ∞ z (t) as in Definition 2. For all δ ∈ (0, 1/e], z (t), log (1/δ)), with probability at (cid:13) (cid:13) (cid:98)C −1/2 (cid:13) Zt (cid:16) (cid:98)CZ − (cid:101)CZ (cid:17) (cid:98)C −1/2 Zt (cid:13) (cid:13) (cid:13)op ≤ C √ 2 2ν(cid:112)6N ∞ z (t) + 8ν2(cid:112)log (1/δ) √ mz , (90) where C is a universal constant independent of N ∞ z (t), δ and mz. Proof. We define the following random variables Wi = (cid:114) mz n n (cid:88) j=1 (Rz)ij (cid:98)C −1/2 Zt χ(zj) ∈ Hz for i = 1, . . . mz. (91) In order to use the concentration bound given in Theorem 3, we show that the Wis are i.i.d. weakly square integrable centered random vectors with covariance operator Σ, sub-Gaussian, and pre- Gaussian. The Wis are weakly square integrable. (cid:112) mz n (cid:80)n j=1(Rz)ijv(zj). Hence, using the definition of a sub-Gaussian sketch, we have Let u ∈ Hz and v = (cid:98)C −1/2 Zt u, we have that (cid:104)Wi, u(cid:105)Hz = (cid:107)(cid:104)Wi, u(cid:105)Hz (cid:107)2 (cid:2)|(cid:104)Wi, u(cid:105)Hz |2(cid:3) L2(P) = ER 1 n = n (cid:88) j=1 < +∞ . v(zj)2 (92) (93) (94) The Wis are subgaussian. we have Let c ∈ R, using the independence and sub-Gaussianity of the Rzij , ERz [exp (c(cid:104)Wi, u(cid:105)Hz )] = ERz exp    n (cid:88)   Rzij v(zj)   (cid:114) mz c n = ≤ n (cid:89) j=1 n (cid:89) j=1 = exp j=1 (cid:18) (cid:20) ERz exp (cid:114) mz c n (cid:19)(cid:21) Rzij v(zj) (cid:19) ν2 mz  exp (cid:18) c2mzv(zj)2 2n   c2ν2 2n n (cid:88) j=1 v(zj)2  = exp (cid:18) c2ν2 2 (cid:107)(cid:104)Wi, u(cid:105)Hz (cid:107)2 L2(P) (cid:19) . 22 Hence, (cid:104)Wi, u(cid:105)Hz is a 1 tion of sub-Gaussian random variables gives 2 ν2 (cid:107)(cid:104)Wi, u(cid:105)Hz (cid:107)2 L2(P)-subgaussian random variable. Then, the Orlicz condi- (cid:34) (cid:32) ER exp (cid:104)Wi, u(cid:105)2 8ν2 (cid:107)(cid:104)Wi, u(cid:105)Hz (cid:107)2 Hz L2(P) (cid:33) (cid:35) − 1 ≤ 1 . We deduce that (cid:107)(cid:104)Wi, u(cid:105)Hz (cid:107)φ2 ≤ 2 √ 2ν (cid:107)(cid:104)Wi, u(cid:105)Hz (cid:107)L2(P) . We conclude that the Wis are subgaussian with B = 2 √ 2ν. (95) (96) The Wis are pre-gaussian. We define Z = (cid:112) mz i.i.d.∼ N (0, 1/mz). Z is a Gaussian random variable that admits the same covariance operator as the Wis. So, the Wi are pre-Gaussian. Zt χ(zj), with Gj j=1 Gj (cid:98)C −1/2 (cid:80)n n Because the Wis are i.i.d. weakly square integrable centered Applying concentration bound. random variables, we can apply Theorem 3, and by using also Lemma 14, and the condition mz ≥ max (6N ∞ z (t), log (1/δ)), we obtain (cid:13) (cid:13) (cid:98)C −1/2 (cid:13) Zt (cid:16) (cid:98)CZ − (cid:101)CZ (cid:17) (cid:98)C −1/2 Zt (cid:13) (cid:13) (cid:13)op ≤ C √ 2 2ν(cid:112)6N ∞ z (t) + 8ν2(cid:112)log (1/δ) √ mz . (97) E Probabilistic bounds In this section, we provide all the probabilistic bounds used in our proofs. In particular, we restate bounds from other works for the sake of providing a self-contained work. We order them in the same in order of appearance in our proofs. Lemma 8 (Bound (A.1) = Let δ ∈ [0, 1], n ∈ N sufficiently large such that λ = n−1/(1+γx) ≥ 9κ2 assumptions, the following holds with probability at least 1 − δ S# Y SX − Hλ (cid:98)CX C −1/2 Xλ (cid:17) (cid:13) (cid:13) (cid:13)HS (cid:16) (cid:13) (cid:13) (cid:13) (Ciliberto et al., 2020, Theorem B.10)). x n log( n x ) Under our set of where the constant M depends on κy, (cid:107)H(cid:107)HS, δ. (A.1) ≤ M log(4/δ)n− 1 2(1+γx ) (98) Proof. This lemma can be obtained from (Ciliberto et al., 2020, Theorem B.10), by noticing that the bound of Theorem B.10 is obtained by upper bounding the sum of (A.1) and a positive term, such that the bound of (Ciliberto et al., 2020, Theorem B.10) is an upper bound of (A.1). Lemma 9 (Bound (cid:107) (cid:98)C −1/2 with probability 1 − δ Xλ C 1/2 Xλ (cid:107)op (Rudi et al., 2013, Lemma 3.6)). If 9 n log n δ ≤ λ ≤ (cid:107)C(cid:107)op, then (cid:107) (cid:98)C −1/2 Xλ C 1/2 Xλ (cid:107)op ≤ √ 2. Lemma 10 (Bound (cid:107)C −1/2 Xλ (cid:98)C 1/2 Xλ (cid:107)op). If 9 n log n δ ≤ λ ≤ (cid:107)C(cid:107)op, then with probability 1 − δ (cid:107)C −1/2 Xλ (cid:98)C 1/2 Xλ (cid:107)op ≤ (cid:114) 3 2 . 23 (99) (100) Proof. We have (cid:107)C −1/2 Xλ (cid:98)C 1/2 Xλ (cid:107)op = (cid:107)C −1/2 Xλ (cid:98)CXλC −1/2 op Xλ (cid:107)1/2 Xλ ( (cid:98)CX − CX )C −1/2 Xλ ( (cid:98)CX − CX )C −1/2 Xλ (cid:107)1/2 op Xλ (cid:107)op = (cid:107)I + C −1/2 ≤ ≤ (cid:16) 1 + (cid:107)C −1/2 (cid:114) 3 2 (cid:17)1/2 (101) (102) (103) (104) with probability at least 1 − δ, where the last inequality is from Rudi et al. (2013, Lemma 3.6). Theorem 3 (Subgaussian concentration bound (Koltchinskii and Lounici, 2017, Theorem 9)). Let W, W1, . . . , Wm be i.i.d. weakly square integrable centered random vectors in a separable Hilbert space Hz with covariance operator Σ. If W is sub-Gaussian and pre-Gaussian, then there exists a constant C > 0 such that, for all τ ≥ 1, with probability at least 1 − e−τ , (cid:32) (cid:33) (cid:114) (cid:107) ˆΣ − Σ(cid:107) ≤ C(cid:107)Σ(cid:107) B , (105) where B > 0 is the constant such that (cid:13) (cid:13)(cid:104)W, u(cid:105)Hy (cid:13)(cid:104)W, u(cid:105)Hy (cid:13) (cid:13)L2(P) for all u ∈ Hz. r(Σ) m ∨ ∨ B2 r(Σ) m ≤ B (cid:13) (cid:13) (cid:13)φ2 (cid:114) τ m ∨ B2 τ m F Auxiliary results and definitions Definition 2. For t > 0, we define the random variable Nz(t) = (cid:104)χ(z), C −1 Zt χ(z)(cid:105)Hz with z ∈ Z distributed according to ρZ and let eff (t) = E [Nz(t)] = Tr (cid:0)CZC −1 dZ Zt (cid:1) , N ∞ z (t) = sup z∈Z Nz(t) . (106) (107) x , dX eff (t), γx, Qy, N ∞ We note N ∞ tively. Lemma 11. When Assumption 3 holds then we have y , dY eff (t), γy, Qy for the input and output kernels kx, ky, respec- Proof. We have eff (t) ≤ Qzt−γz . dZ (cid:1) eff (t) = Tr (cid:0)CZC −1 dZ ≤ Tr (C γz ≤ Qzt−γz . Zt Z ) (cid:107)C 1−γz Z C −1 Zt (cid:107)op Lemma 12. When Assumption 4 holds then we have z (t) ≤ bzdZ N ∞ eff (t)t−μz . Proof. We have N ∞ z (t) = sup z∈Z (cid:104)χ(z), C −1 Zt χ(z)(cid:105)Hz Z ) Zt C 1−μz Zt CZ)(cid:107)C −μz Zt (cid:107)op ≤ bz Tr(C −1 ≤ bz Tr(C −1 ≤ bzdZ eff (t)t−μz . 24 (108) (109) (110) (111) (112) (113) (114) (115) (116) We recall the following deterministic bound. Lemma 13 (Bound (cid:107) (cid:98)C 1/2 Xλ ̃η( (cid:98)CX ) (cid:98)C 1/2 Xλ (cid:107)op (Rudi et al., 2015, Lemma 8)). For any λ > 0, (cid:107) (cid:98)C 1/2 Xλ ̃η( (cid:98)CX ) (cid:98)C 1/2 Xλ (cid:107)op ≤ 1. (117) We introduce here some notations and definitions from Koltchinskii and Lounici (2017). Let W be a centered random variable in Hz, W is weakly square integrable iff (cid:107)(cid:104)W, u(cid:105)Hz (cid:107)2 L2(P) := E (cid:2)|(cid:104)W, u(cid:105)Hz |2(cid:3) < +∞, for any u ∈ Hz. Moreover, we define the Orlicz norms. For a convex nondecreasing function φ : R+ → R+ with φ(0) = 0 and a random variable η on a probability space (Ω, A, P), the φ-norm of η is defined as (cid:107)η(cid:107)φ = inf {C > 0 : E [φ (|η|/C)] ≤ 1} . The Orlicz φ1- and φ2-norms coincide to the functions φ1(u) = eu − 1, u ≥ 0 and φ2(u) = eu2 − 1, u ≥ 0. Finally, Koltchinskii and Lounici (2017) introduces the definitions of sub-Gaussian and pre-Gaussian random variables in a separable Banach space E. We focus on the case where E = Hz. Definition 3. A centered random variable X in Hz will be called sub-Gaussian iff, for all u ∈ Hz, there exists B > 0 such that (118) (cid:107)(cid:104)X, u(cid:105)Hz (cid:107)φ2 ≤ B (cid:107)(cid:104)X, u(cid:105)Hz (cid:107)L2(P) . (119) Definition 4. A weakly square integrable centered random variable X in Hz with covariance operator Σ is called pre-Gaussian iff there exists a centered Gaussian random variable Y in Hz with the same covariance operator Σ. Lemma 14 (Expectancy, covariance, and intrinsic dimension of the Wis). Defining Wi = (cid:112) mz for i = 1, . . . mz where Rz is a subgaussian sketch, the n j=1(Rz)ij (cid:98)C −1/2 Zt χ(zj) ∈ Hz (cid:80)n following hold true and for δ ∈ (0, 1), if 9 n log (cid:0) n δ (cid:1), then with probability 1 − δ ERz [Wi] = 0 Σ = ERz [Wi ⊗ Wi] = (cid:98)C −1/2 Zt (cid:98)CZ (cid:98)C −1/2 Zt (cid:98)Σ = (cid:104)f, Wi(cid:105)Hz Wi = (cid:98)C −1/2 Zt (cid:101)CZ (cid:98)C −1/2 Zt mz(cid:88) i=1 1 mz (cid:1) ≤ t ≤ (cid:107)CZ(cid:107)op − 9 (cid:2)(cid:107)Xi(cid:107)Hz ERz (cid:107)Σ(cid:107)op r (Σ) = n log (cid:0) n (cid:3)2 δ ≤ 6N ∞ z (t) . Proof. First, it is straightforward to check that 1 mz mz(cid:88) i=1 (cid:104)f, Wi(cid:105)Hz Wi = (cid:98)C −1/2 Zt (cid:101)CZ (cid:98)C −1/2 Zt . Then, since ERz [(Rz)i:] = 0, ERz [Wi] = (cid:114) mz n (cid:98)C −1/2 Zt S# Z ERz [(Rz)i:] = 0 . Then, (Wi ⊗ Wi) f = (cid:104)f, Wi(cid:105)Hz Wi √ (cid:16) = (cid:104)f, = mz mz (cid:98)C −1/2 (Rz)(cid:62) Z (Rz)i:(cid:105)Hz (cid:17) Zt S# i: SZ (cid:98)C −1/2 (cid:0)mzRzi: (Rz)(cid:62) Zt f i: (cid:98)C −1/2 Zt S# (cid:1) SZ (cid:98)C −1/2 Zt f , Z (Rz)i: = (cid:98)C −1/2 Zt S# Z √ mz (cid:98)C −1/2 Zt S# Z (Rz)i: 25 (120) (121) (122) (123) (124) (125) (126) (127) (128) (129) and since ERz (cid:3) = In, (cid:2)mz(Rz)i:R(cid:62) zi: Σ = ERz [Wi ⊗ Wi] Zt S# ERz (cid:98)CZ (cid:98)C −1/2 = (cid:98)C −1/2 = (cid:98)C −1/2 Z Zt Zt (cid:2)mzRzi: R(cid:62) . zi: (cid:3) SZ (cid:98)C −1/2 Zt Then, ERz (cid:2)(cid:107)Xi(cid:107)Hz (cid:3)2 ≤ ERz (cid:104) (by Jensen's inequality) = mz ERz Z Rzi: , (cid:98)C −1/2 Zt S# Z Rzi: (cid:105)Hz (cid:105) (cid:107)Xi(cid:107)2 Hz (cid:104) (cid:104) (cid:98)C −1/2 Zt S#  (cid:104) Rzij χ(zj), (cid:105)  n (cid:88) l=1 Rzil (cid:98)C −1 Zt χ(zl)(cid:105)Hz   Rzij Rzil(cid:104)χ(zj), (cid:98)C −1 Zt χ(zl)(cid:105)Hy  = mz n = = mz n mz n = Tr n (cid:88) j=1 n (cid:88)   j,l=1 ERz ERz n (cid:88) 1 mz (cid:16) j=1 (cid:98)C −1 Zt (cid:98)CZ (cid:104)χ(zj), (cid:98)C −1 Zt χ(zj)(cid:105)Hz (cid:17) (cid:98)C 1/2 Z = ≤ Zt (cid:13) (cid:13) (cid:98)C −1/2 (cid:13) (cid:13) (cid:13) (cid:98)C −1/2 (cid:13) Zt C 1/2 Zt (cid:13) 2 (cid:13) (cid:13) HS (cid:13) 2 (cid:13) (cid:13) op (cid:13) (cid:13)C −1/2 (cid:13) Zt (cid:98)C 1/2 Z (cid:13) 2 (cid:13) (cid:13) HS . But, (cid:13) (cid:13)C −1/2 (cid:13) Zt (cid:98)C 1/2 Z (cid:13) 2 (cid:13) (cid:13) HS (cid:16) = Tr C −1 Zt (cid:98)CZ (cid:32) (cid:32) = Tr C −1 Zt (cid:17) 1 n n (cid:88) i=1 (cid:33)(cid:33) χ(zi) ⊗ χ(zi) n (cid:88) i=1 n (cid:88) i=1 n (cid:88) Tr (cid:0)C −1 Zt (χ(zi) ⊗ χ(zi))(cid:1) (cid:10)χ(zi), C −1 Zt χ(zi)(cid:11) Hy Nzi(t) = = = 1 n 1 n 1 n (130) (131) (132) (133) (134) (135) (136) (137) (138) (139) (140) (141) (142) (143) (144) (145) (146) Then, from Lemma 9, for δ ∈ (0, 1), and 9 ≤ N ∞ i=1 z (t) . n log (cid:0) n (cid:1) ≤ t ≤ (cid:107)CZ(cid:107)op, then with probability 1 − δ, (cid:3)2 (cid:2)(cid:107)Xi(cid:107)Hz ≤ 2N ∞ z (t). δ (147) ERz Then, (cid:107)Σ(cid:107)op = (cid:13) (cid:13) (cid:98)C −1/2 (cid:13) Y t (cid:98)C 1/2 Y (cid:13) 2 (cid:13) (cid:13) op ≥ 1/3 for t ≤ 2 (cid:13) (cid:13) (cid:13) (cid:98)CY (cid:13) (cid:13) (cid:13)op . We conclude that ERz (cid:3)2 (cid:2)(cid:107)Wi(cid:107)Hz (cid:107)Σ(cid:107)op ≤ 6N ∞ z (t). 26 (148) Figure 2: Test MSE with respect to mx and my for a SIOKR and ISOKR model respectively with (2 * 10−3)-SR input and output sketches. Table 4: Multi-label data sets description. Data set n nte nf eatures nlabels Bibtex Bookmarks 4880 60000 2515 27856 1836 2150 159 298 Finally, in order to obtain a condition on t that does not depend on empirical quantities, we use (cid:1) ≤ t(cid:48) ≤ (cid:107)CZ(cid:107)op, then CZt(cid:48) (cid:22) 2 (cid:98)CZt(cid:48), which implies Lemma 9 which gives that, for any 9 (cid:13) n log (cid:0) n (cid:13) (cid:13) (cid:98)CZ . n log (cid:0) n δ ≥ (cid:107)CZ(cid:107)op −t(cid:48). Now, taking t(cid:48) = 9 (cid:1), we obtain (cid:107)CZ(cid:107)op − 9 n log (cid:0) n (cid:13) (cid:13) (cid:13) (cid:98)CZ (cid:1) ≤ 2 2 δ δ (cid:13) (cid:13) (cid:13)op (cid:13) (cid:13) (cid:13)op G Contributions and Previous Work Excess-risk bounds for sketched kernel ridge regression have been provided in Rudi et al. (2015) in the case of Nyström subsampling, and scalar-valued ridge regression. Our proofs will consist in similar derivations than in Rudi et al. (2015). Nevertheless, we cannot apply directly their results in our setting. More precisely, we do the following additional derivations. 1. Additional decompositions to deal with: (a) vector-valued regression instead of scalar-valued regression as in Rudi et al. (2015) (b) input and output approximated feature maps 2. Novel probabilistic bounds to deal with gaussian and subgaussian sketching instead of Nyström sketching as in Rudi et al. (2015). H Additional Experiments H.1 Simulated Data Set for Least Squares Regression We report here some results about statistical performance on the synthetic data set described in Section 5 for SIOKR and ISOKR models. H.2 More Details about Multi-Label Classification Data Set In this section, you can find more details about training and testing sizes, number of features of the inputs and number of labels to predict of Bibtex and Bookmarks data sets in Table 4. 27 0.050.0100.0150.0200.0250.0300.0mx0.9600.9620.9640.9660.9680.970MSEIOKRSIOKR0.050.0100.0150.0200.0250.0300.0my0.9600.9650.9700.9750.9800.9850.990MSEIOKRISOKR
http://arxiv.org/abs/2302.10109v1
2023-02-20T17:12:00
2023-02-20T17:12:00
NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion
Novel view synthesis from a single image requires inferring occluded regions of objects and scenes whilst simultaneously maintaining semantic and physical consistency with the input. Existing approaches condition neural radiance fields (NeRF) on local image features, projecting points to the input image plane, and aggregating 2D features to perform volume rendering. However, under severe occlusion, this projection fails to resolve uncertainty, resulting in blurry renderings that lack details. In this work, we propose NerfDiff, which addresses this issue by distilling the knowledge of a 3D-aware conditional diffusion model (CDM) into NeRF through synthesizing and refining a set of virtual views at test time. We further propose a novel NeRF-guided distillation algorithm that simultaneously generates 3D consistent virtual views from the CDM samples, and finetunes the NeRF based on the improved virtual views. Our approach significantly outperforms existing NeRF-based and geometry-free approaches on challenging datasets, including ShapeNet, ABO, and Clevr3D.
[ "Jiatao Gu", "Alex Trevithick", "Kai-En Lin", "Josh Susskind", "Christian Theobalt", "Lingjie Liu", "Ravi Ramamoorthi" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10109v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10109v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.LG" ]
NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Jiatao Gu 1 Alex Trevithick 2 Kai-En Lin 2 Josh Susskind 1 Christian Theobalt 3 Lingjie Liu 3 4 Ravi Ramamoorthi 2 3 2 0 2 b e F 0 2 ] V C . s c [ 1 v 9 0 1 0 1 . 2 0 3 2 : v i X r a Abstract Novel view synthesis from a single image requires inferring occluded regions of objects and scenes whilst simultaneously maintaining semantic and physical consistency with the input. Existing ap- proaches condition neural radiance fields (NeRF) on local image features, projecting points to the input image plane, and aggregating 2D features to perform volume rendering. However, under severe occlusion, this projection fails to resolve uncertainty, resulting in blurry renderings that lack details. In this work, we propose NerfD- iff, which addresses this issue by distilling the knowledge of a 3D-aware conditional diffusion model (CDM) into NeRF through synthesizing and refining a set of virtual views at test-time. We further propose a novel NeRF-guided distil- lation algorithm that simultaneously generates 3D consistent virtual views from the CDM sam- ples, and finetunes the NeRF based on the im- proved virtual views. Our approach significantly outperforms existing NeRF-based and geometry- free approaches on challenging datasets includ- ing ShapeNet, ABO, and Clevr3D. Please see the supplementary website (https://jiataogu. me/nerfdiff) for video results. 1. Introduction Novel view synthesis is a core component of computer graphics and vision applications, including virtual and aug- mented reality, immersive photography, and the creation of digital replicas. Given a few input views of an object or a scene, one seeks to synthesize new views from other viewing directions. This problem is challenging since novel views must account for occlusions and unseen regions. This prob- 1Apple 2University of California, San Diego 3Max Planck Institute for Informatics, Germany 4University of Pennsylvania. Correspondence to: Jiatao Gu <[email protected]>, Lingjie Liu <[email protected]>. Preprint. In progress Figure 1. Renderings from our method in comparison to the SoTA VisionNeRF (Lin et al., 2023). Note how our method can predict sharp renderings despite large occlusion, whereas VisionNeRF cannot handle this uncertainty and shows implausible blurring. lem has a long history, going back to early work in image- based rendering (IBR) (Chen & Williams, 1993; Gortler et al., 1996; Levoy & Hanrahan, 1996; McMillan & Bishop, 1995). However, IBR methods can only produce subopti- mal results and are often scene-specific. Recently, neural radiance fields (NeRF) (Mildenhall et al., 2020) have shown high-quality novel view synthesis results, but NeRF requires tens or hundreds of images for overfitting a scene and has no generalization ability to infer new scenes. This work focuses on novel view synthesis from a single im- age. In attempts to do so, generalizable NeRF models (Tre- vithick & Yang, 2021; Yu et al., 2021; Lin et al., 2023) have been proposed, whereby the NeRF representation is conditioned by the projection of 3D points and gathering of corresponding image features. These approaches produce good results, especially for cameras near the input. How- ever, when the target views are far from the input, these approaches yield blurry results. The uncertainty of large un- seen regions in novel views cannot be resolved by projection to the input image. A distinct line of work addresses the un- certainty issue in single-image view synthesis by leveraging Ground-truthVisionNeRF (Lin et.al., 2023)OursInput Image NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion 2D generative models to predict novel views conditioned on the input view (Rombach et al., 2021c; Watson et al., 2022). However, these approaches are only able to synthesize par- tially 3D-consistent images. In this paper, we propose NerfDiff, a training-finetuning framework for synthesizing multi-view consistent and high- quality images given single-view input. Concretely, at the training stage, we jointly train a camera-space triplane- based NeRF together with a 3D-aware conditional diffusion model (CDM) on a collection of scenes. We initialize the NeRF representation given the input image at the finetun- ing stage. Then, we finetune the parameters from a set of virtual images predicted by the CDM conditioned on the NeRF-rendered outputs. We found that a naive finetuning strategy of optimizing the NeRF parameters directly using the CDM outputs would lead to subpar renderings, as the CDM outputs tend to be multi-view inconsistent. Therefore, we propose NeRF-guided distillation, which updates the NeRF representation and guides the multi-view diffusion process in an alternating fashion. In this way, the uncertainty in single-image view synthesis can be resolved by filling in unseen information from CDM; in the meantime, NeRF can guide CDM for multi-view consistent diffusion. An illustration of the proposed pipeline is shown in Figure 2. We evaluate our approach on three challenging benchmarks. Our results indicate that the proposed NerfDiff signifi- cantly outperforms all the existing baselines, achieving high- quality generation with multi-view consistency. See sup- plementary materials for video results. We summarize the main contributions as follows: • We develop a novel framework – NerfDiff which jointly learns an image-conditioned NeRF and a CDM, and at test time finetunes the learned NeRF using a multi-view consistent diffusion process (§ 4.3,§ 4.4). • We introduce an efficient image-conditioned NeRF rep- resentation based on camera-aligned triplanes, which is the core component enabling efficient rendering and finetuning from the CDM (§ 4.1). • We propose a 3D-aware CDM, which integrates vol- ume rendering into 2D diffusion models, facilitating generalization to novel views (§ 4.2). 2. Related Work 2.1. Diffusion models for 3D generation Diffusion-based generative models (Sohl-Dickstein et al., 2015; Ho et al., 2020; Song & Ermon, 2019) have re- cently become state-of-the-art on image synthesis (Dhari- wal & Nichol, 2021) and have shown remarkable results in handling highly under-constrained tasks such as text-to- image (Ramesh et al., 2022; Rombach et al., 2021a; Saharia et al., 2022) and text-to-video generation (Ho et al., 2022). More recently, diffusion models have also been proven effec- tive in 3D generation tasks. On the one hand, many methods propose to directly apply diffusion in 3D space, including point clouds (Nichol et al., 2022), voxels (M ̈uller et al., 2022a) and fields (Zhuang et al., 2023). Some of them learn diffusion in a latent space derived from 3D space (Bautista et al., 2022; Shue et al., 2022). However, a clear limitation of these approaches is that it requires 3D ground truth for learning the diffusion process, which is hard to acquire in the real environment. On the other hand, several works propose to learn 3D representations from diffusion in 2D space. For example, Li et al. (2022) learns the geometry based on a 2-view diffusion model; Anciukevicius et al. (2022) designs an architecture that generates and renders an intermediate 3D representation for each diffusion step. Con- currently related to our method, a series of work (Poole et al., 2022; Wang et al., 2022; Lin et al., 2022; Zhou & Tulsiani, 2022; Deng et al., 2022) have proposed score distillation that learns 3D representation directly from pre-trained 2D diffusion models. 2.2. Single-view Novel View Synthesis Methods beyond Neural Fields Most initial attempts at single-view 3D reconstruction relied on ground truth train- ing data to estimate the geometry of objects. These methods typically mapped an image to its depth or directly to a 3D shape (Eigen et al., 2014; Saxena et al., 2009; Fan et al., 2017; Tatarchenko et al., 2017; Tulsiani et al., 2017). Some methods (Kato et al., 2018; Yan et al., 2016; Loper & Black, 2014) provide 3D reconstruction estimates without ground truth 3D supervision using differentiable renderers; how- ever, these methods were limited to reconstructing only the geometry, not the appearance. Recently, other methods have allowed the rendering of novel views without regard for multiview consistency. For example, ENR (Dupont et al., 2020) utilizes convolutions with a projection to de- code 3D voxel features to RGB. Targeting more complex scenes, SynSin (Wiles et al., 2020) makes use of a differen- tiable point cloud renderer and an inpainter to extrapolate to unseen areas. InfiniteNature (Liu et al., 2021) utilizes estimated depth to iteratively inpaint novel views along a camera trajectory. Other works, such as GeoFree (Rombach et al., 2021b) and Pixelsynth (Rockwell et al., 2021), utilize an autoregressive prior to inferring unseen areas of the scene. Finally, light-field-based methods like Sajjadi et al. (2022) and Suhail et al. (2022) condition transformers on features from input images and query rays to directly output colors or directly invert into a latent space (Sitzmann et al., 2021). Methods based on Neural Fields Many methods pro- pose to use neural fields (e.g., neural radiance field (NeRF, Mildenhall et al., 2020)) for this task. For example, Sin- NeRF (Xu et al., 2022) renders novel views near the input image using pseudo geometry. On the other hand, Sitzmann NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Figure 2. NerfDiff incorporates a training and finetuning pipeline. We first learn the single-image NeRF and 2D CDM, which are conditioned on the single-image NeRF renderings (left). We use the learned network parameters at test time to predict an initial NeRF representation for finetuning. The NeRF-guided denoised images from the frozen CDM then supervise the NeRF in turn (right). et al. (2019a); Rematas et al. (2021); Jang & Agapito (2021); M ̈uller et al. (2022b) incorporate global latent codes and apply test-time tuning to refine these codes. This process is very similar to inversion into the latent space of 3D NeRF- based GANs (Gu et al., 2021; Chan et al., 2021; Bautista et al., 2022; Cai et al., 2022). Note that it requires (esti- mated) camera poses at test time, which hinders high-quality results. Furthermore, the global bottleneck hinders captur- ing fine details, and due to the optimization of the input view, such methods also cannot handle occlusion appropriately. Finally, image-conditioned methods (e.g., pixelNeRF (Yu et al., 2021) and VisionNeRF (Lin et al., 2023)) directly utilize local image features to condition NeRF and are the most relevant to our method. Note that, like pixelNeRF, our method can perform view synthesis without pose annotation at test time. We provide background on this type of method in the next section. 3. Background 3.1. Image-conditioned NeRF Neural radiance fields (NeRF, Mildenhall et al., 2020) have been proven remarkably effective for novel view synthesis. NeRF defines an implicit function fθ : (x, d) → (c, σ) given a spatial location x ∈ R3 and ray direction d ∈ S2, where θ are the learnable parameters, c and σ are the color and density, respectively. To render a posed image I, we march a camera ray through each pixel r(t) = xo + td (where xo is the camera origin) and calculate its color via an approximation of the volume rendering integral: Iθ(r) = (cid:90) tf tn ω(t) * cθ(r(t), d) dt, (1) where ω(t) = e− (cid:82) t σθ(r(s)) dsσθ(r(t)), tn and tf are the near and far bounds of the ray, respectively. When multi- view images are available, θ can be easily optimized with tn the standard MSE loss: LNeRF θ = EI∼data,r∼R(I)(cid:107)Iθ(r) − I(r)(cid:107)2 2, (2) where R(I) is the set of rays that composes I. To cap- ture high-frequency details, NeRF encodes x and d with sinusoidal positional functions ξpos(x), ξpos(d). Recently, studies have shown that encoding functions with local struc- tures like triplanes (Chan et al., 2021) achieves significantly faster inference speed without quality loss. The training of NeRF, i.e., the optimization of Eq. (2), re- quires tens or hundreds of images along with their cam- era parameters to provide sufficient multi-view constraints. However, in reality, such multi-view data is not easily ac- cessible. Therefore, this work focuses on recovering neural radiance fields from a single image without knowing its absolute camera pose. As this problem is under-constrained, it requires 3D inductive biases learned from a large set of scenes similar to the target scene. Following this philoso- phy, pixel-aligned NeRFs (Yu et al., 2021; Lin et al., 2023) encode 3D information with local 2D image features so that the learned representations can generalize to unseen scenes after being trained on a large number of scenes. PixelNeRF Take PixelNeRF (Yu et al., 2021) as an exam- ple. Given an input image I s, PixelNeRF first extracts a feature volume W = eψ(I s) where eψ is a learnable image encoder. Then, for any 3D point x ∈ R3 in the input cam- era space, its corresponding image features are obtained by projecting x onto the image plane as P(x) ∈ [−1, 1]2 with known intrinsic matrix, and then bilinearly interpolating the feature volume as ξW (x) = W (P(x)). The image features will be combined with the position x and view direction d to infer the color and density. Next, similar to NeRF, the color of a camera ray is calculated via volume rendering (Eq. 1). Such a model is trained over a collection of scenes, and for each scene, at least two views are needed to form the training pairs (I s, I) for reconstruction: θ,ψ = E(I s,I)∼data,r∼R(I)(cid:107)Iθ,W (r) − I(r)(cid:107)2 LIC 2, (3) Training PhaseFinetuning PhaseDenoising LossRendering LossInput viewInput viewImage-conditioned NeRFFinetuning LossTarget viewImage-conditioned NeRFConditional Diffusion ModelTarget viewNoisy target viewConditional Diffusion ModelCDM sampledNeRF Rendered NeRF RenderedDenoisedInput ViewTarget ViewGaussian noiseInput ViewVirtual View NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Figure 3. Details of the architecture of the single-image NeRF for NerfDiff. Using a UNet, we first map an input image to a camera-aligned triplane-based NeRF representation. This triplane efficiently conditions volume rendering from a targeted view, resulting in an initial rendering. This rendering conditions the diffusion process so the CDM can consistently denoise at that target pose. where Iθ,W is the volume rendered image. Challenges However, existing single-image NeRF ap- proaches fail to produce high-fidelity rendering results, espe- cially when severe occlusions exist. This is because single- image view synthesis is an under-constrained problem, as the synthesized occluded regions can exhibit multiple possi- bilities. Therefore, MSE loss (Eq. (3)) forces single-image NeRF to regress to mean pixel values across all possible solutions, yielding inaccurate and blurry predictions. 3.2. Geometry-free View Synthesis To account for the uncertainty challenge, a distinct line of research explicitly models view prediction p(I|I s) with 2D generative models, like Dupont et al. (2020); Rombach et al. (2021b); Sajjadi et al. (2022) and more recently conditional diffusion models (3DiM, Watson et al., 2022). Take 3DiM as an example. It learns a conditional noise predictor (cid:15)φ that de-noises Gaussian-noised target images conditioning on the input view Moreover, the corresponding camera poses. Such a model can be optimized with a denoising loss: φ = E(I s,I)∼data,(cid:15),t(cid:107)(cid:15)φ (Zt, I s) − (cid:15)(cid:107)2 LDM 2 (4) t + σ2 where Zt = αtI + σt(cid:15), (cid:15) ∼ N (0, 1), α2 t = 1 is the noised target for I. As shown in Song & Ermon (2019), the denoiser provides an approximation for the score function of the distribution (cid:15)φ(Zt, I s) ≈ −σt∇Zt log pφ(Zt|I s). At test time, the learned score (cid:15)φ is applied iteratively and refines noise images to synthesize novel views. Challenges Geometry-free models typically suffer from the "alignment problem" where the input view condition- ing and target views are not pixel-wise aligned, leading to inferior generalization when applying standard UNet- based diffusion models. Watson et al. (2022) attempted to alleviate this issue by using cross-attention to gather infor- mation from the input view. However, this requires models with large capacities, and even with this modification, it still needs more generalizability for complex scenes and out-of-distribution cameras. Moreover, since denoising is conducted in 2D for each view independently rather than in 3D, the synthesized novel views of CDMs in the sampling stage tend to be multi-view inconsistent. 4. NerfDiff To achieve the best of both worlds, in this paper, we present a training-finetuning two-stage approach, dubbed as NerfDiff, to incorporate the power of diffusion models into image- conditioned NeRFs for single-image view synthesis. We illustrate the pipelines of the proposed two stages in Fig- ure 2. In the following, we first introduce NerfDiff, which consists of an improved single-image NeRF based on local triplanes (§ 4.1) and a 3D-aware CDM built on top of the single-image NeRF outputs (§ 4.2). An overview of the proposed model is presented in Figure 3. These two compo- nents are optimized jointly on the same training set (§ 4.3). At test time, we adopt a second-stage finetuning. Further- more, to mitigate the inconsistency issue brought by CDM sampling, we present the NeRF-Guided Distillation (NGD) algorithm to improve the finetuning performance (§ 4.4). 4.1. Single-image NeRF with Local Triplanes NerfDiff is built upon an efficient camera-aligned triplane extracted directly from an input image to condition the NeRF. As mentioned in § 3.1, most existing single-view models (Yu et al., 2021; Lin et al., 2023) query the extracted features via image plane projection: P : R3 → [−1, 1]2. One issue with this operation is that the depth information of a 3D point is not contained in its extracted features; that is, all points along the same camera ray project to the same location on the 2D image and thus have the same features. Therefore, to differentiate the points along the same cam- era ray, existing methods need to concatenate the image features with the positional encoding of the global spatial MLPU-NetRaydirPosU-NetInput ViewTarget view rayscross attention (optional)PixelNeRF output (feature maps optional)Denoised outputconcatConditional Diffusion ModelImage-conditioned NeRF NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion location ξpos(x) as the representation of point x. However, this 3D representation is not efficient. Thus it needs a deep MLP network to fuse the image features with spatial in- formation for inferring the color and density of x, which slows down the rendering process. Inspired by Chan et al. (2021), we propose an efficient 3D representation that re- shapes the image feature W into a camera-aligned triplane: {Wxy, Wxz, Wyz}1. Then, each 3D point receives a unique feature vector by bilinear interpolation within three planes: ξW (x) = Wxy( ̃xxy) + Wxz( ̃xxz) + Wyz( ̃xyz), (5) Algorithm 1 Finetuning with NeRF-guided distillation. Input: NeRF (MLP fθ, triplanes W ), CDM (cid:15)φ, input I s, γ, N, B 1 Initialize I π = I π θ,W , (cid:15)π = (cid:15), π ∈ Π, (cid:15) ∼ N (0, 1) for t = tmax . . . tmin do 2 3 4 5 6 7 for π ∈ Π do Z π = αtI π + σt(cid:15)π; (cid:15)π = (cid:15)φ(Z π, I s) + γσt/αt * (I π − I π I π = (Z π − σt(cid:15)π)/αt θ,W ) for n = 1 . . . N do for b = 1 . . . B do Sample a view π ∼ Π and sample a ray r from π; (cid:80) θ,W (r) − I π(r)(cid:107)2 2 Update θ, W with ∇θ,W π,r (cid:107)I π 1 B (cid:104) (cid:105) − 1 P(x), 2 * xz−tn tf−tn ∈ [−1, 1]3, and tn, tf are where ̃x = the near and far bounds of the input camera (Eq. (1)). As this representation is expressive in the sense that it can allo- cate depth information in the xz, yz planes, no additional positional encoding ξpos(x) is needed to augment the repre- sentation, and the deep MLP network can be replaced with a shallow MLP network. This not only makes high-resolution image rendering efficient (§ 4.2) but also enables fast NeRF finetuning, which will be elaborated in § 4.4. Furthermore, modeling triplanes in the camera space of the input image has the following benefits: (1) The triplane can naturally preserve the local image features, same as pixelNeRF (Yu et al., 2021); (2) we do not need to assume a global coor- dinate system, and global camera poses, which is different from existing triplane-based methods (Chan et al., 2021; Chen et al., 2022; Bautista et al., 2022). Note that, for the image encoder, we adopt a UNet architec- ture (Ronneberger et al., 2015; Nichol & Dhariwal, 2021) rather than a pre-trained ResNet (He et al., 2016) used in Yu et al. (2021). Thanks to the U-connection and self-attention blocks, the output layer feature W = eψ(I) contains both the local and global information that is essential for predict- ing occluded views, which works similarly to the feature extractors in Lin et al. (2023). See Figure 3 for details. 4.2. 3D-aware Conditional Diffusion Models While single-image NeRF produces multi-view consistent images, the outputs tend to be blurry due to the uncertainty issue (§ 3.1). To address the uncertainty issue, we model a 3D-aware CDM as the second part of NerfDiff, which resolves uncertainty through a generative process. Specifi- cally, the CDM is learned to iteratively refine the rendering of single-image NeRF to match the target views. Compared to existing geometry-free methods (Watson et al., 2022), we avoid the "alignment" problem by applying single-image NeRF to render the target-view images as the conditioning to CDM rather than using the input-view image as conditioning. As shown in Figure 3, we adopt the 1The xy plane is aligned with the input image, while the xz and yz planes are orthogonal to the xy plane and each other. 8 return θ, W standard conditional UNet architecture (Nichol & Dhariwal, 2021) where the noisy image is concatenated with the ren- dered image. Similar to Watson et al. (2022), we can also employ cross-attention blocks between the CDM UNet and the encoder UNet to strengthen the conditioning. Note that the efficiency of the triplane rendering (see Table 3) allows the NeRF to be trained in tandem with the CDM, which would take far too long otherwise. 4.3. Training Phase θ,ψ,φ = λICLIC Given a collection of scenes where each scene has at least two views, we train end-to-end by combining Equations (3) and (4): LTrain to optimize the single-image NeRF and CDM jointly. Note that the training of single-image NeRF receives supervision from both the photometric error LIC θ,ψ and the CDM denoising loss LDM φ . See Figure 2 (left) for details. θ,ψ + λDMLDM φ 4.4. Fine-tuning Phase While the 3D-aware CDM resolves the uncertainty issue in the single-image NeRF and thus makes the synthesized images sharper, it compromises multi-view consistency, as the 2D diffusion process is independently applied to each novel view. To synthesize multi-view consistent and high- quality results, we propose a novel finetuning strategy at test time to distill the CDM's knowledge. As shown in Figure 2 (right), given an input view I s of an unseen scene, we generate a set of "virtual views" with the trained single-image NeRF and 3D-aware CDM. Then we finetune the triplane parameters W = eψ(I s) and MLP parameters θ (pink box in Fig. 3) with the generated virtual views. Here, we treat W as learnable parameters. It per- forms best when virtual views cover the region of interest. NeRF Guided Distillation A naive optimization strategy is the same as that in Mildenhall et al. (2020) (Eq. (2)), i.e., replacing the targets with the "virtual views" sampled from the CDM. We found that this naive optimization typically leads to noisy results with severe floating artifacts, as the NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion ShapeNet Cars ShapeNet Chairs PSNR↑ SSIM↑ LPIPS↓ FID↓ PSNR↑ SSIM↑ LPIPS↓ FID↓ PSNR↑ SSIM↑ LPIPS↓ FID↓ Amazon-Berkeley Objects LFN (Sitzmann et al., 2021)∗ 3DiM (Watson et al., 2022)∗ 22.42 21.01 SRN (Sitzmann et al., 2019a) 22.25 23.17 PixelNeRF (Yu et al., 2021) CodeNeRF (Jang & Agapito, 2021) 22.73 22.83 FE-NVS (Guo et al., 2022) 22.88 VisionNeRF (Lin et al., 2023) NerfDiff-B (Ours) w/o NGD NerfDiff-L (Ours) w/o NGD 23.51 23.81 23.76 23.95 0.89 0.57 0.88 0.89 0.89 0.91 0.90 0.92 0.92 0.92 0.92 – – – 8.99 22.26 17.05 0.129 41.21 22.89 0.146 59.24 23.72 23.39 – 0.128 0.099 23.21 – 0.084 21.31 24.48 0.082 18.09 24.79 0.093 42.37 24.77 0.076 15.49 24.95 0.092 43.26 24.80 0.90 0.53 0.89 0.90 0.87 0.92 0.92 0.94 0.93 0.94 0.93 – – – 6.57 – – 0.104 26.51 0.128 38.49 – 0.166 0.077 – 0.077 10.05 28.61 – – – – 0.056 32.81 5.65 0.068 15.72 32.07 0.056 32.84 5.34 0.070 15.50 32.00 – – – – – – 0.93 0.96 0.95 0.97 0.96 – – – – – – – – – – – – 0.095 33.38 7.77 0.057 0.063 18.01 0.042 6.31 0.061 17.73 Table 1. Comparisons on ShapeNet Cars & Chairs and ABO datasets across baselines. ∗ indicates geometry-free model. The results of the baselines except VisionNeRF (Lin et al., 2023) are copied from the official papers. – denotes the results are unavailable. Method PSNR↑ SSIM↑ LPIPS↓ FID↓ VisionNeRF (Lin et al., 2023) 35.94 34.81 NerfDiff-B (Ours) 0.97 0.97 0.065 11.18 6.76 0.040 Table 2. Quantative results on Clevr3D inconsistent CDM predictions cause conflicts in optimizing the NeRF model. Instead, we propose NeRF Guided Distil- lation (NGD) that alternates between NeRF distillation and diffusion sampling. Inspired by classifier guidance (Dhari- wal & Nichol, 2021), we incorporate 3D consistency into multi-view diffusion by considering the joint distribution for each virtual view I: pφ(Zt, Iθ,W |I s) = pφ(Zt|I s) * p(Iθ,W |Zt, I s) 2 (cid:107)It−Iθ,W (cid:107)2 2, ∝ pφ(Zt|I s) * e− γ (6) where It = (Zt − σt(cid:15)φ(Zt, I s))/αt is the predicted target image at the intermediate timestep. The second term intro- duces multi-view constraints from a given NeRF. Therefore, the goal is to find NeRF parameters (θ, W ) that maximize Eq. (6) while sampling the most likely virtual views (Zt) from the joint distribution. In practice, we adopt an iterative- based updating rule at each diffusion step t. For generating virtual views with the CDM, we follow the modified diffu- sion score derived from Eq. (6): to minimizing the MSE loss between the denoised images It and the NeRF renderings Iθ,W across all virtual views: θ,W = Eπ∼Π,r∼R(I π LFT t )(cid:107)I π θ,W (r) − I π t (r)(cid:107)2 2, (8) t , I π where Π is a prior distribution on the relative camera poses to the input and I π θ,W are the corresponding images at the relative camera π. Note that to reduce computation, we sample the rays r with batch size B from all views, supervise only the corresponding pixels, and finetune for N steps. The algorithm details are shown in Algorithm 1. Relationship to SDS Our method shares similarities with the recently proposed score distillation sampling (SDS, Poole et al., 2022). Although SDS also distills the dif- fusion models into 3D, there is a fundamental difference. In SDS, a random-scaled noise is injected into NeRF's output from a random angle. The noised image is then denoised by a 2D diffusion model to provide supervision. In contrast, our method initializes a set of virtual views and uses NeRF to guide the diffusion process of each view (and alternat- ingly refines NeRF based on this diffusion). As a result, our pipeline completes the full diffusion trajectory for every view, following a naturally decreasing noise schedule. In Appendix E, we show additional comparisons and potential reasons SDS is practically worse than our method. ̃(cid:15)φ(Zt, I s) = (cid:15)φ(Zt, I s) + γ σt αt (It − Iθ,W ), (7) 5. Experiments where ̃(cid:15)φ will be used in regular DDIM sampling (Song et al., 2020) 2. Note that for γ = α2 t (SNR), following the modified score Eq. (7) is equivalent to replacing the denoised images with the NeRF rendering. For distilling NeRF, we directly maximize the log-likelihood of this joint distribution w.r.t. the NeRF parameters, which is equivalent t /σ2 2We consider ∂It/∂Zt ≈ 1/αt to avoid backpropagation through the UNet, similar to DreamFusion (Poole et al., 2022). 5.1. Experimental Settings Datasets We evaluate NerfDiff on three benchmarks – SRN-ShapeNet (Sitzmann et al., 2019a), Amazon-Berkeley Objects (ABO, Collins et al., 2022) and Clevr3D (Stelzner et al., 2021) – for testing novel view synthesis under single- category, category-agnostic, and multi-object settings, re- spectively. SRN-ShapeNet includes two categories: Cars and Chairs. Dataset details are given in Appendix A. NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Figure 4. A qualitative comparison of our approach versus baselines in single-image view synthesis on multiple datasets. Compared to 3D methods like VisionNeRF (Lin et al., 2023) and Ours(w/o NGD), our proposed NerfDiff synthesizes significantly sharper results behind occlusions. Compared to Ours (CDM), our full model showcases its built-in multi-view consistency. The red arrows display the CDM's inability to synthesize consistently across views. Method Image encoding Rendering Method PixelNeRF (Yu et al., 2021) VisionNeRF (Lin et al., 2023) NerfDiff-B NerfDiff-L 0.007s 0.015s 0.024s 0.031s 1.639s 0.678s 0.018s 0.018s Table 3. Comparison of encoding and rendering speed on ShapeNet Cars dataset between models. Baselines We choose the pixel-aligned method Vision- NeRF (Lin et al., 2023) as the main baseline for comparison considering its state-of-the-art performance in single-image view synthesis. We additionally evaluate our proposed single-image NeRF without the fine-tuning stage (denoted as "Ours (w/o NGD)"), Furthermore, show qualitative results from the CDM prediction without NeRF guidance (denoted as "Ours (CDM)"). Besides, we include publicly-available results for other methods such as SRNs (Sitzmann et al., 2019a), CodeNeRF (Jang & Agapito, 2021), FE-NVS (Guo et al., 2022), and geometry-free approaches LFN (Sitzmann et al., 2021) and 3DiM (Watson et al., 2022). Evaluation Metrics We evaluate our model and the base- lines by comparing the generated images and target views given a single image, and the relative target camera poses PSNR↑ SSIM↑ LPIPS↓ FID↓ 23.81 0.915 0.093 42.37 No Fine-tuning Fine-tuning 23.46 Direct distillation w. SDS (Poole et al., 2022) 20.32 23.51 w. NGD (Ours) 0.911 0.882 0.917 0.105 35.88 0.106 28.06 0.082 18.09 Table 4. Ablation on fine-tuning strategy on ShapeNet-Cars. as input. We report four standard metrics: PSNR, SSIM, LPIPS (Zhang et al., 2018), and FID (Heusel et al., 2017). PSNR measures the mean-squared error per pixel, while SSIM measures the structural similarity; LPIPS is a deep metric that reflects the perceptual similarity between im- ages. Finally, FID measures the similarity between the distribution of the rendered and ground truth images of all test scenes. Note that generative frameworks–due to their multimodal nature–generally perform poorly with respect to PSNR, which prioritizes proximity to the mean pixel values. 5.2. Main Results We show results with two variant sizes (NerfDiff-B:∼ 400M parameters, NerfDiff-L:∼ 1B parameters). Details of the ShapeNet ChairsOurs (w/o NGD)VisionNeRFOursGround TruthOurs (CDM)Input ViewShapeNet CarsABO NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Figure 5. A qualitative comparison on Clevr3d (Stelzner et al., 2021) which consists of images from cameras rotated 120 degrees about the z-axis. We showcase generalization to OOD cameras in this figure. As can be seen, VisionNeRF gets a degenerate result, while NerfDiff provides sharper renderings with fewer artifacts. # virtual views 5 10 25 50 100 w/o NGD PSNR↑ SSIM↑ LPIPS↓ FID↓ 22.86 23.16 23.34 23.51 23.55 0.901 0.913 0.915 0.917 0.916 0.095 0.085 0.083 0.083 0.087 27.41 16.04 17.14 18.09 19.13 23.81 0.915 0.093 42.37 Table 5. Comparison on the number of virtual views used for fine- tuning on ShapeNet Cars. implementation specifics are given in Appendix B. Quantitative evaluation Tables 1 and 2 show the quan- titative comparisons of our proposed models to the SoTA geometry-free and single-view NeRF methods on all three datasets. The quantitative scores of the baselines are copied from the official papers if available. Our proposed NerfDiff (with and without NGD finetuning) significantly outperform all baselines in PSNR and SSIM, displaying the models' ability to synthesize accurate pixel-level details with the local triplane representations. Additionally, in LPIPS, our proposed NerfDiff is better than all previous approaches indicating its ability to create perceptually correct comple- tions behind occlusions. Finally, about FID, our method outperforms all single-view NeRF methods, only having worse scores than 3DiM on ShapeNet-Cars as it is purely 2D. Note that, as mentioned in the original paper (Watson et al., 2022), 3DiM cannot generalize well to the out-of- the-distribution testing cameras of ShapetNet-Chairs, thus performing poorly. In contrast, with the 3D-aware CDM, our approach can easily handle unseen viewpoints. In addi- tion, the proposed NGD finetuning, while slightly hurting PSNR in some cases, significantly improves the sharpness of the results, thus resulting in better FID and LPIPS scores. Besides, scaling the model size up further yields higher perceptual quality. Qualitative evaluation Figure 4 displays the qualitative comparison of our approach to the main baseline, Vision- NeRF (Lin et al., 2023), and two ablated models. Our method produces much more detailed results than the ablated model single-image NeRF and VisionNeRF on ShapeNet and ABO. Due to their reliance on projected im- age features, these methods cannot handle uncertainty be- hind occlusion and thus regress mean pixel values, resulting in blurry renderings. The CDM results are worse aligned and inconsistent across views, as demonstrated by the red arrows in Figure 4. Figure 5 shows additional qualitative results on Clevr3D. Our method again shows consistent and high-quality renderings. At the same time, VisionNeRF VisionNeRFOurs (w/o NGD)Ours (CDM)OursInput View36°96°210°312° NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion overfits the camera distribution and fails to synthesize view- points close to the input (see Appendix B for more details). The CDM results are again inconsistent with objects ap- pearing and disappearing. Please refer to the supplemen- tary materials for uncurated and extensive video results showing the multiview consistency and high fidelity of our method. 5.3. Ablation Studies We provide ablations on the Shapenet-Cars dataset to vali- date our model's key design choices, making our ablation results directly comparable to the ShapeNet Cars results in Figure 4. In Table 4, we compare our model without any CDM-based finetuning and various CDM-based fine- tuning strategies. As seen in the results, finetuning with a CDM will improve the unconditional FID. However, only our NGD sampling will yield the state-of-the-art conditional SSIM and LPIPS. For details of the sampling baselines Di- rect Distillation and SDS compared to our NGD, please see Appendix E. Figure 6 also provides a qualitative comparison. Next, in Table 5, we also provide ablations on the number of virtual views for finetuning. With too few (e.g. 5) virtual views, the NeRF overfits the denoised images resulting in subpar renderings. We find that 50 virtual views provide a good tradeoff between efficiency and performance. 6. Discussion Limitations Our proposed method has two main limita- tions. Firstly, we require at least two views of a scene at training time. Secondly, our finetuning process is expensive in time, limiting application in real-time domains. Future work may address these issues. Future work For future research, it is also possible to investigate our proposed NGD to improve the fidelity of text-to-3D pipelines (Jain et al., 2022; Poole et al., 2022; Lin et al., 2022). Additionally, more complex datasets such as the Waymo Open Dataset (Sun et al., 2020) may be explored, leaving the challenging task of occlusion-handling to large-scale pretrained 2D diffusion models as we do in this paper. Also, incorporating our finetuning strategy in the context of 3D GANs (Gu et al., 2021; Chan et al., 2021) may improve inversion performance and 3D editing capabilities as well. Finally, it may also be interesting to figure out how to properly incorporate priors such as symmetry. 7. Conclusion We introduced NerfDiff, a generative framework for single- image view synthesis which distills a 3D-aware CDM to a triplane-based image-conditioned NeRF. We further intro- duced NeRF-guided distillation to sample multiple views from the CDM while simultaneously improving the NeRF renderings. Our method achieved the state-of-the-art results on multiple challenging benchmarks. References Anciukevicius, T., Xu, Z., Fisher, M., Henderson, P., Bilen, H., Mitra, N. J., and Guerrero, P. RenderDiffusion: Image diffusion for 3D reconstruction, inpainting and generation. arXiv, 2022. Bautista, M. A., Guo, P., Abnar, S., Talbott, W., Toshev, A., Chen, Z., Dinh, L., Zhai, S., Goh, H., Ulbricht, D., Dehghan, A., and Susskind, J. Gaudi: A neural architect for immersive 3d scene generation. arXiv, 2022. Cai, S., Obukhov, A., Dai, D., and Van Gool, L. Pix2nerf: Unsupervised conditional π-gan for single image to arXiv preprint neural radiance fields translation. arXiv:2202.13162, 2022. Chan, E. R., Lin, C. Z., Chan, M. A., Nagano, K., Pan, B., De Mello, S., Gallo, O., Guibas, L., Tremblay, J., Khamis, S., et al. Efficient geometry-aware 3d generative adversarial networks. arXiv preprint arXiv:2112.07945, 2021. Chen, A., Xu, Z., Geiger, A., Yu, J., and Su, H. Tensorf: Ten- sorial radiance fields. arXiv preprint arXiv:2203.09517, 2022. Chen, S. and Williams, L. View Interpolation for Image Synthesis. In SIGGRAPH 93, pp. 279–288, 1993. Collins, J., Goel, S., Deng, K., Luthra, A., Xu, L., Gun- dogdu, E., Zhang, X., Yago Vicente, T. F., Dideriksen, T., Arora, H., Guillaumin, M., and Malik, J. Abo: Dataset and benchmarks for real-world 3d object understanding. CVPR, 2022. Deng, C., Jiang, C., Qi, C. R., Yan, X., Zhou, Y., Guibas, L., Anguelov, D., et al. Nerdi: Single-view nerf synthesis with language-guided diffusion as general image priors. arXiv preprint arXiv:2212.03267, 2022. Dhariwal, P. and Nichol, A. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34:8780–8794, 2021. Dupont, E., Martin, M. B., Colburn, A., Sankar, A., Susskind, J., and Shan, Q. Equivariant neural render- ing. In International Conference on Machine Learning, pp. 2761–2770. PMLR, 2020. Eigen, D., Puhrsch, C., and Fergus, R. Depth Map Pre- diction from a Single Image using a Multi-Scale Deep Network. NIPS'14, pp. 1–9, 2014. NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Fan, H., Su, H., and Guibas, L. A Point Set Generation Network for 3D Object Reconstruction from a Single Image. IEEE Conference on Computer Vision and Pattern Recognition, pp. 605–613, 2017. Li, G., Zheng, H., Wang, C., Li, C., Zheng, C., and Tao, D. 3ddesigner: Towards photorealistic 3d object generation and editing with text-guided diffusion models. arXiv preprint arXiv:2211.14108, 2022. Gortler, S., Grzeszczuk, R., Szeliski, R., and Cohen, M. The Lumigraph. In SIGGRAPH 96, pp. 43–54, 1996. Gu, J., Liu, L., Wang, P., and Theobalt, C. Stylenerf: A style-based 3d-aware generator for high-resolution image synthesis. arXiv preprint arXiv:2110.08985, 2021. Guo, P., Bautista, M. A., Colburn, A., Yang, L., Ulbricht, D., Susskind, J. M., and Shan, Q. Fast and explicit neural view synthesis. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 3791– 3800, 2022. He, K., Zhang, X., Ren, S., and Sun, J. Deep Residual Learning for Image Recognition. IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778, 2016. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., and Hochreiter, S. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017. Ho, J., Jain, A., and Abbeel, P. Denoising diffusion proba- bilistic models. Advances in Neural Information Process- ing Systems, 33:6840–6851, 2020. Ho, J., Chan, W., Saharia, C., Whang, J., Gao, R., Gritsenko, A., Kingma, D. P., Poole, B., Norouzi, M., Fleet, D. J., et al. Imagen video: High definition video generation with diffusion models. arXiv preprint arXiv:2210.02303, 2022. Jain, A., Mildenhall, B., Barron, J. T., Abbeel, P., and Poole, B. Zero-shot text-guided object generation with dream fields. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 867–876, 2022. Jang, W. and Agapito, L. Codenerf: Disentangled neural radiance fields for object categories. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 12949–12958, 2021. Kato, H., Ushiku, Y., and Harada, T. Neural 3D Mesh IEEE Conference on Computer Vision and Renderer. Pattern Recognition, pp. 3907–3916, 2018. Kingma, D. P. and Ba, J. Adam: A Method for Stochastic International Conference on Learning Optimization. Representations, 2015. Levoy, M. and Hanrahan, P. Light Field Rendering. In SIGGRAPH 96, pp. 31–42, 1996. Lin, C.-H., Gao, J., Tang, L., Takikawa, T., Zeng, X., Huang, X., Kreis, K., Fidler, S., Liu, M.-Y., and Lin, T.-Y. Magic3d: High-resolution text-to-3d content cre- ation. arXiv preprint arXiv:2211.10440, 2022. Lin, K.-E., Yen-Chen, L., Lai, W.-S., Lin, T.-Y., Shih, Y.-C., and Ramamoorthi, R. Vision transformer for nerf-based view synthesis from a single input image. In WACV, 2023. Liu, A., Tucker, R., Jampani, V., Makadia, A., Snavely, N., and Kanazawa, A. Infinite nature: Perpetual view generation of natural scenes from a single image. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 14458–14467, 2021. Loper, M. M. and Black, M. J. OpenDR: An approximate differentiable renderer. In Computer Vision – ECCV 2014, volume 8695 of Lecture Notes in Computer Science, pp. 154–169. Springer International Publishing, 2014. Loshchilov, I. and Hutter, F. Decoupled weight decay regu- larization. arXiv preprint arXiv:1711.05101, 2017. McMillan, L. and Bishop, G. Plenoptic Modeling: An Image-Based Rendering System. In SIGGRAPH 95, pp. 39–46, 1995. Mildenhall, B., Srinivasan, P. P., Tancik, M., Barron, J. T., Ramamoorthi, R., and Ng, R. Nerf: Representing scenes as neural radiance fields for view synthesis. In European conference on computer vision, pp. 405–421. Springer, 2020. M ̈uller, N., Siddiqui, Y., Porzi, L., Bul`o, S. R., Kontschieder, P., and Niessner, M. Diffrf: Rendering-guided 3d radiance field diffusion. arXiv preprint arXiv:2212.01206, 2022a. M ̈uller, N., Simonelli, A., Porzi, L., Bul`o, S. R., Niessner, M., and Kontschieder, P. Autorf: Learning 3d object radiance In Proceedings fields from single view observations. of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3971–3980, 2022b. Nichol, A., Jun, H., Dhariwal, P., Mishkin, P., and Chen, M. Point-e: A system for generating 3d point clouds from complex prompts. arXiv preprint arXiv:2212.08751, 2022. Nichol, A. Q. and Dhariwal, P. Improved denoising diffusion In International Conference on probabilistic models. Machine Learning, pp. 8162–8171. PMLR, 2021. NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Poole, B., Jain, A., Barron, J. T., and Mildenhall, B. Dream- fusion: Text-to-3d using 2d diffusion. arXiv preprint arXiv:2209.14988, 2022. Shue, J. R., Chan, E. R., Po, R., Ankner, Z., Wu, J., and Wetzstein, G. 3d neural field generation using triplane diffusion. arXiv preprint arXiv:2211.16677, 2022. Ramesh, A., Dhariwal, P., Nichol, A., Chu, C., and Chen, M. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022. Rematas, K., Martin-Brualla, R., and Ferrari, V. ShaRF: Shape-conditioned Radiance Fields from a Single View. ICML, 2021. Rockwell, C., Fouhey, D. F., and Johnson, J. Pixelsynth: Generating a 3d-consistent experience from a single im- age. In Proceedings of the IEEE/CVF International Con- ference on Computer Vision, pp. 14104–14113, 2021. Rombach, R., Blattmann, A., Lorenz, D., Esser, P., and Ommer, B. High-resolution image synthesis with latent diffusion models, 2021a. Rombach, R., Esser, P., and Ommer, B. Geometry- Free View Synthesis: Transformers and no 3D Priors. arXiv:2104.07652, 2021b. Rombach, R., Esser, P., and Ommer, B. Geometry-free view synthesis: Transformers and no 3d priors. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 14356–14366, 2021c. Ronneberger, O., Fischer, P., and Brox, T. U-Net : Convo- lutional Networks for Biomedical Image Segmentation. International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 234–241, 2015. Saharia, C., Chan, W., Saxena, S., Li, L., Whang, J., Denton, E., Ghasemipour, S. K. S., Ayan, B. K., Mahdavi, S. S., Lopes, R. G., et al. Photorealistic text-to-image diffusion models with deep language understanding. arXiv preprint arXiv:2205.11487, 2022. Sajjadi, M. S. M., Meyer, H., Pot, E., Bergmann, U., Greff, K., Radwan, N., Vora, S., Lucic, M., Duck- worth, D., Dosovitskiy, A., Uszkoreit, J., Funkhouser, T., and Tagliasacchi, A. Scene Representation Trans- former: Geometry-Free Novel View Synthesis Through Set-Latent Scene Representations. CVPR, 2022. URL https://srt-paper.github.io/. Salimans, T. and Ho, J. fast sampling of diffusion models. arXiv:2202.00512, 2022. Progressive distillation for arXiv preprint Sitzmann, V., Zollh ̈ofer, M., and Wetzstein, G. Scene Rep- resentation Networks: Continuous 3D-Structure-Aware Neural Scene Representations. Advances in Neural Infor- mation Processing Systems, pp. 1119–1130, 2019a. Sitzmann, V., Zollh ̈ofer, M., and Wetzstein, G. Scene Rep- resentation Networks: Continuous 3D-Structure-Aware Neural Scene Representations. Advances in Neural Infor- mation Processing Systems, pp. 1119–1130, 2019b. Sitzmann, V., Rezchikov, S., Freeman, W. T., Tenenbaum, J. B., and Durand, F. Light Field Networks : Neural Scene Representations with Single-Evaluation Rendering. arXiv:2106.02634, 2021. Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. Deep unsupervised learning using nonequi- librium thermodynamics. In International Conference on Machine Learning, pp. 2256–2265. PMLR, 2015. Song, J., Meng, C., and Ermon, S. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502, 2020. Song, Y. and Ermon, S. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 32, 2019. Stelzner, K., Kersting, K., and Kosiorek, A. R. Decom- posing 3d scenes into objects via unsupervised volume segmentation. arXiv preprint arXiv:2104.01148, 2021. Suhail, M., Esteves, C., Sigal, L., and Makadia, A. Gen- In European eralizable patch-based neural rendering. Conference on Computer Vision, pp. 156–174. Springer, 2022. Sun, P., Kretzschmar, H., Dotiwalla, X., Chouard, A., Pat- naik, V., Tsui, P., Guo, J., Zhou, Y., Chai, Y., Caine, B., et al. Scalability in perception for autonomous driving: Waymo open dataset. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 2446–2454, 2020. Tatarchenko, M., Dosovitskiy, A., and Brox, T. Octree Generating Networks: Efficient Convolutional Architec- tures for High-resolution 3D Outputs. IEEE International Conference on Computer Vision, pp. 2088–2096, 2017. Trevithick, A. and Yang, B. GRF: Learning a General Radiance Field for 3D Representation and Rendering. International Conference on Computer Vision, 2021. Saxena, A., Sun, M. S. M., and Ng, A. Y. a. Learning 3-D Scene Structure from a Single Still Image. IEEE PAMI, 31(5):824–840, 2009. ISSN 1550-5499. doi: 10.1109/ ICCV.2007.4408828. Tulsiani, S., Zhou, T., Efros, A. A., and Malik, J. Multi-view Supervision for Single-view Reconstruction via Differen- tiable Ray Consistency. IEEE Conference on Computer Vision and Pattern Recognition, pp. 2626–2634, 2017. NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Wang, H., Du, X., Li, J., Yeh, R. A., and Shakhnarovich, Score jacobian chaining: Lifting pretrained 2d arXiv preprint G. diffusion models for 3d generation. arXiv:2212.00774, 2022. Watson, D., Chan, W., Martin-Brualla, R., Ho, J., Tagliasac- chi, A., and Norouzi, M. Novel view synthesis with dif- fusion models. arXiv preprint arXiv:2210.04628, 2022. Wiles, O., Gkioxari, G., Szeliski, R., and Johnson, J. SynSin: End-to-end View Synthesis from a Single Image. IEEE Conference on Computer Vision and Pattern Recognition, 2020. Xu, D., Jiang, Y., Wang, P., Fan, Z., Shi, H., and Wang, Z. Sinnerf: Training neural radiance fields on complex scenes from a single image. arXiv preprint arXiv:2204.00928, 2022. Yan, X., Yang, J., Yumer, E., Guo, Y., and Lee, H. Perspec- tive Transformer Nets: Learning Single-View 3D Object Reconstruction without 3D Supervision. Advances in Neural Information Processing Systems, pp. 1696–1704, 2016. Yu, A., Ye, V., Tancik, M., and Kanazawa, A. pixelNeRF: Neural Radiance Fields from One or Few Images. IEEE Conference on Computer Vision and Pattern Recognition, 2021. Zhang, R., Isola, P., Efros, A. A., Shechtman, E., and Wang, O. The Unreasonable Effectiveness of Deep Features as a Perceptual Metric. IEEE Conference on Computer Vision and Pattern Recognition, pp. 586–595, 2018. Zhou, Z. and Tulsiani, S. Sparsefusion: Distilling view- arXiv conditioned diffusion for 3d reconstruction. preprint arXiv:2212.00792, 2022. Zhuang, P., Abnar, S., Gu, J., Schwing, A., Susskind, J. M., and Bautista, M. ́A. Diffusion probabilistic fields. In International Conference on Learning Representations, 2023. URL https://openreview.net/forum? id=ik91mY-2GN. Appendix A. Datasets We validate our NerfDiff algorithm across three datasets. The details of each are given in the following subsections. A.1. ShapeNet ShapeNet-Cars and -Chairs (Sitzmann et al., 2019a) are standard for few-shot view synthesis benchmarking. We use the data hosted by pixelNeRF (Yu et al., 2021), which can be downloaded from GitHub (https://github.com/ sxyu/pixel-nerf). The chairs dataset consists of 6591 scenes, and the cars dataset has 3514 scenes, both with a predefined train/val/test split. Each training scene contains 50 posed images taken from random points on a sphere. Each testing scene contains 250 posed images taken on an Archimedean spiral along the sphere. All scenes share intrin- sic, and images are rendered at a resolution of (128, 128). At testing, we choose one pose as input (index 64) and keep this camera input constant for all scenes. A.2. Amazon Berkeley Objects (ABO) We also consider (Collins et al., the ABO dataset 2022) from https://amazon-berkeley-objects. s3.amazonaws.com/index.html under the title "ABO 3D Renderings." We randomly sampled a custom split. The dataset thus consists of 6743 training scenes, 396 validation scenes, and 794 testing scenes. Each scene consists of 30 images of an object rendered onto a white background in a physically-based manner. The objects are drawn from 64 different object categories, providing an extensive evaluation of the generalization capabilities of various models. The images have resolution (256, 256), and we crop and adjust the intrinsics so that the models are fed with images of size (128, 128). The cameras are not uni- formly distributed, but all point at the object. For testing, we use an input camera index of 0. A.3. Clevr3D We consider the Clevr3D dataset provided in (Stelzner et al., 2021) for multi-object/scene level learning, which can be downloaded from the github https://github.com/ stelzner/obsurf. We define a custom split in which there are 70000 training scenes and 1000 held-out testing scenes. Each scene consists of 3 posed images at a resolution of (120, 160) with the camera pointing at the origin. These images are rendered at 120 degree rotations about the z-axis with varying distances from the origin. We select one input image (index 0) at testing and render the other two views. NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion B. Implementation Details B.1. Architecture and Hyperaparameters For all datasets, we learn NerfDiff based on the U-Net archi- tecture adopted from ADM (Dhariwal & Nichol, 2021) with two sets of configurations (-B: base ∼ 400M parameters, -L: large ∼ 1B parameters). More specifically, we set the model dimension d = 192 with 2 residual blocks per reso- lution for the base architecture and d = 256 with 3 residual blocks per resolution for the large architecture. All other hyperparameters follow the default setting as ADM. Note that the image encoder retains the same architecture and hyperparameters as the CDM outlined above. Similar to (Watson et al., 2022), we incorporate a cross-attention module between the CDM and the image encoder after every attention block to strengthen the conditioning. The last layer output of the image encoder is reshaped to a triplane. As a result, the triplane has the same spatial resolution as the input image, and we set the feature dimension of the triplane as 48. We implement the NeRF module (pink box in Fig. 3) using a 2-layer MLP with a hidden size of 64. For NeRF rendering, we follow Lin et al. (2023) and uniformly sample 64 points along each ray, with 64 additional points by importance sampling. As mentioned in § 4.2, we directly concat the NeRF rendered image with the noised input and send it to the CDM for denoising. B.2. Training phase The CDM is trained with cosine noise schedule αt = cos(0.5πt) based on velocity prediction (Salimans & Ho, 2022). We set λIC = λDM = 1, which means that we add the two losses of the two modules without re-weighting. All models are trained using AdamW (Loshchilov & Hutter, 2017) with a learning rate of 2e−5 and an EMA decaying rate of 0.9999. We train all models with a batch size of 32 images for 500K iterations on 8 A100 GPUs. Training takes 3 − 4 days to finish for base models. Note that for the Clevr3D dataset (Stelzner et al., 2021), we noticed that the models tended to overfit to the input view easily, creating a plane of density orthogonal to the camera axis and thus clearly degenerate geometry. To ameliorate this, we trained input view reconstruction with slightly noisy camera locations (variance 0.3). We found that this fixed the issue for our method, but it still failed for VisionNeRF (Lin et al., 2023), even after increasing the noise. B.3. Finetuning phase When finetuning with NGD, we define K virtual views rela- tive to the input image by sampling near the test trajectory. By default, we set K = 50 for shapeNet and Clevr3D and 30 for ABO. See Appendix C for specific K per dataset and how to obtain these poses. For the multiview diffusion process, we run 64 DDIM (Song et al., 2020) steps with the CDM for each view, respectively. At every diffusion step, we update the NeRF parameters N = 64 steps, with a batch size of B = 4096 rays. We use Adam optimizer (Kingma & Ba, 2015) set the learning rates for NeRF MLPs 1e − 4 and the triplane features 5e − 2, respectively. Our empirical results indicate that a large learning rate on a triplane can boost the finetuning efficiency. C. Prior Relative Camera Distribution Π In order to approximate the expectation in Eq. (8), we re- quire a sampling of Π, i.e., a sampling of K 'important' or 'relevant' cameras, which adequately capture the region of interest. For each of the three datasets, we rely on the relative (to the input) camera poses of the testing set for this. The cameras are very different between datasets, requiring a slightly different procedure. ShapeNet Because the Shapenet testing trajectory is an Archimedean spiral around the object consisting of 251 views, we simply uniformly sample every 5th camera yield- ing 50 cameras total from which we can approximate Π, thus yielding K = 50 cameras to approximate Eq. (8). Amazon Berkeley Objects (ABO) Because each scene contains only 30 cameras, we use all the relative poses of the testing set (K = 30) to approximate Eq. (8). Clevr3D As Clevr3D contains only three cameras per scene, creating a good sample of Π is slightly more difficult. As we know, all of the Clevr3D cameras are pointing at the origin; we can calculate the relative position of the world origin in camera coordinates by intersecting two of the op- tical axes of the relative cameras. This will serve as the look-at-point for our virtual cameras. Note that the Clevr cameras are additionally all of a similar height relative to the ground plane of the scene. Thus, we can approximate the up direction in camera coordinates by taking the normal plane containing all three cameras. In order to resolve uncertainty about whether this is the up direction or its negation, we check that the cosine similarity with the camera directions is negative, as they lie in the upper halfspace in world coor- dinates. Given a camera center in camera coordinates, we can thus create a camera pose. To define these centers, we uniformly sample a circle in the plane containing all three cameras, which approximately goes through each one (the radius is the mean distance from the approximate world ori- gin). We choose K = 50 camera centers and create camera poses with the estimated world origin and up direction for the finetuning process. We use these to approximate Eq. (8). NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Figure 6. Qualitative examples of ablation studies on fine-tuning strategy. FT refers to finetuning. The red arrow shows floating and noisy artifacts due to learning from inconsistent CDM predictions. D. Details of Baseline Methods E. Additional Comparison Details The baselines are shown in Table. 1, we gathered the error metrics of LFN (Sitzmann et al., 2021), 3DiM (Watson et al., 2022) on the ShapeNet dataset from their respective papers. As for SRN (Sitzmann et al., 2019b), PixelNeRF (Yu et al., 2021), CodeNeRF (Jang & Agapito, 2021), FE-NVS (Guo et al., 2022), and VisionNeRF (Lin et al., 2023), we obtain the ShapeNet results from the VisionNeRF paper and con- duct FID calculation using the renderings provided by the authors of PixelNeRF and VisionNeRF. Moreover, to com- pare against VisionNeRF on the ABO and Clevr3D datasets, we used its publicly available source code and modified the dataloader accordingly. For training, we use the same hyper- parameter setup denoted by the VisionNeRF paper. Namely, we set the image feature channels to 512. The learning rate of the feature extractor is set to 1e−5 and MLP to 1e−4. We keep the same learning rate schedule and apply warm- up and decay, as shown in the original paper. We trained VisionNeRF for 500k steps on the ABO dataset and 250k steps on the Clevr3D dataset since we found it easier to overfit the Clevr3D scenes. Moreover, we also adjusted the batch and ray bundle sizes to fit into the GPU memory. E.1. Importance of 3D-aware Diffusion In Table 6, we showed the comparison with different CDM architectures. "Concat" means directly concat the input view with the noisy image, while "Cross-attention" adopts a similar conditioning as X-UNet (Watson et al., 2022). Both did not involve the volume rendering in the encoding time, which can be seen as 3D-unaware. The results showed that, when applying a 3D-aware diffusion model, we can con- sistently achieve better results and generate more coherent views based on the input. Method PSNR↑ SSIM↑ LPIPS↓ FID↓ No CDM Fine-tuning 23.81 0.915 0.093 42.37 CDM architecture Concat Cross-attention 3D-aware (Ours) 20.72 21.13 23.51 0.874 0.885 0.917 0.135 56.27 0.123 35.49 0.082 18.09 Table 6. Experiments of showing importance for 3D-aware CDM on ShapeNet-Cars. E.2. Fine-tuning Strategies In Table 4 and Figure 6, we showed results for multiple sampling methods for finetuning NeRF. Here we give the details of these methods. NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion v.s. Direct distillation For Direct distillation, we directly sample virtual views from the CDM given the initial pixel- NeRF renderings and use these to finetune the NeRF directly with a standard L2 loss. Note that these renderings are un- likely to be multiview consistent as the denoising process takes place independently for each. Thus, the resultant ren- derings are inconsistent and incongruous with the input, which is also reflected in the learned NeRF. F. Additional Qualitative Results Finally, we provide additional qualitative results for our base single-image models compared with VisionNeRF (Lin et al., 2023) on ShapeNet Cars (Figure 7), Chairs (Figure 8) and ABO dataset (Figures 9 and 10). Images are rendered at a specific viewpoint given a single image input. Please refer to supplementary materials for more video results. v.s. Score distillation sampling (SDS) We also com- pared SDS (Poole et al., 2022), where virtual views are continually predicted by adding noise directly to renderings and taking an L2 loss between the NeRF rendering and the resultant denoised images. Here we note three signifi- cant differences with SDS, which may result in its poorer performance: 1. Inconsistent noise schedule. In our method, we only sample once per view, continually decreasing the noise with greater NeRF guidance. In contrast, SDS will pro- vide inconsistent gradient updates as random amounts of noise are added to the NeRF renderings and then de- noised, yielding blurry results which regress the mean of the supervision. 2. The learned score function of the CDM may be in- adequate. That is to say, the modes of the PDF may not reflect sharp images of the dataset, causing poorer results. Our method uses NeRF to guide the process, which avoids directly seeking a mode. 3. Out-of-distribution inputs. At low noise levels, render- ing a NeRF with additional noise will not resemble a real image with a similar amount of noise. Thus, the inputs to the denoiser may be out-of-distribution. In contrast, our method uses the CDM to refine the NeRF during sampling, keeping the samples close to the data manifold. v.s. Stochastic Conditioning As shown in the main paper, naively finetuning the NeRF parameters from the CDM's generation typically leads to noisy results with severe float- ing artifacts. It is the inconsistent CDM predictions that cause conflicts in learning NeRF. Targeting on this, Wat- son et al. (2022) proposed "stochastic conditioning" – an autoregressive approach for synthesizing virtual views in a sequence, where for generating a novel view, each diffu- sion step stochastically conditions on previously generated views. Although this model's dependencies are across the virtual views, the generated images are not guaranteed to be multiview consistent. Moreover, our initial exploration showed that the imperfect autoregressive prediction accu- mulated errors easily, resulting in degenerated results for long sequences without stable geometry. NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Figure 7. Additional examples of single-image view synthesis on ShapeNet Cars. Ours (w/o NGD)VisionNeRFOursGround TruthInput View NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Figure 8. Additional examples of single-image view synthesis on ShapeNet Chairs. Ours (w/o NGD)VisionNeRFOursGround TruthInput View NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Figure 9. Additional examples of single-image view synthesis on ABO dataset. Ours (w/o NGD)VisionNeRFOursGround TruthInput View NerfDiff: Single-image View Synthesis with NeRF-guided Distillation from 3D-aware Diffusion Figure 10. Additional examples of single-image view synthesis on ABO dataset. Ours (w/o NGD)VisionNeRFOursGround TruthInput View
http://arxiv.org/abs/2302.10106v1
2023-02-20T17:08:03
2023-02-20T17:08:03
Towards Understanding the Survival of Patients with High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms: An Investigation of Ensemble Feature Selection in the Prediction of Overall Survival
Determining the most informative features for predicting the overall survival of patients diagnosed with high-grade gastroenteropancreatic neuroendocrine neoplasms is crucial to improve individual treatment plans for patients, as well as the biological understanding of the disease. Recently developed ensemble feature selectors like the Repeated Elastic Net Technique for Feature Selection (RENT) and the User-Guided Bayesian Framework for Feature Selection (UBayFS) allow the user to identify such features in datasets with low sample sizes. While RENT is purely data-driven, UBayFS is capable of integrating expert knowledge a priori in the feature selection process. In this work we compare both feature selectors on a dataset comprising of 63 patients and 134 features from multiple sources, including basic patient characteristics, baseline blood values, tumor histology, imaging, and treatment information. Our experiments involve data-driven and expert-driven setups, as well as combinations of both. We use findings from clinical literature as a source of expert knowledge. Our results demonstrate that both feature selectors allow accurate predictions, and that expert knowledge has a stabilizing effect on the feature set, while the impact on predictive performance is limited. The features WHO Performance Status, Albumin, Platelets, Ki-67, Tumor Morphology, Total MTV, Total TLG, and SUVmax are the most stable and predictive features in our study.
[ "Anna Jenul", "Henning Langen Stokmo", "Stefan Schrunner", "Mona-Elisabeth Revheim", "Geir Olav Hjortland", "Oliver Tomic" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10106v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10106v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 6 0 1 0 1 . 2 0 3 2 : v i X r a TOWARDS UNDERSTANDING THE SURVIVAL OF PATIENTS WITH HIGH-GRADE GASTROENTEROPANCREATIC NEUROENDOCRINE NEOPLASMS: AN INVESTIGATION OF ENSEMBLE FEATURE SELECTION IN THE PREDICTION OF OVERALL SURVIVAL A PREPRINT Anna Jenul Department of Data Science Norwegian University of Life Sciences ̊As, Norway [email protected] Stefan Schrunner Department of Data Science Norwegian University of Life Sciences ̊As, Norway [email protected] Henning Langen Stokmo∗ Division of Radiology and Nuclear Medicine Oslo University Hospital Oslo, Norway [email protected] Mona-Elisabeth Revheim† Division of Radiology and Nuclear Medicine Oslo University Hospital Oslo, Norway [email protected] Geir Olav Hjortland Department of Oncology Oslo University Hospital Oslo, Norway [email protected] Oliver Tomic Department of Data Science Norwegian University of Life Sciences ̊As, Norway [email protected] February 21, 2023 ABSTRACT Determining the most informative features for predicting the overall survival of patients diagnosed with high-grade gastroenteropancreatic neuroendocrine neoplasms is crucial to improve individual treatment plans for patients, as well as the biological understanding of the disease. Recently de- veloped ensemble feature selectors like the Repeated Elastic Net Technique for Feature Selection (RENT) and the User-Guided Bayesian Framework for Feature Selection (UBayFS) allow the user to identify such features in datasets with low sample sizes. While RENT is purely data-driven, UBayFS is capable of integrating expert knowledge a priori in the feature selection process. In this work we compare both feature selectors on a dataset comprising of 63 patients and 134 features from multiple sources, including basic patient characteristics, baseline blood values, tumor histol- ogy, imaging, and treatment information. Our experiments involve data-driven and expert-driven setups, as well as combinations of both. We use findings from clinical literature as a source of expert knowledge. Our results demonstrate that both feature selectors allow accurate predictions, and that expert knowledge has a stabilizing effect on the feature set, while the impact on predictive performance is limited. The features WHO Performance Status, Albumin, Platelets, Ki-67, Tumor Morphology, Total MTV, Total TLG, and SUVmax are the most stable and predictive features in our study. ∗Henning Langen Stokmo is also affiliated with the Institute of Clinical Medicine, University of Oslo, Oslo, Norway †Mona-Elisabeth Revheim is also affiliated with The Intervention Centre, Oslo University Hospital, Oslo, Norway, and the Institute of Clinical Medicine, University of Oslo, Oslo, Norway Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT 1 Introduction Gastroenteropancreatic (GEP) neuroendocrine neoplasms (NEN) are heterogeneous types of malignancies increas- ingly common over the last three decades [1, 2]. High-grade GEP NEN encompasses both neuroendocrine tumors grade 3 (NET G3) and neuroendocrine carcinomas (NEC), where NEC is further subdivided into small cell (SC) and large cell carcinomas (LC). According to the WHO 2019 Classification of Tumors: Digestive System Tumors, NET G3 are well differentiated (WD), whilst NEC are poorly differentiated (PD), both with a Ki-67 proliferation index (Ki- 67) > 20% [3]. Although both NET G3 and NEC share features of immunohistochemical staining with chromogranin A and synaptophysin, they are considered morphologically different [4]. The prognosis for patients with advanced GEP NEC is poor, with a median survival of less than 12 months [5,6], whilst the prognosis for locoregional GEP NEC is higher; 20.7 months [7]. Numerous recently published studies [5, 8–14] have shown the prognostic importance of several parameters on overall survival (OS) such as age, performance status (PS), primary tumor site, tumor differentiation, TNM-stage, serum lactate dehydrogenase (LDH), serum platelet levels, proliferation marker Ki-67, maximum standardized uptake value (SUVmax), total metabolic tumor volume (tMTV) and total total lesion glycolysis (tTLG). Establishing more robust prognostic parameters and validating established parameters is essential to provide optimal care for this patient group. Forecasting the OS of cancer patients as a major indicator of treatment success by machine learning models is of high relevance to offering optimal individual treatments for patients. In particular, accurate outcome prediction models pave the way for decision support in clinical practice. Since GEP NEN are rare, however, the data basis for training purely data-driven models is limited, leading to problems like overfitting, spurious correlations, and, consequently, to inaccurate predictions [15–17]. Two major approaches are at hand to overcome these issues: (a) increasing the number of samples (either by collecting more data or by artificial data augmentation) or (b) reducing the dimensionality of the feature space. In this work, we elaborate on approach (b), where our method of choice is feature selection. While general dimensionality reduction methods like Principal Component Analysis [18] transform the data to a new domain and thereby make identification of influencing factors difficult, feature selection reduces the dimension by subsetting the dataset by columns. As a result, a subset of the original features is retained, and the interpretability of the data columns is preserved. Beyond the obvious benefit that predictive models become tractable, feature selection has the potential to improve the understanding of biological processes by clinical experts [19]. In particular, feature selectors point to input data parameters, which are related to explaining the target variable by a data-driven model. This information may either support or contradict existing hypotheses about the underlying biological processes or disclose previously unknown relations. The evaluation and interpretation of the findings require close collaboration between clinical experts and data scientists. However, such an application of feature selectors is still less common in machine learning, where the focus typically lies exclusively on optimizing performance metrics. State-of-the-art research in feature selection with applications in healthcare, such as L1 regularization [20], decision trees [21], Laplace scores [22], or the minimum redundancy-maximum relevance (mRMR) criterion [23], are mainly data-driven and may suffer from well-known limitations. Among these limitations is the problem that minor changes, such as the inclusion of new or removal of old samples, may have significant effects on the set of selected features - the property of feature sets to remain invariant under such changes to the dataset is referred to as feature selection stability and investigated in [24]. The usage of ensemble feature selectors, which train multiple feature selectors on subsets of the samples in a dataset, has recently been investigated extensively [25] and achieves a higher feature se- lection stability compared to a single feature selection run, while retaining a similar predictive performance, as used e.g., in random forest methods [26]. More recently, this fact has been exploited to introduce more stable feature se- lection methods tailored for healthcare applications, which offer a large potential with respect to the aspects discussed above [19, 27]. This paper aims to improve the understanding and insights into the OS in patients with high-grade GEP NEN by applying recently developed ensemble feature selection techniques. Specifically, we evaluate the Repeated Elastic Net Technique for Feature Selection (RENT) [27], as well as the User-Guided Bayesian Framework for Feature Selection (UBayFS) [19] on a dataset containing 63 patients diagnosed with high-grade GEP NEN. Our experiments compare both ensemble feature selectors in setups with and without the use of expert information. Our main goals are: (I) to determine the most informative set of features with respect to the outcome prediction task; (II) to interpret those selected features clinically - to evaluate the first goal, we measure the quality of the selected feature set in terms of predictive performance and selection stability. Another aspect of interest is: (III) to determine the effect of integrating prior expert knowledge into the feature selection process, compared to a purely data-driven pipeline. To this end, we discuss the feature selection results with respect to their clinical relevance and potential to improve our understanding of what influences OS of GEP NEN patients. 2 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT In the following, we denote the input data matrix by X ∈ Rm×n, where m denotes the number of Notations patients, and n denotes the number of features. Further, the target variable is denoted by y ∈ Rm. A feature set S is characterized by the indices, S ⊆ {1, . . . , n}. Vectors and matrices are indicated by bold letters. 2 Materials and Methods 2.1 GEP NEN dataset Statements of Ethics This study was done in concordance with the Declaration of Helsinki. Approval from the regional committee for medical and health research ethics (2012/490, 2012/940, 2018/1940) and the local data protec- tion officer was obtained. Informed consent was obtained from all patients at the time of inclusion but was waived for the patients in terminal phase and deceased. Patient cohort Patients were identified from a single institutional cohort at Oslo University Hospital, also included in two multi-institutional Nordic NEC registries organized by the Nordic Neuroendocrine Tumor Group, previously In short, this cohort consisted of 192 patients included between January 2000 and July 2018, described by [8]. with GEP NEC classified according to the WHO 2010-classification [28]. In addition, all patients who had per- formed a fluorine-18 labeled 2-deoxy-2-fluoroglucose ([18F]FDG) positron emission tomography/computed tomogra- phy (PET/CT) within 90 days of their histological evaluation were eligible for inclusion. A hundred and seven patients did not have PET/CT performed, and two patients had no metabolic active lesions available for evaluation. Seventeen patients had more than 90 days between their biopsy and PET/CT, leaving 66 patients available for inclusion in this study. Histological re-evaluation As described previously in [8], the histological re-evaluation was performed on both core biopsies and surgical specimens from GEP NEC primary tumors and metastases. These were re-classified according to the most recent WHO 2019-classification [3] with regards to synaptophysin, chromogranin A, and the proliferation marker Ki-67. In this study, only the re-evaluated histology features were used, while the original histology block was discarded. PET/CT acquisition All PET/CT scans were done according to the European Association of Nuclear Medicine (EANM) guidelines [4, 5] as part of the clinical routine. The three PET scanners used were a 40-slice Siemens Biograph mCT hybrid PET/CT system (Siemens Healthineers, Erlangen, Germany), a Siemens Biograph 64, and a 64-slice General Electric (GE) Discovery 690 (GE Healthcare, Waukesha, WI, USA). Both Biograph PET/CTs were both EANM Research Ltd. (EARL)-accredited, whilst the Discovery 690 followed similar routine quality controls harmonizing with the two Biographs for cross-calibration. All acquisitions were from the vertex or skull base to mid-thighs. Before the PET acquisition, a low dose CT was acquired for anatomical information and attenuation correction. Parameters from PET were extracted using the ROI Visualisation, Evaluation, and Image Registration (ROVER) software v3.0.5 (ABX GmbH).3 Treatment All patients received treatment in the form of surgery, chemotherapy, or a combination of both. In total, 54 patients received the standard treatment of platinum-based chemotherapy. Patients could have surgery prior to or after [18F]FDG PET/CT. Evaluation of response to chemotherapy treatment was done with CT using the Response Evaluation Criteria in Solid Tumors (RECIST) [29]. Outcome variable Our outcome variable, or outcome target, was overall survival (OS) in months. This can be defined as the time a patient remains alive from the time of diagnosis to death of any cause; hence, it is not disease- specific. It is a reliable and easily available survival measure [30]. We can analyze such survival data, i.e., the time from diagnosis to the time of death, using the Kaplan-Meier estimator. For those patients who did not experience the event during the time of the study (or during follow-up) (i.e., death), they are said to be 'censored' [31]. Being 'censored' means that we do not know when this event will occur, only that it has not happened at the end of the study (or during follow-up). Across the full dataset, the empirical distribution of the outcome variable is illustrated as a histogram in Fig. 1. 3The detailed imaging- and extraction protocol is described in [8]. 3 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT Figure 1: Distribution of the overall survival in months. Figure 2: Correlations between input features (features with absolute correlations ≤ 0.5 were removed). 4 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT raw input dataset 66 × 137 remove outliers less than 25% missing values? no yes remove columns missing value imputation feature type? categorical ordered numeric one-hot encoding ordinal encoding Yeo-Johnson & standardization preprocessed dataset 63 × 134 Figure 3: Preprocessing pipeline for the dataset. Data blocks The data were grouped into five different blocks (p) patient characteristics (b) baseline blood values (h) re-evaluated histology (i) PET/CT imaging (t) treatment The data contained mainly categorical and ordinal features with very few continuous variables. An overview of the pairwise correlations between the n = 134 features is provided in Fig. 2. 2.2 Data preprocessing The data preprocessing consists of several chronological steps prior to applying the ensemble feature selectors, see Fig. 3. Data cleaning The first step in data preprocessing is to discard features known to be unimportant, such as features with only one unique value for all patients or duplicated features. Furthermore, we remove all data columns containing more than 25% missing values across all patients. By this criterion, we remove 16 features from block (p), one feature from block (b), six features from block (h), 14 features from block (i), and eight features from block (t). Further, three patients are excluded from the experiments due to a high number of missing values in at least one block. All subsequent preprocessing steps are conducted on the remaining 63 patients and are applied by block to retain the homogeneous block structure. Missing values Some values were missing because the clinicians did not fill out the case registration forms (CRF) properly or completely. Amongst other reasons, this may be because the information was missing in the patient journal, a blood sample was not done, a parameter was forgotten registered in the patient journal, or because the patients are 5 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT Table 1: One-hot versus ordinal encoding of a 4-level variable (levels A, B, C, D). Ordinal encoding assumes an order of the levels (here: A<B<C<D). level one-hot encoding ordinal encoding A B C D (0,0,0) (0,0,1) (0,1,0) (1,0,0) (0,0,0) (0,0,1) (0,1,1) (1,1,1) referred from other hospitals. Such features, which are unavailable for a large percentage of patients, cannot be assessed properly in a data-driven manner and were therefore excluded - an imputation of those features would be unreliable due to the small sample size and may introduce incorrect or misleading information into the model. As a second step, we impute the features with less than 25% missing values via an adaptation of the k-nearest neighbors (kNN) imputation algorithm [32]. The number of features and the number of patients that have at least one missing value for each block are: (p) (7:25), (b) (5:16), (h) (7:6), (i) (2:2), and (t) (3:3) where the first number represents the number of features and the second number represents the number of patients. In particular, we restrict the feature space to non-missing columns and compute a matrix of pair-wise distances between all patients. We denote the set comprising the k-nearest neighbors of patient i by Nk(i) ⊆ {1, . . . , m}. Assuming that feature j is missing for patient i, we impute xi,j by ximp i,j , representing the median (instead of the mean, as suggested by [32]) of feature j across the patient's k nearest neighbors where the feature value is known, i.e. ximp i,j ← median {xl,j : l ∈ Nk(i)} . Ordered categorical features are transformed to an integer scale before interpolation. The usage of an odd value of k (by default, we use k = 5) guarantees that the median returns an integer, which is a clear benefit over the mean when using the technique for ordered features. (1) Categorical feature encoding Categorical features require encoding in order to be processed alongside numeric variables in predictive models. In particular, we distinguish between ordinal and nominal categorical variables: Nom- inal variables (i.e., variables without an internal order of the feature levels), such as clinical institution, are one-hot encoded [33]. Given a feature j with cj feature levels, the one-hot encoding produces a set of cj − 1 binary features {e2, . . . , ecj }, given as follows: (el)i = (cid:26) 1 0 if xi,j = l, otherwise, (2) for l ∈ {2, . . . , cj} indicating the feature level. The number of one-hot/ordinal categorical features is: 21/5 for block (p), 0/3 for block (b), 10/2 for block (h), 1/0 for block (i), and 5/0 for block (t). To avoid linear dependencies between features, the first feature level is not represented by a binary vector in the encoded space, but rather contributes to the model intercept, see Tab. 1. Features with an internal order among their levels (ordinal variables), such as the WHO performance status with levels 0, 1, 2, 3, and 4, require an ordinal encoding to retain the relevant information about the order. Under the assumption that the influence of a feature increases from lower to higher levels (i.e., higher levels comprise the lower levels and an additive effect), the following encoding is used: (el)i = (cid:26) 1 0 if xi,j ≤ l, otherwise. (3) for feature level l ∈ {2, . . . , cj}. Again, the first feature level, which would be assigned a value of 1 across all samples in the encoded space, is not assigned a binary vector in the encoded space. A comparison between one-hot and ordinal encoding is provided in Tab. 1. In contrast to transforming to an integer scale, this binary ordinal encoding preserves the order among the categories but does not pretend equal distances between the categories on a numerical scale. Feature transformation and normalization During our experiments, we split the dataset into train and test sets. To normalize the distribution of each numeric feature, we use the Yeo-Johnson power transformation along with standard- ization [34]. The Yeo-Johnson power transformation is an extension of the well-established Box-Cox transformation with the benefit that it enables the transformation of negative and zero values. The intention is to bring the data closer to a normal distribution by simultaneously stabilizing data variance. For a given feature j, Yeo-Johnson's power transform is defined as 6 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT Table 2: Encoding of the target variable "overall survival" (OS) [months]. level encoding OS ≤ 12 12 < OS ≤ 24 24 < OS ≤ 36 36 < OS ≤ 48 48 < OS ≤ 60 60 < OS 1 2 3 4 5 6 xYJ i,j ←    ((xi,j + 1)λj − 1) λj log(xi,j + 1) − ((−xi,j + 1)2−λj − 1) 2 − λj − log(−xi,j + 1) if λj (cid:54)= 0, xi,j ≥ 0 if λj = 0, xi,j ≥ 0 if λj (cid:54)= 2, xi,j < 0 if λj = 2, xi,j < 0. (4) Commonly, the transformation parameter λj is estimated from the data using a maximum likelihood approach. After the Yeo-Johnson transformation, we scale the data to zero mean and variance of 1. To prevent biased train and test data, the transformation parameter λj and the mean and variance for the standardization are estimated on the training data in each split separately. Encoding of the target variable Even though machine learning models for censored data are evolving, most present predictive models cannot handle censored data [35]. To avoid the problem presented by censored data, we encode the OS in months into an integer value (1-6). Using 60 months median follow-up time as a reference, there are no censored patients with OS below 60 months. Considering survival on a yearly basis we use the representation of the target variable in our experiments as in Tab. 2. Since each level in the encoded space equals one year, predictive errors used in the remainder of this paper refer to a yearly scale. 2.3 Feature Selection Methods In this work, we investigate two ensemble feature selection methods, which have been tailored to fit the requirements of datasets in the life science domain: the Repeated Elastic Net Technique for Feature Selection (RENT) [27] and the User-Guided Bayesian Framework for Feature Selection (UBayFS) [19]. Both methods build on the principle of (a) randomly subsampling the input dataset and (b) training an elementary feature selection model on each sample. The final feature set is determined by applying a meta-model on the feature sets selected by the elementary models, see Fig. 4. In the case of RENT, the elementary feature selector type is restricted to elastic net regularization [36] using logistic regression models for binary classification problems or ordinary least squares linear regression models for regression problems, while UBayFS operates on an arbitrary elementary model type. RENT The rules to obtain a final feature set further demonstrate the distinct scopes of the methods: RENT defines three criteria τ1, τ2 and τ3 for the selection of features based on the distribution of their weights across the elementary models; (I) the number of times the feature weights are non-zero (τ1) is above a level specified by the user; (II) the alternation of the sign of the feature weights does not surpass a user-defined level (τ2); (III) the size of the feature weights deviate significantly from 0 (τ3). The hyperparameters for RENT comprise of a number M of elementary models, an internal data split ratio, two parameters associated with the elastic net regularization in the elementary models (C and (cid:96)1), as well as one cut-off parameter for each of the three criteria τ1, τ2, τ3. UBayFS In contrast, UBayFS combines the selection frequency of each feature across the elementary models with prior information from domain experts, along with side constraints. In particular, the prior weighting of features is possible, along with the definition of linear side constraints between features (and feature blocks). In practice, weights can represent knowledge about the importance of features, which is verified from previous publications. Side constraints enable the user to restrict the feature set's maximum size maxs and account for the intrinsic block structure during feature selection (e.g., in multi-source datasets). Hence, RENT implements a purely data-driven approach based on Elastic Net, while UBayFS is a general meta-model with capabilities to integrate contextual information about the 7 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT data generation process. In its most basic setup, UBayFS requires as hyperparameters a number of elementary models M and an internal data split ratio, a maximum number of features maxs, and a model type to use as the elementary feature selector. input dataset X sub- sampling data subsets X1 X2 . . . Xm elementary feature selectors elementary feature sets δ1 δ2 . . . δm prior knowledge side constraints information from data information from expert RENT UBayFS selection criteria meta-model τ1 τ2 τ3 posterior distribution over δ final feature set δ(cid:63) Figure 4: Overall structure of both ensemble feature selection methods, RENT and UBayFS. After training elementary feature selectors, information is combined in a meta-model. While RENT uses information from data only, UBayFS additionally includes expert information. 2.4 Outcome prediction Linear regression Given a set of selected features S, we make use of linear regression models [37] to model the target variable y. In its simplest form, the linear regression model (with intercept) is given as y = ̃Xβ + ε, (5) where β ∈ Rn+1 is the model parameter vector, ̃X denotes the matrix containing one column of ones, followed by N (0, σ2) denotes the model error with the sub-matrix of X restricted to the columns contained in S. Further, ε ∼ iid constant error variance σ > 0. By default, parameters of linear regression models are obtained via ordinary least squares (OLS), i.e. by minimizing the least squares error (cid:107)y − ̃Xβ(cid:107)2 2. min β (6) Once the parameter vector β is estimated by optimizing Eq. 6 analytically, predictions are obtained by evaluating ˆy = ̃Xβ. k-nearest neighbor (kNN) regression As an alternative to the linear regression model, a k-nearest neighbor (kNN) regression model [37] is used to compute predictive results. In contrast to the linear regression model, the kNN model does not assume a linear relationship between the predictors and the target variable. Similar to the kNN method used for missing value imputation in Section 2.2, a neighborhood Nk(i) of sample i containing the k nearest training data points with respect to a Euclidean metric on the feature space is computed for any data point xi. The prediction for the target value yi corresponding to sample i is given by the mean of the neighbor's target values ˆyi = 1 k (cid:88) yl. l∈Nk(i) 8 (7) Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT Note that, the neighborhood Nk(i) is a subset of the training samples only, while ˆyi may represent both, training or test samples. Both predictive models, linear regression as well as the kNN regression model, are known to suffer from the curse of dimensionality - hence, we can assume that selecting a high number of features deteriorates each model. The opposite extreme for both methods, i.e., selecting no features at all, leads to predicting the output with the mean over the training data regardless of the input. Thus, we expect a well-performing feature selector to deliver a proper subset S of the feature set {1, . . . , n}, which allows both predictive models to perform better than the baselines given by (a) the overall mean of the target variable, and (b) a model including all features. 2.5 Implementation Parts of our analyses are conducted in the programming languages R [38]; other parts are conducted in Python [39]. We use the open-source implementations for RENT [40] and UBayFS [41]. For data preparation and preprocessing, we deploy the R package caret [42], and the Python package scikit-learn [43]. Fold indices are shared between R and Python. Predictive models are trained and evaluated in R using the caret package for all model setups. All plots are created using package ggplot2 [44]. All results are produced on an Intel Core i7 CPU @1.8 GHz, 32GB RAM under a Windows 11 Pro operating system. 3 Experiments Our experimental results are structured into a pre-study, where we determine optimal hyperparameters for the feature selection algorithms, followed by two main experiments. Experiment 1 focuses on the comparison of the two models, RENT and UBayFS, on the dataset without accounting for additional expert knowledge. Experiment 2 is operated on UBayFS only, as prior information and additional side constraints are included in the feature selection. Our main focus in the experiments lies on the selected feature sets, along with the impact of the feature selection on predictive performance. We provide feature counts from both of the investigated feature selectors, RENT and UBayFS, across five different train-test splits of the dataset. Unless specified otherwise, all experiments are conducted using the hyperparameters determined during the pre-study. 3.1 Experimental setup Model parameters Both algorithms, RENT and UBayFS, are trained on M = 100 ensemble models and internal 0.75/0.25-splits for sub-sampling the dataset. The underlying elementary feature selector for RENT is, by definition, an elastic net regularized linear regression model. Thus, RENT requires five hyperparameters to be determined during the pre-study (2 elastic net regularization parameters, (cid:96)1 and C, as well as three thresholds τ1, τ2, and τ3 for the selection criteria). In order to make results comparable with UBayFS, we further deploy a side condition to restrict the search space to settings, which deliver a maximum number of features maxs during validation. Thus, the number of features selected by RENT is approximately equal to the pre-defined parameter maxs. UBayFS uses minimum redundancy max relevance (mRMR) [23] as an elementary feature selector. The internal number of features in each elementary model is set to maxs, i.e., each elementary model selects exactly maxs features. For the meta-model, the same parameter maxs is used to restrict the maximum number of selected features via a max- size side constraint (hard constraint) - while different levels of maxs are evaluated in experiment 1, the parameter is set to the default maxs = 20 in experiment 2. Further, unless otherwise stated, prior feature weights in UBayFS are set uniformly to 0.1 across all features, which results in a non-informative prior. Train-test splits As the ratio between the number of patients and features is unbalanced, with 63 patients and 134 encoded features, the reliability of the feature ranking results must be validated to reduce the risk of spurious correla- tions and overfitting. Hence, we perform a 5-fold split of the dataset. For all possible permutations, we use four folds for training UBayFS or RENT, as well as the predictive models and the remaining fold for testing. Hyperparameters are determined on each split separately by internally subsetting the 4-fold training set (nested split). The 5-fold splits and hyperparameters determined in the pre-study remain the same across all experiments. For each feature selection method, we provide the selection frequencies of each feature across the 5 folds, i.e., a feature obtains an importance score between 0 and 5 according to the number of folds it was selected for. For predictive performance scores, a linear regression model and a kNN regression model are trained on the same training folds, using the features from the preceding feature selection, and evaluate the prediction error on the test set (averaged across all folds). 9 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT Table 3: Selected hyperparameters for each train/test split. parameter 1 2 RENT (cid:96)1 C τ1 τ2 τ3 0.3 1 0.3 0.3 0.975 0 1 0.5 0.5 0.975 fold 3 0.3 1 0.3 0.4 0.975 4 5 0.3 1 0.35 0.35 0.975 0.3 1 0.35 0.35 0.975 UBayFS maxs 20 20 20 20 20 Performance metrics To assess whether a feature set contains relevant information for training predictive models, we analyze the predictive performance in a regression setup following the feature selection step. The performance is quantified using the root mean squared error (RMSE), which has a lower bound of 0 and shall be minimized. Using the stability criterion introduced by [24], we further evaluate the feature selection stability across the five folds for RENT and UBayFS. The computed score is bounded in the interval [0, 1]; a value of 1 indicates perfect stability, i.e., the same feature set is selected in each model, while 0 indicates that selected feature sets show no overlap. Furthermore, the redundancy rate (RED) returns an intrinsic feature set quality measure by computing the average absolute Pearson correlation among the selected features. Small correlations are desirable as highly correlated features represent redundant information. Equally to the absolute Pearson correlation coefficient, RED is bounded in [0, 1]. In experiment 2, we additionally assign prior weights to a subset of features - therefore, we also evaluate the per- centage of prior-elevated features (PERC) in the selected feature sets as well. If PERC is high, features extracted via data-driven feature selectors match the domain experts' knowledge. However, a low PERC does not necessarily contradict expert knowledge since the features may be highly correlated, and therefore, similar information may be encoded in multiple distinct sets of features. 3.2 Pre-Study The pre-study aims to determine the optimal hyperparameters for RENT. Given a 0.75/0.25 outer train-test split as specified above, only train data are used for hyperparameter selection. For this purpose, 4-fold cross-validation is performed on each train dataset (using the same 4 folds as in the outer train-test split). Across the resulting 4 models, hyperparameters are selected by maximizing predictive performance in a grid search over the parameter space C ∈ {1, 10, 100, 1000}, (cid:96)1 ∈ {0, 0.1, 0.2, . . . , 1}, τ1, τ2 ∈ {0, 0.05, 0.1, . . . , 1}, and τ3 = 0.975 (fixed). The runtime for the full computation associated with the pre-study (parameter selection and final feature selection) for RENT comprised approx. 350 sec (16 cores, 24 threads in parallel). Since UBayFS does not require parameter selection, the runtime to evaluate the feature selection model for different levels of maxs (see Experiment 1) is shorter (approx. 65 sec without parallelization). Tab. 3 shows the hyperparameters identified for RENT and UBayFS in each train-test split (given by the numbers of the test folds 1-5). Due to the restriction of the maximum number of features, the stated parameters may not represent global maxima for the performance of RENT; however, comparability between the methods is preserved. Furthermore, since the number of features is restricted, the selected hyperparameters are in a similar range between the folds. 3.3 Experiment 1: feature selection without prior knowledge Having determined hyperparameters for each fold in the pre-study, RENT, and UBayFS are applied in each data split to the training dataset to select an optimized feature set for a given maxs on a purely data-driven basis. Selected features For each feature, selection frequencies across the five test folds are further provided in Tab. 4 (columns RENT and UBayFS, w = 0.1). In addition to the selection frequency, the table indicates whether a feature shows a positive or negative impact on the target variable according to the coefficients in the linear model, if selected. Thereby, ++ and −− indicate that a feature always shows the same sign across all predictive models. In contrast, + and − indicate a majority of positive or negative coefficients across the predictive models, respectively. 10 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT d e s a e r c n i h t i w s e r u t a e F . ) s e r u t a e f d e t c e l e s r o f w s l e v e l t h g i e w r o i r p t n e r e f f i d h t i w ( S F y a B U d n a T N E R y b s d l o f e v fi s s o r c a s e i c n e u q e r f n o i t c e l e s e r u t a e F : 4 e l b a T n o i s s e r g e r r a e n i l f o y t i r o j a m e h t t a h t e t a c i d n i − d n a + , s e s e h t n e r a p n I . s k s i r e t s a h t i w d e t h g i l h g i h e r a n m u l o c t s a l e h t n i d e t r o p e r p u t e s S F y a B U e h t n i s t h g i e w r o i r p s n g i s l a u q e d a h e r u t a e f e h t g n i n i a t n o c s l e d o m l l a t a h t e t a c i d n i − − r o + + ; y l e v i t c e p s e r , t n e i c fi f e o c e v i t a g e n r o e v i t i s o p a t i d e n g i s s a e r u t a e f e h t g n i n i a t n o c s l e d o m . n e v e s a w s n g i s f o n o i t u b i r t s i d e h t t a h t e t a c i d n i s e s e h t n e r a p o n e l i h w , s t n e i c fi f e o c r i e h t f o 0 1 1 = w S F y a B U 0 5 = w 1 . 0 = w T N E R e r u t a e f k c o l b ) - - ( 5 0 ) - ( 3 ) + ( 4 ) - ( 5 ) - ( 5 ) + + ( 5 ) + + ( 5 ) + ( 3 0 0 0 ) - - ( 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) - - ( 5 0 ) - ( 5 ) + + ( 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) - - ( 5 ) - - ( 5 ) - - ( 5 0 0 0 ) - - ( 1 ) + + ( 1 ) + + ( 1 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 ) - - ( 1 0 0 0 ) - - ( 2 ) + + ( 1 0 0 ) + + ( 2 ) + + ( 4 ) + + ( 5 0 ) - - ( 5 ) + ( 3 ) + + ( 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) - - ( 3 ) + + ( 1 0 ) - - ( 2 ) + + ( 1 0 0 0 0 0 0 0 ) - - ( 1 ) + + ( 1 ) - ( 3 ) - - ( 1 0 ) - - ( 1 ) + + ( 2 0 4 0 ) - - ( 5 ) + + ( 1 ) + + ( 4 0 0 0 0 0 0 0 0 ) - - ( 2 ) + ( 3 ) + + ( 4 ) + + ( 5 0 0 0 0 0 0 ) + + ( 3 ) + + ( 1 0 0 ) - - ( 1 ) + + ( 3 0 0 0 0 0 0 ) + + ( 4 ) + + ( 1 0 0 ) + ( 3 ) + + ( 4 0 0 0 0 0 ) + + ( 1 0 0 0 0 0 0 ) + ( 4 ) + + ( 1 ) + + ( 1 0 ) - - ( 1 ) + + ( 1 0 0 0 0 0 2 ) + + ( 4 ) + + ( 3 0 0 0 2 0 2 ) - - ( 2 ) + ( 3 4 ) - - ( 5 ) + + ( 1 ) + + ( 4 0 0 0 ) - - ( 2 0 ) + ( 4 ) + + ( 1 ) + + ( 4 0 0 ) - - ( 2 0 0 0 ) + + ( 4 ) + + ( 1 0 0 3 ) + + ( 5 . t e m I G f o e c n a n i m o D h t i W . r P n w o n k n U a m o n e d A m s a l p o e N g n i t s i x e - o C a i s a l p s y D m s a l p o e N g n i t s i x e - o C t c u d / r e d d a l b l l a G r u o m u T y r a m i r P c i r t s a G r u o m u T y r a m i r P l a n i m o d b a r e h t O r u o m u T y r a m i r P s u g a h p o s E r u o m u T y r a m i r P s i s a t s a t e M m a x E t s i H s a e r c n a P r u o m u T y r a m i r P m u t c e R r u o m u T y r a m i r P 7 6 - i K m s a l p o e N g n i t s i x e - o C o N D W y g o l o h p r o M r u o m u T g n i n i a t S A n i n a r g o m o r h C e v i t a r t l fi n I e r u t c e t i h c r A d i o n a g r O e r u t c e t i h c r A d i l o S e r u t c e t i h c r A r a l u c e b a r T e r u t c e t i h c r A t n a t s i D n r e t t a P l e s s e V c i r t s a G n o i t a c o L y s p o i B s i s a t s a t e M r e v i L n o i t a c o L y s p o i B e d o N h p m y L n o i t a c o L y s p o i B s u g a h p o s e O n o i t a c o L y s p o i B m u e n o t i r e P n o i t a c o L y s p o i B s a e r c n a P n o i t a c o L y s p o i B + 2 + 3 g n i n i a t S n i s y h p o t p a n y S g n i n i a t S n i s y h p o t p a n y S s i s o r c e N c i h p a r g o e G ] n i m [ n a c S o t n o i t c e j n I ] 3 ˆ m c [ V T M l a t o T ] g k [ t h g i e W a m o r t S o N a m o r t S t e l a t i p s o h s k i R n o i t u t i t s n I l l a a v e l l U n o i t u t i t s n I ] L / l o m m [ e s o c u l G ] m c [ t h g i e H ) l a t o t ( n a e m V U S ) l a t o t ( x a m V U S ] g [ G L T l a t o T n a e m V U S x a m V U S * * * * * * * * * * * * e n i b a t i c e p a C / e d i m o l o z o m e T e p y T y p a r e h t o m e h C s u m i l o r e v E / e d i m o l o z o m e T e p y T y p a r e h t o m e h C D P l a c i n i l C y l n O ) T S I C E R ( e s n o p s e R e s n o p s e R l a i t r a P ) T S I C E R ( e s n o p s e R d e s s e s s A t o N ) T S I C E R ( e s n o p s e R e s a e s i D e v i s s e r g o r P ) T S I C E R ( e s n o p s e R e s a e s i D e l b a t S ) T S I C E R ( e s n o p s e R t s e B t s e B t s e B t s e B t s e B e d i s o p o t E n i t a l p s i C h t i w n o i t c u d o r t n i e R ) s y a d ( t n e m t a e r t t s r fi o t T E P m o r f e m T i e d i s o p o t E / n i t a l p s i C e p y T y p a r e h t o m e h C r e h t O e p y T y p a r e h t o m e h C e s a e s i D f o n o i s s e r g o r P d e p p o t S t n e m t a e r T y t i c i x o T d e p p o t S t n e m t a e r T r e h t O d e p p o t S t n e m t a e r T s e s r u o C f o r e b m u N n o i s s e r g o r P o N n o i s s e r g o r P ) h ( ) i ( ) t ( 0 0 0 0 0 0 0 0 0 0 ) - ( 5 ) - - ( 5 0 1 1 = w 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) + ( 5 ) - - ( 5 ) - - ( 3 ) - ( 3 0 ) + ( 5 0 0 0 0 0 0 0 0 0 0 ) + ( 5 ) + + ( 4 S F y a B U 0 5 = w 1 . 0 = w T N E R ) - ( 5 ) + + ( 1 ) - - ( 1 ) + + ( 1 0 0 0 0 0 0 0 0 0 0 ) - - ( 3 0 0 0 0 0 0 0 0 ) - - ( 5 ) - - ( 1 ) + + ( 1 2 0 0 0 0 0 0 0 0 0 ) + ( 3 ) - ( 4 ) + + ( 2 ) - - ( 5 ) - - ( 5 ) - - ( 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) + ( 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) + ( 4 ) + + ( 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) - - ( 1 ) + + ( 3 ) - - ( 1 ) - - ( 2 ) - - ( 2 0 0 ) - - ( 3 ) - - ( 5 0 0 0 0 0 ) - ( 5 ) - ( 5 ) - - ( 1 ) - - ( 4 0 0 0 0 0 ) + + ( 1 ) + + ( 1 0 0 0 0 0 0 ) - - ( 5 ) - - ( 4 0 0 0 0 0 ) - - ( 4 ) - - ( 5 ) - - ( 1 ) - - ( 5 0 0 0 0 0 0 0 0 0 0 2 0 0 ) - ( 5 ) - - ( 1 ) - - ( 4 ) + + ( 1 0 0 0 0 0 0 ) - - ( 5 ) - - ( 5 ) - - ( 4 ) - - ( 2 ) s y a d ( s i s a t s a t e M o t T E P m o r f ) s y a d ( s i s o n g a i D o t T E P m o r f ) s h t n o m ( s t e m o t g a i d m o r f e s a e s i D e l b a t c e s e R . v d A e c n e r u c c e R e m T i e m T i e m T i x e S . c o L . c o L s i s o n g a i D f o e m T i t a e s a e s i D c i t a t s a t e M e v i t a i l l a P n o i t n e t n I t n e m t a e r T s i s o n g a i D t a e g A * e r u t a e f k c o l b L N U 2 = < l a m r o N > A n i n a r g o m o r h C L N U 3 = < l a m r o N > P L A L N U 3 > P L A ) b ( L N U 2 > A n i n a r g o m o r h C L N U 2 = < l a m r o N > H D L L N U 2 = < l a m r o N > E S N L N U 2 > H D L L N U 2 > E S N s t e l e t a l P * * * d e t c e s e R r u o m u T y r a m i r P 1 M e g a t s - M I M B r e k o m S n o N r e k o m S 1 > y t i r e v e S y t i d i b r o m - o C 1 y t i r e v e S y t i d i b r o m - o C y r e g r u S l a c i d a R l a n o i g e R N L s t e M t n a t s i D N L s t e M o r t e R N L s t e M e n o B s t e M r e v i L s t e M g n u L s t e M r e h t O s t e M n i k S s t e M N L s t e M l a c i g o l o h t a P g n i g a t s V I e g a t S d e p u o r g M N T e g a t S * r e c n a C r e h t O r o i r P e n o l A g n i v i L 1 2 3 4 t a t S f r e P O H W t a t S f r e P O H W t a t S f r e P O H W t a t S f r e P O H W 1 N > e g a t s - N 2 T e g a t s - T 3 T e g a t s - T 4 T e g a t s - T 1 N e g a t s - N t n u o C l i h p o r t u e N . s b A n i b o l g o m e a H e n i n i t a e r C C B W n i m u b l A P R C * * * * * ) p ( 11 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT (a) kNN regression on RENT features (b) kNN regression on UBayFS features (c) linear regression on RENT features (d) linear regression on UBayFS features Figure 5: Predictive performances (on test set) of models trained after feature selection for different numbers of features. Predictive performance Further, Fig. 5 illustrates the predictive performances of kNN and linear regression models trained after UBayFS and RENT feature selection. The plot shows the RMSE for each fold given a predefined number of selected features maxs. Notably, RENT performs better using the linear regression model as the predictor, while UBayFS shows a better performance in combination with kNN. The stronger performance of RENT with linear regression may be a result of the fact that the underlying feature selection in RENT is based on a regularized linear regression model. UBayFS, however, is based on mRMR, which does not build upon a linear predictive model. While linear regression results deteriorate at a higher number of features (maxs > 30), the kNN model retains a similar performance level, which suggests that the curse of dimensionality does not yet have a strong effect on the Euclidean distance for the given feature space dimensionalities. For the linear model, overfitting is triggered by a large ratio between the number of features and the number of patients. Among all compared methods, differences between the folds are obvious: for instance, fold 4 is predicted with the least RMSE across all combinations of feature selector, predictive model, and maxs. On the other hand, fold 2 is associated with a large RMSE in the models based on UBayFS, while fold 3 shows similar behavior for the kNN model based on RENT features. Potentially, differences between folds may be caused by two factors (or combinations of both): • the cohort of patients in the training set does not represent the global distribution of the data well - e.g., the training data do not contain a sufficient number of samples with particularly high or low target values (bad prediction due to a bad model); • the cohort of patients in the test set is particularly hard to estimate, e.g., due to outliers (bad prediction in spite of an appropriate model); Due to the low number of only 12-13 patients in each fold, even a low number of hard-to-predict outliers may deteri- orate RMSE results significantly. 12 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT Figure 6: Histograms of errors on the test set (predicted value by kNN - ground truth) of the folds performing best (fold 4) and worst (fold 2) at maxs = 20 features. Residuals In order to shed light on the dynamics leading to the differences in performance between the data folds, histogram plots of the residuals for fold 2 (worst fold in UBayFS) and fold 4 (best fold across most setups) at maxs = 20 are provided in Fig. 6. Residuals are defined as the difference between the true value and the prediction; thus a positive or negative residual value indicates an underestimation or overestimation of the lifetime, respectively. In contrast to fold 4, the residuals from fold 2 are more dispersed. All histograms are symmetric and centered around 0, which indicates that all methods are able to estimate the intercept correctly. In both folds, the prediction model was able to predict the correct lifetime category for almost half of the patients in the test set. However, the histogram indicates that predictive models based on both feature selectors overestimate the lifetime in test fold 4 (positive errors), while lifetimes in test fold 2 are rather slightly overestimated (negative errors). The main difference in performance between fold 2 and fold 4 is driven by dispersion, i.e. by a minority of patients, which show a high error - due to the small sample size, even a small number of such outliers can impact the total RMSE significantly. When considering patients with absolute residual values > 2.5 as outliers, RENT, and UBayFS show 3 outliers in fold 2, each (RENT: 2 positive, 1 negative; UBayFS: 1 positive, 2 negative). Both methods commonly misclassify one patient with true target value 6 and predictions 2.6 (UBayFS) and 2 (RENT), which substantiates the highest positive outlier in both histograms. The remaining two outliers of each method refer to different patients. Stability In addition to the performance evaluation, we further investigate qualitative aspects of the selected feature sets, as shown in Fig. 7. The demonstrated stabilities and redundancy rates (RED) of the feature sets selected by RENT and UBayFS across the five folds tend to increase with maxs. While RENT has a slightly lower and more fluctuating stability (around 0.5), UBayFS shows a clear convergence at around 0.6. The RED is below 0.25 for all possible numbers of features, indicating that both RENT and UBayFS select features with small correlations. 3.4 Experiment 2: feature selection with prior knowledge Previous research on GEP NEN shows that some features impact the survival of patients; those are Age at diagnosis, WHO performance status, Primary tumor location, Tumor morphology, Tumor differentiation, Lactate dehydrogenase (LDH), Platelets, Albumin, Ki-67, SUVmax, and TNM-staging [5, 8–14]. Tumor differentiation is highly correlated to tumor morphology, so we do not include the feature in this work. Furthermore, findings by [8] indicate a high relevance of the features Total MTV [cm3] and Total TLG [g], which shall be investigated. In this experiment, we focus on these features (a total number of 22 features in the encoded space) within our feature selection and prediction pipeline. In particular, during experiment 1, the aforementioned features comprise 30% of the final feature sets (on average across the five folds and given maxs = 20 features, each). We refer to this score as PERC (percentage of selected features supported by literature). In the following, we deploy prior weights on these features to investigate how UBayFS as a hybrid feature selector combining information from experts and data, performs in comparison to the pure data-driven methods presented in experiment 1. Since RENT cannot incorporate prior feature importances, this evaluation is restricted to UBayFS. 13 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT (a) RENT features (b) UBayFS features Figure 7: Stabilities and redundancy rates (RED) of feature sets selected by RENT and UBayFS (maxs = 20 features, each). Specifically, we increase the prior weight of the 22 features supported by literature (referred to as prior-elevated fea- tures) to the following levels: w ∈ {0.1, 10, 20, . . . , 100, 110} - after evaluating all levels with respect to predictive performance, we restrict to special cases w = 0.1 (non-informative prior weighting), w = 50 (mediocre prior weight- ing), and w = 110 (strong prior weighting). After applying UBayFS with the given levels of prior information, we examine how the feature set and the predictive performance develop. The case of 0.1 is equivalent to the uniform case without prior knowledge (default setup for UBayFS in experiment 1). In contrast, prior weight 110 indicates that each prior-elevated feature already is assigned a higher score than the maximum score that can be achieved throughout the elementary models (M = 100) - as a result, the selected features are exclusively restricted to those with prior information and elementary feature selectors in UBayFS are only used to select a feature set of maxs = 20 features among the 22 prior-elevated features. Predictive performance Fig. 8 shows the average performances along with the standard deviations across the 5 test folds. In general, lower levels of prior weights do not significantly impact the performance, although a minor improvement can be observed in folds 4 (kNN) and fold 3 (linear model) up to w = 40. By increasing the prior weight to a higher level, performance levels lead to stronger variability and an increase of RMSE in the better-performing folds, such as fold 4. Finally, if the prior weight is set to the maximum level of 110, all folds converge to a similar level since the data-driven feature selection hardly contributes to these setups. Thus, a potential conclusion is that moderate levels of prior knowledge can slightly increase models' capabilities. In contrast, strong prior knowledge leads to a convergence towards the global mean performance across all folds - such prior setup acts as a strong restriction of the search space exploited by the feature selector. Stability In contrast to the minor effects of prior knowledge on predictive performance, stability increases signifi- cantly, as shown in Fig. 8. Finally, at a maximum level of w = 110, stability converges towards an almost perfectly stable solution. This is due to the restriction of the search space to the prior-elevated features, which results in a selection of 20 out of only 22 features in total. As expected, the percentage of selected features supported by literature (PERC) also increases linearly with the level of prior weights provided. The redundancy rate between the selected features shows a slight decrease, indicating that the prior-elevated features contain only small correlations. 4 Discussion Experiment 1 In our first experiment, we left out prior expert knowledge and let the feature selection be purely data-driven. We know that certain features were prognostic for survival in earlier studies, as mentioned in experiment 2 below. We wanted to study whether the same prognostic features would still be selected and if there were any currently unknown prognostic features that could be further researched. Comparing the two first columns in Tab. 4 we can see which features are selected repeatedly in different folds with RENT and UBayFS. We must keep in mind that we cannot directly compare the importance of the features in terms of a coefficient (e.g similar to Cox regression), just that they are repeatedly selected in each fold. Further, the correlation between features must also be considered when comparing the importance of features which we can find in Fig. 2. Two or more features with a moderate/high correlation contain the same information with respect to the model, and one fold may choose one over the other, whilst 14 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT (a) Predictive performance using kNN regression (b) Predictive performance using linear regression Figure 8: Experiment 2: predictive performances on fold 1-5, and qualitative metrics of features sets produced by UBayFS at different levels of prior knowledge on features with evidence from literature (maxs = 20). (c) Qualitative evaluation another fold may choose a highly correlated one instead. This results in a lower number for both features, not reflecting the importance of both when comparing them with a feature with a high number. In block (p) (baseline patient characteristics) we have a few features that one would expect to be prognostic for OS. One obvious one would be TNM-stage IV disease which does not seem to be chosen at all by RENT and UBayFS. But looking at the correlation heatmap in Fig. 2 we see that this feature is highly correlated to several other features, among those Metastatic Disease at Time of Diagnosis and Treatment Intention Palliative. We see that this last one gets chosen four out of five times with RENT and five out of five times with UBayFS which probably explains why TNM-stage IV does not seem to be important. Having a palliative treatment intention usually means you have stage IV disease. This is also a well-known prognostic indicator from the literature [6]. Bone metastasis is usually a poor prognostic indicator in several types of cancers [45] and it is not surprising that this is chosen all the time. We also know that WHO PS is a prognostic indicator in these patients. This is also reflected in the number of folds it is chosen by RENT and UBayFS, but it is only WHO level 2 that seems to be important. That said, Fig. 2 shows that WHO levels 3 and 4 are highly correlated to some of the SUV-parameters which might contribute to those never being selected. Radical Surgery is quite often chosen by both RENT and UBayFS and is also a predictable prognostic indicator. Having radical surgery means that all viable tumors are removed, and that is only possible if you have a low tumor burden. This underlines the importance of surgery in the curative intended treatment of this type of cancer. Next, in block (b) (baseline blood values), we see that both CRP and ALP > Normal <= 3UNL get selected equally many times by both RENT and UBayFS, and both have a high number indicating importance over the other features in this block. A high CRP at baseline has previously been shown to be a poor prognostic feature in some studies [5,46,47], whilst others have not replicated this [48]. This is probably not surprising as this has been shown to be a poor prognostic indicator in advanced cancer patients in a palliative setting, and especially in GEP NEN [49–52]. ALP has also been shown in studies to be prognostic for a shorter OS [5, 53, 54]. For Albumin and Platelets, RENT chose these only half as many times as UBayFS. Both have been shown to be prognostic indicators of OS [5, 6]. Interestingly, Haemoglobin, WBC, LDH, and Chromogranin A are barely chosen or are not chosen neither by RENT nor UBayFS. All these features have previously been shown to be prognostic for OS [5]. 15 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT Moving on to block (h) (re-evaluated histology) we have quite a few features that are well-known prognostic indicators. The strongest one from the literature is probably Ki-67 which is used in the classification system of NEN. The second strongest is probably Tumor Morphology which has been shown in several studies to be prognostic for OS [5, 6]. We see that Ki-67 is chosen every time from all five folds both for RENT and UBayFS supporting this feature as a strong prognostic indicator for OS. Further, Tumor Morphology gets chosen four out of five times with RENT and three out of five times with UBayFS. This is also to be expected since we know that patients with NET G3 have a better OS than those patients with NEC [55]. What is surprising is that most tumor sites, especially those patients with unknown primary and esophagus NEN, are not chosen by RENT or UBayFS. Primary Tumor Site has been shown to be prognostic in several studies [5, 6]. Several of the features like Stroma, Architecture, Vessel Pattern, Co-existing neoplasm, and Geographic Necrosis are considered typical for either NET G3 or NEC [56], and one might assume these are highly correlated with Tumor Morphology. Although this is not reflected in Fig. 2. Almost none of these features are chosen with RENT or UBayFS except for Stroma. NET G3 typically have hyalinized stroma and NEC have desmoplastic stroma [56]. Further, in block (i) (PET/CT imaging) the interesting features are Total MTV, Total TLG, and the SUV-parameters. From Fig. 2 and previous literature [8] we know that these features are often (if not always) highly correlated. Hence, the selection of SUVmax (total) instead of the other features is probably related to this. Moreover, we know from previous studies [8, 11–13] that global measures such as Total MTV and Total TLG are poor prognostic indicators for OS in these tumors, but we lack stronger evidence in form of larger studies. Here we see that SUVmax (total) is chosen in all five folds both for RENT and UBayFS supporting the previous findings that PET-parameters are good prognostic features of OS. Finally, in block (t) (treatment) we can see a few features are selected often. Chemotherapy treatment with cis- platin/etoposide is not surprisingly a predictor for OS, and most of the patients did indeed receive this combination. No chemotherapy is obviously detrimental. We also see that the Chemotherapy treatment with temozolomide/everolimus gets chosen often both by RENT and UBayFS. This is probably because this chemotherapy regimen is more often chosen for those patients with a low Ki-67 and these are more likely to be NET G3 which already have a better OS. Further, both Number of Courses and Progression are two features that are selected often by RENT and UBayFS. Pro- gression and No Progression are obviously poor prognostic indicators, and one could assume that the higher Number of Courses a patient receives the longer before they have progression and hence they live longer. This is of course only an assumption and interpretation of the data at hand. It is a bit surprising that the response evaluation results did not get chosen. One would assume that patients with the best response - stable disease would fare better than those with progressive disease. Looking at Fig. 2 the features from this block have low correlation coefficients. Experiment 2 Here we added prior expert knowledge and assigned two different weights. A weight w = 50 means approximately 50% expert-driven and 50% data-driven. A weight w = 110 means almost purely an expert-driven ap- proach where we effectively force the selection of features only from the subset of those from prior expert knowledge. We concentrated on features that are well documented in several previous studies, although there exist more features in the literature suggesting prognostic values than these. The features selected from prior expert knowledge are listed in the first paragraph in Section 3.4 and marked by an asterisk in Tab. 4. If we concentrate on the second, third, and fourth columns, which shows the difference between roughly 0%, 50% and 100% expert-driven, we see that none of the marked features drops in importance as we increase the value of expert knowledge. Some features that were never chosen with a pure data-driven model are still not chosen. One could argue that these are probably not strong features to begin with, or that other features contain the same and/or stronger information. A few features only get chosen when almost completely removing the data-driven part and make a huge leap from not being chosen to being chosen five times. We argue that one should be careful to put too much importance on these features as we expect these are more or less forced to be chosen. A few features stand out by being stable across all values of w; WHO Performance Status, Albumin, Platelets, Ki-67, Tumor Morphology, Total MTV, Total TLG, and SUVmax. It would be bold to assume that these features are the most important and stable predictors of OS from the subset of expert knowledge markers, but that would probably be too premature. Further, it is also interesting to notice that even though several parameters from PET are highly correlated, several are still chosen very often by the model. This is in line with the results of our previous study ( [8]. Moreover, it is a bit surprising that Primary Tumor Site, especially Unknown Primary and Esophagus, is not chosen more often as these are well-known negative predictors of OS [5, 6]. We also notice that some of the other non-marked features drop in importance as we increase w, and this is probably related to the fact that the features overlap in the information they add to the model. A few of these features are also moderately or highly correlated. E.g. CRP is correlated with quite a few of the other blood markers, and this could explain why it falls in importance when increasing w. Mets Bone (bone metastases) is not listed in the correlation 16 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT heatmap and thus has no moderate or high correlations with other features, but still completely falls out. Bone metas- tases usually occur late in several cancers and is a poor prognostic feature. Hence, one should assume that this feature and similar ones like CRP, ALP, which performs well with low values of w falls of in the pure knowledge-driven model because the model is "forced" to select only marked features. We must remember that the w = 110 is an ex- treme expert-driven model which is probably not clinically relevant but was added to explore and evaluate what the model did in this extreme situation. This is a small, novel study with few patients and really the first of its kind for exploring and evaluating RENT and UBayFS on clinical data. Using these ensemble feature selectors may be used for validating already established features, or to find new features not previously known. Evaluation into which w is optimal should be explored further in future studies. 5 Conclusion In conclusion, although we cannot ascertain how important different features are compared to each other and if they contribute to poorer or better survival, we do find similar results as several previous studies. The most stable and predictive features in our study are WHO Performance Status, Albumin, Platelets, Ki-67, Tumor Morphology, Total MTV, Total TLG, and SUVmax. From a data science perspective, we demonstrated the capabilities of the ensemble feature selection techniques RENT and UBayFS for healthcare problems - in particular, the inclusion and comparison of expert- and data-driven setups, as well as combinations of both, allow the user to gain relevant information for clinical use. References [1] Benjamin E. White, Brian Rous, Kandiah Chandrakumaran, Kwok Wong, Catherine Bouvier, Mieke Van Hemel- rijck, Gincy George, Beth Russell, Rajaventhan Srirajaskanthan, and John K. Ramage. Incidence and survival of neuroendocrine neoplasia in England 1995–2018: A retrospective, population-based study. The Lancet Regional Health - Europe, 23:100510, December 2022. [2] Raziye Boyar Cetinkaya, Bjarte Aagnes, Espen Thiis-Evensen, Steinar Tretli, Deidi S. Bergestuen, and Svein Hansen. Trends in incidence of neuroendocrine neoplasms in Norway: A report of 16, 075 cases from 1993 through 2010. Neuroendocrinology, 104(1):1–10, November 2015. [3] International Agency for Research on Cancer. WHO Classification of Tumours. Digestive System Tumours. World Health Organization Classification of Tumours. IARC, 1 edition, July 2019. [4] Guido Rindi, David S. Klimstra, Behnoush Abedi-Ardekani, Sylvia L. Asa, Frederik T. Bosman, Elisabeth Brambilla, Klaus J. Busam, Ronald R. de Krijger, Manfred Dietel, Adel K. El-Naggar, Lynnette Fernandez- Cuesta, G ̈unter Kl ̈oppel, W.Glenn McCluggage, Holger Moch, Hiroko Ohgaki, Emad A. Rakha, Nicholas S. Reed, Brian A. Rous, Hironobu Sasano, Aldo Scarpa, Jean-Yves Scoazec, William D. Travis, Giovanni Tallini, Jacqueline Trouillas, J.Han van Krieken, and Ian A. Cree. A common classification framework for neuroen- docrine neoplasms: an International Agency for Research on Cancer (IARC) and World Health Organization (WHO) expert consensus proposal. Modern Pathology, 31(12):1770–1786, December 2018. [5] H. Sorbye, S. Welin, S.W. Langer, L.W. Vestermark, N. Holt, P. Osterlund, S. Dueland, E. Hofsli, M.G. Guren, K. Ohrling, E. Birkemeyer, E. Thiis-Evensen, M. Biagini, H. Gronbaek, L.M. Soveri, I.H. Olsen, B. Federspiel, J. Assmus, E.T. Janson, and U. Knigge. Predictive and prognostic factors for treatment and survival in 305 patients with advanced gastrointestinal neuroendocrine carcinoma (WHO G3): The NORDIC NEC study. Annals of Oncology, 24(1):152–160, January 2013. [6] Arvind Dasari, Kathan Mehta, Lauren A. Byers, Halfdan Sorbye, and James C. Yao. Comparative study of lung and extrapulmonary poorly differentiated neuroendocrine carcinomas: A SEER database analysis of 162, 983 cases. Cancer, 124(4):807–815, December 2017. [7] Arvind Dasari, Chan Shen, Anjali Devabhaktuni, Ruda Nighot, and Halfdan Sorbye. Survival according to primary tumor location, stage, and treatment patterns in locoregional gastroenteropancreatic high-grade neu- roendocrine carcinomas. The Oncologist, 27(4):299–306, February 2022. [8] Henning Langen Stokmo, Mahmoud Aly, Inger Marie Bowitz Lothe, Austin J. Borja, Siavash Mehdizadeh Seraj, Rina Ghorpade, Xuan Miao, Geir Olav Hjortland, Eirik Malinen, Halfdan Sorbye, Thomas J. Werner, Abass Alavi, and Mona-Elisabeth Revheim. Volumetric parameters from [18F]FDG PET/CT predicts survival in patients with high-grade gastroenteropancreatic neuroendocrine neoplasms. Journal of Neuroendocrinology, 34(7):e13170, 2022. 17 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT [9] M Heetfeld, C N Chougnet, I H Olsen, A Rinke, I Borbath, G Crespo, J Barriuso, M Pavel, D O'Toole, T Walter, and other Knowledge Network members. Characteristics and treatment of patients with G3 gastroenteropancre- atic neuroendocrine neoplasms. Endocrine-Related Cancer, 22(4):657–664, June 2015. [10] Sangwon Han, Hyo Sang Lee, Sungmin Woo, Tae-Hyung Kim, Changhoon Yoo, Baek-Yeol Ryoo, and Jin-Sook Ryu. Prognostic value of 18F-FDG PET in neuroendocrine neoplasm. Clinical Nuclear Medicine, Publish Ahead of Print, May 2021. [11] David L. Chan, Elizabeth J. Bernard, Geoffrey Schembri, Paul J. Roach, Meaghan Johnson, Nick Pavlakis, Stephen Clarke, and Dale L. Bailey. High metabolic tumour volume on 18-fluorodeoxyglucose positron emission tomography predicts poor survival from neuroendocrine neoplasms. Neuroendocrinology, 110(11-12):950–958, November 2019. [12] Ho Seong Kim, Joon Young Choi, Dong Wook Choi, Ho Yeong Lim, Joo Hee Lee, Sun Pyo Hong, Young Seok Cho, Kyung-Han Lee, and Byung-Tae Kim. Prognostic value of volume-based metabolic parameters measured by 18F-FDG PET/CT of pancreatic neuroendocrine tumors. Nuclear Medicine and Molecular Imaging, 48(3):180– 186, February 2014. [13] Sun Min Lim, Hyunki Kim, Beodeul Kang, Hyo Song Kim, Sun Young Rha, Sung Hoon Noh, Woo Jin Hyung, Jae-Ho Cheong, Hyoung-Il Kim, Hyun Cheol Chung, Mijin Yun, Arthur Cho, and Minkyu Jung. Prognostic value of 18F-fluorodeoxyglucose positron emission tomography in patients with gastric neuroendocrine carcinoma and mixed adenoneuroendocrine carcinoma. Annals of Nuclear Medicine, 30(4):279–286, February 2016. [14] Giovanni Centonze, Patrick Maisonneuve, Natalie Prinzi, Sara Pusceddu, Luca Albarello, Eleonora Pisa, Mas- simo Barberis, Alessandro Vanoli, Paola Spaggiari, Paola Bossi, Laura Cattaneo, Giovanna Sabella, Enrico Solcia, Stefano La Rosa, Federica Grillo, Giovanna Tagliabue, Aldo Scarpa, Mauro Papotti, Marco Volante, Alessandro Mangogna, Alessandro Del Gobbo, Stefano Ferrero, Luigi Rolli, Elisa Roca, Luisa Bercich, Mauro Benvenuti, Luca Messerini, Frediano Inzani, Giancarlo Pruneri, Adele Busico, Federica Perrone, Elena Tam- borini, Alessio Pellegrinelli, Ketevani Kankava, Alfredo Berruti, Ugo Pastorino, Nicola Fazio, Fausto Sessa, Carlo Capella, Guido Rindi, and Massimo Milione. Prognostic factors across poorly differentiated neuroen- docrine neoplasms: a pooled analysis. Neuroendocrinology, November 2022. [15] P. Kubben, M. Dumontier, and A. Dekker. Fundamentals of Clinical Data Science. Springer International Publishing, 2019. [16] Mattea L. Welch, Chris McIntosh, Benjamin Haibe-Kains, Michael F. Milosevic, Leonard Wee, Andre Dekker, Shao Hui Huang, Thomas G. Purdie, Brian O'Sullivan, Hugo J.W.L. Aerts, and David A. Jaffray. Vulnerabilities of radiomic signature development: The need for safeguards. Radiotherapy and Oncology, 130:2–9, January 2019. [17] David Wallis and Ir`ene Buvat. Clever Hans effect found in a widely used brain tumour MRI dataset. Medical Image Analysis, 77:102368, April 2022. [18] Ian T. Jolliffe and Jorge Cadima. Principal component analysis: a review and recent developments. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 374(2065):20150202, April 2016. [19] Anna Jenul, Stefan Schrunner, J ̈urgen Pilz, and Oliver Tomic. A user-guided bayesian framework for ensemble feature selection in life science applications (UBayFS). Machine Learning, 111(10):3897–3923, 2022. [20] R. Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), 58(1):267–288, 1996. [21] L. Breiman, J. Friedman, C. J. Stone, and R. A. Olshen. Classification and Regression Trees. Taylor & Francis, 1984. [22] Xiaofei He, Deng Cai, and Partha Niyogi. Laplacian score for feature selection. In Proceedings of the 18th International Conference on Neural Information Processing Systems, NIPS'05, page 507–514, Cambridge, MA, USA, 2005. MIT Press. [23] Chris Ding and Hanchuan Peng. Minimum redundancy feature selection from microarray gene expression data. Journal of Bioinformatics and Computational Biology, 3(02):185–205, 2005. [24] Sarah Nogueira, Konstantinos Sechidis, and Gavin Brown. On the stability of feature selection algorithms. Journal of Machine Learning Research, 18(174):1–54, 2018. [25] Ver ́onica Bol ́on-Canedo and Amparo Alonso-Betanzos. Recent advances in ensembles for feature selection. Intelligent Systems Reference Library. Springer International Publishing, Basel, Switzerland, 1 edition, May 2018. 18 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT [26] L. Breiman. Random Forests. Machine Learning, 45(1):5–32, 2001. [27] Anna Jenul, Stefan Schrunner, Kristian Hovde Liland, Ulf Geir Indahl, Cecilia Marie Futsaether, and Oliver Tomic. RENT-repeated elastic net technique for feature selection. IEEE Access, 9:152333–152346, 2021. [28] International Agency for Research on Cancer. WHO classification of tumours of the digestive system. World Health Organization Classification of Tumours. IARC, 4 edition, November 2010. [29] E.A. Eisenhauer, P. Therasse, J. Bogaerts, L.H. Schwartz, D. Sargent, R. Ford, J. Dancey, S. Arbuck, S. Gwyther, M. Mooney, L. Rubinstein, L. Shankar, L. Dodd, R. Kaplan, D. Lacombe, and J. Verweij. New response evalua- tion criteria in solid tumours: Revised RECIST guideline (version 1.1). European Journal of Cancer, 45(2):228– 247, January 2009. [30] A. B. Mariotto, A.-M. Noone, N. Howlader, H. Cho, G. E. Keel, J. Garshell, S. Woloshin, and L. M. Schwartz. Cancer survival: An overview of measures, uses, and interpretation. JNCI Monographs, 2014(49):145–186, November 2014. [31] J M. Bland and D. G Altman. Statistics notes: Survival probabilities (the Kaplan-Meier method). BMJ, 317(7172):1572–1580, December 1998. [32] Max Kuhn and Kjell Johnson. Applied predictive modeling. Springer, New York, NY, 1 edition, May 2013. [33] Alice Zheng. Feature Engineering for Machine Learning. O'Reilly Media, Sebastopol, CA, April 2018. [34] I.-K. Yeo. A new family of power transformations to improve normality or symmetry. Biometrika, 87(4):954– 959, December 2000. [35] B Srujana, Dhananjay Verma, and Sameen Naqvi. Machine learning vs. survival analysis models: a study on right censored heart failure data. Communications in Statistics-Simulation and Computation, pages 1–18, 2022. [36] Hui Zou and Trevor Hastie. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(2):301–320, April 2005. [37] Trevor Hastie, Robert Tibshirani, and Jerome Friedman. The Elements of Statistical Learning. Springer New York, 2009. [38] R Core Team. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Comput- ing, Vienna, Austria, 2022. [39] Guido Van Rossum and Fred L. Drake. Python 3 Reference Manual. CreateSpace, Scotts Valley, CA, 2009. [40] Anna Jenul, Stefan Schrunner, Bao Ngoc Huynh, and Oliver Tomic. RENT: A Python package for repeated elastic net feature selection. Journal of Open Source Software, 6(63):3323, 2021. [41] Anna Jenul and Stefan Schrunner. UBayFS: An R package for user guided feature selection. Journal of Open Source Software, 8(81):4848, 2023. [42] Max Kuhn. caret: Classification and Regression Training, 2022. R package version 6.0-93. [43] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. [44] Hadley Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2016. [45] Genlian Chen, Qiang Xu, Shengjun Qian, Zhan Wang, and Shicheng Wang. Survival analysis in gastrointestinal [46] neuroendocrine carcinoma with bone metastasis at diagnosis. Frontiers in Surgery, 9, January 2022. ̈Omer Komac ̧, G ̈oksel Bengi, ̈Ozg ̈ul Sa ̆gol, and Mesut Akarsu. C-reactive protein may be a prognostic factor for the whole gastroenteropancreatic neuroendocrine tumor group. World Journal of Gastrointestinal Oncology, 11(2):139–152, February 2019. [47] Anna Niessen, Simon Schimmack, Marta Sandini, Dominik Fliegner, Ulf Hinz, Magdalena Lewosinska, Thilo Hackert, Markus W. B ̈uchler, and Oliver Strobel. C-reactive protein independently predicts survival in pancreatic neuroendocrine neoplasms. Scientific Reports, 11(1), December 2021. [48] Patricia Freis, Emmanuelle Graillot, Pascal Rousset, Val ́erie Hervieu, Laurence Chardon, Catherine Lombard- Bohas, and Thomas Walter. Prognostic factors in neuroendocrine carcinoma: biological markers are more useful than histomorphological markers. Scientific Reports, 7(1), January 2017. [49] Niklas Gebauer, Maria Ziehm, Judith Gebauer, Armin Riecke, Sebastian Meyh ̈ofer, Birte Kulemann, Nikolas von Bubnoff, Konrad Steinestel, Arthur Bauer, and Hanno M. Witte. The glasgow prognostic score predicts survival outcomes in neuroendocrine neoplasms of the gastro–entero–pancreatic (GEP-NEN) system. Cancers, 14(21):5465, November 2022. 19 Feature Selection in High-Grade Gastroenteropancreatic Neuroendocrine Neoplasms A PREPRINT [50] Koji Amano, Isseki Maeda, Tatsuya Morita, Tomofumi Miura, Satoshi Inoue, Masayuki Ikenaga, Yoshihisa Matsumoto, Mika Baba, Ryuichi Sekine, Takashi Yamaguchi, Takeshi Hirohashi, Tsukasa Tajima, Ryohei Tatara, Hiroaki Watanabe, Hiroyuki Otani, Chizuko Takigawa, Yoshinobu Matsuda, Hiroka Nagaoka, Masanori Mori, and Hiroya Kinoshita. Clinical implications of c-reactive protein as a prognostic marker in advanced cancer patients in palliative care settings. Journal of Pain and Symptom Management, 51(5):860–867, May 2016. [51] Peter C. Hart, Ibraheem M. Rajab, May Alebraheem, and Lawrence A. Potempa. C-reactive protein and can- cer-diagnostic and therapeutic insights. Frontiers in Immunology, 11, November 2020. [52] Shiva Shrotriya, Declan Walsh, Amy S. Nowacki, Cliona Lorton, Aynur Aktas, Barbara Hullihen, Nabila Benanni-Baiti, Katherine Hauser, Serkan Ayvaz, and Bassam Estfan. Serum c-reactive protein is an important and powerful prognostic biomarker in most adult solid tumors. PLOS ONE, 13(8):e0202555, August 2018. [53] Thomas E. Clancy, Tanya P. Sengupta, Jessica Paulus, Fawzia Ahmed, Mei-Sheng Duh, and Matthew H. Kulke. Alkaline phosphatase predicts survival in patients with metastatic neuroendocrine tumors. Digestive Diseases and Sciences, 51(5):877–884, May 2006. [54] Monica Ter-Minassian, Jennifer A Chan, Susanne M Hooshmand, Lauren K Brais, Anastassia Daskalova, Rachel Heafield, Laurie Buchanan, Zhi Rong Qian, Charles S Fuchs, Xihong Lin, David C Christiani, and Matthew H Kulke. Clinical presentation, recurrence, and survival in patients with neuroendocrine tumors: results from a prospective institutional database. Endocrine-Related Cancer, 20(2):187–196, January 2013. [55] Halfdan Sorbye, Eric Baudin, and Aurel Perren. The problem of high-grade gastroenteropancreatic neuroen- docrine neoplasms. Endocrinology and Metabolism Clinics of North America, 47(3):683–698, September 2018. [56] Hege Elvebakken, Aurel Perren, Jean-Yves Scoazec, Laura H. Tang, Birgitte Federspiel, David S. Klimstra, Lene W. Vestermark, Abir S. Ali, Inti Zlobec, Tor ̊A. Myklebust, Geir O. Hjortland, Seppo W. Langer, Henning Gronbaek, Ulrich Knigge, Eva Tiensuu Janson, and Halfdan Sorbye. A consensus-developed morphological re-evaluation of 196 high-grade gastroenteropancreatic neuroendocrine neoplasms and its clinical correlations. Neuroendocrinology, 111(9):883–894, October 2020. 20
http://arxiv.org/abs/2302.10093v1
2023-02-20T16:57:44
2023-02-20T16:57:44
Progressive Knowledge Distillation: Building Ensembles for Efficient Inference
We study the problem of progressive distillation: Given a large, pre-trained teacher model $g$, we seek to decompose the model into an ensemble of smaller, low-inference cost student models $f_i$. The resulting ensemble allows for flexibly tuning accuracy vs. inference cost, which is useful for a number of applications in on-device inference. The method we propose, B-DISTIL, relies on an algorithmic procedure that uses function composition over intermediate activations to construct expressive ensembles with similar performance as $g$, but with much smaller student models. We demonstrate the effectiveness of \algA by decomposing pretrained models across standard image, speech, and sensor datasets. We also provide theoretical guarantees for our method in terms of convergence and generalization.
[ "Don Kurian Dennis", "Abhishek Shetty", "Anish Sevekari", "Kazuhito Koishida", "Virginia Smith" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10093v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10093v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Progressive Knowledge Distillation: Building Ensembles for Efficient Inference Don Kurian Dennis 1 Abhishek Shetty 2 Anish Sevekari 1 Kazuhito Koishida 3 Virginia Smith 1 3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 3 9 0 0 1 . 2 0 3 2 : v i X r a Abstract We study the problem of progressive distillation: Given a large, pre-trained teacher model g, we seek to decompose the model into an ensemble of smaller, low-inference cost student models fi. The resulting ensemble allows for flexibly tuning accuracy vs. inference cost, which is useful for a number of applications in on-device inference. The method we propose, B-DISTIL, relies on an algorithmic procedure that uses function compo- sition over intermediate activations to construct expressive ensembles with similar performance as g, but with much smaller student models. We demonstrate the effectiveness of B-DISTIL by de- composing pretrained models across standard im- age, speech, and sensor datasets. We also provide theoretical guarantees for our method in terms of convergence and generalization. 1. Introduction Knowledge distillation aims to transfer the knowledge of a large model into a smaller one (Buciluˇa et al., 2006; Hinton et al., 2015). While this technique is commonly used for model compression, one downside is that the procedure is fairly rigid-resulting in a single compressed model of a fixed size. In this work, we instead consider the problem of progressive distillation: approximating a large model via an ensemble of smaller, low-latency models. The resulting decomposition is useful for many applications in on-device inference. For example, components of the ensemble can be selectively combined to flexibly meet accuracy/latency constraints (Li et al., 2019; Yang & Fan, 2021), can enable efficient parallel inference execution schemes, and can facil- itate early-exit (Bolukbasi et al., 2017; Dennis et al., 2018) or anytime inference (Ruiz & Verbeek, 2021; Huang et al., 2017a) applications, which are scenarios where inference may be interrupted due to variable resource availability. 1Carnegie Mellon University, Pittsburgh, PA, USA 2University of California at Berkeley, CA, USA 3Microsoft, Redmond, WA, USA. Correspondence to: Don Dennis <[email protected]>. Figure 1. In progressive distillation, a large teacher model is dis- tilled onto low inference cost models. The more student models we evaluate, the closer the ensemble's decision boundary is to that of the teacher model. Models in the ensemble are allowed to depend on previously computed features. More specifically, we seek to distill a large pre-trained model, g, onto an ensemble comprised of low-parameter count, low-latency models, fi. We additionally aim for the resulting ensemble to form a decomposition, such that evaluating the first model produces a coarse estimate of the prediction (e.g., covering common cases), and evaluating additional models improves on this estimate (see Figure 1). There are major advantages to such an ensemble for on- device (user-side) efficient inference: 1) inference cost vs. accuracy trade-offs can be controlled on-demand at execu- tion time, 2) the ensemble can either be executed in parallel or in sequence, or possibly a mix of both, and 3) we can im- prove upon coarse initial predictions without re-evaluation in response to resource availability. While traditional distillation methods are effective when transferring information to a single model of similar ca- pacity, it has been shown that performance can degrade significantly when reducing the capacity of the student model (Mirzadeh et al., 2020; Gao et al., 2021). More- over, distillation of a deep network onto a weighted sum of shallow networks rarely performs better than distillation onto a single model (Cho & Hariharan, 2019; Allen-Zhu & Li, 2020). Our insight in this work is that by composing and reusing activations and by explicitly incentivizing models to be weak-learners during distillation, we can successfully find weak learners even when the capacity gap is relatively large. As long as these composition functions are resource efficient, we can then increase base class capacity at roughly the same inference cost as a single model. Moreover, we show that our procedure retains the theoretical guarantees of the classical boosting methods (Schapire & Freund, 2013). . . .Teacher ModelProgressive Distillation+++Student Models. . .+ Progressive Knowledge Distillation: Building Ensembles for Efficient Inference Concretely, we make the following contributions: • We formulate progressive distillation as a two player zero- sum game, derive a weak learning condition for distil- lation, and present our algorithm, B-DISTIL, to approx- imately solve this game. To make the search for weak learners in low parameter count models feasible, we solve a log-barrier based relaxation of our weak learning con- dition. By allowing models to reuse computation from select intermediate layers of previously evaluated mod- els of the ensemble, we are able to increase the model's capacity without significant increase in inference cost. • We empirically evaluate our algorithm on synthetic and real-world classification tasks from computer vision, speech, and sensor processing with models suitable for the respective domains. We show that our ensemble be- haves like a decomposition, allowing a run-time trade-off between accuracy and computation, while remaining com- petitive to the teacher model. • We provide theoretical guarantees for our algorithm in terms of in-sample convergence and generalization perfor- mance. Our framework is not architecture or task specific and can recover existing ensemble models used in effi- cient inference, and we believe puts forth a general lens to view previous work and also to develop new, principled approaches for efficient inference. 2. Background and Related Work Knowledge distillation. Machine learning inference is often resource-constrained in practice due to requirements around metrics such as memory, energy, cost, or latency. This has spurred the development of numerous techniques for model compression. A particularly popular approach is knowledge distillation, which considers transferring the knowledge of a larger model (or model ensemble) to a smaller one (Buciluˇa et al., 2006; Hinton et al., 2015). De- spite its popularity, performing compression via distillation has several known pitfalls. Most notably, many have doc- umented that distillation may not perform well when there is a capacity gap between the teacher and student, i.e., the teacher is significantly larger than the student (Mirzadeh et al., 2020; Gao et al., 2021; Cho & Hariharan, 2019; Allen- Zhu & Li, 2020). When performing distillation onto a weighted combination of ensembles, it has been observed that adding additional models into the ensemble does not dramatically improve performance over that of a single dis- tilled model (Allen-Zhu & Li, 2020). There is also a lack of theoretical work characterizing when and why distillation is effective for compression (Gou et al., 2021). Our work aims to address many of these pitfalls by developing a principled approach for progressively distilling a large model onto an ensemble of smaller, low-capacity ones. Early exits and anytime inference. Numerous applica- tions stand to benefit from the output of progressive distilla- tion, which allows for flexibly tuning accuracy vs. inference cost and executing inference in parallel. Enabling trade- offs between accuracy and inference cost is particularly useful for applications that use early exit or anytime infer- ence schemes. In on-device continuous (online) inference settings, early exit models aim to evaluate common cases quickly in order to improve energy efficiency and prolong battery life (Dennis et al., 2018; Bolukbasi et al., 2017). For instance, a battery powered device continuously listening for voice commands can use early exit methods to improve bat- tery efficiency by classifying non-command speech quickly. Many methods that produce early exit models are also ap- plicable to anytime inference (Huang et al., 2017a; Ruiz & Verbeek, 2021). In anytime inference, the aim is to produce a prediction even when inference is interrupted, say due to resource contention or a scheduler decision. Unlike early exit methods where the classifier chooses when to exit early, anytime inference methods have no control over when they are interrupted. We explore the effectiveness of using our method, B-DISTIL, for such applications in Section 5. Two-player games, online optimization and boosting. The importance of equilibrium of two player zero-sum games has been recognized since the foundational work of von Neumann and Morgenstern (von Neumann & Mor- genstern, 1944). Their connections to convex programming duality have lead to many developments in algorithm design, theoretical computer science, and machine learning (Lu- gosi & Cesa-Bianchi, 2006; Goodfellow et al., 2014). One remarkable application is by Schapire (1990) and Freund (1990) who showed that weak learners can be aggregated to produce strong learners. This has led to many practi- cal boosting based learning algorithms and software such as AdaBoost (Freund & Schapire, 1997), gradient boost- ing (Mason et al., 1999), and XGboost (Chen & Guestrin, 2016). An application of boosting that is similar to our setup is by Trevisan et al. (2009). They show that given a target bounded function g, and class of approximating functions F, one can approximate g arbitrarily well with respect to F using ideas from online learning and boosting. Although boosting has led to many theoretical and practical advances, these efforts have only recently seen success in deep learn- ing applications. In particular, Suggala et al. (2020) propose a generalized boosting framework to train boosting based ensembles of deep networks using function compositions in feature space. Our focus in this work is on the distilla- tion onto low cost models, given an expensive pre-trained teacher model. We incorporate a restricted version of this function composition as part of our search for weak learners (Section 3). This is particularly useful in the early rounds of our algorithm, where there is usually a significant capacity gap between the teacher model and the student model class. Progressive Knowledge Distillation: Building Ensembles for Efficient Inference Algorithm 1 B-DISTIL: Main algorithm Require: Target g, rounds T , data {(xi, yi)}N i=1, learning m=1 2N ∀(i, j) t (i, j) ← 1 rate η, model classes {Fm}M 2N , 1 1: K + t (i, j), K − 2: F, r, t ← ∅, 1, 1 3: while r < R and t < T do ft = FIND-WL(K + t , K − 4: if ft is NONE then 5: 6: 7: 8: 9: With l := ft − g, update K + r ← r + 1 continue end if t , Fr) t , K − t . ∀(i, j) K + K − t+1(i, j) ← K + t+1(i, j) ← K − t (i, j) exp(−η * l(xi)j) t (i, j) exp(η * l(xi)j) (1) (2) Normalize K + F, t ← F ∪ {ft}, t + 1 t , K − t . 10: 11: 12: end while 13: Return 1 |F | (cid:80)|F | i=1 fi 3. Problem Formulation and Algorithm We start by formulating our distillation task as a two player zero-sum game and introduce the framework of stochastic minimax optimization. Consider a class of hypotheses F, a class of probability distributions P and a loss function L that is convex in its first argument. We consider two players whose pure strategy sets are F and P respectively, with loss (and reward) of the players given by F (f, p) = Ex∼p[L(f, x)]. This naturally leads to the definition of the minimax value of the game given by max p∈P min f ∈F F (f, p) . (3) Note that this game is convex in the hypothesis player (min- player) and concave in the distribution player (max-player) and thus amenable to algorithmic approaches. An algorithm is said to (approximately) solve the above minimax problem if it produces a distribution over hypotheses and a distribu- tion that achieve the value in Equation (3). In order for the problem to be well-defined, we need to specify the access the algorithm has to the F and P. One general notion is to allow access to a weak gradient vector h such that, when queried at distribution μ ∈ P and for β > 0, (cid:104)h, ∇f F (f, p)(cid:105) ≥ β, (4) The advantage of this lens is that many algorithms can be seen as implementing solutions to such minimax optimiza- tion problems. See Appendix A for a more involved discus- sion of the stochastic minmax optimization framework. Algorithm 2 FIND-WL Require: Probability matrices K +, K −, model class F parameterized by θ ∈ Θ, hyper-parameters for SGD 1 by expanding F (section 3.2). r=1 do Initialize initial parameter θ0 ∈ F (cid:48). for i ∈ {1, . . . , max-search} do Randomly initialize fθi. Run SGD to solve Equation 6. if fθi is a weak learner then 1: Obtain {Fr}R 2: for F (cid:48) ∈ {Fr}R 3: 4: 5: 6: 7: 8: 9: 10: 11: end for 12: Return NONE end if end for Return fθi Although, Equation (4) is a seemingly easier notion than the full optimization, we emphasize that in many problems of interest even this is challenging. In fact, in the multil- abel setting that we focus on, one of the main algorithmic challenges is to construct an algorithm that reliable and efficiently finds these weak gradients. Our method FIND- WL provides a way to do this successfully as demonstrated in our experimental setup, across a variety of datasets. For our setting of interest, we restrict our attention the case where P is the set of all distributions over a sample set drawn from a fixed distribution p, and defer the details of the general framework to the Appendix A. As in traditional distillation we will work with the output of g, often referred to as logits. Our goal is to produce an ensemble of predictors from the set of hypothesis classes {Fm} to approximate g 'well'. We will do this by searching for weak learners with respect to the target g in the class Fm. Whenever this search fails we restart the search, now allowing models in Fm to reuse features computed by previous models. (cid:80) More formally, to cast our progressive distillation prob- lem as a two player game, we start with a predictor (a model or an ensemble) g : X → RL already provided to us along with a non empty set of low inference cost1 hypothesis class {Fm}M m=1. We assume that {Fm} is in increasing order of inference cost. The loss function of i,j (f (xi) − g(xi))2 interest then is 1 j which is the total 2 squared error between the two predictors. Given a training set {xi}, we think of the role of the max player in Equa- tion (3) as producing distributions over the training set and the role of the min player as producing a hypothesis that minimizes the loss on this distribution. In this setting, note i pi,j = 1(cid:9) is the that P = (cid:8)p ∈ RN ×L : pi,j ≥ 0 ∀j (cid:80) 1We can define 'inference cost' in terms of memory require- ments, compute requirements, or other metrics, based on out use- case. We only assume {Fi} can be ordered on this metric. Progressive Knowledge Distillation: Building Ensembles for Efficient Inference product of simplices in N × L dimensions, and (∇f F (f, p))j = (cid:88) i pi,j (f (xi) − g(xi))j . (5) t ∈ RN ×L and K − Concretely, at each iteration t, the algorithm maintains a matrices K + t ∈ RN ×L of proba- bilities (in our setting, it turns out to be easier to main- tain the positive errors and the negative error separately). Note that, the matrices K + t are such that for all j ∈ [L], (cid:80) i K + t (i, j) = 1. Moreover, for all (i, j) ∈ [N ] × [L], 0 ≤ K + t (i, j) ≤ 1. The elements K + t (i, j) can be thought of as the weight on the residuals ft−1(x) − g(x) and g(x) − ft−1(x) respectively, up-weighting large deviations from g(x). t (i, j) and K − t (i, j) + K − t (i, j), K − t and K − In order to make updates to this vector, we need access to a weak gradient similar to h in Equation (4). We formalize this using Definition 1, which can be seen as a natural extension of the standard weak learning assumption in the boosting literature to our setting. Definition 1 (Weak learning condition). Given a dataset i=1, a target function g : X → RL and probabil- {(xi, yi)}N t , a function ft : X → RL is said to ity matrices K + satisfy the weak learning condition with respect to g, ∀j, the following sum is strictly positive t , K − K + t (i, j)(ft(xi)−g(xi))j +K − t (i, j)(g(xi)−ft(xi))j. (cid:88) i t , K + With the current probability matrices K − t , in each round t, B-DISTIL performs two steps; first, it invokes a sub- routine FIND-WL that attempts to find a classifier ft ∈ Fr satisfying the weak learning condition (Definition 1). If such a predictor is found, we add it to our ensemble and proceed to the second step, updating the probability matri- ces K − t based on errors made by ft. This is similar in spirit to boosting algorithms such as AdaBoost (Schapire & Freund, 2013) for binary classification. If no such predictor can be found, we invoke the subroutine with the next class, Fr+1, and repeat the search till a weak learner is found or we have no more classes to search in. t , K + 3.1. Finding Weak-learners As mentioned earlier, the real difficulty in provably boosting in this setting is in finding a single learner ft at round t that satisfies our weak learning condition simultaneously for all labels j. Existing boosting methods for classification treat multi-class settings (L > 1) as L instances of the binary classification problem (one vs. all) (Schapire & Freund, 2013). They typically choose L different weak learners for each instance, which is unsuitable for resource efficient on-device inference. The difficulty is further increased by the capacity gap between the student and teacher models we consider for distillation. In our work, we focus on this aspect of the problem. Thus, along with controlling temperature for distillation, we employ two additional strategies: 1) we use a log-barrier regularizer in the objective FIND-WL solves to promote weak learning and, 2) we reuse limited stored activation outputs of previously evaluated models to increase the expressivity of the current base class. 3.1.1. LOG-BARRIER REGULARIZER To find a weak learner, the FIND-WL method minimizes sum of two lose terms using stochastic gradient descent. The first is standard binary/multi-class cross-entropy distil- lation loss function (Hinton et al., 2015), with temperature smoothening. The second term is defined in Equation 6: − 1 γ (cid:88) i,j I + ij log (cid:16) 1 + (cid:17) l(xi)j 2B + (1 − I + ij ) log (cid:16) 1 − (cid:17) l(xi)j 2B (6) ij := I[K + t (i, j) > K − Here I + t (i, j)], B is an upper bound on the magnitude of the logits, and l(xi) := f (xi) − g(xi). To see the intuition behind this expression, first assume the following is true for all (i, j). (K + t (i, j) − K − t (i, j))(f (xi) − g(xi))j > 0. (7) Summing over all data points xi, we can see that this is sufficient for f to be a weak learner with respect to g. Equa- tion 6 is a soft log-barrier version of the weak learning condition, that penalizes those (i, j) for which Equation 7 does not hold. By tuning γ we can increase the relative im- portance of the regularization objective, encouraging ft to be a weak learner potentially at the expense of classification performance. 3.1.2. INTERMEDIATE LAYER CONNECTIONS As discussed in Section 2, distillation onto a linear combi- nation of low capacity student models often offers no better performance than that of any single model in the ensemble trained independently. For boosting, empirically we see that once the first weak learner has been found in some class Fm of low-capacity deep networks, it is difficult to find a weak learner for the reweighed objective from the same class Fm. To work around this we let our class of weak learners at round t include functions that depend on the output of in- termediate layers of previous weak learners (Suggala et al., 2020). As a concrete example, consider a deep fully connected network with U layers, parameterized as f = W φ1:U . Here φ1:u can be thought of as a feature transform on x using the first u layers into Rdu and W ∈ RdU ×L is a linear transform. With two layer fully connected base model class F0 := {W (0)φ(0) 1:2 | W (0) ∈ RL×d2} (dropping subscript Progressive Knowledge Distillation: Building Ensembles for Efficient Inference m for simplicity), define: Fr = {W (r)φ(r) r = {W (r)φ(r) F (cid:48) 1:2(id + φ(r−1) 2 (id + φ(r) )} , 1 + φ(r−1) 1:2 1 )} , with id(x) := x. It can be seen that {Fr} and {F (cid:48) r} define a variant of residual connection based networks (Huang et al., 2017b). It can be shown that classes of function {Fr} (and {F (cid:48) r}) increase in capacity with r. Moreover, when evalu- ating sequentially the inference cost of a model from Fr is roughly equal to that of F, since each subsequent evaluation reuses stored activations from previous evaluations. For this reason the parameter count of each Fr remains the same as that of the base class. We informally refer to the process of constructing {Fr} given a choice of base class F0, the parameter R and the connection type as expanding F0. In our experiments, we consider four connection functions: dense connec- tions (He et al., 2016), residual-connections (Huang et al., 2017b), LSTM gated-connections (Hochreiter & Schmidhu- ber, 1997) and GRU (Cho et al., 2014) gated connections and other accumulation operations, and consider R as a hyper-parameter. Note that while intermediate connections help with capacity, they often reduce parallelizability. For instance, weak learn- ers from F (cid:48) defined here depend on the output of a (fixed) learner from Fr−1, and thus can only finish its inference after the previous models is evaluated. As a practical con- sequence dependencies on activation outputs of later layers are preferred, as this allows us more freedom in choosing execution schemes (see Appendix C). 4. Theoretical Analysis √ In this section, we provide theoretical analysis and justifica- tion for our method. We first prove in sample convergence guarantees; we will show that the ensemble output produced by algorithm 1 converges to g at O(1/ T ) rate, provided that the procedure FIND-WL succeeds at every time t. Theorem 1. Suppose the class F satisfies that for all f ∈ F, (cid:107)f − g(cid:107)∞ ≤ G∞. Let F = {ft} be the ensemble after T rounds of Algorithm 1, with the final output Ft = 1 t=1 ft. If ft satisfies eq. (7) for all t ≤ T then for T T ≥ ln 2N and η = 1 G∞ T , we have for all j (cid:113) ln 2N (cid:80)T (cid:107)Ft,j − gj(cid:107)∞ ≤ G∞ (cid:114) ln 2N T (8) where Ft,j and gj are the jth coordinates of the functions Ft and g respectively. We differ the details of the proof to the Appendix B. The main idea behind the proof is to bound the rate of conver- gence of the algorithm towards the minimax solution. This proceeds by maintaining a potential function and keeping track of its progress through the algorithm. The bounds and techniques here are general in the sense that for various objectives and loss functions appropriate designed weak learners give similar rates of convergence to the minimax solution. Furthermore, a stronger version that shows expo- nential rates can be shown by additionally assuming an edge for the weak learner. In addition to the claim above about the in sample risk, we also show that the algorithm has a strong out of sample guarantee. We show this by bounding the generalization error of the algorithm in terms of the generalization error of the class F. In the following theorem, we restrict to the case of binary classification for simplicity but general result follow along similar lines. Let CT denote the class of functions of the form H(x) = sign( 1 T T (cid:88) i=1 ht(x)), where ht are functions in class F. Then we have the follow- ing generalization guarantee: Theorem 2 (Excess Risk). Suppose data D contains of N iid samples from distribution D. Suppose that the func- tion g has (cid:15) margin on data D with probability μ, that is Prx∼D [|g(x)| < (cid:15)] < μ. Further, suppose that the class ∞ ln 2N/(cid:15)2, CT has VC dimension d. Then, for T ≥ 4G2 with probability 1 − δ over the samples, the output FT of algorithm 1 satisfies err(FT ) ≤ (cid:99)err(g) + O (cid:32)(cid:114) d ln(N/d) + ln(1/δ) N (cid:33) + μ Note that the above theorem can easily be adapted to the case of margins and VC dimension of the class CT being replaced with the corresponding fat shattering dimensions. Furthermore, in the setting of stochastic minimax optimiza- tion, one can get population bounds directly by thinking of sample losses and gradients as stochastic gradients to the population objective. This is for example the view taken by (Suggala et al., 2020). In our work, we separate the population and sample bounds to simplify the presentation and the proofs. Remark 2.1. We further emphasize that though the exact bound that appear in Theorem 1 and Theorem 2 depend on our particular algorithm, the forms and the general flavor of the guarantees of the theorems are general amongst algo- rithms solving stochastic minimax problems. For example, the theorems of (Suggala et al., 2020) can be captured by our framework. Progressive Knowledge Distillation: Building Ensembles for Efficient Inference (a) Cube (b) Ellipsoid (c) CIFAR-10 (d) CIFAR-100 (e) Google-13 (f) DSA-19 Figure 2. Accuracy vs inference-time trade-offs. Inference time is reported as fraction of teacher's inference time along with average ensemble accuracy and error bars. B-DISTIL performs this trade-off at runtime. The baseline NO-RESHED at inference time τw (x-axis) is the accuracy of a single model that is allowed |τw − 0| time for inference. Similarly the baseline RESHED at τw is the accuracy of an ensemble of models, where the model w is allowed |τw − τw−1| time to perform its inference. This is also the latency between the successive predictions from B-DISTIL. We can see that B-DISTIL (green) remains competitive to the oracle baseline (NO-RESCHED, blue) and outperforms weighted averaging (RESCHED, yellow). 5. Empirical Evaluation We now evaluate B-DISTIL on both real-world and simu- lated datasets, and over a variety of architecture types. We consider four real world datasets across three domains- vision, speech and sensor-data-as well as two simulated datasets. This allows us to evaluate our method on five of architecture types: fully connected networks, convolutional networks, residual networks, densely connected networks, and recurrent networks. 5.1. Dataset Information For experiments with simulated data, we construct two datasets. The first dataset, referred to as ellipsoid is a binary classification data set. Here the classification labels for each data point x ∈ R32 is determined by the value of xT Ax for a random positive semidefinite matrix A. The second simulated dataset, cube, is for multiclass classification with 4 classes. Here labels are determined by distance to vertices from {−1, 1}32 in R32, partitioned into 4 classes. We use four real world data sets for our experiments. Our im- age classification experiments use the CIFAR-10 and CIFAR- 100 datasets for object detection. These datasets are 10 and 100 label classification tasks respectively. For spoken-audio classification tasks we use the Google-13 speech commands dataset. Here the task is keyword detection: given a audio clip, we need to identify if any of 13 predefined keywords have been uttered. We use the daily sports activities (DSA) dataset for experiments with sensor data. Here the task is identifying the activity performed by an individual from a predefined set of activities, using sensor data. For detailed information of all datasets used see Appendix C. 5.2. Model Architecture Details Teacher models. We use deep fully connected (FC) net- works for classification on Ellipsoid and convolutional net- works for Cube. For image classification on CIFAR-10 dataset we use publicly available, pretrained ResNet models. We train reference DenseNet models for the CIFAR-100 dataset based on publicly available training recipes. As both spoken audio data (Google-13) and sensor-data (DSA-19) are time series classification problems, we use recurrent neural networks (RNNs) for these experiments. We train LSTM (Hochreiter & Schmidhuber, 1997) based architec- ture on Google-13 and a GRU (Cho et al., 2014) based architecture on DSA-19. Except for the pretrained ResNet models, all other teacher models are selected based on per- formance on validation data. Student models. For all distillation tasks, for simplicity we design the student base model class from the same ar- chitecture type as the teacher model, but starting with sig- 0.10.20.3frac. inference time8090Accuracy (%)FC-32,32,640.250.500.75frac. inference time80859095FC-16,16,160.00.51.0frac. inference time708090ResNet56NORESHEDRESHEDTeacherBDSTILL0.20.40.6frac. inference time506070Accuracy (%)DenseNet1210.00.20.40.6frac. inference time6080LSTM1280.20.4frac. inference time80.082.585.087.5GRU32 Progressive Knowledge Distillation: Building Ensembles for Efficient Inference Dataset Algorithm Early-prediction Acc Google-13 DSA-19 E-RNN B-DISTIL E-RNN B-DISTIL T = 50% T = 75% Acc (%) 88.31 87.41 83.5 82.1 Frac Acc (%) 0.48 0.49 0.55 0.53 88.42 89.31 83.6 84.1 Frac 0.65 0.71 0.56 0.58 T = 100% Acc (%) 92.43 92.25 86.8 87.2 Table 1. Early prediction performance. Performance of the ensemble produced by B-DISTIL to the E-RNN algorithm (Dennis et al., 2018). The accuracy and the cummulative fraction of the data early predicted at 50%, 75% and 100% time steps are shown. At T = 100, frac. evaluated is 1.0. The ensemble output by B-DISTIL with the early-prediction loss is competitive to the E-RNN algorithm, a method developed specifically for early prediction of RNNs. nificantly fewer parameters and resource requirements. We train for at most T = 7 rounds, keeping η = 1 in all our ex- periments. Whenever FIND-WL fails to find a weak learner, we expand the base class F using the connection specified as a hyperparameter. Since we need only at-most T = 7 weak learners, we can pick small values of R (say, 2). The details of the intermediate connections used for each data- set and hyperparameters such as γ, hyper-parameters for SGD can be found in Appendix C and D. 5.3. Experimental Evaluation and Results First, we present the trade-off between accuracy and infer- ence time offered by B-DISTIL in the context of anytime inference and early prediction. We compare our models on top-1 classification accuracy and total floating point oper- ations (FLOPs) required for inference. We use a publicly available profiler (Rasley et al., 2020) to measure floating point operations. For simplicity of presentation, we convert these to the corresponding inference times (τ ) on a reference accelerator (NVIDIA 3090Ti). Anytime inference. As discussed previously, in the any- time inference setting a model is required to produce a prediction even when its execution is interrupted. Standard model architectures can only output a prediction once the execution is complete and thus are unsuitable for this setting. We instead compare against the idealized baseline where we assume oracle access to the inference budget ahead of each execution. Under this assumption, we can train a set of models suitable various inference time constraints, say by training models at various depths, and pick the one that fits the current inference budget obtained by querying the ora- cle. We refer to this baseline as NO-RESHED and compare B-DISTIL to it on both synthetic and real world datasets in Figure 2. This idealized baseline establishes an upper bound on the accuracy of B-DISTIL. B-DISTIL can improve on its initial prediction whenever inference jobs are allowed to be rescheduled. To contex- tualize this possible improvement, we consider the case where the execution is interrupted and rescheduled (with zero-latency, for simplicity) at times {τ1, τ2, . . . , τW }. We are required to output a prediction at each τw. Assuming we know these interrupt points in advance, one possible base- line can be as follows: select models with inference budgets |τ1|, |τ2 − τ1|, . . . , |τw − τw−1|. Sequentially evaluate them and at at each interrupt τw, output the (possibly weighted) average prediction of the w models. We call this baseline RESCHED. Since the prediction at τw is a simple average of models, we expect its performance to serve as a lower- bound for the performance of B-DISTIL. In the same Figure (Figure 2) we compare B-DISTIL to the RESHED baseline. Note that both baselines require access to inference budget ahead of time. Early prediction. To evaluate the applicability of our method for early prediction in online time-series inference, we compare the performance of B-DISTIL to that of E-RNN from (Dennis et al., 2018). Unlike B-DISTIL, which can be applied to generic architectures, E-RNN is a method for early prediction that was developed specifically for RNNs. When training, we set the classification loss used with Equa- tion (6) to the early-classification loss used in E-RNN train- ing. We evaluate our method on the time-series datasets GoogleSpeech and DSA. The performance in terms of time- steps evaluated is compared in Table 1. B-DISTIL remains competitive to E-RNN algorithm for early-prediction. Un- like E-RNN, B-DISTIL also offers early prediction for offline evaluation of time-series data - when all of the data arrives at once. For such cases, a threshold can be tuned similar to E-RNN and B-DISTIL can evaluate the models in its en- semble in order of increasing inference cost, exiting as soon as the confidence-score crosses this threshold. Overhead of connections. Our method uses intermediate connections to improve its performance. Although these connections are designed to be efficient, they still have an overhead cost over an averaging based ensemble. The FLOPs required to evaluate intermediate connections cor- responding to the distillation tasks in Figure 2 is shown in Figure 3. Here, we compare the FLOPs required to evalu- ate the model that was added in a round T to the FLOPs Progressive Knowledge Distillation: Building Ensembles for Efficient Inference (a) CIFAR-10 (b) CIFAR-100 (c) Google-13 (d) DSA-19 Figure 3. Overhead of connections. The floating point operations required to evaluate the model added in round T , compared to that required to evaluate just the connections used by this model, for each of the real-world dataset. FLOPs are reported as a fraction of teacher model's FLOPs. We see that the connections add relatively little overhead. required evaluate the intermediate connections used by this model. Note that summing up all the FLOPs up to a round T , in Figure 3 gives the total FLOPs required to for the ensemble constructed at the end of round T . For all our models, this overhead is negligible when compared to the inference cost of the corresponding model. To evaluate the benefits offered by the intermediate connec- tions, we can compare the results of B-DISTIL run with con- nections and B-DISTIL without connections. The latter case can be thought of as running the AdaBoost algorithm for distillation. Note that this is the same as the RESCHED base- line (simple averaging). Thus comparing the B-DISTIL plot in Figure 2 to the plot of RESCHED highlights the benefit of using intermediate connections. As in this work our focus is on finding weak learners in the presence of capacity gap, and we do not explore additional compression strategies like quantization, hard thresholding, low-rank projection that can further reduce inference cost. Overheads of training/distillation. B-DISTIL requires additional compute and memory compared to a single model's training. Maintaining the two matrices K + t and K − t requires an additional O(N L) memory. Even for relatively large datasets with, say, N = 106 samples and L = 1000 classes, this comes out to a few gigabytes. Note that the two matrices can be stored in main memory (or disk) and loaded into GPU memory for loss computation using data loaders provided by standard ML frameworks. Thus the additional GPU memory requirement is quite small, O(bL) for a mini-batch size b, same as the memory required to maintain one-hot classification labels for a mini-batch. As for training time, since the weak-learners we consider in each round is of significantly smaller complexity than the teacher model, the computation requirement per mini-batch of training is significantly reduced, often leading to a reduc- tion in training time. Of course for models where training time is dominated by data-loading (communication) and not compute, such as recurrent networks, the improvements are not significant. Repeated failure of FIND-WL can also impact training time, although we did not find this to be an issue in our experiments. 6. Conclusion and Future Work In this paper, we propose B-DISTIL, an algorithm for pro- gressive distillation. B-DISTIL produces an ensemble of learners that provide efficient inference, with progressively better results as the ensemble size increases. This allows for a straightforward way to trade off accuracy and compute at inference time, and is critical for scenarios where infer- ence may be interrupted abruptly, or when variable levels of accuracy are expected/acceptable. We experimentally demonstrate the effectiveness of B-DISTIL by decompos- ing well-established deep models onto ensembles for data from vision, speech, and sensor domains. Our procedure leverages a stochastic solver combined with log barrier reg- ularization for finding weak learners during distillation, and we use intermediary connections to circumvent the issue of model capacity gap. A key insight in this work is that posing distillation as a two player zero-sum game allows us to abstract away model ar- chitecture details into base class construction F. This means that, conditioned on us finding a 'weak learner' from the base class, we retain the guarantees of the traditional boost- ing setup. A caveat of this abstraction is that the user must design F. In future work, we would like to extend these ideas by a running boosting-like procedures on both mod- els and hyperparameters taken together. Similar methods have recently found success in applications such as hyperpa- rameter tuning for federated learning (Khodak et al., 2021). Finally, although our focus has been on-device continuous inference, our distillation procedure can be beneficial even in the cloud/data-center (batch) inference setting, for tasks such as layer-fusion, load-balancing, and improved resource utilization, which are applications worth exploring in more detail in future work. 024Round (T)0.00.10.2ResNet56024Round (T)0.000.050.100.15DenseNet121024Round (T)0.000.050.100.150.20LSTM12802Round (T)0.000.050.100.15Frac. flopsGRU32ModelConn. Progressive Knowledge Distillation: Building Ensembles for Efficient Inference References Allen-Zhu, Z. and Li, Y. Towards understanding ensem- ble, knowledge distillation and self-distillation in deep learning. arXiv preprint arXiv:2012.09816, 2020. Bolukbasi, T., Wang, J., Dekel, O., and Saligrama, V. Adap- tive neural networks for efficient inference. In Interna- tional Conference on Machine Learning, 2017. Buciluˇa, C., Caruana, R., and Niculescu-Mizil, A. Model compression. In International Conference on Knowledge Discovery and Data-mining, 2006. Chen, T. and Guestrin, C. Xgboost: A scalable tree boost- ing system. In International Conference on Knowledge Discovery and Data-mining, 2016. Cho, J. H. and Hariharan, B. On the efficacy of knowledge In Internationa Conference on Computer distillation. Vision, 2019. Cho, K., Van Merriënboer, B., Bahdanau, D., and Bengio, Y. On the properties of neural machine translation: Encoder- decoder approaches. arXiv preprint arXiv:1409.1259, 2014. Dennis, D., Pabbaraju, C., Simhadri, H. V., and Jain, P. Multiple instance learning for efficient sequential data classification on resource-constrained devices. Advances in Neural Information Processing Systems, 2018. Dua, D. and Graff, C. UCI machine learning repository, 2017. URL http://archive.ics.uci.edu/ml. Freund, Y. Boosting a weak learning algorithm by majority. In Workshop on Computational Learning Theory, 1990. Freund, Y. and Schapire, R. E. A decision-theoretic general- ization of on-line learning and an application to boosting. Journal of Computer and System Sciences, 1997. Gao, M., Wang, Y., and Wan, L. Residual error based knowledge distillation. Neurocomputing, 2021. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. Generative adversarial nets. In Advances in Neural Information Processing Systems, 2014. Gou, J., Yu, B., Maybank, S. J., and Tao, D. Knowledge distillation: A survey. International Journal of Computer Vision, 2021. He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition, 2016. Hinton, G., Vinyals, O., Dean, J., et al. Distilling arXiv preprint the knowledge in a neural network. arXiv:1503.02531, 2015. Hochreiter, S. and Schmidhuber, J. Long short-term memory. Neural Computation, 1997. Huang, G., Chen, D., Li, T., Wu, F., Van Der Maaten, L., and Weinberger, K. Q. Multi-scale dense networks for resource efficient image classification. arXiv preprint arXiv:1703.09844, 2017a. Huang, G., Liu, Z., Van Der Maaten, L., and Weinberger, K. Q. Densely connected convolutional networks. In IEEE conference on Computer Vision and Pattern Recog- nition, 2017b. Khodak, M., Tu, R., Li, T., Li, L., Balcan, M.-F., Smith, V., and Talwalkar, A. Federated hyperparameter tuning: Challenges, baselines, and connections to weight-sharing. In Advances in Neural Information Processing Systems, 2021. Krizhevsky, A., Nair, V., and Hinton, G. Cifar-10 (canadian institute for advanced research). URL http://www. cs.toronto.edu/~kriz/cifar.html. Li, H., Zhang, H., Qi, X., Yang, R., and Huang, G. Im- proved techniques for training adaptive deep networks. In International Conference on Computer Vision, 2019. Lugosi, G. and Cesa-Bianchi, N. Prediction, Learning, and Games. Cambridge University Press, 2006. Mason, L., Baxter, J., Bartlett, P., and Frean, M. Boost- ing algorithms as gradient descent. Advances in Neural Information Processing Systems, 1999. Mirzadeh, S. I., Farajtabar, M., Li, A., Levine, N., Mat- sukawa, A., and Ghasemzadeh, H. Improved knowledge distillation via teacher assistant. In AAAI Conference on Artificial Intelligence, 2020. Rasley, J., Rajbhandari, S., Ruwase, O., and He, Y. Deep- speed: System optimizations enable training deep learn- ing models with over 100 billion parameters. In Inter- national Conference on Knowledge Discovery & Data Mining, 2020. Ruiz, A. and Verbeek, J. Anytime inference with distilled In Proceedings of the hierarchical neural ensembles. AAAI Conference on Artificial Intelligence, 2021. Schapire, R. E. The strength of weak learnability. Machine learning, 1990. Schapire, R. E. and Freund, Y. Boosting: Foundations and algorithms. Kybernetes, 2013. Progressive Knowledge Distillation: Building Ensembles for Efficient Inference Suggala, A., Liu, B., and Ravikumar, P. Generalized boost- ing. Advances in Neural Information Processing systems, 2020. Trevisan, L., Tulsiani, M., and Vadhan, S. Regularity, boost- ing, and efficiently simulating every high-entropy distribu- tion. In IEEE Conference on Computational Complexity, 2009. von Neumann, J. and Morgenstern, O. Theory of games and economic behavior, 1944. Warden, P. Speech commands: A dataset for limited- vocabulary speech recognition, 2018. Yang, L. and Fan, D. Dynamic neural network to enable run- time trade-off between accuracy and latency. In Asia and South Pacific Design Automation Conference. Association for Computing Machinery, 2021. Progressive Knowledge Distillation: Building Ensembles for Efficient Inference A. Two-Player Minimax Games In this section, we will look at the setting of two minimax games more closely. Consider a class of hypotheses F and class of probability distributions P. In addition, consider a loss function L : F × X → R that is convex in its first argument. We consider two players whose pure strategy sets are F and P respectively. The loss and reward of the players is given by F (f, μ) = Ex∼p[L(f, x)] and the minmax value of the game is max p∈P min f ∈F F (f, μ) . (9) Note that this game is convex in the hypothesis player and concave in the distribution player. The objective of the game for the hypothesis player is trying to find a hypothesis that has low loss on the worst case distribution from class P. Conversely, the distribution player is trying to construct a distribution that is as hard as possible for the hypothesis player to learn. Also, note that under reasonable conditions on F and P, we have the minimax theorem holds (see Chapter 6, Schapire & Freund (2013)), max p∈P min f ∈F Ex∼p[L(f, x)] = min f ∈∆(F ) max p∈P Ex∼p[L(f, x)]. (10) Here, ∆ (F) is the set distributions over functions F. From this, we can see that as long as we are allowed to aggregate functions from the base class, we have can do as well as we could if we had access to the distribution The interesting algorithmic question would be to find a distribution over hypothesis that achieves the minimum above. Note that the loss function is stochastic and thus, we need to formalize the access the player has to the loss function. We will formulate this in the following stochastic way. Definition 2. An algorithm ORACLE is said to be a (β, δ) weak-gradient if (cid:104)ORACLE(f, p), ∇f F (f, p)(cid:105) ≥ β (11) with probability 1 − δ. Here ∇f denotes the functional gradient of F . This notion is similar to the weak learning assumptions usually used in the boosting literature. Given such an oracle one can ask for methods similar to first order methods for convex optimization, such as gradient descent, to solve the minimax problem. These algorithms iteratively maintain candidate solutions for the both the players and update each of these using feedback from the state of the other player. In our particular setting, the hypothesis player updates using the vector h in eq. (4). Motivating Example Let F be a class of hypotheses, let P is the set of all distributions over a finite sample set {x1, . . . , xn} and let L be the 0-1 loss. Note that in this setting, the oracle from definition 2 is analogous to weak learning. In this setting, from the minmax theorem and the existence of a weak learner, we get that there is a single mixture of hypothesis of (cid:80) i αifi such that loss under every distribution in P which corresponds to zero training error. Thus we can think of boosting algorithms as approximating this minmax equilibrium algorithmically. Similarly, the weak learning condition in (Suggala et al., 2020) is similar in spirit to the condition above. With the condition from Definition 2, one can consider many frameworks for solving minimax games. One general technique is to consider two no-regret algorithms for online convex optimization to play against each other. Let us briefly look at the definition of regret in this setting. Definition 3 (No-Regret). Let K, A be convex sets. At each time, a player observes a point xt ∈ K and chooses an action at ∈ A. The regret of the algorithm is defined as RT = max a∈A T (cid:88) (cid:104)a, xt(cid:105) − t=1 T (cid:88) t=1 (cid:104)at, xt(cid:105). (12) Online learning is a well-studied area of machine learning with a rich set of connections to various areas in mathematics and computer science. In particular, there are frameworks in order to construct algorithms such as follow-the-perturbed Progressive Knowledge Distillation: Building Ensembles for Efficient Inference leader, follow-the-regularized leader and mirror descent. In particular, our algorithm can be seen as a version of mirror descent with the entropy regularizer and theorem 1 as a version of the regret guarantee for the algorithm. In addition to the ones mentioned above, There are several other frameworks considered to solve minimax games such as variational inequalities, extragradient methods, optimistic methods and so on. We believe this framework is a useful one to consider for many learning tasks, especially in settings where we have function approximation. B. Proofs of Main Theorems Here, we provide a proof of Theorem 1, which is restated below: Theorem. Suppose the class F satisfies that for all f ∈ F, (cid:107)f − g(cid:107)∞ ≤ G∞. Let F = {ft} be the ensemble after T rounds of Algorithm 1, with the final output Ft = 1 T t=1 ft. Then for T ≥ ln 2N and (cid:80)T we have for all j η = 1 G∞ (cid:114) ln 2N T (cid:107)Ft,j − gj(cid:107)∞ ≤ G∞ (cid:114) ln 2N T − 1 T T (cid:88) t=1 γt(j) where Ft,j and gj are the jth coordinates of the functions Ft and g respectively. Proof. For simplicity, we assume that ft and g are scalar valued functions, since the proof goes through coordinate-wise. At each time, define the edge of the weak learning algorithm to be γt = (cid:88) i K + t (i)(ft(xi) − g(xi)) + K − t (i)(g(xi) − ft(xi)) (cid:88) i Let Zt denote the normalizing constant at time t, that is, Zt = (cid:88) i From the update rule, we have K + t (i) exp (−η (ft (xi) − g(xi))) + K − t (i) exp (η (ft (xi) − g(xi))) K + T +1(i) = = = K + T (i)eη(fT (xi)−g(xi)) ZT (cid:16) K + 1 (i) exp −η (cid:80)T (cid:81)T t=1 Zt t=1 (ft (xi) − g(xi))j (cid:17) K + 1 (i) exp (−ηT (FT (xi) − g(xi)) t=1 Zt (cid:81)T and similarly K − T +1(i) = K − 1 (i) exp (ηT (FT (xi) − g(xi)) t=1 Zt (cid:81)T Progressive Knowledge Distillation: Building Ensembles for Efficient Inference First, we bound ln(Zt): (cid:32) (cid:88) ln(Zt) = ln K + t (i) exp(−η(ft(xi) − g(xi))) + K − t (i) exp(η(ft(xi) − g(xi))) (cid:33) (cid:88) i (cid:32) i (cid:88) i ≤ ln K + t (i) (cid:0)1 − η(ft(xi) − g(xi)) + η2(ft(xi) − g(xi))2(cid:1) (cid:88) + i K − t (i) (cid:0)1 + η(ft(xi) − g(xi)) + η2(ft(xi) − g(xi))2(cid:1) (cid:33) (cid:33) K − t (i)(ft(xi) − g(xi)) + η2G2 ∞ (cid:32) ≤ ln 1 − η (cid:88) K + t (i)(ft(xi) − g(xi)) + η i ≤ −ηγt + η2G2 ∞ (cid:88) i where the second step follows from the identity exp(x) ≤ 1 + x + x2 for x ≤ 1, provided that η ≤ 1 G∞ bound on regression error after T rounds: . This gives us a −ηT (FT (xi) − g(xi)) = ln(K + T +1(i)) − ln(K + 1 (i)) + T (cid:88) t=1 ln(Zt) ≤ ln = ln (cid:32) (cid:32) (cid:33) (cid:33) K + T +1(i) K + 1 (i) K + T +1(i) K + 1 (i) + T (cid:88) t=1 −ηγt + η2G2 ∞ + η2T G2 ∞ − η T (cid:88) t=1 γt ≤ ln 2N + η2T G2 ∞ − η T (cid:88) t=1 γt Where the last bound follows since K + 1 = 1 2N and K + T +1 ≤ 1. Similarly, we have the bound ηT (FT (xi) − g(xi)) ≤ ln 2N + η2T G2 ∞ − η T (cid:88) t=1 γt Combining the two equations we get that |FT (xi) − g(xi)| = (cid:107)FT − g(cid:107)∞ ≤ sup i ln 2N ηT + ηG2 ∞ − 1 T T (cid:88) t=1 γt If we choose η = 1 G∞ (cid:113) ln 2N T to minimize this expression, then we get the following bound on regression error: (cid:107)Ft − g(cid:107)∞ ≤ − 1 T T (cid:88) t=1 γt + G∞ (cid:114) ln 2N T which is exactly Equation (8). Note that the value of η only satisfies the condition η ≤ 1 G∞ time horizon after which the bound holds. This finishes the proof of Theorem 1 when T ≥ ln 2N , which is the Now, we provide a proof of Theorem 2 which follows from the VC dimension bound and Theorem 1. Before we begin, we setup some notation. Given a function f , distribution D over space X × Y where X is the input space and Y is the label space, and data D consisting of N iid samples (x, y) ∼ D, we define (cid:99)err(f ) = Pr (x,y)∼D [sign(FT (x) (cid:54)= y)] err(f ) = Pr (x,y)∼D [sign(FT (x) (cid:54)= y)] Progressive Knowledge Distillation: Building Ensembles for Efficient Inference Theorem (Excess Risk). Suppose data D contains of N iid samples from distribution D. Suppose that the function g has large margin on data D, that is Further, suppose that the class CT has VC dimension d, then for Pr x∼D [|g(x)| < (cid:15)] < μ T ≥ 4G2 ∞ ln 2N (cid:15)2 , with probability 1 − δ over the draws of data D, the generalization error of the ensemble FT obtained after T round of Algorithm 1 is bounded by err(FT ) ≤ (cid:99)err(g) + O (cid:32)(cid:114) d ln(N/d) + ln(1/δ) N (cid:33) + μ Proof. Recall the following probability bound Schapire & Freund (2013, theorem 2.5) which follows Sauer's Lemma: Pr [∃f ∈ CT : err(f ) ≥ (cid:99)err(f ) + (cid:15)] ≤ 8 (cid:17)d (cid:16) me d e−m(cid:15)2/32 which holds whenever |D| = N ≥ d. It follows that with probability 1 − δ over the samples, we have for all f ∈ CT Since we choose T = 4G2 ∞ ln 2N (cid:15)2 err(f ) ≤ (cid:99)err(f ) + O (cid:32)(cid:114) d ln(N/d) + ln(1/δ) N (cid:33) , by Theorem 1, we have ∀x ∈ D : (cid:107)Ft − g(cid:107)1 ≤ G∞ (cid:114) ln 2N T ≤ (cid:15) 2 Since g has (cid:15) margin on data with probability 1 − μ, we have (cid:99)err(Ft) ≤ (cid:99)err(g) + μ Combining eqs. (13) and (14), we get err(FT ) ≤ (cid:99)err(g) + O (cid:32)(cid:114) d ln(N/d) + ln(1/δ) N (cid:33) + μ which completes the proof. C. Dataset Information and Training Recipe (13) (14) We use four publicly available real world datasets in our experiments. The train-test splits for all the dataset as well as the sources are listed here: Dataset Train-samples Test-samples Num.-labels Source CIFAR-10 CIFAR-100 Google-13 DSA-19 50000 50000 52886 6800 10000 10000 6835 2280 10 100 13 19 (Krizhevsky et al.) (Krizhevsky et al.) (Warden, 2018) (Dua & Graff, 2017) We use two synthetic datasets in our experiments, ellipsoid and cube. To construct the ellipsoid dataset, we first sample a 32 × 32 matrix B, each entry sampled iid. We define A := BT B as our positive semi-definite matrix, and I[xT Ax ≥ 0] determines the label of a data point x. We sample 10k points uniform randomly from [−1, 1]32 and determine their labels to construct our data sample. We randomly construct a 80-20 train-test split for our experiments. To construct cube, we first sample 16 vertices uniform randomly from [−1, 1]32 and split them into 4 equal sets, say {S1, . . . , S4}. As before, we sample 10k points uniformly from [−1, 1]32 and determine the label y(x) of each point x based on the closest vertex in {S1, . . . , S4}. y(x) = arg min i (cid:107)x − x(cid:48)(cid:107). min x(cid:48)∈Si Progressive Knowledge Distillation: Building Ensembles for Efficient Inference D. Model Information, Experimental Details and Additional Results D.1. Base Model Configuration The base class configurations used for all our experiments in Figure 2 is provided in Tables 2, 3, 4 and 5. Note that we use standard model architectures implemented in Pytorch and the parameters correspond to the corresponding function arguments in these implementation. Teacher model Residual Blocks Embedding dims 8 8,8 16,16 16,32,64 1 2,2 2,2 2,2,3 ResNet56 Strides 1 1,1 1,2 1,2,2 Table 2. Base model configuration used for ResNet56 distillation on CIFAR-10. Teacher model DenseNet121 Blocks 4, 8 4, 8, 8 8, 16, 12 growth-rate 12 6 6 Table 3. Configuration used for DenseNet121 distillation on CIFAR-100. Teacher model LSTM128 hid. dims. 4,4 16,8 20,12 20,32 Table 4. Configuration used for LSTM128 distillation on Google-13. D.2. Training Recepies Teacher model GRU32 hid. dims. 4,4 8,16 16,16 32,16 Table 5. Configuration used for GRU32 distillation on DSA-19. We use stochastic gradient descent (SGD) with momentum for all our experiements. For experiments on CIFAR100 and CIFAR10, we use a learning rate of 0.1, a momentum paramter of 0.9, and weight decay of 5 × 10−4. We train for 200 epochs and reduce the learning rate by a factor of 0.2 in after 30%, 60% and 90% of the epoch execution. For experiments with time series data, Google-13 and DSA-19, we use a fixed learning rate of 0.05 and a momentum of 0.9. We do not use weight decay or learning rate scheduling for time-series data. D.3. Additional Results FLOPS measurement. To measure the total floating point operations required for inference, we use the Deep Speed framework (Rasley et al., 2020). We randomly initialize a single sample with batch-size set to 1, and profile it to obtain our values for FLOPs for all real-world data sets. Connections, parallelization and execution schemes. Our focus in this work has been sequential execution of the models. While reusing previously computed features is clearly beneficial for finding weak learners in this setup, the presence of connections across models prevent them from being scheduled together for execution whenever otherwise possible. To manage this trade off between parallelization and expressivity, we try to restrict the number of connections to at most one between models, and further restrict the connection to later layers of the model. Connections in the later layers of networks impose fewer sequential blocks in inference and allows for better parallelization. Let φt,l(x) denote the activation produced at layer l by the weak learner at round t, on data-point x. Then some of the connections we consider are Progressive Knowledge Distillation: Building Ensembles for Efficient Inference (a) Sequential schedule (b) Hybrid schedule Figure 4. A schematic description of a sequential execution scheme for an ensemble of four models, being evaluated one after the other from left to right. The last model in the ensemble reuses the actions of the previous one, causing a blocking dependency. Thus we cannot trivially execute all models in parallel. However, since the connection is between the last layers of the network, we can construct hybrid execution schemes as in (b). Here, pairs of models are executed in together. • φ(t,l)(x) − φ(t+1,l)(x), to learn the error in features at layer l. • φ(t,l)(x) + id(x), standard residual connection at layer l. • φ(t+1,l)[φ(1,l)(x), . . . , φt,l)(x)], dense connections at layer l across rounds. • Simple accumulation operations. • Recurrent networks: LSTM and GRU.
http://arxiv.org/abs/2302.10755v1
2023-02-20T16:26:29
2023-02-20T16:26:29
Federated Gradient Matching Pursuit
Traditional machine learning techniques require centralizing all training data on one server or data hub. Due to the development of communication technologies and a huge amount of decentralized data on many clients, collaborative machine learning has become the main interest while providing privacy-preserving frameworks. In particular, federated learning (FL) provides such a solution to learn a shared model while keeping training data at local clients. On the other hand, in a wide range of machine learning and signal processing applications, the desired solution naturally has a certain structure that can be framed as sparsity with respect to a certain dictionary. This problem can be formulated as an optimization problem with sparsity constraints and solving it efficiently has been one of the primary research topics in the traditional centralized setting. In this paper, we propose a novel algorithmic framework, federated gradient matching pursuit (FedGradMP), to solve the sparsity constrained minimization problem in the FL setting. We also generalize our algorithms to accommodate various practical FL scenarios when only a subset of clients participate per round, when the local model estimation at clients could be inexact, or when the model parameters are sparse with respect to general dictionaries. Our theoretical analysis shows the linear convergence of the proposed algorithms. A variety of numerical experiments are conducted to demonstrate the great potential of the proposed framework -- fast convergence both in communication rounds and computation time for many important scenarios without sophisticated parameter tuning.
[ "Halyun Jeong", "Deanna Needell", "Jing Qin" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10755v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10755v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.IT", "cs.NA", "math.IT", "math.NA", "65-xx, 68W15, 68W20" ]
3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 5 5 7 0 1 . 2 0 3 2 : v i X r a Federated Gradient Matching Pursuit 1 Halyun Jeong, Deanna Needell, Jing Qin Abstract Traditional machine learning techniques require centralizing all training data on one server or data hub. Due to the development of communication technologies and a huge amount of decentralized data on many clients, collaborative machine learning has become the main interest while providing privacy-preserving frameworks. In particular, federated learning (FL) provides such a solution to learn a shared model while keeping training data at local clients. On the other hand, in a wide range of machine learning and signal processing applications, the desired solution naturally has a certain structure that can be framed as sparsity with respect to a certain dictionary. This problem can be formulated as an optimization problem with sparsity constraints and solving it efficiently has been one of the primary research topics in the traditional centralized setting. In this paper, we propose a novel algorithmic framework, federated gradient matching pursuit (FedGradMP), to solve the sparsity constrained minimization problem in the FL setting. We also generalize our algorithms to accommodate various practical FL scenarios when only a subset of clients participate per round, when the local model estimation at clients could be inexact, or when the model parameters are sparse with respect to general dictionaries. Our theoretical analysis shows the linear convergence of the proposed algorithms. A variety of numerical ex- periments are conducted to demonstrate the great potential of the proposed framework – fast convergence both in communication rounds and computation time for many important scenarios without sophisticated parameter tuning. federated learning, sparse recovery, gradient matching pursuit, random algorithm Index Terms I. INTRODUCTION With the development of technology and science, machine learning for big data processing has become an emerging field with a wide variety of applications. In general, there are several major considerations in dealing with a large amount of data - data storage and privacy, computation, and communication [34]. To address the limitation of efficiency and scalability of traditional machine learning algorithms for large-scale data, distributed centralized learning allows data and/or model parallelism, where all local data are typically uploaded to a central server but model training is distributed to various clients [54]. Different from the traditional centralized learning, federated learning (FL) [39] is a collaborative learning framework in which many clients work together to solve an optimization problem without sharing local data. In order to preserve privacy, and reduce the communication cost between clients and the server, data sets are only stored at the clients locally and can not be transferred to other clients or the server in FL. In other words, it aims to learn a central model using decentralized data sets. The heterogeneous data distributions among the clients pose an additional challenge in federated learning. As one of the most popular FL algorithms, Federated Averaging (FedAvg) [38] considers an unconstrained optimization problem where the desired solution has no additional characteristics. FedAvg alternates gradient descent and averaging of distributed solutions from local clients in an iterative way. However, in a lot of applications, the solution of interest has some special structures, such as sparsity and low-rankness by itself or in some transformed domain, which serve as prior information and can be utilized to address the ill-posedness of the problem and improve performance. Thus, recent interest in FL optimization with additional solution structures has grown, which has been shown to be especially effective when only a few data samples are available at each client but the underlying signal dimension is relatively large [52], [61]. In such cases when the solution to an optimization problem from FL applications possesses a certain structure, for example, sparsity and low-rankness, one can use a regularizer to enforce the desired structure [61]. Federated Dual Averaging (FedDualAvg) by Yuan et al. [61], different from FedAvg, uses potentially nonsmooth and convex regularizers to promote the structure of the solution. H. Jeong and D. Needell are with the Department of Mathematics, the University of California Los Angeles, Los Angeles, CA 90095 (email: [email protected]; [email protected]) J. Qin is with the Department of Mathematics, University of Kentucky, KY 40506 (email: [email protected]) When we have more prior information about the solution structure, e.g., the sparsity level, then hard-thresholding based approaches could be often more efficient than the regularization based methods [19], [62]. The hard- thresholding based methods aim to solve nonconvex formulations of the problem, which have been successfully applied to many data processing problems lately with improved performance. [7], [16], [21], [42], [46]. Following this line of research, Tong et al. proposed Federated Hard Thresholding (FedHT) and Federated Iterative Hard Thresholding (FedIterHT) [52], employing hard-thresholding at the aggregation step at the server with potentially additional hard-thresholding after each stochastic gradient step at clients. With a proper choice of step sizes for the stochastic gradients at the clients, these methods guarantee linear convergence up to a neighborhood of the solution to the problem. Despite the fact that these approaches partially inherit the advantages of thresholding based methods over those based on regularization, they necessitate fine-tuning of learning rates at clients, which often have practical limitations and they are not applicable for sparse signals with respect to general dictionaries. Their convergence analysis also requires the mini-batch sizes at the clients to grow exponentially in the number of communication rounds, which further limits the usage in most applications. Another popular thresholding based method is the gradient matching pursuit (GradMP) [44] which is a gen- eralization of the compressive sampling matching pursuit (CoSaMP) [42]. These methods are known to be more efficient than the others such as regularizer based methods, particularly when the sparsity level of a signal is much smaller than its dimension [16], [50]. A. Contributions We summarize our contributions below. • We propose the Federated Gradient Matching Pursuit algorithm, abbreviated as FedGradMP, to overcome the aforementioned drawbacks. More precisely, we show that the proposed FedGradMP enjoys the linear convergence up to a small neighborhood of the solution, without the restrictions for FedHT/FedIterHT to work. Furthermore, Our analysis has shown that FedGradMP converges linearly up to a statistical bias term for the recovery of sparse signals under mild conditions. • The majority of FL algorithm analyses have been carried out either under bounded gradient or bounded dissimilarity assumptions, which could be problematic for certain scenarios [55]. Only a few recent works for FL in unconstrained setup provide theoretical guarantees without this type of assumption, but under the unbounded dissimilarity condition which is considered to be the most general type of heterogeneity assumption [31], [58]. To the best of our knowledge, this is the first work for solving sparsity-constrained FL problems that analyzes the convergence under this general dissimilarity condition. • Thanks to the mechanism of GradMP, FedGradMP does not require intensive tuning of learning rates at the clients for the sparse linear regression problem, which could be often still challenging because of data hetero- geneity in the FL setting. Approaches based on the local stochastic gradient at clients including FedHT/FedIterHT, as described in the literature [26], [52], [55] and demonstrated in our numerical studies, need tweaking the learning rates (step sizes) else they diverge or converge slowly, especially when the data at distinct clients are more heterogeneous. In contrast, FedGradMP which is based on solving low-dimensional sub-optimization problems at clients can be often solved efficiently and does not require fine tuning of learning rates. • Most of the signals of practical interest are not sparse by themselves in the standard basis but in a certain dictionary. This observation has led to the development of several sparse recovery methods with general dictionaries in the centralized setting [4], [14], [44]. FedGradMP is a versatile method under a general dictionary framework. One potential problem with using dictionaries in FL methods is the privacy concern if they are correlated with the client data sets. By utilizing dictionaries that are statistically independent with client data sets such as the random Gaussian dictionary, we demonstrate the effectiveness of FedGradMP as an FL method without such concerns. B. Further related works There have been numerous extensions and analyses of FedAvg [31], [33], [38], [55], [58], a standard algorithm to train a machine learning model in FL. FedAvg can be considered as a variant of Local SGD, which essentially runs stochastic gradient iterations at each client and averages these locally computed model parameters at a server. In addition to the considerations of Local SGD [37], [38] for efficient communication in distributed learning, FedAvg 2 Dictionary sparsity and Linear convergence to the solution No client convergence speed-up up to optimal statistical bias LR tuning Unbounded dissimilarity FedAvg [38] FedDualAvg [61] FedHT/FedIterHT [52] FedGradMP (cid:55) (cid:55) (cid:55) (cid:51) (cid:55) (cid:55) (cid:51)* (cid:51) (cid:55) (cid:55) (cid:55) (cid:71)** (cid:55) (cid:55) (cid:55) (cid:51) * The convergence analysis of FedHT/FedIterHT, however, requires that the mini-batch sizes increase exponentially in the number of communication rounds, which is generally not practical in many applications. ** FedGradMP does not require learning rate tuning for the sparse linear regression problem that could be still challenging for baseline algorithms based on the stochastic gradient descent, essentially due to heterogeneity in the FL environment as we illustrate Section V-C. TABLE I COMPARISON OF OUR WORK WITH RELATED REFERENCES. aims to handle challenges in the FL settings such as heterogeneous client datasets and partial client participation [31], [55]. Thanks to the recent endeavors of researchers [23], [31], [58], we now have a better understanding of the convergence behavior of FedAvg, especially when the objective function is (strongly) convex. As for the nonconvex case, several works provide the convergence of FedAvg to the stationary points and global convergence under extra assumptions such as Polyak-Lojasiewicz (PL) condition [26], which is a generalization of the strong convexity condition. However, it is worth noting that these assumptions do not imply our main assumptions, the restricted strong convexity/smoothness. An important research direction in FL algorithm analysis is characterizing the trade-off between convergence speed and accuracy that stems from client data heterogeneity. As the clients run more local iterations, the estimates of the local solution become more accurate at each client (improving the convergence rate) while they tend to drift away from the global solution (making the actual residual error larger), especially in a highly heterogeneous environment [10], [27], [30], [31], [56]. Our analysis and numerical experiments on the convergence behavior of FedGradMP also reflect this phenomenon, which becomes more noticeable when the client datasets are highly heterogeneous. To reduce the communication cost between the server and clients further, techniques such as sparsifying and reducing the dimensionality of the gradients have been proposed in [5], [24], [40], [47], [51]. In FedGradMP, the hard-thresholding operation is applied whenever the computed models are sent from a server or clients, so the models are already sparsified with the effective dimension same as the desired sparsity level. This makes FedGradMP more attractive in terms of saving communication resources. Another active area in FL research is client sampling or partial participation. Because of the limited connection bandwidth or a large population of clients, it is often not possible for every client to participate at each round in FL. Many methods incorporate this by modeling each client to participate randomly per round according to some distribution [9], [55], [59]. There have been recent attempts to employ more elaborate sampling strategies such as importance sampling [11], but this requires extra care since it could leak private information of client data. We analyze FedGradMP under the more common assumption, i.e., the random client participation model, and show the more client participate at each round, the faster the convergence rate is. This observation is consistent with recent findings [59], [60] on the FL algorithms for the unconstrained problem. C. Organization The rest of the paper is organized as follows. In Section II, we introduce the sparse federated learning problem and make important assumptions that will be used for convergence analysis. In Section III, we propose the federated gradient matching pursuit algorithm and discuss the convergence guarantees in detail. Section IV generalizes Fed- GradMP and its convergence analysis to several practical settings such as the partial client participation environment and inexact estimation at the client side. In addition, we provide theoretical justifications of using a shared random Gaussian dictionary at clients to improve the performance of FedGradMP. Section V provides a variety of numerical experiments for sparse signal recovery which demonstrate the effectiveness of the proposed approach. Finally, we draw conclusions in Section VI. 3 D. Notation We say that a vector is s-sparse if it has at most s nonzero entries. We write (cid:107) * (cid:107)2 to denote the (cid:96)2 norm for a vector. We use (cid:107) * (cid:107)F and (cid:107) * (cid:107) to denote the Frobenius norm and operator norm of a matrix, respectively. For a given positive integer m, [m] denotes the set of integers {1, 2, . . . , m}. For positive semidefinite matrices A and B, A (cid:22) B means that B − A is positive semidefinite. II. SPARSE FEDERATED LEARNING Federated learning is a framework to solve machine learning problems collaboratively by multiple clients possibly with a coordination server. While this provides enhanced privacy, it also poses interesting challenges since clients still require to exchange local parameters to other clients or a server in a communication-efficient way. Moreover, in many heterogeneous learning environments, the local data of each client can be non-identically distributed and/or statistically dependent. To formally describe FL, we begin with introducing the setup. Assume that the number of the clients is N, and the local objective function at the i-th client is denoted by fi(x) = Ez∼Di[(cid:96)i(x; z)] where Di is the data set at the i-th client and (cid:96)i(x; z) is the loss function about x that depends on the data z. The optimization problem of interest in FL typically takes the form min x∈Rn f (x) := N ∑ i=1 pi fi(x) where x ∈ Rn and pi ∈ [0, 1] is the weight for the i-th client satisfying ∑N i=1 pi = 1. This formulation is general enough to cover the majority of machine learning setup, the empirical risk minimization (ERM) by taking the expectation uniformly over the data set Di and pi = |Di|/ ∑N i=1 |Di| [32], [55]. On the other hand, because of communication efficiency or the nature of many applications, it is natural to assume that the solution we are looking for is sparse with respect to a certain dictionary or an atom set. In order to discuss this general notion of sparsity, we consider a finite set of atoms A = {a1, a2, . . . , ad} in which ai ∈ Rn as defined in [44], [45]. For example, we recover the standard basis when A = {e1, * * * , en}, where eis are the standard basis vectors for Rn. We say a vector x is τ-sparse with respect to A if x can be represented as d ∑ i=1 where at most τ number of the coefficients αi's are nonzero. Then, the support of x with respect to A is defined in a natural way, suppA (x) = {i ∈ [d] : αi (cid:54)= 0}. We define the (cid:96)0-norm of x with respect to A as αiai x = (cid:40) (cid:41) (cid:107)x(cid:107)0,A = min α |T | : x = ∑ i∈T αiai, T ⊆ [d] , where α = (α1, α2, . . . , αd)T . With a sparsity constraint, sparse FL aims to solve the constrained problem min x∈Rn f (x) = N ∑ i=1 pi fi(x) subject to (cid:107)x(cid:107)0,A ≤ τ, (1) where τ is a preassigned sparsity level. We denote the optimal solution to this problem by x∗. We also assume further that each local objective function fi can be expressed by the average of the functions gi, j : Rn → R, i.e., fi(x) = 1 M M ∑ j=1 gi, j(x), (2) for some integer M. One can interpret gi, j as a loss function associated with the i-th client restricted to the j-th mini-batch, where the index set of all possible mini-batches is [M]. The objective function of (1) usually depends on the data distribution at clients. For example, the least squares problem in FL typically sets fi(x) = 1 2|Di| (cid:107)ADix − yDi(cid:107)2 2, 4 where ADi is the client i data matrix whose rows consist of the training input data points for client i and yDi are corresponding observations. Let b be the size of each mini-batch and M be the total number of mini-batches. Then, M = (cid:0)|Di| b (cid:1) and gi, j is given by gi, j(x) = 1 2b ∑ (ak,bk)∈S j (yk − (cid:104)ak, x(cid:105))2, where S j is a subset of Di associated j-th mini-batch of i-th client. We use E(i) j φi, j(x) to denote the expectation of a function φi, j(x) provided that the j-th mini-batch index set is chosen from the set of the all possible mini-batches with size b, uniformly at random. Hence, the function fi can be expressed as fi(x) = E(i) j gi, j(x). Since the problem (1) is nonconvex in general, it is difficult to find its solution without additional assumptions on the objective function. In this work, we adopt the assumptions from [44] shown as follows. Assumption 1 (A -restricted Strong Convexity (A -RSC)). The local objective function fi at the i-th client satisfies τ (i)-strongly convexity condition: for each i ∈ [N] and any x1, x2 ∈ Rn with (cid:107)x1 − x2(cid:107)0,A ≤ τ, we the restricted ρ − have fi(x1) − fi(x2) − (cid:104)∇ fi(x2), x1 − x2(cid:105) ≥ (cid:107)x1 − x2(cid:107)2 2. (3) ρ − τ (i) 2 Assumption 2 (A -restricted Strong Smoothness (A -RSS)). The loss function gi, j associated with the j-th mini- τ (i, j)-strongly smoothness condition: for each i, j and any x1, x2 ∈ Rn batch at the i-th client satisfies the restricted ρ + with (cid:107)x1 − x2(cid:107)0,A ≤ τ, we have (cid:107)∇gi, j(x1) − ∇gi, j(x2)(cid:107)2 ≤ ρ + τ (i, j)(cid:107)x1 − x2(cid:107)2. (4) Remark 1. Assumptions 1 and 2 are widely used in the optimization community for solving the high-dimensional statistical learning or sparse recovery problems. Note that the local loss function fi and gi, j may not be convex or smooth in the entire space Rn since we only need strong convexity and smoothness assumptions for vectors that are sparse with respect to a dictionary. Most convergence analysis for the FL algorithms assumes (strong) convexity of fi or the Polyak-Lojasiewicz (PL) condition [26]; neither is weaker than Assumption 1. Several FL algorithms inspired by classical sparse optimization techniques [13], [15], [44] have been proposed under these assumptions. Such algorithms include FedHT and FedIterHT which are based on IHT [52]. These algorithms use the hard-thresholding operator Hτ (x), which keeps the τ largest components of the input vector x in magnitude with respect to the standard basis, whereas our algorithm adopts a more general hard-thresholding operator - the approximate projection operator. To define an approximate projection, we denote by R(AΓ) the subspace of Rn spanned by the atoms in A whose indices are restricted to Γ ∈ [d]. For w ∈ Rn, the orthogonal projection of w to R(AΓ) is denoted by PΓw. Then, an approximate projection operator with η > 0, denoted by approxτ (x), constructs an index set Γ such that where Hτ (w) is the best τ-sparse approximation of w with respect to A , i.e., (cid:107)PΓw − w(cid:107)2 ≤ η(cid:107)w − Hτ (w)(cid:107)2, Hτ (w) = argmin x=A α,(cid:107)α(cid:107)0≤τ (cid:107)w − x(cid:107)2. Here, A is the matrix whose columns are the atoms by abusing the notation slightly. The local dissimilarity in FL captures how the data distributions among clients are different, which is typically in the following form, especially in the early works in FL [35], [55], [61]: Ei∼P (cid:107)∇ fi(x) − ∇ f (x)(cid:107)2 2 ≤ β 2(cid:107)∇ f (x)(cid:107)2 2 + ζ 2, ∀ x ∈ Rn. (5) When β = 0, this condition reduces to the uniform bounded heterogeneity condition that has been used for analyzing the convergence of many popular FL algorithms, such as FedAvg [35] and FedDualAvg [55], [61]. In this work, the assumption of heterogeneity on the client data is much weaker than (5) by assuming heterogeneity only at the solution x∗ as follows. 5 Assumption 3. There is a minimizer for (1), denoted by x∗ with a finite ζ 2 ∗ defined as below: ∗ = Ei∼P (cid:107)∇ fi(x∗)(cid:107)2 ζ 2 2 = N ∑ i=1 pi(cid:107)∇ fi(x∗)(cid:107)2 2. Assumption 3 is the same as the one used for more recent analyses giving sharper convergence guarantees of FL algorithms [31], [58]. This is also a necessary assumption for the FedAvg type of algorithms to converge [58]. But there are a few places where we state the implication of our results under stronger assumptions such as (5), in order to compare the implications of our results to previous works. Other common assumptions in the analysis of federated learning algorithms are the unbiased and bounded variance conditions of local stochastic gradients. Assumption 4. The local stochastic gradient ∇gi, j associated with the randomly selected j-th mini-batch at the i-th client satisfies E(i) j [∇gi, j(x)] = ∇ fi(x) for any τ-sparse vector x, and where E(i) j E(i) j (cid:107)∇gi, j(x) − ∇ fi(x)(cid:107)2 2 ≤ σ 2 i for any τ-sparse vector x, is the expectation taken over the mini-batch index selected from [M] at the client i. (6) (7) Remark 2. The bounded variance condition of local stochastic gradients associated with mini-batches (7) in Assumption 4 is widely used in FL and stochastic algorithms in general [12], [55], but it may not hold for some settings [31]. This assumption (7) is actually not essential for our main result to hold (See Appendix for the proof of our convergence theorem without this assumption) but we present our work under the assumption for the sake of simplicity. The following lemma is a well-known consequence of the A -RSS property in Assumption 1. Lemma 1 (Descent lemma). Suppose that the function h(x) satisfies the A -RSS property in Assumption 2 with a constant ρ + τ . Then for any x1, x2 ∈ Rn with (cid:107)x2(cid:107)0,A ≤ τ, it holds (cid:104)∇h(x1), x2(cid:105) ≥ h(x1 + x2) − h(x1) − ρ + τ 2 (cid:107)x2(cid:107)2 2. III. FEDERATED GRADIENT MATCHING PURSUIT In this section, we propose Federated Gradient Matching Pursuit (FedGradMP) and discuss its convergence guarantee. We start with describing FedGradMP in Algorithm 1. In the FedGradMP framework, the StoGradMP algorithm [44] is implemented at the client side and the server aggregates the resulting locally computed models after each round followed by a projection onto a subspace of dimension at most τ. Each iteration of StoGradMP at a client consists of the following five steps: 1) Randomly select a mini-batch from the client batch. 2) Compute the stochastic gradient associated with the selected mini-batch. 3) Merge the subspace associated with the previously estimated local model with the closest subspace of dimension at most 2τ to the stochastic gradient from Step 2. 4) Solve the minimization problem for the local objective function at the client over the merged subspace from Step 3. 5) Identify the closest subspace of dimension at most τ to the solution at Step 4. Note that in Step 4, the clients are not minimizing the local objective function fi over the sparsity constraint, but over the subspace associated with the estimated sparsity pattern of the solution in Step 3. This subproblem can be often solved efficiently since fi are strongly convex/smooth with respect to such subspaces by Assumptions 1 and 2, especially when the dimension of the subspace is small or fi are quadratic [6], [43]. Nevertheless, it could be expensive to solve this subproblem in general, so we discuss how to obtain its approximate solution by computationally cheap methods in the next section. 6 Algorithm 1 FedGradMP Input: The number of rounds T , the number of clients N, the number of local iterations K, weight vector p, the estimated sparsity level τ, η1, η2, η3. Output: ˆx = xT . Initialize: x0 = 0, Λ = /0. for t = 0, 1, . . . , T − 1 do for client i = 1, 2, . . . , N do x(i) t,1 = xt for k = 1 to K do t,k, η1) Select a mini-batch index set jk := i(i) Calculate the stochastic gradient r(i) Γ = approx2τ (r(i) (cid:98)Γ = Γ ∪ Λ b(i) t,k = argmin x Λ = approxτ (b(i) t,k+1 = PΛ(b(i) x(i) t,k) x ∈ R(A t,k, η2) fi(x), (cid:98)Γ) end for t,k uniformly at random from {1, 2, . . . , M} t,k = ∇gi, jk (cid:17) (cid:16) x(i) t,k end for (cid:16) i=1 pix(i) ∑N Λs = approxτ t,K+1, η3 (cid:16) (cid:17) i=1 pix(i) ∑N xt+1 = PΛs t,K+1 (cid:17) end for A. Linear Convergence of FedGradMP This subsection is devoted to proving the linear convergence of FedGradMP in the number of communication rounds. The first step of the proof for our main theorem is similar to the one for Theorem 3.1 in [52] but also utilizes several lemmas below from [44] and [45] after some modifications to accommodate the FL setting. Lemma 2 ([44, Lemma 1]). The approximation error between the (k + 1)-th local iterate x(i) by t,k+1 and x∗ is bounded 2 ≤ (1 + η2)2(cid:107)b(i) For notational convenience, we define the following two quantities: t,k+1 − x∗(cid:107)2 (cid:107)x(i) t,k − x∗(cid:107)2 2. ρ +(i) τ = max j ρ + τ (i, j), ̄ρ +(i) τ = 1 M M ∑ j=1 ρ + τ (i, j). Lemma 3 ([45, Lemma 5.7]). Let (cid:98)Γ be the set obtained from the k-th iteration at client i. Then, we have 2 ≤ β1(i)E(i) Jk t,k − x∗)(cid:107)2 t,k − x∗(cid:107)2 2 + ξ1(i), E(i) Jk (cid:107)b(i) (b(i) (cid:107)P⊥ (cid:98)Γ where β1(i) = ̄ρ +(i) 4τ 4τ (i) − ̄ρ +(i) 4τ 2ρ − , ξ1(i) = 2E(i) ̄ρ +(i) 4τ Jk, j(cid:107)P (2ρ − (cid:98)Γ∇gi, j(x∗)(cid:107)2 4τ (i) − ̄ρ +(i) ) 4τ 2 . Here Jk denotes the set of all previous mini-batch indices j1, . . . , jk randomly selected in or before the k-th step of the local iterations at the i-th client and E(i) Jk is the expectation taken over Jk. The following lemma is an extended version of Lemma 3 in [44], whose proof further utilizes Young's inequality to control the trade-off between contraction and residual error due to the noise of the stochastic gradient for the FL 7 setting. It also provides a refinement for the exact projection operator. Since the proof of the lemma is substantially different from the original version due to nontrivial changes to accommodate FL setting, we include its proof. Lemma 4. Let (cid:98)Γ be the set obtained from the k-th iteration at client i. Then, for any θ > 0, we have E(i) jk (cid:107)P⊥ (cid:98)Γ (b(i) t,k − x∗)(cid:107)2 2 ≤ β2(i)(cid:107)x(i) t,k − x∗(cid:107)2 2 + ξ2(i) where  β2(i) = 2 (cid:17) (cid:16) ̄ρ +(i) 4τ + 1 θ 2 1 ρ − η 2 4τ (i) − η 2 1 ρ − 4τ (i) +  (3E jk (ρ + τ (i, jk))2 + 1)  , (cid:113) η 2 1 − 1 2 η1ρ − 4τ (i) (cid:20)(cid:18) ξ2(i) =    8 4τ (i))2 max (ρ − Ω⊂[d] |Ω|=4τ 8 4τ (i))2 max (ρ − Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + 1 ρ − 4τ (i) 2θ 2 + 6 √ (cid:19) η 2 1 −1 η1 √ i + 6 σ 2 η 2 1 −1 η1 (cid:21) (cid:107)∇ fi (x∗) (cid:107)2 2 if η1 > 1, (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + 2θ 2σ 2 i ρ − 4τ (i) if η1 = 1 (when the projection operator is exact). Here E(i) jk k-th step of the local iterations at the i-th client. is the expectation taken over the randomly selected mini-batch index jk for the stochastic gradient in the Proof. We start with by noticing P⊥ (cid:98)Γ ∆ := x∗ − x(i) b(i) t,k = 0 and P⊥ (cid:98)Γ t,k and the set suppA (∆) be denoted by R. Note that |R| ≤ 2τ. Hence, we have t,k = 0 since both b(i) x(i) t,k and x(i) t,k belong to the span of A (cid:98)Γ. Let t,k + x(i) t,k)(cid:107)2 + (cid:107)P⊥ (cid:98)Γ t,k − x∗)(cid:107)2 (x(i) t,k − x∗)(cid:107)2 (b(i) (cid:107)P⊥ (cid:98)Γ (b(i) t,k − x∗)(cid:107)2 = (cid:107)P⊥ (cid:98)Γ (b(i) ≤ (cid:107)P⊥ (cid:98)Γ (x(i) = (cid:107)P⊥ (cid:98)Γ Γ (x(i) ≤ (cid:107)P⊥ = (cid:107)∆ − PΓ∆(cid:107)2. t,k − x(i) t,k − x(i) t,k − x∗)(cid:107)2 t,k − x∗)(cid:107)2 Here the second inequality follows from the definitions of the sets Γ and (cid:98)Γ, Γ ⊂ (cid:98)Γ. Now we estimate (cid:107)∆ − PΓ∆(cid:107)2 2. With a slight abuse of notation, E(i) jk First, from the A -RSC property of fi, we have will be denoted by E jk throughout the proof. t,k(cid:107)2 2 (cid:107)x∗ − x(i) (cid:69) t,k), x∗ − x(i) t,k (cid:69) ρ − 4τ (i) 2 ≥ fi(x∗) − fi(x(i) t,k) − (cid:68) t,k), x∗ − x(i) ∇ fi(x(i) (cid:68) ∇gi, jk (x(i) = E jk (cid:68) PR∇gi, jk (x(i) = E jk ≥ −E jk (cid:107)PR∇gi, jk (x(i) t,k t,k), x∗ − x(i) t,k)(cid:107)(cid:107)∆(cid:107)2 t,k (cid:69) (8) By applying the inequality (15) in [44] and from the fact that Γ is the support set after the projection of the stochastic gradient ∇gi, jk (x(i) t,k) in Algorithm 1, we have (cid:107)PR∇gi, jk (x(i) t,k)(cid:107)2 ≤ (cid:107)PΓ∇gi, jk (x(i) t,k)(cid:107)2 + (cid:113) η 2 1 − 1 η1 To make the notation simple, we define z := − PΓ∇gi, jk (x(i) t,k) (cid:107)PΓgi, jk (x(i) t,k)(cid:107)2 (cid:107)∆(cid:107)2. 8 (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2. Then, the term −E jk (cid:107)PR∇gi, jk (x(i) − E jk (cid:107)PR∇gi, jk (x(i) t,k)(cid:107)2(cid:107)∆(cid:107)2 t,k)(cid:107)2(cid:107)∆(cid:107)2 can be further bounded as follows. ≥ −E jk (cid:107)PΓ∇gi, jk (x(i) t,k)(cid:107)2(cid:107)∆(cid:107)2 − = E jk (cid:68) PΓ∇gi, jk (x(i) (cid:69) t,k), z − = E jk (cid:68) ∇gi, jk (x(i) (cid:69) t,k), z − ≥ E jk (cid:68) ∇gi, jk (x(i) (cid:69) t,k), z − (cid:113) (cid:113) (cid:113) η 2 1 − 1 η1 η 2 1 − 1 η1 η 2 1 − 1 2η1 (cid:113) η 2 1 − 1 η1 E jk (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2(cid:107)∆(cid:107)2 E jk (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2(cid:107)∆(cid:107)2 E jk (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2(cid:107)∆(cid:107)2 E jk (cid:16) (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2 (cid:17) 2 + (cid:107)∆(cid:107)2 2 (cid:113) η 2 1 − 1 2η1 = E jk (cid:68) ∇ fi (cid:17) (cid:16) x(i) t,k (cid:69) , z + E jk (cid:68) ∇gi, jk (x(i) t,k) − ∇ fi (cid:17) (cid:16) x(i) t,k (cid:69) , z − E jk (cid:16) (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2 2 + (cid:107)∆(cid:107)2 2 (cid:17) , where the second inequality above follows from the AM-GM inequality, ab ≤ (a2 + b2)/2 for nonnegative real numbers a, b. Now, we apply the Young's inequality for the inner product space to the second term in the last line to obtain (cid:12) (cid:68) ∇gi, jk (x(i) (cid:12) (cid:12) t,k) − ∇ fi (cid:17) (cid:16) x(i) t,k (cid:69)(cid:12) (cid:12) (cid:12) ≤ , z θ 2 2 (cid:107)∇gi, jk (x(i) t,k) − ∇ fi (cid:17) (cid:16) x(i) t,k (cid:107)2 2 + 1 2θ 2 (cid:107)z(cid:107)2 2 for any nonzero θ . Hence, we have − E jk (cid:107)PR∇gi, jk (x(i) t,k)(cid:107)2(cid:107)∆(cid:107)2 θ 2 (cid:69) (cid:17) 2 (cid:16) x(i) t,k ≥ E jk , z − (cid:68) ∇ fi (cid:113) E jk (cid:107)∇gi, jk (x(i) t,k) − ∇ fi (cid:17) (cid:16) x(i) t,k (cid:107)2 2 − 1 2θ 2 E jk (cid:107)z(cid:107)2 2 − η 2 1 − 1 2η1 (cid:16) E jk (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2 (cid:17) 2 + E jk (cid:107)∆(cid:107)2 2 (cid:113) ≥ E jk (cid:68) ∇ fi (cid:17) (cid:16) x(i) t,k (cid:69) , z − θ 2 2 σ 2 i − 1 2θ 2 E jk (cid:107)z(cid:107)2 2 − η 2 1 − 1 2η1 (cid:16) E jk (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2 2 + E jk (cid:107)∆(cid:107)2 2 (cid:17) , where we have used (7) in Assumption 4 in the last inequality above. Next, we obtain the upper bound for E jk (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2 2 as follows. Γ ∇gi, jk (x(i) E jk (cid:107)P⊥ ≤ E jk (cid:107)∇gi, jk (x(i) ≤ 3E jk (cid:107)∇gi, jk (x(i) ≤ 3E jk (ρ + = 3E jk (ρ + t,k)(cid:107)2 2 t,k)(cid:107)2 2 t,k) − ∇gi, jk (x∗)(cid:107)2 t,k − x∗(cid:107)2 2 + 3σ 2 where we have used the inequality (cid:107)a + b + c(cid:107)2 2 and Assumption 4 in the third inequality above. Combining this bound with inequality (8) yields ρ − 4τ (i) 2 τ (i, jk))2(cid:107)x(i) τ (i, jk))2(cid:107)∆(cid:107)2 fi(x∗) − fi (cid:107)x∗ − x(i) (cid:16) x(i) t,k t,k(cid:107)2 2 − (cid:17) ≥ E jk (cid:68) ∇ fi (cid:17) (cid:16) x(i) t,k (cid:69) , z − θ 2 2 σ 2 i − 1 2θ 2 E jk (cid:107)z(cid:107)2 2 − 2 + 3E jk (cid:107)∇gi, jk (x∗) − ∇ fi (x∗) (cid:107)2 2 + 3E jk (cid:107)∇ fi (x∗) (cid:107)2 2 i + 3(cid:107)∇ fi (x∗) (cid:107)2 2 2 + 3σ 2 i + 3(cid:107)∇ fi (x∗) (cid:107)2 2, 2 + 3(cid:107)b(cid:107)2 2 ≤ 3(cid:107)a(cid:107)2 2 + 3(cid:107)c(cid:107)2 2 in the second inequality, and Assumption (cid:16) E jk (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2 2 + E jk (cid:107)∆(cid:107)2 2 (cid:17) (9) (cid:113) η 2 1 − 1 2η1 9 ≥ E jk (cid:68) ∇ fi (cid:17) (cid:16) x(i) t,k (cid:69) , z − θ 2 2 σ 2 i − 1 2θ 2 E jk (cid:107)z(cid:107)2 2 − (cid:113) η 2 1 − 1 2η1 (cid:104) (3E jk (ρ + τ (i, jk))2 + 1)(cid:107)∆(cid:107)2 2 + 3σ 2 i + 3(cid:107)∇ fi (x∗) (cid:107)2 2 (cid:105) . On the other hand, using Lemma 1 for gi, j, a consequence of the A -RSS property, we have (cid:68) ∇gi, j(x(i) t,k), z (cid:69) ≥ gi, j (cid:17) (cid:16) x(i) t,k + z − gi, j (cid:17) (cid:16) x(i) t,k − ρ + 4τ (i, j) 2 (cid:107)z(cid:107)2 2 for all j ∈ [M]. By taking the average over all gi, j over j ∈ [M] on both sides of the inequality above and from the definitions of fi and ρ +(i) , we obtain 4τ (cid:17) (cid:16) x(i) t,k + z Here we have used (6) in Assumption 4. We then take the expectation E jk on both sides of the inequality. (cid:68) ∇ fi(x(i) (cid:69) t,k), z (cid:16) x(i) t,k (cid:107)z(cid:107)2 2. ≥ fi − fi − (cid:17) ̄ρ +(i) 4τ 2 E jk (cid:68) ∇ fi(x(i) (cid:69) t,k), z ≥ E jk fi (cid:16) x(i) t,k + z (cid:17) − fi (cid:17) (cid:16) x(i) t,k − ̄ρ +(i) 4τ 2 E jk (cid:107)z(cid:107)2 2. After applying this bound to inequality (9), we obtain fi(x∗) − fi (cid:17) (cid:16) x(i) t,k − ρ − 4τ (i) 2 (cid:107)∆(cid:107)2 2 ≥ E jk fi (cid:17) (cid:16) x(i) t,k + z (cid:113) − fi (cid:17) (cid:16) x(i) t,k − ̄ρ +(i) 4τ 2 E jk (cid:107)z(cid:107)2 2 − θ 2 2 σ 2 i − 1 2θ 2 E jk (cid:107)z(cid:107)2 2 − η 2 1 − 1 2η1 (cid:2)(3E jk (ρ + τ (i, jk))2 + 1)(cid:107)∆(cid:107)2 2 + 3σ 2 i + 3(cid:107)∇ fi (x∗) (cid:107)2 2 Thus, we have (cid:32) ̄ρ +(i) 4τ 2 + 1 2θ 2 (cid:113) 3 (cid:33) E jk (cid:107)z(cid:107)2 2 −  ρ − 4τ (i) − 1 2 (cid:113) η 2 1 − 1 η1 (3E jk (ρ + τ (i, jk))2 + 1)   (cid:107)∆(cid:107)2 2  +  θ 2 2 = ≥ = ≥ E jk fi ρ − 4τ (i) 2 ρ − 4τ (i) 2 ρ − 4τ (i) 2 ρ − 4τ (i) 2 ρ − 4τ (i) 2 ρ − 4τ (i) 2 = ≥ ≥ η 2 1 − 1   σ 2 i + (cid:113) 3 η 2 1 − 1 2η1 (cid:107)∇ fi (x∗) (cid:107)2 2 + 2η1 (cid:17) (cid:16) x(i) t,k + z − fi (x∗) E jk (cid:107)x(i) t,k + z − x∗(cid:107)2 2 + E jk (cid:68) ∇ fi(x∗), x(i) t,k + z − x∗(cid:69) E jk (cid:107)∆ − z(cid:107)2 2 + E jk (cid:104)∇ fi(x∗), z − ∆(cid:105) E jk (cid:107)∆ − z(cid:107)2 2 + E jk (cid:104)∇ fi(x∗), PΓ∪R(z − ∆)(cid:105) E jk (cid:107)∆ − y(cid:107)2 2 + E jk (cid:104)PΓ∪R∇ fi(x∗), (z − ∆)(cid:105) E jk (cid:107)∆ − z(cid:107)2 2 − E jk (cid:107)PΓ∪R∇ fi(x∗)(cid:107)2(cid:107)z − ∆(cid:107)2 (cid:107)∆ − z(cid:107)2 2 − max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2E jk (cid:107)∆ − z(cid:107)2. (cid:3) . (10) ((cid:63)) (11) Here, the inequality (10) follows from A -RSC. In ((cid:63)) of the above inequality chain, we have used the fact that z = − PΓ∇gi, jk (cid:107)PΓgi, jk (x(i) t,k) (x(i) t,k)(cid:107) (cid:107)∆(cid:107)2. 10 Let u = E jk (cid:107)∆ − z(cid:107)2, a = ρ − 4τ (i), b = max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2, and (cid:18) ̄ρ +(i) 4τ + c = (cid:19) 1 θ 2 E jk (cid:107)z(cid:107)2 2 − (cid:113)  ρ − 4τ (i) − η 2 1 − 1 η1 (3E jk (ρ + τ (i, jk))2 + 1)   (cid:107)∆(cid:107)2 2  θ 2 + + (cid:113) 3 η 2 1 − 1 η1 (cid:113) 3   σ 2 i + η 2 1 − 1 η1 (cid:107)∇ fi (x∗) (cid:107)2 2. Then the inequality (11) can be rewritten as au2 − 2bu − c ≤ 0 which gives Moreover, we have E jk (cid:107)∆ − z(cid:107)2 ≤ (cid:114) c a + 2b a . (cid:107)∆ − PΓ∆(cid:107)2 2 ≤ (cid:107)∆ − z(cid:107)2 2. Combining the previous two bounds yields On the other hand, since E jk (cid:107)∆ − PΓ∆(cid:107)2 2 ≤ (cid:19)2 (cid:18)(cid:114) c a + 2b a ≤ 2c a + 8b2 a2 . (cid:107)z(cid:107)2 2 = (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) − PΓ∇gi, jk (x(i) t,k) (cid:107)PΓgi, jk (x(i) t,k)(cid:107)2 (cid:107)∆(cid:107)2 (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 2 = (cid:107)∆(cid:107)2 2, we have Thus, (cid:113) η 2 1 − 1 η1 (3E jk (ρ + τ (i, jk))2 + 1)   (cid:107)∆(cid:107)2 2   ̄ρ +(i) 4τ + c ≤ 4τ (i) + 1 θ 2 − ρ − (cid:113) 3  θ 2 + + η 2 1 − 1 η1 (cid:113) 3   σ 2 i + η 2 1 − 1 η1 (cid:107)∇ fi (x∗) (cid:107)2 2. E jk (cid:107)∆ − PΓ∆(cid:107)2 2 (cid:16)  ̄ρ +(i) 4τ + 1 θ 2 1 ρ − η 2 2 ≤ (cid:17) 4τ (i) − η 2 1 ρ − 4τ (i) (cid:113) η 2 1 − 1 2 η1ρ − 4τ (i) + (3E jk (ρ + τ (i, jk))2 + 1)   (cid:107)∆(cid:107)2 2 + 8 (ρ − 4τ (i))2 max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 +   2θ 2 +  6 (cid:113) η 2 1 − 1 η1   σ 2 i + 6 (cid:113) η 2 1 − 1 η1 1 ρ − 4τ (i)  (cid:107)∇ fi (x∗) (cid:107)2 2  . Equipped with these lemmas, we are ready to prove our main result for the linear convergence of FedGradMP. Theorem 5. Let x∗ be the solution to (1) and x0 be the initial feasible solution. Assume that the local objective fi satisfies A -RSC with constant ρ − 4τ (i) in Assumption 1 and all of the functions gi, j associated with mini-batches satisfy A -RSS with constant ρ + 4τ (i, j) in Assumption 2. We further assume that gi, j satisfies the bounded variance condition of local stochastic gradients in Assumption 4 with variance bound σ 2 i . Let K be the number of local iterations at each client. 11 Then, for any θ > 0, the expectation of the recovery error at the (t + 1)-th round of FedGradMP described in Algorithm 1 obeys E(cid:107)xt+1 − x∗(cid:107)2 2 ≤ κt+1(cid:107)x0 − x∗(cid:107)2 2 + (2η 2 3 + 2)ν 1 − κ N ∑ i=1 pi 1 − μ(i)K 1 − μ(i) , where Here β1(i) = κ = (2η 2 3 + 2) N ∑ i=1 (cid:2)(1 + η2)2β1(i)β2(i)(cid:3)K pi and μ(i) = (1 + η2)2β1(i)β2(i). ̄ρ +(i) 4τ 4τ (i) − ̄ρ +(i) 4τ 2ρ −  , β2(i) = 2 (cid:17) (cid:16) ̄ρ +(i) 4τ + 1 θ 2 1 ρ − η 2 4τ (i) − η 2 1 ρ − 4τ (i) (cid:113) η 2 1 − 1 2 η1ρ − 4τ (i) +  (3E jk (ρ + τ (i, jk))2 + 1)  , (1 + η2)2 maxi (cid:18) +(1 + η2)2 (cid:18) (1 + η2)2 maxi    ν = +(1 + η2)2 ∑N ̄ρ +(i) 4τ (cid:18) 8β1(i) 4τ (i))2 + (ρ − (cid:20) N β1(i) pi ∑ ρ − 4τ (i) i=1 8β1(i) 4τ (i))2 + (ρ − (cid:20) 2 β1(i) ρ − 4τ (i) i=1 pi +(i) 4τ ̄ρ 4 +(i) (2ρ − 4τ (i)− ̄ρ ) √ 4τ η 2 1 −1 2θ 2 + 6 η1 + β1(i) ρ − 4τ (i) (cid:19) + 4 (2ρ − 4τ (i)− ̄ρ +(i) 4τ ) (cid:19) N ∑ i=1 √ 6 η 2 1 −1 η1 (cid:19) ζ 2 ∗ (cid:21) σ 2 i 4 (2ρ − 4τ (i)− ̄ρ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 +(i) 4τ ) ̄ρ +(i) 4τ pi max Ω⊂[d] |Ω|=4τ (cid:21) θ 2 + ̄ρ +(i) 4τ 4 (2ρ − 4τ (i)− ̄ρ +(i) 4τ ) σ 2 i if η1 = 1. if η1 > 1, Remark 3. There are key factors that impact the rate of convergence of FedGradMP in the number of communication rounds and the residual error in Theorem 5 as we discuss below. 1) Impact of parameters β1(i) and β2(i). For a fixed number of local iterations K, one can see that as the product of the two parameters β1(i) and β2(i) becomes small, the convergence rate κ improves (decreases). 4τ (i) increases or the A -RSS constant ̄ρ +(i) The product β1(i)β2(i) becomes small as the A -RSC constant ρ − decreases. Choosing a proper dictionary could often improve the RSC/RSS constants as shown in Section IV-D consequently leading to better convergence, which is also numerically demonstrated in Section V-B2. 2) Impact of the local iteration number K on the convergence rate. Increasing the local iteration number K also makes the convergence rate κ decrease when all the terms (1 + η2)2β1(i)β2(i) are less than 1. To see this, recall that the convergence rate is given by 4τ κ = (2η 2 3 + 2) N ∑ i=1 (cid:2)(1 + η2)2β1(i)β2(i)(cid:3)K . pi (cid:2)(1 + η2)2β1(i)β2(i)(cid:3)K, improving the In this case, increasing K leads to the decay of each term in ∑N convergence rate. It is possible, however, some of the terms in the sum (1 + η2)2β1(i)β2(i) exceed 1, while (cid:2)(1 + η2)2β1(i)β2(i)(cid:3)K is still less than 1 for small K, making the convergence rate less than the sum ∑N 1. In this case, as we increase the local iteration number K, the largest term starts dominating the sum which could increase the convergence rate (even make it greater than 1 for large K), degrading the performance of FedGradMP. i=1 pi i=1 pi 3 +2)ν 1−κ ∑N 3) Impact of the local iteration number K on the residual error. i=1 pi The residual error (2η 2 1−μ(i)K 1−μ(i) depends on the local iteration number K in a more complicated way. Even when all terms (1 + η2)2β1(i)β2(i) are less than 1, in which case increasing K makes the convergence increases in rate κ decrease (making the factor K. Hence, the dependence of residual error on the local iteration number K may not be simple and this is actually what we observe in the numerical experiment in Section V-D. This is consistent with commonly accepted knowledge on the effect of the local iteration number on the residual error in the FL literature [10], [31], [52], [55], [61]: taking more local steps at clients makes the local estimates closer to the local solutions while the local estimates could deviate from the global solution in the FL environment in general. 1−κ in the residual error decrease), but the factor 1−μ(i)K 1−μ(i) 1 12 Remark 4 (Interpretation of Theorem 5). Theorem 5 states that the iterates of FedGradMP converge linearly up to the residual error of the solution x∗ as long as κ < 1. The size of the residual error is proportional to ν. In particular, from the expression for ν in Theorem 5, one can see that ν = 0 if the heterogeneity parameter ζ∗ = 0 and stochastic gradient noise σi = 0 for all i ∈ [N]. We take a look at the related scenarios in more detail below. • ζ∗ = 0 or ∇ fi(x∗) = 0 for all the client objective function fi. For example, the function fi could be the square loss for the noiseless observations of x∗ with sparsity level τ. • σi = 0 for all 1 ≤ i ≤ N holds if and only if ∇gi, j(x) = ∇ fi(x) almost surely for all τ-sparse vectors. This happens when the full batch of each client is used instead of mini-batches. In particular, when the projection operator is exact (η1 = 1) and under a slightly strong heterogeneity assumption, the residual error is statistically optimal. More precisely, under slightly strong heterogeneity assumptions only at the solution x∗ such as (cid:107)PΩ∇ fi(x∗) − PΩ∇ f (x∗)(cid:107)2 2 ≤ β 2(cid:107)PΩ∇ f (x∗)(cid:107)2 2, (12) where β > 0 and Ω is any subset of [d] with size 4τ, one can see that we have (cid:107)PΩ∇ f (x∗)(cid:107)2 (cid:107)PΩ∇ fi(x∗)(cid:107)2 2. max Ω⊂[d] |Ω|=4τ 2 ≤ 2(1 + β 2) max Ω⊂[d] |Ω|=4τ From Theorem 5, after a sufficient number of rounds, we have (cid:32)(cid:18) N ∑ i=1 E(cid:107)xt+1 − x∗(cid:107)2 ≤ (cid:2)E(cid:107)xt+1 − x∗(cid:107)2 ≤ O (cid:3)1/2 2 (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 (cid:19)1/2(cid:33) , pi max Ω⊂[d] |Ω|=4τ which is bounded from above by O max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ f (x∗)(cid:107)2 . This is the optimal statistical bias for commonly (cid:32) (cid:33) used FL data including sub-Gaussian data sets of size |D| that are independently generated for each client, for the sparse linear regression problem (when fi are the square loss which is of order of O functions). The uniform bounded heterogeneity condition, which is much stronger than (12) is used to show the optimal statistical recovery of Fast FedDualAvg [3]. See [3], [44], [52] for more details. (cid:16)(cid:113) τ log n N|D| (cid:17) • The parameter θ provides a trade-off between the convergence rate and the residual error due to the stochastic gradient. In particular, when the full batch is used (σi = 0), then one can set θ = ∞ giving the fastest convergence. • When σi (cid:54)= 0, the second term of the residual error ν is not vanishing in the number of rounds t. The similar term for FedHT/FedIterHT [52] decreases in t, but this requires that the mini-batch size at each client goes to infinity in t, which could severely restrict the number of communication rounds for the applicability of their theory. The idea of increasing the mini-batch size in the number of iterations is not new and has been used in [17], [62]. However, the settings for these works are not for FL and the rate of mini-batch size growth is moderate, whereas the growth rates of FedHT/FedIterHT need to be generally much higher – they grow exponentially in the number of local iterations at clients. This potential issue in FL methods based on exponentially increasing mini-batch sizes is also pointed out in [23]. Remark 5 (Comparisons between our results and previous works). Under strong convexity/smoothness assumptions for local objective functions fi, it has been proved that the methods based on FedAvg cannot converge linearly to the solution x∗ in general [31], [58]. As for general convex and smoothness conditions, the convergence to a neighborhood of x∗ is proven to be at most sublinear, whereas our work shows the linear convergence up to a small neighborhood under restricted convexity/smoothness assumptions. We want to make clear that we are not claiming that FedGradMP converges linearly to the x∗ but a small neighborhood of x∗ unless ζ∗ = 0 and σi = 0 for all i. Proof of Theorem 5. Let F (t) be the filtration by all the randomness up to the t-th communication round, which is all 2|F (t)(cid:105) the selected mini-batch indices at all the client up to the t-th round. We begin with analyzing E , the expected error of the global iterate xt+1 at the (t + 1)-th round and x∗ conditioned on F (t). Because we will *|F (t)(cid:105) (cid:104) work with this conditional expectation until the very end of the proof, by abusing the notation slightly, E will be denoted by E[*]. (cid:104) (cid:107)xt+1 − x∗(cid:107)2 13 E(cid:107)xt+1 − x∗(cid:107)2 2 = E pix(i) t,K+1 pix(i) t,K+1 + pix(i) t,K+1 − x∗ (cid:13) (cid:13) (cid:13) PΛs (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) PΛs (cid:13) (cid:13) (cid:32) N ∑ i=1 (cid:32) N ∑ i=1 (cid:32) N ∑ i=1 (cid:13) (cid:13) Hτ (cid:13) (cid:13) (cid:13) ≤ 2E ≤ 2η 2 3 E (cid:33) − N ∑ i=1 (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 N ∑ i=1 (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) N ∑ i=1 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) N ∑ i=1 + 2E pix(i) t,K+1 − x∗ (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 pix(i) t,K+1 + 2E pix(i) t,K+1 − x∗ pix(i) t,K+1 (cid:33) − N ∑ i=1 pix(i) t,K+1 (cid:33) − pix(i) t,K+1 N ∑ i=1 (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 ≤ (2η 2 3 + 2)E pix(i) t,K+1 − x∗ = (2η 2 3 + 2)E N ∑ i=1 pix(i) t,K+1 − N ∑ i=1 pix∗ (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 N ∑ i=1 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) N ∑ i=1 ≤ (2η 2 3 + 2) piE(i) JK t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 (13) where the second inequality follows from the definition of the approximation projector operator, the third follows from the fact that both x∗ and Hτ is the best τ-sparse t,K+1 with respect to the dictionary A , and the last one is obtained by applying the approximation of ∑N Jensen's inequality. are τ-sparse but Hτ (cid:16) i=1 pix(i) ∑N (cid:16) i=1 pix(i) ∑N i=1 pix(i) t,K+1 t,K+1 (cid:17) (cid:17) After applying Lemma 2, 3, and 4 sequentially to (13), we obtain N ∑ i=1 piE(i) JK t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 (14) ≤ (1 + η2)2 ≤ (1 + η2)2 = (1 + η2)2 ≤ (1 + η2)2 = (1 + η2)2 N ∑ i=1 N ∑ i=1 N ∑ i=1 N ∑ i=1 N ∑ i=1 piE(i) JK (cid:13) (cid:13)b(i) (cid:13) t,K − x∗(cid:13) 2 (cid:13) (cid:13) 2 (cid:104) β1(i)E(i) JK pi (cid:107)P⊥ (cid:98)Γ (b(i) t,K − x∗)(cid:107)2 (cid:105) 2 + ξ1(i) piβ1(i)E(i) JK−1, jK (cid:107)P⊥ (cid:98)Γ (b(i) t,K − x∗)(cid:107)2 2 + (1 + η2)2 N ∑ i=1 piξ1(i) piβ1(i) (cid:104) β2(i)E(i) JK−1 (cid:107)x(i) t,K − x∗(cid:107)2 (cid:105) 2 + ξ2(i) + (1 + η2)2 N ∑ i=1 piξ1(i) piβ1(i)β2(i)E(i) JK−1 (cid:107)x(i) t,K − x∗(cid:107)2 2 + (1 + η2)2 N ∑ i=1 pi (β1(i)ξ2(i) + ξ1(i)) . (15) First, the term ξ1(i) can be bounded as follows: ξ1(i) = 2(E(i) ̄ρ +(i) 4τ JK , j(cid:107)P (2ρ − (cid:98)Γ∇gi, j(x∗)(cid:107)2 2) 4τ (i) − ̄ρ +(i) ) 4τ ≤ ̄ρ +(i) 4τ 4 4τ (i) − ̄ρ +(i) 4τ (2ρ −    max Ω⊂[d] |Ω|=4τ ) (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + σ 2 i    This is from the property of the projection operator and (7) in Assumption 4 implying E(i) j (cid:107)P (cid:98)Γ∇gi, j(x) − P (cid:98)Γ∇ fi(x)(cid:107)2 2 ≤ E(i) j (cid:107)∇gi, j(x) − ∇ fi(x)(cid:107)2 2 ≤ σ 2 i , so we have E(i) j (cid:107)P (cid:98)Γ∇gi, j(x∗)(cid:107)2 2 ≤ 2(E(i) j (cid:107)P (cid:98)Γ∇ fi(x∗)(cid:107)2 2 + σ 2 i ) ≤ 2    max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + σ 2 i    . 14 Hence, each term β1(i)ξ2(i) + ξ1(i) in (15) can be bounded as below. β1(i)ξ2(i) + ξ1(i)  ≤ β1(i)   8 (ρ − 4τ (i))2 max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 +   2θ 2 +  (cid:113) 6 η 2 1 − 1 η1 (cid:113) 6   σ 2 i + η 2 1 − 1 η1 1 ρ − 4τ (i) (cid:107)∇ fi (x∗) (cid:107)2 2      + ̄ρ +(i) 4τ 4 4τ (i) − ̄ρ +(i) 4τ (2ρ −    max Ω⊂[d] |Ω|=4τ ) (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + σ 2 i    (cid:32) ≤ 8β1(i) (ρ − 4τ (i))2 + ̄ρ +(i) 4τ 4 4τ (i) − ̄ρ +(i) (2ρ − 4τ (cid:113)  (cid:33) ) max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + 6 β1(i) ρ − 4τ (i) (cid:113) η 2 1 − 1 η1 (cid:107)∇ fi (x∗) (cid:107)2 2  +  β1(i) ρ − 4τ (i)  2θ 2 + 6 η 2 1 − 1 η1 4 4τ (i) − ̄ρ +(i) 4τ (2ρ −   σ 2 i . )  + ̄ρ +(i) 4τ By plugging the above bound to (15), we have N ∑ i=1 piE(i) JK t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 piβ1(i)β2(i)E(i) JK−1 (cid:107)x(i) t,K − x∗(cid:107)2 2 (16) ≤ (1 + η2)2 + (1 + η2)2 + (1 + η2)2 N ∑ i=1 N ∑ i=1 N ∑ i=1  (cid:32) pi   8β1(i) (ρ − 4τ (i))2 +  pi  β1(i) ρ − 4τ (i)  2θ 2 + 4 ̄ρ +(i) 4τ (cid:113) 6 (2ρ − 4τ (i) − ̄ρ  η 2 1 − 1 η1  + ̄ρ +(i) 4τ Now consider first the case when η1 > 1. Then, since max Ω⊂[d] |Ω|=4τ N ∑ i=1 piE(i) JK (cid:13) t,K+1 − x∗(cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 piβ1(i)β2(i)E(i) JK−1 (cid:107)x(i) t,K − x∗(cid:107)2 2 (cid:33) +(i) 4τ ) max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + (cid:113) 6 η 2 1 − 1 η1 β1(i) ρ − 4τ (i) (cid:107)∇ fi (x∗) (cid:107)2 2      σ 2 i . 4 (2ρ − 4τ (i) − ̄ρ ) +(i) 4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 ≤ (cid:107)∇ fi (x∗) (cid:107)2 2, we have ≤ (1 + η2)2 N ∑ i=1 + (1 + η2)2 + (1 + η2)2 N ∑ i=1 N ∑ i=1 ≤ (1 + η2)2 N ∑ i=1  pi   pi  + 8β1(i) (ρ − 4τ (i))2  2θ 2 + β1(i) ρ − 4τ (i) 4 4τ (i) − ̄ρ +(i)  4τ ̄ρ +(i) (2ρ − 4τ (cid:113) 6 η 2 1 − 1 η1  + ̄ρ +(i) 4τ β1(i) ρ − 4τ (i) + ) (cid:113) 6 η 2 1 − 1 η1   (cid:107)∇ fi (x∗) (cid:107)2 2 4 4τ (i) − ̄ρ +(i) 4τ (2ρ −   σ 2 i ) piβ1(i)β2(i)E(i) JK−1 (cid:107)x(i) t,K − x∗(cid:107)2 2 + (1 + η2)2 max i   8β1(i) (ρ − 4τ (i))2 + ̄ρ +(i) 4τ 4 4τ (i) − ̄ρ +(i) 4τ (2ρ − 15 6 β1(i) ρ − 4τ (i) + ) (cid:113) η 2 1 − 1 η1   N ∑ i=1 pi(cid:107)∇ fi (x∗) (cid:107)2 2 + (1 + η2)2  pi  N ∑ i=1 β1(i) ρ − 4τ (i)  2θ 2 + 6 (cid:113) η 2 1 − 1 η1   + ̄ρ +(i) 4τ 4 4τ (i) − ̄ρ +(i) 4τ (2ρ −   σ 2 i . ) Let μ(i) = (1 + η2)2β1(i)β2(i) and  ν = (1 + η2)2 max i  + (1 + η2)2  pi  N ∑ i=1 Hence, when η1 > 1, we have β1(i) ρ − 4τ (i) + ) (cid:113) 6 η 2 1 − 1 η1   ζ 2 ∗ (2ρ − 4 4τ (i) − ̄ρ +(i)  4τ + 8β1(i) (ρ − 4τ (i))2  2θ 2 + β1(i) ρ − 4τ (i) ̄ρ +(i) 4τ (cid:113) 6 η 2 1 − 1 η1  + ̄ρ +(i) 4τ 4 4τ (i) − ̄ρ +(i) 4τ (2ρ − N ∑ i=1 piE(i) JK t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 ≤ N ∑ i=1 piμ(i)E(i) JK−1 (cid:107)x(i) t,K − x∗(cid:107)2 2 + ν.   σ 2 i . ) (17) The case when the projection operator for the gradient is exact (η1 = 1) follows the same argument. Setting η1 = 1 in the inequality (16) reduces the inequality to N ∑ i=1 piE(i) JK t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 ≤ (1 + η2)2 + (1 + η2)2 N ∑ i=1 N ∑ i=1 piβ1(i)β2(i)E(i) JK−1 (cid:107)x(i) t,K − x∗(cid:107)2 2 (cid:32) pi 8β1(i) (ρ − 4τ (i))2 + ̄ρ +(i) 4τ 4 4τ (i) − ̄ρ +(i) 4τ (2ρ − (cid:33) ) max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + (1 + η2)2 (cid:34) 2 pi N ∑ i=1 β1(i) ρ − 4τ (i) θ 2 + 4 4τ (i) − ̄ρ +(i) 4τ (2ρ − (cid:35) σ 2 i ) ̄ρ +(i) 4τ (cid:107)x(i) piβ1(i)β2(i)E(i) JK−1 t,K − x∗(cid:107)2 2 ≤ (1 + η2)2 N ∑ i=1 + (1 + η2)2 max i (cid:32) 8β1(i) (ρ − 4τ (i))2 + ̄ρ +(i) 4τ 4 4τ (i) − ̄ρ +(i) 4τ (2ρ − (cid:33) N ∑ i=1 ) pi max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + (1 + η2)2 (cid:34) 2 pi N ∑ i=1 β1(i) ρ − 4τ (i) θ 2 + ̄ρ +(i) 4τ 4 4τ (i) − ̄ρ +(i) 4τ (2ρ − (cid:35) ) σ 2 i . The bound for ν for the exact projection case (η1 = 1) is given as below. (cid:33) N ∑ i=1 ν = (1 + η2)2 max 8β1(i) (ρ − 4τ (i))2 4 4τ (i) − ̄ρ +(i) ̄ρ +(i) 4τ (2ρ − (cid:32) + 4τ ) i pi max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + (1 + η2)2 (cid:34) 2 pi N ∑ i=1 β1(i) ρ − 4τ (i) θ 2 + 4 4τ (i) − ̄ρ +(i) 4τ (cid:35) σ 2 i . ̄ρ +(i) 4τ Then, applying the bound (17) to (13) repeatedly using the induction argument on K, we have (cid:33) (2ρ − ) E(cid:107)xt+1 − x∗(cid:107)2 2 ≤ (2η 2 3 + 2) (cid:104) E(i)μ(i)K(cid:107)x(i) t,1 − x∗(cid:107)2 2 (cid:105) + pi (cid:32) N ∑ i=1 (cid:32) N ∑ i=1 = (2η 2 3 + 2)E N ∑ i=1 pi ν(1 − μ(i)K) 1 − μ(i) (cid:33) ν(1 − μ(i)K) 1 − μ(i) (cid:2)μ(i)K(cid:107)xt − x∗(cid:107)2 2 (cid:3) + pi N ∑ i=1 pi 16 = κ(cid:107)xt − x∗(cid:107)2 2 + (2η 2 3 + 2)ν N ∑ i=1 pi (1 − μ(i)K) 1 − μ(i) , where the first equality follows from x(i) t,1 = xt and the second follows from κ = (2η 2 3 + 2) N ∑ i=1 piμ(i)K = (2η 2 3 + 2) N ∑ i=1 (cid:2)(1 + η2)2β1(i)β2(i)(cid:3)K . pi Now, taking the unconditional expectation on both sides of the above yields (cid:104) E (cid:104) (cid:107)xt+1 − x∗(cid:107)2 E (cid:2)(cid:107)xt+1 − x∗(cid:107)2 (cid:3) = E 2 ≤ κE (cid:104) E (cid:104) (cid:107)xt − x∗(cid:107)2 2|F (t)(cid:105)(cid:105) 2|F (t−1)(cid:105)(cid:105) + (2η 2 3 + 2)ν N ∑ i=1 pi (1 − μ(i)K) 1 − μ(i) . By applying this result repeatedly, we obtain E(cid:107)xt+1 − x∗(cid:107)2 2 ≤ κt+1(cid:107)x0 − x∗(cid:107)2 2 + (2η 2 3 + 2)ν 1 − κ N ∑ i=1 pi 1 − μ(i)K 1 − μ(i) . Corollary 6. Under the same conditions and notation in Theorem 5, we have E f (xt+1) ≤ f (x∗) + 1 2ρ (cid:107)∇ f (x∗)(cid:107)2 2 + ρ (cid:34) κt+1(cid:107)x0 − x∗(cid:107)2 2 + (2η 2 3 + 2)ν 1 − κ N ∑ i=1 pi 1 − μ(i)K 1 − μ(i) (cid:35) , where ρ = ∑N i=1 pi ̄ρ +(i) τ . See Appendix for the proof of Lemma 6. A. Inexact FedGradMP IV. DISCUSSION AND EXTENSIONS x In FedGradMP, each client solves the minimization problem argmin (cid:98)Γ) to update the support estimate of the solution x∗. When a closed-form solution exists to the minimization problem such as the least squares problem and the sparsity level τ is relatively small compared with the signal dimension, an exact minimizer can be obtained efficiently. This can be achieved, for example, by computing the pseudo-inverse with respect to a τ-dimensional subspace R(A (cid:98)Γ) or by algorithms based on Cholesky, QR factorizations, or SVD for the least squares problem [18], [53]. fi(x) over a subspace R(A But for the other cases, although the sub-optimization problem is typically convex due to the A -RSC assumption, one may still want to reduce the computational cost in the optimization. By solving it only approximately but with a desired accuracy, we can save computational resources further. Because the local loss function fi for the i-th client satisfies the A -RSC and A -RSS properties with the respective constants ρ − fi is strongly convex/smooth with the same constants on the domain of the minimization problem, the linear subspace R(A (cid:98)Γ). fi(x) Recall that |Di| is the number of data points at the i-th client. We define a δ -approximate solution to argmin with x ∈ R(A 2 ≤ δ 2 where bopt is its exact solution. The number of steps required to achieve a δ -approximate solution at client i using popular standard algorithms is shown as follows: τ (i) and ̄ρ +(i) , x τ (cid:98)Γ) as a vector b such that (cid:107)b − bopt(cid:107)2 (cid:18) (cid:19) (cid:1) (cid:18) (cid:19) • Gradient descent (GD): O |Di| +(i) ̄ρ τ ρ − τ (i) log (cid:0) 1 δ [43]. • Stochastic gradient descent with variance reduction such as SAG or SVRG: O [48]. (cid:18) +(i) |Di| + ̄ρ τ ρ − τ (i) (cid:19) (cid:1) log (cid:0) 1 δ [29], Since the domain is a τ-dimensional space, the computational complexity per data point of the above algorithms is O(τ) for the squared or logistic loss, so the overall complexity of the local step to compute a δ -approximate 17 Algorithm 2 Inexact FedGradMP with partial participation Input: The number of rounds T , the number of clients N, the cohort size L, the number of local iterations K, weight vector p, the estimated sparsity level τ, η1, η2, η3, δ . Output: ˆx = xT . Initialize: x0 = 0, Λ = /0. for t = 0, 1, . . . , T − 1 do Randomly select a subset St of clients with size L for each client i in St , do x(i) t,1 = xt for k = 1 to K do t,k, η1) Select a mini-batch index set jk := i(i) Calculate the stochastic gradient r(i) Γ = approx2τ (r(i) (cid:98)Γ = Γ ∪ Λ Solve b(i) x Λ = approxτ (b(i) t,k, η2) t,k+1 = PΛ(b(i) x(i) t,k) (cid:16) (cid:16) x(i) x(i) t,k+1 ← ΠR t,k+1 t,k = argmin x ∈ R(A fi(x), (cid:17) (cid:17) t,k uniformly at random from {1, 2, . . . , M} t,k = ∇gi, jk (cid:17) (cid:16) x(i) t,k (cid:98)Γ) up to accuracy δ [Optional projection onto a ball] end for end for (cid:16) i=1 pix(i) ∑N Λs = approxτ t,K+1, η3 (cid:16) (cid:17) i=1 pix(i) ∑N (cid:17) xt+1 = PΛs (cid:16) t,K+1 (cid:17) xt+1 ← ΠR (xt+1) [Optional projection onto a ball] end for (cid:18) (cid:18) +(i) ̄ρ τ ρ − τ (i) log (cid:0) 1 δ (cid:19)(cid:19) (cid:1) |Di|τ solution is O for GD. For Newton's method, the total computational cost to achieve a δ - approximate solution is roughly O (cid:0)(|Di|τ 2 + τ 3) log (cid:0) 1 (cid:1)(cid:1) [43]. Hence, if the sparsity level τ is much smaller than the signal dimension n, the subproblem in FedGradMP can be solved efficiently up to accuracy δ . As a comparison, fi(x) over the whole space Rn, which would most FL methods run (stochastic) gradient descent to solve argmin δ x cost computationally more to acquire its δ -approximate solution. Theorem 7. Under the same notation and assumptions as in Theorem 5, for any θ > 0, the expectation of the recovery error at the (t + 1)-th round of inexact FedGradMP described in Algorithm 2 obeys E(cid:107)xt+1 − x∗(cid:107)2 2 ≤ κt+1(cid:107)x0 − x∗(cid:107)2 2 + (2η 2 3 + 2)(ν + δ 2) 1 − κ N ∑ i=1 pi 1 − μ(i)K 1 − μ(i) , where κ = (2η 2 3 + 2) N ∑ i=1 (cid:2)2(1 + η2)2β1(i)β2(i)(cid:3)K pi and μ(i) = 2(1 + η2)2β1(i)β2(i). Here, the parameters β1(i), β2(i), and ν are the same as in Theorem 5. See Appendix for the proof of Theorem 7. B. Client sampling and the impact of cohort size In practical FL scenarios, it may not be possible for all of the clients to participate in each communication round. This could particularly stand out when there are a large population of clients or the communication bandwidth 18 of connections between the server and clients is limited. A common theoretical assumption to capture this partial client participation is that participating clients for each communication round are drawn randomly according to some probability distribution, independent with other rounds. It could be considered as client sampling as noted in [55]. One could also consider more sophisticated sampling strategies such as importance sampling, but it seems to be not easy to implement such sampling techniques for FL since it could leak the private information of the client data sets [11]. Furthermore, in many real-world scenarios, client availability (which is usually random) solely controls participation rather than the server, ruling out the potential of using such methods [8]. For simplicity, we assume that the weight pi is 1/N in the global objective function f and a fixed number of clients (the cohort size) participate per round as in [20] to study the impact of the cohort size. Theorem 8. Assume the uniform weights pi = 1/N and L participating clients are drawn uniformly at random over the client set without replacement per round. Then, under the same assumptions and notation in Theorem 5, for any θ > 0, the expectation of the recovery error is bounded from above by where and E(cid:107)xt+1 − x∗(cid:107)2 2 ≤ κt+1(cid:107)x0 − x∗(cid:107)2 2 + (2η 2 3 + 2) ̃ν(1 − μ K) (1 − μ)(1 − κ) , κ = (2η 2 3 + 2) max S⊂[N] |S|=L 1 L ∑ i∈S (cid:2)(1 + η2)2β1(i)β2(i)(cid:3)K , μ = max i∈[N] (cid:2)(1 + η2)2β1(i)β2(i)(cid:3)K , (1 + η2)2 maxi +(1 + η2)2 1 L 8β1(i) 4τ (i))2 + (ρ − (cid:20) N β1(i) ∑ ρ − 4τ (i) i=1 ̄ρ +(i) 4τ (cid:18) 4 (2ρ − 4τ (i)− ̄ρ √ 2θ 2 + 6 +(i) ) 4τ η 2 1 −1 η1 (cid:18) (cid:18) ̃ν = (1 + η2)2 max i √ 6 η 2 1 −1 η1 (cid:19) ζ 2 ∗ 4 (2ρ − 4τ (i)− ̄ρ +(i) 4τ ) ̄ρ +(i) 4τ + β1(i) ρ − 4τ (i) (cid:19) +    1 N (cid:19) ) N ∑ i=1 4 (2ρ − 4τ (i)− ̄ρ +(i) 4τ ̄ρ +(i) 4τ 8β1(i) 4τ (i))2 + (ρ − (cid:20) β1(i) 2θ 2 ρ − 4τ (i) N ∑ i=1 + 4 (2ρ − 4τ (i)− ̄ρ +(i) 4τ ) ̄ρ +(i) 4τ max Ω⊂[d] |Ω|=4τ (cid:21) σ 2 i (cid:107)PΩ∇ fi(x∗)(cid:107)2 2   if η1 = 1. +(1 + η2)2 1 L    (cid:21) σ 2 i , if η1 > 1,  . See Appendix for the proof of Theorem 8. Remark 6. Note that the convergence rate κ of FedGradMP improves (decreases) as the cohort size L increases in Theorem 8, aligning with some of the previous works about the impact of cohort size on the convergence speed [59]. Our numerical experiments in Section V-E also validate our theory about the impact of cohort size on the convergence rates. On the other hand, it appears that the residual error in Theorem 8 is pessimistic and the actual behavior of FL algorithms depends on the cohort size in a more complicated way. See Section V-E for the numerical experiment and discussion. C. FedGradMP with a constraint Many machine learning problems can be formulated as an (cid:96)2-norm constrained optimization problem [36], [50], [61]. Since we focus on the FL setting with a sparse structure, our goal is to solve the following problem: min x∈Rn f (x) = N ∑ i=1 pi fi(x) subject to (cid:107)x(cid:107)0,A ≤ τ, (cid:107)x(cid:107)2 ≤ R, (18) for some R > 0, which is our main optimization problem (1) with the additional (cid:96)2 constraint (cid:107)x(cid:107)2 ≤ R. The (cid:96)2 constraint ensures the global minimum exists in the domain. Another advantage of using the (cid:96)2-norm constraint is that its orthogonal projection computationally is cheaper than projections of other constraints such as the (cid:96)1-norm [50]. We denote by ΠR the orthogonal projection of a vector to the set {(cid:107)x(cid:107)2 ≤ R}, which is implemented as follows. For any vector u ∈ RN, ΠR(u) = (cid:40) u, Ru/(cid:107)u(cid:107)2, otherwise. if (cid:107)u(cid:107)2 ≤ R; 19 Let x∗ be a minimizer of the problem (18) and the heterogeneity at the solution x∗ is defined as in Assumption 3. By executing additional steps, the projection to a (cid:96)2-norm ball in Algorithm 2, FedGradMP converges to the solution x∗ under the same conditions in Theorem 5, 7, and 8. The proof follows a simple modification of the proofs of the theorems due to the fact that the orthogonal projection of a vector u to a ball with radius R does not increase the (cid:96)2-norm distance between u and v for a vector v in the ball. For instance, we replace (14) in the proof of Theorem 5 as follows. N ∑ i=1 piE(i) JK 2 (cid:13) (cid:13) 2 t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) (cid:13) (cid:13) (cid:13)ΠR (cid:16) PΛs piE(i) JK piE(i) JK (cid:13) (cid:13) (cid:13)PΛs (cid:17) (cid:16) b(i) t,K = ≤ N ∑ i=1 N ∑ i=1 ≤ (1 + η2)2 N ∑ i=1 piE(i) JK (cid:16) b(i) t,K (cid:17)(cid:17) − x∗(cid:13) 2 (cid:13) (cid:13) 2 − x∗(cid:13) 2 (cid:13) (cid:13) 2 t,K − x∗(cid:13) 2 (cid:13) (cid:13) 2 (cid:13) (cid:13)b(i) (cid:13) , where we have used the fact that x∗ belongs the (cid:96)2-norm ball with radius R and the aforementioned property of ΠR in the first inequality above. Similarly, note that all the local iterates satisfy (cid:107)x(i) t,K+1(cid:107)2 ≤ R because of the projection to the ball in Algorithm 2. Thus, their convex combination ∑N i=1 pix(i) Now we apply the same argument to the first step of the proof of Theorem 5 t,K+1 also belongs to the ball. E(cid:107)xt+1 − x∗(cid:107)2 2 = E (cid:32) PΛs (cid:32) PΛs (cid:32) N ∑ i=1 (cid:32) N ∑ i=1 ΠR (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) PΛs (cid:13) (cid:13) ΠR ≤ 2E ≤ 2E pix(i) t,K+1 (cid:33)(cid:33) − N ∑ i=1 pix(i) t,K+1 + pix(i) t,K+1 − x∗ (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 (cid:33)(cid:33) pix(i) t,K+1 − N ∑ i=1 pix(i) t,K+1 + 2E pix(i) t,K+1 − x∗ (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) N ∑ i=1 (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 (cid:32) N ∑ i=1 pix(i) t,K+1 (cid:33) − N ∑ i=1 pix(i) t,K+1 (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 + 2E pix(i) t,K+1 − x∗ (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 . N ∑ i=1 (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) N ∑ i=1 After these modifications, we proceed as in the rest of the proof of Theorem 5. D. Impact of dictionary choice 4τ (i) and ̄ρ +(i) Recall that our convergence guarantees depend on the restricted convexity/smoothness (A -RSC, A -RSS) con- stants ρ − as many works for sparse recovery [16], [42], [44], [52]. In particular, the product β1(i)β2(i) in Theorems 5, 7, and 8 critically impact the convergence rate κ; for faster convergence, β1(i) and β2(i) should be 4τ (i) and ̄ρ +(i) small as stated in Remark 3. This can be achieved especially when the A -RSS/A -RSC constants ρ − are close to each other or their ratio (the restricted condition number) is close to 1. 4τ 4τ Sparse linear regression: When the local objective function is the square loss function associated with the local data set at the client, the A -RSC and A -RSS constants essentially reduce to the restricted isometry property (A -RIP) [4], [14]. Indeed, let the square loss function be given by h(x) = 1 2 where the rows of matrix B ∈ Rl×m are the input data vectors denoted by bi and y is the observation vector. Assume that (cid:107)bi(cid:107)2 = 1 for all 1 ≤ i ≤ l, which can be done by normalizing the data vector bi and corresponding yi. Since the function h is the square loss function, by looking into its Hessian, we study the restricted strong convexity (RSC) and smoothness (RSS) properties. The Hessian ∇2h of h is given by 2l (cid:107)Bx − y(cid:107)2 BT B. 1 l The RSC and RSS constants are the largest c ≥ 0 and the smallest d ≥ 0 such that c(cid:107)w − z(cid:107)2 z) ≤ d(cid:107)w − z(cid:107)2 2 for all vectors w and z such that (cid:107)w − z(cid:107)0 ≤ τ. 2 ≤ (w − z)T (cid:0) 1 l BT B(cid:1) (w − 20 This observation and the definition of RIP [16] imply that if the RIP constant of B is at least δ then (1 − 2 for all τ-sparse vectors z, making it satisfy the RSC/RSS with constants 1 − δ 1√ l 2 ≤ zT (cid:0) 1 δ )(cid:107)z(cid:107)2 and 1 + δ respectively. l BT B(cid:1) z ≤ (1 + δ )(cid:107)z(cid:107)2 It could be possible, however, that the data matrix B whose rows consist of the local data at each client may not satisfy RSC with respect to the standard basis, but RSC with respect to a certain dictionary A . Put it differently, if h is not restricted strong convex for τ-sparse vectors, then B(w − z) = 0 for some vectors w and z such that (cid:107)w − z(cid:107)0 ≤ τ or Bu = 0 for some τ-sparse vector u, i.e., B is not τ-RIP. We present our idea of simply using a random Gaussian dictionary A to improve the ratio RSS to RSC constants 2 (or improve the A -RIP constant of B with respect to a dictionary 2l (cid:107)BAx − y(cid:107)2 of the associated new loss function 1 A) with high probability. Our idea to improve the RIP with a random dictionary is based on a recent development in high dimensional geometry. More specifically, we use the following theorem from [28]. Theorem 9 (Theorem 1.1 in [28]). Let B ∈ Rl×m be a fixed matrix, let A ∈ Rm×n be a mean zero, isotropic and sub-Gaussian matrix with sub-Gaussian parameter K and let T ⊂ Rn be a bounded set. Then (cid:12) (cid:12) (cid:12)(cid:107)BAx(cid:107)2 − (cid:107)B(cid:107)F (cid:107)x(cid:107)2 (cid:12) (cid:12) ≤ CK(cid:112) (cid:12) E sup x∈T log K (cid:107)B(cid:107) [w(T ) + rad(T )] , and with probability at least 1 − 3e−u2, (cid:12) (cid:12) ≤ CK(cid:112) (cid:12) Here w(T ) is the Gaussian width for the set T , rad(T ) = sup y∈T (cid:12) (cid:12) (cid:12)(cid:107)BAx(cid:107)2 − (cid:107)B(cid:107)F (cid:107)x(cid:107)2 sup x∈T log K (cid:107)B(cid:107) [w(T ) + u * rad(T )] . (cid:107)y(cid:107)2, and C is an absolute constant. The following is an immediate consequence of the above theorem and the well-known fact that w(T ) ≤ Cr(cid:112)τ log(n/τ) for the set T of all τ-sparse vectors x with (cid:107)x(cid:107) ≤ r for some universal constant C > 0. Corollary 10. Let r > 0 and B be the closed unit ball in Rn. For the set T of all τ-sparse vectors in rB and Gaussian random matrix A, we have |(cid:107)BAx(cid:107)2 − (cid:107)B(cid:107)F (cid:107)x(cid:107)2| ≤ C(cid:107)B(cid:107) (cid:104) r(cid:112) τ log(n/τ) + r (cid:105) , E sup x∈T and with probability at least 1 − 3e−u2, |(cid:107)BAx(cid:107)2 − (cid:107)B(cid:107)F (cid:107)x(cid:107)2| ≤ C(cid:107)B(cid:107) sup x∈T (cid:104) r(cid:112) τ log(n/τ) + ru (cid:105) . Since both terms in the bounds in Corollary 10 are homogeneous in r for all x in T with (cid:107)x(cid:107)2 = r, the corollary τ log(n/τ) with high probability, whenever BA satisfies the RIP with a constant δτ = C1 (cid:107)B(cid:107)2 (cid:107)B(cid:107)2 F implies that matrix the stable rank of B 1 (cid:107)B(cid:107)F sr(B) := (cid:107)B(cid:107)2 F (cid:107)B(cid:107)2 ≥ C2τ log(n/τ) for a sufficiently large constant C2 > 0. The above corollary can be readily applied to the data matrix BDi in the local objective function fi = 1 2|Di| (cid:107)BDiAx− 2 for client i. First, recall that (cid:107)bi(cid:107)2 = 1 and by the definition of the Frobenious norm, (cid:107)BDi(cid:107)F = (cid:112)|Di|. The 1 (cid:107)BDi (cid:107)F y(cid:107)2 data matrix BDi may not satisfy the RIP in general but BDiA does with RIP constant BDiA = 1√ |Di| δτ = C (cid:107)BDi(cid:107)2 (cid:107)BDi(cid:107)2 F 2 is A -RSC and A -RSS with the constant ratio 1+δτ 2|Di| (cid:107)BDiAx − y(cid:107)2 1−δτ (cid:107)BDi(cid:107)2 |Di| τ log(n/τ) = C τ log(n/τ). 1 Thus, with high probability, with respect to the Gaussian random dictionary A, under the stable rank condition for BDi (which could be a mild condition for many data matrices). Since 1+δτ is close to 1 whenever the RIP constant δτ is close to 0, this makes β1(i) and 1−δτ β2(i) small, improving the convergence rate in Theorems 5 7, and 8 as we discussed before. Furthermore, note that since the Gaussian random matrix is statistically independent of the client data sets, there is no privacy leakage. 21 l ∑l Sparse binary logistic regression: The previous analysis for the square loss can be extended to the logistic losses. First, we consider the binary logistic loss function h(x) = 1 j x)) with input data vector b j and labels y j ∈ {−1, 1}. Assume that (cid:107)bi(cid:107)2 = 1 for all 1 ≤ i ≤ l and x is a τ-sparse vector with (cid:107)x(cid:107) ≤ r. Since the function h is twice-differentiable, we can study the RSC and RSS by investigating its Hessian. We denote the sigmoid function by s(z) = 1+exp(z) . By a direct computation or from the lecture notes https://www.cs.mcgill.ca/ ∼dprecup/courses/ML/Lectures/ml-lecture05.pdf, one can verify that Hessian ∇2h of the logistic loss function h is given by i=1 log(1 + exp(−2y jbT 1 l where B is the matrix whose rows bi consist of a client data set and Λ(x) is the diagonal matrix whose j-th diagonal entry is 4s(2bT BT Λ(x)B, ∇2h(x) = 1 j x)). First, it is easy to check that h is L-smooth [49] with j x)(1 − s(2bT L ≤ 1 l l ∑ i=1 max x 4s(2bT j x)(1 − s(2bT j x)) ≤ 1. Next, since x is a τ-sparse vector with (cid:107)x(cid:107)2 ≤ r, from the definition of the sigmoid function τ, we deduce [Λ(x)] j j ≥ (1+exp(r))2 . Then, we have 4 4 (1 + exp(r))2 * BT B l (cid:22) ∇2h = 1 l BT Λ(x)B (cid:22) BT B l . Note that the above bound does not imply that h is RSC since it is possible that Bx = 0 for some τ-sparse vector x. However, if we use a random Gaussian dictionary A, then a similar derivation gives AT BT BA l 4 (1 + exp(r))2 * AT BT BA l AT BT Λ(x)BA (cid:22) (cid:22) ∇2h = 1 l . Collorary 10 implies that (cid:107)B(cid:107)F (cid:107)x(cid:107) −C(cid:107)B(cid:107)(cid:107)x(cid:107) (cid:104)(cid:112) τ log(n/τ) + u (cid:105) ≤ √ xT AT BT BAx ≤ (cid:107)B(cid:107)F (cid:107)x(cid:107) +C(cid:107)B(cid:107)(cid:107)x(cid:107) (cid:104)(cid:112) τ log(n/τ) + u (cid:105) for all τ-sparse vectors with probability at least 1 − 3e−u2 the previous bound on ∇2h yields that with high probability, h is A -RSS and A -RSC with the constant ratio . Finally, it is easy to check that applying this bound to (1 + exp(r))2 4  *  (cid:107)B(cid:107)F +C(cid:107)B(cid:107) (cid:107)B(cid:107)F −C(cid:107)B(cid:107) (cid:104)(cid:112)τ log(n/τ) + u (cid:104)(cid:112)τ log(n/τ) + u (cid:105) 2   (cid:105) , which is close to (1+exp(r))2 4 as long as the stable rank sr(B) = (cid:107)B(cid:107)2 F (cid:107)B(cid:107)2 (cid:29) τ log(n/τ). This implies that for any τ-sparse vector x with (cid:107)x(cid:107)2 ≤ r, the logistic loss function is A -RSC/A -RSS with respect to a random Gaussian dictionary with constant ≈ (1+exp(r))2 under a mild condition, even if the function is not 4 RSC/RSS in the standard basis (for example, the ratio is infinite if the RSC constant in the standard basis is 0). We apply the above argument to each binary logistic loss function fi. Note that since the RSC/RSS ratio can be understood as a restricted condition number that controls the convergence rates by Theorems 5, 7, and 8, a random Gaussian dictionary is appropriate for FedGradMP with an (cid:96)2-norm constraint that is discussed in Section IV-C. 22 Sparse multiclass logistic regression: We only highlight the difference between the multiclass and binary logistic regression cases since the arguments are very similar to each other. Consider the multinomial logistic regression function with K classes. The label yi j is 1 if the j-th training input belongs to the class i and 0 otherwise, b j are normalized data vectors (i.e., (cid:107)bi(cid:107)2 = 1), and x(i) are τ-sparse classifier vectors with (cid:107)x(i)(cid:107)2 ≤ r. The corresponding loss function is given as h(x(1), x(2), . . . , x(K)) = (cid:34) K ∑ i=1 l ∑ j=1 (cid:32) −yi jbT j x(i) + ln exp (cid:33)(cid:33)(cid:35) j x(i) bT . (cid:32) K ∑ i=1 Similar to the binary logistic regression case, the direct computation of the Hessian of h gives ∇2 x(i)h = 1 l BT Λ(x(i))B. Here Λ(x) is a diagonal matrix whose diagonal entries are defined as [Λ(x)] j j = s(bT j x)(1 − s(bT j x)), where 1 + ∑K By the same argument used for the sparse binary logistic regression, h is A -RSS and A -RSC with a constant ratio i x) s(bT j x) = exp(bT j x) i=1 exp(bT . (1 + K exp(2r))2 *   (cid:107)B(cid:107)F +C(cid:107)B(cid:107) (cid:107)B(cid:107)F −C(cid:107)B(cid:107) (cid:104)(cid:112)τ log(n/τ) + u (cid:104)(cid:112)τ log(n/τ) + u (cid:105) 2   (cid:105) . This again indicates that for any τ-sparse vector x with (cid:107)x(cid:107) ≤ r, the multiclass logistic loss function is A -RSC/A - RSS with respect to a random Gaussian dictionary even if it may not be RSC/RSS in the standard basis. As we saw in the binary logistic regression, this shows that it is beneficial to use a random Gaussian dictionary in logistic regression for (cid:96)2-norm constrained FedGradMP, which is also verified in our numerical experiments in Section V-B2. Remark 7 (Random dictionary). The idea of using a Gaussian random dictionary to improve the restricted condition number should be distinguished from the sketching in the FL literature [25], [47], [51]. Our formulation and analysis are fundamentally different from those for sketching schemes that focus on compressing the gradient to save communication cost between a server and clients. In these work [25], [47], [51], the sketching mappings (commonly random matrices) developed for numerical linear algebra [57] are applied after the clients computed the gradients to compress the information, whereas our Gaussian random mappings are used to transform the domain of the solution space to improve the restricted condition number. Remark 8 (Sharing the dictionary among clients). The server either broadcasts the dictionary to clients or the shared memory can be used to share the dictionary among clients as suggested in [22], [41]. When the latter option is available, the server does not need to send the dictionary to the clients. In this section, we provide numerical experiments validating our theory and showing the effectiveness of the V. NUMERICAL EXPERIMENTS proposed algorithm. A. FedGradMP for sparse linear regression 1) Synthetic dataset: 23 Fig. 1. Linear convergence of FedGradMP with for data sets with various heterogeneity levels. Experiment settings: The first numerical experiment uses synthetic data sets. We run FedGradMP (Algorithm 1) with the square loss function. More precisely, we consider the component function of the form fi = 1 2(cid:107)Di| (cid:107)ADix−yDi(cid:107)2 2 where ADi is the client i data matrix in R100×1000 whose elements are synthetically generated according to the normal distribution N (μi, 1/i1.1) with the mean value μi that is randomly generated from the mean-zero Gaussian with variance α. Here, yDi are observations with yDi = ADix# and x# ∈ R1000 is a randomly generated vector that is 10-sparse with respect to the standard basis whose 10 nonzero components are drawn from the unit sphere S ⊂ R10. Since the random mean μi obeys the normal distribution N (α, 0), the parameter α modulates the degree of client data heterogeneity: as α increases, the more likely μi vary wildly which in turn makes the client dataset distributions more different. This type of model is commonly used in FL numerical experiments to generate synthetic datasets [52], [55], [61] since randomly generated mean μi and decreasing variance 1/i1.1 make the client data set heterogeneous. The number of clients is 50, the number of data points of each client is 100, and the mini-batch size of each client for FedGradMP is 40. Simulation results: Figure 1 shows that FedGradMP converges linearly for various heterogeneity level α, val- idating Theorem 5. Note that the higher α is, the larger the variance of random mean shift μi or the higher the degree of heterogeneity is. The curves on the left panel are the relative error of FedGradMP for the noiseless case and the curves on the right are for the Gaussian noise case. We observe that FedGradMP still converges for highly heterogeneous data sets but with slower convergence rates in both cases. 2) Real data set: sparse video recovery: In this experiment, we test FedGradMP on video frame recovery from a real-world dataset. Our dataset is a xylophone video consisting of 120 frames from YouTube https://www.youtube. com/watch?v=ORipY6OXltY, which can be also downloaded from the MathWorks website https://www.mathworks. com/help/matlab/ref/videoreader.html. Each frame is of size 240 × 320 after the conversion to gray-scale frames. We reshape the 82-th frame as a vector in R76800 and our goal is to recover this frame. For this experiment, we use the K-SVD algorithm [2] to generate a dictionary Ψ ∈ R76800×50 consisting of 50 atoms that are trained over the first 80 frames. The number of clients to reconstruct this video frame is 50 and non i.i.d. random matrix of size 30 × 76800 is used for each client. More specifically, it is generated according to the normal distribution N (μi, 1/i0.9) where μi ∼ N (0, α = 0.5), similar to the one in Sections V-A and V-B1. Figure 2 shows one frame of the input image sequence on the left, the image recovered by FedGradMP + K- SVD in the middle, and the difference on the right. Considering that the sensing matrices for clients are highly heterogeneous, the recovered image quality is reasonably satisfactory. B. Comparison of FedGradMP with other FL algorithms 1) Federeated sparse linear regression: The next experiments illustrate FedGradMP outperforms other FL algorithms in both low and highly heterogeneous data environments. 24 02468101214161820Number of rounds10-1510-1010-5100Relative erroralpha:0.5alpha:1alpha:1.5alpha:2alpha:2.502468101214161820Number of rounds10-410-310-210-1100Relative erroralpha:1alpha:2alpha:3alpha:4alpha:5 Fig. 2. The difference of the two images is displayed on the right. Input image on the left: 82-th frame of the xylophone video. The output image of FedGradMP with K-SVD dictionary in the middle. Experiment settings: We compare FedGradMP with FedAvg, FedIterHT, FedMid, and FedDualAvg for the sparse linear regression or compressed sensing. The (cid:96)1 regularization hyperparameter for FedMid and FedDualAvg is 0.55. The client learning rates for FedAvg, FedIterHT, FedMid, and FedDualAvg are chosen by grid search with grid {0.01, 0.005, 0.001, 0.0005, 0.0001, 0.00005, 0.00001, 0.000005} to achieve their best performance. The number of clients is 50 and the mini-batch size of each client is 50. The loss function for client i is given by fi = 2|Di| (cid:107)ADix − yDi(cid:107)2 2, where yDi = ADix# + e are noisy measurements of a 15-sparse vector x# and e is a noise vector whose components are generated according to N (0, 0.005). 1 In the low-heterogeneity data experiments for Figure 3, the 100 × 1000 data matrices ADi are generated by the randomly shifted mean Gaussian model used for the experiments for Figure 1 with whose elements are synthetically generated according to N (μi, 1/i0.2) where μi ∼ N (0, α = 0.2). On the other hand, under the same setting as before but a higher value of the parameter α = 0.5 is used to generate the data matrices ADi to obtain a more heterogeneous client data set for the experiment for Figure 4. The previous two experiments are conducted for relatively low-sparsity level signals. The relative error curves in Figure 5 are obtained for a signal x# that 400-sparse under the same heterogeneous model as in Figure 4. Because of the high sparsity level (about the same order as the ambient dimension 1000), we run the Inexact-FedGradMP (Algorithm 2) with gradient descent to solve the sub-optimization problem more efficiently as we have discussed in Section IV. Simulation results: The plots for Figure 3 demonstrate FedGradMP converges faster than other methods in the number of communication rounds for a low heterogeneous environment both in the number of rounds and wall-clock time. FedIterHT converges linearly as shown in [52], but with a slower convergence rate than FedGradMP. FedMid and FedDualAvg also appear to converge as their theory suggest [35], [55], [61] but slower than FedGradMP. FedAvg is the slowest among all algorithms we tested and it generally does not produce a sparse solution. We also notice that FedGradMP offers the smallest residual error evidencing our theory that FedGradMP guarantees the optimal statistical bias in Remark 4. In the highly heterogenous environment setting, FedGradMP still performs well whereas other algorithms start degrading significantly, as we observe in the plots in Figure 4. As for the signals with higher sparsity levels, from the plots in Figure 5 show, we see that FedGradMP performs better than other baseline algorithms in terms of both criteria. 2) Logistic regression for Federated EMNIST dataset: Experiment settings: The data set we use is the Federated EMNIST-10 dataset (FEMNIST-10), a commonly used dataset to test FL algorithms. FEMNIST-10 is a collection of handwritten digits and 10 labels, grouped by writers. Each data point of FEMNIST-10 consists of a 28 × 28 gray-scale image and its label belongs to one of the 10 classes. Note that the dimension of solution space is 28 × 28 = 784. In the experiment, we use 350 clients, which is about 10% of the original dataset with 100 examples each. We split the data into a training dataset with 300 clients and a test dataset with 50 clients. The number of participating clients per round is 10 and the mini-batch size is 50. This is similar to the standard settings used for FL algorithm benchmark [3], [61]. We run the Inexact-FedGradMP with an (cid:96)2 norm constraint with 20 local iterations, in which we solve the sub-optimization problem in FedGradMP by SGD with 2 iterations. The number of local iterations 25 Fig. 3. FedGradMP outperforms other methods in a low data heterogeneous environment. Fig. 4. FedGradMP outperforms other methods in a high data heterogeneous environment. Fig. 5. FedGradMP outperforms other methods in a high data heterogeneous environment for high sparsity level signals. 26 0102030405060708090100Number of rounds10-410-310-210-1100Relative errorFedGradMPFedIterHTFedAvgFedMidFedDualAvg051015202530354045CPU Time10-410-310-210-1100Relative errorFedGradMPFedIterHTFedAvgFedMidFedDualAvg020406080100120140160180200Number of rounds10-310-210-1100Relative errorFedGradMPFedIterHTFedAvgFedMidFedDualAvg0102030405060708090100CPU Time10-310-210-1100Relative errorFedGradMPFedIterHTFedAvgFedMidFedDualAvg050100150200250300Number of rounds10-210-1100Relative errorFedGradMPFedIterHTFedAvgFedMidFedDualAvg020406080100120140160180200CPU Time0.30.40.50.60.70.80.91Relative errorFedGradMPFedIterHTFedAvgFedMidFedDualAvg Fig. 6. In both of experiments using the traning dataset (on the left) and the test dataset (on the right), the performance of FedGradMP is better than other baseline methods. Fig. 7. Training accuracy curves of FedGradMP for the FEMINST dataset with respect to the random Gaussian dictionary and the standard basis. |Di| ∑ j=1 (cid:20) 10 ∑ i=1 for FedIterHT, FedAvg, FedMid, FedDualAvg is 40. Note that the total number of the effective number of local iterations for all the algorithms is the same, 40 iterations. The number of communication rounds is 1000. (cid:18) (cid:18) 10 ∑ i=1 (cid:19)(cid:19)(cid:21) The local objective function fi(x(1), x(2), . . . , x(N)) = 1 |Di| class logistic regression function. Additionally, we use (cid:96)1 regularization with hyperparameter λ is chosen to be 0.0001 for FedMid and FedDualAvg as in [11], [61] and the (cid:96)2 ball constraint (cid:107)x(cid:107) ≤ 105 for FedGradMP. j x(i) + ln , the multi- −yi jbT j x(i) bT exp Simulation results: Figure 6 demonstrates that FedGradMP outperforms the baseline algorithms in terms of prediction accuracy on training and test datasets. Improving FedGradMP performance using random dictionaries: In this section, we show that FedGradMP com- bined with a random Gaussian dictionary empirically outperforms the one with the standard basis. The experiment settings are the same as the ones in Section V-B2 except we use the random Gaussian dictionary of size 200 × 784. As a comparison, we have also included the prediction accuracy curves of FedGradMP in Figure 6. The plot in Figure 7 indicates that FedGradMP + random Gaussian dictionary outperforms FedGradMP + the standard basis, supporting our theory in Section IV-D. 27 01002003004005006007008009001000Number of rounds0.750.80.850.90.95Training accuracyFedGradMPFedIterHTFedAvgFedMidFedDualAvg01002003004005006007008009001000Number of rounds0.750.80.850.90.95Test accuracyFedGradMPFedIterHTFedAvgFedMidFedDualAvg01002003004005006007008009001000Number of rounds0.750.80.850.90.95Training accuracyFedGradMP/Gaussian dictionaryFedGradMP/Standard basis01002003004005006007008009001000Number of rounds0.750.80.850.90.95Test accuracyFedGradMP/Gaussian dictionaryFedGradMP/Standard basis Fig. 8. FedIterHT with learning rates {0.0001, 0.0005, 0.001, 0.002, 0.004, 0.01, 0.02} for non i.i.d. data sets. C. Difficulties of tuning learning rates for FL methods As we saw in the numerical experiments, Section V-B1, other FL methods suffer especially in a highly heteroge- neous environment. This can be alleviated by tuning hyperparameters individually for each client such as learning rates, but it could be challenging or at least time-consuming. To showcase the difficulties of tuning the learning rates of FL methods, we study FedIterHT but we empirically observed the same phenomenon for other baseline algorithms. Another reason we tested FedIterHT is that it is actually the only method among baseline that aims to solve the sparsity-constrained problem (1) as ours. The convergence of FedIterHT in [52] strongly depends on the learning rates. Although they provide the learning rates that depend on the dissimilarity parameter and restricted strong convexity/smoothness parameters at the clients, they are quite often not available and difficult to estimate in practice since the data at clients are non i.i.d.. FedGradMP is free from this issue at least for sparse linear regression and is often still computationally efficient since clients only solve optimization problems over smaller spaces after the support estimation. Experiment settings: We run FedIterHT for the squared loss function with a randomly generated 10-sparse vector 2 where ADi is the client i data matrix in R100×1000 as ground truth. The local loss function fi = 1 whose elements are synthetically generated according to N (μi, 1/i1.1) with randomly generated mean μi from the mean-zero Gaussian with variance α = 1.0. This setting is similar to the synthetic dataset in [52] except we have common sparse ground truth. The number of clients is 30 with mini-batch size 40. The number of total data points m = 3000 and the dimension of solution space n = 1000. The client learning rate combinations for the experiment are {0.0001, 0.0005, 0.001, 0.002, 0.004, 0.01, 0.02}. 2(cid:107)Di| (cid:107)ADix − yDi(cid:107)2 Simulation results: If the learning rates are chosen from {0.004, 0.01, 0.02}, then the left plot in Figure 8 show that they quickly diverge from the optimal solution. On the other hand, the right panel in Figure 8 shows the relative error and squared loss curves for FedIterHT when the learning rate is in {0.0001, 0.0005, 0.001, 0.002}. For these smaller learning rates, the iterates of FedIterHT tend to converge to a highly suboptimal local solution. It has been observed in the literature [1] that approaches based on stochastic gradient descents combined with hard-thresholding (such as FedIterHT) suffer from such phenomena when the learning rates are chosen to be too small. Hence, our numerical experiments indicate that the learning rates should be chosen very carefully for each client. Working learning rates should depend on the statistics and heterogeneity of the local data set at the client. Obtaining this information could be challenging because it might not be available in general, so usually, a grid search is performed to find learning rates. On the other hand, the iterates of FedGradMP converge to the ground truth up to (almost) machine precision as shown in Figure 9 under the same setting, only in four rounds with three local iterations at the clients. Unlike FedIterHT, FedGradMP does not require fine tuning of learning rates per client. 28 01020304050607080Number of rounds10-5010010501010010150102001025010300Relative errorlearningRate :0.0001learningRate :0.0005learningRate :0.001learningRate :0.002learningRate :0.004learningRate :0.01learningRate :0.0202468101214161820Number of rounds10-1100101102Relative errorlearningRate :0.0001learningRate :0.0005learningRate :0.001learningRate :0.002learningRate :0.004learningRate :0.01learningRate :0.02 Fig. 9. FedGradMP for non i.i.d. data sets. D. Impact of the number of local iterations We provide numerical evidence supporting Theorem 5 about how the number of local iterations at clients affects the convergence rate and the residual error of FedGradMP. Experiment settings: The number of clients is 50, the dimension of solution space is 1000, the number of data points of each client is 100, the mini-batch size of each client is 30, and the cohort size is 50. The local objective function fi is the squared loss with associated data matrix ADi for client i, similar to the one used for the heterogeneous case with α = 2.5 in Section V-A. We run FedGradMP with local iterations 3, 6, 9, 12, 15 for noiseless and noisy setup (yDi = ADix# + e, where e is a Gaussian noise where each component are independently generated according to N (0, 4 × 10−6) ). Simulation results: We display the relative error curves of iterates of FedGradMP on the left and right panels of Figure 10 for noiseless and noisy case respectively. The error decay curves in the left plot for the noiseless case demonstrate that as we increase the number of local iterations at clients, FedGradMP converges faster or the convergence rates improve. The plot on the right for the noisy case also exhibits a similar pattern but with a few exceptions probably due to the noise. This supports our theory about the dependence of convergence rate κ on the number of local iterations in Theorem 5 as explained in Remark 3. As for the residual error of FedGradMP, we observe a general trend in the right panel that increasing the local iterations decreases the residual error, but this effect is not as noticeable as the convergence rate. This is somewhat expected since the residual error term in 5 depends on the local iteration numbers complicated way as explained in Remark 3. E. Impact of cohort size The next experiment illustrates how well FedGradMP performs when cohort size (the number of participating clients per round) varies. We notice that Figure 11 provides numerical evidence supporting Theorem 8 about how the cohort size affects the convergence rate and the residual error of FedGradMP. Experiment settings: The number of clients is 50, the dimension of solution space is 50 and we set the mini-batch size 30. The local objective function fi is the squared loss with associated non iid data matrix ADi for client i, similar to the one used for the heterogeneous case with α = 2.5 in Section V-A. We run FedGradMP with cohort size 10, 15, 20, 25, 30 for noiseless and noisy setup. Simulation results: The relative error curves of iterates of FedGradMP are given on the left panel (noiseless case) and right panels (noisy case) of Figure 11. These error plots indicate that the convergence rate improves as we increase the cohort size, for both noiseless and noisy cases as predicted in Theorem 8. On the other hand, a careful reader might have noticed that the residual error actually slightly increases as the cohort size increases. 29 12345678910Number of rounds10-1510-1010-5100Relative errorFedGradMP Fig. 10. The convergence rate improves as the local iterations at clients increase in Theorem 5. Fig. 11. The convergence rates improve as the cohort size increases as predicted in Theorem 8. Note that the residual errors in the right panel decay to zero (up to the machine precision) since all the non i.i.d. measurements are noiseless with the squared loss function. This implies that the dependence of our residual error bound on the cohort size in Theorem 8 is pessimistic and may not capture the true dependence as most of the other works in FL algorithm analysis. For more details, see the discussion and criticism on the gap between the current theoretical analyses of the impact of cohort size in FL algorithms and their empirical performance [9]. VI. CONCLUSION In this paper, we propose a novel federated stochastic gradient matching pursuit algorithm framework and show the linear convergence in expectation under certain assumptions of the objective function, including the dictionary restricted-RSS/RSC conditions and the unbounded dissimilarity assumption. For the sparse linear regression problem, our method does not require learning rate tuning at the client side, which could be challenging for existing baseline algorithms in highly heterogeneous data environments. Numerical experiments on large scale heterogeneous data sets such as EFMINIST and videos have shown the effectiveness of the proposed approach over the state-of-the-art federated learning algorithms. Our analysis reveals the benefits of adopting random dictionaries such as Gaussian random dictionary, which is also confirmed by our numerical experiments. 30 12345678910Number of rounds10-1610-1410-1210-1010-810-610-410-2100Relative errorLocal iteration number K:3Local iteration number K:6Local iteration number K:9Local iteration number K:12Local iteration number K:1512345678910Number of rounds10-310-210-1100Relative errorLocal iteration number K:3Local iteration number K:6Local iteration number K:9Local iteration number K:12Local iteration number K:1502468101214161820Number of rounds10-1610-1410-1210-1010-810-610-410-2100Relative errorCohort size n:10Cohort size n:15Cohort size n:20Cohort size n:25Cohort size n:3002468101214161820Number of rounds10-410-310-210-1100Relative errorCohort size n:10Cohort size n:15Cohort size n:20Cohort size n:25Cohort size n:30 DN is supported by NSF DMS 2011140 and NSF DMS 2108479. The research of Qin is supported by the NSF grant DMS-1941197. ACKNOWLEDGEMENTS APPENDIX A PROOFS Proof of Corollary 6. First, we recall that the global objective function f (x) = ∑N From Assumption 2 on the A -RSS property of gi, j with constant ρ + τ (i, j), we have i=1 pi fi(x) and fi(x) = 1 M ∑M j=1 gi, j(x). (cid:107)∇gi, j(x1) − ∇gi, j(x2)(cid:107)2 ≤ ρ + for all x1, x2 ∈ Rn with (cid:107)x1 − x2(cid:107)0,A ≤ τ. By Lemma 1, we have τ (i, j)(cid:107)x1 − x2(cid:107)2 (cid:10)∇gi, j(x1), x2 (cid:11) ≥ gi, j(x1 + x2) − gi, j(x1) − ρ + τ (i, j) 2 (cid:107)x2(cid:107)2 2. Taking average gi, j over j to recover fi and over i with probability pi to recover f , the above inequality implies that (cid:104)∇ f (x1), x2(cid:105) ≥ f (x1 + x2) − f (x1) − 1 2 N ∑ i=1 pi ̄ρ +(i) τ (cid:107)x2(cid:107)2 2. by ρ. Setting x2 = xt+1 − x∗ and x1 = x∗ in the above inequality yields Denote ∑N i=1 pi ̄ρ +(i) τ f (xt+1) ≤ f (x∗) + (cid:104)∇ f (x∗), xt+1 − x∗(cid:105) + ρ 2 (cid:107)xt+1 − x∗(cid:107)2 2 ≤ f (x∗) + (cid:107)∇ f (x∗)(cid:107)2(cid:107)xt+1 − x∗(cid:107)2 + (cid:107)∇ f (x∗)(cid:107)2 2 + ρ 2 (cid:107)xt+1 − x∗(cid:107)2 (cid:107)xt+1 − x∗(cid:107)2 2 ρ 2 (cid:107)xt+1 − x∗(cid:107)2 2 ρ 2 2 + (cid:107)∇ f (x∗)(cid:107)2 2 + ρ(cid:107)xt+1 − x∗(cid:107)2 2. ≤ f (x∗) + ≤ f (x∗) + 1 2ρ 1 2ρ Here the third inequality follows from the AM-GM inequality. Taking the expectation to the last inequality, we have E f (xt+1) ≤ f (x∗) + 1 2ρ (cid:107)∇ f (x∗)(cid:107)2 2 + ρE(cid:107)xt+1 − x∗(cid:107)2 2. Finally, we apply Theorem 5 to the above inequality to establish the statement in the corollary. Proof of Theorem 7. We follow the same arguments used in the first few steps of the proof of Theorem 5 and obtain the following inequality. E(cid:107)xt+1 − x∗(cid:107)2 2 ≤ (2η 2 3 + 2) N ∑ i=1 piE(i) JK t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 . Because we are solving b(i) t,k = argmin fi(x) for x ∈ R(D (cid:98)Γ) with an accuracy δ , we have x N ∑ i=1 piE(i) JK t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 ≤ (1 + η2)2 ≤ (1 + η2)2 N ∑ i=1 N ∑ i=1 piE(i) JK (cid:20) 2E(i) JK pi (cid:13) (cid:13)b(i) (cid:13) (cid:13) (cid:13)b(i,opt) (cid:13) t,K − x∗(cid:13) 2 (cid:13) (cid:13) 2 t,K − x∗(cid:13) 2 (cid:13) (cid:13) 2 31 + 2E(i) JK (cid:13) (cid:13)b(i,opt) (cid:13) t,K−1 − b(i) t,K (cid:21) (cid:13) 2 (cid:13) (cid:13) 2 ≤ (1 + η2)2 (cid:20) 2E(i) JK (cid:13) (cid:13)b(i,opt) (cid:13) t,K − x∗(cid:13) 2 (cid:13) (cid:13) 2 (cid:21) + 2δ 2 pi ≤ 2(1 + η2)2 (cid:104) β1(i)E(i) JK pi (cid:107)P⊥ (cid:98)Γ (b(i) t,K − x∗)(cid:107)2 2 + ξ1(i) + δ 2(cid:105) . N ∑ i=1 N ∑ i=1 The rest of the proof is similar to that of Theorem 5. Proof of Theorem 8. As in the proof of Theorem 5, let F (t) be the filtration by all the randomness up to the t-th communication round, but in this case, it is all the selected participating clients and the selected mini-batch indices at all these clients up to the t-th round. Let us denote the client subset selected at round t by It . Note that It is chosen uniformly at random over all possible subsets of cardinality L whose elements belong to [N], so |It | = L. Again, as we did in the proof of Theorem 5, by abusing the notation slightly, E will be denoted E(It ) [E[*]], where E(It ) is the expectation taken over the randomly selected participating clients at round t. *|F (t)(cid:105) (cid:104) We first consider the case for η1 > 1. By following the same argument for the first step of the proof for Theorem 5, we have E(It )E(cid:107)xt+1 − x∗(cid:107)2 2 = E(It )E (cid:13) (cid:13) (cid:13) PΛs (cid:13) (cid:13) (cid:32) ∑ i∈It (cid:32) (cid:33) 1 L x(i) t,K+1 1 L − ∑ i∈It (cid:33) 1 L x(i) t,K+1 − ∑ i∈It x(i) t,K+1 + ∑ i∈It (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 x(i) t,K+1 1 L 1 L x(i) t,K+1 − x∗ + 2E(It )E (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ∑ i∈It (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 1 L x(i) t,K+1 − x∗ (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 ≤ 2E(It )E (cid:13) (cid:13) (cid:13) PΛs (cid:13) (cid:13) ∑ i∈It (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:34) x∗ (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 (cid:35) = (2η 2 3 + 2)E(It )E 1 L x(i) t,K+1 − ∑ i∈It 1 L ∑ i∈It ≤ (2η 2 3 + 2)E(It ) ≤ (2η 2 3 + 2)E(It ) ∑ i∈It (cid:34) ∑ i∈It 1 L 1 L E t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 E(i) JK t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 (cid:35) . Moreover, the argument used in the proof of Theorem 5 yields 1 L E(i) JK t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 ≤ (1 + η2)2 ∑ i∈It 1 L ∑ i∈It β1(i)β2(i)E(i) JK−1 (cid:107)x(i) t,K − x∗(cid:107)2 2 + (1 + η2)2 max i   + (1 + η2)2 ∑ i∈It 1 L ̄ρ +(i) 4τ + 8β1(i) (ρ − 4τ (i))2  2θ 2 + β1(i) ρ − 4τ (i) 6 (2ρ − (cid:113) 4τ 4 4τ (i) − ̄ρ +(i)  η 2 1 − 1 η1  +   6 β1(i) ρ − 4τ (i) + ) (cid:113) η 2 1 − 1 η1   ζ 2 ∗ 4 4τ (i) − ̄ρ +(i) 4τ (2ρ −   σ 2 i . ) ̄ρ +(i) 4τ We define ν(It ) that depends on the random index set It as follows:  ν(It ) = (1 + η2)2 max i  + (1 + η2)2 ∑ i∈It + 8β1(i) (ρ − 4τ (i))2  1 L  β1(i) ρ − 4τ (i) (2ρ − ̄ρ +(i) 4τ  2θ 2 + 4τ 4 4τ (i) − ̄ρ +(i) ) (cid:113)  η 2 1 − 1 η1 6  + (cid:113) 6   ζ 2 ∗ η 2 1 − 1 η1 + β1(i) ρ − 4τ (i) 4 4τ (i) − ̄ρ +(i) 4τ (2ρ − ̄ρ +(i) 4τ   σ 2 i . ) After rewriting the previous inequality, we obtain 1 L E(i) JK t,K+1 − x∗(cid:13) (cid:13) (cid:13)x(i) (cid:13) 2 (cid:13) (cid:13) 2 1 L ≤ ∑ i∈It ∑ i∈It μ(i)E(i) JK−1 32 (cid:107)x(i) t,K − x∗(cid:107)2 2 + ν(It ). (19) (20) (21) Hence, by the induction on K and using the fact that the cohort set It is fixed while the local iterations are running, we obtain a similar upper bound on E(cid:107)xt+1 − x∗(cid:107)2 μ(i)K (cid:104) E(cid:107)xt+1 − x∗(cid:107)2 2 ≤ (2η 2 (cid:18) 2 as follows. 1 3 + 2)E(It ) ∑ L i∈It (cid:32)(cid:32) = (2η 2 3 + 2)E(It ) ≤ (2η 2 3 + 2)E(It ) ∑ i∈It (cid:32)(cid:32) ∑ i∈It E(i)(cid:107)x(i) t,1 − x∗(cid:107)2 2 (cid:105) + ν(It )(1 − μ(i)K) 1 − μ(i) (cid:19) (cid:33) (cid:33) 1 L 1 L μ(i)K μ(i)K E(cid:107)xt − x∗(cid:107)2 E(cid:107)xt − x∗(cid:107)2 1 L (1 − μ(i)K) 1 − μ(i) (cid:33) 2 + ν(It ) ∑ i∈It (1 − μ K) 1 − μ 2 + ν(It ) . (cid:33) Recall that the index set It is a subset of [N], uniformly selected at random, for the communication round t. By taking the maximum of ∑ i∈It 1 L μ(i)K over all possible subsets, we have E(cid:107)xt+1 − x∗(cid:107)2 2 ≤ κE(cid:107)xt − x∗(cid:107)2 2 + (2η 2 3 + 2)(1 − μ K) 1 − μ E(It )[ν(It )] ≤ κE(cid:107)xt − x∗(cid:107)2 2 + (2η 2 3 + 2) ̃ν(1 − μ K) 1 − μ κ = (2η 2 3 + 2) max S⊂[N] |S|=L 1 L ∑ z∈S (cid:2)(1 + η2)2β1(z)β2(z)(cid:3)K , where and ̃ν = (1 + η2)2 max i   + (1 + η2)2 1 L 8β1(i) (ρ − 4τ (i))2  N ∑ i=1  β1(i) ρ − 4τ (i) + ̄ρ +(i) 4τ  2θ 2 + 4 4τ (i) − ̄ρ +(i) (2ρ − 4τ (cid:113)  η 2 1 − 1 6 η1  + 6 β1(i) ρ − 4τ (i) + ) (cid:113) η 2 1 − 1 η1   ζ 2 ∗ 4 4τ (i) − ̄ρ +(i) 4τ (2ρ − ̄ρ +(i) 4τ   σ 2 i . ) Hence, by the induction on t, we have E(cid:107)xt+1 − x∗(cid:107)2 2 ≤ κt+1E(cid:107)x0 − x∗(cid:107)2 2 + (2η 2 3 + 2) ̃ν(1 − μ K) (1 − κ)(1 − μ) . The case for η1 = 1 follows from a similar argument. APPENDIX B FEDGRADMP CONVERGENCE WITHOUT THE BOUNDED VARIANCE CONDITION OF STOCHASTIC GRADIENTS We start with the following lemma replacing the bounded variance condition of stochastic gradients (7) in Assumption 4 only under the A -RSS condition. Lemma 11. Let E j be the expectation over the uniform distribution on all possible mini-batches. Then, for all τ-sparse vectors x, we have E j(cid:107)∇gi, j(x) − ∇ fi (x) (cid:107)2 2 ≤ 3E j((ρ + τ (i, j))2 + ̄ρ +(i) 4τ )(cid:107)∆(cid:107)2 2 + 12E j(cid:107)∇gi, j(x∗)(cid:107)2 2 and E j(cid:107)PΓ(∇gi, j(x) − ∇ fi (x))(cid:107)2 where x∗ is a solution to (1) and ∆ = x − x∗. 2 ≤ 3E j((ρ + τ (i, j))2 + ̄ρ +(i) 4τ )(cid:107)∆(cid:107)2 2 + 12E j(cid:107)PΓ∇gi, j(x∗)(cid:107)2 2, Proof of Lemma. E j(cid:107)∇gi, j(x) − ∇ fi (x) (cid:107)2 2 33 ≤ 3E j(cid:107)∇gi, j(x) − ∇gi, j(x∗)(cid:107)2 ≤ 3E j(ρ + = 3E j(ρ + ≤ 3E j((ρ + ≤ 3E j((ρ + τ (i, j))2(cid:107)x − x∗(cid:107)2 τ (i, j))2(cid:107)∆(cid:107)2 τ (i, j))2 + ̄ρ +(i) τ (i, j))2 + ̄ρ +(i) 4τ 4τ 2 + 3E j(cid:107)∇gi, j(x∗) − ∇ fi (x∗) (cid:107)2 2 + 6(cid:107)∇ fi (x∗) (cid:107)2 2 + 6E j(cid:107)∇gi, j(x∗)(cid:107)2 2 + 6E j(cid:107)∇gi, j(x∗)(cid:107)2 2 + 6(cid:107)∇ fi (x∗) (cid:107)2 2 + 3E j(cid:107)∇ fi (x∗) − ∇ fi (x) (cid:107)2 2 2 + 3E j ̄ρ +(i) 4τ (cid:107)∆(cid:107)2 2 4τ (cid:107)x − x∗(cid:107)2 2 + 3E j ̄ρ +(i) 2 )(cid:107)∆(cid:107)2 )(cid:107)∆(cid:107)2 2 + 6E j(cid:107)∇gi, j(x∗)(cid:107)2 2 + 6(cid:107)∇ fi (x∗) (cid:107)2 2 2 + 12E j(cid:107)∇gi, j(x∗)(cid:107)2 2. The second inequality follows from the A -RSS condition for ∇gi, j with constant ρ + τ (i, j), and the fact that ∇ fi is the average of ∇gi, j. The last inequality is from the Jensen's inequality. This proves the first part of the lemma and the second part follows from a similar argument. This lemma allows us to prove a similar statement as in Lemma 4 without the bounded variance condition (7). Since the underlying argument of the proof of the following lemma is the same, we only point out the difference from the proof for Lemma 4. Lemma 12. Let (cid:98)Γ be the set obtained from the k-th iteration at client i. Then, for any θ > 0, we have E(i) jk (cid:107)P⊥ (cid:98)Γ (b(i) t,k − x∗)(cid:107)2 2 ≤ β2(i)(cid:107)x(i) t,k − x∗(cid:107)2 2 + ξ2(i), where  β2(i) = 4 (2η 2 1 − 1) (cid:17) (cid:16) ̄ρ +(i) 4τ + 1 θ 2 1 ρ − η 2 4τ (i) − η 2 1 ρ − 4τ (i) (cid:32) + ξ2(i) = 8 (ρ − 4τ (i))2 max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + 2  6θ 2 + (cid:33) ) 4τ τ (i, jk) + ̄ρ +(i) 3θ 2E jk (ρ + ρ − 4τ (i)   E jk (cid:107)∇gi, jk (x∗)(cid:107)2 2. η 2 1 − 1 (cid:113) + 15 2η1   2(η 2 1 − 1) η 2 1 Note that if η1 = 1, then the projection operator is exact. Here E(i) jk selected index jk at the k-th step of the local iterations of the i-th client. is the expectation taken over the randomly Proof. We follow the same steps in the proof of Lemma 4 for the bound fi(x∗) − fi apply Lemma 12 to the inequality 22 as follows. (cid:17) (cid:16) x(i) t,k − ρ − 4τ (i) 2 (cid:107)x∗ − x(i) t,k(cid:107)2 2 but fi(x∗) − fi (cid:17) (cid:16) x(i) t,k − ρ − 4τ (i) 2 (cid:107)x∗ − x(i) t,k(cid:107)2 2 ≥ E jk (cid:68) ∇ fi (cid:17) (cid:16) x(i) t,k (cid:69) , z − − 1 2θ 2 (cid:68) ∇ fi ≥ E jk E jk (cid:107)z(cid:107)2 2 − (cid:17) (cid:16) x(i) t,k (cid:69) , z − 1 2θ 2 E jk (cid:107)z(cid:107)2 2 − θ 2 2 ̄ρ +(i) 4τ 2 θ 2 2 ̄ρ +(i) 4τ 2 (cid:107)∇gi, jk (x(i) t,k) − ∇ fi (cid:113) (cid:17) (cid:16) x(i) t,k (cid:107)2 2 E jk (cid:107)z(cid:107)2 2 − η 2 1 − 1 2η1 τ (i, j))2 + ̄ρ +(i) 4τ E jk (cid:107)z(cid:107)2 (cid:113) 2 − η 2 1 − 1 2η1 Γ ∇gi, jk (x(i) t,k)(cid:107)2 2 as follows. (cid:16) E jk (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2 2 + E jk (cid:107)∆(cid:107)2 2 − (3E j((ρ + )(cid:107)∆(cid:107)2 2 + 12E j(cid:107)∇gi, j(x∗)(cid:107)2 2) (cid:16) E jk (cid:107)P⊥ Γ ∇gi, jk (x(i) t,k)(cid:107)2 2 + E jk (cid:107)∆(cid:107)2 2 (cid:17) (cid:17) . (22) Similarly, we obtain the upper bound for E jk (cid:107)P⊥ Γ ∇gi, jk (x(i) E jk (cid:107)P⊥ ≤ E jk (cid:107)∇gi, jk (x(i) ≤ 3E jk (cid:107)∇gi, jk (x(i) ≤ 3E jk (ρ + t,k)(cid:107)2 2 t,k)(cid:107)2 2 t,k) − ∇gi, jk (x∗)(cid:107)2 t,k − x∗(cid:107)2 τ (i, jk))2(cid:107)x(i) 2 + 3E jk (cid:107)∇gi, jk (x∗) − ∇ fi (x∗) (cid:107)2 2 + 6(cid:107)∇ fi (x∗) (cid:107)2 2 + 6E jk (cid:107)∇gi, jk (x∗)(cid:107)2 2 + 3E jk (cid:107)∇ fi (x∗) (cid:107)2 2 2 + 3(cid:107)∇ fi (x∗) (cid:107)2 2 34 = 3E jk (ρ + = 3E jk (ρ + τ (i, jk))2(cid:107)∆(cid:107)2 τ (i, jk))2(cid:107)∆(cid:107)2 2 + 6E jk (cid:107)∇gi, jk (x∗)(cid:107)2 2 + 9(cid:107)∇ fi (x∗) (cid:107)2 2 2 + 15E jk (cid:107)∇gi, jk (x∗)(cid:107)2 2, where the last inequality is from the Jensen's inequality. Applying this bound for E jk (cid:107)P⊥ ρ − 4τ (i) 2 fi(x∗) − fi (cid:16) x(i) t,k − (cid:17) (cid:107)∆(cid:107)2 2 Γ ∇gi, jk (x(i) t,k)(cid:107)2 2 yields ≥ E jk (cid:68) ∇ fi (cid:17) (cid:16) x(i) t,k (cid:69) , z − 1 2θ 2 E jk (cid:107)z(cid:107)2 2 − − (cid:113) θ 2 2 η 2 1 − 1 2η1 (3E j((ρ + τ (i, j))2 + ̄ρ +(i) 4τ )(cid:107)∆(cid:107)2 2 + 12E j(cid:107)∇gi, j(x∗)(cid:107)2 2) − ̄ρ +(i) 4τ 2 E jk (cid:107)z(cid:107)2 2 (cid:0)3E jk (ρ + τ (i, jk))2(cid:107)∆(cid:107)2 2 + 15E jk (cid:107)∇gi, jk (x∗)(cid:107)2 2 + E jk (cid:107)∆(cid:107)2 2 (cid:1) . Following the same argument in the proof of Lemma 4, we have (cid:33) (cid:32) ̄ρ +(i) 4τ 2 + 1 2θ 2 E jk (cid:107)z(cid:107)2 2 − 1 2  ρ − 4τ (i) − 3θ 2E jk ((ρ + τ (i, jk))2 + ̄ρ +(i) 4τ (cid:113) η 2 1 − 1 η1 ) − (3E jk ρ + τ (i, jk))2 + 1)   (cid:107)∆(cid:107)2 2  6θ 2 + + (cid:16) x(i) t,k + z (cid:113) 15 η 2 1 − 1 2η1 (cid:17) − fi (x∗)   E jk (cid:107)∇gi, jk (x∗)(cid:107)2 2 (cid:107)∆ − z(cid:107)2 2 − max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2E jk (cid:107)∆ − z(cid:107)2. ≥ E jk fi ρ − 4τ (i) 2 ≥ Let u = E jk (cid:107)∆ − y(cid:107)2, a = ρ − 4τ (i), b = max Ω⊂[d] |Ω|=4τ (cid:107)PΩ∇ fi(x∗)(cid:107)2, and (cid:33) (cid:32) ̄ρ +(i) 4τ 2 + 1 2θ 2 c = E jk (cid:107)z(cid:107)2 2 − 1 2  ρ − 4τ (i) − 3θ 2E jk ((ρ + τ (i, jk))2 + ̄ρ +(i) 4τ ) − (cid:113) η 2 1 − 1 η1 (3E jk ρ + τ (i, jk))2 + 1)   (cid:107)∆(cid:107)2 2  6θ 2 + + 15 (cid:113) η 2 1 − 1 2η1   E jk (cid:107)∇gi, jk (x∗)(cid:107)2 2. Then above inequality can be rewritten in au2 − 2bu − c ≤ 0 and solving it gives E jk (cid:107)∆ − y(cid:107)2 ≤ (cid:114) c a + 2b a . Again, following the same argument for the proof of Lemma 4, we get 8b2 a2 . (cid:107)∆ − PΓ∆(cid:107)2 E(i) jk 2c a 2 ≤ + Thus, E(i) jk  (cid:107)∆ − PΓ∆(cid:107)2 2 (cid:16) ̄ρ +(i) 4τ + 1 θ 2 1 ρ − η 2 2 (cid:17) ≤ 4τ (i) − η 2 1 ρ − 4τ (i) (cid:32) + 3θ 2E jk ((ρ + (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 + 2  6θ 2 + 8 (ρ − 4τ (i))2 max Ω⊂[d] |Ω|=4τ 2η1 35 (cid:33) ) + (cid:113) η 2 1 − 1 η1 (3E jk ρ + τ (i, jk))2 + 1)   (cid:107)∆(cid:107)2 2 4τ τ (i, jk))2 + ̄ρ +(i) ρ − 4τ (i) (cid:113) 15 η 2 1 − 1   E jk (cid:107)∇gi, jk (x∗)(cid:107)2 2. We follow the idea of the proof for Theorem 5 but use Lemma 12 to show the following convergence theorem of FedGradMP. Theorem 13. Under the same notations and assumptions but without the bounded variance condition (7), the expectation of the recovery error at the (t + 1)-th round of FedGradMP described in Algorithm 1 is upper bounded by E(cid:107)xt+1 − x∗(cid:107)2 2 ≤ κt+1(cid:107)x0 − x∗(cid:107)2 2 + (2η 2 3 + 2)ν 1 − κ N ∑ i=1 pi 1 − μ(i)K 1 − μ(i) , where Here β1(i) = β2(i) = κ = (2η 2 3 + 2) N ∑ i=1 (cid:2)(1 + η2)2β1(i)β2(i)(cid:3)K . pi , ̄ρ +(i) 4τ 4τ (i) − ̄ρ +(i) 2ρ − 4τ (cid:16)  ̄ρ +(i) 4τ + 1 θ 2 1 ρ − η 2 2 (cid:17) 4τ (i) − η 2 1 ρ − 4τ (i) (cid:32) + 3θ 2E jk ((ρ + τ (i, jk))2 + ̄ρ +(i) ρ − 4τ (i) 4τ (cid:33) ) + (cid:113) η 2 1 − 1 η1  (3E jk ρ + τ (i, jk))2 + 1)  , ν = (1 + η2)2 max i (cid:18) 8β1(i) (ρ − 4τ (i))2 (cid:19) N ∑ i=1 (cid:107)PΩ∇ fi(x∗)(cid:107)2 2 pi max Ω⊂[d] |Ω|=4τ (cid:113) 6 + (1 + η2)2  pi  N ∑ i=1 β1(i) ρ − 4τ (i)  2θ 2 +   + η 2 1 − 1 η1 ̄ρ +(i) 4τ 4 4τ (i) − ̄ρ +(i) 4τ (2ρ −   N ∑ i=1 ) piE j(cid:107)∇gi, j(x∗)(cid:107)2 2. REFERENCES [1] Amirali Aghazadeh, Ryan Spring, Daniel LeJeune, Gautam Dasarathy, Anshumali Shrivastava, et al. Mission: Ultra large-scale feature selection using count-sketches. In International Conference on Machine Learning, pages 80–88. PMLR, 2018. [2] Michal Aharon, Michael Elad, and Alfred Bruckstein. K-svd: An algorithm for designing overcomplete dictionaries for sparse representation. IEEE Transactions on signal processing, 54(11):4311–4322, 2006. [3] Yajie Bao, Michael Crawshaw, Shan Luo, and Mingrui Liu. Fast composite optimization and statistical recovery in federated learning. In International Conference on Machine Learning, pages 1508–1536. PMLR, 2022. [4] Rich Baraniuk, Simon Foucart, Deanna Needell, Yaniv Plan, and Mary Wootters. One-bit compressive sensing of dictionary-sparse signals. Information and Inference: A Journal of the IMA, 7(1):83–104, 2018. [5] Debraj Basu, Deepesh Data, Can Karakus, and Suhas Diggavi. Qsparse-local-sgd: Distributed sgd with quantization, sparsification and local computations. Advances in Neural Information Processing Systems, 32, 2019. [6] Amir Beck. First-order methods in optimization. SIAM, 2017. [7] Thomas Blumensath and Mike E Davies. Iterative hard thresholding for compressed sensing. Applied and computational harmonic analysis, 27(3):265–274, 2009. [8] Keith Bonawitz, Hubert Eichner, Wolfgang Grieskamp, Dzmitry Huba, Alex Ingerman, Vladimir Ivanov, Chloe Kiddon, Jakub Koneˇcn`y, Stefano Mazzocchi, Brendan McMahan, et al. Towards federated learning at scale: System design. Proceedings of Machine Learning and Systems, 1:374–388, 2019. [9] Zachary Charles, Zachary Garrett, Zhouyuan Huo, Sergei Shmulyian, and Virginia Smith. On large-cohort training for federated learning. Advances in neural information processing systems, 34:20461–20475, 2021. [10] Zachary Charles and Jakub Koneˇcn`y. Convergence and accuracy trade-offs in federated learning and meta-learning. In International Conference on Artificial Intelligence and Statistics, pages 2575–2583. PMLR, 2021. [11] Wenlin Chen, Samuel Horvath, and Peter Richtarik. Optimal client sampling for federated learning. arXiv preprint arXiv:2010.13723, 2020. [12] Yae Jee Cho, Jianyu Wang, and Gauri Joshi. Towards understanding biased client selection in federated learning. In International Conference on Artificial Intelligence and Statistics, pages 10351–10375. PMLR, 2022. [13] Ingrid Daubechies, Michel Defrise, and Christine De Mol. An iterative thresholding algorithm for linear inverse problems with a sparsity constraint. Communications on Pure and Applied Mathematics: A Journal Issued by the Courant Institute of Mathematical Sciences, 57(11):1413–1457, 2004. [14] Mark A Davenport, Deanna Needell, and Michael B Wakin. Signal space cosamp for sparse recovery with redundant dictionaries. IEEE Transactions on Information Theory, 59(10):6820–6829, 2013. 36 [15] John C Duchi, Shai Shalev-Shwartz, Yoram Singer, and Ambuj Tewari. Composite objective mirror descent. In COLT, volume 10, pages 14–26. Citeseer, 2010. [16] Simon Foucart and Holger Rauhut. An invitation to compressive sensing. In A mathematical introduction to compressive sensing, pages 1–39. Springer, 2013. [17] Michael P Friedlander and Mark Schmidt. Hybrid deterministic-stochastic methods for data fitting. SIAM Journal on Scientific Computing, 34(3):A1380–A1405, 2012. [18] Gene H Golub and Charles F Van Loan. Matrix computations. JHU press, 2013. [19] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. MIT press, 2016. [20] Robert Mansel Gower, Nicolas Loizou, Xun Qian, Alibek Sailanbayev, Egor Shulgin, and Peter Richt ́arik. Sgd: General analysis and improved rates. In International Conference on Machine Learning, pages 5200–5209. PMLR, 2019. [21] Rachel Grotheer, Shuang Li, Anna Ma, Deanna Needell, and Jing Qin. Iterative hard thresholding for low cp-rank tensor models. Linear and Multilinear Algebra, pages 1–17, 2021. [22] Xinran Gu, Kaixuan Huang, Jingzhao Zhang, and Longbo Huang. Fast federated learning in the presence of arbitrary device unavailability. Advances in Neural Information Processing Systems, 34:12052–12064, 2021. [23] Farzin Haddadpour, Mohammad Mahdi Kamani, Mehrdad Mahdavi, and Viveck Cadambe. Local sgd with periodic averaging: Tighter analysis and adaptive synchronization. Advances in Neural Information Processing Systems, 32, 2019. [24] Farzin Haddadpour, Mohammad Mahdi Kamani, Aryan Mokhtari, and Mehrdad Mahdavi. Federated learning with compression: Unified analysis and sharp guarantees. In International Conference on Artificial Intelligence and Statistics, pages 2350–2358. PMLR, 2021. [25] Farzin Haddadpour, Belhal Karimi, Ping Li, and Xiaoyun Li. Fedsketch: Communication-efficient and private federated learning via sketching. arXiv preprint arXiv:2008.04975, 2020. [26] Farzin Haddadpour and Mehrdad Mahdavi. On the convergence of local descent methods in federated learning. arXiv preprint arXiv:1910.14425, 2019. [27] Tzu-Ming Harry Hsu, Hang Qi, and Matthew Brown. Measuring the effects of non-identical data distribution for federated visual classification. arXiv preprint arXiv:1909.06335, 2019. [28] Halyun Jeong, Xiaowei Li, Yaniv Plan, and Ozgur Yilmaz. Sub-gaussian matrices on sets: Optimal tail dependence and applications. Communications on Pure and Applied Mathematics, 2021. [29] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. Advances in neural information processing systems, 26, 2013. [30] Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank Reddi, Sebastian Stich, and Ananda Theertha Suresh. Scaffold: Stochastic controlled averaging for federated learning. In International Conference on Machine Learning, pages 5132–5143. PMLR, 2020. [31] Ahmed Khaled, Konstantin Mishchenko, and Peter Richt ́arik. Tighter theory for local sgd on identical and heterogeneous data. In International Conference on Artificial Intelligence and Statistics, pages 4519–4529. PMLR, 2020. [32] Anastasia Koloskova, Sebastian U Stich, and Martin Jaggi. Sharper convergence guarantees for asynchronous sgd for distributed and federated learning. arXiv preprint arXiv:2206.08307, 2022. [33] Jakub Koneˇcn`y, H Brendan McMahan, Daniel Ramage, and Peter Richt ́arik. Federated optimization: Distributed machine learning for on-device intelligence. arXiv preprint arXiv:1610.02527, 2016. [34] Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. Federated learning: Challenges, methods, and future directions. IEEE Signal Processing Magazine, 37(3):50–60, 2020. [35] Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. arXiv preprint arXiv:1812.06127, 2018. [36] Po-Ling Loh and Martin J Wainwright. High-dimensional regression with noisy and missing data: Provable guarantees with non-convexity. Advances in neural information processing systems, 24, 2011. [37] LO Mangasarian. Parallel gradient distribution in unconstrained optimization. SIAM Journal on Control and Optimization, 33(6):1916–1925, 1995. [38] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial intelligence and statistics, pages 1273–1282. PMLR, 2017. [39] Brendan McMahan and Daniel Ramage. Federated learning: Collaborative machine learning without centralized training data. Google AI Blog, 2017. [40] Aritra Mitra, Rayana Jaafar, George J Pappas, and Hamed Hassani. Linear convergence in federated learning: Tackling client heterogeneity and sparse gradients. Advances in Neural Information Processing Systems, 34:14606–14619, 2021. [41] Fan Mo, Hamed Haddadi, Kleomenis Katevas, Eduard Marin, Diego Perino, and Nicolas Kourtellis. Ppfl: privacy-preserving federated learning with trusted execution environments. In Proceedings of the 19th Annual International Conference on Mobile Systems, Applications, and Services, pages 94–108, 2021. [42] Deanna Needell and Joel A Tropp. Cosamp: Iterative signal recovery from incomplete and inaccurate samples. Applied and computational harmonic analysis, 26(3):301–321, 2009. [43] Yurii Nesterov et al. Lectures on convex optimization, volume 137. Springer, 2018. [44] Nam Nguyen, Deanna Needell, and Tina Woolf. Linear convergence of stochastic iterative greedy algorithms with sparse constraints. IEEE Transactions on Information Theory, 63(11):6869–6895, 2017. [45] Jing Qin, Shuang Li, Deanna Needell, Anna Ma, Rachel Grotheer, Chenxi Huang, and Natalie Durgin. Stochastic greedy algorithms for multiple measurement vectors. Inverse Problems & Imaging, 15(1):79–107, 2021. [46] Holger Rauhut, Reinhold Schneider, and ˇZeljka Stojanac. Low rank tensor recovery via iterative hard thresholding. Linear Algebra and its Applications, 523:220–262, 2017. [47] Daniel Rothchild, Ashwinee Panda, Enayat Ullah, Nikita Ivkin, Ion Stoica, Vladimir Braverman, Joseph Gonzalez, and Raman Arora. In International Conference on Machine Learning, pages 8253– Fetchsgd: Communication-efficient federated learning with sketching. 8265. PMLR, 2020. [48] Nicolas Roux, Mark Schmidt, and Francis Bach. A stochastic gradient method with an exponential convergence rate for finite training sets. Advances in neural information processing systems, 25, 2012. [49] Shai Shalev-Shwartz and Shai Ben-David. Understanding machine learning: From theory to algorithms. Cambridge university press, 2014. [50] Jie Shen and Ping Li. A tight bound of hard thresholding. The Journal of Machine Learning Research, 18(1):7650–7691, 2017. 37 [51] Zhao Song, Yitan Wang, Zheng Yu, and Lichen Zhang. Sketching for first order method: Efficient algorithm for low-bandwidth channel and vulnerability. arXiv preprint arXiv:2210.08371, 2022. [52] Qianqian Tong, Guannan Liang, Tan Zhu, and Jinbo Bi. Federated nonconvex sparse learning. arXiv preprint arXiv:2101.00052, 2020. [53] Lloyd N Trefethen and David Bau III. Numerical linear algebra, volume 50. Siam, 1997. [54] Joost Verbraeken, Matthijs Wolting, Jonathan Katzy, Jeroen Kloppenburg, Tim Verbelen, and Jan S Rellermeyer. A survey on distributed machine learning. ACM Computing Surveys (CSUR), 53(2):1–33, 2020. [55] Jianyu Wang, Zachary Charles, Zheng Xu, Gauri Joshi, H Brendan McMahan, Maruan Al-Shedivat, Galen Andrew, Salman Avestimehr, Katharine Daly, Deepesh Data, et al. A field guide to federated optimization. arXiv preprint arXiv:2107.06917, 2021. [56] Jianyu Wang, Qinghua Liu, Hao Liang, Gauri Joshi, and H Vincent Poor. Tackling the objective inconsistency problem in heterogeneous federated optimization. Advances in neural information processing systems, 33:7611–7623, 2020. [57] David P Woodruff et al. Sketching as a tool for numerical linear algebra. Foundations and Trends® in Theoretical Computer Science, 10(1–2):1–157, 2014. [58] Blake E Woodworth, Kumar Kshitij Patel, and Nati Srebro. Minibatch vs local sgd for heterogeneous distributed learning. Advances in Neural Information Processing Systems, 33:6281–6292, 2020. [59] Haibo Yang, Minghong Fang, and Jia Liu. Achieving linear speedup with partial worker participation in non-iid federated learning. arXiv preprint arXiv:2101.11203, 2021. [60] Haibo Yang, Xin Zhang, Prashant Khanduri, and Jia Liu. Anarchic federated learning. In International Conference on Machine Learning, pages 25331–25363. PMLR, 2022. [61] Honglin Yuan, Manzil Zaheer, and Sashank Reddi. Federated composite optimization. In International Conference on Machine Learning, pages 12253–12266. PMLR, 2021. [62] Pan Zhou, Xiaotong Yuan, and Jiashi Feng. Efficient stochastic gradient hard thresholding. Advances in Neural Information Processing Systems, 31, 2018. 38
http://arxiv.org/abs/2302.10066v2
2023-06-22T16:22:47
2023-02-20T16:13:19
Sharp analysis of EM for learning mixtures of pairwise differences
We consider a symmetric mixture of linear regressions with random samples from the pairwise comparison design, which can be seen as a noisy version of a type of Euclidean distance geometry problem. We analyze the expectation-maximization (EM) algorithm locally around the ground truth and establish that the sequence converges linearly, providing an $\ell_\infty$-norm guarantee on the estimation error of the iterates. Furthermore, we show that the limit of the EM sequence achieves the sharp rate of estimation in the $\ell_2$-norm, matching the information-theoretically optimal constant. We also argue through simulation that convergence from a random initialization is much more delicate in this setting, and does not appear to occur in general. Our results show that the EM algorithm can exhibit several unique behaviors when the covariate distribution is suitably structured.
[ "Abhishek Dhawan", "Cheng Mao", "Ashwin Pananjady" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10066v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10066v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "math.ST", "@scheme": "http://arxiv.org/schemas/atom" }
[ "math.ST", "cs.LG", "stat.ML", "stat.TH" ]
3 2 0 2 n u J 2 2 ] T S . h t a m [ 2 v 6 6 0 0 1 . 2 0 3 2 : v i X r a Sharp analysis of EM for learning mixtures of pairwise differences Abhishek Dhawan⋆, Cheng Mao⋆, Ashwin Pananjady†,‡ ⋆School of Mathematics †School of Industrial and Systems Engineering ‡School of Electrical and Computer Engineering Georgia Institute of Technology June 23, 2023 Abstract We consider a symmetric mixture of linear regressions with random samples from the pairwise comparison design, which can be seen as a noisy version of a type of Euclidean distance geometry problem. We analyze the expectation-maximization (EM) algorithm locally around the ground truth and establish that the sequence converges linearly, providing an l∞-norm guarantee on the estimation error of the iterates. Furthermore, we show that the limit of the EM sequence achieves the sharp rate of estimation in the l2-norm, matching the information-theoretically optimal constant. We also argue through simulation that convergence from a random initialization is much more delicate in this setting, and does not appear to occur in general. Our results show that the EM algorithm can exhibit several unique behaviors when the covariate distribution is suitably structured. Contents 1 Introduction 1.1 Contributions and organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Background and problem formulation 3 Main results 2 3 4 4 5 4 Experiments and discussion 4.1 Failure of random initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Spectral method, initialization, and comparison . . . . . . . . . . . . . . . . . . . . . 4.3 Extensions of the model 7 7 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5 Proof techniques 11 5.1 Contraction in the l∞ norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 5.2 Expansion around the ground truth . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Infinity operator norm of the inverse covariance . . . . . . . . . . . . . . . . . . . . . 13 5.3 5.4 Proof organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1 6 Analysis of the EM algorithm 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.1 Preliminaries 6.2 Sample covariance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 6.3 One-step iterate from the ground truth . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.4 Convergence analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 6.5 Sharp results in the low-noise regime . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 6.6 Proof of main results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 A Probability tools B Improved sample complexity C Minimax lower bounds with a fixed design 1 Introduction 39 40 41 Mixtures of linear regressions are classical methods used to model heterogeneous populations (Jor- dan and Jacobs, 1994; Xu et al., 1994; Viele and Tong, 2002) and have been widely studied in recent years (see, e.g., Chaganty and Liang (2013); Chen et al. (2017); Balakrishnan et al. (2017); Li and Liang (2018); Kwon et al. (2019); Chen et al. (2020)). A common approach is to apply a spectral algorithm to initialize the parameters of interest, and then run a locally convergent non- convex optimization algorithm; alternatively, one could even run the nonconvex algorithm from a random initialization. These nonconvex optimization algorithms have been extensively analyzed under Gaussian assumptions on the covariates (see, e.g. Balakrishnan et al. (2017); Klusowski et al. (2019); Chen et al. (2019); Kwon and Caramanis (2020)), and it is known that they can exhibit favorable behavior globally in some settings. In many tasks such as ranking (Bradley and Terry, 1952), crowd-labeling (Dawid and Skene, 1979) and web search (Chen et al., 2013), however, measurements are taken as pairwise comparisons between entities, which renders the covariates inherently discrete. These designs or covariates are far from Gaussian, and it is natural to ask how standard nonconvex optimization algorithms now perform. Motivated by this question, we study how the celebrated expectation-maximization (EM) algorithm behaves when estimating a mixture of symmetric linear regressions under the pairwise comparison design. More specifically, we consider the following model of a symmetric mixture of two linear regressions with parameter vectors θ∗, −θ∗ ∈ Rd. For r = 1, . . . , N , suppose that we observe (xr, yr) ∈ Rd × R satisfying yr = zr x⊤ r θ∗ + εr. (1) Here the covariates xr follow the pairwise comparison design, i.e., xr = eir − ejr for ir, jr ∈ [d] := {1, . . . , d}, where ei is the ith standard basis vector in Rd; zr ∈ {−1, 1} is a latent sign indicating whether the observation is from component θ∗ or −θ∗; εr models additive noise, assumed to be i.i.d. Gaussian for theoretical results. Our goal is to estimate the parameter vector θ∗ ∈ Rd. The model (1) can also be seen as a special case of the Euclidean distance geometry prob- lem (Gower, 1982; Liberti et al., 2014) and multidimensional scaling (Borg and Groenen, 2005), and bears some resemblance to real phase retrieval (see Eldar and Mendelson (2014); Chen et al. 2 (2019) and the references therein). Let y′ Because the sign zr is unobserved, (1) is equivalent to r = |yr| be the observation and ε′ r = zrεr denote noise. r = |x⊤ y′ r θ∗ + ε′ r|. (2) + ε′ − θ∗ jr 1, . . . , θ∗ Since xr = eir − ejr , we observe |θ∗ r| which is the distance between two parameters con- ir taminated by noise1. Hence our goal is to reconstruct θ∗ d from pairwise distances. This is a noisy version of the classical Euclidean distance geometry problem, also known as multidimensional scaling (although the latter is more often used for a class of visualization methods). The above model is also related to the problem of angular or phase synchronization (Singer, 2011; Zhong and Boumal, 2018; Gao and Zhang, 2021), where angles θ∗ 1, . . . , θ∗ d ∈ [0, 2π) are estimated from noisy measurements of θ∗ j mod 2π. Moreover, a heterogeneous version of angular synchroniza- tion (Cucuringu and Tyagi, 2020) aims to reconstruct multiple groups of angles from a mixture of pairwise differences between angles from unknown groups. For all the aforementioned observation models, researchers have considered convex, spectral, and nonconvex fitting approaches. i − θ∗ As mentioned previously, our focus is on the EM algorithm (Dempster et al., 1977)-and we discuss other estimation procedures briefly in Section 4-which has long been used for estimation in latent variable models. Asymptotic convergence guarantees for EM to local optima in general latent variable models are classical (Wu, 1983). For Gaussian covariates xr in (1), nonasymptotic, local linear convergence of the EM algorithm for symmetric mixtures of linear regressions was established in Balakrishnan et al. (2017). In the same setting, a form of "global convergence"- where the EM algorithm is first initialized with a close relative called "Easy-EM" which is in itself randomly initialized (see the background section to follow)-was established in Kwon et al. (2019). There is a large literature on EM and other iterative algorithms for mixtures of regressions and related models; see, e.g., Daskalakis et al. (2017); Xu et al. (2016); Li and Liang (2018); Klusowski et al. (2019); Wu and Zhou (2021); Dwivedi et al. (2020); Kwon and Caramanis (2020); Kwon et al. (2021) and references therein. EM has also been analyzed in progressively more complex settings, most recently in Gaussian latent tree models (Dagan et al., 2022). Our paper should be seen, in spirit, as extending this line of investigation. 1.1 Contributions and organization In this paper, we apply the EM algorithm to model (1) and establish its local linear convergence around the ground truth θ∗, proving that once the algorithm is initialized sufficiently close to the ground truth θ∗, it converges linearly fast to a fixed point ˆθ. Moreover, we provide optimal bounds on the l∞ and l2 estimation errors achieved by the EM fixed point in estimating θ∗. Despite the extensive study of the EM algorithm for mixture models, our results differ from existing works in several crucial ways. First, we establish entrywise guarantees on the EM algorithm-our results hold in the stronger l∞-norm, not just the l2-norm. Second, and in contrast to several results in the Gaussian case for mixtures of linear regressions (Kwon et al., 2019; Chandrasekher et al., 2021), we do not assume that each iterate of the EM algorithm takes in a fresh sample, i.e., our convergence guarantee is not based on sample-splitting2. Third, our result for the l2-norm is sharp in that it also is optimal 1It is more natural to have the noise ε′ 2Some results of Balakrishnan et al. (2017) do not assume sample-splitting but are suboptimal in the low-noise r inside the absolute value because the distance is nonnegative. regime. 3 in terms of the constant factor, while most previous results for EM only achieve the optimal rate up to constant factors. Fourth, our simulation results show that EM's convergence from a random initialization is quite delicate: convergence does not occur in general and this stands in sharp contrast to the case with Gaussian covariates. On a technical level, our results are enabled by analyzing the finite-sample EM operator directly, whereas many previous results proceed through the population update. En route to establishing our results, we analyze the l∞→∞ operator norm of the psedoinverse of the sample covariance in this problem, a result that may be of independent interest (see Section 5). The rest of this paper is organized as follows. In Section 2, we formally introduce our assump- tions and the EM iteration that we study. In Section 3, we state and discuss the main theorems proved in this paper. In Section 4, we present a host of experiments showing that the conditions appearing in our theorem statements are indeed necessary in some respect. These experiments also confirm that global convergence of EM in this setting is a delicate phenomenon and does not appear to occur in general. Section 4 also discusses other algorithms and the related literature, and discusses the (non-)identifiability of mixtures with more than two components. We conclude with a sketch of the proof techniques in Section 5. Full proofs can be found in Section 6. 1.2 Notation Let d and N be positive integers such that 3 ≤ d ≤ N throughout the paper. Define [d] := {1, . . . , d} (cid:1) := {(i, j) : i, j ∈ [d], i < j}. Let 1 denote the all-ones vector in Rd, and let H denote and (cid:0)[d] 2 the orthogonal complement of 1 in Rd. We use the standard asymptotic notation O(*) and o(*) as N → ∞; we use Op(*) and op(*) when the asymptotic relation holds between two random variables with high probability. We also write aN ≪ bN if aN = o(bN ), aN ≫ bN if bN = o(aN ), and aN ≲ bN if aN = O(bN ). For a matrix A ∈ Rd×d, we denote the trace of A by tr(A). 2 Background and problem formulation For the results to follow, we consider model (1) with the following assumptions. Assumption 1. In (1), the covariates are xr = eir − ejr where (ir, jr)N r=1 are i.i.d. and uniformly random in (cid:0)[d] (cid:1) = {(i, j) : i, j ∈ [d], i < j}. The noise terms (εr)N r=1 are i.i.d. N (0, σ2) and 2 independent from the covariates. Moreover, 1⊤θ∗ = 0, i.e., θ∗ ∈ H where H is the orthogonal complement of the all-ones vector 1 in Rd. The assumption on the covariates states that the comparisons are chosen uniformly at random and with replacement among all pairs of indices. There is no loss of generality in assuming 1⊤θ∗ = 0, because the model (1) is invariant under any constant shift of θ∗: If θ∗ is replaced by θ∗ + c 1 for a constant c ∈ R, the response yr stays the same. Define the sample covariance matrix of the covariates to be ˆΣ := d − 1 2N N (cid:88) r=1 xrx⊤ r . (3) Note that 1 is in the kernel of ˆΣ and H is an invariant subspace of ˆΣ. Therefore, ˆΣ can be viewed as a linear map on H. Let ˆΣ† denote the pseudoinverse of ˆΣ; it is the true inverse of ˆΣ if ˆΣ is 4 restricted to H and is invertible. Moreover, the normalization d−1 has entries 2N is chosen so that E[ ˆΣ] ∈ Rd×d (cid:40) (E[ ˆΣ])ij = (d − 1)/d −1/d if i = j, if i ̸= j. It is not hard to check that E[ ˆΣ] is the identity map on H. It is convenient to define the so-called "Easy-EM" operator ̄Q : H → H (Kwon et al., 2019) and write the EM operator ˆQ : H → H in terms of it: ̄Q(θ) := N (cid:88) tanh d − 1 2N r=1 ˆQ(θ) := ˆΣ† ̄Q(θ). (cid:17) (cid:16) yr x⊤ r θ σ2 yrxr, (4a) (4b) See Balakrishnan et al. (2017) for a derivation of the EM operator. Starting from an initialization θ(0), the EM iteration is then given by θ(t+1) := ˆQ(θ(t)) = (cid:18) N (cid:88) xrx⊤ r (cid:19)† N (cid:88) r=1 r=1 tanh r θ(t) (cid:16) yr x⊤ σ2 (cid:17) yrxr, t ≥ 0. (5) 3 Main results It is helpful to define the following class of parameter vectors. For a constant β > 0, let (cid:26) Θ(β) := θ ∈ H : θ1 ≤ * * * ≤ θd, |θi − θj| ≥ β |i − j| d for any (i, j) ∈ (cid:19)(cid:27) . (cid:18)[d] 2 (6) Operationally, the set Θ(β) is a natural family of parameters to consider. First, up to a relabeling of the coordinates, there is no loss of generality in restricting our attention to parameter vectors with nondecreasing entries. Second, each parameter vector in Θ(β) has its ith and jth entries separated by at least β |i−j| d . This separation condition is imposed to simplify the statement of our main results. It also appeared in, e.g., Chen et al. (2022), where the pairwise comparison design was studied. Our full results in Section 6 are more general, assuming a condition weaker than that in (6) (see (36b) in particular). In short, for every i ∈ [d], we require the set {j ∈ [d] : |θi − θj| ≤ c1β} to contain at most c2 d elements for some constants c1, c2 > 0; in other words, θi should not have too many "neighbors" θj. This weaker condition is satisfied with high probability if θ∗ i are i.i.d. uniform random variables in [−1, 1], for example. With this setup in hand, we are now ready to state our main results. Our first result shows that the EM sequence {θ(t)}t≥0 converges linearly to a limit ˆθ around the ground truth θ∗, and provides an estimation error guarantee in the l∞-norm with high probability. Theorem 1. Consider the model in (1) satisfying Assumption 1. For any fixed constants ρ, D > 0, there exist constants N0, c1, C2 > 0 depending only on ρ and D such that the following holds. For β > 0, suppose θ∗ ∈ Θ(β) as defined in (6). Suppose N ≥ max{d1+ρ, N0} and σ ≤ c1β. Fix θ(0) ∈ H such that ∥θ(0) − θ∗∥∞ ≤ c1β. Let {θ(t)}t≥0 be the EM iterates defined in (5). Moreover, let τ := C2σ log N , T := max 0, log4/3 (cid:26) (cid:24) (cid:18) ∥θ(0) − θ∗∥∞ 4τ (cid:19)(cid:25)(cid:27) . (cid:114) d N Then it holds with probability at least 1 − N −D that 5 • there exists ˆθ ∈ H such that ˆQ(ˆθ) = ˆθ and ∥ˆθ − θ∗∥∞ ≤ 4τ ; • the sequence {θ(t)}t≥0 converges to ˆθ; • ∥θ(T +t) − ˆθ ∥∞ ≤ 8τ /2t for all t ≥ 0. Theorem 1 is proved in Section 6.6 and is a result of Proposition 3. We begin with a discussion of the conditions in the theorem. First, the setting is nearly high-dimensional because we only require N ≥ d1+ρ for an arbitrarily small ρ > 0. We remark that it is possible to improve this condition to N ≥ d * polylog(d) by a more careful application of Proposition 3 at the cost of complicating the conditions on the other parameters (see Section B for details). Focusing on the setting where β is a constant for clarity, we have |θ∗ i = O(1) for all i, j ∈ [d]. The constant-sized noise condition σ ≤ c1β is mild, because it should be compared against the minimum signal strength |θ∗ i+1| ≍ 1/d (see Eq. (6)). Next, the initialization θ(0) has to be close to the true parameter vector θ∗ so that ∥θ(0) − θ∗∥∞ ≤ c1β. This is the sense in which the convergence guarantee is local, and we conjecture that some such condition is necessary (see Section 4 for experimental verification of this conjecture). j | ≍ |i − j|/d, and θ∗ i − θ∗ i − θ∗ (cid:113) d With these conditions assumed, we now explain the conclusions of Theorem 1. It is useful to N log N is the optimal rate3 we expect to have when estimating each entry θ∗ i It is easiest to interpret note that τ ≍ σ of a d-dimensional vector from N samples with probability 1 − N −D. Theorem 1 as a two-stage result for the EM iteration: • First, the quantity T indicates that it takes at most a logarithmic number of steps for the EM iteration to get from distance ∥θ(0) − θ∗∥∞ to an O(τ )-neighborhood around the ground truth θ∗. By the bounds ∥ˆθ − θ∗∥∞ ≤ 4τ and ∥θ(T ) − ˆθ∥∞ ≤ 8τ (by taking t = 0 in the last statement), we have ∥θ(T ) − θ∗∥∞ = O(τ ). Hence, θ(T ) already achieves the optimal rate of estimation in the l∞-norm. • Second, beyond time T , the EM sequence {θ(t)}t≥0 eventually converges to a limit ˆθ, and In other words, the EM operator is locally contractive. the rate of convergence is linear. Moreover, the limit ˆθ lies in the 4τ -neighborhood of θ∗ in the l∞-norm. Finally, we once again remark that the theorem does not require any resampling for the EM iteration. The conclusions of the theorem hold simultaneously on a high-probability event. Our second theorem shows that the limit ˆθ of the EM sequence achieves the sharp estimation error in the l2-norm with high probability in the low-noise regime, in that the constant is also sharp. Theorem 2. In the setting of Theorem 1 (which in particular assumes N ≥ d1+ρ for fixed ρ > 0), we additionally assume σ ≪ β (log N )2 and d ≫ log N . Then it holds with probability at least 1 − N −D that ∥ˆθ − θ∗∥2 2 ≤ (1 + op(1)) σ2 d − 1 2N tr( ˆΣ†). The proof of Theorem 2 is deferred to Section 6.6. Compared to the noise condition σ ≤ c1β in Theorem 1, here we need σ to be smaller by a polylogarithmic factor, and an additional, mild 3In fact, this is the optimal rate even if we consider linear regression without a mixture, i.e., where all the signs zr are known a priori. 6 condition on the dimension. While we assume a random design of xr and thus the right-hand side of the above equation is random, the result can be understood as follows. Conditional on a typical r=1, the squared error ∥ˆθ − θ∗∥2 realization of the covariates (xr)N 2 is within a (1 + o(1)) factor of σ2 d − 1 2N tr( ˆΣ†) = σ2 tr (cid:18)(cid:16) N (cid:88) (cid:17)†(cid:19) xrx⊤ r r=1 (7) with high probability over the randomness of the noise (εr)N r=1. Note that (7) is the optimal rate even for vanilla linear regression with a fixed design (see Section C for more discussion). As a result, we obtain the optimal l2 error (including the sharp constant) for the EM algorithm provided that the initialization is sufficiently informative and the noise level is sufficiently small. 4 Experiments and discussion In this section, we further discuss our model and results, related methods, and possible extensions. Our discussion is accompanied by numerical experiments. 4.1 Failure of random initialization Theorem 1 requires that the initialization of the EM algorithm satisfies ∥θ(0) − θ∗∥∞ ≤ cβ for a constant c > 0. We believe that this is not an artifact of the analysis and that some such condition is necessary. To test this hypothesis, let us numerically test if a "random" initialization suffices for the convergence of EM. i = i d − d+1 For simplicity, we take θ∗ d . Then θ∗ ∈ Θ(β) with 2d for i ∈ [d] so that |θ∗ β = 1. Let θ ∈ Rd be a random vector whose entries are i.i.d. uniform in [−0.5, 0.5]; then define θR = θ−a1 where the scalar a ∈ R is chosen so that 1⊤θR = 0. The vector θR is a canonical random initialization, because the entries of both θR and θ∗ are approximately in the range [−0.5, 0.5], yet θR is random. For η ∈ [0, 1], define θ(0) = θ(0)(η) = (1 − η)θ∗ + η θR, which interpolates between the ground truth θ∗ and the random vector θR. We use θ(0) as the initialization of the EM algorithm and study its performance. Note that i − θ∗ j | = |i−j| ∥θ(0) − θ∗∥∞ = η ∥θR − θ∗∥∞ which is approximately η. Our theory predicts that the EM algorithm performs well when η is a small constant. On the other hand, if a random initialization is not sufficient, then the EM algorithm will have poor performance when η is close to 1. We indeed observe this phenomenon in the left plot of Figure 1. To be more precise, we set d = 50, N = 1000, and σ = 0.1. For η ∈ {0.1, 0.2, . . . , 1}, we start from θ(0) = θ(0)(η) and run the EM algorithm for T = 100 steps4. We plot the initial squared error 2 (solid blue line)5, averaged ∥θ(0) −θ∗∥2 over 100 independent repetitions for each value of η. The error ∥θ(T ) − θ∗∥2 2 for each repetition is 2 (dashed red line) and the eventual squared error ∥θ(T ) −θ∗∥2 4The EM algorithm typically converges within a few steps, especially when the initialization is close to the ground truth, but we make the conservative choice T = 100 to ensure convergence. 5Since the model (1) is invariant if θ∗ is replaced by −θ∗, convergence to a neighborhood of −θ∗ should also be 2} in all our experiments. considered as a success. Hence, we actually compute the error min{∥θ(T ) − θ∗∥2 For brevity, we do no mention this elsewhere. 2, ∥θ(T ) + θ∗∥2 7 Figure 1. Left: Pairwise-comparison design. Right: Gaussian design. We plot the initial squared error ∥θ(0) − θ∗∥2 2 (dashed red line) and the eventual squared error ∥θ(T ) − θ∗∥2 2 (solid blue line) of the EM algorithm against a varying randomness parameter η in the initialization. The experiment for each value of η is averaged over 100 repetitions, and the error ∥θ(T ) − θ∗∥2 2 for each repetition is indicated by a yellow cross. indicated by a yellow cross. As shown by the left plot of Figure 1, an initialization with η ≤ 0.5 leads to an extremely small error ∥θ(T ) − θ∗∥2 2 with high probability, while for an initialization with a larger η, the EM algorithm fails to achieve a small error with constant probability. d I), where the normalization 2 The failure of random initialization in the setting of the pairwise comparison design stands in sharp contrast to its behavior for Gaussian designs, as confirmed by the right plot of Figure 1. The setup and parameters of this experiment are exactly the same as before, except that we now take i.i.d. covariates xr ∼ N (0, 2 d is chosen to match the scaling of xr in Assumption 1. As we see in the figure, the EM algorithm achieves a small error ∥θ(T ) − θ∗∥2 2 with high probability6 even if η is close to 1. We remark that there is a sizable literature on the success of iterative algorithms with random initialization for a variety of problems, such as phase retrieval (Chen et al., 2019), Gaussian mixtures (Dwivedi et al., 2020; Wu and Zhou, 2021), mixtures of log- concave distributions (Qian et al., 2019), and general regression models with Gaussian covariates (Chandrasekher et al., 2021). However, Gaussianity or continuous density is typically part of the assumption, and analyzing iterative algorithms beyond the Gaussian setting appears to be a generally more challenging problem. See also Dudeja et al. (2022); Wang et al. (2022) for recent work in this direction in the framework of approximate message passing. An interesting open problem is to offer an explanation for the contrasting behavior of the randomly initialized EM algorithm given the two types of covariates. We speculate that random initialization tends to fail if the covariates are discrete and sparse. Note that our covariates xr are supported in the highly structured set {ei − ej : (i, j) ∈ (cid:0)[d] (cid:1)}, unlike the Gaussian covariates which are in general positions in Rd. However, we do not have a theoretical explanation for this phenomenon and leave the question to future work. 2 6The occasional failures of random initialization with η = 1 can be explained by a few factors, such as our moderate choices of d and N , the nontrivial error probability, etc. 8 0.20.40.60.81024680.20.40.60.8102468 4.2 Spectral method, initialization, and comparison Spectral methods form another popular class of algorithms for tackling mixture models and the Euclidean distance geometry problem. One canonical spectral method for localizing points given their pairwise distances is the classical multidimensional scaling (Borg and Groenen, 2005). It takes the following form for model (1). Define a matrix D ∈ Rd×d that stores noisy pairwise distances by Dij = Dji = d(d − 1) 2N N (cid:88) (y2 r − σ2) 1{xr = ei − ej}. r=1 Since E[y2 that r − σ2 | xr = ei − ej] = E[(θ∗ i − θ∗ j )2 + 2εrzr(θ∗ i − θ∗ j ) + ε2 r − σ2 | xr] = (θ∗ i − θ∗ j )2, we see E[Dij] = (θ∗ i − θ∗ j )2. In other words, E[D] stores the pairwise distances between the entries of θ∗. Let J = I − 1 d 11⊤ where I is the identity matrix in Rd×d and 1 is the all-ones vector in Rd. Using that E[D] is the pairwise distance matrix, it is not hard to verify that − 1 2 J E[D]J = θ∗(θ∗)⊤, which is the Gram matrix of θ∗. Therefore, if (λ1, v1) is the leading eigenpair of the matrix − 1 then we can use ̃θ = λ1 v1 as an estimator of θ∗. √ 2 JDJ, Using standard spectral perturbation theory and random matrix theory, it is straightforward to analyze the error ̃θ − θ∗ in either the l2 or l∞ norm (see, e.g., Chen et al. (2021)). We do not provide a theoretical analysis of ̃θ in this work, but let us discuss it qualitatively. There are two sources of error in the spectral estimator ̃θ: the noise εr, which is inevitable, and the incompleteness (cid:1), if we never have xr = ei − ej for a pair of indices (i, j), then of observations. In the regime N < (cid:0)d 2 j )2. As a result, the spectral estimator ̃θ does not recover θ∗ even Dij = 0 while E[Dij] = (θ∗ if σ → 0. On the other hand, the limit of the EM algorithm ˆθ recovers θ∗ as shown by Theorem 2 in this regime. Nevertheless, this does not mean that the spectral estimator is useless, because it can be used as an initialization of the EM algorithm. The experiment exhibited in the left plot of Figure 2 confirms these observations. i − θ∗ In the left plot of Figure 2, we set d = 50, N = 1000, and let the noise variance σ2 vary from 0.002 to 2. Let us first focus on the performance of estimators in the small-noise regime. When σ → 0, the squared error ∥ ̃θ − θ∗∥2 2 of the spectral method (dash-dotted red line) does not converge to zero. However, we can set θ(0) = ̃θ and run the EM algorithm from this initialization for T = 20 steps. The squared error ∥θ(T ) − θ∗∥2 2 (solid blue line) goes to zero as σ → 0. Recall that Theorem 2 predicts a sharp optimal rate (7) for the EM algorithm in the small-noise regime. We also plot this optimal error (dashed yellow line) and observe that it is very close to the actual error ∥θ(T ) − θ∗∥2 2 as σ → 0. In addition, we consider the Easy-EM iteration with θ(t+1) = ̄Q(θ(t)) where ̄Q is defined in (4a). Compared to the EM iteration, Easy-EM does not have the multiplication by ˆΣ† at each step, which turns out to be crucial: We observe that the Easy-EM algorithm (dotted green line) fails to achieve a small error as σ → 0. Next, we consider the regime of large noise in the left plot of Figure 2. The error of the EM algorithm no longer follows the sharp rate predicted by Theorem 2, which suggests that some condition on the noise may be necessary for this theorem (although the condition σ ≪ β (log N )2 we 9 Figure 2. Left: Varying noise standard deviation. Right: Varying sample size. The log-log plots show the performance of different algorithms against the varying parameters. The squared error ∥ ̃θ − θ∗∥2 2 for the spectral estimator is shown in dash-dotted red lines. The EM and Easy-EM algorithms are initialized with θ(0) = ̃θ and run for T = 20 steps. Their eventual squared errors ∥θ(T ) − θ∗∥2 2 are shown in solid blue lines and dotted green lines respectively. The experiment for each value of σ2 or N is averaged over 100 independent repetitions. The theoretically predicted optimal rate is shown in dashed yellow lines. impose may not be optimal). Nevertheless, the EM and Easy-EM algorithms still improve upon the spectral initialization, and all the three algorithms appear to differ only by a constant factor from the optimal rate as σ2 grows. To further investigate the rate of estimation achieved by these algorithms, we consider another experiment shown in the right plot of Figure 2. We take d = 50, σ = 0.1, and let the sample size N vary from 500 to 2000. We again run the EM and the Easy-EM algorithm from the spectral initialization θ(0) = ̃θ for T = 20 steps, and plot the squared errors. Given that the noise is small, the optimal rate from Theorem 2 accurately predicts the actual error of the EM algorithm. The spectral estimator and the Easy-EM algorithm clearly have worse performance, but their rates of estimation appear to be optimal as N grows. 4.3 Extensions of the model There are several directions for extending our model. For example, one may consider a mixture of k linear regressions yr = x⊤ r θ[lr] + εr, where we have θ[1], . . . , θ[k] ∈ Rd and (lr)N satisfying wl ≥ 0 and (cid:80)k the identifiability of the mixture model is a nontrivial open problem. l=1 wlδl with weights l=1 wl = 1. When the covariates xr are from a discrete distribution, even r=1 are i.i.d. from the distribution (cid:80)k To see the difficulty of the problem, let us consider a negative example. Suppose that we have a mixture of k = 3 equally weighted linear regressions, and the covariates are pairwise comparisons 10 10-210-110010-210050010001500200010-210-1100 xr = eir − ejr for ir, jr ∈ [d]. For simplicity, suppose that the noise εr is zero. Let θ[1] =        , θ[2] =        1 2 θ3 ... θd        3 3 θ3 ... θd        , θ[3] =        2 4 θ3 ... θd        , ̃θ[1] =        , ̃θ[2] =        2 2 θ3 ... θd        1 3 θ3 ... θd        , ̃θ[3] =        ,        3 4 θ3 ... θd where the unspecified entries θ3, . . . , θd can take any values. It is not hard to see that, even if we observe the sets (cid:110) i − θ[l] θ[l] j : l = 1, 2, 3 for all (i, j) ∈ (cid:111) (cid:19) (cid:18)[d] 2 with no noise, the two mixtures {θ[l] : l = 1, 2, 3} and { ̃θ[l] : l = 1, 2, 3} yield the same sets of observations. As a consequence, the mixture model with 3 components is not identifiable with the pairwise comparison design. Therefore, to have an identifiable mixture model with multiple components, it is necessary to assume a richer design of covariates xr. Instead of pairwise comparisons, one may consider comparisons between multiple objects as in the Plackett–Luce model (Luce, 1959; Plackett, 1975) or groups of pairwise comparisons used for mixtures of permutations (Mao and Wu, 2022). We leave this interesting topic to future research. Beyond a mixture of linear regressions with additive noise, one may consider a mixture of generalized linear regressions (see, e.g., Heumann et al. (2008); Sun et al. (2014); Sedghi et al. (2016)), and in particular, the case of binary response is of practical interest in classification tasks. Similar to the linear setting, existing theories for mixtures of generalized linear models are often based on a Gaussian or continuous design. In the discrete setting, there have been a series of recent works on mixtures of the Placket–Luce or multinomial logit models motivated by ranking tasks (see, e.g., Zhao et al. (2016); Mollica and Tardella (2017); Chierichetti et al. (2018); Liu et al. (2019); Zhao et al. (2022)). In particular, Zhang et al. (2022) show that a mixture of two Bradley– Terry–Luce models (i.e., logistic regressions with the pairwise comparison design) are identifiable except when the parameters are in a set of measure zero. Very recently, Nguyen and Zhang (2023) provide a spectral initialization and an accurate implementation of the EM algorithm for learning a mixture of Plackett–Luce models. It would be interesting to analyze the convergence of iterative algorithms such as the EM algorithm for these models. Along another direction, one may extend the model (2) to the noisy Euclidean distance geometry d ∈ Rm based on problem in dimension m > 1. Namely, we aim to estimate vectors θ∗ incomplete, noisy observations of pairwise distances ∥θ∗ j ∥2. While this problem and its variants have long been studied (see the survey by Liberti et al. (2014)), progress in understanding the sample complexity has been made only in recent years using tools of matrix completion (Lai and Li, 2017; Tasissa and Lai, 2018), and the theory is even less complete in the noisy setting (Drusvyatskiy et al., 2017; Sremac et al., 2019). Compared to semidefinite programs used in many of these works, iterative algorithms are faster to run, but remain to be understood for this problem. 1, . . . , θ∗ i − θ∗ 5 Proof techniques We now informally discuss the strategies and key ingredients in the proofs of our main results; full proofs are provided in Section 6. 11 5.1 Contraction in the l∞ norm The first main result of this work is the linear convergence of the EM iteration in the l∞-norm in Theorem 1. To shed light on this result, let us first consider the zero-noise limit of the EM algorithm for simplicity. Suppose that the noise εr is zero in (1). Letting σ → 0 in (5), we see that the EM iteration becomes θ(t+1) = (cid:18) N (cid:88) xrx⊤ r (cid:19)† N (cid:88) r=1 r=1 sign(yr x⊤ r θ(t)) yrxr (8) for t ≥ 0, where sign(a) = 1 if a > 0, sign(a) = 0 if a = 0, and sign(a) = −1 if a < 0. In fact, this is equivalent to the alternating minimization procedure where we iteratively compute • z(t) r := minz∈{−1,1}(yr − z x⊤ r θ(t))2 = sign(yr x⊤ r θ(t)) for r ∈ [N ]; • θ(t+1) := minθ∈H (cid:80)N r=1(yr − z(t) r x⊤ r θ)2 = (cid:16)(cid:80)N r=1 xrx⊤ r (cid:17)† (cid:80)N r=1 z(t) r yrxr. We now explain why the iteration (8) contracts to θ∗ locally. By slightly abusing the notation, we denote (only in this subsection) the noiseless Easy-EM and EM operators respectively by ̄Q(θ) = d − 1 2N N (cid:88) r=1 sign(yr x⊤ r θ) yrxr, ˆQ(θ) = ˆΣ† ̄Q(θ), where the sample covariance ˆΣ is defined in (3). We first note that θ∗ is a fixed point of the operator ˆQ. Indeed, since yr = zrx⊤ r θ∗, we have ˆQ(θ∗) = (cid:18) N (cid:88) xrx⊤ r (cid:19)† N (cid:88) r=1 r=1 sign (cid:16) zr(x⊤ r θ∗)2(cid:17) zr(x⊤ r θ∗)xr = (cid:18) N (cid:88) xrx⊤ r (cid:19)† N (cid:88) r=1 r=1 xrx⊤ r θ∗ = θ∗. Next, fix θ ∈ H in an l∞ neighborhood of θ∗. We have ˆQ(θ) − θ∗ = ˆΣ† (cid:0) ̄Q(θ) − ̄Q(θ∗)(cid:1), so ∥ ˆQ(θ) − θ∗∥∞ ≤ ∥ ˆΣ†∥∞ (cid:13) ̄Q(θ) − ̄Q(θ∗)(cid:13) (cid:13) (cid:13)∞ , (9) It remains to show, for example, that for a quantity where ∥ ˆΣ†∥∞ := maxv∈H:∥v∥∞=1 ∥ ˆΣ†v∥∞. L > 0, we have ∥ ˆΣ†∥∞ ≤ L, so that we have the desired contraction ∥ ˆQ(θ) − θ∗∥∞ ≤ 1 In fact, bounding ∥ ˆΣ†∥∞ is one of the most important and technical steps of our proof. We discuss this step in more detail in Section 5.3 below and establish a bound formally in Proposition 2. For the remaining portion of the proof, we must bound (cid:13) (cid:13) ̄Q(θ) − ̄Q(θ∗)(cid:13) (cid:13)∞. Note that ̄Q(θ) − ̄Q(θ∗) = d − 1 2N N (cid:88) (cid:104) r=1 sign (cid:0)yrx⊤ r θ(cid:1) − sign (cid:0)yrx⊤ r θ∗(cid:1)(cid:105) yrxr. (10) If θ is in an l∞ neighborhood of θ∗, i.e., θ is close to θ∗ entrywise, then x⊤ r θ(cid:1) will coincide with sign (cid:0)yrx⊤ to x⊤ . As a result, sign (cid:0)yrx⊤ r θ∗ = θ∗ ir − θ∗ jr r θ = θir − θjr is close r θ∗(cid:1) for most r ∈ [N ], 12 (cid:13) ̄Q(θ) − ̄Q(θ∗)(cid:13) (cid:13) , (cid:13)∞ ≤ 1 2L 2 ∥θ − θ∗∥∞. and a majority of terms in the above sum will vanish. Based on this intuition, we can perform an entrywise analysis of ̄Q(θ) − ̄Q(θ∗) and obtain a bound on ∥ ̄Q(θ) − ̄Q(θ∗)∥∞. We omit the details. In the noisy setting, the strategy for analyzing the EM iteration (5) is similar to the above noiseless analysis. However, there are complications due to the presence of noise. First, the fixed point of the EM operator ˆQ is the random vector ˆθ, not the deterministic vector θ∗. Therefore, we cannot directly show Q(ˆθ) = ˆθ; rather, it follows as a consequence of ˆQ being a contraction locally around θ∗. Second, to prove that ˆQ is contractive, we again reduce it to analyzing the Easy-EM operator ̄Q via (9), but now for θ, θ′ ∈ H, ̄Q(θ) − ̄Q(θ′) = d − 1 2N N (cid:88) (cid:20) r=1 tanh (cid:17) (cid:16) yr x⊤ r θ σ2 − tanh (cid:17)(cid:21) (cid:16) yr x⊤ r θ′ σ2 yrxr. As the function tanh(*) is a soft approximation of the sign(*) function in (10), the intuition for why we can control ̄Q(θ) − ̄Q(θ′) remains the same, but a more quantitative analysis is necessary. See Section 6.4 for details. 5.2 Expansion around the ground truth Our second main result is the sharp l2 bound for the EM fixed point ˆθ in Theorem 2. The strategy for proving this result consists in an expansion of ˆθ around the ground truth θ∗. Recall the definitions of ̄Q and ˆQ in (4). Since ˆθ is a fixed point of ˆQ, we have ˆθ − θ∗ = ˆQ(ˆθ) − ˆQ(θ∗) + ˆQ(θ∗) − θ∗ = ˆΣ† d − 1 2N N (cid:88) (cid:18) r=1 tanh ˆθ (cid:17) (cid:16) yrx⊤ r σ2 − tanh (cid:16) yrx⊤ r θ∗ σ2 (cid:17)(cid:19) yrxr + ˆQ(θ∗) − θ∗. Applying Taylor's expansion of the function tanh(*), we obtain ˆθ − θ∗ ≈ ˆΣ†A(ˆθ − θ∗) + ˆQ(θ∗) − θ∗, σ2 tanh′ (cid:16) yrx⊤ where A := d−1 2N ∥ ˆΣ†A(ˆθ − θ∗)∥2 ≪ ∥ˆθ − θ∗∥2 and so (cid:80)N r=1 y2 r r θ∗ σ2 (cid:17) xrx⊤ r . By analyzing the matrix A, we then show that ∥ˆθ − θ∗∥2 ≈ ∥ ˆQ(θ∗) − θ∗∥2. It remains to study how far the one-step EM iterate ˆQ(θ∗) moves away from the ground truth θ∗. Since ˆQ(θ∗) is an independent sum conditional on the covariates x1, . . . , xN , and θ∗ is deterministic, we can apply tools from matrix concentration to obtain the desired sharp bound ∥ ˆQ(θ∗) − θ∗∥2 2 ≤ (1 + o(1)) σ2 d − 1 2N tr( ˆΣ†). 5.3 Infinity operator norm of the inverse covariance As discussed in Section 5.1 above, a key ingredient in our analysis of the EM iteration is an upper bound on ∥ ˆΣ†∥∞ := maxv∈H:∥v∥∞=1 ∥ ˆΣ†v∥∞. Recall that E[ ˆΣ] is the identity map on H by the 13 discussion after the definition of ˆΣ in (3). Hence, it is plausible that ˆΣ and ˆΣ† have bounded norms. To prove ∥ ˆΣ†∥∞ ≤ L for a quantity L > 0, we start with the relation (see Lemma 3) ∥ ˆΣ†∥∞ = (cid:16) min u∈H:∥u∥∞=1 ∥ ˆΣu∥∞ (cid:17)−1 . It therefore suffices to prove min u∈H:∥u∥∞=1 ∥ ˆΣu∥∞ ≥ 1/L. (11) The proof of (11) is the most technical step in our analysis and spans Lemmas 4, 5, 6, 7, and Proposition 2. In short, it is not sufficient to control ∥ ˆΣu∥∞ for each fixed u and then apply a union bound. Instead, we carefully split the constraint set {u ∈ H : ∥u∥∞ = 1} into a union of subsets according to the sizes of entries u1, . . . , ud. On each subset consisting of vectors u, we use the specific properties of sizes of entries u1, . . . , ud to bound ∥ ˆΣu∥∞ simultaneously for all u in that subset. Finally, we combine all the subsets using a union bound. See Section 6.2 for details. While (11) arises as a technical ingredient in our work, we believe the analysis of the quantity minu∈H:∥u∥∞=1 ∥ ˆΣu∥∞ is interesting in its own right in view of its connection to the literature. First, consider the graph G with vertex set [d] and edge set {(ir, jr) : xr = eir − ejr , r ∈ [N ]}. Then (cid:1)(cid:1) except that the edges are sampled with the graph G resembles an Erd ̋os–R ́enyi graph G(cid:0)d, N/(cid:0)d 2 replacement. Moreover, it is not hard to see that ˆΣ is a rescaled version of the Laplacian matrix of the graph G, which is a well-researched object. In fact, if the l∞-norms in (11) were replaced by the l2-norms, then the quantity minu∈H:∥u∥2=1 ∥ ˆΣu∥2 would be the second-smallest eigenvalue of the Laplacian matrix, known as the algebraic connectivity or the Fiedler value. This eigenvalue for an Erd ̋os–R ́enyi graph has long been studied; see, e.g., Feige and Ofek (2005); Coja-Oghlan (2007); Chung and Radcliffe (2011); Kolokolnikov et al. (2014). However, we are not aware of an existing bound for the l∞-norm that would imply (11). Moreover, if the minimization problem in (11) were over u ∈ {−1, 1}d, then it would be related to the vast literature on discrepancy theory: minu∈{−1,1}d ∥ ˆΣu∥∞ is the combinatorial discrepancy of the matrix ˆΣ. We refer the interested reader to the celebrated work by Spencer (1985) which has generated extensive research on this topic, and see, e.g., Perkins and Xu (2021); Abbe et al. (2022); Altschuler (2022) for recent breakthroughs. The relaxation that we study is thus a natural object. 5.4 Proof organization Finally, we overview how the proofs are organized in Section 6. Recall that our results do not require a fresh sample for each step of the EM iteration. To achieve this, we first condition on a high- probability event globally, and then show that the EM operator is contractive deterministically on this event. More precisely, this high-probability event consists of two sets of conditions: Section 6.1 proves that certain preliminary conditions hold for the observations (xr, yr)N r=1 with high probability (Lemma 1); Section 6.2 mainly establishes a high probability bound on ∥ ˆΣ†∥∞ (Proposition 2) together with a few other conditions on ˆΣ. With these conditions assumed, Lemma 12 in Section 6.4 shows that the EM operator is contractive locally around θ∗, and note that this lemma is completely deterministic. Finally, using an additional bound on ∥ ˆQ(θ∗) − θ∗∥∞ in Section 6.3, Proposition 3 in Section 6.4 summarizes the convergence of the EM sequence and directly leads to Theorem 1. 14 For Theorem 2, we first need a sharp analysis of ∥ ˆQ(θ∗)−θ∗∥2 in Section 6.3: its expectation and concentration are controlled by Lemmas 10 and 11 respectively. Then, in Section 6.5, we analyze the lower order terms and conclude with Proposition 4, which immediately implies Theorem 2. 6 Analysis of the EM algorithm Throughout the proof section, we use C, C1, C′, etc., to denote universal, positive constants that may change from line to line. Recall the definitions of ̄Q and ˆQ in (4) and that yr = zr x⊤ r θ∗ + εr where zr = ±1. Since tanh(*) is an odd function, we may assume without loss of generality that zr = 1 for all r = 1, . . . , N , which does not change the EM operator. Therefore, we take the liberty r θ∗ + εr when analyzing the EM operator. of assuming that the observations take the form yr = x⊤ 6.1 Preliminaries For i ∈ [d], define Ri to be the set of indices r ∈ [N ] for which the entry (xr)i is non-zero, i.e., Ri := (cid:8)r ∈ [N ] : xr = ±(ei − ej), j ∈ [d] \ {i}(cid:9), (12) where ± is + if i < j and is − if i > j. In addition, for a fixed separation parameter ∆ > 0, define Si(∆) := {j ∈ [d] \ {i} : |θ∗ Ri(∆) := {r ∈ [N ] : xr = ±(ei − ej), j ∈ Si(∆)}. j | ≤ ∆} i − θ∗ and (13a) (13b) In other words, Si(∆) is the set of indices j such that θ∗ consisting of indices r ∈ [N ] for which xr compares θ∗ j is close to θ∗ i , and Ri(∆) is a subset of Ri i to a nearby parameter θ∗ j . Lemma 1. There is an absolute constant C > 0 such that the following holds for any δ ∈ (0, 0.1). Suppose that N ≥ Cd log d δ . It holds with probability at least 1 − δ that, for all i ∈ [d] and all ∆ ≥ σ: • 1.9N d ≤ |Ri| ≤ 2.1N d ; r∈Ri(∆) |yr| ≤ C∆ (cid:0)|Si(∆)| N r ≤ C∆2 (cid:0)|Si(∆)| N r∈Ri(∆) y2 • (cid:80) • (cid:80) d2 + log d δ d2 + log d δ (cid:1); (cid:1). Proof. For a fixed i ∈ [d], each xr is equal to ±(ei − ej) for some j ∈ [d] \ {i} with probability (d − 1)/(cid:0)d (cid:1) = 2/d. Hence |Ri| ∼ Bin (N, 2/d). It then follows from a binomial tail bound for any 2 δ ∈ (0, 0.1) that (cid:12) (cid:12) |Ri| − (cid:12) (cid:12) 2N d (cid:12) (cid:12) (cid:12) (cid:12) (cid:114) ≤ C1 N d log d δ + C1 log d δ with probability at least 1 − δ and using the condition N ≥ Cd log d Similarly, |Ri(∆)| ∼ Bin (cid:0)N, 2|Si(∆)| d(d−1) (cid:1) and d for an absolute constant C1 > 0. Taking a union bound over i ∈ [d] δ , we obtain the desired bound on |Ri|. |Ri(∆)| ≤ 2N |Si(∆)| d(d − 1) + C2 (cid:115) N |Si(∆)| d(d − 1) log d δ + C2 log d δ ≤ 3N |Si(∆)| d(d − 1) + C3 log d δ 15 with probability at least 1 − δ d2 for absolute constants C2, C3 > 0. Condition on Ri(∆) henceforth. For r ∈ Ri(∆), we have |yr| = |x⊤ r ≤ 2∆2 + 2ε2 y2 r. Consequently, by a sub-Gaussian tail bound on (cid:80) r θ∗ + εr| ≤ ∆ + |εr| and so r∈Ri(∆) |εr|, we obtain (cid:88) r∈Ri(∆) |yr| ≤ ∆ |Ri(∆)| + (cid:88) r∈Ri(∆) |εr| ≤ ∆ |Ri(∆)| + (cid:114) σ |Ri(∆)| + C4σ |Ri(∆)| log (cid:114) 2 π d δ with probability at least 1 − δ (cid:80) r∈Ri(∆) ε2 r, we obtain d2 for an absolute constant C4 > 0. Moreover, by a χ2 tail bound on (cid:88) r∈Ri(∆) r ≤ 2∆2 |Ri(∆)|+2 y2 (cid:88) r∈Ri(∆) r ≤ 2∆2 |Ri(∆)|+2σ2 |Ri(∆)|+C5σ2(cid:16)(cid:114) ε2 |Ri(∆)| log d δ +log (cid:17) d δ with probability at least 1 − δ d2 for an absolute constant C5 > 0. Combining the above three bounds and using the condition ∆ ≥ σ, we obtain (cid:88) |yr| ≤ 2∆ r∈Ri(∆) (cid:16) 3N |Si(∆)| d(d − 1) + C3 log (cid:17) d δ + C4σ (cid:115) (cid:16) 3N |Si(∆)| d(d − 1) + C3 log (cid:17) d δ log d δ ≤ 7N ∆|Si(∆)| d(d − 1) + C6∆ log d δ for an absolute constant C6 > 0 and (cid:88) r∈Ri(∆) r ≤ 4∆2 (cid:16) 3N |Si(∆)| y2 d(d − 1) + C3 log (cid:17) d δ + C5σ2 (cid:18)(cid:115) (cid:16) 3N |Si(∆)| d(d − 1) + C3 log (cid:17) d δ log d δ + log (cid:19) d δ ≤ 13N ∆2|Si(∆)| d(d − 1) + C7∆2 log d δ for an absolute constant C7 > 0. Finally, note that the sets Si(∆) are nested as ∆ varies, and Si(∆) can take at most d−1 values; hence, the same statements are true for Ri(∆). We can then take a union bound over all (≤ d − 1) possibilities for Ri(∆) as ∆ varies, together with a union bound over i ∈ [d] to conclude. 6.2 Sample covariance In this section, we study the sample covariance matrix (3). Recall that H denotes the orthogonal complement of 1 in Rd, and the pseudoinverse ˆΣ† is the inverse of ˆΣ when viewed as a map on H. We first bound the spectral norms of ˆΣ and ˆΣ†. Proposition 1. There is an absolute constant C > 0 such that the following holds for any δ ∈ (0, 0.1). If N ≥ Cd log d δ , then with probability at least 1 − δ, • ∥ ˆΣ∥op ≤ 3; • ˆΣ has d − 1 nonzero eigenvalues; 16 • ∥ ˆΣ†∥op ≤ 5. Proof. Since ˆΣ is positive semidefinite, we have ∥ ˆΣ∥op = λmax( ˆΣ). Let us first upper-bound λmax( ˆΣ). Let v ∈ Rd such that ∥v∥2 = 1. By the definition (3), we have v⊤ ˆΣv = d − 1 2N N (cid:88) (x⊤ r v)2 = r=1 d − 1 2N N (cid:88) r=1 (vir − vjr )2 ≤ d − 1 N N (cid:88) (v2 ir + v2 jr ) = r=1 d − 1 N d (cid:88) i=1 |Ri|v2 i , where the inequality follows since (a − b)2 ≤ 2(a2 + b2) for any a, b ∈ R, and Ri is defined in (12). By the bound on |Ri| from Lemma 1, we conclude that with probability at least 1 − δ, ∥ ˆΣ∥op = max v∈Rd:∥v∥2=1 v⊤ ˆΣv ≤ d − 1 N * 2.1N d ≤ 3. Note since ˆΣ† is also positive semidefinite, we have ∥ ˆΣ†∥op = λmax( ˆΣ†). Furthermore, we have λmax( ˆΣ†) = 1/λ, where λ is the minimum nonzero eigenvalue of ˆΣ. It suffices to lower-bound the smallest eigenvalue of ˆΣ as a map on H, and then this eigenvalue is precisely λ. To this end, let us make a few definitions. First define the set Then define the random matrices S := {v ∈ H : ∥v∥2 = 1}. D ∈ Rd×d, such that Dij = A ∈ Rd×d, such that Aij = (cid:26) |Ri| 0 (cid:26) (cid:80)N r=1 i = j, i ̸= j, 1{xr = ±(ei − ej)} i ̸= j, i = j, 0 M = N (cid:1) (J − I) − A, (cid:0)d 2 where J = 11⊤. With these in hand, we have the following λ = min v∈S v⊤ ˆΣv = d − 1 2N min v∈S v⊤(D − A)v ≥ d − 1 2N (cid:18) min v∈S v⊤Dv − max u∈S (cid:19) u⊤Au . Let us consider the first term. We have min v∈S v⊤Dv = min v∈S d (cid:88) i=1 |Ri|v2 i ≥ min v∈S d (cid:88) i=1 1.9N d v2 i = 1.9N d , (14) (15) where the inequality holds with probability at least 1 − δ by Lemma 1. Let us now consider the second term. Note that (I − J)u = u for u ∈ S. By the definition of A, we have max u∈S u⊤Au = max u∈S u⊤(−M )u + ≤ max u,v∈S u⊤(−M )v + N (cid:1) u⊤(I − J)u (cid:0)d 2 N (cid:1) (cid:0)d 2 ≤ ∥(−M )∥op + N (cid:1) = ∥M ∥op + (cid:0)d 2 N (cid:1) . (cid:0)d 2 17 (16) It remains to bound ∥M ∥op using Lemma 17. To this end, let us define random matrices Xr = 1 (cid:1) (J − I) − (cid:0)d 2 (cid:88) 1≤i<j≤d 1{xr = ±(ei − ej)}(eie⊤ j + eje⊤ i ), and then M = (cid:80)N r=1 Xr. First, let us show E[Xr] = 0. We have (cid:18) 1 (cid:1) (J − I) − (cid:0)d 2 (cid:88) 1≤i<j≤d 1 (cid:1) (eie⊤ (cid:0)d 2 j + eje⊤ i ) = E[Xr] = 1 (cid:1) (cid:0)d 2 J − I − (cid:19) eie⊤ j = 0. (cid:88) i̸=j Next, we find a bound on ∥Xr∥op. Note that (cid:80) With this in mind, we have 1≤i<j≤d 1{xr = ±(ei − ej)} = 1 for every r ∈ [N ]. ∥Xr∥op ≤ 1 (cid:1) (∥J∥op + ∥I∥op) + (cid:0)d 2 (cid:88) 1≤i<j≤d 1{xr = ±(ei − ej)} ∥eie⊤ j + eje⊤ i ∥op = d + 1 (cid:0)d 2 (cid:1) + 1 ≤ 2. Finally, we need a bound on ∥ (cid:80)N r=1 E[X 2 r ]∥op. To this end, we compute X 2 r = 1 (cid:1)2 ((d − 2)J + I) + (cid:0)d 2 (cid:88) 1≤i<j≤d 1{xr = ±(ei − ej)}(eie⊤ i + eje⊤ j ) − 1 (cid:1) (cid:0)d 2 (cid:88) 1≤i<j≤d 1{xr = ±(ei − ej)} (cid:16) which implies 1e⊤ j + 1e⊤ i + ei1⊤ + ej1⊤ − 2(eie⊤ (cid:17) j + eje⊤ i ) , E[X 2 r ] = 1 (cid:1)2 ((d − 2)J + I) + (cid:0)d 2 1 (cid:1) (cid:0)d 2 (cid:88) (eie⊤ i + eje⊤ j ) 1≤i<j≤d − 1 (cid:1)2 (cid:0)d 2 (cid:88) (cid:16) 1≤i<j≤d 1e⊤ j + 1e⊤ i + ei1⊤ + ej1⊤ − 2(eie⊤ (cid:17) j + eje⊤ i ) = = Finally, we have 1 (cid:1)2 ((d − 2)J + I) + (cid:0)d 2 d − 1 (cid:0)d 2 (cid:1) I − 1 (cid:1)2 ((d − 2)J + I). (cid:0)d 2 d − 1 (cid:0)d 2 (cid:1) I − 2 (cid:1)2 ((d − 2)J + I) (cid:0)d 2 v(M ) = (cid:13) (cid:13)N E[X 2 1 ](cid:13) (cid:13)op ≤ N (cid:18) 2 d + 4(d − 1)2 d2(d − 1)2 (cid:19) ≤ 4N d . By Lemma 17, we have that for some absolute constant C′ > 0, ∥M ∥op ≤ C′ (cid:32)(cid:114) N d log d δ + log (cid:33) , d δ with probability at least 1 − δ. 18 Putting the above together with (15) and (16), we have min v∈S v⊤Dv − max u∈S u⊤Au ≥ 1.9N d − N (cid:1) − C′ (cid:0)d 2 (cid:32)(cid:114) N d log d δ + log (cid:33) , d δ with probability at least 1 − 2δ. Since d ≥ 3, combining this with (14) yields that for some absolute constant C′′ > 0, λ ≥ 0.3 − C′′ (cid:32)(cid:114) d N log d δ + d N log d δ (cid:33) , with probability at least 1 − 2δ. In particular, for N ≥ C d log d δ , we have λ ≥ 0.2 and with probability at least 1 − 2δ. ∥ ˆΣ†∥op = 1/λ ≤ 5 Lemma 2. There is an absolute constant C > 0 such that the following holds for any δ ∈ (0, 0.1). Suppose that N ≥ Cd log d δ . With probability at least 1 − δ, we have tr( ˆΣ†) ≥ (d − 1)/3. Proof. Condition on the event where the bounds in Proposition 1 hold. Let λ1 ≥ * * * ≥ λd−1 > 0 be the nonzero eigenvalues of ˆΣ. Then we have λ1 ≤ 3 and so tr( ˆΣ†) = (cid:80)d−1 i=1 ≥ d−1 3 . 1 λi For any linear map A : H → H, define the norm ∥A∥∞ := max v∈H:∥v∥∞=1 ∥Av∥∞. We bound the norm ∥ ˆΣ†∥∞ in the rest of this section: starting with Lemmas 4, 5, 6, and 7, the bound is completed in Proposition 2. Lemma 3. Suppose that Then we have min u∈H:∥u∥∞=1 ∥ ˆΣu∥∞ > 0. (cid:18) ∥ ˆΣ†∥∞ = (cid:19)−1 ∥ ˆΣu∥∞ min u∈H:∥u∥∞=1 Proof. By the assumption, there is no vector u ∈ H such that ˆΣu = 0, so ˆΣ is invertible on H. Then we have . ∥ ˆΣ†∥∞ = max v∈H:∥v∥∞=1 ∥ ˆΣ†v∥∞ = max u∈H:∥ ˆΣu∥∞=1 ∥u∥∞ = max u∈H:∥ ˆΣu∥∞>0 ∥u∥∞ ∥ ˆΣu∥∞ = max u∈H:∥u∥∞=1 1 ∥ ˆΣu∥∞ which yields the desired result. Lemma 4. There exists an absolute constant C > 0 such that the following holds for any fixed δ ∈ (0, 0.1), κ ∈ (0, 1], and u ∈ H with ∥u∥∞ = 1. Define I := {i ∈ [d] : ui ≥ κ}. Suppose that N |I| ≥ d log 1 δ . With probability at least 1 − δ, we have ∥ ˆΣu∥∞ ≥ κ − C (cid:115) d N |I| log 1 δ . 19 Proof. For any i ∈ [d], we have ( ˆΣu)i = d (cid:88) j=1 ˆΣijuj = d (cid:88) j=1 ˆΣij(uj − ui), since (cid:80)d j=1 ˆΣij = ( ˆΣ1)i = 0. Then, by the definition of ˆΣ, ( ˆΣu)i = d − 1 2N (cid:88) N (cid:88) j∈[d]\{i} r=1 (cid:0)xrx⊤ r (cid:1) ij(uj − ui) = d − 1 2N N (cid:88) (cid:88) (ui − uj)1{xr = ±(ei − ej)}. (17) r=1 j∈[d]\{i} Then it holds that ∥ ˆΣu∥∞ ≥ 1 |I| (cid:88) i∈I ( ˆΣu)i = d − 1 2N |I| N (cid:88) (cid:88) (cid:88) (ui − uj)1{xr = ±(ei − ej)}. (18) r=1 i∈I j∈[d]\{i} For any r ∈ [N ], define Xr := d − 1 2 (cid:88) (cid:88) i∈I j∈[d]\{i} (ui − uj)1{xr = ±(ei − ej)}. Then we have E[Xr] = d − 1 2 (cid:88) (cid:88) (ui − uj) i∈I j∈[d]\{i} 2 d(d − 1) (cid:88) = i∈I dui − (cid:80)d d j=1 uj (cid:88) = ui ∈ (cid:2)κ |I|, |I|(cid:3) i∈I since (cid:80)d j=1 uj = 0 and κ ≤ ui ≤ ∥u∥∞ = 1 for i ∈ I. Moreover, it follows that |Xr − E[Xr]| ≤ |Xr| + E[Xr] ≤ d * 2∥u∥∞ + |I| ≤ 3d and that Var(Xr) ≤ E[X 2 r ] = (d − 1)2 4 (cid:88) (cid:88) (ui − uj)2 i∈I j∈[d]\{i} 2 d(d − 1) ≤ 2d |I|. Since X1, . . . , XN are independent, Bernstein's inequality together with (18) implies that ∥ ˆΣu∥∞ ≥ 1 N |I| N (cid:88) r=1 Xr ≥ κ − C1 (cid:18)(cid:115) d N |I| log 1 δ + d N |I| log (cid:19) 1 δ with probability at least 1 − δ for an absolute constant C1 > 0. This completes the proof since N |I| ≥ d log 1 δ by assumption. Lemma 5. There exists an absolute constant C > 0 such that the following holds for any fixed δ ∈ (0, 0.1) and α, κ ∈ (0, 1]. Suppose that N ≥ C d ακ2 log 2 κδ . Define U := (cid:8)u ∈ H : ∥u∥∞ = 1, |{i ∈ [d] : ui ≥ κ}| ≥ αd(cid:9). With probability at least 1 − δ, we have ∥ ˆΣu∥∞ ≥ κ/2. min u∈U 20 Proof. For ε ∈ (0, 1), the set N := {u ∈ U : ui = 0, ±ε, ±2ε, . . . , ±⌊1/ε⌋ε for all i ∈ [d]} is clearly an ε-net of U in the l∞ norm, and it has cardinality |N | ≤ (2/ε)d. For any u ∈ U, let v ∈ N be such that ∥u − v∥∞ ≤ ε. Then we have ∥ ˆΣv∥∞ = ∥ ˆΣ(v − u + u)∥∞ ≤ ∥ ˆΣ∥∞∥v − u∥∞ + ∥ ˆΣu∥∞ ≤ ε∥ ˆΣ∥∞ + ∥ ˆΣu∥∞. (19) By the definition of ˆΣ and the fact that (cid:80)d j=1 ˆΣij = 0 for any i ∈ [d], we obtain ∥ ˆΣ∥∞ = max i∈[d] d (cid:88) j=1 | ˆΣij| = 2 max i∈[d] (cid:88) | ˆΣij| = j∈[d]\{i} d − 1 N max i∈[d] (cid:88) j∈[d]\{i} (cid:12) (cid:12) (cid:12) (cid:12) N (cid:88) (xrx⊤ r )ij r=1 (cid:12) (cid:12) (cid:12) (cid:12) = d − 1 N max i∈[d] (cid:88) N (cid:88) j∈[d]\{i} r=1 1{xr = ±(ei − ej)}. It then follows from the definition of Ri in (12) and Lemma 1 that ∥ ˆΣ∥∞ = d − 1 N max i∈[d] |Ri| ≤ 3 with probability at least 1 − δ/2. Combining this bound with (19) gives min u∈U ∥ ˆΣu∥∞ ≥ min v∈N ∥ ˆΣv∥∞ − 3ε. Recall that |{i ∈ [d] : vi ≥ κ}| ≥ αd for every v ∈ N ⊂ U. Let ε = κ/10. We apply Lemma 4 2(2/ε)d and a union bound over all v ∈ N to obtain that, with probability at δ with δ replaced by least 1 − δ/2, ∥ ˆΣv∥∞ ≥ κ − C1 min v∈N (cid:114) d N αd log 2(2/ε)d δ ≥ κ − C2 (cid:114) d N α log 2 κδ for absolute constants C1, C2 > 0. In view of the above two displays together with the condition N ≥ C d ακ2 log 2 κδ for a large constant C > 0, we conclude that minu∈U ∥ ˆΣu∥∞ ≥ κ/2 with probability at least 1 − δ. Lemma 6. There exists an absolute constant C > 0 such that the following holds for any fixed δ ∈ (0, 0.1), 0 ≤ λ < κ ≤ 1, and nonempty subsets I ⊂ J ⊂ [d]. With probability at least 1 − δ, we have that ∥ ˆΣu∥∞ ≥ (κ − λ) d − |J| d − |I| d − C (cid:18)(cid:115) d N |I| log 1 δ + d N |I| log (cid:19) 1 δ for all u ∈ H with ∥u∥∞ = 1, {i ∈ [d] : ui ≥ κ} = I, and {i ∈ [d] : ui ≥ λ} = J. 21 Proof. By (17), we have ∥ ˆΣu∥∞ ≥ 1 |I| (cid:88) ( ˆΣu)i = i∈I d − 1 2N |I| = d − 1 2N |I| N (cid:88) (cid:88) (cid:88) (ui − uj)1{xr = ±(ei − ej)} r=1 N (cid:88) r=1 j∈[d]\{i} i∈I (cid:18) (cid:88) (cid:88) (ui − uj)1{xr = ±(ei − ej)} i∈I (cid:88) j∈I\{i} (cid:88) + (ui − uj)1{xr = ±(ei − ej)} i∈I j∈J\I (cid:88) (cid:88) + i∈I j∈[d]\J (ui − uj)1{xr = ±(ei − ej)} (cid:19) . In view of the assumptions ∥u∥∞ = 1, {i ∈ [d] : ui ≥ κ} = I, and {i ∈ [d] : ui ≥ λ} = J, we see that for i ∈ I, ui − uj ≥ It then follows that  −1  0  κ − λ if j ∈ I \ {i}, if j ∈ J \ I, if j ∈ [d] \ J. ∥ ˆΣu∥∞ ≥ − 1 N |I| N (cid:88) r=1 d − 1 2 (cid:88) (cid:88) i∈I j∈I\{i} 1{xr = ±(ei − ej)} + κ − λ N |I| N (cid:88) r=1 d − 1 2 (cid:88) (cid:88) i∈I j∈[d]\J 1{xr = ±(ei − ej)}. (20) (21) We now bound the above two terms. To control (20), we define Xr := d − 1 2 (cid:88) (cid:88) i∈I j∈I\{i} 1{xr = ±(ei − ej)} for r ∈ [N ]. Then we have E[Xr] = d − 1 2 (cid:88) (cid:88) i∈I j∈I\{i} 2 d(d − 1) = |I|(|I| − 1) d ≤ |I|2 d , |Xr − E[Xr]| ≤ d, and Var(Xr) ≤ E[X 2 r ] = (d − 1)2 4 (cid:88) (cid:88) i∈I j∈I\{i} 2 d(d − 1) ≤ |I|2 2 . Since X1, . . . , XN are independent, Bernstein's inequality implies that N (cid:88) r=1 Xr ≤ N |I|2 d + C1 (cid:18)(cid:114) N |I|2 log 1 δ + d log (cid:19) 1 δ 22 with probability at least 1−δ/2 for an absolute constant C1 > 0 and any δ ∈ (0, 0.1). Consequently, the term (20) can be bounded as 1 N |I| N (cid:88) r=1 d − 1 2 (cid:88) (cid:88) i∈I j∈I\{i} 1{xr = ±(ei − ej)} ≤ |I| d + C1 (cid:18)(cid:114) 1 N log 1 δ + d N |I| log (cid:19) . 1 δ Analogously, if we define X ′ r := d − 1 2 (cid:88) (cid:88) i∈I j∈[d]\J 1{xr = ±(ei − ej)}, we can apply Bernstein's inequality to obtain that N (cid:88) r=1 X ′ r ≥ N |I|(d − |J|) d (cid:18)(cid:114) − C2 N |I|(d − |J|) log 1 δ + d log (cid:19) 1 δ with probability at least 1 − δ/2 for an absolute constant C2 > 0 and any δ ∈ (0, 0.1). Then the term (21) can be bounded as κ − λ N |I| N (cid:88) r=1 d − 1 2 (cid:88) (cid:88) i∈I j∈[d]\J 1{xr = ±(ei − ej)} ≥ (κ − λ) (cid:18)(cid:115) d − |J| d − C2 d N |I| log 1 δ + d N |I| log (cid:19) . 1 δ Plugging the above bounds into (20) and (21) respectively completes the proof. Lemma 7. There exists an absolute constant C > 0 such that the following holds for any fixed δ ∈ (0, 0.1) and 0 ≤ λ < κ ≤ 1. For u ∈ Rd, define l(u) := |{i ∈ [d] : ui ≥ κ}|, m(u) := |{i ∈ [d] : ui ≥ λ}|. With probability at least 1 − δ, we have that ∥ ˆΣu∥∞ ≥ κ − λ 2 for all u ∈ H with ∥u∥∞ = 1, m(u) ≤ d (κ−λ)2l(u) log d δ . (cid:1) ≤ dm pairs of subsets (I, J) Proof. For fixed positive integers l ≤ m ≤ d, there are at most (cid:0) d m such that |I| = l, |J| = m, and I ⊂ J ⊂ [d]. Therefore, by Lemma 6 with δ replaced by δ/dm and a union bound over all possible (I, J), we obtain the following: With probability at least 1 − δ, 8 , and N ≥ Cd m(u) (cid:1)(cid:0)m l 4 , l(u) ≤ (κ − λ) d ∥ ˆΣu∥∞ ≥ (κ − λ) d − m d − l d − C1 (cid:18)(cid:114) dm N l log d δ + dm N l log (cid:19) d δ (22) for all u ∈ H with ∥u∥∞ = 1, l(u) = l, and m(u) = m, where C1 > 0 is an absolute constant, and l(u) and m(u) are defined as in the lemma. Moreover, there are at most d2 possible choices for the pair of integers (l, m). Thus, by a further union bound over (l, m), the bound (22) holds for all u ∈ H with ∥u∥∞ = 1, provided that the constant C1 is replaced by a larger absolute constant. The conclusion then follows from the imposed conditions m ≤ d 8 , and N ≥ Cd m 4 , l ≤ (κ − λ) d (κ−λ)2l log d δ . 23 Proposition 2. There exists an absolute constant C > 0 such that the following holds for any δ ∈ (0, 0.1). Fix an integer L ≥ 2. Suppose that N ≥ C max (cid:110) L2d L L−1 log dL δ , L3d log (cid:111) . L δ Then it holds with probability at least 1 − δ that, and, as a result, min u∈H:∥u∥∞=1 ∥ ˆΣu∥∞ ≥ 1 2L ∥ ˆΣ†∥∞ ≤ 2L. Proof. By Lemma 3, it suffices to prove the lower bound on ∥ ˆΣu∥∞ for u ∈ H with ∥u∥∞ = 1. For t = 0, 1, . . . , L, define κt := 1 − t/L, lt(u) := |{i ∈ [d] : ui ≥ κt}|. For t = 1, 2, . . . , L − 1, define (cid:26) Ut := u ∈ H : ∥u∥∞ = 1, lt(u) ≤ d 4 , lt−1(u) ≤ d 8L , N ≥ C1dL2lt(u) lt−1(u) log (cid:27) , dL δ where C1 > 0 is a constant to be chosen. In addition, define (cid:26) UL := u ∈ H : ∥u∥∞ = 1, lL−1(u) ≥ We claim that L (cid:91) t=1 (cid:26) Ut = u ∈ H : ∥u∥∞ = 1, max i∈[d] ui = 1 . (23) We first finish the proof based on the above claim. For u ∈ (cid:83)L−1 t=1 Ut, we apply Lemma 7 with κ = κt−1, λ = κt, l(u) = lt−1(u), m(u) = lt(u), and δ replaced by δ 2L , together with a union bound over t ∈ [L − 1]. Note that κ − λ = 1/L. Hence we obtain that, with probability at least 1 − δ/2, min u∈(cid:83)L−1 t=1 Ut ∥ ˆΣu∥∞ ≥ 1 2L , provided that C1 is a sufficiently large absolute constant. Moreover, for u ∈ UL, we apply Lemma 5 with κ = KL−1 = 1/L and α = 1/(8L) to obtain that, with probability at least 1 − δ/2, ∥ ˆΣu∥∞ ≥ min u∈UL 1 2L , provided that N ≥ C2L3d log L δ for a large constant C2 > 0. The above two bounds together with (23) imply that, with probability at least 1 − δ, we have ∥ ˆΣu∥∞ ≥ 1/(2L) for all u ∈ H with ∥u∥∞ = 1 and maxi∈[d] ui = 1. Finally, for u ∈ H with ∥u∥∞ = 1 and mini∈[d] ui = −1, it suffices to apply the bound to −u. 24 (cid:27) . d 8L (cid:27) t=1 Ut. Then for any t ∈ [L − 1], we have lt(u) > d Proof of Claim (23). Consider u ∈ H with ∥u∥∞ = 1 and maxi∈[d] ui = 1. Suppose that u /∈ (cid:83)L−1 δ . If 8L for some t ∈ {0, 1, . . . , L − 1}. 8L . Thus u ∈ UL. Let us either of the first two conditions holds, then we have lt(u) > d Since κL−1 ≤ κt, by the definition of lt(u), we have lL−1(u) ≥ lt(u) > d further suppose that u /∈ UL. Then, for all t ∈ [L − 1], we must have 8L , or N < C1dL2lt(u) 4 , lt−1(u) > d log dL lt−1(u) N < C1dL2lt(u) lt−1(u) log dL δ ⇐⇒ lt(u) > lt−1(u) * N C1L2d log(dL/δ) . Since κ0 = 1 and l0(u) = |{i ∈ [d] : ui = 1}| ≥ 1, we apply the above bound iteratively to obtain lL−1(u) ≥ (cid:18) N C1L2d log(dL/δ) (cid:19)L−1 ≥ d > d 8L , where the second inequality holds by the assumption N ≥ CL2d finishing the proof. L L−1 log dL δ . As a result, u ∈ UL, 6.3 One-step iterate from the ground truth In this subsection, we study the difference between the ground truth θ∗ and the one-step EM iterate ˆQ(θ∗) from it. All the results in this subsection are conditional on a realization of x1, . . . , xN . For brevity, we often take the liberty of using E and P to denote the conditional expectation and probability on x1, . . . , xN respectively. Let us start with a lemma. Lemma 8. Let X ∼ N (μ, σ2). Then we have and (cid:20) X tanh E (cid:19)(cid:21) (cid:18) μX σ2 = μ, (cid:18) Var X tanh (cid:19)(cid:19) (cid:18) μX σ2 ≤ σ2. (24) (25) Proof. Equation (24) is well-known, but we provide a proof for completeness. By a change of variable ν = μ σ ∼ N (ν, 1), it suffices to show that σ and Z = X E [Z tanh(νZ)] = ν. (26) We have E[Z] = ν and E [Z (tanh(νZ) − 1)] = 1 √ 2π (cid:90) R z −2e−νz eνz + e−νz e−(z−ν)2/2 dz = − 2e−ν2/2 √ 2π (cid:90) R ze−z2/2 eνz + e−νz dz = 0, (27) because the integrand is an odd function. Then (26) immediately follows. Next, it holds that Var (cid:0)X tanh(μX/σ2)(cid:1) = σ2 Var (Z tanh(νZ)) = σ2 E (cid:2)(Z tanh(νZ) − ν)2(cid:3) . (28) 25 Furthermore, we have (Z tanh(νZ) − ν)2 = (Z − ν)2 − 2vZ(tanh(νZ) − 1) + Z2(tanh(νZ)2 − 1) ≤ (Z − ν)2 − 2vZ(tanh(νZ) − 1) + Z2 tanh(νZ) (tanh(νZ) − 1) since tanh(νZ) ≤ 1. Let us compute the expectations of these three terms. We have E[(Z − ν)2] = 1, E[2vZ(tanh(νZ) − 1)] = 0, by Z ∼ N (ν, 1) and (27) respectively. For the third term, E[Z2 tanh(νZ) (tanh(νZ) − 1)] = = (cid:90) 1 √ 2π R −2e−v2/2 √ 2π z2 (eνz − e−νz)(−2e−νz) (eνz + e−νz)2 z2e−z2/2 eνz − e−νz (cid:90) R (eνz + e−νz)2 dz = 0, e−(z−ν)2/2 dz because the integrand is an odd function. Combining the three terms with (28) proves (25). We now control ˆQ(θ∗) − θ∗ in the l∞-norm. Lemma 9. Condition on a realization of x1, . . . , xN such that ∥ ˆΣ†∥∞ ≤ 2L. There is an absolute constant C > 0 such that for any δ ∈ (0, 0.1), it holds with (conditional) probability at least 1 − δ that ∥ ˆQ(θ∗) − θ∗∥∞ ≤ Cσ (cid:114) L d N log d δ . Proof. Let us first check that E[ ˆQ(θ∗)] = θ∗. By (24), we have E yr∼N (x⊤ r θ∗,σ2) (cid:20) yr tanh (cid:19)(cid:21) (cid:18) yrx⊤ r θ∗ σ2 = x⊤ r θ∗. Then, it follows that E[ ̄Q(θ∗)] = d − 1 2N N (cid:88) r=1 xrx⊤ r θ∗ = ˆΣ θ∗, E[ ˆQ(θ∗)] = θ∗. Next, we study ˆQ(θ∗) − θ∗, whose ith entry is e⊤ i (cid:0) ˆQ(θ∗) − θ∗(cid:1) = e⊤ i ˆΣ†(cid:0) ̄Q(θ∗) − E[ ̄Q(θ∗)](cid:1). For w ∈ H, define fw(y) := w⊤ ̄Q(θ∗) = d − 1 2N N (cid:88) r=1 yrx⊤ r w tanh (cid:18) yrx⊤ r θ∗ σ2 (cid:19) . (29) (30) (31) (32) We will show that fw(y) − Ey[fw(y)] is sub-Gaussian with variance parameter of order σ2L d N when w⊤ is a row of ˆΣ†. The proof is similar to that of Proposition 11 of Kwon et al. (2019), with the main tool being Lemma 18, a standard concentration result for Gaussian random variables. To this 26 end, let vr = yr−x⊤ i.i.d. standard Gaussians ζ1, . . . , ζN . Let us define a new function = εr σ be i.i.d. standard Gaussians and introduce another independent set of r θ∗ σ gw(v) := fw(y) = d − 1 2N N (cid:88) (σvr + x⊤ r θ∗)x⊤ r w tanh r=1 For each r ∈ [N ], we have (∇gw(v))r = d − 1 2N x⊤ r w (cid:20) r θ∗ σ tanh + (σvr + x⊤ (cid:18) (σvr + x⊤ r θ∗)x⊤ σ2 x⊤ r θ∗ σ (cid:18) (σvr + x⊤ r θ∗ r θ∗)x⊤ σ2 r θ∗) (cid:19) , = d − 1 2N x⊤ r wσ * h (cid:18) (σvr + x⊤ r θ∗)x⊤ σ2 r θ∗ (cid:19) . (cid:19) tanh′ (cid:18) (σvr + x⊤ r θ∗)x⊤ σ2 r θ∗ (cid:19) (cid:21) where h(t) := tanh(t)+t*tanh′(t). We will use the inequality |h(t)| ≤ 2 for all t ∈ R. By Lemma 18, E[exp(λ(fw(y) − E[fw(y)]))] = E[exp(λ(gw(v) − E[gw(v)]))] (cid:19)(cid:21) ⟨∇g, ζ⟩ ≤ Ev,ζ (cid:20) exp (cid:34) (cid:18) λπ 2 (cid:32) = EvEζ exp λπ 2 (cid:32) d − 1 2N N (cid:88) r=1 ζrx⊤ r wσ * h (cid:18) (σvr + x⊤ r θ∗)x⊤ σ2 r θ∗ (cid:19)(cid:33)(cid:33)(cid:35) = Ev ≤ exp (cid:34) exp (cid:32)(cid:18) λ2σ2π2(d − 1) 16N (cid:32)(cid:18) λ2σ2π2(d − 1) 4N (cid:19) (cid:32) (cid:19) (cid:32) d − 1 2N N (cid:88) (cid:16) r=1 r w * h((σvr + x⊤ x⊤ r θ∗)x⊤ r θ∗) (cid:33)(cid:33)(cid:35) (cid:17)2 (cid:33)(cid:33) d − 1 2N N (cid:88) (x⊤ r w)2 r=1 ≤ exp (cid:18) λ2σ2π2d 4N w⊤ ˆΣw (cid:19) . If w⊤ is the ith row of ˆΣ†, we have w = ˆΣ†ei and by assumption. It follows that w⊤ ˆΣw = e⊤ i ˆΣ†ei ≤ ∥ ˆΣ†∥∞ ≤ 2L E[exp(λ(fw(y) − E[fw(y)]))] ≤ exp (cid:18) λ2σ2π2dL 2N (cid:19) , so fw(y) is sub-Gaussian with variance parameter σ2π2dL least 1 − δ/d that N . Therefore, it holds with probability at (cid:12)fw(y) − E[fw(y)](cid:12) (cid:12) (cid:12) ≤ Cσ (cid:114) Ld N log d δ for a constant C > 0. In view of (31) and (32), the left-hand side of the above bound is precisely i ( ˆQ(θ∗) − θ∗)| when w⊤ is the ith row of ˆΣ†. Taking a union bound over i ∈ [d] proves the desired |e⊤ result on ∥ ˆQ(θ∗) − θ∗∥∞. 27 The following two lemmas provide a sharp control on ˆQ(θ∗)−θ∗ in the l2-norm: they respectively bound the expectation and deviation of ∥ ˆQ(θ∗) − θ∗∥2 2. Lemma 10. Condition on a realization of x1, . . . , xN such that ˆΣ† is the inverse of ˆΣ as a map on H. Let E[*] denote the conditional expectation. Then we have E(cid:2)∥ ˆQ(θ∗) − θ∗∥2 2 (cid:3) ≤ σ2 d − 1 2N tr( ˆΣ†). Proof. By the definition of ˆQ in (4b), it is not difficult to see that ˆQ(θ∗) − θ∗ = (cid:18) N (cid:88) xrx⊤ r (cid:19)† N (cid:88) (cid:18) r=1 r=1 tanh (cid:16) yr x⊤ r θ∗ σ2 (cid:17) yr − x⊤ r θ∗ (cid:19) xr. Then it follows that E (cid:2)( ˆQ(θ∗) − θ∗)( ˆQ(θ∗) − θ∗)⊤(cid:3) (cid:18) N (cid:88) = xrx⊤ r (cid:19)†(cid:32) N (cid:88) (cid:20)(cid:18) E r=1 r=1 tanh r θ∗ (cid:16) yr x⊤ σ2 (cid:17) yr − x⊤ r θ∗ (cid:19)2(cid:21) xrx⊤ r (cid:33)(cid:18) N (cid:88) (cid:19)† , xrx⊤ r r=1 where the cross terms vanish thanks to (29). By (25), we have σr := E (cid:20)(cid:18) tanh r θ∗ (cid:16) yr x⊤ σ2 (cid:17) yr − x⊤ r θ∗ (cid:19)2(cid:21) ≤ σ2. As a result, the matrix (cid:18) N (cid:88) σ2 xrx⊤ r (cid:19)† r=1 −E (cid:2)( ˆQ(θ∗)−θ∗)( ˆQ(θ∗)−θ∗)⊤(cid:3) = (cid:18) N (cid:88) r=1 xrx⊤ r (cid:19)†(cid:32) N (cid:88) r=1 (σ2 −σ2 r )xrx⊤ r (cid:33)(cid:18) N (cid:88) (cid:19)† xrx⊤ r r=1 is positive semi-definite. In other words, E (cid:2)( ˆQ(θ∗) − θ∗)( ˆQ(θ∗) − θ∗)⊤(cid:3) ≼ σ2 (cid:19)† xrx⊤ r (cid:18) N (cid:88) r=1 in the Loewner order. Since the trace operator is monotone in the Loewner order, we obtain E(cid:2)∥ ˆQ(θ∗) − θ∗∥2 2 (cid:3) = tr (cid:16) E (cid:2)( ˆQ(θ∗) − θ∗)( ˆQ(θ∗) − θ∗)⊤(cid:3)(cid:17) ≤ σ2 tr (cid:32)(cid:18) N (cid:88) (cid:19)†(cid:33) , xrx⊤ r r=1 which completes the proof. Lemma 11. Condition on a realization of x1, . . . , xN such that ∥ ˆΣ∥op ≤ 3 and ∥ ˆΣ†∥op ≤ 5. Then there exists an absolute constant C > 0 such that for any δ ∈ (0, 0.1), we have (cid:12) (cid:12)∥ ˆQ(θ∗) − θ∗∥2 (cid:12) 2 − E(cid:2)∥ ˆQ(θ∗) − θ∗∥2 2 (cid:3)(cid:12) (cid:12) ≤ Cσ2 (cid:12) (cid:18) d3/2 N (cid:114) log 1 δ + d N log (cid:19) 1 δ with (conditional) probability at least 1 − δ. 28 Proof. Let ε′ := ε/σ ∼ N (0, IN ), and then yr = x⊤ r θ∗ + σε′ r. Consider the random vector f (ε′) := ˆQ(θ∗) − θ∗ = ˆΣ† (cid:32) d − 1 2N N (cid:88) tanh (cid:18) (x⊤ r θ∗ + σε′ σ2 r)x⊤ r θ∗ (cid:19) (x⊤ r θ∗ + σε′ r)xr (cid:33) − θ∗. r=1 We claim that the function f (*) is 15σ(cid:112)d/N -Lipschitz in the Euclidean distance. Assuming the claim for a moment, we now show that the random vector f (ε′) satisfies the convex concentration property in Definition 1. To this end, let φ be an arbitrary 1-Lipschitz function. (Note that we do not require φ to be convex and hence prove something stronger.) Then φ ◦ f is 15σ(cid:112)d/N -Lipschitz, so by Lemma 15, P (cid:8)(cid:12) (cid:12)φ(f (ε′)) − E[φ(f (ε′))](cid:12) (cid:12) ≥ t(cid:9) ≤ 2 exp (cid:19) (cid:18) −t2 C2 1 σ2d/N for an absolute constant C1 > 0. Therefore, f (ε′) satisfies the convex concentration property for K = C1 σ (cid:112)d/N . We have seen in (30) that E[f (ε′)] = 0. Then Lemma 16 with A = Id yields that for an absolute constant C2 > 0, (cid:110)(cid:12) (cid:12)∥ ˆQ(θ∗) − θ∗∥2 Pr 2](cid:12) 2 − E[∥ ˆQ(θ∗) − θ∗∥2 (cid:12) ≥ t (cid:111) (cid:18) ≤ 2 exp − 1 C2 min (cid:18) N 2t2 σ4d3 , N t σ2d (cid:19)(cid:19) . From here, the lemma follows. It remains to prove the claim that the function f (*) is 15σ(cid:112)d/N -Lipschitz. Let ε′, ε′′ ∈ RN . By Taylor's theorem, we have for some tr ∈ (0, 1), (cid:18) (x⊤ r θ∗ + σε′′ r )x⊤ r θ∗ (cid:19) tanh (x⊤ r θ∗ + σε′′ r ) − tanh (cid:18) (x⊤ r θ∗ + σε′ σ2 r)x⊤ r θ∗ (cid:19) (x⊤ r θ∗ + σε′ r) σ2 (cid:18) = (ε′′ r − ε′ r) d d ̃ε = (ε′′ r − ε′ r) σ h (cid:19) r θ∗ tanh (cid:18) (x⊤ (cid:18) (x⊤ r θ∗ + σ ̃ε)x⊤ σ2 r θ∗ + σ ̃εr)x⊤ r θ∗ σ2 (cid:19) , (x⊤ r θ∗ + σ ̃ε) (cid:19) (cid:12) (cid:12) (cid:12) (cid:12) ̃ε=ε′ r+tr(ε′′ r −ε′ r) where h(t) := tanh(t) + t tanh′(t) for t ∈ R, and ̃εr := ε′ r + tr(ε′′ r − ε′ r). Then we have f (ε′′) − f (ε′) = ˆΣ† (cid:32) d − 1 2N N (cid:88) (ε′′ r − ε′ r) σ h r=1 (cid:18) (x⊤ r θ∗ + σ ̃εr)x⊤ σ2 r θ∗ (cid:19) (cid:33) xr = σ ˆΣ† ̃XD(ε′′ − ε′), where ̃X ∈ Rd×N is the matrix whose rth column is d−1 defined by 2N xr, and D ∈ RN ×N is the diagonal matrix Drr := h (cid:18) (yr + tr(yr − yr))x⊤ r θ∗ (cid:19) . σ2 As a result, Note that ̃X ̃X ⊤ = d−1 2N ∥f (ε′′) − f (ε′)∥2 ≤ σ∥ ˆΣ†∥op∥ ̃X∥op∥D∥op∥ε′ − ε′′∥2. ˆΣ and so we have ∥ ̃X∥op = (cid:114) d − 1 2N ∥ ˆΣ∥op ≤ (cid:114) 3d 2N 29 by the conditioning. Moreover, we have ∥ ˆΣ†∥op ≤ 5 by the conditioning, and ∥D∥op ≤ 2 by the fact that |h(t)| = | tanh(t) + t tanh′(t)| ≤ 2 for all t ∈ R. Combining all the bounds gives ∥f (ε′′) − f (ε′)∥2 ≤ 15 σ (cid:114) d N ∥ε′′ − ε′∥2, completing the proof. 6.4 Convergence analysis Assuming the bounds in Lemma 1 and the control on ∥ ˆΣ†∥∞ in Proposition 2, the following result shows that the EM operator is contractive locally around θ∗, deterministically. Lemma 12. There exist absolute constants C, C′ > 0 such that the following holds. Suppose that all the bounds in Lemma 1 hold with C > 0 and δ ∈ (0, 0.1). Consider θ, θ′ ∈ H, λ ∈ (0, 1), and ∆ := max{ 1 }, such that λ ∥θ − θ′∥∞, 3σ√ λ max{∥θ − θ∗∥∞, ∥θ′ − θ∗∥∞} ≤ ∆ 6 , N ≥ C′ d λ2 log d δ , max i∈[d] |Si(∆)| ≤ λ2 C′ d, where Si(*) is defined as in (13a). Then we have ∥ ̄Q(θ) − ̄Q(θ′)∥∞ ≤ λ∥θ − θ′∥∞. If, in addition, ∥ ˆΣ†∥∞ ≤ 1 2λ , then ∥ ˆQ(θ) − ˆQ(θ′)∥∞ ≤ 1 2 ∥θ − θ′∥∞. Proof. For notational simplicity, let us consider iteration of the first entry of each vector and bound | ̄Q(θ)1 − ̄Q(θ′)1|. The same analysis applies to any other entry with straightforward modification. We can write the iteration of the first entry as ̄Q(θ)1 = d − 1 2N (cid:88) r∈R1 tanh (cid:17) (cid:16) yr x⊤ r θ σ2 yr, where R1 is defined as in (12). It follows that | ̄Q(θ)1 − ̄Q(θ′)1| ≤ d − 1 2N (cid:88) r∈R1 (cid:12) (cid:12) tanh (cid:12) (cid:12) (cid:17) (cid:16) yr x⊤ r θ σ2 − tanh (cid:16) yr x⊤ r θ′ σ2 (cid:17)(cid:12) (cid:12) (cid:12) (cid:12) |yr|. Define θ(z) := θ′ + z(θ − θ′) for z ∈ [0, 1]. By the fundamental theorem of calculus, we have (cid:12) (cid:12) (cid:12) (cid:12) tanh (cid:19) (cid:18) yr x⊤ r θ σ2 − tanh (cid:18) yr x⊤ r θ′ σ2 (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) = ≤ (cid:90) 1 (cid:12) (cid:12) (cid:12) (cid:12) 0 |yr x⊤ tanh′ (cid:18) yr x⊤ r θ(z) σ2 (cid:90) 1 (cid:18) −2 4 exp (cid:19) (cid:18) yr x⊤ r (θ − θ′)| σ2 r (θ − θ′)| |yr x⊤ σ2 ≤ 4 0 exp (cid:18) −2 min 0≤z≤1 (cid:19) (cid:19) r (θ − θ′) σ2 |yr x⊤ r θ(z)| σ2 |yr x⊤ r θ(z)| σ2 dz (cid:12) (cid:12) (cid:12) (cid:12) dz (cid:19) , 30 where we used the fact 0 ≤ tanh′(t) = (cosh(t))−2 ≤ 4 exp(−2|t|) for all t ∈ R. Combining the above bounds with the trivial bound | tanh(t)| ≤ 1 for t ∈ R, we obtain | ̄Q(θ)1 − ̄Q(θ′)1| ≤ d N (cid:88) r∈R1 (cid:26) min |yr|, 2 r |x⊤ y2 r (θ − θ′)| σ2 (cid:18) exp −2 min 0≤z≤1 |yr x⊤ r θ(z)| σ2 (cid:19)(cid:27) . (33) For brevity, we let η := ∥θ − θ′∥∞ in the sequel. Then ∆ = max{ η } by definition. Recall that the sets S1(∆) and R1(∆) are defined in (13a) and (13b) respectively. We now analyze the summands in (33) for r ∈ R1(∆) and r ∈ R1 \ R1(∆) separately. λ , 3σ√ λ First, for r ∈ R1 \ R1(∆), we have xr = e1 − ej such that |x⊤ ∥θ − θ∗∥∞ ≤ ∆/6 and ∥θ′ − θ∗∥∞ ≤ ∆/6 by assumption. It follows that r θ∗| = |θ∗ 1 − θ∗ j | > ∆. Moreover, |x⊤ r θ(z)| = |θ(z)1 − θ(z)j| ≥ |θ∗ ≥ |θ∗ 1 − θ∗ 1 − θ∗ j | − |θ(z)1 − θ∗ j | − z|θ1 − θ∗ 1| − |θ(z)j − θ∗ j | 1 − θ∗ 1| − (1 − z)|θ′ 1| − z|θj − θ∗ j | − (1 − z)|θ′ j − θ∗ j | for any z ∈ [0, 1]. Moreover, it holds that |x⊤ 2 r |x⊤ y2 r (θ − θ′)| σ2 (cid:18) exp −2 min 0≤z≤1 ≥ |x⊤ r θ∗| − ∆ 3 > |x⊤ r θ∗| 2 3 r (θ − θ′)| ≤ 2∥θ − θ′∥∞ = 2η. Therefore, (cid:19) r θ∗| |yr x⊤ r θ(z)| . σ2 (cid:18) −4 |yr| |x⊤ y2 r σ2 exp ≤ 4η 3σ2 (cid:19) It is not hard to see that maxa≥0 a2 exp(−ab) = 4/(eb)2 for b > 0. Taking a = |yr| and b = 4 |x⊤ r θ∗| 3σ2 in the above bound then yields 2 r |x⊤ y2 r (θ − θ′)| σ2 (cid:18) exp −2 min 0≤z≤1 |yr x⊤ r θ(z)| σ2 (cid:19) ≤ 9σ2 r θ∗|2 η ≤ e2 |x⊤ (cid:16) 3σ e∆ (cid:17)2 η. As a result, d N (cid:88) r∈R1\R1(∆) 2 r |x⊤ y2 r (θ − θ′)| σ2 (cid:18) exp −2 min 0≤z≤1 (cid:19) |yr x⊤ r θ(z)| σ2 ≤ d N |R1| (cid:16) 3σ e∆ (cid:17)2 η ≤ λ 2 η (34) by the bound |R1| ≤ 3N/d in Lemma 1 and the condition ∆ ≥ 3σ√ λ Second, for r ∈ R1(∆), since exp(−t) ≤ 1 for t ≥ 0 and |x⊤ . r (θ − θ′)| ≤ 2η, we have d N ≤ r∈R1(∆) d N (cid:88) r∈R1(∆) (cid:88) (cid:26) min |yr|, 2 r |x⊤ y2 r (θ − θ′)| σ2 (cid:18) exp −2 min 0≤z≤1 (cid:19)(cid:27) |yr x⊤ r θ(z)| σ2 (cid:26) min |yr|, 4η (cid:27) y2 r σ2 ≤ d N (cid:26) (cid:88) min r∈R1(∆) |yr|, 4η σ2 (cid:88) (cid:27) . y2 r r∈R1(∆) Plugging the bounds from Lemma 1 into the above then yields d N (cid:88) (cid:26) min |yr|, 2 r |x⊤ y2 r (θ − θ∗)| σ2 (cid:18) exp −2 min 0≤z≤1 (cid:19)(cid:27) |yr x⊤ r θ(z)| σ2 r∈R1(∆) (cid:18) d N ≤ C |S1(∆)| N d2 + log d δ (cid:19) (cid:26) min ∆, (cid:27) . 4η σ2 ∆2 31 (35) Lastly, combining (34) and (35) with (33) gives | ̄Q(θ)1 − ̄Q(θ′)1| ≤ λ 2 η + C (cid:18) |S1(∆)| d + d N log (cid:19) d δ (cid:26) min ∆, (cid:27) . 4η σ2 ∆2 Since ∆ = max{ η λ , 3σ√ λ }, we have (cid:26) min ∆, (cid:27) 4η σ2 ∆2 ≤ max (cid:26) η λ , 4η σ2 (cid:16) 3σ √ λ (cid:17)2(cid:27) ≤ 36 η λ . The above two bounds together with the assumptions N ≥ C′ d δ and |S1(∆)| ≤ λ2 C′ d yield | ̄Q(θ)1 − ̄Q(θ′)1| ≤ λ 2 η + C (cid:18) λ2 C′ + λ2 C′ λ2 log d (cid:19) η λ * 64 ≤ λη, once C′ is chosen to be sufficiently large. For the final statement of the lemma, note that ˆQ(θ) = ˆΣ† ̄Q(θ), so we have ∥ ˆQ(θ) − ˆQ(θ′)∥∞ ≤ ∥ ˆΣ†∥∞∥ ̄Q(θ) − ̄Q(θ′)∥∞, from which the conclusion follows. We summarize the convergence results for the EM sequence in the following proposition. Proposition 3. There exist absolute constants C, C′ > 0 such that the following holds for any δ ∈ (0, 0.1) and any integer L ≥ 2. Fix θ(0) ∈ H and let ∆(0) := max{4L∥θ(0) − θ∗∥∞, 6 L σ}. Suppose that √ N ≥ C max (cid:110) L2d L L−1 log dL δ , L3d log (cid:111) , L δ |Si(∆(0))| ≤ max i∈[d] d CL2 , (36a) (36b) where Si(*) is defined in (13a). Let {θ(t)}t≥0 be the EM iterates defined in (5). Moreover, let τ := C′σ (cid:114) L d N log d δ , (cid:26) (cid:24) T := max 0, log4/3 (cid:18) ∥θ(0) − θ∗∥∞ 4τ (cid:19)(cid:25)(cid:27) . Then it holds with probability at least 1 − δ that • there exists ˆθ ∈ H such that ˆQ(ˆθ) = ˆθ and ∥ˆθ − θ∗∥∞ ≤ 4τ ; • the sequence {θ(t)}t≥0 converges to ˆθ; • ∥θ(T +t) − ˆθ ∥∞ ≤ 8τ /2t for all t ≥ 0. Proof. By Proposition 2 and the assumption on N , it holds with probability at least 1 − δ/3 that ∥ ˆΣ†∥∞ ≤ 2L. 32 By Lemma 9, it holds with probability at least 1 − δ/3 that ∥ ˆQ(θ∗) − θ∗∥∞ ≤ C′σ (cid:114) L d N log d δ = τ (37) for a constant C′ > 0. Applying Lemma 1 and Lemma 12 with λ = 1 at least 1 − δ/3, the following holds: For all θ, θ′ ∈ H and ∆ := max{4L∥θ − θ′∥∞, 6 that 4L , we see that with probability L σ} such √ max{∥θ − θ∗∥∞, ∥θ′ − θ∗∥∞} ≤ we have ∥ ˆQ(θ) − ˆQ(θ′)∥∞ ≤ d CL2 , ∆ 6 max i∈[d] |Si(∆)| ≤ ∥θ − θ′∥∞. , 1 2 (38) (39) In the sequel, we condition on the event of probability at least 1 − δ that all the above bounds hold. We split the rest of the proof into two parts as we will use the above conclusion twice. Part I: Convergence to a neighborhood of the ground truth. Let us take θ = θ(t) for t ≥ 0 and θ′ = θ∗ in (38) and (39). Let ∆(t) := max{4L∥θ(t) − θ∗∥∞, 6 L σ}. Note that we have ∥θ(t) − θ∗∥∞ ≤ 4L 6 , so the first condition in (38) holds. We now show inductively that, for t ≥ 0, 6 ∥θ(t) − θ∗∥∞ ≤ ∆(t) √ ∆(t) ≤ ∆(0), (40) and furthermore, 1 2 First, (40) is trivial for t = 0. Suppose that (40) holds. Then, by maxi∈[d] |Si(∆(0))| ≤ d CL2 and that Si(*) is a nondecreasing function defined in (13a), we see that maxi∈[d] |Si(∆(t))| ≤ d CL2 . Hence (38) is satisfied, and then (39) implies ∥θ(t+1) − θ∗∥∞ ≤ ∥θ(t) − θ∗∥∞ + τ. (41) Combining this bound with (37) gives (41). ∥θ(t+1) − ˆQ(θ∗)∥∞ ≤ 1 2 ∥θ(t) − θ∗∥∞. Next, suppose that (41) holds. If ∥θ(t) − θ∗∥∞ ≥ 2τ , then (41) implies that ∥θ(t+1) − θ∗∥∞ ≤ ∥θ(t) − θ∗∥∞. As a result, ∆(t+1) ≤ ∆(t), so (40) holds for t + 1 in place of t. On the other hand, if ∥θ(t) − θ∗∥∞ ≤ 2τ , then (41) implies that ∥θ(t+1) − θ∗∥∞ ≤ 2τ . By the definition of τ and our assumption on N , it is clear that 4L∥θ(t+1) − θ∗∥∞ ≤ 8Lτ ≤ 6 L σ. As a result, ∆(t+1) ≤ 6 L σ ≤ ∆(0), so again (40) holds for t + 1 in place of t. This completes the induction. √ √ To conclude this part, note that by (41), the EM iterates {θ(t)}t≥0 satisfy ∥θ(t+1) − θ∗∥∞ ≤ 3 4 ∥θ(t) − θ∗∥∞ (42) if ∥θ(t) − θ∗∥∞ > 4τ . Moreover, define B := {θ ∈ H : ∥θ − θ∗∥∞ ≤ 4τ }, T1 := min (cid:8)t ≥ 0 : θ(t) ∈ B(cid:9). By (42), we have (cid:26) (cid:24) T1 ≤ max 0, log4/3 (cid:18) ∥θ(0) − θ∗∥∞ 4τ (cid:19)(cid:25)(cid:27) = T. Finally, θ(t) ∈ B for all t ≥ T1 by (41). 33 Part II: Convergence to a fixed point. We now focus on the set B defined above. Fix any θ, θ′ ∈ B. We have ∥θ − θ′∥∞ ≤ 8τ . By the definition of τ and our assumption on N , it holds that 4L∥θ − θ′∥∞ ≤ 16Lτ ≤ 6 L σ ≤ ∆(0). By our L σ. Hence, ∆ = max{4L∥θ − θ′∥∞, 6 assumption on ∆(0) and that Si(*) is a nondecreasing function, we obtain maxi∈[d] |Si(∆)| ≤ d CL2 . In addition, max{∥θ − θ∗∥∞, ∥θ′ − θ∗∥∞} ≤ 4τ ≤ 6 . Therefore, (38) is satisfied, and so (39) holds. L σ = ∆ L σ} = 6 √ √ √ √ Similar to Part I, taking θ′ = θ∗ in (39), we obtain ∥ ˆQ(θ) − θ∗∥∞ ≤ ∥ ˆQ(θ) − ˆQ(θ∗)∥∞ + ∥ ˆQ(θ∗) − θ∗∥∞ ≤ 1 2 ∥θ − θ∗∥∞ + τ ≤ 4τ, so the EM operator ˆQ can be viewed as a map on B. Furthermore, (39) says that ˆQ is a contraction on B. By the Banach fixed-point theorem, ˆQ has a unique fixed point ˆθ in B, and the EM sequence {θ(t)}t≥0 converges to ˆθ with ∥θ(t+1) − ˆθ ∥∞ ≤ ∥θ(t) − ˆθ ∥∞ 1 2 for all t ≥ T1. Since ∥θ(T1) − ˆθ∥∞ ≤ 8τ , the conclusion follows immediately. 6.5 Sharp results in the low-noise regime Before proving the sharp bound on ∥ˆθ − θ∗∥2, let us start with two lemmas that control the lower order terms. Lemma 13. There exist absolute constants C, C′ > 0 such as the following holds for any δ ∈ r θ∗| ≤ (0, 0.1). Suppose that all the bounds in Lemma 1 hold with the constant C, and that |yr − x⊤ Cσ log N δ for all r ∈ [N ]. Define (cid:113) A := d − 1 2N N (cid:88) r=1 y2 r σ2 tanh′ (cid:18) yrx⊤ r θ∗ σ2 (cid:19) xrx⊤ r . (43) Moreover, let ∆ := 2Cσ (cid:113) log N δ , and define Si(∆) as in (13a). Then we have ∥A∥∞ ≤ C′ (cid:18) max i∈[d] |Si(∆)| d + d N log (cid:19) d δ log N δ . Proof. We have ∥A∥∞ = maxi∈[d] r )ii = (xrx⊤ entries (xrx⊤ σ2 tanh′ (cid:0) yrx⊤ r θ∗ y2 r σ2 j=1 |Aij|. r )ij = (xrx⊤ (cid:1) ≥ 0. Then, by the definition of A, it is not hard to see that is the matrix with r )ji = −1, and 0 elsewhere. Also, note that If xr = ei − ej, then xrx⊤ r r )jj = 1, (xrx⊤ (cid:80)d d (cid:88) j=1 |Aij| = d − 1 N (cid:88) r∈Ri y2 r σ2 tanh′ (cid:18) yrx⊤ r θ∗ σ2 (cid:19) ≤ 4d N (cid:18) y2 r σ2 exp − 2 (cid:12) (cid:12) (cid:12) (cid:12) r θ∗ yrx⊤ σ2 (cid:12) (cid:19) (cid:12) (cid:12) (cid:12) (cid:88) r∈Ri (44) where Ri is defined in (12), and the inequality follows from the fact 0 ≤ tanh′(t) = (cosh(t))−2 ≤ 4 exp(−2|t|) for all t ∈ R. 34 (cid:113) log N For ∆ = 2Cσ δ , let Ri(∆) be defined in (13b). Similar to the proof of Lemma 12, we split the analysis of the sum in (44) into two parts. First, let us consider r ∈ Ri \ Ri(∆). Then r θ∗| ≤ Cσ |x⊤ r θ∗| > ∆, and by the assumption |yr − x⊤ δ = ∆/2, we have log N (cid:113) (cid:12) (cid:12) (cid:12) (cid:12) yrx⊤ r θ∗ σ2 (cid:12) (cid:12) (cid:12) (cid:12) ≥ (x⊤ r θ∗)2 2σ2 . Consequently, 4d N (cid:88) r∈Ri\Ri(∆) (cid:18) y2 r σ2 exp − 2 (cid:12) (cid:12) (cid:12) (cid:12) yrx⊤ r θ∗ σ2 (cid:12) (cid:19) (cid:12) (cid:12) (cid:12) ≤ 4d N N 4(x⊤ r θ∗)2 σ2 (cid:18) exp − (cid:19) (x⊤ r θ∗)2 σ2 (a) ≤ 16 d ∆2 σ2 exp (cid:18) − (cid:19) (b) ≤ ∆2 σ2 1 N 10 , where (a) holds as the function t exp(−t) is decreasing for t ≥ 1, and (b) holds by the definition of ∆ provided that the constant C is sufficiently large. Next, consider r ∈ Ri(∆). We have (cid:12) (cid:12) (cid:12) (cid:12) y2 r σ2 exp 4d N − 2 (cid:88) (cid:18) r θ∗ yrx⊤ σ2 r∈Ri(∆) (cid:12) (cid:19) (cid:12) (cid:12) (cid:12) ≤ ≤ 4d σ2N 4d σ2N (cid:88) y2 r r∈Ri(∆) (cid:18) C∆2 |Si(∆)| = 16C3 (cid:18) |Si(∆)| d + d N N d2 + log (cid:19) d δ log (cid:19) d δ log N δ , where the second inequality follows from Lemma 1. Finally, combining the above two bounds with (44) finishes the proof. Lemma 14. There exist absolute constants C, C′ > 0 such as the following holds for any δ ∈ r θ∗| ≤ (0, 0.1). Suppose that all the bounds in Lemma 1 hold with the constant C, and that |yr − x⊤ Cσ δ for all r ∈ [N ]. For θ ∈ H, t ∈ [0, 1]d, and r ∈ [N ], define log N (cid:113) (cid:18) yrx⊤ r (θ∗ + tr(θ − θ∗)) (cid:19) σ2 (x⊤ r (θ − θ∗))2, ω(θ, r, tr) := ω(θ, t) := y2 r 2σ4 tanh′′ N d − 1 (cid:88) 2N r=1 ω(θ, r, tr) yr xr. (45a) (45b) Suppose further that ∥θ − θ∗∥∞ ≤ C 4 σ (cid:113) log N δ . Then we have ∥ω(θ, t)∥∞ ≤ C′ σ ∥θ − θ∗∥2 ∞ (cid:16) log (cid:17)3/2 . N δ Proof. Fix i ∈ [d]. By (45) and the definition of Ri in (13b), we have |ω(θ, t)i| ≤ d − 1 2N (cid:88) r∈Ri |ω(θ, r, tr) yr| ≤ d 4N (cid:88) r∈Ri |y3 r | σ4 (cid:12) (cid:12) tanh′′ (cid:12) (cid:12) (cid:18) yrx⊤ r (θ∗ + tr(θ − θ∗)) σ2 (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) (x⊤ r (θ − θ∗))2. 35 Using that (cid:12) (cid:12)tanh′′ (t)(cid:12) (cid:12) ≤ 8 exp(−2|t|) for all t ∈ R and (x⊤ r (θ − θ∗))2 ≤ 4∥θ − θ∗∥2 ∞, we obtain |ω(θ, t)i| ≤ 8d σN ∥θ − θ∗∥2 ∞ (cid:88) r∈Ri |y3 r | σ3 exp (cid:18) −2 (cid:12) (cid:12) (cid:12) (cid:12) yrx⊤ r (θ∗ + tr(θ − θ∗)) σ2 (cid:12) (cid:19) (cid:12) (cid:12) (cid:12) . (46) Similar to the proof of the previous lemma, we again split the analysis into two parts. Define r θ∗| > ∆, and by the assumptions δ . First, consider r ∈ Ri \ Ri(∆). Then |x⊤ log N (cid:113) r θ∗| ≤ ∆/2 and ∥θ − θ∗∥∞ ≤ ∆/4, we have tr|x⊤ r (θ − θ∗)| ≤ 2∥θ − θ∗∥∞ ≤ ∆/2 and ∆ := 2Cσ |yr − x⊤ (cid:12) (cid:12) (cid:12) (cid:12) yrx⊤ r (θ∗ + tr(θ − θ∗)) σ2 (cid:12) (cid:12) (cid:12) (cid:12) ≥ (x⊤ r θ∗)2 4σ2 . It follows that |y3 r | σ3 exp (cid:18) −2 (cid:12) (cid:12) (cid:12) (cid:12) yrx⊤ r (θ∗ + tr(θ − θ∗)) σ2 (cid:19) (cid:12) (cid:12) (cid:12) (cid:12) ≤ 8 |x⊤ r θ∗|3 σ3 (cid:18) exp − (cid:19) (x⊤ r θ∗)2 2σ2 ≤ 16 since the function t3 exp(−t2/2) ≤ 2 for t ∈ R. Next, consider r ∈ Ri(∆). Then |x⊤ |yr| ≤ 2∆. Hence we have r θ∗| ≤ ∆ and so |y3 r | σ3 exp (cid:18) −2 (cid:12) (cid:12) (cid:12) (cid:12) yrx⊤ r (θ∗ + tr(θ − θ∗)) σ2 (cid:12) (cid:19) (cid:12) (cid:12) (cid:12) ≤ 8 ∆3 σ3 = 64C3(cid:16) log (cid:17)3/2 . N δ Putting the two cases together with (46), we obtain |ω(θ, t)i| ≤ 8d σN ∥θ − θ∗∥2 ∞ |Ri| * 64C3(cid:16) log (cid:17)3/2 N δ ≤ C′ σ ∥θ − θ∗∥2 ∞ (cid:16) log (cid:17)3/2 , N δ where the second inequality follows from Lemma 1. This holds for any i ∈ [d], so the proof is complete. With these results in hand, we are now ready to perform a sharp analysis of ∥ˆθ − θ∗∥2. Proposition 4. There exist absolute constants C, C′ > 0 such that the following holds for any δ ∈ (0, 0.1) and any integer L ≥ 2. Fix θ(0) ∈ H and let ∆(0) := max{4L∥θ(0) − θ∗∥∞, 6 L σ}. Also, let ∆ := 2Cσ log N (cid:113) √ δ . Suppose that N ≥ C max (cid:110) L2d L L−1 log dL δ , L3d log (cid:111) , L δ N ≫ L4 d (cid:18) log |Si(∆(0))| ≤ max i∈[d] d CL2 , (cid:18) max i∈[d] |Si(∆)| = o d (L log(N/δ))3/2 (cid:19)5 N δ (cid:19) , , (47a) (47b) where Si(*) is defined in (13a). Let ˆθ be the limit of the EM sequence {θ(t)}t≥0 defined in (5) as guaranteed by Proposition 3. Then we have ∥ˆθ − θ∗∥2 2 ≤ (1 + o(1)) σ2 d − 1 2N tr( ˆΣ†) + C′σ2 (cid:32) (cid:114) log d3/2 N 1 δ + d N log (cid:33) . 1 δ 36 Proof. There is an event E of probability at least 1 − δ on which • |yr − x⊤ r θ∗| ≤ Cσ (cid:113) log N δ for all r ∈ [N ]; • the bounds in Lemma 1 hold; • ∥ ˆΣ∥op ≤ 3, ∥ ˆΣ†∥op ≤ 5, and tr( ˆΣ†) ≥ (d − 1)/3 by Proposition 1 and Lemma 2; • ∥ ˆΣ†∥∞ ≤ 2L by Proposition 2; • ∥ ˆQ(θ∗) − θ∗∥2 2 ≤ σ2 d−1 2N tr( ˆΣ†) + Cσ2 (cid:16) d3/2 N (cid:113) log 1 δ + d N log 1 δ (cid:17) by Lemmas 10 and 11; • ∥ˆθ − θ∗∥∞ ≤ Cσ (cid:113) L d N log d δ by Proposition 3; • ∥A∥∞ ≤ C′ (cid:16) maxi∈[d] |Si(∆)| d + d N log d δ (cid:17) log N δ ≤ o (cid:18) (cid:19) 1 √ log(d/δ) L3/2 by Lemma 13 and the as- sumptions (47a) and (47b); • ∥ω(ˆθ, t)∥∞ ≤ C′ σ ∥ˆθ − θ∗∥2 above bound on ∥ˆθ − θ∗∥∞, and (47a). (cid:0)log N δ (cid:1)3/2 ∞ ≤ C′C2σ L d N (cid:0)log N δ (cid:1)5/2 ≤ o (cid:19) (cid:18) (cid:113) d N σ L by Lemma 14, the Let us condition on the event E in the rest of the proof. Since ˆΣˆθ = ˆΣ ˆQ(ˆθ) = ̄Q(ˆθ), we have ˆΣ(ˆθ − θ∗) = ̄Q(ˆθ) − ̄Q(θ∗) + ̄Q(θ∗) − ˆΣθ∗ N (cid:88) (cid:33) (cid:32) (cid:32) ˆθ tanh − tanh yrx⊤ r σ2 = d − 1 2N r=1 (cid:19)(cid:33) (cid:18) yrx⊤ r θ∗ σ2 yrxr + ̄Q(θ∗) − ˆΣθ∗. By Taylor's theorem, it holds that tanh (cid:33) ˆθ (cid:32) yrx⊤ r σ2 − tanh (cid:19) (cid:18) yrx⊤ r θ∗ σ2 = tanh′ (cid:18) yrx⊤ r θ∗ σ2 (cid:19) yrx⊤ r (ˆθ − θ∗) σ2 + ω(ˆθ, r, tr), where the error term ω(ˆθ, r, tr) is defined in (45a) for some tr ∈ [0, 1]. With this in hand, we have ˆΣ(ˆθ − θ∗) = d − 1 2N N (cid:88) r=1 tanh′ (cid:18) yrx⊤ r θ∗ σ2 (cid:19) yrx⊤ r (ˆθ − θ∗) σ2 = A(ˆθ − θ∗) + ̄Q(θ∗) − ˆΣθ∗ + ω(ˆθ, t), yrxr + ω(ˆθ, t) + ̄Q(θ∗) − ˆΣθ∗ where ω(ˆθ, t) is defined in (45b) for t = (t1, . . . , td), and A is defined in (43). It follows that ˆθ − θ∗ = ˆQ(θ∗) − θ∗ + ˆΣ†A(ˆθ − θ∗) + ˆΣ†ω(ˆθ, t). On the event E, the main term ˆQ(θ∗) − θ∗ in the above formula satisfies ∥ ˆQ(θ∗) − θ∗∥2 2 ≤ σ2 d − 1 2N tr( ˆΣ†) + Cσ2 (cid:32) (cid:114) log d3/2 N 1 δ + d N log (cid:33) . 1 δ (48) (49) 37 The error term satisfies ∥ ˆΣ†A(ˆθ − θ∗) + ˆΣ†ω(ˆθ, t)∥∞ ≤ ∥ ˆΣ†∥∞∥A∥∞∥ˆθ − θ∗∥∞ + ∥ ˆΣ†∥∞∥ω(ˆθ, t)∥∞ ≤ o (cid:16) σ(cid:112)d/N (cid:17) in view of the bounds ∥ ˆΣ†∥∞ ≤ 2L, ∥ˆθ − θ∗∥∞ ≤ Cσ (cid:113) L d N log d δ , ∥A∥∞ ≤ o ∥ω(ˆθ, t)∥∞ ≤ o (cid:19) (cid:18) (cid:113) d N σ L on the event E. It follows that (cid:18) 1 √ log(d/δ) L3/2 (cid:19) , and ∥ ˆΣ†A(ˆθ − θ∗) + ˆΣ†ω(ˆθ, t)∥2 2 ≤ o (cid:0)σ2d2/N (cid:1) . (50) Finally, since tr( ˆΣ†) ≥ (d − 1)/3 on the event E, the first term of the bound in (49) dominates the bound in (50). Combining (49) and (50) with (48) then completes the proof. 6.6 Proof of main results Proof of Theorem 1. The theorem follows from Proposition 3 together with the assumption θ∗ ∈ Θ(β). We first check that the conditions in Theorem 1 imply the conditions in (36). Checking (36a): On the one hand, and as claimed in the statement of the theorem, On the other hand, choosing L = 1 + ⌈2/ρ⌉ and δ = N −D in Proposition 3, we obtain the sample size requirement N ≥ max{d1+ρ, N0}. (51) N ≥ C max (cid:110) L2d L L−1 log dL δ , L3d log (cid:111) . L δ (52) It can be easily verified that for a sufficiently large constant N0 > 0, (51) implies (52). Checking (36b): Furthermore, since θ∗ ∈ Θ(β), if |θ∗ we have j | ≤ ∆, then |i − j| ≤ ∆d/β. Therefore, i − θ∗ Si(∆) = {j ∈ [d] \ {i} : |θ∗ i − θ∗ j | ≤ ∆} ⊂ {j ∈ [d] \ {i} : |i − j| ≤ ∆d/β}, so As a result, for ∆(0) = max{4L∥θ(0) − θ∗∥∞, 6 L σ}, it holds that |Si(∆)| ≤ 2∆d/β. √ |Si(∆(0))| ≤ max{8L∥θ(0) − θ∗∥∞d/β, 12 √ L σd/β} ≤ d CL2 max i∈[d] (53) in view of the assumptions ∥θ(0) − θ∗∥∞ ≤ c1β and σ ≤ c1β. It remains to compare τ in Theorem 1 and Proposition 3: once we set δ = N −D, the two are the same up to multiplicative factors depending solely on the pair (ρ, D). Proof of Theorem 2. The theorem follows from Proposition 4. Continuing from the proof of Theo- rem 1, we check the two additional conditions in (47) compared to (36). Checking (47a): Choosing L = 1 + ⌈2/ρ⌉ and δ = N −D again, we can use the assumption N ≥ max{d1+ρ, N0} to verify that N ≫ L4 d (cid:18) log (cid:19)5 . N δ 38 Checking (47b): We again have |Si(∆)| ≤ 2∆d/β, so for ∆ = 2Cσ (cid:113) log N δ , it holds max i∈[d] |Si(∆)| ≤ 4Cσd β (cid:114) log N δ (cid:18) = o d (L log(N/δ))3/2 (cid:19) in view of the assumption σ = o Implication: Proposition 4 then gives β (log N )2 (cid:16) (cid:17) . ∥ˆθ − θ∗∥2 2 ≤ (1 + o(1)) σ2 d − 1 2N tr( ˆΣ†) + C′σ2 (cid:32) d3/2 N (cid:112)log N + (cid:33) log N . d N Finally, tr( ˆΣ†) ≥ (d − 1)/3 with high probability by Lemma 2, so the first term above dominates the other terms when d ≫ log N . Therefore, Theorem 2 follows. A Probability tools Lemma 15 (Gaussian concentration, Theorem 5.2.2 of Vershynin (2018)). Consider a random vector X ∼ N (0, In) and an L-Lipschitz function f : Rn → R. Then we have Pr{|f (X) − E[f (X)]| ≥ t} ≤ 2 exp (cid:0)−c t2/L2(cid:1) for an absolute constant c > 0. Definition 1 (Convex concentration property). Let X be a random vector in Rn. We say that X has the convex concentration property with constant K if for every 1-Lipschitz convex function φ : Rn → R, we have E[|φ(X)|] < ∞, and for every t > 0, Pr{|φ(X) − E[φ(X)]| ≥ t} ≤ 2 exp (cid:0)−t2/K2(cid:1) . Lemma 16 (Theorem 2.3 of Adamczak (2015)). Let X be a mean zero random vector in Rn. If X has the convex concentration property with constant K, then for any A ∈ Rn×n and any t > 0, Pr{|X ⊤AX − E[X ⊤AX]| ≥ t} ≤ 2 exp (cid:18) − 1 C (cid:18) min t2 K4∥A∥2 F , t K2∥A∥op (cid:19)(cid:19) , for an absolute constant C > 0. Lemma 17 (Matrix Bernstein, Theorem 1.6.2 of Tropp (2015)). Consider a finite sequence {Xk}N of independent, random, Hermitian matrices in Rd×d. Assume that k=1 E[Xk] = 0 and ∥Xk∥op ≤ L for each k ∈ [N ]. Introduce the random matrix Y = Xk. N (cid:88) k=1 39 Let v(Y ) be the matrix variance statistic of the sum: Then Furthermore, for all t > 0, v(Y ) = ∥E[Y 2]∥ = (cid:13) (cid:13) (cid:13) (cid:13) N (cid:88) k=1 (cid:13) (cid:13) E[X 2 . k ] (cid:13) (cid:13) E[∥Y ∥] ≤ (cid:112)2v(Y ) log(2d) + 1 3 L log(2d). Pr{∥Y ∥ ≥ t} ≤ 2d exp − (cid:18) t2/2 v(Y ) + Lt/3 (cid:19) . Lemma 18 (Lemma 2.27 of Wainwright (2019)). Let f : RN → R be a differentiable function. Then for every convex function φ : R → R, we have E[φ(f (X) − E[f (X)])] ≤ E (cid:104) φ (cid:16) π 2 (cid:17)(cid:105) ⟨∇f, Y ⟩ , where X, Y ∼ N (0, IN ) are independent standard Gaussians. B Improved sample complexity In Theorem 1, we assume the conditions • (sample size) N ≥ d1+ρ; • (noise) σ ≤ c1β; • (initialization) ∥θ(0) − θ∗∥∞ ≤ c1β. It is possible to improve the sample complexity at the cost of strengthening the other two conditions. Namely, we may assume the alternative conditions • (sample size) N ≥ d (log d)C1; • (noise) σ ≤ c2 β (log d)5/2 ; • (initialization) ∥θ(0) − θ∗∥∞ ≤ c2 β (log d)3 . To see the sufficiency of this set of conditions, we apply Proposition 3 with L = (cid:6) log d δ = N −D for a constant D > 0. It suffices to check the two conditions in (36). We have log log d ⌉ and 1 L−1 ≤ d Therefore, if N ≥ d (log d)C1 for a sufficiently large constant C1 = C1(D) > 0, then (cid:110) log d = (log d)2. d 2 log log d N ≥ C max L2d L L−1 log , L3d log dL δ (cid:111) . L δ Further, as in (53), we have |Si(∆(0))| ≤ max{8L∥θ(0) − θ∗∥∞d/β, 12 √ L σd/β} ≤ d CL2 max i∈[d] provided that ∥θ(0) − θ∗∥∞ ≤ β be sufficiently small. 8CL3 and σ ≤ β 12CL5/2 . These are satisfied once we choose c2 > 0 to 40 C Minimax lower bounds with a fixed design If the signs zr are given in the model (1) and the covariates xr are fixed, then the problem reduces to linear regression with a fixed design. It is an elementary fact that the least squares estimator ˆθLS achieves the risk E ∥ˆθLS − θ∗∥2 2 = σ2 tr (cid:18)(cid:16) N (cid:88) (cid:17)†(cid:19) . xrx⊤ r r=1 It is well-known that this risk is minimax-optimal. To show that σ2 tr is a lower bound on the minimax risk, the standard proof is via the Bayes risk assuming that θ∗ has the prior distribution N for a parameter τ . One can compute the Bayes-optimal estimator which is the posterior mean of θ∗. Then the Bayes risk achieved by the posterior mean evaluates to τ 2 . Since the Bayes risk is a lower bound on the minimax risk, letting τ → ∞ proves the desired lower bound. 0, τ 2(cid:0) (cid:80)N 1+τ 2 σ2 tr r=1 xrx⊤ r r=1 xrx⊤ r r=1 xrx⊤ r (cid:16)(cid:0) (cid:80)N (cid:1)†(cid:17) (cid:1)†(cid:17) (cid:16) (cid:16)(cid:0) (cid:80)N (cid:1)†(cid:17) (cid:1)†(cid:17) r=1 xrx⊤ r If the signs zr are unknown in the mixture model (1) and the covariates xr are fixed, then (cid:16)(cid:0) (cid:80)N is still a lower bound on the minimax risk for estimating θ∗. Therefore, σ2 tr conditional on a typical realization of (xr)N r=1, the proof of Theorem 2 in fact shows that the EM fixed point ˆθ achieves the minimax rate with the sharp constant (see Theorem 2 and Eq. (7)). Since this work assumes a random design of the covariates, to keep our terminology consistent, we do not further formalize a minimax result in the fixed-design setting. Acknowledgments AD was supported in part by NSF grant DMS-2053333. CM was supported in part by NSF grants DMS-2053333 and DMS-2210734. AP was supported in part by NSF grants CCF-2107455 and DMS-2210734, and by Research Awards from Adobe and Amazon. CM thanks Dylan J. Altschuler and Anderson Ye Zhang for helpful discussions. References E. Abbe, S. Li, and A. Sly. Proof of the contiguity conjecture and lognormal limit for the sym- metric perceptron. In 2021 IEEE 62nd Annual Symposium on Foundations of Computer Science (FOCS), pages 327–338. IEEE, 2022. R. Adamczak. A note on the Hanson–Wright inequality for random vectors with dependencies. Electronic Communications in Probability, 20:1–13, 2015. D. J. Altschuler. Critical window of the symmetric perceptron. arXiv preprint arXiv:2205.02319, 2022. S. Balakrishnan, M. J. Wainwright, and B. Yu. Statistical guarantees for the EM algorithm: From population to sample-based analysis. The Annals of Statistics, 45(1):77 – 120, 2017. I. Borg and P. J. Groenen. Modern multidimensional scaling: Theory and applications. Springer Science & Business Media, 2005. 41 R. A. Bradley and M. E. Terry. Rank analysis of incomplete block designs: I. the method of paired comparisons. Biometrika, 39(3/4):324–345, 1952. A. T. Chaganty and P. Liang. Spectral experts for estimating mixtures of linear regressions. In International Conference on Machine Learning, pages 1040–1048. PMLR, 2013. K. A. Chandrasekher, A. Pananjady, and C. Thrampoulidis. Sharp global convergence guar- antees for iterative nonconvex optimization: A Gaussian process perspective. arXiv preprint arXiv:2109.09859, 2021. P. Chen, C. Gao, and A. Y. Zhang. Optimal full ranking from pairwise comparisons. The Annals of Statistics, 50(3):1775–1805, 2022. S. Chen, J. Li, and Z. Song. Learning mixtures of linear regressions in subexponential time via Fourier moments. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, pages 587–600, 2020. X. Chen, P. N. Bennett, K. Collins-Thompson, and E. Horvitz. Pairwise ranking aggregation in a crowdsourced setting. In Proceedings of the sixth ACM international conference on Web search and data mining, pages 193–202, 2013. Y. Chen, X. Yi, and C. Caramanis. Convex and nonconvex formulations for mixed regression with IEEE Transactions on Information Theory, 64(3): two components: Minimax optimal rates. 1738–1766, 2017. Y. Chen, Y. Chi, J. Fan, and C. Ma. Gradient descent with random initialization: Fast global convergence for nonconvex phase retrieval. Mathematical Programming, 176:5–37, 2019. Y. Chen, Y. Chi, J. Fan, and C. Ma. Spectral methods for data science: A statistical perspective. Foundations and Trends® in Machine Learning, 14(5):566–806, 2021. F. Chierichetti, R. Kumar, and A. Tomkins. Learning a mixture of two multinomial logits. In International Conference on Machine Learning, pages 961–969. PMLR, 2018. F. Chung and M. Radcliffe. On the spectra of general random graphs. the electronic journal of combinatorics, pages P215–P215, 2011. A. Coja-Oghlan. On the Laplacian eigenvalues of G(n, p). Combinatorics, Probability and Com- puting, 16(6):923–946, 2007. M. Cucuringu and H. Tyagi. An extension of the angular synchronization problem to the hetero- geneous setting. arXiv preprint arXiv:2012.14932, 2020. Y. Dagan, V. Kandiros, and C. Daskalakis. EM's convergence in Gaussian latent tree models. In P.-L. Loh and M. Raginsky, editors, Proceedings of Thirty Fifth Conference on Learning Theory, volume 178 of Proceedings of Machine Learning Research, pages 2597–2667. PMLR, 02–05 Jul 2022. C. Daskalakis, C. Tzamos, and M. Zampetakis. Ten steps of EM suffice for mixtures of two Gaussians. In Conference on Learning Theory, pages 704–710. PMLR, 2017. 42 A. P. Dawid and A. M. Skene. Maximum likelihood estimation of observer error-rates using the EM algorithm. Journal of the Royal Statistical Society: Series C (Applied Statistics), 28(1):20–28, 1979. A. P. Dempster, N. M. Laird, and D. B. Rubin. Maximum likelihood from incomplete data via the EM algorithm. Journal of the royal statistical society: series B (methodological), 39(1):1–22, 1977. D. Drusvyatskiy, N. Krislock, Y.-L. Voronin, and H. Wolkowicz. Noisy euclidean distance real- ization: robust facial reduction and the pareto frontier. SIAM Journal on Optimization, 27(4): 2301–2331, 2017. R. Dudeja, Y. M. Lu, and S. Sen. Universality of approximate message passing with semi-random matrices. arXiv preprint arXiv:2204.04281, 2022. R. Dwivedi, N. Ho, K. Khamaru, M. J. Wainwright, M. I. Jordan, and B. Yu. Singularity, misspec- ification and the convergence rate of EM. The Annals of Statistics, 48(6):3161 – 3182, 2020. Y. C. Eldar and S. Mendelson. Phase retrieval: Stability and recovery guarantees. Applied and Computational Harmonic Analysis, 36(3):473–494, 2014. U. Feige and E. Ofek. Spectral techniques applied to sparse random graphs. Random Structures & Algorithms, 27(2):251–275, 2005. C. Gao and A. Y. Zhang. Exact minimax estimation for phase synchronization. IEEE Transactions on Information Theory, 67(12):8236–8247, 2021. J. C. Gower. Euclidean distance geometry. Math. Sci, 7(1):1–14, 1982. C. Heumann, B. Gr ̈un, and F. Leisch. Finite mixtures of generalized linear regression models. Recent advances in linear models and related areas: essays in honour of helge toutenburg, pages 205–230, 2008. M. I. Jordan and R. A. Jacobs. Hierarchical mixtures of experts and the EM algorithm. Neural computation, 6(2):181–214, 1994. J. M. Klusowski, D. Yang, and W. Brinda. Estimating the coefficients of a mixture of two linear IEEE Transactions on Information Theory, 65(6): regressions by expectation maximization. 3515–3524, 2019. T. Kolokolnikov, B. Osting, and J. Von Brecht. Algebraic connectivity of Erd ̈os–R ́enyi graphs near the connectivity threshold. Manuscript in preparation, 2014. J. Kwon and C. Caramanis. EM converges for a mixture of many linear regressions. In International Conference on Artificial Intelligence and Statistics, pages 1727–1736. PMLR, 2020. J. Kwon, W. Qian, C. Caramanis, Y. Chen, and D. Davis. Global convergence of the EM algorithm for mixtures of two component linear regression. In Conference on Learning Theory, pages 2055– 2110. PMLR, 2019. 43 J. Kwon, N. Ho, and C. Caramanis. On the minimax optimality of the EM algorithm for learning In International Conference on Artificial Intelligence two-component mixed linear regression. and Statistics, pages 1405–1413. PMLR, 2021. R. Lai and J. Li. Solving partial differential equations on manifolds from incomplete interpoint distance. SIAM Journal on Scientific Computing, 39(5):A2231–A2256, 2017. Y. Li and Y. Liang. Learning mixtures of linear regressions with nearly optimal complexity. In Conference On Learning Theory, pages 1125–1144. PMLR, 2018. L. Liberti, C. Lavor, N. Maculan, and A. Mucherino. Euclidean distance geometry and applications. SIAM review, 56(1):3–69, 2014. A. Liu, Z. Zhao, C. Liao, P. Lu, and L. Xia. Learning Plackett–Luce mixtures from partial pref- In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages erences. 4328–4335, 2019. R. D. Luce. Individual choice behavior: A theoretical analysis. Wiley, 1959. C. Mao and Y. Wu. Learning mixtures of permutations: Groups of pairwise comparisons and combinatorial method of moments. The Annals of Statistics, 50(4):2231–2255, 2022. C. Mollica and L. Tardella. Bayesian Plackett–Luce mixture models for partially ranked data. Psychometrika, 82(2):442–458, 2017. D. Nguyen and A. Y. Zhang. Efficient and accurate learning of mixtures of Plackett–Luce models. arXiv preprint arXiv:2302.05343, 2023. W. Perkins and C. Xu. Frozen 1-rsb structure of the symmetric ising perceptron. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, pages 1579–1588, 2021. R. L. Plackett. The analysis of permutations. Journal of the Royal Statistical Society Series C: Applied Statistics, 24(2):193–202, 1975. W. Qian, Y. Zhang, and Y. Chen. Global convergence of least squares EM for demixing two log-concave densities. Advances in Neural Information Processing Systems, 32, 2019. H. Sedghi, M. Janzamin, and A. Anandkumar. Provable tensor methods for learning mixtures of generalized linear models. In Artificial Intelligence and Statistics, pages 1223–1231. PMLR, 2016. A. Singer. Angular synchronization by eigenvectors and semidefinite programming. Applied and computational harmonic analysis, 30(1):20–36, 2011. J. Spencer. Six standard deviations suffice. Transactions of the American mathematical society, 289(2):679–706, 1985. S. Sremac, F. Wang, H. Wolkowicz, and L. Pettersson. Noisy Euclidean distance matrix completion with a single missing node. Journal of Global Optimization, 75:973–1002, 2019. Y. Sun, S. Ioannidis, and A. Montanari. Learning mixtures of linear classifiers. In International Conference on Machine Learning, pages 721–729. PMLR, 2014. 44 A. Tasissa and R. Lai. Exact reconstruction of Euclidean distance geometry problem using low-rank matrix completion. IEEE Transactions on Information Theory, 65(5):3124–3144, 2018. J. A. Tropp. An introduction to matrix concentration inequalities. Foundations and Trends® in Machine Learning, 8(1-2):1–230, 2015. R. Vershynin. High-dimensional probability: An introduction with applications in data science, volume 47. Cambridge university press, 2018. K. Viele and B. Tong. Modeling with mixtures of linear regressions. Statistics and Computing, 12: 315–330, 2002. M. J. Wainwright. High-dimensional statistics: A non-asymptotic viewpoint, volume 48. Cambridge University Press, 2019. T. Wang, X. Zhong, and Z. Fan. Universality of approximate message passing algorithms and tensor networks. arXiv preprint arXiv:2206.13037, 2022. C. J. Wu. On the convergence properties of the EM algorithm. The Annals of statistics, pages 95–103, 1983. Y. Wu and H. H. Zhou. Randomly initialized EM algorithm for two-component Gaussian mixture n) iterations. Mathematical Statistics and Learning, 4(3), 2021. achieves near optimality in O( √ J. Xu, D. J. Hsu, and A. Maleki. Global analysis of expectation maximization for mixtures of two gaussians. Advances in Neural Information Processing Systems, 29, 2016. L. Xu, M. Jordan, and G. E. Hinton. An alternative model for mixtures of experts. Advances in neural information processing systems, 7, 1994. X. Zhang, X. Zhang, P.-L. Loh, and Y. Liang. On the identifiability of mixtures of ranking models. arXiv preprint arXiv:2201.13132, 2022. Z. Zhao, P. Piech, and L. Xia. Learning mixtures of Plackett–Luce models. In International Conference on Machine Learning, pages 2906–2914. PMLR, 2016. Z. Zhao, A. Liu, and L. Xia. Learning mixtures of random utility models with features from incomplete preferences. arXiv preprint arXiv:2006.03869, 2022. Y. Zhong and N. Boumal. Near-optimal bounds for phase synchronization. SIAM Journal on Optimization, 28(2):989–1016, 2018. 45
http://arxiv.org/abs/2302.10062v1
2023-02-20T16:08:54
2023-02-20T16:08:54
An evaluation of deep learning models for predicting water depth evolution in urban floods
In this technical report we compare different deep learning models for prediction of water depth rasters at high spatial resolution. Efficient, accurate, and fast methods for water depth prediction are nowadays important as urban floods are increasing due to higher rainfall intensity caused by climate change, expansion of cities and changes in land use. While hydrodynamic models models can provide reliable forecasts by simulating water depth at every location of a catchment, they also have a high computational burden which jeopardizes their application to real-time prediction in large urban areas at high spatial resolution. Here, we propose to address this issue by using data-driven techniques. Specifically, we evaluate deep learning models which are trained to reproduce the data simulated by the CADDIES cellular-automata flood model, providing flood forecasts that can occur at different future time horizons. The advantage of using such models is that they can learn the underlying physical phenomena a priori, preventing manual parameter setting and computational burden. We perform experiments on a dataset consisting of two catchments areas within Switzerland with 18 simpler, short rainfall patterns and 4 long, more complex ones. Our results show that the deep learning models present in general lower errors compared to the other methods, especially for water depths $>0.5m$. However, when testing on more complex rainfall events or unseen catchment areas, the deep models do not show benefits over the simpler ones.
[ "Stefania Russo", "Nathanaël Perraudin", "Steven Stalder", "Fernando Perez-Cruz", "Joao Paulo Leitao", "Guillaume Obozinski", "Jan Dirk Wegner" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10062v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10062v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "physics.ao-ph" ]
3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 2 6 0 0 1 . 2 0 3 2 : v i X r a An evaluation of deep learning models for predicting water depth evolution in urban floods Stefania Russo2, Nathana ̈el Perraudin1, Steven Stalder1, Fernando Perez-Cruz1, Joao Paulo Leitao3, Guillaume Obozinski1, and Jan Dirk Wegner4 1Swiss Data Science Center, ETH Z ̈urich and EPF Lausanne, Switzerland 2Photogrammetry and Remote Sensing group, ETH Zurich, Switzerland 3Department of Urban Water Management, EAWAG, Switzerland 4Institute for Computational Science, University of Zurich, Switzerland August 2022 Abstract In this technical report we compare different deep learning models for prediction of water depth rasters at high spatial resolution. Efficient, accurate, and fast methods for water depth prediction are nowadays important as urban floods are increasing due to higher rainfall intensity caused by climate change, expansion of cities and changes in land use. While hydrodynamic models models can provide reliable forecasts by simulating water depth at every location of a catchment, they also have a high computational burden which jeopardizes their application to real-time prediction in large urban areas at high spatial resolution. Here, we propose to address this issue by using data-driven techniques. Specifically, we evaluate deep learning models which are trained to reproduce the data simulated by the CADDIES cellular-automata flood model, providing flood forecasts that can occur at different future time horizons. The advantage of using such models is that they can learn the underlying physical phenomena a priori, preventing manual parameter setting and computational burden. We perform experiments on a dataset consisting of two catchments areas within Switzerland with 18 simpler, short rainfall patterns and 4 long, more complex ones. Our results show that the deep learning models present in general lower errors compared to the other methods, especially for water depths > 0.5m. However, when testing on more complex rainfall events or unseen catchment areas, the deep models do not show benefits over the simpler ones. 1 Introduction Floods are one of the most common natural disasters with an unpredictable and destructive force carrying devastating consequences for infrastructure, economy and societies [34]. At the whim of nature, floods can affect massive areas leaving no possibility to prevent or undo the destruction following the disaster. In urban areas, floods occur when natural water sources or drainage systems in cities lack the capacity to convey excess water caused by intense rainfall events [1]. Thus, early warning systems through real-time flood predictions [31], and a quick and effective response from rescue services make up the most essential counter- measures to floods [41]. While hydrodynamic flood simulation models can provide reliable forecasts for water depth at every location of a catchment, their high computational burden, as well as required expertise and in-depth knowledge about hydrological parameters [36] is hindering their application. For this reason, data- driven models have been developed in recent years for flood forecasting and prediction [45, 33, 22, 18], In this technical report, we compare several deep learning models for dense water depth prediction at different future time horizons. The models only require terrain features such as the Digital Elevation Model (DEM) of the area under study and a rainfall forecast. 1 We evaluate the models on a dataset consisting of two catchments areas within Switzerland with 18 simple, short rainfall patterns and 4 long, more complex ones. Our results show that the deep learning models present in general lower errors compared to the other methods, especially for water depths > 0.5m. On the other hand, the deep models do not show any benefits over the simpler one when testing on more complex rainfall events or unseen catchment areas. We discuss that this is probably caused by the fact that the networks only capture the easiest correlations in the dataset so and fail to do so for the complex dynamics in the long rainfall events. We conclude this report proposing potential solutions for future works. 2 Related Works Flooding is and has been a massive concern over past decades, causing wide-spread damage to infrastructure and economy. Greatest damages can arise especially in the case of urban flash-floods where the reaction time and planning time is limited. Predicting large scale flash-floods is therefore crucial to support counter measures such as early warning systems. In this section, an overview of techniques for flood prediction is given. Hydrodynamic models have been in use for long time to predict water-related events, such as floods [14], storms [4, 13], rainfall/runoff [6, 16] and flows [12, 49]. Physically-based hydrodynamic models have been used for a long time in urban flood simulation [5, 9, 2]. Nevertheless, the development of physically-based models often requires expertise related to hydrological parameters, making the application to spatial flood forecasting challenging [28], in addition to its high computational cost. Other approaches used for flood prediction are simple and easy-to-use statistical models, such as multiple criteria decision methods, weights-of-evidence and flood frequency analysis [40]. However, due to various simplifying assumptions, they often produce results with insufficient precision and tend to be unreliable. Another group of models for flood estimation are the so- called physically-simplified approaches [32, 25] predicting floods through simplified hydraulic notions. As a result, these model provide predictions with much lower computational costs [24, 38]. The cellular-automata flood models [20] have recently gained attention by the hydrological community. Instead of solving complex shallow water equations, these models carry out faster flood modelling by using transition rules which work by predicting the new state (i.e. the amount of water in each cell) based on the cell's previous state and its neighbors. This is applied on all raster cells in parallel, thus supporting GPU parallelism, greatly reducing the simulation time [20] at the cost of accuracy. The shortcomings of the above mentioned hydrodynamic models encouraged the use of advanced data- driven models, such as Machine Learning (ML). A further reason for the popularity of ML is that it can numerically formulate the nonlinear characteristics of the flood without the need to learn the physical pro- cesses from scratch [37]. Many ML models, such as multilayer perceptron [42], wavelet neural networks [39], support vector machine [46, 11], decision tree based classifiers [27, 26], neuro-fuzzy [35], and artificial neural networks (ANNs) [26], have been applied to flood forecasting. In recent years, Deep Learning (DL) models, which fall into the general umbrella of ML, have gained more popularity since they overcome many of the limitations of traditional ML methods on the modelling process [47]. Compared to earlier ANNs, DL models can identify complex nonlinear relationships underlying predictor and outcome variables [40], which also enables DL models to outperform traditional ML methods in flood forecasting tasks successfully. In [8], the authors forecast a river stream flow based on the rainfall measurements from several gauge stations using a recurrent neural network. This method was later extended to multiple-step-ahead using an expandable ANN architecture in [7]. In [30], a single long short-term memory model was trained on hundreds of basins using meteorological time series data and static catchment attributes. Their approach significantly outperformed hydrological models that were calibrated regionally. [45] used a convolutional neural network (CNN) model to perform a daily runoff prediction. Similarly, [33] employed a CNN to predict the maximum water depth maps (i.e. an hazard map) in urban pluvial flood events. [22] also used a CNN-based U-Net [43] model, exploring the where the generalization capabilities of CNNs as flood prediction models. Recently, in [18], DL techniques were used for predicting gauge height, with higher accuracy than the physical and statistical models currently in use. While most of the above works focus on predicting the maximum water depth that can occur for any point in the map in the near future, in this technical report we consider the task of providing flood forecasts at different future time horizons (i.e. 30 minutes, 1 hour). In this way, we aim at modeling the full evolution of 2 water depth at different time steps. 3 Experiment setup Figure 1: DEM (normalized elevation) of the main catchment area 709. Dark to light color indicates low to high elevation. The values that are completely zero are not part of the catchment area. 3.1 Dataset For our experiments, we use a dataset consisting of simulations run by the CADDIES cellular-automata flood model [19]. The transformation rules of the CADDIES model establish flow motions through a weight- based mechanism, which avoid the need to solve complicated and time-consuming equations. It outperforms physically-based models for solving shallow water equations in terms of computational performance, with a decrease in accuracy [19]. Using this dataset allows us to conveniently verify our approach with low computational effort. The simulated results consist of pairings of rainfall events and water depths in two catchment areas across Switzerland, which are named 709 and 744 according to a DEM numbering system. The data comes with a spatial resolution of 1m. Data Preparation Most experiments are performed on the catchment area 709 from the dataset, whose elevation map we show in Fig. 1. Eighteen different one-hour short rainfall events in this catchment area are created based on the return periods of 2, 5, 10, 20, 50, and 100 years. Additionally, we have access to four long rainfall events over time periods of up to four hours. In Figure 2, we show the amount of rainfall for the short events, split into training and test sets, as well as for all long events, which we individually add to the training or test set for some experiments. The simulation are discretized with a time step of 5 minutes. The evolution of spatial water depths for one rainfall event is shown in Fig. 4. The time steps 1, 6, 8, 12, 16, 36, 46, and 61 are chosen to give an overview of the entire event. Note that one time step equals 5 minutes. It can be seen that the water depth quickly rises during time steps 1 to 12, and starts to decrease slowly after until the last time step 61. This is consistent with the rainfall event that only lasts for 60 minutes, which equals 12 time steps. Note that most areas have very low water depths or no water at all (see Figure 3). Most of the water will be densely concentrated in a few small areas. These areas are also the most critical ones, and therefore we care most about correctly predicting these extreme water depths. In Section 4, we will also show one experiment on catchment area 744. How- ever, because that data is structured and preprocessed in the same way as the one for catchment area 709, we will omit its details from the next paragraphs. Figure 3: Histogram of wa- ter depths for event tr2 1. Data Preprocessing Five features are selected and concatenated as input data X for the models, including the DEM elevation D, spatial differential DEM elevation ∆D, rainfall R, water depth W , as well as temporal differential water depth ∆W if the number of given input time steps is greater than 1. These features are concatenated as multi-channel images (rasters), which are composed of 3×T+H+3 channels, where T is the number of input time steps ordered from oldest to latest, and H is the amount of 3 0.60.70.80.91.00246810Water depth (m)101103105107 Figure 2: Hyetographs of rainfall events used for simulations. For the short events, the first number of the label denotes the return period, while the second denotes the time step discretization (5 minutes - "1", 10 minutes - "2" and 15 minutes - "3"). For the long events: the same naming is applied, in addition to "c" that stands for "continued" rainfall. Additionally, two real long rainfall events were also used, real1 c1 and real2 c1, lasting two hours and with a return period of approximately 20 years. Figure 4: Evolution of spatial water depth over time for event tr2 1. time steps we want to predict ahead for. The resolution of the catchment area 709 is 2525×3000, resulting in the corresponding shapes of the features, as shown in the Table 1. Variable Feature D ∆D R W ∆W DEM spatial differential DEM rainfall water depth temporal differential water depth Shape 2525×3000×1 2525×3000×4 2525×3000×(T + H − 1) 2525×3000×T 2525×3000×(T − 1) Table 1: Shape of the input features for catchment area 709. The input X consist of the concatenation of some or all of these features. The process to obtain ∆D and ∆W is as follows: • ∆D: The DEM can be viewed as a 2D grid, where the elevation change can be measured in four 4 0102030405060Minutes020406080100120140Rainfall (mm/h)709 Short Events (Train + Val)tr5_1tr20_1tr50_1tr2_2tr10_2tr20_2tr50_2tr5_3tr10_3tr100_3tr100_2tr2_30102030405060Minutes020406080100120140160Rainfall (mm/h)709 Short Events (Test)tr2_1tr10_1tr100_1tr5_2tr20_3tr50_3050100150200250Minutes020406080100Rainfall (mm/h)709 Long Eventsreal1_c1tr50_3c2tr50_3c1real2_c1 directions: left, right, down and up. For each direction, we pad D with -1 on the respective side before performing the subtractions along the columns (c) or rows (r) to introduce the correct shift in the output and to obtain the ∆D with the same resolution as D: ∆D(i) 1 = c(i) − c(i−1) (Leftward change) ∆D(i) 2 = c(i) − c(i+1) (Rightward change) ∆D(j) 3 = r(j) − r(j−1) (Downward change) ∆D(j) 4 = r(j) − r(j+1) (Upward change) (1) (2) (3) (4) where i and j are the column and row indices in the range [1, 3000] and [1, 2525], respectively. Remember that because of the padding, c(0), r(0), c(3001), and r(2526) denote added vectors which all equal −1. • ∆W : There are a series of spatial water depths for each rainfall event, and the water depths W of adjacent time steps can be subtracted in time order. Then, ∆W with T-1 channels can be computed as follows: ∆W (t) = W (t+1) − W (t), (5) where t is the time step in the range [1, T -1]. Note that the selection of these features was inspired by the work of [22]. Naturally, we cannot handle the full input at once due to its size. Therefore, the input data X is sampled in patches size of 128×128. In addition to reducing the input size, training on a large amount of randomly sampled patches can also help the models to generalize better. 3.2 Neural network models Figure 5: Overview of the simple FCN architecture. The spatial dimensions of the patch are preserved throughout the network. In this subsection, we describe our neural network architectures. Each model is given the same inputs for a fixed amount of previous time steps T and a fixed amount of future time steps H, which we want to predict ahead for (see Table 1). All data is provided for a catchment patch of size 128x128 and concatenated. Finally, the models output a patch of equal size that predicts the amount of change in water depth for each 5 196464Input Tile128x128 5x5 conv, ReLU128x128128x128128x1281Output tile pixel. Predicting changes instead of directly predicting water depths facilitates training. However, one can easily retrieve the actual water depths from these values. Fully Convolutional Network (FCN) As a first, relatively simple model, we have chosen to implement a Fully Convolutional Network (FCN). The FCN consists of three convolutional layers with a kernel size of 5 and adequate zero padding on the sides to preserve the input dimensions (see Figure 5). AutoEncoder Our second network has been inspired by [21], who use a Convolutional AutoEncoder, which is another fully convolutional architecture. The network first increases the amount of features while decreasing the spatial dimensions through pooling operations. This part of the model is called the encoder as it "encodes" information into a reduced representation. In the second half of the network – the decoder – the spatial dimensions are restored through transposed convolutions. The architecture is visualized in Figure 6. Figure 6: Overview of the CNN AutoEncoder architecture. The spatial dimensions of the full image with K input features (depending on amount of time steps given and other settings, and equaling 19 for our experiments) are first reduced through pooling operations. Later, they are restored through transposed convolutions to produce an output of the original input size. U-Net The U-Net architecture [43] is similar to the CNN AutoEncoder in the sense that the spatial di- mensions of the input are first down- and later upsampled to produce an output of the original dimensions. However, there are a few key changes to the architecture. Most importantly, the U-Net utilizes skip connec- tions to concatenate the outputs of the left and right half of the network. Furthermore, we have decided to use bi-linear upsampling instead of transposed convolutions. The U-Net architecture is visualized in Figure 7. Graph Our graph model was designed with the specific goal of mimicking the underlying physical process of water flooding. To do so, we view the image as a graph where each pixel is a node with only 4 edges: up, down, left and right connection. This graph allows us to easily encode two simple hypotheses into the model: 1) the waterflow between two nodes depends only the elevation difference and the current amount of water on both nodes. 2) The resulting waterlevel on a node consists in the sum of the 4 waterflows (from the edges) and the remaining water on the node. A simplified1 version of the model is provided in Figure 8. The learnable parameters of the network are the two Multilayer Linear Perceptrons (MLP) in blue. For efficiency reasons, we implemented these MLPs using 1x1 and 1x2 convolutions. 3.3 Baselines To better evaluate the performance of our neural network models, we have implemented two non-parametric baselines. 1For simplicity, we omitted some of the input features in the network 6 193232Input Tile128x12832646464x646432x3212812816x1632x32128128128646464x64 643232128x128 321Output tile 3x3 conv, LeakyReLU 2x2 Max Pool 2x2 Transposed conv Figure 7: Overview over the U-Net architecture. The spatial dimensions of input are first downsampled through pooling operations and later upsampled through bi-linear upsampling. The skip connections seen in this figure give the architecture its characteristic U-shape. A. No change. Our first baseline outputs no change in water depth at the next predicted time step. Assuming T given time steps: with Y denoting the output (note that T is the latest time step). Equivalently, Y = W (t), with ∆Y = Y − W (t). ∆Y = 0, B. Linear extrapolation. The second baseline performs linear extrapolation, i.e. it predicts or, equivalently, Note that ∆W (t−1) = W (t) − W (t−1). Y = W (t) + ∆W (t−1), ∆Y (t) = ∆W (t−1). (6) (7) (8) (9) Furthermore, we also implemented two baselines using classic autoregressive models. These models are only given the water depth data without any information on the DEM or the rainfall data. The incentive for leaving out this information here is to test whether the more complex models are able to sufficiently utilize this additional data for improved predictions over these baselines. C. Autoregressive (AR) 1x1. We implement a single convolutional layer with a 1x1 kernel to predict the next water depths in a pixel-wise manner. D. Autoregressive (AR) 5x5. As a second model, we implement a single convolutional layer but with a 5x5 kernel to take into account some information of close-by locations. The models are only trained to predict the water depths in the next time step. If we require a prediction for a later time step, we apply the model autoregressively until we arrive at this point in time. To be precise, each output of the model will be added to the input in place for the oldest time step in a looping manner until we reach the desired time step. 7 196464Input Tile128x12864x64 12812832x32 25625616x16 5125128x8 10245125125122562561281286464116x16 32x32 64x64 128x128 3x3 conv, BN, ReLUOutput Tile 2x2 Max Pool 2x2 Bilinear Upsampling Skip Connections Figure 8: Simplified scheme of the graph architecture. The only learnable blocks are in blue. They can In a first step, we compute the "water acceleration" based on the DEM in the edge be seen as MLPs. block. Then, we combine this information with the water level on neighboring nodes in the "node block". Eventually, the output is one flow per edge and some remaining water on the node. Finally, we aggregate the water with a simple sum (orange block). 3.4 Loss function The loss function, which is optimized during training, measures the quality of a set of network parameters w.r.t. the training data. For this loss function, we have experimented with several variations of the mean absolute error (MAE) and mean squared error (MSE). Finally, due to difficulties with learning the largest differences in water depths (which are considered the most important predictions), we have settled for a variant of MAE that increases the loss by a factor of 4 wherever the target water depth changes by more than 20cm. As it can be observed in Figure 3, the amount of large water depths is relatively small but most critical for our case. However, in practice such water levels are of the highest importance since they correspond to the most dangerous situations. 3.5 Evaluation method We predict water depths for the test rainfall events that have not been seen during training to test the performance of the implemented models. Since our main interest is to avoid errors at higher water depths, we define different water depth ranges: our main evaluation metric M measures the absolute errors within 5 buckets (intervals) depending on the ground truths, for water depths of 0-10cm, 10-20cm, 20-50cm, 50- 100cm, and >100cm, respectively. Since the errors will vary greatly between buckets, we further normalize them by the standard deviation of the ground truths within each bucket. To summarize, we compute for every pixel-wise prediction ˆyi in each bucket b: Mb(yi, ˆyi) = |yi − ˆyi| σb , (10) where y is a vector of all ground truths in bucket b, and σb denotes the standard deviation over these ground truths. Naturally, we want to minimize this metric. The normalization (division by the standard ground truth deviation) used in our metric, i.e. (10) has the advantage to provide an error theoretically scale-independent of the water level. Furthermore, similar to the coefficient of determination, this metric quantifies globally learning in comparison with a mean predictor. The error of a mean predictor is in average 1 as the numerator will be, in average, the standard deviation. Therefore, we consider that the models are learning if the metric (10) is below 1 and that the model is failing to learn if the metric is above 1. 4 Results Through testing many different configurations, we have found the following settings that work well across all of the models. Each model receives 5 previous time steps as input, where the spatial dimension of the features 8 Edge block Water accelerationNode blockWater displacementRepeat for all edgesWater aggregation4 edgesflowsremainingwaterPrediction rainfall is of size 128x128, and predicts the change in water depth one hour ahead (12 time steps of 5 minutes). All parametric models are trained for 30 epochs with a learning rate of 10−3 and the Adam optimizer [29], except the AutoEncoder, which we train for 50 epochs with a learning rate of 10−4 because it failed to train with a higher learning rate. 4.1 Training methods To facilitate further evaluations on all networks and baselines, we first aim to establish a preferred training method. We consider three options: A. 1 TS: The network is trained to predict one time step ahead and evaluated iteratively to get predictions for 12 time steps ahead. B. 12 TS Direct: The network is trained to directly predict 12 time steps ahead. C. 12 TS Iterative: The network is trained to predict 12 time steps ahead iteratively, i.e. already during training it uses predictions for one time step as an additional input for predicting the next time step until all 12 time steps are predicted. We have implemented all training methods for two of our models with the hope that the results will be sufficiently predicative to assume that the behavior will generalize to the other models as well. To this end, we have evaluated the training methods for our FCN as well as the Graph model in Figure 9. Despite some issues with low water depths, we can conclude that training to directly predict 12 time steps ahead yields clearly better results than the other training methods, especially for larger water depths, which are the most critical ones. This comes with the additional benefit that direct prediction is significantly faster than autoregressively predicting one step after another. Therefore, all models in subsequent experiments will use this training method, except the last two baselines that are designed to be applied autoregressively. Figure 9: Comparison of training methods for the FCN (left) and Graph (right) models. The error metric is described in Section 3.5. Both models have been trained and evaluated on the 709 short rainfall events (see Figure 2). 4.2 Model comparison In this section, we evaluate all four deep models, the two non-parametric baselines, as well as our two versions of the autoregressive baseline. Out of all experiments that have been performed, we chose three that should give the most complete picture over the overall performance of the models. Short rainfall events For our first evaluation, we compare the models' performance on the short events of the 709 catchment. The specific training, validation and testing split that we use for this experiment can be seen in Table 2. 9 0-10 cm10-20 cm20-50cm50-100cm>100cm0.000.250.500.751.001.251.501 TS12 TS Direct12 TS Iterative0-10 cm10-20 cm20-50cm50-100cm>100cm0.000.250.500.751.001.251.501 TS12 TS Direct12 TS Iterative Our results are summarized in Figure 10. For the lower water depths, some of the baseline models outperform the deep networks. Under the assumption that lower water depths also show less change over time, it is not too surprising that predicting no change at all might result in relatively small errors overall. For the two non-parametric baselines, this behavior is certain, but also the simple autoregressive baselines seem to be able to capture little to no change better than the more involved models. However, we care about more about predictions for large water depths which are more critical. In the range of 50-100cm and especially for water depths of more than 1m, we see that both the U-Net as well as the graph model show significantly lower errors compared to the other methods. Dataset Rainfall Events Training Set tr5 1, tr20 1, tr50 1, tr2 2, tr10 2, tr20 2, tr50 2, tr5 3, tr10 3, tr100 3 Validation Set tr100 2, tr2 3 Test Set tr2 1, tr10 1, tr100 1, tr5 2, tr20 3, tr50 3 Table 2: Allocation of training, validation and test set for the 709 catchment with only short rainfall events. Figure 10: Box plots for all models trained and tested on catchment area 709 with short events only. The medians are denoted by a black dash. In a next step, we want to introduce long rainfall events to the training and testing Long rainfall events procedures. We add the events real1 c1 and tr50 3c2 (see rightmost plot in Figure 2) to the training set from Table 2 and event tr50 3c1 to the validation set. As the test set, we replace the two short events with the long event real2 c1. We decided to replace the short events in the test set because we want to measure the performance on a long event specifically, without influence from the possibly different performance on the short events. From the results from Figure 11 we see that the errors are considerably higher for all models compared to the short events. Unfortunately, we cannot observe any advantages from the more involved models over a simple model like the FCN or even over the autoregressive baselines. There is a small, but – due to the overall poor performance – insignificant benefit over the non-parametric baselines that predict no change at all or linearly interpolate the water depth. Generalization to different catchment Finally, we want to evaluate the models' capabilities of gener- alizing to a different catchment area. To this end, we take the same trained models from the last paragraph (i.e. trained on catchment area 709 with both short and long events) and test them on a long event for catch- ment area 744. The event chosen has the same rainfall pattern as the long event real1 c1 from catchment 10 0-10 cm10-20 cm20-50cm50-100cm>100cm0.000.250.500.751.001.251.501.75FCNAutoEncoderU-NetGraphNo changeLinear extrapolationAutoregressive 1x1Autoregressive 5x5 Figure 11: Box plots for all models trained and tested on catchment area 709 with both short and long events. The medians are denoted by a black dash. area 709. The results for this experiment are presented in Figure 12. Once again, the deep models do not show any benefits over the simpler ones. For the largest water depths, even linear extrapolation of the water depths is on par with the predictions from parameterized models. Figure 12: Box plots for all models trained on catchment area 709 with both short and long events and tested on one long event from catchment 744. The medians are denoted by a black dash. We have performed further tests on other long events, and experimented with training on long events only. Unfortunately, those additional experiments have also not yielded dramatically changed results. This leaves the more involved, deep models with improved results only on the short rainfall events but without any advantages on the experiments with long events for either catchment area. 5 Discussion In Figure 10, where only short events are used in the training set, the metric values are significantly below 1 indicating that the models are learning the distribution and generalizing to unseen data. We also observe that learned models are better than the baselines, especially for high water levels (> 0.5m). U-Net is overall the best model. While the graph network is the best for high water levels, it has bad performance for low water levels. Despite the fact that the reconstruction error is low, we are not satisfied with the proposed networks as they are not significantly better than the baselines. This probably indicates that the networks only capture the easiest correlations in the dataset. In Figure 11 and Figure 12, we evaluate the model on two different test sets with distribution shifts. In Figure 11, we observe that for long rainfall events the performance drops significantly (the metric is above 11 0-10 cm10-20 cm20-50cm50-100cm>100cm012345FCNAutoEncoderU-NetGraphNo changeLinear extrapolationAutoregressive 1x1Autoregressive 5x50-10 cm10-20 cm20-50cm50-100cm>100cm012345FCNAutoEncoderU-NetGraphNo changeLinear extrapolationAutoregressive 1x1Autoregressive 5x5 1), meaning that the model does not generalize. Similarly, in the case of a different catchment (Figure 12), the model is also not able to generalize. Our interpretation is that long rainfall events likely include more complex dynamics that the networks were not able to learn. This hypothesis is supported by the fact that the performance of non-learnable baselines has also dropped significantly compared to the short rainfall event test set. One final observation is that on these more challenging test sets, the networks are not improving over the baselines. 6 Conclusion As discussed in the previous Section 5, our current model provides unsatisfying results for two reasons. First the overall performance improvement of the proposed models compared to the baselines is insufficient to justify their additional complexity. Second, the proposed models are not able to generalize to events outside of the training distribution, making them unsuitable for a real use case. One possible problem with the current setup might be the lack of diversity in the training rainfall events. While the models do not overfit the data per se (i.e. the loss does not drop below a constant significantly above 0), it is likely that the models overfit some characteristics of the training distribution, preventing them from generalizing to different rainfall events. Unfortunately, generating a training set with a high rainfall diversity would be very computationally expensive. Another potential weakness of our setup lies in the fact that the proposed model are more appropriate to exploit space correlations instead of time correlations. This choice might not be suitable for modeling water flows, which are affected by complex time dynamics. Therefore, the problem could benefit from architectures more designed for time series, such as recurrent networks [23], dilated convolutions [15], or transformers [48]. Possibly, the physics of flood simulation might be too challenging to learn from scratch and a different approach might be preferable. They are multiple "physically inspired" contributions [17, 3, 44, 10] leveraging using the structure of a simulator with some parts being replaced with a neural network. Typically, this would allow to work with large time step (in comparison with the original simulator) and significantly accelerate the simulation process. In the interest of reproducibility, we make our code and datasets available at and . 12 References [1] Y. Adikari and J. Yoshitani. Global trends in water-related disasters: An insight for policymakers, 2009. Last accessed: 18 Oct. 2022. [2] P. D. Bates, M. S. Horritt, and T. J. Fewtrell. A simple inertial formulation of the shallow water equations for efficient two-dimensional flood inundation modelling. Journal of Hydrology, 387(1-2):33– 45, 2010. [3] T. Beucler, M. Pritchard, S. Rasp, J. Ott, P. Baldi, and P. Gentine. Enforcing analytic constraints in neural networks emulating physical systems. Physical Review Letters, 126(9):098302, 2021. [4] D. K. Borah. Hydrologic procedures of storm event watershed models: a comprehensive review and comparison. Hydrological Processes, 25(22):3472–3489, 2011. [5] K. Bradbrook, S. Lane, S. Waller, and P. Bates. Two dimensional diffusion wave modelling of flood inundation using a simplified channel representation. International Journal of River Basin Management, 2(3):211–223, 2004. [6] L. Cea, M. Garrido, and J. Puertas. Experimental validation of two-dimensional depth-averaged models for forecasting rainfall-runoff from precipitation data in urban areas. Journal of Hydrology, 382(1):88– 102, March 2010. [7] F.-J. Chang, P.-A. Chen, Y.-R. Lu, E. Huang, and K.-Y. Chang. Real-time multi-step-ahead water level forecasting by recurrent neural networks for urban flood control. Journal of Hydrology, 517:836–846, 2014. [8] L.-C. Chang, F.-J. Chang, and Y.-M. Chiang. A two-step-ahead recurrent neural network for stream-flow forecasting. Hydrological Processes, 18(1):81–92, 2004. [9] A. S. Chen, S. Djordjevic, J. Leandro, and D. Savic. The urban inundation model with bidirectional flow interaction between 2d overland surface and 1d sewer networks. In Novatech 2007-6`eme Conf ́erence sur les techniques et strat ́egies durables pour la gestion des eaux urbaines par temps de pluie/Sixth Inter- national Conference on Sustainable Techniques and Strategies in Urban Water Management. GRAIE, Lyon, France, 2007. [10] C. Cheng and G.-T. Zhang. Deep learning method based on physics informed neural network with resnet block for solving fluid flow problems. Water, 13(4):423, 2021. [11] B. Choubin, E. Moradi, M. Golshan, J. Adamowski, F. Sajedi-Hosseini, and A. Mosavi. An ensemble prediction of flood susceptibility using multivariate discriminant analysis, classification and regression trees, and support vector machines. Science of the Total Environment, 651:2087–2096, 2019. [12] P. Costabile, C. Costanzo, and F. Macchione. Comparative analysis of overland flow models using finite volume schemes. Journal of Hydroinformatics, 14(1):122–135, 04 2011. [13] P. Costabile, C. Costanzo, and F. Macchione. A storm event watershed model for surface runoff based on 2d fully dynamic wave equations. Hydrological Processes, 27(4):554–569, 2013. [14] P. Costabile and F. Macchione. Enhancing river model set-up for 2-d dynamic flood modelling. Envi- ronmental Modelling & Software, 67:89–107, 2015. [15] P. Dutilleux. An implementation of the "algorithme `a trous" to compute the wavelet transform. In Wavelets, pages 298–304. Springer, 1990. [16] J. Fern ́andez-Pato, D. Caviedes-Voulli`eme, and P. Garc ́ıa-Navarro. Rainfall/runoff simulation with 2d full shallow water equations: Sensitivity analysis and calibration of infiltration parameters. Journal of Hydrology, 536:496–513, 2016. 13 [17] J. M. Frame, F. Kratzert, D. Klotz, M. Gauch, G. Shelev, O. Gilon, L. M. Qualls, H. V. Gupta, and G. S. Nearing. Deep learning rainfall–runoff predictions of extreme events. Hydrology and Earth System Sciences, 26(13):3377–3392, 2022. [18] V. Gude, S. Corns, and S. Long. Flood prediction and uncertainty estimation using deep learning. Water, 12(3), 2020. [19] M. Guidolin, A. S. Chen, B. Ghimire, E. C. Keedwell, S. Djordjevi ́c, and D. A. Savi ́c. A weighted cellular automata 2d inundation model for rapid flood analysis. Environmental Modelling & Software, 84:378–394, 2016. [20] M. Guidolin, A. S. Chen, B. Ghimire, E. C. Keedwell, S. Djordjevi ́c, and D. A. Savi ́c. A weighted cellular automata 2d inundation model for rapid flood analysis. Environmental Modelling & Software, 84:378–394, 2016. [21] Z. Guo, J. P. Leit ̃ao, N. E. Sim ̃oes, and V. Moosavi. Data-driven flood emulation: Speeding up ur- ban flood predictions by deep convolutional neural networks. Journal of Flood Risk Management, 14(1):e12684, 2021. [22] Z. Guo, J. P. Leit ̃ao, N. E. Sim ̃oes, and V. Moosavi. Data-driven flood emulation: Speeding up ur- ban flood predictions by deep convolutional neural networks. Journal of Flood Risk Management, 14(1):e12684, 2021. [23] M. Hermans and B. Schrauwen. Training and analysing deep recurrent neural networks. Advances in neural information processing systems, 26, 2013. [24] N. M. Hunter, P. D. Bates, S. Neelz, G. Pender, I. Villanueva, N. G. Wright, D. Liang, R. A. Falconer, B. Lin, S. Waller, A. J. Crossley, and D. C. Mason. Benchmarking 2d hydraulic models for urban flooding. Proceedings of the Institution of Civil Engineers - Water Management, 161(1):13–30, 2008. [25] B. Jamali, P. M. Bach, L. Cunningham, and A. Deletic. A cellular automata fast flood evaluation (ca-ff ́e) model. Water Resources Research, 55(6):4936–4953, 2019. [26] S. Janizadeh, M. Avand, A. Jaafari, T. V. Phong, M. Bayat, E. Ahmadisharaf, I. Prakash, B. T. Pham, and S. Lee. Prediction success of machine learning methods for flash flood susceptibility mapping in the tafresh watershed, iran. Sustainability, 11(19):5426, 2019. [27] K. Khosravi, B. T. Pham, K. Chapi, A. Shirzadi, H. Shahabi, I. Revhaug, I. Prakash, and D. T. Bui. A comparative assessment of decision trees algorithms for flash flood susceptibility modeling at haraz watershed, northern iran. Science of the Total Environment, 627:744–755, 2018. [28] B. Kim, B. F. Sanders, J. S. Famiglietti, and V. Guinot. Urban flood modeling with porous shallow-water equations: A case study of model errors in the presence of anisotropic porosity. Journal of Hydrology, 523:680–692, 2015. [29] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [30] F. Kratzert, D. Klotz, G. Shalev, G. Klambauer, S. Hochreiter, and G. Nearing. Towards learning uni- versal, regional, and local hydrological behaviors via machine learning applied to large-sample datasets. Hydrology and Earth System Sciences, 23(12):5089–5110, 2019. [31] J. P. Leit ̃ao and S. Pe ̃na-Haro. Leveraging video data to assess urban pluvial flood hazard, 2022. Last accessed: 02 Feb. 2022. [32] J. Lhomme, P. Sayers, B. Gouldby, P. Samuels, M. Wills, and J. Mulet-Marti. Recent development and application of a rapid flood spreading method. Flood Risk Management: Research and Practice. Taylor & Francis Group, London, UK, 2008. 14 [33] R. L ̈owe, J. B ̈ohm, D. G. Jensen, J. Leandro, and S. H. Rasmussen. U-flood – topographic deep learning for predicting urban pluvial flood water depth. Journal of Hydrology, 603:126898, 2021. [34] A. K. Misra. Climate change and challenges of water and food security. International Journal of Sustainable Built Environment, 3(1):153–165, 2014. [35] A. Mosavi and M. Edalatifar. A hybrid neuro-fuzzy algorithm for prediction of reference evapotranspi- ration. In International conference on global research and education, pages 235–243. Springer, 2018. [36] A. Mosavi, P. Ozturk, and K.-w. Chau. Flood prediction using machine learning models: Literature review. Water, 10(11), 2018. [37] A. Mosavi, P. Ozturk, and K.-w. Chau. Flood prediction using machine learning models: Literature review. Water, 10(11):1536, 2018. [38] S. Neelz and G. Pender. Benchmarking of 2d hydraulic modelling packages. SC080035/SR2 Environment Agency, 01 2010. [39] V. Nourani, A. H. Baghanam, J. Adamowski, and O. Kisi. Applications of hybrid wavelet–artificial intelligence models in hydrology: a review. Journal of Hydrology, 514:358–377, 2014. [40] M. Panahi, A. Jaafari, A. Shirzadi, H. Shahabi, O. Rahmati, E. Omidvar, S. Lee, and D. T. Bui. Deep learning neural networks for spatially explicit prediction of flash flood probability. Geoscience Frontiers, 12(3):101076, 2021. [41] E. J. Plate. Flood risk and flood management. Journal of Hydrology, 267(1):2–11, 2002. Advances in Flood Research. [42] M. Rezaeian Zadeh, S. Amin, D. Khalili, and V. P. Singh. Daily outflow prediction by multi layer perceptron with logistic sigmoid and tangent sigmoid activation functions. Water resources management, 24(11):2673–2688, 2010. [43] O. Ronneberger, P. Fischer, and T. Brox. U-net: Convolutional networks for biomedical image segmen- tation. In International Conference on Medical image computing and computer-assisted intervention, pages 234–241. Springer, 2015. [44] Y. Ruckstuhl, T. Janji ́c, and S. Rasp. Training a convolutional neural network to conserve mass in data assimilation. Nonlinear Processes in Geophysics, 28(1):111–119, 2021. [45] C. M. Song. Data construction methodology for convolution neural network based daily runoff prediction and assessment of its applicability. Journal of Hydrology, 605:127324, 2022. [46] M. S. Tehrany, B. Pradhan, S. Mansor, and N. Ahmad. Flood susceptibility assessment using gis-based support vector machine model with different kernel types. Catena, 125:91–101, 2015. [47] D. Van Dao, A. Jaafari, M. Bayat, D. Mafi-Gholami, C. Qi, H. Moayedi, T. Van Phong, H.-B. Ly, T.-T. Le, P. T. Trinh, et al. A spatially explicit deep learning neural network model for the prediction of landslide susceptibility. Catena, 188:104451, 2020. [48] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, (cid:32)L. Kaiser, and I. Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. [49] X. Xia, Q. Liang, X. Ming, and J. Hou. An efficient and stable hydrodynamic model with novel source term discretization schemes for overland flow and flood simulations. Water Resources Research, 53(5):3730–3759, 2017. 15
http://arxiv.org/abs/2302.10058v1
2023-02-20T16:05:04
2023-02-20T16:05:04
Differentiable Arbitrating in Zero-sum Markov Games
We initiate the study of how to perturb the reward in a zero-sum Markov game with two players to induce a desirable Nash equilibrium, namely arbitrating. Such a problem admits a bi-level optimization formulation. The lower level requires solving the Nash equilibrium under a given reward function, which makes the overall problem challenging to optimize in an end-to-end way. We propose a backpropagation scheme that differentiates through the Nash equilibrium, which provides the gradient feedback for the upper level. In particular, our method only requires a black-box solver for the (regularized) Nash equilibrium (NE). We develop the convergence analysis for the proposed framework with proper black-box NE solvers and demonstrate the empirical successes in two multi-agent reinforcement learning (MARL) environments.
[ "Jing Wang", "Meichen Song", "Feng Gao", "Boyi Liu", "Zhaoran Wang", "Yi Wu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10058v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10058v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.MA", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.MA", "cs.AI", "cs.LG" ]
3 2 0 2 b e F 0 2 ] A M . s c [ 1 v 8 5 0 0 1 . 2 0 3 2 : v i X r a Differentiable Arbitrating in Zero-sum Markov Games Jing Wang∗,† New York University New York, United States [email protected] Meichen Song∗,† Stony Brook University New York, United States [email protected] Boyi Liu Northwestern University Illinois, United States [email protected] Zhaoran Wang Northwestern University Illinois, United States [email protected] Feng Gao‡ IIIS, Tsinghua University Beijing, China [email protected] Yi Wu IIIS, Tsinghua University; Shanghai Qi Zhi Institute [email protected] ABSTRACT We initiate the study of how to perturb the reward in a zero-sum Markov game with two players to induce a desirable Nash equi- librium, namely arbitrating. Such a problem admits a bi-level op- timization formulation. The lower level requires solving the Nash equilibrium under a given reward function, which makes the overall problem challenging to optimize in an end-to-end way. We propose a backpropagation scheme that differentiates through the Nash equi- librium, which provides the gradient feedback for the upper level. In particular, our method only requires a black-box solver for the (regularized) Nash equilibrium (NE). We develop the convergence analysis for the proposed framework with proper black-box NE solvers and demonstrate the empirical successes in two multi-agent reinforcement learning (MARL) environments. KEYWORDS Zero-sum game; Equilibrium refinement; Bi-level optimization ACM Reference Format: Jing Wang∗,†, Meichen Song∗,†, Feng Gao‡, Boyi Liu, Zhaoran Wang, and Yi Wu. 2023. Differentiable Arbitrating in Zero-sum Markov Games. In Proc. of the 22nd International Conference on Autonomous Agents and Multiagent Systems (AAMAS 2023), London, United Kingdom, May 29 – June 2, 2023, IFAAMAS, 29 pages. 1 INTRODUCTION Arbitrating the conflict between self-interest and collective inter- ests permeates the development of human societies [32]. We study Markov games [53] as abstractions of human societies. Nash equi- librium (NE) [8], where none of the players could benefit from unilaterally deviating its strategy, is an essential concept in Markov games. While players modeled by Markov games act rationally to maximize their own rewards, the lack of collective considera- tion may lead to an undesirable NE, which undermines the overall welfare from a system perspective [23]. Incentive design [73], which was originally developed for bandit settings, aims to arbitrate such a conflict by perturbing the rewards to refine NE so that the self-interested players reach a desirable one, *These authors contributed equally to this work †Work finished during the internship in Shanghai Qi Zhi Institute. ‡Feng Gao contributed the entire experiment part of this work. Proc. of the 22nd International Conference on Autonomous Agents and Multiagent Sys- tems (AAMAS 2023), A. Ricci, W. Yeoh, N. Agmon, B. An (eds.), May 29 – June 2, 2023, London, United Kingdom. © 2023 International Foundation for Autonomous Agents and Multiagent Systems (www.ifaamas.org). All rights reserved. e.g., the higher social welfare or the lager exploration rate. More specifically, the incentive design problem is naturally formulated as a bi-level structure [19, 58]. The upper-level designer aims to determine the optimal incentives and the lower-level players per- form under incentive-perturbed rewards. To this end, it needs to anticipate how the lower-level players react to the prescribed incen- tives when they play a Markov game. However, taking a derivative through the bi-level structure is difficult [27], especially when the lower level has multiple agents. In particular, the lower-level equi- librium appears to be a black box for the upper-level designer, which makes it challenging for the upper-level designer to assess how the prescribed incentives will influence the lower-level equilibrium. As a result, the upper-level designer lacks the gradient feedback for effectively updating its policy for prescribing the incentives [51]. Some attempts have been proposed to work around the difficulty of derivatives in solving bi-level optimization. One direction is to get rid of the bi-level problem structure by converting the problem into a multi-objective problem: i.e., the low-level players simultaneously optimize the game reward and the designer's objective by exploring multiple NEs [15, 22, 38, 49, 71, 81]. The simplified problem can be directly solved by an NE solver. However, there is no theoretical guarantee for finding the optimal NE subject to the designer's objective [21]. The other direction is to keep the bi-level problem structure and avoid the derivative issue by applying a gradient-free optimizer to the upper level [64]. However, this suffers from a high computation cost since a zeroth-order method typically requires a large number of queries to the lower-level solver to derive the desired NE. Therefore, a first-order method that can be applied to complicated environments under the bi-level structure with a convergence guarantee is urgently needed to overcome the sample efficiency issue. We extend the incentive design problem to the MARL settings and construct a provably differentiable arbitrating (DA) framework. We derive the derivatives through the NE for the DA framework, which enables the upper level to utilize the policy gradient feed- back from the lower level to obtain the gradient of the designer's objective. Theoretical convergence proof for DA is presented in the setting of the two-player zero-sum game by choosing proper NE solvers which have convergence guarantee, e.g. Policy Extra- gradient Method (PEM) [14] and Entropy-regularized OMWU [13]. In practice, we implement the DA framework using a multi-agent variant of the soft actor-critic algorithm (MASAC) [30], leading to a practical algorithm, DASAC. We evaluate our algorithm in two two-player zero-sum MARL environments. Empirical results show that the incentive proposed by the designer arbitrates the conflict well: i.e., the upper-level designer's loss function reduces while lower-level self-interested players still attain an NE. The emergent arbitrated behaviors are consistent with human intuitions in each setting. Besides, the sample efficiency for the upper level is signifi- cantly improved compared with a zeroth-order method. Contributions. i) We consider the problem of incentive design in MARL settings and tackle the challenge of deriving the gradi- ent of the upper-level objective through the bi-level structure. ii) We develop the first differentiable first-order framework, Differen- tiable Arbitrating (DA), which can arbitrate the conflict to obtain a desirable NE in Markov games. iii) We theoretically prove the convergence of DA with proper NE solvers for two-player zero-sum Markov games. iv) We empirically show that a desirable NE with interpretable behaviors can be found by DA more efficiently than zeroth-order methods in two MARL environments. 2 RELATED WORKS Nash equilibrium for Markov Games. There is a large amount of work on finding the Nash equilibrium in multi-agent Markov games. Claus and Boutilier propose fictitious play [18] (FS), i.e., all players presuming that the opponents are stationary, for equilib- rium selection with guaranteed convergence to a Nash equilibrium. FS was originally developed for normal form games and therefore was not widely applied to complex applications [34, 45, 61] until the fictitious self-play (FSP) [33] was proposed. [35] extends SP from extensive-form games to imperfect-information games. [55] proposes the smooth FSP algorithm, which expands the PPO al- gorithm [74] from the single-agent to the multi-agent zero-sum Markov game and provides with convergence guarantee. In the multi-agent reinforcement learning setting, MADDPG in [57] and MAAC in [39] adapt the actor-critic [43] and soft-actor-critic [30] algorithms from the single-agent to complex multi-agent setting and empirically show better performances fully than decentral- ized multi-agent RL on finding NEs. MADDPG and MAAC do not have theoretical convergence guarantee even though they achieve empirical successes. On the other hand, many works have devel- oped convergence guarantee for value-based methods [13, 14, 16] and policy-based methods [3, 94] for two-player zero-sum Markov games. Cen [13, 14] introduce the entropy regularization term into the two-player zero-sum Markov game and propose the Policy Ex- tragradient Methods and Entropy-regularized OMWU Methods, which have convergence guarantee without the NE uniqueness assumption on the two-player zero-sum Markov game. Equilibrium Selection/Refinement. Since even team Markov Games (where the players have common interests) could have mul- tiple NEs, there exists a large volume of work in game theory on NE selection [66, 75], e.g. admissibility [7], subgame perfection [75], Pareto efficiency [10] or stability against opponent's deviation from best response [24]. [73] raises emphasis on adaptive incentive design, which modifies intrinsic rewards via additional incentive to balance the individuals' self-interests and system's social welfare for desir- able NE selection. The incentive design was first proposed in eco- nomics [70] and attracts substantial attentions with many follow-up works [11, 44, 88]. During the past decades, people explored the economic incentive to various domains, including energy [12, 65], transportation [42, 62], healthcare [5, 59], and education [60]. More recently, incentive design has also been extended to the area of game theory and reinforcement learning. [54] utilize the incentive design in the multi-bandit problem and prove that the proposed algorithm converges to the global optimum at a sub-linear rate for a broad class of games. [64] provide an incentive-design mechanism for an uncooperative multi-agent system and optimize the upper-level incentive objective with Bayesian optimization, a sample-efficient optimization algorithm, instead of the gradient-based methods be- cause the lower-level MARL problem is a black box. [90] propose a decentralized incentive mechanism that allows each individual to directly give rewards to others and learn its own incentive function, respectively. Also, [78] proposes a bi-level incentive mechanism for a single lower-level player, which can be viewed as a special case of our setting. Stackelberg game [48, 52] is a strategic game in economics in which the leader moves first and the followers behave sequentially. The incentive design could be reformulated as the Stackelberg game by treating the incentive design objective as the leading player. [86] proposed a gradient-decent algorithm to find NE for the Stackelberg bandit problem. [95] propose a value iteration method for solving the Stackelberg Markov game with convergence guarantee. [85] features differentiation through policy gradient on Sequential Decision Problems without global conver- gence guarantee. Bi-level optimization. In machine learning, a large amount of tasks can be formulated as bi-level optimization problems, e.g. ad- versarial learning [40], meta-learning [26], hyperparameter opti- mization [9], and end-to-end learning [4]. Many gradient-based algorithms are used for solving these problems. Most of them are first-order gradient-based methods [9, 26, 28, 67] thanks to both computational efficiency of first-order gradients and fast empirical convergence. By contrast, zeroth-order methods [79, 87] suffer from a heavy workload of data sampling, which requires tremendous computing resources. [69] develop a second-order method. How- ever, the proposed algorithm requires computation of the inverse of Hessian, which restricts the algorithm to simple tabular settings. The most challenging part for gradient-based methods to solve the bi-level optimization problem is to derive the derivative of lower- level solution with respect to the incentive variables in the higher level. Feng [25] and Yang [91] expand the lower-level optimization process as a sequence of gradient updates and directly compute gradients throughout the entire optimization process. Despite of the simplicity, such a method suffers from tremendous computation troubles due to memory explosion and numerical issues. Therefore, approximation techniques such as truncated gradient with a sliding window would be necessary. By contrast, our DA framework gives an accurate first-order formula for exact gradient computation for the lower-level optima. Wang [85] constructed a bi-level problem to infer the missing parameters in MDP by learning a predictive model. This paper is under the single-agent setting where the objective in the lower-level is to minimize a clear performance measure while our setting is more complex by requiring the computation of NE. 3 PROBLEM FORMULATION This section organizes as follows. Section 3.1 begins with a typical definition for two-player zero-sum Markov games G. To illustrate how the designer induces the behaviors of players, Section 3.2 intro- duces the incentive parameter θ into the reward of the two-player zero-sum Markov game and formulate the incentivized Markov game Gθ . Section 3.3 designs an entropy-regularized Markov game G′ by adding entropy regularization terms into the reward of Gθ θ and demonstrates G′ owns the unique NE. Section 3.4 formulates θ the arbitrating system as a bi-level optimization scheme based on the regularized Markov game with the incentive-perturbed reward. 3.1 Two-player Zero-sum Markov Game Consider a two-player zero-sum Markov game G = (S, {Ai }i ∈ {1,2}, P, {ri }i ∈ {1,2}, γ), where S is the state space observed by all players, Ai is the action space of player i and A := A1 × A2 is the joint action space of two players, then P : S × A × S → [0, 1] denotes the transition probability from state s ∈ S to state s ′ ∈ S for taking joint action a ∈ A. ri : S × A → [−1, 1] is the immediate reward function of player i, which implies r 1 = −r 2 in zero-sum game. γ ∈ [0, 1) is the discounted factor. ]We remark that we consider the two-player zero-sum setting for notation simplicity. Extensions to more general settings will be discussed in Appendix C. 3.2 Markov Game with the Incentive-perturbed Reward Let Gθ = (S, {Ai }i ∈ {1,2}, P, {ri (*; θ )}i ∈ {1,2}, γ) be a two-player zero-sum Markov game with an incentive-perturbed reward func- tion ri (*; θ ) explicitly parameterized by θ , where θ ∈ Rm repre- sents the incentives added by the designer. We assume that ri (*; θ ) : S × A → [−1, 1] is uniformly bound in θ and remains zero-sum. For a given trajectory τ = (s0, {ai T −1}i ∈ {1,2}, sT ), we denote the total discounted reward for player i ∈ {1, 2} as T −1 ∑︁ 0}i ∈ {1,2}, s1, ..., {ai Ri (τ; θ ) = γtri (st , at ; θ ). t =0 Define πi: S×Ai→[0, 1] as the probability distribution of policy of player i and π=(π 1, π 2) as that of the joint policy. Let Dπ (τ) denote the probability distribution of the trajectory τ based on the policy pair π. That is, Dπ (τ) := ρ0 (s0) T −1 (cid:214) t =0 P (st +1|st , at ) πi (ai t |st ) (cid:33) , (cid:32) 2 (cid:214) i=1 where ρ0 (s0) is the distribution for the initial state. We denote Eπ [ * ] as the expectation over the trajectory τ ∼ Dπ (τ). Then the performance of the policy pair π for the game Gθ is evaluated by the state-value function V i π : S → R, which is defined as (cid:34)T −1 ∑︁ (cid:35) γt *ri (st , ai t , a−i t ; θ )|s0 = s V i π (s; θ ) = Eπ t =0 = Eτ∼Dπ (cid:2)Ri (τ; θ )(cid:12) (cid:12)s0 = s(cid:3) . (3.1) ′ 3.3 Entropy-regularized Markov Game To ensure the NE to be unique, we follow [14, 20, 93] and introduce θ = (S, {Ai }i ∈ {1,2}, P, {r (i) the entropy-regularized counterpart G (*; θ )}i ∈ {1,2}, γ, λ), where λ ≥ 0 is the regularization parameter. The entropy regularization technique is commonly utilized in rein- forcement learning to encourage exploration to avoid being trapped at sub-optimal solutions [2, 29, 46] and keep the policies of differ- ent agents away from being heavily affected by the opponents' strategy [56, 89]. Specifically, the reward function for player i is replaced by its π (*; θ ) : S ×Ai ×A−i → R, entropy-regularized reward function r (i) which is defined as, r (i) π (s, ai, a−i ; θ ) =ri (s, ai, a−i ; θ ) − λ log(πi (ai |s)) + λ log(π −i (a−i |s)). (3.3) Here we clarify what the entropy we use with a light abuse of notation. The state-reward function and the entropy-regularized state-reward function associated with policy pair π are defined as ri π (s; θ ) = E(ai,a−i )∼π r (i) π (s; θ ) = E(ai,a−i )∼π =ri (cid:2)ri (s, ai, a−i ; θ )(cid:3) , (cid:105) (cid:104) r (i) π (s, ai, a−i ; θ ) π (s; θ ) +λH (πi (*|s)) − λH (π −i (*|s)), (3.4) where H (πi (*|s))= −(cid:205)ai ∈Ai πi (ai |s) log(πi (ai |s)) is the Shannon entropy. Correspondingly, the total discounted reward R (i) π for a given trajectory τ of the player i in game G′ and the entropy- θ regularized state-value function with incentive parameter V (i) π S → R are defined as : R (i) π (τ; θ ) = T −1 ∑︁ t =0 γtr (i) π (st , ai t , a−i t ; θ ), V (i) π (s; θ ) = Eπ (cid:34)T −1 ∑︁ γt *r (i) π (st , ai t , a−i t (cid:35) ; θ )|s0 = s t =0 (cid:104) = Eτ∼Dπ (cid:105) . (cid:12)s0 = s R (i) π (τ; θ )(cid:12) Suppose the NE of the regularized Markov game with incentive- perturbed reward G′ ∗ (θ )). We write Player -i θ as Player i's opponent then the joint policy could also be rewritten as the policy pair π = (πi, π −i ), where i ∈ {1, 2}. Then the NE can be defined as follows, for ∀i ∈ {1, 2}, the NE π ∗ satisfies is π∗ (θ ) = (π 1 ∗ (θ ), π 2 (3.5) V (i) π∗ (θ ) (s; θ ) = max πi V (i) (πi,π -i ∗ (θ )) (s; θ ), ∀s ∈ S. (3.6) The NE for the regularized Markov game G′ θ solution of the following min-max optimization problem V (1) π (s; θ ), ∀s ∈ S. min π 2 max π 1 is equivalent to the (3.7) The Nash equilibrium (NE) is an essential concept where no agent could benefit by individually changing its policy. The NE for the incentivized two-player zero-sum Markov game Gθ is the solution for the following min-max game: min π 2 max π 1 V 1 π (s; θ ), s ∈ S. (3.2) Shapley [76] proves that there exists a NE pair for the min-max game 3.2 for all state s ∈ S and the min-max value is unique [84]. As is known from [13, 14, 63], there exists a unique policy pair π for the min-max optimization problem (3.7). Therefore the entropy- regularized Markov game has the unique NE. Moreover, [14] proves that an ε/2-optimal NE for the regularized Markov game G′ is an θ ε-optimal NE for the original when the regularization parameter , which indicates the difference between λ ≤ NE for the regularized Markov game and NE for the original can be controlled by the regularization parameter. The definition for (1−γ )ε 2(log( | A1 |)+log( | A2 |)) ε-optimal NE is clearly defined in [14], which means the optimal gap of the policy is smaller than ε. 3.4 Bi-level Optimization Scheme Our final goal is to arbitrate conflicts between self-interested players and the collective-interested designer by navigating all individuals to the desirable refined NE with higher system welfare. Section 3.2 introduces the incentive parameter θ to modify the intrinsic reward ri (*; θ ) of Markov games, which is utilized as a tool to design the system objective and refine NE for arbitration. In this section, we formulate a bi-level optimization scheme with equilibrium con- straints induced by such an arbitrating system. Among the bi-level optimization scheme, for the lower-level players, we aim at finding the NE for the given incentivized Markov game G′ . Regarding the θ upper-level designer, we define a system arbitrating objective tar- geting the optimal θ that could channel all individuals towards a desirable NE. φ 1, π 2 φi (w.r.t πi For the purpose of gradient computation in Section 4 and exper- φi with φi ∈ Rdi for iments in Section 7, we parameterize policy πi the player i (i ∈ {1, 2}) and denote the policy pair as πφ = (π 1 φ 2 ), where φ = (φ 1, φ 2) ∈ Rd, d = d1 + d2. To avoid the abuse of subscrip- tion, we omit i of φi in πi ). The simplification will not cause confusion because the policy πi of a single player i is only determined by φi . Then the joint policy could also be rewritten as the policy pair πφ = (πi φ ), where i ∈ {1, 2}. The NE of the φ ′ is de- regularized Markov game with incentive-perturbed reward G θ ∗ (θ ), φ 2 noted as πφ∗ (θ ) = (π 1 ∗ (θ )) is the parameter of NE under incentive θ . The definition of NE for regularized Markov game in (3.6) can be rewritten as, ), where φ∗ (θ ) = (φ 1 , π −i φ∗ (θ ) φ∗ (θ ) , π 2 φ (s; θ ), ∀s ∈ S. V (i) πφ∗ (θ ) (s; θ ) = max φi ∈Rdi V (i) (πi φ φ∗ (θ ) ) ,π -i Arbitrating system. Suppose the arbitrating objective for game system G′ is only determined by the incentive parameter θ and θ the joint policy πφ , written as mapping f (θ, φ) : Θ × Rd → R. The system aims to minimize the arbitrating objective loss at the NE of Gθ , f (θ, φ∗ (θ )) . Therefore, the arbitrating system could be formulated as a bi-level optimization problem: f∗ (θ ) = f (θ, φ∗ (θ )) min θ ∈Θ s.t . Eν ∗ (cid:104) V (i) πφ∗ (θ ) (cid:105) (s; θ ) = max φi ∈Rdi Eν ∗ (cid:20) V (i) (πi φ ,π -i (cid:21) (s; θ ) , ∀i ∈ {1, 2} (3.8) φ∗ (θ ) ) Remark: Eq. 3.8 is our major objective. We primarily focus on efficiently learning the upper-level incentive parameter while treating the lower level as a black-box NE solver. In the following sections, we focus on deriving the first-order gradient of the upper- level loss function f∗ (θ ), then establish our Differentiable Arbitrating (DA) framework based on it. 4 METHOD The bi-level arbitrating system (Eq. 3.8) with NE constraints guides players indirectly via the incentive parameter θ to safeguard the arbitrating objective f . For the lower level, we attempt to determine the policy parameter of NE under a certain incentivized environ- ment G′ , remarked as φ ∗ (θ ). For the upper-level designer, we aim θ to derive the first-order algorithm to find the optimal incentive parameter θ such that the objective f∗ (θ ) = f (θ, φ∗ (θ )) can be optimized while players attain their NE. In such a bi-level problem, it is challenging to obtain the gradient of f∗, especially when the solver for regularized NE in the lower level is a black box, since the incentive parameter θ affects objective f∗ implicitly via refining the regularized NE for players. Our goal is to derive the gradient of f∗ w.r.t θ with NE constrains and then develop a backpropagation scheme that utilize the feedback of policy gradients from the lower level to establish the gradient of the incentive objective function at a regularized NE, ∇θ f (θ, φ ∗ (θ )). To be more specific, the gradient ∇θ f (θ, φ ∗ (θ )) can be derived as, ∇θ f∗ = (cid:2)∇θ f (θ,φ) +∇θ φ ∗ (θ )⊺∇φ f (θ, φ)(cid:3)(cid:12) (cid:12)φ=φ ∗ (θ ). (4.1) where ∇θ f (θ,φ) and ∇φ f (θ, φ) are known while the NE gradient ∇θ φ∗ (θ ) need to be derived based on the policy gradient feedback from the lower level. The computing of the NE gradient ∇θ φ ∗ (θ ) is in detail discussed in Section 4.1 and then a general backpropagation framework that for the regularized NE is proposed in Section 4.2. 4.1 Gradient for the Incentive In this section, we will derive the gradient at NE ∇θ f (θ, φ ∗ (θ )), in which the key point is to derive NE gradient ∇θ φ ∗ (θ ). For notation simplification, we denote u (i) φ (s; θ ) w.r.t φi then we define θ (φ; s) as the gradient of V (i) uθ (φ) := Eν (∗) [uθ (φ; s)], uθ (φ; s) := (u (1) (φ; s), u (2) πφ (s; θ )). θ θ Then, the gradient of uθ (φ) w.r.t. to θ and φ are straightforward as follows, πφ (s; θ ), ∇φ 2V (2) (φ; s)) = (∇φ 1V (1) (4.2) ∇θuθ (φ) = ∇φuθ (φ) = Eν (∗)∇2 Eν (∗)∇2       Eν (∗) ∇2    Eν (∗) ∇2    θφ 1V (1) θφ 2V (2) φφ 1V (1) φφ 2V (2) πφ (s; θ ) πφ (s; θ )       πφ (s; θ )    πφ (s; θ )    ∈ Rd×m, (4.3) ∈ Rd×d . (4.4) θφiV (i) φφiV (i) The following Lemma 4.1 implies the computation of ∇2 πφ (s; θ ) and ∇2 πφ (s; θ ) can be explicitly derived based on the policy gra- dient, which are backpropagated from NE solver in the lower level. The computation details for the gradients and Hessians in Lemma 4.1 are presented throughout Lemma A.1 in appendix due to limi- tation of space. Then in light of (4.3-4.4) and Lemma 4.1, ∇θ φ ∗ (θ ) can be expressed in policy gradient as derived in the following Lemma 4.2, inducing the final expression of objective gradient at NE ∇θ f∗ (θ ). Lemma 4.1. In an incentive regularized Markov game G := π −i πi φi notation simplicity, then we have t |st ), π −i φ −i ′ θ , we denote |st ) and πφ := πφ (at |st ) for φ −i (a−i φi (ai := πi t ∇θV (i) πφ (s; θ ) = ∇θV i πφ (s; θ ); ∇2 θφiV (i) πφ (s; θ ) = ∇2 θφiV i πφ (s; θ ); + + + (cid:32)T −1 ∑︁ t =0 (cid:32)T −1 ∑︁ t =0 (cid:32)T −1 ∑︁ t =0 ∇φiV (i) πφ (s; θ ) = ∇φiV i πφ (s; θ ) −λEDπφ (cid:34)T −1 ∑︁ t =0 γt ∇φi log πi φi (cid:32)T −1 ∑︁ + γt (cid:16)logπi φi − logπ −i φ −i (cid:33) (cid:32)T −1 ∑︁ (cid:17) t =0 ∇φi log πi φi (cid:33)(cid:35) ; t =0 φφiV (i) ∇2 πφ (s; θ ) = ∇2 (cid:34) (cid:32)T −1 ∑︁ − λEDπφ t =0 γt (cid:16)log πi φφiV i πφ (s; θ ) ∇φi logπi φi (cid:33) (cid:32)T −1 ∑︁ γt (cid:16) ∇φ logπi φi − ∇φ logπ −i φ −i φi − log π −i φ −i ∇φi log πi φi ∇φ logπφ (cid:33)⊺ (cid:17) (cid:33)⊺ (cid:33) (cid:32)T −1 ∑︁ t =0 (cid:33)⊺ t =0 (cid:33) (cid:32)T −1 ∑︁ (cid:17) t =0 (cid:33) (cid:32)T −1 ∑︁ (cid:17) t =0 (cid:33)⊺ γt (cid:16)log πi φi − log π −i φ −i ∇2 φφi log πφ γt ∇φi logπi φi ∇φ log πφ + (cid:33) (cid:32)T −1 ∑︁ t =0 (cid:32)T −1 ∑︁ t =0 γt ∇2 φφi logπφ (cid:33)(cid:35) , where EDπφ [ * ] denotes the expectation over the trajectory τ ∼ Dπφ (τ) and ∇θV i πφ (s; θ ), ∇2 are computed from Lemma A.1 in appendix. πφ (s; θ ), ∇φiV i φ (s; θ ) and ∇2 φφiV i θφiV i φ (s; θ ) Lemma 4.1 utilizes the policy gradient information, which is easily accessible in a NE solver, to describe how self-interested players react to the adjustment in the incentive parameter. It is straightforward to prove but is essential to provide the lower-level information embedded in the policy gradient to guide the direction of updates for the incentive parameter against a high collective loss. In light of Lemma 4.1, Lemma 4.2 presents the gradient of NE w.r.t. the incentive parameter, which is crucial to leverage the back- propagated information from the lower level to update the incentive parameter. It describes how the equilibrium among players is af- fected by the incentive from the designer and shows that such information is related to the Hessian of V (i) πφ (s; θ ) at NE. Lemma 4.2. The following formula holds for the policy parameter ′ φ (∗) (θ ) of NE πφ ∗ (θ ) for incentive regularized Markov game G θ : (4.5) ∇θ φ (∗) (θ ) = − (cid:2)∇φuθ (φ)(cid:3) −1 ∇θuθ (φ)(cid:12) . (cid:12)φ=φ ∗ (θ ) Then substituting Eq. (4.5) into Eq. (4.1) leads to the final explicit expression of ∇θ f∗ (θ ): ∇θ f∗ (θ, φ ∗ (θ )) (cid:104) ∇θ f (θ,φ)−∇θuθ (φ)⊺ (cid:2)∇φuθ (φ)(cid:3) −1 = ∇φ f (θ, φ) (cid:105) (cid:12) (cid:12)φ=φ ∗ (θ ). (4.6) 4.2 Differentiable Arbitrating Based on the gradient computation in Section 4.1, we propose the Differentiable Arbitrating (DA) framework to solve the arbitrat- ing system (Eq. 3.8). DA differentiates the upper-level designer's objective function through NE and backpropagates the gradient information of policies from the lower level to derive the upper- level gradient. In this scheme, the black-box solver for the reg- ularized NE in the lower level could be any methods contain- ing gradient information of the policies, for example, SAC [30], MADDPG [57], MAAC [39], Policy Extragradient Method [14] and Entropy-regularized OMWU [13]. Framework 1 DA: Differentiable Arbitrating in MARL. Input: βk : learning rate for upper-level iteration Output: θ : incent. param.; φ: param. of policy πφ Initialize the incentive parameter θ = θ0. for k=0,1,... do Initialize param. φ = φ0 of policy πφ0 for t=0,1... do for game G′ θk . Update φ = φt with NE solver until corresponding policy converge to the Nash equilibrium of game G′ , w.r.t πφt θk φ ∗ (θk ). end for Update incentive parameter θ = θk+1 ← θk − βk ∇f∗ (θk ), where ∇f∗ (θk ) is defined in (4.6). end for The workflow of DA is shown in Framework 1. In this work, we specifically develop the convergence guarantee for the DA frame- work with lower-level NE solvers which have convergence guaran- tee and implement our DA framework using a multi-agent variant of SAC, which will be described in detail later in Section 6. DA framework is a first-order method. This is because the update of upper-level incentive θ only relies on the first-order gradient ∇f∗ (θ ) without any hessian information of θ . The second- order gradients defined in Lemma 4.1 are hessian matrices of lower- level value function V and are used for the computation of first- order gradient ∇f∗ (θ ). Extension to general settings. Although DA framework is de- scribed under two-player zero-sum fully observable Markov games, it could be extended to more general settings: N-players, general- sum and partially observable Markov decision process (POMDP). For N-player general-sum Markov games, the game Gθ is required to be monotone to ensure the entropy-regularized game G′ to be θ strongly-monotone and therefore has unique NE. Then the DA framework could leverage a proper lower-level black-box NE solver for the (regularized) NE. For POMDPs, some minor adjustments are required, replacing the state-based policy πi (ai |s) with the observation-based policy πi (ai |oi ), where oi =Oi (s) is the obser- vation of the player i in state s. Such adjustments will not change the gradient computation, which is essential for the DA framework. The detailed discussions of problem formulation and the gradient derivation for the general settings are deferred to Appendix C. 5 CONVERGENCE ANALYSIS In this section, we develop the convergence analysis for the DA framework with proper lower-level NE solvers in the two-player zero-sum setting. Section 5.1 discuss lower-level NE solvers with convergence guarantee in literature that could be applied to our DA framework. Section 5.2 guarantees the convergence of incentive parameter θ in the upper level for the bi-level DA framework under convergent lower-level NE solvers. 5.1 Convergence of the Lower Level The convergence of the bi-level DA framework requires the lower- level NE solver for having the convergence guarantee to the NE π∗ of the entropy-regularized Markov game G′ . There are diverse NE θ solvers that have good empirical performance in practical games [30, 39, 57]. Some proposed NE solvers have the theoretical conver- gence proofs [37, 77, 80]. For the illustration of the DA framework convergence, we take two NE solvers proposed under entropy- regularization that are directly related with our setting. It is known that the Policy Extragradient Method (PEM) [14] and Entropy- regularized OMWU [13] all have the convergence guarantee under our setting. This section restates the main convergence results for PEM and Entropy-regularized OMWU for the purpose of complete- ness of convergence guarantee for DA framework. Proposition 5.1 (Theorem 3 in [14]). Assume |S1| ≥ |S2| and λ ≤ 1. Setting learning rate ηt = η = 2(1+λ (log |S1 |+1−γ )) , the Policy Extragradint Method (Algorithm 4 in supplementary) takes no more iterations to achieve the policy pair π = than (cid:101)O (π1, π2) that satisfies: Es∼ρ λ (1−γ ) 2 log2 (cid:16) 1 (s; θ ) ≤ ε, 1−γ (cid:17)(cid:17) (cid:104)(cid:16) (cid:17)(cid:105) (cid:16) 1 ε V (1) π ′ 1,π2 (s; θ ) − V (1) π1,π ′ 2 max π ′ 1,π ′ 2 where ρ is an arbitrary distribution over the state space S. Proposition 5.2 (Theorem 1 in [13]). Setting 0 < η ≤ (1−γ ) 3 32000|S | and αt = ηλ, the Entropy-regularized OMWU (Algorithm 5 in supple- mentary) takes no more than (cid:101)O iterations to achieve achieve the policy pair π = (π1, π2) that satisfies: (cid:16) (cid:17) V (1) π ′ 1,π2 (s; θ ) − V (1) π1,π ′ 2 1 (1−γ )ηλ log 1 ε (s; θ ) ≤ ε. max s ∈S,π ′ (cid:17) (cid:16) 1,π ′ 2 Proposition 5.1 and Proposition 5.2 demonstrate that the PEM and Entropy-regularized OMWU algorithms converges to the NE for the lower-level incentivized entropy-regularized Markov games G′ θ in linear rate. 5.2 Convergence of the Upper Level Assume that θ ∗ = arg minθ f∗ (θ ) represents the optimal point of incentive parameter θ in the arbitrating system (3.8). In this section, we are going to show that the framework 1 guarantees that the incentive parameter θ converges to θ ∗ under certain assumptions. Assumption 5.3. We assume that ∇θ f∗ (θ ) is L-Lipschitz continu- ous (L-smooth) w.r.t θ ∈ Θ, which means (cid:13)∇θ f∗ (θ ) − ∇θ f∗ (θ ′)(cid:13) (cid:13) (cid:13) ≤ L (cid:13) We also assume that f∗ (θ ) is bounded w.r.t θ ∈ Θ, which means there exists M > 0 such that (cid:13) , ∀θ, θ ′ ∈ Θ (cid:13)θ − θ ′(cid:13) |f∗ (θ )| ≤ M, ∀θ ∈ Θ L-smooth assumption is a common assumption in convergence proofs for different algorithms [1, 41, 50, 72, 92]. We also illustrate a concrete example to justify Assumption 5.3 is rational in practical setting in Appendix E. Assumption 5.3 does not require the compos- ite function f∗ (θ ) = f (θ, φ ∗ (θ )) to be convex and the convergence guarantee for the upper level even suitable for non-convex cases. Theorem 5.4. Suppose that Assumption 5.3 holds and the lower- level NE solver has convergence guarantee. In Framework 1, let the update rule θk+1 = θk − βk ∇θ f∗ (θk ) for incentive parameter θk run for T iterations with learning rates βk = 1 L , then we have min k=0,...,T ∥∇θ f∗ (θk )∥2 ≤ 2L(f∗ (θ0) − f∗ (θ ∗)) T + 1 ≤ 4LM T + 1 . Theorem 5.4 implies that there exist a subsequence in the se- quence of gradient norms {∥∇θ f∗ (θk )∥}∞ which converges to k=0 zero. Therefore, Theorem 5.4 guarantees that the incentive parame- ter θ could always converge to a sub-optimal point with sublinear convergence rate in the upper level. It is easy to know if the com- posite function f ∗ (θ ) is convex, it converges to the global optimal point. The detailed proof is shown in Appendix F. 6 IMPLEMENTATIONS The direct implementation of PEM and Entropy-regularized OMWU are not practical/efficient although they have the theoretical con- vergence guarantee. PEM is a double-loop algorithm that invokes solving the NE of an entropy-regularized Matrix game for each inner-loop. Although Entropy-regularized OMWU is a single-loop algorithm that adapts a two-timescale iteration, its update rules are for the tabular setting, in which the policy are per state updated. Therefore, we modify the vanilla algorithm of Entropy-regularized OMWU with some techniques inspired by the multi-agent soft- actor-critic (MASAC) and propose the DA-SAC algorithm (Algo. 6). We organize the modifications as the following: i) In stead of the per-state policy update in Entropy-regularized OMWU, we optimize a separate policy model via minimizing its KL divergence from the exponential energy function, i.e., we establish an actor-critic structure as widely accepted in SAC. ii) We use one-step gradient update with great practical suc- cess accepted by most of MARL practical algorithms, e.g. SAC [30], MADDPG [57] and MAAC [39], instead of the extragradient technique introduced in Entropy-regularized OMWU. iii) We follow SAC to set the energy function as a multiple of the Q function, where the scale factor is the reciprocal of the auto-tuned temperature coefficient [31]. Updated pseudo-code and all remaining details are included in Appendix G. 7 EXPERIMENTS We evaluate the performance of the DA framework in sense of sam- ple efficiency for the upper level in two zero-sum Markov games with two players and their incentivized variant, running with scis- sors (RWS) [83] which contains cyclic reinforcement learning chal- lenges [6, 47, 68] and a standard predator-prey, both of which are implemented on a grid-world environment [17]. 7.1 Evaluation Environments Running with scissors (RWS). In 5×5 grid-world RWS, resources (rock, scissors, or paper) are tailed in resources pools (Figure 2). Three of them are deterministic pools spaced with fixed resources and six others are nondeterministic filled with random resources. Two players randomly spawn among the free grids and fully observe the environment and resources owned by their opponent. Each (a) RWS (θ0) (b) RWS (θ ∗) (c) PP (θ0) (d) PP (θ ∗) Figure 1: Trace for incentivized RWS and incentivized PP with different incentive parameters θ0 and θ ∗ (left to right). θ0 is the initial incentive parameter and θ ∗ is the optimized parameter with DA framework. The NEs after arbitration (Figure (b) & (d)) ensure higher exploration rate in the grid-world games compared with the initial NEs (Figure (a) & (c)) without arbitration. Figure 2: Configuration of the Rock-with-Scissors (RWS). Two players are randomly spawned among the free grids and collect resources for confrontation. The bonus coins are the incentive added by the designer to encourage explo- ration. Figure 3: Configuration of the Predator-Prey (PP). The preda- tor aims to catch the prey and the prey aims to return to the nest. Both of them are randomly spawned in born region. The water pools are set as the incentive by the designer. chooses to move one grid in four directions at one step. When the player i steps on the grid with the resource, it collects the resource to its inventory vi , and the resource is removed from the grid. Four rocks, papers and scissors are randomly distributed to two players at the initial state and each player is assigned at least one for each resource. After 25 steps, the confrontation occurs and the payoffs for each player, r 0 and r 1, are calculated on the basis of the standard antisymmetric matrix M [36] as (cid:18) v 1 ∥v 1 ∥ = −r 1, where M = v 0 ∥v 0 ∥ r 0 = (cid:19) ⊺ M . −1 0 1 0 1 −1       1 −1 0       Besides, the rules of the game are assumed to be a blank to the players and they must explore to discover them. RWS is an extension of the classic matrix game rock-paper- scissors (RPS) with increasing complexity, and the game-theoretic structures of the RPS are satisfied in RWS. Since NE is to keep the same number of each resource in their inventory [82], players tend to stay around a grid after they achieve NE instead of continuing to explore, while the upper-level designer hopes more grids can be explored. Given such a conflict, the designer intervenes in the rewards by scattering gold coins as an incentive to channel players exploring more grids. There are four grids that generate coins. Two of them are filled with fixed bonuses 0.5, and others are filled with adjustable bonuses marked as the incentive parameter θ = (θ1, θ2) ∈ R2. Once the player i collects coins, the corresponding bonuses are added to its total reward. Conversely, the bonuses collected by player i are deducted from its opponent −i. The total reward for the player i is j − I −i j ) + 0.5(N i ri total =ri + fixed − N −i fixed), θ j (Ii ∑︁ j=1,2 where Ii j = 1 if the coin with incentive bonus θ j is collected by the player i, otherwise Ii is the number of fixed coins collected by the player i. Then the exploration rate (ER) can be defined as j = 0 and N i fixed ER(θ ) = e (θ ) (cid:205)i Gi Gtotal , (7.1) where the Gi e (θ ) denotes the number of grids explored by player i and Gtotal denotes the total number of grids. Therefore, the de- signer's loss is defined as f∗ (θ ) = 1 − ER(θ ). Predator-prey (PP). The environment for the predator-prey is set in a 7 × 7 grid-world as Figure 3, containing the prey's nest, two shelters, and water pools. Both the predator and prey cannot stop at the shelter. At each step, the prey can move one grid and the predator can move one or two grids in four directions. The game is terminated under three conditions: i) the episode achieves maximum length 25; ii) the prey returns the nest, then the reward for the prey, rprey, is +1 and the reward for the predator, rpred, is −1; iii) the predator catches the prey (they arrive on the same grid at the same time), then the reward for prey, rprey, is −1 and the player 0player 1bonus coinrockpaperscissorsdeterministicpreypredatorshelternestdeterministic bonusborn regionbonus water reward for predator, rpred, is +1. From a whole-ecosystem perspec- tive, like the dissemination of plant seeds, the designer stimulates them to explore more places by setting four pools with different volumes of water in the four fixed grids. Two of them are filled with fixed water volume with an additional 0.1 bonuses and others are filled with adjustable water volume, whose bonuses are denoted as the incentive parameter θ = (θ1, θ2) ∈ R2. The player gets the corresponding bonus if it finds and drinks up a pool of water while its opponent gets the corresponding penalty. Then the total pay-off for the predator is ∑︁ j=1,2 − I prey j θ j (I pred j ) +0.5(N pred rpred =Icatch −Inest + fixed − N prey fixed), where Icatch and Inest are two indicators for that the predator catch the prey or the prey back to the nest, I pred ) is the indication functions of whether the pool with θ j amount of water is found by the predator (or prey) and N pred ) represents the number fixed of fixed pools discovered by the predator (or prey). In addition, we define the reward for prey as rprey = −rpred. The arbitrating objective for PP is the same as what is defined for RWS. (or N prey fixed (or I prey j j 7.2 Results and Analysis We use GridSearch(M) to denote the zeroth-order method, which spreads M number of points into the feasible region for incentive parameter θ , as a competitor to DASAC. Additionally, we adopt Bayesian optimization to improve the efficiency of the zeroth-order method, denoted as BayesOpt, which is also used in [64]. The ex- perimental details of GridSearch(M) and BayesOpt are included in Appendix G.2. Figure 4 shows the trend of the arbitrating objective f∗ after applying DASAC onto the environments. The green dotted line in Figure 4 is the best objective score of GridSearch(100). On the one hand, Figure 4 shows the differentiable first-order frame- work we propose is capable to admit a better incentive parameter θ with a lower objective loss. On the other hand, Figure 4 indicates that GridSearch(M) requires 100 samples, in another word, solving the lower-level Markov game 100 times, to achieve an equivalent performance of DASAC. DASAC can achieve better efficiency ( 5 outer-loop iterations) than these zeroth-order methods even though BayesOpt ( 12 outer-loop iterations, >2 times slower than ours) has improved the efficiency of GridSearch (100 outer-loop iterations). After considering the gradient computation, DASAC requires 3.5h for one iteration and the zeroth-order methods (Gridsearch and BayesOpt) requires 3h for one iteration under the same GPU set- ting. Our method is 2x faster than BayesOpt and 17x faster than Gridsearch(100). It means our first-order framework requires fewer evaluations for the upper level to obtain a desirable NE policy, leading to a higher sample efficiency. Furthermore, we will present our DASAC tends to reach a desir- able NE via analyzing the NE behavior at the initial incentive θ0 and the optimal incentive θ ∗ (marked in Figure 4). Figure 1 illustrates the trace of players when taking the NE policies in RWS and PP environments with initial incentive θ0 and the optimal incentive θ ∗ respectively. It demonstrates that the optimal θ ∗ navigates the system to a better NE that players are more exploration-minded. To be more specific, with the initial incentive parameter θ0, al- though players start to take account of the exploration rate and think outside the habitual behaviors in an unincentivized system, Figure 4: Arbitrating objective loss f∗ for DASAC, BayesOpt, and GridSearch(100) in RWS (top) and PP (bottom). The green dotted line indicates the best objective score of Grid- Search(100). Our DASAC can outperform two zeroth-order baselines, GridSearch(100) and BayesOpt, by a large margin, which shows that our first-order framework requires fewer evaluations for the upper level to obtain a desirable NE pol- icy, leading to a higher sample efficiency. e.g., standstill but not collecting resources after a few steps in RWS or stalemate in a relative diagonal position in PP, they still tend to maintain the habitual behavior after a few explorations. As the training for the incentive parameter goes on, the habitual behav- iors in an unincentivized system are gradually abandoned and they develop new patterns of behavior that lead to a higher exploration rate and ensure their own goals at the same time. For example, in PP, the predator still tries their best to catch the prey, and the prey tries to escape as soon as possible. The difference is that the prey tends to circle around, exploring the water source to replenish its energy instead of staying in one place and avoiding risky moves. 8 CONCLUSION Our work initiates a provably differentiable framework in context with MARL to solve a bi-level arbitrating problem. We provide the convergence proof and empirically validate the effectiveness of the DASAC on arbitrating in two Markov games. Our work can be extended to multiple-player and general-sum settings with proper NE solvers whose convergence properties have been empirically shown. Therefore, we will empirically test the performance of the 02468101214outer-loop iteration0.1250.1500.1750.2000.2250.2500.2750.300incentive lossRock with ScissorsDASACBayesOptGridsearch(100)024681012outer-loop iteration0.4250.4500.4750.5000.5250.5500.5750.600incentive lossPredator PreyDASACBayesOptGridsearch(100) performance of the DA framework on more general cases in our future work. REFERENCES [1] Hadi Abbaszadehpeivasti, Etienne de Klerk, and Moslem Zamani. 2022. The exact worst-case convergence rate of the gradient method with fixed step lengths for L-smooth functions. Optimization Letters 16, 6 (2022), 1649–1661. [2] Zafarali Ahmed, Nicolas Le Roux, Mohammad Norouzi, and Dale Schuurmans. 2019. Understanding the impact of entropy on policy optimization. In Interna- tional Conference on Machine Learning. PMLR, 151–160. [3] Ahmet Alacaoglu, Luca Viano, Niao He, and Volkan Cevher. 2022. A natural actor-critic framework for zero-sum Markov games. In International Conference on Machine Learning. PMLR, 307–366. [4] Brandon Amos and J Zico Kolter. 2017. Optnet: Differentiable optimization as a layer in neural networks. In International Conference on Machine Learning. PMLR, 136–145. [5] Haris Aziz and Florian Brandl. 2021. Efficient, fair, and incentive-compatible healthcare rationing. arXiv preprint arXiv:2102.04384 (2021). [6] David Balduzzi, Karl Tuyls, Julien Perolat, and Thore Graepel. 2018. Re-evaluating evaluation. arXiv preprint arXiv:1806.02643 (2018). [7] Jeffrey S Banks and Joel Sobel. 1987. Equilibrium selection in signaling games. Econometrica: Journal of the Econometric Society (1987), 647–661. [8] Tamer Başar and Geert Jan Olsder. 1998. Dynamic noncooperative game theory. SIAM. [9] Atilim Gunes Baydin, Robert Cornish, David Martinez Rubio, Mark Schmidt, and Frank Wood. 2018. Online Learning Rate Adaptation with Hypergradient Descent. In International Conference on Learning Representations. [10] B Douglas Bernheim and Michael D Whinston. 1987. Coalition-proof Nash equilibria II. applications. Journal of Economic Theory 42, 1 (1987), 13–29. [11] Patrick Bolton and Mathias Dewatripont. 2004. Contract theory. MIT press. [12] Carlo Cambini and Laura Rondi. 2010. Incentive regulation and investment: evidence from European energy utilities. Journal of regulatory economics 38, 1 (2010), 1–26. [13] Shicong Cen, Yuejie Chi, Simon S Du, and Lin Xiao. 2022. Faster Last-iterate Convergence of Policy Optimization in Zero-Sum Markov Games. arXiv preprint arXiv:2210.01050 (2022). [14] Shicong Cen, Yuting Wei, and Yuejie Chi. 2021. Fast policy extragradient meth- ods for competitive games with entropy regularization. Advances in Neural Information Processing Systems 34 (2021), 27952–27964. [15] Georgios Chalkiadakis and Craig Boutilier. 2003. Coordination in Multiagent Reinforcement Learning: A Bayesian Approach. In Proceedings of the Second International Joint Conference on Autonomous Agents and Multiagent Systems (Melbourne, Australia) (AAMAS '03). Association for Computing Machinery, New York, NY, USA, 709–716. https://doi.org/10.1145/860575.860689 [16] Ziyi Chen, Shaocong Ma, and Yi Zhou. 2021. Sample Efficient Stochastic Policy Extragradient Algorithm for Zero-Sum Markov Game. In International Conference on Learning Representations. [17] Maxime Chevalier-Boisvert, Lucas Willems, and Suman Pal. 2018. Minimalistic Gridworld Environment for OpenAI Gym. https://github.com/maximecb/gym- minigrid. [18] Caroline Claus and Craig Boutilier. 1998. The dynamics of reinforcement learning in cooperative multiagent systems. AAAI/IAAI 1998, 746-752 (1998), 2. [19] Benoît Colson, Patrice Marcotte, and Gilles Savard. 2007. An overview of bilevel optimization. Annals of operations research 153, 1 (2007), 235–256. [20] Bo Dai, Albert Shaw, Lihong Li, Lin Xiao, Niao He, Zhen Liu, Jianshu Chen, and Le Song. 2018. SBEED: Convergent Reinforcement Learning with Nonlinear Function Approximation. In Proceedings of the 35th International Conference on Machine Learning (Proceedings of Machine Learning Research, Vol. 80), Jennifer Dy and Andreas Krause (Eds.). PMLR, 1125–1134. https://proceedings.mlr.press/ v80/dai18c.html [21] Sam Devlin and Daniel Kudenko. 2011. Theoretical considerations of potential- based reward shaping for multi-agent systems. In The 10th International Confer- ence on Autonomous Agents and Multiagent Systems. ACM, 225–232. [22] Yali Du, Lei Han, Meng Fang, Ji Liu, Tianhong Dai, and Dacheng Tao. 2019. Liir: Learning individual intrinsic reward in multi-agent reinforcement learning. (2019). [23] Pradeep Dubey. 1986. Inefficiency of Nash Equilibria. Mathematics of Operations Research 11, 1 (1986), 1–8. http://www.jstor.org/stable/3690047 [24] Fei Fang, Albert Xin Jiang, and Milind Tambe. 2013. Protecting moving targets with multiple mobile resources. Journal of Artificial Intelligence Research 48 (2013), 583–634. [25] Xidong Feng, Oliver Slumbers, Ziyu Wan, Bo Liu, Stephen McAleer, Ying Wen, Jun Wang, and Yaodong Yang. 2021. Neural auto-curricula in two-player zero-sum games. Advances in Neural Information Processing Systems 34 (2021), 3504–3517. [26] Chelsea Finn, Pieter Abbeel, and Sergey Levine. 2017. Model-agnostic meta- learning for fast adaptation of deep networks. In International Conference on Machine Learning. PMLR, 1126–1135. [27] Terry L Friesz, Roger L Tobin, Hsun-Jung Cho, and Nihal J Mehta. 1990. Sensitivity analysis based heuristic algorithms for mathematical programs with variational inequality constraints. Mathematical Programming 48, 1 (1990), 265–284. [28] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. 2020. Generative adversarial networks. Commun. ACM 63, 11 (2020), 139–144. [29] Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. 2017. Rein- forcement learning with deep energy-based policies. In International Conference on Machine Learning. PMLR, 1352–1361. [30] Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. 2018. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International conference on machine learning. PMLR, 1861– 1870. [31] Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, et al. 2018. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905 (2018). [32] Yuval Noah Harari. 2014. Sapiens: A brief history of humankind. Random House. [33] Johannes Heinrich, Marc Lanctot, and David Silver. 2015. Fictitious Self-Play in Extensive-Form Games. In Proceedings of the 32nd International Conference on Machine Learning (Proceedings of Machine Learning Research, Vol. 37), Francis Bach and David Blei (Eds.). PMLR, Lille, France, 805–813. https://proceedings. mlr.press/v37/heinrich15.html [34] Johannes Heinrich and David Silver. 2015. Smooth uct search in computer poker. In Twenty-Fourth International Joint Conference on Artificial Intelligence. [35] Johannes Heinrich and David Silver. 2016. Deep reinforcement learning from self-play in imperfect-information games. arXiv preprint arXiv:1603.01121 (2016). [36] Josef Hofbauer and Karl Sigmund. 2003. Evolutionary game dynamics. Bulletin of the American mathematical society 40, 4 (2003), 479–519. [37] Junling Hu and Michael P Wellman. 2003. Nash Q-learning for general-sum stochastic games. Journal of machine learning research 4, Nov (2003), 1039–1069. [38] Aly Ibrahim, Anirudha Jitani, Daoud Piracha, and Doina Precup. [n.d.]. Reward Redistribution Mechanisms in Multi-agent Reinforcement Learning. ([n. d.]). [39] Shariq Iqbal and Fei Sha. 2019. Actor-attention-critic for multi-agent reinforce- ment learning. In International Conference on Machine Learning. PMLR, 2961– 2970. [40] Haoming Jiang, Zhehui Chen, Yuyang Shi, Bo Dai, and Tuo Zhao. 2021. Learn- ing to Defend by Learning to Attack. In International Conference on Artificial Intelligence and Statistics. PMLR, 577–585. [41] Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic opti- mization. arXiv preprint arXiv:1412.6980 (2014). [42] Zafeiris Kokkinogenis, Nuno Monteiro, Rosaldo JF Rossetti, Ana LC Bazzan, and Pedro Campos. 2014. Policy and incentive designs evaluation: A social- oriented framework for Artificial Transportation Systems. In 17th International IEEE Conference on Intelligent Transportation Systems (ITSC). IEEE, 151–156. [43] Vijay R Konda and John N Tsitsiklis. 2000. Actor-critic algorithms. In Advances in neural information processing systems. 1008–1014. [44] Jean-Jacques Laffont and David Martimort. 2009. The theory of incentives. Prince- ton university press. [45] Theodore J Lambert Iii, Marina A Epelman, and Robert L Smith. 2005. A fictitious play approach to large-scale optimization. Operations Research 53, 3 (2005), 477–489. [46] Kyungjae Lee, Sungjoon Choi, and Songhwai Oh. 2018. Sparse markov decision processes with causal sparse tsallis entropy regularization for reinforcement learning. IEEE Robotics and Automation Letters 3, 3 (2018), 1466–1473. [47] Joel Z Leibo, Edward Hughes, Marc Lanctot, and Thore Graepel. 2019. Autocur- ricula and the emergence of innovation from social interaction: A manifesto for multi-agent intelligence research. arXiv preprint arXiv:1903.00742 (2019). [48] George Leitmann. 1978. On generalized Stackelberg strategies. Journal of opti- mization theory and applications 26, 4 (1978), 637–643. [49] Chenghao Li, Chengjie Wu, Tonghan Wang, Jun Yang, Qianchuan Zhao, and Chongjie Zhang. 2021. Celebrating Diversity in Shared Multi-Agent Reinforce- ment Learning. arXiv preprint arXiv:2106.02195 (2021). [50] Huan Li, Cong Fang, Wotao Yin, and Zhouchen Lin. 2018. A sharp conver- gence rate analysis for distributed accelerated gradient methods. arXiv preprint arXiv:1810.01053 (2018). [51] Jiayang Li, Jing Yu, Yu Nie, and Zhaoran Wang. 2020. End-to-end learning and intervention in games. Advances in Neural Information Processing Systems 33 (2020). [52] Tao Li and Suresh P Sethi. 2017. A review of dynamic Stackelberg game models. Discrete & Continuous Dynamical Systems-B 22, 1 (2017), 125. [53] Michael L Littman. 1994. Markov games as a framework for multi-agent rein- forcement learning. In Machine learning proceedings 1994. Elsevier, 157–163. [54] Boyi Liu, Jiayang Li, Zhuoran Yang, Hoi-To Wai, Mingyi Hong, Yu Marco Nie, Inducing Equilibria via Incentives: Simultaneous and Zhaoran Wang. 2021. Design-and-Play Finds Global Optima. arXiv preprint arXiv:2110.01212 (2021). [81] Zhenggang Tang, Chao Yu, Boyuan Chen, Huazhe Xu, Xiaolong Wang, Fei Fang, Simon Shaolei Du, Yu Wang, and Yi Wu. 2021. Discovering Diverse Multi-Agent Strategic Behavior via Reward Randomization. In International Conference on Learning Representations. https://openreview.net/forum?id=lvRTC669EY_ [82] Anne van den Nouweland. 2007. Rock-paper-scissors; a new and elegant proof. (2007). [83] Alexander Vezhnevets, Yuhuai Wu, Maria Eckstein, Rémi Leblond, and Joel Z Leibo. 2020. OPtions as REsponses: Grounding behavioural hierarchies in multi- agent reinforcement learning. In International Conference on Machine Learning. PMLR, 9733–9742. [84] John Von Neumann and Oskar Morgenstern. 2007. Theory of games and economic behavior. In Theory of games and economic behavior. Princeton university press. [85] Kai Wang, Sanket Shah, Haipeng Chen, Andrew Perrault, Finale Doshi-Velez, and Milind Tambe. 2021. Learning MDPs from Features: Predict-Then-Optimize for Sequential Decision Making by Reinforcement Learning. Advances in Neural Information Processing Systems 34 (2021), 8795–8806. [86] Kai Wang, Lily Xu, Andrew Perrault, Michael K Reiter, and Milind Tambe. 2022. Coordinating followers to reach better equilibria: End-to-end gradient descent for stackelberg games. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 36. 5219–5227. [87] Xiaoxing Wang, Wenxuan Guo, Junchi Yan, Jianlin Su, and Xiaokang Yang. 2021. ZARTS: On Zero-order Optimization for Neural Architecture Search. arXiv preprint arXiv:2110.04743 (2021). [88] Thomas A Weber and AV Kryazhimskiy. 2011. Optimal control theory with applications in economics. Vol. 10. MIT press Cambridge, MA. [89] Changnan Xiao, Haosen Shi, Jiajun Fan, and Shihong Deng. 2021. An Entropy Regularization Free Mechanism for Policy-based Reinforcement Learning. arXiv preprint arXiv:2106.00707 (2021). [90] Jiachen Yang, Ang Li, Mehrdad Farajtabar, Peter Sunehag, Edward Hughes, and Hongyuan Zha. 2020. Learning to Incentivize Other Learning Agents. Advances in Neural Information Processing Systems 33 (2020). [91] Jiachen Yang, Ethan Wang, Rakshit Trivedi, Tuo Zhao, and Hongyuan Zha. 2022. Adaptive Incentive Design with Multi-Agent Meta-Gradient Reinforcement Learn- ing. In Proceedings of the 21st International Conference on Autonomous Agents and Multiagent Systems. 1436–1445. [92] Tianbao Yang, Qihang Lin, and Zhe Li. 2016. Unified convergence analysis of stochastic momentum methods for convex and non-convex optimization. arXiv preprint arXiv:1604.03257 (2016). [93] Rui Zhao, Xudong Sun, and Volker Tresp. 2019. Maximum Entropy-Regularized Multi-Goal Reinforcement Learning. In Proceedings of the 36th International Conference on Machine Learning (Proceedings of Machine Learning Research, Vol. 97), Kamalika Chaudhuri and Ruslan Salakhutdinov (Eds.). PMLR, 7553– 7562. https://proceedings.mlr.press/v97/zhao19d.html [94] Yulai Zhao, Yuandong Tian, Jason Lee, and Simon Du. 2022. Provably Efficient Policy Optimization for Two-Player Zero-Sum Markov Games. In International Conference on Artificial Intelligence and Statistics. PMLR, 2736–2761. [95] Han Zhong, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. 2021. Can Re- inforcement Learning Find Stackelberg-Nash Equilibria in General-Sum Markov Games with Myopic Followers? arXiv preprint arXiv:2112.13521 (2021). [55] Boyi Liu, Zhuoran Yang, and Zhaoran Wang. 2020. Policy Optimization in Zero-Sum Markov Games: Fictitious Self-Play Provably Attains Nash Equilibria. (2020). [56] Jingbin Liu, Xinyang Gu, and Shuai Liu. 2019. Policy optimization reinforcement learning with entropy regularization. arXiv preprint arXiv:1912.01557 (2019). [57] Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, Pieter Abbeel, and Igor Mordatch. 2017. Multi-agent actor-critic for mixed cooperative-competitive environments. In Proceedings of the 31st International Conference on Neural Information Processing Systems. 6382–6393. [58] Zhi-Quan Luo, Jong-Shi Pang, and Daniel Ralph. 1996. Mathematical programs with equilibrium constraints. Cambridge University Press. [59] Xiaochen Ma, Hong Wang, Li Yang, Leiyu Shi, and Xiaoyun Liu. 2019. Realigning the incentive system for China's primary healthcare providers. Bmj 365 (2019). [60] Hugh Macartney, Robert McMillan, and Uros Petronijevic. 2016. Incentive de- sign in education: An empirical analysis. Technical Report. National Bureau of Economic Research. [61] H Brendan McMahan and Geoffrey J Gordon. 2007. A fast bundle-based anytime algorithm for poker and other convex games. In Artificial Intelligence and Statistics. PMLR, 323–330. [62] Joy Melnikow, Mary Paliescheskey, and Gary K Stewart. 1997. Effect of a trans- portation incentive on compliance with the first prenatal appointment: a ran- domized trial. Obstetrics & Gynecology 89, 6 (1997), 1023–1027. [63] Panayotis Mertikopoulos and William H Sandholm. 2016. Learning in games via reinforcement and regularization. Mathematics of Operations Research 41, 4 (2016), 1297–1324. [64] David Mguni, Joel Jennings, Emilio Sison, Sergio Valcarcel Macua, Sofia Ceppi, and Enrique Munoz de Cote. 2019. Coordinating the Crowd: Inducing Desirable Equilibria in Non-Cooperative Systems. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems. 386–394. [65] Amir-Hamed Mohsenian-Rad, Vincent WS Wong, Juri Jatskevich, and Robert Schober. 2010. Optimal and autonomous incentive-based energy consumption scheduling algorithm for smart grid. In 2010 Innovative Smart Grid Technologies (ISGT). IEEE, 1–6. [66] Roger B Myerson. 1978. Refinements of the Nash equilibrium concept. Interna- tional journal of game theory 7, 2 (1978), 73–80. [67] Alex Nichol, Joshua Achiam, and John Schulman. 2018. On first-order meta- learning algorithms. arXiv preprint arXiv:1803.02999 (2018). [68] Shayegan Omidshafiei, Christos Papadimitriou, Georgios Piliouras, Karl Tuyls, Mark Rowland, Jean-Baptiste Lespiau, Wojciech M Czarnecki, Marc Lanctot, Julien Perolat, and Remi Munos. 2019. α-rank: Multi-agent evaluation by evolu- tion. Scientific reports 9, 1 (2019), 1–29. [69] Jack Parker-Holder, Luke Metz, Cinjon Resnick, Hengyuan Hu, Adam Lerer, Alistair Letcher, Alex Peysakhovich, Aldo Pacchiano, and Jakob Foerster. 2020. Ridge Rider: Finding Diverse Solutions by Following Eigenvectors of the Hessian. arXiv preprint arXiv:2011.06505 (2020). [70] A.C. Pigou and N. Aslanbeigui. 1920. The Economics of Welfare (1st ed.). Routledge. [71] Aida Rahmattalabi, Jen Jen Chung, Mitchell Colby, and Kagan Tumer. 2016. D++: Structural credit assignment in tightly coupled multiagent domains. In 2016 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 4424–4429. [72] Ali Ramezani-Kebrya, Ashish Khisti, and Ben Liang. 2018. On the generalization of stochastic gradient descent with momentum. arXiv preprint arXiv:1809.04564 (2018). [73] Lillian J Ratliff, Roy Dong, Shreyas Sekar, and Tanner Fiez. 2019. A perspective on incentive design: Challenges and opportunities. Annual Review of Control, Robotics, and Autonomous Systems 2 (2019), 305–338. [74] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347 (2017). [75] Reinhard Selten. 1965. Spieltheoretische behandlung eines oligopolmodells mit nachfrageträgheit: Teil i: Bestimmung des dynamischen preisgleichgewichts. Zeitschrift für die gesamte Staatswissenschaft/Journal of Institutional and Theoreti- cal Economics H. 2 (1965), 301–324. [76] Lloyd S Shapley. 1953. Stochastic games. Proceedings of the national academy of sciences 39, 10 (1953), 1095–1100. [77] Satinder Singh, Tommi Jaakkola, Michael L Littman, and Csaba Szepesvári. 2000. Convergence results for single-step on-policy reinforcement-learning algorithms. Machine learning 38, 3 (2000), 287–308. [78] Chen Siyu, Yang Donglin, Li Jiayang, Wang Senmiao, Yang Zhuoran, and Wang Zhaoran. 2022. Adaptive Model Design for Markov Decision Process. Technical Report. [79] Xingyou Song, Wenbo Gao, Yuxiang Yang, Krzysztof Choromanski, Aldo Pacchi- ano, and Yunhao Tang. 2020. ES-MAML: Simple Hessian-Free Meta Learning. In ICLR. [80] Csaba Szepesvári and Michael L Littman. 1999. A unified analysis of value- function-based reinforcement-learning algorithms. Neural computation 11, 8 (1999), 2017–2060. Differentiable Arbitrating in Zero-sum Markov Games Contents Proof for Lemma 4.1 Proof for Lemma 4.2 Extensions of DA framework PEM and Entropy-regularized OMWU Policy Extragradient Method (PEM) Entropy-regularized OMWU Clarification for Assumption 5.3 section*.1section.1section.2section.3subsection.3.1subsection.3.2subsection.3.3subsection.3.4section.4subsection.4.1subsection.4.2section.5subsection.5.1subsection.5.2section.6section.7subsection.7.1subsection.7.2section.8section*.9 A B C D D.1 D.2 E E.1 F G G.1 G.2 G.3 DASAC GridSearch(M) and BayesOpt baselines Implementation Details Proof for Theorem 5.4 Experimental Details 11 15 15 22 22 22 23 25 27 28 28 29 29 Proof for Lemma E.3 A PROOF FOR LEMMA 4.1 In this section, we provide the formulation of gradients ∇θV (i) derivation of gradients for V i πφ (s; θ ), ∇φiV (i) φφiV (i) πφ (s; θ ) in the following Lemma A.1 and then move into the proof for Lemma 4.1. Lemma A.1. For incentivized Markov game Gθ = (N, S, {Ai }i ∈ {1,2}, P, {ri (*; θ )}i ∈ {1,2}, γ), let Ri (τ; θ ) be the total reward for an sample trajectory τ on following πφ for T steps, starting from initial state s0 = s. We have πφ (s; θ ). We first introduce the πφ (s; θ ) and ∇2 πφ (s; θ ), ∇2 θφiV (i) ∇θV i πφ (s; θ ) = Eτ∼Dπφ ∇φiV i πφi (s; θ ) = Eτ∼Dπφ ∇2 θφiV i πφ (s; θ ) = Eτ∼Dπφ ∇2 φφiV i πφ (s; θ ) = Eτ∼Dπφ (cid:2)∇θ Ri (τ; θ )|s0 = s(cid:3) , (cid:34) T −1 ∑︁ Ri (τ; θ ) ∇φi log πi t =0 φi (at |st ) (cid:35) , (cid:12) s0 = s (cid:12) (cid:12) (cid:34)(cid:32)T −1 ∑︁ t =0 ∇φi log πi φi (at |st ) (cid:33) ∇θ Ri (τ; θ )⊺(cid:12) s0 = s (cid:12) (cid:12) (cid:35) , (cid:34) Ri (τ; θ ) (cid:32) T −1 ∑︁ ( t =0 ∇φi log πi φi (at |st ))( ∇φ log πφ (at |st ))⊺ T −1 ∑︁ t =0 (cid:35) , (cid:12) s0 = s (cid:12) (cid:12) where ∇2 φφi log πφ (at |st ) (cid:33) + T −1 ∑︁ t =0 ∇φ log πφ (at |st ) = (∇φ 1 log π 1 φ 1φi log π 1 φφi log πφ (at |st ) = (∇2 ∇2 φ 1 (at |st ), ∇φ 2 log π 2 φ 1 (at |st ), ∇2 φ 2φi log π 2 φ 2 (at |st )) φ 2 (at |st )). Proof for Lemma A.1. First, we find out ∇φi log Dπφ (τ |s0 = s): (cid:32) 2 (cid:214) (cid:34)T −1 (cid:214) ∇φi log Dπφ (τ |s0 = s) = ∇φi log P (st +1|st , at ) (cid:33)(cid:35) φi (ai πi t |st ) t =0 = ∇φi (cid:34)T −1 ∑︁ t =0 log P (st +1|st , at ) + i=1 T −1 ∑︁ t =0 log πi φi (at |st ) + T −1 ∑︁ t =0 log π −i φ −i (at |st ) (cid:35) = T −1 ∑︁ t =0 ∇φi log πi φi (at |st ). Similarly, we have ∇φ log Dπφ (τ |s0 = s) = (cid:205)T −1 over, recall that ∇φφi log πφ (at |st ) = (∇φ 1φi log π 1 and ∇2 πφ (s; θ ) as follows, φφiV i t =0 ∇φ log πφ (at |st ), where ∇φ log πφ (at |st ) = (∇φ 1 log π 1 φ 2 (at |st )), we could derive ∇θV i φ 1 (at |st ), ∇φ 2φi log π 2 φ 1 (at |st ), ∇φ 2 log π 2 πφ (s; θ ), ∇2 φiθ φ 2 (at |st )). More- πφ (s; θ ) πφ (s; θ ),∇φiV i V i ∇θV i πφ (s; θ ) = ∇θ Eτ∼Dπφ ∇φiV i πφ (s; θ ) = ∇φi Eτ∼Dπφ (cid:2)Ri (τ; θ )|s0 = s(cid:3) = Eτ∼Dπφ     τ∼Dπφ   (cid:2)Ri (τ; θ )|s0 = s(cid:3) = ∇φi ∑︁ ∑︁ = Dπφ (τ |s0 = s)∇φi log Dπφ (τ |s0 = s)Ri (τ; θ ) (cid:2)∇θ Ri (τ; θ )|s0 = s(cid:3) , Dπφ (τ |s0 = s)Ri (τ; θ )       τ∼Dπφ = Eτ∼Dπφ = Eτ∼Dπφ (cid:104) (cid:34) ∇φi log Dπφ (τ |s0 = s)Ri (τ; θ )|s0 = s (cid:105) Ri (τ; θ ) T −1 ∑︁ t =0 ∇φi log πi φi (at |st )|s0 = s (cid:35) , where the third equation follows as ∇φi Dπφ = Dπφ ∇φi Dπφ Dπφ = Dπφ ∇φi log Dπφ and interchanging the gradient and summation. ∇2 θφiV i πφ (s; θ ) = ∇θ Eτ∼Dπφ (cid:34) Ri (τ; θ ) T −1 ∑︁ t =0 ∇φi log πi φi (at |st )|s0 = s (cid:35) = Eτ∼Dπφ (cid:34)(cid:32)T −1 ∑︁ t =0 ∇φi log πi φi (at |st ) (cid:33) ∇θ Ri (τ; θ )⊺ |s0 = s (cid:35) , ∇2 φφiV i πφ (s; θ ) = ∇φφi Dπφ (τ |s0 = s)Ri (τ; θ )       ∑︁     τ∼Dπφ   ∑︁ Dπφ (τ |s0 = s)∇φi log Dπφ (τ |s0 = s)Ri (τ; θ ) = ∇φ = ∇φ     τ∼Dπφ       τ∼Dπφ   ∑︁ ∑︁ = τ∼Dπφ Dπφ (τ |s0 = s) (cid:32)T −1 ∑︁ t =0 ∇φi log πi Ri (τ; θ ) ∇φi log πi φi (at |st ) (cid:33) (cid:34)(cid:32)T −1 ∑︁ t =0       Ri (τ; θ ) (cid:33) φi (at |st )       ∇φ Dπφ (τ |s0 = s)⊺ +Dπφ (τ |s0 = s) ∇φφi log πφ (at |st ) (cid:33)(cid:35) (cid:32)T −1 ∑︁ t =0 Ri (τ; θ )Dπφ (τ |s0 =s) ∑︁ = τ∼Dπφ ∇φi log πi φi (at |st ) (cid:33) (cid:34)(cid:32)T −1 ∑︁ t =0 ∇φ log Dπφ (τ |s0 =s)⊺ ∇φφi log πφ (at |st ) (cid:35) + T −1 ∑︁ t =0 = Eτ∼Dπφ (cid:34) Ri (τ; θ ) (cid:32) T −1 ∑︁ ( t =0 ∇φi log πi φi (at |st ))( T −1 ∑︁ t =0 ∇φ log πφ (at |st ))⊺ In the remaining of this section, we complete the proof of Lemma 4.1 in main body. + T −1 ∑︁ t =0 ∇2 φφi log πφ (at |st ) (cid:33) (cid:35) . (cid:12) s0 = s (cid:12) (cid:12) □ Proof for Lemma 4.1. Recall the definition of V (i) πφ (s; θ ) in (3.5) and ri π (s, ai, a−i ; θ ) in (3.3), we have, V (i) πφ (s; θ ) = Eτ∼Dπφ = Eτ∼Dπφ (cid:34)T −1 ∑︁ t =0 (cid:34)T −1 ∑︁ t =0 γt *r (i) π (st , ai t , a−i t (cid:35) ; θ )|s0 = s γt *ri π (st , ai t , a−i t ; θ ) − λ T −1 ∑︁ t =0 γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:35) (cid:17) |st ) |s0 = s = V i πφ (s; θ ) − λEτ∼Dπφ (cid:34)T −1 ∑︁ t =0 γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:17) |st ) (cid:35) |s0 = s . For easy notation, we define Then we have, U i πφ (s) = Eτ∼Dπφ (cid:34)T −1 ∑︁ t =0 γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:17) |st ) (cid:35) |s0 = s . ∇θU i πφ (s) =0; ∇φiU i πφ (s) =∇φi (cid:34) ∑︁ τ Dπφ (τ |s0 =s) T −1 ∑︁ t =0 γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:35) (cid:17) |st ) ∑︁ = Dπφ (τ |s0 =s) (cid:34) τ ∇φi log Dπφ (τ |s0 =s) T −1 ∑︁ t =0 γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t γt ∇φi log πi φi (ai t |st ) T −1 ∑︁ + t =0 (cid:34)(cid:32)T −1 ∑︁ t =0 T −1 ∑︁ + (cid:35) (cid:35) ; γt ∇φi log πi φi (ai t |st ) ∇θφiU i πφ (s) =0; t =0 =Eτ∼Dπφ γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:33) (cid:32)T −1 ∑︁ (cid:17) |st ) t =0 ∇φi log πi φi (ai t |st ) (A.1) (A.2) (A.3) (A.4) (cid:17) |st ) (cid:33) (cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32) (cid:122) ∇φφiU i πφ (s) = ∇φ (cid:34) ∑︁ Dπφ (τ |s0 = s) (cid:32)T −1 ∑︁ γt (cid:16)log πi φi (ai := (I ) (cid:125)(cid:124) t |st ) − log π −i (cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32) (cid:33) (cid:32)T −1 ∑︁ (cid:17) (cid:123) (cid:33)(cid:35) ∇φi log πi φi (ai t |st ) φ −i (a−i t |st ) t =0 τ (cid:34) (cid:124) + ∇φ ∑︁ Dπφ (τ |s0 = s) (cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32) τ γt ∇φi log πi t |st ) (cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32) φi (ai (cid:35) . (cid:125) t =0 T −1 ∑︁ t =0 (cid:123)(cid:122) := (II ) Next we are going to compute (I) and (II). (I ) = ∑︁ Dπφ(τ |s0 =s) (cid:32)T −1 ∑︁ γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t |st ) (cid:33)(cid:32)T −1 (cid:17) ∑︁ t =0 ∇φi logπi φi (ai (cid:33) t |st) ∇φ log Dπφ (τ |s0 = s)⊺ τ t =0 ∑︁ + Dπφ (τ |s0 = s)∇φ τ (cid:34)(cid:32)T −1 ∑︁ t =0 γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:33) (cid:32)T −1 ∑︁ (cid:17) |st ) t =0 ∇φi log πi φi (ai t |st ) (cid:33)(cid:35) ∑︁ (I ) = Dπφ(τ |s0 = s) (cid:32)T −1 ∑︁ γt (cid:16)log πi t =0 Dπφ (τ |s0 = s) (cid:34)(cid:32)T −1 ∑︁ τ + ∑︁ τ φi (ai t |st ) − log π −i φ −i (a−i t ∇φi log πi φi (ai t |st) (cid:33)(cid:32)T −1 (cid:17) ∑︁ |st ) t =0 (cid:33)(cid:32)T −1 ∑︁ (cid:33) ⊺ ∇φ log πφ (at |st) t =0 ∇φi log πi φi (ai t |st ) (cid:33) (cid:32)T −1 ∑︁ γt (cid:16) t =0 ∇φ log πi φi (ai t |st ) − ∇φ log π −i φ −i (a−i t (cid:33) ⊺ (cid:17) |st ) γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:33) (cid:32)T −1 ∑︁ (cid:17) |st ) t =0 ∇2 φφi log πφ (ai t |st ) (cid:33)(cid:35) t =0 + (cid:32)T −1 ∑︁ t =0 =Eτ∼Dπφ (cid:34)(cid:32)T −1 ∑︁ t =0 γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:33) (cid:32)T −1 ∑︁ (cid:17) |st ) t =0 ∇φi log πi φi (ai t |st ) (cid:33) (cid:32)T −1 ∑︁ t =0 (cid:33) ⊺ ∇φ log πφ (at |st ) + + (cid:32)T −1 ∑︁ t =0 (cid:32)T −1 ∑︁ t =0 ∇φi log πi φi (ai t |st ) (cid:33) (cid:32)T −1 ∑︁ γt (cid:16) t =0 ∇φ log πi φi (ai t |st ) − ∇φ log π −i φ −i (a−i t (cid:17) |st ) (cid:33) ⊺ γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:33) (cid:32)T −1 ∑︁ (cid:17) |st ) t =0 ∇2 φφi log πφ (ai t |st ) (cid:33)(cid:35) ; (II ) = ∑︁ τ Dπφ (τ |s0 = s) (cid:34)(cid:32)T −1 ∑︁ t =0 γt ∇φi log πi φi (at |st ) (cid:33) ⊺ ∇φ log πφ (at |st ) (cid:33) (cid:32)T −1 ∑︁ t =0 + (cid:32)T −1 ∑︁ (cid:33)(cid:35) φφi log πφ (at |st ) γt ∇2 t =0 (cid:34)(cid:32)T −1 ∑︁ t =0 γt∇φi log πi φi (at |st) ∇φ log πφ (at |st) (cid:33)(cid:32)T −1 ∑︁ (cid:33) ⊺ + (cid:32)T −1 ∑︁ (cid:33)(cid:35) φφi log πφ (at |st) γt ∇2 . t =0 t =0 =Eτ∼Dπφ Therefore, ∇φφiU i πφ (s) = Eτ∼Dπφ (cid:34)(cid:32)T −1 ∑︁ t =0 γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:33) (cid:32)T −1 ∑︁ (cid:17) |st ) t =0 (cid:33) ⊺ ∇φ log πφ (at |st ) (cid:33) (cid:32)T −1 ∑︁ t =0 ∇φi log πi t |st ) φi (ai (cid:33) ⊺ (cid:17) |st ) (cid:32)T −1 ∑︁ t =0 (cid:32)T −1 ∑︁ t =0 (cid:32)T −1 ∑︁ + + + ∇φi log πi φi (ai t |st ) (cid:33) (cid:32)T −1 ∑︁ γt (cid:16) t =0 ∇φ log πi φi (ai t |st ) − ∇φ log π −i φ −i (a−i t γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:33) (cid:32)T −1 ∑︁ (cid:17) |st ) t =0 t |st ) ∇2 φφi log πφ (ai (cid:33) ⊺ (cid:32)T −1 ∑︁ (cid:33) (cid:33)(cid:35) t =0 (cid:33) (cid:32)T −1 ∑︁ t =0 γt ∇φi log πi φi (at |st ) ∇φ log πφ (at |st) + γt ∇2 φφi log πφ (at |st ) (A.5) t =0 Since (A.1) can be written as V (i) πφ (s; θ ) = V i πφ (s; θ ) − λU i πφ (s), then together with (A.2-A.5), we have ∇θV (i) πφ (s; θ ) = ∇θV i πφ (s; θ ); ∇φiV (i) πφ (s; θ ) = ∇φiV i πφ (s; θ ) − λEτ∼Dπφ (cid:34)(cid:32)T −1 ∑︁ t =0 θφiV (i) ∇2 πφ (s; θ ) = ∇2 θφiV i πφ (s; θ ); γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:33) (cid:32)T −1 ∑︁ (cid:17) |st ) t =0 ∇φi log πi φi (ai t |st ) (cid:33) + T −1 ∑︁ t =0 γt ∇φi log πi φi (ai t |st ) φφiV (i) ∇2 πφ (s; θ ) = ∇2 φφiV i πφ (s; θ ) −λEτ∼Dπφ (cid:34)(cid:32)T −1 ∑︁ t =0 γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:33) (cid:32)T −1 ∑︁ (cid:17) |st ) t =0 ∇φi log πi φi (ai t |st ) (cid:33) (cid:32)T −1 ∑︁ t =0 (cid:33) ⊺ ∇φ log πφ (at |st ) (cid:32)T −1 ∑︁ t =0 (cid:32)T −1 ∑︁ t =0 (cid:32)T −1 ∑︁ + + + ∇φi log πi φi (ai t |st ) (cid:33) (cid:32)T −1 ∑︁ γt (cid:16) t =0 ∇φ log πi φi (ai t |st ) − ∇φ log π −i φ −i (a−i t (cid:17) |st ) (cid:33) ⊺ γt (cid:16)log πi φi (ai t |st ) − log π −i φ −i (a−i t (cid:33) (cid:32)T −1 ∑︁ (cid:17) |st ) t =0 t |st ) ∇2 φφi log πφ (ai (cid:33) ⊺ (cid:32)T −1 ∑︁ (cid:33) (cid:33)(cid:35) γt ∇φi log πi φi (at |st ) ∇φ log πφ (at |st) + γt ∇2 φφi log πφ (at |st ) t =0 (cid:33) (cid:32)T −1 ∑︁ t =0 t =0 B PROOF FOR LEMMA 4.2 In this section, we prove Lemma 4.2 based on Lemma 4.1. (cid:35) ; □ Proof for Lemma 4.2. Since φ (∗) (θ ) is the policy parameter of Nash equilibrium πφ (∗) (θ ) incentivized reward G′ θ θ on both sides, for any i ∈ {1, 2}, we have , uθ (φ (∗) (θ )) = (Eν ∗ ∇φ 1V (1) πφ (θ ), Eν ∗ ∇φ 2V (2) πφ (θ ))(cid:12) for the regularized Markov game with the (cid:12)φ=φ (∗) (θ ) = 0. Then, by differentiating the equality with respect to Thus, define where ν∗ is νπ φ (∗) (θ ) (s). We have, Eν ∗ ∇θφiV (i) πφ (θ ) + Eν ∗ ∇φφiV (i) πφ (θ ) [∇θ φ (∗) (θ )] = 0. ∇θuθ (φ) = ∇φuθ (φ) = (cid:35) (cid:34)Eν ∗ ∇θφ 1V (1) Eν ∗ ∇θφ 2V (2) (cid:34)Eν ∗ ∇φφ 1V (1) Eν ∗ ∇φφ 2V (2) πφ (θ ) πφ (θ ) πφ (θ ) πφ (θ ) ∈ Rd×m, (cid:35) ∈ Rd×d, ∇θ φ (∗) (θ ) = − (cid:2)∇φuθ (φ)(cid:3) −1 ∇θuθ (φ)(cid:12) (cid:12)φ=φ ∗ (θ ) . □ C EXTENSIONS OF DA FRAMEWORK Note that the DA framework itself is general given a proper lower-level NE solver. In this section, we detail the extension of DA framework to two general cases: i) N-players and no restriction to reward; ii) partial observations. Since the primary part in DA framework is the derivation of upper-level loss gradient at NE ∇f∗ (θ ), in the following we present the calculation of ∇f∗ (θ ) based on the policy gradient information from the lower level in extended settings. Extension to N-player and no reward restriction. We first define the incentivized Markov game with N players as Gθ = (S, {Ai, ri (*; θ )}i ∈ {1,*** ,N }, λ, P, γ). Then the total discounted reward Ri π (τ; θ ) and value function V i π (s; θ ) for all i ∈ {1, ..., N } are defined as Ri π (τ; θ ) = T −1 ∑︁ t =0 V i π (s; θ ) = Eπ γtri (st , ai t , a−i t ; θ ), γt *ri π (st , ai t , a−i t (cid:35) ; θ )|s0 = s (cid:34)T −1 ∑︁ t =0 = Eτ∼Dπ (cid:2)Ri π (τ; θ )(cid:12) (cid:12)s0 = s(cid:3) . (C.1) (C.2) Then define the entropy-regularized G′ θ = (S, {Ai, r (i) π (*; θ )}i ∈ {1,*** ,N }, λ, P, γ), where r (i) (*; θ ) : S × Ai × A−i → R is defined as: r (i) π (*; θ ) = ri (*; θ ) − λ log(πi (ai |s)) + λ N − 1 ∑︁ j =1,...,n j ≠i log(π j (a j |s)). Then the entropy-regularized value function is R (i) π (τ; θ ) = T −1 ∑︁ t =0 γtr (i) π (st , ai t , a−i t ; θ ), V (i) π (s; θ ) = Eπ (cid:34)T −1 ∑︁ γt *r (i) π (st , ai t , a−i t (cid:35) ; θ )|s0 = s t =0 (cid:104) = Eτ∼Dπ R (i) π (τ; θ )(cid:12) (cid:12)s0 = s (cid:105) . (C.3) (C.4) Other definitions remain same as defined in Section 3.2 except for the zero-sum restriction to ri (*; θ ). We are going to paramterized the i=1 di . In N-player φ N ), where φ = (φ 1, * * * , φ N ) ∈ Rd, d = (cid:205)N joint policy π with φ for computation simplicity. Therefore, πφ = (π 1 Markov game, we denote φ 1, * * * , π N ∇φ log πφ (at |st ) = (∇φ 1 log π 1 ∇2 φφi log πφ (at |st ) = (∇2 φ 1φi log π 1 φ 1 (at |st ), * * * , ∇φ N log π N φ 1 (at |st ), * * * , ∇2 φ N φi log π N φ N (at |st )) φ N (at |st )). Lemma C.1 and Lemma C.2 extends the Lemma A.1 and Lemma 4.1 into the N-player general-sum game respectively. For extension of Lemma 4.2, we switch the notation in (4.2) and (4.3) as uθ (φ; s) := (∇φ 1V (1) Eν (∗)∇2 ∇θuθ (φ) = Eν (∗)∇2 πφ (s; θ ), * * * , ∇φ N V (N ) πφ θφ 1V (1) πφ (s; θ ) * * * θφ N V (N ) πφ (s; θ )                 ∈ Rd×m, ∇φuθ (φ) = (s; θ )), uθ (φ) := Eν (∗) [uθ (φ; s)], Eν (∗) ∇2 πφ (s; θ ) φφ 1V (1) * * * φφ N V (N ) πφ Eν (∗) ∇2 (s; θ )         (C.5) (C.6) ∈ Rd×d .         Then (4.5) in Lemma 4.2 and the gradient of upper-level loss ∇f∗ (θ ) in (4.6) remain the same. Lemma C.1. For an incentivized Markov game Gθ = (S, {Ai, Ωi, Oi, ri (*; θ )}i ∈ {1,*** ,N }, P, γ), let Ri (τ; θ ) be the total reward for an sample trajectory τ following πφ for T steps, starting from initial state s0 = s. We have ∇θV i πφ (s; θ ) = Eτ∼Dπφ ∇φiV i πφi (s; θ ) = Eτ∼Dπφ ∇2 θφiV i πφ (s; θ ) = Eτ∼Dπφ ∇2 φφiV i πφ (s; θ ) = Eτ∼Dπφ (cid:2)∇θ Ri (τ; θ )|s0 = s(cid:3) , (cid:34) T −1 ∑︁ Ri (τ; θ ) ∇φi log πi t =0 φi (at |st ) (cid:35) , (cid:12) s0 = s (cid:12) (cid:12) (cid:34)(cid:32)T −1 ∑︁ t =0 ∇φi log πi φi (at |st ) (cid:33) ∇θ Ri (τ; θ )⊺(cid:12) s0 = s (cid:12) (cid:12) (cid:35) , (cid:34) Ri (τ; θ ) (cid:32) T −1 ∑︁ ( t =0 ∇φi log πi φi (at |st ))( ∇φ log πφ (at |st ))⊺ T −1 ∑︁ t =0 (cid:35) , (cid:12) s0 = s (cid:12) (cid:12) where ∇2 φφi log πφ (at |st ) (cid:33) + T −1 ∑︁ t =0 ∇φ log πφ (at |st ) = (∇φ 1 log π 1 φ 1φi log π 1 φφi log πφ (at |st ) = (∇2 ∇2 φ 1 (at |o1 φ 1 (at |o1 t ), * * * , ∇φ N log π N φ N (at |oN t ), * * * , ∇2 φ N φi log π N t )), φ N (at |oN t )). Proof for Lemma C.1. According to the proof of Lemma A.1, the derivation for ∇φiV i (cid:104)ΠN i=1πi t =0 ρ (s0)P (st +1|at , st ) Recall Dπφ (τ) = ΠT −1 (cid:105), we have φi (ai t |oi ) πφ (s; θ ) and ∇2 φφiV i πφ (s; θ ) are based on ∇φi log Dπφ (τ |s0 = s). ∇φi log Dπφ (τ |s0 = s) = ∇φi (cid:34)T −1 ∑︁ t =0 log P (st +1|st , at ) + T −1 ∑︁ t =0 = T −1 ∑︁ t =0 ∇φi log πi φi (at |st ). log πi φi (at |st ) + T −1 ∑︁ t =0 (cid:35) log π −i φ −i (at |o−i t ) (C.7) Similarly, we have ∇φ log Dπφ (τ |s0 = s) = (cid:205)T −1 of Lemma A.1. t =0 ∇φ log πφ (at |st ). The remaining of the proof based on (C.7) is exactly the same as the proof □ In the light of Lemma C.1, we replace Lemma 4.1 by the following Lemma C.2 for the gradient of regularized state-value function based on the incentivized reward. Lemma C.2. In an incentive regularized Markov game G ′ θ , we have ∇θV (i) πφ (s; θ ) = ∇θV i πφ (s; θ ); log πi t =0  T −1  ∑︁ (cid:169)  (cid:173)  (cid:173)   (cid:171)  T −1 ∑︁ γt (cid:169) (cid:173) (cid:173) (cid:171) γt ∇φi log πi φi (ai t |st ) − (cid:35) ; φi (ai t |st ) 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) ∇φi log πi φi (ai t |st ) (cid:33) (cid:32)T −1 ∑︁ t =0 (cid:170) (cid:174) (cid:174) (cid:172) ∇φiV (i) πφ (s; θ ) = ∇φiV i πφ (s; θ ) − λEτ∼Dπφ + θφiV (i) ∇2 πφ (s; θ ) = ∇2 θφiV i πφ (s; θ ); φφiV (i) ∇2 πφ (s; θ ) = ∇2 φφiV i πφ (s; θ ) −λEτ∼Dπφ t =0 (cid:32)T −1 ∑︁ t =0        (cid:33) ∇φi log πi φi (ai t |st ) ∇φ log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i ∇φ log π j φ j (a j ∇φi log πi φi (ai t |st ) (cid:33) ⊺ ∇φ log πφ (at |st ) (cid:33) (cid:32)T −1 ∑︁ t =0 ⊺ (cid:170) (cid:174) (cid:174) (cid:172) t |st )(cid:170) (cid:174) (cid:174) (cid:172) γt (cid:169) (cid:173) (cid:173) (cid:171) T −1 ∑︁ (cid:169) (cid:173) (cid:173) t =0 (cid:171) (cid:32)T −1 ∑︁ t =0 (cid:170) (cid:174) (cid:174) (cid:172) (cid:32)T −1 ∑︁ t =0 T −1 ∑︁ + (cid:169) (cid:173) (cid:173) (cid:171) T −1 ∑︁ + (cid:169) (cid:173) (cid:173) t =0 (cid:171) (cid:32)T −1 ∑︁ + t =0 γt (cid:169) (cid:173) (cid:173) (cid:171) log πi φi (ai t |st ) − γt (cid:169) (cid:173) (cid:173) (cid:171) 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) log πi φi (ai t |st ) − log π j φ j (a j ∑︁ j =1,...,N j ≠i γt ∇φi log πi φi (at |st ) ∇φ log πφ (at |st) + 1 N − 1 (cid:33) (cid:32)T −1 ∑︁ t =0 ∇2 φφi log πφ (ai t |st ) (cid:33) γt ∇2 φφi log πφ (at |st ) (cid:33)(cid:35) (cid:170) t |st )(cid:170) (cid:174) (cid:174) (cid:174) (cid:174) (cid:172) (cid:172) (cid:32)T −1 ∑︁ (cid:33) ⊺ t =0 t =0 Proof for Lemma C.2. Recall the definition of V (i) πφ (s; θ ) in (C.3), we have, V (i) πφ (s; θ ) = Eτ∼Dπφ = Eτ∼Dπφ (cid:34)T −1 ∑︁ t =0  T −1  ∑︁      t =0 γt *r (i) π (st , ai t , a−i t (cid:35) ; θ )|s0 = s γt *ri π (st , ai t , a−i t ; θ ) − λ T −1 ∑︁ t =0 γt (cid:169) (cid:173) (cid:173) (cid:171) log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) = V i πφ (s; θ ) − λEτ∼Dπφ  T −1  ∑︁      t =0 γt (cid:169) (cid:173) (cid:173) (cid:171) log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) |s0 = s .        |s0 = s        (C.8) For easy notation, we define U i πφ (s) = Eτ∼Dπφ  T −1  ∑︁      t =0 φi (ai t |st ) − γt (cid:169) log πi (cid:173) (cid:173) (cid:171) 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) |s0 = s .        Then we have, ∇θU i πφ (s) =0; ∇φiU i πφ (s) =∇φi ∑︁ = τ t =0 ∇θφiU i πφ (s) =0; ∇φφiU i πφ (s) = ∇φ ∑︁ τ        Dπφ (τ |s0 =s) T −1 ∑︁ t =0 γt (cid:169) (cid:173) (cid:173) (cid:171) log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172)        Dπφ (τ |s0 =s) log Dπφ (τ |s0 =s) ∇φi        γt ∇φi log πi (cid:35) φi (ai t |st ) log πi φi (ai t |st ) − T −1 ∑︁ t =0 γt (cid:169) (cid:173) (cid:173) (cid:171) + T −1 ∑︁ t =0 T −1 ∑︁ (cid:169) (cid:173) (cid:173) (cid:171) T −1 ∑︁ t =0 =Eτ∼Dπφ        log πi φi (ai t |st ) − γt (cid:169) (cid:173) (cid:173) (cid:171) + γt ∇φi log πi φi (ai t |st ) 1 N − 1 ∑︁ j =1,...,N j ≠i (cid:35) ; log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) ∇φi log πi φi (ai t |st ) (cid:33) (cid:32)T −1 ∑︁ t =0 (cid:170) (cid:174) (cid:174) (cid:172) (cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32) (cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32) ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) ∇φi log πi φi (ai t |st ) (cid:32)T −1 ∑︁ t =0 (cid:170) (cid:174) (cid:174) (cid:172) (cid:123) (cid:33)       (cid:122) + ∇φ (cid:124) τ        ∑︁ T −1 ∑︁ Dπφ (τ |s0 = s) (cid:169) (cid:173) (cid:173) (cid:171) Dπφ (τ |s0 = s) (cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32) ∑︁ t =0 (cid:34) τ T −1 ∑︁ log πi φi (ai t |st ) − γt (cid:169) (cid:173) (cid:173) (cid:171) γt ∇φi log πi t |st ) (cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32)(cid:32) φi (ai t =0 (cid:123)(cid:122) := (II ) := (I ) (cid:125)(cid:124) 1 N − 1 (cid:35) . (cid:125) (C.9) (C.10) (C.11) (C.12) Next we are going to compute (I) and (II). (I ) = ∑︁ τ T −1 ∑︁ Dπφ(τ |s0 =s)(cid:169) (cid:173) (cid:173) (cid:171) t =0 ∑︁ + τ Dπφ (τ |s0 = s)∇φ ∑︁ = τ T −1 ∑︁ Dπφ(τ |s0 = s)(cid:169) (cid:173) (cid:173) t =0 (cid:171) ∑︁ + Dπφ (τ |s0 = s) τ γt (cid:169) (cid:173) (cid:173) (cid:171)        γt (cid:169) (cid:173) (cid:173) (cid:171) (cid:32)T −1 ∑︁        log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j (cid:32)T −1 ∑︁ (cid:170) t |st )(cid:170) (cid:174) (cid:174) (cid:174) (cid:174) (cid:172) (cid:172) t =0 ∇φi logπi φi (ai (cid:33) t |st) ∇φ log Dπφ (τ |s0 = s)⊺ T −1 ∑︁ (cid:169) (cid:173) (cid:173) (cid:171) t =0 γt (cid:169) (cid:173) (cid:173) (cid:171) log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) ∇φi log πi φi (ai t |st ) (cid:32)T −1 ∑︁ t =0 (cid:170) (cid:174) (cid:174) (cid:172) log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j (cid:32)T −1 ∑︁ (cid:170) t |st )(cid:170) (cid:174) (cid:174) (cid:174) (cid:174) (cid:172) (cid:172) t =0 ∇φi log πi φi (ai t |st) (cid:33)(cid:32)T −1 ∑︁ t =0 (cid:33)       (cid:33) ⊺ ∇φ log πφ (at |st) ∇φi log πi φi (ai t |st ) (cid:33) T −1 ∑︁ (cid:169) (cid:173) (cid:173) (cid:171) t =0 γt (cid:169) (cid:173) (cid:173) (cid:171) ∇φ log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i ∇φ log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) ∇2 φφi log πφ (ai t |st ) (cid:32)T −1 ∑︁ t =0 (cid:170) (cid:174) (cid:174) (cid:172) t =0 T −1 ∑︁ + (cid:169) (cid:173) (cid:173) (cid:171) t =0 γt (cid:169) (cid:173) (cid:173) (cid:171) ⊺ (cid:170) (cid:174) (cid:174) (cid:172) (cid:33)       (cid:33) ⊺   =Eτ∼Dπφ      T −1 ∑︁ (cid:169) (cid:173) (cid:173) (cid:171) t =0 log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) ∇φi log πi φi (ai t |st ) (cid:33) (cid:32)T −1 ∑︁ t =0 (cid:32)T −1 ∑︁ t =0 (cid:170) (cid:174) (cid:174) (cid:172) ∇φ log πφ (at |st ) ∇φi log πi φi (ai t |st ) (cid:33) T −1 ∑︁ (cid:169) (cid:173) (cid:173) t =0 (cid:171) γt (cid:169) (cid:173) (cid:173) (cid:171) ∇φ log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i ∇φ log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) ⊺ (cid:170) (cid:174) (cid:174) (cid:172) log πi φi (ai t |st ) − 1 N − 1 ∑︁ log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) (cid:170) (cid:174) (cid:174) (cid:172) (cid:32)T −1 ∑︁ t =0 (cid:33) ⊺ ∇2 φφi log πφ (ai t |st ) ; (cid:33)       j =1,...,N j ≠i (cid:33) (cid:32)T −1 ∑︁ t =0 (II ) = ∑︁ τ Dπφ (τ |s0 = s) γt ∇φi log πi φi (at |st ) ∇φ log πφ (at |st ) γt (cid:169) (cid:173) (cid:173) (cid:171) (cid:32)T −1 ∑︁ t =0 + T −1 ∑︁ + (cid:169) (cid:173) (cid:173) t =0 (cid:171) γt (cid:169) (cid:173) (cid:173) (cid:171) (cid:34)(cid:32)T −1 ∑︁ t =0 + (cid:32)T −1 ∑︁ (cid:33)(cid:35) φφi log πφ (at |st ) γt ∇2 t =0 =Eτ∼Dπφ Therefore, (cid:34)(cid:32)T −1 ∑︁ t =0 γt∇φi log πi φi (at |st) ∇φ log πφ (at |st) (cid:33)(cid:32)T −1 ∑︁ (cid:33) ⊺ + (cid:32)T −1 ∑︁ (cid:33)(cid:35) φφi log πφ (at |st) γt ∇2 . t =0 t =0 ∇φφiU i  T −1  ∑︁ (cid:169) πφ (s) = Eτ∼Dπφ  (cid:173)  (cid:173)   (cid:171)  t =0 γt (cid:169) (cid:173) (cid:173) (cid:171) log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) (cid:32)T −1 ∑︁ t =0 (cid:170) (cid:174) (cid:174) (cid:172) ∇φi log πi φi (ai t |st ) + (cid:32)T −1 ∑︁ t =0 ∇φi log πi φi (ai t |st ) (cid:33) T −1 ∑︁ (cid:169) (cid:173) (cid:173) t =0 (cid:171) γt (cid:169) (cid:173) (cid:173) (cid:171) ∇φ log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i ∇φ log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) ⊺ (cid:170) (cid:174) (cid:174) (cid:172) γt (cid:169) (cid:173) (cid:173) (cid:171) T −1 ∑︁ + (cid:169) (cid:173) (cid:173) t =0 (cid:171) (cid:32)T −1 ∑︁ + t =0 log πi φi (ai t |st ) − log π j φ j (a j ∑︁ j =1,...,N j ≠i γt ∇φi log πi φi (at |st ) ∇φ log πφ (at |st) + 1 N − 1 (cid:33) (cid:32)T −1 ∑︁ t =0 (cid:32)T −1 ∑︁ ∇2 φφi log πφ (ai t |st ) (cid:33) γt ∇2 φφi log πφ (at |st ) (cid:33)(cid:35) (cid:170) t |st )(cid:170) (cid:174) (cid:174) (cid:174) (cid:174) (cid:172) (cid:172) (cid:32)T −1 ∑︁ (cid:33) ⊺ t =0 t =0 (cid:33) ⊺ ∇φ log πφ (at |st ) (cid:33) (cid:32)T −1 ∑︁ t =0 (C.13) (C.14) Since (C.8) can be written as then together with (A.2-A.5), we have ∇θV (i) πφ (s; θ ) = ∇θV i πφ (s; θ ); V (i) πφ (s; θ ) = V i πφ (s; θ ) − λU i πφ (s), ∇φiV (i) πφ (s; θ ) = ∇φiV i πφ (s; θ ) − λEτ∼Dπφ φi (ai t |st ) − log πi t =0  T −1  ∑︁ (cid:169)  (cid:173)  (cid:173)   (cid:171)  T −1 ∑︁ γt (cid:169) (cid:173) (cid:173) (cid:171) γt ∇φi log πi + φi (ai t |st ) (cid:35) ; (cid:33) ∇φi log πi φi (ai t |st ) θφiV (i) ∇2 πφ (s; θ ) = ∇2 θφiV i πφ (s; θ ); t =0 φφiV (i) ∇2 πφ (s; θ ) = ∇2 φφiV i πφ (s; θ ) −λEτ∼Dπφ (cid:32)T −1 ∑︁ t =0        t =0 T −1 ∑︁ + (cid:169) (cid:173) (cid:173) (cid:171) T −1 ∑︁ + (cid:169) (cid:173) (cid:173) t =0 (cid:171) (cid:32)T −1 ∑︁ + t =0 γt (cid:169) (cid:173) (cid:173) (cid:171) log πi φi (ai t |st ) − γt (cid:169) (cid:173) (cid:173) (cid:171) 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) (cid:170) (cid:174) (cid:174) (cid:172) log πi φi (ai t |st ) − γt ∇φi log πi φi (at |st ) 1 N − 1 (cid:33) (cid:32)T −1 ∑︁ t =0 ∇φ log π j φ j (a j ∑︁ j =1,...,N j ≠i (cid:33) ⊺ ∇φ log πφ (at |st) (cid:32)T −1 ∑︁ t =0 t |st )(cid:170) (cid:170) (cid:174) (cid:174) (cid:174) (cid:174) (cid:172) (cid:172) (cid:32)T −1 ∑︁ γt ∇2 + t =0 ∇2 φφi log πφ (ai t |st ) (cid:33) (cid:33)(cid:35) φφi log πφ (at |st ) 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) ∇φi log πi φi (ai t |st ) (cid:33) (cid:32)T −1 ∑︁ t =0 (cid:170) (cid:174) (cid:174) (cid:172) γt (cid:169) (cid:173) (cid:173) (cid:171) T −1 ∑︁ (cid:169) (cid:173) (cid:173) t =0 (cid:171) (cid:32)T −1 ∑︁ t =0 ∇φ log πi φi (ai t |st ) − 1 N − 1 ∑︁ j =1,...,N j ≠i ∇φ log π j φ j (a j t |st )(cid:170) (cid:174) (cid:174) (cid:172) ∇φi log πi φi (ai t |st ) (cid:33) ⊺ ∇φ log πφ (at |st ) (cid:33) (cid:32)T −1 ∑︁ t =0 ⊺ (cid:170) (cid:174) (cid:174) (cid:172) □ Extension to partial observations. We first formulate the multi-agent POMDP with incentivized reward. With a light abuse of notation, : S → Ωi is the observation we denote Gθ = (S, {Ai, Ωi, Oi, ri (*; θ )}i ∈ {1,*** ,N }, P, γ), where Ωi is the observation set for agent i, Oi function for agent i, and we denote oi = Oi (s) as the observation of agent i at state s. Other elements in the tuple remain same as in Section 3.2 except for the zero-sum restriction to ri (*; θ ). We define observation-based policy of player i as πi : Ωi × Ai → [0, 1] and parameterize the policy for the player i by φi . Then based on Gθ , we formulate the regularized multi-agent POMDP with incentivized reward πφ (s, ai, a−i ; θ ) = ri (s, ai, a−i ; θ ) −λ log(πi φi (ai |oi )) as G′ and λ ≥ 0. For a trajectory τ = (s0, a0, s1, * * * , aT −1, sT ), where at = (a1 t ), t = 0, * * * ,T , the probability distribution of the trajectory is, θ = (S, {Ai, Ωi, Oi, r (i) (*; θ )}i ∈ {1,*** ,N }, λ, P, γ), where r (i) (s, ai, a−i ; θ ) represents r (i) t , * * * , aN Dπφ (τ) := T −1 (cid:214) t =0 ρ (s0)P (st +1|at , st ) φi (ai πi t |oi t ) (cid:35) , (cid:34) N (cid:214) i=1 where oi t = Oi (st ). In this setting, we replace Lemma C.1 by the following Lemma C.3 for the gradient of state-value function. Lemma C.3. For an incentivized Markov game Gθ = (S, {Ai, Ωi, Oi, ri (*; θ )}i ∈ {1,*** ,N }, P, γ), let Ri (τ; θ ) be the total reward for an sample trajectory τ following πφ for T steps, starting from initial state s0 = s. We have ∇θV i πφ (s; θ ) = Eτ∼Dπφ ∇φiV i πφi (s; θ ) = Eτ∼Dπφ (cid:2)∇θ Ri (τ; θ )|s0 = s(cid:3) , (cid:34) T −1 ∑︁ Ri (τ; θ ) ∇φi log πi φi (at |oi t ) (cid:35) , (cid:12) s0 = s (cid:12) (cid:12) t =0 ∇2 θφiV i πφ (s; θ ) = Eτ∼Dπφ (cid:34)(cid:32)T −1 ∑︁ t =0 ∇φi log πi φi (at |oi t ) (cid:33) ∇θ Ri (τ; θ )⊺(cid:12) s0 = s (cid:12) (cid:12) (cid:35) , ∇2 φφiV i πφ (s; θ ) = Eτ∼Dπφ (cid:34) Ri (τ; θ ) (cid:32) T −1 ∑︁ ( t =0 ∇φi log πi φi (at |oi t ))( ∇φ log πφ (at |ot ))⊺ T −1 ∑︁ t =0 (cid:35) , (cid:12) s0 = s (cid:12) (cid:12) where ∇2 φφi log πφ (at |ot ) (cid:33) + T −1 ∑︁ t =0 φ 1 (at |o1 φ 1 (at |o1 In the light of Lemma C.3, we replace Lemma C.2 by the following Lemma C.4 for the gradient of regularized state-value function based ∇φ log πφ (at |ot ) = (∇φ 1 log π 1 ∇2 φφi log πφ (at |ot ) = (∇2 φ 1φi log π 1 t )), φ N (at |oN t ), * * * , ∇φ N log π N φ N φi log π N φ N (at |oN t ), * * * , ∇2 t )). on partially observed state. Lemma C.4. For a regularized Markov game with incentivized reward G′ θ = (S, {Ai, Ωi, Oi, r (i) (*; θ )}i ∈ {1,*** ,N }, λ, P, γ), we have ∇θV (i) πφ (s; θ ) = ∇θV i πφ (s; θ ); ∇φiV (i) πφ (s; θ ) = ∇φiV i πφ (s; θ ) − λEτ∼Dπφ log πi t =0  T −1  ∑︁ (cid:169)  (cid:173)  (cid:173)   (cid:171)  T −1 ∑︁ γt (cid:169) (cid:173) (cid:173) (cid:171) γt ∇φi log πi + φi (ai t |oi t ) − (cid:35) ; φi (ai t |oi t ) 1 N − 1 ∑︁ j =1,...,N j ≠i log π j φ j (a j t |o j t )(cid:170) (cid:174) (cid:174) (cid:172) ∇φi log πi φi (ai t |oi t ) (cid:33) (cid:32)T −1 ∑︁ t =0 (cid:170) (cid:174) (cid:174) (cid:172) ∇φi log πi φi (ai t |oi t ) (cid:33) ∇φ log πi φi (ai t |oi t ) − 1 N − 1 ∑︁ j =1,...,N j ≠i ∇φ log π j φ j (a j t |o j ⊺ (cid:170) (cid:174) (cid:174) (cid:172) t )(cid:170) (cid:174) (cid:174) (cid:172) log π j φ j (a j t |o j ∇φi log πi φi (ai t |ai t ) (cid:33) ⊺ ∇φ log πφ (at |ot ) (cid:33) (cid:32)T −1 ∑︁ t =0 θφiV (i) ∇2 πφ (s; θ ) = ∇2 θφiV i πφ (s; θ ); t =0 φφiV (i) ∇2 πφ (s; θ ) = ∇2 φφiV i πφ (s; θ ) −λEτ∼Dπφ (cid:32)T −1 ∑︁ t =0        log πi φi (ai t |oi t ) − γt (cid:169) (cid:173) (cid:173) (cid:171) 1 N − 1 ∑︁ j =1,...,N j ≠i t =0 T −1 ∑︁ + (cid:169) (cid:173) (cid:173) (cid:171) T −1 ∑︁ + (cid:169) (cid:173) (cid:173) t =0 (cid:171) (cid:32)T −1 ∑︁ + γt (cid:169) (cid:173) (cid:173) (cid:171) γt (cid:169) (cid:173) (cid:173) (cid:171) T −1 ∑︁ (cid:169) (cid:173) (cid:173) t =0 (cid:171) (cid:32)T −1 ∑︁ t =0 (cid:170) t )(cid:170) (cid:174) (cid:174) (cid:174) (cid:174) (cid:172) (cid:172) (cid:32)T −1 ∑︁ t =0 (cid:170) t )(cid:170) (cid:174) (cid:174) (cid:174) (cid:174) (cid:172) (cid:172) (cid:32)T −1 ∑︁ + log πi φi (ai t |oi t ) − log π j φ j (a j t |o j ∇2 φφi log πφ (ai t |oi t ) ∑︁ j =1,...,N j ≠i 1 N − 1 (cid:33) (cid:32)T −1 ∑︁ (cid:33) ⊺ ∇φ log πφ (at |ot) (cid:33) (cid:33)(cid:35) γt ∇φi log πi φi (at |ot ) γt ∇2 φφi log πφ (at |ot ) t =0 The proofs for Lemma C.3 and C.4 are quite similar to the proofs for C.1 and C.2 with little change on the notation. Therefore, we do not t =0 t =0 discuss the proof in this section. D PEM AND ENTROPY-REGULARIZED OMWU In this section, we are going to briefly state the pseudocode for NE solvers Policy Extragradient Method (PEM) [14] and Entropy-regularized OMWU [13] in this section. D.1 Policy Extragradient Method (PEM) To begin with, we first introduce the entropy-regualrized zero-sum two-player matrix game. max π1 ∈Δ( A1) min π2 ∈Δ( A2) fλ (A; π1, π2) := π ⊺ 1 Aπ2 + λH (π1) − λH (π2), (D.1) where A ∈ Rm×n denotes the payoff matrix, π1 ∈ Δ(A1) and π2 ∈ Δ(A2) stand for the mixed/randomized policies of each player, defined as distributions over the probability simplex Δ(A1) and Δ(A2), H (π) = − (cid:205)i πi log(πi ), and λ is the regularization parameter. Cen [14] proposed two extragradient methods: PU and OMWU with linear convergence guarantees to solve the entropy-regularized zero-sum two-player matrix game (D.1). Algorithm 2 The PU method Initialization: π (0) 1 Parameters: Learning rate ηt for t=0,1,2,... do , π (0) 2 . Update π 1 and π 2 for every action a = (a1, a2) ∈ A = A1 × A2 according to Algorithm 3 The OMWU method 1 , π (0) Initialization: π (0) Parameters: Learning rate ηt for t=0,1,2,... do 1 = π (0) 2 = π (0) 2 . Update π 1 and π 2 for every action a = (a1, a2) ∈ A = A1 × A2 according to π (t +1) 1 π (t +1) 2 (a1) ∝ π (t ) 1 (a2) ∝ π (t ) 2 (a1)1−ηt λ exp(ηt [Aπ (t ) ]a1 ) 2 (a2)1−ηt λ exp(−ηt [A⊺π (t ) 1 ]a2 ) π (t +1) 1 π (t +1) 2 (a1) ∝ π (t ) 1 (a2) ∝ π (t ) 2 (a1)1−ηt λ exp(ηt [Aπ (t ) ]a1 ) 2 (a2)1−ηt λ exp(−ηt [A⊺π (t ) 1 ]a2 ) Update π1 and π2 for every action a = (a1, a2) ∈ A = A1 × A2 according to Update π1 and π2 for every action a = (a1, a2) ∈ A = A1 × A2 according to π (t +1) 1 π (t +1) 2 (a1) ∝ π (t ) 1 (a2) ∝ π (t ) 2 (a1)1−ηt λ exp(ηt [Aπ (t ) 2 ]a1 ) (a2)1−ηt λ exp(−ηt [A⊺π (t ) 1 ]a2 ) π (t +1) 1 π (t +1) 2 (a1) ∝ π (t ) 1 (a2) ∝ π (t ) 2 (a1)1−ηt λ exp(ηt [Aπ (t ) 2 ]a1 ) (a2)1−ηt λ exp(−ηt [A⊺π (t ) 1 ]a2 ) end for end for The Policy Extragradient Method (PEM) is based on the PU and OMWU methods. We provide the pseudocode for PEM (Algorithm 4) below for your reference. Algorithm 4 PEM: Policy Extragradient Method Initialization: Q (0) = 0. for t=0,1,2,...,Tmain do Let Q (t ) denote Q (t ) (s, a1, a2) = r 1 (s, a1, a2) + λEs′∼P ( * |s,a1,a2)V (t ) (s ′) Invode PU (Algorithm 2) or OMWU (Algorithm 3) for Tsub iterations to solve the following entropy-regularized matrix game for every state s, where initial state is set as uniform distribution max π1 (s) ∈Δ( A1) min π2 (s) ∈Δ( A2) fλ (Q (t ) (s); π1 (s), π2 (s)). Return the last iterate π (t,Tsub ) Set V (t +1) (s) = fλ (Q (t ) (s); π (t,Tsub ) (s), π (t,Tsub ) (s). 2 (s), π (t,Tsub ) 2 1 1 (s)). end for D.2 Entropy-regularized OMWU In this section, we provide the pseudocode of Entropy-regularized OMWU method [13]. Algorithm 5 Entropy-regularized OMWU Input: Regularization parameter λ > 0, learning rate for policy update η > 0, learning rate for value update {αt }∞ Initialization: Set π 0 2 as uniform policies; and set 2 and π 0 1 , π 0 1, π 0 t =0. Q (0) = 0, V (0) = λ(log |A1| + log |A2|). for t=0,1,2,... do for all s ∈ S do When t ≥ 1, update policy pair π = (π1, π2) as: π (t +1) 1 π (t +1) 2 Update policy pair π = (π 1, π 2) as: (a1|s) ∝ π (t ) 1 (a2|s) ∝ π (t ) 2 π (t +1) 1 π (t +1) 2 (a1|s) ∝ π (t ) 1 (a2|s) ∝ π (t ) 2 Update Q (t +1) (s) and V (t +1) (s) as (a1|s)1−ηt λ exp(η [Q (t ) (s)π (t ) 2 (a2|s)1−ηt λ exp(−η [Q (t ) (s)π (t ) 1 (s)]a1 ) (s)]a2 ) (a1|s)1−ηt λ exp(η [Q (t ) (s)π (t ) 2 (a2|s)1−ηt λ exp(−η [Q (t ) (s)π (t ) 1 (s)]a1 ) (s)]a2 ) Q (t +1) (s, a1, a2) = r 1 (s, a1, a2) + λEs′∼P ( * |s,a1,a2) [V (t ) (s ′)] V (t +1) (s) = (1 − αt +1)V (t ) (s) + αt +1 [π (t +1) ⊺ 1 Q (t +1) (s)π (t +1) 2 + λH (π (t +1) 1 ) − λH (π (t +1) 2 )] end for end for E CLARIFICATION FOR ASSUMPTION 5.3 Based on the definition f∗ (θ ) = f (θ, φ∗ (θ )), f∗ (θ ) is a composite function consists of f (θ, φ) : Θ × Φ → R and φ∗ (θ ) : Θ → Φ, where Θ and Φ are the feasible areas of incentive parameter θ and policy parameter φ, respectively. Therefore, directly making assumptions for f∗ (θ ) might be aggressive and hard to verified. In this section we give an example that if the loss function f (θ, φ) and value function V (i) πφ (s; θ ) defined in equation (3.3) satisfy proper conditions, the composite function f∗ (θ ) satisfy Assumption 5.3 when the loss function f (θ, φ) and the value functions V (i) πφ (s; θ ) satisfies proper conditions. Assumption 5.3 consists of 2 parts. Firstly, we require the composite function f∗ (θ ) to be bounded. This assumption is mild and easy to satisfy if loss f (θ, φ) is bounded. Secondly, we require f∗ to be L-smooth (∇θ f∗ (θ ) is L-lipschitz continuous). This assumption need to be verified. The following Proposition E.4 provide an exact example that f∗ (θ ) is both bounded and L-smooth. Assumption E.1. Assume that loss function f (θ, φ) : Θ × Φ → R satisfies the following conditions: (1) (Bounded) ∃Mf > 0, such that |f (θ, φ)| ≤ Mf , ∀(θ, φ) ∈ Θ × Φ ⊂ R3. (2) (Lip-continuous) ∃G f > 0, such that ∥∇f (θ, φ)∥2 ≤ G f . ∀(θ, φ) ∈ Θ × Φ ⊂ R3. (3) (Smooth) ∃Lf > 0, such that for ∀(θ1, φ1), (θ2, φ2) ∈ Θ × Φ ⊂ R3 ∥∇f (θ1, φ1) − ∇f (θ2, φ2)∥2 ≤ Lf ∥(θ1, φ1) − (θ2, φ2) ∥2 . Assumption E.2. Assume that the feasible area for θ , φ1, and φ2 are all one-dimensional, which means θ ∈ Θ ⊂ R, φ1 ∈ Φ1 ⊂ R, φ2 ∈ Φ2 ⊂ R and φ = (φ1, φ2) ∈ Φ = Φ1 × Φ1 ⊂ R2. Assume that for arbitrary fixed state s ∈ S, the value functions V (i) πφ (s; θ ) : Θ → R, (i = 1, 2) satisfy the following conditions: (4) (Second-order gradient bounded) ∃Gv > 0, such that for ∀(θ, φ) ∈ Θ × Φ ⊂ R3 and i = 1, 2, (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ Gv, ∂2V (i) πφ (s; θ ) ∂θ ∂φi (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (5) (Third-order gradient bounded) ∃Lv > 0, such that for ∀(θ, φ) ∈ Θ × Φ ⊂ R3 and i = 1, 2, (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∂2V (i) πφ (s; θ ) ∂φ 2 i ∂3V (i) πφ (s; θ ) ∂θ ∂φi ∂φ−i πφ (s; θ ) ∂φi ∂φ−i πφ (s; θ ) ∂θ ∂φ 2 i πφ (s; θ ) ∂θ 2∂φi ∂3V (i) ∂3V (i) ∂2V (i) ≤ Lv, ≤ Gv ≤ Lv and and (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ Gv . ≤ Lv . (6) (Positive definite matrix) ∃ρv > 0, such that for ∀(θ, φ) ∈ Θ × Φ ⊂ R3, ∂2V (1) πφ (s;θ ) ∂φ 2 1 ∂2V (2) πφ (s;θ ) ∂φ2φ1         ∂2V (1) πφ (s;θ ) ∂φ1∂φ2 ∂2V (2) πφ (s;θ ) ∂φ 2 2         ≻ ρvI, where I is the identity matrix. Lemma E.3. Suppose that Assumption E.2 holds. φ∗ (θ ) : Θ → Φ is the mapping from incentive parameter theta θ to policy parameter of Nash policy for regularized MG G′ θ defined in section 3.4. Then we have 2Gv ρv . (i) For ∀θ ∈ Θ, we have ∥∇θ φ∗ (θ )∥F ≤ (ii) For ∀θ1, θ2 ∈ Θ, we have ∥∇θ φ∗ (θ1) − ∇θ φ∗ (θ2)∥F ≤ 2Lv ρv (cid:16)1 + 4Gv + (cid:17) 16G 2 v ρv ∥θ1 − θ2 ∥2, where ∥*∥F is the Frobenius Norm for matrix. Proof. See Appendix E.1. □ Proposition E.4. If Assumption E.1 and E.2 hold, we could conclude that f∗ (θ ) defined in optimization problem (3.8) satisfies the following conditions: (i) (Bounded) |f∗ (θ )| ≤ Mf for ∀θ ∈ Θ. (ii) (Smooth) f∗ (θ ) is L-smooth (∇θ f∗ (θ ) is L-Lipschitz continuous), where L = Lf (1 + 2Gv ρv )(1 + 4Gv ρv ) + 2LvG f ρv (1 + 4Gv + 16G 2 v ρv ). Proof. Firstly, |f∗ (θ )| ≤ Mf is easy to generated from condition (1) since φ ∗ (θ ) ∈ Φ. We are going to focus on showing f∗ (θ ) is L-smooth in the following proof. For ∀θ1, θ2 ∈ Θ, ∥∇θ f∗ (θ1) − ∇θ f∗ (θ2)∥2 = (cid:13) (cid:13)∇θ f (θ1, φ∗ (θ1)) + ∇θ φ∗ (θ1)⊺∇φ f (θ1, φ∗ (θ1)) − ∇θ f (θ2, φ∗ (θ2)) − ∇θ φ∗ (θ2)⊺∇φ f (θ2, φ∗ (θ2))(cid:13) (cid:13)2 ≤ ∥∇θ f (θ1, φ∗ (θ1)) − ∇θ f (θ2, φ∗ (θ2))∥2 + (cid:13) ≤ ∥∇θ f (θ1, φ∗ (θ1)) − ∇θ f (θ2, φ∗ (θ2))∥2 + ∥∇θ φ∗ (θ1)∥F (cid:13)∇θ φ∗ (θ1)⊺∇φ f (θ1, φ∗ (θ1)) − ∇θ φ∗ (θ2)⊺∇φ f (θ2, φ∗ (θ2))(cid:13) (cid:13)2 (cid:13)∇φ f (θ1, φ∗ (θ1)) − ∇φ f (θ3, φ∗ (θ2))(cid:13) (cid:13) (cid:13)2 (E.1) (cid:13)∇φ f (θ2, φ∗ (θ2))(cid:13) + (cid:13) (cid:13)2 ∥∇θ φ∗ (θ1) − ∇θ φ∗ (θ2)∥F We are going to bound three terms in formula (E.1) one by one. i) By the condition (3) in Assumption E.1 and property (i) in Lemma E.3, we have ∥∇θ f (θ1, φ∗ (θ1)) − ∇θ f (θ2, φ∗ (θ2)) ∥2 ≤ ∥∇θ f (θ1, φ∗ (θ1)) − ∇θ f (θ2, φ∗ (θ2))∥2 ≤ Lf ∥(θ1, φ∗ (θ1)) − (θ2, φ∗ (θ2))∥2 ≤ Lf (∥θ1 − θ2 ∥2 + ∥φ∗ (θ1) − φ∗ (θ2)∥2) ≤ Lf (∥θ1 − θ2 ∥2 + max θ ∈Θ ∥∇θ φ∗ (θ ) ∥F ∥θ1 − θ2 ∥2) ≤ Lf (1 + 2Gv ρv ) ∥θ1 − θ2 ∥2 (Condition (3) in Assumption E.1) (Mean value Theorem) (Property (i) in Lemma E.3) (E.2) ii) By property (i) in Lemma E.3 and the condition (3) in Assumption E.1, we have (cid:13)∇φ f (θ1, φ∗ (θ1)) − ∇φ f (θ3, φ∗ (θ2))(cid:13) (cid:13) (cid:13)2 (cid:13)∇φ f (θ1, φ∗ (θ1)) − ∇φ f (θ3, φ∗ (θ2))(cid:13) (cid:13) (cid:13)2 ∥ (θ1, φ∗ (θ1)) − (θ2, φ∗ (θ2))∥2 ∥∇θ φ∗ (θ1)∥F 2Gv ρv 2GvLf ρv 2GvLf ρv (1 + ≤ ≤ ≤ 2Gv ρv (Property (i) in Lemma E.3) (Condition (3) in Assumption E.1) ) ∥θ1 − θ2 ∥2 (E.3) iii) By condition (2) in Assumption E.1 and property (ii) in Lemma E.3, we have (cid:13)∇φ f (θ2, φ∗ (θ2))(cid:13) (cid:13) (cid:13)2 ∥∇θ φ∗ (θ1) − ∇θ φ∗ (θ2)∥F ≤G f ∥∇θ φ∗ (θ1) − ∇θ φ∗ (θ2)∥F (cid:18) 2LvG f ρv ≤ 1 + 4Gv + (cid:19) 16G 2 v ρv ∥θ1 − θ2 ∥2 Combine inequalities (E.1-E.4), we could get (Condition (2) in Assumption E.1) (Property (ii) in Lemma E.3) (E.4) ∥∇θ f∗ (θ1) − ∇θ f∗ (θ2)∥2 ≤ Lf (1 + 2Gv ρv )(1 + 4Gv ρv ) + 2LvG f ρv (1 + 4Gv + 16G 2 v ρv ) ∥θ1 − θ2 ∥2 We already prove that f∗ (θ ) is L-smooth with L = Lf (1 + 2Gv ρv )(1 + 4Gv ρv ) + 2LvG f ρv (1 + 4Gv + 16G 2 v ρv ). (E.5) □ E.1 Proof for Lemma E.3 Proof for Lemma E.3. When conditions (4-6) in Assumption E.2 hold for V (i) (4-6) also hold for Ev (∗) V (i) properties one by one. πφ (s; θ ). For notation simplicity, we denote Ev (∗) V (i) πφ (s; θ ) on every state s ∈ S, it is obvioud that conditions πφ (s; θ ) := V i (θ, φ) in this section. We are going to prove 2 i) Firstly, we are going to bound ∥∇θ φ∗ (θ ) ∥F . For arbitrary θ ∈ Θ and φ ∈ Φ, since φ1 ∈ R, φ2 ∈ R and φ = (φ1, φ2) ∈ R2, formula (4.3-4.4) in section 4 could be written as ∇θuθ (φ) = ∂2V 1 (θ,φ) ∂θφ1 ∂2V 2 (θ,φ) ∂θφ2             ∈ R2×1, ∇φuθ (φ) = ∂2V 1 (θ,φ) ∂φ 2 1 ∂2V 2 (θ,φ) ∂φ1∂φ2       ∂2V 1 (θ,φ) ∂φ1∂φ2 ∂2V 1 (θ,φ) ∂φ 2 2       ∈ R2×2 (E.6) By formula (4.5) in Lemma 4.2 and condition (4, 6) in Assumption E.2, we have ∂2V 1 (θ,φ) ∂φ 2 1 ∂2V 2 (θ,φ) ∂φ1∂φ2 ∂2V 1 (θ,φ) ∂φ1∂φ2 ∂2V 1 (θ,φ) ∂φ 2 2 ∂2V 1 (θ,φ) ∂φ 2 1 ∂2V 2 (θ,φ) ∂φ1∂φ2 ∂2V 1 (θ, φ) (cid:18)(cid:12) (cid:12) (cid:12) ∂θφ1 (cid:12) ∂2V 1 (θ,φ) ∂φ1∂φ2 ∂2V 1 (θ,φ) ∂φ 2 2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) + (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)F ∂2V 1 (θ,φ) ∂θφ1 ∂2V 2 (θ,φ) ∂θφ2       ∂2V 1 (θ,φ) ∂θφ1 ∂2V 2 (θ,φ) ∂θφ2 −1             −1 (cid:13) (cid:13)  (cid:13) (cid:13)   (cid:13) (cid:13)   (cid:13) (cid:13)   (cid:13) (cid:13)   (cid:13) (cid:13)  F   ∂2V 2 (θ, φ) (cid:12) (cid:12) (cid:12) ∂θφ2 (cid:12) (cid:19) (cid:13)∇θ φ ∗ (θ )(cid:13) (cid:13) (cid:13)F ≤ ≤ ≤ ≤       (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)  (cid:13)  (cid:13)  (cid:13)  (cid:13) (cid:13)   1 ρv 2Gv ρv (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)F       (Condition (6) in Assumption E.2) (Condition (4) in Assumption E.2) (E.7) ii) Secondly, we are going to bound ∥∇θ φ∗ (θ1) − ∇θ φ∗ (θ2)∥F . For ∀θ1, θ2 ∈ Θ, ∥∇θ φ∗ (θ1) − ∇θ φ∗ (θ2)∥F = ≤ (cid:13) ∇θuθ1 (φ∗ (θ1)) − (cid:2)∇φuθ2 (φ∗ (θ2))(cid:3) −1 (cid:2)∇φuθ1 (φ∗ (θ1))(cid:3) −1 (cid:13) (cid:13) (cid:2)∇φuθ1 (φ∗ (θ1))(cid:3) −1(cid:13) (cid:13) (cid:13)∇θuθ1 (φ∗ (θ1)) − ∇θuθ2 (φ∗ (θ2))(cid:13) (cid:13) (cid:13) (cid:13) (cid:13)F (cid:13)F (cid:13) (cid:13) (cid:2)∇φuθ1 (φ∗ (θ1))(cid:3) −1 (cid:13)∇θuθ2 (φ∗ (θ2))(cid:13) + (cid:13) (cid:13) (cid:13)F (cid:13) − (cid:2)∇φuθ2 (φ∗ (θ2))(cid:3) −1(cid:13) (cid:13) (cid:13)F ∇θuθ2 (φ∗ (θ2)) By Condition (6) we have By Condition (4) we have (cid:13) (cid:13) (cid:13) (cid:2)∇φuθ1 (φ∗ (θ1))(cid:3) −1(cid:13) (cid:13) (cid:13)F ≤ 1 ρ . (cid:13)∇θuθ2 (φ∗ (θ2))(cid:13) (cid:13) (cid:13)F ≤ ∂2V 1 (θ2, φ∗ (θ2)) ∂θφ1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) + ∂2V 2 (θ2, φ∗ (θ2)) ∂θφ2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ 2Gv . (cid:13) (cid:13) (cid:13)F (E.8) (E.9) (E.10) By Condition (5) we have (cid:13) (cid:13)∇θuθ1 (φ∗ (θ1)) − ∇θuθ2 (φ∗ (θ2))(cid:13) (cid:13)F ≤ (cid:12) (cid:12) (cid:12) (cid:12) − ∂2V 1 (θ1, φ∗ (θ1)) ∂θφ1 ∂3V 1 (θ1, φ∗ (θ1)) ∂θ 2φ1 (cid:12) (cid:12) (cid:12) (cid:12) ≤2Lv ∥θ1 − θ2 ∥ . ≤ max θ,φ ∂2V 1 (θ2, φ∗ (θ2)) ∂θφ1 (cid:12) (cid:12) (cid:12) (cid:12) + (cid:12) (cid:12) (cid:12) (cid:12) ∥θ1 − θ2 ∥2 + max θ,φ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∂2V 2 (θ1, φ∗ (θ1)) ∂θφ2 ∂3V 2 (θ1, φ∗ (θ1)) ∂θ 2φ2 − ∂2V 2 (θ2, φ∗ (θ2)) ∂θφ2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∥θ1 − θ2 ∥2 Last but not least, (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) =       (cid:2)∇φuθ1 (φ∗ (θ1))(cid:3) −1 ∂2V 1 (θ1,φ∗ (θ1)) ∂φ 2 1 ∂2V 2 (θ1,φ∗ (θ1)) ∂φ1∂φ2 − (cid:2)∇φuθ2 (φ∗ (θ2))(cid:3) −1(cid:13) (cid:13) (cid:13)F ∂2V 1 (θ1,φ∗ (θ1)) ∂2V 1 (θ2,φ∗ (θ2)) ∂φ 2 ∂φ1∂φ2 1 ∂2V 2 (θ2,φ∗ (θ2)) ∂2V 2 (θ1,φ∗ (θ1)) ∂∂φ 2 ∂φ1∂φ2 2 −1 −             For notation simplicity we denote ∂2V 1 (θ2,φ∗ (θ2)) ∂φ1∂φ2 ∂2V 2 (θ2,φ∗ (θ2)) ∂∂φ 2 2 −1(cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)F       a1 = a2 = , b1 = , b2 = ∂2V 1 (θ1, φ∗ (θ1)) ∂φ 2 1 ∂2V 1 (θ2, φ∗ (θ2)) ∂φ 2 1 (cid:18) (cid:20)a1 c1 b1 d1 (cid:21) (cid:19) ∂2V 1 (θ1, φ∗ (θ1)) ∂φ1∂φ2 ∂2V 1 (θ2, φ∗ (θ2)) ∂φ1∂φ2 (cid:18) (cid:20)a2 c2 b2 d2 (cid:21) (cid:19) M1 = det , M2 = det , c1 = , c2 = ∂2V 2 (θ1, φ∗ (θ1)) ∂φ1∂φ2 ∂2V 2 (θ2, φ∗ (θ2)) ∂φ1∂φ2 , d1 = , d2 = ∂2V 2 (θ1, φ∗ (θ1)) ∂∂φ 2 2 ∂2V 2 (θ2, φ∗ (θ2)) ∂∂φ 2 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) . (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Therefore, we have = ≤ We are first going to bound (cid:12) (cid:12) (cid:12) a1 M1 − a2 M2 By Condition (6), we have By Condition (5) we have By Condition (4) we have Similarly, by Condition (4,5) we have (cid:21) (cid:2)∇φuθ1 (φ∗ (θ1))(cid:3) −1 1 M1 a1 M1 (cid:20) d1 −c1 a2 M2 −b1 a1 (cid:12) (cid:12) (cid:12) (cid:12) b1 M1 (cid:12) (cid:12) (cid:12) (cid:12) − − − + − (cid:2)∇φuθ2 (φ∗ (θ2))(cid:3) −1(cid:13) (cid:13) (cid:13)F 1 −b2 a2 M2 b2 M2 (cid:20) d2 −c2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:21)(cid:13) (cid:13) (cid:13) (cid:13)F (cid:12) (cid:12) (cid:12) (cid:12) c2 M2 c1 M1 d1 M1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) − + + − d2 M2 (cid:12) (cid:12) (cid:12) (cid:12) a1 M1 − a2 M2 (cid:12) (cid:12) (cid:12) (cid:12) ≤ 1 |M1| |a1 − a1| + |a2| |M1M2| |M1 − M2|. |M1| ≥ ρv and |M2| ≥ ρv . |a1 − a1| ≤ Lv ∥θ1 − θ2 ∥2 . |a2| ≤ Gv . |M1 − M2| =|a1d1 − b1c1 − a2d2 + b2c2| ≤|a1||d1 − d2| + |d2||a1 − a2| + |b1||c1 − c2| + |c2||b1 − b2| ≤4GvLv ∥θ1 − θ2 ∥2 . Combine formula (E.15-E.18) we have (cid:12) (cid:12) (cid:12) (cid:12) a1 M1 a2 M2 (cid:12) (cid:12) (cid:12) (cid:12) − ≤ ( Similarly, we could compute the bound for Lv ρv (cid:12) (cid:12) (cid:12) + Gv ρ2 v × 4GvLv) ∥θ1 − θ2 ∥2 = b1 M1 − b2 M2 (cid:12) , (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) c1 M1 − c2 M2 (cid:12) (cid:12) (cid:12) and (cid:12) (cid:12) (cid:12) d1 M1 (cid:13) (cid:13) (cid:13) (cid:2)∇φuθ1 (φ∗ (θ1))(cid:3) −1 − (cid:2)∇φuθ2 (φ∗ (θ2))(cid:3) −1(cid:13) (cid:13) (cid:13)F ≤ Lv ρv − (1 + 4G 2 v ρv ) ∥θ1 − θ2 ∥2 . d2 M2 (cid:12) (cid:12) (cid:12) . Therefore, we have 4Lv ρv (1 + 4G 2 v ρv ) ∥θ1 − θ2 ∥2 (E.11) (E.12) (E.13) (E.14) (E.15) (E.16) (E.17) (E.18) (E.19) (E.20) Combine formula (E.9,E.10,E.11,E.20) we have ∥∇θ φ∗ (θ1) − ∇θ φ∗ (θ2)∥F ≤ ≤ 1 ρv 2Lv ρv × 2Lv ∥θ1 − θ2 ∥2 + 2Gv × 4Lv ρv (1 + 4G 2 v ρv ) ∥θ1 − θ2 ∥2 (1 + 4Gv + 16G 2 v ρv ) ∥θ1 − θ2 ∥2 . F PROOF FOR THEOREM 5.4 Proof for Theorem 5.4. By Assumption 5.3,the gradient ∇θ f∗ (θ ) is L-Lipschitz continuous implies for ∀k f∗ (θk+1) ≤ f∗ (θk ) + ∇θ f∗ (θk )⊺ (θk+1 − θk ) + L 2 ∥θk+1 − θk ∥2 . Since θk+1 = θk − β∇θ f∗ (θk ), we have θk+1 − θk = −β∇θ f∗ (θk ). Substitute θk+1 − θk in formula F.1, we have f∗ (θk+1) − f∗ (θk ) ≤ − β∇θ f∗ (θk )⊺∇θ f∗ (θk ) + Lβ 2 − 1) ∥∇θ f∗ (θk ) ∥2 . =β ( Lβ 2 ∥∇θ f∗ (θk )∥2 Since the learning rate β = 1 L , substitute β in formula F.2 we have Therefore, summing for k = 0, ...,T for both LHS and RHS of inequality F.3 we have f∗ (θk+1) − f∗ (θk ) ≤ − 1 2L ∥∇θ f∗ (θk ) ∥2 . T ∑︁ [f∗ (θk+1) − f∗ (θk )] ≤ − T ∑︁ ∥∇θ f∗ (θk )∥2 =⇒ 1 2L k=0 Since θ ∗ = arg min θ f∗ (θ ), we have f∗ (θT ) ≥ f∗ (θ ∗). Then k=0 T ∑︁ k=0 ∥∇θ f∗ (θk )∥2 ≤ 2L(f∗ (θ0) − f∗ (θT )) T ∑︁ k=0 ∥∇θ f∗ (θk )∥2 ≤ 2L(f∗ (θ0) − f∗ (θ ∗)) (E.21) □ (F.1) (F.2) (F.3) (F.4) Therefore, since the square of norms are all positive, the minimum of the square of norms must be smaller than the mean of the square of norms. we have min k=0,...,T ∥∇θ f∗ (θk )∥2 ≤ 1 T + 1 T ∑︁ k=0 ∥∇θ f∗ (θk )∥2 ≤ 2L(f∗ (θ0) − f∗ (θ ∗)) T + 1 . By Assumption 5.3, |f∗ (θ )| ≤ M for all θ ∈ Θ and f∗ (θ0) ≥ f∗ (θ ∗), we could conclude f∗ (θ0) − f∗ (θ ∗) = |f∗ (θ0) − f∗ (θ ∗)| ≤ |f∗ (θ0)| + |f∗ (θ ∗)| ≤ 2M. Therefore, min k=0,...,T ∥∇θ f∗ (θk )∥2 ≤ 1 T + 1 T ∑︁ k=0 ∥∇θ f∗ (θk )∥2 ≤ 2L(f∗ (θ0) − f∗ (θ ∗)) T + 1 ≤ 4LM T + 1 . (F.5) (F.6) □ G EXPERIMENTAL DETAILS G.1 DASAC Algorithm 6 DASAC: SAC-based Differentiable Arbitrating in MARL. { ̄α (i) t }t ∈ [0,T−1],i ∈ {1,2}, βk Input:Seq. of stepsize (cid:16) {1, 2}, target entropy for SAC algorithm ̄H . Initialization actor parameter θ0 ∈ Θ, marginalized Q estimator parameter ψ0 ∈ Ψ, and centralized joint Q estimator parameter (namely centralized critic) ξ0 ∈ Ξ. for k=0,1,... do 0, i ∈ {1, 2}, truncation parameters (cid:110) (cid:17), initial regularization parameters λi max, E (i) Q (i) max i ∈ (cid:111) (s, ai ; θk ) ← 0 (i ∈ {1, 2}) Q (i) ψ i 0 for t=0,1... do Sample transitions (st , ui // Update the actor Update policy via minimizing the KL divergence t , u−i t , ri t , st +1) from the replay buffer πi φi t (*|st ; θk ) ← arg min φ ∈Φ (cid:32) DKL πφ ||exp (cid:33)(cid:33) Qψ i t (st , ai t ) (cid:32) 1 λi t // Optimize the centralized joint Q estimator Compute the value function of the next state with the centralized joint Q function t |st +1; θk )) + λ−i t ; θk ) − λi (st +1, ai t log(πφi t , a−i t (ai V cent,(i) t +1 t = Qcent ξ (i ) t log(πφ −i t (a−i t |st +1; θk )) Update the parameter ξi by minimizing (cid:18) t + (1 − is_done)γV cent,(i) ri t +1 − Qcent ξ (i ) t (st , u (i) t , u (−i) t ; θk ) (cid:19)2 // Optimize the marginalized Q estimator Compute the marginalized Q (i) -function from the learned centralized joint Q function (cid:21) (cid:98)Q (i) πφt (s, ai t ; θk ) = E ˆa−i t ∼π −i φt (cid:20) Qcent ξ (i ) t (st , ai t , ˆa−i t ; θk ) Update the estimated ideal energy function (cid:98)Q (i) t +1 (s, ai t ; θk ) =(1 − ̄α (i) t ) * Q (i) φi t (s, ai t ; θk ) + ̄α (i) t * (cid:98)Q (i) πφt (s, ai t ; θk ). Update the parameters ψ of marginalized Q estimator to obtain Q (i) ψ i (s, ai ; θ ) ∈ F : Q (i ) max ψt +1 ← arg min ψ Eσt // Auto-tune the regularization parameters Update the regularization parameters λi (cid:16) ∑︁     i ∈ {1,2}   Q (i) ψ i (s, ai t ;θ ) − (cid:98)E (i) t +1 (s, ai t ;θ ) . (cid:17)2      λi t +1 ← arg min λ Eai t ∼πi φt (cid:104) t log πi λi φt (ai t |st ) − λi t ̄H (cid:105) θk+1 ← θk − βk ∇f∗ (θk ), ψ (∗) (θk ) = ψt +1. end for Update incentive parameter where ∇f∗ (θk ) is defined in (4.6). end for G.2 GridSearch(M) and BayesOpt baselines For comparison, we apply the grid search over the incentive parameters as a zeroth-order algorithm. We first perform a round of coarse- grained grid search, using the same modified MASAC algorithm under the incentive parameters from 0.0 to 0.5 with a step size of 0.05, and then for two games respectively, a round of fine-grained search is applied. For Predator-prey, we do grid search from 0.3 to 0.35 with a step size of 0.005 while we search from 0.35 to 0.4 with the same step size for Running-with-scissors. For the improved zeroth-order baseline, BayesOpt, we use the most popular expected improvement (EI) as the acquisition function and use L-BFGS-B method to maximize the acquisition function with a random start point in order to compute the next sampling point. G.3 Implementation Details G.3.1 Computation Resources. We conduct our experiments on one NVIDIA GeForce RTX 3090 GPU with 24 GB GDDR6X memory. We implement our codes on the PyTorch framework with CUDA acceleration, which we can run in parallel on one GPU card. G.3.2 Hyper-parameters. Hyper-parameter initialization method num GRU layers Actor MLP hidden state dim Actor RNN hidden state dim Critic MLP&RNN hidden state dim num FC after optimizer optimizer eps weight decay activation function use reward normalization episode length last action layer gain batch size buffer size gamma epsilon epsilon anneal time Q function loss initial regularization parameter target entropy coefficient Value orthogonal 1 32 16 64 1 Adam 1e-5 0 ReLU true 25 0.01 64 5000 0.99 from 1.0 to 0.05 50000 MSE loss 1 0.3 Table 1: Hyper-parameters used in our experiments by DASAC. Meichen Song*„ Feng GaoâĂą, Boyi Liu, Zhaoran Wang, Yi Wu„
http://arxiv.org/abs/2302.11992v1
2023-02-20T15:57:56
2023-02-20T15:57:56
Solving Recurrent MIPs with Semi-supervised Graph Neural Networks
We propose an ML-based model that automates and expedites the solution of MIPs by predicting the values of variables. Our approach is motivated by the observation that many problem instances share salient features and solution structures since they differ only in few (time-varying) parameters. Examples include transportation and routing problems where decisions need to be re-optimized whenever commodity volumes or link costs change. Our method is the first to exploit the sequential nature of the instances being solved periodically, and can be trained with ``unlabeled'' instances, when exact solutions are unavailable, in a semi-supervised setting. Also, we provide a principled way of transforming the probabilistic predictions into integral solutions. Using a battery of experiments with representative binary MIPs, we show the gains of our model over other ML-based optimization approaches.
[ "Konstantinos Benidis", "Ugo Rosolia", "Syama Rangapuram", "George Iosifidis", "Georgios Paschos" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11992v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11992v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "math.OC", "@scheme": "http://arxiv.org/schemas/atom" }
[ "math.OC", "cs.LG", "stat.ML" ]
SOLVING RECURRENT MIPS WITH SEMI-SUPERVISED GRAPH NEURAL NETWORKS 3 2 0 2 b e F 0 2 ] C O . h t a m [ 1 v 2 9 9 1 1 . 2 0 3 2 : v i X r a Konstantinos Benidis Amazon Research Berlin, Germany [email protected] Ugo Rosolia Amazon Research Luxembourg [email protected] Syama Rangapuram Amazon Research Berlin, Germany [email protected] George Iosifidis∗ Delft University of Technology Delft, Netherlands [email protected] Georgios Paschos Amazon Research Luxembourg [email protected] ABSTRACT We propose an ML-based model that automates and expedites the solution of MIPs by predicting the values of variables. Our approach is motivated by the observation that many problem instances share salient features and solution structures since they differ only in few (time-varying) parameters. Examples include transportation and routing problems where decisions need to be re-optimized whenever commodity volumes or link costs change. Our method is the first to exploit the sequen- tial nature of the instances being solved periodically, and can be trained with "unlabeled" instances, when exact solutions are unavailable, in a semi-supervised setting. Also, we provide a principled way of transforming the probabilistic predictions into integral solutions. Using a battery of ex- periments with representative binary MIPs, we show the gains of our model over other ML-based optimization approaches. Keywords Graph Neural Networks, Discrete Optimization, Semi-supervised Learning, MIP 1 Introduction The solution of mixed integer programming (MIP) problems is as important as it is challenging to achieve. Indeed, MIP is employed for optimizing real-world operations, decision processes and systems, including transportation [28, 34], facility location [25], production planning [62, 14], content distribution networks [29], all the way to structured predictions [30, 46] and neural network (NN) training [48]. However, despite the success and wide availability of MIP solvers, the fast and accurate optimization of such problems remains largely elusive. This has given rise to perpetual efforts for approximation algorithms [59] and heuristic solutions [37], and for improving the performance of solvers [54]. Nonetheless, an aspect that has received less attention is that several MIP instances share properties and common In fact, practitioners, more often than not, need to solve repeatedly problems that differ only in few structures. parameters, cf. [51, 11]. For example, routing and other transportation problems are re-solved periodically over the same graph whenever new demands or costs are obtained. This motivates the use of ML in order to explore correlations among problem properties and solution values, which in turn can be leveraged to expedite the solution of new instances, enabling their solution even in real-time as an increasing number of applications require [10]. The idea of ML-assisted optimization is not new per se; it has been successfully applied to configure solvers [44], and design heuristics, e.g., in Branch-and-Bound (BnB) techniques [31]. Importantly, recent studies focused on learning problem structures towards predicting (some) variables [31, 19, 52, 39] and/or active constraints [10, 11], with promising results – we review them in Sec. 2. ∗Work done while at Amazon. In this work we make several steps towards the latter direction by developing an ML-based method for facilitating the solution of binary MIPs which (might) exhibit temporal structure. For example, internet traffic follows a diurnal (and not random) pattern [47, 27]; and the same holds for a plenitude of transportation problems [49]. Motivated by these observations, we propose MIPnet, a Long Short-Term Memory (LSTM)-based probabilistic variable-prediction model [56] that operates on a permutation and scale-invariant embedding space created by a Graph Convolutional Network (GCN) [8]. The GCN exploits the intuitive bipartite graph MIP representation [31, 52], towards encoding the problems' salient properties without manual feature engineering. Furthermore, unlike prior works, MIPnet employs semi-supervised learning to augment the training data without computational costs, while still benefiting from the robustness of supervised learning when possible. And including this unsupervised loss provides additional gains. Namely, not all variables have the same impact on the MIP's objective and on constraint violation. Indeed, misprediction of some variables can render the problem infeasible, while others affect only the objective (and to different extent). Clearly, while a model using only supervised loss cannot discern such conditions, MIPnet can learn these effects with per-variable granularity, and mitigate their impact accordingly. Our goal is to predict a significant portion of the binary variables so as to facilitate the optimization of the remaining (binary and continuous) variables. The selection of these variables is based on a confidence metric following a principled Bayesian approach that enables tunable variable selection without (expensive) model re-training. MIPnet is evaluated through a battery of experiments, using both real and synthetic traces, and in diverse real-world problems that include network routing, facility location and TSP, among others. These are representative problems in operational research, and have been used in prior works [10, 11, 52, 19] and references therein. The experiments reveal significant gains over these previous works in terms of variable prediction accuracy, while maintaining high constraint feasibility. We also demonstrate the importance of exploiting the temporal dimension of these problems (whenever it is prevalent), towards improving our predictions. Finally, we stress that we focus on binary MILPs which have applications in a vast range of real-world problems;2 yet, our method paves the road towards tackling general MIPs. In summary, the contributions of this work are: • We propose MIPnet, a GCN-based probabilistic model that learns to solve MIPs and selects the most confident variables based on a principled Bayesian approach. MIPnet speeds up significantly the solution of general binary MIPs while exploiting, for the first time, any temporal relation across the problem instances. • MIPnet employs semi-supervised learning to benefit from labeled data when available, and remain operative when these are hard to obtain. This hybrid approach further allows the model to identify and prioritize variables that are pivotal for feasibility and optimality. • In a series of experiments, MIPnet is proved to find accurate solutions to a range of different problems, consistently outperforming SotA benchmarks such as [10, 52]. Paper Structure. Sec. 2 reviews the related work and Sec. 3 introduces the model, training and inference approach. Sec. 4 presents the experimental results and Sec. 5 concludes the study. Model and dataset details, and additional experiments are provided as supplementary material. 2 Related work Learning Configurations & Heuristics A first thrust of works learn to tune (hyper) parameters of solvers [22, 23, 50, 44, 4, 6]. For example, [22, 23] leverage local search to identify good configurations and [50] developed a pertinent software library. These suggestions are oblivious to, and hence unable to benefit from, the problem structure. A different approach is to learn heuristics. Many works in this context learn how to select BnB variables [1, 21, 31, 2, 35] or BnB nodes [36, 38], and how to run primal heuristics [20]. Similar ideas are used in cutting planes [7] and in optimization over graphs [16, 40, 41]. On the other hand, [12, 45] (and references therein) learn optimization models via alternative decompositions and problem reformulations. Identifying Substructures The third thrust of related work focuses on learning and exploiting problem substruc- tures. Early efforts include predicting backdoor variables [17, 18], i.e., instantiating key variables to increase the problem's tractability. Similarly, assuming the availability of training data, [51, 43] propose sampling methods for predicting active constraints. Along these lines, [10, 11] builds Optimal Classification Trees and Feedforward NNs to predict active constraints and variables. Similarly, [61] assigns variables using a k-Nearest Neighbours classifier. Finally, [57, 60] use Imitation Learning and RL for splitting ILPs. These works do not employ richer (and more promising) problem representations, nor they design bespoke NN architectures for the problems at hand. 2E.g., 164 of 240 benchmarks in [33] are binary/integer LPs; while 90% of variables are binary in the rest. 2 Benidis et al. Employing GCNs To that end, [31, 52, 19] use GCNs where the MIPs are encoded with bipartite graphs. This approach is permutation-invariant, thus can yield generalizable learned policies. In [31] the GCN is used for variable selection in BnB; [52] learns also how to initialize (Neural Diving); and [19] uses cross-entropy loss to predict prob- ability distributions for the binary variables so as to expedite branch exploration. On the other hand, [39] proposes a GNN-based unsupervised approach for graph-related problems, where the integral solution is recovered with deran- domization through sequential decoding. This interesting approach yields feasible solutions with high probability, yet is not applicable to general MIPs. Unlike these works (see overview [9]), MIPnet considers the temporal evolution of problem's parameters; employs semi-supervised learning to reduce the requirement for training datasets; and follows a Bayesian approach to variable selection through learned distributions with tunable confidence and infeasibility penalization. Appendix J includes further comparisons with prior work. 3 Semi-supervised Temporal GCN 3.1 Problem Setting Consider the binary MILP in standard form:3 minimize z cT z subject to Az b, (cid:22) (1) where z = [z(b); z(c)], with z(b) z +D(c) and Dz = D(b) z b RDc (notation details in Appendix A). D(b) z , and z(c) . An instance of (1) is defined by the set of parameters φ = z being the binary and continuous variables, respectively, RDc×Dz , RDz , A 0, 1 } ∈ { ∈ RD(c) , with c c, A, b } { ∈ ∈ S with and t and ̄ ∈ S S ⊆ S We focus on applications where (1) needs to be solved recurrently with different parameters that follow a temporal structure. Consider a set of time series Ts timesteps, where each timestep corresponds to an instance with φs,t}s∈S,t∈Ts, consider their optimal solutions parameters φs,t, with s { s,t}s∈ ̄S,t∈ ̄Ts , with ̄ z(cid:63) Ts ⊆ Ts, i.e., we assume the availability of solution only for a subset of instances. { Our goal is to train a model that learns a globally shared mapping from the problem parameters φs,t to a probabilistic representation p(z(cid:63) s,t) of the optimal solution. Leveraging this mapping, we present a method to select a subset of variables for which the optimal assignment is known with high confidence – the size of the subset is a user-defined parameter. Then, we fix these variables in problem (1) and we solve the resulting lower dimensional sub-problem. As s , the proposed methods is able to expedite shown in the result section, for every new set of instances the computation of the optimal solution. ∈ Ts. For the set of instances φ(cid:48) s,t}s∈S (cid:48),t∈T (cid:48) { ∈ We elaborate next on the model architecture, training and inference procedures. For clarity of exposition we drop the time series and timestep subscripts unless necessary. 3.2 Proposed Method Inspired by [31, 19, 52], we represent an instance of (1) as a bipartite graph by having one node for each variable and constraint, and connecting a variable node to a constraint node iff the variable is active on that constraint. We use a GCN block to map the nodes to an embedding space, followed by an LSTM block to capture the temporal structure of the MILP instances φs,t}s∈S,t∈Ts. The model is trained in a semi-supervised manner, exploiting both a supervised { and an unsupervised component. Two key properties of (1) are the scale and permutation invariance, i.e., the solution of the problem does not change if we scale (appropriately) the problem, or permute its parameters and variables. If a model does not satisfy these prop- erties, it would need to be re-trained for each variation of a problem. Our architecture satisfies both scale invariance by introducing a normalization step and permutation invariance by allowing only symmetric functions among nodes. Parameter Normalization We initially normalize all parameters φ of (1) in order to make the training more stable and the model scale-invariant. This means that the model will learn to solve the problem with parameters drawn from a "base" distribution, and every scaled problem version can be solved just by normalizing the parameters. The normalization needs to ensure that the relative weights of the objective parameters and each constraint remain the same; 3We do not specifically include equality constraints since they can be rewritten as two inequality constraints. 3 therefore we normalize them separately. The normalized parameters Dc, j Dz, are computed as follows: [aT (cid:107) where ai is the i-th row of A. We use p = 2. For problem instances of different sizes the normalization can lead to a distribution shift. We discuss this in Appendix B. [aT (cid:107) (cid:107)p (cid:107)p (cid:107) (2) ai,j = , bi = ai,j i ; bi] i ∀ ≤ , cj = bi i ; bi] ≤ , cj c (cid:107)p , E V V , with = Dz + Dc, the set of edges , A(adj)) defined by the set of nodes Model Architecture. The model builds on the bipartite graph representation of MILPs. Formally, consider a graph equal to the number G = ( R|V|×|V|, of nonzero entries in the constraint matrix A, and the graph adjacency matrix A(adj) = [IDz , AT ; A, IDc ] i.e., the (non-binary) adjacency matrix contains the coefficients from the constraint matrix A and self-loops for all nodes given by the identity matrices. One set of Dz nodes in the bipartite graph corresponds to variables and the other set of Dc nodes to constraints. An edge ei,j ∈ E R|V|×Du derived by the problem parameters The nodes of the graph are associated with a set of features U = U(φ) φ, where Du is the feature dimension. The feature vector of each node is constructed by linearly combining in a permutation invariant way all the variable and constraint parameters that the node is related to. We refer the reader to Appendix C for a detailed description. indicates that variable j appears in the i-th constraint. , with E | |V| ∈ ∈ E | The graph representation of (1) motivates using a GCN [42]. A GCN with L layers is denoted: X(l+1) = g(X(l), A(adj); θ(l) g ), l = 0, . . . , L 1, − ∀ (3) ∈ with X(0) = U and θ(l) Θ the learnable parameters of each layer. The adjacency matrix defines the graph connec- g tivity and determines how information is aggregated at each layer, while the number of layers define the number of hops away that a node gets information from. Note that the GCN is applied to each node in parallel and the resulting embedding is by construction permutation invariant. We follow the GCN propagation rule as defined in [42, 8], with a few (optional) modifications between each layer of the GCN as in [52]: (i) We include a nonlinearity after each layer, (ii) we include skip connection inputs and (iii) we apply layer normalization [5] in the output of each layer. R|V|×Dx is the final embedding of each node which will be used as input The output of the final layer X = X(L) to the next NN block of the model architecture. We use an LSTM network to capture the temporal evolution of (1). The inputs to the LSTM at time t are the embedded nodes X as well as the previous network output hs,t−1, i.e., hs,t = h(hs,t−1, Xs,t−1; θh), with θh ∈ Θ the learnable parameters of the LSTM. The LSTM retains the permutation invariance since it acts on the feature dimension. The network output at time t, i.e., hs,t, is appropriately projected to the parameters of the selected probabilistic representation of each variable using a multilayer perceptron (MLP). In general the projection has the following form: ∈ ψs,t,j = f (xs,t,j, hs,t; θf ), (4) Θ are the learnable MLP parameters and xs,t,j = [Xs,t]j are the embedded features of the j-th variable where θf ∈ node that acts as a skip connection, while the constraint nodes are discarded. Note that the mapping layer can apply any function in the feature dimension of hs,t but only symmetric functions across the node dimension. Here, ψ represents a generic set of parameters for the binary variables that may differ based on the selected model output. If (1) includes continuous variables the model outputs their values and not a distribution, i.e., ψs,t = . In particular, we leverage two MLPs to project the output of the LSTM to the estimates of binary and continuous variables (for a discussion about the prediction of continuous variables please see Appendix D). The probabilistic representation of binary variables becomes concrete in Sec. 3.3. s,t ), ˆz(c) s,t} p(z(b) { 3.3 Training A common characteristic of MILP applications is the difficulty in obtaining labels. Specifically, to obtain one label, one has to solve an instance of the MILP, which depending on the use case may take from minutes to hours or even days. It is therefore of high interest for the generality of MIPnet to be able to train with a semi-supervised loss, exploiting labeled data and benefiting from unlabeled data. Supervised Setting. For the instances that have available labels (optimal solutions) we can train the model with an MLE approach. A natural choice for a probabilistic representation of binary variables is the Bernoulli distribution Ber(z; π) [52, 60], where π is the Bernoulli parameter. Given a Bernoulli representation of a binary variable it is straightforward to assign a value to the variable, but hard to quantify how accurate or confident this prediction is (see Appendix E for a discussion). A different approach was proposed in [52] that used the SelectiveNet [32] and learned 4 Benidis et al. Loss (cid:96)s,t−1 (cid:96)s,t (cid:96)s,t+1 Projection LSTM GCN ψs,t−1 = {p(z(b) s,t−1), ˆz(c) s,t−1} hs,t−1 Xs,t−1; A(adj) s,t−1 Features Us,t−1 Input φs,t−1 ψs,t = {p(z(b) s,t), ˆz(c) s,t} ψs,t+1 = {p(z(b) s,t+1), ˆz(c) s,t+1} hs,t Xs,t; A(adj) s,t Us,t φs,t hs,t+1 Xs,t+1; A(adj) s,t+1 Us,t+1 φs,t+1 Figure 1: MIPnet – At each time step t, we construct the features Us,t of all nodes based on the MILP temporal parameters, feed them into a GCN that produces the final embedding Xs,t. The embeddings are fed to an LSTM whose output is projected to the set of parameters ψs,t and the corresponding loss (cid:96)s,t is computed. two sets of binary variables. One set indicates if a variable is going to be selected and the other its binary value (to be used if selected). Here, we introduce a principled way to define how accurate or confident is a prediction via its own variance. We leverage this notion of variance and follow a Bayesian approach by using the Beta distribution Beta(π; α, β) to model the Bernoulli parameters, where α and β are the parameters of the Beta distribution. This approach can be readily used as a statistically principled selection method, and is a key advantage of our method. (we ignore Now, we elaborate on the model output (4). The model yields the Beta distribution parameters ψ = the continuous variables and drop subscripts), and for each variable with optimal value z(cid:63) the likelihood is computed as (cid:82) 1 0 Beta(π; α, β)Ber(z(cid:63); π)dπ, i.e., we need to integrate over all values of π. Unfortunately this integral does not have a closed-form solution; yet, we can approximate it efficiently using a quadrature method (Monte-Carlo sampling can be also used, but is not as efficient). We use the Clenshaw-Curtis quadrature method [15] where the function to be integrated is evaluated at the K roots of a Chebyshev polynomial and the integral is approximated by a weighted average of the integral's function I(π) = Beta(π; α, β)Ber(z(cid:63); π) in specific and predefined points α, β { } K/2 k=0, i.e., ̄πk} { (cid:90) 1 Beta(π; α, β)Ber(z(cid:63); π)dπ = (cid:90) 1 I(π)dπ wT I( ̄π), ≈ 0 RK/2+1 is independent of the function (precomputed) and I( ̄π) = [I( ̄π0), . . . , I( ̄πK/2)]T . For details of where w ∈ the method we refer the reader to Appendix F.1. With the above formulation the negative log-likelihood (NLL) of all the instances becomes: 0 (cid:96)sup(z(cid:63), ψ) |S| (cid:88) |Ts| (cid:88) Dz(cid:88) ≈ − s=1 t=1 j=1 log (cid:0)wT I( ̄πs,t,j)(cid:1) , (5) where ψ = αs,t, βs,t} . { In Appendix F.2 we propose an additional regularization term, while in Appendix F.3 we describe a weighted version of 5 for imbalanced labels. Unsupervised Setting. Apart from (5) we consider an unsupervised loss that is optimized together and is essentially the objective of (1) with a penalty term for the constraint violations: (cid:96)unsup = |S| (cid:88) |Ts| (cid:88) s=1 t=1 cT s,tˆzs,t + λc (As,tˆzs,t − (cid:107) 2, bs,t)+ (cid:107) (6) (cid:17) , where σ( (cid:16) α α+β 0 and (x)+ = max(x, 0). Here, ˆzs,t represents a prediction based on the learned Beta distribution that is where λc ≥ α+β is the mean of Beta. Applying the sigmoid computed as ˆz = σ to the mean gives values close to the limits that we use as a proxy for the true binary since exact rounding would block the gradient flow. Further, in the unsupervised loss we include the continuous variables that are directly given by the where αs,t, βs,t ∈ network output (4), i.e., ψs,t = The unsupervised loss, as explained earlier, allow us to work with instances for which labels are hard to obtain and, at the same time, provides the means to learn the impact of erroneous predictions (with per-variable granularity) on ) is the sigmoid function and α * αs,t, βs,t, ˆz(c) s,t} { and ˆz(c) s,t ∈ RD(b) RD(c) . z z 5 the objective function and constraint violation. This, in turn, is proved an effective practical control for mitigating the effect of the (few) miss-predictions that MIPnet yields. Note also that the continuous variables are optimized jointly with the binary through this loss. Putting the above together, the overall loss is given by (cid:96) = (cid:96)sup + λ(cid:96)unsup, (7) with λ unsupervised loss. Fig. 1 summarizes the architecture. ≥ 0. Note that if a label is not available, the supervised loss of that instance is masked and we compute only the 3.4 Inference and Variable Selection Our prediction problem is very challenging since it can return an infeasible solution even if it mispredicts only few variables. Hence, instead of targeting an all-or-nothing solution (as in [11], see Table 4), we apply a variable selection method where we generate a recommended assignment for each variable associated with a notion of confidence. By fixing the value of high-confidence variables and calling an MILP solver on the reduced problem, we speed up the discovery of high-quality solutions, as shown also in [19, 52, 11, 61]. Differently to these works however, we take a formal Bayesian approach into this variable selection problem, which additionally, does not require retraining. z z ∈ RD(c) RD(b) and ˆz(c) the model outputs the parameters ψ(cid:48) = Given a trained model and a new instance φ(cid:48) = c, A, b with { } . For each of the D(b) α, β z binary variables we compute the mean and the standard deviation ∈ of its Beta distribution, given by μj = αj (αj +βj )(αj +βj +1) . Since a confident output has mean and σj = αj+βj , and we close to 0 or 1 and low variance, we define the score sj = min(μj, 1 select a desired percentage ρ of the variables with the lowest score. Parameter γ 0 is tuned on a validation set. For a given set of selected variables, we fix their values rounding their mean, and optimize the remaining binary and continuous variables.Following this approach we solve the remaining problem only once, although one has the option to take multiple samples from the learned distribution, solve the remaining problems multiple times and keep the best solution [52]. μj) + γσj, for j = 1, . . . , D(b) α, β, ˆz(c) { αj βj (cid:113) − ≥ } z 4 Experiments We evaluate MIPnet using carefully-selected problems and datasets, as detailed in Appendix G. For the routing prob- lem we used the dataset Geant [53] collecting real-world temporal traffic data from Internet Service Providers; for the facility-loc we used the real-world topology from the nobel-germany dataset [53]; and for the caching problem we used actual requests from the MovieLens datasets [24]. We generated synthetic data for the tsp, energy-grid and revenue-max problems. We ran every experiment 3 times in order to evaluate model variance. Appendices H and I include evaluation details and additional experiments, respectively. 4.1 Evaluating Accuracy & Feasibility We assess the accuracy, optimality and feasibility of MIPnet against various state of the art methods. Namely, we compare our results with Neural Diving (N-div) [52], a GCN model that selects variables using the SelectiveNet approach [32]; the method proposed in [11], an approach that learns a classifier from problem parameters to complete solutions (based on the unique solutions appeared in the training set); and a variant of our model trained only with supervised loss, MIPnet-sup, to evaluate the importance of the unsupervised loss component. As a further ablation, we also evaluate our method when trained only with unsupervised loss which, however, did not achieve satisfactory performance (see Appendix I). As a final method we use the MIP solver SCIP [58]. For all problems expect for routing, SCIP finds an optimal solution for all instances within the 15-minutes time limit. On the other hand for routing, SCIP finds an optimal solution for 99.73% of instances within the 60-minutes time limit, which highlights the problem's complexity. These optimal solutions – and the suboptimal ones when optimals are not available – serve as ground truth, and the results of all other methods are presented relative to them. z binary variables, we fix the (cid:6)ρD(b) For a problem with D(b) (0, 1), and use a solver z for the exact optimization of the remaining subproblem, subject to MIPnet's assignments. Table 1 summarizes the percentage of correct predictions on the assigned variables (accuracy) across all instances, while Table 2 presents the percentage of infeasible instances. Table 3 compares the optimality gap of the different approaches, which is computed using only the set of feasible solutions (denoted with Nf ), and is defined as the average difference between (cid:7) most-confident ones, where ρ ∈ 6 Benidis et al. Table 1: Accuracy (mean ± std)% of MIPnet vs. N-div. Bold indicates the best method (higher values are better). ρ (%) Method routing facility-loc tsp energy-grid revenue-max caching 30% 40% 50% 60% 70% MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div 97.60 ± 0.13 97.60 ± 0.04 84.40 ± 0.72 96.03 ± 0.13 96.01 ± 0.15 87.17 ± 3.68 94.46 ± 0.09 94.46 ± 0.11 89.34 ± 0.11 92.83 ± 0.08 93.15 ± 0.11 90.38 ± 2.55 91.25 ± 0.07 91.86 ± 0.09 90.30 ± 0.92 100.00 ± 0.00 99.88 ± 0.16 100.00 ± 0.00 100.00 ± 0.00 99.87 ± 0.16 99.98 ± 0.02 100.00 ± 0.00 99.79 ± 0.24 99.91 ± 0.03 99.98 ± 0.01 99.71 ± 0.29 99.91 ± 0.02 99.84 ± 0.05 99.41 ± 0.58 99.64 ± 0.06 98.12 ± 1.38 94.56 ± 1.73 93.43 ± 0.00 97.54 ± 1.73 93.97 ± 1.49 96.09 ± 1.76 96.97 ± 1.94 93.42 ± 1.40 95.02 ± 0.54 96.38 ± 2.05 92.96 ± 1.35 95.41 ± 2.61 95.72 ± 2.05 92.62 ± 1.19 93.93 ± 0.84 100.00 ± 0.00 99.97 ± 0.05 100.00± 0.00 100.00 ± 0.00 99.97 ± 0.04 99.20 ± 1.13 99.99± 0.00 99.94 ± 0.03 99.61 ± 0.53 99.96 ± 0.01 99.86 ± 0.13 99.96 ± 0.01 99.80 ± 0.01 99.74 ± 0.14 99.64 ± 0.11 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 Table 2: Infeasibility (mean ± std)% of MIPnet vs. N-div. Bold indicates the best method (lower values are better). ρ (%) Method routing facility-loc tsp energy-grid revenue-max caching 30% 40% 50% 60% 70% MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div 59.09 ± 3.31 61.27 ± 0.04 100.00 ± 0.00 99.97 ± 0.04 99.97 ± 0.04 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.02 ± 0.01 0.11 ± 0.04 7.82 ± 11.06 0.07 ± 0.05 1.03 ± 0.03 0.28 ± 0.40 0.24 ± 0.18 3.78 ± 0.75 5.19 ± 4.19 2.92 ± 3.47 10.83 ± 0.39 19.75 ± 12.90 0.09 ± 0.13 75.52 ± 38.37 31.22 ± 17.52 0.46 ± 0.58 80.79 ± 27.16 0.18± 0.26 2.83 ± 2.78 94.26 ± 8.12 76.14 ± 8.49 13.06 ± 7.82 99.8 ± 0.28 34.07 ± 46.62 48.90 ± 17.19 100.00 ± 0.00 48.23 ± 36.64 0.00 ± 0.00 0.02 ± 0.03 0.00 ± 0.00 0.00 ± 0.00 0.02 ± 0.03 0.00 ± 0.00 0.00 ± 0.00 0.09 ± 0.08 0.09 ± 0.08 0.04 ± 0.03 0.09 ± 0.08 0.04 ± 0.03 0.02 ± 0.03 0.11 ± 0.11 0.04 ± 0.06 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 a method's objective (obj) and SCIP's optimal value (obj∗), i.e., opt_gap = 1 |Nf | the experiments for different ρ values.4 (cid:80) obj∈Nf (obj − obj∗). We repeat We observe that MIPnet matches or outperforms N-div in almost all cases, while it exhibits more consistent be- haviour across runs. Compared to MIPnet-sup, it is either on par or better, especially in feasibility. A notable ob- servation is that accuracy itself is not adequate to validate the performance of a model. For example, in the routing and tsp datasets we observe that accuracy values well-above 90% can lead to (almost) 100% infeasibility; while in facility-loc accuracy values > 99% can yield a significant portion of infeasible instances – especially for MIPnet-sup and N-div. This is associated with the complexity of the constraints and highlights the importance of using an unsupervised component in model training. Since [11] is an approach that selects a complete solution, i.e., there is no option for selecting ρ% of variables, we present the results of this method separately. As shown in Table 4, this all-or-nothing approach learns feasible solutions for tsp, facility-loc, and caching (no variance was observed across runs). In these problems the constraints are time-invariant (do not change across instances). Hence, optimal solutions from the training dataset are feasible for the test dataset, and indeed we see that [11] finds feasible solutions. Alas, these are often far from optimal, e.g., for tsp and caching the average gap is 19.61% and 52.49%, respectively. On the other hand, for revenue-max where the constraints change across instances, optimal solutions from the training dataset are infeasible for new problem instances and the method returns infeasible variable assignments. That is, this approach does not generalize to solutions not seen in the training dataset. Finally, we highlight that we were able to run the approach from [11] only on a smaller version of the routing dataset, which alludes to potential implementation difficulties of this approach – see Appendix I. 4In MIPnet, we can decide a different portion of assigned variables without model retraining. This stands in stark contrast to N-div where the variable selection percentage is predefined. 7 Table 3: Optimality gap (mean ± std)% of MIPnet vs. N-div. Bold indicates the best method (lower values are better). ρ (%) Method routing facility-loc tsp energy-grid revenue-max caching 30% 40% 50% 60% 70% MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div MIPnet MIPnet-sup N-div 6.59 ± 0.15 6.03 ± 0.63 - 6.27 ± 0.00 27.59 ± 0.00 - - - - - - - - - - 0.07 ± 0.01 0.04 ± 0.05 0.28 ± 0.23 0.16 ± 0.01 0.20 ± 0.10 0.44 ± 0.35 0.34 ± 0.03 0.72 ± 0.42 3.55 ± 4.88 0.73 ± 0.10 2.15 ± 1.72 1.22 ± 0.55 2.66 ± 0.72 5.80 ± 5.04 5.83 ± 1.97 0.24 ± 0.02 2.38 ± 0.00 0.25 ± 0.04 0.37 ± 0.07 4.20 ± 0.00 0.26 ± 0.04 0.74 ± 0.19 6.05 ± 0.00 5.70 ± 0.63 1.49 ± 0.30 4.18 ± 0.00 0.48 ± 0.01 2.08 ± 0.17 - 1.79 ± 0.21 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.08 ± 0.04 0.00 ± 0.00 0.00 ± 0.00 8.81 ± 12.45 0.00 ± 0.00 0.01 ± 0.01 0.01 ± 0.00 0.01 ± 0.00 0.01 ± 0.01 0.04 ± 0.03 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 Table 4: Accuracy, infeasibility and optimality gap of [11]. Accuracy Infeasibility Optimality gap routing facility-loc tsp revenue-max caching - 98.13 86.29 99.22 99.91 - 0.00 0.00 100.00 0.00 - 1.78 19.61 - 52.49 4.2 Evaluating the Temporal Component of MIPnet In this section we explore the benefit of leveraging the temporal aspect of the problem instances. Figure 2 illustrates the differences in accuracy and infeasibility when MIPnet employs an MLP instead of an LSTM, for three problems with different temporal properties. Namely, the real-world demands in routing follow a diurnal pattern; the de- mands in facility-loc have a strong time-dimension; while the edge costs in tsp are generated by adding random perturbations in successive instances. We observe that the LSTM-based MIPnet outperforms consistently, and most-often substantially, its MLP-based ver- In other words, all else being equal in the model and inference sion both in terms of mean and variance values. approach, the addition of LSTM has substantial gains, without requiring any compromises (MLP never outperforms LSTM). This finding underlines the importance of leveraging the temporal evolution pattern of the problem parame- ters, a hitherto overlooked aspect in all prior works. 4.3 Trading Off Accuracy and Solution Speed via ρ Finally, we explore how the percentage of assigned variables ρ, affects the solution time. These experiments reveal also the gains of MIPnet in terms of solution speed, compared to off-the-shelf solvers. In detail, we denote with tp the ρ is the percentage of variables that time the SCIP solver requires for solving the optimization problem, where p = 1 are not assigned by MIPnet (hence, need to be optimized by the solver). Figure 3 reports the normalized time defined as the ration tp/t100, i.e., the ratio between the solver (SCIP) time when ρ variables are assigned using MIPnet, and the time for solving the entire problem with SCIP.5 As expected, the time decreases when a higher percentage of variables is assigned. For all problems an average of, at least, 2 speedup is obtained by setting ρ = 0.7, while for revenue-max, energy-grid, and caching we achieve a 2x speedup already for ρ = 0.3, i.e., when assigning only 30% of the variables, and a maximum 5 speed up. These experiments manifest the solution speed gains of MIPnet compared to a solver, and the importance of our variable selection threshold which indeed can be used to trade off accuracy with solution speed. × − × 5 Conclusions Solving MIPs via ML methods can revolutionize the solution of large-scale NP-hard problems and avail MIP to new application domains. This potential is hampered by unprecedented challenges: the values of variables are inherently correlated and need to be jointly predicted; even tiny value assignment errors may lead to infeasibility or unbounded 5These times are calibrated in order to account for the different computational environments we have used in the experiments. 8 Benidis et al. (a) routing (b) facility-loc (c) tsp Figure 2: Comparison of MIPnet w\ and w\o a temporal component. Figure 3: Calibrated running time for various ρ values. tp is the solution time when a percentage ρ of variables is assigned by MIPnet and p = 1 ρ variables are assigned by the solver. t100 is the time when using only the solver. − suboptimality; training data are not readily available; and generalizing trained models is highly non-trivial. In this work, we propose MIPnet, a systematic framework for tackling general binary MILPs that may exhibit temporal structure, which: employs GCNs to automate embeddings and capture correlation among variables; uses an LSTM to account for, hitherto-overlooked, time dependencies across problem instances (a regularly-encountered operational condition); and includes a principled Bayesian assignment strategy with user-tunable confidence. We follow a semi- supervised approach so as to account for the lack of solved instances, a practical limitation when dealing with NP-hard problems, and in order, also, to identify key variables impacting feasibility and optimality. Our work fills (some of) the gaps in the literature and, we believe, contributes towards establishing ML as an off-the-shelf MIP technology, including for non-binary and nonlinear problems that were not addressed by the proposed approach. 9 References [1] A. H. Land, and A. G. Doig. An Automatic Method of Solving Discrete Programming Problems. Econometrica, 28(3):497–520, 1960. [2] A. M. Alvarez. A Machine Learning-based Approximation of Strong Branching. INFORMS Journal on Com- puting, 29(1):185–195, 2017. [3] Akshay Agrawal, Brandon Amos, Shane Barratt, Stephen Boyd, Steven Diamond, and J Zico Kolter. Differen- tiable convex optimization layers. Advances in Neural Information Processing Systems (NeurIPS), 2019. [4] Carlos Ansótegui, Yuri Malitsky, Horst Samulowitz, Meinolf Sellmann, and Kevin Tierney. Model-based genetic In Twenty-Fourth International Joint Conference on Artificial Intelli- algorithms for algorithm configuration. gence, 2015. [5] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. [6] Maria-Florina Balcan, Travis Dick, Tuomas Sandholm, and Ellen Vitercik. Learning to branch. In International Conference on Machine Learning (ICML), pages 344–353, 2018. [7] Maria-Florina F Balcan, Siddharth Prasad, Tuomas Sandholm, and Ellen Vitercik. Sample complexity of tree search configuration: Cutting planes and beyond. Advances in Neural Information Processing Systems (NeurIPS), 2021. [8] Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018. [9] Yoshua Bengio, Andrea Lodi, and Antoine Prouvost. Machine learning for combinatorial optimization: a methodological tour d'horizon. European Journal of Operational Research, 290(2):405–421, 2021. [10] Dimitris Bertsimas and Bartolomeo Stellato. Online Mixed-integer Optimization in Milliseconds. arXiv preprint arXiv:1907.02206, 2019. [11] Dimitris Bertsimas and Bartolomeo Stellato. The Voice of Optimization. Machine Learning, 110(2):249–277, 2021. [12] Pierre Bonami, Andrea Lodi, and Giulia Zarpellon. Learning a classification of mixed-integer quadratic pro- gramming problems. In International Conference on the Integration of Constraint Programming, Artificial In- telligence, and Operations Research, pages 595–604. Springer, 2018. [13] Francesco Borrelli, Alberto Bemporad, and Manfred Morari. Predictive control for linear and hybrid systems. Cambridge University Press, 2017. [14] Zhi-Long Chen. Integrated production and outbound distribution scheduling: review and extensions. Operations research, 58(1):130–148, 2010. [15] Charles W Clenshaw and Alan R Curtis. A method for numerical integration on an automatic computer. Nu- merische Mathematik, 2(1):197–205, 1960. [16] Hanjun Dai, Bo Dai, and Le Song. Discriminative embeddings of latent variable models for structured data. In International conference on machine learning, pages 2702–2711, 2016. [17] Bistra Dilkina, Carla P Gomes, Yuri Malitsky, Ashish Sabharwal, and Meinolf Sellmann. Backdoors to com- In International Conference on Integration of Constraint binatorial optimization: Feasibility and optimality. Programming, Artificial Intelligence, and Operations Research, pages 56–70. Springer, 2009. [18] Bistra Dilkina, Carla P Gomes, and Ashish Sabharwal. Backdoors in the context of learning. In International Conference on Theory and Applications of Satisfiability Testing, pages 73–79. Springer, 2009. [19] Jian-Ya Ding, Chao Zhang, Lei Shen, Shengyin Li, Bing Wang, Yinghui Xu, and Le Song. Accelerating pri- In Proceedings of the AAAI mal solution findings for mixed integer programs based on solution prediction. Conference on Artificial Intelligence, volume 34, pages 1452–1459, 2020. [20] E. B. Khalil, B. Dilkina, G. L. Nemhauser, S. Ahmed, and Y. Shao. Learning to Run Heuristics in Tree Search. In International Joint Conference on Artificial Intelligence (IJCAI), 2017. [21] E. B. Khalil, et al. Learning to Branch in Mixed Integer Programming. In Proceedings of the AAAI conference on artificial intelligence, page 724–731, 2016. [22] F. Hutter, et al. ParamILS: An Automatic Algorithm Configuration Framework. Journal of Artificial Intelligence Research, 36(1), 2009. 10 Benidis et al. [23] F. Hutter, et al. Sequential Model-based Optimization for General Algorithm Configuration. Learning and intelligent optimization, pages 507–523, 2011. [24] F. M. Harper, and J. A. Konstan. The MovieLens Datasets: History and Context. ACM Transactions on Interac- tive Intelligent Systems, 5:19:1–19:2, 2015. [25] R. Z. Farahani and M. Hekmatfar. Facility Location: Concepts, Models, Algorithms and Case Studies. Springer, 2009. [26] Nuno P. Faísca, Vivek Dua, and Efstratios N. Pistikopoulos. Multiparametric Linear and Quadratic Program- ming, chapter 1, pages 1–23. John Wiley & Sons, Ltd, 2007. ISBN 9783527631216. doi: https://doi.org/10.1002/ 9783527631216.ch1. URL https://onlinelibrary.wiley.com/doi/abs/10.1002/9783527631216. ch1. [27] G. Barlacchi, et al. A Multi-source Dataset of Urban Life in the City of Milan and the Province of Trentino. Scientific Data, 2, 2015. [28] G. Laporte. Fifty Years of Vehicle Routing. Transportation Science, pages 408–416, 2009. [29] G. S. Paschos, et al. Cache Optimization Models and Algorithms. Found. Trends Commun. Inf. Theory, 16(3-4): 156–343, 2019. [30] G. Vivek, K. Srikumar, and D. Roth. On amortizing inference cost for structured prediction. Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning, pages 1114–1124, 2012. [31] Maxime Gasse, Didier Chételat, Nicola Ferroni, Laurent Charlin, and Andrea Lodi. Exact combinatorial op- timization with graph convolutional neural networks. Advances in Neural Information Processing Systems (NeurIPS), 2019. [32] Yonatan Geifman and Ran El-Yaniv. Selectivenet: A deep neural network with an integrated reject option. In International Conference on Machine Learning (ICML), pages 2151–2159, 2019. [33] Ambros Gleixner, Gregor Hendel, Gerald Gamrath, Tobias Achterberg, Michael Bastubbe, Timo Berthold, Philipp M. Christophel, Kati Jarck, Thorsten Koch, Jeff Linderoth, Marco Lübbecke, Hans D. Mittelmann, Derya Ozyurt, Ted K. Ralphs, Domenico Salvagnin, and Yuji Shinano. MIPLIB 2017: Data-Driven Compi- lation of the 6th Mixed-Integer Programming Library. Mathematical Programming Computation, 2021. doi: 10.1007/s12532-020-00194-3. URL https://doi.org/10.1007/s12532-020-00194-3. [34] B. Gopalakrishnan and E. L. Johnson. Airline Crew Scheduling: State-of-the-Art. Annals of Operations Re- search, 140(1):305–337, 2005. [35] Christoph Hansknecht, Imke Joormann, and Sebastian Stiller. Cuts, primal heuristics, and learning to branch for the time-dependent traveling salesman problem. arXiv preprint arXiv:1805.01415, 2018. [36] He He, Hal Daume III, and Jason M Eisner. Learning to search in branch and bound algorithms. Advances in Neural Information Processing Systems (NeurIPS), 2014. [37] I. Boussaıd, et al. A Survey on Optimization Metaheuristics. Information Sciences, 237:82–117, 2013. [38] J. Song, R. Lanka, A. Zhao, Y. Yue, and M. Ono. Learning to Search via Retrospective Imitation. In arXiv:1804.00846, 2018. [39] Nikolaos Karalias and Andres Loukas. Erdos goes neural: an unsupervised learning framework for combinatorial optimization on graphs. In Proceedings of NeurIPS, 2020. [40] Elias Khalil, Hanjun Dai, Yuyu Zhang, Bistra Dilkina, and Le Song. Learning combinatorial optimization algo- rithms over graphs. Advances in Neural Information Processing Systems (NeurIPS), 2017. [41] Minsu Kim, Jinkyoo Park, et al. Learning collaborative policies to solve np-hard routing problems. Advances in Neural Information Processing Systems (NeurIPS), 2021. [42] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. [43] Martin Klauˇco, Martin Kalúz, and Michal Kvasnica. Machine learning-based warm starting of active set methods in embedded model predictive control. Engineering Applications of Artificial Intelligence, 77:1–8, 2019. [44] Robert Kleinberg, Kevin Leyton-Brown, Brendan Lucier, and Devon Graham. Procrastinating with confidence: Near-optimal, anytime, adaptive algorithm configuration. Advances in Neural Information Processing Systems (NeurIPS), 2019. 11 [45] Markus Kruber, Marco E Lübbecke, and Axel Parmentier. Learning when to use a decomposition. In Interna- tional conference on AI and OR techniques in constraint programming for combinatorial optimization problems, pages 202–210. Springer, 2017. [46] Alex Kulesza and Fernando Pereira. Structured learning with approximate inference. Advances in Neural Infor- mation Processing Systems (NeurIPS), 2007. [47] Anukool Lakhina, Konstantina Papagiannaki, Mark Crovella, Christophe Diot, Eric D. Kolaczyk, and Nina Taft. Structural analysis of network traffic flows. In Proceedings of ACM Sigmetrics, 2004. [48] Cong Leng, Zesheng Dou, Hao Li, Shenghuo Zhu, and Rong Jin. Extremely low bit neural network: Squeeze the last bit out with ADMM. In Proceedings of the AAAI Conference on Artificial Intelligence, 2018. [49] M. C. Gonzalez, et al. Understanding Individual Human Mobility Patterns. Nature, 453:779–782, 2008. [50] M. Lopez-Ibanez, et al. The Irace Package: Iterated Racing for Automatic Algorithm Configuration. Operations Research Perspectives, pages 43–58, 2016. [51] Sidhant Misra, Line Roald, and Yeesian Ng. Learning for constrained optimization: Identifying optimal active constraint sets. INFORMS Journal on Computing, 34(1):463–480, 2022. [52] Vinod Nair, Sergey Bartunov, Felix Gimeno, Ingrid von Glehn, Pawel Lichocki, Ivan Lobov, Brendan O'Donoghue, Nicolas Sonnerat, Christian Tjandraatmadja, Pengming Wang, et al. Solving mixed integer pro- grams using neural networks. arXiv preprint arXiv:2012.13349, 2020. [53] S. Orlowski, M. Pióro, A. Tomaszewski, and R. Wessäly. SNDlib 1.0–Survivable Network Design Library. In Proceedings of the 3rd International Network Optimization Conference (INOC 2007), Spa, Belgium, April . http://sndlib.zib.de, extended version accepted in Networks, 2009. [54] R. E. Bixby. A Brief History of Linear and Mixed-Integer Programming Compucation. Documenta Mathematica, pages 107–121, 2010. [55] S. Chopra, I. Gilboa, and S. T. Sastry. Source Sink Flows with Capacity Installation in Batches. Discrete Applied Mathematics, 85:165–192, 1998. [56] S. Hochreiter, et al. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997. [57] Jialin Song, Yisong Yue, Bistra Dilkina, et al. A general large neighborhood search framework for solving integer linear programs. Advances in Neural Information Processing Systems (NeurIPS), 2020. [58] T. Achterberg. SCIP: Solving Constraint Integer Programs. Mathematical Programming Computation, 1:1–41, 2009. [59] David Williamson and David Shmoys. The Design of Approximation Algorithms. Cambridge University Press, 2011. [60] Yaoxin Wu, Wen Song, Zhiguang Cao, and Jie Zhang. Learning large neighborhood search policy for integer programming. Advances in Neural Information Processing Systems (NeurIPS), 2021. [61] Alinson S Xavier, Feng Qiu, and Shabbir Ahmed. Learning to solve large-scale security-constrained unit com- mitment problems. INFORMS Journal on Computing, 33(2):739–756, 2021. [62] Y. Pochet, and L. A. Wolsey. Production Planning by Mixed Integer Programming. Springer Science and Business Media, 2006. 12 Benidis et al. Appendix A Notation Supplementary Materials Matrices, vectors and scalars are denoted by uppercase bold, lowercase bold and lowercase normal letters, i.e., X, x and x, respectively. The set of D-dimensional real numbers is defined by RD. x ZD denote vectors of real and integer variables with dimension D. [x; z] and [x, z] indicates column and row concatenation, respectively. XT denotes the transpose of matrix X and [X]j its j-th row. ID and 0D denote the D-dimensional identity and zero matrix, respectively. The number of variables is denoted as Dz and the number of constraints as Dc. We use a hat to indicate a variable prediction, e.g., ˆz. We use the subscript j as a variable index and i as a constraint index. We use uppercase calligraphic and Greek letters to define sets. We denote by a set of time series (indexed by s) and the set of timesteps of time series s (indexed by t). φ represents the set of parameters of an by optimization problem and Θ the set of parameters of a NN. The symbol 1condition denotes the indicator function with value 1 if condition is true and 0 otherwise. KL (p q) denotes the KL-divergence of distributions p and q. RD and z Ts = |Ts|} 1, . . . , ∈ ∈ S { || B Parameter Normalization & Distribution Shift As mentioned in Section 3, the parameter normalization (see Eq. (2)) makes our model scale invariant, i.e., our trained model can be applied to new instances where the magnitudes of the constraint matrix and cost vector are entirely different from what was seen during training. More importantly, our trained model can also be used in solving MIP problems whose sizes (i.e., length of the cost vector Dz) are different from that of training instances. However, during test time, if the problem size grows (or shrinks), the parameters will become smaller (or larger), causing a distribution shift. The distribution shift is caused since in training time with the normalization given in (2) (with p = 2) the parameters aij and bi are proportional to , whereas at test time these would be proportional to , respectively. This can be rectified by a further rescaling of parameters during test time. 1√ Dz+1 , and cj is proportional to and 1√ Dz 1 √ ̄Dz+1 1 √ ̄Dz More precisely, given a model that is trained on instances of size Dz and applied on test instances of size ̄Dz, we normalize the test instance's parameters as (cid:115) ai,j = ̄Dz + 1 Dz + 1 ai,j i ; bi] 2 (cid:107) [aT (cid:107) , (cid:115) bi = ̄Dz + 1 Dz + 1 bi i ; bi] (cid:107) [aT (cid:107) , 2 (cid:115) cj = ̄Dz Dz cj c (cid:107) (cid:107) . 2 (8) This reduces to Eq. (2) (with p = 2), if ̄Dz = Dz. With this normalization, the parameters (ai,j, bi) and cj during test time are also proportional to respectively. 1√ 1√ Dz+1 and Dz Given this normalization, our model can also be trained on MIP instances of different sizes. We just need to fix one size Dz as the reference size and for every instance of different size ̄Dz, the parameters would have a further rescaling as in (8). C Graph Features R|V|×Du , which is An integral part of MIPnet is the creation of the features of each node that form the matrix U fed into the GCN (see Eq. (3)), where Du is the feature dimension. We differentiate the feature construction between variable and constraint nodes. ∈ The set of parameters that the j-th variable is associated with are: (i) its cost in the objective cj, (ii) all its parameters in the constraint matrix A, i.e., aj = [AT ]j and (iii) the right-hand side of the constraints b. Usually the constraint matrix A is sparse, especially for large problems, which means that each variable participates in only a small subset of the constraints. We leverage this observation and we include as relevant features only the subset of constraints that = 0. In particular, we calculate each variable is included, i.e., for the j-th variable we include the constraint i if ai,j (cid:54) the maximum number of constraints that any variable appears, mc, and we keep that many constraint parameters for all variables (so all the feature dimensions are consistent).6 6The maximum number of constraints per variable mc is calculated across the whole dataset. This number can vary in different datasets but this does not affect the model since no operation is done across this dimension. 13 Now, for the j-th variable we construct mc triplets (ai,j, bi, cj), where i in less that mc constraints, i.e., if |Ij| target feature dimension Du using an MLP with parameters learned jointly across all variables: < mc, then we include mc − |Ij| . If a variable is included zero triplets. Each triplet is mapped to the ∈ Ij = = 0 } ai,j (cid:54) i | {   W(var-map),   Vj = f (var-map)(aIj ,j, bIj , cj) = cj ... cj R3×Du is the learnable weight matrix of the MLP and Vj ∈ where W(var-map) all rows using a symmetric function (e.g., average): u(var) j = f (var-agg)(Vj), ai1,j ... aimc ,j bi1 ... bimc   ∈ j RDu . Note that u(var) where u(var) for the variable nodes is constructed by concatenating all the feature vectors u(var) RDz×Du . ∈ j j Rmc×Du . Finally, we aggregate over (9) , i.e., U(var) = [u(var) 1 , . . . , u(var) Dz ] ∈ is variable and constraint permutation invariant. The complete feature matrix The features of the constraints are constructed in a similar manner. The set of parameters that the i-th constraint is associated with are: (i) all its parameters in the constraint matrix A, i.e., ai = [A]i (ii) the right-hand side of the constraint bi and (iii) the costs in the objective c for the variables in the constraint. As in the variable nodes, we leverage the sparsity of A and find the maximum number of variables in all the constraints, mv. Now, for the i-th constraint we create mv triplets (ai,j, bi, cj), where j . The triplets are projected to the target = 0 ∈ Ji = } dimension Du and then aggregated in the same way as the variable features:  j : ai,j (cid:54) { Ci = f (con-map)(ai,Ji, bi, cJi) =   ai,j1 bi ... ... ai,jmv bi = f (con-agg)(Ci),   W(con-map),  cj1 ... cjmv ∈ u(con) i R3×Du is the learnable weight matrix of the MLP, Ci ∈ , i.e., U(con) = [u(con) RDu . Note is variable and constraint permutation invariant. The complete feature matrix for the constraint nodes is where W(con-map) that u(con) i constructed by concatenating all the feature vectors u(con) It is possible to differentiate between the equality and inequality constraints and treat them separately. In that case, a different set of triplets is constructed for each constraint and a different MLP can be used to map the triplets to the feature dimension. Rmv×Du and u(con) , . . . , u(con) Dc RDc×Du . ∈ ∈ 1 ] i i The final feature matrix U is: D MLP for Continuous Variables U = (cid:21) (cid:20)U(var) U(con) ∈ R|V|×Du . (10) Given an assignment of integer variables, we can re-write the MILP (1) as the following parametric linear program: V (z(b)) = minimize z (c(b))T z(b) + (c(c))T z(c) subject to A(b)z(c) b ≤ − A(b)z(b). (11) where z = [z(b); z(c)], A = [A(b), A(c)], and c = [c(b), c(c)]. The above function V : RDz R is a piecewise convex function [26, 13], and therefore it can be approximated by an MLP with ReLU activation units. This fact motivated us to use an MLP to map the embedding from the GCN to the continuous variables. Notice that also a convex layer [3] can be used to approximate optimization programs. However, training convex layers is expensive as it requires to differentiate through the optimization program and in our testing it significantly increased the time needed for training. For this reason, we opted to use an MLP instead. → E On the Bernoulli and Beta Distributions The goal of our model is to learn the value of each binary variable as well as measure how reliable is each prediction. A natural approach to assess how reliable or risky is a decision is via the variance. Recall that a Bernoulli distribution, 14 Benidis et al. π). Thus, for a given mean, the variance is completely defined defined as Ber(π), has a mean π and variance π(1 and fixed, i.e., we cannot have different variance values for a given mean value. This essentially renders the variance uninformative (given the mean) for the purpose of assessing how reliable is a binary variable prediction. On the other hand, in the Beta distribution a fixed mean does not correspond to a fixed variance value and therefore can be used (along with the mean) as a measure to select trustworthy variables. For example, when selecting the ρ% most reliable variable predictions, one might prefer to include a variable with mean 0.2 and small variance (and fix it to the integer value 0) than a variable with mean 0.1 and very large variance, which indicates that the model has low confidence on that particular prediction although its mean is closer to 0. − F Training F.1 Clenshaw-Curtis Quadrature The Clenshaw-Curtis quadrature [15] is a method for numerical integration that is based on the expansion of the integrand in terms of Chebyshev polynomials, where the function f (x) to be integrated over the fixed interval [ 1, 1] is evaluated at the K roots of a Chebyshev polynomial. Then, the integral can be approximated as: (cid:90) 1 − f (x)dx ≈ −1 w(cid:62)y, where are the quadrature weights, with d zero-based indexing) is given by ∈ RK/2+1 and D ∈ w = D(cid:62)d, (13) R(K/2+1)×(K/2+1). In particular, the k-th element of d (with 1, 2/(1 1/(1 while the (m, k)-th element of D is defined as dk =    (2k)2), K 2), − − k = 0, k = 1, . . . , K/2 k = K/2, 1, − (14) Dmk = cos 2 K (cid:19) (cid:18) mkπ K/2 (cid:26)1/2, 1, k = 0, K/2, otherwise. × Notice that both D and d are independent of the function f (x) and therefore can be precomputed in O(K log K). The RK/2+1, where its k-th element, with k = 0, . . . , K/2, can information of the function is encoded in the vector y be computed as ∈ Finally, if the function needs to be integrated in the [0, 1] interval, we can apply the simple change of variable x(cid:48) = 2x x = (x(cid:48) + 1)/2 and the new integral becomes 1 yk = f (cos(kπ/K)) + f ( cos(kπ/K)). (16) − − → (cid:90) 1 −1 1 2 f ((x(cid:48) + 1)/2)dx(cid:48), (17) where we have also accounted for the Jacobian factor which is equal to 1/2. The integral in (17) has the right limits and the Clenshaw-Curtis quadrature can be applied accordingly. F.2 Regularization Ideally, we would like the model to produce Beta distributions with mean close to 0.5 and high variance if it is not confident. We propose the following regularization term to reinforce this behaviour: (12) (15) r(α, β, z(cid:63)) = (cid:90) 1 0 (cid:18) z(cid:63) Beta(π; α, β) | π dπ | * − KL (U(0, 1) Beta(π, α, β)) || z(cid:63)) (cid:90) 1 0 Beta(π; α, β)πdπ + z(cid:63) (cid:90) 1 0 Beta(π; α, β)(1 (cid:19) π)dπ − = (1 − (cid:90) 1 0 × (cid:18) = (1 (cid:18) (1 = − − (cid:19) (cid:18) log 1 Beta(π; α, β) + z(cid:63) β (cid:19) z(cid:63)) α α + β z(cid:63))α + z(cid:63)β α + β α + β dπ (18) (cid:19) (cid:18) (cid:90) 1 log − 0 (cid:18) πα−1(1 π)β−1 − B(α, β) (cid:19) (cid:19) dπ (α − 1 + β − 1 + log (B(α, β))) , 15 where Uni(0, 1) is the uniform distribution in the unit interval and B(α, β) the Beta function. The goal is to minimize the KL-divergence between the learned Beta distribution and the Uniform only when a prediction is wrong. The term (cid:82) 1 dπ evaluates how far is the distribution from the true label z(cid:63): if Beta is close to the label and 0 Beta(π; α, β) | has small variance (confident and correct) then this term is very small and the regularization becomes negligible. If the distribution is far from the label, the KL divergence regularizes Beta towards Uniform (pushes its mean towards 0.5) and increases its variance. z(cid:63) − π | The overall supervised loss is given by: (cid:96)sup-reg = (cid:96)sup(z(cid:63), ψ = αs,t, βs,t} { ) + λregr(z(cid:63), ψ = αs,t, βs,t} { ), (19) where λreg ≥ 0 is a regularization parameter. F.3 Weighted Loss It is common in classification tasks to include weights in the loss when the classes are imbalanced or to trade off precision and recall. Our problem can be interpreted as a classification task with 2D(b) z classes, one for each possible binary sequence of length D(b) z , and each instance then belongs to a specific class. With this interpretation the number of classes explodes very fast and no meaningful technique can be applied since the samples required to have a decent representation of each class in unattainable (e.g., for D(b) z = 100 and assuming an average of only 10 samples per class we would require 2100 An interpretation that scales is to consider our problem as D(b) classification tasks (one fore each variable) with 2 z classes each (since we consider binary variables). With this approach, each instance is a combination of D(b) classes. z Now, each classification task has as many samples as the number of instances, which are split in a different way among the 2 classes. 107 samples). 10 ≈ * Note that the above interpretations do not change the mathematical formulation of the problem or the loss but the way we think of the class weighting. Following the second approach, we can calculate the class representation percentage rj of the j-th variable (i.e., each classification task) from the available instances (labels). For example, if in 80% of the labels zj = 0 and in 20% of the labels zj = 1, then rj = 0.2. Then, the (supervised) loss in its generic form would be: (cid:96)(z(cid:63), φ) = S (cid:88) T (cid:88) Dz(cid:88) − s=1 t=1 j=1 z(cid:63) s,t,j r j (1 log( ) * rj)1−z(cid:63) − s,t,j . (20) The use (or not) of these weights for the computation of the supervised loss is a hyperparameter that is optimized for each dataset. G Datasets We introduce the six types of problems which we employed in the evaluation of MIPnet. The results for the problems from Tables 5 and 7 can be found in Section 4, and the results from problems from Tables 6 and 8 are discussed in Section I.1 of the Appendix. These problems were selected in line with the evaluation studies in prior works, see [52, 19, 11] and references therein; they appear regularly in different application domains and, furthermore, constitute building blocks for a very wide range of optimization problems. In the sequel we describe the mathematical formula- tion of each problem, denoted as Pt and p = 1, . . . , 6, to indicate that each formulation corresponds to a particular instance of the problem with time-varying parameters.78 We further identify the problems' complexity and class (type of problem), and we map them to real-world applications. Finally, we provide details about the datasets and instances we used in training, testing and validation – see also the summarized view in Tables 5–8. p with t ∈ T G.1 Multicommodity Network Design and Routing We consider the joint unsplittable-routing and network design problem where the goal is to minimize the aggregate routing cost by deciding how much capacity to purchase for each link and which path to select for each commodity. 7We have ignored the time series index s to avoid notational cluttering. 8For the problem formulations we have used t as a superscript in all the time-varying parameters (t is fixed per instance and it just indicates that a specific parameter changes across instances), while all the subscripts are instance-dependent indices. 16 Benidis et al. Table 5: Datasets problem sizes. routing facility-loc # Integer variables 2812 1989 # Continuous variables # Equality constraints # Inequality constraints Data 0 450 36 real Fraction of non-zeros in A 0.0374 Fraction of non-zeros in b 1.0 Fraction of non-zeros in c Fraction of non-zeros in z∗ 0.579 0.0001 0 50 39 mixed 0.0226 0.5 0.9804 0.0278 energy-grid revenue-max caching 1000 30000 39942 tsp 144 500 36 0 1 4082 1010 0 0 20 0 0 1 synthetic synthetic synthetic mixed 0.1414 0.8333 0.9996 0.0833 0.6723 0.9876 1.0 0.7375 0.50 1.0 1.0 0.0044 1.0 1.0 0.0187 0.0006 Table 6: Additional datasets problem sizes. routing-sm revenue-max-sm # Integer variables # Continuous variables # Equality constraints # Inequality constraints Data 1044 0 390 36 real Fraction of non-zeros in A 0.0333 Fraction of non-zeros in b Fraction of non-zeros in c Fraction of non-zeros in z∗ 1.0 0.9169 0.4298 10000 0 0 10 synthetic 0.501 1.0 1.0 0.0166 Formally, the network is modeled by a graph ) and serves a set of commodities with time varying demands dt = dt k}k∈K, and predetermined sources and destinations. Specifically, our goal is to solve the following binary { problem: k + 1 : minimize vk,lpk,ldt uiqe,i = ( (cid:88) (cid:88) (cid:88) (cid:88) Pt K V G E , k ∀ e ∀ , ∈ K , ∈ E p,q subject to k∈K (cid:88) l∈Pk e∈E i∈I pk,l = 1, Problem Pt ∈ { 1 has the following binary variables: p 0, 1 |K|, q } 0, 1 ∈ { l∈Pk (cid:88) (cid:88) k∈K l∈Pk ae,k,lpk,ldt k ≤ (cid:88) be + ciqe,i, i∈I |E||I|. } • pk,l ∈ { • qe,i ∈ { : selection of path l for routing commodity k 0, 1 } : installment of i-type capacity at edge e 0, 1 } ∈ E , ∈ K , and the following parameters: Pk: set of eligible paths for commodity k • • vk,l ∈ • ak e,l ∈ { • be ∈ R+: routing cost (per unit of traffic) of path l : parameter indicating that edge e is contained in path l 0, 1 } R+: initial capacity installed at edge e ∈ Pk, ∈ K ∈ E , , ∈ Pk, 17 Table 7: Datasets time series dimensions. routing facility-loc tsp energy-grid revenue-max caching # of time series for training # of time series for testing # of time series for validation # of instances per time series 46 5 5 96 80 20 20 700 80 20 20 400 80 20 20 100 80 20 20 100 80 20 20 150 Table 8: Additional datasets time series dimensions. routing-sm revenue-max-sm # of time series for training # of time series for testing # of time series for validation # of instances per time series 96 18 10 96 80 20 20 100 • ui ∈ • ci ∈ • dt k ∈ R+: cost of buying i-th capacity installment, R+: capacity of i-th installment, R+: demand of commodity k at time t. Complexity. Pt 1 is known to be NP-hard even for a single commodity, i.e., = 1, cf. [55]. |K| Datasets. The problem parameters, including the graph topology, were taken from the SNDlib database [53] that contains real-world traffic matrices and network topologies from different communication (and other) networks (e.g., from backbone ISP networks).9 In particular, for this problem we used the dataset geant dataset, the size of which can be seen in Table 5. The capacity and instalment costs are fixed over time, while the demand vector dt is being updated every 15 minutes over a period of 4 months. We note that we have scaled the demand dt and edge capacity by a factor of 100 and 1/40, respectively, to increase the complexity of the problem.10 The number of time series we used, and the number of instances for each time series can be found in Table 7, where the instances differ in vector dt. G.2 Facility Location of clients, the goal is to decide which In the facility location problem, given a set facilities to open and how to assign clients to the opened facilities. The objective is to minimize the total opening and assignment cost. More formally, we solve the following binary problem: (cid:88) of facility locations and a set (cid:88) (cid:88) J I Pt 2 : minimize z cj,idt jzj,i + fixi subject to i∈I (cid:88) i∈I (cid:88) j∈J j∈J i∈I zj,i = 1, zj,i ≤ 2 |J | xi, z 0, 1 ∈ { |I||J ||I|, } j ∀ i ∀ , ∈ J , ∈ I where the vector of binary variables z = [z11, . . . , z|I||J |, x1, . . . , x|I|]. In the above problem, we introduced the following binary variables: • zj,i ∈ { • xi ∈ { 0, 1 0, 1 : assignment of client j } : deployment of facility i } to facility i , ∈ I ∈ J ∈ I , 9SNDlib is a rich and well-known database which is regularly used in the evaluation of routing algorithms in communication networks. 10This scaling renders capacity purchase necessary in order to fulfill the demands. 18 Benidis et al. and the following parameters: • fi ∈ • cj,i ∈ • dt j ∈ R+: cost for opening facility i ∈ I R+: cost for associating client j R+: demand of client j ∈ J at time t. , ∈ J to facility i , ∈ I Complexity. Pt 1.463 ratio, with the currently-known algorithm achieving a solution within 1.488 ratio, see [67]. 2 is the metric uncapacitated facility location problem, which is NP-hard and inapproximable below Datasets. The graph topology is borrowed from the germany50 dataset [53], the cost parameters fi are randomly generated from a uniform distribution for each problem instance and the time-varying demand dt = dt j}j∈J is { defined as: dt+1 = max (cid:8)0, Adt + a1 sin(t/period1) + a2 sin(t/period2) + w(cid:9) , R|J |×|J | constructed by randomly sampling the eigenvalues λi ∼ U for a Hurwitz matrix A (0.98, 0.999) and the associated orthonormal eigenvectors vi (2, 10), R|J |×|J | and the random vector w is a diagonal matrix of ones. In the above definition the max operator is applied component-wise and guarantees nonnegative demand. Finally, the periodicity of the sine functions are period1 = 20 and period2 = 70. (1, 5) and a2 R|J | and the covariance matrix Σ1 ∈ { (0, Σ1), where the vector of zeros 0 . The random variables a1 ∼ U ∈ 11 for i 1, . . . , |J |} ∼ N ∼ U ∈ ∈ G.3 Travelling Salesman We consider the Travelling Salesman Problem (TSP) under the Dantzig–Fulkerson–Johnson formulation [64]. detail, we have a set are connected with a graph G = ( (i, j) minimize the aggregate (travelling) cost of the route. In detail, the formulated binary problem is: (cid:88) In of N cities, which we need to visit exactly once and return to the starting node. The cities . Our goal is to ) which induces routing (or distance) costs ci,j, ∈ E (cid:88) N N ∀ E , Pt 3 : minimize z ct i,jzi,j subject to j∈N zi,j = 1, zi,j = 1, j ∀ i ∀ , , ∈ N ∈ N i∈N (cid:88) i∈N (cid:88) j∈J (cid:88) i∈S (cid:88) j∈S zi,j ≤ |S| − N 2 0, 1 } . z ∈ { 1, ∀S ⊆ { 1, . . . , N , } |S| ≥ 2, The problem includes the binary variables: • zi,j ∈ { and parameters: 0, 1 : inclusion of link (i, j) } ∈ E or not (xij = 0) in the route, • ct i,j ∈ R+: cost for traversing link (i, j) at time t. Complexity. Pt 3 is NP-hard to approximate within any polynomial factor for general distance functions, while im- proved approximation ratios are available for certain restricted cases (metric spaces, etc.). We refer the reader to [63] for an up-to-date discussion on the complexity of TSP. Datasets. We created instances with N = 12 nodes. The location of each node is randomly generated using a uniform Rn is given by the distance distribution and we assumed that the graph is fully connected. The cost vector ct between each city pair and it changes at each time step as follows: ∈ ct+1 = max 0, ct + w { U(dmin, dmax)n and the max operator is applied component-wise; where dmin, dmax are positive con- , } where w stants. ∼ 11The eigenvectors are computed randomly sampling from a standard normal and then using the Gram–Schmidt procedure to compute a set of orthonormalized vectors. 19 Figure 4: Microgrid energy storage optimization for a community of prosumers and a two-tier battery system. F G.4 Revenue Maximization We consider the problem of shipping commodities from a set source nodes (each commodity cor- responds to one node) towards their intended destinations over predetermined (overlapping) paths. Our goal is to maximize the revenue from delivering as many commodities as possible, while satisfying the time-varying capacity of each edge i n. Formally, we consider the following ∈ I binary problem: that lies along the path of each commodity n of N = , i.e., i ∈ N |N | N (cid:51) P4t : maximize z subject to (cid:88) n∈N (cid:88) ct nzn ai,nzn ≤ N . } 0, 1 n∈N z ∈ { bt i, i ∀ , ∈ I The problem includes the binary variables: • zn ∈ { and parameters: : transporting commodity n to its destination via a predetermined path, or not, 0, 1 } R+: revenue when delivering commodity n, at time t, R+: transportation capacity of link i , at time t, ∈ I • ct n ∈ • bt i ∈ • ai,n ∈ { Complexity. Pt : indicating if link i lies in the predetermined path of commodity n, i.e., i 0, 1 } n. (cid:51) 4 is NP-complete as it falls in the category of multi-dimensional Knapsack problems, see [66]. Datasets. We randomly generated from a uniform distribution the scalars ai,n representing the resources needed to ship commodity n from the i-th facility. Furthermore, for each time series the time-varying capacity and revenue vectors are defined as follows: ct+1 = ct + a1 sin(t/period1) + a2 sin(t/period2) + wc, bt+1 = bt + wb, where ct = [ct 1, . . . , ct the random vectors wc ∈ instances per time series please refer to Table 7. 1, . . . , bt R|I||N | and wb ∈ N ], bt = [bt |I|], the scalars a1, a2 are randomly generated for each time series, and R|I|. For further details about the number of time series and problem G.5 Energy Grid energy producers-consumers (or, We consider a microgrid energy-sharing problem, cf. [65], where a set prosumers) coordinate their energy prosumption plan over several time periods. The prosumers have at their disposal a hierarchical energy storage system, where the primary batteries are already in place and the secondary batteries are deployed upon demand by paying additional cost. The goal is to optimize the overall microgrid operation, by solving of F = |F| F 20 Secondary BatteriesPrimaryBatteries<latexit sha1_base64="/oI7/GtOsF1cbhH6QjZIdsw7BM0=">AAAB8nicbVBNS8NAFHypX7V+VT16WSyCp5KIqMeiF71VsLaQhrLZbtqlm03YfRFK6c/w4kERr/4ab/4bN20O2jqwMMy8x86bMJXCoOt+O6WV1bX1jfJmZWt7Z3evun/waJJMM95iiUx0J6SGS6F4CwVK3kk1p3EoeTsc3eR++4lrIxL1gOOUBzEdKBEJRtFKfjemOGRUkrtKr1pz6+4MZJl4BalBgWav+tXtJyyLuUImqTG+56YYTKhGwSSfVrqZ4SllIzrgvqWKxtwEk1nkKTmxSp9EibZPIZmpvzcmNDZmHId2Mo9oFr1c/M/zM4yugolQaYZcsflHUSYJJiS/n/SF5gzl2BLKtLBZCRtSTRnalvISvMWTl8njWd27qHv357XGdVFHGY7gGE7Bg0towC00oQUMEniGV3hz0Hlx3p2P+WjJKXYO4Q+czx9FcZCX</latexit>I<latexit sha1_base64="kQlvnhSt6TF1MpsjV35jaJyKMkE=">AAAB8nicbVBNS8NAFHypX7V+VT16WSyCp5KIqMeiF09SwdpCGspmu2mXbjZh90UopT/DiwdFvPprvPlv3LQ5aOvAwjDzHjtvwlQKg6777ZRWVtfWN8qbla3tnd296v7Bo0kyzXiLJTLRnZAaLoXiLRQoeSfVnMah5O1wdJP77SeujUjUA45THsR0oEQkGEUr+d2Y4pBRSe4qvWrNrbszkGXiFaQGBZq96le3n7As5gqZpMb4nptiMKEaBZN8WulmhqeUjeiA+5YqGnMTTGaRp+TEKn0SJdo+hWSm/t6Y0NiYcRzayTyiWfRy8T/PzzC6CiZCpRlyxeYfRZkkmJD8ftIXmjOUY0so08JmJWxINWVoW8pL8BZPXiaPZ3Xvou7dn9ca10UdZTiCYzgFDy6hAbfQhBYwSOAZXuHNQefFeXc+5qMlp9g5hD9wPn8ATQqQnA==</latexit>N<latexit sha1_base64="izx0mNdI8WAbYNPOkYIbGfYiXoY=">AAAB8nicbVBNS8NAFHypX7V+VT16WSyCp5KIqMeiIB4rWFtIQ9lsN+3SzSbsvgil9Gd48aCIV3+NN/+NmzYHbR1YGGbeY+dNmEph0HW/ndLK6tr6RnmzsrW9s7tX3T94NEmmGW+xRCa6E1LDpVC8hQIl76Sa0ziUvB2ObnK//cS1EYl6wHHKg5gOlIgEo2glvxtTHDIqyW2lV625dXcGsky8gtSgQLNX/er2E5bFXCGT1Bjfc1MMJlSjYJJPK93M8JSyER1w31JFY26CySzylJxYpU+iRNunkMzU3xsTGhszjkM7mUc0i14u/uf5GUZXwUSoNEOu2PyjKJMEE5LfT/pCc4ZybAllWtishA2ppgxtS3kJ3uLJy+TxrO5d1L3781rjuqijDEdwDKfgwSU04A6a0AIGCTzDK7w56Lw4787HfLTkFDuH8AfO5w9A4pCU</latexit>FProsumers<latexit sha1_base64="hpo6U332PzLAPwVGnxjrRvnyyz8=">AAAB7nicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8cK9gPaUDbbSbt0swm7G6GE/ggvHhTx6u/x5r9x0+agrQ8GHu/NMDMvSATXxnW/ndLa+sbmVnm7srO7t39QPTxq6zhVDFssFrHqBlSj4BJbhhuB3UQhjQKBnWByl/udJ1Sax/LRTBP0IzqSPOSMGit1hoNM8lllUK25dXcOskq8gtSgQHNQ/eoPY5ZGKA0TVOue5ybGz6gynAmcVfqpxoSyCR1hz1JJI9R+Nj93Rs6sMiRhrGxJQ+bq74mMRlpPo8B2RtSM9bKXi/95vdSEN37GZZIalGyxKEwFMTHJfydDrpAZMbWEMsXtrYSNqaLM2ITyELzll1dJ+6LuXdW9h8ta47aIowwncArn4ME1NOAemtACBhN4hld4cxLnxXl3PhatJaeYOYY/cD5/AA06j2I=</latexit>dni<latexit sha1_base64="U69szQhJDFHVc/hfJ6yzt8KQ1qg=">AAAB7nicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8cK9gPaUCbbTbt0swm7G6GE/ggvHhTx6u/x5r9x0+agrQ8GHu/NMDMvSATXxnW/ndLa+sbmVnm7srO7t39QPTxq6zhVlLVoLGLVDVAzwSVrGW4E6yaKYRQI1gkmd7nfeWJK81g+mmnC/AhHkoecorFSBweZDGeVQbXm1t05yCrxClKDAs1B9as/jGkaMWmoQK17npsYP0NlOBVsVumnmiVIJzhiPUslRkz72fzcGTmzypCEsbIlDZmrvycyjLSeRoHtjNCM9bKXi/95vdSEN37GZZIaJuliUZgKYmKS/06GXDFqxNQSpIrbWwkdo0JqbEJ5CN7yy6ukfVH3rurew2WtcVvEUYYTOIVz8OAaGnAPTWgBhQk8wyu8OYnz4rw7H4vWklPMHMMfOJ8/BAqPXA==</latexit>anf<latexit sha1_base64="Img4E/rmxjvT7pImU6DGQUxFDWk=">AAAB7XicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8cK9gPaWDbbTbt2sxt2J0IJ/Q9ePCji1f/jzX9j0vagrQ8GHu/NMDMviKWw6LrfTmFldW19o7hZ2tre2d0r7x80rU4M4w2mpTbtgFouheINFCh5OzacRoHkrWB0k/utJ26s0OoexzH3IzpQIhSMYiY1g556wFKvXHGr7hRkmXhzUoE56r3yV7evWRJxhUxSazueG6OfUoOCST4pdRPLY8pGdMA7GVU04tZPp9dOyEmm9EmoTVYKyVT9PZHSyNpxFGSdEcWhXfRy8T+vk2B45adCxQlyxWaLwkQS1CR/nfSF4QzlOCOUGZHdStiQGsowCygPwVt8eZk0z6reRdW7O6/UrudxFOEIjuEUPLiEGtxCHRrA4BGe4RXeHO28OO/Ox6y14MxnDuEPnM8fCaGOxw==</latexit>btn<latexit sha1_base64="xYeHN4vs3FJKe/2cIHsX5Hxdhv8=">AAAB6XicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8cq1hbaUDbbSbt0swm7G6GE/gMvHhTx6j/y5r9x0+agrQ8GHu/NMDMvSATXxnW/ndLK6tr6RnmzsrW9s7tX3T941HGqGLZYLGLVCahGwSW2DDcCO4lCGgUC28H4JvfbT6g0j+WDmSToR3QoecgZNVa655V+tebW3RnIMvEKUoMCzX71qzeIWRqhNExQrbuemxg/o8pwJnBa6aUaE8rGdIhdSyWNUPvZ7NIpObHKgISxsiUNmam/JzIaaT2JAtsZUTPSi14u/ud1UxNe+RmXSWpQsvmiMBXExCR/mwy4QmbExBLKFLe3EjaiijJjw8lD8BZfXiaPZ3Xvou7dndca10UcZTiCYzgFDy6hAbfQhBYwCOEZXuHNGTsvzrvzMW8tOcXMIfyB8/kDBfmNBw==</latexit>i<latexit sha1_base64="Frx5NAJe5WtOQSibiyzgSPVaNek=">AAAB6XicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8cq1hbaUDbbSbt0swm7G6GE/gMvHhTx6j/y5r9x0+agrQ8GHu/NMDMvSATXxnW/ndLK6tr6RnmzsrW9s7tX3T941HGqGLZYLGLVCahGwSW2DDcCO4lCGgUC28H4JvfbT6g0j+WDmSToR3QoecgZNVa6l5V+tebW3RnIMvEKUoMCzX71qzeIWRqhNExQrbuemxg/o8pwJnBa6aUaE8rGdIhdSyWNUPvZ7NIpObHKgISxsiUNmam/JzIaaT2JAtsZUTPSi14u/ud1UxNe+RmXSWpQsvmiMBXExCR/mwy4QmbExBLKFLe3EjaiijJjw8lD8BZfXiaPZ3Xvou7dndca10UcZTiCYzgFDy6hAbfQhBYwCOEZXuHNGTsvzrvzMW8tOcXMIfyB8/kDDZKNDA==</latexit>n<latexit sha1_base64="BBtDCpCKnFSTGuZ0cCMn7bxilU4=">AAAB6XicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8cq1hbaUDbbSbt0swm7G6GE/gMvHhTx6j/y5r9x0+agrQ8GHu/NMDMvSATXxnW/ndLK6tr6RnmzsrW9s7tX3T941HGqGLZYLGLVCahGwSW2DDcCO4lCGgUC28H4JvfbT6g0j+WDmSToR3QoecgZNVa6Dyv9as2tuzOQZeIVpAYFmv3qV28QszRCaZigWnc9NzF+RpXhTOC00ks1JpSN6RC7lkoaofaz2aVTcmKVAQljZUsaMlN/T2Q00noSBbYzomakF71c/M/rpia88jMuk9SgZPNFYSqIiUn+NhlwhcyIiSWUKW5vJWxEFWXGhpOH4C2+vEwez+reRd27O681ros4ynAEx3AKHlxCA26hCS1gEMIzvMKbM3ZenHfnY95acoqZQ/gD5/MHAWqNBA==</latexit>fTransferLosses<latexit sha1_base64="IFtCM6n9ye/DXhnXZd+bOZz9RJ0=">AAAB/XicbVDLSsNAFL2pr1pf8bFzEy2CCymJiLosunFZwT6gCWEynbRDJ5MwMxHaEPwVNy4Ucet/uPNvnLRdaOuBezmccy9z5wQJo1LZ9rdRWlpeWV0rr1c2Nre2d8zdvZaMU4FJE8csFp0AScIoJ01FFSOdRBAUBYy0g+Ft4bcfiZA05g9qlBAvQn1OQ4qR0pJvHoz9jObukUu5bpl95rh5xTerds2ewFokzoxUYYaGb365vRinEeEKMyRl17ET5WVIKIoZyStuKkmC8BD1SVdTjiIivWxyfW6daKVnhbHQxZU1UX9vZCiSchQFejJCaiDnvUL8z+umKrz2MsqTVBGOpw+FKbNUbBVRWD0qCFZspAnCgupbLTxAAmGlAytCcOa/vEha5zXnsubcX1TrN7M4ynAIx3AKDlxBHe6gAU3AMIZneIU348l4Md6Nj+loyZjt7MMfGJ8/0A6UJw==</latexit>zi2{0,1}<latexit sha1_base64="5DBI1u49yCOJH0uy74+pIJj9dJk=">AAAB83icbVBNS8NAEJ3Ur1q/qh69bC2Cp5KIqCcpevFYwX5AE8pmu2mXbjZhdyPU0L/hxYMiXv0z3vw3btIctPXBwOO9GWbm+TFnStv2t1VaWV1b3yhvVra2d3b3qvsHHRUlktA2iXgkez5WlDNB25ppTnuxpDj0Oe36k9vM7z5SqVgkHvQ0pl6IR4IFjGBtJPdpkAYzt3bt1uzKoFq3G3YOtEycgtShQGtQ/XKHEUlCKjThWKm+Y8faS7HUjHA6q7iJojEmEzyifUMFDqny0vzmGToxyhAFkTQlNMrV3xMpDpWahr7pDLEeq0UvE//z+okOrryUiTjRVJD5oiDhSEcoCwANmaRE86khmEhmbkVkjCUm2sSUheAsvrxMOmcN56Lh3J/XmzdFHGU4gmM4BQcuoQl30II2EIjhGV7hzUqsF+vd+pi3lqxi5hD+wPr8AW5FkKE=</latexit>zf>0 Benidis et al. the mixed binary problem: Pt 5 : maximize z subject to (cid:88) f ∈F (cid:88) f ∈F (cid:88) f ∈F z(c) where the last constraint enforces the prosumers of their community. The main variables of Pt 5 are: f z(c) ct f − (cid:88) iz(b) pt i i∈I bt n + anf z(c) f ≤ dn,iz(b) i , (cid:88) i∈I n ∀ , ∈ N z(c) f = 1, RF , z(b) 0, 1 } ∈ { F , to keep at least 1 (normalized) unit of energy for serving the needs ∈ F • z(c) R: continuous variable deciding how much energy prosumer f f ∈ (if negative),12 will store (if positive) or purchase ∈ F • z(b) i ∈ { and the main parameters: 0, 1 } : decides whether to deploy or not (zi = 0) the secondary battery i , ∈ I • an,f ∈ values indicate larger losses, R+: energy transfer loss coefficient when prosumer f ∈ F transfers energy to battery n . Larger ∈ N R+: selling or purchase (when z(c) R+: available capacity at primary battery n f < 0) price for the energy of prosumer f at time t, , at time t, ∈ F R+: energy loss coefficient when transferring energy from primary battery n ∈ N to secondary ∈ N • ct f ∈ • bt n ∈ • dn,i ∈ battery i . ∈ I Complexity. Pt 5 is NP-hard as it generalizes the facility location problem [65]. Datasets. We created instances using a non-stationary formula for the time-varying vectors that exhibits temporal properties as follows: ct+1 = ct + a sin(t/period1) + wc, bt+1 = bt + wb, where the scalar a is randomly generated for each time series, and the random vectors wc ∈ G.6 Caching R|I||P| and wb ∈ R|I|. Our final problem is a standard data caching problem where we wish to store the most popular files in a cache of files and a single cache limited capacity, see [29]. In particular, we consider a content library of 1, 2, . . . , N { with C bytes capacity. Each file n n at time t, which captures the expected requests for file n at that time, and size of qn bytes. The goal is to store, at each time, those files that will be requested by the larger number of content viewers, i.e., to maximize the cache hits. This can be formalized with the following binary problem: has popularity pt ∈ N N = } pt nxn Pt 6 : maximize z subject to N (cid:88) n=1 N (cid:88) n=1 xnqn ≤ , 0, 1 } C n ∀ . ∈ N xn ∈ { The variables of Pt 6 are: • xn ∈ { 0, 1 : binary variables that select a file to be cached or not, } 12Negative transfers release capacity that can be used for stored-energy transfers. 21 Table 9: Hyperparameters of the loss components. Schedule Parameter λ λreg λc warm-up steps warm-up initial value warm-up final value final value {500, 1000, 1500, 2000} {0.01, 0.1} {0.1, 1} {1, 10, 50} {250, 500} {0.01, 0.1} {0.1, 1} {0.1, 1, 10, 100} {1000, 1500} 0.1 {1, 10} {10, 100} and the main parameters: • pt n ∈ • qn ∈ R+: normalized file popularity parameters at time t, R+: size of file n . ∈ N Complexity. Pt through dynamic programming. 6 is a standard Knapsack problem which is NP-Complete but can be solved in pseudo-polynomial time Datasets. The file sizes were created randomly from a uniform distribution (1, 10), while for the file popularity we used the standard dataset for request traces from Movielens [24], which we sliced in order to create the different time series. U H Experimental Details H.1 Benchmarks In our experiments we use as benchmark the N-div model [52] as it is the most related approach to our method MIPnet. N-div uses a GCN based on the bipartite graph representation of the MILP, similar to our approach, while the output of the GCN is mapped to Bernoulli parameters using an MLP. The model is trained by minimizing the NLL (cross- entropy) modified based on the SelectiveNet approach [32]. The idea is to learn two sets of binary variables: one set indicates if a variable is going to be selected and the other its binary value (to be used if selected). Therefore, the overall loss can be seen as a weighted cross-entropy. Further, this loss assumes a predefined target selection percentage and therefore a different model is required for different variable selection percentages. We implemented N-div by keeping the common structure of our model and changing the final layers and the loss. Further, we used the same set of features (see Appendix C) as in our method for a fair comparison. Note that in [52] it is not clearly mentioned what features are used for the N-div method. The authors only mention a set of solver-based features that can be used in their neural-branching method but are not applicable for N-div since no such features are available during inference. For the method from [11], we use the implementation available online at github.com/bstellato/mlopt. This strategy learns a mapping from problem parameters to feasible variable assignments. First, the input data is categorized into strategies, i.e., feasible variables assignment. Then, the mapping is learned as a multi-class classification problem. Notice that this approach does not generalize when a class is not in the training dataset, i.e., when at test time all feasible assignments seen during training are note feasible for the new problem instance. In order to scale to large datasets, we modified their implementation so that it accepts sparse training data. Moreover, we made sure that their method receives the same train/validation/test split as our method. H.2 Hyperparameters For all datasets we used the Adam optimizer for the gradient updates with 10−5 weight-decay and clipped the gradient 10−2 for the first 500 steps after which a norm to 10. The learning rate was warmed-up linearly from 1 × cosine decay follows for the remaining time steps with a decay rate of 0.99. 10−4 to 1 × For each dataset we performed a hyperparameter optimization on the model and loss parameters. The batch size and the number of training steps were tuned per dataset with values in , } respectively. All the loss hyperparameters were linearly warmed-up to an initial value and then linearly scaled up to 8, 12, 16, 32 { 8000, 15000, 20000 and } { 22 Benidis et al. Table 10: Hyperparameters of the model blocks. Parameter Block MLP (features) GCN LSTM MLP (binary map) MLP (continuous map) # of layers # of units nonlinearity 1 {8, 16} {ReLU, No} {2, 3} {8, 16} {ReLU, No} {1, 2, 3} {16, 32} No 1 2 × D(b) z ReLU 1 D(c) z No Table 11: Accuracy, infeasibility and optimality gap (mean ± std) of MIPnet vs. N-div. Bold indicates best method. ρ Method routing-sm revenue-max-sm routing-sm revenue-max-sm routing-sm revenue-max-sm Accuracy Infeasibility Optimality gap 30% 40% 50% 60% 70% MIPnet N-div MIPnet N-div MIPnet N-div MIPnet N-div MIPnet N-div 99.18 ± 0.17 95.67 ± 0.48 98.29 ± 0.22 78.33 ± 25.14 97.32 ± 0.40 89.46 ± 0.93 95.19 ± 0.42 92.41 ± 1.26 92.79 ± 0.43 89.52 ±2.55 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 7.88 ± 0.63 77.91 ± 9.73 35.63 ± 21.02 96.27 ± 4.32 65.07 ± 29.85 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.35 ± 0.01 0.39 ± 0.04 0.95 ± 0.37 0.27 ± 0.02 1.48 ± 0.89 - - - - - 0.12 ± 0.03 0.16 ± 0.05 0.07 ± 0.02 0.11 ± 0.07 0.05 ± 0.02 0.03 ± 0.03 0.03 ± 0.03 0.02 ± 0.01 0.03 ± 0.04 0.03 ± 0.01 a final target value in the final training step. The loss scheduling hyperparameter ranges are provided in Table 9. The model hyperparameter ranges are provided in Table 10.13 H.3 Computational Environment For running our experiments we used p3.8xlarge AWS EC2 instances with 4 Tesla V100 GPUs, 36 CPUs, and 244 GB of memory, and m5.8xlarge instances with 32 CPUs and 128 GB of memory. I Additional Results I.1 Additional Datasets infeasibility, and optimality gap for the two additional datasets In Table 11 we provide results for accuracy, routing-sm and revenue-max-sm, which are smaller versions of routing and revenue-max-sm, respectively. Ta- ble 12 shows the accuracy, infeasibility, and optimality gap on these two additional datasets for the method from [11]. We notice that our method performs better than N-div and the method from [11] in almost all additional experi- ments. Notice that the method from [11] is able to find a feasible solution for routing-sm in more cases than MIPnet and N-div. However, this method is always infeasible in revenue-max, MIPnet and N-div always find a feasible solution. I.2 Unsupervised Loss As we already showed in Section 4.1, training MIPnet only with supervised loss (MIPnet-sup) leads to decreased per- formance for reasons we discussed throughout the paper. Here, we complete the picture by including the performance of MIPnet-unsup, i.e., MIPnet trained only with unsupervised loss. Tables 13-15 show the accuracy, infeasibility and optimality gap, respectively. It is clear that the performance of MIPnet-unsup compared to MIPnet is significantly degraded in most datasets, with the sole exception of the caching. It is important to highlight some key observations based on these results. First, the accuracy of MIPnet-unsup in the energy-grid dataset is less than 50% for all values of ρ. This does not lead to significant infeasibilities since apparently the constraints of the problem are not that hard to satisfy, however it causes a significant optimality gap. This is a case where labels make a big difference in the model training process and in fact the performance of MIPnet-sup is in par with MIPnet, i.e., most of the learning is done from the labels. On the other end, we observe that in the 13Note that the number of units in GCN increases due to skip connections. 23 Table 12: Accuracy, infeasibility and optimality gap of [11]. Accuracy Infeasibility Optimality gap routing-sm revenue-max-sm 85.4 99.22 93.0 100.00 9.4 ∞ Table 13: Accuracy (mean ± std)% of MIPnet-unsup. ρ (%) routing facility-loc tsp energy-grid revenue-max caching 30% 95.46 ± 1.47 99.02 ± 1.12 96.45 ± 2.69 49.38 ± 1.36 100.00 ± 0.00 100.00 ± 0.00 40% 94.13 ± 1.16 98.90 ± 1.25 95.83 ± 2.90 48.16 ± 0.75 100.00 ± 0.00 100.00 ± 0.00 50% 92.60 ± 1.13 98.85 ± 1.26 95.28 ± 3.04 47.61± 0.77 99.99 ± 0.00 100.00 ± 0.00 60% 91.24 ± 1.01 98.76 ± 1.21 94.76 ± 3.03 47.59 ± 0.86 99.99 ± 0.00 100.00 ± 0.00 70% 89.49 ± 0.76 98.50 ± 1.02 94.32 ± 2.84 47.78 ± 0.79 99.99 ± 0.00 100.00 ± 0.00 Table 14: Infeasibility (mean ± std)% of MIPnet-unsup. ρ (%) routing facility-loc tsp energy-grid revenue-max caching 30% 100.00 ± 0.00 6.92 ± 0.56 33.43 ± 47.07 0.02 ± 0.03 0.00 ± 0.00 0.00 ± 0.00 40% 100.00 ± 0.00 13.87 ± 10.09 41.94 ± 42.22 0.06 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 50% 100.00 ± 0.00 29.89 ± 25.36 54.68 ± 39.66 0.11 ± 0.06 0.00 ± 0.00 0.00 ± 0.00 60% 100.00 ± 0.00 47.28 ± 24.40 69.16 ± 40.00 0.15 ± 0.03 0.00 ± 0.00 0.00 ± 0.00 70% 100.00 ± 0.00 72.68 ± 15.37 84.04 ± 21.92 0.17 ± 0.08 0.00 ± 0.00 0.00 ± 0.00 Table 15: Optimality gap (mean ± std)% of MIPnet-unsup. ρ (%) routing facility-loc tsp energy-grid revenue-max caching 30% 40% 50% 60% 70% - - - - - 8.83 ± 12.33 1.55 ± 1.27 8.59 ± 0.04 0.00 ± 0.00 0.00 ± 0.00 12.44 ± 17.31 3.11 ± 2.78 12.62 ± 0.36 0.00 ± 0.00 0.00 ± 0.00 15.08 ± 20.06 5.95 ± 5.38 17.16 ± 0.63 0.66 ± 0.01 0.00 ± 0.00 18.97 ± 24.36 11.06 ± 9.82 22.00 ± 0.95 1.23 ± 0.01 0.00 ± 0.00 32.20 ± 27.12 19.73 ± 17.64 27.41 ± 1.11 1.57 ± 0.07 0.00 ± 0.00 caching dataset the model is able to learn the optimal values without labels. Arguably this is an easy problem to learn since all the models achieve optimal performance. In such cases the overhead of collecting (many) labels might not be necessary. All the other datasets fall in the case where both MIPnet-sup and MIPnet-unsup underperform compared to MIPnet and a combination of supervised and unsupervised loss gives the best performance. I.3 Missing Labels Finally, we examine how missing labels affect the performance of a model trained with and without unsupervised loss. For this experiment we used the tsp dataset. Figure 5 illustrates the accuracy of the models for different percentages of missing labels. In the presence of missing labels the model that is trained with both supervised and unsupervised loss clearly outperforms the one without unsupervised loss in all cases. J Discussion of Related Work Table 16 summarizes the key differences of MIPnet from the most-related models and approaches. In the evaluation section we have presented detailed comparisons of MIPnet with [52], [32] and [11], while here we focus on qualitative 24 Benidis et al. Figure 5: Comparison of MIPnet w\ and w\o unsupervised loss for different missing label percentages. differences. In detail, we see that MIPnet is the only model that uses semi-supervised learning. This is very important since obtaining labels requires, in most cases, solving large-scale NP-hard problems, while the unsupervised loss component can improve the performance of the model further, by allowing us to identify the effect (in terms of optimality gap and infeasibility) of mispredictions at a per-variable granularity. These benefits are evident in the experiments. We note that other works, such as [52] and [19], identify the importance of unsupervised learning as well, but this approach is esssentially explored only in [39]. In particular, [39] proposes an unsupervised approach specifically for graph problems where a GNN is used to learn a distribution over the graph nodes, representing a solution. In order to produce an integral solution, the authors derandomize the continuous values using sequential decoding. The method comes with theoretical guarantees, giving good and feasible solutions with high probability. However, this approach is not applicable to general MIPs, while even for the targeted graph problems it is not trivial to include general constraints. Besides, this work does not benefit from the availability of labels, which, in certain operational environments are available. On the other hand, in [52] the authors provide only a preliminary evaluation with training datasets that might include noisy labels (obtained from suboptimal solutions); while [19] performs an initial variable assignment and then uses neighborhood search to increase the training data without solving the problem exactly – which works under the as- sumption of locality, as the authors stress. On the contrary, MIPnet uses a semi-supervised learning approach which, apart from allowing us to expand the training dataset, enables tuning the impact of each variable on the feasibility and objective value of the problem. Another distinguishing feature of MIPnet is that, unlike all prior works, it accounts for the temporal structure across the different instances, which, as shown in the experiments, indeed enhances the model's performance. This aspect is crucial as, more often than not, the different instances that practitioners solve exhibit a temporal structure, namely problem parameters such as the commodity volumes, user requests, transportation costs or electricity prices, follow some type of diurnal pattern. We also note that the related works in Table 16 can be separated to those that use GCN in order to automate feature embedding, and to those that do not follow this approach, as e.g., [10, 11]. GCNs seem to enhance the performance and provide the means to account for dependencies across the variables and, indirectly, among the constraints as well. Finally, MIPnet is the only work that uses a Bayesian approach and a tunable confidence for performing the assignment of variables, unlike, e.g., the threshold-based variable selection rule of [19]. We note also that [52] offers the option to select different percentage ρ of the binary variables, but this decision needs to be made in advance so as to train the model accordingly. Table 16: Comparison of MIPnet with most related models. Uses GCN Vars Select Method Temporal Learning [52] [11] [19] [10] [31] [39] MIPnet Yes No Yes No Yes Yes Yes Bernoulli No Threshold-based No Threshold-based No No No No No No No Superv. Superv. Superv. Superv. Superv. Unsuperv. Bayesian (& tunable thresh.) Yes Superv. + Unsuperv. 25 Additional References [63] A. R. Karlin, N. Klein, and S. O. Gharan. A (Slightly) Improved Approximation Algorithm for Metric TSP. Arxiv, 2022. URL arXiv:2007.01409. [64] G. Dantzig, R. Fulkerson, and S. Johnson. Solution of a Large-Scale Traveling-Salesman Problem. Journal of the Operations Research Society of America, 2(4):393–410, 1954. [65] I. Koutsopoulos, T. G. Papaioannou, and V. Hatzi. Modeling and Optimization of the Smart Grid Ecosystem. Found. Trends Netw., 10(2-3), 2016. [66] Martello, Silvano and Toth, Paolo. Knapsack Problems: Algorithms and Computer Implementations. John Wiley & Sons, ISBN 978-0471924203, 1990. [67] S. Li. A 1.488 Approximation Algorithm for the Uncapacitated Facility Location Problem. Information and Computation, 222:45–58, 2013. 26
http://arxiv.org/abs/2302.10034v2
2023-10-10T05:55:10
2023-02-20T15:33:26
Over-Parameterization Exponentially Slows Down Gradient Descent for Learning a Single Neuron
We revisit the problem of learning a single neuron with ReLU activation under Gaussian input with square loss. We particularly focus on the over-parameterization setting where the student network has $n\ge 2$ neurons. We prove the global convergence of randomly initialized gradient descent with a $O\left(T^{-3}\right)$ rate. This is the first global convergence result for this problem beyond the exact-parameterization setting ($n=1$) in which the gradient descent enjoys an $\exp(-\Omega(T))$ rate. Perhaps surprisingly, we further present an $\Omega\left(T^{-3}\right)$ lower bound for randomly initialized gradient flow in the over-parameterization setting. These two bounds jointly give an exact characterization of the convergence rate and imply, for the first time, that over-parameterization can exponentially slow down the convergence rate. To prove the global convergence, we need to tackle the interactions among student neurons in the gradient descent dynamics, which are not present in the exact-parameterization case. We use a three-phase structure to analyze GD's dynamics. Along the way, we prove gradient descent automatically balances student neurons, and use this property to deal with the non-smoothness of the objective function. To prove the convergence rate lower bound, we construct a novel potential function that characterizes the pairwise distances between the student neurons (which cannot be done in the exact-parameterization case). We show this potential function converges slowly, which implies the slow convergence rate of the loss function.
[ "Weihang Xu", "Simon S. Du" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10034v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10034v2", "@rel": "related", "@type": "application/pdf" } ]
[ "Proceedings of Thirty Sixth Conference on Learning Theory, PMLR\n 195:1155-1198, 2023" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "math.OC", "stat.ML" ]
3 2 0 2 t c O 0 1 ] G L . s c [ 2 v 4 3 0 0 1 . 2 0 3 2 : v i X r a Over-Parameterization Exponentially Slows Down Gradient Descent for Learning a Single Neuron Weihang Xu* 1 Simon S. Du†2 1Institute for Interdisciplinary Information Sciences, Tsinghua University. 2Paul G. Allen School of Computer Science and Engineering, University of Washington October 11, 2023 Abstract We revisit the problem of learning a single neuron with ReLU activation under Gaussian input with square loss. We particularly focus on the over-parameterization setting where the student network has n ≥ 2 neurons. We prove the global convergence of randomly initial- ized gradient descent with a O (cid:0)T −3(cid:1) rate. This is the first global convergence result for this problem beyond the exact-parameterization setting (n = 1) in which the gradient descent en- joys an exp(−Ω(T )) rate. Perhaps surprisingly, we further present an Ω (cid:0)T −3(cid:1) lower bound for randomly initialized gradient flow in the over-parameterization setting. These two bounds jointly give an exact characterization of the convergence rate and imply, for the first time, that over-parameterization can exponentially slow down the convergence rate. To prove the global convergence, we need to tackle the interactions among student neurons in the gradient descent dynamics, which are not present in the exact-parameterization case. We use a three-phase structure to analyze GD's dynamics. Along the way, we prove gradient descent automatically balances student neurons, and use this property to deal with the non-smoothness of the ob- jective function. To prove the convergence rate lower bound, we construct a novel potential function that characterizes the pairwise distances between the student neurons (which cannot be done in the exact-parameterization case). We show this potential function converges slowly, which implies the slow convergence rate of the loss function. 1 Introduction In recent years, theoretical explanations of the success of gradient descent (GD) on training deep neural networks emerge as an important problem. A prominent line of work Allen-Zhu et al. [2018], Du et al. [2018c], Jacot et al. [2018], Safran and Shamir [2018], Chizat et al. [2019] sug- gests that over-parameterization plays a key role in the successful training of neural networks. *[email protected]. Part of this work was done while W. Xu was visiting University of Washington. †[email protected] 1 However, the drawback of over-parameterization is under-explored. In this paper, we consider training two-layer ReLU networks, with a particular focus on learning a single neuron in the over- parameterization setting. We give a rigorous proof for the following surprising phenomenon: Over-parameterization exponentially slows down the convergence of gradient descent. Specifically, we consider two-layer ReLU networks with n neurons and input dimension d: n (cid:88) [w⊤ i x]+, x → (1) i=1 where [x]+ = max{0, x} denotes the ReLU function, w1, . . . , wn ∈ Rd are n neurons. The input x ∼ N (0, I) follows a standard Gaussian distribution. We consider the teacher-student setting, where a student network is trained to learn a ground truth teacher network. Following the architecture (1), the student network f : Rd → R is given by f (x) = (cid:80)n i x]+, where w1, . . . , wn ∈ Rd are n student neurons. Similarly, the teacher i=1[w⊤ network is given by f ∗(x) = (cid:80)m i x]+, where v1, . . . , vm ∈ Rd are m teacher neurons. It is natural to study the square loss: i=1[v⊤ L(w) = Ex∼N (0,I)   1 2 (cid:32) n (cid:88) [w⊤ i x]+ − i=1 (cid:33)2  , [v⊤ i x]+ m (cid:88) i=1 (2) 1 , w⊤ 2 , . . . , w⊤ where w = (w⊤ n )⊤ ∈ Rn×d denotes the parameter vector formed by student neurons. In this paper, we focus on the special case where the teacher network consists of one single neuron v1, i.e., m = 1. For simplicity, we omit the subscript and denote v1 with v. The student network is initialized with a Gaussian distribution: ∀1 ≤ i ≤ n, wi(0) ∼ N (0, σ2I), (σ ∈ R+ denotes the initialization scale), then trained by gradient descent with a step size η. In this widely-studied setting, we discover a new phenomenon: compared to the exact-parameterized case (n = 1), the loss L(w(t)) converges much slower in the over-parameterized case. Empirically (see Figure 1), the slow-down effect happens universally for all n ≥ 2. Moreover, log(ηT ) L(w(T )) has a tendency of converging towards −3, which seems to suggest that the convergence rate should be L(w(T )) = Θ(T −3). For the exact-parameterized case (n = 1), Yehudai and Ohad [2020] proved that L(w(t)) convergences with a linear rate: L(w(t)) ≤ exp (−Ω(t)), which is also validated in Figure 1. For the over-parameterized case, an exact characterization of the convergence rate is given in this paper as L(w(t)) = Θ(t−3). As a result, we show that (even very mild) over-parameterization exponentially slows down the convergence rate. Specifically, our main results are the following two theorems. √ Theorem 1 (Global Convergence, Informal). For ∀δ > 0, suppose the dimension d = Ω(log(n/δ)), d, n−1, ∥v∥−1). the initialization scale 1 σ Then with probability at least 1 − δ, gradient descent converges to a global minimum with rate L(w(t)) ≤ poly(n, ∥v∥, η−1)t−3. √ d = poly(n−1)∥v∥, the learning rate η = poly(σ √ 1Note that ∥wi(0)∥ scales with σ d rather than σ. 2 Figure 1: Setting: σ = 0.1, η = 0.05, ∥v∥ = 1. Left: The loss converges much slower when n > 1, compared to the case of n = 1. Right: log(ηT ) L(w(T )) converges to −3, with a small C (ηT )3 ∈ (−3 − ε, −3 + ε), then perturbation that converges extremely slow (note if we want log(ηT ) T ≥ 1 η C 1/ε is needed.) Theorem 2 (Convergence Rate Lower Bound, Informal). Suppose the student network is over- parameterized, i.e., n ≥ 2. Consider gradient flow: ∂w(t) ∂w . If the requirements on d and σ in Theorem 1 hold, then with high probability, there exist constants Γ1, Γ2 which do not depend on time t, such that ∀t ≥ 0, L(w(t)) ≥ (Γ1t + Γ2)−3. ∂t = − ∂L(w(t)) Theorem 1 shows the global convergence of GD, while Theorem 2 provides a convergence rate lower bound. These two bounds together imply an exact characterization of the convergence rate for GD. We further highlight the significance of our contributions below: • To our knowledge, Theorem 1 is the first global convergence result of gradient descent for the square loss beyond the special exact-parameterization cases of m = n = 1 [Tian, 2017, Brutzkus and Globerson, 2017, Yehudai and Ohad, 2020, Du et al., 2017] and m = n = 2 [Wu et al., 2018]. • While over-parameterization is well-known for its benefit in establishing global convergence in the finite-data regime, this is the first work proving it can slow down gradient-based methods. 1.1 Related Works The problem of learning a single neuron is actually well-understood and can be solved with min- imal assumptions by classical single index models algorithms [Kakade et al., 2011]. For learning a single-neuron, Brutzkus and Globerson [2017], Tian [2017], Soltanolkotabi [2017] proved con- vergence for GD assuming Gaussian input distribution, which was later improved by Yehudai and Ohad [2020] who proved linear convergence of GD for learning one single neuron properly. These results are also generalized to learning a convolutional filter [Goel et al., 2018, Du et al., 2017, 2018a, Zhou et al., 2019, Liu et al., 2019]. These works only focus on the exact-parameterization setting, while we focus on the over-parameterization setting. Another direction focuses on the optimization landscape. Safran and Shamir [2018] showed spurious local minima exists for large m in the exact-parameterization setting. Safran et al. [2020] studied problem (2) with orthogonal teacher neurons. They showed that neither one-point strong 3 convexity nor Polyak-Łojasiewicz (PL) condition hold locally near the global minimum. Wu et al. [2018] showed that problem (2) has no spurious local minima for m = n = 2. Zhong et al. [2017], Zhang et al. [2019] studied the exact-parameterization setting and showed the local strong convexity of loss and therefore with tensor initialization, GD can converge to a global minimum. Arjevani and Field [2022] proved that over-parameterization annihilates certain types of spurious local minima. A popular line of works, known as neural tangent kernel (NTK) [Jacot et al., 2018, Chizat et al., 2019, Du et al., 2018c, 2019, Cao and Gu, 2019, Allen-Zhu et al., 2019, Arora et al., 2019, Oymak and Soltanolkotabi, 2020, Zou et al., 2020, Li and Liang, 2018] connects the training of ultra- wide neural networks with kernel methods. Another line of works uses the mean-field analysis to study the training of infinite-width neural networks [Nitanda and Suzuki, 2017, Chizat and Bach, 2018, Wei et al., 2019, Nguyen and Pham, 2020, Fang et al., 2021, Lu et al., 2020]. All of these works considered the finite-data regime and require the neural network to be ultra-wide, sometimes infinitely wide. Their techniques cannot explain the learnability of a single neuron, as pointed out by Yehudai and Shamir [2019]. More related to our works are results on the dynamics of gradient descent in the teacher-student setting. Li and Yuan [2017] studied the exact-parameterized setting and proved convergence for SGD with initialization in a region near identity. Li et al. [2020] showed that GD can learn two- layer networks better than any kernel methods, but their final upper bound of loss is constantly large and no convergence is proven. Zhou et al. [2021] proved local convergence for mildly over- parameterized two-layer networks. While our global convergence analysis uses their idea of es- tablishing a gradient lower bound, we also propose new techniques to get rid of their architectural modifications, and improved their gradient lower bound to yield a tight convergence rate upper bound (see Section 2 for details). Also, Zhou et al. [2021] only provided a local convergence the- ory, while we prove convergence globally. On the other hand, their results hold for general m ≥ 1 whereas we only study m = 1. The first phase of our analysis is similar to the initial alignment phenomenon in Boursier et al. [2022]. Their analysis also relies on the finite-data regime and the orthogonality of inputs, hence does not apply to our setting. Similar slow-down effects of over-parameterization on the convergence rate have been ob- served in other scenarios. Richert et al. [2022] considered error function activation and empirically observed an O(T −2) convergence rate. Going beyond neural network training, Dwivedi et al. [2018], Wu and Zhou [2019] showed such a phenomenon for Expectation-Maximization (EM) al- gorithm on Gaussian mixture models. Zhang et al. [2022] exhibited similar empirical behaviors of GD on Burer–Monteiro factorization, but no rigorous proof was given. Paper Organization. In Section 2 we describe the main technical challenges in our analysis, and our ideas for addressing them. In section 3 we define some notations and preliminary notions. In Section 4 we formalize the global convergence result (Theorem 1) and provide a proof sketch. In Section 5 we formalize the convergence rate lower bound (Theorem 2) and provide a proof sketch. 2 Technical Overview Three-Phase Convergence Analysis. phases. We define θi as the angle between wi and v, and H := ∥v∥ − (cid:80) Our global convergence analysis is divided into three i⟨wi, v⟩. Intuitively, 4 √ θi represents the radial difference between teacher and students, while H represents the tangential difference between teacher and students. When the initialization σ d is small enough, in phase 1, for every i ∈ [n], θi decreases to a small value while ∥wi∥ remains small. In phase 2, ∀i ∈ [n], θi remains bounded by a small value while H decreases with an exponential rate. Both θi and H being small at the end of phase 2 implies that GD enters a local region near a global minimum. In phase 3, we establish the local convergence by proving two properties: a lower bound of gradient, and a regularity condition of student neurons. Non-Benign Optimization Landscape. Compared to the exact-parameterization setting, the opti- mization landscape becomes significantly different and much harder to analyze when the network is over-parameterized. Zhou et al. [2021] provided an intuitive illustration for this in their Section 4. For the general problem (2), Safran et al. [2020] showed that nice geometric properties that hold when m = n, including one-point strong convexity and PL condition, do not hold when m < n. In this paper, we go further and show that the difference in geometric landscape leads to totally different convergence rates. Non-smoothness and Implicit Regularization. The loss function is not smooth when student neurons are close to 0, which brings a major technical challenge for a local convergence analysis. Zhou et al. [2021] reparameterized the student neural network architecture to make the loss L smooth. We show this artificial change is not necessary. Our observation is that GD implicitly regularizes the student neurons and keeps them away from the non-smooth regions near 0. To prove this, we show that wi cannot move too far in phase 3, by applying an algebraic trick to upper- bound (cid:80)∞ t=T η∥∇wiL(w(t))∥ with L(w(T )) (Lemma 22). A similar regularization property for GD was given in Du et al. [2018b], but it applies layer-wise rather than neuron-wise as in our paper. Improving the Gradient Lower Bound. In our local convergence phase, we establish a local gradient lower bound similar to Theorem 3 in Zhou et al. [2021]. Moreover, we improve their bound from ∥∇wL(w)∥ ≥ Ω(L(w)) to ∥∇wL(w)∥ ≥ Ω(L2/3(w)) (Theorem 7). The idea in Zhou et al. [2021] is to pick an arbitrary global minimum {w∗ i⟨∇wiL(w), wi − w∗ i }n i=1 such that ∥wi −w∗ i ∥ is small, then applying Cauchy inequality to get a tighter bound. This improvement is crucial since it improves the final bound of convergence rate from L = O(T −1) in Zhou et al. [2021] to L = O(T −3), which matches the lower bound in Theorem 2. This also indicates the optimality of the improved dependency L2/3. Non-degeneracy Condition. While the lower bound for the convergence rate is straightforward to prove in the worst-case (i.e., from a bad initialization), the average-case (i.e., with random initialization) lower bound is highly-nontrivial due to the existence of several counter-examples in the benign cases (see Section 5.1). To distinguish these counter-examples from general cases, we establish a new non-degeneracy condition and build our lower bound upon it. We define a potential function Z(t) = (cid:80) i<j ∥zi(t) − zj(t)∥, where zi := wi − ⟨wi, v⟩v. As long as the initialization is non-degenerate (See Definition 11), then Z(t) = Ω(t−1) and L(w(t)) ≥ Ω(Z 3(t)n−5/∥v∥), which imply L(w(t)) ≥ Ω(t−3). Intuitively, the slow convergence rate of L when n ≥ 2 is due to the slow convergence of term zi − zj, (i ̸= j), and we define Z(t) to formalize this idea. i ⟩ ≥ L(w). We improve their proof technique by carefully choosing a specific {w∗ i=1 and show (cid:80) i }n 5 3 Preliminaries In this paper, bold-faced letters denote vectors. We use [n] to denote {1, 2, . . . , n}. Notations. For any nonzero vector v ∈ Rd, the corresponding normalized vector is denoted with v := v ∥v∥. For two nonzero vectors w, v ∈ Rd, θ(w, v) := arccos (⟨w, v⟩) denotes the angle between them. For simplicity, we also adopt some notational conventions. Denote the gradient of the ith stu- dent neuron with ∇i := ∂L(w) . For any variable w that changes during the training process, w(t) ∂wi denotes its value at the tth iteration, e.g., wi(t) indicates the value of wi at the tth iteration. Some- times we omit the iteration index t when this causes no ambiguity. We abbreviate the expectation taken w.r.t the standard Gaussian as Ex[*] := Ex∼N (0,I)[*]. Special Notations for Important Terms. There are several important terms in our analysis and we give each of them a special notation. θi := θ(wi, v) denotes the angle between wi and v. θij := θ(wi, wj) denotes the angle between wi and wj. Define r := n (cid:88) i=1 wi − v, and R : Rd → R, R(x) := n (cid:88) j=1 [w⊤ j x]+ − [v⊤x]+. Then L(w) = Ex[ 1 2R2(x)]. Define the length of the projection of wi onto v as hi = ⟨wi, v⟩. Lastly, define H := ∥v∥ − (cid:88) i∈[n] hi = ⟨v, −r⟩. Closed Form Expressions of Loss and Gradient. When the input distribution is standard Gaus- sian, closed form expressions of L(w) and ∇L(w) can be obtained [Safran and Shamir, 2018]. The complete form is deferred to Appendix A. Here we only present the closed form of gradient as it is used extensively in our analysis: Safran and Shamir [2018] showed that when wi ̸= 0, ∀i ∈ [n], the loss function is differentiable with gradient given by: ∇i = 1 2 (cid:32) (cid:88) j (cid:33) wj − v + (cid:34)(cid:32) 1 2π (cid:88) j̸=i ∥wj∥ sin θij − ∥v∥ sin θi wi − (cid:33) (cid:35) θijwj + θiv . (3) (cid:88) j̸=i 4 Proof Overview: Global Convergence In this section we provide a proof sketch for Theorem 1. Full proofs for all theorems and lemmas can be found in the Appendix. We start with the initialization. 4.1 Initialization We need the following conditions, which hold with high probability by random initialization. Lemma 3. Let s1 := 1 the following properties hold at the initialization: d. When d = Ω(log(n/δ)), with probability at least 1 − δ, d, s2 := 2σ 2σ √ √ ∀i ∈ [n], s1 ≤ ∥wi(0)∥ ≤ s2, and π 3 ≤ θi(0) ≤ 2π 3 . (4) 6 Condition (4) gives upper bound s2 and lower bound s1 for the norms of wi(0), and states θi 3 ] initially. These are standard facts in high-dimensional probability. will fall in the interval [ π See Appendix E.1 for proof details. The rest of our analysis will proceed deterministically. 3 , 2π 4.2 Phase 1 We present the main theorem of Phase 1, which starts at time 0 and ends at time T1. Theorem 4 (Phase 1). Suppose the initial condition in Lemma 3 holds. For any ε1 = O(1), (ε1 > , by 0), there exists C = O setting T1 := C η , the following holds for ∀1 ≤ i ≤ n, 0 ≤ t ≤ T1: such that for any σ = O (cid:0)Cε48 1 d−1/2∥v∥(cid:1) and η = O (cid:16) nCσ ∥v∥ (cid:16) ε2 1 n (cid:17) (cid:17) √ d s1 ≤ ∥wi(t)∥ ≤ s2 + 2η∥v∥t, and sin2 (cid:19) (cid:18) θi(t) 2 (cid:18) 1 + − ε2 1 ≤ ηt s2/∥v∥ (cid:19)−1/24 (cid:18) sin2 (cid:19) (cid:18) θi(0) 2 (cid:19) . − ε2 1 Consequently, at the end of Phase 1, we have ∀i ∈ [n], θi(T1) ≤ 4ε1, and hi(T1) ≤ 2hj(T1), ∀i, j ∈ [n]. (5) (6) (7) (8) (5) gives upper and lower bounds for ∥wi∥. (6) is used to bound the dynamics of θi. (7) shows that θi is small at the end of Phase 1, so the student neurons are approximately aligned with the teacher neuron. (8) states that the student neurons' projections on the teacher neuron are balanced. Now we briefly describe our proof ideas. Proof of (5). Proving the upper bound of ∥wi∥ is straightforward, since triangle inequality implies an upper bound of gradient norm ∥∇i∥ = O(∥v∥ + (cid:80) i ∥wi∥), and the increasing rate of ∥wi∥ is bounded by η∥∇i∥. Note that we use ∥wi∥ to upper bound ∥∇i∥, and use ∥∇i∥ to upper bound ∥wi∥, so the argument can proceed inductively. Given with the upper bound, we know that ∥wi∥ = O(η∥v∥t) = O(ε2 1∥v∥/n) is a small term. Then the gradient (3) can be rewritten as: ∇i = − 1 2π (∥v∥ sin θiwi + (π − θi)v) + O(ε2 1∥v∥2). (9) With (9), we prove the lower bound ∥wi∥ ≥ s1 by showing that ∥wi∥ monotonically increases. Proof of (6). The condition (6) aims to show that θi would decrease. Our intuition is clear: Since in each GD iteration, the update of wi (the inverse of gradient (9)) is approximately a linear combination of wi and v, the angle between wi and v is going to decrease. However, there is a technical difficulty when converting the above intuition into a rigorous proof, which is caused by the small perturbation term O(ε2 1∥v∥2) in (9). When θi is large, showing θi would decrease is easy since this term is negligible. But when θi is too small, the effects of this perturbation term on the dynamics of θi is no longer negligible. As a result, we cannot directly show that θi decreases monotonically. Instead, we prove a weaker condition on the dynamics of 7 θi and perform an algebraic trick (See (32) (33) in Appendix B). Define χi(t) := sin2 (cid:16) θi(t) have 2 (cid:17) . We χi(t) − χi(t + 1) ≥ ⇒χi(t + 1) − ε2 1 ≤ (cid:18) η∥v∥ 12∥wi(t + 1)∥ (cid:0)χi(t) − ε2 1 (cid:1) 1 − η∥v∥ 12∥wi(t + 1)∥ (cid:19) (cid:0)χi(t) − ε2 1 (cid:1) . (10) (cid:16) (cid:17) 12∥wi(t′)∥ 1 − η∥v∥ (χi(0) − ε2 1) (even if χi(t) − ε2 1, hence both cases of θi being large and θi 1 ≤ 1 might be negative for some t). This bound, Note that (10) holds regardless of the sign of χi(t) − ε2 being small are gracefully handled. Therefore we can apply (10) iteratively to get χi(t + 1) − ε2 Πt+1 t′=1 combined with algebraic calculations, yields (6). Proof of (7). Applying (6) with t = T1 and some basic algebraic calculations yields (7). Proof of (8). To prove (8), we divide Phase 1 into two intervals: [0, T1/50] and [T1/50, T1]. We first show that θi remains small in the second interval: [T1/50, T1]. Given with θi being small, nice properties of the gradient implies that hi monotonically increases, and its increasing rate approximately equals η 2 H (see (35)), which is identical for all i. Therefore, the increases of hi in the second interval: hi(T1) − hi(T1/50) are balanced. Then we show that hi(T1/50) is small compared to hi(T1) − hi(T1/50). These two properties together shows that hi(T1) are balanced. 4.3 Phase 2 Our second phase starts at time T1 + 1 and ends at time T2. The main theorem is as follows. Theorem 5 (Phase 2). Suppose the initial condition in Lemma 3 holds. For ∀ε2 = O(1), set ε1 = O (cid:0)ε6 , then ∀T1 ≤ t ≤ T2, 2n−1/2(cid:1) in Theorem 4, η = O and T2 = T1 + (cid:16) ε2 (cid:108) 1 nη ln 1σ2d ∥v∥2 (cid:16) 1 36ε2 (cid:17)(cid:109) (cid:17) hi(t) ≤ 2hj(t), ∀i, j, (11) (cid:17)t−T1 (cid:16) 1 − nη 2 ∥v∥ + 6ε2∥v∥ ≥ H(t) ≥ ∥v∥ − 6ε2∥v∥ ≥ 18ε2∥v∥, (12) (cid:17)t−T1 (cid:16) 2 3 1 − nη 2 s1 2 θi(t) ≤ ε2, ∀i. ≥ hi(t) ≥ 2∥v∥ n , ∀i. (13) (14) (11) is the continuation of (5), which shows that the projections hi remain balanced in Phase 2. (12) bounds the dynamics of H(t). It shows that H(t) exponentially decreases and gives upper and lower bounds. (13) gives upper and lower bounds for hi. (14) shows that θi remains upper bounded by a small term ε2 in Phase 2. Below we prove (11) (12) (13) (14) together inductively. Proof of (11). Similar to (8), note that (14) guarantees that θi is small, so we still have that, for ∀i, hi monotonically increases with rate approximately η Proof of (12). To understand why we need the bound (12), note that the gradient (3) has the following property: 2 H. Therefore, hi will remain balanced. ∇i = 1 2 r + O((n max i ∥wi∥ + ∥v∥) max i θi). (15) 8 By (13) and (14), maxi θi ≤ ε2, and maxi ∥wi∥ = O(∥v∥/n). So the second term in (15) can be bounded as O((n maxi ∥wi∥ + ∥v∥) maxi θi) ≤ O(ε2∥v∥). When O(ε2∥v∥) is much smaller than the first term r/2 in (15), we have ∇i ≈ r/2. Consequently, r and H = ⟨v, −r⟩ will decrease with an exponential rate. But this will end when r becomes no larger than O(ε2∥v∥) and the approximation ∇i ≈ r/2 no longer holds, and that is the end of Phase 2. So H should decrease (with exponential rate) to a small value, and it also should not be too small to ensure that ∥r/2∥ ≫ O(ε2∥v∥) (since H = ⟨v, −r⟩). So we need to use (12) to simul- taneously upper and lower bound H. With the above intuition, proving (12) is straightforward as: ∇i ≈ r/2 ⇒ H(t + 1) ≈ (1 − nη/2)H(t) ≈ * * * ≈ (1 − nη/2)t−T1H(T1). It is worth noting that, we also need to handle a perturbation term when bounding the dynamics of H(t), and we used the same trick as in proving (6). Proof of (13). The left inequality can be derived from (11) and (12). The right inequality can be derived from the monotonicity of hi, (14) and (5). Proof of (14). This is the most difficult part in Theorem 5. Recall that in Phase 1 we used the gradient approximation (9) to bound θi, but (9) relies on ∥wi∥ being a small term, which only holds in phase 1. So this time we use a totally different method to bound θi. First we calculate the dynamics of cos θi and get (see the proof in Appendix C for details): cos(θi(t+1))−cos(θi(t)) = I1 +I2, where term I1 ≥ − η ∥wi(t+1)∥, 2 and term I2 is a small perturbation term. The next step is to establish the condition (11), then use it to bound the term ∥wj (t)∥ j̸=i sin θi(t) sin(θi(t)+θj(t)) ∥wj (t)∥ ∥wi(t+1)∥ in I1. Consequently, we have (cid:80) cos(θi(t + 1)) − cos(θi(t)) = I1 + I2 ≥ −2η (cid:88) j̸=i sin θi(t)(sin θi(t) + sin θj(t)) + I2. (16) However, this is still not enough to prove the bound. The lower bound of the dynamics of cos θi in (16) depends on θj where j ̸= i. Since θj might be much larger then θi, the increasing rate of θi still cannot be upper-bounded. To solve this problem, our key idea is to consider all θi's together. Define a potential function V (t) := (cid:80) i sin2 (θi(t)/2), then we can sum the bound in (16) over all i's to get an upper bound for the increasing rate of V . Although the bound for θi depends on other θj's, the bound for V only depends on V itself. Consequently, the dynamics of the potential function V can be upper bounded, which yields the final upper bound (14). 4.4 Phase 3 Theorem 6 (Phase 3). Suppose the initial condition in Lemma 3 holds. If we set ε2 = O(n−14) in Theorem 5, η = O (cid:0) 1 n2 (cid:1), then ∀T ∈ N we have 4∥v∥ n ≥ ∥wi(T + T2)∥ ≥ ∥v∥ 4n and L(T + T2) ≤ O (cid:18) n4∥v∥2 (ηT )3 (cid:19) . (17) This is the desired 1/T 3 convergence rate. Our analysis consists of two steps: 1. Prove a gradient lower bound ∥∇L(w)∥ ≥ poly(n−1, ∥v∥−1)L2/3(w). 2. Prove that the loss function is smooth and Lipschitz on the gradient trajectory. Given these two properties, the convergence can be established via the standard analysis for GD. 9 4.4.1 Step 1: Gradient Lower Bound. Theorem 7 (Gradient Lower Bound). If for every student neuron we have 4∥v∥ and L(w) = O , then ∥∇wL(w)∥ ≥ Ω (cid:16) L2/3(w) n2/3∥v∥1/3 (cid:16) ∥v∥2 n14 (cid:17) (cid:17) . n ≥ ∥wi∥ ≥ ∥v∥ 4n , As stated in Section 2, this theorem is an improved version of Theorem 3 in Zhou et al. [2021], improving the dependency of L from ∥∇wL(w)∥ ≥ Ω(L(w)) to ∥∇wL(w)∥ ≥ Ω(L2/3(w)). Below we introduce our idea of improving the bound. Lemma 8 (Gradient Projection Bound). Suppose w∗ function L. Define θmax := maxi∈[n] θi, then 1, w∗ 2, . . . , w∗ n is a global minimum of loss n (cid:88) i=1 (cid:28) ∂ ∂wi L(w), wi − w∗ i (cid:29) ≥ 2L(w) − O (cid:0)θ2 max∥r∥ * ∥v∥(cid:1) . (18) 1, w∗ 2, . . . , w∗ Lemma 8 uses the idea of "descent direction" from Lemma C.1 in Zhou et al. [2021]. The idea is to pick a global minimum w∗ n and lower bound the projection of gradient on the direction wi − w∗ i . Recall that Zhou et al. [2021] made artificial modifications of the network architecture for technical reasons, e.g., they used the absolute value activation x → |x| instead of ReLU. Therefore, their proof cannot be directly applied to our lemma. However, we show that their idea still works in our setting, and modified their proof to prove Lemma 8 in Appendix D.2. With Lemma 8 and several technical lemmas (Lemma 18, 19 in Appendix D.2), it is easy show (cid:68) ∂ that the last term O (θ2 ≥ L(w). ∂wi Then we need to upper bound ∥wi − w∗ i ∥, and that is the step where we make the improvement. In Zhou et al. [2021], they picked an arbitrary global minimum {w∗ i=1 and treated the term i ∥ as constantly large. Consequently, their gradient lower bound scale with L−1, yielding ∥wi − w∗ a final convergence rate of L(w(T )) ≤ O(T −1). In contrast, our key observation is that we can pick a specific global minimum {w∗ max∥r∥ * ∥v∥) in (18) is small, so (cid:80)n L(w), wi − w∗ i i=1 that depends on {wi}n i=1. Specifically, we define i }n i }n i=1 (cid:69) ∀i ∈ [n], w∗ i := hi j hj (cid:80) v. Then Lemma 20 shows that ∥wi − w∗ Finally, direct application of Cauchy inequality yields the improved bound Theorem 7. i ∥ ≤ O(L1/3(w)) is a small term rather than a constant term. 4.4.2 Step 2: Smoothness and Lipschitzness The aim of step 2 is to show the smoothness and Lipschitzness of L. However, one can see from (3) that L is neither Lipschitz nor smooth. The problem of non-Lipschitzness is easy to address, since (3) implies that ∥∇L∥ is upper bounded by ∥wi∥, and ∥wi∥ is upper bounded by L(w). However, the non-smoothness property of L is hard to handle. By the closed form expression of ∇2L (see (50)), one can see that ∥∇2L∥ scales with ∥v∥ ∥wi∥. Then ∥∇2L∥ → ∞ as ∥wi∥ → 0. As stated in Section 2, our idea of solving this problem is to show that GD implicitly regularizes wi such that ∥wi∥ is always lower and upper bounded, namely (17) in Theorem 6. This property ensures the smoothness of L on GD trajectory (see Lemma 21 for details). 10 t=T2 Implicit Regularization of Student Neurons. Next we describe our idea of proving the implicit regularization condition (17). It is not hard to give ∥wi(T2)∥ lower and upper bounds (see Lemma 17). Therefore, we only need to show that the student neurons do not move very far in phase 3. In other words, we wish to bound (cid:80)T η∥∇L(w(t))∥ for ∀T > T2. The intuition is very clear: in phase 3, the loss being small implies that the decrease of loss is small. Since the move of student neurons results in the decrease of loss, the change of ∥wi∥ should also be small. However, the following subtlety emerges when constructing a rigorous proof. The Importance of the Improved Gradient Lower Bound. We want to emphasize that our improved gradient lower bound (Theorem 7) is crucial for bounding the movement of student neurons (cid:80)T η∥∇L(w(t))∥. There is an intuitive explanation for this: The weaker bound ∥∇L(w(t))∥ ∼ L(w(t)) implies the rate L(w(T )) ∼ 1 T (i.e., the rate in Zhou et al. [2021]). 1 Then ∥∇L(w(t))∥ ∼ L(w(t)) ∼ 1 t . But the infinite sum (cid:80)∞ η∥∇L(w(t))∥ ∼ (cid:80)T T and (cid:80)T 1 t diverges, so we cannot derive any meaningful bound. t=T2 On the other hand, the improved gradient lower bound ∥∇L(w(t))∥ ∼ L2/3(w(t)) implies the T 3 ⇒ ∥∇L(w(t))∥ ∼ L2/3(w(t)) ∼ 1 η∥∇L(w(t))∥ ∼ 1 t2 , which is finite. See Lemma 22 for the rigorous argument. convergence rate L(w(T )) ∼ 1 (cid:80)T T 2 ⇒ (cid:80)T t=T2 t=T2 t=T2 t=T2 t=T2 4.5 Main Theorem Now we are ready to state and prove the formal version of Theorem 1. Theorem 9 (Global Convergence). For ∀δ > 0, if d = Ω(log(n/δ)), σ = O (cid:0)n−4226d−1/2∥v∥(cid:1) , (cid:16) log n such that with probability at least 1 − δ over η = O nη , then there exists T2 = O (cid:16) σ2d n169∥v∥2 (cid:17) (cid:17) the initialization, for any T ∈ N, L(w(T + T2)) ≤ O (cid:16) n4∥v∥2 (ηT )3 (cid:17) . To combine three phases of our analysis together, the last step is to assign values to the parame- ters in Theorem 4, 5, 6 (ε2, ε1, C, σ, η, T1, T2) such that the previous phase satisfies the requirements of the next phase. For a complete list of the values, we refer the readers to Appendix E.2. With the parameter valuations in Appendix E.2, combining the initialization condition (Lemma 3) and three phases of our analysis (Theorem 4, 5, 6) together proves Theorem 9 immediately. Remark 10. Careful readers might notice that, if there exists i such that wi = 0, then L is not differentiable and gradient descent is not well-defined. However, such a corner case has been naturally excluded in our previous analysis. (See Appendix E.3 for a detailed discussion.) 5 Proof Overview: Convergence Rate Lower Bound In this section, we provide a general overview for the convergence rate lower bound. Full proofs of all theorems can be found in Appendix F. We consider the gradient flow (gradient descent with infinitesimal step size): ∂w(t) ∂t = − ∂L(w(t)) ∂w , ∀t ≥ 0, while keeping other settings (network architecture, initialization scheme, etc.) unchanged. To understand why over-parameterization causes a significant change of the convergence rate, we first investigate several toy cases. 11 5.1 Case study Set n = 2, w1(0) = λ1(0)v + λ2(0)v⊥, w2(0) = λ1(0)v − λ2(0)v⊥, where Toy Case 1. λ1(0), λ2(0) > 0, v⊥ is a vector orthogonal with v such that ∥v⊥∥ = ∥v∥. Then w1(0) and w2(0) are reflection symmetric with respect to v (See Figure 2). Consider gradient descent with step size η initialized from (w1(0), w2(0)). It is easy to see that the symmetry of w1 and w2 is preserved in GD update, so for t = 0, 1, 2, . . . there exists λ1(t), λ2(t) such that w1(t) = λ1(t)v + λ2(t)v⊥, w2(t) = λ1(t)v − λ2(t)v⊥. Since θ1(t) = θ2(t), ∀t ∈ N, we denote θ := θ1 = θ2. Then gradient (3) has the form (cid:19) (cid:18) [(∥w2∥ sin(2θ) − ∥v∥ sin θ) w1 − 2θw2 + θv] sin(2θ) − (cid:19) (cid:19)(cid:19) λ1 − θ(2λ1 − 1) v sin θ ∇1 = = (cid:18) λ1 − λ1 − 1 2π (cid:18)(cid:18) v + + 1 2π 1 2 1 2 (cid:18) 1 2π + (cid:18) = λ1 − 2θ + sin(2θ) − (cid:19) (cid:18) 1 − 1 2 θ π + ∥v∥ ∥w1∥ sin(2θ) λ1 ∥v∥ ∥w1∥ (cid:19) sin θ (cid:19) v + λ2v⊥ (cid:18) 2θ + 1 2π (cid:19) sin(2θ) λ1 − 1/2 λ1 λ1∥v∥/ cos θ sin θ = sin(2θ) λ2v⊥, λ1 (cid:0)λ1 − 1 2 (cid:1). (cid:19)(cid:19) , (19) θ(t) π + sin(2θ(t)) λ1(t) (cid:19)(cid:19) where the last equality is because sin(2θ)− ∥v∥ A similar expression can be computed for ∇2. ∥w1∥ sin θ = sin(2θ)− ∥v∥ Then we can write out the dynamics of λ1 and λ2 as (cid:18) (cid:19) (cid:18) (cid:18) λ1(t + 1) − = λ1(t) − 1 − η 1 − 1 2 1 2 (cid:18) (cid:18) 1 − 2θ + η 2π λ2(t + 1) = λ2(t) Since θ = o(1), λ1 is a constant term, 1 − θ(t) λ1 − 1/2 λ1 λ1(t) ≈ 1, then (19) implies 2 λ1(t + 2 exponentially fast. So ≈ λ2. Then (20) can be rewritten 2π λ2(t)(cid:1) . This indicates that λ2 converges to 0 with rate λ2(t) ∼ t−1. Finally, we can compute the loss with (22) as L(w) = Θ ((2λ1 − 1)2 + (sin θ − θ cos θ)) ∥v∥2. (cid:1) (1 − η). This indicates that λ1 converges to 1 sin(2θ) ≈ 2θ ≈ 2 tan θ = 2 λ2 λ1 2 ≈ (cid:0)λ1(t) − 1 1) − 1 λ1 − 1/2 = o(1) ⇒ 2θ + λ1−1/2 as λ2(t + 1) ≈ λ2(t) (cid:0)1 − η π + sin(2θ(t)) sin(2θ) (20) λ1 . 2 2((cid:80) j wj − v). One can easily see that (cid:80) 2 ∼ t−3, we know that the convergence rate is L(w(t)) ∼ t−3. Since (sin θ − θ cos θ) ∼ θ3 ∼ λ3 Toy Case 2. Let n ≥ 2. We consider the case where all student neurons are parallel with the teacher neuron: w1 = λ1v, . . . , wn = λnv, where λ1, . . . , λn ∈ R+. Then the gradient (3) becomes ∇i = 1 i∈[n] λi converges exponentially fast to 0, which means that the convergence rate in this toy case is actually linear. Toy Case 3. Let n ≥ 2. We consider the case where all student neurons are equal: w1 = w2 = . . . = wn. Then the gradient (3) becomes ∇i = 1 2π [−∥v∥ sin θiwi + θiv]. One can see that the gradient in this case is just n times the gradient in the single student neuron case where the student neuron is wi and the teacher neuron is v/n. So the training process is actually equivalent with learning one teacher neuron ∥v∥/n with one student neuron, with the step size η being multiplied by a factor of n. So in this toy case, the loss also have linear convergence. 2(nwi − v) + 1 2Here we use the ≈ sign to omit higher order terms. 12 θ θ w1 w2 v Figure 2: Toy Case 1 5.2 Non-degeneracy Toy case 1 above already implies that the convergence rate given by Theorem 9 is worst case optimal. However, our ultimate goal is to prove an average case lower bound for the convergence rate: Theorem 12. One can see that there is a huge gap between the worst case optimality and the average case optimality. Proving the latter is much more difficult since toy case 2 and 3 exhibits fast-converging initialization points that break the Ω(T −3) lower bound. Therefore, we need to utilize the property of random initialization to show our lower bound of Ω (1/T 3). Our idea is to show the lower bound holds as long as the initialization is non-degenerate. To formalize the above idea, we first define a few important terms. For ∀i ∈ [n], define zi := wi − ⟨wi, v⟩v as the projection of wi onto the orthogonal complement of v. Define Z(t) = (cid:80) 1≤i<j≤n ∥zi(t) − zj(t)∥. Define Q+(t) := {i ∈ [n]|zi(t) ̸= 0} as the index set containing all i with zi nonzero at time t. For i, j ∈ Q+, define κij := θ(zi, zj) as the angle between zi and zj. Define κmax(t) := maxi,j∈Q+(t) κij(t) as the maximum angle between zi and zj. Definition 11 (Non-degeneracy). When n ≥ 2, we say the initialization is non-degenerate if the following two conditions are satisfied. (1) All zi's are nonzero: ∀i ∈ [n], zi(0) ̸= 0. (2) zi's are not parallel: κmax(0) > 0. Since zi's are initialized with a Gaussian distribution, the initialization is only degenerate on a set with Lebesgue measure zero, so the probability of the initialization being non-degenerate is 1. Now we are ready to state the formal version of Theorem 2 whose proof is in Appendix F.3. Theorem 12 (Convergence Rate Lower Bound). Suppose the network is over-parameterized, i.e., n ≥ 2. Consider gradient flow: ∂w(t) ∂w . For ∀δ > 0, if the initialization is non- degenerate, d = Ω(log(n/δ)), σ = O (cid:0)n−4226d−1/2∥v∥(cid:1), then there exists T2 = O (cid:0) log n (cid:1) such that with probability at least 1 − δ, for ∀t ≥ T2 we have ∂t = − ∂L(w(t)) n L(w(t))−1/3 ≤ O (cid:18) n17/3 max(0)∥v∥2/3 κ2 (cid:19) (t − T2) + γ, where γ ∈ R+ is a constant that does not depend on t. Remark 13. The bound in Theorem 12 depends on 1/κ−2 max(0). Such a dependence is reasonable since we have shown that there would be counter-examples if κmax(0) = 0 (See toy case 3 in Section 5.1). 13 5.3 Proof Sketch Our key idea of proving Theorem 12 is to consider the potential function Z(t) = (cid:88) i<j ∥zi(t) − zj(t)∥ where zi(t) := wi(t) − ⟨wi(t), v⟩v. With Z(t), our proof consists of three steps: 1. Show that with the non-degeneracy condition, κmax(t) is lower bounded. (Lemma 28) 2. Show that when κmax is lower bounded by a positive constant, ∂ Z 2(t) (See (65) in Appendix F.3), so the convergence rate of Z(t) is at most Z(t) ∼ t−1. 3. Use Z(t) to lower bound L(w(t)): L(w(t)) ≥ Ω . ((67) in Appendix F.3). (cid:17) (cid:16) Z3(t) n5∥v∥ ∂t Z(t) can be lower bounded by Remark 14. The potential function Z(t) provides two implications. • It explains why the convergence rate is different for n = 1 and n ≥ 2. For n ≥ 2, our analysis implies that the slow convergence rate of Z (Z(t) ∼ t−1) induces the slow convergence rate of L(t) ∼ t−3. When n = 1, Z is always zero, so L converges with linear rate. Intuitively, this is because optimizing the difference between student neurons is hard, which is a phenomenon that only exists in the over-parameterized case. • It explains why the convergence rates in the two counter-examples (toy case 2 and 3 in Sec- tion 5.1) are linear. In these two cases, the potential function Z degenerates to 0. We need several technical properties of the gradient flow trajectory. The first one is the implicit regularization condition: (17) in Theorem 6, and we use its gradient flow version (see Theorem 25 for details). We also need Corollary 26 and Lemma 27 to exclude the corner cases when wi = 0 and zi(t) = 0, where κmax is not well-defined. The proofs are deferred to Appendix F.1. Lower bounding κmax is the most non-trivial step. We need to use the following lemma. Lemma 15 (Automatic Separation of zi). If there exists i, j such that κij(t) = κmax(t) < π cos κij(t) is well-defined in an open neighborhood of t, differentiable at t, and 2 , then ∂ ∂t (1 − cos κ2 cos κij(t) ≤ − π − θij(t) π Lemma 15 states that, when the vectors zi are too close in direction, gradient flow will auto- matically separate them, which immediately implies a lower bound of κmax (See Theorem 28). Its proof idea is also interesting: we can easily compute the dynamics of cos κij, which splits into two terms I1 and I2 (see (60) for them). I1 is a simple term that can be handled easily, but the second term I2 is very complicated and seems intractable. Our key observation is that, although I2 is hard to bound for general i, j, it is always non-positive if we pick the pair of i, j such that κij = κmax, and that property implies Lemma 15 via some routine computations. ij(t)). (21) Remark 16. We note that in toy case 3 in Appendix 5.1, all zi's remain parallel and will not be separated. This is because the bound (21) in Lemma 15 implies that the initial condition κij = 0, ∀i, j is unstable. To see this, consider the ordinary differential equation ̇x = − ̃C(1 − x2) where ̃C > 0 is a constant. The initial condition x(0) = 1 induces the solution x(t) ≡ 1, which corresponds to toy case 3. But this initial condition is unstable since any perturbation of x(0) results in solution x(t) = 1−exp(2 ̃Ct+c0) , which implies an exponential increase of the perturbation, 1+exp(2 ̃Ct+c0) hence the separation of zi. 14 Given with a lower bound of κmax(t), and the implicit regularization property in Theorem 25, step 2 and step 3 can be proved with some geometric lemmas See Lemma 31, Lemma 29 and the proof of Theorem 12 in Appendix F. Combining three steps together finishes our proof. References Z. Allen-Zhu, Y. Li, and Y. Liang. Learning and generalization in overparameterized neural net- works, going beyond two layers, 2018. URL https://arxiv.org/abs/1811.04918. Z. Allen-Zhu, Y. Li, and Z. Song. A convergence theory for deep learning via over- parameterization. In International Conference on Machine Learning, pages 242–252. PMLR, 2019. Y. Arjevani and M. Field. Annihilation of spurious minima in two-layer relu networks. arXiv preprint arXiv:2210.06088, 2022. S. Arora, S. Du, W. Hu, Z. Li, and R. Wang. Fine-grained analysis of optimization and generaliza- tion for overparameterized two-layer neural networks. In International Conference on Machine Learning, pages 322–332. PMLR, 2019. E. Boursier, L. Pillaud-Vivien, and N. Flammarion. Gradient flow dynamics of shallow relu net- works for square loss and orthogonal inputs. arXiv preprint arXiv:2206.00939, 2022. A. Brutzkus and A. Globerson. Globally optimal gradient descent for a convnet with gaussian inputs. In International conference on machine learning, pages 605–614. PMLR, 2017. Y. Cao and Q. Gu. Generalization bounds of stochastic gradient descent for wide and deep neural networks. Advances in neural information processing systems, 32, 2019. L. Chizat and F. Bach. On the global convergence of gradient descent for over-parameterized models using optimal transport. Advances in neural information processing systems, 31, 2018. L. Chizat, E. Oyallon, and F. Bach. On lazy training in differentiable programming. Advances in neural information processing systems, 32, 2019. S. Dasgupta and L. Schulman. A two-round variant of em for gaussian mixtures, 2013. URL https://arxiv.org/abs/1301.3850. S. Du, J. Lee, Y. Tian, A. Singh, and B. Poczos. Gradient descent learns one-hidden-layer cnn: Don't be afraid of spurious local minima. In International Conference on Machine Learning, pages 1339–1348. PMLR, 2018a. S. Du, J. Lee, H. Li, L. Wang, and X. Zhai. Gradient descent finds global minima of deep neural networks. In International conference on machine learning, pages 1675–1685. PMLR, 2019. S. S. Du, J. D. Lee, and Y. Tian. When is a convolutional filter easy to learn? arXiv preprint arXiv:1709.06129, 2017. 15 S. S. Du, W. Hu, and J. D. Lee. Algorithmic regularization in learning deep homogeneous models: Layers are automatically balanced. Advances in neural information processing systems, 31, 2018b. S. S. Du, X. Zhai, B. Poczos, and A. Singh. Gradient descent provably optimizes over- parameterized neural networks, 2018c. URL https://arxiv.org/abs/1810.02054. R. Dwivedi, N. Ho, K. Khamaru, M. I. Jordan, M. J. Wainwright, and B. Yu. Singularity, misspec- ification, and the convergence rate of em, 2018. URL https://arxiv.org/abs/1810. 00828. C. Fang, J. Lee, P. Yang, and T. Zhang. Modeling from features: a mean-field framework for over-parameterized deep neural networks. In Conference on learning theory, pages 1887–1936. PMLR, 2021. S. Goel, A. Klivans, and R. Meka. Learning one convolutional layer with overlapping patches. In International Conference on Machine Learning, pages 1783–1791. PMLR, 2018. A. Jacot, F. Gabriel, and C. Hongler. Neural tangent kernel: Convergence and generalization in neural networks. Advances in neural information processing systems, 31, 2018. S. M. Kakade, V. Kanade, O. Shamir, and A. Kalai. Efficient learning of generalized linear and sin- gle index models with isotonic regression. Advances in Neural Information Processing Systems, 24, 2011. Y. Li and Y. Liang. Learning overparameterized neural networks via stochastic gradient descent on structured data. Advances in neural information processing systems, 31, 2018. Y. Li and Y. Yuan. Convergence analysis of two-layer neural networks with relu activation. Ad- vances in neural information processing systems, 30, 2017. Y. Li, T. Ma, and H. R. Zhang. Learning over-parametrized two-layer relu neural networks beyond ntk. arXiv preprint arXiv:2007.04596, 2020. T. Liu, M. Chen, M. Zhou, S. S. Du, E. Zhou, and T. Zhao. Towards understanding the impor- tance of shortcut connections in residual networks. Advances in neural information processing systems, 32, 2019. Y. Lu, C. Ma, Y. Lu, J. Lu, and L. Ying. A mean field analysis of deep resnet and beyond: Towards In International Conference on provably optimization via overparameterization from depth. Machine Learning, pages 6426–6436. PMLR, 2020. Y. Nesterov et al. Lectures on convex optimization, volume 137. Springer, 2018. P.-M. Nguyen and H. T. Pham. A rigorous framework for the mean field limit of multilayer neural networks. arXiv preprint arXiv:2001.11443, 2020. A. Nitanda and T. Suzuki. Stochastic particle gradient descent for infinite ensembles. arXiv preprint arXiv:1712.05438, 2017. 16 S. Oymak and M. Soltanolkotabi. Toward moderate overparameterization: Global convergence guarantees for training shallow neural networks. IEEE Journal on Selected Areas in Information Theory, 1(1):84–105, 2020. F. Richert, R. Worschech, and B. Rosenow. Soft mode in the dynamics of over-realizable online learning for soft committee machines. Physical Review E, 105(5):L052302, 2022. I. Safran and O. Shamir. Spurious local minima are common in two-layer ReLU neural networks. In J. Dy and A. Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 4433–4441. PMLR, 10–15 Jul 2018. URL https://proceedings.mlr.press/v80/safran18a.html. I. Safran, G. Yehudai, and O. Shamir. The effects of mild over-parameterization on the optimization landscape of shallow relu neural networks. CoRR, abs/2006.01005, 2020. URL https:// arxiv.org/abs/2006.01005. M. Soltanolkotabi. Learning relus via gradient descent. Advances in neural information processing systems, 30, 2017. Y. Tian. An analytical formula of population gradient for two-layered relu network and its ap- plications in convergence and critical point analysis. In International conference on machine learning, pages 3404–3413. PMLR, 2017. C. Wei, J. D. Lee, Q. Liu, and T. Ma. Regularization matters: Generalization and optimization of neural nets vs their induced kernel. Advances in Neural Information Processing Systems, 32, 2019. C. Wu, J. Luo, and J. D. Lee. No spurious local minima in a two hidden unit relu network. 2018. Y. Wu and H. H. Zhou. Randomly initialized em algorithm for two-component gaussian mixture achieves near optimality in O( n) iterations. arXiv preprint arXiv:1908.10935, 2019. √ G. Yehudai and S. Ohad. Learning a single neuron with gradient methods. In J. Abernethy and S. Agarwal, editors, Proceedings of Thirty Third Conference on Learning Theory, volume 125 of Proceedings of Machine Learning Research, pages 3756–3786. PMLR, 09–12 Jul 2020. URL https://proceedings.mlr.press/v125/yehudai20a.html. G. Yehudai and O. Shamir. On the power and limitations of random features for understanding neural networks. Advances in Neural Information Processing Systems, 32, 2019. G. Zhang, S. Fattahi, and R. Y. Zhang. Preconditioned gradient descent for overparameterized nonconvex burer–monteiro factorization with global optimality certification. arXiv preprint arXiv:2206.03345, 2022. X. Zhang, Y. Yu, L. Wang, and Q. Gu. Learning one-hidden-layer relu networks via gradient In The 22nd international conference on artificial intelligence and statistics, pages descent. 1524–1534. PMLR, 2019. 17 K. Zhong, Z. Song, P. Jain, P. L. Bartlett, and I. S. Dhillon. Recovery guarantees for one-hidden- In International conference on machine learning, pages 4140–4149. layer neural networks. PMLR, 2017. M. Zhou, T. Liu, Y. Li, D. Lin, E. Zhou, and T. Zhao. Toward understanding the importance of In International Conference on Machine Learning, pages noise in training neural networks. 7594–7602. PMLR, 2019. M. Zhou, R. Ge, and C. Jin. A local convergence theory for mildly over-parameterized two-layer neural network. In Conference on Learning Theory, pages 4577–4632. PMLR, 2021. D. Zou, Y. Cao, D. Zhou, and Q. Gu. Gradient descent optimizes over-parameterized deep relu networks. Machine learning, 109:467–492, 2020. 18 A Closed Form Expressions for L and ∇L In this section, we present closed forms of L and ∇L, as computed in Safran and Shamir [2018]. Closed Form of L(w). where L(w) = 1 2 n (cid:88) i,j=1 Υ(wi, wj) − n (cid:88) i=1 Υ(wi, v) + 1 2 Υ(v, v), Υ(w, v) = Ex∼N (0,I)) (cid:104)(cid:2)w⊤x(cid:3) + (cid:2)v⊤x(cid:3) (cid:105) + = 1 2π ∥w∥ ∥v∥(sin(θw,v) + (π − θw,v) cos(θw,v)). Rearranging terms yields L(w) = 1 4 ∥ (cid:88) i wi−v∥2+ 1 2π (cid:34) (cid:88) i<j (sin θij − θij cos θij)∥wi∥ ∥wj∥ − (cid:88) i (sin θi − θi cos θi)∥wi∥ ∥v∥ . (cid:35) (22) Closed Form of ∇L(w). When wi ̸= 0, ∀i ∈ [n], Safran and Shamir [2018] showed that the loss function is differentiable and the gradient is given by ∇i = Ex∼N (0,I) (cid:34)(cid:32) n (cid:88) (cid:2)w⊤ j x(cid:3) + (cid:33) − (cid:2)v⊤x(cid:3) + (cid:35) 1 (cid:8)w⊤ i x ≥ 0(cid:9) x j=1 (cid:33) wj − v + = 1 2 (cid:32) (cid:88) j (cid:34)(cid:32) 1 2π (cid:88) j̸=i ∥wj∥ sin θij − ∥v∥ sin θi wi − (cid:33) (cid:35) θijwj + θiv . (cid:88) j̸=i B Global Convergence: phase 1 Theorem 4. Suppose the initial condition in Lemma 3 holds. For any ε1 = O(1), (ε1 > 0), there exists C = O , by setting T1 := C η ,3 the following holds for ∀1 ≤ i ≤ n, 0 ≤ t ≤ T1: such that for any σ = O (cid:0)Cε48 1 d−1/2∥v∥(cid:1) and η = O (cid:16) nCσ ∥v∥ (cid:16) ε2 1 n (cid:17) (cid:17) √ d s1 ≤ ∥wi(t)∥ ≤ s2 + 2η∥v∥t, sin2 (cid:19) (cid:18)θi(t) 2 (cid:18) 1 + − ε2 1 ≤ ηt s2/∥v∥ (cid:19)−1/24 (cid:18) sin2 (cid:19) (cid:18) θi(0) 2 (cid:19) . − ε2 1 Consequently, at the end of Phase 1, we have and ∀i ∈ [n], θi(T1) ≤ 4ε1, hi(T1) ≤ 2hj(T1), ∀i, j ∈ [n]. 3Here we set η such that T1 = C/η ∈ N. 19 (23) (24) (25) (26) Proof. By Lemma 3, (23) and (24) holds for t = 0, and we have s1 ≤ ∥wi(0)∥ ≤ s2, ∀i. Now we show with induction that (23) and (24) holds for ∀t ≤ T1. For t < T1, assume (23) and (24) holds for 0, 1, . . . , t, we prove the case of t + 1. First note that (24) holds for 0, 1, . . . , t implies that ∀t′ ≤ t, sin2(θi(t′)/2) ≤ max{sin2(θi(0)/2), ε2 1} ≤ sin2(π/3) ⇒ θi(t′) ≤ 2π/3. Proof of the right inequality of (23). Consider ∀0 ≤ t′ ≤ t, note that ∥wi(t′)∥ ≥ s1 > 0, ∀i implies that, for any i, j, the gradient ∇i(t′) and the angles θi(t′), θij(t′) are well-defined. √ Note that s2 = 2σ d = O ((ηT1)ε48 1 ∥v∥) ≤ ηT1∥v∥, so ∀0 ≤ t′ ≤ t we have ∥wi(t′)∥ ≤ s2 + 2η∥v∥t′ ≤ s2 + 2η∥v∥T1 ≤ 3C∥v∥ = O (cid:0)ε2 1/n(cid:1) ∥v∥ ≤ By triangle inequality, for ∀i ∈ [n], 0 ≤ t′ ≤ t, ∥∇i(t′)∥ ≤ ≤ 1 2 1 2 j (cid:18) 1 3 (cid:32) (cid:88) (cid:33) ∥wj(t′)∥ + ∥v∥ + (cid:34) (cid:88) ∥wj(t′)∥ + ∥v∥ + 1 2π (cid:19) + 1 ∥v∥ + 1 2π (cid:18) 1 3 + 1 + (cid:19) j̸=i π 3 + π ∥v∥ ≤ 2∥v∥. ∥v∥ 3n . (27) (cid:35) (cid:88) j̸=i π∥wj(t′)∥ + π∥v∥ (28) Then ∥wi(t + 1)∥ can be upper-bounded as ∥wi(t + 1)∥ = ∥wi(0) − t (cid:88) t′=0 η∇i(t′)∥ ≤ ∥wi(0)∥ + t (cid:88) t′=0 η∥∇i(t′)∥ ≤ s2 + 2η(t + 1)∥v∥. Proof of the left inequality of (23). Next we show that ∥wi(t + 1)∥ ≥ ∥wi(t)∥ ≥ s1. Note that ∥wi(t + 1)∥2 − ∥wi(t)∥2 = ∥wi(t) − η∇i(t)∥2 − ∥wi(t)∥2 = −2η⟨wi(t), ∇i(t)⟩ + η2∥∇i(t)∥2, so to show ∥wi(t + 1)∥ ≥ ∥wi(t)∥, we only need to prove that ⟨wi(t), ∇i(t)⟩ < 0 (note that by the induction hypothesis we have ∥wi(t)∥ > 0, therefore wi(t) is well-defined): ⟨wi(t), ∇i(t)⟩ = − (π − θi(t)) ⟨wi(t), v⟩ + ⟨wi(t), ∥v∥ sin θi(t)wi(t)⟩ 2π (cid:88) + ⟨wi(t), (π − θij(t))wj(t)⟩ 2π j (π − θi(t)) cos θi(t) + sin θi(t) 2π + (π − θi(t)) cos θi(t) + sin θi(t) 2π ∥v∥ + O (cid:0)ε2 (cid:1) ∥v∥ 1 1/12 2π = − (27) ≤ − ≤ − <0. (cid:68) wi(t), (cid:16)(cid:80) (cid:17) j̸=i ∥wj(t)∥ sin θij(t) (cid:69) wi(t) 2π ∥v∥ + (cid:88) j (π − θij(t)) cos θij(t) + sin θij(t) 2π ∥wj(t)∥ ∥v∥ + O (cid:0)ε2 1 (cid:1) ∥v∥ 20 The reason for the second to last inequality is that, it is easy to verify by taking derivatives that the expression (π − θ) cos θ + sin θ monotonically decreases on the interval [0, π], and the induction hypothesis implies θi(t) ≤ 2π/3, therefore (π − θi(t)) cos θi(t) + sin θi(t) ≥ (π − 2π/3) cos(2π/3) + sin(2π/3) > 1/12. Then we have ∥wi(t + 1)∥ ≥ ∥wi(t)∥ ≥ s1. Proof of (24). First we calculate the dynamics of cos θi. cos(θi(t + 1)) − cos(θi(t)) = ⟨wi(t + 1), v⟩ − ⟨wi(t), v⟩ ∥wi(t)∥ ⟨wi(t + 1), v⟩ − ∥wi(t + 1)∥ ⟨wi(t), v⟩ ∥wi(t + 1)∥ * ∥wi(t)∥ ⟨wi(t), v⟩ (∥wi(t)∥ − ∥wi(t + 1)∥) − η∥wi(t)∥ ⟨∇i(t), v⟩ ∥wi(t + 1)∥ * ∥wi(t)∥ ⟨wi(t), v⟩ ∥wi(t)∥2−∥wi(t)−η∇i(t)∥2 ∥wi(t)∥+∥wi(t+1)∥ − η∥wi(t)∥ ⟨∇i(t), v⟩ ∥wi(t + 1)∥ * ∥wi(t)∥ ⟨wi(t), v⟩ 2η ⟨wi(t), ∇i(t)⟩ − η2∥∇i(t)∥2 ∥wi(t)∥ + ∥wi(t + 1)∥ η ⟨wi(t), v⟩ ⟨wi(t), ∇i(t)⟩ + ⟨wi(t), v⟩ (cid:21) − η ⟨∇i(t), v⟩ (cid:18) 2η ⟨wi(t), ∇i(t)⟩ ∥wi(t)∥ + ∥wi(t + 1)∥ (cid:21) − η ⟨∇i(t), v⟩ ∥∇i(t)∥2 ∥wi(t)∥ + ∥wi(t + 1)∥ ⟨⟨wi(t), v⟩ wi(t) − v, ∇i(t)⟩ − 2η ⟨wi(t), ∇i(t)⟩ 2∥wi(t)∥ (cid:19) (cid:123)(cid:122) I1 (cid:20) ⟨wi(t), ∇i(t)⟩ (∥wi(t)∥ − ∥wi(t + 1)∥) ∥wi(t)∥ + ∥wi(t + 1)∥ (cid:125) (cid:123)(cid:122) I2 − η ∥∇i(t)∥2 ∥wi(t)∥ + ∥wi(t + 1)∥ . (cid:21) (cid:125) (29) = = = = = (cid:20) (cid:20) 1 ∥wi(t + 1)∥ 1 ∥wi(t + 1)∥ − η2 ⟨wi(t), v⟩ = η ∥wi(t + 1)∥ (cid:124) + η ⟨wi(t), v⟩ ∥wi(t + 1)∥ (cid:124) For the first term I1, note that the vector ⟨wi(t), v⟩ wi(t) − v is orthogonal with wi, therefore, 21 I1 = η ∥wi(t + 1)∥ (cid:42) ⟨wi(t), v⟩ wi(t) − v, 1 2π (cid:34) (cid:88) j̸=i (π − θij(t))wj(t) − (π − θi(t))v (cid:35)(cid:43) (cid:34) (π − θi(t)) sin2 θi(t)∥v∥ − (cid:88) j̸=i (π − θij(t)) (cos θj(t) − cos θi(t) cos θij(t)) ∥wj(t)∥ (cid:35) = ≥ (27) ≥ ≥ η 2π∥wi(t + 1)∥ η 2π∥wi(t + 1)∥ η 2π∥wi(t + 1)∥ η∥v∥ 2π∥wi(t + 1)∥ (cid:2)(π − θi(t)) sin2 θi(t)∥v∥ − nπ * 2∥wj(t)∥(cid:3) (cid:2)(π − θi(t)) sin2 θi(t)∥v∥ − nπ * 2O(C)∥v∥(cid:3) (cid:105) sin2 θi(t) − O (nC) , (cid:104) π 3 where the last inequality is because θi(t) ≤ π/3. The second term I2 is a small perturbation term, which can be lower bounded as: I2 ≥ − = − η ∥wi(t + 1)∥ η2 s1∥wi(t + 1)∥ (cid:20)∥∇i(t)∥ * ∥η∇i(t)∥ 2s1 (28) ≥ − ∥∇i(t)∥2 + η (cid:21) ∥∇i(t)∥2 2s1 4η2 s1∥wi(t + 1)∥ ∥v∥2. (30) (31) Combining both terms together, we get cos(θi(t + 1)) − cos(θi(t)) = I1 + I2 ≥ ≥ where the last inequality is because η = O η∥v∥ 2π∥wi(t + 1)∥ η∥v∥ 6∥wi(t + 1)∥ (cid:16) nCσ √ ∥v∥ (cid:17) d (cid:20)π 3 sin2 θi(t) − O (nC) − 8πη (cid:21) ∥v∥ s1 (cid:2)sin2 θi(t) − O (nC)(cid:3) , ⇒ 8πη ∥v∥ s1 = O (nC). (cid:19) sin2 Therefore, we have (cid:18) θi(t) 2 η∥v∥ 12∥wi(t + 1)∥ ≥ − sin2 (cid:19) (cid:18) θi(t + 1) 2 = (cid:2)sin2 θi(t) − O (nC)(cid:3) ≥ cos(θi(t + 1)) − cos(θi(t)) 2 η∥v∥ 12∥wi(t + 1)∥ (cid:20) sin2 (cid:19) (cid:18)θi(t) 2 (cid:21) , − ε2 1 (32) where the last inequality is because cos(θi(t)/2) ≥ cos(π/3) = 1/2 ⇒ sin θi(t) = 2 sin(θi(t)/2) cos(θi(t)/2) ≥ sin(θi(t)/2), and C = O(ε2 1/n) ⇒ O(nC) ≤ ε2 1. Then we have sin2 (cid:19) (cid:18) θi(t + 1) 2 − ε2 1 ≤ sin2 (cid:18) (cid:19) (cid:18) θi(t) 2 − η∥v∥ 12∥wi(t + 1)∥ η∥v∥ 12∥wi(t + 1)∥ (cid:19) (cid:18) sin2 (cid:20) sin2 (cid:19) (cid:18) θi(t) 2 (cid:21) − ε2 1 − ε2 1 (cid:19) (cid:19) − ε2 1 (cid:18) θi(t) 2 (cid:19) (cid:18) η 12 (s2/∥v∥ + 2η(t + 1)) sin2 (cid:19) (cid:18) θi(t) 2 (cid:19) . − ε2 1 = 1 − (cid:18) ≤ 1 − 22 sin2 (cid:18) θi(t′ + 1) 2 (cid:17) sin2 (cid:16) θi(t′) For the same reason, for any t′ ∈ {0, 1, . . . , t} we have (cid:18) (cid:19) − ε2 1 ≤ 1 − η 12 (s2/∥v∥ + 2η(t′ + 1)) (cid:19) (cid:18) sin2 (cid:19) (cid:18) θi(t′) 2 (cid:19) . − ε2 1 (33) − ε2 1 can both be positive or negative, but (33) always holds regardless of its sign. 2 η Since 1 − 12(s2/∥v∥+2η(t′+1)) is always positive, and multiplying both sides of an inequality by a positive number does not change the direction of the inequality, we can iteratively apply (33) and get sin2 (cid:19) (cid:18) θi(t + 1) 2 t+1 (cid:89) (cid:18) 1 − − ε2 1 ≤ η 12 (s2/∥v∥ + 2ηu) (cid:19) (cid:18) sin2 (cid:19) (cid:19) (cid:19) − ε2 1 (cid:18) θi(0) 2 (cid:18) θi(0) 2 (cid:18) θi(0) 2 (cid:18) θi(0) 2 sin2 sin2 − ε2 1 (cid:19) sin2 (cid:19) (cid:18) (cid:19)(cid:19) (cid:18) (cid:19) (cid:19) − ε2 1 (cid:19) (cid:19) − ε2 1 u=1 t+1 (cid:89) u=1 ≤ (cid:18) exp − η 12 (s2/∥v∥ + 2ηu) (cid:19) (cid:18) (cid:18)(cid:90) t+2 ≤ exp − du η 12 (s2/∥v∥ + 2ηu) (cid:18) s2 + (t + 2)2η∥v∥ s2 + 2η∥v∥ (cid:18) u=1 1 24 − ln = exp (cid:18) ≤ 1 + η(t + 1) s2/∥v∥ (cid:19)−1/24 (cid:18) sin2 (cid:19) (cid:18) θi(0) 2 (cid:19) , − ε2 1 where the last inequality is because 2η∥v∥ ≤ s1 ≤ s2. (Note that, by Lemma 3, sin2 (cid:16) θi(0) is always positive.) Proof of (25). W.L.O.G., suppose T1/50 ∈ N. By (24), for ∀t ∈ [T1/50, T1] we have that 2 (cid:17) − ε2 1 sin2 (cid:19) (cid:18)θi(t) 2 (cid:18) 1 + − ε2 1 ≤ ηt s2/∥v∥ (cid:19)−1/24 (cid:18) sin2 (cid:19) (cid:18)θi(0) 2 (cid:19) ≤ − ε2 1 (cid:18) ηT1/50 O ((ηT1)ε48 1 ) (cid:19)−1/24 ≤ ε2 1. (34) Since ε1 = O(1) is a sufficiently small constant, we have ∀t ∈ [T1/50, T1], sin (cid:19) (cid:18) θi(t) 2 ≤ √ 2ε1 ⇒ ∀t ∈ [T1/50, T1], θi(t) ≤ 4ε1. This implies (25) immediately. Proof of (26). Consider ∀t ∈ [T1/50, T1]. The dynamics of hi is given by hi(t + 1) − hi(t) = −η⟨∇i(t), v⟩ ∥v∥ − (cid:33) hj(t) (cid:88) j (cid:32) = η 2 (cid:124) − η 2π (cid:124) (cid:34)(cid:32) (cid:123)(cid:122) η 2 H(t) (cid:88) j̸=i (cid:125) ∥wj(t)∥ sin θij(t) − ∥v∥ sin θi(t) cos θi(t) − (cid:33) θij(t)hj(t) + θi(t)∥v∥ . (cid:35) (cid:88) j̸=i (cid:123)(cid:122) Qi(t) 23 (cid:125) (35) The first term is just η Qi(t). 2 H(t). Denote the second term with Qi(t). Then hi(t + 1) = hi(t) + η 2 H(t) − H(t) can be lower bounded as H(t) = ∥v∥ − (cid:88) j hj(t) ≥ ∥v∥ − ∥wj(t)∥ (27) ≥ ∥v∥ − n * ∥v∥ 3n = 2∥v∥ 3 . (cid:88) j (36) On the other hand, the second term Qi(t) is a small perturbation term, whose norm can be upper bounded by |Qi(t)| ≤ ≤ η 2π η 2π (cid:20) n * ∥v∥ 3n θij(t) + ∥v∥θi(t) + n * θij(t) + θi(t)∥v∥ (cid:21) ∥v∥ 3n (cid:20) ∥v∥ 3 8ε1 + ∥v∥4ε1 + (cid:21) 8ε1 + 4ε1∥v∥ (37) ≤3η∥v∥ε1 ≤ 9ε1 η 2 H(t) ≤ 0.1 H(t), ∥v∥ 3 η 2 where the second inequality is because θij(t) ≤ θi(t) + θj(t) ≤ 8ε1. Therefore 0.3η∥v∥ ≤ 0.9 η 2 H(t) ≤ hi(t + 1) − hi(t) = η 2 H(t) − Qi(t) ≤ 1.1 η 2 H(t), ∀t ∈ [T1/50, T1]. Then we have the following bound, which shows that, ∀i, hi(T1)−hi(T1/50) approximately equals to (cid:80)T1−1 t=T1/50 η 2 H(t):  0.9  T1−1 (cid:88) t=T1/50 η 2  H(t)  ≤ hi(T1)−hi (T1/50) = T1−1 (cid:88) t=T1/50 (hi(t + 1) − hi(t)) ≤ 1.1   T1−1 (cid:88) t=T1/50 η 2  H(t)  . The next bounds shows that, ∀i, |hi(T1/50)| is small comparing to (cid:80)T1−1 t=T1/50 η 2 H(t): (38) |hi(T1/50)| ≤ ∥wi(T1/50)∥ (23) ≤ s2 + 2η∥v∥ T1 50 ≤ 1 20 η∥v∥T1 (36) ≤ 0.2   T1−1 (cid:88) t=T1/50 η 2  H(t)  . (39) (38) and (39) jointly yields 0 < 0.7   T1−1 (cid:88) t=T1/50 η 2   H(t)  ≤ hi(T1) ≤ 1.3   H(t)  , ∀i, T1−1 (cid:88) t=T1/50 η 2 which implies (26) immediately. 24 C Global Convergence: phase 2 Theorem 5. Suppose the initial condition in Lemma 3 holds. For ∀ε2 = O(1), set ε1 = O (cid:0)ε6 (cid:108) 1 in Theorem 4, η = O nη ln , then ∀T1 ≤ t ≤ T2, and T2 = T1 + 1σ2d ∥v∥2 (cid:16) 1 36ε2 (cid:16) ε2 (cid:17)(cid:109) (cid:17) 2n−1/2(cid:1) hi(t) ≤ 2hj(t), ∀i, j, (40) (cid:17)t−T1 (cid:16) 1 − nη 2 ∥v∥ + 6ε2∥v∥ ≥ H(t) ≥ ∥v∥ − 6ε2∥v∥ ≥ 18ε2∥v∥, (41) (cid:17)t−T1 (cid:16) 2 3 1 − nη 2 s1 2 θi(t) ≤ ε2, ∀i. ≥ hi(t) ≥ 2∥v∥ n , ∀i. (42) (43) Proof. We prove (40), (41), (42) and (43) together inductively. First we show the induction base holds. Note that Theorem 4 directly implies (40) and (43) for t = T1. For (42), by (27) we have n , and by (23) we have hi(T1) = ∥wi(T1)∥ cos θi(T1) ≥ ∥wi(T1)∥/2 ≥ hi(T1) ≤ ∥wi(T1)∥ ≤ 2∥v∥ s1/2. For (41), note that 0 ≤ hi(T1) ≤ ∥wi∥ (27) ≤ ∥v∥/(3n) ⇒ ∥v∥ ≥ H(T1) ≥ 2∥v∥/3. Now suppose (40), (41) (42) and (43) holds for T1, T1 +1, . . . , t, next we show the case of t+1. Proof of (40). First note that due to θi(t) ≤ ε2 and 2∥v∥ n ≥ hi(t) ≥ s1 2 we have 3∥v∥ n ≥ hi(t) cos ε2 ≥ hi(t) cos θi(t) = ∥wi(t)∥ ≥ hi ≥ s1 2 , ∀i. As computed in (35), hi(t + 1) = hi(t) + η Note that θij(t) ≤ θi(t) + θj(t) 2 H(t) − Qi(t), ∀i. (43) ≤ 2ε2, ∀i, j. Similar to (37), we have |Qi(t)| ≤ η 2π 14ε2∥v∥ ≤ 3ε2η∥v∥ (41) ≤ η 2 * 1 3 H(t), (44) (45) (46) which implies 0 < 2 H(t) − Qi(t) ≤ 2 (cid:0) η η H(t) ≤ 2 2 H(t) − Qj(t)(cid:1) , ∀i, j. Finally, ∀i, j we have hi(t + 1) = hi(t) + η η 2 2 3 * Then η H(t) − Qi(t) ≤ η 2 * 4 3 H(t), ∀i. 2hj(t + 1). Proof of (41). The dynamics of H(t) is given by H(t + 1) = H(t) − (cid:80) H(t) − (cid:80) i Qi(t) = (1 − nη/2)H(t) + (cid:80) i Qi(t). η 2 H(t) + (cid:80) Note that (45) implies | (cid:80) i i Qi(t)| ≤ 3nε2∥v∥η, therefore 2 H(t) − Qi(t) ≤ 2hj(t) + 2 (cid:0) η 2 H(t) − Qj(t)(cid:1) = i(hi(t + 1) − hi(t)) = H(t + 1) − 6ε2∥v∥ ≤ (cid:16) 1 − (cid:17) nη 2 H(t) + 3nε2∥v∥η − 6ε2∥v∥ = (cid:16) 1 − (cid:17) nη 2 (H(t) − 6ε2∥v∥) . Iterative application of the above bound yields H(t+1)−6ε2∥v∥ ≤ (cid:0)1 − nη For the same reason, we also have H(t + 1) + 6ε2∥v∥ ≥ (cid:0)1 − nη 2 (cid:1)t+1−T1 (H(T1) + 6ε2∥v∥). 2 (cid:1)t+1−T1 (H(T1) − 6ε2∥v∥). 25 On the other hand, ∀i, ∥v∥/(3n) (27) ≥ ∥wi(T1)∥ ≥ hi(T1) = ∥wi(T1)∥ cos θi(T1) ≥ 0 implies ∥v∥ ≥ H(T1) ≥ 2∥v∥/3. Combining three aforementioned bounds yields the first and second inequality in (41). Now we prove the rightmost inequality in (41). Note that nη = o(1) ⇒ 1 − nη/2 ≥ exp(−2nη/3). Then (cid:17)t−T1 (cid:16) 1 − nη 2 ∥v∥ − 6ε2∥v∥ exp(−2nη(T2 − T1)/3)∥v∥ − 6ε2∥v∥ (cid:18) exp − 2nη 3 * 3 2 1 nη ln (cid:18) 1 36ε2 (cid:19)(cid:19) ∥v∥ − 6ε2∥v∥ * 36ε2∥v∥ − 6ε2∥v∥ 2 3 2 3 2 3 2 3 ≥ ≥ = = 18ε2∥v∥, (cid:108) 1 nη ln (cid:16) 1 36ε2 (cid:17)(cid:109) (cid:17) (cid:16) 1 36ε2 where the second inequality is because T2 − T1 = Proof of (42). Since we have already shown (40) and (41) for t + 1, H(t + 1) ≥ 18ε2∥v∥ > 0 implies . ≤ 3 2 1 nη ln n 2 hi(t + 1) (cid:88) (40) ≤ j hj(t + 1) ≤ ∥v∥, ∀i ⇒ hi(t + 1) ≤ 2 n ∥v∥, ∀i. For the lower bound, by (35) and (46) we have hi(t + 1) = hi(t) + η 2 H(t) − Qi(t) ≥ hi(t) ≥ s1 2 . (47) Proof of (43). Recall that the dynamics of cos(θi) is given by (29) as cos(θi(t + 1)) − cos(θi(t)) = I1 + I2. Then we have I1 = η 2π∥wi(t + 1)∥ (cid:34) (π − θi(t)) sin2 θi(t)∥v∥ − (cid:88) (π − θij(t)) (cos θj(t) − cos θi(t) cos θij(t)) ∥wj(t)∥ (cid:35) ≥ − ≥ − η 2 η 2 (cid:88) j̸=i (cid:88) j̸=i (cos θj(t) − cos θi(t) cos θij(t)) sin θi(t) sin(θi(t) + θj(t)) ∥wj(t)∥ ∥wi(t + 1)∥ , j̸=i ∥wj(t)∥ ∥wi(t + 1)∥ where the last inequality is because θij(t) ≤ θi(t)+θj(t) ≤ 2ε2 < π ⇒ cos θj(t)−cos θi(t) cos θij(t) ≤ cos θj(t) − cos θi(t) cos(θi(t) + θj(t)) = sin θi(t) sin(θi(t) + θj(t)). Since we have already shown (42) for t + 1, ∥wi(t + 1)∥ ≥ hi(t + 1) have ∥wj(t)∥ = hj(t)/ cos θj(t) ≤ 2hj(t). Then (47) ≥ hi(t) holds. Also we I1 ≥ − η 2 (cid:88) j̸=i sin θi(t)(sin θi(t) + sin θj(t)) 2hj(t) hi(t) (40) ≥ −2η (cid:88) j̸=i 26 sin θi(t)(sin θi(t) + sin θj(t)). To bound I2, first note that ∥wi(t)∥ ≤ 3∥v∥/n, ∀i. Then by applying elementary triangle inequality in a similar manner as (28), we have ∥∇i(t)∥ ≤ 5∥v∥, ∀i. Since ∥wi(t + 1)∥ ≥ hi(t + 1) ≥ s1/2, for similar reasons as (31), I2 could be lower bounded as I2 ≥ − η s1/2 * ∥∇i(t)∥ * η∥∇i(t)∥ + η∥∇i(t)∥2 s1 ≥ −100 η2∥v∥2 s2 1 . So we have cos(θi(t + 1)) − cos θi(t) ≥ −2η (cid:88) j̸=i sin θi(t)(sin θi(t) + sin θj(t)) − 100 η2∥v∥2 s2 1 . (48) Define a potential function V (t) := (cid:80) i sin2 (θi(t)/2), we consider the dynamics of V (t): V (t + 1) − V (t) = ≤ 1 2 1 2 (cid:88) i (cid:88) (cos θi(t) − cos θi(t + 1)) (cid:32) (cid:88) 2η sin θi(t)(sin θi(t) + sin θj(t)) + 100 i j̸=i (cid:33) η2∥v∥2 s2 1 (cid:32) 3 2 (cid:88) ≤η i n sin2 θi(t) + (cid:33) sin2 θj(t) + 50 nη2∥v∥2 s2 1 (cid:88) j ≤10nη (cid:88) sin2 i (cid:19) (cid:18) θi(t) 2 + 50 nη2∥v∥2 s2 1 , (49) where the last inequality is because sin2 θi(t) = 4 sin2(θi(t)/2) cos2(θi(t)/2) ≤ 4 sin2(θi(t)/2). Then we have V (t+1)+ 5η∥v∥2 s2 1 (cid:18) ≤ (1 + 10nη) V (t) + (cid:19) 5η∥v∥2 s2 1 ≤ * * * ≤ (1 + 10nη)t+1−T1 (cid:18) V (T1) + (cid:19) . 5η∥v∥2 s2 1 Note that by (34) we have V (T1) ≤ 2nε2 1, and by setting η = O (cid:17) (cid:16) ε2 1σ2d ∥v∥2 = O 5η∥v∥2 s2 1 ≤ nε2 1. Then V (t + 1) ≤ (1 + 10nη)t+1−T1 3nε2 1 ≤ exp(10nη(T2 − T1))3nε2 2/16. we have (cid:16) ε2 (cid:17) 1s2 1 ∥v∥2 1 ≤ ε2 D Global Convergence: phase 3 D.1 Initial Condition of Phase 3 First we prove some initial conditions that are satisfied at time T2, i.e., the start of Phase 3. Lemma 17. Suppose the conditions (40) (41) (42) (43) in Theorem 5 holds, then at the start of Phase 3 we have ∀i ∈ [n], ∥v∥/(3n) ≤ ∥wi(T2)∥ ≤ 3∥v∥/n, and L(w(T2)) ≤ 20ε2∥v∥2. 27 Proof. Proof of the First Condition. By Theorem 5 we have θi(T2) ≤ ε2, ∀i, and H(T2) ≤ (cid:0)1 − nη 2 (T2 − T1))∥v∥ + 6ε2∥v∥ = (36ε2)1/2∥v∥ + 6ε2∥v∥ ≤ 7ε1/2 (cid:1)T2−T1 ∥v∥ + 6ε2∥v∥ ≤ exp(− nη 2 2 ∥v∥. Then for ∀i ∈ [n], 2 ∥v∥/(3n). 3∥v∥ ≤ ∥v∥ − H(T2) = (cid:80) Similarly, for ∀i ∈ [n], H(T2) ≥ 0 ⇒ ∥v∥ ≥ (cid:80) j hj(T2) ≤ 2nhi(T2) ⇒ ∥wi(T2)∥ ≥ hi(T2) ≥ j hj(T2) ≥ nhi(T2)/2 ⇒ hi(T2) ≤ 2∥v∥/n ⇒ ∥wi(T2)∥ = hi(T2)/ cos(θi(T2)) ≤ 3 Proof of the Second Condition. Since ∥v∥/(3n) ≤ hi(T2) ≤ 2∥v∥/n, ∀i, we have 2hi(T2) ≤ 3∥v∥/n. (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:88) i wi(T2) − v (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ≤ = (cid:88) i (cid:88) i ∥wi(T2) − hi(T2)v∥ + (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:88) i hi(T2)v − v (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) hi(T2) tan θi(T2) + H(T2) ≤ 8ε1/2 2 ∥v∥, where the last inequality is because ∀i, θi(T2) ≤ ε2 = o(1) ⇒ tan θi(T2) ≤ 2ε2 ≤ o(ε1/2 2 ). So according to (22) we have L(w(T2)) ≤ 8ε1/2 2 ∥v∥ (cid:17)2 + (cid:16) 1 4 1 2π (cid:32) n2 * 2ε2 * (cid:19)2 ∥v∥ + nε2 (cid:18) 2 n 2 n (cid:33) ∥v∥2 ≤ 20ε2∥v∥2. D.2 Proofs for Gradient Lower Bound Before proving Theorem 7, we need some auxiliary lemmas. D.2.1 Auxiliary lemmas Lemma 8. Recall the global minimum w∗ maxi∈[n] θi, then 1, w∗ 2, . . . , w∗ n defined as w∗ i = (cid:80) hi j∈[n] hj v. Define θmax := n (cid:88) i=1 (cid:28) ∂ ∂wi L(w), wi − w∗ i (cid:29) ≥ 2L(w) − O (cid:0)θ2 max∥r∥ * ∥v∥(cid:1) . Proof. First we introduce the idea of residual decomposition in Zhou et al. [2021], which decom- poses the residual function R(x) in two terms : R(x) = n (cid:88) j=1 (cid:2)w⊤ j x(cid:3) + −(cid:2)v⊤x(cid:3) + = r⊤x*1{v⊤x ≥ 0}+ n (cid:88) j=1 w⊤ j x (cid:0)1{w⊤ j x ≥ 0} − 1{v⊤x ≥ 0}(cid:1) . Define R1(x) = r⊤x*1{v⊤x ≥ 0} and R2(x) = (cid:80)n j=1 w⊤ j x (cid:0)1{w⊤ j x ≥ 0} − 1{v⊤x ≥ 0}(cid:1), then R(x) = R1(x) + R2(x). 28 Back to the lemma, first we have the following algebraic calculations: n (cid:88) i=1 (cid:28) ∂ ∂wi L(w), wi − w∗ i (cid:29) n (cid:88) = Ex i=1 (cid:34) = Ex R(x) (cid:2)R(x)1 (cid:8)w⊤ i x ≥ 0(cid:9) x⊤(wi − w∗ i )(cid:3) n (cid:88) (cid:16)(cid:2)w⊤ i x(cid:3) + − 1 (cid:8)w⊤ i x ≥ 0(cid:9) x⊤w∗ i (cid:35) (cid:17) i=1 (cid:34) = 2L(w) + Ex R(x) n (cid:88) (cid:16) i=1 (cid:110) 1 w∗ i (cid:111) ⊤x ≥ 0 − 1 (cid:8)w⊤ i x ≥ 0(cid:9)(cid:17) x⊤w∗ i (cid:35) With the residual decomposition, the last term above can be decomposed into two terms I1, I2 as (cid:34) Ex R(x) n (cid:88) (cid:16) (cid:110) 1 w∗ i (cid:111) ⊤x ≥ 0 − 1 (cid:8)w⊤ i x ≥ 0(cid:9)(cid:17) x⊤w∗ i (cid:35) (cid:34) i=1 n (cid:88) R1(x) i=1 = Ex (cid:124) (cid:16) 1 (cid:110) w∗ i (cid:111) ⊤x ≥ 0 − 1 (cid:8)w⊤ i x ≥ 0(cid:9)(cid:17) x⊤w∗ i (cid:34) + Ex R2(x) (cid:124) n (cid:88) (cid:16) i=1 (cid:123)(cid:122) I1 (cid:110) w∗ i 1 (cid:111) ⊤x ≥ 0 − 1 (cid:8)w⊤ i x ≥ 0(cid:9)(cid:17) (cid:123)(cid:122) I2 (cid:35) x⊤w∗ i . (cid:125) (cid:35) (cid:125) For the second term I2, note that j x (cid:0)1{w⊤ ∀j, w⊤ j x ≥ 0} − 1{v⊤x ≥ 0}(cid:1) ≥ 0 ⇒ R2(x) ≥ 0 and ∀w∗ i , wi, (cid:16) 1 (cid:110) w∗ i (cid:111) ⊤x ≥ 0 − 1 (cid:8)w⊤ i x ≥ 0(cid:9)(cid:17) x⊤w∗ i ≥ 0, so I2 is always non-negative. For the first term I1 = (cid:80) i∈[n] Ex (cid:2)r⊤x1(v⊤x ≥ 0) (cid:0)1 (cid:8)w∗ i ⊤x ≥ 0(cid:9) − 1 (cid:8)w⊤ i x ≥ 0(cid:9)(cid:1) x⊤w∗ i (cid:3), we bound each term in the summation as (cid:110) (cid:16) (cid:104) Ex r⊤x1(v⊤x ≥ 0) (cid:110) (cid:104) ≥ −Ex |r⊤x| * (cid:12) (cid:12) (cid:12)1 i ∥ * E ̃x i ∥(cid:1) i ∥w∗ = −∥r∥θi∥w∗ ≥ −O (cid:0)∥r∥θ2 1 w∗ i ⊤x ≥ 0 (cid:111) ⊤x ≥ 0 w∗ i ∥ ̃x∥2 (cid:12) (cid:110) (cid:104) (cid:12) (cid:12)1 w∗ i (cid:105) (cid:111) x⊤w∗ i − 1 (cid:8)w⊤ i x ≥ 0(cid:9)(cid:17) i x ≥ 0(cid:9)(cid:12) − 1 (cid:8)w⊤ (cid:12) * ∥ ̃x∥ * ∥w∗ (cid:12) i ∥θi i ̃x ≥ 0(cid:9)(cid:12) (cid:111) (cid:105) − 1 (cid:8)w⊤ (cid:12) (cid:12) ⊤ ̃x ≥ 0 (cid:105) where ̃x is the projection of x onto span(w∗ Here the first inequality is because 1 (cid:8)w∗ i , wi, r) and follows a three-dimensional Gaussian. i x ≥ 0(cid:9) ̸= 0 ⇒ θ(w∗ i , x) ∈ [π/2 − ⊤x ≥ 0(cid:9) − 1 (cid:8)w⊤ i 29 θi, π/2 + θi] ⇒ |x⊤w∗ i ∥θi, and the last inequality is because i | ≤ ∥ ̃x∥ * ∥w∗ i | = | ̃x⊤w∗ ∥ ̃x∥2 (cid:12) (cid:111) (cid:110) (cid:12) (cid:12)1 ⊤ ̃x ≥ 0 w∗ i (cid:104) E ̃x − 1 (cid:8)w⊤ i ̃x ≥ 0(cid:9)(cid:12) (cid:12) (cid:12) (cid:105) = O(θi). (See Lemma C.5 in Zhou et al. [2021] for detailed calculations.) i ∥ = ∥v∥, so we have Note that (cid:80) i ∥w∗ n (cid:88) i=1 (cid:28) ∂ ∂wi L(w), wi − w∗ i (cid:29) = 2L(w)+I1+I2 ≥ 2L(w)− (cid:88) i∈[n] O (cid:0)∥r∥θ2 i ∥w∗ i ∥(cid:1) ≥ 2L(w)−O (cid:0)θ2 max∥r∥ * ∥v∥(cid:1) . Lemma 18 (Bound of θi). We have that ∥wi∥2θ3 i ≤ 30πL(w), ∀i. Proof. W.L.O.G., suppose v = (∥v∥|, 0, . . . , 0)⊤ and wi = (cos θi, sin θi, 0, . . . , 0)⊤∥wi∥. Define Si := {x : x ∈ Rd, x⊤wi ≥ 0 ∧ x⊤v < 0}. One can see that Si = {x : θ(x, wi) ≤ + ≥ π/2, θ(x, v) ≥ π/2}. On the other hand, ∀x ∈ Si, R(x) = (cid:80)n (cid:2)w⊤ − (cid:2)v⊤x(cid:3) j x(cid:3) (cid:2)w⊤ j=1 + i x(cid:3) + ≥ 0. Therefore, L(w) = Ex∼N (0,I))   1 2 (cid:32) n (cid:88) i=1 (cid:2)w⊤ i x(cid:3) + − (cid:2)v⊤x(cid:3) + (cid:33)2  (∥wi∥ρ cos(ω − θi))2ρe−ρ2/2dωdρ i x)2 e− ∥x∥2 2 (cid:90) x∈Si (cid:90) +∞ (w⊤ 1 2 (cid:90) θi+π/2 (2π)d/2 dx 1 4π ω=π/2 (cid:90) θi+π/2 cos2(ω − θi)dω ω=π/2 (2θi − sin(2θi)) * (2θi)3 30 . ≥ = = = ≥ ρ=0 ∥wi∥2 2π ∥wi∥2 8π ∥wi∥2 8π Rearranging terms yields the result. Lemma 19 (Bound of ∥r∥). Given that 4∥v∥ O(n−2∥v∥2), then n ≥ ∥wi∥ ≥ ∥v∥ 4n for all i ∈ [n] and L(w) = ∥r∥ = O (cid:0)nL1/2(w)(cid:1) . Proof. Lemma 18 and ∥wi∥ = Θ(∥v∥/n) implies θi = O (cid:18) i ∈ [n], by Taylor expansion we have |(sin θi − θi cos θi)| = O(θ3 (cid:17)1/3(cid:19) n2/3 (cid:16) L(w) i ), then |(sin θi − θi cos θi)∥wi∥ * = o(1). For all ∥v∥2 30 ∥v∥| = O(θ3 (cid:18) n2/3 (cid:16) L(w) Then by (22), we have ∥v∥2 O i )∥wi∥ * ∥v∥ = O (nL(w)). Similarly, ∀i, j ∈ [n] we have θij ≤ θi + θj ≤ (cid:17)1/3(cid:19) ⇒ |(sin θij − θij cos θij)∥wi∥ * ∥wj∥| = O(θ3 ij)∥wi∥ * ∥wj∥ = O (L(w)). ∥r∥2 = 4L(w) − 2 π (cid:34) (cid:88) i<j (sin θij − θij cos θij)∥wi∥ * ∥wj∥ − (sin θi − θi cos θi)∥wi∥ * ∥v∥ (cid:35) (cid:88) i ≤ 4L(w) + n2O(L(w)) + nO(nL(w)) ≤ O(n2L(w)), which implies ∥r∥ = O (cid:0)nL1/2(w)(cid:1). Lemma 20 (Bound of ∥wi − w∗ O(∥v∥2/n2). Then ∥wi − w∗ i ∥ ≤ O i ∥). Suppose 4∥v∥ (cid:18) n2/3 (cid:16) L(w) ∥v∥2 n ≥ ∥wi∥ ≥ ∥v∥ (cid:17)1/3(cid:19) ∥wi∥. 4n , ∀i ∈ [n] and L(w) = Proof. Lemma 18 and ∥wi∥ = Θ(∥v∥/n) implies θi = O (cid:18) n2/3 (cid:16) L(w) ∥v∥2 (cid:17)1/3(cid:19) . Lemma 19 implies |H| = |⟨r, v⟩| = O(nL1/2(w)). We first decompose ∥wi − w∗ i ∥ into two parts as ∥wi − w∗ The first part can be bounded as ∥wi − hiv∥ = ∥wi∥ sin θi ≤ O The second part can be bounded as ∥hiv − w∗ ∥v∥−H . Note that |H| = |⟨r, v⟩| ≤ ∥r∥ = O(nL1/2(w)) ≤ O(∥v∥) ⇒ ∥v∥ − |H| ≥ ∥v∥/2. So we have ∥v∥/2O(nL1/2(w)) ≤ O (cid:18) n2/3 (cid:16) L(w) i ∥ ≤ ∥wi∥ |H| ∥v∥−H ≤ ∥wi∥ * ∥v∥−H ≤ ∥wi∥ |H| ∥hiv − w∗ (cid:17)1/3(cid:19) ∥wi∥. i ∥ = ∥v∥2 1 (cid:12) (cid:12) (cid:12)hi (cid:16) 1 − ∥v∥ (cid:80) j hj i ∥ ≤ ∥wi − hiv∥ + ∥hiv − w∗ ∥wi∥. (cid:17)1/3(cid:19) i ∥. (cid:18) n2/3 (cid:16) L(w) (cid:17)(cid:12) (cid:12) (cid:12) = hi ∥v∥2 |H| Combining two parts together yields the bound. D.2.2 Proof of Theorem 7 Now we are ready to prove Theorem 7. Theorem 7. If for every student neuron we have 4∥v∥ L(w) = O then ∥∇wL(w)∥ ≥ Ω (cid:16) L2/3(w) n2/3∥v∥1/3 (cid:17) . 4n , and n ≥ ∥wi∥ ≥ ∥v∥ (cid:19) (cid:18)∥v∥2 n14 , Proof. Lemma 18 and ∥wi∥ = Θ(∥v∥/n) implies θi = O (cid:18) n2/3 (cid:16) L(w) ∥v∥2 (cid:17)1/3(cid:19) . Lemma 19 implies ∥r∥ = O(nL1/2(w)). Combined with lemma 8 and L(w) = O (cid:17) (cid:16) ∥v∥2 n14 we have n (cid:88) i=1 (cid:28) ∂ ∂wi L(w), wi − w∗ i (cid:29) ≥ 2L(w)−O (cid:0)θ2 max∥r∥ * ∥v∥(cid:1) ≥ 2L(w)−O(n7/3L7/6(w)∥v∥−1/3) ≥ L(w). 31 Then L(w) ≤ n (cid:88) i=1 (cid:28) ∂ ∂wi L(w), wi − w∗ i (cid:29) ≤ Lemma 20 ≤ (cid:13) (cid:13) (cid:13) (cid:13) ∂L(w) ∂w (cid:13) (cid:13) (cid:13) (cid:13) (cid:32) O n2/3 So (cid:13) (cid:13) (cid:13) ∂L(w) ∂w (cid:13) (cid:13) (cid:13) ≥ Ω (cid:16) L2/3(w) n2/3∥v∥1/3 (cid:17) . ∂ ∂wi n (cid:88) (cid:13) (cid:13) (cid:13) (cid:13) i=1 (cid:19)1/3(cid:33) L(w) (cid:13) (cid:13) (cid:13) (cid:13) * ∥wi − w∗ i ∥ ≤ (cid:13) (cid:13) (cid:13) (cid:13) ∂L(w) ∂w (cid:13) (cid:13) (cid:13) (cid:13) (cid:88) i∈[n] ∥wi − w∗ i ∥ (cid:18) L(w) ∥v∥2 ∥w∗ i ∥ = O (cid:16) n2/3L(w)1/3∥v∥1/3(cid:17) (cid:13) (cid:13) (cid:13) (cid:13) ∂L(w) ∂w (cid:13) (cid:13) (cid:13) (cid:13) . (cid:88) i∈[n] D.3 Handling Non-smoothness In this section, we establish two lemmas needed for handling the non-smoothness of L. Define the Hessian matrix of L as Λ := ∂2L(w) ∂w2 . The next lemma ensures the smoothness of L when the student neurons are regularized, i.e, their norms are upper and lower bounded. Lemma 21 (Conditional Smoothness of L). If for every student neuron we have 4∥v∥ ∥v∥ 4n , then ∥Λ∥2 ≤ O(n2). Proof. When wi computed the closed form expression of Hessian Λ = ∂2L ̸= 0, ∀i, Safran et al. [2020] has shown that L(w) is twice differentiable and n ≥ ∥wi∥ ≥ ∂w2 ∈ Rnd×nd: Λ =    Λ1,1 ... Λn,1    , * * * Λ1,n ... * * * Λn,n (50) where Λi,j ∈ Rd×d, i, j ∈ [n] are d × d matrices with the following forms: The ith diagonal block matrix of Λ is Λi,i = 1 2 I + (cid:88) j̸=i ζ(wi, wj) − ζ(wi, v), where ζ(w, v) = sin θ(w, v)∥v∥ 2π∥w∥ (I − ww⊤ + nv,wn⊤ v,w), and nv,w = v − cos θ(w, v)w. For i ̸= j, the off-diagonal entry is (cid:2)(π − θ(wi, wj))I + nwi,wj w⊤ j + nwj ,wiw⊤ i (cid:3) . Λi,j = 1 2π n ), ∀i implies ∥wj ∥ 2π∥wi∥ = O(1) and ∥ζ(wi, v)∥ ≤ O(1) ∥v∥ ∥ζ(wi, v)∥ ≤ O(n). Note that ∥wi∥ = Θ( ∥v∥ ∥wj ∥ Also note that ∥Λi,j∥ ≤ 1 Then ∥Λ(w)∥ ≤ (cid:80) 2π (π + 1 + 1) ≤ 1 for all i ̸= j. i,j ∥Λi,j∥ ≤ nO(n) + (n2 − n) ≤ O(n2). 32 ∥wi∥ = O(1), ∀i, j and ∥v∥ ∥wi∥ ≤ O(n), so ∥Λi,i∥ ≤ ∥ 1 ∥wi∥ = O(n), ∀i. Then ∥ζ(wi, wj)∥ ≤ 2I∥ + (cid:80) j̸=i ∥ζ(wi, wj)∥ + The following lemma shows that each student neuron wi will not move too far in the third phase. Lemma 22 (Bound of the Change of Neurons). If the initial loss at phase 3 is upper bounded by L(w(T2)) ≤ Cl, and there exists constant Cs > 0 such that L(w(t + 1)) ≤ L(w(t)) − η 2 ∥∇W (t)∥2 ≤ L(w(t)) − CsηL4/3(w(t)), ∀T + T2 − 1 ≥ t ≥ T2, then L(T + T2) ≤ 1 (L(w(T2))−1/3 + CsηT /3)3 , and T −1 (cid:88) t=0 Proof. We bound the loss as η∥∇W (t + T2)∥ ≤ 8C −1/2 s C 1/3 l . 1 L1/3(w(t + 1)) 1 (L(w(t)) − CsηL4/3(w(t)))1/3 1 L1/3(w(t)) 1 L1/3(w(t)) 1 L1/3(w(t)) 1 L1/3(w(t)) (cid:32) 1 +  1 + 1 − (cid:0)1 − CsηL1/3(w(t))(cid:1)1/3 (1 − CsηL1/3(w(t)))1/3 (cid:33) (1 − CsηL1/3(w(t)))1/3 (cid:16) CsηL1/3(w(t)) 1 + (1 − CsηL1/3(w(t)))1/3 + (1 − CsηL1/3(w(t)))2/3(cid:17)   + Csη 1 (1 − CsηL1/3(w(t)))1/3 + (1 − CsηL1/3(w(t)))2/3 + (1 − CsηL1/3(w(t))) + Csη 3 . ≥ = = = ≥ Therefore, L−1/3(w(t + T2)) ≥ L−1/3(w(T2)) + Csη 3 t, ∀T ≥ t ≥ 0. Let l1 := L−1/3(w(T2)), then 1/l3 1 ≤ Cl and L(w(T2 + t)) ≤ 1 (l1 + Csηt/3)3 , ∀t ≤ T, this proves the first inequality. For the second inequality, note that L(w(t + 1)) ≤ L(w(t)) − η 2 ∥∇W (t)∥2 ⇒ ∥∇W (t)∥2 ≤ 2 η (L(w(t)) − L(w(t + 1))) . 33 (l1 + Csηt/3)2∥∇W (T2 + t)∥2 (cid:33) (l1 + Csηt/3)2 2 η (L(w(T2 + t)) − L(w(T2 + t + 1))) (cid:33) By Cauchy inequality, ∀T > 0, (cid:33)2 ∥∇W (T2 + t)∥ 1 (l1 + Csηt/3)2 1 (l1 + Csηt/3)2 (cid:33) (cid:32)T −1 (cid:88) t=0 (cid:33) (cid:32)T −1 (cid:88) t=0 (cid:33) (cid:32) (cid:32)T −1 (cid:88) t=0 (cid:32)T −1 (cid:88) t=0 (cid:32)T −1 (cid:88) t=0 (cid:32)T −1 (cid:88) t=0 (cid:32)T −1 (cid:88) t=0 (cid:32)T −1 (cid:88) t=0 2 η 2 η 2 η ≤ ≤ ≤ ≤ ≤ 1 (l1 + Csηt/3)2 1 (l1 + Csηt/3)2 1 (l1 + Csηt/3)2 l2 1L(w(T2 + T )) + (cid:33) (cid:32) l2 1L(w(T2 + T )) + T −1 (cid:88) t=1 2Csη 3 T −1 (cid:88) t=1 (cid:33) (cid:32) 1 l1 + 2Csη 3 T −1 (cid:88) t=1 1 (l1 + Csηt/3)2 (cid:33) (cid:0)(l1 + Csηt/3)2 − (l1 + Csη(t − 1)/3)2(cid:1) L(w(T2 + t)) (cid:33) (l1 + Csηt/3) L(w(T2 + t)) (cid:33) Note that T −1 (cid:88) t=0 1 (l1 + Csηt/3)2 ≤ +∞ (cid:88) t=0 1 (l1 + Csηt/3)2 ≤ 3 Csη +∞ (cid:88) (cid:18) t=0 1 l1 + Csη(t − 1)/3 − 1 l1 + Csηt/3 (cid:19) ≤ 6 Csηl1 . Therefore, (cid:33)2 ∥∇W (T2 + t)∥ ≤ (cid:32)T −1 (cid:88) t=0 2 η (cid:18) 6 Csηl1 (cid:19) (cid:18) 1 l1 + 2Csη 3 6 Csηl1 (cid:19) ≤ 2 η 6 Csηl1 5 l1 = 60 Csη2l2 1 . So we get η T (cid:88) t=0 ∥∇(T2 + t)∥ ≤ η (cid:115) 60 Csη2l2 1 ≤ 8C −1/2 s C 1/3 l . D.4 Proof of Theorem 6 Theorem 6. Suppose the initial condition in Lemma 3 holds. If we set ε2 = O(n−14) in Theorem 5, η = O (cid:0) 1 n2 (cid:1), then ∀T ∈ N we have and 4∥v∥ n ≥ ∥wi(T + T2)∥ ≥ ∥v∥ 4n , L(T + T2) ≤ O (cid:18) n4∥v∥2 (ηT )3 (cid:19) . 34 (51) (52) Proof. Since we have set ε2 = O(n−14), by Lemma 17 we have 3∥v∥ (cid:17) L(w(T2)) ≤ 20ε2∥v∥2 = O . (cid:16) ∥v∥2 n14 n ≥ ∥wi(T2)∥ ≥ ∥v∥ 3n , ∀i, and To prove the theorem, we just need to prove (51) and a stronger version of (52): L(T + T2) ≤ (cid:16) L(T2)−1/3 + Ω 1 (cid:16) (cid:17)3 . (cid:17) ηT 1 n4/3∥v∥2/3 (53) We prove (51) and (53) together inductively. The induction base holds for T = 0 by Lemma 17. Now suppose (51) (53) hold for 0, 1, . . . , T − 1, we show the case of T . First note that (3) (51) and routine computation implies ∥∇i(t + T2)∥ = O(∥v∥), ∀0 ≤ t ≤ T − 1. For ∀T2 ≤ t ≤ T + T2 − 1, since the induction condition together with lemma 21 guarantee the smoothness of L, the classical analysis of gradient descent can be applied ([Nesterov et al. [2018]], lemma 1.2.3) to bound the decrease of loss at time t as L(w(t + 1)) =L(w(t)) + ⟨∇W (t), −η∇W (t)⟩ + (cid:90) 1 τ =0 (1 − τ )(−η∇W (t))⊤ ∂2L ∂w2 (w(t) − τ η∇W (t))(−η∇W (t))dτ. (54) For ∀τ ∈ [0, 1], ∥wi(t) − τ η∇i(t)∥ ≥ ∥wi(t)∥ − η∥∇i(t)∥ ≥ ∥v∥ we have ∥wi(t)−τ η∇i(t)∥ ≤ ∥wi(t)∥+η∥∇i(t)∥ ≤ 5∥v∥ (cid:13) (cid:13) of L at w(t) − τ η∇W (t): (cid:13) bound Theorem 7 (note that L(w(t)) = O(∥v∥2/n14)), the dynamic of loss can be bounded as 4n − ηO(∥v∥) ≥ ∥v∥ 5n , similarly n . Then lemma 21 implies the smoothness (cid:13) ∂2L (cid:13) (cid:13) ≤ O (n2). Combined with gradient lower ∂w2 (w(t) − τ η∇W (t)) L(w(t)) − L(w(t + 1)) ≥ η∥∇W (t)∥2 − (cid:90) 1 τ =0 (1 − τ )O (cid:0)n2(cid:1) ∥ − η∇W (t)∥2dτ ∥∇W (t)∥2 ≥ η 2 Theorem 7 ≥ Ω (cid:18) 1 n4/3∥v∥2/3 (cid:19) ηL4/3(w(t)). Set Cs in Lemma 22 as Cs = Ω implies that L(w(t + 1)) ≤ L(w(t)) − η Lemma 22 here, which immediately implies (53). 1 . For ∀T + T2 − 1 ≥ t ≥ T2, the above inequality n4/3∥v∥2/3 2 ∥∇W (t)∥2 ≤ L(w(t)) − CsηL4/3(w(t)). So we can apply (cid:16) (cid:17) For (51), Lemma 22 yields ∥wi(T + T2)∥ ≥ ∥wi(T2)∥ − T −1 (cid:88) t=0 (cid:32) η∥∇W (t + T2)∥ ≥ ∥v∥ 3n (cid:19)1/3(cid:33) − 8C −1/2 s L(w(T2))1/3 ∥v∥ 4n , ≥ (cid:18) ∥v∥2 n14 = ∥v∥ 3n − O n2/3∥v∥1/3 * 35 similarly ∥wi(T +T2)∥ ≤ ∥wi(T2)∥+ T −1 (cid:88) η∥∇W (t+T2)∥ ≤ t=0 3∥v∥ n (cid:32) +O n2/3∥v∥1/3 * (cid:19)1/3(cid:33) (cid:18) ∥v∥2 n14 ≤ 4∥v∥ n . E Supplementary Materials for Section 4 E.1 Proof of Lemma 3 Lemma 3. Let s1 := 1 the following properties holds: 2σ d, s2 := 2σ √ √ d. When d = Ω(log(n/δ)), with probability at least 1 − δ, ∀i ∈ [n], s1 ≤ ∥wi(0)∥ ≤ s2, ∀i ∈ [n], π 3 ≤ θi(0) ≤ 2π 3 . (55) (56) Proof. By concentration inequality of Gaussian (See Section 2 in Dasgupta and Schulman [2013]), 4σ2d(cid:3) ≤ For ∀i we have Pr (cid:17) (cid:1)2 d/24 − (cid:0) 3 3n . By union bound, (55) holds with probability at exp least 1 − δ/3. 2σ ≤ exp(−Ω(log(n/δ))) ≤ δ ≤ Pr (cid:2)|∥wi(0)∥2 − σ2d| > 3 (cid:104) ∥wi(0)∥ < 1 d ∨ ∥wi(0)∥ > 2σ (cid:105) d √ √ (cid:16) 4 For (56), note that for ∀i ∈ [n], |⟨wi(0), v⟩| ≤ √ 1 4 σ d ∧ ∥wi(0)∥ ≥ √ 1 2 σ d ⇒ |⟨wi(0), v⟩| ∥wi(0)∥ ≤ 1 2 ⇒ π 3 ≤ θi(0) ≤ 2π 3 . By concentration inequality of Gaussian, Pr (cid:104) δ 3n. Then Pr (cid:2)θi(0) < π ≤ 2δ 3n. By union bound, (56) holds with probability at least 1 − 2δ/3. Applying union bound again finishes the proof. 3 ∨ θi(0) > 2π (cid:3) ≤ Pr + Pr 4σ d 3 |⟨wi(0), v⟩| > 1 4σ √ (cid:105) d (cid:104) |⟨wi(0), v⟩| > 1 √ (cid:105) d (cid:16) − ( 1 4 σ ≤ 2 exp (cid:104) ∥wi(0)∥ < 1 2σ2 2σ √ (cid:17) d)2 √ (cid:105) ≤ E.2 Parameter Setting In this section, we assign values to all intermediate parameters appeared in Theorem 4, Theorem 5 and Theorem 6, according to the requirements of these theorems. • First we set ε2 = O(n−14) in Theorem 5 as required by Theorem 6. • Set ε1 = O(ε6 2n−1/2) = O(n−84.5) in Theorem 4 as required by Theorem 5. (cid:16) ε2 1 n = O(n−170) in Theorem 4. • Set C = O (cid:17) • Set σ = O (cid:0)Cε48 1 d−1/2∥v∥(cid:1) = O (cid:0)ε50 1 d−1/2∥v∥/n(cid:1) = O (cid:0)n−4226d−1/2∥v∥(cid:1) in Theorem 4. 36 C = ηT1 ε1 σ ε2 η T1 T2 Figure 3: Parameter Dependency Graph (cid:17) (cid:16) ε2 1σ2d ∥v∥2 (cid:16) σ2d (cid:17) • Set η = O as required by Theorem 5. (Note that in Phase 1 and 3, Theorem 4 and Theorem 6 also have requirements for η, but the bound in Theorem 5 is the tightest one.) n169∥v∥2 = O • Set T1 = C η = O (cid:17) (cid:16) ε2 1 nη in Theorem 4. • Finally, set T2 = T1+ in Theorem 5. (cid:108) 1 nη ln (cid:16) 1 36ε2 (cid:17)(cid:109) = O (cid:17) (cid:16) ε2 1 nη +O (cid:16) log(1/ε2) nη (cid:17) = O (cid:16) log(1/ε2) nη (cid:17) = O (cid:17) (cid:16) log n nη The dependence between these parameters is shown in Figure 3. (We use arrows to indicate dependency, e.g., the arrow from ε1 to ε2 indicates that ε1 depends on ε2.) E.3 Non-degeneracy of Student Neurons There is a technical issue in the convergence analysis: if one of the student neuron wi is degenerate and wi = 0, the loss function L(w) is not differentiable, hence gradient descent is not well-defined. However, our proof shows that such case would not happen and the student neurons are always non-degenerate. Note that the student neuron's norm ∥wi∥ is always lower-bounded in all three phases of our analysis (Phase 1: (23) in Theorem 4, Phase 2: (42) in Theorem 5, Phase 3: (51) in Theorem 6). By these bounds we have the following corollary describing the non-degeneracy of student neurons. Corollary 23. If the initialization conditions in Lemma 3 hold, then for ∀i ∈ [n], t ∈ N, ∥wi(t)∥ > 0. Remark 24. Note that an assumption on the initialization condition such as the one in Corollary 23 is necessary, otherwise there would be counter-examples where all student neurons are degenerate. For example, ∀c > 0, if we set wi(0) = −cv, ∀i and η = 2c 1+nc, then straightforward calculation shows that ∀i, ∇i(0) = − 1+nc 2 v ⇒ ∀i, wi(1) = 0.. 37 F Lower Bound of the Convergence Rate F.1 Preliminaries In this section, we do some technical preparations for proving Theorem 12. Taking η → 0, we get the gradient flow version of Theorem 6. Theorem 25. Suppose gradient flow is initialized from a point w(0) where the conditions in (cid:1) such that ∀T ∈ R≥0 Lemma 3 hold. If σ = O (cid:0)n−4226d−1/2∥v∥(cid:1), then there exists T2 = O (cid:0) log n we have n 4∥v∥ n ≥ ∥wi(T + T2)∥ ≥ ∥v∥ 4n , and L(T + T2) ≤ O (cid:18) n4∥v∥2 T 3 (cid:19) . Similarly, we also have the gradient flow version of Corollary 23. (57) (58) Corollary 26. Given that the initial condition in Lemma 3 holds, then for ∀i ∈ [n], t ∈ N, ∥wi(t)∥ > 0. Lemma 27. Given that the initial condition in Lemma 3 holds, and the initialization is non- degenerate, then ∀t, ∃i ∈ [n], s.t. zi(t) ̸= 0. Proof. Assume for contradiction that ∃t ∈ R+ such that z1(t) = * * * = zn(t) = 0. Define t := inf{t|z1(t) = * * * = zn(t) = 0}. Then the continuity of zi implies z1(t) = * * * = zn(t) = 0, so t > 0. On the other hand, Corol- lary 23 indicates that wi(t) ̸= 0, ∀i ∈ [n]. Since wi is continuous, there exists a neighborhood of t such that for ∀i, j ∈ [n], ∥wi(t)∥/∥wj(t)∥ and ∥v∥/∥wi(t)∥ are bounded by a fixed constant when t is in this neighborhood. Furthermore, since t > 0, ∃ε > 0 and constant C > 1 such that for ∀t ∈ [t − ε, t], ∀i ∈ [n] we have (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) π + (cid:88) j̸=i ∥wj(t)∥ ∥wi(t)∥ sin θij(t) − ∥v∥ ∥wi(t)∥ (cid:12) (cid:12) (cid:12) sin θi(t) (cid:12) (cid:12) ≤ π + (cid:88) j̸=i ∥wj(t)∥ ∥wi(t)∥ | + ∥v∥ ∥wi(t)∥ ≤ C. 38 (cid:33) sin θi zi − π − θij 2π (cid:88) j̸=i  (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) zj  ≤ C∥zi∥ + (cid:88) j̸=i ∥zj∥, Then in the interval [t − ε, t] we have (cid:13) (cid:13) (cid:13) (cid:13) ∂zi ∂t (cid:13) (cid:13) (cid:13) (cid:13) = (cid:32) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) − 1 2π π + (cid:88) j̸=i ∥wj∥ ∥wi∥ sin θij − ⇒ ∂∥zi∥2 ∂t = 2 (cid:28) ∂zi ∂t ∥v∥ ∥wi∥ (cid:29) , zi ≥ −2C∥zi∥  (cid:88) ∥zj∥   2 j∈[n]  ∥zj∥  ≥ −2nC   (cid:88) ∥zj∥2    (cid:88) ⇒ ∂ ∂t (cid:88) j∈[n] ∥zj∥2 ≥ −2C  e2nCt   ⇒ ∂ ∂t (cid:88) j∈[n]  ∥zj∥2    = e2nCt j∈[n]   2nC   ∥zj∥2  + (cid:88) j∈[n] j∈[n]  ∂ ∂t  (cid:88) j∈[n]   ∥zj∥2   ≥ 0 ⇒ (cid:88) j∈[n] ∥zj(t)∥2 ≥ e−2nCε  ∥zj(t − ε)∥2  .   (cid:88) j∈[n] Here the (t) indicator is omitted for simplicity. Note that we bound ∂∥zi∥2 instead of ∂∥zi∥ ∂t here, ∂t since ∥zi∥ might not be differentiable if zi = 0, while ∥zi∥2 is always differentiable. Finally, due to the definition of t, there exists i ∈ [n] such that zi(t − ε) ̸= 0. Then j∈[n] ∥zj(t)∥2 ≥ e−2nCε (cid:16)(cid:80) j∈[n] ∥zj(t − ε)∥2(cid:17) > 0, a contradiction. (cid:80) F.2 Proofs for Section 5 By the closed form formula of gradient (3), the dynamics of zi is given by ∂zi ∂t = − 1 2π (cid:32) π + (cid:88) j̸=i ∥wj∥ ∥wi∥ sin θij − ∥v∥ ∥wi∥ (cid:33) sin θi zi − (cid:88) j̸=i π − θij 2π zj. (59) Lemma 15. If there exists i, j such that κij(t) = κmax(t) < π open neighborhood of t, differentiable at t, and 2 , then cos κij(t) is well-defined in an ∂ ∂t cos κij(t) ≤ − π − θij(t) π (1 − cos κ2 ij(t)). Proof. First note that for ∀i ∈ Q+(t), ∥zi(t)∥ > 0 ⇒ zi(t) = zi(t) ∥zi(t)∥ is differentiable at t. Therefore, for ∀i, j ∈ Q+(t), cos κij = ⟨zi(t), zj(t)⟩ is well-defined in an open neighborhood of t and differentiable at t. According to the dynamics of zi (59), ∀i ∈ Q+(t) we have ∂ ∂t zi = ∥zi∥ ∂zi ∂t zi ∂t − ∂∥zi∥ ∥zi∥2 = ∂t , zi⟩zi ∂t − ⟨ ∂zi ∂zi ∥zi∥ = − (cid:88) k̸=i π − θik 2π zk − ⟨zk, zi⟩zi ∥zi∥ . 39 Then ∂ cos κij ∂t (cid:28) ∂ ∂t ∂⟨zi, zj⟩ ∂t (cid:28) = (cid:29) (cid:29) zj ∂ ∂t ∥zk∥ ∥zi∥ = zi, zj + zi, (cid:88) = − π − θik 2π (cid:18) ∥zi∥ ∥zj∥ k̸=i,k∈Q+ π − θij 2π = − (cid:124) − (cid:124) (cid:88) k̸=i,j∧k∈Q+ (cid:19) (1 − cos2 κij) (cid:125) + ∥zj∥ ∥zi∥ (cid:123)(cid:122) I1 (cid:20)π − θik 2π ∥zk∥ ∥zi∥ (⟨zk, zj⟩ − ⟨zk, zi⟩⟨zi, zj⟩) − (cid:88) k̸=j,k∈Q+ π − θjk 2π ∥zk∥ ∥zj∥ (⟨zk, zi⟩ − ⟨zk, zj⟩⟨zi, zj⟩) (cos κkj − cos κki cos κij) + π − θjk 2π ∥zk∥ ∥zj∥ (cid:21) (cos κik − cos κkj cos κij) . (cid:123)(cid:122) I2 (cid:125) (60) The expression above splits into two terms I1 and I2. The most important observation is that, by setting zi, zj to be the pair of maximally separated vectors, i.e., κij = κmax, the second term I2 is guaranteed to be nonpositive. This is because for ∀k, κki ≤ κmax < π/2, κkj ≤ κmax = κij ⇒ cos κkj ≥ cos κij ≥ cos κki cos κij ⇒ cos κkj−cos κki cos κij ≥ 0, similarly we have cos κik − cos κkj cos κij ≥ 0, ∀k. So I2 ≤ 0 when κij = κmax. This implies that when κij = κmax, ∂ cos κij ∂t ≤ I1 = − π − θij 2π (cid:18) ∥zi∥ ∥zj∥ + ∥zj∥ ∥zi∥ (cid:19) (1 − cos2 κij) ≤ − π − θij π (1 − cos2 κij). Lemma 28. Given that the initial condition in Lemma 3 holds, suppose the network is over- parameterized, i.e., n ≥ 2, and the initialization is non-degenerate, then for ∀t ∈ R≥0, at least one of the following two conditions must hold: ∃i ∈ [n] s.t. zi(t) = 0, κmax(t) ≥ κmax(0) 3 . Proof. Assume for contradiction that ∃t such that zi(t) ̸= 0, ∀i and κmax(t) < κmax(0) can define 3 (cid:26) t∗ = inf t ∈ R|∀i, zi(t) ̸= 0 ∧ κmax(t) < κmax(0) 3 (cid:27) . (61) (62) . Then we Note that by lemma 27 we have Q+(t∗) ≥ 1. For ∀i, j ∈ Q+(t∗), if κij(t∗) > κmax(0)/3, due to the continuity of κij, κij > κmax(0)/3 holds in an open neighborhood of t∗, which contradicts the definition of t∗. So ∀i, j ∈ Q+(t∗) we have κij(t∗) ≤ κmax(0)/3. 40 Step 1: First we prove ∀i, zi(t∗) ̸= 0. If ∃i such that zi(t∗) = 0, then for such i we have ∂zi(t∗) ∂t = − (cid:80) j̸=i π−θij (t∗) 2π zj(t∗). Since Q+(t∗) ̸= ∅, pick k ∈ Q+(t∗) and we have (cid:28) ∂zi(t∗) ∂t (cid:29) , zk(t∗) = − (cid:88) j̸=i∧j∈Q+(t∗) π − θij(t∗) 2π ⟨zj(t∗), zk(t∗)⟩ < 0, where the last inequality is because κjk(t∗) ≤ κmax(0)/3 < π 2 . On the other hand, the definition of ∂zi(t∗) ∂t zi(t∗) + (t′ − t∗) ∂zi(t∗) (t′ − t∗) ∂zk(t∗) ∂t + o(t′ − t∗). Then ∂t + o(t′ − t∗) = (t′ − t∗) ∂zi(t∗) implies that ∃ε > 0, ∀t′ ∈ [t∗, t∗ + ε), zi(t′) = ∂t + o(t′ − t∗). Similarly, zk(t′) = zk(t∗) + ⟨zi(t′), zk(t′)⟩ = (t′ − t∗) (cid:28) ∂zi(t∗) ∂t (cid:29) , zk(t∗) + o(t′ − t∗). (63) Since (cid:68) ∂zi(t∗) ∂t (cid:69) , zk(t∗) < 0 is a negative constant, there exists ε′ > 0 such that for ∀t′ ∈ [t∗, t∗ +ε′), (cid:16)(cid:68) (cid:69)(cid:17) (63) is negative, consequently κik(t′) = arccos κmax(t′) ≥ κik(t′) > π/2 ≥ κmax(0)/3, this contradicts the definition of t∗. Step 2: After proving zi(t∗) ̸= 0, ∀i and κij(t∗) ≤ κmax(0)/3 < κmax(0), ∀i, j ∈ [n], we aim to derive a contradiction. 2 . So ∀t′ ∈ [t∗, t∗ + ε′), zi(t′), zk(t′) > π Note that t∗ ̸= 0 due to the definition of κmax. By the continuity of zi, ∃ε1 > 0 such that for ∀t ∈ (t∗ − ε1, t∗ + ε1), i ∈ [n], zi(t) ̸= 0. Then the definition of t∗ implies that ∀t ∈ (t∗ − ε1, t∗), κmax(t) ≥ κmax(0)/3. Since on the interval (t∗ − ε1, t∗ + ε1), κmax = maxi,j∈[n] κij is continuous 4, we have that κmax(t∗) ≥ κmax(0)/3. Then κmax(t∗) = κmax(0)/3. Pick i, j such that κij(t∗) = κmax(t∗). Note that θij(t∗) < π, otherwise κij(t∗) = π, a contradiction. Then by lemma 15 we have ∂ ∂t cos κij(t∗) ≤ − (1 − cos κ2 ij(t∗)) < 0. π − θij(t∗) π ∂t κij(t∗) > 0 ⇒ ∃ε2 > 0 s.t. ∀t ∈ (t∗, t∗ + ε2), κmax(t) ≥ κij(t) > κij(t∗) = κmax(t∗) = So ∂ κmax(0)/3, this contradicts the definition of t∗. Lemma 29. Given that the initial condition in Lemma 3 holds, suppose the network is over- parameterized, i.e., n ≥ 2, and the initialization is non-degenerate, then for ∀t ∈ R≥0 we have Z(t) ≥ Ω(κmax(0) max i∈[n] ∥zi(t)∥). Proof. We show that for ∀t ∈ R≥0, max i,j∈[n] ∥zi(t) − zj(t)∥ ≥ Ω(κmax(0) max i∈[n] ∥zi(t)∥). (64) W.L.O.G., suppose z1(t) = maxi∈[n] ∥zi(t)∥. By lemma 28, for ∀t one of the following two cases must happen: 4Generally κmax may not be continuous since the range of taking the max (i, j ∈ Q+) might change, but it is continuous on (t∗ − ε1, t∗ + ε1) since all zi's are nonzero on this interval. 41 • ∃k s.t. zk(t) = 0. By lemma 27, k ̸= 1. Then maxi,j∈[n] ∥zi(t) − zj(t)∥ ≥ ∥z1(t) − zk(t)∥ = ∥z1(t)∥ ≥ O(κmax(0) maxi∈[n] ∥zi(t)∥). • κmax(t) ≥ κmax(0)/3. Pick a pair i, j such that κij(t) = κmax(t). Then κ1i(t) + κ1j(t) ≥ κij(t) ≥ κmax(0)/3 ⇒ max{κ1i(t), κ1j(t)} ≥ κmax(0)/6. W.L.O.G., suppose κ1i(t) ≥ κmax(0)/6. If κ1i(t) ≤ π/2, then ∥z1(t) − zi(t)∥ ≥ ∥z1(t)∥ sin κ1i(t) ≥ Ω(κmax(0) maxi∈[n] ∥zi(t)∥). If κ1i(t) > π/2, then ∥z1(t) − zi(t)∥ ≥ ∥z1(t)∥ ≥ Ω(κmax(0) maxi∈[n] ∥zi(t)∥). So no matter which case happens, (64) always holds. In conclusion, we have Z(t) ≥ maxi,j∈[n] ∥zi(t) − zj(t)∥ ≥ Ω(κmax(0) maxi∈[n] ∥zi(t)∥). Combined with Lemma 27, Lemma 29 immediately implies the following corollary. Corollary 30. Given that the initial condition in Lemma 3 holds, suppose zi(0) ̸= 0, ∀i ∈ [n], κmax(0) > 0 and n ≥ 2, then for ∀t ∈ R≥0 we have Z(t) > 0. Lemma 31. Suppose the conditions (57) (58) in Theorem 25 holds. Suppose the network is over- parameterized, i.e., n ≥ 2, and the initialization is non-degenerate. Then ∀t ≥ T2 we have ∂ ∂t Z(t) ≥ −O(n2∥v∥θ2 max(t)). Proof. Recall the closed form expression of gradient (3), which can be decomposed into two terms, ∂L(w) ∂wi = 1 2 (cid:124) j (cid:123)(cid:122) I1 (cid:32) (cid:88) (cid:33) wj − v + (cid:34)(cid:32) 1 2π (cid:88) j̸=i ∥wj∥ sin θij − ∥v∥ sin θi wi − (cid:33) (cid:125) (cid:124) (cid:123)(cid:122) I2 (cid:35) θijwj + θiv . (cid:88) j̸=i (cid:125) The second term I2 can be rewritten as I2 = 1 2π (cid:34) (cid:88) j̸=i ∥wj∥(sin θij − θij)wi + (cid:88) j̸=i ∥wj∥θij(wi − wj) − ∥v∥(sin θi − θi)wi − ∥v∥θi(wi − v) (cid:35) By Theorem 25, for ∀t > T2, we have ∥wi(t)∥ = Θ(∥v∥/n). Note that sin θij(t) − θij(t) = ij(t)) = O(θ3 max(t)). Combined with ∥wi − wj∥ = max(t)), similarly sin θi(t) − θi(t) = O(θ3 O(θ3 2 sin(θij/2) = O(θmax), we get ∥I2∥ ≤ (cid:88) j̸=i Θ(∥v∥/n)O(θ3 max) + (cid:88) j̸=i Θ(∥v∥/n)θmaxO(θmax) +∥v∥O(θ3 max) + ∥v∥θmaxO(θmax) = O(∥v∥θ2 max). Then ∀i, ∂wi ∂t = − ∂L(w) = − 1 2 ∂wi is the same for all wi, so for ∀i, j ∈ [n] we have j wj − v (cid:16)(cid:80) (cid:17) max). Note that the first term − 1 +O(∥v∥θ2 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) = O(∥v∥θ2 (cid:13) = (cid:13) ∂t − ∂wj ∂wi−wj ∂t (cid:13) (cid:13) (cid:13) ∂wi ∂t max). (cid:16)(cid:80) j wj − v (cid:17) 42 For ∀i, j ∈ [n], if zi(t) = zj(t) then ∂zi(t) ∂t = ∂zj (t) ∂t ⇒ ∂ ∂t ∥zi(t) − zj(t)∥ = 0. Otherwise zi(t) − zj(t) ̸= 0 and ∂ ∂t (∥zi(t) − zj(t)∥) = So for both cases we have ∂ ∂t Z(t) = (cid:80) ∂ Then ∂ 1≤i<j≤n ≥ − (cid:13) (cid:13) (cid:13) (cid:13) ∂ ∂t (zi(t) − zj(t)) (cid:13) (cid:13) (cid:13) (cid:13) ≥ − (cid:29) (zi(t) − zj(t)) , zi(t) − zj(t) (cid:28) ∂ ∂t (cid:13) (cid:13) (cid:13) (cid:13) ∂t (∥zi(t) − zj(t)∥) ≥ −O(∥v∥θ2 ∂t (∥zi(t) − zj(t)∥) ≥ −O(n2∥v∥θ2 (wi(t) − wj(t)) ∂ ∂t ≥ −O(∥v∥θ2 (cid:13) (cid:13) (cid:13) (cid:13) max(t)). max(t)). max(t)). F.3 Proof of Main Theorem Theorem 12. Suppose the network is over-parameterized, i.e., n ≥ 2. For ∀δ > 0, if the initialization is non-degenerate, d = Ω(log(n/δ)), σ = O (cid:0)n−4226d−1/2∥v∥(cid:1), then there exists T2 = O (cid:0) log n (cid:1) such that with probability at least 1 − δ, for ∀t ≥ T2 we have n L(w(t))−1/3 ≤ O (cid:18) n17/3 max(0)∥v∥2/3 κ2 (cid:19) (t − T2) + γ, where γ ∈ R+ is a constant that does not depend on t. Proof. For ∀t ≥ T2 we have maxi∈[n] ∥zi(t)∥ ≥ θmax(t)Θ(∥v∥/n). Then by lemma 29, for ∀t ≥ T2, Z(t) ≥ Ω(κmax(0)θmax(t)∥v∥/n) ⇒ θmax(t) = O . Combined with lemma 31 we have (cid:16) nZ(t) κmax(0)∥v∥ (cid:17) ∂ ∂t Z(t) ≥ −O(n2∥v∥θ2 max(t)) ≥ −O . (65) (cid:18) n4Z 2(t) (cid:19) κ2 max(0)∥v∥ By Corollary 30, Z(t) is always strictly positive. We can therefore calculate the dynamics of 1/Z(t) as: ∀t ≥ T2, ∂ ∂t 1 Z(t) = − 1 Z 2(t) ∂ ∂t Z(t) ≤ O (cid:18) (cid:19) n4 κ2 max(0)∥v∥ ⇒ 1 Z(t) = O (cid:18) n4 κ2 max(0)∥v∥ (cid:19) (t − T2) + . 1 Z(T2) (66) On the other hand, by Theorem 25 we have (cid:88) (cid:88) (∥zi(t)∥ + ∥zj(t)∥) ≤ Z(t) ≤ (θi(t)∥wi(t)∥ + θj(t)∥wj(t)∥) ≤ O(n∥v∥θmax). 1≤i<j≤n 1≤i<j≤n By lemma 18 we have ∀t ≥ T2, θmax(t) = O (cid:32)(cid:18) L(w(t))n2 (cid:19)1/3(cid:33) ∥v∥2 ⇒ L(w(t)) ≥ Ω (cid:18) Z 3(t) n5∥v∥ (cid:19) . (67) Combined with (66), we have L(w(t))−1/3 ≤ O (cid:18) n17/3 κ2 max(0)∥v∥2/3 (cid:19) (t − T2) + n5/3∥v∥1/3 Z(T2) . Finally, since Corollary 30 implies Z(T2) > 0, setting γ = n5/3∥v∥1/3 Z(T2) finishes the proof. 43
http://arxiv.org/abs/2302.10030v1
2023-02-20T15:24:06
2023-02-20T15:24:06
Safe Deep Reinforcement Learning by Verifying Task-Level Properties
Cost functions are commonly employed in Safe Deep Reinforcement Learning (DRL). However, the cost is typically encoded as an indicator function due to the difficulty of quantifying the risk of policy decisions in the state space. Such an encoding requires the agent to visit numerous unsafe states to learn a cost-value function to drive the learning process toward safety. Hence, increasing the number of unsafe interactions and decreasing sample efficiency. In this paper, we investigate an alternative approach that uses domain knowledge to quantify the risk in the proximity of such states by defining a violation metric. This metric is computed by verifying task-level properties, shaped as input-output conditions, and it is used as a penalty to bias the policy away from unsafe states without learning an additional value function. We investigate the benefits of using the violation metric in standard Safe DRL benchmarks and robotic mapless navigation tasks. The navigation experiments bridge the gap between Safe DRL and robotics, introducing a framework that allows rapid testing on real robots. Our experiments show that policies trained with the violation penalty achieve higher performance over Safe DRL baselines and significantly reduce the number of visited unsafe states.
[ "Enrico Marchesini", "Luca Marzari", "Alessandro Farinelli", "Christopher Amato" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10030v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10030v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.AI", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.AI", "cs.LG" ]
3 2 0 2 b e F 0 2 ] I A . s c [ 1 v 0 3 0 0 1 . 2 0 3 2 : v i X r a Safe Deep Reinforcement Learning by Verifying Task-Level Properties Enrico Marchesini* Northeastern University Boston (MA), USA [email protected] Alessandro Farinelli University of Verona Verona, Italy [email protected] Luca Marzari* University of Verona Verona, Italy [email protected] Christopher Amato Northeastern University Boston (MA), USA [email protected] ABSTRACT Cost functions are commonly employed in Safe Deep Reinforce- ment Learning (DRL). However, the cost is typically encoded as an indicator function due to the difficulty of quantifying the risk of policy decisions in the state space. Such an encoding requires the agent to visit numerous unsafe states to learn a cost-value function to drive the learning process toward safety. Hence, increasing the number of unsafe interactions and decreasing sample efficiency. In this paper, we investigate an alternative approach that uses domain knowledge to quantify the risk in the proximity of such states by defining a violation metric. This metric is computed by verifying task-level properties, shaped as input-output conditions, and it is used as a penalty to bias the policy away from unsafe states without learning an additional value function. We investigate the benefits of using the violation metric in standard Safe DRL benchmarks and robotic mapless navigation tasks. The navigation experiments bridge the gap between Safe DRL and robotics, introducing a frame- work that allows rapid testing on real robots. Our experiments show that policies trained with the violation penalty achieve higher performance over Safe DRL baselines and significantly reduce the number of visited unsafe states. KEYWORDS Deep Reinforcement Learning; Safety; Robot Navigation ACM Reference Format: Enrico Marchesini*, Luca Marzari*, Alessandro Farinelli, and Christopher Amato. 2023. Safe Deep Reinforcement Learning by Verifying Task-Level Properties. In Proc. of the 22nd International Conference on Autonomous Agents and Multiagent Systems (AAMAS 2023), London, United Kingdom, May 29 – June 2, 2023, IFAAMAS, 10 pages. 1 INTRODUCTION Safe Deep Reinforcement Learning (DRL) approaches typically fos- ter safety by limiting the accumulation of costs caused by unsafe interactions [12]. Defining informative cost functions, however, has the same issues as designing rewards [13] due to the difficulty of quantifying the risk around unsafe states. For this reason, recent Proc. of the 22nd International Conference on Autonomous Agents and Multiagent Sys- tems (AAMAS 2023), A. Ricci, W. Yeoh, N. Agmon, B. An (eds.), May 29 – June 2, 2023, London, United Kingdom. © 2023 International Foundation for Autonomous Agents and Multiagent Systems (www.ifaamas.org). All rights reserved. * indicates equal contribution. works rely on indicator functions, where a positive value deems a state unsafe [22]. In detail, the cost refers to a state-action pair (s, a), and it is backed up to propagate safety information and esti- mate a cost-value function. The cost metric and its value estimation have been used to drive the learning process towards safety using penalties [33, 43], cumulative or instantaneous constraints [21, 41]. However, the learned value functions have poor estimates and end up in local optima [14, 25], limiting their efficacy in fostering safety. We argue that the cost's sparse nature is another key issue that hinders safety and sample efficiency. A sparse definition of the cost requires the agent to visit unsafe states to learn good estimates from the sparse feedback. These issues are pivotal in a safety context where we aim to minimize the number of visited unsafe states. In this direction, we note that the indicator costs do not carry information about areas around s where it is risky to perform the action that led to deeming s unsafe. For example, consider a naviga- tion scenario where a policy chooses the robot's velocity, given its position. In this context, prior works trigger a positive cost when colliding in a state s (Figure 1 on the left) and need to visit similar unsafe interactions around s to learn the cost-value function that drives the learning process toward safety [7, 21, 41]. In contrast, it is possible to exploit high-level system specifications (e.g., robots' size and velocity) to define an area of size ε around s where perform- ing the action a that led to collision would result in other unsafe interactions (Figure 1 on the right). We can then compute a safety value based on the policy's decisions, avoiding visiting such an unsafe area to learn a cost-value function. Hence, the idea is to replace indicator costs and the learning of cost-value functions by quantifying the states in the unsafe area where the policy chooses a and use it as a penalty to discourage unsafe decisions [1, 19]. Our hypothesis is that this procedure can significantly improve sample efficiency and reduce the number of visited hazardous states. To this end, we propose an approximate violation metric as a penalty that uses system specifications to quantify how safe policy Figure 1: Indicator cost function (left). Unsafe interactions, caused by the same action, around the unsafe state (right). decisions are around s. Following recent literature [20, 26, 36], we encode whether a policy chooses specific actions (outputs) in a subspace of the state space (inputs) as input-output conditional statements, commonly referred to as task-level properties (or state- action mappings). Formal Verification (FV) approaches for Deep Neural Networks (DNNs) have been used to formally check all the states where the policy violates such properties [45]. In particular, [10] introduced a formal violation metric by provably quantifying how well the policy respects the properties. Such a formal violation naturally addresses the limitation of indicator cost functions but has not been previously investigated to foster safety in DRL, as FV has two main issues. (i) It is a NP-Complete problem [17] that makes it intractable to compute the formal violation metric at training time without a prohibitive overhead. (ii) The state-action mappings are hard-coded, which could be unfeasible in tasks with complex or unknown specifications. Against this background, we make the following contributions to the state-of-the-art: • We replace FV with a sample-based approach that approx- imates the violation metric with forward propagations of the agent's network on the sampled states. Such an approxi- mation empirically shows a negligible error over the value computed with FV in a fraction of the computation time. • We generate an additional state-action mapping when per- forming an unsafe interaction during the training, using a fixed-size area around the visited unsafe state and the action that led to such interaction. • We show the advantages of using our approximate violation as a penalty in existing DRL algorithms and employ FV [10] on the trained policies to show that our approach allows learning safer behaviors (i.e., lower violations). Our empirical evaluation considers a set of Unity [15] robotic map- less navigation tasks [29, 42, 51]. In contrast to Safe DRL bench- marks (e.g., SafeMuJoCo [21]), our scenarios allow transferring policies directly on the robot to foster the development of Safe DRL approaches in realistic applications. We also evaluate violation- based approaches in standard SafeMuJoCo tasks. In all scenarios, we compare with unconstrained DRL baselines augmented with a cost penalty [39, 47], and constrained DRL [41]. Our evaluation shows that cost-based algorithms have higher costs and higher vio- lations, confirming the lack of information provided by indicator cost functions. In contrast, the approximate violation-based penalty drastically reduces unsafe behaviors (i.e., lower cost and violation) while preserving good returns during and after training. 2 PRELIMINARIES A DRL problem is typically modeled as a Markov Decision Process (MDP), described by a tuple < S, A, P, r, γ > where S is the state space, A is the action space, P : S × A → S is the state transition function, r : S × A → R is a reward function, and γ ∈ [0, 1) is the discount factor. In particular, given a policy π ∈ Π := {π (a|s) : s ∈ S, a ∈ A}, the agent aims to maximize the expected discounted return for each trajectory τ = (s0, a0, r0, * * * ): J π r := Eτ∼π max π ∈Π (cid:35) γtr (st , at ) (cid:34) ∞ ∑︁ t =0 (1) A common approach to fostering safety is adding a penalty to the reward to learn how to avoid unsafe interactions character- ized by lower payoffs [12]. Otherwise, MDPs can be extended to Constrained MDPs (CMDPs) to incorporate a set of constraints C defined on C0,...,c : S ×A → R cost functions (where c is the number of constraints) and their thresholds t0,...,c [3]. A Ci -return is defined as J π γtCi (st , at )]. Constraint-satisfying (feasible) policies Π C, and optimal policies π ∗ are thus defined as: Ci := Eτ∼π [(cid:205)∞ t =0 Π C := {π ∈ Π : J π Ci ≤ ti, ∀i ∈ [0, . . . , c]}, π ∗ = max π ∈ΠC J π r (2) Constrained DRL algorithms aim at maximizing the expected return J π r while maintaining costs under hard-coded thresholds t: J π r max π ∈Π s.t. J π C ≤ t (3) Such a constrained optimization problem is usually transformed into an equivalent unconstrained one using the Lagrangian method [35, 38, 41], resembling a penalty-based approach. Recently, Tessler et al. [43] also argued that constrained DRL has significant limi- tations as it requires a parametrization of the policy (i.e., it does not work with value-based DRL), a propagation of the constraint violation over trajectories and works with limited types of con- straints (e.g., cumulative, instantaneous). For these reasons, the authors show the efficacy of integrating a penalty signal into the reward function. This motivates our choice of using penalty-based approaches to evaluate the benefits of incorporating the proposed approximate violation as a penalty to foster safety. 2.1 Properties and Violation From FV literature [20], a property P is hard-coded using task- level knowledge as a pre-condition R and a post-condition Q (i.e., P := ⟨R, Q⟩). In a DRL context, R is the domain of the property (i.e., the area around s), and Q is the co-domain (i.e., an action). Broadly speaking, given a DNN N with y1,...,n outputs, R is defined with an interval εi for each input i of N , which we refer to as εεε-area, and Q represents different desiderata on the output [4]. For example, in a value-based setup where the policy selects the action with the highest value, the post-condition Q of a property designed for safety models never select the action corresponding to the output yk ∈ y1,...,n. Formally, Q checks the following inequality: yk < yi ∀i ∈ [1, n] − {k } (4) that extends to continuous actions as shown in prior work [20, 45]. Recent works introduced a violation metric to quantify the num- ber of violations in the domain of the property using verification techniques [10, 31]. In more detail, the violation is defined as the ratio between the size of R′ ⊆ R where the post-condition is vio- lated (i.e., the inequality does not hold and yk is selected) and R. Such a provable violation carries the task-level information of the properties and quantifies how often a property is violated. Hence, when using properties to model safety specifications, which we refer to as safety properties, the violation represents a locally-aware cost function. Algorithm 1 Computing the Approximate Violation Given N with outputs y1,...,n, the current state s, properties ⟨R, Q⟩, and size m of states to sample. 1: N ′ ← add a layer with n outputs to N that implements (4) 2: P′ ← ⟨R, Q⟩ if s ∩ R ≠ ∅, ∀ ⟨R, Q⟩ ∈ ⟨R, Q⟩ ▷ i.e., s is unsafe 3: I ← Sample m points from p [R] ∀p ∈ P′ 4: violation = Count max[N ′(I )] ≤ 0 ∀I ∈ I ▷ considering yk from p [Q] ∀p ∈ P′ 5: return violation / (m |P′|) information in a local region around a state. Moreover, our approx- imate violation: • Includes safety information of areas of interest due to the state-action mappings (i.e., properties). • Approximates how often a property violation might occur, having a similar role to Lagrangian multipliers but without requiring additional gradient steps or value estimators. • It does not require additional environment interactions, dras- tically reducing the number of visited unsafe states. Finally, prior verification works only rely on hard-coded proper- ties [10, 46, 48]. Still, it is not uncommon to experience an unsafe state not included in the pre-conditions due to design issues, i.e., s ∩ R = ∅ ∀ R ∈ R. Hence, we generate an additional property upon experiencing an unsafe state s using a fixed-size area around s as R and the performed action as Q. However, hard-coded properties are still crucial as there could be corner cases with more than one action to avoid. 3.1.1 Visual Example. We further detail the approximate violation computation using a visual example. In particular, Figure 2 shows an illustrative example of a DNN and a property Pr (following Section 4.2 formalization). For the sake of simplicity, we show the process assuming to use only m = 1 sample from the property pre-condition. Following Algorithm 1, we show N ′ on the right of Figure 2, consisting of a new output that implements yi − yk ∀i ∈ [1, n], where yk with k = 1 is the node that represents the action we are interested in avoiding. Considering the example in Figure 1, x0,...,3 are the current position, orientation, and distance from 3 METHODS We aim to investigate the benefits of combining a reward and a violation-based penalty value into an MDP. Following prior penalty- based approaches [12, 43], we maximize the following objective: (cid:34) ∞ ∑︁ (cid:35) γtr (st , at ) − Z (*) (5) J π r,C := Eτ∼π max π ∈Π t =0 where Z (*) is a generic penalty function. For example, a violation- penalty is Zπ (st ± εεε), indicating that the violation depends on the policy decisions in a proximity εεε of the state (i.e., the εεε-area, or R). Equation 5 has two core benefits over other Safe DRL methods based on constraints: (i) penalty objectives potentially maintain the same optimal policy of the underlying MDP as they do not constrain exploration nor reduce the space of feasible policies as constrained approaches [34].1 (ii) Constrained DRL typically estimates an ad- vantage function to propagate cost information, hindering their application with values that strictly depend on the current policy. Moreover, this requires visiting unsafe states to learn effective esti- mates for the sparse cost values. In contrast, penalty-based methods do not require a separate advantage estimate. In addition, various DRL algorithms, such as Proximal Policy Optimization (PPO) [39], provide significant empirical evidence of the benefits of using penal- ties instead of constraints [43]. 3.1 Approximate Violation A violation metric computed on a safety property quantifies the number of unsafe policy decisions over an area of the state space around the state s. Such a local component and the task-level knowledge inherited by the safety properties naturally address the indicator cost functions' lack of information. However, the NP- Completeness of FV [17] makes the provable violation computation intractable during the training due to the significant overhead of ver- ification tools [18]. Hence, we address the computational demands of FV by proposing a novel sample-based method to approximate the violation. Given a DNN N that parameterizes a policy, a list of properties P = ⟨R, Q⟩, and the current state s, we aim at checking whether yk < yi ∀i ∈ [1, n] − {k } (where y := [y1,...,n] are the outputs of N given s as input). The general flow of our method is presented in Algorithm 1: first, we embed the condition (4) in the network architecture by concatenating a new output layer that implements yi −yk ∀i ∈ [1, n] (line 1). We refer to this augmented network as N ′. If s is contained in one or more pre-condition (i.e., it is deemed risky according to the properties), we consider such a subset of properties P′ ⊆ P to compute the approximate violation (line 2). Hence, we randomly sample a set of states I from the pre-conditions R ∈ P′ (line 3). Finally, after propagating I through N ′, we enumerate the outputs N ′(I ) ≤ 0, which are the ones that do not satisfy the post-conditions (line 4). Finally, our approximate violation is the ratio between the number of such outputs over the total sampled points (line 5), which closely resembles how the formal violation is computed in [10]. Similarly to the formal violation, our approximation can be in- terpreted as a locally-aware cost because it is computed using the 1This is not the case for navigation tasks as safe policies avoid obstacles. Figure 2: Example of computing the approximate violation. (e.g., violation), enabling a straightforward application to different penalty-based objectives (as in Equation 5) or constraints. We introduce four training and one testing environment with different obstacles, namely Fixed_obs_{T, NT}, Dynamic_obs_{T, NT}, and Evaluation_NT depicted in Figure 3. Such a variety of conditions serve to provide different settings for evaluating Safe DRL algo- rithms in robotic navigation. The environments inherit several char- acteristics from known benchmarks such as SafetyGym [37] and dif- fer from each other as the obstacles that can be Fixed (parallelepiped- shaped static objects) or Dynamic (cylindrical-shaped objects that move to random positions at a constant velocity). Moreover, obsta- cles can be Terminal (T) if they end an episode upon collision, or Non-Terminal (NT) if the agent can navigate through them. 4.1 Environment Descriptions Our scenarios share a 4m × 4m size (6m × 6m for the testing one), randomly generated obstacle-free goals, and a timeout at 500 steps. A list of environments and their other main features follows: • Fixed_obs_T has fixed terminal (T) obstacles. With terminal, we intend that the episode ends upon collision. • Fixed_obs_NT differs from the previous one for the non- terminal (NT) obstacles. The environment returns a signal upon each collision that can be used to model cost functions or other penalties. Non-terminal obstacles are visible to the lidars but non-tangible, i.e., the Turtlebot3 can pass through them. This class of obstacles represents the main challenge to designing safe DRL solutions, as the robot could get more positive rewards by crossing an obstacle at the expense of a higher number of unsafe behaviors. • Dynamics_obs_T has cylindrical-shaped dynamic terminal (T) obstacles. Such obstacles move toward random positions at a constant velocity, representing a harder challenge. The obstacles can travel on the robot's goal, so the agent must learn a wider variety of behaviors (e.g., react to an approach- ing obstacle, stand still to wait for the goal to clear). • Dynamics_obs_NT : differs from the previous one for the non-terminal (NT) obstacles. • Evaluation_NT : we use this evaluation environment to test the generalization abilities of trained policies to new situ- ations. This scenario is wider and contains both fixed and dynamic non-terminal obstacles of different shapes. the goal for the robot. We want to avoid the action with index 0 (i.e., y1), a forward movement at velocity (cid:174)v. We sample the m = 1 point from the property pre-condition, obtaining i ∈ I that is then forward propagated through the network N ′(I ). Such propagation returns y1 = 3, y2 = 1, y3 = 2 in the original output layer, and y ′ 3 = −1 in the output of N ′. Finally, we enumerate 1 = 0, y ′ the states ∈ I where the maximum of N ′(I ) is less than or equal to 0, which means that y1 will be chosen, leading to a violation. 2 = −2, y ′ 3.2 Limitations The violation requires hard-coded properties, which are challeng- ing to design when considering agents with unknown dynamics. Our generated property does not consider scenarios where multiple actions are unsafe for the same state, so it remains unclear how to collect and refine properties during the training to model safe behaviors. Hence, as in FV literature [20], we assume having access to task-level knowledge to design the hard-coded properties. In safety-critical contexts, this assumption typically holds. Consid- ering different input types (e.g., images) is conceptually feasible but would require further research and empirical evaluation. To this end, model-based DRL would allow using the model to design the unsafe area. Finally, it is unclear how to provide guarantees in model-free Safe DRL approaches, including our work, constrained DRL [2, 21, 49], and several other approaches summarized in Garcıa and Fernández [12]. As discussed in Ilyas et al. [14], using DNNs for approximating policies and values makes the method diverge from the underlying theoretical framework. Nonetheless, we start addressing such key issues by employing existing FV approaches to check the trained policy decisions over the properties of interest. 4 EXPERIMENTS First, we introduce a set of Turtlebot3-based safety mapless navi- gation tasks to enable rapid testing of policies in realistic contexts. Our environments rely on Unity [15] as it allows rapid prototyp- ing, Gym compatibility, and interface with the Robotic Operating System (ROS). Mapless navigation is a well-known problem in model-free DRL [42, 51], prior Safe DRL literature [27, 37], and multi-agent DRL [29, 30]. While standard navigation planners use a map of the environment and exhaustive information from the sensors, DRL setups consider more challenging conditions, such as not having a map and relying only on sparse local sensing. We use a similar encoding to prior work [6, 28, 32, 42, 51]: 11 sparse laser scans with a limited range and two values for the target relative position (i.e., distance and heading) as observations. Discrete ac- tions encode angular and linear velocities to reduce training times while maintaining good navigation skills [28].2 At step t, the agent receives a reward: (cid:40) rt = 1 Δ(dt −1, dt ) − β if goal reached otherwise (6) The agent thus obtains a dense reward given by the distance (d) difference (Δ) from the goal in two consecutive steps, with a per- step −β to incentive shorter paths. Each collision returns a posi- tive cost signal that can be used to compute the desired penalty 2Our environments also support continuous actions and different domain ran- domization of the tasks and physical properties through the Unity editor. Figure 3: Fixed, Dynamic, Evaluation tasks with different ob- stacles. Terminal obstacles (T) reset the environment upon collision. Non-terminal ones (NT) allow the robot to cross them, experiencing more unsafe states. The evaluation en- vironment has fixed and dynamic non-terminal obstacles. Table 1: Average violation (%), and computation time for properties p↑,←,→ calculated using ProVe[10], and our approximation with 100, 1.000, and 10000 samples. ProVe Estimation 100 Estimation 1k Estimation 10k Property p↑ p← p→ Mean violation: 81.48 ± 1.2 73.9 ± 0.8 74.2 ± 0.3 76.53 Mean computation time: ≈2m37s 4.2 Properties for Mapless Navigation Our properties shape rational, safe behaviors for mapless navigation and are used to compute the approximate violation. Moreover, we consider an online generated property described in Section 3.1. A natural language description of the main hard-coded properties follows: • p↑: There is an obstacle close in front ⇒ Do not go forward • p←: There is an obstacle close to the left ⇒ Do not turn left • p→: There is an obstacle close to the right ⇒ Do not turn right We use the maximum agent velocity to determine the size of the area around the (unsafe) states of interest (i.e., the εεε-area). For example, a formal definition for p↑ is: p↑ : x0, . . . , x4 ∈ [0, 1] ∧ x5 ∈ [0, 0.05] ∧ x6, . . . , x10 ∈ [0, 1] ∧ x11, x12 ∈ [−1, 1] =⇒ a ≠ 4 where x0, . . . , x10 are the 11 lidar values, x11, x12 is the relative position of the goal (i.e., distance and heading), and action a = 4 corresponds to a forward movement. Crucially, each input xi po- tentially considers a different interval to model the area of interest. Hence, p↑ checks the policy's decisions when there is an obstacle close to the front (i.e., x5 ∈ [0, 0.05]) under any possible target posi- tion (x11, x12 ∈ [−1, 1]).3 The approximate violation computed over these properties thus contains information about a specific unsafe situation under a general goal configuration (i.e., x11, x12 ∈ [−1, 1]). To assess how good our approximate violation is over the prov- able one, we compare it with the violation computed by a FV frame- work. In particular, the formal violation and our approximate one are computed using the above properties. They are averaged over the same ten models collected at random steps during the train- ing. Table 1 shows the violation values for each property p↑,←,→ computed by ProVe [10], and our approximation using 100, 1000, and 10000 samples. Our approximation shows an average 0.69% error over the formal violation even when using only 100 samples. Such an error further decreases to 0.47% by using 10000 samples. By exploiting parallelism and batch computation of modern Deep Learning Frameworks, the increase in computation time for the approximate violation with 100 or 10000 samples is comparable. Conversely, as discussed in Section 3.1, ProVe's average computa- tion time is orders of magnitude higher with respect to our approach (i.e., 0.06 over 157 seconds). However, our approximate methodol- ogy does not formally guarantee the policy behaviors due to its 81.0 ± 0.6 73.5 ± 0.2 73.6 ± 0.1 76.00 ≈0.053s 81.1 ± 0.8 73.63 ± 0.2 73.67 ± 0.1 76.13 ≈ 0.056s 81.17 ± 0.5 73.65 ± 0.3 73.68 ± 0.1 76.17 ≈0.060s sample-based nature. For this reason, the next section uses stan- dard FV frameworks on the trained policies to show the provable violation results. 4.3 Empirical Evaluation Our evaluation aims at showing the following: • The benefits of integrating reward and safety specifications into a single MDP. • The advantages of using our violation over indicator cost functions. To assess our claims, we plot the following values averaged over the last 1000 steps: (i) success (i.e., the number of goals reached), (ii) cost, (iii) and the violation at different stages of the training. Data are collected on an i7-9700k and consider the mean and standard deviation of ten independent runs [9]. We consider the cost and violation penalty objective (5) in a value-based (Dueling Double Deep Q-Network (DuelDDQN) [47]) and policy-based (PPO [39]) baselines, referring to the resultant algorithms as DuelDDQN_{cost, violation} and PPO_{cost, violation}. We compare with Lagrangian PPO (LPPO) [41] as it is a widely adopted Constrained DRL baseline and achieves state-of-the-art performance in similar SafetyGym navigation-based tasks.4 According to the literature, the value- based and policy-gradient baselines should achieve the highest rewards and costs (having no penalty information) [37]. Conversely, LPPO should show a significant trade-off between average cost and reward or fail at maintaining the cost threshold when set to low values [21, 27, 37]. In contrast, we expect the penalty-based methods to achieve promising returns while significantly reducing the cost and the number of violations during the training. Terminal Results. Our results are shown in the Appendix. The information carried by the violation results in a significant perfor- mance advantage, maintaining similar or higher successes over non- violation-based approaches. Moreover, the policy-based algorithms show superior performance over the value-based implementations. Non-Terminal Results. Given the higher performance of policy- based algorithms, the following experiments omit value-based ones. Figure 4 show the results of (NT) tasks. As in the previous eval- uation, PPO achieves a higher number of successes and a higher cost. In contrast, LPPO satisfies the constraint most of the time but achieves the lowest successes and does not learn effective naviga- tion behaviors in Dynamic_obs_NT, confirming the performance 3We measured that a minimum normalized distance of 0.05 is required for the robot to turn at max speed and avoid obstacles in front. 4For a fair comparison, we set the cost threshold of LPPO to the average cost obtained by PPO_cost. The Appendices detail our hyper-parameters and are accessible at the following link: shorturl.at/crSX6 Figure 4: The two rows show average success, cost, and violation in the (NT) environments for PPO, the cost and violation penalty versions PPO_{cost, violation}, and LPPO. * indicates penalty-based algorithms. Table 2: Average formal violation for the models at convergence in NT environment. Our violation-based penalty algorithm is the safest overall, as a lower violation value translates into fewer collisions. trade-off in complex scenarios [27, 37]. Moreover, PPO_violation achieves better or comparable successes and cost values over PPO_cost but significantly reduces the violations during the training. At convergence, PPO_violation shows a ≈ 2.2% and ≈ 4.6% improve- ment over the cost counterparts, corresponding to 1320 and 2760 fewer unsafe policy decisions. In general, non-terminal tasks allow experiencing more unsafe situations in a trajectory, making the performance advantage in terms of the safety of violation-based algorithms more evident. In addition, we use FV [10] on the trained models of NT environ- ments to provably guarantee the number of unsafe policy decisions over our safety properties. Table 2 shows the average violations of the main properties for the models at the convergence of each train- ing seed, which confirms that policies trained with PPO_violation achieve lower violations, i.e., perform fewer collisions. The Appen- dix shows the same results for the T environments. Evaluation Results. Table 3 reports the average success, cost, and violation for the best model at the convergence of each training seed in the evaluation task of Figure 3. The evaluation in a previ- ously unseen scenario is used to test the generalization skills of the trained policies. In our experiments, the violation-based algorithm confirms superior navigation skills, achieving more success while Table 3: Performance of the best-trained models in the test- ing environment Evaluation_NT. Mean Success Mean Cost Mean Violation PPO PPO_cost PPO_violation LPPO 10.0 ± 0.4 6.4 ± 1.8 7.7 ± 0.2 2.5 ± 0.3 52.0 ± 4.8 25.5 ± 8.3 17.9 ± 1.2 18.2 ± 2.5 63.7 ± 11.3 29.2 ± 9.5 18.8 ± 1.7 19.5 ± 0.9 being safer than LPPO and the cost counterpart. Real-Robot Testing. The core motivation for introducing our Safe DRL environments is the lack of benchmarks that allow testing the policies directly on real robots. In contrast, Unity environments enable the transfer of policies trained in simulation on ROS-enabled platforms. We report a video with the real-world experiments of the policies trained in our environments here: shorturl.at/ijmFV, while Figure 5 shows our actual setup with the Turtlebot3. 4.4 Additional Experiments We performed several additional experiments in the Fixed_obs_NT task to highlight the impact of the different components presented violation as a penalty in a different domain known in the litera- ture.6 In more detail, we consider the same hyperparameters of our navigation experiments. Moreover, given the challenges of hand-writing properties for the drone, we rely only on the online generated property, considering a fixed ε-area of size 0.05 where we want to avoid a similar action that led to the unsafe state, up to decimal precision. The following results consider the average reward, cost, and violation collected over ten runs with different random seeds. Figure 7 shows the results Safe-DroneRun. These results confirm the behavior of previous experiments (we omitted the PPO results to maintain the plot scale for better visualization), where LPPO struggles to keep the cost threshold set to 20 and results in lower performance compared to the penalty-based approaches. In con- trast, the violation-based PPO maintains the best trade-off between reward and cost. 5 RELATED WORK Garcıa and Fernández [12] presents an exhaustive taxonomy of the main families of approaches for Safe DRL, analyzing the pros and cons of each category. For example, model-based DRL approaches have been investigated in constrained and unconstrained settings [16, 52]. However, having access to or approximating a model is not always possible. Similarly, using barrier functions effectively fosters safety but requires an accurate system model [44]. In contrast, we focus on model-free learning. In this context, shielding approaches typically synthesize a shield (i.e., an automa- ton) to enforce safety specifications. However, this is usually un- feasible in complex setups due to the exponential growth in the size of the automaton. Hence, most DRL shielding approaches rely on simple grid-world domains [5, 11]. Although providing safety guarantees, it is unclear how to scale shielding approaches in com- plex, realistic applications. In contrast, constrained DRL has been used as a natural way to address Safe DRL [2, 8, 41, 49, 53]. In detail, CPO [2] is characterized by strongly constrained satisfac- tion at the expense of possibly infeasible updates that requires demanding second-order recovery steps. Similarly, PCPO [49] uses second-order derivatives and has mixed improvements over CPO [53]. Moreover, Lyapunov-based algorithms [8] combine a projec- tion step with action-layer interventions to address safety. However, the cardinality of Lyapunov constraints equals the number of states, resulting in a significant implementation effort. Despite the variety of constrained literature, we compare with Lagrangian methods [41] as they reduce the complexity of prior approaches and show promising constraints satisfaction. However, constrained DRL has several drawbacks. For example, incorrect threshold tuning leads to algorithms being too permissive or, conversely, too restrictive [12]. Moreover, the guarantees of such approaches rely on strong assumptions that can not be satisfied in DRL, such as having an op- timal policy. Constrained DRL is thus not devoid of short-term fatal behaviors as it can fail at satisfying the constraints [27]. Moreover, constraints naturally limit exploration, causing getting stuck in local optima or failing to learn desired behaviors properly [13, 24]. Figure 5: Overview of real-world experiments. in this paper using: (i) different sizes for the pre-conditions, (ii) the online property.5 (iii) We show the results of our violation-based penalty method in standard safe locomotion benchmarks to further confirm the performance improvement of the proposed approach. Different Sizes for Pre-Conditions. Figure 6 shows the results of two PPO_violation versions: one that uses a constant εεε for the size of the pre-conditions, and one that has different εεε values for each input. The latter considers all the possible target positions as in previous experiments. As detailed in Section 4.2, using wider ranges for the inputs that shape environment configurations allows the violation to contain details about the unsafe behavior in general target initialization, resulting in higher performance. Crucially, the PPO_violation with a constant εεε also returns better performance over PPO_cost, confirming the importance of having locally-aware information in the penalty value. This is particularly important as it may not be possible to shape detailed pre-conditions in setups where accurate task-level knowledge is lacking. Online Property. As detailed in Section 3.1, we generate an additional property upon experiencing an unsafe state s because it is not uncommon to experience an unsafe transition not included in the pre-conditions (due to the limitation of hard-coding prop- erties). Figure 8 shows the size of the set P ′ during the training for PPO_violation under two implementations. The first adds an online-generated property, and the second uses only the hard-coded properties. Results for the latter show an average size of P ′ < 1, con- firming our hypothesis and the limitations of the properties' design of Section 3.2. In contrast, the generated property implementation ensures having at least one input-output mapping for each unsafe state. This allows the violation to correctly shapes information about undesired situations, which biases the policy toward safer regions. Moreover, the growth in the size of P ′ over the training indicates that the policy experiences unsafe states in rare corner cases captured by the intersection of multiple properties (i.e., some complex situations require not choosing more than one action to avoid collisions). Standard Safe DRL Tasks. We performed additional experi- ments in the standard Safe-DroneRun task to consider a different simulated robot, task, and safety specifications. Our goal is to con- firm further our framework's results and the benefits of using the 5A regularization term can module the importance of the penalty over the training. 6We refer to the original works for more details about the environments and the We perform additional experiments with it in the Appendix. shaped cost functions [2], github.com/SvenGronauer/Bullet-Safety-Gym Figure 6: Average performance of penalty-based PPO using different pre-condition shapes: (i) fixed size (i.e., with a constant εεε), (ii) and one that considers the whole domain for the target's coordinates (i.e., different values forεεε. For example, x11,12 ∈ [−1, 1]). Figure 7: Average reward, cost, and violation in Safe-DroneRun for PPO, PPO_{cost, violation}, LPPO. * indicates penalty-based algorithms. distinctive feature of our method is the use of the violation value, which can not be directly computed by using SV. 6 DISCUSSION We present an unconstrained DRL framework that leverages local violations of input-output conditions to foster safety. We discussed the limitations of using cost functions as in Safe DRL [12] present- ing: (i) a sample-based approach to approximate a violation metric and use it as a penalty in DRL algorithms. Such a violation intro- duces task-level safety specifications into the optimization, address- ing the cost's lack of information. (ii) The influence of generating properties to cope with the limitations of hard-coded conditions. (iii) We argued the importance of developing real-world environ- ments for broader applications of DRL in practical scenarios. To this end, we presented an initial suite of robotic navigation tasks that allow rapid testing on ROS-based robots. This work paves the way for several research directions, includ- ing extending our task suite to create a general safe DRL benchmark. Such extension is possible due to the rapid prototyping benefits of Unity [15]. Moreover, studying the effects of different time horizons would be interesting to separate the importance given to rewards and safety values. It would also be interesting to design a shield to avoid unsafe behaviors at deployment, leveraging the information from FV. Finally, our insights on the violation could be used to model desired behaviors in single and multi-agent applications to improve performance and sample efficiency. Figure 8: Mean size of P ′ over the training for PPO_violation with an online generated property (red), and with only the hard-coded properties (green). We note that our Equation 5 falls under the category of reward engineering, which has been proved effective by several works [1, 12, 19, 40]. For example, IPO [21] uses a penalty function based on constraints, giving a zero penalty when constraints are satisfied and a negative infinity upon violation. However, tuning both the barrier parameter and the constraint threshold has sub-optimal solutions over Lagrangian methods [27]. Finally, Statistical Verification (SV) has been recently employed on learning systems [50] to deal with the computational demands of FV. In these approaches, desired specifications are defined as Signal Temporal Logic [23], which closely resembles the properties used by FV literature. However, a 7 ACKNOWLEDGEMENTS This work was partially funded by the Army Research Office under award number W911NF20-1-0265. REFERENCES [1] David Abel, Will Dabney, Anna Harutyunyan, Mark K. Ho, Michael L. Littman, Doina Precup, and Satinder Singh. 2021. On the Expressivity of Markov Reward. In Conference on Neural Information Processing Systems (NeurIPS). [2] Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. 2017. Constrained Policy Optimization. In International Conference on Machine Learning (ICML). [3] Eitan Altman. 1999. Constrained Markov Decision Processes. In CRC Press. [4] Guy Amir, Davide Corsi, Raz Yerushalmi, Luca Marzari, David Harel, Alessandro Farinelli, and Guy Katz. 2022. Verifying Learning-Based Robotic Navigation Systems. arXiv (2022). [5] Steven Carr, Nils Jansen, Sebastian Junges, and Ufuk Topcu. 2022. Safe Reinforce- ment Learning via Shielding for POMDPs. In arXiv. [6] Hao-Tien Lewis Chiang, Aleksandra Faust, Marek Fiser, and Anthony Francis. 2019. Learning Navigation Behaviors End to End. RA-L (2019). [7] Yinlam Chow, Ofir Nachum, Edgar Duenez-Guzman, and Mohammad Ghavamzadeh. 2018. A Lyapunov-based Approach to Safe Reinforcement Learn- ing. In Conference on Neural Information Processing Systems (NeurIPS). [8] Yinlam Chow, Ofir Nachum, Aleksandra Faust, Mohammad Ghavamzadeh, and Edgar A. Duéñez-Guzmán. 2019. Lyapunov-based Safe Policy Optimization for Continuous Control. In International Conference on Machine Learning (ICML). [9] Cédric Colas, Olivier Sigaud, and Pierre-Yves Oudeyer. 2019. A Hitchhiker's Guide to Statistical Comparisons of Reinforcement Learning Algorithms. In International Conference on Learning Representations (ICLR) Worskhop on Reproducibility. [10] Davide Corsi, Enrico Marchesini, and Alessandro Farinelli. 2021. Formal Ver- ification of Neural Networks for Safety-Critical Tasks in Deep Reinforcement Learning. In Conference on Uncertainty in Artificial Intelligence (UAI). [11] Ingy Elsayed-Aly, Suda Bharadwaj, Christopher Amato, Rüdiger Ehlers, Ufuk Topcu, and Lu Feng. 2021. Safe Multi-Agent Reinforcement Learning via Shielding. In AAMAS. [12] Javier Garcıa and Fernando Fernández. 2015. A comprehensive survey on safe reinforcement learning. In Journal of Machine Learning Research (JMLR). [13] Zhang-Wei Hong, Tzu-Yun Shann, Shih-Yang Su, Yi-Hsiang Chang, and Chun- Yi Lee. 2018. Diversity-Driven Exploration Strategy for Deep Reinforcement Learning. In Conference on Neural Information Processing Systems (NeurIPS). [14] Andrew Ilyas, Logan Engstrom, Shibani Santurkar, Dimitris Tsipras, Firdaus Janoos, Larry Rudolph, and Aleksander Madry. 2020. A Closer Look at Deep Policy Gradients. In International Conference on Learning Representations (ICLR). [15] Arthur Juliani, Vincent-Pierre Berges, Esh Vckay, Yuan Gao, Hunter Henry, Marwan Mattar, and Danny Lange. 2018. Unity: A Platform for Intelligent Agents. In arXiv. [16] Parv Kapoor, Anand Balakrishnan, and Jyotirmoy V. Deshmukh. 2020. Model- based Reinforcement Learning from Signal Temporal Logic Specifications. In arXiv. [17] Guy Katz, Clark Barrett, David L Dill, Kyle Julian, and Mykel J Kochenderfer. 2017. Reluplex: An efficient SMT solver for verifying deep neural networks. In International conference on computer aided verification. Springer, 97–117. [18] Guy Katz, Derek A Huang, Duligur Ibeling, Kyle Julian, Christopher Lazarus, Rachel Lim, Parth Shah, Shantanu Thakoor, Haoze Wu, Aleksandar Zeljić, et al. 2019. The marabou framework for verification and analysis of deep neural networks. In International Conference on Computer Aided Verification. [19] Zachary C. Lipton, Jianfeng Gao, Lihong Li, Jianshu Chen, and Li Deng. 2016. Combating Reinforcement Learning's Sisyphean Curse with Intrinsic Fear. In arXiv. [20] Changliu Liu, Tomer Arnon, Christopher Lazarus, Christopher Strong, Clark Barrett, and Mykel J. Kochenderfer. 2021. Algorithms for Verifying Deep Neural Networks. Foundations and Trends® in Optimization (2021). [21] Yongshuai Liu, Jiaxin Ding, and Xin Liu. 2020. IPO: Interior-point Policy Opti- mization under Constraints. In AAAI Conference on Artificial Intelligence. [22] Yongshuai Liu, Avishai Halev, and Xin Liu. 2021. Policy Learning with Constraints in Model-free Reinforcement Learning: A Survey. In International Joint Conference on Artificial Intelligence (IJCAI). 4508–4515. [23] Oded Maler and D. Niković. 2004. Monitoring Temporal Properties of Continuous Signals. In FORMATS/FTRTFT. [24] Enrico Marchesini and Christopher Amato. 2022. Safety-Informed Mutations for Evolutionary Deep Reinforcement Learning. In Proceedings of the Genetic and Evolutionary Computation Conference Companion. 1966–1970. [25] Enrico Marchesini and Christopher Amato. 2023. Improving Deep Policy Gradi- ents with Value Function Search. In International Conference on Learning Repre- sentations (ICLR). [26] Enrico Marchesini, Davide Corsi, and Alessandro Farinelli. 2021. Benchmark- ing Safe Deep Reinforcement Learning in Aquatic Navigation. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). 5590–5595. https://doi.org/10.1109/IROS51168.2021.9635925 [27] E. Marchesini, D. Corsi, and A. Farinelli. 2022. Exploring Safer Behaviors for Deep Reinforcement Learning. In AAAI Conference on Artificial Intelligence Conference on Artificial Intelligence. [28] Enrico Marchesini and Alessandro Farinelli. 2020. Discrete deep reinforcement learning for mapless navigation. In 2020 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 10688–10694. [29] Enrico Marchesini and Alessandro Farinelli. 2021. Centralizing State-Values in Dueling Networks for Multi-Robot Reinforcement Learning Mapless Navigation. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). 4583–4588. https://doi.org/10.1109/IROS51168.2021.9636349 [30] Enrico Marchesini and Alessandro Farinelli. 2022. Enhancing Deep Reinforcement Learning Approaches for Multi-Robot Navigation via Single-Robot Evolutionary Policy Search. In International Conference on Robotics and Automation (ICRA). 5525–5531. https://doi.org/10.1109/ICRA46639.2022.9812341 [31] Luca Marzari, Davide Corsi, Ferdinando Cicalese, and Alessandro Farinelli. 2023. The #DNN-Verification problem: Counting Unsafe Inputs for Deep Neural Net- works. ArXiv abs/2301.07068 (2023). [32] Luca Marzari, Davide Corsi, Enrico Marchesini, and Alessandro Farinelli. 2022. Curriculum learning for safe mapless navigation. In Proceedings of the 37th ACM/SIGAPP Symposium on Applied Computing. 766–769. [33] Luca Marzari, Enrico Marchesini, and Alessandro Farinelli. 2023. Online Safety Property Collection and Refinement for Safe Deep Reinforcement Learning in Mapless Navigation. In International Conference on Robotics and Automation (ICRA). [34] Andrew Y. Ng, Daishi Harada, and Stuart Russell. 1999. Policy invariance under reward transformations: Theory and application to reward shaping. In ICML. [35] J. Nocedal and S. Wright. 2006. Numerical Optimization (2 ed.). Springer. [36] Ameya Pore, Davide Corsi, Enrico Marchesini, Diego Dall'Alba, Alicia Casals, Alessandro Farinelli, and Paolo Fiorini. 2021. Safe Reinforcement Learning using Formal Verification for Tissue Retraction in Autonomous Robotic-Assisted Surgery. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). 4025–4031. https://doi.org/10.1109/IROS51168.2021.9636175 [37] Alex Ray, Joshua Achiam, and Dario Amodei. 2019. Benchmarking Safe Explo- ration in Deep Reinforcement Learning. In arXiv. [38] Julien Roy, Roger Girgis, Joshua Romoff, Pierre-Luc Bacon, and Christopher Pal. 2022. Direct Behavior Specification via Constrained Reinforcement Learning. In AAAI Conference on Artificial Intelligence. [39] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal policy optimization algorithms. arXiv (2017). [40] David Silver, Satinder Singh, Doina Precup, and Richard S. Sutton. 2021. Reward is enough. Artificial Intelligence 299 (2021), 103535. [41] Adam Stooke, Joshua Achiam, and Pieter Abbeel. 2020. Responsive Safety in Reinforcement Learning by PID Lagrangian Methods. In International Conference on Machine Learning (ICML). [42] L. Tai, G. Paolo, and M. Liu. 2017. Virtual-to-real deep reinforcement learn- ing: Continuous control of mobile robots for mapless navigation. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). [43] Chen Tessler, Daniel J. Mankowitz, and Shie Mannor. 2019. Reward Constrained Policy Optimization. In International Conference on Learning Representations (ICLR). [44] Cumhur Erkan Tuncali, James Kapinski, Hisahiro Ito, and Jyotirmoy V. Deshmukh. 2018. Reasoning about Safety of Learning-Enabled Components in Autonomous Cyber-physical Systems. In Design Automation Conference (DAC). [45] Shiqi Wang, Kexin Pei, Justin Whitehouse, Junfeng Yang, and Suman Jana. 2018. Efficient Formal Safety Analysis of Neural Networks. In Conference on Neural Information Processing Systems (NeurIPS). [46] Shiqi Wang, Kexin Pei, Justin Whitehouse, Junfeng Yang, and Suman Jana. 2018. Formal security analysis of neural networks using symbolic intervals. In U SEN IX Security Symposium. [47] Ziyu Wang, Tom Schaul, Matteo Hessel, Hado Hasselt, Marc Lanctot, and Nando Freitas. 2016. Dueling network architectures for deep reinforcement learning. In International conference on machine learning (ICML). 1995–2003. [48] Kaidi Xu, Huan Zhang, Shiqi Wang, Yihan Wang, Suman Jana, Xue Lin, and Cho-Jui Hsieh. 2021. Fast and Complete: Enabling Complete Neural Network Ver- ification with Rapid and Massively Parallel Incomplete Verifiers. In International Conference on Learning Representations (ICLR). [49] Tsung-Yen Yang, Justinian Rosca, Karthik Narasimhan, and Peter J. Ramadge. 2020. Projection-Based Constrained Policy Optimization. In International Conference on Learning Representations (ICLR). [50] Mojtaba Zarei, Yu Wang, and Miroslav Pajic. 2020. Statistical Verification of Learning-Based Cyber-Physical Systems. In International Conference on Hybrid Systems: Computation and Control. [51] J. Zhang, J. T. Springenberg, J. Boedecker, and W. Burgard. 2017. Deep reinforce- ment learning with successor features for navigation across similar environments. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). [52] Xinglong Zhang, Yaoqian Peng, Biao Luo, Wei Pan, Xin Xu, and Haibin Xie. 2021. Model-Based Safe Reinforcement Learning with Time-Varying State and Control Constraints: An Application to Intelligent Vehicles. In arXiv. [53] Yiming Zhang, Quan Vuong, and Keith W. Ross. 2020. First Order Constrained Optimization in Policy Space. In Conference on Neural Information Processing Systems (NeurIPS).
http://arxiv.org/abs/2302.10025v1
2023-02-20T15:14:46
2023-02-20T15:14:46
DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises
While diffusion models have achieved great success in generating continuous signals such as images and audio, it remains elusive for diffusion models in learning discrete sequence data like natural languages. Although recent advances circumvent this challenge of discreteness by embedding discrete tokens as continuous surrogates, they still fall short of satisfactory generation quality. To understand this, we first dive deep into the denoised training protocol of diffusion-based sequence generative models and determine their three severe problems, i.e., 1) failing to learn, 2) lack of scalability, and 3) neglecting source conditions. We argue that these problems can be boiled down to the pitfall of the not completely eliminated discreteness in the embedding space, and the scale of noises is decisive herein. In this paper, we introduce DINOISER to facilitate diffusion models for sequence generation by manipulating noises. We propose to adaptively determine the range of sampled noise scales for counter-discreteness training; and encourage the proposed diffused sequence learner to leverage source conditions with amplified noise scales during inference. Experiments show that DINOISER enables consistent improvement over the baselines of previous diffusion-based sequence generative models on several conditional sequence modeling benchmarks thanks to both effective training and inference strategies. Analyses further verify that DINOISER can make better use of source conditions to govern its generative process.
[ "Jiasheng Ye", "Zaixiang Zheng", "Yu Bao", "Lihua Qian", "Mingxuan Wang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10025v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10025v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.AI", "cs.LG" ]
DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises Jiasheng Ye 1 2 Zaixiang Zheng 2 Yu Bao 2 Lihua Qian 2 Mingxuan Wang 2 Abstract While diffusion models have achieved great suc- cess in generating continuous signals such as im- ages and audio, it remains elusive for diffusion models in learning discrete sequence data like natural languages. Although recent advances cir- cumvent this challenge of discreteness by em- bedding discrete tokens as continuous surrogates, they still fall short of satisfactory generation qual- ity. To understand this, we first dive deep into the denoised training protocol of diffusion-based sequence generative models and determine their three severe problems, i.e., 1) failing to learn, 2) lack of scalability, and 3) neglecting source con- ditions. We argue that these problems can be boiled down to the pitfall of the not completely eliminated discreteness in the embedding space, and the scale of noises is decisive herein. In this paper, we introduce DINOISER to facilitate diffu- sion models for sequence generation by manipu- lating noises. We propose to adaptively determine the range of sampled noise scales for counter- discreteness training; and encourage the proposed diffused sequence learner to leverage source con- ditions with amplified noise scales during infer- ence. Experiments show that DINOISER enables consistent improvement over the baselines of pre- vious diffusion-based sequence generative models on several conditional sequence modeling bench- marks thanks to both effective training and in- ference strategies. Analyses further verify that DINOISER can make better use of source condi- tions to govern its generative process. 3 2 0 2 b e F 0 2 ] L C . s c [ 1 v 5 2 0 0 1 . 2 0 3 2 : v i X r a 1. Introduction Conditional sequence learning aims at generating a target se- quence from given conditions, which is one of the important paradigms of natural language generation (Sutskever et al., 1Department of Computer Science, Nanjing Univer- sity (work was done during Jiasheng's internship at ByteDance) 2ByteDance AI Lab. Jiasheng Ye <[email protected]>, Zaixiang Zheng <zhengzaixi- [email protected]>. Correspondence to: Preprint. Code: github.com/yegcjs/DINOISER 2014; Wiseman et al., 2017; Raffel et al., 2020), including machine translation (Bahdanau et al., 2014), summariza- tion (Rush et al., 2015), and paraphrasing (Prakash et al., 2016). Recent advances in generative modeling introduce diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020; Song et al., 2020b), which achieve great success in generating continuous signals, including images (Rombach et al., 2021), video (Ho et al., 2022), and audio (Kong et al., 2020). Diffusion models also garner growing interest for conditional sequence learning in the research community because of their promising characteristics, such as diversity and controllability, demonstrated in these domains. However, the discrete nature of sequence data, constituted by a number of tokens in order, makes it non-trivial to apply diffusion models for conditional sequence learning. Typical diffusion models noise data with Gaussian permutation ker- nels (Ho et al., 2020) and learn to recover original data from their corrupted versions, which is not directly compatible with discrete tokens. To remedy this, DiffusionLM (Li et al., 2022) attempted to embed discrete tokens into continuous space and employ diffusion models to the embedding space. Although this kind of approach unlocks the possibility of ap- plying diffusion models to discrete data, it still falls short of competitive performance for various conditional sequence generation tasks (Fig. 1A). We argue that embedding discrete tokens into continuous surrogates does not necessarily eliminate discreteness com- pletely. To verify this, we conduct in-depth preliminary stud- ies and highlight our findings along with their implications as follows. (1) On the pitfall of discreteness. Embeddings populate only finite clusters (up to the vocabulary size) in the continuous space, which results in the vastness of low- density regions especially when the models are learned with small-scale noises. We refer to this as the pitfall of discrete- ness, which suggests that small noises hinder conditional sequence learning, and thus should be avoided during train- ing. (2) On scalability. It becomes increasingly harder for the diffusion process to eliminate discreteness when the dimension of the embedding space gets scaled up, suggest- ing that to ensure scalability, an adaptable noise schedule is necessitated yet neglected. (3) On conditional learning. Enlarging noises in inference can calibrate diffusion models to take into account more source conditional information. Please refer to §3 for more details. DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises Motivated by these findings, we propose DINOISER to im- prove diffusion models by manipulating noises for con- ditional sequence learning. We propose a novel way of counter-discreteness training to eliminate the chances of training on small noise scales to avoid their negative in- fluences, for which we introduce the noise scale clipping strategy to adaptively manipulate the noise scales. For infer- ence, we manipulate the model to be exposed to larger noise scales to encourage trained diffusion models to leverage source conditions. We summarize our contributions and findings as follows: • By thorough and in-depth preliminary studies, we shed the light on the pitfall of discreteness along with the critical role of noise scales in conditional sequence learning with diffusion models, thereby suggesting me- liorated counter-discreteness solutions in terms of both training and inference by manipulating noises. • We accordingly propose DINOISER to leverage large noise scales in both training and inference. Experi- ments show that DINOISER achieves strong perfor- mance on a variety of conditional sequence learning tasks, including several machine translation bench- marks (both bilingual and multilingual, including the most commonly-used WMT14 EN→DE), as well as text simplification and paraphrasing, ranging from low- resource to high-resource scenarios. • Ablations show that both DINOISER's improved train- ing and inference approaches result in considerable per- formance gains. Further analysis verifies that our pro- posed post-hoc inference strategy, i.e., the condition- enhanced denoiser, can help make better use of source conditions for accurate predictions. Conditional 2. Background Conditional Sequence Learning. se- quence learning aims to yield target sequence y = [y1, y2, . . . , yn] ∈ {0, 1}n×|V| within the vocabulary space V, given source conditions x, which can be another se- quence x = [x1, x2, . . . , xm]. The conventional model- ing paradigm (Sutskever et al., 2014; Vaswani et al., 2017) generates target tokens in an autoregressive decomposition p(y|x) = (cid:81)n i=1 p(yi|y<i, x). Gu et al. (2018) proposed an alternative way in a fully non-autoregressive (NAR) manner, where all the tokens are predicted in parallel by assum- ing conditional independence between the target tokens, i.e., p(y|x) = (cid:81)n i=1 p(yi|x). Later works alleviate this strong assumption by iterative refinement (Lee et al., 2018; Ghazvininejad et al., 2019; Gu et al., 2019), resulting in improved generation quality. These iterative refinement ap- proaches generate target sequences with several cycles, in each of which the models generate sequence depending on both the source sequence and the intermediate prediction of the previous one, i.e., p(y|x) = (cid:81)T t=1 p(y(t)|y(t−1), x). Diffusion Probabilistic Models. Given a random variable z0 from an underlying data distribution q(z0), diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020) de- fine a forward diffusion process {zt}t∈[0,1] perturbed with a Gaussian perturbation kernel, starting with z0 and converg- ing to its corresponding stationary distribution, such that for any t ∈ [0, 1], the distribution of zt given z0 satisfies q(zt|z0) = N (zt; α(t)z0, σ2(t)I), where σ(t) is a monotonically increasing function, usu- ally referred to as the noise schedule, satisfying σ(0) = 0 and σ(1) ≈ 1; and α(t) = (cid:112)1 − σ2(t). The noise schedule σ(t) controls the degree of corruption at differ- ent timestep t. As t gets larger, the noise scale σ(t) gets larger whereas α(t) gets smaller, hence the more corrupted data zt from the original z0. At t = 1, with α(1) ≈ 0 and σ(1) ≈ 1, zt become pure noises as reaching the stationary distribution of a standard Gaussian. Song et al. (2020b) proves that such a Gaussian diffusion process has the same transition distribution q(zt|z0) as the following stochastic differential equation (SDE): dz = − 1 2 β(t)zdt + (cid:112)β(t)dω, (1) where β(t) = −2 d log α(t) ; ω denotes the standard Wiener process (a.k.a., Brownian motion), and dω can be viewed as infinitesimal white noise. dt As such, the corresponding generative process, as shown in Song et al. (2020b), can be achieved as the time reversal of the stochastic process in Eqn. 1 by solving the following ordinary differential equation (diffusion ODE):  dz = − 1 2 β(t)z − 1 2   dt. (2) β(t) ∇z log qt(z) (cid:125) (cid:123)(cid:122) score function (cid:124) Here, the score function is usually parameterized as the function of z0 as follows: ∇z log qt(z) (cid:12) (cid:12) (cid:12) (cid:12)z=zt ∗= − (cid:15)t σ(t) ∗∗= − zt − α(t)z0 σ2(t) , (3) where ∗∗= holds as (cid:15)t is the sampled noise in Gaussian repa- rameterization of zt (Kingma & Welling, 2013; Ho et al., 2020), i.e., zt = α(t)z0 + σ(t)(cid:15)t, (cid:15)t ∼ N (0, I), (4) and ∗= holds because of Tweedie's Law (Efron, 2011) (cid:15)t = −σ(t)∇zt log qt(zt). With this reparameterization, Eqn. 2 can be rewritten into (cid:20) dz = − 1 2 β(t)z + β(t) 2σ2(t) (cid:21) (z − α(t)z0) dt. (5) DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises In practice, we can then use a learned model zθ(zt, t) to estimate z0 and plug into Eqn. 5. The model parameters θ are learned by minimizing the discrepancy between training data and model estimation (Ho et al., 2020; Song et al., 2020b; Ramesh et al., 2022): Ldiffusion(z0) = E t∼U (0,1),(cid:15)t∼N (0,I) (cid:104) (cid:107)zθ(zt, t) − z0(cid:107)2 2 (cid:105) . (6) Given Eqn. 5 with a trained model zθ(zt, t), we can use arbitrary ODE solvers to solve this diffusion ODE from t = 1 to t = 0 for sampling data. An effective and efficient solver to this end is the DDIM solver (Song et al., 2020a; Lu et al., 2022) and is widely adopted. It discretizes the ODE into M + 1 timesteps {ti}M i=0 decreasing from t0 = 1 to tM ≈ 0. Then, it samples zt0 from the standard Gaussian distribution and computes {zti}M i=1 with M iterations, in each of which zti is predicted from zti−1 according to zti = α(ti)zθ(zti−1 , ti−1) + σ(ti)(cid:15)θ(zti−1, ti−1), (7) where (cid:15)θ(zti−1, ti−1) is the predicted noise, which can be directly induced according to Eqn. 4, (cid:15)θ(zti−1, ti−1) = zti−1 − α(ti−1)zθ(zti−1 , ti−1) σ(ti−1) . (8) After iterations, the last prediction ztM is taken as the final generated result ˆz0 of the sampling. Diffusion Models for Conditional Sequence Learning. The denoising process of diffusion models matches an it- erative refinement process (Gong et al., 2022). However, diffusion models are not directly applicable to sequence learning tasks since the original diffusion models operate in continuous space rather than sequences of discrete tokens. Li et al. (2022) tackles this by embedding the discrete to- kens into continuous latent space and applying diffusion models therein. We can then train the models as variational autoencoders (Kingma & Welling, 2013), where a diffu- sion model serves as the prior, from a latent-variable model perspective, and derive the corresponding variational lower bound (Wehenkel & Louppe, 2021; Vahdat et al., 2021): L(y) = E z0∼qφ(EMB(y)) (cid:104) − log pθ(y|z0) (cid:123)(cid:122) (cid:125) (cid:124) Lreconstruction +Ldiffusion(z0) (cid:105) , (9) where y is the original sequence with z0 as its embeddings1: z0 = EMB(y) = [EMB(y1), EMB(y2), ..., EMB(yn)] (10) Ldiffusion denotes the diffusion loss (Eqn. 6) which now oper- ates on the embedding space, and Lreconstruction is the newly added reconstruction term. 1DiffusionLM (Li et al., 2022) adds tiny noise to the embed- dings to form z0 (i.e. z0 ∼ N (EMB(y), σ0I)). We empirically find this unnecessary and letting z0 follow a Dirac distribution makes training more efficient. To further adapt the model for conditional sequence genera- tion, a vanilla approach is to replace the unconditional model zθ(zt, t) with a conditional model zθ(zt, x, t), where x is the source condition. Similar to the previous practice of using diffusion models for conditional generation in vi- sion (Rombach et al., 2021), the diffusion process can be kept unchanged, the same as Eqn. 4. And the length of the target sequences is decided by predicting the length difference between the source and the target. 3. Pitfall of Discreteness: Noise Scale Matters In this section, we dive deep into the current weaknesses of diffusion models for conditional sequence learning and find that the noise scale matters, which accordingly motivates our proposal for improved training and inference. Settings. We begin with the vanilla conditional diffusion model modified from DiffusionLM (Li et al., 2022) as de- scribed in §2. We follow the original paper of DiffusionLM to apply the sqrt schedule (i.e., σ(t) = t0.25) to arrange noise scales for training and sampling. We use IWSLT14 DE→EN (Cettolo et al., 2012) machine translation bench- mark for evaluation. We also include CMLM (Ghazvinine- jad et al., 2019) as a baseline for comparison, which is a strong conditional sequence generative model that generates sequence by iterative refinement similar to diffusion models but in discrete tokens space. Observations. We summarize our findings as follows: O1. DiffusionLM still falls short of conditional sequence learning. Fig. 1(A) shows the validation performance of the two models at different training steps, in which the performance of DiffusionLM still lags behind CMLM by a large margin, even taking many more steps before convergence. This shows that the performance and training efficiency of the vanilla diffusion-based sequence learner remain unsatisfactory. O2. Diffusion losses at small noise scales are unexpect- edly small. DiffusionLM uniformly samples timesteps hence the corresponding noise scales during training. As shown in Fig. 1(B), we find that the magnitudes of diffusion losses approach almost zero for small noise scales, indicating that it is quite trivial to recover the corrupted embeddings under such circumstances. We conjecture that, combined with the illustrated example in Fig. 1(D), this is because there remain highly dis- crete modes for the embedding density such that any corrupted embedding is very likely to lie in a region with a small radius around the original token embed- ding. As a consequence, the more the modes of embed- dings separate from each other the smaller the diffusion loss, which adheres to the following observation. O3. It becomes increasingly harder for the diffusion pro- cess to eliminate discreteness while the dimension of DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises Figure 1. Prelimilary study. (A) The validation BLEU of different models on IWSLT14 DE→EN at different training steps. (B) Diffusion loss of DiffusionLM on the validation set of IWSLT14 DE→EN at different noise scales and the distribution of noise scale sampled during training. The loss reaches almost 0 when σ < 0.5 but significantly rockets when σ continuously gets larger beyond 0.5. Besides, the model can achieve extremely small loss for small noise scales, despite being less likely sampled during the training, even at the early stage of training (i.e., 45k steps), suggesting that recovering data corrupted by small noise is frustratingly easy. (C) The accuracy of predicting z0 from zt by finding the nearest neighbor for zt with different noise scales, vocabulary sizes, and dimensions. On the legend, |V| means the vocabulary size and D means the embedding dimension. For each embedding dimension, we randomly sample |V| points from the standard Gaussian distribution as the embeddings. Then, for each noise scale, we randomly sample 50, 000 zt-s. Each zt is corrupted from a z0 uniformly picked among the N embeddings. (D) An illustrative example of the distributions of zt of three data points corrupted with different noise scales as in Eqn. 4, where for small noise scales, a large proportion of the embedding space between modes (associated with tokens) remains vacant. (E) The tendency of whether the model prediction is more influenced by the source or target side information when fed with indicators of different noise scales. In addition to the source condition x, we feed the model with t = zt(y(cid:48), t) that is corrupted with a timestep-dependent noise σ(t) from a negative y(cid:48), which is different from the original (positive z(cid:48) sample of) target sequence y. We compare the similarity between the model prediction zθ(z(cid:48) t, x, τ ) to the embedding of ground-truth z0(y), and study to what degree the model prediction is governed by the source condition x (via the embedding of the ground-truth z0(y) as the proxy), or the target information y(cid:48) (via z(cid:48) t) otherwise. the embedding space scales up. Fig. 1(C) shows a surprisingly high accuracy of recovering corrupted em- beddings that can be easily achieved by simply seeking the nearest neighbor when embedding dimensions en- large, even at considerably large noise scales. This reveals that scaling embedding space leads to more severe discreteness, namely a curse of dimensionality. O4. On condition learning: larger noise scales calibrate diffusion models in taking into account more source conditional information during inference. We have seen that recovering embeddings corrupted with small noise scales is easy (O2), and if modes distribute sep- arately, even finding the nearest neighbor is enough (O3). In Fig. 1(C), as the noise scale decreases, the prediction accuracy by finding the nearest neighbor increases and achieves almost 100% under a threshold, which can be learned trivially even with little to no source conditions. This results in the hallucination as shown in Tab. 1, which is an unexpected consequence for conditional sequence generative models to yield output loyal to the input condition. To mitigate this, Table 1. Illustration of hallucinations of vanilla DiffusionLM on IWSLT14 DE→EN translation task, along with DINOISER's pre- dictions, where the vanilla DiffusionLM generates inexplicable expressions that are irrelevant to the source condition whose mean- ing dramatically differs from the groud-truth target. Source Reference Mit welchen worten w ̈urden sie ban beschreiben? What are the words you would use to describe ban? DiffusionLM In which words would you save ban? DINOISER In which words would you describe ban? we quantitatively study the influence of noise scales on conditional reliance. As shown in Fig 1(E), we find that as the noise scales are larger, the model can predict more faithfully to source conditions. Concluding remarks. We summarize conclusions from the aforementioned observations along with suggestions for more plausible diffused conditional sequence learning: C1. We should not train on too small noise scales to cir- cumvent the pitfall of discreteness. Both O2 and O4 show the negative influences of small noise scales on training that it leads to a not smooth embedding space DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises with vast regions of low density between modes asso- ciated with tokens (O2). These regions can inevitably be sampled during inference as the result of maximum likelihood estimation2, thereby giving rise to error ac- cumulation. Besides, it also impedes conditional learn- ing (O4). To remedy this for the counter-discreteness purpose, a probably simple way is to eliminate the chance of training with small noise scales. C2. We need to determine the noise schedule according to the dimensionality of the embedding space. Fitting more complex datasets usually requires larger embed- ding dimensions. O3 indicates the criterion to dis- tinguish large and small noise scales depends on the embeddings hence the complexity of the datasets. How- ever, existing methods employ a fixed noise schedule for all embedding dimensions, which lacks scalability. This, therefore, demands a task-specific noise schedule to accommodate diverse datasets. C3. We could manipulate the model to be exposed to larger noise scales so as to potentially better lever- age source conditions. O4 suggests that the more corrupted the embeddings, the more difficult for the model to recover, thereby necessitating more reliance on source conditions. As a result, we could probably encourage trained diffusion models to care more about source conditions for free by post-hoc manipulating the noise to large ones. 4. DINOISER Provided the observations and postulates we discussed in §3, we accordingly propose DINOISER, a simple yet effective method that improves diffusion models by manipulating noises for conditional sequence learning. In a nutshell, we propose to eliminate the chance of training diffused se- quence learners with small-scale noises so as to circumvent the aforementioned pitfall of discreteness in embedding space. As for sampling, we propose a new effective sampler to amplify the impact of source conditions on the model prediction, where indicators of large noise scales are always fed into the model. We now dive deep into the details of the proposed DINOISER. Figure 2. (A) Illustration of the proposed noise scale clipping, where we showcase the Gaussian distributions zt/α(t) = N (EMB(yi), ̃σ2(t)I), of three corrupted embeddings perturbed with σ(t) at timestep t for a token yi and its two (spatially) nearest neighbors yj and yk in the embedding space, respectively. To remedy the pitfall of discreteness, we propose to ensure a suffi- ciently large minimum "overlap" between corrupted embeddings. As shown in this example, such a goal of counter-discreteness is achieved by bounding the standard deviation ̃σ(t) of EMB(yi) by δij the "distance" to its nearest neighbor (i.e., yj). (B) Comparison between sqrt noise schedule and our noise schedule σ(t) = t manipulated with the proposed noise scale clipping. The adaptive clipping threshold σmin at several training steps is presented as it varies during training. The clipping threshold σmin starts with a large number at around 0.7 and stays steady later maintaining at around 0.5. The sqrt noise schedule, on the other hand, increases rapidly at small timesteps, exceeding our clipping threshold at the start of training (i.e., σ(t ≈ 0.2)) and later stage of training steps (i.e., σ(t ≈ 0.1)), respectively. continuous space, and also undermine conditional learning. A simple yet effective way to mitigate this is to encourage training diffusion models with sufficiently large noise scales. As such, we propose noise scale clipping, where we bound the minimum noise scale σmin for training such that only timesteps satisfying σ(t) ≥ σmin could be sampled, which is decided adaptively as the model learn progresses. To start with, we can eliminate the scaling effect of α(t) in the forward diffusion process for the embedding of each token yi by rewriting Eqn. 10 into3: 4.1. Noise Scale Clipping: Counter-Discreteness Training with Manipulated Noises Recall that C1 and C2 in §3 demonstrate that small noises can barely help "discrete" embeddings populate the entire zt α(t) = z0 + ⇒ (cid:15)t ⇒ zt α(t) (cid:18) σ(t) α(t) zt α(t) ∼ N EMB(yi), ̃σ2(t)I (cid:18) ∼ N z0, σ2(t) 1 − σ2(t) (cid:19) (cid:19) I (11) 2Consider that a token α is translated into token A or a with 50% each. Without extra information, the optimal prediction for translating α is the center of the embedding of A and a. This is because minimizing its training objective (i.e., 1 2 + 2) results in zθ = zA(0)+za(0) 2 (cid:107)zθ − za(0)(cid:107)2 1 . The prediction exactly falls in the blank area that lies between embeddings. 2 (cid:107)zθ − zA(0)(cid:107)2 2 As illustrated in Fig. 2(A), there, intuitively, should exist a sufficiently large number δ measuring the minimum "over- lap" between the distributions of two corrupted embeddings under the Gaussian perturbation kernel with a standard de- 3Here we let zt and z0 denote zt(yi) and z0(yi) for brevity. DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises viation of ̃σ(t) = σ(t)√ 1−σ2(t) . To this end, we let δ2 be the minimum amount of variation of added noise, defined as the average squared L2-distances between the embeddings and their nearest neighbor, normalized by the dimension of embeddings (according to C2 in §3): δ2 = 1 |V| * D = 1 |V| * D |V| (cid:88) i=1 |V| (cid:88) i=1 min 1≤j(cid:54)=i≤|V| δ2 ij min 1≤j(cid:54)=i≤|V| (cid:107)EMB(yi) − EMB(yj)(cid:107)2 2. (12) We now define the noise scale clipping as follows: Definition 4.1 (The noise scale clipping). Let V be the target vocabulary with corresponding embeddings in D- dimensional space ∀yi ∈ V : EMB(yi) ∈ RD, the noise scale ciipping is performed if the noise scale σ(t) at timestep t satisfies the following condition: ̃σ2(t) = σ2(t) 1 − σ2(t) ≥ δ2 ⇒ σ2 min 1 − σ2 min = δ2, (13) the clipping threshold σmin is whereby derived when the equality in Eqn. 13 holds, such that (cid:32) σmin = (cid:80)|V| i=1 min 1≤j(cid:54)=i≤|V| |V| * D (cid:107)EMB(yi) − EMB(yj)(cid:107)2 2 (cid:33)− 1 2 , + 1 (14) obtained by substituting Eqn. 12 into the R.H.S of Eqn. 13. As illustrated in Fig. 2(B), the clipping threshold σmin is estimated dynamically during training, depending on how properly the model learns the embeddings up to the min- imum pair-wise distances within the vocabulary. In each training step, we first estimate the clipping threshold σmin with Eqn. 14, then sample timesteps among t that satisfies σ(t) > σmin. In practice, one can first estimate the noise scale threshold σmin and then turn it into the timestep thresh- old tmin = σ−1(σmin) in general. In this work, we select σ(t) = t as the noise scheduler to simplify this procedure4. As a result, the updated diffusion loss with an enlarged minimum timestep threshold (thus an increased minimum noise scale) in the final training objective (modified from Eqn. 9) now becomes: L(cid:48) diffusion(y) = E t∼U (tmin,1),(cid:15)t∼N (0,I) (cid:104) (cid:107)zθ(zt, x, t) − z0(cid:107)2 2 (cid:105) . We provide pseudocodes regarding how to manipulate noises in training as such in Alg. 1. 4This can be done since the effects of different noise schedules are theoretically interchangeable up to different weight factors under the simplified training objective (Ho et al., 2020) we adopted (see Appendix A). We also provide empirical comparisons between different schedules in Tab. 4. This allows us to more conveniently manipulate noise scales. Algorithm 1 Training with noise scale clipping Input Training dataset D = {(x, y)}. Output Optimized parameters θ. 1: repeat 2: 3: 4: 5: Sample x, y from the dataset D and embed y into z0 t ∼ U(σ−1(σmin), 1), where σmin is from Eqn. 14 Sample zt with Gaussian reparameterization (Eqn. 4) Take gradient descent step on (cid:2)− log pθ(y|z0) + (cid:107)zθ(zt, x, t) − z0(cid:107)2 (cid:3) 2 ∇θ 6: until converged Figure 3. A synthesis experiment similar to Fig. 1(E), where the model is asked to predict with current timestep τ = t and an alter- native larger timestep τ = 0.995, respectively. We compare the MSE between the model prediction zθ(z(cid:48) t, x, τ ) to the embedding of ground-truth z0(y) (top) and negative sample z0(y(cid:48)) (bottom) respectively, and study to which target the model prediction assim- ilates, the original y or the negative one y(cid:48), hence should most likely be governed by the source or the target information. 4.2. CEDI: Sampling with Manipulated Noises for Enhanced Condition Awareness Based on C3 in §3, we suppose the model relies more on the source conditions when indicated by large noise scales. This implies that we may make the model more faithful to source conditions by feeding indicators of large noise scales to the model. Fig. 3 shows a synthesis experiment similar to Fig. 1(E), wherein the predictions using a large timestep 0.995 (namely, a larger noise scale) are closer to the embedding of the original target y, while more distant to that of the misleading y(cid:48), reiterating that the model relies more on the source condition x when exposed to large noise indicator due to manipulation in inference. Inspired by the aforementioned observations, we propose a condition-enhanced denoiser (CEDI) for sampling. CEDI always feeds a large t to the model zθ to encourage the model to make use of the source condition. In practice, we largely follow the framework of DDIM solver (Song et al., 2020a) but pick two sets of timesteps. In the first set {ti}M i=0, timesteps decrease uniformly from t0 = 1 to tM ≈ 0 as normal. As for the other set {τi}M i=0, τis decrease DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises Algorithm 2 Sampling with CEDI for enhanced condition awareness Input Source condition x; number of steps M ; model pa- rameters θ. Output Predicted target ˆy. 1: Uniformly discretize [T, 1] into M + 1 steps {ti}M i=0 in descend order (T ≈ 0) 2: Uniformly discretize [T , 1] into M + 1 steps {τi}M i=0 in descend order (T (cid:29) 0) 3: Sample ˆzt0 ∼ N (0, I) 4: for i = 1 to M do 5: ˆz0 ← zθ( ˆzti−1, x, τi−1) ˆzti−1 −α(τi−1) ˆz0 ˆ(cid:15) ← σ(τi−1) ˆzti ← α(ti) ˆz0 + σ(ti)ˆ(cid:15) 6: 7: 8: end for 9: Map ˆztM to ˆy with the embeddings uniformly from τ0 = 1 to a large time τM (cid:29) 05. When making predictions, we assign timesteps from the second set to the model. By replacing corresponding timesteps in the framework of DDIM (Eqn. 7 and Eqn. 8) with τis, we generate our predictions by iteratively computing ˆzti = α(ti)zθ( ˆzti−1 , x, τi−1) + σ(ti)(cid:15)θ( ˆzti−1, x, τi−1), where the predicted noise is also updated as (cid:15)θ( ˆzti−1, x, τi−1) = ˆzti−1 − α(τi−1)zθ( ˆzti−1 , x, τi−1) σ(τi−1) . We also demonstrate how CEDI works in Alg. 2. 5. Experiment We conduct experiments to verify the effectiveness of our proposed method and study its characteristics. 5.1. Experimental Setup Tasks and Datasets. We mainly experiment on ma- chine translation, a well-established benchmark task for conditional sequence learning. We consider IWSLT14 DE↔EN (160K pairs), WMT14 EN↔DE (4.0M pairs), and WMT14 EN↔RO (610K pairs), six machine transla- tion tasks with variant sizes of training data. Additionally, we experiment on two of the datasets introduced by Dif- fuSeq (Gong et al., 2022), including Wiki (Jiang et al., 2020) for text simplification and QQP6 for paraphrasing. 5Empirically, we find that τM satisfying σ(τM ) = 0.99 (i.e., τM = 0.99 for σ(t) = t and τM = 0.9606 for Li et al. (2022)'s sqrt schedule σ(t) = t0.25) generally works well. 6https://www.kaggle.com/c/ quora-question-pairs Baselines. We include three groups of baselines for machine translation: (1) The autoregressive Transformer (Vaswani et al., 2017); (2) The CMLM (Ghazvininejad et al., 2019), an iterative-based non-autoregressive model for conditional sequence learning. (3) Previous diffusion-based sequence generative models, including the vanilla design that simply extends the original DiffusionLM (Li et al., 2022) with an additinal condition encoder, and the other recently proposed improved methods CDCD (continuous diffusion for cate- gorical data, Dieleman et al., 2022), DiffuSeq (Gong et al., 2022), SeqDiffuSeq (Yuan et al., 2022) and Difformer (Gao et al., 2022). For text simplification and paraphrasing, we compare our method with DiffuSeq (Gong et al., 2022). Metrics. We primarily report SacreBLEU7 (Post, 2018) for machine translation, following CDCD (Dieleman et al., 2022). We also report tokenized BLEU (Pap- ineni et al., 2002) in Appendix B for reference. For text simplification and paraphrasing, we follow DiffuSeq to employ sentence-level BLEU under the tokenizer of BERT-BASE-UNCASED as the evaluation metric. Implementation Details. All implementations are based on Transforme-base (Vaswani et al., 2017) for all datasets except IWSLT14. For IWSLT14, we use a smaller architec- ture that has 4 attention heads and 1024-dimensional feed- forward layers. The embedding dimension for the diffusion model is 16 on IWSLT14 and 64 on the others. In the im- plementation of our method, we follow recent advances and apply self-conditioning techniques (Dieleman et al., 2022; Chen et al., 2022; Strudel et al., 2022). Besides, following previous practice in non-autoregressive machine translation, we train our model both with and without knowledge distil- lation (KD, Kim & Rush, 2016; Zhou et al., 2020). During inference, for machine translation, we apply beam search in the autoregressive Transformer with beam size 5. Correspondingly, we use length beam 5 in the non- autoregressive models, except for CDCD and DiffuSeq since they vary the target lengths by predicting paddings instead of length predictions. For text simplification and paraphras- ing, we report results with various length beams as length prediction on these tasks is more challenging and less stud- ied. For all the diffusion-based methods, we follow pre- vious work (Li et al., 2022; Gong et al., 2022; Dieleman et al., 2022) and apply Minimum Bayes-Risk (MBR) decod- ing (Kumar & Byrne, 2004). For both DiffusionLM and our model, we perform sampling with 20 steps. We implement DiffusionLM and DINOISER upon fairseq (Ott et al., 2019), and also train Transformer and CMLM baselines using fairseq. For data preprocess- 7The signature is nrefs:1|case:mixed|eff:no| tok:intl|smooth:exp|version:2.3.1 if the target language is German, and nrefs:1|case:mixed|eff:no| tok:13a|smooth:exp|version:2.3.1 for others. DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises Table 2. Comparison in SacreBLEU on machine translation tasks. "LB": the size of the length beam search. "MBR": the number of candidates for each length beam to apply Minimum Bayes-Risk decoding. "KD": results are obtained with knowledge distillation (KD, Kim & Rush, 2016; Zhou et al., 2020). Provided that KD is common and effective practice in non-autoregressive (NAR) machine translation, though not the focus of this study, we also provide further experiments with KD in Appendix B for reference. The best NAR results without KD are in bold and the second best ones are underlined. The results of CDCD are quoted from Dieleman et al. (2022), and the results of Difformer, DiffuSeq, and SeqDiffuSeq are from Gao et al. (2022). †: how CMLM originally selects candidates with different lengths differs from the MBR decoding we used for diffusion models, and we thus include its results with MBR decoding for fair comparisons. ‡: results are presented in tokenized BLEU as reported in Gao et al. (2022), and we encourage readers to check the original papers for more details. Methods Transformer (Vaswani et al., 2017) (AR, beam = 5) CMLM (Ghazvininejad et al., 2019) (NAR, LB = 5) CMLM (Ghazvininejad et al., 2019) (NAR, LB = 5, MBR=1†) DiffusionLM (Li et al., 2022) (LB = 5, MBR = 1) DiffusionLM (Li et al., 2022) (LB = 5, MBR = 10) CDCD (Dieleman et al., 2022) (MBR = 10) CDCD (Dieleman et al., 2022) (MBR = 100) Difformer (Gao et al., 2022) DiffuSeq‡ (Gong et al., 2022) (KD, LB×MBR = 10) SeqDiffuSeq‡ (Yuan et al., 2022) (KD, LB×MBR = 10) (LB×MBR = 20) DINOISER (LB = 5, MBR = 1) DINOISER (LB = 5, MBR = 10) DINOISER (LB = 10, MBR = 5) DINOISER (KD, LB = 10, MBR = 5) IWSLT14 WMT14 WMT16 DE→EN EN→DE DE→EN EN→DE RO→EN EN→RO 33.61 29.41 29.32 26.61 29.11 - - - - - 31.29 31.61 31.44 - 28.30 24.33 24.34 20.29 22.91 - - - - - 25.55 25.70 26.14 - 30.55 28.71 28.43 17.31 19.69 25.40 26.00 - - - 28.83 29.05 29.01 30.30 26.85 23.22 23.09 15.33 17.41 19.70 20.00 23.80 15.37 17.14 24.25 24.26 24.62 25.88 33.08 31.13 31.07 28.61 30.17 - - - - - 31.14 31.22 31.24 33.13 32.86 31.26 30.92 27.01 29.39 - - - 25.45 26.17 30.93 31.08 31.03 32.84 ing, we follow the instruction in fairseq for IWSLT148 and use the preprocessed data by Gu & Kong (2021) for WMT14 and WMT169. For Wiki and QQP, we use pre- processed data provided by DiffuSeq10 and tokenized them with byte-pair encoding (BPE, Sennrich et al., 2016). The training batch size is 128K for WMT14/WMT16, and 32K for the others. We empirically find checkpoint averaging unnecessary for our method and have not applied it in all our implementations. 5.2. Main Results The results of machine translation and the other two tasks are in Tab. 2 and Tab. 3, respectively. Overall performance. Our DINOISER demonstrates effec- tiveness on all selected conditional sequence learning tasks, which we summarize into the following three aspects: • DINOISER achieves state-of-the-art results among diffusion-based models on one of the representa- tive conditional sequence generation tasks, i.e., ma- chine translation, where DINOISER outperforms the vanilla design of DiffusionLM, as well as the previous 8https://github.com/facebookresearch/ fairseq/tree/main/examples/translation 9https://github.com/shawnkx/Fully-NAT 10https://github.com/Shark-NLP/DiffuSeq strongest approaches such as CDCD (Dieleman et al., 2022) and Difformer (Gao et al., 2022) by a large mar- gin (Tab. 2). For DiffuSeq and SeqDiffuSeq, although their reported tokenized BLEUs are not strictly compa- rable to our SacreBLEU results due to the difference in tokenizers, our performance is far above them by over 4 BLEU score and even more if we involve knowledge distillation, which supports our superiority over them. • DINOISER demonstrates strong competitiveness in conditional sequence learning. It even surpasses CMLM (Ghazvininejad et al., 2019) on almost all the experimented machine translation datasets (Tab. 2). Provided that CMLM is one of the leading approaches among NAR sequence learners, the performance DI- NOISER achieves can be considered quite competitive. • DINOISER is generic to various conditional sequence learning tasks. Results on Tab. 3 shows that DINOISER also works well in tasks other than machine translation, surpassing previously proposed DiffuSeq. In addition to the overall performance, DINOISER also demonstrates several nice properties over the baselines. We elaborate on them as follows: Scalability. As shown in Tab. 2, DiffusionLM seems more challenging to accommodate larger datasets like WMT14 than smaller ones (e.g., IWSLT14). This verifies the curse of scalability problem discussed in §3. In contrast, DINOISER DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises Table 3. Sentence-level BLEU of our method and DiffuSeq on Wiki (text simplification) and QQP (paraphrasing). "NFE": num- ber of function evaluations, measuring the total number of forward passes to the model for each prediction. The results of DiffuSeq are quoted from Gong et al. (2022). Steps LB MBR NFE Wiki QQP Methods DiffuSeq 2000 DINOISER DINOISER DINOISER 20 20 20 - 10 20 20 10 20000 36.22 24.13 1 1 5 200 35.36 26.07 400 36.94 25.42 2000 36.88 25.57 surpasses CMLM on almost all large- and small-scale sce- narios, which indicates that DINOISER indeed greatly im- proves the scalability of diffusion-based sequence learners. This advantage of DINOISER could help facilitate further re- search and open up the possibilities of large-scale real-world applications of diffused sequence generative models. Sampling efficiency. Given the sizes of length beam search (LB) and MBR decoding shown in Tab. 2, DINOISER sur- passes or closely approaches CMLM even when MBR=1, while the vanilla DiffusionLM heavily relies on a large number of candidates used for MBR decoding. Besides, DINOISER necessitates much fewer NFEs to achieve strong performance, e.g., only 20 steps, resulting in only 1% to 10% computational consumption and latency compared to previous works (Gong et al., 2022; Li et al., 2022; Diele- man et al., 2022). This manifests that DINOISER is more accurate yet efficient compared to previous diffusion-based sequence learning models. 5.3. Effect of Sizes of Length Beam and MBR DINOISER can leverage both length beam search and MBR decoding to produce diverse candidates for selection. The results on all of the evaluated datasets (Tab. 2 and Tab. 3) demonstrate that the method can gain its performance by properly adjusting the two hyperparameters for sampling. In particular, we search on various combinations of length beams and MBRs and evaluate the corresponding perfor- mance of DINOISER on the validation set of WMT14 EN→DE, shown in Fig. 4. The model performance rises first and then drops down as the length beam increases. And for each length beam, we can further boost the performance of DINOISER with MBR > 1, suggesting that the effects of the two factors are complementary. Using both length beam search and MBR decoding also brings benefits to DINOISER over those only involving one of them. Compared to CMLM which decodes determin- istically, DINOISER is able to sample multiple sentences for each length beam, providing more diverse candidates. Compared to CDCD, which predicts paddings to generate sentences of various lengths and whose sampling efficiency is restricted by maximum target length, DINOISER's use Figure 4. SacreBLEU on the validation set of WMT14 EN→DE with different length beams and MBR sizes. of length beams allows more fine-grained control of the computational budget. 5.4. Effect of Noise Scale Clipping for Training We compare models trained with different settings in Tab. 4 to study the effect of our training strategy. We find that the proposed noise scale clipping consistently helps improve the model performance. Replacing the noise schedule in DINOISER (i.e., σ(t) = t) with the sqrt schedule pro- posed by Li et al. (2022) has negligible influence on the final performance. This is expected since we only set the noise schedule as σ(t) = t for convenience. The differ- ence is that the improvement by noise clipping is relatively smaller when using the sqrt schedule. This is because the noise scale of the sqrt schedule increases quickly in small timesteps (Fig. 2B). When t = 0.2, σsqrt(t) ≈ 0.67, which is close to our initial clipping threshold. This suggests the previous success of the sqrt schedule may also be partly explained as training more on large-scale noises. 5.5. Effect of Condition Enhancement for Sampling We compare the performance between different denoisers, i.e., DDIM and the proposed CEDI, in Tab. 4. In a nut- shell, CEDI impressively outperforms DDIM, especially for small MBR candidate sizes. We also notice that DDIM per- forms particularly unsatisfactorily when the model is trained without noise scale clipping. However, for these models, CEDI can still produce a relatively good performance (over 20.50 for MBR=1) that even surpasses well-designed CDCD (20.00 for MBR=100). What's more, we highlight two criti- cal characteristics of CEDI as follows: CEDI indeed better leverage source conditions for infer- ence. Recall that we propose the CEDI with the purpose of encouraging the model to make better use of source con- ditions for prediction (§4.2). To investigate whether the denoiser achieves this, we apply Layer-wise Relevant Propa- gation (LRP, Bach et al., 2015; Voita et al., 2021) to measure the relative contribution of the source condition to the model prediction. As shown in Fig. 5(B), we compare the source contribution of our CEDI and the DDIM solver along the sampling iterations. CEDI maintains a high source contribu- DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises Table 4. Ablation Study on WMT14 EN→DE. All the results are in SacreBLEU scores and the length beam sizes are 5. Training Settings DDIM (MBR = 1) CEDI (MBR = 1) DDIM (MBR = 10) CEDI (MBR = 10) Ours [final] w/o self-conditioning w/o noise scale clipping w/o self-conditioning, w/o noise scale clipping w/ sqrt noise schedule w/ sqrt noise schedule, w/o noise scale clipping 19.23 20.37 7.95 11.30 20.11 16.68 24.25 23.03 21.16 20.86 24.13 23.22 22.12 22.58 11.51 14.84 22.83 20.46 24.26 23.14 21.40 21.47 24.07 23.40 Table 5. Results of multilingual machine translation ({DE,RO,PT- BR,NL}↔EN). "BILINGUAL": integrated results of separate mod- els of every language pair. "MULTILING.": results from a unified multilingual model. We employ langdetect (Shuyo, 2010) to infer the language of generated sequences for computing the language accuracy. Settings Methods SacreBLEU (Lang Acc %) BILINGUAL MULTILING. many-to-one {DE,RO,PT-BR,NL} →EN one-to-many EN→ {DE,RO,PT-BR,NL} CMLM DINOISER (DDIM, MBR=1) DINOISER (DDIM, MBR=10) DINOISER (MBR=1) DINOISER (MBR=10) CMLM DINOISER (DDIM, MBR=1) DINOISER (DDIM, MBR=10) DINOISER (MBR=1) DINOISER (MBR=10) 33.85 32.40 33.73 34.57 34.74 28.10 27.44 28.54 28.72 28.81 35.23 33.43 35.48 35.26 35.66 30.55 (72.40) 17.95 (67.58) 18.57 (67.50) 30.52 (72.81) 30.67 (72.88) four language pairs of IWSLT14 translation benchmark, i.e., EN↔DE, EN↔RO, EN↔NL, and EN↔PT-BR. In the one-to-many translation, we append language tokens to the source sequences to incorporate the target language as a condition. We also include a baseline in which the models are trained separately for each language pair for comparison. As shown in Tab. 5, DINOISER works well in multilingual settings, showing its strong capability in modeling condi- tions, i.e. a complex multimodal condition (source sentences of four languages in many-to-one), and multiple condi- tions (source sentence of English as well as identity of target languages). Particularly, CEDI shows huge advantages over DDIM in the multilingual setting of one-to-many trans- lation. In this case, the language accuracy of DDIM is much lower than that of CEDI, suggesting DDIM has trouble cap- turing the given condition, namely the language identity in this one-to-many scenario. In contrast, DINOISER augmented with CEDI yields satisfactory predictions with high language accuracy, exhibiting superiority in working with multiple conditions. 6. Related Work 6.1. Non-autoregressive Sequence Generative Models Non-autoregressive sequence learning (NAR) was first pro- posed by Gu et al. (2018) as an alternative to its autoregres- sive counterpart. It generates target tokens in parallel, either fully NAR (Gu et al., 2018) or up to a mild number of itera- Figure 5. The difference between our CEDI and the DDIM solver over steps. (A) The prediction accuracy at each step, measured with SacreBLEU. (B) The proportion of source contribution to the prediction at each step. tion, while the source contribution of CEDI is unsatisfactory in the first few steps, which demonstrates that sampling with our CEDI does leverage the source condition more. Correspondingly, as shown in Fig. 5(A), the prediction ac- curacy of CEDI increases steadily, while the performance of DDIM fails to improve at the beginning of the iterations, suggesting correlations between higher source contribution and higher performance improvement. Among all iterations, the first few steps establish the foundation for the overall performance. Although DDIM improves its performance in later iterations, it still falls behind our CEDI. This sug- gests the effectiveness of increasing the source contribution, especially at the beginning of the sampling process. CEDI can handle sequence generation from complex and multiple conditions. To further show the strength of CEDI in capturing source conditions, we explore more complex conditional sequence learning scenarios. We sim- ulate this under two multilingual translation settings, i.e. many-to-one and one-to-many translation. In the many-to-one scenario, a unified model needs to trans- late source sentences in multiple different source languages to English counterparts, requiring the model to handle complicated source conditions. On the other hand, the one-to-many setting simulates a multi-conditional sce- nario, requiring the model to recognize the target language as another crucial condition to capture the target distribu- tion. To this end, we construct a dataset by combining DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises tions (Ghazvininejad et al., 2019), liberating sequence mod- eling from the constraint of a predefined order (Qian et al., 2022). With recent efforts, NAR shows great potential in the applications of various domains, including language (Qian et al., 2021; Qi et al., 2021; Huang et al., 2022c; Qian et al., 2022), speech (Kim et al., 2021), proteins (Zheng et al., 2023a), and molecules (Hoogeboom et al., 2022). Different from more commonly-used autoregressive (AR) models (Sutskever et al., 2014), NAR models assume condi- tional independence among the output tokens. Such an as- sumption risks ignoring the target dependencies (Ren et al., 2020; Huang et al., 2022b) and leads to the multi-modality problem (Gu et al., 2018). As a result, the vanilla fully NAR model has inferior generation quality. Some of the later improvements alleviate the strong assumption by refor- mulating NAR formulation under iterative refinement (Lee et al., 2018; Gu et al., 2019; Ghazvininejad et al., 2019; 2020; Huang et al., 2022a;d; Zheng et al., 2023b), which iteratively takes as input the previously generated sequence, which serves as an intermediate random variable, to produce the tokens of its refined or denoised version in parallel until convergence or the budget of maximum iterations run out. Some recent advances herein follow the idea of discrete dif- fusion (Sohl-Dickstein et al., 2015; Austin et al., 2021) and formalize iterative refinement as Markov processes (Savinov et al., 2021; He et al., 2022; Reid et al., 2022). Although both are named after diffusion models, these works operate on discrete state space, whereas our focus, continuous dif- fusion models accommodate the continuous (embedding) space of discrete tokens. 6.2. Diffusion Models for Sequence Learning Continuous diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020; Song et al., 2020b) gained first success in generating high-quality images. Recently, Li et al. (2022) successfully adapted them to sequence learning and pro- posed the DiffusionLM, the first diffusion-based sequence generative model with a special focus on controllable text generation. Later improvements to the diffusion-based se- quence generative models are mainly categorized threefold. The first line includes novel components for diffusion mod- eling, such as the partial diffusion process proposed by Gong et al. (2022), self-conditioning techniques introduced by Strudel et al. (2022), and the adaptive noise schedule of Yuan et al. (2022). The second line applies diffusion models to the latent space of specific pretrained language models (Lovelace et al., 2022). And the third tries to in- corporate conventional practice in discrete token prediction. For instance, Dieleman et al. (2022); Gao et al. (2022) and Han et al. (2022) incorporate the cross-entropy objectives in training. For the application of diffusion-based models for sequence learning, previous work found their advantages in controllable generation (Yu et al., 2022; Liu et al., 2022; Li et al., 2022), and generating diverse sequences (Gong et al., 2022). Lin et al. (2022) demonstrates that diffusion-based sequence generative models can benefit from large-scale self-supervised pretraining. While almost all these works mainly focus on the training phrase of diffusion-based se- quence generative models, our study emphasizes both train- ing and inference. 7. Conclusion In this paper, we shed light on the crucial role of noise scales in conditional sequence learning with diffusion models and determine that small noise scales impede diffusion models in both learning and inference. Motivated by our findings, we propose DINOISER to leverage large noise scales in both training and inference. DINOISER makes training samples cover the whole sample space more efficiently and also enables the model to better utilize source conditions for prediction, thereby leading to considerable performance improvements. In this work, we demonstrate the potential diffusion models for conditional sequence learning. We expect our study could help facilitate further research on diffusion models to empower various applications of condi- tional sequence learning. References Austin, J., Johnson, D. D., Ho, J., Tarlow, D., and van den Berg, R. Structured denoising diffusion models in discrete state-spaces. Advances in Neural Information Processing Systems, 34:17981–17993, 2021. Bach, S., Binder, A., Montavon, G., Klauschen, F., M ̈uller, K.-R., and Samek, W. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PloS one, 10(7):e0130140, 2015. Bahdanau, D., Cho, K., and Bengio, Y. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. Cettolo, M., Girardi, C., and Federico, M. Wit3: Web inventory of transcribed and translated talks. In Confer- ence of european association for machine translation, pp. 261–268, 2012. Chen, T., Zhang, R., and Hinton, G. Analog bits: Gen- erating discrete data using diffusion models with self- conditioning. arXiv preprint arXiv:2208.04202, 2022. Dieleman, S., Sartran, L., Roshannai, A., Savinov, N., Ganin, Y., Richemond, P. H., Doucet, A., Strudel, R., Dyer, C., Durkan, C., et al. Continuous diffusion for categorical data. arXiv preprint arXiv:2211.15089, 2022. Efron, B. Tweedie's formula and selection bias. Journal DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises of the American Statistical Association, 106(496):1602– 1614, 2011. Gao, Z., Guo, J., Tan, X., Zhu, Y., Zhang, F., Bian, J., and Xu, L. Difformer: Empowering diffusion model on embedding space for text generation. arXiv preprint arXiv:2212.09412, 2022. Ghazvininejad, M., Levy, O., Liu, Y., and Zettlemoyer, L. Mask-predict: Parallel decoding of conditional masked language models. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 6112–6121, 2019. Ghazvininejad, M., Levy, O., and Zettlemoyer, L. Semi- autoregressive training improves mask-predict decoding. arXiv preprint arXiv:2001.08785, 2020. Gong, S., Li, M., Feng, J., Wu, Z., and Kong, L. Diffuseq: Sequence to sequence text generation with diffusion mod- els. arXiv preprint arXiv:2210.08933, 2022. Gu, J. and Kong, X. Fully non-autoregressive neural ma- chine translation: Tricks of the trade. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pp. 120–133, 2021. Gu, J., Bradbury, J., Xiong, C., Li, V. O., and Socher, R. Non-autoregressive neural machine translation. In Inter- national Conference on Learning Representations, 2018. Gu, J., Wang, C., and Zhao, J. Levenshtein transformer. Advances in Neural Information Processing Systems, 32, 2019. Ho, J., Chan, W., Saharia, C., Whang, J., Gao, R., Gritsenko, A., Kingma, D. P., Poole, B., Norouzi, M., Fleet, D. J., et al. Imagen video: High definition video generation with diffusion models. arXiv preprint arXiv:2210.02303, 2022. Hoogeboom, E., Satorras, V. G., Vignac, C., and Welling, M. Equivariant diffusion for molecule generation in 3d. In International Conference on Machine Learning, pp. 8867–8887. PMLR, 2022. Huang, C., Zhou, H., Za ̈ıane, O. R., Mou, L., and Li, L. Non- autoregressive translation with layer-wise prediction and deep supervision. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 10776–10784, 2022a. Huang, F., Tao, T., Zhou, H., Li, L., and Huang, M. On the learning of non-autoregressive transformers. In Interna- tional Conference on Machine Learning, pp. 9356–9376. PMLR, 2022b. Huang, F., Zhou, H., Liu, Y., Li, H., and Huang, M. Directed acyclic transformer for non-autoregressive machine trans- lation. In International Conference on Machine Learning, pp. 9410–9428. PMLR, 2022c. Huang, X. S., Perez, F., and Volkovs, M. Improving non- autoregressive translation models without distillation. In International Conference on Learning Representations, 2022d. Jiang, C., Maddela, M., Lan, W., Zhong, Y., and Xu, W. Neural crf model for sentence alignment in text simpli- fication. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7943– 7960, 2020. Han, X., Kumar, S., and Tsvetkov, Y. Ssd-lm: Semi- autoregressive simplex-based diffusion language model for text generation and modular control. arXiv preprint arXiv:2210.17432, 2022. Kim, J., Kong, J., and Son, J. Conditional variational au- toencoder with adversarial learning for end-to-end text-to- speech. In International Conference on Machine Learn- ing, pp. 5530–5540. PMLR, 2021. He, Z., Sun, T., Wang, K., Huang, X., and Qiu, X. Diffu- sionbert: Improving generative masked language models with diffusion models. arXiv preprint arXiv:2211.15029, 2022. Kim, Y. and Rush, A. M. Sequence-level knowledge dis- tillation. In Proceedings of the 2016 Conference on Em- pirical Methods in Natural Language Processing, pp. 1317–1327, 2016. Ho, J., Jain, A., and Abbeel, P. Denoising diffusion In Larochelle, H., Ranzato, probabilistic models. M., Hadsell, R., Balcan, M., and Lin, H. (eds.), Advances in Neural Information Processing Systems, pp. 6840–6851. Curran Associates, volume 33, URL https://proceedings. 2020. Inc., neurips.cc/paper/2020/file/ 4c5bcfec8584af0d967f1ab10179ca4b-Paper. pdf. Kingma, D. P. and Welling, M. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. Kong, Z., Ping, W., Huang, J., Zhao, K., and Catanzaro, B. Diffwave: A versatile diffusion model for audio synthesis. In International Conference on Learning Representations, 2020. Kumar, S. and Byrne, W. Minimum bayes-risk decoding for statistical machine translation. Technical report, JOHNS DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises HOPKINS UNIV BALTIMORE MD CENTER FOR LANGUAGE AND SPEECH PROCESSING (CLSP), 2004. Lee, J., Mansimov, E., and Cho, K. Deterministic non- autoregressive neural sequence modeling by iterative re- In Proceedings of the 2018 Conference on finement. Empirical Methods in Natural Language Processing, pp. 1173–1182, 2018. Li, X. L., Thickstun, J., Gulrajani, I., Liang, P., and Hashimoto, T. Diffusion-lm improves controllable text generation. ArXiv, abs/2205.14217, 2022. Lin, Z., Gong, Y., Shen, Y., Wu, T., Fan, Z., Lin, C., Chen, W., and Duan, N. Genie: Large scale pre-training for text generation with diffusion model. arXiv preprint arXiv:2212.11685, 2022. Liu, G., Feng, Z., Gao, Y., Yang, Z., Liang, X., Bao, J., He, X., Cui, S., Li, Z., and Hu, Z. Composable text controls in latent space with odes. arXiv preprint arXiv:2208.00638, 2022. Lovelace, J., Kishore, V., Wan, C., Shekhtman, E., and Weinberger, K. Latent diffusion for language generation. arXiv preprint arXiv:2212.09462, 2022. Lu, C., Zhou, Y., Bao, F., Chen, J., Li, C., and Zhu, J. Dpm-solver: A fast ode solver for diffusion probabilis- tic model sampling in around 10 steps. arXiv preprint arXiv:2206.00927, 2022. Ott, M., Edunov, S., Baevski, A., Fan, A., Gross, S., Ng, N., Grangier, D., and Auli, M. fairseq: A fast, ex- tensible toolkit for sequence modeling. arXiv preprint arXiv:1904.01038, 2019. Papineni, K., Roukos, S., Ward, T., and Zhu, W.-J. Bleu: a method for automatic evaluation of machine transla- tion. In Proceedings of the 40th annual meeting of the Association for Computational Linguistics, pp. 311–318, 2002. Post, M. A call for clarity in reporting bleu scores. In Pro- ceedings of the Third Conference on Machine Translation: Research Papers, pp. 186–191, 2018. Prakash, A., Hasan, S. A., Lee, K., Datla, V. V., Qadir, A., Liu, J., and Farri, O. Neural paraphrase gener- ation with stacked residual LSTM networks. CoRR, abs/1610.03098, 2016. URL http://arxiv.org/ abs/1610.03098. Qi, W., Gong, Y., Jiao, J., Yan, Y., Chen, W., Liu, D., Tang, K., Li, H., Chen, J., Zhang, R., Zhou, M., and Duan, N. Bang: Bridging autoregressive and non- autoregressive generation with large scale pretraining. In Meila, M. and Zhang, T. (eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 8630–8639. PMLR, 18–24 Jul 2021. URL https:// proceedings.mlr.press/v139/qi21a.html. Qian, L., Zhou, Y., Zheng, Z., Zhu, Y., Lin, Z., Feng, J., Cheng, S., Li, L., Wang, M., and Zhou, H. The volctrans glat system: Non-autoregressive translation meets wmt21. WMT 2021, pp. 187, 2021. Qian, L., Wang, M., Liu, Y., and Zhou, H. Diff-glat: Dif- fusion glancing transformer for parallel sequence to se- quence learning. arXiv preprint arXiv:2212.10240, 2022. Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., Liu, P. J., et al. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1–67, 2020. Ramesh, A., Dhariwal, P., Nichol, A., Chu, C., and Chen, M. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022. Reid, M., Hellendoorn, V. J., and Neubig, G. Diffuser: Diffusion via edit-based reconstruction. In International Conference on Learning Representations, 2022. Ren, Y., Liu, J., Tan, X., Zhao, Z., Zhao, S., and Liu, T.- Y. A study of non-autoregressive model for sequence generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 149– 159, 2020. Rombach, R., Blattmann, A., Lorenz, D., Esser, P., and Ommer, B. High-resolution image synthesis with latent diffusion models, 2021. Rush, A. M., Chopra, S., and Weston, J. A neural atten- tion model for abstractive sentence summarization. In Proceedings of the 2015 Conference on Empirical Meth- ods in Natural Language Processing, pp. 379–389, Lis- bon, Portugal, September 2015. Association for Compu- tational Linguistics. doi: 10.18653/v1/D15-1044. URL https://aclanthology.org/D15-1044. Savinov, N., Chung, J., Binkowski, M., Elsen, E., and van den Oord, A. Step-unrolled denoising autoencoders for text generation. In International Conference on Learn- ing Representations, 2021. Sennrich, R., Haddow, B., and Birch, A. Neural machine translation of rare words with subword units. In Proceed- ings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1715–1725, 2016. DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises Yu, P., Xie, S., Ma, X., Jia, B., Pang, B., Gao, R., Zhu, Y., Zhu, S.-C., and Wu, Y. Latent diffusion energy-based model for interpretable text modeling. In International Conference on Machine Learning (ICML 2022)., 2022. Yuan, H., Yuan, Z., Tan, C., Huang, F., and Huang, S. Seqdif- fuseq: Text diffusion with encoder-decoder transformers. arXiv preprint arXiv:2212.10325, 2022. Zheng, Z., Deng, Y., Xue, D., Zhou, Y., YE, F., and Gu, Q. Structure-informed language models are protein design- ers. arXiv preprint arXiv:2302.01649, 2023a. Zheng, Z., Zhou, Y., and Zhou, H. Deep equilibrium non- autoregressive sequence learning. 2023b. Zhou, C., Neubig, G., and Gu, J. Understanding knowledge distillation in non-autoregressive machine translation. In International Conference on Learning Representations, 2020. Shuyo, N. 2010. language-detection/. Language detection library for java, URL http://code.google.com/p/ Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. Deep unsupervised learning using nonequi- librium thermodynamics. In Bach, F. and Blei, D. (eds.), Proceedings of the 32nd International Conference on Ma- chine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 2256–2265, Lille, France, 07– 09 Jul 2015. PMLR. URL https://proceedings. mlr.press/v37/sohl-dickstein15.html. Song, J., Meng, C., and Ermon, S. Denoising diffusion implicit models. In International Conference on Learning Representations, 2020a. Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Er- mon, S., and Poole, B. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2020b. Strudel, R., Tallec, C., Altch ́e, F., Du, Y., Ganin, Y., Men- sch, A., Grathwohl, W., Savinov, N., Dieleman, S., Sifre, L., et al. Self-conditioned embedding diffusion for text generation. arXiv preprint arXiv:2211.04236, 2022. Sutskever, I., Vinyals, O., and Le, Q. V. Sequence to se- quence learning with neural networks. Advances in neural information processing systems, 27, 2014. Vahdat, A., Kreis, K., and Kautz, J. Score-based generative modeling in latent space. Advances in Neural Information Processing Systems, 34:11287–11302, 2021. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., and Polosukhin, I. At- tention is all you need. Advances in neural information processing systems, 30, 2017. Voita, E., Sennrich, R., and Titov, I. Analyzing the source and target contributions to predictions in neural machine translation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1126–1140, 2021. Wehenkel, A. and Louppe, G. Diffusion priors in variational autoencoders. In ICML Workshop on Invertible Neural Networks, Normalizing Flows, and Explicit Likelihood Models, 2021. Wiseman, S., Shieber, S. M., and Rush, A. M. Challenges in data-to-document generation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2253–2263, 2017. DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises A. Relationship Between Different Noise Schedules and Time Samplers Generally, the training objective of diffusion models can be expressed as Et∼r(t),(cid:15)∼N (0,I)[w(t)(cid:107)zθ − z(0)(cid:107)2 2], where zθ is the model prediction zθ((cid:112)1 − σ2(t)z(0) + σ(t)(cid:15), t) for short. The above expectation over timesteps can be rewritten into the expectation of noise scales as follows. Et∼r(t),(cid:15)[w(t)(cid:107)zθ − z(0)(cid:107)2 2] (cid:90) 1 =E(cid:15)[ 0 (cid:90) 1 r(t)w(t)(cid:107)zθ − z(0)(cid:107)2 2dt] =E(cid:15)[ ˆr(σ) ˆw(σ)(cid:107)zθ − z(0)(cid:107)2 2] dt dσ =Eσ∼ U (0,1),(cid:15)[w(cid:48)(σ)(cid:107)zθ − z(0)(cid:107)2 2], 0 dσ where w(cid:48)(σ) = w(σ−1)r(σ−1) dt interchangeable by applying different weighting functions. dσ . Therefore, training with different noise schedules and different time samplers is B. More Results on Machine Translation In order to provide references for further study and comparisons, we report more results on machine translation. Knowledge distillation (KD). A common practice to improve the performance of non-autoregressive machine translation is knowledge distillation (Kim & Rush, 2016; Zhou et al., 2020). We report the performance of our method trained on distilled data of WMT14 and WMT16 on Tab. 6. The result shows that the performance gap between our method and the autoregressive transformer is small when knowledge distillation is used. This suggests that our method is able to achieve performance that satisfies the need of applications. Table 6. Model performances on machine translation with knowledge distillation. The results of transformer are from raw data, while DINOISER is trained on distilled data. The performances are measured with SacreBLEU. Methods DE→EN EN→DE RO→EN EN→RO WMT14 WMT16 Transformer DINOISER (LB=5, MBR=1) DINOISER (LB=5, MBR=10) DINOISER (LB=10, MBR=5) 30.55 30.13 30.12 30.30 26.85 25.70 25.90 25.88 33.08 32.96 33.04 33.13 32.86 32.58 32.57 32.84 Evaluation with tokenized BLEU. Some of the previous studies in machine translation reported tokenized BLEU, despite inconsistent tokenizers (other than the standard Moses tokenizer) they might use. To help conveniently compare DINOISER to them, we also report the performance of DINOISER with tokenized BLEU in Tab. 7. Table 7. Tokenized BLEU of our method on machine translation datasets. We use the moses tokenizer12 for all the texts. "LB": the size of length beam. "MBR": the number of candidates for each length beam to apply Minimum Bayes-Risk decoding. +KD means the results are obtained with knowledge distillation. Methods DE→EN EN→DE DE→EN EN→DE RO→EN EN→RO IWSLT14 WMT14 WMT16 DINOISER (LB=5, MBR=1) DINOISER (LB=5, MBR=10) DINOISER (LB=10, MBR=5) DINOISER + KD (LB=5, MBR=1) DINOISER + KD (LB=5, MBR=10) DINOISER + KD (LB=10, MBR=5) 32.23 32.48 32.25 - - - 25.54 25.68 25.99 - - - 29.35 29.53 29.40 30.64 30.62 30.76 24.43 24.45 24.48 26.08 26.29 26.04 31.21 31.39 31.50 33.21 33.29 33.40 31.18 31.29 31.27 32.57 32.59 32.89
http://arxiv.org/abs/2302.10021v2
2023-05-25T19:53:08
2023-02-20T15:07:24
Medical Face Masks and Emotion Recognition from the Body: Insights from a Deep Learning Perspective
The COVID-19 pandemic has undoubtedly changed the standards and affected all aspects of our lives, especially social communication. It has forced people to extensively wear medical face masks, in order to prevent transmission. This face occlusion can strongly irritate emotional reading from the face and urges us to incorporate the whole body as an emotional cue. In this paper, we conduct insightful studies about the effect of face occlusion on emotion recognition performance, and showcase the superiority of full body input over the plain masked face. We utilize a deep learning model based on the Temporal Segment Network framework, and aspire to fully overcome the face mask consequences. Although facial and bodily features can be learned from a single input, this may lead to irrelevant information confusion. By processing those features separately and fusing their prediction scores, we are more effectively taking advantage of both modalities. This framework also naturally supports temporal modeling, by mingling information among neighboring frames. In combination, these techniques form an effective system capable of tackling emotion recognition difficulties, caused by safety protocols applied in crucial areas.
[ "Nikolaos Kegkeroglou", "Panagiotis P. Filntisis", "Petros Maragos" ]
10.1145/3594806.3594829
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1145/3594806.3594829", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.10021v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10021v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.LG", "I.4; I.5" ]
3 2 0 2 y a M 5 2 ] V C . s c [ 2 v 1 2 0 0 1 . 2 0 3 2 : v i X r a Medical Face Masks and Emotion Recognition from the Body: Insights from a Deep Learning Perspective Nikolaos Kegkeroglou National Technical University of Athens, School of ECE 15773 Athens, Greece [email protected] Panagiotis P. Filntisis Athena Research Center Institute of Robotics 15125 Maroussi, Greece [email protected] Petros Maragos National Technical University of Athens, School of ECE 15773 Athens, Greece Athena Research Center Institute of Robotics 15125 Maroussi, Greece [email protected] ABSTRACT The COVID-19 pandemic has undoubtedly changed the standards and affected all aspects of our lives, especially social communica- tion. It has forced people to extensively wear medical face masks, in order to prevent transmission. This face occlusion can strongly irritate emotional reading from the face and urges us to incorporate the whole body as an emotional cue. In this paper, we conduct insightful studies about the effect of face occlusion on emotion recognition performance, and showcase the superiority of full body input over the plain masked face. We utilize a deep learning model based on the Temporal Segment Network framework, and aspire to fully overcome the face mask consequences. Although facial and bodily features can be learned from a single input, this may lead to irrelevant information confusion. By processing those fea- tures separately and fusing their prediction scores, we are more effectively taking advantage of both modalities. This framework also naturally supports temporal modeling, by mingling informa- tion among neighboring frames. In combination, these techniques form an effective system capable of tackling emotion recognition difficulties, caused by safety protocols applied in crucial areas. 1 INTRODUCTION The possible applications of an interface capable of assessing hu- man emotional states are numerous. Humans generally treat com- puter agents as they might treat other people [32]. Robots and systems that are able to recognize, interpret and process human affect [5], are arguably well suited to this, making the interaction more effective and pleasant. They find fertile ground in the area of computer-assisted education, as learning is the quintessential emo- tional experience. A learning episode might begin with curiosity and fascination. But as its difficulty increases, one may experience confusion, frustration or anxiety, and thus, may abandon learn- ing [29]. A tutoring agent, who is able to estimate the learner's affective state, can respond appropriately and give encouraging suggestions. Existing work has shown that robot tutors enhance learning, by personalizing their motivational strategies to the stu- dent's emotional behavior [13] [20]. Another crucial area is health care, as mental health disorders, like depression and psychosis, are on the rise across the world. Emotion recognition systems can be an effective strategy for preventing and monitoring such disorders [38]. While works based on facial expressions abound in the area, recognizing affect from the body remains a less explored topic. A study in neurobiology has shown that body movement and posture contain useful features for recognizing human affect [8]. In other experiments, it was shown that facial and bodily expressions work complementary for visual perception of emotion, and in some cases humans perceive bodily expressed emotional information as more diagnostic than facial [2]. Furthermore, the visibility of facial cues is not guaranteed. Bodily expression recognition becomes crucial when facial features are occluded. Medical face masks, which are extensively used nowadays due to the COVID-19 pandemic [6], are the epitome of face occlusion. Because bodies are more expressive than faces in those situations, social information can be detected from the body instead. Although there has been a considerable amount of research on automatic emotion recognition in adults, the topic regarding children has been understudied. Children go through a critical de- velopment process and applications involving them require special attention [31]. They also tend to fidget and move around more than adults, leading to more self-occlusions and non-frontal head poses [4]. This becomes even more challenging, considering the current health and safety protocols that demand the use of face masks. Robots can no longer rely only on facial expressions to recognize emotion, but also have to take into account body expressions that can stay visible and detectable, even when the face is unobservable. Children's behavior and natural characteristics differ from adults, so perception systems need to be specifically trained, to be able to tackle Child-Robot Interaction (CRI) problems. The rest of the paper is organized as follows: Section 2 discusses related work on emotion recognition mainly from the body. Sec- tion 3 describes the adopted deep learning-based visual emotion recognition model in detail, as well as the tools and methods used for the experiments. Section 4 presents the experimental results, and lastly Section 5 provides our conclusions. 2 RELATED WORK In recent years, deep learning methods have been very popular due to the massive amounts of digital data in combination with pow- erful processing hardware. Deep extracted features have yielded excellent results and on most cases outperformed non-deep state-of- the-art methods for the emotion recognition task. When processing a video with emotional expressions, an essential component is cap- turing temporal information to complement the prediction from still images. Two-stream Convolutional Neural Network (CNN) ar- chitectures use multi-frame optical flow to handle complex actions like emotional expressions [34]. The most common modality used by the research community for identifying emotion is facial expressions [21]. Some works have pro- posed an audiovisual approach [12], where the system takes speech as an additional input to the face, in order to tackle occlusions and increase robustness. In [26], they utilize 3D CNNs to extract spatio- temporal features both from face videos and audio signals, and deep belief nets [17] for emotion recognition. However, the COVID-19 pandemic has fostered a pervasive use of medical face masks all around the world, making a serious impact on social communica- tion. Several studies investigated how the presence of a face mask affects emotion recognition accuracy and revealed that it dimin- ishes the people's ability to accurately categorize a facial expression [6] [14]. On top of that, the mask impairs re-identification of the same face by people [24], which suggests a need for mask-specific model training. In [35], they also explored how masks influence the perceived emotional profile of facial expressions. It was shown, that it not only led to a decrease in perceived intensity of the intended emotions, but it also resulted in an overall increase in the perceived intensity of non-intended emotions. In [28], even super-recognizers, people who are highly skilled and superior in recognition tasks, were impaired by the face occlusion caused by the face mask. This negative effect in emotional reading is not limited to adults, as it also concerns interaction with children [7]. Motivated by all the above, we move towards incorporating bod- ily expressed information as a major cue in the emotion recognition task. An early work [15] combined handcrafted face and body fea- tures at feature and decision-level for emotion classification. In [10], a hierarchical multi-label annotation method was proposed, which fused body skeleton with facial expressions for automatic recognition of emotion of children during CRI scenarios. In [23], they experimented with two bodily expression pipelines, one of which implemented a two-stream-based CNN. The other one relied solely on the human skeleton and utilized a spatial-temporal Graph Convolutional Network (GCN) [37], which constructs a graph from the human body landmarks with their natural spatial connectivity, as well as temporally neighboring landmarks. Along with body, context has been an additional modality in- volved in the task of emotion recognition. In [11], RGB and flow body streams were accompanied with a context RGB stream and a visual-semantic embedding loss based on word embedding repre- sentations. In [18], they proposed a network structure composed of a GCN processing skeleton landmarks, and two 3D CNNs for RGB body and context input. A network ensemble, including streams that processed the body in RGB, flow and skeleton form was pro- posed in [30]. This variety of bodily expressed cues have also been involved in CRI emotion recognition systems [9] [25]. Our work focuses on the effect of the face occlusion on emotion recognition performance. We adopt a proven related work model and process only RGB input, despite the diversity of body cues that can be conveyed. We sense that this approach suits best to our purpose, regarding the medical face mask effect study. 3 VISUAL EMOTION RECOGNITION MODEL In this chapter, we present the model, that will be used to tackle the visual emotion recognition task. We discuss its structure and benefits and also address the occuring challenges, which are taken into account in the model's various configurations. Furthermore, we describe the tools utilized to conduct the upcoming experiments and some techniques to enhance model performance. 3.1 Feature Capturing Complex actions, like emotional expressions, comprise multiple stages spanning over a period of time and it would be quite a loss failing to utilize them. On the other hand, each expressed emotion is not present throughout a whole input video. These facts, indicate that we are in need of effective general feature capturing. While the plain CNN architecture considers the whole input sequence, as well as each frame in the video separately, the Temporal Segment Network (TSN) framework [36] operates on a sequence of short snippets sparsely sampled from the entire video. Each snippet in this sequence will produce its own preliminary prediction of the emotion classes and then, a consensus among the snippets will be derived as the video-level prediction. Therefore, it allows the network to access several parts of the video, but also tackles the inability of the former to model long-range temporal structure, thus, being more likely to observe the corresponding expression. 3.2 Method The overall architecture of our model is shown in Fig. 1. Formally, given a video V , we divide it into K non-overlapping segments {S1, S2, ..., SK }, to access several parts of the video, and transform them into a sequence of snippets {T1,T2, ...,TK }. Each snippet Tk is produced, by randomly sampling 3 consecutive frames from its corresponding segment Sk , to tackle frame redundancy. Finally, a segmental consensus function H is applied on the snippet-level predictions produced by the backbone, to obtain the final scores S: S = TSN(T1,T2, ...,TK ) = H (F (T1; W), F (T2; W), ..., F (TK ; W)) Here F (Tk ; W) denotes the function representing the application of a CNN with parameters W on the snippet Tk . The CNN is equipped with a ResNet-50 backbone architecture [16]. The consensus func- tion H we use is average pooling and the obtained video-level scores S are fed to a loss function L to perform the training step. This framework offers several benefits to emotion recognition. Com- pared to processing the entire video, the sampling process ignores redundant information in consecutive video frames, helping avoid overfitting, and offers a type of data augmentation, valuable for children emotion databases of small size. 3.3 Database We perform our experiments on the EmoReact dataset [27], which contains 1102 videos of 63 children, aged between 4 and 14, express- ing emotions while discussing different topics, collected from the YouTube channel React. Each video is annotated with one or more emotions, from a total of 8 emotion labels: Curiosity, Uncertainty, Excitement, Happiness, Surprise, Disgust, Fear, and Frustration. Therefore, we are dealing with a CRI binary multi-label classifi- cation problem. In Fig. 2, we show the imbalance of EmoReact's Figure 1: TSN-Based Model Architecture Figure 2: EmoReact Training Set Imbalance training set, which means it includes an unequal number of videos for each emotion label, and is something that we must address in our upcoming model configuration choices. We can also argue that some emotions (Fear, Frustration, Disgust) are expressed in a relatively low number of samples, which results in possible lack of diversity and less ease to generalize well across unseen individuals, introducing an extra degree of difficulty to our problem. 3.4 Medical Face Mask Effect Study The COVID-19 pandemic has forced people to extensively wear medical face masks, in order to prevent transmission. Motivated by this fact, we want to conduct an experimental study about the effect of medical face masks on emotion recognition, by applying a relevant mask on the EmoReact children's faces, as an attempt to simulate the face occlusion consequence. 3.4.1 Mask Application. To apply the mask, we detect the facial surface geometry using Google's MediaPipe Face Mesh [19], an end-to-end CNN-based model for inferring an approximate 3D mesh representation of a human face from a single image. It uses a (a) Original Image (b) Mesh Tracking (c) Mask Polygon Figure 3: Mask Application Steps dense mesh model of 468 vertices and is well-suited for face-based augmented reality effects. We track the 2D coordinates of the right and left jawline vertices, starting from just below the eyes until the chin, and one extra vertex for the nose, in order to form a polygon that is finally filled to represent the mask (Fig. 3). The jawlines for the mask are created by tracking the edge x-axis vertices and accordingly selecting among several jawline candidates, that we manually created for this particular face mesh model 1. In Fig. 4, we display several samples of EmoReact after the application of the mask and showcase our tool's robustness to face orientation. 3.4.2 Body Detection. In order to incorporate bodily expressions, we need a way to detect the human body. Google's MediaPipe also provides human body and hand skeleton tracking tools [3] [39]. We combine keypoints tracked by both tools and create a bounding box with the edge points, expanded by a factor of 10% at each respective dimension, which is then cropped as the input image. This process is demonstrated in Fig. 5, where most background noise is removed and full body information dominates the cropped image. 1The application tool the mask https://github.com/nkegke/medical-face-mask-applier code for is publicly available at: Figure 4: EmoReact Masked Samples Figure 5: Body Detection 3.5 Modality Fusion We are looking to take advantage of the face and body information separately, by fusing the individual modality prediction scores with a late fusion scheme. The full body crop includes the masked face, and processing it as a single RGB input image can lead to irrelevant information confusion. The proposed method is to separate the face and body features, in order to avoid the aforementioned issue. The core model remains as is, but now processes the face crop, and the plain body crop with the corresponding face area blacked out, in two separate forward passes (Fig. 6). After producing the scores Sf and Sb from face and plain body respectively, we use a late fusion scheme to obtain the final scores S. Finally, the overall loss L is simply the summation of the individual modality losses: L = Lf + Lb . 3.6 Temporal Modeling The current TSN-based model processes only one of the N con- secutive frames of each snippet, being heavily based on spatial structure. This architecture naturally supports temporal modeling, by mingling information among neighboring snippet frames with the Temporal Shift Module (TSM) [22]. TSM can be inserted into CNNs, to exploit temporality at zero computation and parameters. It shifts part of the channels of the input frames and the latent representations of each snippet along the temporal dimension, both forward and backward, thus facilitate information exchange among neighboring frames. Because information contained in the channels is no longer accessible for the current frame, the spatial modeling ability of the backbone can be harmed. To address this problem, the module is placed inside the residual branches of the ResNet, so the information in the original activation is still accessible after temporal shift, through the identity mappings. 3.7 Model & Training Configurations The model is pretrained on AffectNet, the largest facial expression dataset. We obtain the weights of the network as provided by the PyTorch framework, achieving 59.47% accuracy on the validation set. Before feeding the input to the network, we rescale sampled RGB images from full resolution to 224 × 224. We train our models for 60 epochs, with stochastic gradient descent with momentum 0.9 and a batch size of 8, L2 regularization with weight decay 5e-4, and start with a learning rate of 1e-2, which is then reduced by a factor of 10 at 20 and 40 epoch milestones2. Since our task is binary multi-label classification, our predictions are fed to a binary cross-entropy (BCE) loss function, after suppressing the scores S to [0,1] with a sigmoid function. BCE depends on the the label-specific error, thus it penalizes label predictions independently. Following prior work, the only evaluation metric that has been shown to be robust to imbalanced datasets is the Area Under the Curve of Receiver Operating Characteristic (ROC AUC). The scores S, of size 8 per sample, are averaged to obtain a single overall performance metric. Instead of giving equal weight to each class, which will over-emphasize on the typically low performance on an infrequent class, we compute the unbalanced average, so every sample-class pair contributes equally to the overall metric. For evaluation, we select the epoch with the best validation ROC AUC and apply the corresponding network on the test set, to finally report the best overall performance achieved. 4 EXPERIMENTAL RESULTS In this section, we present our experimental procedure and re- sults. First, an ablation study on the number of TSN segments is performed to explore possible trade-offs. Then, we study the medi- cal face mask effect by comparing emotion recognition results of masked input to when the faces are visible. We examine the case of when the mask is applied to the image of the full body, as well as only the face, to compare performance between input modalities. Furthermore, visual explanation techniques are utilized to display expressive features for different modalities and emotion categories. Lastly, we report results given with the enhancement techniques, both when individually utilized and when combined. 4.1 Performance vs Speed Trade-off In Table 1, we perform an ablation study on the number of segments and consequently the number of snippets, which are used during the TSN training, by considering 4 different values: 1, 3, 5 and 10. By increasing the number of segments, we significantly increase computational load, and therefore inference and training time. On the other hand, when we provide the model with multiple parts of the video, it might help achieve better performance. The numbers 2The code for the model and the experiments https://github.com/nkegke/deep-affective-bodily-expression-recognition is publicly available at: Figure 6: Modality Score Late Fusion Scheme Table 1: TSN Training Computational Load Table 2: Mask Effect Results on Face Input Segments 1 3 5 10 Time per Epoch (sec.) Validation Training 4 6 10 14 16 23 23 32 reported stand for training with a single RTX 2080 GPU, but one could use multiple ones and increase batch size proportionally for faster training. 4.2 Mask Effect Results We compare emotion recognition results between default and masked input, for face and full body crops. For face cropping, we extract the visual face features using OpenFace [1], an open source facial behavior analysis toolkit. 4.2.1 Mask Effect on Face Input. In Table 2, we report results on face input. At first sight, performance drops considerably (≈ 3-4%). This is a result we expected, as the mask covers the majority of the face, including one of the most expressive facial features, the mouth. Intuitively, if one would try to predict the emotions expressed in the two images of Table 2, we sense that they would have a better chance without the presence of the mask. Regarding the number of segments used, performance peaks at 10, but increasing it above 3 does not result in significant performance difference. This means that the model does not necessarily create stronger temporal structure when provided with more than 3 parts of the video. 4.2.2 Mask Effect on Full Body Input. Looking at Table 3, which shows results on full body input, the first and most important observation we make, is that performance decrease is very little to none (0-0.4%). These results suggest that the model can exploit body information in such a way, that even with the application of a face mask, and consequently face information loss, it only suffers minimal performance drop. We also note the same pattern of performance with the masked face input results, which is better performance as complexity goes up. However, performance increase from 3 to 10 segments is minimal (0.1%), which again suggests working towards the speed side of the trade-off. 4.2.3 Masked Face vs Masked Full Body Results. Lastly, in Table 4 we compare model performance with masked face versus masked full body crop, and show that incorporating the whole body in the Segments 1 3 5 10 ROC AUC Default Mask 0.728 0.755 0.733 0.769 0.732 0.767 0.741 0.770 Performance −2.7% −3.6% −3.5% −2.9% Table 3: Mask Effect Results on Full Body Input Segments 1 3 5 10 ROC AUC Default Mask 0.752 0.752 0.758 0.759 0.754 0.758 0.759 0.761 Performance - −0.1% −0.4% −0.2% input gives superior results over face crop. With black we highlight the best overall result, whereas with blue we highlight the result of the suggested optimal model, regarding the performance vs speed trade-off discussed earlier. The obvious conclusion is that moving towards bodily expression recognition is our best option, when the face is occluded. However, this is only a baseline result, which we could build on and pursue improvements by enhancing our model. 4.3 Per Emotion Performance In Fig. 7, we report per emotion ROC AUC and compare masked face versus masked full body input performance. Full body outper- forms face in all emotions, except for Excitement and Frustration. This could be translated as these two emotions being expressed more by facial than bodily features from the children involved and Table 4: Masked Input Result Comparison Segments ROC AUC Masked Face Masked Full Body Performance 1 3 5 10 0.728 0.733 0.732 0.741 0.752 0.758 0.754 0.759 +2.4% +2.5% +2.2% +1.8% Happiness Excitement Curiosity Frustration Figure 8: Face Decision Regions Happiness Excitement Curiosity Frustration Figure 9: Body Decision Regions Figure 7: Masked Input Modality per Emotion Performance incorporating the body in this case misleads the network. For Fear, performance is a lot higher with full body compared to face, which intuitively makes sense as children tend to utilize their body more to express fear [10]. Happiness is not conventionally an emotion with intense expressions, as most people think of just a simple smile, which is obstructed by the mask, but the model manages to recognize it at a decent level. Another conclusion we could come up to is that for some emotion pairs, like Curiosity-Uncertainty or Excitement-Surprise, which intuitively are quite similar to each other, performance might be lower for each emotion individually, because it is harder for the model to distinguish one from the other. 4.4 Visual Explanation To have a better understanding of the mask effect on performance, we utilize a technique for producing visual explanations for pre- dictions. We wish to explore where our model focuses in the input image and how its behaviour varies for the different emotion cate- gory targets. The method we choose is Grad-CAM [33], which uses the gradients of an emotion target flowing into the final convolu- tional layer, to produce a coarse localization map that highlights the important regions in the image for predicting that particular emo- tion. We provide some example frames of the activation mapping, where model focus increases from blue to red. Starting from the face examples (Fig. 8), we can see that the model focuses on the upper part of the face. The facial features Happiness Excitement Curiosity Frustration Figure 10: Mixed Decision Regions that could be utilized are the eyes (half-closed for Curiosity, wide open for Excitement), the eyebrows (raised for Excitement), and the forehead (frowning for Frustration). Regarding the body examples (Fig. 9), the arms become visible and provide information that is utilized by the model. The bodily features that could be utilized are the hands (calm for Happiness, aroused for Excitement, investigating for Curiosity, fist for Frus- tration), the arms (wide open for Excitement), and the shoulders (shrugged for Curiosity). In Fig. 10, we present several examples where the model focuses not only the body, but also on the face, fusing different modality information to make predictions. This suggests that it is able to learn both facial and bodily features in a single RGB stream. Overall, the model has learned to ignore noisy features, like the mask and the background. It is crucial to note, that the background is considered noise in this dataset, as the videos were recorded in a directed setup and it can be the same for different reaction topics. There is also large variability introduced by differences in the chil- dren's appearance due to clothing, body shape, size and hairstyles. These examples specify that the model is able to overcome these difficulties and focus on the expressive features. 4.5 Enhancement Results We enhance the TSN-based model with the modality fusion and temporal modeling techniques and aspire to fully overcome the consequences of the face mask, by achieving performance as high as with the unmasked input. Table 5: TSN Fusion Scheme Performance Comparison Table 7: Method Combination Performance Results Input - 3 Segments Aggregation ROC AUC Masked Face Plain Body Fusion - - Maximum Average 0.733 0.736 0.724 0.764 Table 6: TSN vs TSM Model Performance Comparison Model TSN TSN Input - 3 Segments Masked Face Masked Full Body TSM Masked Full Body Shift ROC AUC - - 1/8 1/4 0.733 0.758 0.762 0.763 4.5.1 Modality Fusion. In Table 5, we report fusion results after experimenting with two different aggregation functions: maximum and average. We also present an extra row of the plain body input, the performance of which is expected to be on the same scale with the masked face. A first observation we can make is, that using max- imum as the aggregation function gives poor results, as it is actually outperformed by the plain body crop method. That might happen, because we are utilizing different modality information with a sin- gle input and wrong positive predictions (false positives) from one modality are possibly canceling out correct negative predictions (true negatives) from the other. On the other hand, averaging seems a choice that blends well, as it clearly improves performance. In- tuitively, it makes sense to have a balanced consensus between modalities, as emotional expression cues can vary. 4.5.2 Temporal Modeling. We experiment with the originally pro- posed channel shift fractions: 1/8 and 1/4. In Table 6, we observe that inserting TSM improves performance slightly. Either by shift- ing 1/4 or 1/8 of the channels, the difference is minimal. We come to the conclusion, that spatial feature learning plays a more important role for an emotional expression, while temporal structure is rather complementary. 4.5.3 Method Combination. In Table 7, we report results when combining the TSM and fusion techniques. It seems that when utilizing both, the same conclusions as earlier apply. That means, TSM seems to give slight temporal modeling ability to the model and the fusion method results suggest that it effectively takes advantage of the face and body information separately, and possibly avoids irrelevant information confusion. The best overall performance is 0.768 ROC AUC and is achieved by the averaging fusion method, when using TSM with 1/4 partial shift. Compared to 0.769, which is the best face result achieved with no mask applied, reported in Table 2, we almost fully overcome face information loss and achieve similar performance. For reference, the last row reports the balanced ROC AUC average result from [27], where features extracted from [1] are used with an SVM, which our TSM Fusion method clearly outperforms. Model Input - 3 Seg. Shift Aggr. Masked Face TSN TSN Masked Full Body TSM Fusion TSN [27] Unmasked Face - - 1/8 1/4 - - - - Max. Avg. Max. Avg. - - ROC AUC Bal. Unb. - 0.733 - 0.758 - 0.729 - 0.767 - 0.731 0.696 0.768 0.698 0.769 0.620 - 5 CONCLUSION In this work, we studied the effect of face occlusion on a CRI vi- sual emotion recognition problem. In the presence of a face mask, performance from just the face drops considerably and urges us to incorporate the body modality. By providing the full body image as input, the model can sustain its performance and outperform the masked face case. Spatial information can be instrumental and yield great results, while temporal structure complements fittingly, as the consensus of several video segments provides additional emotional expression information. When enhancing the baseline model with temporal modeling and more importantly modality fusion, we almost fully overcome face information loss and achieve performance similar to the unmasked input case. Our visualizations provided insights suggesting a single RGB stream can ignore noise and learn both from facial, as well as bodily expressive features. An emotion recognition system with these capabilities can effectively tackle face occlusion forced by health and safety protocols, and be a core part of various applications in crucial areas like education and health care, for both adults and children. ACKNOWLEDGMENTS This work has received funding from the European Union's Horizon Europe research and innovation programme under grant agreement no. 101070381 (project: PILLAR-Robots). REFERENCES [1] Brandon Amos, Bartosz Ludwiczuk, and Mahadev Satyanarayanan. 2016. Open- Face: A general-purpose face recognition library with mobile applications. Technical Report. CMU-CS-16-118, CMU School of Computer Science. [2] Hillel Aviezer, Yaacov Trope, and Alexander Todorov. 2012. Body Cues, Not Facial Expressions, Discriminate Between Intense Positive and Negative Emotions. Science 338, 6111 (Nov. 2012), 1225–1229. https://doi.org/10.1126/science.1224313 [3] Valentin Bazarevsky, Ivan Grishchenko, Karthik Raveendran, Tyler Zhu, Fan Zhang, and Matthias Grundmann. 2020. BlazePose: On-device Real-time Body Pose tracking. https://doi.org/10.48550/ARXIV.2006.10204 [4] Tony Belpaeme, Paul Baxter, Joachim de Greeff, James Kennedy, Robin Read, Rosemarijn Looije, Mark Neerincx, Ilaria Baroni, and Mattia Coti Zelati. 2013. Child-Robot Interaction: Perspectives and Challenges. In Social Robotics. Springer International Publishing, 452–459. https://doi.org/10.1007/978-3-319-02675-6_45 [5] Cynthia Breazeal. 2003. Emotion and sociable humanoid robots. International Journal of Human-Computer Studies 59, 1-2 (July 2003), 119–155. https://doi.org/ 10.1016/s1071-5819(03)00018-1 [6] Claus-Christian Carbon. 2020. Wearing Face Masks Strongly Confuses Coun- terparts in Reading Emotions. Frontiers in Psychology 11 (Sept. 2020). https: //doi.org/10.3389/fpsyg.2020.566886 [7] Claus-Christian Carbon and Martin Serrano. 2021. The Impact of Face Masks on the Emotional Reading Abilities of Children-A Lesson From a Joint Computing Machinery, New York, NY, USA, 137–144. https://doi.org/10.1145/ 2993148.2993168 [28] Eilidh Noyes, Josh P. Davis, Nikolay Petrov, Katie L. H. Gray, and Kay L. Ritchie. 2021. The effect of face masks and sunglasses on identity and expression recog- nition with super-recognizers and typical observers. Royal Society Open Science 8, 3 (March 2021). https://doi.org/10.1098/rsos.201169 [29] Reinhard Pekrun, Thomas Goetz, Wolfram Titz, and Raymond P. Perry. 2002. Academic Emotions in Students' Self-Regulated Learning and Achievement: A Program of Qualitative and Quantitative Research. Educational Psychologist 37, 2 (Jan. 2002), 91–105. https://doi.org/10.1207/s15326985ep3702_4 [30] Ioannis Pikoulis, Panagiotis P. Filntisis, and Petros Maragos. 2021. Leveraging Semantic Scene Characteristics and Multi-Stream Convolutional Architectures in a Contextual Approach for Video-Based Visual Emotion Recognition in the Wild. (2021). https://doi.org/10.48550/ARXIV.2105.07484 [31] J.C. Read and P. Markopoulos. 2013. Child-computer interaction. International Journal of Child-Computer Interaction 1, 1 (Jan. 2013), 2–6. https://doi.org/10. 1016/j.ijcci.2012.09.001 [32] Byron Reeves and Clifford Nass. 1996. The Media Equation: How People Treat Computers, Television, and New Media Like Real People and Pla. Bibliovault OAI Repository, the University of Chicago Press (01 1996). [33] Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedan- tam, Devi Parikh, and Dhruv Batra. 2016. Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization. (2016). https://doi.org/10.48550/ ARXIV.1610.02391 [34] Karen Simonyan and Andrew Zisserman. 2014. Two-Stream Convolutional Networks for Action Recognition in Videos. In Proceedings of the 27th Interna- tional Conference on Neural Information Processing Systems - Volume 1 (Montreal, Canada) (NIPS'14). MIT Press, Cambridge, MA, USA, 568–576. [35] Maria Tsantani, Vita Podgajecka, Katie L. H. Gray, and Richard Cook. 2022. How does the presence of a surgical face mask impair the perceived intensity of facial emotions? PLOS ONE 17, 1 (Jan. 2022), e0262344. https://doi.org/10.1371/journal. pone.0262344 [36] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. 2016. Temporal Segment Networks: Towards Good Practices for Deep Action Recognition. In Computer Vision – ECCV 2016, Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling (Eds.). Springer International Publishing, Cham, 20–36. [37] Sijie Yan, Yuanjun Xiong, and Dahua Lin. 2018. Spatial Temporal Graph Convo- lutional Networks for Skeleton-Based Action Recognition. https://doi.org/10. 48550/ARXIV.1801.07455 [38] Zhengyuan Yang, Amanda Kay, Yuncheng Li, Wendi Cross, and Jiebo Luo. 2020. Pose-based Body Language Recognition for Emotion and Psychiatric Symptom Interpretation. CoRR abs/2011.00043 (2020). arXiv:2011.00043 https://arxiv.org/ abs/2011.00043 [39] Fan Zhang, Valentin Bazarevsky, Andrey Vakunov, Andrei Tkachenka, George Sung, Chuo-Ling Chang, and Matthias Grundmann. 2020. MediaPipe Hands: On-device Real-time Hand Tracking. https://doi.org/10.48550/ARXIV.2006.10214 School–University Project. https://doi.org/10.1177/20416695211038265 i-Perception 12, 4 (July 2021), 204166952110382. [8] Beatrice de Gelder. 2009. Why bodies? Twelve reasons for including bodily expressions in affective neuroscience. Philosophical Transactions of the Royal Society B: Biological Sciences 364, 1535 (Dec. 2009), 3475–3484. https://doi.org/10. 1098/rstb.2009.0190 [9] Niki Efthymiou, Panagiotis P. Filntisis, Gerasimos Potamianos, and Petros Mara- gos. 2021. A Robotic Edutainment Framework for Designing Child-Robot Interac- tion Scenarios. In The 14th PErvasive Technologies Related to Assistive Environments Conference (Corfu, Greece) (PETRA 2021). Association for Computing Machinery, New York, NY, USA, 160–166. https://doi.org/10.1145/3453892.3458048 [10] Panagiotis P. Filntisis, Niki Efthymiou, Petros Koutras, Gerasimos Potamianos, and Petros Maragos. 2019. Fusing Body Posture With Facial Expressions for Joint Recognition of Affect in Child–Robot Interaction. IEEE Robotics and Automation Letters 4, 4 (Oct. 2019), 4011–4018. https://doi.org/10.1109/lra.2019.2930434 [11] Panagiotis P. Filntisis, Niki Efthymiou, Gerasimos Potamianos, and Petros Mara- gos. 2020. Emotion Understanding in Videos Through Body, Context, and Visual- Semantic Embedding Loss. In Computer Vision – ECCV 2020 Workshops, Adrien Bartoli and Andrea Fusiello (Eds.). Springer International Publishing, Cham, 747–755. [12] Panagiotis P. Filntisis, Niki Efthymiou, Gerasimos Potamianos, and Petros Mara- gos. 2021. An Audiovisual Child Emotion Recognition System for Child-Robot Interaction Applications. In 2021 29th European Signal Processing Conference (EUSIPCO). 791–795. https://doi.org/10.23919/EUSIPCO54536.2021.9616106 [13] Goren Gordon, Samuel Spaulding, Jacqueline Kory Westlund, Jin Joo Lee, Luke Plummer, Marayna Martinez, Madhurima Das, and Cynthia Breazeal. 2016. Af- fective Personalization of a Social Robot Tutor for Children's Second Language Skills. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence (Phoenix, Arizona) (AAAI'16). AAAI Press, 3951–3957. [14] Felix Grundmann, Kai Epstude, and Susanne Scheibe. 2021. Face masks reduce emotion-recognition accuracy and perceived closeness. PLOS ONE 16, 4 (April 2021), e0249792. https://doi.org/10.1371/journal.pone.0249792 [15] Hatice Gunes and Massimo Piccardi. 2007. Bi-modal emotion recognition from expressive face and body gestures. Journal of Network and Computer Applications 30, 4 (Nov. 2007), 1334–1345. https://doi.org/10.1016/j.jnca.2006.09.007 [16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep Residual Learning for Image Recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). IEEE. https://doi.org/10.1109/cvpr.2016.90 [17] Geoffrey E. Hinton, Simon Osindero, and Yee-Whye Teh. 2006. A Fast Learning Algorithm for Deep Belief Nets. Neural Comput. 18, 7 (jul 2006), 1527–1554. https://doi.org/10.1162/neco.2006.18.7.1527 [18] Yibo Huang, Hongqian Wen, Linbo Qing, Rulong Jin, and Leiming Xiao. 2021. Emotion Recognition Based on Body and Context Fusion in the Wild. In 2021 IEEE/CVF International Conference on Computer Vision Workshops (ICCVW). IEEE. https://doi.org/10.1109/iccvw54120.2021.00403 [19] Yury Kartynnik, Artsiom Ablavatski, Ivan Grishchenko, and Matthias Grund- mann. 2019. Real-time Facial Surface Geometry from Monocular Video on Mobile GPUs. https://doi.org/10.48550/ARXIV.1907.06724 [20] Iolanda Leite, Ginevra Castellano, André Pereira, Carlos Martinho, and Ana Paiva. 2012. Modelling Empathic Behaviour in a Robotic Game Companion for Children: An Ethnographic Study in Real-World Settings. In Proceedings of the Seventh Annual ACM/IEEE International Conference on Human-Robot Interaction (Boston, Massachusetts, USA) (HRI '12). Association for Computing Machinery, New York, NY, USA, 367–374. https://doi.org/10.1145/2157689.2157811 [21] Shan Li and Weihong Deng. 2022. Deep Facial Expression Recognition: A Survey. IEEE Transactions on Affective Computing 13, 3 (July 2022), 1195–1215. https: //doi.org/10.1109/taffc.2020.2981446 [22] Ji Lin, Chuang Gan, and Song Han. 2018. TSM: Temporal Shift Module for Efficient Video Understanding. https://doi.org/10.48550/ARXIV.1811.08383 [23] Yu Luo, Jianbo Ye, Reginald B. Adams, Jia Li, Michelle G. Newman, and James Z. Wang. 2018. ARBEE: Towards Automated Recognition of Bodily Expression of Emotion In the Wild. (2018). https://doi.org/10.48550/ARXIV.1808.09568 [24] Marco Marini, Alessandro Ansani, Fabio Paglieri, Fausto Caruana, and Marco Viola. 2021. The impact of facemasks on emotion recognition, trust attribution and re-identification. Scientific Reports 11, 1 (March 2021). https://doi.org/10. 1038/s41598-021-84806-5 [25] Elisabeta Marinoiu, Mihai Zanfir, Vlad Olaru, and Cristian Sminchisescu. 2018. 3D Human Sensing, Action and Emotion Recognition in Robot Assisted Therapy of Children with Autism. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. IEEE. https://doi.org/10.1109/cvpr.2018.00230 [26] Dung Nguyen, Kien Nguyen, Sridha Sridharan, Afsane Ghasemi, David Dean, and Clinton Fookes. 2017. Deep Spatio-Temporal Features for Multimodal Emotion Recognition. In 2017 IEEE Winter Conference on Applications of Computer Vision (WACV). 1215–1223. https://doi.org/10.1109/WACV.2017.140 [27] Behnaz Nojavanasghari, Tadas Baltrušaitis, Charles E. Hughes, and Louis-Philippe Morency. 2016. EmoReact: A Multimodal Approach and Dataset for Recognizing Emotional Responses in Children. In Proceedings of the 18th ACM International Conference on Multimodal Interaction (Tokyo, Japan) (ICMI '16). Association for
http://arxiv.org/abs/2302.10016v1
2023-02-20T14:46:54
2023-02-20T14:46:54
Boosting classification reliability of NLP transformer models in the long run
Transformer-based machine learning models have become an essential tool for many natural language processing (NLP) tasks since the introduction of the method. A common objective of these projects is to classify text data. Classification models are often extended to a different topic and/or time period. In these situations, deciding how long a classification is suitable for and when it is worth re-training our model is difficult. This paper compares different approaches to fine-tune a BERT model for a long-running classification task. We use data from different periods to fine-tune our original BERT model, and we also measure how a second round of annotation could boost the classification quality. Our corpus contains over 8 million comments on COVID-19 vaccination in Hungary posted between September 2020 and December 2021. Our results show that the best solution is using all available unlabeled comments to fine-tune a model. It is not advisable to focus only on comments containing words that our model has not encountered before; a more efficient solution is randomly sample comments from the new period. Fine-tuning does not prevent the model from losing performance but merely slows it down. In a rapidly changing linguistic environment, it is not possible to maintain model performance without regularly annotating new text.
[ "Zoltán Kmetty", "Bence Kollányi", "Krisztián Boros" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10016v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10016v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.LG" ]
Boosting classification reliability of NLP transformer models in the long run Zoltán Kmetty*12, Bence Kollányi1, Krisztián Boros1 1Centre for Social Sciences, CSS-RECENS Research Group, Budapest 2Eötvös Loránd University, Faculty of Social Sciences, Sociology Department, Budapest *Corresponding author Zoltán Kmetty, [email protected]. Centre for Social Sciences, CSS-RECENS Research Group, 1097 Budapest, Tóth Kálmán u. 4., Hungary Introduction A key goal of machine learning projects is some form of classification of the input data. This classification is typically done so that both the training and the data to be classified come from the same period and data set. In practice, however, it may often be the case that a particular classification is extended to a different set of data and/or to a different period. The need and the possibility to extend classification over time is strongly supported by increasing digitization as updated datasets are more frequently available for industrial and scientific research purposes. But how long is a classification suitable for, and when is it worth re-training our model? Since the much-quoted Google Flu case, every researcher using machine learning knows that models should not be blindly trusted and that it is crucial to revise them in time (Lazer et al., 2014). The need for retraining may be particularly relevant in cases where the domain under study changes rapidly over time. In the various natural language processing (NLP) projects, this problem is common, as language and language use can change within a short period of time on a given topic (Kulkarni et al., 2015). Furthermore, neural network-based black-box models complicate the problem, as they offer little insight into how a particular classification model works, making it harder to identify what changes in content or context might cause the model to break down. This black-box feature is a problem with the transformer-based NLP models currently used for classification tasks in data-mining projects. Transformer-based machine learning models have become an important tool for many natural language processing (NLP) tasks since the introduction of the method (Vaswani et al., 2017). Connecting the encoder and decoder through an attention mechanism (which can capture the meaning of an input sequence, e.g., a sentence) and effective parallelization of the training process led to robust generalized language models. Transformer models are usually pre-trained on a generic language corpus and can later be tuned to domain-specific tasks. These models can be used for a wide array of general NLP tasks, from classification problems to document summarization, sentiment analysis, and named entity recognition. When a model is trained and fine-tuned on a range of training materials, it is often difficult to apply it to another field (Ramponi and Plank, 2020). A growing body of literature suggests that domain shifts affect the performance of general models. Performance can significantly drop when a model is applied to a dataset different from the data used for pre-training, often referred to as an out-of-distribution (OOD) dataset (Koh et al., 2021; Larson et al., 2021; Ma et al., 2019; Wang et al., 2022). Language models trained on general texts are often insufficient for tasks related to special domains, such as medical texts or legal documents. The performance of Bidirectional Encoder Representations from Transformers (BERT) can also degrade when the general model is applied to a specific domain, so further fine-tuning is often required for specific NLP tasks. BERT, one of the most popular transformer-based models, was originally pre-trained on the complete Wikipedia corpus and books digitized by the Google Books project (Devlin et al., 2018). After BERT was released as open source in 2019, researchers focusing on specific domains created their own specialized versions of BERT by extending the base model and pre- training their models on domain-specific text. For example, BioBERT was trained on biomedical corpora (PubMed abstracts and full-text articles) to learn the biomedical language (Lee et al., 2019), SciBERT was pre-trained on a random sample of 1.14 million scientific (mainly computer science and biomedical) articles (Beltagy et al., 2019), while FinBERT was pre-trained on a large financial corpus consisting of more than 46,000 news articles with 29 million words (Araci, 2019). These domain-specific models can be fine-tuned to downstream NLP tasks with great success and significantly improve the performance of BERT on these domain-specific tasks. Using a large domain-specific corpus and pre-training the model with it is often difficult and expensive. Another approach is to pre-train the model using the training classification dataset, which is often a much smaller corpus (Araci, 2019). In addition to the difficulties of applying a language model to an OOD dataset (a domain distinct from the materials used to train the model), the performance of trained language models may also degrade over time. Measuring the robustness of such a model over time has recently attracted considerable research attention. Measuring the performance of transfer models is challenging because transformer models tend to overestimate their performance when the training and evaluation periods overlap (Lazaridou et al., 2021). The literature suggests temporal misalignment degrades performance when the testing period is temporally distant from the training period (Luu et al., 2022; Röttger and Pierrehumbert, 2021). Previous work also examined the changes in the language itself over time. The pace of language change has become increasingly rapid in the context of social media (Goel et al., 2016). Linguistic shifts can also affect the performance of classification tasks based on machine learning. Both changes in word usage and altering the context of the same words can lead to performance degradation (Huang and Paul, 2019). Temporal shifts have been studied in the context of several NLP tasks, including domain classification (Huang and Paul, 2018; Agarwal & Nenkova, 2022), named entity recognition (NER) (Rijhwani and Preotiuc-Pietro, 2020; Chen et al., 2021), and sentiment analysis (Lukes and Søgaard, 2018). Florio et al. (2020) evaluated the temporal robustness of an Italian version of the model BERT and found that the model's efficiency is highly time-dependent. Although the Italian BERT model was trained on social media data and it was fine-tuned on a labeled dataset on hate speech, the content of the texts used for testing changed rapidly. When the temporal distance between the training set and the test set increased, the model's precision and F1 values decreased significantly. The authors concluded that the language of hateful content is closely linked to current events in the news that trigger hate speech and is therefore highly sensitive to changes over time. Florio et al. also found that training the model repeatedly with new data significantly helps the model to maintain its performance over time. The authors compared two different solutions to this problem. First, they used a sliding window approach in which the model was fine-tuned on a data set that was collected one month prior to the test data set. The other solution used an incremental approach, meaning that the model was trained with data from all available data before the test period so that after a longer period, data from several months were used. BERT performed significantly better in their experiment than a Support Vector Machine (SVM) model. It proved to be more robust and less sensitive to changes over time, even when fine- tuned on a static dataset and not adjusted by using more recent labeled data. We answer two research questions in this paper. On the one hand, we analyze the best approaches to fine-tune a BERT model on a long-running classification task regarding the temporal selection of fine-tuning data (RQ1). On the other hand, we test a particular re- classification approach where we use comments selected by their temporal uniqueness (RQ2). Data This paper uses comments about COVID-19-related vaccination in Hungary collected between September 2020 and December 2021. We used a social listening platform called SentiOne to collect the data. SentiOne (www.sentione.com) is an international social listening software, a content-based web analytics platform that covers and recognizes 30 languages across Europe. It collects, indexes, and analyses online public content from social media platforms, blogs, forums, and websites. By selecting keywords and tags used by the users, the interactive platform returns content that is mentioned either in the text or in its metadata. We set the start date to September 2020, as this is when the debate around Covid-19 vaccines started in Hungary. For creating our corpus, we used keywords related to vaccination. Then, we filtered out stop-words and used topic-modeling approaches to find the relevant content. There were several articles that were not related to the topic in the initial corpus, for example, articles related to animal vaccination. We retained only those articles and posts that relate to Covid-19 vaccination. The cleaned corpus consisted of about 295,152 articles and posts on social media. In this paper, we do not use the articles themselves, just the comments under the articles and relevant social media posts. At the comment level, we retained those comments written under the selected articles or containing vaccination or vaccine-related keywords. The corpus contains 8,260,808 comments from the selected period. One of our initial project goals was to find the anti-vaccination content in the comments. To this end, we developed a transformer-based classifier in early 2021. As the first step, the researchers in the project coded a random sample of 1,000 comments to anti-vax and non-anti- vax or not related to vaccination category. Based on this initial classification, we defined a set of keywords that covered well (over 98 percent recall) the anti-vax comments (see the supplementary for the list of keywords). In this step, we wanted to remove those comments from the classification where we did not expect to find any anti-vax content. This method filtered out 27.5 percent of the comments. After filtering the comments with the keywords, we randomly selected 10,000 comments from the pool of 1.7 million. The selected comments covered the period from September 2020 to February 7, 2021. We double-annotated these comments to anti-vaxxer comments and pro- vaxxer or neutral comments. In case of disagreement between annotators, a supervisor selected the final category. The supplementary contains the details of the annotation process. The kappa value for the inter-coder agreement was 0.73. These manually classified 10,000 comments formed the basis for categorizing the rest of the comment pool. For the comment categorization, we used a transformer-based NLP model based on the Hungarian version of BERT (huBERT) (Nemeskey, 2021). The average macro- precision of the classification was 0.79, and the recall and F1 scores were 0.78. This model was not fine-tuned to the topic. We call this model the base model in this paper. We continued to collect COVID-related content in the project on a daily basis and classified the new comments using the above-described transformer model. In the last months of 2021, we decided to run a second round of classifications to check whether our BERT classifier could still classify the comments with high validity. In this round, we selected comments from November 2021. To overcome the unbalanced ratio of anti-vax and non-anti-vax comments, we increased the weighting of the anti-vax comments in this annotation round. Before annotation, we classified the comments using our BERT classifier and selected 3,000 anti-vax and 1,500 pro-vaxxer or neutral comments. The 4,500 comments were annotated in the same way as in the first round of annotation. Two annotators annotated all the comments. The annotators did not know how the BERT classifier classified the comments. If there was a difference between the annotators, a supervisor selected the final category. The kappa value for the inter-coder agreement was 0.63. In this paper, we use some of these annotated comments from the second round of annotation to test the quality of the different classification approaches (see the details in the method section). Methods Our primary research question (RQ1) was how we could optimize the classification of vaccination-related comments in the long run. We use data from different periods in the first set of tests to fine-tune the original BERT model. The classification logic was the following. We started with the original huBERT model; then, we fine-tuned the model with non-labeled data. After the fine-tuning, we add the labeled data from the first annotation round to the model to learn the classification. The quality of this classification was measured on two bases. We leave out 30 percent of the comments from the labeled training set for test purposes. These comments cover the period from September 2020 to January 2021. The second quality check was on the test comments selected from the second annotation round. These comments are coming from November 2021. For the fine-tuning, we use non-labeled data from three different periods: ● 09/2020-01/2021 – 1.3m comments ● 10/2021-11/2021 – 777k comments ● 09/2020-12/2021 – 5.5m comments Again, we tested a different approach. We used unlabeled data from the entire period (09/2020- 12/2021) for fine-tuning, but we only allowed two epochs for the model to specify the weights; then we used these model weights to do further fine-tuning with data from October and November 2021. Here, we wanted to test whether it is worth combining shallow and deep learning techniques to maximize classification quality. In addition to testing the different fine-tuning approaches, we also measured how a second round of annotation could boost the quality of the classification (RQ2). We tested an optimization approach for the selection of second-round annotated comments. To do this, we computed a weirdness statistic for all words in the comments. Weirdness is a simple statistic on a word level, which shows the ratio of a given word between two corpora or two time-periods (Basile, 2020). In our case, we calculated the baseline ratio of a word for the period between September 2020 and January 2021. This is a simple division of the frequency of the word and the total counts of all words in the selected period. We then calculated a weirdness statistic for words on a monthly basis. We calculated the ratio of one word compared to all words in the selected month and divided this number by the baseline ratio. This weirdness number is one if the occurrence of a word in a month is the same as in the baseline period, and it rises above one if the words appear more often in that month. To compute the weirdness statistics, we used a sample of comments. We selected 40,000 comments each month and lemmatized the texts with a Hungarian lemmatizer e-magyar (Zsibrita, 2013). We used the lemmatized comments for the calculation. Figure 1.A presents the weirdness value of the word "Delta" and Figure 1.B the Google searches for this word. WHO began using the delta-variant name in June 2021. The weirdness statistic for this word goes parallel with the number of Google searches, which started to increase in the same month and peaked in August 2021. Figure 1. A: Weirdness value for the word Delta. B: Google searches in Hungary for the word Delta. C: The monthly standard deviation of the weirdness statistics Weirdness is a perfect statistic to measure the change in our corpus compared to a previous period. Figure 1.C shows the change in the standard deviation of the weirdness statistic. A standard deviation of zero would mean that the word ratio in the observed month is the same as in the baseline period. As expected, the standard deviation of the weirdness statistic was the lowest in February 2021, the month closest to the baseline period. The standard deviation value increased until August 2021, and then decreased. Seasonality might explain this decline in word usage. We calculated a comment level weirdness based on the word level weirdness statistic. It is a simple average of the word's monthly weirdness value per comment. We use this comment level weirdness value to select a particular sample from the second round of annotated contents by using weirdness statistics as a weight in the sampling process. We selected 1,500 comments based on this approach and 1,500 comments randomly from the pool of secondly annotated comments. There was some overlap (693 comments) between the weirdness based 1,500 comments and the randomly selected 1,500 comments. Both samples were selected from the second annotation round of annotation, covering November 2021. The 2,193 comments from the second annotation round used for test purposes did not overlap with these samples. We used the two samples of annotated comments to boost the classification. We added these comments to the original training dataset and trained the models with these extended training sets. In these tests, we used all the available unlabeled data for fine-tuning. Results We first present the model performance for the first period of annotation. Of the 10,000 comments annotated in the first round, we withheld 30 percent for testing and trained the models on the remaining comments. This round of annotation covered the period between September 2020 and January 2021. Figure 2. summarizes the results. The base huBERT model, without any fine-tuning, achieved an F1-score of 0.65 in the anti-vaxxer category and 0.92 for the non-anti-vaxxer and neutral comments. As expected, fine-tuning boosted the performance of our transformer model. We obtained an F1-score of 0.73 for the anti-vaxxer comments when we used the complete unlabeled data for fine-tuning. We obtained the same value when we fine-tuned with data selected from the same period as the test comments, namely September 2020 to January 2021. As expected, the other models optimized for the second annotation period achieved weaker performance in this case. The model with an extra 1,500 randomly selected comments from the second annotation achieved almost the same low F1-score as the base model without fine-tuning. Figure 2. F1-score for models tested in the first period of annotation Prior to the detailed analysis of classification performance, we examined how confident the models in the prediction were in the case of the test dataset coming from the second annotation period. To do this, we calculated a simple confidence value which was the absolute value of 0.5 minus the probability of anti-vaxxer classification given by the BERT model. The minimum value of this statistic is zero, and the maximum value is 0.5. A higher value means higher model confidence. We calculated this value for the test data and a subset of the test data with lower and higher weirdness values (see Table 1). As expected for all the models, the confidence value was low for comments with high weirdness and high for comments with low weirdness scores. Our base model had the lowest confidence value. The fine-tuned model had a higher confidence value, and the confidence value of the fine-tuned models and the models with the boosted classification samples did not differ significantly. Without knowing the true classification results based on model confidence, we would expect the same performance for the fine-tuned and the extended models. As we will see in the next section, the results did not confirm this expectation. Base model Fine tuned - 09/2020-01/2021 Fine tuned - 10/2021-11/2021 Fine tuned - 09/2020-12/2021 Fine tuned - 09/2020-12/2021 (2 epochs) + 10/2020- 11/2021 (deep) Fine tuned - 09/2020-12/2021 + second annotation round (random) Fine tuned - 09/2020-12/2021 + second annotation round (weirdness) Table 1. Confidence level of models Weird<0.9 0.39 0.44 0.42 0.43 0.44 0.41 0.44 All test data Weird>1.2 0.18 0.28 0.27 0.31 0.28 0.27 0.26 0.16 0.25 0.26 0.27 0.26 0.26 0.24 Figure 3. presents the results of the comments used to test the classification quality for November 2021. There were 2,193 comments in the test database, none of which were used for fine-tuning or model classification. As expected, the overall quality of classification for these comments was much lower. The base model using annotated comments from the first period without fine-tuning only achieved an F1-score of 0.5 for anti-vaxxers and 0.66 for the rest of the comments. Fine-tuning without new training data did not improve the model quality for non-anti-vaxxers and neutral comments; in some cases, it even decreased it. For the anti-vaxxer category, fine-tuning boosted the F1 score. The model with the full unlabeled data and the model with the combination of swallow and deep learning had the same level of performance. The last two sets of models used classified comments from the time period of the test data. The performance of these two models was much higher than the earlier ones, so it seems that reclassification is inevitable for a changing corpus. The random sample from the annotated comments performed better based on the test data, achieving higher F1-scores both for the anti- vaxxer and the other class, so the special sampling design for the training dataset did not help the overall classification. Figure 3. F1-score for models tested in the second period of annotation In the next step, we checked how the classification model worked for the comments where the weirdness value was above 1.2 (see Figure 3.). About 10 percent of the annotated comments were above this threshold. The test data contained 223 comments that were above the 1.2 weirdness score. As expected for most models, the classification of these comments was more challenging than that of the "normal" comments; the model performance decreased sharply. There was only one exception, namely the extended model with the random sample from the second annotation. In contrast, the extended model with the sample based on weirdness probability had a weaker F1-score for the anti-vaxxers. Discussion Our results confirm the general result found in the literature on fine-tuning. Domain-based fine- tuning of transformer models can significantly improve their performance. Considering the temporal aspect of fine-tuning, the results clearly show that the best solution is to use all available unlabeled annotations in tuning the models (RQ1). Presumably, the more/better principle that is generally observed in larger language models applies here. However, fine-tuning does not protect against model performance loss, but at least slows down the performance loss. In a rapidly changing linguistic environment, it is not possible to maintain model performance without adding new annotations. The timing of re-annotation is not generalizable, but indicators such as the weirdness index can help to shed light on corpus change dynamics. An important result of our analysis is that it is not advisable to select those comments that were less likely encountered by our model previously for new comment annotations. A more efficient solution is to randomly select the comments from the new period. The random sampling approach worked better than the specific weirdness-based sampling approach, even for classifying comments with high weirdness values. In the latter case, we saw that the model learned much worse on specific comments than on a more general training set (RQ2). It is also a critical result that it is difficult to say anything about the performance of the models without repeated annotation. The confidence of the BERT models we tested was similar for both the fine-tuned and the extended models, although the latter performed better in reality. This model confidence can easily mislead researchers when no re-annotated data is available. The creation of gold-standard categorizations will continue to be very important. However, these categorizations should not only always be domain-specific, but also need to take into account the temporal aspect. High performance of transformer models based on reinforced learning can only be maintained if a regular reclassification phase is built into the classification process, where the model is adapted to the new incoming data. Without this, our language models can quickly lose their predictive power. References Agarwal, O., & Nenkova, A. (2022). Temporal effects on pre-trained models for language processing tasks. Transactions of the Association for Computational Linguistics, 10, 904-921. Araci, D. (2019). Finbert: Financial sentiment analysis with pre-trained language models. arXiv preprint arXiv:1908.10063. Basile, V. (2020). Domain adaptation for text classification with weird embeddings. In Proceedings of the Seventh Italian Conference on Computational Linguistics (pp. 1-7). CEUR-ws. Beltagy, I., Lo, K., & Cohan, A. (2019). SciBERT: A pretrained language model for scientific text. arXiv preprint arXiv:1903.10676. Chen, S., Neves, L., & Solorio, T. (2021). Mitigating Temporal-Drift: A Simple Approach to Keep NER Models Crisp. arXiv preprint arXiv:2104.09742. Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805. Florio, K., Basile, V., Polignano, M., Basile, P., & Patti, V. (2020). Time of your hate: The challenge of time in hate speech detection on social media. Applied Sciences, 10(12), 4180. Goel, R., Soni, S., Goyal, N., Paparrizos, J., Wallach, H., Diaz, F., & Eisenstein, J. (2016, November). The social dynamics of language change in online networks. In International conference on social informatics (pp. 41-57). Springer, Cham. Huang, X., & Paul, M. (2018, July). Examining temporality in document classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers) (pp. 694-699). Huang, X., & Paul, M. (2019, July). Neural temporality adaptation for document classification: Diachronic word embeddings and domain adaptation models. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics (pp. 4113-4123). Koh, P. W., Sagawa, S., Marklund, H., Xie, S. M., Zhang, M., Balsubramani, A., ... & Liang, P. (2021, July). Wilds: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning (pp. 5637-5664). PMLR. Kulkarni, V., Al-Rfou, R., Perozzi, B., & Skiena, S. (2015, May). Statistically significant detection of linguistic change. In Proceedings of the 24th international conference on world wide web (pp. 625- 635). Larson, S., Singh, N., Maheshwari, S., Stewart, S., & Krishnaswamy, U. (2021, September). Exploring Out-of-Distribution Generalization in Text Classifiers Trained on Tobacco-3482 and RVL-CDIP. In International Conference on Document Analysis and Recognition (pp. 416-423). Springer, Cham. Lazaridou, A., Kuncoro, A., Gribovskaya, E., Agrawal, D., Liska, A., Terzi, T., ... & Blunsom, P. (2021). Mind the gap: Assessing temporal generalization in neural language models. Advances in Neural Information Processing Systems, 34, 29348-29363. Lazer, D., Kennedy, R., King, G., & Vespignani, A. (2014). The parable of Google Flu: traps in big data analysis. science, 343(6176), 1203-1205. Lee, J., Yoon, W., Kim, S., Kim, D., Kim, S., So, C. H., & Kang, J. (2020). BioBERT: a pre-trained biomedical language representation model for biomedical text mining. Bioinformatics, 36(4), 1234- 1240. Lukes, J., & Søgaard, A. (2018, October). Sentiment analysis under temporal shift. In Proceedings of the 9th workshop on computational approaches to subjectivity, sentiment and social media analysis (pp. 65-71). Luu, K., Khashabi, D., Gururangan, S., Mandyam, K., & Smith, N. A. (2021). Time waits for no one! analysis and challenges of temporal misalignment. arXiv preprint arXiv:2111.07408. Ma, X., Xu, P., Wang, Z., Nallapati, R., & Xiang, B. (2019, November). Domain adaptation with BERT- based domain classification and data selection. In Proceedings of the 2nd Workshop on Deep Learning Approaches for Low-Resource NLP (DeepLo 2019) (pp. 76-83). Nemeskey, D. M. (2021). Introducing huBERT. In G. Berend, G. Gosztolya & V. Vincze (Eds.), XVII. Magyar Számítógépes Nyelvészeti Konferencia (pp. 3-14). JATEPress. Ramponi, A., & Plank, B. (2020). Neural unsupervised domain adaptation in NLP---a survey. arXiv preprint arXiv:2006.00632. Rijhwani, S., & Preoţiuc-Pietro, D. (2020, July). Temporally-informed analysis of named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics (pp. 7605-7617). Röttger, P., & Pierrehumbert, J. B. (2021). Temporal adaptation of BERT and performance on downstream document classification: Insights from social media. arXiv preprint arXiv:2104.08116. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., ... & Polosukhin, I. (2017). Attention is all you need. Advances in neural information processing systems, 30. Wang, J., Lan, C., Liu, C., Ouyang, Y., Qin, T., Lu, W., ... & Yu, P. (2022). Generalizing to unseen domains: A survey on domain generalization. IEEE Transactions on Knowledge and Data Engineering. Zsibrita, J., Vincze, V., & Farkas, R. (2013). magyarlanc: A Toolkit for Morphological and Dependency Parsing of Hungarian. In R. Mitkov, G. Angelova & K. Bontcheva (Eds.), Proceedings of the International Conference Recent Advances in Natural Language Processing (RANLP 2013) (pp. 763– 771). Incoma Ltd. Funding The research was supported by the European Union within the framework of the RRF-2.3.1- 21-2022-00004 Artificial Intelligence National Laboratory Program. Conflicts of Interest The authors declare no conflict of interest. Data availability Raw data is not available because of copyright issues, but access can be asked from the authors. Ethics approval As we did not include human subject in our research no ethical approval was needed. Author Contributions Conceptualization, Z.K. and B.K.; methodology, Z.K. K.B and B.K.; formal analysis, Z.K. K.B and B.K.; data curation, K.B.; writing-original draft preparation, Z.K. and B.K.; writing-review and editing, Z.K. and B.K; visualization, Z.K.; funding acquisition, Z.K. Supplementary Detailed description of the annotation Originally in the project, the annotators coded the comments into three categories. If the comment was clearly against vaccination by showing an intent not to get vaccinated, we have categorized it as anti- vaxxer content. Partially anti-vaxxer contents were more challenging to grab; they are the ones who do not reject vaccination at all but have specific concerns in different matters. Comments expressing uncertainty toward vaccination due to the lack of transparency and necessary information regarding vaccination were categorized as partially anti-vaxxer content. Moreover, discussions on unpredictability regarding the efficacy or the side effects of the vaccine among different age groups or the ones criticizing the vaccination process and the whole establishment in this context, which have an explicitly expressed effect on vaccination attitudes, were also categorized as partially anti-vaxxer comments. Comments expressing cherry-picking attitudes by choosing certain vaccines over other types - typically promoting 'western' vaccines against 'eastern' products - were also put into the partial anti-vaxxer category. The third category contains comments showing neutral and pro-vaccination attitudes. However, seemingly non-relevant comments were added to this category since all the comments linked to articles were collected, even if the text is not about vaccination. The annotator agreement was relatively low for this three-category classification. In the case of the first annotation period, the kappa value for the inter-coder agreement was 0.66. In the second annotation period, this kappa went down to 0.53. The initial transformer model performance was also low, so we decided to join the two anti-vaxxer categories. This paper runs all our analyses built on the two-category classification. Hungarian olt vakcina ad kap orosz kína astra pfizer moderna Szputnyik sem nem % megbízható hatásos veszélyes Table S1. – Keywords for filtering anti-vax comments English vaccinate vaccine give get russian chinese astra pfizer moderna sputnik nor not % trusted effective dangerous Model Base model Fine tuned - 09/2020-01/2021 Fine tuned - 10/2021-11/2021 Fine tuned - 09/2020-12/2021 Class Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Accura cy f1- score 0,65 Precisi on 0,66 Reca ll 0,64 0,87 0,9 0,89 0,9 0,89 0,92 0,73 0,94 0,71 0,93 0,73 0,94 0,71 0,92 0,71 0,94 0,78 0,91 0,72 0,94 0,69 0,92 0,74 0,93 0,65 0,95 0,74 0,94 0,73 Fine tuned - 09/2020-12/2021 (2 epochs) + 10/2020- 11/2021 (deep) Fine tuned - 09/2020-12/2021 + second annotation round (random) Fine tuned - 09/2020-12/2021 + second annotation round (weirdness) Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral 0,93 0,66 0,92 0,7 0,94 0,62 0,93 0,66 0,93 0,71 0,9 0,74 0,865 0,89 0,93 0,92 0,93 Table S2. Model performances for the first annotation round (09/2020-01/2021) Model Base model Fine tuned - 09/2020-01/2021 Fine tuned - 10/2021-11/2021 Fine tuned - 09/2020-12/2021 Fine tuned - 09/2020-12/2021 (2 epochs) + 10/2020- 11/2021 (deep) Fine tuned - 09/2020-12/2021 + second annotation round (random) Fine tuned - 09/2020-12/2021 + second annotation round (weirdness) Class Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Accura cy f1- score 0.50 Precisi on 0.59 Reca ll 0.44 0.60 0.61 0.57 0.61 0.61 0.78 0.66 0.53 0.66 0.57 0.58 0.57 0.64 0.56 0.65 0.70 0.83 0.62 0.60 0.64 0.59 0.80 0.45 0.73 0.54 0.69 0.57 0.73 0.81 0.69 0.73 0.46 0.75 0.44 0.80 0.46 0.79 0.46 0.77 0.68 0.85 0.55 0.70 0.75 0.70 0.8 Table S3. Model performances for the second annotation round – test data Model Base model Fine tuned - 09/2020-01/2021 Fine tuned - 10/2021-11/2021 Fine tuned - 09/2020-12/2021 Fine tuned - 09/2020-12/2021 (2 epochs) + 10/2020- 11/2021 (deep) Fine tuned - 09/2020-12/2021 + second annotation round (random) Fine tuned - 09/2020-12/2021 + second annotation round (weirdness) Class Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Anti-vaxxer Non anti-vaxxer, neutral Accura cy f1- score 0.39 Precisi on 0.57 Reca ll 0.30 0.45 0.49 0.44 0.50 0.55 0.81 0.50 0.37 0.57 0.43 0.44 0.45 0.55 0.42 0.63 0.70 0.86 0.54 0.40 0.49 0.49 0.70 0.32 0.65 0.44 0.54 0.55 0.71 0.86 0.61 0.67 0.30 0.68 0.32 0.70 0.34 0.74 0.35 0.73 0.69 0.87 0.48 0.68 0.75 0.71 0.80 Table S4. Model performances for the second annotation round – test data, weirdness value greater than 1.2
http://arxiv.org/abs/2302.09977v1
2023-02-20T13:45:55
2023-02-20T13:45:55
Dynamic Graph Neural Network with Adaptive Edge Attributes for Air Quality Predictions
Air quality prediction is a typical spatio-temporal modeling problem, which always uses different components to handle spatial and temporal dependencies in complex systems separately. Previous models based on time series analysis and Recurrent Neural Network (RNN) methods have only modeled time series while ignoring spatial information. Previous GCNs-based methods usually require providing spatial correlation graph structure of observation sites in advance. The correlations among these sites and their strengths are usually calculated using prior information. However, due to the limitations of human cognition, limited prior information cannot reflect the real station-related structure or bring more effective information for accurate prediction. To this end, we propose a novel Dynamic Graph Neural Network with Adaptive Edge Attributes (DGN-AEA) on the message passing network, which generates the adaptive bidirected dynamic graph by learning the edge attributes as model parameters. Unlike prior information to establish edges, our method can obtain adaptive edge information through end-to-end training without any prior information. Thus reduced the complexity of the problem. Besides, the hidden structural information between the stations can be obtained as model by-products, which can help make some subsequent decision-making analyses. Experimental results show that our model received state-of-the-art performance than other baselines.
[ "Jing Xu", "Shuo Wang", "Na Ying", "Xiao Xiao", "Jiang Zhang", "Yun Cheng", "Zhiling Jin", "Gangfeng Zhang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09977v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09977v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
Dynamic Graph Neural Network with Adaptive Edge Attributes for Air Quality Prediction Jing Xua, Shuo Wanga,e, Na Yingb, Xiao Xiaoc, Jiang Zhanga,e, Yun Chengd, Zhiling Jinc, Gangfeng Zhanga,f,∗ aSchool of Systems Science, Beijing Normal University, Beijing, 100875, China bChinese Research Academy of Environmental Sciences, Beijing, 100085, China cSchool of Telecommunications Engineering, Xidian University, Xi'an, 710071, Shaanxi, China dInformation Technology and Electrical Engineering, ETH Zurich, Zurich, 8092, Switzerland eSwarma Research, Beijing, China fState Key Laboratory of Earth Surface Processes and Resource Ecology, Beijing Normal University, Beijing, 100875, China 3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 7 7 9 9 0 . 2 0 3 2 : v i X r a Abstract Air quality prediction is a typical Spatio-temporal modeling problem, which always uses different components to handle spatial and temporal dependencies in complex systems separately. Previous models based on time series analysis and Recurrent Neural Network (RNN) methods have only modeled time series while ignoring spatial information. Previous GCNs-based methods usu- ally require providing spatial correlation graph structure of observation sites in advance. The correlations among these sites and their strengths are usually calculated using prior information. However, due to the limitations of human cognition, limited prior information cannot reflect the real station-related structure or bring more effective information for accurate prediction. To this end, we propose a novel Dynamic Graph Neural Network with Adaptive Edge Attributes (DGN-AEA) on the message passing network, which generates the adaptive bidirected dynamic graph by learning the edge attributes as model parameters. Unlike prior informa- tion to establish edges, our method can obtain adaptive edge information through end-to-end training without any prior information. Thus reduced the complexity of the problem. Besides, the hidden structural information between the stations can be obtained as model by-products, which can help make some subsequent decision-making analyses. Experimental results show that our model received state-of-the-art performance than other baselines. Keywords: Air quality prediction, Adaptive graph learning, Dynamic Graph, Message Passing Neural Networks 1. Introduction Air quality has a significant impact on our daily lives. Peo- ple who breathe clean air sleep better and are less likely to die prematurely from diseases such as cardiovascular and respira- tory disorders, as well as lung cancer [1, 2]. One of the key factors that decreases air quality is PM2.5 (atmospheric partic- ulate matter (PM) having a diameter of 2.5 μm or less), which can easily be inhaled and cause damage to the human body. Thus, monitoring and forecasting the PM2.5 concentrations are critical for improving air quality. With the rapid development of industry, a significant amount of energy is consumed, re- sulting in massive PM2.5 emissions [3]. According to [4], in 2016, 38 days were heavily polluted due to PM2.5 emissions in Beijing. High PM2.5 concentrations may cause serious adverse health impacts and diseases [5], such as cardiac and pulmonary disease [6], detrimental effects on birth outcomes [7], and in- fant mortality [8]. Fortunately, to monitor and record air qual- ity data, a large number of low-cost air quality sensors have been deployed, which makes it possible for researchers to per- form accurate air quality prediction tasks. Accurate air quality predictions are useful, for example, individual activity arrange- ments and government pollution restrictions can benefit from ∗corresponding author. Email address: [email protected] (Gangfeng Zhang) that [9]. When the predicted PM2.5 concentrations are too high, people can avoid going out and politicians can modify policies accordingly. Conventional air quality prediction approaches can be gen- erally divided into two categories: the knowledge-driven ap- proach and the data-driven approach. In the past two decades, the knowledge-driven approach has been widely adopted for air quality prediction. The representations of this approach include the community multiscale air quality (CMAQ) [10], comprehensive air quality model with extensions (CAMx) [11], weather research, and forecasting/chemistry (WRF-Chem) [12] modeling systems. This knowledge-driven approach does not necessitate a large number of historical observations, and its prediction performance is determined by how well the model fits the actual conditions. However, in the real world, air qual- ity data change dramatically, which makes it not easy to make this model fit the conditions. In addition, the air quality is af- fected by various features, such as the weather, altitude, and the wind field. Under these circumstances, the knowledge-driven approaches often do not yield good predictions. Recently, data-driven approaches have shown great perfor- mance for air quality prediction. As a conventional data-driven approach, statistical methods have been widely adopted for their simple structure. Yi et al. [9] applied the autoregressive inte- grated moving average (ARIMA) model to capture the trend of air quality time series in New Delhi. Naveen et al. [13] then adopted the seasonal autoregressive integrated moving average (SARIMA), which can capture the seasonal feature of time se- ries, to predict the air quality in Kerala. However, due to the complexity and uncertainty of air quality prediction tasks, it is difficult for the statistical methods to perform well for long- term predictions. Different from the statistical methods, ma- chine learning methods are non-parametric methods that can automatically learn new patterns, and thus can handle the com- plex non-linearity of temporal data. In recent years, machine learning methods have been widely employed for air quality prediction, including the support vector regression (SVR) [14], the extreme gradient boosting (XGBoost) [15] algorithm, and the random forest approach [16], etc. However, these methods do not take into account the Spatio-temporal correlations and thus limiting their prediction performance. To extract the Spatio-temporal correlations, deep learning methods have been applied for air quality forecasting. Wen et al. [17] proposed a spatiotemporal convolutional long short- term memory (LSTM) neural network to capture the temporal and spatial dependencies. The temporal patterns were captured through the LSTM networks and the spatial dependencies were extracted by the convolutional neural networks (CNNs). Zhang et al. [18] then modeled the Spatio-temporal correlations with the CNN model and the gated recurrent units (GRUs). The above methods can provide satisfactory prediction results, nev- ertheless, the CNN model is not suitable to model the non- Euclidean structure data and thus the spatial relationships be- tween air sensors cannot be effectively modeled. Most recently, graph-based deep learning methods have gai- ned popularity since they can process the non-Euclidean struc- ture data by modeling it to a graph for training. Wang et al. [19] and Zhang et al. [18] separately employed graph convolutional networks (GCNs) to model the contextual relationships among air quality stations and further predict the air quality in the fu- ture. In a relatively short period, this modeling approach was very successful. Models based on GCN need to construct the graph structure in advance. Traditional methods for constructing graph struc- tures are usually based on prior knowledge, which can be di- vided into three categories: methods based on geographic dis- tance, time-series similarity [19], and wind field information [20]. However, we cannot exhaustively enumerate all factors previously. Besides, parallel learning of too many graphs may result in too many parameters and high computational costs. In conclusion, inaccurate prior information may lead us to incor- rectly connect two unrelated stations or lose links between two related stations. Moreover, the contextual relationships are con- stantly changing due to the impacts of the wind fields and other factors. Therefore, the dynamic graph is more suitable to model the relationships among stations in the real world. To overcome these limitations, we develop a new method that learns the dy- namic links between two stations automatically. In this paper, we propose to construct a Dynamic Graph Neural Network with Adaptive Edge Attributes (DGN-AEA). Firstly, to address the shortcomings of prior information, we propose a method that uses self-use dynamic graph learning. However, the dynamic adjacency matrix represents the connec- tion relationships between nodes will change with time, which will bring instability and difficulty to the training of the model. So, we divide the adjacency matrix into two parts, the connec- tion relation (topology) matrix, and the weight matrix, and pro- pose to use an adaptive edge attributes (weights) matrix. Exper- iments show that the adaptive edge attributes can improve the prediction result. Secondly, in order to solve the physical con- sistency problem of many existing deep learning models, we designed a dynamic edge connection construction method using wind field information and combined it with adaptive edge con- nection through the method of multi-graph stitching. Through this way, these learnable edges can be used as a correction of prior information, which can help the model to get rid of the one-sidedness of prior knowledge. Thirdly, we also calculate the outbound and inbound directions respectively when aggre- gating the neighbor node's information. Through this way, the inflow and outflow processes during the diffusion of pollutants are simulated. In summary, the contributions of this paper are listed as follows. • We introduce the adaptive dynamic graph learning unit to learn the dual-path weighted edges automatically, to solve the problem of correlation graph modeling in non- Euclidean space. • The wind field data can be integrated into our model as a type of directed dynamic connection by a Multi-Graph Process Block (MGP). The physical consistency of the model is improved in this way. • For each node, we calculate its in-degree and out-degree separately to model convolution calculations on weighted directed graphs, which is more suitable for complex sys- tems in the real world. • The proposed DGN-AEA model improves the prediction capabilities and achieves state-of-the-art prediction accu- racy. The remainder of this paper is organized as follows. In Section 2, we introduce the method to construct the adaptive dynamic graph, and our proposed DGN-AEA model. In Sec- tion 3, we describe the data used in our research and how we design experiments to verify the performance of DGN-AEA on the real-world air quality dataset. In Section 4, we show results of experiments and try to discuss what makes DGN-AEA per- forms better. Finally, we conclude and discuss the future works in Section 5. 2. Method used In this section, we firstly give the mathematical definition of the air quality prediction. Next, we describe how we con- struct the two kinds of dynamic graphs. Then, as illustrated in Figure 2, we introduce the DGN-AEA model which is de- signed to solve the adaptive graph learning problem. We show the details of how we leverage the framework of GCNs on the 2 spatial domain to handle message passing on directed edges. We also use the spatial block Dynamic Multi-Graph Process Block(MGP) to combine the adapted edge-attributes and the wind graph with MLPs, and the temporal block GRU. Finally, we form the stacked GCNs, which need spatial and temporal blocks working together to capture the spatio-temporal depen- dencies among cities. Figure 1: The distribution of the observation station of the pollutant studied in our work. Each point represents one city-level observation station. 2.1. Problem definition Air quality prediction can be seen as a typical spatial-temporal prediction problem. Let Xt ∈ RN denote the observed PM2.5 concentrations at time step t. The method based on GCNs usually models the changing spatial correlations among differ- ent cities by the dynamic directed graph G = (V, E, t), where V is the set of nodes and it is always the number of N. Et is the set of weighted edges representing the potential inter- actions among cities where its weight may change over time. Let S t ∈ RN×s denote the nodes' attribute and Zt ∈ RN×z de- note the edges' attribute at time step t, where s and z represent the variable dimensions of node features and edge features, re- spectively. The problem aims to predict the next T steps of PM2.5 concentrations [Xt+1, ..., Xt+T ]. based on the nodes' at- tribute [S t+1, ..., S t+T ] and the edges' attributes [Zt+1, ..., Zt+T ]. The mapping among the input and output can be shown as fol- lows: (cid:104) Xt; S t+1, * * * , S t+T ; Zt+1, * * * , Zt+T (cid:105) f (*) −→ ˆXt+1, * * * , ˆXt+T (cid:105) (1) where ˆXt represents the predicted vector, and f (*) is the pre- (cid:104) diction function based on the DGN-AEA framework. 3 2.2. Dynamic graph construction In the air quality forecasting problem, we need to predict the future steps of all the cities. So the number of nodes will not change with time, which is different from some evolving dynamic graph problems [21, 22, 23]. We dfine the weighted adjacency matrix A, which it can be divided into two parts: the topology matrix (P) of 0 or 1 indi- cating whether two nodes are connected, and the weight matrix (represents the edge attributes Z) indicating the strength of mu- tual influence between nodes. When using a neural network for training, if the adjacency matrix changes with time, it will bring great instability during training. Therefore, we use the adaptive edge attribute to represent this changing node interaction since it does not change the connection relationship between nodes but changes the strength of these connections, which means that the topology matrix will be static but the adjacency matrix will be dynamic. Thus, we suppose that all the correlations among cites are decided by the Euclidean distance (Equation 4) like many previous graph-based air quality prediction approaches. 2.2.1. Topology and adjacency matrix As we all know, the pollutant (such as PM2.5, PM10) con- centrations in one place are strongly affected by other adjacents. Considering that relationships like that in real world is usually sparse and different, to model these two spatial correlation fea- tures explicitly, we define the adjacency matrix A of Graph G as: A = P (cid:12) Z, (2) where (cid:12) represents the Hadamard product, Z represents the edge attributes matrix. The formulation of Z will show in the following sections. As to the topology metrix P, we introduce the effect of dis- tance on site relevance for the impact of the site is inversely proportional to the distance. And when the altitude between the two stations is too high, the connections will also be blocked out. To consider the above two factors, we use a Heaviside step function to filter out the edges that do not meet the rules as fol- lows: Pi j = H (d − ξd) * H (a − ξa) , where H(*) is the Heaviside step function: H (x) =   1, x>0  0, otherwise , (3) (4) where a represents the altitude of each node. d is the Eu- clidean distance calculated by the relative positions between two stations: (cid:113) (x1 − x2)2 + (y1 − y2)2. d = (5) Here the Euclidean distance and altitude threshold ξd and ξa equals 300km and 1.2km respectively. Here we get the topol- ogy matrix P. Figure 2: Model structure of proposed model DGN-AEA. 2.2.2. Node attributes The node attributes S t are mainly meteorological data. Which includes 17 types of variables same as [20]. We chose 8 of them as the final node attributes: Temperature, Planetary Boundary Layer height, K index, Relative humidity, Surface pressure, To- tal precipitation and the u and v component of wind. The time interval is consistent of these node attributes with the PM2.5 concentration data as 3h. 2.2.3. Edge attributes In our work, there are two kinds of edge attributes: One is from the wind field and another is from the adaptive neural net- work parameter. We use the advection coefficient as attributes from wind data and calculate it as follows: Zt w = relu   (cid:12)(cid:12)(cid:12)(cid:126)vt(cid:12)(cid:12)(cid:12) d  * cos (α − β)  , (6) where (cid:126)vt represents the wind speed at time t, d is the dis- tance between stations, and α and β are angles of cities and wind directions. relu(*) is the ReLU activation function. a ∈ R1×l the adaptive neural network parameters, where Zt l represents the number of edges, i.e., the number of 1 in the topology matrix P. We set it as one important parameter which can be seen as another kind of useful edge attribute in addi- tion to wind effects in the air quality prediction problem. This parameter can be obtained by continuous iterative optimization through the training stage. By setting adaptive dynamic edge weights as learnable pa- rameters, such dynamic correlations can be directly learned dur- ing the end-to-end training process. Even in practical scenarios where some prior information is missing, the correlation net- work between sites can still be adaptively learned for spatio- temporal prediction. When using wind field information, we can consider this learnable parameter as a supplement to wind field information. The prediction accuracy can be further im- proved in this way. The details will be presented in Section ??. 2.3. Dynamic Graph Neural Network with Adaptive Edge At- tributes 2.3.1. Graph convolution block Many dynamic graph neural networks methods are based on the spectral domain. The convolution operation on the graph 4 h!GRUCellG!"#$G%"#$Z!"#$Z%"#$X$"#$S"#$h"=X!GCN EdgeMLPNodeMLPMessageAggregateGRUCellG!"G%"Z!"Z%"S"⋯⋯⋯h!#$GCN EdgeMLPNodeMLPMessageAggregateGRUCellG!"&'#$G%"&'#$Z!"&'#$Z%"&'#$X$"#$,X$"#(,⋯,X$"#'h!#%&$MGPOut!"Out%"GraphMLPGCN EdgeMLPNodeMLPMessageAggregatecatMGPOut!"#$Out%"#$GraphMLPcatMGPOut!"&)#$Out%"&)#$GraphMLPcatS"#) is equivalent to the product in the spectral domain after the Fourier transform. The corresponding Fourier transform ba- sis is the eigenvector of the Laplace matrix. And the model Chebnet [24] uses Chebyshev polynomial to approximate the spectral convolution. However, these methods cannot handle the directed graph since the Laplacian matrices are used for undirected graphs [25, 26]. They are not suitable for complex system modeling because many relations in complex systems are directed. Besides, the prediction accuracy is limited by the order of the Chebyshev polynomial fit, and in many cases does not perform as well as spatial GCNs [27]. To solve these prob- lems, we take the spatial domain GCN i.e., the Message Passing Neural Network (MPNN) in use. MPNN framework can be divided into two stages: message passing stage and readout stage [28]. Compared with spectral- domain GCN which can only model node attributes, MPNN directly aggregates messages from neighbor nodes and can also model edges, which makes it more flexible and intuitive. For node i at time t, our GCN block with MPNN framework will work as the following equations: = (cid:104) εt i ˆXt−1 i , S t i (cid:105) , mt i j = φ (cid:16)(cid:104) i, εt εt j, Zt i j (cid:105)(cid:17) , et i = ω   (cid:88) (cid:16) j∈N(i) mt i j − mt ji (cid:17)   , (7) (8) (9) where [*, *] represent the concat operator that concats two 1-D vector to a single vector. Equation 7 represents the splicing operation of neighbor information and edge connection weights. εt i in Equation 7 represents the result after the concatenation op- eration of the input matrix. φ(*) in Equation 8 represents one layer of MLP. N(i) represents the neighbours of node i. The whole Equation 8 represents the process of aggregating neigh- bor information according to the edge weights. mi j and m ji re- spectively represent the in-degree and out-degree information of the node. In Equation 9, ω (*) is another layer of MLP. After Equation 9, we can calculate the increase and decrease after the node's message passing process. In our proposed method, we use two kinds of edge attributes. For each different edge attribute, Z may represent Zw or Za, then we can get ew and ea following Equation 9. Next, we concat the two graph-level embeddings through the transfer layer: (cid:16) (cid:17) [et ζt = ψ w, et a] It should be noted that Za is a learnable parameter in our model, thus it will be updated through the model training stage. After that, we can get an adaptive edge attribute ZAEA. (10) . Since the PM2.5 transport graph network is a directed graph, in order to realize the material conservation of source and sink nodes, we calculate the message aggregation process of each node's incoming and outgoing edges respectively. This is con- sistent with the physical process of pollutant diffusion. It can improve the prediction accuracy of the model. The specific cal- culation process is shown in the following Figure 3. Figure 3: Illustration for our used MPNN to process incoming and outgoing edge processing separately (use node a as example). Different colors of areows represents the import and export process separately. 2.3.2. Temporal processing block Our model DGN-AEA in Figure 2 can be seen as the stacked structure: it is processed by MPNN, which is good at process- ing information on graphs, and then input the aggregated re- sults to the GRU, which is good at iterative prediction of time series. Such a structure can more clearly extract effective infor- mation in the temporal and spatial domains, respectively. Here we will introduce the temporal processing block GRU. The in- put of GRU includes the historical PM2.5 concentrations of the nodes and future meteorological data, which is embedded in the node embedding εt i. We also input the information gathered on the graph to the GRU. The prediction process for node i at time t is shown as follows: (cid:105) = (cid:104) ζt i , εt i This concatenates the input variables (results after graph convolution and the meteorological variables) to prepare for subsequent matrix operations: (11) ct i . qt i = σ (cid:16) Wq * (cid:104) ht−1 i , ct i (cid:105)(cid:17) , (12) (cid:16) Wr * (cid:104) ht−1 i (cid:105)(cid:17) , rt i = σ (13) where qt i and rt , ct i i in Equation 12 represent the results after operations of update gate and forget gate in GRU respectively. σ(*) represents the sigmoid activate function. ht−1 is the hidden i state of the previous time step, ct i represents the aggregated in- put features after Equation 11. The update gate is used to con- trol the degree to which the state information of the previous moment is brought into the current state. The state information brought in at the previous moment is somewhat positively re- lated to the value of the update gate. The reset gate controls how much information from the previous state is written to the current candidate set (cid:101)ht i. The smaller the reset gate, the less in- formation from the previous state is written. (cid:101)ht i is calculated by: (cid:101)ht i = tanh (cid:16) (cid:101)W * (cid:104) i ∗ ht−1 rt i , ct i (cid:105)(cid:17) , (14) where Wq, Wr, (cid:101)W in Equation 12 to Equation 14 are learn- able parameters. After the gate control signal is obtained, we 5 febadc+bceε!ε"ε#bceε!ε"ε#importexporta+a-a'Aaggregate&readoutMassagePassing After the whole operation, we finally get the prediction re- 6: first use the reset gate to obtain the data after "reset". After the Hadamard product operation of the reset gate rt i and the hidden layer information of the previous step ht−1 , then spliced the in- put signal ct i of the current step. Then we multiply the result of the above operation by a learnable matrix, and then let the result pass a tanh activation function to scale the result to the range of [-1, 1]. As shown in Equation 14. The input information is added to the current hidden state in a targeted manner, which is equivalent to memorizing the state at the current moment. i Finally, Equation 15 performs the memory and updates op- erations at the same time, and obtains the updated hidden layer state: = (cid:16) ht i 1 − qt i (cid:17) ∗ ht−1 i + qt i ∗ (cid:101)ht i, (15) sult of PM2.5 concentration by: = Ω (cid:16) (cid:17) , ht i ˆXt i (16) where Ω (*) is a MLP layer. 2.3.3. Proposed learning algorithm We use the stacked spatiotemporal prediction structure. As shown in Figure 2, we first use MPNN to perform a convolu- tion operation on the PM2.5 concentration of each site on the graph according to the edge weight. Two MPNN are used to process the wind field information map and adaptive dynamic map respectively. Then the two graph processing results are aggregated through a layer of MLP (as shown in Equation 7 to Equation 10). Then, the output of the entire graph convolu- tion part and the historical meteorological data are input into the GRU for time series iterative processing as Equation 11 to Equation 15. Finally, we get the future forecast result as Equation 15. The whole process of the proposed DGN-AEA is shown in Algorithm 1. Algorithm 1 PM2.5 Prediction Algorithm Input: Historical PM2.5 concentrations X0; Node's attributes S = [S 1, * * * , S T ]; Edge's attributes(by wind) Zw = [Z1 Randomly initialized adaptive edge's attributes Za = [Z1 w, * * * , ZT w ]; a , * * * , ZT Output: Future PM2.5 concentrations ˆX = [ ˆX1, ..., ˆX1+T ]; AEA, ..., Z1+T Learned adaptive edge attributes ZAEA = [Z1 Evaluation metric MAE and RMSE. ˆX0 = X0 AEA]; a ]; 1: 2: h0 = 0 3: for each time step t ∈ [1, T ] do 4: 5: for all vi ∈ V do = ψ = GRU(εt ζt i ˆXt i ˆX = [ ˆX, ˆXt MPNN1 i, ζt ˆX0 i , S t i, Zt w i , ht−1 ); (cid:16) (cid:16) i i ]. (cid:17) , MPNN2 (cid:16) ˆX0 i , S t i, Zt a (cid:17)(cid:17) ; end for 7: 8: 9: end for 10: Calculate MAE and RMSE follow the Equation 18 and Equation 19; 11: return ˆX, ZAEA, MAE, RMSE where T is the length of the prediction time step, and N repre- ˆX and X represent the predicted sents the number of samples. value and the ground truth of PM2.5 concentrations respectively. To evaluate the prediction accuracy between models, we adopt two evaluation metrics: Mean Absolute Error (MAE) and Root Mean Square Error (RMSE). MAE = 1 N (cid:118)(cid:117)(cid:116) RMS E = × N(cid:88) i=1 |ˆyi − yi| , 1 N × N(cid:88) i=1 (ˆyi − yi)2, (18) (19) 3. Data and experiment design In this section, we will show the details of our selected dataset and experiment settings. 3.1. Experiment settings Our experiments are conducted on Linux system with CPU: Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz and GPU: NVIDIA Corporation Device 2204 (rev a1) The batch size of model train- ing, validation, and test data are all 32. All models are trained up to 50 epochs by early stop rules with 10 steps and use RM- SProp optimizer. The learning rate is 5e-4 and weight decay is also set to 5e-4. All the prediction results are the average result after 10 repetitions. In the training stage, we aim to minimize the Mean Square Error (MSE) Loss function as the following equation: where y is ground truth and ˆy represents the prediction re- sults given by models. These two are commonly used indicators to evaluate the accuracy of time series forecasting. 3.2. Data used To examine the ability of the model to solve real problems, we conduct experiments on the real-world datasets from the previous work[9]. This dataset is collected from MEE1 and EAR52. It contains three types of data: Sites' geographic infor- mation, meteorological data, and pollutant concentration (PM2.5) data. The last two types of variables are time series data ranging from 2015-1-1 00:00:00 to 2018-12-31 23:59:59, with 3 hours for each time step. The dataset includes 184 city-level observa- tion stations as shown in previous Figure 1. To test the predictive ability of the model under different cir- cumstances. We divide the dataset into three parts by time. The MS E Loss = 1 T   1 N T(cid:88) t=1 N(cid:88) (cid:16) i=1 ˆXt i − Xt i (cid:17)2   , (17) 6 1https://english.mee.gov.cn/ 2https://climate.copernicus.eu/climate-reanalysis training set of the first dataset is the data for two years in 2015 and 2016, and the test set and validation set are the data for the whole year of 2017 and 2018, respectively. The training, vali- dation, and testing of data set 2 were sequentially intercepted in the winter of 2015 - 2018 for three consecutive years (Novem- ber 1st - February 28th of the following year). This is because winter is usually the season of high PM2.5 pollution in China, and the average value of the data is higher. Dataset 3 uses the 2016 autumn and winter 4 months (September 1st - Decem- ber 31st) for training, uses the winter data of the following two months for verification (December 1st to December 31st) and test (January 1st to January 31st of the following year). The period of 2016 was chosen because that winter saw almost the worst pollution in Chinese history. 3.3. Baselines In our work, we consider baselines to examine the model effect. Baselines include classical statistical models, classi- cal spatio-temporal prediction models, and state-of-the-art deep learning models with adaptive graph components. • HA: The Historical Average (HA) model is a typical time series analysis model, which main idea is to use the aver- age of all the values at the corresponding time in history (known data) as the predicted value for future. Therefore, there is no concept of prediction time step. Here we refer to the construction method in the article [29] to calculate the test set, and intercept all the moments of one week to predict the corresponding time points. • LSTM: The long short-term memory (LSTM) [30] model is an improvement of the RNN model, which uses three types of gates to extract more useful related historical data. • GC-LSTM: GC-LSTM [31] is a model which uses two spectral-based GCNs embedded into the long-short term memory model to extract spatio-temporal features from data. • PM2.5-GNN: PM2.5-GNN [20] is a state-of-the-art pre- diction model for PM2.5 concentrations prediction. It also uses the stacked spatio-temporal structure based on GCNs and RNNs. • Graph WaveNet (w/o weather): The Graph WaveNet [32] develops a novel adaptive dependency matrix, which can automatically capture the spatial dependency from It uses Temporal Convolutional Network (TCN) data. as the temporal block. It has achieved state-of-the-art results in many real-world datasets, especially in traf- fic flow forecasts. Since the original model uses one- dimensional convolution to operate on only one variable, we do not use multi-dimensional meteorological infor- mation when reproduce the model. Results will shown in Section 2. 3.4. Ablation Study In order to further illustrate the role of the adaptive dynamic edge attribute, we compare the results with models with some parts removed, which are: • Static: To demonstrate the role of dynamic graphs, we conduct experiments using only static graph structures based on distance and altitude calculations. • Only AEA: As described before, DGN-AEA integrates wind edge information. Here the wind information is re- moved and only adaptive edge attributes are used. This can illustrate the important role of wind in modeling PM2.5 forecasting. • Only Wind: Contrary to Only AEA, here we only use the wind field information and remove the adaptive edge attributes. Similar to the control variables approach, this can illustrate the importance of using adaptive edge at- tributes. • W/O weather: Here we also compare the effect of not inputting the future weather GRU module as known in- formation to illustrate the effect of using future weather. • AEA+Wind(ours): As shown in Figure 2, we will use the multi-graph information of adaptive edge attributes and wind at the same time. 4. Results and discussion 4.1. Performance comparisions with baselines We compare the prediction results with the evaluation met- ric between our DGN-AEA and baselines in all three datasets. In addition, we set different prediction horizon time steps with 3 (9h), 6 (18h), 12 (36h), and 24 (72h) so that we can compare the predictive ability of various models under different time pre- diction lengths. The best results are highlighted in bold-face in Table 1. We divided the data into three datasets. By designing the number of samples and seasons of the training set dataset, it can be considered that the training difficulty on the three datasets is increasing. The training set of data set 3 has the least data and the corresponding value is large, since winter is the high season of haze in China, the value of PM2.5 is generally higher. It can be seen that our model always performs the best and the traditional statistical model HA is not always the worst. GC-LSTM performs a little better than LSTM, nevertheless, it does not perform well on our dataset overall. In dataset 3, our model DGN-AEA improves the RMSE of GC-LSTM by 6.81%, 6.11%, 5.04%, and 6.7%, respectively. PM2.5-GNN per- forms better than other baselines, but our model is more accu- rate. On the RMSE of dataset3, DGN-AEA is 2.98%, 2.94%, 2.46%, 6.3% more accurate than PM2.5-GNN. Compared with another adaptive graph model, Graph WaveNet requires a large number of parameters and has a high com- putational resource overhead, so the training is slow. Its ef- fect is also not good. Compared with Graph WaveNet, our 7 Table 1: Prediction accuracy compared with baselines. Dataset Methods Metric HA LSTM GC-LSTM PM2.5-GNN DGN-AEA 1 t e s a t a D 2 t e s a t a D 3 t e s a t a D RMSE MAE RMSE MAE RMSE MAE 3 6 12 24 3 6 12 24 3 6 12 24 3 6 12 24 3 6 12 24 3 6 12 24 25.81 37.26 52.21 35.84 42.33 29.31 12.17±0.10 15.61±0.11 18.56±0.11 20.87±0.16 9.43±0.09 12.44±0.12 14.88±0.14 16.48±0.15 18.01±0.17 23.55±0.22 28.60±0.23 32.82±0.27 14.01±0.15 18.90±0.19 23.14±0.21 26.61±0.32 26.43±0.36 33.87±0.41 40.98±0.55 45.08±1.02 20.52±0.28 27.14±0.40 33.16±0.59 36.89±1.01 12.03±0.07 15.40±0.07 18.38±0.09 20.81±0.09 9.31±0.06 12.25±0.06 14.69±0.10 16.45±0.08 18.30±0.11 23.65±0.19 28.547±0.17 33.03±0.33 14.21±0.08 18.95±0.19 22.96±0.16 26.37±0.36 26.56±0.20 34.06±0.27 40.84±0.66 44.86±0.70 20.63±0.18 27.23±0.23 32.92±0.58 36.62±0.73 11.55±0.11 14.76±0.10 17.70±0.15 20.18±0.17 8.93±0.05 11.70±0.10 14.11±0.17 15.90±0.19 17.61±0.17 22.94±0.24 27.52±0.30 31.70±0.29 13.70±0.15 18.38±0.23 25.26±0.41 25.26±0.41 25.51±0.32 32.95±0.33 39.76±0.71 45.04±0.88 19.84±0.27 26.37±0.32 32.14±0.74 36.23±0.99 11.34±0.07 14.53±0.09 17.06±0.11 19.20±0.15 8.75±0.05 11.50±0.08 13.56±0.11 15.06±0.14 17.15±0.07 22.29±0.09 26.85±0.11 30.79±0.20 13.33±0.06 17.83±0.09 21.60±0.10 24.45±0.22 24.75±0.17 31.98±0.36 38.78±0.27 42.18±0.84 19.22±0.14 25.53±0.34 31.19±0.24 34.08±0.78 Figure 4: Future PM2.5 concentrations predicted by DGN-AEA. proposed model DGN-AEA improves the RMSE of dataset 3 by 47.46%, 45.32%, 44.56%, 43.98%, and 38.08%, 36.05%, 37.61%, 36.99% on MAE. We speculate that it may be due to the construction of the adjacency matrix that changes from time to time brings great difficulty to training on PM2.5 datasets, making it difficult for the model to grasp the exact topology of 8 (a) ground truth (b) predict result Figure 5: Visualization of forecast results in the Yangtze River Delta region. The data is derived from dataset 3 with 24 prediction horizon time steps. (The unit is μg/m3) (c) error between the two the stations. The prediction fit curves of Linan are also plotted in Fig- ure 4. The above results are the average of the whole map and fit curves for individual cities. In order to examine the prediction ability of the model at the local regional scale, we select the ground truths and predicted results of the Yangtze River Delta region for a continuous period of time to visualize. The result is shown in the figure 5. 4.2. The function of dynamic graph To explain why we choose to retain two types of graph edges, we conduct ablation studies to explore the predictive ef- fects of using different edges. We find that our proposed model is the best in most cases, regardless of the dataset or prediction at any time scale (Table 2). We can see that the models where we do not use dynamic information perform worse than the dynamic graph method in the vast majority of cases. In addition, the prediction accuracy of Only Wind and Only AEA are similar, and in most cases Only AEA has even better MAE and RMSE metrics. Especially in Dataset 3, our proposed DGN-AEA has an average of 4.3%,4.7%, 3.4%, 7.8% MAE metric decrease than the other two dynamic edge attribute. 4.3. The function of future weather Our model uses future weather data as known for future air quality prediction. We compare DGN-AEA and DGN-AEA (w/o weather) models respectively. As shown in Figure 6, by using future meteorological data, the prediction accuracy can be improved by 8.87%, 11.76%, 13.65%, 15.15% on RMSE and 9.13%, 12.30%, 15.54%, 17.76% on MAE. This shows that it is very useful to use future weather data. We compared our results with another another adaptive graph model without future weather, Graph WaveNet. Graph WaveNet requires a large number of parameters and has a high com- 9 Dataset Methods Metric Only Wind Only AEA Static W/O weather AEA+Wind Table 2: Result of ablation study. 1 t e s a t a D 2 t e s a t a D 3 t e s a t a D RMSE MAE RMSE MAE RMSE MAE 3 6 12 24 3 6 12 24 3 6 12 24 3 6 12 24 3 9 12 24 3 6 12 24 11.55±0.05 14.76±0.10 17.70±0.15 20.18±0.17 8.93±0.05 11.70±0.10 14.11±0.17 15.90±0.19 17.61±0.17 22.99±0.21 27.60±0.30 31.70±0.29 13.70±0.15 18.41±0.20 22.26±0.32 25.26±0.41 25.51±0.32 32.95±0.33 39.10±0.63 43.44±0.42 19.84±0.27 26.37±0.32 31.54±0.64 35.72±0.45 11.38±0.04 14.55±0.06 17.36±0.07 19.78±0.09 8.78±0.04 11.51±0.06 13.79±0.08 15.55±0.09 17.60±0.14 23.02±0.20 27.71±0.25 31.50±0.33 13.69±0.13 18.45±0.20 22.37±0.23 25.06±0.31 25.32±0.23 32.74±0.46 39.26±0.26 42.83±0.52 19.68±0.20 26.17±0.45 31.51±0.28 35.08±0.53 11.58±0.08 14.72±0.09 17.51±0.13 19.80±0.19 8.95±0.06 11.68±0.08 13.97±0.13 15.60±0.19 17.35±0.16 22.34±0.08 27.15±0.13 31.49±0.34 13.69±0.13 18.67±0.08 22.35±0.14 24.81±0.33 24.80±0.28 32.13±0.22 39.31±0.41 42.32±0.77 19.26±0.24 25.63±0.22 31.72±0.42 34.58±0.79 13.03±0.06 17.08±0.07 20.78±0.10 24.41±0.08 10.14±0.05 13.73±0.06 16.90±0.11 18.84±0.09 19.62±0.04 26.17±0.03 32.87±0.07 38.89±0.08 15.31±0.04 21.12±0.03 26.99±0.08 31.94±0.11 27.16±0.05 36.12±0.14 44.91±0.13 49.71±0.11 21.15±0.05 29.11±0.14 36.93±0.16 41.44±0.13 11.34±0.06 14.53±0.09 17.06±0.11 19.20±0.15 8.75±0.05 11.50±0.08 13.56±0.11 15.06±0.14 17.15±0.07 22.29±0.09 26.85±0.11 30.79±0.20 13.33±0.06 17.83±0.09 21.60±0.10 24.45±0.22 24.75±0.17 31.98±0.36 38.78±0.27 42.18±0.84 19.22±0.14 25.53±0.34 31.19±0.24 34.08±0.78 putational resource overhead, so the training is slow. Whats more, because the TCN model used by the time series module of Graph WaveNet can only perform convolution operations on one-dimensional variables, it cannot input future weather data. Compared with Graph WaveNet, our proposed model DGN- AEA(w/o weather) improves the RMSE of dataset 3 by 42.35%, 38.25%, 35.80%, 33.98%, and 31.86%, 27.10%, 26.13%, 23.39% on MAE. We speculate that it may be due to the construction of the adjacency matrix that changes from time to time brings great difficulty to training on PM2.5 datasets, making it difficult for the model to grasp the exact topology of the stations. 4.4. Comparison of two attributes Following the above steps, we can get two kinds of graph edge attributes: one can be calculated by wind field data, and another can be learned after training. To get through the differ- ence and explain why the adaptive edge attribute is useful, we visualize both of them at the same time step shown in Figure 7. some analytical methods and indicators in the field of complex networks. We listed in the supplementary information. We separately count the sum of the weights on the incoming and outgoing edges of different nodes and calculate the total weight of the connected edges minus the total weight of the incoming and outgoing edges. The positive or negative value of this difference indicates that the node belongs to the type that is more affected by the surroundings or has a greater influence on the surrounding (Figure Appendix E). At the same time, we can also compare the relationship between edge weights and degree (Equation E.1), and the relationship between edge weights and the degree centrality (Equation E.2) of the complex network. Shown in Figure E.9 and Figure E.10. We see a clear positive correlation between node weight and degree value. However, there is no obvious correlation between node degree centrality and degree value. 5. Conclusions 4.5. Complex network analysis on the learned adaptive edges With DGN-AEA, an adaptive correlation network structure can be obtained after the training phase. The properties of the obtained correlation network can be discussed with the help of In this paper, we propose a flexible Dynamic Graph Neural Networks with Adaptive Edge Attributes (DGN-AEA) based on the spatial domain. This method retains edges by the wind to follow the basic prior physical knowledge of air pollution transmission. At the same time, we calculate the transmission 10 (a) MAE on Dataset 1 (b) MAE on Dataset 2 (c) MAE on Dataset 3 (d) RMSE on Dataset 1 (e) RMSE on Dataset 2 (f) RMSE on Dataset 3 Figure 6: Comparison among DGN-AEA, DGN-AEA (w/o weather) and Graph WaveNet(w/o weather) models. The results are the average of ten training sessions. (a) adaptive edge attributes (b) edge attribute by wind (c) The transpose of the upper triangle matrix of the adaptive edge attributes matrix minus the value of the lower triangle. Figure 7: Difference between the two matrices use in our model. volume on the outgoing edge and incoming edge respectively when doing message transmission and aggregation to the nodes, which simulates the law of conservation of matter in the trans- port and diffusion of pollutants to some extent. Besides, we fuse adaptive edge attributes by means of the multi-graph structure. Experiment results show that our model achieves a better level of prediction effect on the real world PM2.5 dataset. In this way, we can adaptively learn the correlation between real sites and obtain better time series prediction results. How- ever, how much of the network relationship in the real world can be restored in real data sets by this way of adaptively con- structing learnable parameters is also worth exploring. There are still some ideas of network reconstruction methods that may be worth learning from. Acknowledgment This work was supported by the National Natural Science Foundation of China (NO.42101027). We thank the support from the Save 2050 Program jointly sponsored by Swarma Club and X-Order. Appendix A. Related Work about Air Quality Prediction Air quality prediction issues have been studied for years. These issues were first studied by some conventional statis- 11 9h18h36h72hPrediction Time Steps0510152025MAEDGN-AEADGN-AEA(w/o weather)Graph WaveNet(w/o weather)9h18h36h72hPrediction Time Steps010203040MAEDGN-AEADGN-AEA(w/o weather)Graph WaveNet(w/o weather)9h18h36h72hPrediction Time Steps01020304050MAEDGN-AEADGN-AEA(w/o weather)Graph WaveNet(w/o weather)9h18h36h72hPrediction Time Steps05101520253035RMSEDGN-AEADGN-AEA(w/o weather)Graph WaveNet(w/o weather)9h18h36h72hPrediction Time Steps0102030405060RMSEDGN-AEADGN-AEA(w/o weather)Graph WaveNet(w/o weather)9h18h36h72hPrediction Time Steps010203040506070RMSEDGN-AEADGN-AEA(w/o weather)Graph WaveNet(w/o weather)015304560759010512013515016518001530456075901051201351501651800.10.00.10.20.30.40.50.60.7015304560759010512013515016518001530456075901051201351501651800.10.00.10.20.30.40.50.60.7015304560759010512013515016518001530456075901051201351501651800.60.40.20.00.20.40.6 tical methods, e.g., autoregressive integrated moving average (ARIMA) [9, 33]. However, there are too much uncertainty and non-linearity in air quality prediction, which is not suitable for these statistical models to achieve high prediction accuracy for long-term prediction. Machine learning methods make use of historical obser- vations to perform accurate predictions. Liu et al. [14] pro- posed a multi-dimensional collaborative support vector regres- sion (SVR) model for air quality index (AQI) forecasting in the Jingjinji region while considering the weather conditions. Dun et al. [34] adopted the linear regression (LR) and SVR method for short-term air quality prediction. Liu et al. [35] fused the principal component regression (PCR), SVR, and autoregres- sive moving average (ARMA) models to predict the air quality with six different kinds of pollutants. However, these machine learning methods did not capture the spatio-temporal correla- tions and thus limiting the prediction performance. In recent years, deep learning methods are widely employed in air quality prediction issues due to their high prediction ac- curacy. Ma et al. [36] propose a transfer learning-based stacked bidirectional long short-term memory (LSTM) model which combined deep learning and transfer learning strategies to pre- dict the air quality of some stations based on the data observed by other stations. Wen et al. [17] proposed a spatiotempo- ral convolutional long short-term memory neural network to capture the temporal and spatial dependencies with LSTM and convolutional neural networks (CNNs), respectively. Zhang et al. [18] proposed a hybrid model (MTD-CNN-GRU) for PM2.5 concentration prediction. In the MTD-CNN-GRU model, the CNNs were employed to extract the spatial relationships and the gated recurrent units (GRUs) were applied to capture temporal features. In this way, they could capture the spatio-temporal correlations to achieve higher prediction accuracy. Appendix B. Related Work about Graph-based Prediction Methods Conventional deep learning methods are not suitable for data processing in non-Euclidean space, which can not model the spatial correlations very well. To solve the problem, graph- based deep learning methods are proposed and have been widely applied to air quality forecasting these years. Wang et al. [19] proposed an Attentive Temporal Graph Convolutional Network (ATGCN) for air quality prediction. The ATGCN encoded three types of relationships among air quality stations including spa- tial adjacency, functional similarity, and temporal pattern sim- ilarity into graphs and aggregated features using gated recur- rent units (GRUs). Finally, a decoder was designed to con- duct multi-step predictions. Qi et al. [31] then proposed a GC-LSTM model which combined the graph convolutional net- works (GCNs) and LSTM to capture spatial terms and tempo- ral attributes and predict the future PM2.5 concentrations. Wang et al. [20] proposed a PM2.5-GNN model, which incorporated the domain knowledge into graph-structure data to model long- term spatio-temporal dependencies, for PM2.5 concentrations prediction. Since multiple features were considered, this model could achieve excellent prediction performance, especially for long-term predictions. Appendix C. Related Work about Dynamic Graph Models Recently, to better model contextual information, dynamic graph models have been employed by some researchers. Zhou et al. [37] modeled a dynamic directed graph based on the wind field among the air quality stations. They then used the GCNs to capture the dynamic relationships among the stations and applied a temporal convolutional network (TCN) to pre- dict the PM2.5 concentrations. Diao et al. [38] employed a dy- namic Laplacian matrix estimator to model the dynamic graph, which can better model the spatial dependencies. Based on the dynamic estimator, they proposed a dynamic spatio-temporal graph convolutional neural network for traffic forecasting and outperformed the baselines. Peng et al. [39] employed the rein- forcement learning to generate dynamic graphs and combined the graphs with the LSTM model for long-term traffic flow pre- diction. They further proved that dynamic graphs reduced the effects of data defects with extensive experiments. Appendix D. Related Work about Adaptive Graph Learn- ing Models To overcome the limitations of prior information, Wu et al. [32] developed an adaptive dependency matrix through node embedding to capture the hidden spatial dependency in the data. And the model Multivariate Time Series Forecasting with Graph Neural Networks (MTGNN) [40] also used this method to ex- tract the uni-directed relations among variables. However, this method of changing the adjacency matrix with the time of the event will bring a lot of interference information to the training of the model, thereby affecting the accuracy of the prediction. Therefore, Graph WaveNet does not perform well on real air quality prediction datasets. Appendix E. Figures and Equations Figure E.8: Cities sorted by the multiply of sum(in-weight) and sum(out- weight). The left red colored cities means they are attend to inflect their neigh- bors, and the right blue ones are just the opposite. 12 -15-10-50510JiangyinWuhuTangshanXingtaiXuanchengFuyangChangzhouJiaozuoZhangzhiZhangshaWuhaiNantongRizhaoEnshizhouShizuishanTianjinLiyangJiujiangHezeBaotouMeishanYibinGuyuanDeyangLaixiXianLuoyangXiangfanYunchengSuqianYueyangPingduYananEzhouChangdeHebiTonglingShangluoJimoAnkangLiuanSuiningXuchangZhoukouLianyungangYixingcitiesmultiplyofsum(inweight)andsum(outweight) role of urbanization in aggravating the health burden, Science of the Total Environment 652 (2019) 683–695. [6] B. Leclercq, J. Kluza, S. Antherieu, J. Sotty, L. Alleman, E. Perdrix, A. Loyens, P. Coddeville, J.-M. L. Guidice, P. Marchetti, et al., Air pollution-derived PM2.5 impairs mitochondrial function in healthy and chronic obstructive pulmonary diseased human bronchial epithelial cells, Environmental pollution 243 (2018) 1434–1449. [7] X. Sun, C. Liu, Z. Wang, F. Yang, H. Liang, M. Miao, W. Yuan, H. Kan, Prenatal exposure to residential PM2.5 and anogenital distance in infants at birth: A birth cohort study from shanghai, china, Environmental Pollu- tion 264 (2020) 114684. [8] G. Li, L. Li, D. Liu, J. Qin, H. Zhu, Effect of PM2.5 pollution on perinatal mortality in china, Scientific Reports 11 (1) (2021) 1–12. [9] X. Yi, J. Zhang, Z. Wang, T. Li, Y. Zheng, Deep distributed fusion network for air quality prediction, in: Proceedings of the 24th ACM SIGKDD international conference on knowledge discovery & data min- ing, 2018, pp. 965–973. [10] B. N. Murphy, C. G. Nolte, F. Sidi, J. O. Bash, K. W. Appel, C. Jang, D. Kang, J. Kelly, R. Mathur, S. Napelenok, et al., The detailed emissions scaling, isolation, and diagnostic (desid) module in the community multi- scale air quality (cmaq) modeling system version 5.3, Geosci. Model Dev. Discuss 2020 (2020) 1–28. [11] M. Ibrahim, Air quality analyses for photochemical smog associated with atmospheric aerosol particles and ozone precursors using cmaq and camx modeling systems, International Journal of Scientific Research in Science and Technology (2019) 224–235. [12] J. Hong, F. Mao, Q. Min, Z. Pan, W. Wang, T. Zhang, W. Gong, Improved PM2.5 predictions of wrf-chem via the integration of himawari-8 satel- lite data and ground observations, Environmental Pollution 263 (2020) 114451. [13] V. Naveen, N. Anu, Time series analysis to forecast air quality indices in thiruvananthapuram district, kerala, india, International Journal of Engi- neering Research and Application 7 (6) (2017) 66–84. [14] B.-C. Liu, A. Binaykia, P.-C. Chang, M. K. Tiwari, C.-C. Tsao, Urban air quality forecasting based on multi-dimensional collaborative support vector regression (svr): A case study of beijing-tianjin-shijiazhuang, PloS one 12 (7) (2017) e0179763. [15] B. Pan, Application of xgboost algorithm in hourly pm2. 5 concentration prediction, in: IOP conference series: Earth and environmental science, Vol. 113, IOP publishing, 2018, p. 012127. [16] R. Yu, Y. Yang, L. Yang, G. Han, O. A. Move, Raq–a random forest ap- proach for predicting air quality in urban sensing systems, Sensors 16 (1) (2016) 86. [17] C. Wen, S. Liu, X. Yao, L. Peng, X. Li, Y. Hu, T. Chi, A novel spatiotem- poral convolutional long short-term neural network for air pollution pre- diction, Science of the total environment 654 (2019) 1091–1099. [18] Q. Zhang, S. Wu, X. Wang, B. Sun, H. Liu, A PM2.5 concentration pre- diction model based on multi-task deep learning for intensive air quality monitoring stations, Journal of Cleaner Production 275 (2020) 122722. [19] C. Wang, Y. Zhu, T. Zang, H. Liu, J. Yu, Modeling inter-station relation- ships with attentive temporal graph convolutional network for air quality prediction, in: Proceedings of the 14th ACM International Conference on Web Search and Data Mining, 2021, pp. 616–634. [20] S. Wang, Y. Li, J. Zhang, Q. Meng, L. Meng, F. Gao, PM2.5-gnn: A do- main knowledge enhanced graph neural network for PM2.5 forecasting, in: Proceedings of the 28th International Conference on Advances in Ge- ographic Information Systems, 2020, pp. 163–166. [21] A.-L. Barab ́asi, R. Albert, Emergence of scaling in random networks, sci- ence 286 (5439) (1999) 509–512. [22] J. Leskovec, J. Kleinberg, C. Faloutsos, Graphs over time: densification laws, shrinking diameters and possible explanations, in: Proceedings of the eleventh ACM SIGKDD international conference on Knowledge dis- covery in data mining, 2005, pp. 177–187. [23] J. You, R. Ying, X. Ren, W. Hamilton, J. Leskovec, Graphrnn: Gener- ating realistic graphs with deep auto-regressive models, in: International conference on machine learning, PMLR, 2018, pp. 5708–5717. [24] M. Defferrard, X. Bresson, P. Vandergheynst, Convolutional neural net- works on graphs with fast localized spectral filtering, Advances in neural information processing systems 29 (2016). [25] Z. Tong, Y. Liang, C. Sun, D. S. Rosenblum, A. Lim, Directed graph convolutional network, arXiv preprint arXiv:2004.13970 (2020). Figure E.9: Relationships between degree centrality and connection weights. Figure E.10: Relationships between degree and connection weights. CD (Ni) = g(cid:88) J=1 xi j (i (cid:44) j) C(cid:48)D (Ni) = CD (Ni) g − 1 (E.1) (E.2) References [1] P. Strøm-Tejsen, D. Zukowska, P. Wargocki, D. P. Wyon, The effects of bedroom air quality on sleep and next-day performance, Indoor air 26 (5) (2016) 679–686. [2] T. Vandyck, K. Keramidas, A. Kitous, J. V. Spadaro, R. Van Dingenen, M. Holland, B. Saveyn, Air quality co-benefits for human health and agriculture counterbalance costs to meet paris agreement pledges, Nature communications 9 (1) (2018) 1–11. [3] H. Zhang, S. Wang, J. Hao, X. Wang, S. Wang, F. Chai, M. Li, Air pol- lution and control action in beijing, Journal of Cleaner Production 112 (2016) 1519–1527. [4] L. Li, Y. Lei, S. Wu, Z. Huang, J. Luo, Y. Wang, J. Chen, D. Yan, Evalu- ation of future energy consumption on PM2.5 emissions and public health economic loss in beijing, Journal of Cleaner Production 187 (2018) 1115– 1128. [5] X. Lu, C. Lin, W. Li, Y. Chen, Y. Huang, J. C. Fung, A. K. Lau, Analysis of the adverse health effects of pm2. 5 from 2001 to 2017 in china and the 13 0.050.100.150.20indegree_centrality02468101214in_weightout_weight510152025303540in_degree02468101214in_weightout_weight [26] Y. Ma, J. Hao, Y. Yang, H. Li, J. Jin, G. Chen, Spectral-based graph con- volutional network for directed graphs, arXiv preprint arXiv:1907.08990 (2019). [27] J. Skarding, B. Gabrys, K. Musial, Foundations and modeling of dynamic networks using dynamic graph neural networks: A survey, IEEE Access 9 (2021) 79143–79168. [28] J. Gilmer, S. S. Schoenholz, P. F. Riley, O. Vinyals, G. E. Dahl, Neural message passing for quantum chemistry, in: International conference on machine learning, PMLR, 2017, pp. 1263–1272. [29] Y. Li, R. Yu, C. Shahabi, Y. Liu, Diffusion convolutional recur- rent neural network: Data-driven traffic forecasting, arXiv preprint arXiv:1707.01926 (2017). [30] S. Du, T. Li, Y. Yang, S.-J. Horng, Deep air quality forecasting using hybrid deep learning framework, IEEE Transactions on Knowledge and Data Engineering 33 (6) (2019) 2412–2424. [31] Y. Qi, Q. Li, H. Karimian, D. Liu, A hybrid model for spatiotemporal forecasting of PM2.5 based on graph convolutional neural network and long short-term memory, Science of the Total Environment 664 (2019) 1–10. [32] Z. Wu, S. Pan, G. Long, J. Jiang, C. Zhang, Graph wavenet for deep spatial-temporal graph modeling, arXiv preprint arXiv:1906.00121 (2019). [33] J. K. Rekhi, P. Nagrath, R. Jain, et al., Forecasting air quality of delhi using arima model, in: Advances in Data Sciences, Security and Applica- tions, Springer, 2020, pp. 315–325. [34] M. Dun, Z. Xu, Y. Chen, L. Wu, Short-term air quality prediction based on fractional grey linear regression and support vector machine, Mathe- matical Problems in Engineering 2020 (2020). [35] B. Liu, Y. Jin, C. Li, Analysis and prediction of air quality in nanjing from autumn 2018 to summer 2019 using pcr–svr–arma combined model, Scientific Reports 11 (1) (2021) 1–14. [36] J. Ma, Z. Li, J. C. Cheng, Y. Ding, C. Lin, Z. Xu, Air quality prediction at new stations using spatially transferred bi-directional long short-term memory network, Science of The Total Environment 705 (2020) 135771. [37] H. Zhou, F. Zhang, Z. Du, R. Liu, Forecasting PM2.5 using hybrid graph convolution-based model considering dynamic wind-field to offer the benefit of spatial interpretability, Environmental Pollution 273 (2021) 116473. [38] Z. Diao, X. Wang, D. Zhang, Y. Liu, K. Xie, S. He, Dynamic spatial- temporal graph convolutional neural networks for traffic forecasting, in: Proceedings of the AAAI conference on artificial intelligence, Vol. 33, 2019, pp. 890–897. [39] H. Peng, B. Du, M. Liu, M. Liu, S. Ji, S. Wang, X. Zhang, L. He, Dynamic graph convolutional network for long-term traffic flow prediction with reinforcement learning, Information Sciences 578 (2021) 401–416. [40] Z. Wu, S. Pan, G. Long, J. Jiang, X. Chang, C. Zhang, Connecting the dots: Multivariate time series forecasting with graph neural networks, in: Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2020, pp. 753–763. 14
http://arxiv.org/abs/2302.09976v2
2023-09-28T12:32:22
2023-02-20T13:44:47
Discouraging posterior collapse in hierarchical Variational Autoencoders using context
Hierarchical Variational Autoencoders (VAEs) are among the most popular likelihood-based generative models. There is a consensus that the top-down hierarchical VAEs allow effective learning of deep latent structures and avoid problems like posterior collapse. Here, we show that this is not necessarily the case, and the problem of collapsing posteriors remains. To discourage this issue, we propose a deep hierarchical VAE with a context on top. Specifically, we use a Discrete Cosine Transform to obtain the last latent variable. In a series of experiments, we observe that the proposed modification allows us to achieve better utilization of the latent space and does not harm the model's generative abilities.
[ "Anna Kuzina", "Jakub M. Tomczak" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09976v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09976v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CV" ]
3 2 0 2 p e S 8 2 ] G L . s c [ 2 v 6 7 9 9 0 . 2 0 3 2 : v i X r a DISCOURAGING POSTERIOR COLLAPSE IN HIERARCHI- CAL VARIATIONAL AUTOENCODERS USING CONTEXT Anna Kuzina Vrije Universiteit Amsterdam Jakub M. Tomczak Eindhoven University of Technology ABSTRACT Hierarchical Variational Autoencoders (VAEs) are among the most popular likelihood-based generative models. There is a consensus that the top-down hi- erarchical VAEs allow effective learning of deep latent structures and avoid prob- lems like posterior collapse. Here, we show that this is not necessarily the case, and the problem of collapsing posteriors remains. To discourage this issue, we propose a deep hierarchical VAE with a context on top. Specifically, we use a Discrete Cosine Transform to obtain the last latent variable. In a series of ex- periments, we observe that the proposed modification allows us to achieve better utilization of the latent space and does not harm the model's generative abilities. 1 INTRODUCTION Latent variable models (LVMs) parameterized with neural networks constitute a large group in deep generative modeling (Tomczak, 2022). One class of LVMs, Variational Autoencoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014), utilize amortized variational inference to efficiently learn distributions over various data modalities, e.g., images (Kingma & Welling, 2014), audio (Van Den Oord et al., 2017) or molecules (G ́omez-Bombarelli et al., 2018). One of the problems hin- dering the performance of VAEs is the posterior collapse (Wang et al., 2021) when the variational posterior (partially) matches the prior distribution (e.g., the standard Gaussian distribution). The expressive power of VAEs could be improved by introducing a hierarchy of latent variables. The resulting hierarchical VAEs like ResNET VAEs (Kingma et al., 2016), BIVA (Maaløe et al., 2019), very deep VAE (VDVAE) (Child, 2021) or NVAE (Vahdat & Kautz, 2020) achieve state-of-the-art performance on images in terms of the negative log-likelihood (NLL). Despite their successes, hier- archical VAEs could still suffer from the posterior collapse effect. As a result, the modeling capacity is lower, and some latent variables carry very little to no information about observed data. In this paper, we take a closer look into the posterior collapse in the context of hierarchical VAEs. It was claimed that introducing a specific top-down architecture of variational posteriors (Sønderby et al., 2016; Maaløe et al., 2019; Child, 2021; Vahdat & Kautz, 2020) solves the problem and allows learning powerful VAEs. However, we can still notice at least partial posterior collapse, where some of the latent variables are completely ignored by the model. Here, we fill a few missing gaps in comprehending this behavior. We analyze the connection between posterior collapse and latent variable non-identifiability. By understanding the issue that lies in the optimization nature of the Kullback-Leibler terms, we propose to utilize a non-trainable, discrete, and deterministic transformation (e.g., Discrete Cosine Transform) to obtain informative top-level latent variables. Making the top latent variables highly dependent on data, we alter the optimization process. The resulting hierarchical VAE starts utilizing the latent variables differently. In the experiments, we show that our proposition achieves a different landscape of latent space. The contributions of the paper are the following: • We provide empirical evidence that the posterior collapse is present in top-down hierarchical VAEs (Section 3.2). • We extend the analysis of the posterior collapse phenomenon presented by (Wang et al., 2021) to hierarchical VAEs (Section 3.3). • We propose a way to discourage posterior collapse by introducing Discrete Cosine Transform (DCT) as a part of the variational posterior (Section 4). 1 • In the experiments, we show that the proposed approach leads to better latent space utilization (Section 5.2), more informative latent variables (Section 5.3) and does not harm the generative performance (Section 5.1). 2 BACKGROUND 2.1 VARIATIONAL AUTOENCODERS ∈ X ∈ X D (e.g., = R). We observe N x's sampled from the em- Consider random variables x pirical distribution q(x). We assume that each x has L corresponding latent variables z1:L = RMl , where Ml is the dimensionality of each variable. We aim to find a la- (z1, . . . , zL), zl tent variable generative model with unknown parameters θ, pθ(x, z1:L) = pθ(x z1:L)pθ(z1:L). In | general, optimizing latent-variable models with non-linear stochastic dependencies is troublesome. A possible solution is an approximate inference in the form of variational inference (Jordan et al., 1999) with a family of variational posteriors over the latent variables φ. This idea is exploited in Variational Auto-Encoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014), in which variational posteriors are referred to as encoders. As a result, we optimize a tractable ob- jective function, i.e., the Evidence Lower BOund (ELBO), over the parameters of the variational posterior, φ, and a generative part, θ: qφ(z1:L { x) } | Eq(x) [ln pθ(x)] ≥ (cid:20) Eqφ(z1:L|x) ln pθ(x Eq(x) z1:L) | − DKL [qφ(z1:L (cid:21) , pθ(z1:L)] ∥ x) | (1) where q(x) is an empirical data distribution. Further, we use qtest(x) for the hold-out data. 2.2 TOP-DOWN HIERARCHICAL VAES l=1 pθ(zl We propose to factorize the distribution over the latent variables in an autoregressive manner: pθ(z1, . . . , zL) = pθ(zL) (cid:81)L−1 zl+1:L), similarly to (Child, 2021; Maaløe et al., 2019; Vah- | dat & Kautz, 2020). Next, we follow the proposition of (Sønderby et al., 2016) with the top-down x) (cid:81)L−1 inference model: qφ(z1, . . . , zL zl+1:L, x). This factorization was used | previously by successful VAEs, among others, NVAE (Vahdat & Kautz, 2020) and Very Deep VAE (VDVAE) (Child, 2021). It was shown empirically that such a formulation allows for achieving state-of-the-art performance on several image datasets. x) = qφ(zL | l=1 qφ(zl | 3 AN ANALYSIS OF THE posterior collapse IN HIERARCHICAL VAES The posterior collapse effect is a known problem of shallow VAEs when certain latent variables do not carry any information about the observed data. There are various methods to deal with this issue for VAEs, such as changing the parameterization (Dieng et al., 2019; He et al., 2019), changing the optimization or the objective (Alemi et al., 2018; Bowman et al., 2016; Fu et al., 2019; Havrylov & Titov, 2020; Razavi et al., 2019), or using hierarchical models (Child, 2021; Maaløe et al., 2017; 2019; Tomczak & Welling, 2018; Vahdat & Kautz, 2020). Here, we focus entirely on the hierarchical VAEs since the posterior collapse problem is not fully analyzed in their context. In practice, hierarchical VAEs usually require huge latent space with multiple latent layers to achieve good performance (Sønderby et al., 2016; Maaløe et al., 2019; Child, 2021; Vahdat & Kautz, 2020). However, as we show in our analysis, the actual number of used latent units in these models is relatively small. Therefore, it is still an open question about how to reduce the gap between the total size of the latent space and the actual number of latents used by these models. Following definition 1 in Wang et al. (2021), we consider the posterior collapse as a situation where the true posterior is equal to the prior for a given set of parameters θ. We can formulate this definition for a single stochastic layer of top-down hierarchical VAE as follows: pθ(zl zl+1:L, x) = pθ(zl zl+1:L). (2) | In practice, we deal with the variational posterior qφ(zl zl+1:L, x), which approximates the true posterior. Furthermore, it is common to identify the posterior collapse based on this approxi- mate distribution (Burda et al., 2015; Lucas et al., 2019; Sønderby et al., 2016; Van Den Oord | | 2 Table 1: Posterior collapse metrics and NLL for the top-down hierarchical VAEs with various LATENT SPACE sizes and with fixed model SIZE (the total num- ber of parameters). SIZE L LATENT SPACE AU KL NLL↓ 676K 4 624K 6 657K 8 651K 10 490 735 980 1225 38.3% 0.047 37.9% 0.031 33.5% 0.022 33.6% 0.018 79.6 78.8 78.3 77.9 Figure 1: The cumulative distribution function of the KL-divergence in VAEs with varying latent space sizes. | x) pθ(zL x) ∥ x)] + (cid:80)L−1 l=1 et al., 2017). Both definitions are connected, yet not identical. We learn the posterior approxi- mation by variational inference, and the ELBO (Eq. 1) is maximized when the approximate pos- x)] = 0. Furthermore, the terior matches the true posterior, namely, DKL [qφ(z1:L | x)] = KL-divergence can be further decomposed into the following sum: DKL[qφ(z1:L | DKL [qφ(zL pθ(z1:L ∥ Eqφ(zl+1:L,x)DKL [qφ(zl Therefore, a collapsed true posterior distribution for the latent variable at the stochastic layer l results in a collapsed variational posterior for this latent variable at the optimum. However, the collapse of the variational posterior distribution does not guarantee the collapse of the true posterior as it can be caused by a poor choice of the family of the variational distributions. See Appendix A for an in- depth discussion. To this end, we assume that the family of variational posterior distribution is rich enough and use the variational posterior collapse as an indicator of true posterior collapse. Next, we discuss the metrics of the posterior collapse in more detail. pθ(zl zl+1:L, x) ∥ x) || | zl+1:L, x)] . pθ(z1:L | | | | 3.1 MEASURING THE POSTERIOR COLLAPSE We consider two metrics for assessing the posterior collapse in hierarchical VAEs. First, we compute the KL-divergence for the i-th latent variable of the stochastic layer l: kli l = Eqtest(x)Eqφ(zl+1:L|x)DKL (cid:2)qφ(zi zl+1:L, x) l| ∥ zl+1:L)(cid:3) . pθ(zi l| (3) This quantity can be approximately computed using Monte Carlo sampling and gives us an estimate of the posterior collapse issue for each latent variable. Note that the KL-divergence term used in the ELBO 1 equals the sum of these values over all latent variables i and stochastic layers l. Second, we use active units. This is a metric introduced in (Burda et al., 2015), and it can be calculated for a given stochastic layer and a threshold δ: Al = Varqtest(x)Eqφ(zl+1:L|x)Eqφ(zl|zl+1:L,x) [zl] , (cid:80)L l=1 AU = (cid:80)Ml i=1 [Al,i > δ] l=1 Ml , (cid:80)L (4) (5) where Ml is the dimensionality of the stochastic layer l, [P ] is Iverson bracket, which equals to 1 if P is true and to 0 otherwise. Following (Burda et al., 2015), we use the threshold δ = 0.01. The higher the share of active units, the more efficient the model is in using its latent space. 3.2 EMPIRICAL EVIDENCE OF POSTERIOR COLLAPSE In the following, we carry out an experiment to observe the posterior collapse in hierarchical VAE. We train four top-down hierarchical VAE models with different latent space sizes on the MNIST dataset. At the same time, we make sure that all the models have a similar number of parameters and try to keep the number of ResNet blocks the same. We vary the number of stochastic layers L from 4 to 10. Note that the data space has a dimensionality of 784. We report the test NLL, Active Unit, and KL-divergence per latent variable for this experiment in Table 1. We also plot an empirical CDF of the latent variable's KLs in Figure 1. 3 0.00.10.20.30.40.5{klil}l,i0.60.70.80.91.0Prop.oflatentunits490Latents735Latents980Latents1225Latents The total number of latent units increases from 490 to 1225 in this experiment. However, all the models have no more than 40% of active units. We also observe that AU and KL metrics decrease with the number of stochastic layers increasing. The cumulative histogram of KL-divergence (Eq. 3) depicted in Figure 1 shows that the models have close to 60% of the latent variable with almost zero KL-divergence. This indicates that the deep hierarchical VAEs do not use the majority of the latent units. As a result, the common claim that the top-down hierarchical VAEs alleviate the problem of the posterior collapse (Maaløe et al., 2019) is not necessarily true as indicated by this experiment. It is true, though, that increasing the number of latents improves the performance (NLL). However, this is not an efficient way of utilizing the model since it disregards over 60% of its latents. 3.3 LATENT VARIABLES NON-IDENTIFIABILITY AND THE POSTERIOR COLLAPSE IN HIERARCHICAL VAES Wang et al. (2021) prove that collapse of the true posterior in a one-level VAE takes place if and only if latent variables are non-identifiable. A latent variable z is called non-identifiable (Raue et al., 2009) if for a given set of parameter values θ∗, the conditional likelihood does not depend on this latent variable. Namely, pθ∗ (x z) = pθ∗ (x). Similarly, we say that latent variable zl in | hierarchical VAE is non-identifiable when pθ∗ (x z1:L) = pθ∗ (x | | We now establish the connection between posterior collapse (Eq. 2) and non-identifiability in the following propositions. See Appendix B for the proofs. z−l). Proposition 1 Consider a top-down hierarchical VAE introduced in Section 2.2. Then, for a given set of parameter values θ∗, the posterior of the latent variable zl collapses if and only if x and zl are conditionally independent given (zl+1, . . . , zL). Proposition 2 Consider a top-down hierarchical VAE introduced in Section 2.2. If x and zl are conditionally independent given (zl+1, . . . , zL), then the latent variable zl is non-identifiable. How- ever, if zl is non-identifiable, it does not imply that it is conditionally independent with x given (zl+1, . . . , zL). To simplify the notation, let us split the latent variables of hierarchical VAEs into three groups: z1, . . . , zl−1 , zl, zl+1, . . . , zL (cid:124) (cid:125) (cid:125) (cid:123)(cid:122) zA (cid:123)(cid:122) zC (cid:124) . (6) We can do this for each l 1, . . . , L, assuming that in the corner case of l = 1, zA is an empty set, and in the case of l = L, zC is an empty set. Then, the content of the propositions 1 and 2 can be summarized in the following diagram: pθ∗ (x pθ∗ (zl | (cid:124) (cid:124) zA, zC) (cid:125) pθ∗ (x (cid:124) zC) | (cid:125) zC) (cid:125) ⇔ ⇒ ∈ zl, zC) = pθ∗ (x (cid:123)(cid:122) Conditional Independence zA, z,zC) = pθ∗ (x | | (cid:123)(cid:122) Non-identifiability zC, x) = pθ∗ (zl | (cid:123)(cid:122) Posterior Collapse | . That being said, as opposed to the one-level VAE considered by (Wang et al., 2021), the non- identifiability of the latent variables in hierarchical VAEs does not necessarily cause the true pos- terior to collapse. Therefore, the solution, in which we define the likelihood function in a way that guarantees the latent variable identifiability might be too restrictive. One possible solution would be to utilize the method from (Wang et al., 2021) to ensure that zl and x are not conditionally indepen- zl, zl+1:L), dent given (zl+1, . . . , zL). However, one would need access to the distribution pθ∗ (x | which is intractable in the top-down hierarchical VAEs. As a result, we employ an orthogonal approach by adding one more non-trainable latent variable to a hierarchical VAE, which we call a context. We show in Section 4.3 that this method can break the link between conditional independence and posterior collapse without any restriction on the likelihood function. 4 HIERARCHICAL VAES WITH NON-TRAINABLE CONTEXT 4.1 HIERARCHICAL VAES WITH CONTEXT In this work, we introduce a modified hierarchical VAE model, which is meant to increase the number of latent variables used by a deep hierarchical VAE while not harming performance. As 4 we discuss in Sec. 3.3, posterior collapse happens if and only if there is a conditional independence between zl and x given z>l. If this is the case, then the posterior distribution is proportional to the prior, namely, pθ(zl zl+1:L). As a result, the latent variable zl does not contain | any information about the input x. Note also that prior distribution is an object we can control since this is the distribution we parametrize directly by the neural network. This motivates us to introduce the context. We think of the context as a top-level latent variable that can be obtained from the input via a fixed, non-trainable transformation. zl+1:L, x) | pθ(zl ∝ Let us consider the top latent variable zL to be given by a non- learnable transformation of the input x, namely, zL = f (x). We require context zL to be a much simpler object than the ini- RML tial object x. That is, we want the dimensionality of zL ∈ D, ML to be smaller than the dimensionality of x D. At the same time, we want the context to be a reasonable rep- resentation of x. We can think of the context as a compressed representation of the input data, e.g., in the simplest case, it could be a downsampled version of an image (see Appendix F for details). We discuss another way of constructing the con- text in Section 4.4. ∈ X ≪ z3 z2 z1 d2 d1 x z3 z2 z1 x The graphical model of the VAE with the context is de- picted in Figure 2. We use the top-down VDVAE architec- ture (Child, 2021) and extend this model with a deterministic, non-trainable function to create latent variable zL (the con- text). Context zL is produced from the observation x and fur- ther used to condition all other latent variables in both infer- ence and generative models. We provide a mode details on the architecture in Appendix E.1 (Figure 8) Figure 2: Graphical model of the top-down hierarchical VAE with two latent variables and the context z3. The inference model (left) and the generative model (right) share the top-down path (blue). The grey arrow represents a non-trainable transformation. 4.2 TRAINING VAE WITH THE CONTEXT We assume that both x and zL are discrete random variables. Furthermore, we assume that the f (x)). As we variational posterior of the context is Kronecker's delta function q(zL depict in Figure 2, the generative model is conditioned on the context latent variable zL at each step. To sample unconditionally, we define a context prior distribution pγ(zL), which is trained simultaneously with the whole VAE model via the ELBO objective. Following (Vahdat et al., 2021; Wehenkel & Louppe, 2021), we propose to use a diffusion-based generative model (Ho et al., 2020) as the prior. Since the context is a less complex object, we assume that it is enough to use a model much smaller compared to the VAE itself. We provide details on diffusion models in Appendix C. The diffusion-based model provides a lower bound on the log density of the prior distribution x) = δ(zL | − (γ, zL) L ≤ ln pγ(zL), which together with VAE objective 1 results in the following objective: Eqφ(z1:L|x) [ln pθ(x|z1:L)] + Eq(zL|x)L(γ, zL) − L−1 (cid:88) l=1 Eqφ(zl+1:L|x)DKL [qφ(zl|zl+1:L, x)∥pθ(zl|zl+1:L)] . 4.3 THE POSTERIOR COLLAPSE FOR VAES WITH THE CONTEXT x δ(zL We claim that the introduction of the context changes the prior distributions, which results in the posterior collapse having less effect on the model. First, since zL = f (x), we guarantee that the top latent variable will not collapse. We now need to fit the prior to the aggregated posterior q(zL) = (cid:80) f (x))q(x), not the other way around. As a result, this prior contains information about the data points x by definition. Second, let us assume that zl and x are conditionally independent for given parameter values θ∗: pθ(x zl+1:L). Then, from the Proposition 1 the | zl+1:L). However, since f (x) = posterior is proportional to the prior: pθ(zl | ∝ zL zl+1:L, we still have information about x preserved in the posterior: zl, zl+1:L) = pθ(x | zl+1:L, x) pθ(zl − | ∈ This way, the presence of posterior collapse does not necessarily lead to uninformative latent codes. pθ(zl zl+1:L, x) | ∝ pθ(zl zl+1:L−1, f (x)). | (7) 5 4.4 A DCT-BASED CONTEXT We suggest to think of the context as of compressed representation of the input data (Sec. 4.1). We expect it to be lower-dimensional compared to the data itself while preserving crucial information. In other words, we may say that context does not contain any high-frequency details of the signal of interest while preserving a more general pattern. To this end, we propose to use the Discrete Cosine Transform1 (DCT) to create the context. DCT(Ahmed et al., 1974) is widely used in signal processing for image, video, and audio data, i.e., it is a part of the JPEG standard (Pennebaker & Mitchell, 1992). DCT is a linear transformation that decomposes a discrete signal on a basis consisting of cosine functions of different frequencies. 2 D ∈ X (cid:113) 2 (cid:0)n + 1 Let us consider a signal as a 3D tensor x as follows: zDCT,i = CxiC⊤, where for all pairs (k = 0, n): Ck,n = D cos (cid:0) π Ch×D×D. Then DCT for a single channel, xi, is defined (cid:113) 1 D , and for all pairs (k, n) (cid:1) k(cid:1). A helpful property of the DCT is that it is an such that k > 0: Ck,n = invertible transformation. Therefore, it contains all the information about the input. However, for our approach, we want the context to be lower-dimensional compared to the input dimensionality. Therefore, we propose to remove high-frequency components from the signal. Assume that each d channel of x is D bottom rows and right-most columns for each channel in the frequency domain. Finally, we perform normalization using matrix S, which contains the maximal absolute value of each frequency. We DCT(x) calculate this matrix using all the training data: S = maxx∈Dtrain | . As a result, we get latent | 1, 1]. In the last step, we round all values to a given precision such variables whose values are in [ − that after multiplying the latents by S we get integers, thus, we get discrete variables. We call this the quantization step. Algorithm 1 describes context computation from the given input x. D. We select the desired size of the context d < D and remove (crop) D − × Algorithm 1 Create a DCT-based context Input: x, S, d zDCT = DCT(x) zDCT = Crop(zDCT, d) zDCT = zDCT S zDCT = quantize(zDCT) Return: zDCT Algorithm 2 Decode the DCT-based context. Input: zDCT, S, D zDCT = zDCT S * zDCT = zero pad(zDCT, D ̃xcontext = iDCT(zDCT) d) − Return: ̃xcontext Due to cropping and quantization operations, the context computation is not invertible anymore. However, we can still go back from the frequency to the local domain. First, we start by multiplying by the normalization matrix S. Afterwards, we pad each channel with zeros, so that the size increases from d D. Lastly, we apply the inverse of the Discrete Cosine Transform (iDCT). We describe this procedure in Algorithm 2. We refer to our top-down hierarchical VAE with a DCT- based context as DCT-VAE. d to D × × 5 EXPERIMENTS We evaluate DCT-VAE on several commonly used image datasets, namely, MNIST, OMNIGLOT, and CIFAR10. We provide the full set of hyperparameters in Appendix E.2. We designed the experiments to validate the following hypotheses: 1) Adding the DCT-based context into hierarchical VAE does not harm the performance (as mea- sured by negative loglikelihood) (sec. 5.1). 2) DCT-VAE have more active units / higher KL values (sec. 5.2). 3) Latent variables of very deep DCT-VAE carry more information about the input data (sec. 5.3). In all the experiments, we implement two models: A baseline Very Deep VAE model without any context (denoted by VDVAE) (Child, 2021), and our approach (DCT-VAE) that is a VDVAE with a DCT-based context on top. We keep both architectures almost identical, keeping the same number of channels, resnet blocks, and latent space sizes. In other words, the only difference in the architecture is the presence of the context in DCT-VAE. 1In this work, we consider the most widely used type-II DCT. 6 Table 2: The test performance (NLL) on MNIST and OM- NIGLOT datasets and the number of stochastic layers (L). MODEL DCT-VAE (ours) Donwsample-VAE (ours) Small VDVAE (our implementation) Attentive VAE (Apostolopoulou et al., 2022) CR-NVAE (Sinha & Dieng, 2021) OU-VAE (Pervez & Gavves, 2021) NVAE (Vahdat & Kautz, 2020) BIVA(Maaløe et al., 2019) LVAE (Sønderby et al., 2016) IAF-VAE (Kingma et al., 2016) L 8 8 8 15 15 5 15 6 5 MNIST OMNIGLOT log p(x) − 76.62 77.52 ≤ ↓ 86.11 87.69 78.27 77.63 76.93 81.10 78.01 78.41 81.74 88.14 89.50 - 96.08 - 91.34 102.11 - 79.10 - (a) MNIST (b) OMNIGLOT Figure 3: NLL results for MNIST and OMIGLOT for different con- text types and sizes. 5.1 IMAGE GENERATION BENCHMARKS Binary images We start with the experiments on binary images: MNIST and OMNIGLOT, for which we use dynamic binarization. In Figure 3, we report the results of an ablation study where we test various context sizes and two contexts: downsampling and DCT. We observe that DCT- VAE (green) outperforms the VDVAE in all the experiments (the orange horizontal line). However, if we choose downsampling as a context instead of the DCT, the performance of the model drops significantly for larger context sizes (blue bars). The reason for that comes from the fact that it becomes harder to fit the prior to the aggregated posterior. Interestingly, it seems there is a sweet spot for the context size of the DCT-VAE at around 5%. Since DCT always performs better than downsampling, we use it in all the experiments from now on. Comparing DCT-VAE to various best-performing VAEs, it turns out that our approach not only does not harm performance but also achieves state-of-the-art performance on both datasets, see Table 5. Importantly, the introduction of the context gives a significant improvement over the same architecture of the VDVAE. Natural Images We perform ex- periments on natural images to test the method's performance on a more challenging task. We use the CI- FAR10 dataset, which is a common benchmark in VAE literature. We note that the best-performing VAEs (e.g., VDVAE, NVAE) on this dataset are very large and require sub- stantial computational resources to train which we do not have access to. Instead, we train a small-size VD- VAE and provide results of other gen- erative models of comparable sizes in Table 5. We report the complete com- parison (including large models) in Appendix D. Table 3: The test performance (BPD) on the CIFAR10 dataset, the total number of trainable parameters (Size), the number of stochastic layers (L). MODEL SIZE L BITS/DIM ≤ ↓ DCT-VAE (ours) Small VDVAE (our implementation) OU-VAE (Pervez & Gavves, 2021) Residual flows (Perugachi-Diaz et al., 2021) i-DenseNet flows (Perugachi-Diaz et al., 2021) 22M 29 21M 29 10M 3 25M 1 25M 1 3.26 3.28 3.39 3.28 3.25 7 2.0%3.2%4.6%6.2%8.2%Contextsize/Inputsize7678808284TestNLLVDVAEDCT-VAEDownsample-VAE2.0%3.2%4.6%6.2%8.2%Contextsize/Inputsize858890929598100TestNLLVDVAEDCT-VAEDownsample-VAE Table 4: The absolute and the relative number of active units for VAEs and DCT-VAEs evaluated on the test datasets of MNIST, OMNIGLOT, and Cifar10. LATENT SPACE CONTEXT SIZE AU↑ (Absolute) AU↑ (% of latents) KL↑ (per latent unit) ×10e − 3 VDVAE DCT-VAE VDVAE DCT-VAE 980 967 980 980 0 36 0 49 VDVAE DCT-VAE 105K 105K 0 108 7.5K 11.3K MNIST 336 405 34.4% 41.9% 22.9 (1.4) 25.9 (0.8) OMNIGLOT 494 593 CIFAR10 50.4% 60.5% 7.1% 10.8% 35.1 (0.8) 36.5 (0.8) 47.6 (2.1) 51.6 (2.0) We observe that our approach works on par with the generative models that have comparable sizes (OU-VAE, Residual Flows, GLOW), and, most importantly, it has a similar (in fact, slightly better) BPD to our implementation of the VDVAE of a similar size. 5.2 POSTERIOR COLLAPSE In this section, we analyze the latent space of the DCT-VAE and VDVAE trained on different datasets from the posterior collapse point of view. We report the number of active units and KL-divergence on the test dataset in Table 4. We also show the total latent space size and context size. We observe that the number of active units increases significantly when the context is introduced to the model. Furthermore, this increase is much higher than the size of the context itself, meaning that it helps to increase the latent space utilization in general. However, there are still a lot of unused latent variables. For example, on the CIFAR10 dataset, the proportion of active units increases from 7% to 11%. It means that even though deeper models obtain better NLL, there is still a significant waste of the model's capacity. Similarly to the AU metric, the higher KL-divergence of the DCT- VAE compared to the VDVAE with no context indicates that the DCT-based context helps to push more information to other layers. In conclusion, we observe the improved utilization of latent space in terms of both metrics. 5.3 DATA INFORMATION IN LATENT VARIABLES Many of the state-of-the-art models have a lot of stochastic layers (e.g., 45 for CIFAR10 (Child, 2021)). Therefore, it is likely that the information about the x could be completely disregarded by the latent variables further away from the input. In this section, we explore how much information about the corresponding data points the top latent codes contain. For this purpose, we consider the reconstruction performance and compression. We examine VDVAE and DCT-VAE with 29 stochastic layers trained and tested on the CIFAR10 dataset in both experiments. 5.3.1 RECONSTRUCTION CAPABILITIES OF DCT-VAE We compute Multi-Scale Structural Similarity Index Measure (MSSSIM) (Wang et al., 2003) for the test data and its reconstruction obtained using only part of the latent variables from the variational we obtain a reconstruction ̃xm using m latent variables posterior. That is, for each m m latent variables from the prior, namely: from the variational posterior and by sampling the rest L 1, . . . , L ∈ { } − ̃xm ∼ pθ( z1:L) *| L−m (cid:89) l=1 pθ(zl zl+1:L) | L (cid:89) l=L−m+1 qφ(zl zl+1:L, x). | (8) 8 Figure 4: The reconstruction measured by the MSSSIM ( ) on the CIFAR10 ↑ test set for a varying number of latent variables sampled from the encoder. Figure 5: Compression result on KODAK dataset. We use discrete context only to compress images with DCT-VAE. We report the BPP of JPEG and VDVAE that corresponds to the same reconstruction quality. (a) VDVAE (b) DCT-VAE Figure 6: Examples of the decompressed images. We use (a) 2 top latent variables of VDVAE to reconstruct the image, (b) only the context of DCT-VAE, and (c) we choose JPEG compression to have a similar PSNR value to DCT-VAE. (c) JPEG We present the results of this experiment in Figure 4. We observe that in VDVAE the top latent layers carry very little to no information about the real data point x, which continues up to the 5th layer from the top. Then, the reconstructions become reasonable (between the 5th and the 10th layer values of MSSSIM increases from 0.6 to 0.8). In the case of DCT-VAE, using only one layer (i.e., context) gives already reasonable reconstructions (MSSSIM above 0.8). 5.3.2 IMAGE COMPRESSION WITH DCT-VAE To find out how much information about the data is preserved in the top latent variable, we conduct an experiment in which we use the baseline VDVAE and the DCT-VAE pretrained on CIFAR10 for compression. We use the KODAK dataset, which is a standard compression benchmark containing 24 images with resolution 512 32, we independently encode 768. Since CIFAR10 images are 32 patches of KODAK images. We then reconstruct each patch using only the context latent variable, while the rest of the latent variables are sampled from the prior. We combine these patches to obtain final reconstructions and measure reconstruction error (PSNR). We use JPEG as a baseline. × × Results are provided in Figure 5. We select the compression rates that result in comparable PSNR values. We report KL-divergence converted to bits-per-pixel as a theoretical compression rate. All the latent variables (except for the context in DCT-VAE) are continuous. We provide an example of the KODAK image after compression in Figure 6. We also plot examples of the reconstructed images in the Appendix Figure 9. Interestingly, DCT-VAE is capable of obtaining much better BPP than two other baselines while keeping the same PSNR. This indicates the usefulness of context. 6 CONCLUSION In this paper, we discuss the issue of posterior collapse in top-down hierarchical VAEs. We show theoretically and empirically that this problem exists. As a solution, we propose to introduce deter- ministic, discrete and non-trainable transformations to calculate the top latent variables, e.g., DCT. The resulting model, DCT-VAE, seems to give more robust latent variables that carry more informa- tion about data (e.g., the compression experiment). 9 1510152025StohasticLayer0.20.40.60.81.0MSSSIMVDVAEDCT-VAEJPEGDCT-VAEVDVAE*20222426PSNRJPEGDCT-VAEVDVAE*0.20.30.4BPPPSNR=15.2,MSSSIM=0.38,BPP*=0.05PSNR=25.1,MSSSIM=0.84,BPP=0.19PSNR=26.6,MSSSIM=0.84,BPP=0.32 REFERENCES Nasir Ahmed, T Natarajan, and Kamisetty R Rao. Discrete cosine transform. IEEE Transactions on Computers, 100(1):90–93, 1974. Alexander Alemi, Ben Poole, Ian Fischer, Joshua Dillon, Rif A Saurous, and Kevin Murphy. Fixing a broken elbo. In ICML, 2018. Ifigeneia Apostolopoulou, Ian Char, Elan Rosenfeld, and Artur Dubrawski. Deep attentive varia- tional inference. In ICLR, 2022. Samuel Bowman, Luke Vilnis, Oriol Vinyals, Andrew Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. In SIGNLL, 2016. Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv, 2015. Rewon Child. Very deep vaes generalize autoregressive models and can outperform them on images. In ICLR, 2021. Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. NeurIPS, 2021. Adji B Dieng, Yoon Kim, Alexander M Rush, and David M Blei. Avoiding latent variable collapse with generative skip models. In AISTATS, 2019. Hao Fu, Chunyuan Li, Xiaodong Liu, Jianfeng Gao, Asli Celikyilmaz, and Lawrence Carin. Cyclical annealing schedule: A simple approach to mitigating kl vanishing. arXiv, 2019. Rafael G ́omez-Bombarelli, Jennifer N Wei, David Duvenaud, Jos ́e Miguel Hern ́andez-Lobato, Benjam ́ın S ́anchez-Lengeling, Dennis Sheberla, Jorge Aguilera-Iparraguirre, Timothy D Hirzel, Ryan P Adams, and Al ́an Aspuru-Guzik. Automatic chemical design using a data-driven contin- uous representation of molecules. ACS central science, 2018. Serhii Havrylov and Ivan Titov. Preventing posterior collapse with levenshtein variational autoen- coder. arXiv, 2020. Junxian He, Daniel Spokoyny, Graham Neubig, and Taylor Berg-Kirkpatrick. Lagging inference networks and posterior collapse in variational autoencoders. In ICLR, 2019. Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. NeurIPS, 2020. Chin-Wei Huang, Jae Hyun Lim, and Aaron C Courville. A variational perspective on diffusion- based generative models and score matching. NeurIPS, 2021. Michael I Jordan, Zoubin Ghahramani, Tommi S Jaakkola, and Lawrence K Saul. An introduction to variational methods for graphical models. Machine learning, 37(2):183–233, 1999. Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014. Diederik P Kingma, Tim Salimans, Ben Poole, and Jonathan Ho. Variational diffusion models. In NeurIPS, 2021. Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Im- proved variational inference with inverse autoregressive flow. NeurIPS, 2016. Anna Kuzina, Max Welling, and Jakub Mikolaj Tomczak. Alleviating adversarial attacks on varia- tional autoencoders with mcmc. In NeurIPS, 2022. James Lucas, George Tucker, Roger Grosse, and Mohammad Norouzi. Understanding posterior collapse in generative latent variable models. Deep Generative Models for Highly Structured DataICLR, 2019. Lars Maaløe, Marco Fraccaro, and Ole Winther. Semi-supervised generation with cluster-aware generative models. arXiv, 2017. 10 Lars Maaløe, Marco Fraccaro, Valentin Li ́evin, and Ole Winther. Biva: A very deep hierarchy of latent variables for generative modeling. NeurIPS, 2019. Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Do deep generative models know what they don't know? In ICLR, 2019. William B Pennebaker and Joan L Mitchell. JPEG: Still image data compression standard. Springer Science & Business Media, 1992. Yura Perugachi-Diaz, Jakub Tomczak, and Sandjai Bhulai. Invertible densenets with concatenated lipswish. NeurIPS, 2021. Adeel Pervez and Efstratios Gavves. Spectral smoothing unveils phase transitions in hierarchical variational autoencoders. ICML, 2021. Andreas Raue, Clemens Kreutz, Thomas Maiwald, Julie Bachmann, Marcel Schilling, Ursula Klingm ̈uller, and Jens Timmer. Structural and practical identifiability analysis of partially ob- served dynamical models by exploiting the profile likelihood. Bioinformatics, 25(15):1923–1929, 2009. Ali Razavi, Aaron van den Oord, Ben Poole, and Oriol Vinyals. Preventing posterior collapse with delta-vaes. In ICLR, 2019. Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, 2014. Samarth Sinha and Adji Bousso Dieng. Consistency regularization for variational auto-encoders. NeurIPS, 2021. Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In ICML, 2015. Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. NeurIPS, 2016. Jakub Tomczak and Max Welling. Vae with a vampprior. In AISTATS, 2018. Jakub M. Tomczak. Deep Generative Modeling. Springer Cham, 2022. Belinda Tzen and Maxim Raginsky. Neural stochastic differential equations: Deep latent gaussian models in the diffusion limit. arXiv, 2019. Arash Vahdat and Jan Kautz. Nvae: A deep hierarchical variational autoencoder. NeurIPS, 2020. Arash Vahdat, Karsten Kreis, and Jan Kautz. Score-based generative modeling in latent space. NeurIPS, 2021. Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. NeurIPS, 2017. Yixin Wang, David Blei, and John P Cunningham. Posterior collapse and latent variable non- identifiability. NeurIPS, 2021. Zhou Wang, Eero P Simoncelli, and Alan C Bovik. Multiscale structural similarity for image quality assessment. In IEEE Conf. on Signals, Systems & Computers, 2003. Antoine Wehenkel and Gilles Louppe. Diffusion priors in variational autoencoders. In INNFICML, 2021. 11 A POSTERIOR COLLAPSE AND VARIATIONAL DISTRIBUTION Here, we present a discussion on the variational posterior collapse. To keep the notation unclut- tered, we use z instead of z1:L. First, let us look into the Kullback-Leibler divergence between the variational posterior and the real posterior: DKL[qφ(z x) | pθ(z || x)] = | = = = = (cid:90) (cid:90) − − − qφ(z x) ln | qφ(z pθ(z dz x) | x) | x)dz (cid:90) qφ(z x) ln qφ(z | H[qφ(z H[qφ(z H[qφ(z x)] | x)] | x)] | − − qφ(z x) ln pθ(z | | − Eqφ(z|x)[ln pθ(z x)] | (cid:20) pθ(x | pθ(x) z)] | Eqφ(z|x) [ln pθ(x Eqφ(z|x) z)pθ(z) ln − (cid:21) − (φ, θ; x). = ln p(x) − L x)dz | Eqφ(z|x) [ln pθ(z)] + Eqφ(z|x) [ln pθ(x)] In other words, the the Kullback-Leibler divergence between the variational posterior and the real posterior calculated is equal to the difference between the true marginal likelihood and the ELBO. Now, if we assume the variational posterior collapses, i.e., q(z x) = p(z), then we get: | DKL[qφ(z pθ(z x) | || | pθ(z x)] | x)] =DKL[p(z) || H[p(z)] H[p(z)] − = = = ln pθ(x) − − − Ep(z) [ln pθ(x z)] | z)] + H[p(z)] + ln pθ(x) Ep(z) [ln pθ(x | z)] − Ep(z) [ln pθ(x − Ep(z) [ln pθ(z)] + Ep(z) [ln pθ(x)] | As a result, the gap between the collapsed variational posterior (qφ(z posterior is equal to the difference between the marginal likelihood and Ep(z) [ln pθ(x We can consider two cases, that is: x) = pθ(z)) and the true | z)]. | 1. If the real posterior collapses, pθ(z x) = pθ(z), then naturally the variational pos- | terior collapses. The reason is straightforward: We optimize the following objective: DKL[qφ(z pθ(z)]. 2. If the variational posterior collapses, then depending on the expressive power of the con- ditional likelihood pθ(x z), the true posterior can also collapse. This follows from the fact | that if Ep(z) [ln pθ(x z)] | ln p(x), then DKL[p(z) x)] = 0, thus, pθ(z p(z). pθ(z x) ≈ ≈ || | | x) | || In the second point, it is still possible that the variational posterior can collapse and still the real posterior is not collapsed (or it is "partially" collapsed, meaning that it gets closer to pθ(z)). 12 B POSTERIOR COLLAPSE AND LATENT VARIABLES NON-IDENTIFIABILITY Proposition 1. Consider a top-down hierarchical VAE introduced in Section 2.2. Then, for a given set of parameter values θ∗, the posterior of the latent variable zl collapses if and only if x and zl are conditionally independent given (zl+1, . . . , zL). Proof. To simplify the notation, let us split the latent variables of hierarchical VAEs into three groups: , zl z1, . . . , zl−1 (cid:124)(cid:123)(cid:122)(cid:125) (cid:125) (cid:123)(cid:122) (cid:124) zB zA , zl+1, . . . , zL (cid:124) (cid:123)(cid:122) (cid:125) zC . (9) We can do this for each l and in the case of l = L, zC is an empty set. Then, the posterior collapse implies pθ∗ (zB pθ∗ (zB pθ∗ (x additionally conditioned on zC. 1, . . . , L, assuming that in the corner case of l = 1, zA is an empty set, zC, x) = | zB, zC) = | | zC). The proof follows directly from Theorem 1 in (Wang et al., 2021), where everything is | ■ zC), and the conditional independence is exactly the following equality: pθ∗ (x ∈ Note, however, that the conditional independence in Proposition 1 is not the same as the latent variable non-identifiability which is defined as follows: where z−l = (z1, . . . , zl−1, zl+1, . . . , zL). To see how latent variable non-identifiability is con- nected to posterior collapse (Eq. 2) in hierarchical VAE, we start with the following proposition. pθ∗ (x | z1:L) = pθ∗ (x z−l), | (10) Proposition 2. Consider a top-down hierarchical VAE introduced in Section 2.2. If x and zl are conditionally independent given (zl+1, . . . , zL), then the latent variable zl is non-identifiable. How- ever, if zl is non-identifiable, it does not imply that it is conditionally independent with x given (zl+1, . . . , zL). zC). zB, zC) = pθ∗ (x | zA, zB, zC) = pθ∗ (x | Proof. Let us utilize the same notation as in Proposition 1. Consider conditional independence, namely pθ∗ (x In other words, if we consider a corresponding graphi- | cal model, all the paths from zB to x should go through zC. Then, for any zA it holds that pθ∗ (x zA, zC). This can be proved by contradiction. If this is not true, then | there exists a path from zB to x, which does not go through zA or zC. Therefore, there exists a path from zB to x, which does not go through zC. This contradicts the initial assumption. In summary, we have shown that if zl and x are conditionally independent given (zl+1, . . . zL), then they are also conditionally independent given (zl, . . . zl−1, zl+1, . . . zL), which is the definition of the latent variable non-identifiability. To see that the opposite is false, consider the counter example in Figure 7. In this graphical model, zB and x are conditionally independent given zA, zC. Namely, all the paths from zB to x go through either zA or zC. However, if we are given only zC, there is still a path from zB to x (going through zA). Therefore, zB and x are not conditionally independent given zC. This implies that the latent variable non- identifiability does not imply conditional inde- ■ pendence. zC zB zA x Figure 7: Example of a graphical model where zB and x are conditionally independent given zA, zC (non-idetifiability). However, they are not condi- tionally independent given only zC, since there is an additional path from zB to x through zA. 13 C BACKGROUND OF DIFFUSION PROBABILISTIC MODELS Diffusion Probabilistic Models or Diffusion-based Deep Generative Models (Ho et al., 2020; Sohl- Dickstein et al., 2015) constitute a class of generative models that can be viewed as a special case of the Hierarchical VAEs (Huang et al., 2021; Kingma et al., 2021; Tomczak, 2022; Tzen & Raginsky, 2019). Denoting the last latent (context) zL y0 and auxiliary latent variables yt, t = 1, . . . , T , we define a generative model, also referred to as the backward (or reverse) process, as a Markov 0, I), that is: pγ(y0, . . . , yT ) = chain with Gaussian transitions starting with p(yT ) = | p(yT ) (cid:81)T (yt−1; μγ(yt, t), Σγ(yt, t)). yt) = (yT N ≡ t=0 pγ(yt−1 yt), where pγ(yt−1 | | N Let us further define αt = 1 can be seen as Gaussian linear models, we can analytically calculate the following distributions: i=0 αi. Since the conditionals in the forward diffusion − βt and αt = (cid:81)t q(yt−1 q(yt y0) = | yt, x0) = | √ N αt(1−αt−1) 1−αt N (yt; √αty0, (1 αt)I), (yt−1; ̃μ(yt, y0), ̃βtI), − (11) (12) yt, and ̃βt = 1−αt−1 1−αt βt. We can use (11) and (12) to √αt−1βt 1−αt where ̃μ(yt, y0) = define the variational lower bound as follows: Lvlb = Eq(y1|y0)[ln pγ(y0 y0 + (cid:124) (cid:123)(cid:122) −L0 y1)] | (cid:125) − DKL [q(yT (cid:124) y0) | (cid:123)(cid:122) LT p(yT )] ∥ (cid:125) (13) T (cid:88) t=2 − Eq(yt|y0)DKL [q(yt−1 | (cid:124) (cid:123)(cid:122) Lt−1 yt, y0) ∥ pγ(yt−1 . yt)] | (cid:125) Parameters γ of the diffusion model and parameters θ, φ of the hierarchical VAE are optimized simultaneously with the joint objective Eq. 7, where we use the lower bound (Eq. 13) instead of the ln pγ(f (x)) term. The conditional distribution over the context We assume that the context is a discrete random variable. Therefore, it is important to choose an appropriate family of conditional distributions pγ(y0 1, 1], and use the discretized (binned) Gaussian distribution: y1). Following Ho et al. (2020), we scale y0 linearly to [ | − pγ (y0 y1) = | D (cid:89) i=1 (cid:90) δ+(xi 0) δ−(xi 0) N (cid:0)x; μi γ (x1, 1) , σ2 1 (cid:1) dx, where D is the dimensionality of y0, and i denotes one coordinate of y0, and: (cid:26) δ+(x) = ∞ x + 1 b if x = 1 if x < 1 δ−(x) = (cid:26) −∞ x − 1 b if x = if x > , 1 1 − − where b is the bin width determined based on training data. (14) (15) 14 D CIFAR10 EXPERIMENTS In addition to the binary datasets, we perform experiments on natural images. We used the CIFAR10 dataset, which is a common benchmark in VAE literature. We report the results in n Table 5. We observe that our approach works on par with the generative models which have comparable sizes (OU-VAE, Residual Flows, GLOW). However, there are models with much larger sizes (e.g. VD- VAE, NVAE), which perform better. Unfortunately, we do not have the computational resources to train a comparable-size model. Instead, we compare the DCT-VAE with our implementation of the smaller-size VDVAE. Table 5: The test performance on CIFAR10 dataset. We compare the total number of trainable parameters (Size), the number of stochastic layers (L), and NLL. † Results with data augmentation. MODEL SIZE L BITS/DIM ≤ ↓ DCT-VAE (ours) Small VDVAE (our implementation) Attentive VAE (Apostolopoulou et al., 2022) VDVAE (Child, 2021) Residual flows (Perugachi-Diaz et al., 2021) i-DenseNet flows (Perugachi-Diaz et al., 2021) OU-VAE (Pervez & Gavves, 2021) CR-NVAE (Sinha & Dieng, 2021) NVAE (Vahdat & Kautz, 2020) BIVA (Maaløe et al., 2019) GLOW (Nalisnick et al., 2019) IAF-VAE (Kingma et al., 2016) 22M 29 21M 29 119M 16 39M 45 25M 1 25M 1 10M 3 131M 30 - 30 103M 15 - 1 - 12 3.26 3.28 2.79 2.87 3.28 3.25 3.39 2.51† 2.91 3.08 3.46 3.11 15 Figure 8: A diagram of the top-down hierarchical VAE with the context. The decoder consists of TopDown blocks (blue), which take as input features from the block above hDec l+1 and the features from the encoder hEnc l+1 (only during training). Dotted lines denote that zl is a sample from the prior (in the generative mode) or from the variational posterior (in the reconstruction mode). The context (in red) is added to the features of the decoder at the beginning of each scale. The encoder consists of ResNet blocks (green) We use the same ResNet blocks in the TopDown blocks. E MODEL DETAILS E.1 ARCHITECTURE We schematically depict the proposed deep hierarchical VAE in Figure 8. We extend the architecture presented in (Child, 2021) by using a deterministic, non-trainable function to create latent variable zL (the context). It is then used to train the prior pθ(zL), and to obtain ̃xcontext that is eventually passed to every level (scale) of the top-down decoder. 16 TopDown Block lhEncl+1hDecl+1hDeclqφ(zl|zl+1:L,x)pθ(zl|zl+1:L) ̃zlContext Block ̃xcontexthDecihDeciResNet Blockhi+1hiav.poolingconv1×1conv3×3conv3×3conv1×1conv1×1conv1×1TopDown 1Av. PoolingAv. PoolingUpsamplezLlnpθ(zL) ̃xcontextL−1...Upsample2...L−2 Table 6: Full list of hyperparameters. MNIST OMNIGLOT CIFAR10 VAE DCT-VAE VAE DCT-VAE VAE DCT-VAE AdamW Cosine 1e-3 1e-5 1e-2 600 1 100 0 1 128 AdamW Cosine 1e-3 1e-5 1e-2 600 1 100 0 1 128 142, 72. 4 × 4 × 8 1 142, 72. 4 × 3 × 142, 72. 4 × 4 × 142, 72. 4 × 3 × 8 1 6 6 × - × 1 32 40 FALSE SiLU Bernoulli 7 7 × × 1 32 40 FALSE SiLU Bernoulli AdamW Cosine 4e-4 5e-5 1e-2 8000 0.2 100 0 4 96 29 10 322, 10 3 × × × 162, 5 42, 1 82, × 12. × - 10 2 8 × × 3 10 322, × 162, 5 42, 1 82, × 12. × 6 6 × × 384 96 TRUE SiLU Discretized Logisitc Mixture 7 1 3 32 linear - - - - - 7 1 3 32 linear - - - - - 40 2 3 64 linear - - - - - - n o i t a z i m i t p O e r u t c e t i h c r A Optimizer Scheduler Starting Learning rate End Learning rate Weight Decay # Epochs Grad. Clipping Grad. Skipping Threshold EMA rate # GPUs Batch Size (per GPU) L Latent Sizes Latent Width Context Size # Channels (input) # Channels (hidden) Weight Norm Activation Likelihood r # Diffusion Steps o i r # Scales in UNet P # ResBlocks per Scale # Channels β schedule t x e t n o C E.2 HYPERPARAMETERS In Table 6, we report all the hyperparameter values that were used to train the baseline VAE and DCT-VAE. The context Prior We use the diffusion generative model as a prior over the context. As a back- bone, we use UNet implementation from (Dhariwal & Nichol, 2021) which is available on GitHub2 with the hyperparameters provided in Table 6. 2https://github.com/openai/guided-diffusion 17 F DOWNSAMPLING-BASED CONTEXT In this work, we propose a DCT-based context. However, downsampling can also be used to create a lower-dimensional representation of the input. Therefore, we conducted an ablation study where we used downsampled-based context. Results of this experiment can be found in Section 5.1. To create a downsampling-based context we use average pooling, as shown in Algorithm 3. Then, we can decode it back by simply using nearest-neighbours upsampling (Algorithm 4). Algorithm 3 Create context: downsampling Input: x, v zDownsample = Av. Pooling(x, v) zDownsample = quantize(zDownsample) Return: zDownsample Algorithm 4 Decode context: downsampling Input: zDownsample, D ▷ Apply nearest neighbour upsampling ̃xcontext = Upsampling(zDownsample, D) Return: ̃xcontext 18 G COMPRESSION To find out how much information about the data is preserved in the top latent variable, we conduct an experiment where we use the baseline VDVAE and the DCT-VAE pretrained on CIFAR10 for compression. We use the KODAK dataset, which is a standard compression benchmark containing 24 images with resolution 512 32, we independently encode 768. Since CIFAR10 images are 32 patches of KODAK images. We then reconstruct each patch using only a part of the latent variables and combine these patches to obtain final reconstructions. × × In Figure 9, we present non-cherry-picked reconstructions from the compression experiment. We use a single latent variable (only context) for DCT-VAE and two top latent variables for the baseline model. We sample the rest of the latent variables from the prior distribution with a temperature equal to 0.1. We also show images compressed with JPEG for comparison. We use PSNR and MSSSIM to measure the reconstruction error. We report KL-divergence converted to bits-per-pixel as a compression rate. All latent variables (except for the context in DCT-VAE) are continuous. 19 (a) VAE (b) DCT-VAE (c) JPEG Figure 9: Examples of the compressed images. We use 2 top latent variables of VDVAE to recon- struct the image in col. (a) and only context of DCT-VAE in col. (b). We choose JPEG compression to have a similar PSNR value to DCT-VAE (col. c). 20 PSNR=18.0,MSSSIM=0.36,BPP*=0.05PSNR=23.8,MSSSIM=0.80,BPP=0.17PSNR=23.9,MSSSIM=0.78,BPP=0.31PSNR=17.7,MSSSIM=0.35,BPP*=0.06PSNR=25.7,MSSSIM=0.79,BPP=0.17PSNR=27.7,MSSSIM=0.83,BPP=0.29PSNR=15.6,MSSSIM=0.27,BPP*=0.05PSNR=19.8,MSSSIM=0.75,BPP=0.19PSNR=18.7,MSSSIM=0.59,BPP=0.30PSNR=15.7,MSSSIM=0.29,BPP*=0.05PSNR=23.3,MSSSIM=0.83,BPP=0.20PSNR=22.9,MSSSIM=0.79,BPP=0.33PSNR=15.2,MSSSIM=0.35,BPP*=0.05PSNR=26.0,MSSSIM=0.79,BPP=0.15PSNR=26.3,MSSSIM=0.81,BPP=0.31PSNR=15.2,MSSSIM=0.38,BPP*=0.05PSNR=25.1,MSSSIM=0.84,BPP=0.19PSNR=26.6,MSSSIM=0.84,BPP=0.32 H ROBUSTNESS TO ADVERSARIAL ATTACKS In (Kuzina et al., 2022) it was shown that the top latent of deep hierarchical VAEs can be easily "fooled" by the most straightforward methods of attack construction, and thus, it could serve as a diagnostic tool to assess the robustness of the latent space. Here, we follow this line of thought to assess the robustness of the DCT-VAE. For each dataset, we use 50 test points (5 different random initializations) to construct latent space attacks on the VDVAE and the DCT-VAE. In Figure 10, we present the average similarity between the real reconstruction and the attacked reconstruction measured by MSSSIM depending on the latent layers under attack. In all cases, we see a clear advantage in using the DCT-based context. For MNIST and CIFAR10, the DCT-VAE provides much better robustness for the two latent layers under attack. In general, the DCT-VAE seems to be less affected by adversarial attacks than the VDVAE. (a) MNIST (b) OMNIGLOT (c) CIFAR10 Figure 10: The adversarial robustness measured by MSSSIM. 21 2468LatentLayersUnderAttack0.50.60.70.80.9MSSSIMVDVAEDCT-VAE2468LatentLayersUnderAttack0.70.80.9MSSSIMVDVAEDCT-VAE246810LatentLayersUnderAttack0.10.20.30.40.50.6MSSSIMVDVAEDCT-VAE
http://arxiv.org/abs/2302.09967v1
2023-02-20T13:25:23
2023-02-20T13:25:23
Stability-based Generalization Analysis for Mixtures of Pointwise and Pairwise Learning
Recently, some mixture algorithms of pointwise and pairwise learning (PPL) have been formulated by employing the hybrid error metric of "pointwise loss + pairwise loss" and have shown empirical effectiveness on feature selection, ranking and recommendation tasks. However, to the best of our knowledge, the learning theory foundation of PPL has not been touched in the existing works. In this paper, we try to fill this theoretical gap by investigating the generalization properties of PPL. After extending the definitions of algorithmic stability to the PPL setting, we establish the high-probability generalization bounds for uniformly stable PPL algorithms. Moreover, explicit convergence rates of stochastic gradient descent (SGD) and regularized risk minimization (RRM) for PPL are stated by developing the stability analysis technique of pairwise learning. In addition, the refined generalization bounds of PPL are obtained by replacing uniform stability with on-average stability.
[ "Jiahuan Wang", "Jun Chen", "Hong Chen", "Bin Gu", "Weifu Li", "Xin Tang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09967v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09967v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 7 6 9 9 0 . 2 0 3 2 : v i X r a Stability-based Generalization Analysis for Mixtures of Pointwise and Pairwise Learning Jiahuan Wang1, Jun Chen2, Hong Chen1, 3, 4,*, Bin Gu5, Weifu Li1, 3, 4, Xin Tang6 1College of Science, Huazhong Agricultural University, Wuhan 430070, China 2College of Informatics, Huazhong Agricultural University, Wuhan 430070, China 3Engineering Research Center of Intelligent Technology for Agriculture, Ministry of Education, Wuhan 430070, China 4Key Laboratory of Smart Farming for Agricultural Animals, Wuhan 430070, China 5Mohamed bin Zayed University of Artificial Intelligence, Abu Dhabi, UAE 6Ping An Property & Casualty Insurance Company, Shenzhen, China [email protected] Abstract Recently, some mixture algorithms of pointwise and pair- wise learning (PPL) have been formulated by employing the hybrid error metric of "pointwise loss + pairwise loss" and have shown empirical effectiveness on feature selection, ranking and recommendation tasks. However, to the best of our knowledge, the learning theory foundation of PPL has not been touched in the existing works. In this paper, we try to fill this theoretical gap by investigating the generalization prop- erties of PPL. After extending the definitions of algorithmic stability to the PPL setting, we establish the high-probability generalization bounds for uniformly stable PPL algorithms. Moreover, explicit convergence rates of stochastic gradient descent (SGD) and regularized risk minimization (RRM) for PPL are stated by developing the stability analysis technique of pairwise learning. In addition, the refined generalization bounds of PPL are obtained by replacing uniform stability with on-average stability. Introduction There are mainly two paradigms to formulate machine learn- ing systems including pointwise learning and pairwise learn- ing. Usually, the former aims to train models under the error metric associated with single sample, while the latter con- cerns the relative relationships between objects measured by the loss related to the pair of samples. Besides wide appli- cations, the theoretical foundations of the above paradigms have been well established from the viewpoint of statistical learning theory, e.g., pointwise stability analysis (Bousquet and Elisseeff 2002; London, Huang, and Getoor 2016; Sun, Li, and Wang 2021), pairwise stability analysis (Agarwal and Niyogi 2009; Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021), and uniform convergence analysis (Cl ́emenc ̧on, Lugosi, and Vayatis 2008; Rejchel 2012; Cao, Guo, and Ying 2016; Ying, Wen, and Lyu 2016; Ying and Zhou 2016). It is well known that pointwise (or pairwise) learning en- joys certain advantages and limitations for real-world data analysis. For the same number of samples, pointwise learn- ing has computation feasibility due to its low model com- *Corresponding author. Copyright © 2023, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. plexity, while pairwise learning can mine valuable informa- tion in terms of the intrinsic relationship among samples. As illustrated by Wang et al. (2016), the degraded performance may occur for the pointwise learning with the ambiguity of some labels and for the pairwise learning as samples in dif- ferent categories have similar features. Therefore, it is natu- ral to consider the middle modality of the above paradigms to alleviate their drawbacks. Along this line, some learning algorithms have been proposed under the pointwise and pair- wise learning (PPL) framework, where the pointwise loss and the pairwise loss are employed jointly (Liu and Zhang 2015; Wang et al. 2016; Lei et al. 2017; Zhuo et al. 2022; Wang et al. 2022a). In PPL, its pointwise part concerns the fitting ability to empirical observations and its pairwise part addresses the stability or robustness of learning models (Liu and Zhang 2015). While the studies on algorithmic design and applications are increasing, there are far fewer results to investigate the generalization ability of PPL in theory. As one of the main routines of learning theory analy- sis, the algorithmic stability tools have advantages in some aspects, such as dimensional independence and adaptivity for broad learning paradigms (Bousquet and Elisseeff 2002; Shalev-Shwartz et al. 2010; Hardt, Recht, and Singer 2016; Feldman and Vondrak 2018, 2019). Specially, the stability and generalization have been well understood recently for stochastic gradient descent (SGD) and regularized risk min- imization (RRM) under both the pointwise learning (Hardt, Recht, and Singer 2016; Lei and Ying 2020) and the pairwise learning setting (Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021). Inspired by the recent progress, in this paper, we try to fill this theoretical gap of PPL by establishing its generalization bounds in terms of the algorithmic stability technique. To the best of our knowledge, this is the first the- oretical understanding of generalization properties for PPL. The main work of this paper is two-fold: One is to es- tablish a relationship between uniform stability and estima- tion error for the mixture setting, which can be considered as natural extension of the related results in (Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021). The other is to char- acterize the stability-based generalization bounds for some PPL algorithms (i.e. SGD and RRM) under mild conditions. Objective function Reference Optimization Application Generalization analysis Pointwise loss +Pairwise loss +Regularization Liu and Zhang (2015) ACG Feature Selection Wang et al. (2016) ADMM Image Classification Lei et al. (2017) Wang et al. (2022a) SGD SGD Ranking Recommendation No No No No Table 1: Summary of pointwise and pairwise learning (ACG: Accelerated Proximal Gradient; ADMM: Alternating Direction Method of Multipliers). Related Work To better evaluate our theoretical results, we review the re- lated works on PPL and generalization analysis. Pointwise and pairwise learning (PPL). In recent years, some algorithms of PPL have been designed for learning tasks such as feature selection, image classification, ranking, and recommendation systems. Liu and Zhang (2015) pro- posed a pairwise constraint-guided sparse learning method for feature selection, where the pairwise constraint is used for improving robustness. For image classification tasks, Wang et al. (2016) designed a novel joint framework, called pointwise and pairwise image label prediction, to predict both pointwise and pairwise labels and achieved superior performance. For emphasis selection tasks, Huang et al. (2020) employed a pointwise regression loss and a pairwise ranking loss simultaneously to fit models. Recently, Lei et al. (2017) proposed an alternating pointwise-pairwise ranking to improve decision performance. Zhuo et al. (2022) and Wang et al. (2022a) formulated hybrid learning models for the recommendation systems. Although the empirical effec- tiveness has been validated for the above PPL algorithms, their theoretical foundations (e.g., generalization guarantee) have not been investigated before. To further highlight the gap in generalization analysis, we summarize the basic prop- erties of PPL models in Table 1. Generalization analysis. From the viewpoint of statisti- cal learning theory, generalization analysis is crucial since it provides the statistical theory support for the empirical performance of trained models. Usually, model training is a process of calculating loss based on data and then seeking an optimal function in the predetermined hypothetical function space through an optimization algorithm. Naturally, the gen- eralization performance of learning systems can be investi- gated from the perspectives of hypothetical function space (Smale and Zhou 2007; Yin, Kannan, and Bartlett 2019; Lei and Tang 2021; Wang et al. 2020) and data (Bousquet and Elisseeff 2002; Elisseeff et al. 2005; Shalev-Shwartz et al. 2010), respectively. The former is often called uniform con- vergence analysis and the latter is realized by stability anal- ysis. In essential, the uniform convergence analysis consid- ers the capacity of hypothesis space (e.g., via VC-dimension (Vapnik, Levin, and Le Cun 1994), covering numbers (Zhou 2002; Chen et al. 2017, 2021), Rademacher complexity (Yin, Kannan, and Bartlett 2019)), while the stability analy- sis concerns the change of model parameters caused by the change of training data (Bousquet and Elisseeff 2002; Lei, Liu, and Ying 2021). Algorithmic stability has shown re- markable effectiveness in deriving dimension-independent generalization bounds for wide learning frameworks. A clas- sic framework for stability analysis is developed by Bous- quet and Elisseeff (2002), in which the uniform stability and hypothesis stability are introduced. Subsequently, the uniform stability measure was extended to study stochastic algorithms (Elisseeff et al. 2005; Hardt, Recht, and Singer 2016) and inspired several other stability concepts including uniform argument stability (Liu et al. 2017), locally elastic stability (Deng, He, and Su 2021), on-average loss stability (Lei, Ledent, and Kloft 2020; Lei and Ying 2020; Lei, Liu, and Ying 2021) and on-average argument stability (Shalev- Shwartz et al. 2010; Lei, Liu, and Ying 2021). From the lens of learning paradigms, generalization guar- antees have been established for various pointwise learning algorithms (Bousquet and Elisseeff 2002; London, Huang, and Getoor 2016; Hardt, Recht, and Singer 2016; Lei and Ying 2020; Sun, Li, and Wang 2021; Klochkov and Zhivo- tovskiy 2021) and pairwise learning models (Agarwal and Niyogi 2009; Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021; Yang et al. 2021). Therefore, it is natural to ex- plore the generalization properties of PPL by the means of the stability analysis technique. Preliminaries This section introduces the problem formulation of PPL and the definitions of algorithmic stability. Pointwise and Pairwise Learning Consider a training dataset S := {zi}n i=1, where each zi is independently drawn from a probability measure ρ defined over a sample space Z = X × Y. Here, X ⊂ Rd is an input space of dimension d and Y ⊂ R is an output space. Let W be a given parameter space of learning models. The goal of pointwise learning is to find a parameter w based model such that the population risk (or expected risk), defined as Rpoint(w) = Ez[f (w; z)], is as small as possible, where f : W × Z → [0, ∞) is a pointwise loss and Ez denotes the expectation with respect to z ∼ ρ. For brevity, we also use w to denote the parameter w based model in the sequel. However, we can't get the minimizer of Rpoint(w) di- rectly since the intrinsic distribution ρ is unknown. As a nat- ural surrogate, for algorithmic design, we often consider the corresponding empirical risk defined as Rpoint S (w) = n (cid:88) f (w; zi) . 1 n i=1 Unlike the pointwise learning, the pairwise learning model w is measured by Rpair(w) = Ez, ̃z[g(w; z, ̃z)], where g : W × Z × Z → [0, ∞) is a pairwise loss function and Ez, ̃z denotes the expectation with respect to z, ̃z ∼ ρ. In pairwise learning models, Rpair(w) is approximately char- acterized by the empirical risk Rpair S (w) = 1 n(n − 1) (cid:88) g (w; zi, zj) , i,j∈[n]:i(cid:54)=j where zi, zj ∼ ρ and [n] := {1, . . . , n}. In this paper, we consider a mixture paradigm of point- wise learning and pairwise learning, called pointwise and pairwise learning (PPL). The population risk of w in PPL is R(w) = τ Rpoint(w) + (1 − τ )Rpair(w), where τ ∈ [0, 1] is a tuning parameter. Given training set S, the corresponding empirical version of R(w) is S S (w). RS(w) = τ Rpoint (w) + (1 − τ )Rpair (1) For brevity, A(S) denotes the derived model by apply- ing algorithm A (e.g., SGD and RRM) on S. In the process of training and adjustment of parameters, the output model A(S) can be a small empirical risk since we often can fit training examples perfectly. However, the empirical effec- tiveness of A(S) can not assure the small population risk. In statistical learning theory, the difference between the popu- lation risk and empirical risk R(w) − RS(w) (2) is called the generalization error of learning model w. It is key concern of this paper to bound this gap in theory. Algorithmic stability Algorithmic stability is an important concept in statistical learning, which measures the sensitivity of an algorithm to the perturbation of training sets. This paper focuses on the analysis techniques associated with the algorithmic uniform stability (Bousquet and Elisseeff 2002; Elisseeff et al. 2005; Agarwal and Niyogi 2009; Hardt, Recht, and Singer 2016), on-average loss stability (Lei, Ledent, and Kloft 2020; Lei and Ying 2020; Lei, Liu, and Ying 2021), and on-average argument stability (Shalev-Shwartz et al. 2010; Lei, Liu, and Ying 2021). To match the generalization analysis of PPL algorithms, we firstly extend the definitions of algorithmic stability (e.g., the pointwise uniform stability (Bousquet and Elisseeff 2002) and pairwise uniform stability (Lei, Ledent, and Kloft 2020)) to the PPL setting. Let S = {z1, . . . , zn} and S(cid:48) = {z(cid:48) 1, . . . , z(cid:48) n} be indepen- dently drawn from ρ. For any i < j, i, j ∈ [n], denote Si = {z1, . . . , zi−1, z(cid:48) i, zi+1, . . . , zn} (3) and Si,j = (cid:8)z1, . . . , zi−1, z(cid:48) i, zi+1, . . . , zj−1, z(cid:48) j, zj+1, . . . , zn (cid:9) . (4) Definition 1. (PPL Uniform Stability). Assume that f (*; z) is a pointwise loss function and g(*; z, ̃z) is a pairwise loss function. We say A : Z n (cid:55)→ W is PPL γ-uniformly stable, if for any training datasets S, Si ∈ Z n max {Upoint, Upair} ≤ γ, ∀i ∈ [n], where Upoint = supz∈Z |f (A(S); z) − f (A (Si) ; z)| and Upair = supz, ̃z∈Z |g(A(S); z, ̃z) − g (A (Si) ; z, ̃z)|. Remark 1. Denote (cid:96)(A(Si); z, ̃z) := τ f (A(Si); z) + (1 − τ )g(A(Si); z, ̃z) for simplicity, and call it as the PPL loss function. Then, we can define the weaker stability measure by replacing the maximum in Definition 1 with sup z, ̃z∈Z |(cid:96)(A(S); z, ̃z) − (cid:96) (A (Si) ; z, ̃z)| ≤ γ. Following the mixture stability associated with τ , we can also get the similar generalization results as Theorems 1 and 2 in the next section. We then introduce the definitions of PPL on-average loss stability and PPL on-average argument stability described as follows. Definition 2. (PPL On-average Loss Stability). Let f (*; z) be a pointwise loss function and let g(*; z, ̃z) be a pairwise loss function. We say A : Z n (cid:55)→ W is PPL γ-on-average loss stable if, for any training datasets S, Si, Si,j ∈ Z n, max {Vpoint, Vpair} ≤ γ, ∀i < j ∈ [n], where Vpoint = 1 n (cid:88) i∈[n] ES,S(cid:48) [f (A (Si) ; zi) − f (A(S); zi)] and Vpair = (cid:80) i,j∈[n] ES,S(cid:48) [g (A (Si,j) ; zi, zj) − g (A(S); zi, zj)] n(n − 1) . Remark 2. Definition 2 is built by combining the on- average loss stability for pointwise learning (Shalev- Shwartz et al. 2010; Lei and Ying 2020) with the one for pairwise learning (Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021). The requirement of PPL on-average loss stabil- ity is milder than the PPL uniform stability, where the sta- bilization is not measured by the changes of all samples but the mean of training sets. Definition 3. (PPL On-average Argument Stability). We say A : Z n (cid:55)→ W is PPL (cid:96)1 γ-on-average argument stable if, for any training datasets S, Si ∈ Z n, max {ES,S(cid:48),A[Hpoint], ES,S(cid:48),A[Hpair]} ≤ γ, (5) where Hpoint = 1 n (cid:80) (cid:80)n i=1 (cid:107)A(S) − A(Si)(cid:107)2 and Hpair = i,j∈[n]:i(cid:54)=j (cid:107)A(S) − A(Si,j)(cid:107)2. 1 n(n−1) We say A is PPL (cid:96)2 γ-on-average argument stable if, for any training datasets S, Si ∈ Z n, ES,S(cid:48),A (cid:104) 1 n n (cid:88) i=1 (cid:107)A(S) − A(Si)(cid:107)2 2 (cid:105) ≤ γ2. Remark 3. The (cid:96)2 on-average argument stability of PPL is similar with that of pointwise learning (Lei and Ying 2020) and pairwise learning (Lei, Liu, and Ying 2021). Differently from Definition 1, which relied on the drift of loss functions, Definition 2, 3 measures the stability in terms of the changes of the model A(S). Main Results In this section, we present our main results on the general- ization bounds of PPL algorithms based on uniform stability and on-average stability. Uniform stability-based generalization This subsection establishes the relationship between the gen- eralization ability and the uniform stability for PPL. In the sequel, e represents the base of the natural logarithm, (cid:100)a(cid:101) means the smallest integer which is no less than a. Supple- mentary Material B.1 provides the detailed proof of the fol- lowing theorem. Theorem 1. Let A : Z n (cid:55)→ W be PPL γ-uniformly stable. Assume that max z, ̃z∈Z {|ES[f (A(S); z)]| , |ES[g(A(S); z, ̃z)]|} ≤ M for some positive constant M . Then, for all τ ∈ [0, 1] and δ ∈ (0, 1/e), we have, with probability 1 − δ, |RS(A(S)) − R(A(S))| ≤(4 − 2τ )γ + e √ (cid:16) 4M (4 − 3τ )n− 1 2 (cid:112)log(e/δ) (cid:17) + 24 2(2 − τ )γ (cid:100)log2(n)(cid:101) log(e/δ) . Remark 4. Theorem 1 is a high-probability generalization bound for uniformly stable PPL algorithms, motivated by the recent analyses in the pointwise learning (Hardt, Recht, and Singer 2016) and the pairwise learning (Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021). Similar to Lei, Ledent, and Kloft (2020), the error estimations of the point- wise part and the pairwise part of PPL are obtained by ap- plying and developing the concentration inequality (Bous- quet, Klochkov, and Zhivotovskiy 2020). Ignoring the con- stants (e.g. M , τ , log(e/δ)), we can get the convergence or- der O(n− 1 2 + γ log2 n) from Theorem 1. Due the generality and flexibility of PPL induced by τ ∈ [0, 1], the derived con- nection, between uniform stability and generalization, con- tains the previous results for pairwise learning (Lei, Ledent, and Kloft 2020) as special example. Remark 5. To better understand the stability-based gener- alization bound, we summarize the main results about the relationships between generalization and various definitions of algorithmic stability in Table 2. In this table, for feasibil- ity, we denote the generalization error as Gen := R(A(S)) − RS(A(S)) and denote the expected generalization error as EGen := ES,A[R(A(S)) − RS(A(S))]. Table 2 demonstrates our characterized relations are com- parable with the existing results. Generalization bounds of SGD for PPL As a popular computing strategy, SGD has been employed for PPL as shown in Table 1. The SGD for PPL can be re- garded as an elastic net version of pointwise SGD and pair- wise SGD, which involves the gradients of the pointwise loss function f and the pairwise loss function g. At the t-th iter- ation, (it, jt) is taken from the uniform distribution over [n] randomly, which requires it (cid:54)= jt. The SGD for the PPL model is updated by wt+1 = wt−ηt (τ ∇f (wt; zit) + (1 − τ )∇g (wt; zit, zjt)) , (6) where {ηt}t is a step size sequence, and ∇f (wt; zit) and ∇g (wt; zit, zjt) denote the subgradients of f (*; zit) and g (*; zit, zjt) at wt, respectively. To bound the gradient update process of SGD, it is neces- sary to presume some properties of the loss functions. For brevity, we just recall some conditions for pointwise loss function (Hardt, Recht, and Singer 2016; Lei and Ying 2020) since the definitions of pairwise setting are analogous. Definition 4. A loss function f : W × Z → [0, ∞) is σ- strongly convex if f (u) ≥ f (v) + (cid:104)∇f (v), u − v(cid:105) + Specially, f is convex if σ = 0. σ 2 (cid:107)u − v(cid:107)2 2, ∀u, v ∈ W. Clearly, a strongly convex loss function must be convex, but the contrary may not be true. It is well known that con- vexity is crucial for some optimization analyses of learn- ing algorithms (Hardt, Recht, and Singer 2016; Harvey et al. 2019). Definition 5. A loss function f : W × Z → [0, ∞) is L- Lipschitz if |f (u) − f (v)| ≤ L(cid:107)u − v(cid:107)2, ∀u, v ∈ W. The above inequality is equivalent to the gradient bound- edness of f , i.e. (cid:107)∇f (x)(cid:107)2 ≤ L. Thus, the L-Lipschitz con- tinuity assures the boundedness of the gradient update. Definition 6. A loss function f : W × Z → [0, ∞) is β- smooth if (cid:107)∇f (u) − ∇f (v)(cid:107)2 ≤ β(cid:107)u − v(cid:107)2, ∀u, v ∈ W. Following the steps in (Hardt, Recht, and Singer 2016; Lei, Ledent, and Kloft 2020), we can verify that the gradient update is non-expansive when f is convex and β-smooth. Now we present the generalization bounds of SGD for PPL. The proof is given in Supplementary Material B.2. Theorem 2. Suppose for any z, ̃z ∈ Z, f (w; z) and g (w; z, ̃z) are convex, β-smooth and L-Lipschitz with re- spect to w ∈ W. Without loss of generality, let S and S(cid:48) be different only in the last example. If ηt ≤ 2/β, then SGD for PPL with t iterations is PPL γ-uniformly stable with γ ≤ 2L2 t (cid:88) k=1 ηkI [ik = n] + 2L2(1 − τ ) t (cid:88) k=1 ηkI [jk = n] , (7) Type Reference Algorithmic stability (γ) Bousquet and Elisseeff (2002) Uniform Stability Bousquet and Elisseeff (2002) Hypothesis Stability Shalev-Shwartz et al. (2010) On-average Stability Hardt, Recht, and Singer (2016) Uniform Stability Feldman and Vondrak (2018) Feldman and Vondrak (2019) Uniform Stability Uniform Stability Relationship EGen ≤ γ. √ Gen = O( γ). EGen ≤ γ. EGen ≤ γ. √ Gen = O( γ + n− 1 γ(log2 n)2 + n− 1 2 ). 2 (cid:16) (cid:17) . Gen = O Lei and Ying (2020) On-average Stability EGen ≤ Lγ. Lei, Ledent, and Kloft (2020) Uniform Stability Lei, Liu, and Ying (2021) (cid:96)1 On-average Argument Stability Lei, Liu, and Ying (2021) (cid:96)2 On-average Argument Stability Ours (Theorem 1) Uniform Stability Ours (Theorem 4) On-average Loss Stability Ours (Corollary 2) (cid:96)1 On-average Argument Stability Ours (Theorem 5) (cid:96)2 On-average Argument Stability Gen = 4γ + O(n− 1 2 + γ log2 n). EGen = O(γ2 + γ/n). EGen = O(γ2 + γ/ n). √ Gen = (4 − 2τ )γ + O((4 − 3τ )n− 1 2 +(2 − τ )γ log2 n). EGen ≤ γ. EGen ≤ Lγ. EGen = O( 1 γ + (2 − 3 2 τ )γ). Pointwise Learning Pairwise Learning PPL Table 2: Summary of stability-based generalization bounds (γ-stability parameter; Gen-generalization error; EGen-expected generalization error). where I[*] is the indicator function. Let {wt}, {w(cid:48) t} be gen- erated by SGD on S and S(cid:48) with ηt = η. Then, for all δ ∈ (0, 1/e), the following inequality holds with probability 1 − δ (cid:13) (cid:13)wt+1 − w(cid:48) ≤2Lη(2 − τ ) t+1 (cid:16) t n (cid:13) (cid:13)2 (cid:17) + log(1/δ) + (cid:112)2n−1t log(1/δ) . Theorem 2 characterizes the impact of the change of train- ing set on the training loss and the model parameter, which extends the previous related results of pointwise (or pair- wise) SGD to the general PPL setting. We now apply Theorem 1 with A(S) = wT where T is the index of the last iteration and the uniform stability bounds in (7) to derive the following result. Corollary 1. Suppose that f (w; z) and g (w; z, ̃z) are con- vex, β-smooth and L-Lipschitz with respect to w, and {|ES[f (wT ; z)]| , |ES[g(wT ; z, ̃z)]|} ≤ M max z, ̃z∈Z for some positive constant M , where wT is produced by SGD (6) at T -th iteration with ηt ≡ c/ T ≤ 2/β. Then, for any δ ∈ (0, 1/e), the following inequality holds with probability 1 − δ √ |RS(wT ) − R(wT )| = O (cid:115) (cid:16) √ T n + log2 n log( (cid:16) +O T − 1 2 log2 n log2( ) + n− 1 2 log2 n log 3 2 ( log( 1 δ ) n 1 δ Remark 6. Let w∗ R = arg min w∈W R(w). (8) −RS(w∗ The excess risk of SGD for PPL is defined as R(wT ) − R(w∗ R) = [R(wT ) − RS(wT )] + [RS(wT ) R) − R(w∗ R)] + [RS(w∗ R)] , where the first term and the second term of right side are called estimation error (or generalization error) and opti- mization error, respectively. Theorem 3 provides the upper bound of the first term and the results of (Harvey et al. 2019) imply the bound O(T − 1 2 log2 T ) for the optimization error. R) − R(w∗ For the third term RS(w∗ R), we can bound it by Bernstein's inequality. When T = O(n), with probability 1 − δ we have R(wT ) − R(w∗ R) = O(n− 1 2 log2 n), which is comparable with the convergence analysis of SGD for pairwise learning (Lei, Ledent, and Kloft 2020). Generalization bounds of RRM for PPL Let r : W → [0, ∞) be a regularization term for achieving sparsity or preventing over-fitting of learning algorithms as- sociated with RS(w) defined in (1). The RRM for PPL aims to search the mininizer of (cid:17) ) FS(w) := RS(w) + r(w) over w ∈ W. Let . w∗ = arg min w∈W [R(w) + r(w)] (cid:17) ) 1 δ 1 δ (9) (10) and Remark 7. Note that the excess risk A(S) = arg min w∈W FS(w). (11) R(A(S)) − R(w∗ R) We can verify the uniform stability of PPL with a strongly convex loss function, which is proved in Supplementary Ma- terial B.3. Lemma 1. Assume that A is defined by (11). Suppose FS is σ-strongly convex and the pointwise loss function f (*; z) and pairwise loss function g (*; z, ̃z) are both L-Lipschitz. Then, A is 4L2 nσ (2 − τ )-uniformly stable. The following lemma shows the distance between the em- pirical optimal solution (the best algorithm learned in the training set) and the theoretically optimal solution in expec- tation. Lemma 2. Assume that FS is σ-strongly convex. If the al- gorithm A defined in (11) is PPL γ-uniformly stable, then ES (cid:107)A(S) − w∗(cid:107)2 2 ≤ 4γ(2 − τ )/σ. A mixed version of Bernstein's inequality from (Hoeffd- ing 1963; Pitcan 2017; Lei, Ledent, and Kloft 2020) is also introduced here, which is used in our error analysis. Lemma 3. Assume that {f (w∗; z), g(w∗; z, ̃z)} ≥ 0, min z, ̃z∈Z max z, ̃z∈Z for some constants b, θ > 0, and {f (w∗; z), g(w∗; z, ̃z)} ≤ b max{V ar[f (w∗; Z)], V ar[g(w∗; Z, ̃Z)]} ≤ θ, where V ar(a) denotes the variance of a and w∗ is defined by (10). Then, for any δ ∈ (0, 1), with probability at least 1 − δ we have (cid:12)R(w∗) − RS(w∗)(cid:12) (cid:12) 2(1 − τ )b log(1/δ) 3(cid:98)n/2(cid:99) 2τ b log(1/δ) 3(cid:98)n(cid:99) (cid:12) ≤ + +(1 − τ ) (cid:115) 2θ log(1/δ) (cid:98)n/2(cid:99) + τ (cid:115) 2θ log(1/δ) (cid:98)n(cid:99) , where (cid:98)a(cid:99) is the biggest integer no more than a. Next, we firstly derive the upper bounds of the pointwise loss function and the pairwise loss function, and then apply Theorem 1 to get the generalization bounds for PPL with strongly convex objective functions. Theorem 3. Assume that FS(w) is σ-strongly convex, f (*; z) and g (*; z, ̃z) are both L-Lipschitz. Under the as- sumptions of Lemma 3, for the RRM algorithm A defined by (11) and any δ ∈ (0, 1/e), with probability 1 − δ we have |RS(A(S)) − R(A(S))| ≤ 2b log(1/δ) 3(cid:98)n(cid:99) (cid:18) 16L2 nσ + e √ 96 2L2 + nσ (cid:115) + 2θ log(1/δ) (cid:98)n(cid:99) + 8L2 nσ (2 − τ )2 (2 − τ )(4 − 3τ )(cid:112)log(e/δ) (2 − τ )2 (cid:100)log2(n)(cid:101) log(e/δ) . (cid:33) = [R(A(S)) − RS(A(S))] + [RS(A(S) − RS(w∗ R)] R) − R(w∗ = [R(A(S)) − RS(A(S))] + [RS(w∗ + [RS(w∗ R)] R)] + [FS(A(S) − FS(w∗ R)] + r(w∗ ≤ [R(A(S)) − RS(A(S))] + [RS(w∗ R) − R(w∗ R) − r(A(S)) R) − R(w∗ R)] + r(w∗ R) − r(A(S)), where w∗ strategy of Theorem 4, we derive R is defined by (8). Following the similar proof RS(w∗ R) − R(w∗ R) = O (cid:32) log(1/δ) √ n + (cid:33) (cid:114) θ log(1/δ) n with probability 1 − δ. When r(w∗ O(n− 1 2 ), and R) = O(σ(cid:107)w∗ R(cid:107)2 2), σ = max{sup z (f (w∗ R; z)) , sup z, ̃z (g(w∗ R; z, ̃z))} = O( √ n), we have R(A(S)) − R(w∗ R) = O (cid:16) n− 1 2 log2 n log(1/δ) (cid:17) with probability 1 − δ based on Theorem 3 and the above decomposition of excess risk. Remark 8. We now apply Theorem 3 to the pairwise constraint-guided sparse model (Liu and Zhang 2015), which is inspired from the (cid:96)1-penalty and (cid:96)2,1-penalty used in Lasso (Tibshirani 2011) and its variants (Zou 2006; Yuan and Lin 2006; Simon et al. 2013; Friedman, Hastie, and Tib- shirani 2010). The optimization objective of (Liu and Zhang 2015) can be formulated as 1 n (cid:88) i∈[n] f (w; zi)+ λ1 n(n − 1) (cid:88) i,j∈[n]:i(cid:54)=j g (w; zi, zj)+λ2(cid:107)w(cid:107)1, where f (w; zi) is the general least square loss and the pair- wise part is measured by (cid:88) (wT xi −wT xj)2 −λ3 (cid:88) (wT xi −wT xj)2. (xi,xj )∈M (xi,xj )∈C Here, M and C denote the must-link set and the cannot-link set respectively, and λ1, λ2, λ3 are tuneable parameters. It is straightforward to verify that the above objective func- tion is strongly-convex and Lipschitz. Therefore, our theoret- ical analysis provides the generalization bounds of the PPL model (Liu and Zhang 2015). Optimistic generalization bounds This subsection further investigates the refined generaliza- tion bounds with the help of on-average loss stability in Def- inition 2 and on-average argument stability in Definition 3. The related proofs can be found in Supplementary Material B.4. Theorem 4. If A is PPL γ-on-average loss stable, then ES[R(A(S)) − RS(A(S))] ≤ γ. (cid:105)(cid:17) (A(S)) we get the fast convergence rate ES[R(A(S))] − R(w∗ R) = O (cid:18) (cid:107)w∗ R(cid:107)2 2 n (cid:19) . As illustrated in Table 2, this quantitative relation is con- sistent with the previous results for pointwise learning (Lei and Ying 2020) and pairwise learning (Lei, Liu, and Ying 2021). A similar result for (cid:96)1 on-average argument stability is stated as follows. Corollary 2. Assume that A is PPL (cid:96)1 γ-on-average ar- gument stable. If the pointwise loss function f (w; z) and the pairwise loss function g(w; z, ̃z) are L-Lipschitz with respect to w, then ES,A[R(A(S)) − RS(A(S))] ≤ Lγ. For completeness, we introduce the following result of (cid:96)2 on-average argument stability, which is a natural extension of Theorem 2 part (b) (Lei and Ying 2020) and Theorem 1 (Lei, Liu, and Ying 2021), and removes the requirement on the L-Lipschitz condition of loss functions for PPL. Theorem 5. (Lei and Ying 2020; Lei, Liu, and Ying 2021) Let A be PPL (cid:96)2 γ-on-average argument stable and (cid:15) > 0. If f (w; z) and g(w; z, ̃z) are nonnegative and β-smooth with respect to w, then ES,A[R(A(S)) − RS(A(S))] β γ (cid:16) ES,A (cid:104) τ Rpoint S (cid:18) ≤ + (β + (cid:15))γ 2 − (cid:19) . 3 2 τ (A(S)) + (1 − τ )Rpair S In the expectation viewpoint, the generalization error can be bounded by the empirical risk and the drift of model pa- rameters induced by the changes of training data, which is illustrated in the following lemma. Lemma 4. Assume that the pointwise loss function f (w; z) and the pairwise loss function g(w; z, ̃z) are β-smooth with respect to w. Let (cid:15) > 0 and τ ∈ [0, 1]. Then, E [R(A(S)) − RS(A(S))] βτ E (A(S)) Rpoint S (cid:104) (cid:105) β(1 − τ )E ≤ (cid:15) ((cid:15) + β) n + (cid:18) 2 − 3 2 τ + (cid:19) n (cid:88) (cid:104) E i=1 (cid:104) Rpair S (cid:105) (A(S)) (cid:15) (cid:107)A (Si) − A(S)(cid:107)2 2 (cid:105) . the pointwise loss function Theorem 6. Assume that f (w; z) and the pairwise loss function g(w; z, ̃z) are β- smooth with respect to the first argument. Suppose A is de- fined by (11) and w∗ is defined by (10). If FS is σ-strongly convex and β ≤ σn/4(2 − τ ), then ES[F (A(S))] − F (w∗) ≤ES[R(A(S)) − RS(A(S))] βτ E (cid:104) Rpoint S (cid:105) (A(S)) β(1 − τ )E (cid:104) Rpair S (cid:105) (A(S)) (cid:15) 384τ 2((cid:15) + β)β σ2n2 + (cid:18) 2 − τ 3 2 (cid:18) ≤ + + (cid:19) (cid:104) E (cid:15) Rpoint S (A(S)) (cid:105) 768(1 − τ )2((cid:15) + β)β σ2n2 2 − (cid:19) 3 2 τ E (cid:104) Rpair S (cid:105) (A(S)) . Remark 9. If r(w) = O (cid:0)σ(cid:107)w(cid:107)2 2 (cid:1), we can get ES[R(A(S))] − R(w∗ R) R) + Rpair(w∗ R) (cid:18) Rpoint(w∗ =O nσ (cid:19) + O (cid:0)(n−1 + σ)(cid:107)w∗ R(cid:107)2 2 (cid:1) , where w∗ R is defined by (8). Furthermore, taking σ = max (cid:115) (cid:40) 12β n , Rpoint(w∗ R) + Rpair(w∗ R) R(cid:107)2 n(cid:107)w∗ 2 (cid:41) , we can conclude that ES[R(A(S))] − R(w∗ R) =O (cid:18) (cid:107)w∗ R(cid:107)2√ n (cid:20)(cid:113) Moreover, when Rpoint(w∗ R) + Rpair(w∗ R) (cid:21) + (cid:107)w∗ R(cid:107)2 2 n (cid:19) . max{Rpoint(w∗ R), Rpair(w∗ R)} = O (cid:18) (cid:107)w∗ R(cid:107)2 2 n (cid:19) , The derived rate O(n−1) often is considered as tightness enough in statistical learning theory (Shalev-Shwartz et al. 2010; Hardt, Recht, and Singer 2016). Remark 10. It should be noticed that the current result is consistent with the pointwise setting (Lei and Ying 2020) as τ = 1, with the pairiwise setting (Lei, Ledent, and Kloft 2020) as τ = 0. Our convergence analysis of PPL setting covers more complicated learning algorithms (e.g., algorithms described in Table 1) due to the flexibility of τ ∈ [0, 1]. Conclusion This paper focuses on establishing the generalization bounds of PPL by means of algorithmic stability analysis. After characterizing the quantitative relationship between gener- alization error and algorithmic stability, we establish the up- per bounds of excess risk of SGD and RRM for PPL. Our stability-based analysis fills the gap of statistical learning theory in part for the related PPL algorithms. In the future, it is interesting to further investigate the stability-based gen- eralization of SGD for PPL under non-i.i.d sampling, e.g., Markov chain sampling (Sun, Sun, and Yin 2018; Wang et al. 2022b). Acknowledgments This work was supported in part by National Natural Science Foundation of China under Grant No. 12071166 and by the Fundamental Research Funds for the Central Universities of China under Grant 2662020LXQD002. We are grateful to the anonymous AAAI reviewers for their constructive com- ments. References Agarwal, S.; and Niyogi, P. 2009. Generalization bounds for ranking algorithms via algorithmic stability. Journal of Machine Learning Research, 10: 441–474. Boucheron, S.; Lugosi, G.; and Massart, P. 2013. Concentra- tion inequalities: A nonasymptotic theory of independence. Oxford University Press. Bousquet, O.; and Elisseeff, A. 2002. Stability and general- ization. Journal of Machine Learning Research, 2: 499–526. Bousquet, O.; Klochkov, Y.; and Zhivotovskiy, N. 2020. In Con- Sharper bounds for uniformly stable algorithms. ference on Learning Theory (COLT), 610–626. Cao, Q.; Guo, Z.-C.; and Ying, Y. 2016. Generalization bounds for metric and similarity learning. Machine Learn- ing, 102: 115–132. Chen, H.; Wang, X.; Deng, C.; and Huang, H. 2017. Group sparse additive machine. In Advances in Neural Information Processing Systems (NeurIPS), 198–208. Chen, H.; Wang, Y.; Zheng, F.; Deng, C.; and Huang, H. 2021. Sparse modal additive model. IEEE Transactions on Neural Networks and Learning Systems, 32(6): 2373–2387. Cl ́emenc ̧on, S.; Lugosi, G.; and Vayatis, N. 2008. Ranking and empirical minimization of U-statistics. The Annals of Statistics, 36: 844–874. Deng, Z.; He, H.; and Su, W. 2021. Toward better general- ization bounds with locally elastic stability. In International Conference on Machine Learning (ICML), 2590–2600. Elisseeff, A.; Evgeniou, T.; Pontil, M.; and Kaelbing, L. P. 2005. Stability of randomized learning algorithms. Journal of Machine Learning Research, 6: 55–79. Feldman, V.; and Vondrak, J. 2018. Generalization bounds for uniformly stable algorithms. In Advances in Neural In- formation Processing Systems (NeurIPS), 9770–9780. Feldman, V.; and Vondrak, J. 2019. High probability gener- alization bounds for uniformly stable algorithms with nearly In Conference on Learning Theory (COLT), optimal rate. 1270–1279. Friedman, J. H.; Hastie, T.; and Tibshirani, R. 2010. A note on the group lasso and a sparse group lasso. arXiv:1001.0736. Hardt, M.; Recht, B.; and Singer, Y. 2016. Train faster, generalize better: Stability of stochastic gradient descent. In International Conference on Machine Learning (ICML), 1225–1234. Harvey, N. J.; Liaw, C.; Plan, Y.; and Randhawa, S. 2019. Tight analyses for non-smooth stochastic gradient descent. In Conference on Learning Theory (COLT), 1579–1613. Hoeffding, W. 1963. Probability inequalities for sums of bounded random variables. Journal of the American Statis- tical Association, 58: 13–30. Huang, Z.; Feng, S.; Su, W.; Chen, X.; Wang, S.; Liu, J.; Ouyang, X.; and Sun, Y. 2020. ERNIE at SemEval-2020 Task 10: Learning word emphasis selection by pre-trained language model. In International Committee on Computa- tional Linguistics (ICCL), 1456–1461. Klochkov, Y.; and Zhivotovskiy, N. 2021. Stability and de- viation optimal risk bounds with convergence rate O(1/n). In Advances in Neural Information Processing Systems (NeurIPS), 5065–5076. Lei, Y.; Ledent, A.; and Kloft, M. 2020. Sharper general- ization bounds for pairwise learning. In Advances in Neural Information Processing Systems (NeurIPS), 21236–21246. Lei, Y.; Li, W.; Lu, Z.; and Zhao, M. 2017. Alternating pointwise-pairwise learning for personalized item ranking. In Conference on Information and Knowledge Management, 2155–2158. Lei, Y.; Liu, M.; and Ying, Y. 2021. Generalization guar- antee of SGD for pairwise learning. In Advances in Neural Information Processing Systems (NeurIPS), 21216–21228. Lei, Y.; and Tang, K. 2021. Learning rates for stochastic IEEE Trans- gradient descent with nonconvex objectives. actions on Pattern Analysis and Machine Intelligence, 43: 4505–4511. Lei, Y.; and Ying, Y. 2020. Fine-grained analysis of stability and generalization for stochastic gradient descent. In Inter- national Conference on Machine Learning (ICML), 5809– 5819. Liu, M.; and Zhang, D. 2015. Pairwise constraint-guided sparse learning for feature selection. IEEE Transactions on Cybernetics, 46: 298–310. Liu, T.; Lugosi, G.; Neu, G.; and Tao, D. 2017. Algorithmic stability and hypothesis complexity. In International Con- ference on Machine Learning (ICML), 2159–2167. London, B.; Huang, B.; and Getoor, L. 2016. Stability and generalization in structured prediction. Journal of Machine Learning Research, 17: 7808–7859. Pitcan, Y. 2017. A note on concentration inequalities for U-statistics. arXiv:1712.06160. Rejchel, W. 2012. On ranking and generalization bounds. Journal of Machine Learning Research, 13: 1373–1392. Shalev-Shwartz, S.; and Ben-David, S. 2014. Understanding machine learning: From theory to algorithms. Cambridge University Press. Shalev-Shwartz, S.; Shamir, O.; Srebro, N.; and Sridharan, K. 2010. Learnability, stability and uniform convergence. Journal of Machine Learning Research, 11: 2635–2670. Simon, N.; Friedman, J.; Hastie, T.; and Tibshirani, R. 2013. A sparse-group lasso. Journal of Computational and Graph- ical Statistics, 22: 231–245. Smale, S.; and Zhou, D.-X. 2007. Learning theory estimates via integral operators and their approximations. Construc- tive Approximation, 26: 153–172. Srebro, N.; Sridharan, K.; and Tewari, A. 2010. Smoothness, low noise and fast rates. In Advances in neural information processing systems (NeurIPS), 2199–2207. Sun, T.; Li, D.; and Wang, B. 2021. Stability and general- ization of decentralized stochastic gradient descent. In AAAI Conference on Artificial Intelligence, 9756–9764. Sun, T.; Sun, Y.; and Yin, W. 2018. On Markov chain gradi- ent descent. In Advances in Neural Information Processing Systems (NeurIPS). Tibshirani, R. 2011. Regression shrinkage and selection via the lasso: A retrospective. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 73: 273–282. Vapnik, V.; Levin, E.; and Le Cun, Y. 1994. Measuring the VC-dimension of a learning machine. Neural Computation, 6: 851–876. Wang, M.; Guo, Y.; Zhao, Z.; Hu, G.; Shen, Y.; Gong, M.; and Torr, P. 2022a. MP2: A momentum contrast approach for recommendation with pointwise and pairwise learning. arXiv:2204.08326. Wang, P.; Lei, Y.; Ying, Y.; and Zhou, D.-X. 2022b. Sta- bility and generalization for Markov chain stochastic gradi- ent methods. In Advances in Neural Information Processing Systems (NeurIPS). Wang, Y.; Chen, H.; Zheng, F.; Xu, C.; Gong, T.; and Chen, Y. 2020. Multi-task additive models for robust estimation In Advances in Neural and automatic structure discovery. Information Processing Systems (NeurIPS). Wang, Y.; Wang, S.; Tang, J.; Liu, H.; and Li, B. 2016. PPP: Joint pointwise and pairwise image label prediction. In Conference on Computer Vision and Pattern Recognition (CVPR), 6005–6013. Yang, Z.; Lei, Y.; Wang, P.; Yang, T.; and Ying, Y. 2021. Simple Stochastic and Online Gradient Descent Algorithms for Pairwise Learning. In Advances in Neural Information Processing Systems (NeurIPS), 20160–20171. Yin, D.; Kannan, R.; and Bartlett, P. 2019. Rademacher complexity for adversarially robust generalization. In Inter- national Conference on Machine Learning (ICML), 7085– 7094. Ying, Y.; Wen, L.; and Lyu, S. 2016. Stochastic online AUC maximization. In Advances in Neural Information Process- ing Systems (NIPS). Ying, Y.; and Zhou, D.-X. 2016. Online pairwise learning algorithms. Neural Computation, 28: 743–777. Yuan, M.; and Lin, Y. 2006. Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68: 49–67. Zhou, D.-X. 2002. The covering number in learning theory. Journal of Complexity, 18: 739–767. Zhuo, J.; Zhu, Q.; Yue, Y.; and Zhao, Y. 2022. Learning explicit user interest boundary for recommendation. In ACM Web Conference, 193–202. Zou, H. 2006. The adaptive lasso and its oracle properties. Journal of the American Statistical Association, 101: 1418– 1429. The main notations of this paper are summarized in Table 3. A. Notations Z zi W f (w; z) (cid:96)(w; z, ̃z) ERM A Rpoint Rpair R(w) FS(w) Gen w∗ γ β Upoint Vpoint Hpoint n T ∇ (cid:107)Y (cid:107)p Sample space i-th training example Model parameter space Pointwise loss function PPL loss function Empirical risk minimization Given algorithm Pointwise expected risk Pairwise expected risk τ Rpoint(w) + (1 − τ )Rpair(w) RS(w) + r(w) R(A(S)) − RS(A(S)) arg minw∈W [R(w) + r(w)] Stability parameter Smoothness parameter Pointwise uniform stability Pointwise on-average loss stability 1 i=1 (cid:107)A(S) − A(Si)(cid:107)2 n Sample size Iteration number the gradient of loss function (E|Y |p) (cid:80)n 1 p S ρ w g(w; z, ̃z) SGD RRM A(S) Rpoint S Rpair S RS(w) τ EGen w∗ R L σ Upair Vpair Hpair d ηt ES[*] [n] Training dataset {z1, . . . , zn} Probability measure Model parameter Pairwise loss function Stochastic gradient descent Regularized risk minimization Output model Pointwise empirical risk Pairwise empirical risk τ Rpoint S PPL tuning parameter ES,A[R(A(S)) − RS(A(S))] arg minw∈W [R(w)] Lipschitz parameter Strong convexity parameter Pairwise uniform stability Pairwise on-average loss stability (cid:80) (w) + (1 − τ )Rpair (w) S i,j∈[n]:i(cid:54)=j (cid:107)A(S)−A(Si,j )(cid:107)2 n(n−1) the dimension of X Step size Conditional expectation about S {1, . . . , n} Table 3: Table of Notations. To improve the readability of theoretical analysis, we state the outlines for the proofs of Theorems 1-6 in Fig 1 B. Proofs of main theoretical results B.1 Proof of Theorem 1 To prove Theorem 1, we need to introduce some lemmas as follows. Lemma 5. (Bousquet, Klochkov, and Zhivotovskiy 2020) Let S = {z1, . . . , zn} be a set of independent random variables each taking values in Z and let d1, . . . , dn be some functions di : Z n (cid:55)→ R such that the following holds for any i ∈ [n] (cid:12)ES\{zi} [di(S)](cid:12) • (cid:12) (cid:12) ≤ M almost surely (a.s.), where S\ {zi} = {z1, . . . , zi−1, zi+1, . . . , zn}, • Ezi [di(S)] = 0 a.s., • gi has a bounded difference α with respect to all variables except the i-th variable (cid:12) (cid:12)di(z1, . . . , zn) − di (cid:0)z1, . . . , zj−1, z(cid:48)(cid:48) j , zj+1, . . . , zn (cid:1)(cid:12) (cid:12) ≤ α, where j ∈ [n] with j (cid:54)= i, and z(cid:48)(cid:48) j ∈ Z. Then, for any p ≥ 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 di(S) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)p √ ≤ 12 2pnα (cid:100)log2 n(cid:101) + 4M √ pn. Lemma 6. (Bousquet, Klochkov, and Zhivotovskiy 2020) Let a, b ≥ 0 and let Y be a random variable with (cid:107)Y (cid:107)p ≤ for any p ≥ 2. Then for any δ ∈ (0, 1) with probability at least 1 − δ (cid:18) (cid:114) |Y | ≤ e a log (cid:17) (cid:16) e δ + b log (cid:17)(cid:19) . (cid:16) e δ √ pa + pb Figure 1: Box of theoretical results for Pointwise and Pairwise Learning. Proof of Theorem 1 From (2), we know the generalization error R(A(S)) − RS(A(S)) =τ Rpoint(A(S)) + (1 − τ )Rpair(A(S)) − τ Rpoint S (cid:88) =τ Ez[f (w; z)] + (1 − τ )Ez, ̃z[g(w; z, ̃z)] − (A(S)) − (1 − τ )Rpair τ n i∈[n] f (w; zi) − S (1 − τ ) n(n − 1) (A(S)) (cid:88) g (w; zi, zj) . i,j∈[n]:i(cid:54)=j It is easy to see that the above generalization gap can be divided into two parts associated with pointwise loss and pairwise loss, respectively. To bound the pointwise part, we consider nEZ[f (A(S); Z)] − n (cid:88) i=1 f (A(S); zi) = n (cid:88) i=1 EZ (cid:2)f (A(S); Z) − Ez(cid:48) i [f (A (Si) ; Z)](cid:3) + n (cid:88) i=1 Ez(cid:48) i + n (cid:88) i=1 Ez(cid:48) i [f (A (Si) ; zi) − f (A(S); zi)] , [EZ [f (A (Si) ; Z)] − f (A (Si) ; zi)] where Si is defined by (3). According to the definition of PPL uniform stability in Definition 1, we know [f (A (Si) ; Z)](cid:12) |f (A (Si) ; zi) − f (A(S); zi)| ≤ γ. (cid:12) (cid:12)f (A(S); Z) − Ez(cid:48) (cid:12) ≤ γ, i Therefore, where (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) nEZ[f (A(S); Z)] − (cid:12) (cid:12) (cid:12) f (A(S); zi) (cid:12) (cid:12) (cid:88) i=1 ≤ 2nγ + (cid:12) n (cid:12) (cid:88) (cid:12) (cid:12) (cid:12) i=1 di(S) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) , (12) di(S) = Ez(cid:48) i [EZ [f (A (Si) ; Z)]] − Ez(cid:48) i [f (A (Si) ; zi)] = d(1) i (Si) − d(2) i (Si), ∀i ∈ [n]. Due to the boundedness assumption of loss function, we know (cid:12)ES\{zi} [di(S)](cid:12) (cid:12) (cid:12) ≤ 2M, ∀i ∈ [n]. Theorem 3Lemma 1Lemma 2Lemma 3Lemma 13Theorem 1Theorem 2Lemma 7Lemma 8Lemma 11Lemma 12Lemma 9Lemma 10Corollary 1Theorem 6Theorem 4Lemma 4Corollary 2Lemma 5Lemma 6 Since zi is independent of Si, there holds Ezi [EZ [f (A (Si) ; Z)] − [f (A (Si) ; zi)]] = 0, which means Ezi [di] = 0. By using the PPL uniform stability, we derive that (cid:12) (cid:12)d(1) (cid:12) i (Si) − d(1) i (S(m) i (cid:12) (cid:12) (cid:12) = ) (cid:12) (cid:12) (cid:12) Ez(cid:48) i EZ [f (A (Si) ; Z)] − Ez(cid:48) i (cid:16) (cid:104) f A (cid:16) EZ S(m) i (cid:17) ; Z (cid:17)(cid:105)(cid:12) (cid:12) (cid:12) ≤ γ, where S(m) i is the set Si replacing the m-th element with z(cid:48) (cid:12) (cid:12)d(2) (cid:12) Therefore, applying Lemma 5 with α = 2γ, we have (Si) − d(2) (cid:12) (cid:12) (cid:12) = ) (S(m) i (cid:12) Ez(cid:48) (cid:12) (cid:12) i i i m. Similarly, we can also conduct (cid:17) (cid:16) (cid:16) (cid:104) [f (A (Si) ; zi)] − Ez(cid:48) i f A S(m) i ; zi (cid:17)(cid:105)(cid:12) (cid:12) (cid:12) ≤ γ. (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 √ ≤ 24 di (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)p 2pnγ (cid:100)log2 n(cid:101) + 4M √ pn. According to Lemma 6, we derive that (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) n (cid:88) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) di i=1 √ (cid:16) 4M ≤ e n(cid:112)log(e/δ) + 24 √ 2nγ (cid:100)log2 n(cid:101) log(e/δ) (cid:17) with probability at least 1 − δ. Furthermore, we plug the above inequality back into (12) to derive (cid:12) (cid:12) (cid:12) ≤ 2γ + e (A(S)) − Rpoint(A(S)) 2 (cid:112)log(e/δ) + 24 (cid:12) (cid:12)Rpoint (cid:12) 4M n− 1 √ (cid:16) S 2γ (cid:100)log2(n)(cid:101) log(e/δ) (cid:17) with probability at least 1 − δ. Theorem 1 of Lei, Ledent, and Kloft (2020) assures that the pairwise part satisfies (cid:12) (cid:12)Rpair (cid:12) S (A(S)) − Rpair(A(S)) (cid:12) (cid:12) (cid:12) ≤ 4γ + e (cid:16) 16M (n − 1)− 1 2 (cid:112)log(e/δ) + 48 √ 2γ (cid:100)log2(n − 1)(cid:101) log(e/δ) (cid:17) with probability at least 1 − δ. The desired result follows by combining the two estimations for pointwise and pairwise parts. B.2 Proof of Theorem 2 To prove Theorem 2, we introduce the PPL non-expansiveness operator which is motivated by Hardt, Recht, and Singer (2016) and extended in Lei, Ledent, and Kloft (2020). We also need to introduce some properties of the PPL loss function when the pointwise loss function part and the pairwise loss function part change. Lemma 7. (Hardt, Recht, and Singer 2016) Assume the pointwise loss function f (w; z) is convex and β-smooth with respect to w for all z ∈ Z. Then for all η ≤ 2/β there holds (cid:107)w − ηf (cid:48) (w; z) − w(cid:48) + ηf (cid:48) (w(cid:48); z)(cid:107)2 ≤ (cid:107)w − w(cid:48)(cid:107)2 . Correspondingly, the non-expansiveness operators of the pairwise and the pointwise are the same except for the functional forms. Lemma 8. Assume the pairwise loss function g (w; z, ̃z) is convex and β-smooth with respect to w for all z, ̃z ∈ Z. Then for all η ≤ 2/β there holds (cid:107)w − ηg(cid:48) (w; z, ̃z) − w(cid:48) + ηg(cid:48) (w(cid:48); z, ̃z)(cid:107)2 ≤ (cid:107)w − w(cid:48)(cid:107)2 . Lemma 9. If the pointwise loss function f (w; z) and the pairwise loss function g (w; z, ̃z) are convex with respect to w for z, ̃z ∈ Z, then the PPL loss function (cid:96) (w; z, ̃z) is convex with respect to w. Proof of Lemma 9 According to the definition of convex function, we can easily get the above conclusion, and the proof process is omitted here. Lemma 10. If the pointwise loss function f (w; z) and the pairwise loss function g (w; z, ̃z) are β-smooth with respect to w for z, ̃z ∈ Z, then the PPL loss function (cid:96) (w; z, ̃z) is β-smooth with respect to w. Similarly, if the pointwise loss function and the pairwise loss function are L-Lipschitz with respect to w for z, ̃z ∈ Z, then the PPL loss function is L-Lipschitz with respect to w. Proof of Lemma 10 Based on the definitions of smoothness, the following inequalities hold for f and g: τ (cid:107)∇f (u) − ∇f (v)(cid:107)2 ≤ τ β(cid:107)u − v(cid:107)2, (1 − τ )(cid:107)∇g(u) − ∇g(v)(cid:107)2 ≤ (1 − τ )β(cid:107)u − v(cid:107)2, τ (cid:107)∇f (u) − ∇f (v)(cid:107)2 + (1 − τ )(cid:107)∇g(u) − ∇g(v)(cid:107)2 ≤ β(cid:107)u − v(cid:107)2. From the sub-additivity of (cid:107) * (cid:107)2, we know (cid:107)τ ∇f (u) + (1 − τ )∇g(u) − τ ∇f (v) − (1 − τ )∇g(v)(cid:107)2 ≤ β(cid:107)u − v(cid:107)2, i.e., The proof of the Lipschitz continuity is similar to the above process, thus we omit it here. The proof is completed. (cid:107)∇(cid:96)(u) − ∇(cid:96)(v)(cid:107)2 ≤ β(cid:107)u − v(cid:107)2. Since the PPL loss function is convex and β-smooth, We can also get the non-expansiveness of the PPL as follows. Lemma 11. Assume for all z, ̃z ∈ Z, the functions w (cid:55)→ f (w; z) and w (cid:55)→ g (w; z, ̃z) are both convex and β-smooth. Then for all η ≤ 2/β there holds (cid:107)w − η(cid:96)(cid:48) (w; z, ̃z) − w(cid:48) + η(cid:96)(cid:48) (w(cid:48); z, ̃z)(cid:107)2 ≤ (cid:107)w − w(cid:48)(cid:107)2 . In addition, we also need to introduce a concentration inequality (Boucheron, Lugosi, and Massart 2013; Shalev-Shwartz and Ben-David 2014) which is useful for developing high-probability bounds in the following part. Lemma 12. (Chernoff's Bound).Let X = (cid:80)T {0, 1} and μ = E[X]. Then for any δ1, we have X ≤ (1 + δ1)μ with probability at least 1 − exp(−μδ2 for any δ ∈ (0, 1), we have t=1 Xt where X1, . . . , XT is independent random variables taking values in 1/(3 + δ1)). Moreover, X ≤ μ + log(1/δ) + (cid:112)2μ log(1/δ) with probability at least 1 − δ. Proof of Lemma 12 We now establish the uniform stability of PPL SGD. Proof of Theorem 2 Let {wt} , {w(cid:48) t} be produced by PPL SGD on S and S(cid:48), then wt+1 = wt − ηt (τ f (cid:48) (wt; zit) + (1 − τ )g(cid:48) (wt; zit, zjt)) and w(cid:48) t+1 = w(cid:48) t − ηt (cid:0)τ f (cid:48) (cid:0)w(cid:48) t; z(cid:48) it (cid:1) + (1 − τ )g(cid:48) (cid:0)w(cid:48) t; z(cid:48) it , z(cid:48) jt (cid:1)(cid:1) . In the sequel, let us consider three cases. Firstly, if it ∈ [n − 1] and jt ∈ [n − 1], it (cid:54)= jt, then wt+1 − w(cid:48) t+1 =wt − ηt (τ f (cid:48) (wt; zit) + (1 − τ )g(cid:48) (wt; zit, zjt)) − w(cid:48) =wt − ηt (τ f (cid:48) (wt; zit) + (1 − τ )g(cid:48) (wt; zit, zjt)) − w(cid:48) (cid:0)τ f (cid:48) (cid:0)w(cid:48) t + ηt t + ηt (τ f (cid:48) (w(cid:48) (cid:1) + (1 − τ )g(cid:48) (cid:0)w(cid:48) t; z(cid:48) it t; zit) + (1 − τ )g(cid:48) (w(cid:48) t; z(cid:48) , z(cid:48) jt it t; zit, zjt)) . (cid:1)(cid:1) It then follows from Lemma 11 that Secondly, if it = n and jt ∈ [n − 1], then (cid:13) (cid:13)wt+1 − w(cid:48) t+1 (cid:13) (cid:13)2 ≤ (cid:107)wt − w(cid:48) t(cid:107)2 . t+1 (cid:13) (cid:13)2 (cid:13) (cid:13)wt+1 − w(cid:48) = (cid:13) (cid:13)wt − ηt (τ f (cid:48) (wt; zit ) + (1 − τ )g(cid:48) (wt; zit, zjt)) − w(cid:48) ≤ (cid:107)wt − w(cid:48) t; z(cid:48) it ≤ (cid:107)wt − w(cid:48) = (cid:107)wt − w(cid:48) t(cid:107)2 + τ (cid:13) (cid:13)ηtf (cid:48) (cid:0)w(cid:48) t(cid:107)2 + 2τ ηtL + 2(1 − τ )ηtL t(cid:107)2 + 2ηtL, (cid:1) − ηtf (cid:48) (wt; zit)(cid:13) t + ηt (cid:13)2 + (1 − τ ) (cid:13) (cid:0)τ f (cid:48) (cid:0)w(cid:48) t; z(cid:48) it (cid:13)ηtg(cid:48) (cid:0)w(cid:48) t; z(cid:48) it (cid:1) + (1 − τ )g(cid:48) (cid:0)w(cid:48) , z(cid:48) jt (cid:1)(cid:1)(cid:13) (cid:13)2 (cid:1) − ηtg(cid:48) (wt; zit, zjt)(cid:13) (cid:13)2 t; z(cid:48) it , z(cid:48) jt where the last inequality is due to the L-Lipschitz continuity of the loss functions f and g. Finally, if it ∈ [n − 1] and jt = n, then t+1 (cid:13) (cid:13)2 (cid:13) (cid:13)wt+1 − w(cid:48) = (cid:13) (cid:13)wt − ηt (τ f (cid:48) (wt; zit) + (1 − τ )g(cid:48) (wt; zit, zjt)) − w(cid:48) ≤ (cid:107)wt − ηtτ f (cid:48) (wt; zit) − w(cid:48) ≤ (cid:107)wt − w(cid:48) t(cid:107)2 + 2ηtL(1 − τ ). t + ηt t; zit)(cid:107)2 + (1 − τ ) (cid:13) t + ηtτ f (cid:48) (w(cid:48) (cid:0)τ f (cid:48) (cid:0)w(cid:48) (cid:13)ηtg(cid:48) (cid:0)w(cid:48) t; z(cid:48) it t; z(cid:48) it , z(cid:48) jt (cid:1) + (1 − τ )g(cid:48) (cid:0)w(cid:48) , z(cid:48) jt (cid:1) − ηtg(cid:48) (wt; zit, zjt)(cid:13) (cid:13)2 t; z(cid:48) it (cid:1)(cid:1)(cid:13) (cid:13)2 Combining the above three cases, we derive (cid:13) (cid:13)wt+1 − w(cid:48) t+1 (cid:13) (cid:13)2 ≤ (cid:107)wt − w(cid:48) t(cid:107)2 + 2ηtLI [it = n] + 2ηtL(1 − τ )I [jt = n] , where I[*] is the indicator function. Iterating over the above formula (w1 = w(cid:48) 1), there holds (cid:13) (cid:13)wt+1 − w(cid:48) t+1 (cid:13) (cid:13)2 ≤ 2L t (cid:88) k=1 ηkI [ik = n] + 2L(1 − τ ) t (cid:88) k=1 ηkI [jk = n] . (13) With the Lipschitz continuity, for all z, ̃z ∈ Z, we know (cid:12) (cid:12)(cid:96) (wt+1; z, ̃z) − (cid:96) (cid:0)w(cid:48) t+1; z, ̃z(cid:1)(cid:12) (cid:12) ≤ L (cid:13) (cid:13)wt+1 − w(cid:48) t+1 (cid:13) (cid:13)2 , hence (cid:12) (cid:12)(cid:96) (wt+1; z, ̃z) − (cid:96) (cid:0)w(cid:48) t+1; z, ̃z(cid:1)(cid:12) (cid:12) ≤ 2L2 t (cid:88) k=1 ηkI [ik = n] + 2L2(1 − τ ) t (cid:88) k=1 ηkI [jk = n] . We assume Xk = I[ik = n], it is easy to know that 1 n Applying Lemma 12 with Xk = I [ik = n], we obtain with probability 1 − δ, E[Xk] = P r{ik = n} = . Xk ≤ μ + log(1/δ) + (cid:112)2μ log(1/δ), t (cid:88) k=1 where μ = (cid:80)t k=1 E [Xt] ≤ t/n. It then follows with probability 1 − δ that t (cid:88) k=1 Xk ≤ t n + log(1/δ) + (cid:112)2n−1t log(1/δ). We can also derive the same results for Yk = I [jk = n] t (cid:88) k=1 Yk ≤ t n + log(1/δ) + (cid:112)2n−1t log(1/δ). Combining the above two inequalities with (13), we derive the following inequality with probability 1 − δ (cid:13) (cid:13)wt+1 − w(cid:48) t+1 (cid:13) (cid:13)2 ≤ 2Lη(2 − τ ) (cid:19) + log(1/δ) + (cid:112)2n−1t log(1/δ) . (cid:18) t n The proof is completed with ηt = η. B.3 Proof of Theorem 3 Next, we prove some important lemmas, Lemma 13. For any S ∈ Z n, define A as A(S) = arg minw∈W FS(w). For any k ∈ [n], let Sk be defined by (3). Then FS (A (Sk)) − FS(A(S)) τ n (f (A (Sk) ; zk) − f (A (Sk) ; z(cid:48) k) + f (A (S) ; z(cid:48) k) − f (A (S) ; zk)) ≤ + 1 − τ n(n − 1) (cid:88) i∈[n]:i(cid:54)=k [((g(A(Sk); zi, zk) − g(A(S); zi, zk)) + (g (A (Sk) ; zk, zi) − g (A(S); zk, zi)) + (g (A(S); zi, z(cid:48) k) − g (A (Sk) ; zi, z(cid:48) k)) + (g (A(S); z(cid:48) k, zi) − g (A (Sk) ; z(cid:48) k, zi))] . Proof of Lemma 13 Without loss of generality, we can assume k = n. Due to A (Sn) is the minimizer of FSn , we know FS (A (Sn)) − FS(A(S)) =FS (A (Sn)) − FSn (A (Sn)) + FSn (A (Sn)) − FSn(A(S)) + FSn (A(S)) − FS(A(S)) ≤FS (A (Sn)) − FSn (A (Sn)) + FSn (A(S)) − FS(A(S)). (14) By the definitions of FS and FSn, we obtain FS (A (Sn)) − FSn (A (Sn)) n−1 (cid:88) (cid:32) n (cid:88) f (cid:48) (A (Sn) ; zi) − i=1 i=1 = τ n f (cid:48) (A (Sn) ; zi) − f (cid:48) (A (Sn) ; z(cid:48) n) + (cid:33) 1 − τ n(n − 1) (cid:88) i,j∈[n]:i(cid:54)=j g (A (Sn) ; zi, zj) − 1 − τ n(n − 1)   (cid:88) i,j∈[n−1]:i(cid:54)=j g (A (Sn) ; zi, zj) + (cid:88) i∈[n−1] g (A (Sn) ; zi, z(cid:48) n) +  g (A (Sn) ; z(cid:48) n, zi)  (cid:88) i∈[n−1] = τ n (f (cid:48) (A (Sn) ; zn) − f (cid:48) (A (Sn) ; z(cid:48) n)) + (1 − τ ) n(n − 1) (cid:88) i∈[n−1] Similarly, we know (g (A (Sn) ; zi, zn) + g (A (Sn) ; zn, zi) − g (A (Sn) ; zi, z(cid:48) n) − g (A (Sn) ; z(cid:48) n, zi)) . FSn (A (S)) − FS (A (S)) = τ n (f (cid:48) (A (S) ; z(cid:48) n) − f (cid:48) (A (S) ; zn)) + (1 − τ ) n(n − 1) (cid:88) i∈[n−1] (g (A(S); zi, z(cid:48) n) + g (A(S); z(cid:48) n, zi) − g (A(S); zi, zn) − g (A(S); zn, zi)) . We can combine (15) and (16) to derive (FS (A (Sn)) − FSn (A (Sn)) + FSn (A (S)) − FS (A (S))) τ n (f (cid:48) (A (Sn) ; zn) − f (cid:48) (A (Sn) ; z(cid:48) n) + f (cid:48) (A (S) ; z(cid:48) n) − f (cid:48) (A (S) ; zn)) = + (1 − τ ) n(n − 1) (cid:88) i∈[n−1] ((g (A (Sn) ; zi, zn) − g (A(S); zi, zn)) + (g (A (Sn) ; zn, zi) − g (A(S); zn, zi)) (15) (16) + (g (A(S); zi, z(cid:48) n) − g (A (Sn) ; zi, z(cid:48) n)) + (g (A(S); z(cid:48) n, zi) − g (A (Sn) ; z(cid:48) n, zi))) . The proof is completed. Proof of Lemma 1 Let wS = A(S) and wS(cid:48) = A (S(cid:48)). Without loss of generality, we can assume S(cid:48) = Sn = {z1, . . . , zn−1, z(cid:48) n}. Due to wS is the minimizer of FSn and FS is σ-strongly convex, we know FS (wS(cid:48)) − FS (wS) ≥ σ 2 (cid:107)wS(cid:48) − wS(cid:107)2 2 . (17) According to and Lemma 13, we obtain |f (w; z) − f (w(cid:48); z)| ≤ L (cid:107)w − w(cid:48)(cid:107)2 , |g(w; z, ̃z) − g (w(cid:48); z, ̃z)| ≤ L (cid:107)w − w(cid:48)(cid:107)2 , ∀z ∈ Z, w, w(cid:48) ∈ W, ∀z, ̃z ∈ Z, w, w(cid:48) ∈ W, FS (wS(cid:48)) − FS (wS) ≤ 2Lτ (cid:107)wS(cid:48) − wS(cid:107)2 n + 4(n − 1)L(1 − τ ) (cid:107)wS(cid:48) − wS(cid:107)2 n(n − 1) = 2L n (2 − τ ) (cid:107)wS(cid:48) − wS(cid:107)2 . By combining the above inequality with (17), we have With Lemma 10, it is easy to get the 4L2 nσ (2 − τ )-uniform stability of A. (cid:107)wS − wS(cid:48)(cid:107)2 ≤ 4L nσ (2 − τ ). Proof of Lemma 2 With the reason that A(S) is the minimizer of FS, we know that F (cid:48) the definition of strong convexity, there holds S(A(S)) = 0. Then, further based on RS (w∗) + r (w∗) − RS(A(S)) − r(A(S)) ≥ σ 2 (cid:107)A(S) − w∗(cid:107)2 2 . (18) From (12), we know (cid:16) Rpoint(A(S)) − Rpoint S n (cid:17) (A(S)) ≤ 2nγ + (cid:88) i=1 di. Similarly, from Lei, Ledent, and Kloft (2020), we know (cid:16) n(n − 1) Rpair(A(S)) − Rpair S (A(S)) (cid:17) ≤ 4n(n − 1)γ + (cid:88) di,j, i,j∈[n]:i(cid:54)=j where E [di,j] = 0. Besides, the proof of Theorem 1 shows that E [di] = 0. It then follows that E[R(A(S)) − Rs(A(S))] ≤ 2γ(2 − τ ). We can put the above inequality back into (18) to derive (cid:107)A(S) − w∗(cid:107)2(cid:105) (cid:104) E σ 2 ≤ E [RS (w∗) + r (w∗) − RS(A(S)) − r(A(S))] ≤ E [RS (w∗) + r (w∗) − R(A(S)) − r(A(S))] + 2γ(2 − τ ) = E [R (w∗) + r (w∗) − R(A(S)) − r(A(S))] + 2γ(2 − τ ) ≤ 2γ(2 − τ ). Proof of Lemma 3 Because the PPL involves a pointwise part and a pairwise part, some related works of Lei, Ledent, and Kloft (2020) and Pitcan (2017) can be combined here, i.e., (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) τ n (cid:88) i∈[n] ≤τ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 n (cid:88) i∈[n] f (w; zi) + 1 − τ n(n − 1) (cid:88) i,j∈[n]:i(cid:54)=j (cid:12) (cid:12) f (w; zi) − Ez[f (w; z)] (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) + (1 − τ ) (cid:12) (cid:12) (cid:12) (cid:12) g (w; zi, zj) − τ Ez[f (w; z)] − (1 − τ )Ez, ̄z[g(w; z, ̃z)] (cid:12) (cid:12) (cid:12) 1 n(n − 1) (cid:88) i,j∈[n]:i(cid:54)=j (cid:12) (cid:12) g (w; zi, zj) − Ez, ̄z[g(w; z, ̃z)] (cid:12) (cid:12) (cid:12) (cid:115) ≤ 2τ blog(1/δ) 3(cid:98)n(cid:99) + τ 2θlog(1/δ) (cid:98)n(cid:99) + 2(1 − τ )blog(1/δ) 3(cid:98)n/2(cid:99) (cid:115) + (1 − τ ) 2θlog(1/δ) (cid:98)n/2(cid:99) . Proof of Theorem 3 According to Lemma 1 and Lemma 2, we deduce ES obtain that (cid:104) (cid:107)w∗ − A(S)(cid:107)2 2 (cid:105) ≤ 16L2(2−τ )2 nσ2 . We can further ES [(cid:107)w∗ − A(S)(cid:107)2] ≤ (cid:104) (cid:16) ES (cid:107)w∗ − A(S)(cid:107)2 2 (cid:105)(cid:17) 1 2 ≤ 4L(2 − τ ) nσ √ . (19) For any w ∈ W and z, ̃z, we define ̃f (w; z) = f (w; z) − f (w∗; z) and ̃g(w; z, ̃z) = g(w; z, ̃z) − g (w∗; z, ̃z) . With Lemma 10 and (19), for all z, ̃z ∈ Z, we can obtain the following inequalities: (cid:12) (cid:12) (cid:12) (cid:12) ES[ ̃f (A(S); z)] (cid:12) = |ES [f (A(S); z) − f (w∗; z)]| ≤ LES [(cid:107)w∗ − A(S)(cid:107)2] ≤ (cid:12) 4L2(2 − τ ) nσ √ and |ES[ ̃g(A(S); z, ̄z)]| = |ES [g(A(S); z, ̃z) − g (w∗; z, ̃z)]| ≤ LES [(cid:107)w∗ − A(S)(cid:107)2] ≤ 4L2(2 − τ ) nσ √ . We now apply Theorem 1 with γ = 4L2 nσ (2 − τ ) and M = 4L2(2−τ ) √ nσ to show the following inequality τ n (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 8L2 nσ ≤ (cid:88) i=1 ̃f (A(S); zi) − τ Ez[ ̃f (A(S); z)] + (1 − τ ) n(n − 1) (cid:88) i(cid:54)=j (cid:12) (cid:12) (cid:12) ̃g (A(S); zi, zj) − (1 − τ )Ez, ̃z[ ̃g(A(S); z, ̃z)] (cid:12) (cid:12) (cid:12) (2 − τ )2 + e (cid:32) 16L2 nσ (2 − τ )(4 − 3τ )(cid:112)log(e/δ) + 96 √ 2L2 nσ (2 − τ )2 (cid:100)log2(n)(cid:101) log(e/δ) (cid:33) with probability 1 − δ. Therefore, |RS(A(S)) − R(A(S))| (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) τ n i=1 f (w∗; zi) − τ Ez [f (w∗; z)] + ≤ (1 − τ ) n(n − 1) (cid:88) i(cid:54)=j + 8L2 nσ (2 − τ )2 + e (cid:32) 16L2 nσ (2 − τ )(4 − 3τ )(cid:112)log(e/δ) + 96 As stated in Lemma 3, with probability at least 1 − δ we have √ 2L2 nσ (cid:12) (cid:12) (cid:12) g (w∗; zi, zj) − (1 − τ )Ez, ̃z [g (w∗; z, ̃z)] (cid:12) (cid:12) (cid:12) (2 − τ )2 (cid:100)log2(n)(cid:101) log(e/δ) . (20) (cid:33) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) τ n (cid:88) i∈[n] f (w∗; zi) + (1 − τ ) n(n − 1) (cid:88) i,j∈[n]:i(cid:54)=j (cid:12) (cid:12) g (w∗; zi, zj) − τ Ez[f (w∗; z)] − Ez, ̃z[g(w∗; z, ̃z)] (cid:12) (cid:12) (cid:12) (cid:115) ≤ 2τ b log(1/δ) 3(cid:98)n(cid:99) + τ 2θ log(1/δ) (cid:98)n(cid:99) + 2(1 − τ )blog(1/δ) 3(cid:98)n/2(cid:99) + (1 − τ ) (cid:115) 2θlog(1/δ) (cid:98)n/2(cid:99) . (21) Combine (20) with (21), we deduce that with probability 1 − δ |RS(A(S)) − R(A(S))| (cid:115) ≤ 2τ b log(1/δ) 3(cid:98)n(cid:99) + τ 2θ log(1/δ) (cid:98)n(cid:99) + 2(1 − τ )blog(1/δ) 3(cid:98)n/2(cid:99) (cid:115) + (1 − τ ) 2θlog(1/δ) (cid:98)n/2(cid:99) + 8L2 nσ (2 − τ )2 + e (cid:32) 16L2 nσ (2 − τ )(4 − 3τ )(cid:112)log(e/δ) + √ 96 2L2 nσ (2 − τ )2 (cid:100)log2(n)(cid:101) log(e/δ) . (cid:33) The proof is complete. B.4 Proof of Theorem 6 Proof of Theorem 4 Note that Si and Si,j is defined in (3) and (4). It is easily known that E (cid:2)Rpoint(A(S))(cid:3) = E (cid:2)Rpoint(A(Si))(cid:3) and E (cid:2)Rpair(A(S))(cid:3) = E (cid:2)Rpair(A(Si,j))(cid:3) for all i, j ∈ [n] with i (cid:54)= j. Thus, E [R(A(S)) − RS(A(S))] =E (cid:16) (cid:104) τ Rpoint(A(S)) − Rpoint S (A(S)) (cid:17) (cid:16) + (1 − τ ) Rpair(A(S)) − Rpair S (A(S)) (cid:17)(cid:105) = = τ n τ n i=1 n (cid:88) i=1 n (cid:88) (cid:104) E Rpoint (A (Si)) − Rpoint S (cid:105) (A(S)) + (1 − τ ) n(n − 1) (cid:88) E (cid:104) Rpair (A (Si,j)) − Rpair S (cid:105) (A(S)) i,j∈[n]:i(cid:54)=j E [f (A (Si) ; zi) − f (A(S); zi)] + (1 − τ ) n(n − 1) (cid:88) i,j∈[n]:i(cid:54)=j E [g (A (Si,j) ; zi, zj) − g (A(S); zi, zj)] ≤ γ. The proof is complete. Proof of Lemma 4 According to the Lemma 2.1 of Srebro, Sridharan, and Tewari (2010), we know that the self-bounding property for non-negative and smooth functions, i.e., (cid:107)f (cid:48)(w)(cid:107)2 2 ≤ 2βf (w), ∀w ∈ W, and the following inequalities are also satisfied (cid:107)g(cid:48)(w)(cid:107)2 2 ≤ 2βg(w), ∀w ∈ W, f (w) ≤ f (w(cid:48)) + (cid:104)f (cid:48) (w(cid:48)) , w − w(cid:48)(cid:105) + g(w) ≤ g (w(cid:48)) + (cid:104)g(cid:48) (w(cid:48)) , w − w(cid:48)(cid:105) + β (cid:107)w − w(cid:48)(cid:107)2 2 2 β (cid:107)w − w(cid:48)(cid:107)2 2 2 , , ∀w, w(cid:48) ∈ W, ∀w, w(cid:48) ∈ W. Based on the above conditions and the Cauchy-Schwartz inequality, we deduce that f (A (Si) ; zi) − f (A(S); zi) ≤ (cid:104)f (cid:48) (A(S); zi) , A (Si) − A(S)(cid:105) + β 2 (cid:107)A (Si) − A(S)(cid:107)2 2 ≤ (cid:107)f (cid:48) (A(S); zi)(cid:107)2 (cid:107)A (Si) − A(S)(cid:107)2 + β 2 (cid:107)A (Si) − A(S)(cid:107)2 2 ≤ (cid:107)f (cid:48) (A(S); zi)(cid:107)2 2 2(cid:15) + (cid:15) + β 2 (cid:107)A (Si) − A(S)(cid:107)2 2 ≤ βf (A(S); zi) (cid:15) + (cid:15) + β 2 (cid:107)A (Si) − A(S)(cid:107)2 2 . Then, we apply the above inequality to Theorem 5 to obtain (cid:104) E Rpoint(A(S)) − Rpoint S (A(S)) (cid:105) n (cid:88) E [f (A(S); zi)] + (cid:15) + β 2n n (cid:88) (cid:104) E i=1 (cid:107)A (Si) − A(S)(cid:107)2 2 (cid:105) ≤ β (cid:15)n βE = i=1 (cid:104) Rpoint S (cid:105) (A(S)) (cid:15) + (cid:15) + β 2n n (cid:88) (cid:104) E i=1 (cid:107)A (Si) − A(S)(cid:107)2 2 (cid:105) . From the Lemma D.1 of Lei, Ledent, and Kloft (2020), we know (cid:104) E Rpair(A(S)) − Rpair S (A(S)) (cid:105) ≤ βE (cid:104) Rpair S (cid:105) (A(S)) (cid:15) + 2((cid:15) + β) n n (cid:88) i=1 E (cid:104) (cid:107)A (Si) − A(S)(cid:107)2 2 (cid:105) . Combining (22) and (23), we have E [R(A(S)) − RS(A(S))] βτ E (A(S)) Rpoint S (cid:105) (cid:104) ≤ (cid:15) β(1 − τ )E + (cid:104) Rpair S (cid:105) (A(S)) (cid:15) + ((cid:15) + β) n (2 − 3 2 τ ) n (cid:88) (cid:104) E i=1 (cid:107)A (Si) − A(S)(cid:107)2 2 (cid:105) . The proof is completed. Proof of Theorem 6 Due to Lemma 13 and the β-smoothness of f and g, we deduce that, for any k ∈ [n], FS (A (Sk)) − FS(A(S)) ≤ τ n + (cid:16) (cid:104)f (cid:48) (A(S); zk) − f (cid:48) (A (Sk) ; z(cid:48) k) , A (Sk) − A(S)(cid:105) + β (cid:107)A (Sk) − A(S)(cid:107)2 2 (cid:17) (1 − τ ) n(n − 1) (cid:88) i∈[n]:i(cid:54)=k ((cid:104)g(cid:48) (A(S); zi, zk) + g(cid:48) (A(S); zk, zi) − g(cid:48) (A (Sk) ; zi, z(cid:48) k) Using the Cauchy-Schwartz inequality, we obtain −g(cid:48) (A (Sk) ; z(cid:48) k, zi) , A (Sk) − A(S)(cid:105) + 4β (cid:107)A (Sk) − A(S)(cid:107)2 2 2 ). FS (A (Sk)) − FS(A(S)) ≤ τ n + (cid:16) ((cid:107)f (cid:48) (A(S); zk)(cid:107)2 + (cid:107)f (cid:48) (A (Sk) ; z(cid:48) (1 − τ ) n(n − 1) (cid:88) ( i∈[n]:i(cid:54)=k k)(cid:107)2) (cid:107)A (Sk) − A(S)(cid:107)2 + β (cid:107)A (Sk) − A(S)(cid:107)2 2 ((cid:107)g(cid:48) (A(S); zi, zk)(cid:107)2 + (cid:107)g(cid:48) (A(S); zk, zi)(cid:107)2 + (cid:107)g(cid:48) (A (Sk) ; zi, z(cid:48) k)(cid:107)2 + (cid:107)g(cid:48) (A (Sk) ; z(cid:48) k, zi)(cid:107)2) (cid:107)A (Sk) − A(S)(cid:107)2 + 2β(n − 1) (cid:107)A (Sk) − A(S)(cid:107)2 2). (22) (23) (cid:17) Based on the self-bounding property and strong-convexity property, we verify that σ (cid:107)A (Sk) − A(S)(cid:107)2 2 2 ≤ τ n (cid:18) (cid:112)2β (cid:18) (cid:112)f (A(S); zk) + (cid:18) (cid:88) ((cid:112)2β (cid:113) f (A (Sk) ; z(cid:48) k) (cid:19) (cid:107)A (Sk) − A(S)(cid:107)2 + β (cid:107)A (Sk) − A(S)(cid:107)2 2 (cid:19) (cid:112)(cid:96) (A(S); zi, zk) + (cid:112)(cid:96) (A(S); zk, zi) + (cid:113) (cid:96) (A (Sk) ; zi, z(cid:48) k) (1 − τ ) n(n − 1) + + (cid:113) i∈[n]:i(cid:54)=k (cid:19) (cid:96) (A (Sk) ; z(cid:48) k, zi) (cid:107)A (Sk) − A(S)(cid:107)2 + 2β(n − 1) (cid:107)A (Sk) − A(S)(cid:107)2 2) and σ (cid:107)A (Sk) − A(S)(cid:107)2 2 ≤ τ n (cid:18) (cid:112)2β (cid:18) (cid:112)f (A(S); zk) + (cid:113) f (A (Sk) ; z(cid:48) k) (cid:19) + β (cid:107)A (Sk) − A(S)(cid:107)2 (cid:19) + (1 − τ ) n(n − 1) ((cid:112)2β (cid:88) (cid:16)(cid:112)g (A(S); zi, zk) + (cid:112)g (A(S); zk, zi) g (A (Sk) ; zi, z(cid:48) k) + g (A (Sk) ; z(cid:48) k, zi) (cid:19) + 2β(n − 1) (cid:107)A (Sk) − A(S)(cid:107)2). i∈[n]:i(cid:54)=k (cid:113) (cid:113) + When β ≤ σn/4(2 − τ ), ≤ σ (cid:107)A (Sk) − A(S)(cid:107)2 4 (cid:18) (cid:112)f (A(S); zk) + (cid:18) (cid:18) (cid:112)2β τ n + (1 − τ ) n(n − 1) (cid:112)2β (cid:88) i∈[n]:i(cid:54)=k (cid:113) (cid:19)(cid:19) f (A (Sk) ; z(cid:48) k) (cid:112)g (A(S); zi, zk) + (cid:112)g (A(S); zk, zi) + (cid:113) g (A (Sk) ; zi, z(cid:48) k) + (cid:113) g (A (Sk) ; z(cid:48) k, zi) (cid:19) We multiply both sides of the above inequality by n(n − 1) to derive σn(n − 1) (cid:107)A (Sk) − A(S)(cid:107)2 4 (cid:112)2β (cid:18) (cid:18) ≤τ (n − 1) (cid:112)f (A(S); zk) + (cid:18) (cid:88) (cid:113) f (A (Sk) ; z(cid:48) k) (cid:19)(cid:19) + (1 − τ )(cid:112)2β (cid:112)g (A(S); zi, zk) + (cid:112)g (A(S); zk, zi) + (cid:113) g (A (Sk) ; zi, z(cid:48) k) + (cid:113) g (A (Sk) ; z(cid:48) k, zi) (cid:19) i∈[n]:i(cid:54)=k and further square, that is, σ2n2(n − 1)2 (cid:107)A (Sk) − A(S)(cid:107)2 2 16 ≤2β(n − 1) (cid:88) i∈[n]:i(cid:54)=k (cid:16) (1 − τ ) (cid:16)(cid:112)g (A(S); zi, zk) + (cid:112)g (A(S); zk, zi) (cid:113) g (A (Sk) ; zi, z(cid:48) k) + + (cid:113) g (A (Sk) ; z(cid:48) k, zi) + τ (cid:19) (cid:18) (cid:112)f (A(S); zk) + (cid:113) f (A (Sk) ; z(cid:48) k) (cid:19)(cid:19)2 . Then we use Cauchy-Schwartz inequality to derive σ2n2(n − 1) (cid:107)A (Sk) − A(S)(cid:107)2 2 ≤192β (cid:88) (cid:0)(1 − τ )2 (g (A(S); zi, zk) + g (A(S); zk, zi) + g (A (Sk) ; zi, z(cid:48) k) + g (A (Sk) ; z(cid:48) k, zi)) i∈[n]:i(cid:54)=k + τ 2 (f (A(S); zk) + f (A (Sk) ; z(cid:48) k))(cid:1) . . , We take a summation from k = 1 to n to obtain σ2n2(n − 1) n (cid:88) k=1 (cid:107)A (Sk) − A(S)(cid:107)2 2 ≤192β (cid:88) i,k∈[n]:i(cid:54)=k [(1 − τ )2 (g (A(S); zi, zk) + g (A(S); zk, zi) + g (A (Sk) ; zi, z(cid:48) k) + g (A (Sk) ; z(cid:48) k, zi)) + τ 2 (f (A(S); zk) + f (A (Sk) ; z(cid:48) k))]. Due to the symmetry, it is easily known that σ2n n (cid:88) k=1 (cid:107)A (Sk) − A(S)(cid:107)2 2 ≤ 384τ 2βE (cid:104) Rpoint S (A(S)) (cid:105) + 768(1 − τ )2βE (cid:104) Rpair S (A(S)) (cid:105) . With Lemma 4, we derive the following inequality for all (cid:15) > 0 E [R(A(S)) − RS(A(S))] βτ E (A(S)) Rpoint S (cid:105) (cid:104) ≤ ≤ (cid:15) (cid:104) βτ E Rpoint S (cid:105) (A(S)) (cid:15) β(1 − τ )E + (cid:104) Rpair S (cid:105) (A(S)) (cid:15) + ((cid:15) + β) n (cid:18) 2 − + 384τ 2((cid:15) + β)β σ2n2 (cid:18) 2 − (cid:19) 3 2 τ E (cid:104) Rpoint S (A(S)) E (cid:104) (cid:107)A (Si) − A(S)(cid:107)2 2 (cid:105) (cid:19) n (cid:88) i=1 3 2 τ (cid:105) β(1 − τ )E (cid:104) Rpair S (cid:105) (A(S)) (cid:15) + + 768(1 − τ )2((cid:15) + β)β σ2n2 (cid:18) 2 − (cid:19) (cid:104) E 3 2 τ Rpair S (A(S)) (cid:105) . In addition, from the definition of A(S), we get E[F (A(S))] − F (w∗) = E [F (A(S)) − FS(A(S))] + E [FS(A(S)) − FS (w∗)] ≤ E [F (A(S)) − FS(A(S))] = E [R(A(S)) − RS(A(S))] . Thus, E[F (A(S))] − F (w∗) (cid:105) (cid:104) βτ E Rpoint S (A(S)) ≤ + + 384τ 2((cid:15) + β)β σ2n2 (cid:18) 2 − (cid:19) (cid:104) E 3 2 τ Rpoint S (A(S)) (cid:105) (cid:15) β(1 − τ )E (cid:104) Rpair S (cid:105) (A(S)) (cid:15) + 768(1 − τ )2((cid:15) + β)β σ2n2 (cid:18) 2 − (cid:19) 3 2 τ E (cid:104) Rpair S (cid:105) (A(S)) . The desired result is proved.
http://arxiv.org/abs/2302.09956v2
2023-02-28T18:30:37
2023-02-20T12:57:31
Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting
Traffic forecasting is a critical task to extract values from cyber-physical infrastructures, which is the backbone of smart transportation. However owing to external contexts, the dynamics at each sensor are unique. For example, the afternoon peaks at sensors near schools are more likely to occur earlier than those near residential areas. In this paper, we first analyze real-world traffic data to show that each sensor has a unique dynamic. Further analysis also shows that each pair of sensors also has a unique dynamic. Then, we explore how node embedding learns the unique dynamics at every sensor location. Next, we propose a novel module called Spatial Graph Transformers (SGT) where we use node embedding to leverage the self-attention mechanism to ensure that the information flow between two sensors is adaptive with respect to the unique dynamic of each pair. Finally, we present Graph Self-attention WaveNet (G-SWaN) to address the complex, non-linear spatiotemporal traffic dynamics. Through empirical experiments on four real-world, open datasets, we show that the proposed method achieves superior performance on both traffic speed and flow forecasting. Code is available at: https://github.com/aprbw/G-SWaN
[ "Arian Prabowo", "Wei Shao", "Hao Xue", "Piotr Koniusz", "Flora D. Salim" ]
10.1145/3576842.3582362
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1145/3576842.3582362", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.09956v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09956v2", "@rel": "related", "@type": "application/pdf" } ]
[ "IoTDI 2023" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CV", "cs.DB" ]
3 2 0 2 b e F 8 2 ] G L . s c [ 2 v 6 5 9 9 0 . 2 0 3 2 : v i X r a Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting ARIAN PRABOWO, RMIT University, Australia and Data61/CSIRO, Australia WEI SHAO, UC Davis, USA HAO XUE, UNSW, Australia PIOTR KONIUSZ, Data61/CSIRO, Australia and ANU, Australia FLORA D. SALIM, UNSW, Australia (a) Locations of the sensors on the Californian highway network sur- rounding the bay area. Installing a network of sensors on a road infras- tructure enables traffic forecasting and smarter cities. (b) At each sensor, traffic forecasting uses the recent sensor readings (solid blue line) to predict the future traffic (red line). This forecast is made by our proposed architecture Graph Self- attention WaveNet (G-SWaN). Our forecasts accurately predict the future traffic (dotted blue line). Fig. 1. Visual abstract of the traffic forecasting task. Traffic forecasting is a critical task to extract values from cyber-physical infrastructures, which is the backbone of smart transportation. However owing to external contexts, the dynamics at each sensor are unique. For example, the afternoon peaks at sensors near schools are more likely to occur earlier than those near residential areas. In this paper, we first analyze real-world traffic data to show that each sensor has a unique dynamic. Further analysis also shows that each pair of sensors also has a unique dynamic. Then, we explore how node embedding learns the unique dynamics at every sensor location. Next, we propose a novel module called Spatial Graph Transformers (SGT) where we use node embedding to leverage the self-attention mechanism to ensure that the information flow Publication rights licensed to ACM. ACM acknowledges that this contribution was authored or co-authored by an employee, contractor or affiliate of a national government. As such, the Government retains a nonexclusive, royalty-free right to publish or reproduce this article, or to allow others to do so, for Government purposes only. © 2023 Copyright held by the owner/author(s). Publication rights licensed to ACM. Manuscript submitted to ACM 1 IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Arian Prabowo, Wei Shao, Hao Xue, Piotr Koniusz, and Flora D. Salim between two sensors is adaptive with respect to the unique dynamic of each pair. Finally, we present Graph Self-attention WaveNet (G-SWaN) to address the complex, non-linear spatiotemporal traffic dynamics. Through empirical experiments on four real-world, open datasets, we show that the proposed method achieves superior performance on both traffic speed and flow forecasting. Code is available at: https://github.com/aprbw/G-SWaN CCS Concepts: • Applied computing → Transportation; • Information systems → Sensor networks; • Computing methodolo- gies → Neural networks. Additional Key Words and Phrases: cyber-physical systems, intelligent transport systems, spatio-temporal, sensor networks ACM Reference Format: Arian Prabowo, Wei Shao, Hao Xue, Piotr Koniusz, and Flora D. Salim. 2023. Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting. In International Conference on Internet-of-Things Design and Implementation (IoTDI '23), May 9–12, 2023, San Antonio, TX, USA. ACM, New York, NY, USA, 20 pages. https://doi.org/10.1145/3576842.3582362 1 INTRODUCTION The recent proliferation of networked physical sensors have allowed exponential growth of machine generated data in many applications, including road traffic. This has led to the emergence of intelligent transportation systems, which have the potential to revolutionize the way we live. Previous works have discussed and explored the challenges of traffic forecasting (Figure 1) relating to the complexity of temporal and spatial dynamics. Temporal dynamics is the relationships between past and future traffic. Although many simplified mathematical model exists [5], none are capable to capture the complexity of real world traffic. This resulted in many research towards data-driven methods [11, 18, 22, 46, 54, 58, 59]. Meanwhile, spatial dynamics is the relationships traffic at different locations. The complexity in spatial dynamics is caused by the non-euclidean topology of the road network [4, 18, 32, 46, 54, 58]. (a) Idealized fundamental diagram. Figure is copied from [5]. (b) Fundamental diagram of a sensor in PeMS-D4 dataset. (c) Fundamental diagrams of 12 selected sensors in PeMS-D4 dataset showing great diversity. Fig. 2. Fundamental diagrams showing the dynamics between flow (density) in the x-axis and speed (velocity) in the y-axis. Figure 2(a) and 2(b) compare the idealized fundamental diagram against the real-world data, while Figure 2(c) shows that every sensor has a unique fundamental diagram, suggesting a unique underlying dynamics. The PeMS-D4 dataset is detailed in section 4.1. However, one novel observation presented in this paper is that every sensor has a unique dynamics. We show this by plotting flow (density) versus speed (velocity), also known as fundamental diagrams [5]. Figure 2(a) shows the idealized fundamental diagram based on a mathematical model of traffic [6]. According to this model, all sensors have 2 Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting IoTDI '23, May 9–12, 2023, San Antonio, TX, USA the same general shape: The speed stays constant during a free flow of traffic and decreases during a congested flow. The real-world data, however, reveals a different dynamic. Figure 2(b) shows the fundamental diagram of a sensor in the PeMS-D4 dataset. Although both the theory and the data agree that there is an inverse relationship between flow and speed, the sharp threshold between free flow and congested flow is not found in this particular sensor data. At every density, moreover, there is a huge variance of speed. Finally, Figure 2(c) shows that there is a great diversity between fundamental diagrams of various sensors, strongly suggesting that every sensor has a unique dynamic. This suggests the need of a mechanism to capture individual sensor dynamics. (a) Association plots of 8 random sensor pairs. (b) Association plots of a sensor pair over three weeks. Blue lines are weekdays, red lines are weekends. Fig. 3. Association plots of different pairs of sensor readings in PeMS-D4. The x-value of a point is the flow at one sensor, while the y-value is the flow at the other sensor. Consecutive data points are connected by a line. The PeMS-D4 dataset is detailed in section 4.1. Furthermore, given that all individual sensor dynamics are unique, the impact traffic at a sensor location has on its neighbors also involves complex relationships that are unique to that pair. The data confirms this behavior. In Figure 3(a), we plot the flow correlation of several pairs of sensors. The plot shows great diversity in the dynamics of sensor pairs. Moreover, Figure 3(b) shows that even within a single sensor, the dynamic changed periodically over time. The weekday pair dynamic (blue) is distinct from the weekend pair dynamic (red). There are many other ways to formulate this task besides as a multivariate timeseries forecasting, one example being as conditional spatiotemporal generation [16]. Another is a mathematical model of traffic, which can explain the cause of unique sensor and sensor pair dynamics. The macroscopic or continuum model of traffic is based on partial differential equations (PDEs) [48]. In this model, traffic is treated as a continuous fluid, with aggregate values used such as average speed and flow. Similar to fluid dynamics, traffic is modelled using a set of PDEs and boundary conditions. While initial conditions are often discussed in the context of PDEs, they have less relevance in this context and will be ignored. The PDEs that describe the evolution of traffic flow have spatial shifts or translation symmetry, meaning that they are the same everywhere. This is the dynamics that is being captured by most existing models that does not take sensor and sensor pairs unique dynamics into account. However, different places may have different boundary conditions, breaking the spatial symmetry and resulting in unique dynamics for every sensor. For example, entry and exit ramps can 3 IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Arian Prabowo, Wei Shao, Hao Xue, Piotr Koniusz, and Flora D. Salim be modelled as inlet/source and outlet/sink boundary conditions, respectively; lane or road closures can be considered changes to the geometry of the boundaries. This is why traffic flow may differ significantly between neighbouring sensors, even if they are connected by a road. To address these challenges, we present Graph Self-attention WaveNet (G-SWaN). It contains a novel spatial module called Spatial Graph Transformers (SGT) that extends a self-attention mechanism [49] to traffic networks with unique sensor dynamics. Moreover, being a graph neural network, SGT are well suited to deal with the non-euclidean spatial dynamics of a traffic network [7]. The node embedding in SGT injects sensor identity information into the self-attention mechanisms, enabling them to adapt to the unique dynamics of each pair. To show the generalizability of our architecture in traffic forecasting tasks, we evaluate our model by two traffic metrics: Speed and flow. We use four public, real-world datasets for reproducibility. Briefly, our main contributions are as follows: (1) To adapt to the behavior dynamics of individual sensors and pairs of sensors, as shown in Figure 2 and 3, we propose the Spatial Graph Transformers (SGT) module, which encodes individual sensor dynamics through node embedding. (2) We introduce a novel traffic forecasting architecture, Graph Self-attention WaveNet (G-SWaN), which uses SGT to capture the unique dynamics. (3) Through extensive experiments on four open real-world datasets, we empirically show that the proposed architecture achieves state-of-the-art results. 2 RELATED WORK This section discusses existing works on traffic forecasting, starting from classical statistical techniques to the latest deep learning methods, including attention-based models. One of the first works in this area [2] featured the Box-Jenkins technique. A large number of these earlier works also fall into the data-driven and statistical approaches to machine learning. These include Autoregressive Integrated Moving Average (ARIMA) [19] and ARIMA-like approaches, such as KARIMA [47], subset ARIMA [29], ARIMAX [52], VARMA [25], and SARIMA [53], as well as classical machine learning methods like SVR [9, 24, 33]. Based on early successes in various other tasks, deep learning was applied to traffic forecasting and [36] used stacked autoencoder as a generic latent feature learning. This was followed by a number of works that used varieties of Recurrent Neural Networks (RNN), such as Gated Recurrent Units (GRU) [15] and Long Short-Term Memory (LSTM) [42][12], to better capture the temporal dynamics. In contrast to the temporal focus used in the aforementioned studies, other works captured spatial information from traffic data to infer road maps [41] and predict flight delays [43, 44]. Diffusion Convolution Recurrent Neural Network (DCRNN) [32] attempted to capture both spatial and temporal dynamics by alternating between spatial and temporal modules. It established the architecture for many subsequent works, including the present one. DCRNN also extended convolution from undirected to directed graphs, arguing that traffic flow is directed in a network. In addition, Spatio-Temporal Hashing Multi-Graph Convolutional Network (ST-HMGCN) extended convolution to a multi-graph in order to forecast in a bus transit system, arguing that there are many different types of dependencies beyond the spatiotemporal ones, such as the semantics of different stations [35]. Following this general approach, Spatio-Temporal Graph Convolution Network (STGCN) [58] replaces the GRU in DCRNN with 1D convolution layers in order to increase efficiency. This pattern of replacing a specific module with 4 Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Table 1. Notations Notation Description α A Aadp Ar attention matrices adjacency matrices adaptive adjacency matrices adjacency matrices based on physical road network connectivity tensor shape: B: batch size, D: embedding dimension size, N: number of sensors, L: number of timesteps in an observation window final representation dimension size node embeddings forecasting horizon in timesteps Fully Connected layer Graph Convolutional Networks number of attention heads model output, prediction on the future traffic Mean Absolute Error Mean Percentage Error query and key matrices as a part of self-attention mechanisms Radial Basis Functions Root Mean Square Error sigmoid activation function hyperbolic tan time-of-day number of G-SWaN layers feature data point ground truth label [B,D,N,L] Dr e1, e2 F FC GCN H h MAE MAPE query (Q) key (K) RBF RMSE σ tanh tod W x y inspiration from other tasks continues with Graph WaveNet [45, 54]. By replacing temporal 1D convolution with WaveNet, the study [38], showed success in capturing temporal dynamics for audio. They also replaced the spectral GCN [26, 65, 66] with spatial GCN [20]. The limitation of the adjacency matrix is that it only reflects the physical connectivity between sensors to capture the latent spatio-temporal correlations [13]. This line of reasoning motivates the development of adaptive graph generation [4, 51, 54]. Some later methods took inspiration from the successes of attention mechanisms [3] applied to spatial GCN [50], combined with the self-attention paradigm of transformer [8, 10, 49, 51, 59], and introduced their own variants of GAT such as [27, 34, 40, 63]. This contrasts with the existing attention-based works on traffic forecasting, such as Attention Based Spatial-Temporal Graph Convolutional Network (ASTGCN) [18] and Reinforced Spatiotemporal Attentive Graph 5 IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Arian Prabowo, Wei Shao, Hao Xue, Piotr Koniusz, and Flora D. Salim Neural Networks (RSTAG) [64], which only focus on past data instead of the road network structure. Attentive Spatial- Temporal Convolutional Network (ASTCN) has also used an attention mechanism to forecast traffic flow on a grid instead of on a graph [17]. Attention mechanisms have retained their popularity over recent years [56, 57]. One approach [30] used GAT to forecast traffic metrics of the edge attributes rather than the sensor attributes, while another [14] used an attention-based method on GPS traces to get a fine-grained representation. More closely related to our present work, other works [1, 60] used attention to capture temporal dynamics. Nevertheless, none of these works took into account the node and edges unique dynamics, nor provided a method to effectively capture these dynamics. 3 METHOD 3.1 Problem Statement The dataset X ∈ RDinput ×N ×K is a tensor where d ∈ Dinput includes the traffic measurements and other contextual information, such that d = 0 is the traffic measurement and d = 1 is the kth the time-of-day, N is the number of recording stations, and K is the number of timesteps. Each data point xk = XDinput ,N ,k:k+L is a tensor, where L is the number of timesteps in the data point. Road networks are abstracted to a directed graph with weighted edges. This graph is represented through a sparse adjacency matrix Ar . The adjacency matrix is normalized between zero and one. An edge with higher weight means that the sensors are closer together, while lower weight means that the sensors are further apart. The traffic forecasting task is a multi-step forecasting problem formalized as follows: h(xk ) = xk+L+F where F is the forecasting horizon. A description of the notation used is presented in Table 1. 3.2 Graph Self-attention WaveNet (G-SWaN) Fig. 4. System architecture of Graph Self-attention WaveNet (G-SWaN). Spatial Graph Transformers (SGT) is the novel module proposed that uses the node embeddings e1 and e2 to capture the unique sensor dynamics in the self-attention mechanisms. The notations are described in Table 1. 6 Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting IoTDI '23, May 9–12, 2023, San Antonio, TX, USA The general structure of the proposed Graph Self-attention WaveNet (G-SWaN) is shown in Figure 4. While we use Graph WaveNet [54] as our backbone, we also make a number of minor improvements. The main contribution in this paper is the SGT module. The major components of G-SWaN are augmentations, initial embedding, G-SWaN layers, and the final fully connected (FC) layers. The initial embedding module, which functions as the encoder for the input x, consists of two parallel FC layers. The output is then passed through W G-SWaN layers, each consisting of a WaveNet module to learn the temporal dynamics and a SGT module to learn the spatial dynamics. The SGT uses adjacency matrices A and node embeddings e1 and e2. These node embeddings learn the node and edge unique dynamics end-to-end. The adjacency matrices A are composed of an adjacency matrix based on the physical connectivity of the road network Ar and a learned adaptive one Aadp . Ar is constructed by passing the Euclidean distance of physically connected sensors through a Radial Basis Function (RBF). Meanwhile, Aadp is constructed as a batched dot product of the node embeddings. Most importantly, SGT uses a self-attention mechanism to make the adjacency matrices A adaptive to the current input. Finally, the output of the G-SWaN layers is passed through FC layers to produce the forecasted future traffic h. The loss function is Mean Absolute Error (MAE). In the tensor shapes, B is the batch size, D is the embedding dimension, N is the number of sensors, and L is the number of timesteps. Many minor elements such as augmentation [62], activation functions [61], batch normalization, tensor reshape, and batch operations are not shown. The major components introduced in this section will be described in the order above. 3.2.1 Augmentation. We use three different augmentations: • Soft spatial occlusion. For each data point, every station has a 5% probability to be partially occluded through a 0.05 scaling. • Temporal permutation. For each data point, every timestep has a 5% probability to have the stations be permuted. • Uniform noise. A uniform noise with a scale of 5% of the standard deviation is added to each entry of a data point. Initial Embedding. The initial embedding consists of two parallel FC layers. Functioning as an encoder, both 3.2.2 project the input to the latent space with an embedding size of D. The first layer (FC metric) projects the historical traffic data, while the second layer (FC tod) projects the time-of-day (tod) information. Because both projections have the same dimensions, they can be aggregated via summation. 3.2.3 G-SWaN Layer. A G-SWaN layer is a spatio-temporal layer made up of three main components: WaveNet [38] as the temporal module, SGT as the spatial module, and an FC layer. The WaveNet module takes the outputs of the previous layer as the input and outputs to the SGT module. The SGT module outputs to the next G-SWaN layer. In the earlier layers, SGT is building simpler spatial latent features as it only has a small temporal receptive field. However, in the later layers, SGT is building a richer spatiotemporal latent feature as the receptive field covers the entire observation window. To deal with diminishing gradients, the outputs of both the temporal and spatial module are also connected to the final FC layer in the G-SWaN layer to form residual connections [21]. This FC layer has Dr neurons. The outputs of each FC layer is then aggregated via summation. This is detailed in Figure 5. The final FC are the ones below the gray area. The WaveNet and SGT modules are described in the following two sections. 7 IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Arian Prabowo, Wei Shao, Hao Xue, Piotr Koniusz, and Flora D. Salim 3.2.4 WaveNet. WaveNet [38] is a convolutional alternative to RNN that deals with sequential data. By using dilation, it gives exponential increases of receptive field width with respect to the number of layers, as opposed to traditional CNN. Following the original Graph WaveNet [54], two WaveNet are used per layer in parallel. One is activated with tanh and acts as a convolutional filter, while the other is activated with sigmoid and acts as a gating mechanism on each latent channel. The outputs of the WaveNet module are passed on to the SGT. Additionally, a residual connection is passed to the final FC layer of the corresponding G-SWaN layer. Fig. 5. A layer of G-SWaN contains a WaveNet temporal block (blue) and a Spatial Graph Transformer (SGT) block (red). SGT uses node embedding (e1 and e2) to apply multi-headed a query and key self-attention mechanism on the adjacency matrix A. This way, the self-attention mechanism is sensitive to the unique dynamics of every pair of sensors. There are H attention heads and W layers. Some details such as activation functions and batch normalization are also not shown. 3.2.5 Spatial Graph Transformer (SGT). When modelling the spatial dynamics, it is important to factor in that spatial dynamics change periodically through time, as shown in Figure 3(b). However, many current works do not take this into account. Here are three examples from STGCN [58], AGCRN [4], and Graph WaveNet [54], respectively: x′ = W(AL)x, x′ = WE WW xAL, x′ = K ∑︁ k k k adp, p + W2,k xA W1,k xA (1) (2) (3) where x and x′ are the input and output from and to the previous and subsequent layers, respectively, W, WE , WW , W1,k , and W1,k are all learnable parameters, AL is the Laplacian of the adjacency matrix [26], Ap is the power normalized adjacency matrix [32], Aadp is the adaptive adjacency matrix, and K is the number hops in the spatial diffusion. In all three cases, the adjacency matrices A are not a function of the input signal x, rendering them incapable to adapt to the changes in the spatial dynamics. To address this issue, we propose a novel module called SGT to make the 8 Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting IoTDI '23, May 9–12, 2023, San Antonio, TX, USA GCN adaptive to the unique and changing dynamics of each pair of sensors. This has some similarity with the attention mechanism in GAT [50]. SGT uses a transformer-like query, key, and value formulation of self-attention [49]. We propose the following graph convolution layer: x′(x|e1, e2) = K,H ∑︁ k,h W1,k xα (Ar |x, e1, e2)k + W2,k xα (Aadp |x, e1, e2)k (4) where e1 and e2 are the source and target node embeddings, H is the number of attention heads, Ar is the adjacency matrix based on the physical road connectivity, and finally the α (A|X, e1, e2) function is the attention mechanism that is adaptive to the input signal x, which is going to be described in more detail in the following paragraph. The (cid:205) operation could be generalized to any aggregating function. In our case, (cid:205) is implemented as two FC layers, shown in Figure 5 to the right of the red area and at the bottom right of the grey area. Aadp is a learned adjacency matrix to capture complex spatial relations that is not captured through the former adjacency matrix (Ar ). This is shown in the bottom row of Figure 4. The adaptive adjacency matrix is calculated as follows: Finally, α (*) is a self-attention mechanism that dynamically determines the attention given to each edge, based on the current input and node embeddings. It is defined as follows: Aadp = So f tMax (ReLU (e1e2 T )). (5) α (A|x, e1, e2) = So f tMax (cid:16) σ (A ∗ Q (x, e1)K (x, e2)T ), τ (cid:17) (6) where ∗ is an element-wise matrix multiplication, σ is an activation function, and τ is the softmax temperature. In equation (6), the query Q and key K matrices are given through two FC layers: K (x, e1) = FCK (x + e1), Q (x, e2) = FCQ (x + e2). (7) (8) The query Q (x, e2) and key K (x, e2) matrices are functions of both the input x and node embeddings e1 and e2. This formulation enables the SGT module to be adaptive to the unique and changing dynamics of each pair of sensors. 3.2.6 Final FC and Loss. The final FC layers take the aggregated output of the G-SWaN layers and act as a decoder. In this sense, the G-SWaN layers act as a spatio-temporal encoder that produce compact representations of the input in contrast to multi-way tensor representations [28]. It outputs the forecast h for the next F timesteps at all N sensors. 3.2.7 Loss and Optimizer. Following previous works, we use Mean Absolute Error (MAE) as the loss function and Adam with weight decay as the optimizer. 3.2.8 Minor Improvements. Additionally, there are a number of minor modifications. First, we adopt changes suggested by [45]: (1) Adding a time-of-day feature and separate FC layer for embedding. (2) Increasing the number of hidden channels from 32 to 40. (3) Introducing a learning rate decay with a factor of 0.97 per epoch. (4) Reducing the gradient clipping from 5 to 3 as additional residual connections are introduced around the GCN. (5) Replacing missing data with the average of training data, instead of zero. As well as the changes discussed above, a series of minor changes are introduced: (1) Using Mish [37] as activation function. (2) contrary to the finding in [45], batch normalization is found to be useful and is implemented accordingly. 9 IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Arian Prabowo, Wei Shao, Hao Xue, Piotr Koniusz, and Flora D. Salim 4 EXPERIMENT 4.1 Dataset Table 2. Dataset description. Dataset Spatial Temporal Value Size Sensors Edges Timesteps Range (duration in days) Metric Mean ± Std Entry Compressed (MB) METR-LA PeMS-BAY PeMS-D4 PeMS-D8 207 325 307 170 1,515 2,694 340 277 34,272 52,116 16,969 17,833 1 Mar 12 - 30 Jun 12 (121) 1 Jan 17 - 30 Jun 17 (180) 1 Jan 18 - 28 Feb 18 (58) 1 Jul 16 - 31 Aug 16 (61) speed speed flow flow 53.72± 20.26 62.61± 9.59 211.70± 158.07 230.68± 146.22 7,094,304 16,937,700 5,209,483 3,031,610 54 130 31 18 We use four open, real-world, datasets that have been previously been used by other works as benchmarks [4, 18, 32, 46, 54, 58, 59]. The important statistics of these datasets are available in Table 2. All datasets record the relevant traffic metric every five minutes (one timestep) at various recording stations (sensors) in a road network. The traffic metric recorded by METR-LA and PeMS-BAY is the average speed, while PeMS-D4 and PeMS-D8 is the flow (number of vehicles, also known as traffic volume). They are all also accompanied with time-of-day information. As can be seen in Figure 6, the speed datasets have negative skews while the flow datasets have positive skews. This is because most of the time, the road networks are not congested and vehicles are traveling at the speed limit. This is also shown through the slight negative correlation in the fundamental diagrams in Figure 2(c). We selected these datasets because they are publicly available, and because they vary in important ways, as described below: • METR-LA [23]. This dataset is collected from loop detectors in LA, USA county highway. This is the most popular dataset for traffic forecasting. • PeMS-BAY [32]. This dataset is collected by California Transportation Agencies (CalTrans) Performance Mea- surement System (PeMS), also from loop detectors. This is the second most popular dataset for traffic forecasting. This is the largest dataset in terms of sensors, edges, timesteps, and entries among the four we are using. • PeMS-D4. This dataset is also from CalTrans PeMS. This, together with PeMS-D8, is the most popular dataset for traffic flow forecasting. To the best of our knowledge, three works have also used both of these datasets [4, 18, 46]. It contains sensor data from freeways of district 4 in California, USA. Temporally, this is the shortest dataset. • PeMS-D8. This dataset is also from CalTrans PeMS. All three works that used the PeMS-D4 dataset also used this dataset. However, it is coming from district 8. This is the smallest dataset in terms of sensors, edges, and number of entries. All datasets are accompanied with an adjacency matrix based on the network distance between sensors. To maintain consistency with previous works, we construct the adjacency matrix by passing the network distance between connected sensors through a Gaussian RBF: (cid:32) Ai,j = exp − (cid:19)2(cid:33) (cid:18) d (ni, n j ) σd (9) where Ai,j is the i-th row and j-th entry of adjacency matrix A, d (ni, n j ) is the network distance between sensor ni and sensor n j , and σd is the standard deviation of all the network distance between all immediately connected sensors. 10 Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Fig. 6. Visualization of the temporal dynamics and distribution of the datasets. 4.2 Experimental Setup We use the common experimental setup as typical in previous works. One timestep consists of a 5-minute average speed for every sensor in the road network. One datapoint of an input is made up of 12 consecutive timesteps (1 hour), and the output is the next 12 timesteps. 11 IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Arian Prabowo, Wei Shao, Hao Xue, Piotr Koniusz, and Flora D. Salim 4.2.1 Training, Validation, and Test Split. In order to match the setting of previous works, the split ratio differs depending on the traffic metric. For the datasets with the speed metric, we use 7:1:2 temporal split, following [54]. For the datasets with the flow metric, we use 6:2:2 temporal split, following [4]. 4.2.2 Feature Scaling. We scale the speed channel of our input to achieve standard distribution as follows: x ′ = x − μx σx (10) where x is the raw input, x ′ is the input after scaling, μx is the average of the raw input, σx is the standard deviation of the raw input. This way, our input has zero mean and a standard deviation of one. The time-of-day feature is scaled using MinMax scaler. 4.2.3 Computing Infrastructure. All of the models are implemented in Python 3.7.4 with PyTorch 1.5.1 (cuDNN 7.6.5 and CUDA 10.1). They are executed in a computing sensor with one NVIDIA Tesla V100 GPU card and Intel(R) Xeon(R) Platinum 8268 CPU @ 2.90GHz. 4.2.4 Metrics. To evaluate the prediction performance of the proposed methods, three widely used metrics are selected, namely Mean Average Error (MAE), Mean Average Percentage Error (MAPE), and Root Mean Square Error (RMSE). They are defined as follows: MAE = 1 N N ∑︁ n=1 |yn − hn|, MAPE = 100% N N ∑︁ n=1 (cid:12) (cid:12) (cid:12) (cid:12) yn − hn yn (cid:12) (cid:12) (cid:12) (cid:12) , RMSE = (cid:118)(cid:117)(cid:116) 1 N N ∑︁ n=1 (yn − hn)2, (11) (12) (13) where y is the actual label, h is the predicted value, and N is the number of datapoints. All three metrics are useful to compare the error profile of different models. MAE is the most interpretable since it is simply the average absolute error. RMSE is more sensitive to larger errors, thus when RMSE is significantly larger than MAE, it indicates that models make fewer mistakes, but those mistakes are larger in magnitude. This information is important for users of the traffic models. Finally, MAPE is unitless, making it useful for comparison between datasets. Following the previous work, we report the performance at three forecasting horizons (15, 30, and 60 minutes) for the speed datasets (METR-LA and PeMS-BAY) [32, 54]; whereas the average MAE, MAPE, and RMSE across the next 12 timesteps (corresponding to one hour) are reported for the flow datasets (PeMS-D4 and PeMS-D8) [18, 46, 46]. 4.3 Baselines We compare G-SWaN with the performances of the following models: (1) HA [4] Historical Average assumes daily periodicity and takes the average of the same time slot from the previous period; (2) ARIMA [19] Auto-Regressive Integrated Moving Average; (3) VAR [67] Vector Auto Regressive; (4) SVR [31] Support Vector Regression; (5) FNN [31] Feed-forward Neural Network; (6) FC-LSTM [32] Fully Connected, Long Short-Term Memory network; (7) GRU-ED [11] Gated Recurrent Unit Encoder Decoder; (8) DSANet [22] Dual Self-Attention Network uses self-attention to capture spatial correlation; (9) DCRNN [32] Diffusion Convolution Recurrent Neural Network with graph convolution 12 Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting IoTDI '23, May 9–12, 2023, San Antonio, TX, USA in the spatial block and GRU in the temporal block; (10) STGCN [58] Spatio-Temporal Graph Convolutional Network, using spectral GCN; (11) Graph WaveNet [54] uses spatial GCN [20] in the spatial block and WaveNet [38] in their temporal block; (12) ST-MetaNet [39] Spatio-temporal Meta-learning Network; (13) ASTGCN [18] Attention-based Spatio-Temporal Graph Convolution Network uses both spatial and temporal attention; (14) STSGCN [46] Spatio- Temporal Synchronous Graph Convolution Network captures spatio-temporal dynamics by adding temporal edges to their graph convolution; (15) AGCRN [4] Adaptive Graph Convolutional Recurrent Network generates an adaptive spatial graph to complement the physical road network adjacency matrix; (16) GMAN [63] Graph Multi-Attention Network uses spatio-temporal and transform attention; (17) MTGNN [55] Multivariate Time-series Graph Neural Network uses meta-learning to learn the weights of the spatial and temporal module. Besides for G-SWaN, the results in Table 3 are based on the benchmark performed by [31], while for Table 4, it was performed by [4]. The exception is for Graph WaveNet in Table 4, which was reproduced by us. 5 RESULTS 5.1 Performance Comparison Table 3. Performance comparison on speed metric using METR-LA and PeMS-BAY datasets. Since all the metrics are error metrics, lower means better. Prediction horizon = 15 / 30 / 60 minutes. Bold means the best performance within the metric. Underline means the second best performance. (Metric: speed) Model HA ARIMA VAR SVR FNN FC-LSTM DCRNN STGCN Graph WaveNet ST-MetaNet ASTGCN STSGCN AGCRN GMAN MTGNN G-SWaN (ours) MAE 4.16 3.99/5.15/6.90 4.42/5.41/6.52 3.99/5.05/6.72 3.99/4.23/4.49 3.44/3.77/4.37 2.77/3.15/3.60 2.88/3.47/4.59 2.69/3.07/3.53 2.69/3.10/3.69 4.86/5.43/6.51 3.31/4.13/5.06 2.87/3.23/3.62 2.80/3.12/3.44 2.69/3.05/3.49 2.65/3.02/3.47 METR-LA RMSE 7.80 8.21/10.45/13.23 7.89/9.13/10.11 8.45/19.87/13.76 7.94/8.17/8.69 6.30/7.23/8.69 5.38/6.45/7.60 5.74/7.24/9.40 5.15/6.22/7.37 5.17/6.28/7.52 9.27/10.61/12.52 7.62/9.77/11.66 5.58/6.58/7.51 5.55/6.49/7.35 5.18/6.17/7.23 5.05/6.12/7.27 MAPE (%) MAE 13.00 9.60/12.70/17.40 10.20/12.70/15.80 9.30/12.10/16.7 9.90/12.90/14.00 9.60/10.90/13.20 7.30/8.80/10.50 7.62/9.57/12.70 6.90/8.37/10.01 6.91/8.57/10.63 9.21/10.13/11.64 8.06/10.29/12.91 7.70/9.00/10.38 7.41/8.73/10.07 6.86/8.19/9.87 6.72/8.13/9.86 2.88 1.62/2.33/3.38 1.74/2.32/2.93 1.85/2.48/3.28 2.20/2.30/2.46 2.05/2.20/2.37 1.38/1.74/2.07 1.36/1.81/2.49 1.30/1.63/1.95 1.36/1.76/2.20 1.52/2.01/2.61 1.44/1.83/2.26 1.37/1.69/1.96 1.34/1.63/1.86 1.32/1.65/1.94 1.30/1.61/1.91 PeMS-BAY RMSE 5.59 3.30/4.76/6.50 3.16/4.25/5.44 3.59/5.18/7.08 4.42/4.63/4.98 4.19/4.55/4.96 2.95/3.97/4.74 2.96/4.27/5.69 2.74/3.70/4.52 2.90/4.02/5.06 3.13/4.27/5.42 3.01/4.18/5.21 2.87/3.85/4.54 2.91/3.76/4.32 2.79/3.74/4.49 2.72/3.64/4.37 MAPE (%) 6.80 3.50/5.40/8.30 3.60/5.00/6.50 3.80/5.50/8.00 5.19/5.43/5.89 3.80/5.20/5.70 2.90/3.90/4.90 2.90/4.17/5.79 2.73/3.67/4.63 2.82/4.00/5.45 3.22/4.48/6.00 3.04/4.17/5.40 2.94/3.87/4.64 2.86/3.68/4.37 2.77/3.69/4.53 2.69/3.62/4.49 Table 3 and 4 present the results of our G-SWaN and other methods. For each column, the best result is given in bold. Note that HA makes the same prediction regardless of the forecasting horizon, so we only have one value for each metric. When the forecasting horizon is increasing, the prediction performance of each method becomes worse, which is as expected. As can be seen from Table 3 and 4, the proposed G-SWaN achieves the best performances in all datasets, across all metrics, with few exceptions. In those exceptions, G-SWaN always comes in the second place. Overall, these results demonstrate the superior performance of our G-SWaN. 13 IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Arian Prabowo, Wei Shao, Hao Xue, Piotr Koniusz, and Flora D. Salim Table 4. Performance comparison on flow metric using PeMS-D4 and PeMS-D8 datasets. Since all the metrics are error metrics, lower means better. Bold means the best performance within the metric. Underline means the second best performance. (Metric: flow) PeMS-D4 PeMS-D8 Model MAE RMSE MAPE MAE RMSE MAPE 52.04 59.24 38.03 HA VAR 29.81 38.61 24.54 36.23 39.27 23.68 GRU-ED DSANet 26.96 35.77 22.79 26.36 33.44 21.22 DCRNN STGCN 27.09 34.89 21.16 30.04 42.08 Graph WaveNet 28.98 ASTGCN 28.06 35.22 22.93 26.86 33.65 21.19 STSGCN AGCRN 25.22 32.26 19.83 G-SWaN (ours) 18.48 30.51 12.59 14.05 23.00 27.88 17.24 16.44 16.03 14.17 13.83 30.80 16.56 13.90 12.97 34.86 19.19 22.00 17.14 16.82 17.50 20.52 18.25 17.13 15.95 24.07 13.10 13.33 11.32 10.92 11.29 16.20 11.64 10.96 10.09 9.08 Since MAPE is unitless, it provides a useful metric to compare different datasets. The results show that some datasets are easier than others (i.e. achieving lower error), because the datasets have different variability in the first place. Broadly speaking, the speed datasets seem to be easier than the flow datasets. PeMS-BAY is the easiest dataset, where all models seem to have low MAPE, including the non-learning baselines HA and ARIMA. Since there is no learning with HA and ARIMA, the reason cannot be that PeMS-BAY has more datapoints to learn from, but rather that it has low variability, as shown with low standard deviation in Table 2, even as a proportion to the mean value 15.32%. Using this ratio between standard deviation to mean, we could rank the difficulty of the datasets. From easiest to hardest, the subsequent ranking is, METR-LA (37.7%), PeMS-D8 (63.39%), and finally PeMS-D4 (74.67%) as the most difficult. Moreover, the difference between the spread of different datasets can also be observed visually in Figure 6. The speed datasets usually hover around the speed limit, while the value of the flow datasets cycles more drastically throughout the day, resulting in a wider distribution, as seen from the violin plots. This method of ranking is mostly correct when comparing the MAPE across the datasets, except that PeMS-D8 is more difficult than PeMS-D4, despite the lower standard deviation, both in absolute value and proportion. Again, this could be explained, not by the lack of training data but by the lack of periodic behavior. This can be shown by the disparity of the MAPE error for the non-learning model HA, which is simply the average value from the day before. G-SWaN performance gain seems to be relative to the difficulty of the dataset. For example, at PeMS-BAY, since it is an easier datasets [31] and all the other models are already performing relatively well, our improvements are marginal. At 15 minutes forecasting horizon, G-SWaN only achieves the same MAE with Graph WaveNet, while at 60 minutes horizon, G-SWaN was outperformed by GMAN. With the relative difficulty of the datasets discussed, we can compare the models across datasets. There are nine models that are implemented across all datasets: HA, VAR, DCRNN, STGCN, Graph WaveNet, ASTGCN, STSGCN, AGCRN, and G-SWaN. As expected, deep learning models outperformed their classical counterparts. Simply adding an attention mechanism does not guarantee improvement, however as shown through the performance of ASTGCN, as opposed to GMAN and G-SWaN. 14 Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Both G-SWaN and AGCRN employ a data adaptive adjacency matrix. AGCRN used matrix factorization to achieve this, while G-SWaN used a self-attention mechanism. The superior performance of G-SWaN corroborates the literature regarding the importance of self-attention mechanisms when introducing data adaptive components. Table 5. Ablation study on PeMS-D8. Bold means the worst performance, showing the importance of the missing component. Underline means the second worst. Model G-SWaN w/o spatial occlusion w/o temporal permutation w/o uniform noise w/o node embeddings Single head attention GCN w/o SGT MAE MAPE (%) RMSE 14.05 14.12 14.21 14.11 14.29 14.21 14.62 9.08 9.14 9.18 9.22 9.22 9.14 9.52 23.00 23.10 23.15 23.15 23.11 23.05 23.34 5.2 Ablation We performed ablation analysis on the PeMS-D8 dataset, as shown in Table 5. We used the same experimental setup for the PeMS-D8 dataset. We named G-SWaN without different components as follows: (1) w/o spatial occlusion: G-SWaN without the spatial occlusion augmentation as described in section 3.2.1; (2) w/o temporal permutation: G-SWaN without the temporal permutation augmentation as described in section 3.2.1; (3) w/o uniform noise: G-SWaN without the uniform noise augmentation as described in section 3.2.1; (4) w/o node embeddings: G-SWaN without having the node embeddings fused with the keys and queries matrices in SGT. See Equation 7; (5) Single head attention: G-SWaN where the SGT only had one attention head (H = 1); (6) GCN w/o SGT: G-SWaN where we replaced the SGT with the GCN described in [54]. The ablation analysis results show that each of the components of G-SWaN is effective. In particular, the results show that the worst is the variant without SGT (in bold), the main contribution of this paper. Moreover, removing the node embeddings from the SGT module also degrades the MAE and MAPE performances significantly, resulting in the second worse version (underlined). This agrees with our hypothesis that SGT and integrating node embeddings in the self-attention mechanism improved the performances by capturing the individual sensor dynamics, the pair dynamics, and the evolution of the dynamics through time. 5.3 Node Embedding Analysis To further investigate the node embeddings, we wanted to see if the node embeddings managed to learn spatial information that was not part of the training data. For this purpose, we tried to find any linear and trigonometric relationships between the node embeddings and the spatial coordinates of each sensor (longitude and latitude). We used Coefficient of determination (R2) as a metric. This was implemented in the dataset with the most sensors, PeMS-BAY. First, we performed linear regression on each sensor, using a concatenation of source e1 and target e2 node embeddings as the feature vector, and the longitude and latitude as the labels. We obtained R2 = 0.401, showing a non-trivial 15 IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Arian Prabowo, Wei Shao, Hao Xue, Piotr Koniusz, and Flora D. Salim Fig. 7. Recovering sensor coordinates from node embeddings using a linear probe with trigonometric kernels. correlation between the node embeddings with the coordinates of the sensors. This confirms that the node embeddings do contain spatial information. Since the node embeddings were learned as a part of a non-linear deep learning method, there was no guarantee that linear probing was the best tool to analyze the learned features. To address this, we used three trigonometric functions as kernels for the node embeddings: sin(*), cos (*), and tan(*). Using linear regression with the kernels, we obtained R2 = 0.996. To visually evaluate this, we plotted the coordinates' value based on the linear probing of the node embeddings with trigonometric kernels as shown in Figure 7. The figure shows that all the orange crosses are located close to the ground truth (blue circles). This again confirms that node embeddings learned spatial information from the data. 5.4 Adaptive Adjacency Matrix Analysis Adaptive adjacency matrix Aadp is a learned adjacency matrix described in section 3.2.5. It is also constructed based on node embeddings. Its purpose is to capture interesting connections between sensors that are not due to physical connections in the road network. Intuitively, therefore, it should have minimal overlap with the adjacency matrix from the physical road network. This can be qualitatively shown in Figure 8. The figure shows that the physical edges (black lines) connect nearby sensors, while the adaptive adjacency (red lines) connects the sensors that are physically far away. To further test this empirically, we flattened the adjacency matrices and calculated the cosine similarity between the physical and adaptive ones. The similarity is 0.0226, which shows that they are widely different. 16 Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Fig. 8. Qualitative comparison between physical and adaptive adjacency matrix in METR-LA dataset. The line transparency is proportional to the edge weight. 6 CONCLUSION In this paper, we show that each sensor in a road network has a unique traffic dynamic. Moreover, each pair of sensors also has a unique dynamic that displays periodic behaviors. To capture these phenomena, we present G-SWaN, a novel traffic forecasting architecture. This behavior can be handled by SGT, which is proposed to replace GCN, a widely used model for traffic forecasting, since SGT is more general and able to mask the adjacency matrix adaptively to the data. In order to make the SGT adaptive to the sensor location as well, it incorporates node embeddings that adapt the self-attention mechanism with spatial information and sensor-unique dynamics for every source-target sensor pair. Our experiments on four open, real-world datasets show that G-SWaN achieved state-of-the-art performance. Finally, through recovering the co-ordinates, we show that the node embeddings learned meaningful spatial information. These findings should inform future traffic models regarding the importance of capturing sensors and sensor pairs unique dynamics. REFERENCES [1] Amr Abdelraouf, Mohamed Abdel-Aty, and Jinghui Yuan. 2021. Utilizing Attention-Based Multi-Encoder-Decoder Neural Networks for Freeway Traffic Speed Prediction. IEEE Transactions on Intelligent Transportation Systems (2021). 17 IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Arian Prabowo, Wei Shao, Hao Xue, Piotr Koniusz, and Flora D. Salim [2] Mohammed S Ahmed and Allen R Cook. 1979. Analysis of freeway traffic time-series data by using Box-Jenkins techniques. Vol. 722. Transportation Research Record. [3] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations. [4] Lei Bai, Lina Yao, Can Li, Xianzhi Wang, and Can Wang. 2020. Adaptive Graph Convolutional Recurrent Network for Traffic Forecasting. In Advances in neural information processing systems. [5] Nicola Bellomo and Christian Dogbe. 2011. On the modeling of traffic and crowds: A survey of models, speculations, and perspectives. SIAM review 53, 3 (2011), 409–463. [6] Florent Berthelin, Pierre Degond, Marcello Delitala, and Michel Rascle. 2008. A model for the formation and evolution of traffic jams. Archive for Rational Mechanics and Analysis 187, 2 (2008), 185–220. [7] Michael M Bronstein, Joan Bruna, Taco Cohen, and Petar Veličković. 2021. Geometric deep learning: Grids, groups, graphs, geodesics, and gauges. arXiv preprint arXiv:2104.13478 (2021). [8] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems. [9] Chenyi Chen, Yin Wang, Li Li, Jianming Hu, and Zuo Zhang. 2012. The retrieval of intra-day trend and its influence on traffic prediction. Transportation research part C: emerging technologies 22 (2012), 103–118. [10] Mark Chen, Alec Radford, Rewon Child, Jeff Wu, Heewoo Jun, Prafulla Dhariwal, David Luan, and Ilya Sutskever. 2020. Generative Pretraining from Pixels. In Proceedings of the 37th International Conference on Machine Learning. [11] Kyunghyun Cho, Bart van Merrienboer, Çaglar Gülçehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation. In EMNLP. [12] Zhiyong Cui, Longfei Lin, Ziyuan Pu, and Yinhai Wang. 2020. Graph Markov network for traffic forecasting with missing data. Transportation Research Part C: Emerging Technologies 117 (2020), 102671. [13] Rodrigo de Medrano and José L Aznarte. 2020. On the Inclusion of Spatial Information for Spatio-Temporal Neural Networks. arXiv preprint arXiv:2007.07559 (2020). [14] Mengyuan Fang, Luliang Tang, Xue Yang, Yang Chen, Chaokui Li, and Qingquan Li. 2021. FTPG: A Fine-Grained Traffic Prediction Method With Graph Attention Network Using Big Trace Data. IEEE Transactions on Intelligent Transportation Systems (2021). [15] Rui Fu, Zuo Zhang, and Li Li. 2016. Using LSTM and GRU neural network methods for traffic flow prediction. In 2016 31st Youth Academic Annual Conference of Chinese Association of Automation (YAC). IEEE, 324–328. [16] Nan Gao, Hao Xue, Wei Shao, Sichen Zhao, Kyle Kai Qin, Arian Prabowo, Mohammad Saiedur Rahaman, and Flora D Salim. 2020. Generative Adversarial Networks for Spatio-temporal Data: A Survey. arXiv preprint arXiv:2008.08903 (2020). [17] Haizhou Guo, Dian Zhang, Landu Jiang, Kin-Wang Poon, and Kezhong Lu. 2021. ASTCN: An Attentive Spatial Temporal Convolutional Network for Flow Prediction. IEEE Internet of Things Journal (2021). [18] Shengnan Guo, Youfang Lin, Ning Feng, Chao Song, and Huaiyu Wan. 2019. Attention based spatial-temporal graph convolutional networks for traffic flow forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 33. 922–929. [19] Mohammad M Hamed, Hashem R Al-Masaeid, and Zahi M Bani Said. 1995. Short-term prediction of traffic volume in urban arterials. Journal of Transportation Engineering 121, 3 (1995), 249–254. [20] Will Hamilton, Zhitao Ying, and Jure Leskovec. 2017. Inductive representation learning on large graphs. In Advances in neural information processing systems. 1024–1034. [21] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition. 770–778. [22] Siteng Huang, Donglin Wang, Xuehan Wu, and Ao Tang. 2019. DSANet: Dual Self-Attention Network for Multivariate Time Series Forecasting. In The 28th ACM International Conference on Information and Knowledge Management (CIKM 2019). Beijing, China. [23] Hosagrahar V Jagadish, Johannes Gehrke, Alexandros Labrinidis, Yannis Papakonstantinou, Jignesh M Patel, Raghu Ramakrishnan, and Cyrus Shahabi. 2014. Big data and its technical challenges. Commun. ACM 57, 7 (2014), 86–94. [24] Young-Seon Jeong, Young-Ji Byon, Manoel Mendonca Castro-Neto, and Said M Easa. 2013. Supervised weighting-online learning algorithm for short-term traffic flow prediction. IEEE Transactions on Intelligent Transportation Systems 14, 4 (2013), 1700–1707. [25] Yiannis Kamarianakis and Poulicos Prastacos. 2003. Forecasting traffic flow conditions in an urban network: Comparison of multivariate and univariate approaches. Transportation Research Record 1857, 1 (2003), 74–84. [26] Thomas N Kipf and Max Welling. 2017. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations. [27] Xiangyuan Kong, Weiwei Xing, Xiang Wei, Peng Bao, Jian Zhang, and Wei Lu. 2020. STGAT: Spatial-Temporal Graph Attention Networks for Traffic Flow Forecasting. IEEE Access 8 (2020), 134363–134372. [28] Piotr Koniusz, Lei Wang, and Anoop Cherian. 2021. Tensor representations for action recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence 44, 2 (2021), 648–665. [29] Sangsoo Lee and Daniel B Fambro. 1999. Application of subset autoregressive integrated moving average model for short-term freeway traffic volume forecasting. Transportation Research Record 1678, 1 (1999), 179–188. 18 Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting IoTDI '23, May 9–12, 2023, San Antonio, TX, USA [30] Duo Li and Joan Lasenby. 2021. Spatiotemporal Attention-Based Graph Convolution Network for Segment-Level Traffic Prediction. IEEE Transactions on Intelligent Transportation Systems (2021). [31] Fuxian Li, Jie Feng, Huan Yan, Guangyin Jin, Depeng Jin, and Yong Li. 2021. Dynamic Graph Convolutional Recurrent Network for Traffic Prediction: Benchmark and Solution. arXiv preprint arXiv:2104.14917 (2021). [32] Yaguang Li, Rose Yu, Cyrus Shahabi, and Yan Liu. 2018. Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting. In International Conference on Learning Representations. [33] Marco Lippi, Matteo Bertini, and Paolo Frasconi. 2013. Short-term traffic flow forecasting: An experimental comparison of time-series analysis and supervised learning. IEEE Transactions on Intelligent Transportation Systems 14, 2 (2013), 871–882. [34] Bin Lu, Xiaoying Gan, Haiming Jin, Luoyi Fu, and Haisong Zhang. 2020. Spatiotemporal Adaptive Gated Graph Convolution Network for Urban Traffic Flow Forecasting. In Proceedings of the 29th ACM International Conference on Information & Knowledge Management. 1025–1034. [35] Dan Luo, Dong Zhao, Qixue Ke, Xiaoyong You, Liang Liu, and Huadong Ma. 2021. Spatio-Temporal Hashing Multi-Graph Convolutional Network for Service-level Passenger Flow Forecasting in Bus Transit Systems. IEEE Internet of Things Journal (2021). [36] Yisheng Lv, Yanjie Duan, Wenwen Kang, Zhengxi Li, and Fei-Yue Wang. 2014. Traffic flow prediction with big data: a deep learning approach. IEEE Transactions on Intelligent Transportation Systems 16, 2 (2014), 865–873. [37] Diganta Misra. 2019. Mish: A self regularized non-monotonic neural activation function. arXiv preprint arXiv:1908.08681 (2019). [38] Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. 2016. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499 (2016). [39] Zheyi Pan, Yuxuan Liang, Weifeng Wang, Yong Yu, Yu Zheng, and Junbo Zhang. 2019. Urban traffic prediction from spatio-temporal data using deep meta learning. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 1720–1730. [40] Cheonbok Park, Chunggi Lee, Hyojin Bahng, Kihwan Kim, Seungmin Jin, Sungahn Ko, Jaegul Choo, et al. 2019. Stgrat: A spatio-temporal graph attention network for traffic forecasting. arXiv preprint arXiv:1911.13181 (2019). [41] Arian Prabowo, Piotr Koniusz, Wei Shao, and Flora D Salim. 2019. COLTRANE: ConvolutiOnaL TRAjectory NEtwork for Deep Map Inference. In Proceedings of the 6th ACM International Conference on Systems for Energy-Efficient Buildings, Cities, and Transportation. 21–30. [42] Hongxin Shao. 2020. Deep learning approaches for traffic prediction. Ph. D. Dissertation. Nanyang Technological University. [43] Wei Shao, Arian Prabowo, Sichen Zhao, Piotr Koniusz, and Flora D Salim. 2022. Predicting flight delay with spatio-temporal trajectory convolutional network and airport situational awareness map. Neurocomputing 472 (2022), 280–293. [44] Wei Shao, Arian Prabowo, Sichen Zhao, Siyu Tan, Piotr Koniusz, Jeffrey Chan, Xinhong Hei, Bradley Feest, and Flora D Salim. 2019. Flight Delay Prediction using Airport Situational Awareness Map. In Proceedings of the 27th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems. 432–435. [45] Sam Shleifer, Clara McCreery, and Vamsi Chitters. 2019. Incrementally Improving Graph WaveNet Performance on Traffic Prediction. arXiv preprint arXiv:1912.07390 (2019). [46] Chao Song, Youfang Lin, Shengnan Guo, and Huaiyu Wan. 2020. Spatial-Temporal Synchronous Graph Convolutional Networks: A New Framework for Spatial-Temporal Network Data Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 34. 914–921. [47] Mascha Van Der Voort, Mark Dougherty, and Susan Watson. 1996. Combining Kohonen maps with ARIMA time series models to forecast traffic flow. Transportation Research Part C: Emerging Technologies 4, 5 (1996), 307–318. [48] Femke van Wageningen-Kessels, Hans Van Lint, Kees Vuik, and Serge Hoogendoorn. 2015. Genealogy of traffic flow models. EURO Journal on Transportation and Logistics 4, 4 (2015), 445–473. [49] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in neural information processing systems. 5998–6008. [50] Petar Veličković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. 2018. Graph Attention Networks. International Conference on Learning Representations (2018). https://openreview.net/forum?id=rJXMpikCZ accepted as poster. [51] Xiaoyang Wang, Yao Ma, Yiqi Wang, Wei Jin, Xin Wang, Jiliang Tang, Caiyan Jia, and Jian Yu. 2020. Traffic Flow Prediction via Spatial Temporal Graph Neural Network. In Proceedings of The Web Conference 2020. 1082–1092. [52] Billy M Williams. 2001. Multivariate vehicular traffic flow prediction: Evaluation of ARIMAX modeling. Transportation Research Record 1776, 1 (2001), 194–200. [53] Billy M Williams and Lester A Hoel. 2003. Modeling and forecasting vehicular traffic flow as a seasonal ARIMA process: Theoretical basis and empirical results. Journal of transportation engineering 129, 6 (2003), 664–672. [54] Qiong Wu, Qin Fu, and Mingxin Nie. 2020. Graph Wavelet Long Short-Term Memory Neural Network: A Novel Spatial-Temporal Network for Traffic Prediction. In Journal of Physics: Conference Series, Vol. 1549. IOP Publishing, 042070. [55] Zonghan Wu, Shirui Pan, Guodong Long, Jing Jiang, Xiaojun Chang, and Chengqi Zhang. 2020. Connecting the Dots: Multivariate Time Series Forecasting with Graph Neural Networks. In KDD '20: The 26th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Virtual Event, CA, USA, August 23-27, 2020, Rajesh Gupta, Yan Liu, Jiliang Tang, and B. Aditya Prakash (Eds.). ACM, 753–763. https://doi.org/10.1145/3394486.3403118 [56] Hao Xue, Flora Salim, Yongli Ren, and Nuria Oliver. 2021. MobTCast: Leveraging auxiliary trajectory forecasting for human mobility prediction. Advances in Neural Information Processing Systems 34 (2021), 30380–30391. [57] Hao Xue and Flora D Salim. 2021. TERMCast: Temporal relation modeling for effective urban flow forecasting. In Advances in Knowledge Discovery and Data Mining: 25th Pacific-Asia Conference, PAKDD 2021, Virtual Event, May 11–14, 2021, Proceedings, Part I. Springer, 741–753. 19 IoTDI '23, May 9–12, 2023, San Antonio, TX, USA Arian Prabowo, Wei Shao, Hao Xue, Piotr Koniusz, and Flora D. Salim [58] Bing Yu, Haoteng Yin, and Zhanxing Zhu. 2018. Spatio-temporal Graph Convolutional Networks: A Deep Learning Framework for Traffic Forecasting. In Proceedings of the 27th International Joint Conference on Artificial Intelligence (IJCAI). [59] Jiani Zhang, Xingjian Shi, Junyuan Xie, Hao Ma, Irwin King, and Dit Yan Yeung. 2018. GaAN: Gated Attention Networks for Learning on Large and Spatiotemporal Graphs. In 34th Conference on Uncertainty in Artificial Intelligence 2018, UAI 2018. [60] Shaokun Zhang, Yao Guo, Peize Zhao, Chuanpan Zheng, and Xiangqun Chen. 2021. A Graph-Based Temporal Attention Framework for Multi-Sensor Traffic Flow Forecasting. IEEE Transactions on Intelligent Transportation Systems (2021). [61] Yifei Zhang, Hao Zhu, Ziqiao Meng, Piotr Koniusz, and Irwin King. 2022. Graph-adaptive rectified linear unit for graph neural networks. In Proceedings of the ACM Web Conference 2022. 1331–1339. [62] Yifei Zhang, Hao Zhu, Zixing Song, Piotr Koniusz, and Irwin King. 2019. Spectral Feature Augmentation for Graph Contrastive Learning and Beyond. In 2023 AAAI Conference on Artificial Intelligence (AAAI'23). [63] Chuanpan Zheng, Xiaoliang Fan, Cheng Wang, and Jianzhong Qi. 2020. Gman: A graph multi-attention network for traffic prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 34. 1234–1241. [64] Fan Zhou, Qing Yang, Kunpeng Zhang, Goce Trajcevski, Ting Zhong, and Ashfaq Khokhar. 2020. Reinforced spatiotemporal attentive graph neural networks for traffic forecasting. IEEE Internet of Things Journal 7, 7 (2020), 6414–6428. [65] Hao Zhu and Piotr Koniusz. 2022. Generalized Laplacian Eigenmaps. In Advances in Neural Information Processing Systems, Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (Eds.). https://openreview.net/forum?id=HjicdpP-Nth [66] Hao Zhu, Ke Sun, and Peter Koniusz. 2021. Contrastive laplacian eigenmaps. Advances in Neural Information Processing Systems 34 (2021), 5682–5695. [67] Eric Zivot and Jiahui Wang. 2006. Vector autoregressive models for multivariate time series. Modeling financial time series with S-PLUS® (2006), 385–429. ACKNOWLEDGMENTS This research is supported by Australian Research Council (ARC) Discovery Project DP190101485. We would like to also acknowledge the support of the Investigative Analytics team (Data61/CSIRO). We would also like to acknowledge the support of Cisco's National Industry Innovation Network (NIIN) Research Chair Program. 20
http://arxiv.org/abs/2302.09952v1
2023-02-20T12:40:54
2023-02-20T12:40:54
Why is the prediction wrong? Towards underfitting case explanation via meta-classification
In this paper we present a heuristic method to provide individual explanations for those elements in a dataset (data points) which are wrongly predicted by a given classifier. Since the general case is too difficult, in the present work we focus on faulty data from an underfitted model. First, we project the faulty data into a hand-crafted, and thus human readable, intermediate representation (meta-representation, profile vectors), with the aim of separating the two main causes of miss-classification: the classifier is not strong enough, or the data point belongs to an area of the input space where classes are not separable. Second, in the space of these profile vectors, we present a method to fit a meta-classifier (decision tree) and express its output as a set of interpretable (human readable) explanation rules, which leads to several target diagnosis labels: data point is either correctly classified, or faulty due to a too weak model, or faulty due to mixed (overlapped) classes in the input space. Experimental results on several real datasets show more than 80% diagnosis label accuracy and confirm that the proposed intermediate representation allows to achieve a high degree of invariance with respect to the classifier used in the input space and to the dataset being classified, i.e. we can learn the metaclassifier on a dataset with a given classifier and successfully predict diagnosis labels for a different dataset or classifier (or both).
[ "Sheng Zhou", "Pierre Blanchart", "Michel Crucianu", "Marin Ferecatu" ]
10.1109/DSAA54385.2022.10032332
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1109/DSAA54385.2022.10032332", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.09952v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09952v1", "@rel": "related", "@type": "application/pdf" } ]
[ "2022 IEEE 9th International Conference on Data Science and\n Advanced Analytics (DSAA), Oct 2022, Shenzhen, China. pp.1-9" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Why is the prediction wrong? Towards underfitting case explanation via meta-classification Sheng ZHOU∗†, Pierre BLANCHART∗, Michel CRUCIANU† and Marin FERECATU† ∗ Universit ́e Paris-Saclay, CEA, List, F-91120, Palaiseau, France † Conservatoire National des Arts et M ́etiers (CNAM), CEDRIC, 75003, Paris, France Email: [email protected], [email protected], [email protected], [email protected] 3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 2 5 9 9 0 . 2 0 3 2 : v i X r a Abstract-In this paper we present a heuristic method to pro- vide individual explanations for those elements in a dataset (data points) which are wrongly predicted by a given classifier. Since the general case is too difficult, in the present work we focus on faulty data from an underfitted model. First, we project the faulty data into a hand-crafted, and thus human readable, intermediate representation (meta-representation, profile vectors), with the aim of separating the two main causes of miss-classification: the classifier is not strong enough, or the data point belongs to an area of the input space where classes are not separable. Second, in the space of these profile vectors, we present a method to fit a meta-classifier (decision tree) and express its output as a set of interpretable (human readable) explanation rules, which leads to several target diagnosis labels: data point is either correctly classified, or faulty due to a too weak model, or faulty due to mixed (overlapped) classes in the input space. Experimental results on several real datasets show more than 80% diagnosis label accuracy and confirm that the proposed intermediate representation allows to achieve a high degree of invariance with respect to the classifier used in the input space and to the dataset being classified, i.e. we can learn the meta- classifier on a dataset with a given classifier and successfully predict diagnosis labels for a different dataset or classifier (or both). Index Terms-machine learning, interpretability, explainabil- ity, XGBoost, MLP, model validation, debugging, kNN. I. INTRODUCTION Recent machine learning models for prediction have attained excellent performance in many data classification tasks, and are widely applied in various scenarios where prediction is needed (e.g. medical diagnostics or financial analysis). How- ever, as applications begin to concern every aspect of our daily life, there is an increased need for transparency and interpretability of the model decision process, in order to earn user's trust and reveal the reasoning behind model decision in terms comprehensible by humans [1]. Indeed, interpretability of machine learning algorithms has grown to become an important topic in recent years, especially due to the black box nature of many ML algorithms [2], aspect which is even more important when they fail: users need to understand the causes of failures such as to avoid them in the future. The concept of interpretability for machine learning aims at presenting model predictions in a human- understandable way, or providing information to interpret the predictions or the failures [3]. Modern ML models (such as XGBoost [4] or artificial neural networks [5]) are powerful enough to fit the most complex patterns in data distributions with rather contained computation costs but, unfortunately for most of them, the decision-making process is not transparent to users (black- box behavior). In such a case it is important to have tools to investigate their behavior, especially when they fail, such as to be able to detect general patterns of model's behavior on its faulty predicting data, if they exist [6]. In this direction, we propose in this work an analysis and diagnostic pipeline to interpret the behavior of an ML model in the input space, around data points where it fails to give the expected prediction. More precisely, the task is to analyse and diagnose faulty individual points, where the label predicted by the model differs from the ground truth. More specifically, because it is difficult to approach the problem with full generality, we restrict ourselves to the more amenable situation when the model is underfitted. Recall that underfitting is a global property of a model which summarizes the fact that the accuracy, as a classification performance measure, fails to achieve high values on both training and test sets; furthermore, there is no big gap in accuracy between the train and test sets. In this situation, given a faulty data point (wrongly classified), our aim is to reach one of the two following diagnostics : • The model is too weak: the model fits poorly the true data distribution, because its capacity as well as complexity is not high enough so it fails to get sufficient information on the true decision boundary (model under- fitting). An example of this case is trying to fit a linear classifier on a dataset that is separable, e.g., by a parabola. In this case, the solution is to use a more complex (and possibly more expensive) classifier, able to fit the data. • Data classes are mixed-up: the data point belongs, in the input space, to an area where several class labels mix up beyond statistical resolution, meaning that different training samples would give very different separating boundaries. In this case it is impossible to generalize from one sample to the other (e.g. from training to test), even using a very strong classifier, implying that the data in this area cannot be separated properly in terms of their labels. To do better in this case, the user needs to devise more powerful features for the data, to resolve the ambiguity. To achieve this, we project original feature space X into a hand-crafted intermediate representation space Z (x → z), where the representation z of a point x encodes the local behavior of the classifier C(x) in the X space around the point x, compared to what its output should be (the ground-truth). We hand-craft the variables defining the Z space, instead of learning them from data, because we want them to be meaningful to a human user, thus easy to interpret. In the second stage we fit a decision tree in the Z space, to obtain a meta-classifier M (z(x)) capable of assigning a diagnostic label to any data point x ∈ X: "data point is well classified" (no classification error), "model is too weak", or "point is in a mixed-up data region". To summarize, the main contributions of our proposal are as follows : • We propose an intermediate representation of the input data which is model agnostic and data agnostic, that is it does not use specific information about the type of classifier or data being employed. • The proposed approach is end-to-end interpretable: it uses a human readable representation (hand-crafted features) and an interpretable meta-model (decision tree) to help the user understand the behavior of a black-box classifier around the data points where it fails to function properly. By employing our method the user will know if she needs to put more effort into improving the classifier or into the data harvesting activity, and also have a clear view on why this is the case. We test our framework on several large real datasets. The results show systematically more than 80% accu- racy for the meta-classifier (in the Z space), confirming that the proposed intermediate representation permits to achieve a reasonably high degree of invariance with respect to the classifier used in the input space and also to the dataset being classified. That is, we can learn the meta-classifier on an initial collection of classification problems (couples dataset/classifier) and successfully predict diagnosis labels for a different couple dataset/classifier. The workflow of our method is shown in Fig. 1. The paper is organized as follows: in Sec II we present related work and position our proposal with respect to these, in Sec. III we present our framework followed by the experi- mental validation on several real world datasets in Sec. IV and we conclude in Sec. V with a synthesis of our achievements and a discussion of future work. II. RELATED WORK In this section we present a brief synthesis of the existing state of the art on the topic of diagnosis and interpretability of faulty cases from validation/test data, and position our work with respect to these. A. Model validation and debugging Several existing works focus on machine learning model validation, data analysis and debugging, which serve a similar objective as ours: SecureMLdebugger [7] presents a model debugger by ac- cessing metadata such as model's hyper-parameters, training epochs, evaluation measures and network layouts, without using specific user data to ensure privacy during the analysis. The idea of exploiting model's metadata for debugging and investigation is quite pervasive in the field; we also make use of it but in a different way, i.e. to form a set of meta-features characterizing the model, and develop interpretability based on them. Slice Finder [8] is a tool for slicing datasets to obtain certain data subgroups which are identified as problematic to the model. The goal is to provide a more granular view and analysis of model behavior: investigating such kind of problematic data helps explain model poor performance. A slice is defined as a conjunction of feature-value (rule) pairs, in which the number of rule pairs should be few enough to ensure human readability, each acquired slice should have significant impact to affect model performance, and also large enough coverage on validation data. MLCube [9] proposes a tool allowing the user to define instance subsets in form of feature-condition conjunctions, and explore the aggregate statistics (like accuracy) or evaluation metrics over these subsets. [10] also investigate data subgroups via similar feature-value conjunctions: they identify trouble data subgroups by measuring a divergence metric defined on false positive or false negative rates using Shapley values. The fore-mentioned methods share a common pathway, that is they assess certain data subgroups via feature-value conjunction structures, which actually match the basic split rules used in decision trees - they suit thus well the logic of tree-based models. Their drawback comes from their nature: the interpretability power of these methods depends on the simplicity of the slice, meaning the granularity of investigation and interpretation is limited by the complexity of the acquired rule set. Unlike them, our method is based on training in- stances, thus it does not face the issue of rule set complexity but rather draws inferences from data-local population. Another drawback when using these methods to solve the model validation and debugging problem is that none of them integrates prior knowledge of model diagnosis categories: their aim is partially the identification of faulty/problematic data, without further analyzing the reason behind the faulty cases. In contrast, our method relies on a clarification of the relationship between the data distribution and the model prediction pairs, and ends up providing interpretations on the reason why certain cases lead the model to make wrong predictions. B. Data Complexity recognition As we already discussed, the mismatch between data dis- tribution in terms of classes and model prediction labels does not always come from model fitting error only, but also from the complexity of the classification problem with respect to the intrinsic distribution of the data. In this sense, surveys like [11], [12] list several measures of data distribution complexity in terms of decision boundary dividing different classes. This geometrical point of view leads to three grand classes of measures: linear classifier based (such as minimized error, error rate by Linear Programming); nearest Fig. 1: Main pipeline of our proposal: a black-box model is trained with the train set {xi, yi}train, the goal being to predict whether the sample is miss-classified and achieve, for each miss-classified sample x (for which y (cid:54)= ˆy), an understanding of the cause of miss-classification: "the model is too weak" or "data classes are mixed-up". To achieve this, each data point x is projected by the Meta-Features Extraction module into a profile vector z consisting of several statistical indicators; then the collection of all acquired profile vectors is used by the Feature Aggregation module to train a decision tree on the three classes mentioned above. This will help the user obtain a diagnosis result, understand the reason behind the faulty case, and thus arrive at a practical solution for post-hoc treatment. neighbor based (fraction of points on boundary by Minimum Spanning Tree method, ratio of average intra/inner class near- est neighbour (NN) distance, error rate and nonlinearity of 1NN classifier); geometry or topology based (maximal Fisher discriminant ratio, overlap region volume, maximal feature efficiency, fraction of points with adherence subsets retained, average number of samples per dimension) [12]. Some of these measures focus on data separability or mixture identification, some on individual feature value overlapping, others examine the geometrical properties of the decision boundary such as space covering and non-linearity. While we are not using these results directly, we are taking inspiration from them in devising our meta-features (see next section). III. METHOD PROPOSAL A. Problem Formulation In this study we only consider binary classification prob- lems. A classifier C is classifying a point x ∈ X (usually Rd) in one of two classes, 0 or 1, i.e. C(x) = y ∈ {0, 1}. Our purpose is to explain why a classifier fails to classify a test point in the right class in the special case when the model is known to be underfitted. We refer to these points as "faulty" and to the other points as "normal". For each faulty point, we further diagnose the cause of classification error by considering two main types of behavior: • The model is too simple, i.e. there exists a larger capacity model (i.e. with more parameters) of the same type that can correctly classify the faulty data considered, while achieving a superior cross-validation performance. • The faulty data belongs to a region of space where classes 0 and 1 overlap, i.e. we cannot find a more complex model that correctly classifies the faulty data while achieving superior cross-validation performance. This can happen for instance if the features x are too weak, i.e. not providing enough discriminant information regarding the classification problem at hand. We refer to this case as "mixed-up" data in the following. Our goal is to train a meta-classifier F which maps the test data to three output classes: a normal data is assigned to the class Good Prediction, a faulty data is assigned either to the class Weak Model or to the class Data Mixed-Up. The meta- classifier takes as input a set of meta-features related to the faulty input point x. Meta-features are computed using both x, and training points belonging to a neighborhood of x along with their labels. B. Meta-features extraction Simple meta-features characterizing local configurations are extracted around a point of interest using K-nearest neighbors (KNN). A value for K, found by trial and error, of 0.05 × (dataset size) provided good results in our case. Training data is then used to compute label-based indicators inside these neighborhoods. In particular, in a neighborhood we extract: • The local model prediction accuracy. • The two-class confusion matrix. • A confidence in the prediction: if the model prediction ˆyi is the probability of class 0, let Conf(xi) = |ˆyi − 0.5| 0.5 ∈ [0, 1] then the higher this value, the more confident the model is considered to be in its prediction. • The average confidence in the neighborhood, which re- flects the local model confidence around the point of interest. • The average distance to "allies", i.e. the points from the neighborhood with the same label as xi: Dally(xi) = 1 |Ai| (cid:88) xj ∈Ai d (xi, xj) where Ai = {xj ∈ KNN (xi) |yj = yi} • The average distance to "opponents", i.e. the points from the neighborhood with a different label than that of xi: 1 |Oi| Dopp(xi) = d (xi, xj) (cid:88) xj ∈Oi where Oi = {xj ∈ KNN (xi) |yj (cid:54)= yi}. Two other meta-features not using KNN neighborhoods but still characterizing data configurations at a local scale are also extracted: • A Minimum Spanning Tree (MST) based feature de- scribed in [11]. This feature requires to compute the MST of the training dataset using a distance criterion to keep only connections between close points. This feature characterizes class separability at a local scale. It is computed as the number of opponents of xi connected to xi over the total number of points connected to xi. As such, it is valued between 0 and 1. A value close to zero corresponds to a configuration where the point lies in an homogeneous region of ally points. A value close to 0.5 corresponds to a configuration where the point lies in a non-homogeneous region made both of ally and opponent points (mixed-up data). • A tree-based meta-feature that can only be added when the binary classifier is a tree ensemble model (other meta- features are model agnostic). This feature is inspired from [13] where it is referred to as Tree space prototype measure. Given a query point xi and a point xj in which to compute the measure, it is obtained as the number of leaves of the tree ensemble model that contain both xi and xj. This feature is dependent on model complexity, i.e. the bigger the number of trees in the ensemble model, the higher it tends to be on average. When averaged over the K nearest neighbors, it quantifies to what extent the K nearest neighbors fall in the same leaves as the query point. As such, it is an indirect measure of model complexity in the considered neighborhood. C. Training the meta-classifier The previously described meta-features are aggregated to form profile vectors zi ∈ Z associated with each test data. A three-class meta-classifier under the form of a decision tree is trained on these meta-features/profile vectors. The output classes are the ones described in Sec. III-B. The choice of a decision tree is justified here by the aim to keep the meta- classifier decisions interpretable. In particular, decision rules can be extracted by following the path between the root and a leaf of the tree. The decision tree selects in a greedy way the most discriminative characteristics for the classification problem at hand and provides an importance score for each of these characteristics. The extracted rules give a more detailed explanation of the meta-classifier decision, all the more since the meta-features are themselves interpretable. Once the meta-classifier is trained, it can be employed to understand the behavior of other classifiers around the points where they fail to predict the correct label, that is to decide if they need a more powerful classifier or more discriminant features. For this, the user should first extract the meta-features for the dataset on which the investigated classifier was trained. IV. EXPERIMENTAL EVALUATION In this section, we present experimental validation of our method on several binary classification problems (datasets). To do this we start by pre-processing each dataset in order to generate the ground-truth labels needed for the meta-classifier (Sec. IV-A). By employing this ground truth we train the meta- classifier and use prediction accuracy, precision and recall as a measures of success (Sec. IV-B). We also show examples of output interpretations, and we discuss the strengths and weaknesses of our approach. A. Meta-classifier ground truth generation Suppose we are given a dataset D associated to a binary classification problem. Each data point is seen as a vector x in the input feature space X. Suppose also that we trained a classifier C on some part of D (the training set) and we test on the rest of the dataset (the test set). Each input point x ∈ X has a meta-feature vector z ∈ Z associated with it, computed by the procedure described in Sec. III-B. To be able to train the meta-classifier F in the Z space we need to attach to each element in the input space x ∈ X one diagnosis label (with respect to the classifier C): "Good Prediction", "Weak Model", "Data Mixed-Up". This is obvious for correctly classified data points, but for the miss-classified ones we need to ensure the cause of miss- classification is guaranteed to be the one associated with the label. We describe below the procedure we use to generate these labels. We start by choosing a strong classifier, for example an XGBoost model with a very large number of trees and large depth. We then iterate several times the following procedure: 1) Randomly split the initial dataset D into two equal disjoint parts, D1 and D2. 2) Train the classifier with D1 as training set to obtain model C1. Similarly, train the classifier with D2 as training set to obtain model C2. 4) Consider D = D(cid:48) 3) Remove from D1 the elements miss-classified by C2, 1, and remove from D2 the elements obtaining the set D(cid:48) miss-classified by C1, obtaining the set D(cid:48) 2. 1 ∪ D(cid:48) 2 and repeat the whole procedure until there are no more miss-classified elements by C1 and C2 (or very few, e.g. an accuracy of 99.9% for both). In practice, we found that two-three iterations are enough in the procedure above to obtain classifiers with very high accuracy (99.9%) on the remaining data. The procedure cleans up the dataset, so we are sure that the remaining data can be correctly classified by a model of very high capacity (thus, classes are not mixed-up in the regions covered by this data). From here we use two procedures to generate diagnosis labels for miss-classified data: 1) Lower the capacity of the model. For example, for an XGBoost model decrease the number of trees and their depth. For an MLP reduce the number of hidden layers and neurons, or simply add noise to the weights. When training a lower capacity model on the cleaned-up data, some of the test sample will be miss-classified, and we can assign them the label "Weak Model". 2) In the input space X, drop some of the components of the features, which is equivalent to projecting the data to a lower dimensional vector space. This entails information loss, and classes that were well separated in the input space X may overlap (mix up) in the projection space X (cid:48). Then train a strong classifier in the X (cid:48) space, without overfitting it. This classifier, because some classes are mixed-up in the reduced feature space, cannot achieve perfect accuracy, so there are some miss-classified data points on the test set. For this reason, these miss-classified data points can be labeled as "Data Mixed-up". Because strong classifiers are still very good even after throwing away a lot of features, at least on the datasets we are using, we actually perform a principal component analysis in the input space X and then eliminate the most important components (to quickly remove components of high variance). In order to achieve the desired effect, it is important to train the best model on the projected data without overfitting, since because the trained classifier is strong, overfitting is indeed a risk. Fig. 2 illustrates a situation when both MLP and XGBoost classifiers overfit depending on the dataset. If a classifier overfits when dropping data components, that indicates that a weaker version of it should be used to avoid this phenomenon. classification vector set. After the usual train/test dataset split we use a decision tree as our meta-classifier, because this type of model can be used to generate interpretable decision rules easily. A decision tree can also easily deal with large training sets, which is an important factor in our case, because we employ several large datasets to build the ground-truth for the meta-classifier. Meta-feature extraction time grows linearly with the input dataset size, but this process is only performed once. The meta-classifier is evaluated using the accuracy, pre- cision and recall scores. Our meta-classifier is capable of suggesting a diagnosis label for a new data point, miss- classified by a different classifier on a different dataset and, if desired, decision rules extracted from the meta-classifier. These should help understanding if the data point has been wrongly classified because the classifier was too weak or the classification classes are mixed up in the feature space, and the decision rule gives insight into what happens locally in the feature space around the miss-classified point. C. Evaluation results To test our proposal we use eight datasets set up for binary classification: MNIST 3-8 [14] (classes 3 and 8, number of features reduced to 87 by PCA), Fashion MNIST 0-6 [15] (classes 0 and 6, number of features reduced to 100 by PCA), Weather Australia1, Spotify2, Human Resource Analytics3, Water Potability4, Indian Diabetes5, Banknote authentication6. On each dataset we train two types of classifiers: an XGBoost and a Multi Layer Perceptron (MLP). Each of them provides three models: the base model (obtained on the cleaned-up dataset (also called "easy dataset" in the follow- ing), as explained in Sec. IV-A), the weak model (obtained by weakening the base model either by reducing the number of trees and their depth, for XGBoost, or by reducing the size of the hidden layer, for the MLP), and the truncated feature space model (obtained after cutting off a number of components from the feature space). In the Table I we present the details of the involved datasets and configurations during the diagnosis label generation pro- cess: the dataset size including number of label 0 and label 1 points, the number of features, the number of extracted meta- vectors (corresponding to miss-classified samples), the param- eters of baseline models on the easy (cleaned up) dataset, parameters of the weak model (for "Weak Model" label generation) and the number of cut-off data feature components (for "Data Mixed-up" label generation). For the "MLP cut" we also give the variance of the cut-off components (percentage in brackets). Notice that the first five datasets each provide 2000 meta-vectors, while the last three datasets, which are much smaller, give roughly ten times less meta-vectors. B. Meta-classifier: training and prediction Each dataset is processed by the proposed method to extract meta-feature profile vectors for each element, together with the associated diagnosis labels, the result being a three class 1http://www.bom.gov.au/climate/dwo 2https://github.com/rfordatascience/tidytuesday/tree/master/data/2020 3https://www.kaggle.com/datasets/rohandx1996/human-resource-analytics 4https://www.kaggle.com/datasets/adityakadiwal/water-potability 5https://www.kaggle.com/datasets/uciml/pima-indians-diabetes-database 6https://archive.ics.uci.edu/ml/datasets/banknote+authentication (a) Spotify, XGB model (b) Spotify, MLP model (c) Fashion MNIST, XGB model (170 trees, depth 6) (d) Fashion MNIST, MLP model (hidden layer size = 50) (e) Fashion MNIST, weaker XGB model (50 trees, depth 3) (f) Fashion MNIST, weaker MLP model (hidden layer size = 10) Fig. 2: Accuracy curves demonstrating the underfitting checking process: each graph shows the training accuracy and testing accuracy along with the percentage of data variance being removedUpper two graphs a) and b) correspond to the underfitting scenarios we aim at, since training accuracy drops together with the testing accuracy. The middle two graphs c) and d) show an overfitting situation, where testing accuracy drops quickly while training accuracy remains close to 100%, and the gap between the two becomes larger and larger. This case should be avoided by choosing a weaker base model in the input feature space X. Graphs e) and f) then show that a weaker base model on the same dataset as c) and d) leads to underfitting when compared to the overfitting base model. Table II presents results for four main configurations on extracted meta-vectors to train the meta-classifier decision tree and test its performance: • Row 1: train on 4 datasets randomly sampled from #1 to #5 and test on datasets #6 to #8. • Row 2: train on 4 randomly selected datasets and test on the rest. • Row 3: train on XGBoost generated meta-vectors, test on MLP generated meta-vectors and vice-versa. • Row 4: train/test on the union of all datasets: split 75% train / 25% test. These configurations aim to test the ability of the meta- classifier to generalize across different datasets (train on a collection of datasets and predict on a different dataset: rows 1 and 2) and also to generalize across different classifiers (train on a classifier and predict on another classifier: row 3). The last configuration (row 4) represents the case where training and testing are done on the union of all the datasets and, as expected, provides slightly better results compared to the other configurations because the training dataset is much larger. The decision tree structure, including tree depth, number of leaves, training set and testing set size, most important meta- features from the tree, and particularly the most impacting decision rules extracted from the tree, are also shown in Table II. Performance of the meta-classifiers is provided by predicting precision and recall scores on the test set (each contains three elements corresponding to each of the three diagnosis classes), where the precision/recall values are col- lected statistically from several rounds of training, giving the mean and standard derivation. Looking at Table II, for all experimental configurations, after proper label re-balancing on training vectors, the ob- tained decision trees have similar structure: the number of features with a high score according to the decision tree feature importance score is quite low (usually less than 5 or 6), although the specific features may vary depending on the configuration. Some of the meta-features are always present and provide significant discriminative power on three- diagnosis-labels classification task (e.g. rTN/rFN – rate of True Negative/False Negative data, rate dist gt/pred – rate of average distance to ally neighbors against opponent neighbors in terms of ground truth labels/model predicted labels, KNN pred conf – KNN average predicted probability confidence measure; see Sec. III-B for a detailed description of these features). They are thus good candidates to form a small meta- feature set in terms of which to present the decision rules. Most meta-classifiers have precision and recall values around 80%–90% on all three diagnosis labels, showing that our method provides a high degree of invariance over the dataset and classifier type. This means that we can learn the meta-classifier on a collection of datasets and predict diagnosis labels for different datasets and classifiers. In a few cases a wee see a higher uncertainty level (accuracy drop under 80%). To explain this performance drop, one reason might be the lack of enough training meta-vectors (see, for example, Table II row 2) causing decision tree to overfit on Fig. 3: Linked Bar plots of meta feature ablation experiment, showing that prediction accuracy score decays with important important ones to more meta-feature removed (from least important ones). the training data, or the different geometrical nature of decision boundaries from different types of model (see Table II row 3). This indicates that in order to improve the meta-classifier with respect to the pipeline performance, more datasets of diverse types and complexity are needed. Based on previous findings we performed an ablation test (see Fig. 3). We remove meta-features in the order of their increasing importance score (starting with the smallest but non-zero value): as more and more meta-features are removed (actually being made zero thus muted during training), we see the evolution of precision and recall value, on the three diagnosis classes. The curves are stable up until dropping the last 5 or 6 meta-features, indicating that indeed, these most important meta-features contain the majority of the discriminating power in terms of the three diagnosis classes, while the rest of the meta-features hold for the ability to gain higher predictive accuracy on more granular patterns in meta- feature space. Concerning the computing resources, to perform the evalu- ations presented here, we used a standard personal computer with a 2.5GHz Intel Core i5-12600HX CPU (12 cores 16 threads) and 16GB of RAM. The most expensive part is the generation of the meta-features, which for the largest dataset used here (Spotify Pop) took around 20 min to obtain a total of 4000 meta-vectors. This time grows linearly with the size and the number of features of the dataset but can be reduced by using a more sophisticated KNN retrieval algorithm like the one in [16]. Training the meta-classifier took a few minutes Dataset 1) MNIST 3-8 2) Fashion MNIST 0-6 3) Weather AUS 4) Spotify Pop 5) Human Resource 6) Water Potability 7) Diabetes 8) Banknote # of data points #label0, #label1 11982 6131, 5851 12000 6000, 6000 20000 15669, 4331 32833 18871, 13962 14999 11428, 3571 3276 1998, 1278 767 500, 267 1371 761, 610 # of # of features meta-vectors 87 100 17 12 5 9 8 4 xgb 2000 mlp 2000 xgb 2000 mlp 2000 xgb 2000 mlp 2000 xgb 2000 mlp 2000 xgb 2000 mlp 2000 xgb 200 mlp 500 xgb 194 mlp 200 xgb 500 mlp 500 XGB base easyset size 50 trees, depth 3 10343 50 trees, depth 3 9214 100 trees, depth 3 16114 120 trees, depth 4 18551 100 trees, depth 4 14512 20 trees, depth 4 1994 25 trees, depth 3 534 50 trees, depth 3 1354 XGB weak XGB cut 40 trees, depth 1 40 comp (90%) 10 trees, depth 1 30 comp (80%) 10 trees, depth 2 3 comp (60%) 50 trees, depth 2 6 comp (60%) 10 trees, depth 1 3 comp (60%) 10 trees, depth 1 5 comp (60%) 10 tree3, depth 1 3 comp (60%) 10 trees, depth 2 2 comp (60%) MLP base easyset size 100 iter, (200,)hl 11153 100 iter (500,)hl 8699 500 iter (30,)hl 16062 500 iter (100,)hl 14762 1000 iter (100,)hl 14441 1000 iter (50,)hl 1769 200 iter (50,)hl 568 1000 iter (40,)hl 1366 MLP weak MLP cut 5 iter (10,)hl 70 comp (98%) 7 iter (4,)hl 12 comp (50%) 7 iter (4,)hl 6 comp (80%) 7 iter (10,)hl 4 comp (50%) 20 iter (5,)hl 3 comp (60%) 50 iter (10,)hl 5 comp (60%) 100 iter (5,)hl 3 comp (60%) 60 iter (5,)hl 2 comp (60%) TABLE I: Information about the used datasets and the parameters of base models, weak models and cut-off models. All MLP models have one hidden layer (its size is given by the HL parameter). For the XGBoost model, we give the number of trees and their depth. See Sec. IV-C for a detailed description of each column. # of train vectors 11075 Dtree depth 16 Dtree leafs 188 12450 16 153 11050 18 163 11300 15 181 Data Configuration train 4 datasets from 1)-5); test 6)-8) train random 4 datasets; test rest 4 datasets train all XGB vec; test all MLP vec. and vice versa train all random split 75%; test rest 25% Important meta features rTN 0.31, rate dist gt 0.27, rate dist pred 0.14 proximity 0.07 knn pred conf 0.05 rTN 0.39, rate dist gt 0.24, rate dist pred 0.10, knn pred conf 0.06, MST frac gt 0.05 rFN 0.42, rate dist gt 0.22, rate dist pred 0.14, proximity 0.06, rTN 0.04 rFN 0.31, rate dist gt 0.26, rate dist pred 0.13 proximity 0.06 knn pred conf 0.05 Extracted Decision Rules WM: (rFN>0.17)&(rate dist gt<=0.435) # of test vectors 1659 C: (rTN<=0.03)&(rate dist pred<=0.493) MD: (rFN>0.03)&(knn pred conf>0.097) &(rate dist gt>0.501)&(rate dist pred<=0.381) WM: (rTN>0.63)&(rate dist gt<=0.533) &(MST frac gt>0.02)&(rate dist pred<=0.509) C: (rTN<=0.01)&(rate dist pred<=0.501) MD: (rTN>0.01)&(rate dist gt>0.56) &(rate dist pred<=0.39)&(knn pred conf>0.09) WM: (rFN>0.13)&(rate dist gt<=0.437) &(MST frac gt>0.112)&(local set cardinality pred>0.078) C: (rFN<=0.03)&(rate dist pred<=0.498) &(rTN<=0.68) MD: (rFN>0.03)&(rate dist gt>0.467) &(rate dist pred<=0.297)&(proximity<=0.997) WM: (rFN>0.15)&(rate dist gt<=0.413) &(MST frac gt>0.112) C: (rFN<=0.03)&(rate dist pred<=0.49) &(rTN<=0.19) MD: (rFN>0.03)&(rate dist gt>0.501) &(rate dist pred<=0.37)&(knn pred conf>0.096) &(MST frac gt<=0.459) 16560 12200 3885 Prediction Precision / Recall Prec: [0.83±0.0465 0.978±0.0144 0.828±0.0431] Rec: [0.854±0.0688 0.932±0.011 0.838±0.0648] Prec: [0.766 ±0.0736 0.964 ±0.02 0.774 ±0.0886 ] Rec: [0.804 ±0.0952 0.904 ±0.0548 0.778 ±0.0835 ] Prec: [0.7575 ±0.0538 0.9425 ±0.0471 0.7675 ±0.0316 ] Rec: [0.8075 ±0.0983 0.9 ±0.0763 0.7475 ±0.0792 ] Prec: [0.9±0.00931 0.972±0.011 0.882 ±0.0144] Rec: [0.908 ±0.011 0.92 ±0.0246 0.898 ±0.0172] TABLE II: Learned meta classifier (decision trees), their properties and predicting performance scores. using a standard Scikit-learn7 decision tree implementation. V. CONCLUSION In this work we propose a framework to help the user gain information about why a classifier failed to give a correct result for a given data point (given individual query). We introduce several quantities describing what happens around the faulty point in the feature space and, with the aid of these, we extract profile vectors as intermediate representations capable of unifying faulty data from different datasets and different classifiers. These profile vectors are aggregated by a decision tree meta-classifier to match three diagnosis cases. The final interpretation rules provided by the decision tree could be useful to help the user distinguish and understand the reason of faulty data. 7https://scikit-learn.org Users may employ the proposed set of interpretability tools to debug an ML model: decide whether they should add more data or more features, prune the model, or fine-tune other hyper-parameters inside the model, in order to achieve higher prediction accuracy and better generalisation, or else just correct certain parts of the dataset to remove ambiguity. One obvious direction in which to develop the presented method is to extend the framework to include the overfitting case. The difficulty comes from the fact that in a region where several classes overlap, a weak classifier will underfit, while a strong one will overfit, both leading to poor generalisation. We may need in this case a finer graduation of diagnosis scenarios, which might not be feasible in all situations. An important development direction of our proposal would be to extend it to work in the case of multi-class classifiers. Indeed, in the present work we tested our framework in the [13] Sarah Tan, Matvey Soloviev, Giles Hooker, and Martin T Wells. Tree space prototypes: Another look at making tree ensembles interpretable. In Proceedings of the 2020 ACM-IMS on Foundations of Data Science Conference, pages 23–34, 2020. [14] Li Deng. The MNIST database of handwritten digit images for machine IEEE Signal Processing Magazine, 29(6):141–142, learning research. 2012. [15] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. CoRR, abs/1708.07747, 2017. [16] Jeff Johnson, Matthijs Douze, and Herv ́e J ́egou. Billion-scale similarity search with GPUs. IEEE Transactions on Big Data, 7(3):535–547, 2019. case of binary classifiers, but there is nothing that limits it to this: the definition of a miss-classified sample remains the same (a sample that that is attributed by the classifier a wrong label) and the construction of the ground-truth for the meta- classifier can be done by the procedure described in Sec. IV-A in a one-vs-rest manner. The meta-features list should probably be updated to include a measure of the degree of local non- separability of different pairs of classes in the neighbourhood of the test point. We also expect a linear increase in the scale of certain meta-features calculation, such as the confusion matrix, since there should be an element for each class. Another direction worthy of investigation is to develop the meta-features automatically, for example by using a neural network to project the input space into an intermediate rep- resentation that maximizes separability between the clusters associated with each diagnosis label. This might indeed lead to better meta-classifiers but would likely require a much larger training set and, in addition, would lose the interpretability of the meta-features. REFERENCES [1] Yu Zhang, Peter Tiˇno, Aleˇs Leonardis, and Ke Tang. A survey on neural network interpretability. IEEE Transactions on Emerging Topics in Computational Intelligence, 5(5):726–742, 2021. [2] Riccardo Guidotti, Anna Monreale, Salvatore Ruggieri, Franco Turini, Fosca Giannotti, and Dino Pedreschi. A survey of methods for explain- ing black box models. ACM computing surveys (CSUR), 51(5):1–42, 2018. [3] Finale Doshi-Velez and Been Kim. Towards a rigorous science of interpretable machine learning. arXiv preprint arXiv:1702.08608, 2017. [4] Tianqi Chen and Carlos Guestrin. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining, pages 785–794, 2016. [5] Trevor Hastie, Robert Tibshirani, Jerome H Friedman, and Jerome H Friedman. The elements of statistical learning: data mining, inference, and prediction, volume 2. Springer, 2009. [6] Alejandro Barredo Arrieta, Natalia D ́ıaz-Rodr ́ıguez, Javier Del Ser, Adrien Bennetot, Siham Tabik, Alberto Barbado, Salvador Garcia, Sergio Gil-Lopez, Daniel Molina, Richard Benjamins, Raja Chatila, and Francisco Herrera. Explainable artificial intelligence (xai): Concepts, taxonomies, opportunities and challenges toward responsible ai. Infor- mation Fusion, 58:82–115, 2020. [7] Peiyi Han, Chaozheng Wang, Chuanyi Liu, Shaoming Duan, Hezhong Securemldebugger: A privacy-preserving Pan, and Pengshuai Luo. In 2020 IEEE Fifth International machine learning debugging tool. Conference on Data Science in Cyberspace (DSC), pages 127–134. IEEE, 2020. [8] Yeounoh Chung, Tim Kraska, Neoklis Polyzotis, Ki Hyun Tae, and Steven Euijong Whang. Slice finder: Automated data slicing for model In 2019 IEEE 35th International Conference on Data validation. Engineering (ICDE), pages 1550–1553. IEEE, 2019. [9] Minsuk Kahng, Dezhi Fang, and Duen Horng Chau. Visual exploration of machine learning results using data cube analysis. In Proceedings of the Workshop on Human-In-the-Loop Data Analytics, pages 1–6, 2016. [10] Eliana Pastor, Luca de Alfaro, and Elena Baralis. Looking for trouble: In Proceedings Analyzing classifier behavior via pattern divergence. of the 2021 International Conference on Management of Data, pages 1400–1412, 2021. [11] Tin Kam Ho and Mitra Basu. Complexity measures of supervised IEEE transactions on pattern analysis and classification problems. machine intelligence, 24(3):289–300, 2002. [12] Ana C Lorena, Lu ́ıs PF Garcia, Jens Lehmann, Marcilio CP Souto, and Tin Kam Ho. How complex is your classification problem? a survey on measuring classification complexity. ACM Computing Surveys (CSUR), 52(5):1–34, 2019.
http://arxiv.org/abs/2302.09949v1
2023-02-20T12:36:54
2023-02-20T12:36:54
SpecXAI -- Spectral interpretability of Deep Learning Models
Deep learning is becoming increasingly adopted in business and industry due to its ability to transform large quantities of data into high-performing models. These models, however, are generally regarded as black boxes, which, in spite of their performance, could prevent their use. In this context, the field of eXplainable AI attempts to develop techniques that temper the impenetrable nature of the models and promote a level of understanding of their behavior. Here we present our contribution to XAI methods in the form of a framework that we term SpecXAI, which is based on the spectral characterization of the entire network. We show how this framework can be used to not only understand the network but also manipulate it into a linear interpretable symbolic representation.
[ "Stefan Druc", "Peter Wooldridge", "Adarsh Krishnamurthy", "Soumik Sarkar", "Aditya Balu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09949v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09949v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CV" ]
3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 9 4 9 9 0 . 2 0 3 2 : v i X r a SPECXAI - SPECTRAL INTERPRETABILITY OF DEEP LEARNING MODELS Stefan Druc1, Peter Wooldridge1, Adarsh Krishnamurthy2, Soumik Sarkar2, Aditya Balu2 1Monolith AI LTD., London, England 2Iowa State University, Ames, IA, USA Abstract Deep learning is becoming increasingly adopted in business and industry due to its ability to transform large quantities of data into high-performing models. These models, however, are generally regarded as black boxes, which, in spite of their performance, could prevent their use. In this context, the field of eXplainable AI attempts to develop techniques that temper the impenetrable nature of the models and promote a level of understanding of their behavior. Here we present our contribution to XAI methods in the form of a framework that we term SpecXAI, which is based on the spectral characterization of the entire network. We show how this framework can be used to not only understand the network but also manipulate it into a linear interpretable symbolic representation. 1 Introduction Deep learning has become a ubiquitous, versatile, and powerful technique that has a wide range of applications across many different fields such as image and speech recognition, natural lan- guage processing, and self-driving cars. The most popular application of deep learning is in the area of computer vision, where deep learning models are used for vision tasks such as image classification, object detection, and segmentation. While effective and powerful, one of the challenges that is plaguing deep learning models is ex- plainability [1–4]. Unlike traditional machine learning models, which can be understood through the use of simple mathematical equations, deep learning models are highly complex and difficult to interpret. This makes it difficult to understand how the model arrived at a particular decision, which can be a problem in areas such as healthcare [5], or finance [6, 7] where transparency is im- portant. Explainability is also equally important for building trust, especially in several engineer- ing applications that require Verification and Validation such as designing automotive vehicles and aircraft etc. [8–11]. Over the past decade, researchers have been working to develop methods to increase the explain- ability of deep learning models, such as through the use of visualization tools and interpretable representations of the model's internal workings [1–4]. Despite these challenges, deep learning models have proven to be highly effective in a wide range of applications and they will continue to play a critical role in the field of artificial intelligence. There are several explainability algorithms that have been proposed to help understand the decision- making process of deep learning models. A common approach is to try to linearize the model locally near the sample space to provide explanations. One popular algorithm that uses this approach is LIME (Local Interpretable Model-Agnostic Ex- planations) [12]. LIME approximates the complex deep learning model with a simpler, inter- pretable model that is only valid in the neighborhood of a specific sample. This allows us to un- derstand the decision-making process of the deep learning model for that specific sample. LIME does this by perturbing the input data and measuring the change in the model's predictions. This information is then used to generate a linear model that approximates the complex model locally. 1 Another algorithm that uses this approach is SHAP (SHapley Additive exPlanations) [13–16]. SHAP is based on the concept of Shapley values from cooperative game theory, it provides an explanation for a specific sample by computing the contribution of each feature to the model's prediction. SHAP assigns a weight to each feature, which represents the importance of that fea- ture in the final prediction. The weights are computed based on the feature's interactions with other features and the sample's proximity to the training data. These algorithms are not the only ones that are available and other approaches like Anchors [17], Counterfactuals [18], and Attention [19–21] mechanisms can also be used to explain DL models. The main idea behind these algorithms is to linearize the model locally around the sample space to provide an explanation, which can be more interpretable and understandable than the complex deep learning model itself. In contrast to these methods, several works have made use of the fact that neural networks can be represented as Point-wise Affine (PWA) Maps around the input to explore the learned linear regions [22–25]. In other words, it has been shown that these complex models are in fact already locally linear and can be used directly rather than building linear surrogate models to explain the local behavior. [26, 27] create explanations of the model that can be attempted by analyzing the spectral decomposition of these linear representations across the dataset. In addition, spectral methods have been extensively applied to the weights of individual layers, most notably for com- pression and performance characterization. However, to our knowledge, until now there has been no attempt in the literature to analyze the spectral properties of the whole network via their PWA representation. In this paper, we view the network as an input-dependent operator and our explanations are gen- erated by applying the SVD to decompose its action into more interpretable components. This operator view is also adopted in several works that attempt to learn orthogonal modes for fluid dynamics [28]. These investigations, including our own, were in turn inspired by established dimensionality reduction techniques for dynamical systems such as the Proper Orthogonal De- composition (POD) [29] and the Dynamic Mode Decomposition (DMD) [30, 31]. The main contributions of our work are: 1. We make use of the Singular Value Decomposition (SVD) to understand the local represen- tation of the network. 2. We obtain linear symbolic expressions of the network output 3. We use the singular vectors (SV) from multiple examples across the dataset to understand the global properties of the network. 2 Results In this section, we present results by applying the above methodology to various models orga- nized by dataset and task. 2.1 ILSVRC 2012 (ImageNet) Classification ImageNet [32] is a classification dataset consisting of roughly 1000 images for each of the 1000 possible classes (total of 1.2 million images). As one of the first large and well-curated image data sets, it has served as a standard benchmark to evaluate the state-of-the-art vision models. Here we examine two models trained on ImageNet. The first is the AlexNet [33] CNN model which is credited to have started the deep learning boom in computer vision. The second is VGG11 [34] 2 with batch normalization. We use the pre-trained version of the models available through PyTorch and for both models we choose to explain the last layer before the output, i.e. 'classifier.5' layer. We present the feature-wise dot product for the top three SV's of a few examples for both models in Figure 1. We can note that for both models the SV's are mostly focused on the central object, however, the background becomes more prominent as the singular value decreases. In addition, VGG seems somewhat less focused on the background at this layer. (a) (b) Figure 1: Comparison of top 3 SV's (in descending order) and spectra for (a) AlexNet and (b) VGG11 from 'classifier.5' layer It is important to note however that the order of singular vectors is not necessarily reflective of their contribution to the output. In Figure 2, we display the top contributing SV's to the output (the predicted class) after canceling coefficients to leave only positive contributions, i.e. ˆaj from (21). ls Both models use noisier SV's from further down the spectrum, however, the reduced spectrum of AlexNet seems to be broader than VGG at this layer. Next, we proceed to explore the singular vectors generated from the last convolutional layer before global average pooling, specifically 'features.12' and 'features.28' for AlexNet and VGG respectively. (a) (b) Figure 2: Comparison of top 3 SV's contributing to output (in descending order) for (a) AlexNet and (b) VGG11 from 'classifier.5' layer The most noticeable change is that for both models the SV's seem to be more spatially localized on significant features, e.g. the wattle and the distinctive plumage of the fowl. In addition, the reduced spectra are generally sparser, e.g. the hermit crab only has a single SV contributing for AlexNet. The notable exception here is the eagle image for VGG11 which has a very broad re- duced spectrum with no dominating SV's. All in all, this might suggest that the last convolutional layer is a better choice than the penultimate 'classifier.5' layer since it produces more intuitive and localized SV's, although not universally. 3 (a) (b) Figure 3: Comparison of top 3 SV's contributing to output (in descending order) and the full and reduced spectra for (a) AlexNet and (b) VGG11 from the last convolutional layer 2.2 3D Data In this section, we outline some results obtained for two 3D data sets comprising of car models and wind turbines. These are used to train a simple autoencoder whose latent space is then used to train a separate downstream model to predict a quantity of interest. We train models to predict the drag coefficient for the cars and the peak stress for the wind turbines. The model is well-trained and provides good accuracy in prediction. In Figure 4, we see the top three SV's influencing the drag coefficient of the car from the first layer of the network (in contrast with the treatment of the ImageNet models). Unlike for AlexNet and VGG the singular vectors seem more spatially coherent and seem to highlight geometrically significant parts of the car such as the front, sides, and roof. Figure 4: Top 3 singular vectors influencing drag coefficient for car model Further, we note an apparent similarity between the singular vectors for different car shapes, suggesting that the network is making use of some generalized features, e.g. the first two SV's in the first two rows and the last SV and the first in the first and last row respectively. In order to explore this similarity we plot the inner product between SV's across the dataset in Figure 5. This effectively amounts to a cosine similarity metric since the SV's are unit normalized. The first singular vector seems to be quite common across the dataset with the next two decreasing in generality but still maintaining significant subgroups. 4 Figure 5: Similarity of SV's across the car dataset We compare the evolution of singular vectors across the network by visualizing the top SV and the corresponding spectrum from the first, middle, and penultimate layers in Figure 6. Two trends appear, the first being that the spectrum narrows as the depth of the layer increases with shifting contributions until the penultimate layer uses the first SV almost exclusively. Figure 6: Evolution of the top SV from the first layer on the left to the penultimate layer on the right The second trend is that the top SV seems to evolve with depth, evidenced by how certain regions of the singular vector shift the sign of their contributions and their spatial coherence increases. It is difficult to say whether this is supportive of the widely held view that models learn more abstract features with increasing depth. On the one hand, the increasing sparsity of the spectrum does suggest that features are being consolidated, yet, on the other hand, the similarity of the SV's from each layer contradicts the idea of progressive abstraction. A remarkable feature of the SV's for the car data set is how they respect the symmetry of the de- sign. It may be tempting to assume that this is always the case with symmetric designs. However, our next dataset and model were trained to reconstruct wind turbines and predict their maximum stress. In Figure 7, we see that the top SV does not concentrate on the geometric features in a sym- metric way. Instead, the model chose to source different contributions from each blade separately but within the same singular vector. Beyond this difference, there is a similar evolution with the depth of the SV's and the increasing sparsity of the spectra as was observed for the car dataset. 5 Figure 7: Evolution of the top SV from the first layer on the left to the penultimate layer of the model trained on the turbine data set 2.3 Auto Encoded Rotated Squares We end our results section by presenting our method applied to a toy dataset of randomly rotated squares of size 32 × 32 on a black background of size 64 × 64. We then train an auto-encoder network using fully connected layers without bias, with ReLU activations and a bottleneck layer of size 8. After training, we compare the learned singular vectors vs. the vectors obtained via SVD of the data matrix (i.e. the matrix whose rows are the flattened images). On the model side, the singular vectors are obtained by selecting random images from the test data set and calculating the SVD decomposition of the full affine operator for that instance (i.e. ls = L). The singular value spectrum of the data matrix SVD is shown in Figure 8a along with the first four singular vectors in Figure 8c. The corresponding spectrum from the SVD decomposition of the linear operator decays much faster, suggesting that the learned linear operator is more specialized to the instance given. This view is reinforced by the visualization of the top four singular vectors. In contrast to the data-derived singular vectors that are clearly circular the network vectors are much more reminiscent of the square, although, circular aspects are also present. It is curious that the fullest square is not the top SV as the disc is for the data. Or that the other SV's are required at all since the second SV seems sufficient to reconstruct the square. However, if we consider the coefficients in (18) we see that c0 L = 25 with all other contributions ci>1 (cid:28) 1. This effectively renders φ1 L as can be determined by the corresponding SVs of the UL. We note that the singular vectors of the UL and VL matrices are complementary but have significant differences. L the top contributor with edge corrections from φ0 L = 5 and c1 3 Discussion 3.1 Bias term contribution So far we have concentrated on understanding the ui operator through its singular vectors and spectrum. However, it is not the only input-dependent term contributing to the output and here we aim to highlight that the bias term has a significant role to play. 6 (a) (b) (c) Figure 8: Comparison of singular spectra of data matrix and network linear operator. (a) Spectrum of data matrix. (b) Spectrum of network operator. (c) (1st row) First four singular vectors of the data matrix, (2nd row) Right SV's of the entire Network, (3rd row) Feature wise contractions of the SV's, (4th row) Left SV's of the entire network For the toy problem, we trained a network without any bias terms in order to make the com- parison with data SVD. We train a new network with bias terms and explore their contributions. Remarkably, the SV's of the new network only correct the edges of the bulk that is generated by the bias terms as shown in Figure 9. This is quite different from the solution found by the no-bias network and is, somewhat, counter-intuitive though the bias term from the last decoder layer does align nicely with the top SV from the data matrix. We can apply a similar analysis for the 3D data since we trained an autoencoder to reproduce the input shape before the downstream model. In Figure 10 we show the bias contributions of the last few layers of the autoencoder. Similar to the toy data the bias terms of the last two layers are responsible for the bulk of the 7 (a) (b) Figure 9: Comparison of contributions coming from the SV's of the u ̃x term and those coming from the bias terms. (a) (top) Top 4 singular vectors, (bottom) bias term contributions from the decoder layers. (b) (top) u ̃x * ̃x, (bottom) b ̃x as calculated from the RHS of (9) (a) (b) Figure 10: Bias contributions of (a) the last three layers and (b) the total bias term reconstructed shape. An intriguing difference is how the bias contributions look like noisy point clouds but their sum results in a highly structured shape. It seems that the bias terms can also be responsible for the representative power of deep models and have been quite overlooked in the XAI literature. A possible reason for this behavior and the increased performance over the no-bias network might be due to the ease of training the bias terms through their shallower gradient paths. This would be in line with the motivations and performance of ResNet [35] architectures. 3.2 Feature wise contraction Throughout the results section we have made use of the feature-wise contraction to generate the heatmaps displayed. However, it may not be clear why this is more interpretable than using the SV's directly, especially since for the toy dataset the SV's don't look too far from their contracted versions. We display some examples from the image and 3d data sets in Figure 11 where the fea- ture channels are averaged over instead of contracted with the input. The most distinct difference between the two treatments for the images is how much more diffuse and present on the back- ground the averaged SV's are. For the 3D models, the SV's are not as diffuse but they do give a false impression of the contribution each point brings to the output. This is also the case for the 8 Figure 11: Feature wise averaged top contributing SV's for AlexNet, VGG11, cars and wind turbines images where the averaged SV's may lead us to over-attribute the importance of the background, when in fact it gets canceled pixel-wise. This pixel/point-wise cancellation without taking the corresponding weights to zero is a remarkable feature of the learned operators. It reinforces the view that learning to ignore features is just as important part of learning as paying attention to the main signal. 3.3 Comparison with other XAI methods For comparison, we present here explanations produced by a prominent subset of the many XAI methods available in the literature. Since most of these methods were developed with 2D com- puter vision in mind we restrict our comparison to the ImageNet models. In Figures 12 and 13 we see attribution heatmaps for the three ImageNet examples used throughout our results. Gradient based [36–38] and LRP [39] explanations seem in good agreement with each other. No- tably integrated gradients (IG) [38] have the least amount of noise in their heatmaps while grad exhibits the most. This of course can be attributed to the feature-wise dot-product and averaging effect of the integral in IG. There is a lot of similarity between these explanations and the singular vectors produced by the penultimate layer. This can be expected since the right operator in (16) is most of the network. However, with the existing XAI methods, there is no opportunity to decompose the effect of the network into potentially less noisy pieces. The most striking difference is that we can naturally inspect the operators and representation at an intermediate layer and compare SV's in an equiva- lent way. In doing so, the advantage of our method becomes most apparent and we can see how the operator coming from the last convolutional layer has SV's that are spatially separated. GradCam [40] also attempts to understand the network in terms of the output of the last con- Figure 12: Comparison explanations for AlexNet 9 volutional layer. However, due to the averaging operations and the necessary interpolation, the produced explanations are very coarse. In contrast, our method is fine-grained, and the SV's high- light how the filters decompose the input. Figure 13: Comparison explanations for VGG 11 LIME [12] builds a linear surrogate of the model around perturbations of the input applied to superpixels obtained by Felzenszwalb segmentation [41]. Despite the fact, the models considered are already linear around the input the produced explanations are quite different than the SV's and other gradient-based methods. The biggest disagreement is the over-importance LIME assigns to the background super pixel. This may be explained by either the fact that Lime produces out- of-distribution perturbations or because the background gets removed via the feature-wise dot product in the other methods including our own. 4 Method In this section, we outline the mathematical preliminaries underpinning our method. 4.1 Deep networks A deep neural network, in the most general sense, is a map fθ : RM → RN between an input signal x ∈ RM to the space of desired output signals y ∈ RN, where θ denotes all parameters of the map. It is important to note that regardless of the actual input and output signal type (e.g. binary or categorical) deep learning usually assumes the underlying algebraic field is continuous. The term deep refers to the fact that the map fθ is a composition of multiple maps, that are loosely termed layers, each with their own set of parameters fθ(x) = ( f L θL ◦ f L−1 θL−1 ◦ * * * ◦ f 1 θ1 )(x) θi ⊂ θ (1) where L ∈ N > 2 specifies the number of layers. The prototypical layer consists of an affine map followed by an element-wise non-linear activation function σ. zl+1 = σ(Wlzl + bl) (2) Where z0 = x, zL = y and the intermediate cases zl for 1 < l < L are termed hidden or latent repre- sentations. The non-linearity σ is usually chosen from a popular set of functions such as Sigmoid, 10 Tanh or ReLU := max(*, 0) and their variants. These non-linear activations are responsible for the ability of neural networks to approximate arbitrary functions and are the source of the observed representational power of deep learning. Indeed, without the non-linearity the composition of multiple linear maps fW,b(x) = Wx + b would collapse into a single linear transformation. fW2,b2 ( fW1,b1(x)) = fW2W1,W2b1+b2 (3) Due to the combination of a large number of layers, a large number of parameters, and the use of non-linear activation functions, deep learning models have come to be perceived as black boxes. 4.2 Local Linearity Despite the global non-linear nature of deep neural networks, it was noticed in Mont ́ufar et al. [22] that certain architectures containing piece-wise linear activation functions are completely defined by the separate linear pieces that it's composed of. More specifically, if we restrict ourselves to a linear region of the input domain Rˆı ⊂ RM then for any input in that region the network output is given by: yˆı = uˆı * xˆı + bˆı, xˆı ∈ Rˆı (4) This is known as the input-dependent point-wise affine map (PWA) form of the network. The above equation shows that in a linear region, the network is reduced to a matched filter output plus a bias term or, put another way, a dot product between the input and a learned vector. For the case when the network is composed of linear transformations and ReLU activation functions we can explicitly write the vector as (uˆı)j = (WL)j: * diag(IzL−1>0) * WL−1 * . . . * diag(Iz1>0) * W1 (5) Where the operator diag(Izl >0) is represented by a diagonal matrix of element-wise indicator func- tions. By noticing that the indicator operator is in fact the derivative of the ReLU activation func- tion we can write the following: ∂ ∂z ReLU( fW,b(z)) = ∂ReLU(z) ∂z (cid:12) (cid:12) (cid:12) fW,b(z) * ∂ ∂z ( fW,b(z)) = diag(I fW,b(z)>0) * W (6) As previously noted deep networks are compositions of differentiable functions and we can ex- ploit the chain rule to efficiently calculate the ui vector. (uˆı)j = (cid:19) (cid:18) ∂zL ∂zL−1 * ∂zL−1 ∂zL−2 j: * . . . * ∂z1 ∂z0 = (cid:19) (cid:18) ∂y ∂x j: (7) In practice, we do not know apriori, what the linear regions are. Fortunately, we can still obtain the corresponding linear transformation by differentiating the network w.r.t. a specific example of interest ̃x in the input space. fθ( ̃x) = ∂ fθ(x) ∂x (cid:12) (cid:12) (cid:12) ̃x * ̃x + b ̃x = u ̃x * ̃x + b ̃x (8) 11 The bias term can be obtained in two ways: b ̃x = fθ( ̃x) − ∂ fθ(x) ∂x (cid:12) (cid:12) (cid:12) ̃x * ̃x = L ∑ l=1 ∂ fθ(x) ∂bl (cid:12) (cid:12) (cid:12) ̃x * bl = L ∑ l=1 βl (9) Now we can obtain the linear regions by perturbing ̃x and testing for change in the operator. For this particular architecture, the input dependence is only manifest through the indicator functions since the other terms correspond to the layer weights. This means that two inputs with the same activation signs will result in the same affine map and will belong to the same linear region Ri. We can view the model as an ensemble of linear models with restricted support to the linear regions. Since linear models are considered inherently interpretable, then a neural network with piecewise activation functions can be said to be effectively interpretable when considering its form for a specific input. 4.3 The class of locally linear models So far we have shown local linearity for networks consisting of affine maps followed by ReLU activation functions. However, the class of locally linear models is substantially broader as we show in the following. Convolutional layers are a popular choice for vision-related tasks and signal processing. The inputs to these layers are usually organized as tensors with spatiotemporal dimensions and chan- nel (features) dimensions e.g. for video zt h w c ∈ RT ⊗ RH ⊗ RW ⊗ RC. These inputs are then convoluted with the layer filters Wt h w c c(cid:48) ∈ RTk ⊗ RHk ⊗ RWk ⊗ RC ⊗ RC(cid:48) ̃zt(cid:48) h(cid:48) w(cid:48) c(cid:48) = Tk−1 ∑ τ=0 Hk−1 ∑ η=0 Wk−1 ∑ ω=0 Ck−1 ∑ κ=0 Wτ η ω κ c(cid:48) zτ+t(cid:48) η+h(cid:48) ω+w(cid:48) κ + bc(cid:48) (10) Despite the above succinct representation the most efficient way to implement convolutions is to flatten the input into a vector and matrecize the weights into a Toeplitz matrix. Ultimately, convolutions are affine maps with a constrained weight matrix ̃W ∈ RT(cid:48) H(cid:48)W(cid:48)C(cid:48)×TW HC ̃z = ̃W * z + ̃b ̃z, ̃b ∈ RT(cid:48) H(cid:48)W(cid:48)C(cid:48) ; z ∈ RTHWC (11) The output dimensions are a function of the convolution kernel size, dilation, stride, and padding. Pooling layers are a type of convolution operation aimed at reducing the size of the spatiotempo- ral dimensions while leaving the channel dimension the same. The weights of these layers can be fixed as in the case of average pooling or can be input dependent like max pooling, however, since they are convolution layers they too are effectively affine maps. Residual layers a.k.a. skip connections, are an effective way to combat the vanishing gradient problem by introducing an additive operation and allowing paths of a lower depth. y = (W + f ) * x + b (12) 12 Where f is a locally linear deep network and W is a map, not necessarily trainable, used to match the input to the same dimension as the image of f . Residual layers are pointwise affine as long as f is pointwise affine. Concatenation layers are a method of combining inputs from different branches into a single representation. Taking z1 = f1 * x and z2 = f2 * x to be the outputs of two locally linear branches of the network, a concatenated layer can be expressed as z = W * [z1 z2] + b = [W1 W2] * [z1 z2] + b = W1 * z1 + W2 * z1 + b = (W1 f1 + W2 f2) * x + b (13) Which is equivalent in form to a residual layer and hence pointwise affine. Activation functions have already been identified as element-wise non-linear operations critical to model performance. However, despite their non-linearity they too admit an input dependent point wise affine representation σ(z) = fΛ(z),b(z) = diag (cid:19) (cid:18) σ(z) − b z * z + b (14) Note that this representation is not unique, and we have the freedom to choose any constant b including 0 or σ(0). For the special case, when the activation is piecewise linear, the canonical representation is given by the gradient of the activation function as was shown for the ReLU case above. Λ(z) = diag (cid:19) (cid:18) ∂σ(z) ∂z (15) This representation is also valid for the near linear regions of Sigmoid and Tanh activations and is favored in this work due to its ease of computation using auto differentiation packages. We define the class of locally linear models as functions formed by composing successive point- wise affine maps. Their local linearity can be proven by noticing that these maps map points to points and that their composition is again pointwise affine. As demonstrated above, many pop- ular components of deep learning models fall into this category and the class of locally linear models is quite broad. 4.4 Spectral surgery Having shown that a large class of deep learning models can be reduced to locally linear models we now turn to the analysis of these models for the purposes of explainability. The natural ques- tion is how do we analyze the overall effect of composing multiple pointwise affine maps. One method is to focus on the final output and analyze the effective linear transformation ui in (4). Indeed, this strategy is used for saliency maps where the gradient of the output with respect to the input gives ui as shown in (7). However, despite it being an exact representation of the network action, it is an aggregated view that gives limited insight into the various components that make up the final prediction. The main contribution of this work is to decompose the output of the model into a linear combination of spectral components that are ranked by their contribution. 13 The first step is to pick an intermediate layer and separate the chain of pointwise affine maps (7) into a left and right piece. (u ̃x)j = (cid:32) L ∏ l=ls Wl (cid:33) (cid:32) ls∏ l=1 j: (cid:33) Wl * ̃x = (Lls )j:Rls * ̃x (16) Where we have used Wl for the representation of all pointwise affine maps involved. Next, we obtain the SVD of the right operator Lls Rls * ̃x = LlsUls Σ ls V T ls * ̃x = ˆLls * cls (17) Where ˆLls = LlsUls is a spectral left operator and cls = Σ * ̃x are spectral coefficients obtained by projecting the input onto the singular orthonormal vectors φi which are the columns of Vls and scaling by the corresponding singular values λi ls V T ls ci ls = λi ls φi ls * ̃x φi ls * φj ls = δij (18) Where δij is the Kronecker delta function. The singular values are defined to be positive and ordered in descending order λ0 > λ1 > . . . λr−1 where r is the rank of Lls. This decomposition of the input into the singular vectors (SV) of the operator is in contrast with the usual PCA methods used in statistics and data science but in line with the spectral methods common in physics and the analysis of differential equations. Specifically, given a linear differential operator L and problems of the form Lu = f (19) The solutions are obtained by expanding both u and f in terms of the eigenvectors of L and solving the resulting algebraic system. We interpret the singular vectors as a set {φi}r−1 i=0 of learned high dimensional filters which can be visualized for the purposes of explainability. In addition, we can obtain a linear decomposition of the network output in terms of the excitation of these filters. y ̃x = r−1 ∑ k=0 αk ls + b ̃x = r−1 ∑ k=0 ls λk ψk ls φk ls * x ̃x + b ̃x (20) Where the ψk are the r components of the row of the spectral left operator responsible for the ls output ( ˆLls )j:. It is important to note that the sign of the αk may not be positive nor does the magnitude preserve the order established by the singular values. However, what we do have for certain is an additive representation of the network output in terms of likely far fewer components than the input dimension r << M. We can further reduce the number of components by imposing a threshold either on the absolute values or the quantiles of the αk. Here we consider an alternative approach in which we reduce the components to purely positive or negative depending on the overall sign of the sum. To do so we separate the components into two complementary ordered lists α+ = {αk j > 0} and α−, where j |αk 14 j denotes the order index and k is the spectral index. Then we add the two sequences order-wise to obtain a new set of coefficients ˆα = (cid:0)α+ k + α− k (cid:1)min(|α+|,|α−|)−1 j=0 (cid:91) (α+ j )|α+| j=min(|α+|,|α−|) (cid:91) (α− j )|α−| j=min(|α+|,|α−|) (21) If the new sequence still has mixed signs then we can repeat the process with the resulting se- quence. Once all terms have the same sign, they can be normalized to give the proportional contribution of each singular vector ̃αk = ˆαk ∑| ˆα| j=0 ˆαj ˆαk, ˆαj ∈ ˆα (22) The justification for this procedure comes from the observation that weights in deep learning are initialized randomly with both positive and negative values while the common classification task requires either a positive or negative final output. Therefore, in the absence of a least energy constraint, solutions of many excitations that average out to a sufficiently positive or negative outcome are just as valid as ones of a single excitation. Note that we picked the layer ls to split the operator arbitrarily and each choice presents a new basis. However, each basis results in the same operator but expressed in terms of spaces with differing ranks. The spectral surgery referred to in the title of this subsection is the combination of exploring the basis of singular vectors at each layer and collapsing or pruning contributions to obtain an inter- pretable representation of the model. 4.5 Feature wise contraction The singular vectors have the same dimensions as the input and their action on the input is that of a dot product. However, when the data has a more natural tensor representation, such as an image, then we find that it proves insightful to perform the dot product along a particular dimension. hw = ∑ ck c (cid:17) (cid:16) φk ls xhwc hwc (23) This has a couple of advantages beginning with the fact that it is a more natural way to treat multi- dimensional attributions for each point in the input than averaging or taking absolute values. In this way, we consider the attributions as a contribution each point brings to the output, which can be zero. This is the second advantage of the contraction in that it allows us to determine which points don't affect the prediction and may emphasize the contributing points better. We note the similarity with the gradient times input XAI method [37]. However, we offer a more principled prescription to aggregate the contributions at each point compared to the usual mask- ing of negative values. This does not permit the cancellation of features and may present an inaccurate view of the network. 4.6 Symbolic representation At this point we have all the necessary ingredients to produce a symbolic representation of the network. This is usually done in spectral decomposition methods as a change of basis. 15 ̃x = ∑ k (cid:16) φk ls * ̃x (cid:17) φk ls (24) In practice we find that the projections of the input onto the SV's to be of similar magnitude across the entire spectrum and thus unsuitable for our XAI purposes. This representation does not directly take into consideration how the input influences the network output. The combination of the singular values λk and the left operator Lls typically induce a natural ranking among the SV's. ls Therefore, we symbolically decompose the output of the network as: (y ̃x)hw = r−1 ∑ k=0 αk ls ˆck hw + (b ̃x)hw ⇒ y ̃x = ∑ (y ̃x)hw hw Where ˆck hw = ck hw ∑hw ck hw , (b ̃x)hw = b ̃x |h||w| (25) (26) This decomposition takes account of the ranking induced by the output and incorporates the fea- ture wise contraction. In addition we can make use of the reduction strategy to replace the αk ls by ̃αk from (22) and obtain coefficients of homogenous sign. We emphasise that although the in- ls dices reflect an image classification use case the decomposition can be easily extended to arbitrary tensor outputs. 5 Conclusion In this work, we have presented a novel explainability technique that leverages the locally linear structure of complex neural networks to decompose the action of deep learning models into inter- pretable components. We have shown that the network does indeed focus on salient features if the corresponding singular vectors are combined with the input in the correct way. Furthermore, the technique can be used to dissect the network in a consistent way so that we may inspect the repre- sentations at each layer and elucidate how the operator evolves across the depth of the model. A notable example of this can be seen in the output of the convolutional layers in the vision models, which decompose the input image into spatially separated salient segments. In our view, this ad- dresses a shortcoming in many existing explainability methods that tend to produce explanations that are a mix of all salient features. The methods that do consider intermediate representations tend to rely on interpolation and/or analysis of a subset of units. Our approach, however, out- puts fine-grained explanations that consider all activated units. Next, we have shown how our method produces a natural additive symbolic representation that is equivalent across all layers, and we have outlined a method to reduce the number of contributing terms through cancellations of opposing coefficients. Finally, the main advantage of our method, we believe lies in the fact that it does not rely on axiomatic or heuristic motivations but is a principled application of es- tablished linear algebra techniques to give an accurate, interpretable characterization of complex deep learning models. 6 Acknowledgements This work was done in the scope of the Innovate UK grant on "Explainable AI system to rational- ize accelerated decision making on automotive component performance and manufacturability" [Project 10009522]. 16 References [1] Feiyu Xu, Hans Uszkoreit, Yangzhou Du, Wei Fan, Dongyan Zhao, and Jun Zhu. Explain- able ai: A brief survey on history, research areas, approaches and challenges. In Natural Language Processing and Chinese Computing: 8th CCF International Conference, NLPCC 2019, Dunhuang, China, October 9–14, 2019, Proceedings, Part II 8, pages 563–574. Springer, 2019. [2] Filip Karlo Doˇsilovi ́c, Mario Brˇci ́c, and Nikica Hlupi ́c. Explainable artificial intelligence: A survey. In 2018 41st International convention on information and communication technology, electronics and microelectronics (MIPRO), pages 0210–0215. IEEE, 2018. [3] Amina Adadi and Mohammed Berrada. Peeking inside the black-box: a survey on explain- able artificial intelligence (xai). IEEE access, 6:52138–52160, 2018. [4] Andreas Holzinger, Anna Saranti, Christoph Molnar, Przemyslaw Biecek, and Wojciech Samek. In xxAI-Beyond Explainable AI: International Workshop, Held in Conjunction with ICML 2020, July 18, 2020, Vienna, Austria, Revised and Extended Papers, pages 13–38. Springer, 2022. Explainable ai methods-a brief overview. [5] Hui Wen Loh, Chui Ping Ooi, Silvia Seoni, Prabal Datta Barua, Filippo Molinari, and U Ra- jendra Acharya. Application of explainable artificial intelligence for healthcare: A systematic review of the last decade (2011–2022). Computer Methods and Programs in Biomedicine, page 107161, 2022. [6] Jurgita ˇCerneviˇcien ̇e and Audrius Kabaˇsinskas. Review of multi-criteria decision-making methods in finance using explainable artificial intelligence. Frontiers in artificial intelligence, 5:35, 2022. [7] Branka Hadji Misheva, Joerg Osterrieder, Ali Hirsa, Onkar Kulkarni, and Stephen Fung Lin. Explainable ai in credit risk management. arXiv preprint arXiv:2103.00949, 2021. [8] Bibhudhendu Shukla, Ip-Shing Fan, and Ian Jennions. Opportunities for explainable artificial In PHM Society European Conference, intelligence in aerospace predictive maintenance. volume 5, pages 11–11, 2020. [9] Vikram Krishnamurthy, Kusha Nezafati, Erik Stayton, and Vikrant Singh. Explainable ai framework for imaging-based predictive maintenance for automotive applications and be- yond. Data-Enabled Discovery and Applications, 4:1–15, 2020. [10] Srikanth Kaniyanoor Srinivasan, V Krishna, and Harsha Vardhan Sahoo. A methodology to use ai for automotive safety using model explainability. Technical report, EasyChair, 2021. [11] Iulian Ogrezeanu, Anamaria Vizitiu, Costin Cius, del, Andrei Puiu, Simona Coman, Cristian Boldis, or, Alina Itu, Robert Demeter, Florin Moldoveanu, Constantin Suciu, et al. Privacy- preserving and explainable ai in industrial applications. Applied Sciences, 12:6395, 2022. [12] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. "why should i trust you?": Explain- ing the predictions of any classifier, 2016. URL https://arxiv.org/abs/1602.04938. [13] Javier Castro, Daniel G ́omez, and Juan Tejada. Polynomial calculation of the shapley value based on sampling. Computers I& Operations Research, 36(5):1726–1730, 2009. ISSN 0305- 0548. doi: https://doi.org/10.1016/j.cor.2008.04.004. URL https://www.sciencedirect. 17 com/science/article/pii/S0305054808000804. Selected papers presented at the Tenth In- ternational Symposium on Locational Decisions (ISOLDE X). [14] Erik ˇStrumbelj and Igor Kononenko. An efficient explanation of individual classifications using game theory. J. Mach. Learn. Res., 11:1–18, 2010. [15] Scott Lundberg and Su-In Lee. A unified approach to interpreting model predictions, 2017. URL https://arxiv.org/abs/1705.07874. [16] Paolo Giudici and Emanuela Raffinetti. Shapley-lorenz explainable artificial intelligence. Expert systems with applications, 167:114104, 2021. [17] Yasmeen Alufaisan, Laura R Marusich, Jonathan Z Bakdash, Yan Zhou, and Murat Kantar- In cioglu. Does explainable artificial intelligence improve human decision-making? Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 6618–6626, 2021. [18] Mark T Keane and Barry Smyth. Good counterfactuals and where to find them: A case-based technique for generating counterfactuals for explainable ai (xai). In Case-Based Reasoning Research and Development: 28th International Conference, ICCBR 2020, Salamanca, Spain, June 8–12, 2020, Proceedings 28, pages 163–178. Springer, 2020. [19] Yibing Liu, Haoliang Li, Yangyang Guo, Chenqi Kong, Jing Li, and Shiqi Wang. Re- thinking attention-model explainability through faithfulness violation test. In International Conference on Machine Learning, pages 13807–13824. PMLR, 2022. [20] Sarah Wiegreffe and Yuval Pinter. Attention is not not explanation. arXiv preprint arXiv:1908.04626, 2019. [21] Kunpeng Zhang and Li Li. Explainable multimodal trajectory prediction using attention models. Transportation Research Part C: Emerging Technologies, 143:103829, 2022. [22] Guido Mont ́ufar, Razvan Pascanu, Kyunghyun Cho, and Yoshua Bengio. On the number of linear regions of deep neural networks, 2014. [23] Randall Balestriero and Richard G. Baraniuk. Mad max: Affine spline insights into deep learning. Proceedings of the IEEE, 109(5):704–727, May 2021. ISSN 1558-2256. doi: 10.1109/ jproc.2020.3042100. URL http://dx.doi.org/10.1109/JPROC.2020.3042100. [24] Guang-He Lee, David Alvarez-Melis, and Tommi S. Jaakkola. Towards robust, locally linear deep networks, 2019. [25] Xiao Zhang and Dongrui Wu. Empirical studies on the properties of linear regions in deep neural networks, 2020. [26] Shengjie Wang, Abdel-Rahman Mohamed, Rich Caruana, Jeff Bilmes, Matthai Plilipose, Matthew Richardson, Krzysztof Geras, Gregor Urban, and Ozlem Aslan. Analysis of deep neural networks with the extended data jacobian matrix. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML'16, page 718–727. JMLR.org, 2016. [27] Sebastian Lapuschkin, Stephan W ̈aldchen, Alexander Binder, Gr ́egoire Montavon, Woj- ciech Samek, and Klaus-Robert M ̈uller. Unmasking clever hans predictors and assessing what machines really learn. Nature Communications, 10(1), mar 2019. doi: 10.1038/ s41467-019-08987-4. URL https://doi.org/10.1038/s41467-019-08987-4. 18 [28] Hamidreza Eivazi, Soledad Le Clainche, Sergio Hoyas, and Ricardo Vinuesa. Towards ex- traction of orthogonal and parsimonious non-linear modes from turbulent flows. Expert Systems with Applications, 202:117038, 2022. ISSN 0957-4174. doi: https://doi.org/10. 1016/j.eswa.2022.117038. URL https://www.sciencedirect.com/science/article/pii/ S0957417422004535. [29] Kari Karhunen. Zur spektraltheorie stochastischer prozesse. Ann. Acad. Sci. Fennicae, AI, 34, 1946. [30] Clarence W. Rowley, Igor Mezic, Shervin Bagheri, Philipp Schlatter, and Dan S. Henningson. Journal of Fluid Mechanics, 641:115–127, 2009. doi: Spectral analysis of nonlinear flows. 10.1017/S0022112009992059. [31] Peter Schmid and J ̈orn Sesterhenn. Dynamic mode decomposition of numerical and experi- mental data. Journal of Fluid Mechanics, 656, 11 2008. doi: 10.1017/S0022112010001217. [32] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei- Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. doi: 10.1007/s11263-015-0816-y. [33] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84–90, 2017. [34] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [35] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for im- In Proceedings of the IEEE conference on computer vision and pattern age recognition. recognition, pages 770–778, 2016. [36] Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps, 2013. URL https: //arxiv.org/abs/1312.6034. [37] Avanti Shrikumar, Peyton Greenside, Anna Shcherbina, and Anshul Kundaje. Not just a black box: Learning important features through propagating activation differences, 2016. [38] Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks, 2017. [39] Alexander Binder, Gr ́egoire Montavon, Sebastian Lapuschkin, Klaus-Robert M ̈uller, and Wo- jciech Samek. Layer-wise relevance propagation for neural networks with local renormaliza- tion layers. In International Conference on Artificial Neural Networks, pages 63–71. Springer, 2016. [40] Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-CAM: Visual explanations from deep networks via gradient- based localization. International Journal of Computer Vision, 128(2):336–359, oct 2019. doi: 10.1007/s11263-019-01228-7. URL https://doi.org/10.1007%2Fs11263-019-01228-7. [41] Pedro F Felzenszwalb and Daniel P Huttenlocher. Efficient graph-based image segmentation. International journal of computer vision, 59:167–181, 2004. 19
http://arxiv.org/abs/2302.09938v1
2023-02-20T12:07:57
2023-02-20T12:07:57
SkillRec: A Data-Driven Approach to Job Skill Recommendation for Career Insights
Understanding the skill sets and knowledge required for any career is of utmost importance, but it is increasingly challenging in today's dynamic world with rapid changes in terms of the tools and techniques used. Thus, it is especially important to be able to accurately identify the required skill sets for any job for better career insights and development. In this paper, we propose and develop the Skill Recommendation (SkillRec) system for recommending the relevant job skills required for a given job based on the job title. SkillRec collects and identify the skill set required for a job based on the job descriptions published by companies hiring for these roles. In addition to the data collection and pre-processing capabilities, SkillRec also utilises word/sentence embedding techniques for job title representation, alongside a feed-forward neural network for job skill recommendation based on the job title representation. Based on our preliminary experiments on a dataset of 6,000 job titles and descriptions, SkillRec shows a promising performance in terms of accuracy and F1-score.
[ "Xiang Qian Ong", "Kwan Hui Lim" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09938v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09938v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.AI", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.AI", "cs.LG", "cs.SI" ]
SkillRec: A Data-Driven Approach to Job Skill Recommendation for Career Insights Xiang Qian Ong Information Systems Technology and Design Pillar Singapore University of Technology and Design Singapore xiangqian [email protected] Kwan Hui Lim Information Systems Technology and Design Pillar Singapore University of Technology and Design Singapore kwanhui [email protected] 3 2 0 2 b e F 0 2 ] I A . s c [ 1 v 8 3 9 9 0 . 2 0 3 2 : v i X r a Abstract-Understanding the skill sets and knowledge required for any career is of utmost importance, but it is increasingly challenging in today's dynamic world with rapid changes in terms of the tools and techniques used. Thus, it is especially important to be able to accurately identify the required skill sets for any job for better career insights and development. In this paper, we propose and develop the Skill Recommendation (SkillRec) system for recommending the relevant job skills required for a given job based on the job title. SkillRec collects and identify the skill set required for a job based on the job descriptions published by companies hiring for these roles. In addition to the data collection and pre-processing capabilities, SkillRec also utilises word/sentence embedding techniques for job title representation, alongside a feed-forward neural network for job skill recommendation based on the job title representation. Based on our preliminary experiments on a dataset of 6,000 job titles and descriptions, SkillRec shows a promising performance in terms of accuracy and F1-score. Index Terms-Recommendation Systems, Skill Recommen- dation, Occupational Analysis, Natural Language Processing, Neural Networks I. INTRODUCTION Technological advancements and industrial changes are con- stantly evolving at a rapid pace [1]. With this rapid change, new job scopes are constantly being generated at companies along with a dynamic list of skill sets to meet these ever- growing changes. As such, individuals that are looking to change their career or seeking a new job often face the problem of skill mismatch due to those constant changes. This problem is further highlighted by the recent COVID-19 pandemic which has caused drastic changes in many industries, such as aviation and tourism. During this period, there was a spike in the number of retrenched workers seeking to find employment in other fields [2] and potentially facing skill mismatch. On top of that, jobs are tightly coupled with skill sets, which are essential for fulfilling the job requirements. Individuals who are transiting into a new career and industry would need to conduct extensive research or seek advice on the latest job requirements and the relevant skills. This process is commonly performed to improve the chances of applicants securing a new job, especially in a new industry. This is necessary due to the huge barrier of entry for individuals transiting over to new jobs or new industries, given their existing skill sets. Different industry fields and even roles within the same industry require different sets of skills to carry out tasks associated with the job. Likewise, hiring managers also look out for those skill sets when assessing suitable candidates for an open role. As such, identifying the skill sets required for a given job is especially important for potential job seekers, even for those staying in the same industry. A. Related Work In terms of academic research, this problem and research area have also garnered keen interest in recent years due to these various developments [1], [3]–[7]. For example, there are various streams of research that investigate diverse but related topics such as: (i) recommending job candidates to companies based on their suitability [8]–[10]; (ii) recommending jobs to candidates based on the candidates skill sets and career history [11], [12]; (iii) modelling the career trajectories of in- dividuals [13], [14]; (iv) predicting the future career transitions and movements of workers [15], [16]. Among these works, the most closely related works to our research are those on job skill recommendations [17]–[19] and those using various embedding techniques [4], [20]–[22] for occupational analysis and mining. For example, Dave et al. proposed a representation learning model using job transitions, job-skills and skill co-occurence networks for recommending both jobs and skills [17]. Others have used reinforcement learning in the form of a Deep-Q Network for skill recom- mendation and better interpretation [19]. Liu et al. developed a bi-directional language model for contextualised job tile em- beddings that was demonstrated on a downstream occupational named entity recognition task [4]. Skills2Graph [21] used FastText embeddings to better maintain semantic similarity between taxonomic components of job postings. Also closely related to our research are various works that have developed systems and implemented approaches for related occupational analysis and mining tasks [20], [23], [24]. B. Motivation and Problem Statement The fundamental problem is that identifying the relevant skill sets required for a particular job title is both time- consuming and a complex process. However, this process is essential to job seekers looking to enter new jobs and yet very challenging as they are new to both the field and industry. The problem can be broken down into two sub-problems: the lack of knowledge to learn the relevant skills and the lack of proficiency in the relevant skills, which will be elaborated next. 1) Lack of knowledge to learn the relevant skills: To learn the relevant skills required for the particular job, there is a need to understand the current job workflow, the tools that are used on the job and knowledge in that field of interest. The root of the problem is the lack of domain expertise in the new industry to truly understand the skill sets required for the job [25]. There are various different ways in which the problem can be mitigated. The first is to seek advice from experts who have worked in the field for a long time. They understand the job requirements and the necessary skill sets needed, from their ex- tensive years of experience. Alternatively, governments' skills recommendations serve as a good indicator of possible general relevant skill sets that are required in the industry for the near future [26], [27]. Lastly, individuals could perform online research on the industry, given that there is an abundance of articles and forums that share insights and recommendations. This step is crucial as it serves as the basis for the next step. Only after knowing the skills that need to be learned, then the individual can embark on the next step. 2) Lack of proficiency in the relevant skills: After identi- fying the required skill sets to transit to a new industry or role, it is crucial for individuals to have access to resources to learn those skills. Proficiency in these relevant skills is an essential requirement that leads to successful employment and subsequent progression. The resources could come in many different forms, both physical and digital, which we discuss next. A classroom setting is a common structure whereby individ- uals will attend classes and undergo a structured curriculum to gain knowledge and experience from the instructors. At the end of such courses, there are formal certificates that act as proof of completion of the course. Classroom formats could also be virtual, ranging from online courses such as Udemy and Coursera. Similarly, these classes provide both the content and practical lessons, with the added bonus of online certificates upon completion. Openly available resources are unstructured curricula that could comprise different resources from both online and offline. This gives the individual the flexibility of time and learning opportunity but typically do not result in a formal certification upon completion. C. Problem Definition In this paper, our main focus is on the first sub-problem, which is the lack of knowledge to learn the relevant skills required for a job role. This problem is significantly more crucial than the second sub-problem, as the former's outcome will determine the skill sets that an individual is required to learn. Failing at this step will render useless any future efforts at both a industry transition or career progression. In addition, there are multiple open-source and affordable resources online to address the problem of a lack of proficiency, thus this second sub-problem is thus not as crucial as compared to the first sub- problem that we focus on. More formally, we investigate the problem of identifying and recommending the required job skill sets required for a role given the job title. D. Main Contributions The current ways to address the problems are mainly human-driven insights, such as seeking the advice of current practitioners in the new industry or through self-reading of openly available resources. However, we could tap into data- driven insights that perform the analysis and recommend the right skill sets to pick up for the industry or role we are interested in. This could reduce the time taken or the cost incurred in the process. In this paper, we make the following contributions: 1) We investigate the problem of job skill recommendation, which is to recommend a list of required skill sets given role in the form of a job title. 2) To address the above problem, we propose and develop the Skill Recommendation (SkillRec) system. SkillRec comprises the capability to collect openly available job listing information, process these data to extract job title and required skill sets, and subsequently recommend skill sets given a job title. 3) As part of SkillRec, we also develop two approaches to skill recommendation, utilising word/sentence em- bedding techniques (using BERT and FastText) for job title representation, before inputing this job title repre- sentation to a simple but effective feed-forward neural network for job skill recommendation. 4) Using a dataset of 6,000 job listings, we perform pre- liminary experiments to evaluate the performance of our proposed SkillRec system. Our preliminary results show promising performance of SkillRec in terms of accuracy and F1-score. II. PROPOSED SKILL RECOMMENDATION SYSTEM Our proposed Skill Recommendation (SkillRec) system comprises four main components, including a web collection component, data pre-processing component, job title represen- tation component and job skill recommendation component. Figure 1 shows an overview of our proposed system. Next, we provide a brief summary of each component, followed by a more detail description in the later sections. 1) Web Collection Component. This component retrieves job listings from various web sources, such as online job posting platforms. 2) Data Pre-processing Component. This component per- forms the necessary data pre-processing and cleaning to extract relevant information from the job descriptions, such as the job title, job description, required skills, company name, etc. 3) Job Title Representation Component. This component utilises word/sentence embedding techniques, such as BERT and FastText, to model job titles in term of its vector representations. Fig. 1: System Architecture of Our Proposed Skill Recommendation (SkillRec) System 4) Job Skill Recommendation Component. The job title representation from the previous step is then fed into this component, which comprises a feed-forward neural network that outputs a set of recommended skills given this job title. A. Web Collection Component The web collection component retrieves various types of web-based information such as job descriptions from popular online job posting platforms, as well as skill sets from massive open online courses platforms. B. Data Pre-processing Component the relevant The data pre-processing component works on the job title and job description data collected by the web collection component. This component first parses the collected webpage to extract the job title and information, job description. Thereafter, the standard text pre-processing steps, such as conversion to lowercase, removal of non-textual symbols, tokenisation, are performed on these two fields. The skill sets for a job listing is derived from its corresponding job description based on an exact match of a mentioned skill with our earlier list of 589 unique skill sets. i.e., C. Job Title Representation Component The job description data was retrieved over a period of six months at a weekly interval to ensure that the dataset is kept up-to-date. A total of 6,000 job descriptions were retrieved from three popular online job posting platform. As our main task is to determine the required skill sets for a given job title, we proceed to model the job titles using various embedding techniques. In this study, we experiment with two popular word/sentence representation techniques: Massive open online courses platforms provide a good source of information on popular educational courses and the skill sets they aim to impart. Using two popular massive open online courses platforms, we collected and identified 589 unique skill sets that are relevant for this work. • BERT Embedding [28]. The Bidirectional Encoder Rep- resentation of Transformer (BERT) is a transformer-based language model comprising multiple layers of bidirec- tional Transformer encoders, along with self-attention mechanism. BERT is then pre-trained with the Masked Language Model task of predicting hidden tokens using other non-hidden tokens, and/or Next Sentence Predic- tion task of predicting the next sentence given an input sentence. • BERT+NN. Similar to the earlier FastText+NN model, this model uses the BERT embedding for job title repre- sentation (Section II-C), followed by the same neural net- work (NN) for job skill recommendation (Section II-D). • FastText Embedding [29], [30]. FastText builds upon the skip-gram approach that is popularly used by the Word2Vec model [31], [32]. Using FastText, each word is represented by a bag-of-character n-grams, and in turn each character n-grams is represented by a vector. The vector representation of each word is then derived from the sum of these character n-grams vector representations. BERT was chosen due to its strong performance in various language modelling tasks, such as text classification, ques- tion answering, among others. In addition, BERT has been frequently used in a variety of other recommendation and prediction tasks, such as location prediction [33], [34] and tourism recommendation [35], [36]. After extracting the job title in the previous step, either BERT or FastText is then used to obtain the vector rep- resentation of the job title. This job title representation is subsequently used as input to our neural network for job skill recommendation, which we describe next. D. Job Skill Recommendation Component Using the vector representation of the job title from the previous step, this job title representation is then fed into a feed-forward neural network for job skill recommendation based on the job title. We utilise a feed-forward neural network with two fully-connected hidden layer, with the first hidden layer comprising 1280 nodes, the second hidden layer comprising 640 nodes and a final output layer of 589 nodes corresponding to the 589 unique skill sets. We employ Sigmoid as our activation function, AdamW as our optimizer and a dropout of 0.5 to reduce overfitting. III. EXPERIMENTS AND RESULTS Using our collected dataset, we use 80% for training our model as described in Section II and use the remaining 20% for evaluation. For evaluation purposes, we use the standard metrics of accuracy and F1-score, based on the recommended job skill against the ground truth job skill in the original job description. We experimented with the following algorithms and base- lines: • Bag-of-Words. A classical bag-of-words model that is traditionally used for classification tasks involving text- based data. In our application, we utilise a frequency- the frequency of which a based approach to model particular skill is mentioned in relation to a specific job. This model is used as a simple baseline to compare our two proposed approaches. • FastText+NN. As described earlier in our SkillRec sys- tem, this model uses the FastText embedding for job title representation (Section II-C), followed by a neural net- work (NN) for job skill recommendation (Section II-D). TABLE I: Experimental Results Algorithm Bag-of-Words FastText+NN BERT+NN Accuracy 0.4768 0.9728 0.9870 F1-score 0.2887 0.4931 0.4973 Table I shows the average results of our experiments for the three models in terms of accuracy and F1-score. The results show that our proposed SkillRec system using BERT+NN is the best performing model, with FastText+NN being a extremely close second. BERT has been shown to perform well for a range of natural language processing tasks, from text classification to question answering. Similarly for this task of occupational skill recommendation, BERT as well as FastText perform well with the add-on of a straightforward neural network. Unsurprisingly, Bag-of-Words performs the worst by a large margin due to the simple job title representation approach that is unable to capture similar job titles obtained. TABLE II: Example Job Title and Relevant Skills Job Title developer software chef senior director software engineer Related Jobs and Skills java, python, fullstack, android, software stack, java, python, fullstack, android pastry, kitchen, hair, chemist, accountant director, partner, pacific, planner, strategy software, engineer, python, java, embedded In addition to the experiments measuring accuracy and F1- score of the job skill recommendations, we also performed a qualitative check on the job title representations learnt and the similar job titles and skill sets based on these representations. Table II shows a sample of some job titles and the related job titles and skill sets. This simple analysis shows the effective- ness of our approach as occupations such as developer and software engineer results in relevant skills like Java, Python, fullstack, embedded, etc. Similarly, non-technical roles such as senior director also resulted in similar roles like partner and planner and relevant skills like strategy. For certain roles like chef, the results are more mixed with relevant terms like pastry and kitchen being mentioned but also non-relevant ones like chemist and accountant. This issue highlights a limitation due to our preliminary experiments and limited dataset, which contains more technical roles than non-technical ones. IV. CONCLUSION AND FUTURE WORK In this paper, we proposed the SkillRec system to address the problem of job skill recommendation given a job title. SkillRec comprises four main components for web collection, data pre-processing, job title representation and job skill recommendation. In particular, our preliminary experiments show that an approach that combines job title representation using BERT, along with job skill recommendation using a straightforward feed-forward neural network works effectively in terms of accuracy and F1-score. Future enhancements to SkillRec can involve a more dy- namic recommendation of job skills to account for new skill sets that may emerge in future or existing skill sets that evolve over time. Similarly, we can also include more context in addition to the job titles, such as the industry, country, job applicant details, etc, for making more contextualised and personalised job skill recommendations. V. ACKNOWLEDGMENT This research is funded in part by the Singapore University of Technology and Design under grant RS-MEFAI-00005- R0201. REFERENCES [1] I. Khaouja, I. Kassou, and M. Ghogho, "A survey on skill identification from online job ads," IEEE Access, vol. 9, pp. 118 134–118 153, 2021. [2] W. E. Forum, "The future of jobs report 2020," World Economic Forum, 2020. [3] A. Gugnani and H. Misra, "Implicit skills extraction using document embedding and its use in job recommendation," in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, no. 08, 2020, pp. 13 286–13 293. [4] J. Liu, Y. C. Ng, Z. Gui, T. Singhal, L. Blessing, K. L. Wood, and K. H. Lim, "Title2vec: a contextual job title embedding for occupational named entity recognition and other applications," Journal of Big Data, vol. 9, no. 1, pp. 1–16, 2022. [5] Z. Ao, G. Horv ́ath, C. Sheng, Y. Song, and Y. Sun, "Skill requirements in job advertisements: A comparison of skill-categorization methods based on wage regressions," Information Processing & Management, vol. 60, no. 2, p. 103185, 2023. [6] A. Barducci, S. Iannaccone, V. La Gatta, V. Moscato, G. Sperl`ı, and S. Zavota, "An end-to-end framework for information extraction from italian resumes," Expert Systems with Applications, vol. 210, p. 118487, 2022. [7] J. Liu, Y. C. Ng, K. L. Wood, and K. H. Lim, "Ipod: a large-scale in- dustrial and professional occupation dataset," in Conference Companion Publication of the 2020 on Computer Supported Cooperative Work and Social Computing, 2020, pp. 323–328. [8] C. Zhu, H. Zhu, H. Xiong, C. Ma, F. Xie, P. Ding, and P. Li, "Person-job fit: Adapting the right talent for the right job with joint representation learning," ACM Transactions on Management Information Systems (TMIS), vol. 9, no. 3, p. 12, 2018. [9] D. Shen, H. Zhu, C. Zhu, T. Xu, C. Ma, and H. Xiong, "A joint learning approach to intelligent job interview assessment." in IJCAI, 2018, pp. 3542–3548. [10] C. Qin, H. Zhu, T. Xu, C. Zhu, L. Jiang, E. Chen, and H. Xiong, "Enhancing person-job fit for talent recruitment: An ability-aware neural network approach," in The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, 2018, pp. 25–34. [11] J. Malinowski, T. Keim, O. Wendt, and T. Weitzel, "Matching people and jobs: A bilateral recommendation approach," in Proceedings of the 39th Annual Hawaii International Conference on System Sciences (HICSS'06), vol. 6, 2006, pp. 137c–137c. [12] Y. Zhang, C. Yang, and Z. Niu, "A research of job recommendation system based on collaborative filtering," in 2014 Seventh International Symposium on Computational Intelligence and Design, vol. 1, 2014, pp. 533–538. [13] Y. Liu, L. Zhang, L. Nie, Y. Yan, and D. S. Rosenblum, "Fortune teller: predicting your career path," in Thirtieth AAAI conference on artificial intelligence, 2016. [14] D. Mimno and A. McCallum, "Modeling career path trajectories," 2008. [15] C. James, L. Pappalardo, A. Sˆırbu, and F. Simini, "Prediction of next career moves from scientific profiles," arXiv preprint arXiv:1802.04830, 2018. [16] Y. Yang, D.-C. Zhan, and Y. Jiang, "Which one will be next? an analysis of talent demission," Proceedings of the 1st International Workshop on Organizational Behavior and Talent Analytics, 2018. [17] V. S. Dave, B. Zhang, M. Al Hasan, K. AlJadda, and M. Korayem, "A combined representation learning approach for better job and skill recommendation," in Proceedings of the 27th ACM International Con- ference on Information and Knowledge Management, 2018, pp. 1997– 2005. [18] A. Maurya and R. Telang, "Bayesian multi-view models for member- job matching and personalized skill recommendations," in 2017 IEEE International Conference on Big Data (Big Data). IEEE, 2017, pp. 1193–1202. [19] Y. Sun, F. Zhuang, H. Zhu, Q. He, and H. Xiong, "Cost-effective and interpretable job skill recommendation with deep reinforcement learning," in Proceedings of the Web Conference 2021, 2021, pp. 3827– 3838. [20] A. Giabelli, L. Malandri, F. Mercorio, M. Mezzanzanica, and A. Seveso, "Skills2graph: Processing million job ads to face the job skill mismatch problem." in Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, 2021. [21] --, "Skills2job: A recommender system that encodes job offer embed- dings on graph databases," Applied Soft Computing, vol. 101, p. 107049, 2021. [22] C. M. Jaramillo, P. Squires, H. G. Kaufman, A. M. Da Silva, and J. To- gelius, "Word embedding for job market spatial representation: tracking changes and predicting skills demand," in 2020 IEEE International Conference on Big Data (Big Data). IEEE, 2020, pp. 5713–5715. [23] X. J. S. Ashok, E.-P. Lim, and P. K. Prasetyo, "Jobsense: A data-driven career knowledge exploration framework and system," in 2018 IEEE International Conference on Data Mining Workshops (ICDMW). IEEE, 2018, pp. 1411–1416. [24] C. Qin, H. Zhu, C. Zhu, T. Xu, F. Zhuang, C. Ma, J. Zhang, and H. Xiong, "Duerquiz: A personalized question recommender system for intelligent job interview," in Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2019, pp. 2165–2173. [25] P. Restrepo, "Skill mismatch and structural unemployment," MIT Work- ing Paper, 2015. [26] A. Felstead, D. Gallie, F. Green, and Y. Zhou, Skills at Work in Britain, 1986 to 2006. ESRC Centre on Skills, Knowledge and Organisational Performance, 2007. [27] A. Felstead, D. Gallie, F. Green, and H. Inanc, "Skills at work in britain: First findings from the skills and employment survey 2012," 2013. [28] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, "Bert: Pre-training of deep bidirectional transformers for language understanding," in Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), 2019, pp. 4171–4186. [29] P. Bojanowski, E. Grave, A. Joulin, and T. Mikolov, "Enriching word vectors with subword information," Transactions of the association for computational linguistics, vol. 5, pp. 135–146, 2017. [30] A. Joulin, ́E. Grave, P. Bojanowski, and T. Mikolov, "Bag of tricks for efficient text classification," in Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, 2017, pp. 427–431. [31] T. Mikolov, K. Chen, G. Corrado, and J. Dean, "Efficient estimation of word representations in vector space," arXiv preprint arXiv:1301.3781, 2013. [32] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean, "Distributed representations of words and phrases and their composi- tionality," Advances in neural information processing systems, vol. 26, 2013. [33] M. Li, K. H. Lim, T. Guo, and J. Liu, "A transformer-based framework for poi-level social post geolocation," Proceedings of the 45th European Conference on Information Retrieval, 2023. [34] L. F. Simanjuntak, R. Mahendra, and E. Yulianti, "We know you are living in bali: Location prediction of twitter users using bert language model," Big Data and Cognitive Computing, vol. 6, no. 3, p. 77, 2022. [35] J. Arreola, L. Garcia, J. Ramos-Zavaleta, and A. Rodriguez, "An embeddings based recommendation system for mexican tourism," in IberLEF@SEPLN, 2021, pp. 110–117. [36] N. L. Ho and K. H. Lim, "Poibert: A transformer-based model for the 2022 IEEE the tour recommendation problem," Proceedings of International Conference on Big Data, 2022.
http://arxiv.org/abs/2302.09930v2
2023-07-31T21:20:16
2023-02-20T11:51:58
Nyström $M$-Hilbert-Schmidt Independence Criterion
Kernel techniques are among the most popular and powerful approaches of data science. Among the key features that make kernels ubiquitous are (i) the number of domains they have been designed for, (ii) the Hilbert structure of the function class associated to kernels facilitating their statistical analysis, and (iii) their ability to represent probability distributions without loss of information. These properties give rise to the immense success of Hilbert-Schmidt independence criterion (HSIC) which is able to capture joint independence of random variables under mild conditions, and permits closed-form estimators with quadratic computational complexity (w.r.t. the sample size). In order to alleviate the quadratic computational bottleneck in large-scale applications, multiple HSIC approximations have been proposed, however these estimators are restricted to $M=2$ random variables, do not extend naturally to the $M\ge 2$ case, and lack theoretical guarantees. In this work, we propose an alternative Nystr\"om-based HSIC estimator which handles the $M\ge 2$ case, prove its consistency, and demonstrate its applicability in multiple contexts, including synthetic examples, dependency testing of media annotations, and causal discovery.
[ "Florian Kalinke", "Zoltán Szabó" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09930v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09930v2", "@rel": "related", "@type": "application/pdf" } ]
[ "Proceedings of the Thirty-Ninth Conference on Uncertainty in\n Artificial Intelligence, PMLR 216:1005-1015, 2023" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.IT", "cs.LG", "math.IT", "46E22, 94A17", "I.2.6; H.1.1" ]
3 2 0 2 l u J 1 3 ] L M . t a t s [ 2 v 0 3 9 9 0 . 2 0 3 2 : v i X r a Nyström M -Hilbert-Schmidt Independence Criterion Florian Kalinke1 Zoltán Szabó2 1Institute for Program Structures and Data Organization, Karlsruhe Institute of Technology, Karlsruhe, Germany 2Department of Statistics, London School of Economics, London, UK Abstract the so-called kernel function. Kernel techniques are among the most popular and powerful approaches of data science. Among the key features that make kernels ubiquitous are (i) the number of domains they have been designed for, (ii) the Hilbert structure of the function class associated to kernels facilitating their statistical analysis, and (iii) their ability to represent prob- ability distributions without loss of information. These properties give rise to the immense success of Hilbert-Schmidt independence criterion (HSIC) which is able to capture joint independence of ran- dom variables under mild conditions, and permits closed-form estimators with quadratic computa- tional complexity (w.r.t. the sample size). In order to alleviate the quadratic computational bottleneck in large-scale applications, multiple HSIC approxi- mations have been proposed, however these estima- tors are restricted to M " 2 random variables, do not extend naturally to the M ě 2 case, and lack theoretical guarantees. In this work, we propose an alternative Nyström-based HSIC estimator which handles the M ě 2 case, prove its consistency, and demonstrate its applicability in multiple contexts, including synthetic examples, dependency testing of media annotations, and causal discovery. 1 INTRODUCTION Kernels methods [Aronszajn, 1950] have been on the fore- front of data science for more than 20 years [Schölkopf and Smola, 2002, Steinwart and Christmann, 2008], and they underpin some of the most powerful and principled machine learning techniques currently known. The key idea of ker- nels is to map the data into a (possibly infinite-dimensional) feature space in which one computes the inner product im- plicitly by means of a symmetric, positive definite function, Kernel functions have been designed for strings [Watkins, 1999, Lodhi et al., 2002] or more generally for sequences [Király and Oberhauser, 2019], sets [Haussler, 1999, Gärt- ner et al., 2002], rankings [Jiao and Vert, 2016], fuzzy do- mains [Guevara et al., 2017] and graphs [Borgwardt et al., 2020], which renders them broadly applicable. Their ex- tension to the space of probability measures [Berlinet and Thomas-Agnan, 2004, Smola et al., 2007] allows to rep- resent distributions in a reproducing kernel Hilbert space (RKHS) by the so-called mean embedding. Such embed- dings form the main building block of maximum mean dis- crepancy (MMD; Smola et al. [2007], Gretton et al. [2012]), which quantifies the discrepancy of two distributions as the RKHS distance of their respective mean embeddings. MMD is (i) a semi-metric on probability measures, (ii) a metric iff. the kernel is characteristic [Fukumizu et al., 2008, Sriperum- budur et al., 2010], (iii) an instance of integral probability metrics (IPM; Müller [1997], Zolotarev [1983]) when the underlying function class in the IPM is chosen to be the unit ball in an RKHS. Measuring the discrepancy of a joint distribution to the product of its marginals by MMD gives rise to the Hilbert- Schmidt independence criterion (HSIC; Gretton et al. [2005]). HSIC was shown to be equivalent [Sejdinovic et al., 2013b] to distance covariance [Székely et al., 2007, Székely and Rizzo, 2009, Lyons, 2013]; Sheng and Sriperumbudur [2023] have recently proved a similar result for the condi- tional case. HSIC is known to capture the independence of M " 2 random variables with characteristic pkmq2 m"1 ker- nels (on the respective domains) as proved by Lyons [2013]; for more than two components (M ą 2; Quadrianto et al. [2009], Sejdinovic et al. [2013a], Pfister et al. [2018]) univer- sality [Steinwart, 2001, Micchelli et al., 2006] of pkmqM m"1-s is sufficient [Szabó and Sriperumbudur, 2018]. HSIC has been deployed successfully in a wide range of domains in- cluding independence testing [Gretton et al., 2008, Pfister et al., 2018, Albert et al., 2022], feature selection [Camps- Valls et al., 2010, Song et al., 2012, Wang et al., 2022] with applications in biomarker detection [Climente-González et al., 2019] and wind power prediction [Bouche et al., 2023], clustering [Song et al., 2007, Climente-González et al., 2019], and causal discovery [Mooij et al., 2016, Pfis- ter et al., 2018, Chakraborty and Zhang, 2019, Schölkopf et al., 2021]. Various estimators for HSIC and other dependence mea- sures exist in the literature, out of which we summarize the most closely related ones to our work in Table 1. The classical V-statistic based HSIC estimator (V-HSIC; Gretton et al. [2005], Quadrianto et al. [2009], Pfister et al. [2018]) is powerful but its runtime increases quadratically with the number of samples, which limits it applicability in large- scale settings. To tackle this severe computational bottle- neck, approximations of HSIC (N-HSIC, RFF-HSIC) have been proposed [Zhang et al., 2018], relying on the Nyström [Williams and Seeger, 2001] and the random Fourier fea- ture (RFF; Rahimi and Recht [2007]) method, respectively. However, these estimators (i) are limited to two compo- nents, (ii) their extension to more than two components is not straightforward, and (iii) they lack theoretical guaran- tees. The RFF-based approach is further restricted to finite- dimensional Euclidean domains and to translation-invariant kernels. The normalized finite set independence criterion (NFSIC; Jitkrittum et al. [2017]) replaces the RKHS norm of HSIC with an L2 one which allows the construction of linear-time estimators. However, NFSIC is also limited to two components, requires Rd-valued input, and analytic kernels [Chwialkowski et al., 2015]. Novel complemen- tary approaches are the kernel partial correlation coefficient (KPCC; Huang et al. 2022), and tests basing on incomplete U-statistics [Schrab et al., 2022]. One drawback of KPCC is its cubic runtime complexity w.r.t. the sample size when applied to kernel-enriched domains. Schrab et al. [2022]'s approach can run in linear time, but it is limited to M " 2 components. We note that all approaches require choosing an appropriate kernel: Here, one can optimize over various parametric families of kernels for increasing a proxy of test power in case of MMD [Jitkrittum et al., 2016, Liu et al., 2020], and in case of HSIC [Jitkrittum et al., 2017]. One can also design (almost) minimax-optimal MMD-based two- sample tests using spectral regularization [Hagrass et al., 2022]. The restriction of existing HSIC approximations to two components is a severe limitation in recent applications like causal discovery which require independence tests capable of handling more than two components. Furthermore, the emergence of large-scale data sets necessitates algorithms that scale well in the sample size. To alleviate these bottle- necks, we make the following contributions. 1. We propose Nyström M -HSIC, an efficient HSIC estima- tor, which can handle more than two components and has ̄ , where n denotes the num- runtime ́ M n13 ` M n1n O ber of samples, n1 ! n stands for the number of Nyström points, and M is the number of random variables whose independence is measured. ` 2. We provide theoretical guarantees for Nyström M - HSIC: we prove that our estimator converges with rate n, which matches the convergence n ́1{2 for n1 „ O of the quadratic-time estimator. ? ̆ 3. We perform an extensive suite of experiments to demon- strate the efficiency of Nyström M -HSIC. These appli- cations include dependency testing of media annotations and causal discovery. In the former, we achieve similar runtime and power as existing HSIC approximations. The latter requires testing joint independence of more than two components, which is beyond the capabilities of ex- isting HSIC accelerations. Here, the proposed algorithm achieves the same performance as the quadratic-time HSIC estimator V-HSIC with a significantly reduced run- time. The paper is structured as follows. Our notations are in- troduced in Section 2. The existing Nyström-based HSIC approximation for two components is reviewed in Section 3. Our proposed method, which is capable of handling M ě 2 components, is presented in Section 4 together with its theo- retical guarantees. In Section 5 we demonstrate the applica- bility of Nyström M -HSIC. All the proofs of our results are available in the supplementary material. 2 NOTATIONS X H M m"1 ` 1 p k, μk, MMDk, bM m"1km, CX , A ́1, }A}op, trpAq, This section is dedicated to definitions and to the introduc- tion of our target quantity Hilbert-Schmidt independence criterion (HSIC). In particular, we introduce the notations rM s, xv, wy, }v}2, ̋mPrM sAm, trpAq, A ́1, A ́, AT, }A}F, 1d, Id, span, q, m"1km, Pm, HSICbM bM X pλq, OP prnq. For a positive integer M , rM s :" t1, . . . , M u. The Euclidean inner product of vectors v, w P Rd is denoted by xv, wy; :" a xv, vy. The Hadamard product of matrices Am P Rd1ˆd2 of equal size (m P rM s) is ̋mPrM sAm :" "ś . Matrix multiplication takes the Euclidean norm is }v}2 mPrM spAmqi,j N ı iPrd1s,jPrd2s ř precendence over the Hadamard one. For a matrix A P Rdˆd, trpAq :" iPrds Ai,i denotes its trace, A ́1 is its inverse (assuming that A is non-singular), and A ́ is its Moore–Penrose inverse. The transpose of a matrix A P Rd1ˆd2 is denoted by AT. The Frobenius norm of a matrix A P Rd1ˆd2 is }A}F :" iPrd1s,jPrd2spAi,jq2. The d-dimensional vector of ones is 1d. The d ˆ d-sized identity matrix is denoted by Id. For a set S in a vector , τX q space, spanpSq denotes the linear hull of S. Let p bř X Table 1: Comparison of kernel independence measures: n – number of samples, M – number of components, n1 – number of Nyström samples, s – number of random Fourier features, d – data dimensionality. Runtime Complexity M Domain Admissible Kernels Independence Measure V-HSIC [Pfister et al., 2018] NFSIC [Jitkrittum et al., 2017] N-HSIC [Zhang et al., 2018] RFF-HSIC [Zhang et al., 2018] KPCC [Huang et al., 2022] Nyström M -HSIC (N-MHSIC) ` ̆ ̄ M n2 pnq ́ n13 ` nn12 ` ̆ s2n ̆ ` n3 ́ M n13 ` M n1n O O O O O O M ě 2 any M " 2 Rd M " 2 any M " 2 Rd M " 2 any M ě 2 any ̄ universal analytic, characteristic characteristic translation-invariant, characteristic characteristic universal X X X H H X H M X , B k on " hpxq for all x P k and xh, kp ̈, xqyHk pτX q the Borel sigma-algebra be a topological space, and B induced by the topology τX . All probability measures in the manuscript are meant with respect to the measurable ` q. The pτX qq, and they are denoted by space p 1 p X Ñ R associated with a kernel k : ˆ RKHS X Ñ R such that is the Hilbert space of functions h : kp ̈, xq P and k.1 Kernels are assumed to be bounded (in other h P words, there exists B P R such that supx,x1PX kpx, x1q ď B) and measurable, and k is assumed to be separable throughout the paper.2 The function defined by φkpxq :" kp ̈, xq is the canonical feature map; with this feature map " xφkpxq, φkpx1qyHk for kpx, x1q " xkp ̈, xq, kp ̈, x1qyHk . A kernel k : Rd ˆ Rd Ñ R is called all x, x1 P translation-invariant if there exists a function κ : Rd Ñ R such that kpx, x1q " κpx ́ x1q for all x, x1 P Rd. The mean embedding μk of a probability measure P P q ş X is μk pPq :" X φkpxqdPpxq, where the integral is meant in Bochner's sense. The resulting (semi-)metric is called maximum mean discrepancy (MMD): ` 1 p M H X MMDkpP, Qq :" }μkpPq ́ μkpQq}Hk , X M ` 1 p for P, Q P q. The injectivity of the mean embedding μk is equivalent to MMDk being a metric; in this case the kernel k is called characteristic. Let X " pXmqM m"1 denote a random variable with distribution P P ` q on the 1 p X " ˆM product space m is enriched with m"1X X m Ñ R. The distribution of the m- kernel km : X th marginal Xm of X is denoted by Pm P mq; the Pm P product of these M marginals is bM q. The tensor product of the kernels pkmqM ` 1 p X ` 1 p X m, where M M X m ˆ m"1 M X m"1 ` bM m"1km pxmqM m"1, px1 mqM m"1 ̆ :" ź kmpxm, x1 mq, mPrM s with xm, x1 m P use the shorthand k " bM m (m P rM s), is also a kernel; we will m"1km. The associated RKHS X 1kp ̈, xq stands for x1 P X ÞÑ kpx1, xq P R with x P X fixed. 2The separability of Hk can be guaranteed on a separable topological space X by taking a continuous kernel k [Steinwart and Christmann, 2008, Lemma 4.33]. k " bM H m"1H km [Berlinet and has a simple structure Thomas-Agnan, 2004] with the r.h.s. denoting the tensor kmqM product of the RKHSs p km , H m"1hm P bM the multi-linear operator bM km acts as ś bM mPrM s xhm, vmyHkm m"1hmpv1, . . . , vM q " , where km . The space bM hm, vm P km is the closure of the m"1H linear combination of such bM m"1hm-s: m"1. Indeed, for hm P m"1H H H bM m"1H km " Ęspan ` bM m"1hm : hm P ̆ km, m P rM s H , where the closure is meant w.r.t. to the (linear extension of the) inner product defined as D @ bM m"1am, bM ź m"1bm bM m"1Hkm :" " xam, bmyHkm , am, bm P mPrM s km. (1) H Specifically, (1) implies that › ›bM m"1am › › bM m"1Hkm " ź mPrM s }am}Hkm . (2) One can define an independence measure, the so-called Hilbert-Schmidt independence criterion based on k as ` ̆ HSICkpPq :" MMDk where CX :" μkpPq ́ μk covariance operator. P, bM ` m"1 Pm ̆ bM m"1 Pm " }CX }Hk , (3) is the centered cross- 1 E H H H H ř k Ñ k Ñ pA ̊Aq "1 }Ah}Hk . As Let A : k be a bounded linear operator. Its in- H verse (provided that it exists) A ́1 : k is also bounded linear. The operator norm of A is defined as }A}op :" sup}h}Hk k is separable, it has a countable orthonormal basis pejqjPJ . A is called trace-class A ă 8 where p ̈q ̊ denotes the if jPJ xAej, ejyHk adjoint, and in this case trpAq :" is called the trace of A. For P P ă 8 q, kernel k : M Ñ R and λ ą 0, the uncentered covariance op- X X kp ̈, xq b kp ̈, xqdPpxq and its reg- erator is μkbkpPq :" ularized variant is μkbk,λpPq :" μkbkpPq ` λI, respec- xpλq " tively, where I denotes the identity operator. Let 2 ej, ej ` 1 p jPJ ř Hk ˆ X X ş N A φkpxq, μ ́1 . The effective dimension of E kbk,λpPqφkpxq :" Ex„P r X „ P is defined as xpλqs " ̄ kbk,λpPq tr . For a sequence of rn ą 0-s and a sequence of real-valued random variables Xn, Xn " OPprnq denotes that Xn ́ μkbkpPqμ ́1 is bounded in probability. Hk X pλq N N rn 3 EXISTING HSIC ESTIMATORS We recall the existing HSIC estimator V-HSIC in Sec- tion 3.1, and its Nyström approximation for two compo- nents in Section 3.2. We present our proposed Nyström approximation for more than two components in Section 4. 3.1 CLASSICAL HSIC ESTIMATOR (V-HSIC) Given an i.i.d. sample of M -tuples of size n 1 , . . . , xn 1, . . . , x1 x1 M , . . . , pxn ˆPn :" ␣` ̆ ( M q Ă (4) X drawn from P, the corresponding empirical estimate of the squared HSIC, obtained by replacing the population means with the sample means, gives rise to the V-statistic based estimator ́ ̄ ˆPn :" 1 n2 1T 1T nKkm 1n ́ n 0 ď HSIC2 k ź ` 1 n2M mPrM s ` ̆ ̋mPrM s Kkm 1n ` 2 nM `1 1T n ̋mPrM s Kkm1n (5) ̆ 1, x1 n 1n1T ( 1 , xn 2 q n P Rnˆn, with the centering matrix H " In ́ 1 Gram matrices Kk1 , Kk2 defined in (6), and sample ˆPn :" ␣ px1 2q, . . . , pxn as in (4) with M " 2. The naive ` computation of (7) costs . However, noticing that ř trpATBq " i,jPrns Ai,jBi,j, the computational complex- . The quadratic complexity can be ity reduces to reduced by the Nyström approximation3 [Zhang et al., 2018] n3 n2 O O ̆ ` ̆ ́ ̄ HSIC2 k,N0 ˆPn " p ̊q " ̄ ́ HKNys HKNys k2 k1 ̄ T 1 n2 tr › ́ › 1 › HφNys › k1 n2 HφNys k2 (8) › › › › 2 F , which we detail in the following. The Nyström approxima- tion relies on a subsample of size n1 ď n of ˆPn, which we denote by ̃Pn1 :" 1, ̃x1 ̃x1 ; the tilde 2 indicates a relabeling. The subsample allows to define three matrices ̃xn1 1 , ̃xn1 , . . . , ̆) !` ̆ ` 2 " ` ̆‰ m, ̃xj ̃xi Kkm,n1n1 " km m Kkm,nn " Kkm P Rnˆn, ‰ " Kkm,n1n " mq kmp ̃xi m, xj i,jPrn1s P Rn1ˆn1 , (9) iPrn1s,jPrns P Rn1ˆn, where m P r2s and Kkm is defined in (6), and let Kkm,nn1 " KT km pm P r2sq as used in (8) are . The matrices KNys km,n1n P Rnˆn1 KNys km :" Kkm,nn1 K ́1 " Kkm,nn1K ́ 1 looooooooomooooooooon km,n1n1 2 km,n1n1Kkm,n1n ` Kkm,nn1 K ́ 1 looooooooomooooooooon km,n1n1 2 ̆ T P Rnˆn, with Gram matrices " ` Kkm " km ̆‰ m, xj xi m i,jPrns P Rnˆn, (6) ":φNys km PRnˆn1 φNys km which can be computed in Opn2M q.3 This prohibitive run- time inspired the development of HSIC approximations [Zhang et al., 2018] using the Nyström method and random Fourier features. We review the Nyström-based construction in Section 3.2 and explain why the technique is restricted to M " 2 components, before presenting our alternative ap- proximation scheme of HSIC in Section 4 which is capable of handling M ě 2 components. ` ̆ provided that the inverse K ́1 km,n1n1 exists. In (8) the r.h.s. pn13 ` nn12q,4 of p ̊q has a computational complexity of n; which is smaller than this speeds up the computation. p ̊q relies on the cyclic invariance property of the trace, and the idempotence of H (in other words, HH " H), limiting the above derivation to M " 2 components; the approach does not extend naturally to the case of M ą 2. of (7), provided that n1 ă n2 ? O O 3.2 NYSTRÖM METHOD 4 PROPOSED HSIC ESTIMATOR In this section, we recall the existing Nyström approxima- tion, which can handle M " 2 components. We now elaborate the proposed Nyström HSIC approxima- tion for M ě 2 components. The expression (5) can be rewritten [Gretton et al., 2005] for M " 2 components as ̄ ́ ˆPn HSIC2 k " 1 n2 tr pHKk1HKk2 q , (7) 3HSIC2 kpˆPnq denotes the application of HSIC2 k to the empiri- cal measure ˆPn. HSIC2 k,NpˆPnq indicate depen- k,N0 pˆPnq and HSIC2 dence on ˆPn. Similarly, μlp ˆQnq stands for application, μlp ̃Qn1 q, μkm p ̃Pm,n1 q and μkp ̃Pn1 q indicate dependence on the argument. Recall that the centered cross-covariance operator takes the form ` ̆ CX " μkpPq ́ μk " μkpPq ́ bM bM Pm m"1 m"1μkm pPmq . (10) 4This follows from the complexity of Opn13q of inverting an n1 ˆ n1 matrix and the complexity of multiplying both feature representations [Zhang et al., 2018]. There are M `1 expectations in this expression; we estimate these mean embeddings separately. This conceptually sim- ple construction, is to the best of our knowledge, the first that handles M ě 2 components, and it allows to leverage recent bounds on mean estimators (Lemma 4.1). We first detail the general Nyström method for approximating expectations ş Y φlpyqdQpyq associated to a kernel l : Ñ R and Y probability distribution Q P q. One can then choose ˆ Y ` 1 p M Y , k, Pq, and m, km, Pmq, m P rM s, , l, Qq " p , l, Qq " p p Y p Y to achieve our goal. X X ! ̃y1, . . . , ̃yn1 ) ␣ y1, . . . , yn Let ̃Qn1 " be a subsample (with replace- ( i.i.d.„ Q referred to as Nyström ment) of ˆQn " points; the tilde again indicates relabeling. The usual esti- mator of the mean embedding replaces the population mean with its empirical counterpart over n samples3 ż μlpQq " φlpyqdQpyq « Y 1 n ÿ iPrns φlpyiq " μlp ˆQnq. Instead, the Nyström approximation uses a weighted sum with weights αi P R (i P rn1s): given n1 Nyström points, the estimator takes the form3 ́ ̄ μlpQq « αiφlp ̃yiq " μl ̃Qn1 P Nys l , H ÿ iPrn1s ` ` ̆ ̆ : i P rn1s :" span Nys ̃yi φl where l H l qT P Rn1 l , . . . , αn1 ficients αl " pα1 minimum norm solution of Ă l. The coef- are obtained by the H › › › › μl › › min αlPRn1 ́ ̄ ˆQn ́ ÿ ̆ ` ̃yi αiφl iPrn1s › › 2 › › › › Hl . (12) The following lemma describes the solution of (12). Lemma 4.1 (Nyström mean embedding, Chatalic et al. [2022]). For a kernel l with corresponding feature map φl, an i.i.d. sample ˆQn of distribution Q, and a subsample ̃Qn1 of ˆQn, the Nyström estimate of μlpQq is given by ÿ ̄ ́ ̃Qn1 μl " ` ̆ ̃yi , αi lφl iPrn1s 1 n αl " pKl,n1n1q ́ Kl,n1n1n, (13) be ␣` a x1 1, . . . , x1 M and subsample ̆ (with replacement) of M q defined 1 , . . . , xn ( , . . . , pxn ̃Pm,n1 " ! m, . . . , ̃xn1 ̃x1 m ) ˆPn in " (4), (15) be the corresponding subsample of the m-th marginal (m P rM s). Using our choice (11) with Lemma 4.1, the estimators for the embeddings of marginal distributions take the form3 (11) ̄ ́ ̃Pm,n1 " μkm ÿ αi km φkm ` ̆ , ̃xi m iPrn1s 1 n pKkm,n1n1 q ́ Kkm,n1n1n, αkm " (16) and the estimator of the mean embedding of the joint distri- bution is3 ̄ ́ ̃Pn1 " μk ÿ k bM αi m"1 φkm ` ̆ , ̃xi m iPrn1s 1 n pKk,n1n1q ́ pKk,n1nq 1n αk " p ̊q " 1 n hkkkkkkkkkkkkikkkkkkkkkkkkj pcq ́ ̄ ̋mPrM s Kkm,n1n1 looooooooomooooooooon ́ paq ̄ ́ ˆ ̋mPrM s Kkm,n1n loooooooomoooooooon 1n, (17) pbq where p ̊q holds as for the Gram matrix Kk,n1n1 associated with the product kernel k " bmPrM skm one has ̄ı Kk,n1n1 " ́ pxi " k » 1, . . . , xi M q, pxj 1, . . . , xj fi M q i,jPrn1s ź – " mPrM s kmpxi m, xj mq fl " ̋mPrM s Kkm,n1n1, i,jPrn1s and similarly Kk,n1n " ̋mPrM s Kkm,n1n, with Kkm,n1n1 and Kkm,n1n defined in (9). Combining the M ` 1 Nyström estimators in (16) and in (17) gives rise to the overall Nyström HSIC estimator, which is elaborated in the following lemma. Lemma 4.2 (Computation of Nyström M -HSIC). The Nys- tröm estimator for HSIC can be expressed as3 ` ̄ ̆ " αT k ̋mPrM s Kkm,n1n1 ` αk (18) ̆ αT km Kkm,n1n1αkm ́ 2αT k ̋mPrM s Kkm,n1n1αkm , ́ ˆPn HSIC2 ź k,N with Gram matrix Kl,n1n1 " " and Kl,n1n " lp ̃xi, xjq ‰ " ‰ lp ̃xi, ̃xjq iPrn1s,jPrns P Rn1ˆn. i,jPrn1s P Rn1ˆn1 , ` mPrM s Let ! ́ ̄ ́ ̄) ̃Pn1 " 1, . . . , ̃x1 ̃x1 M , . . . , 1 , . . . , ̃xn1 ̃xn1 M (14) with αkm and αk defined in (16) and (17), respectively, Kkm,n1n1 is defined in (9), and N in the subscript of the estimator refers to Nyström. Note that (18) depends on ˆPn as one must solve (12). Remark 1. • Uniform weights, no subsampling. The estimator (18) n 1n for all m P rM s, gives back (5) when αk :" αkm :" 1 and when there is no subsampling applied. ̄ O • Runtime complexity. In order to determine the compu- tational complexity of (18) one has to find that of (17); that of (16) follows by choosing M " 1 in (17). paq and pbq in (17) are Hadamard products; hence their com- ́ M n12 pM nn1q. pcq putational complexity is in (17) is the Moore-Penrose inverse of an n1 ˆ n1 ma- ̄ ́ n13 . Hence, the compu- trix; thus its complexity is ̆ M n12 ` n13 ` M n1n n12 ` n13 ` n1n tation of αk costs of pαkm qM rM s. In (18) each term can be computed in . Overall the Nyström M -HSIC estimator has complexity ̆ , and that for each m P ̄ ́ M n12 ̆ M n13 ` M n1n M n12 ` M n13 ` M n1n m"1 is and ` O O O O O ` ̆ ` ` . " O O • Difference compared to the estimator by Zhang et al. [2018]. For M " 2, (18) reduces to ̄ ́ ˆPn ` " αT k ̋iPr2sKki,n1n1 ` ̆ αk (19) ̆ αT ki Kki,n1n1αki ́ 2αT k ̋iPr2sKki,n1n1αki . HSIC2 ź k,N ` iPr2s Using the equivalence of (5) and (7) in case M " 2 gives tr pHKk1HKk2 q " ź ` 1 n4 iPr2s 1 n2 1T 2 n3 1T n pKk1 ̋ Kk2 q 1n 1T nKki 1n ́ n pKk11n ̋ Kk21nq , hence (8) becomes ̄ ́ ́ ˆPn " n 1 n2 1T 1n ́ nKNys 1T ki 2 n3 1T n k1 ̋ KNys k2 KNys ́ ̄ 1n (20) ̄ KNys k1 1n ̋ KNys k2 1n . HSIC2 k,N0 ź ` 1 n4 iPr2s The estimators (19) and (20) are identical if αk " αkm " 1 n 1n for all m P rM s and when there is no subsampling; in the general case they do not coincide. In (8) the domi- nant term in the complexity is pn1q2 n (since n1 ă n), this reduces to n1n in our proposed estimator (18). Key to showing the consistency of the proposed Nyström M -HSIC estimator (18) (Proposition 4.1) is our next lemma, which describes how the Nyström approximation error of the mean embeddings of the components (dkm below) can be propagated through tensor products. Lemma 4.3 (Error propagation on tensor products). Let X " pXmqM m ˆ m Ñ R bounded kernels (Dakm P p0, 8q such that kmpxm, xmq ď akm , m P rM s), k " X supxmPXm m, km : " ˆM m"1 P m"1X a X X bM m"1km, ` 1 p k the RKHS associated to k, X „ P P q, Pm the m-th marginal of P (m P rM s), n1 ď n, H X M and ̃Pm,n1 defined according to (15). Then ́ ̃Pm,n1 ź m"1μkm pPmq ́ bM › › ›bM m"1μkm ź ̄› › › Hk ď ď pakm ` dkm q ́ akm , where dkm " mPrM s › › ›μkm pPmq ́ μkm ́ ̃Pm,n1 mPrM s ̄› › › Hkm . Our resulting Nyström M -HSIC performance guarantee is as follows. X M ` 1 p m ˆ m"1 P " ˆM m, X „ P P Proposition 4.1 (Error bound for Nyström M -HSIC). Let X " pXmqM q, m"1X X X mqmPrM s locally compact, second-countable topological p X m Ñ R bounded kernels, i.e., Dakm P spaces, km : a X p0, 8q such that supxmPXm kmpxm, xmq ď akm for all M m"1 akm , φkmpxmq " m P rM s, k " bmPrM skm, ak " kmp ̈, xmq for all xm P m"1φkm, Ck " E rφkpXq b φkpXqs, Ckm " E rφkm pXmq b φkm pXmqs, the number of Nyström points n1 ď n, ˆPn defined according to (4). Then, for any δ P ˇ ˇ ˇHSICkpPq ́ HSICk,N 1 M `1 ̄ˇ ˇ ˇ ď m, φk " bM ˆPn ś 0, ` ` X ́ ́ ̄ ck,1? nloomoon tk,1 ck,2 n1loomoon tk,2 ̇ 12a2 k logpn1{δq d ˆ a ck,3 logpn1{δq n1 X loooooooooooooooooooooooooomoooooooooooooooooooooooooon n1 N ` ̧ ff tk,3 ckm,1? nloomoon ` « ź akm ` mPrM s a ckm,3 tkm,1 g f f e logpn1{δq n1 ` ckm,2 n1loomoon tkm,2 ̃ Xm looooooooooooooooooooooooooooomooooooooooooooooooooooooooooon n1 N 12a2 km logpn1{δq ` ` ` ́ tkm,3 ź mPrM s akm holds with probability at least 1 ́ pM ` 1qδ, provided that n1 ě max mPrM s ́ 67, 12a2 k }Ck} ́1 op , 12a2 km }Ckm } ́1 op ̄ log n1 δ , a ? a where ck,1 " 2ak ck,3 " 12 ? ckm,2 " 4 for m P rM s. 2 logp6{δq, ck,2 " 4 a 3 logp12{δqak, ckm,1 " 2akm 3akm logp12{δq, ckm,3 " 12 a 3ak logp12{δq, 2 logp6{δq, 3 logp12{δqakm As a baseline, to interpret the result (see the second bullet point in Remark 2), one could consider the V-statistic based HSIC estimator (5) for M ě 2, which according to our following lemma has a convergence rate of ̄ . ́ 1? n OP Lemma 4.4 (Deviation bound for V-statistic based HSIC estimator). Let HSICkpˆPnq be as in (5) on a metric space m, and HSICk pPq ą 0. Then ˆ ̇ X " ˆM m"1X ˇ ˇ ˇHSICk pPq ́ HSICk ̄ˇ ˇ ˇ " ́ ˆPn . 1 ? n OP Remark 2. ? ? • From the terms tk,1, tk,2, tkm,1, tkm,2, m P rM s it follows that for n1 ă n the respective second term dominates, thus increasing the error; for n1 ą n the respective first term dominates and the computational complexity increases. The effective dimension ptk,3, tkm,3q controls the trade off between the two terms and can be related [Chatalic et al., 2022] to the decay of the eigenvalues of the respective covariance operator. A convergence rate of n ́1{2 for the sums tk,1 ` tk,2 ` tk,3 and tkm,1 ` tkm,2 ` tkm,3 can be achieved if – maxmPrM s p X pλq, Xm pλqq ď cλ ́γ for some c ą 0 and γ P p0, 1s with n1 " n1{p2 ́γq logpn{δq, or N N – maxmPrM s p Xm pλqq ď logp1 ` c{λq{β some c ą 0, β ą 0, and n1 " X pλq, N ˆ N ́ ̄ ̇ for ? n log ? n max mPrM s 1 δ , c 6a2 k , c 6a2 km . This rate of convergence propagates through the product. ̆ n2{3 • Lemma 4.4 establishes that the V-statistic based estimator of HSIC converges with rate n ́1{2. Recalling the last line ` of Table 1, setting n1 " o , the proposed estima- tor yields an asymptotic speedup over V-HSIC. Hence, setting n1 " ̃ nq allows to obtain the same rate O of convergence while decreasing runtime. Assumption HSICk pPq ą 0 in Lemma 4.4 protects one from attaining a convergence rate of n ́1 of HSIC2 k ́ ˆPn ̄ . ? p 5 EXPERIMENTS In this section, we demonstrate the efficiency of the pro- posed method (N-MHSIC) against the baselines NFSIC, RFF-HSIC, N-HSIC and the quadratic-time V-statistic based HSIC estimator (V-HSIC) in the context of independence testing. Hence, the null hypothesis H0 is that the joint distri- bution factorizes to the product of the marginals, the alter- native H1 is that this is not the case. The experiments study both synthetic (Section 5.1) and real-world (Section 5.2) examples, in terms of power and runtime.5 We use the Gaussian kernel ́ kmpxm, x1 mq " exp ́γkm ̄ › ›xm ́ x1 m › ›2 2 5The code of our experiments is available at https:// github.com/FlopsKa/nystroem-mhsic. Figure 1: Estimation accuracy for M " 2 components; the theoretical HSIC value is zero. for all experiments, with γkm chosen according to the me- dian heuristic. For a fair comparison of the test power, we approximate the null distribution of each test statistic by the permutation approach with 250 samples. We then perform a one-sided test with an acceptance region of 5% (α " 0.05), which we repeat, for all power experiments, on 100 inde- pendent draws of the data; the runtime results include these. We set each algorithm's parameters as recommended by the respective authors: For NFSIC, we set the number of test lo- cations J " 5; the number of Fourier features (RFF-HSIC) n. The num- and Nyström samples (N-HSIC) is set to ber of Nyström samples of N-MHSIC is indicated within the experiment description. The opaque area in the figures indicates the 0.95-quantile obtained over 5 runs. All experi- ments were performed on a PC with Ubuntu 20.04, 124GB RAM, and 32 cores with 2GHz each. ? 5.1 SYNTHETIC DATA We examine three toy problems in the following, illustrating runtime and statistical power. N i.i.d.„ Comparison of HSIC approximations under H0. First, for M " 2 components, we compare our proposed method to the existing accelerated HSIC estimators (N-HSIC, RFF- HSIC) on independent data to assess convergence w.r.t. run- time. Specifically, we set X1, X2 p0, 1q. The theoreti- cal value of HSIC is thus zero. Figure 1 shows the estimates for sample sizes from 100 to 1000; the number of Nyström samples for N-MHSIC is set to n1 " 2 n. All approaches converge to zero, with N-MHSIC converging a bit slower than the exisiting HSIC approximations. However, we note that the gap is on the order of 10 ́3 so it is close to the theo- retical value also for small sample sizes. The runtime scales as predicted by the complexity analysis, with the proposed approach running faster than both N-HSIC and RFF-HSIC starting from n " 500 samples. ? Dependent Data (H1 holds). To evaluate the statistical power on M " 2 components, we set X1 „ p0, 1q, X2 " p0, 1q, with n1 set as before. Figure 2 X1 ` ε, and ε „ shows that N-MHSIC achieves a power of one for n « N N 20040060080010000.0000.0050.010Estimate20040060080010000.000.010.020.030.04Runtime(s)Numberofsamples(n)N-MHSICN-HSICRFF-HSIC Figure 2: Power on dependent data. Runtime on log scale. Figure 3: Ratio of correctly identified DAGs with 4 nodes. 100 and that it is slightly worse than the existing HSIC approximations for small sample sizes. V-HSIC has the highest power but also the highest runtime. Even though NFSIC has linear runtime complexity it is slower than all other statistics on small sample sizes. Causal Discovery. The experiments until now considered M " 2 components. However, N-MHSIC allows for han- dling M ě 2 components and thus can estimate the directed acyclic graph (DAG) governing causality if one assumes an additive noise model. Specifically, we sample from the structural equations Xi " ř jPPAi f i,j pXjq ` εi for i P rM s, of a randomly selected fully connected DAG with four nodes (M " 4), of which there are 24. In the equation, PAi denotes the parents of i in the associated DAG, and the εi are normally distributed and jointly independent, with a variance sampled independently from the uniform distribution ̆ 2 ? 1, ` . U To now test whether a particular DAG fits the data, Pfister et al. [2018] propose to use generalized additive model regression to find the residuals when regressing each node onto all its parents and to reject the DAG if the residuals are not jointly independent. If these are independent, we accept the causal structure. In this application, one is only interested in the relative p-values when performing the procedure for all possible DAGs with the correct number of nodes. V-HSIC has the best performance in [Pfister et al., 2018], so we only compare against V-HSIC; it is also the only other approach which allows testing joint independence of more than two components. Figure 3 shows how often N-MHSIC and V-HSIC identify the correct DAG in 100 samples. V- HSIC has higher power than N-MHSIC and more often identifies the correct DAG for small sample sizes. However, as the r.h.s. of Figure 3 shows, the proposed algorithm runs even for n1 " 8 n and n " 1500 twice as fast as V- HSIC while producing the same result quality. Due to their different runtime complexities, the gap in runtime widens further with increasing sample size. ? 5.2 REAL-WORLD DATA This section is dedicated to benchmarks on real-world data. Figure 4: Test power vs. runtime on the Million Song Data. Million Song Data. The Million Song Data [Bertin- Mahieux et al., 2011] contains approximately 500,000 songs. Each has 90 features (X) together with its year of release, which ranges from 1922 to 2011 (Y ). The algorithms must detect the dependence between the features and the year of release. To approximate the power, we draw 100 inde- pendent samples of the whole data set. Figure 4 shows the results, for level α " 0.01; the different ranges of n high- light the asymptotic runtime gains. In contrast to a similar experiment of Jitkrittum et al. [2017], we use a permutation approach for all two-sample tests and increase the number of Nyström samples (random Fourier features) as a function of n, obtaining higher power throughout. The problem is sufficiently challenging, so that we set the number of Nys- tröm samples to 8 n for N-MHSIC. V-HSIC and NFSIC achieve maximum power from n " 500. N-MHSIC features similar runtime and power as the existing HSIC approxi- mations N-HSIC and RFF-HSIC but can handle more than two components. The runtime plot illustrates that the lower asymptotic complexity of N-MHSIC compared to V-HSIC also holds in practice. ? Weather Causal Discovery. Here, we aim to infer the correct causality DAG from real-world data, namely the data set of Mooij et al. [2016] which contains 349 measurements consisting of altitude, temperature and sunshine. The goal is to infer the most plausible DAG with three nodes pd " 3q out of the 25 possible DAGs (33 ́2 " 25; two graphs have a cycle). We assume the structural equations discussed before. Figure 5 shows the p-values with the estimated DAG (with index 25) having the largest p-value. Again, we compare our results to V-HSIC and find that both successfully identify the most plausible DAG [Pfister et al., 2018]. 02004000.000.250.500.751.00Power020040010−1100101102Runtime(s)Numberofsamples(n)N-MHSICNFSICN-HSICRFF-HSICV-HSIC5007501000125015000.20.40.60.81.0RatioofcorrectDAGs5007501000125015000100020003000Runtime(s)Numberofsamples(n)1√n2√n4√n8√nV-HSIC05001000150020000.000.250.500.751.00Power02000400060008000100101102103Runtime(s)Numberofsamples(n)N-MHSICNFSICN-HSICRFF-HSICV-HSIC Figure 5: Testing for joint independence on the residuals of DAGs with three nodes (left) and the DAG with the largest p-value (right). The p-values agree on DAGs 1 to 24. These experiments demonstrate the efficiency of the pro- posed Nyström M -HSIC method. 510152025DAG10−2p-valueN-MHSICV-HSICAltitudeSunshineTemperature A APPENDIX Section A.1 contains two external theorems and lemmas that we use. Section A.2 is about our proofs. A.1 EXTERNAL THEOREMS AND LEMMAS In this section two theorems and lemmas are recalled for self-completeness, Theorem A.1 is about bounding the error of Nyström mean embeddings [Chatalic et al., 2022, Theorem 4.1], Theorem A.2 is a well-known result [Serfling, 1980, Section 5.6, Theorem A] for bounding the deviation of U-statistics. Lemma A.1 is about connection between U- and V-statistics. Lemma A.2 recalls Markov's inequality. Theorem A.1 (Bound on mean embeddings). Let be a locally compact second-countable topological space, X a random Ñ R, with Borel probability measure P, and let variable supported on X X kpx, xq ď K. Let Ck " and feature map φk. Assume that there exists a constant K P p0, 8q such that supxPX E rφkpXq b φkpXqs. Furthermore, assume that the data points ˆPn " tx1, . . . , xnu are drawn i.i.d. from the distribution P and that n1 ď n subsamples ̃Pn1 " t ̃x1, . . . , ̃xn1u are drawn uniformly with replacement from the dataset ˆPn. Then for any δ P p0, 1q it holds that k be a RKHS on with kernel k : a H ˆ X X X › › ›μk pPq ́ μk ́ ̃Pn1 ̄› › › Hk ď c1? n ` c2 n1 ` a c3 logpn1{δq d ˆ n1 X N 12K 2 logpn1{δq n1 ̇ , with probability at least 1 ́ δ provided that n1 ě max ́ 67, 12K 2 }Ck} ́1 op ̄ log ˆ ̇ , n1 δ a where c1 " 2K 2 logp6{δq, c2 " 4 ? 3K logp12{δq, and c3 " 12 3 logp12{δqK. a Recall that a U-statistic is the average of a (symmetric) core function h " hpx1, . . . , xmq over the observations X1, . . . , Xn „ P (n ě m) with form ` n m Un " U pX1, . . . , Xmq " ̆ 1` n m ÿ c ̆ hpXi1, . . . , Ximq, (21) combinations of m distinct elements ti1, . . . , imu from t1, . . . , nu. Un is an unbiased estimator where c is the set of the of θ " θpPq " EPrhpX1, . . . , Xmqs. Theorem A.2 (Hoeffding's inequality for U-statistics). Let h " hpx1, . . . , xmq be a core function for θ " θpPq " EP rhpX1, . . . , Xmqs with a ď hpx1, . . . , xmq ď b. Then, for any u ą 0 and n ě m, ˆ PpUn ́ θ ě uq ď exp ́ ̇ . 2nu2 mpb ́ aq2 Similar to (21) one can consider an alternative (slightly biased) estimator of θ, which is called V-statistic: Vn " V pX1, . . . , Xmq " 1 nm ÿ pi1,...,imqPTmpnq hpXi1 , . . . , Xim q, (22) where Tmpnq is the m-fold Cartesian product of the set rns. There is a close relation between U- and V-statistics, as it is made explicit by the following lemma [Serfling, 1980, Lemma, Section 5.7.3]. i.i.d.„ Lemma A.1 (Connection between U- and V-statistics). Let P be a probability measure on a metric space P. Let m denote any element of rns. Let h be a core function satisfying E r|hpX1, . . . , Xmq|rs ă 8 with some r P Z`. Let Un and Vn denote the U and V-statistic associated to h as defined in (21) and (22), respectively. Then it holds that . Let pXiqiPrns X E r|Un ́ Vn|rs " O ` ̆ n ́r . Lemma A.2 (Markov inequality). For a real-valued random variable X with probability distribution P and a ą 0, it holds that A.2 PROOFS P p|X| ě aq ď E p|X|q a . This section is dedicated to proofs. Lemma 4.2 is derived in Section A.2.1. Proposition 4.1 is proved in Section A.2.3 relying on two lemmas shown in Section A.2.2. Lemma 4.4 is proved in Section A.2.5, with an auxiliary result in Section A.2.4. A.2.1 Proof of Lemma 4.2 ̄ ́ ̃Pn1 " Let μk ř HSIC2 k,N n1 i"1 αi ̄ ́ ˆPn ̄ " k bM m"1 φkm pxi › ́ › ̃Pn1 ›μk ̄› › ́ › › 2 ̃Pn1 › ›μk looooooomooooooon Hk " mq, and let μkm ́ bM m"1μkm A ́ ̄ ̃Pm,n1 ̄› › 2 › Hk ́ ̃Pm,n1 ́ ̄ ̃Pn1 ́2 ̈ μk m"1μkm loooooooooooooooooooooomoooooooooooooooooooooon Hk , bM ̄E ́ ̃Pm,n1 ́ ̄› › › › 2 ›bM › loooooooooooooomoooooooooooooon Hk m"1μkm ̃Pm,n1 , ` ř " n1 i"1 αi km φkm pxi mq for m P rM s. We write ":A ":C ":B and continue term-by-term. Using the definition of the tensor product, we have for term A that n1ÿ ̄E n1ÿ n1ÿ A ̄ ́ " Hk i"1 j"1 @ bM kαj αi k m"1φkmpxi mq, bM m"1φkm pxj D mq " Hk Mź n1ÿ kαj αi k kmpxi m, xj mq i"1 j"1 m"1 A " μk , μk ̃Pn1 ́ ̃Pn1 ` " αT k ̋M m"1 Kkm ̆ αk. Similarly, we obtain for term B that A B " bM m"1μkm C ́ ̄ ̃Pm,n1 ̄E ́ ̃Pm,n1 , bM m"1μkm ́ ̄ " bM m"1 αipmq km φkm xipmq m , bM m"1 n1ÿ ipmq"1 Mź n1ÿ n1ÿ p ̊q " m"1 ipmq"1 jpmq"1 ́ km αjpmq αipmq km km xipmq m , xjpmq m " Hk n1ÿ jpmq"1 ̄ G ̄ ́ xjpmq m αjpmq km φkm Hk Mź m"1 αT km Kkmαkm, where in p ̊q we used (1), the linearity of the inner product, and the reproducing property. Last, we express term C as C " C n1ÿ i"1 ̆ ̆ ` xi m ` xi m , bM m"1 , bM m"1 n1ÿ jpmq"1 n1ÿ jpmq"1 k bM αi m"1 φkm C αi k bM m"1φkm C ź ` ̆ , xi m φkm n1ÿ αjpmq km φkm αjpmq km φkm αjpmq km φkm ́ xjpmq m ́ xjpmq m G ̄ Hk G ̄ Hk G ̄ ́ xjpmq m mPrM s jpmq"1 ź n1ÿ A φkm ̆ ` xi m αjpmq km ́ ̄E , φkm xjpmq m Hk Hk mPrM s ź jpmq"1 n1ÿ ́ m, xjpmq xi loooooooooooooooomoooooooooooooooon jpmq"1 αjpmq km km ̄ m pKkm qiαkm i"1 mPrM s ` " αT k ̋M m"1 Kkmαkm ̆ , n1ÿ i"1 n1ÿ i"1 n1ÿ i"1 n1ÿ paq " pbq " pcq " pdq " αi k αi k αi k where (a) follows from the linearity of the inner product, (b) holds by (1), (c) is implied by the linearity of the inner product, (d) is valid by the reproducing property, and we refer to the i-th row of Kkm as pKkmqi. Substituting terms A, B, and C concludes the proof. A.2.2 Two Lemmas to the Proof of Proposition 4.1 Our main result relies on two lemmas. ` 1 p q, and p m"1 P mqmPrM s locally compact, second-countable topological spaces. Let km : Lemma A.3 (Error bound for Nyström mean embedding of tensor product kernel). Let X " pXmqM X „ P P be a bounded kernel, i.e. there exists akm P p0, 8q such that supxmPXm k the RKHS associated to k, φk " bM ak " H and ̃Pn1 defined according to (14). Then for any δ P p0, 1q it holds that m, m"1X m Ñ R X kmpxm, xmq ď akm for m P rM s. Let m"1φkm, Ck " E rφkpXq b φkpXqs, n1 ď n, m"1 akm, k " bM X m ˆ X m"1km, " ˆM M a ś X X M › › ›μk pPq ́ μk ́ ̃Pn1 ̄› › › Hk ď ck,1? n ` ck,2 n1 ` a ck,3 logpn1{δq n1 d ˆ X N 12a2 k logpn1{δq n1 ̇ , with probability at least 1 ́ δ, provided that ́ n1 ě max 67, 12a2 k }Ck} ́1 op ˆ ̇ , n1 δ ̄ log a where ck,1 " 2ak 2 logp6{δq, ck,2 " 4 3ak logp12{δq, and ck,3 " 12 3 logp12{δqak. a ? Proof. With Theorem 16.2(c), Theorem 18.6], statement is implied by Theorem A.1. " ˆmPrM sX m, noticing that k " bM H X X m"1H is locally compact second-countable iff. p kpx, xq " m"1φkm, and km , φk " bM a ś X a mqmPrM s are so [Willard, 1970, M kmpxm, xmq ď ak, the m"1 Proof of Lemma 4.3. To simplify notation, let μkm " μkm pPmq, ̃μkm " μkm ̄ ́ ̃Pm,n1 , }μkm ́ ̃μkm}Hkm satisfied, and we assume that the statement holds for M " M ́ 1, to obtain . The proof proceeds by induction on M : For M " 1 the l.h.s. = r.h.s. = k " bM m"1H › H › ›μk1 pP1q ́ μk1 km , and dkm " ́ ̃P1,n1 ̄› › › Hk is m"1 μkm b ̃μkM ́ bM m"1 ̃μkm › › Hk › › bM m"1 ̃μkm › › Hk › › " " m"1μkm ́ bM › › bM ́1 › ›bM ́1 ̈ paq ď m"1 μkm b pμkM ́ ̃μkM q ` › › m"1 μkm b pμkM ́ ̃μkM q Hk ̨ bM ` m"1 μkm ́ bM ́1 bM ́1 m"1 μkm ́ bM ́1 › ` › m"1 μkm b ̃μkM ` bM ́1 › › m"1 ̃μkm Hk b ̃μkM ̆ ̆ m"1 ̃μkm b ̃μkM › › Hk ` bM ́1 m"1 μkm ́ bM ́1 › › m"1 μkm ́ bM ́1 m"1 ̃μkm › › bM ́1 }μkm}Hkm ‚dkM ` ź ̋ pbq " mPrM ́1s ź pcq ď dkM pdq ď dkM mPrM ́1s ź mPrM ́1s ź › › bM ́1 m"1 μkm ́ bM ́1 m"1 ̃μkm › › bM ́1 m"1 Hkm ź bM ́1 m"1 Hkm } ̃μkM }HkM pakM ` dkM q , . - pakM ` dkM q ź pakm ` dkmq ́ akm mPrM ́1s ź akm ` akm ` $ & ź % ź mPrM ́1s " dkM akm ` pakm ` dkm q ́ akm ́ dkM akm mPrM ́1s ź mPrM s ź " pakm ` dkm q ́ akm , mPrM s mPrM s mPrM s mPrM ́1s where (a) holds by the triangle inequality, (b) is implied by (2) and the definition of dkM , (c) follows from }μkm}Hkm " › ż › › › Xm kmp ̈, xmqdPmpxmq › › › › Hkm ż peq ď Xm }kmp ̈, xmq}Hkm loooooooomoooooooon ? kmpxm,xmq pgq ď akm pf q " dPmpxmq ď akm, (23) } ̃μkM }HkM " } ̃μkM ́ μkM ` μkM }HkM phq ď } ̃μkM ́ μkM }HkM ` }μkM }HkM piq ď dkM ` akM , (d) is valid by the induction statement holding for M ́ 1, (e) is a property of Bochner integrals, (f) is implied by the reproducing property, (g) comes from the definition of akm , the triangle inequality implies (h), (i) follows from (23) and the definition of dkM . A.2.3 Proof of Proposition 4.1 m"1km, and let k " bM mqmPrM s are so [Willard, 1970, Theorem 16.2(c), Theorem 18.6]. Let k " bM p X We decompose the error of the Nyström approximation as km . We note that m"1H H X " ˆmPrM sX m is locally compact second-countable as ˇ ˇ ˇHSICkpPq ́ HSICk,N ́ ˆPn ̄ˇ ˇ ˇ " ˇ ˇ ˇ ˇ › › m"1μkmpPmq Hk › ›μkpPq ́ bM › › ›μkpPq ́ bM m"1μkm pPmq ́ μk ̄› › ́ › › ̃Pn1 ›μkpPq ́ μk › looooooooooooomooooooooooooon Hk ` paq ď pbq ď › › ›μk ́ ́ ̄ ̃Pn1 ́ ̄ ́ bM m"1μkm ́ ̃Pn1 ` bM m"1μkm ˇ ˇ ˇ ˇ ̄› › › Hk ́ ̃Pm,n1 ̄› › › Hk ̃Pm,n1 ́ ̃Pm,n1 ̄› › › › ›bM › loooooooooooooooooooooooooomoooooooooooooooooooooooooon Hk m"1μkmpPmq ́ bM m"1μkm , t1 t2 where (a) holds by the reverse triangle inequality, and (b) follows from the triangle inequality. First term (t1): One can bound the error of the first term by Lemma A.3; in other words, for any δ P p0, 1q with probability at least p1 ́ δq it holds that › › ›μkpPq ́ μk ́ ̃Pn1 ̄› › › Hk ď ck,1? n ́ ck,3 ck,2 n1 ` ̄ ́ ` ̄ a logpn1{δq n1 ̃ g f f e N Xm ̧ 12a2 km logpn1{δq n1 a provided that n1 ě max a ? 4 3ak logp12{δq, ck,3 " 12 67, 12a2 k }Ck} ́1 op log n1 δ 3 logp12{δqak. , with the constants ck,1 " 2ak 2 logp6{δq, ck,2 " Second term (t2): Applying Lemma 4.3 to the second term gives › › ›bM m"1μkm pPmq ́ bM m"1μkm ́ ̃Pm,n1 ̄› › › Hk ď ˆ ź mPrM s › › ›μkm pPmq ́ μkm ́ ̃Pm,n1 akm ` ̇ ̄› › › Hkm ́ ź mPrM s akm. We now bound the error of each of the M factors by Theorem A.1, i.e., for fixed m P rM s; particularly we get that for any δ P p0, 1q with probability at least 1 ́ δ › › ›μkm pPmq ́ μkm ́ ̃Pm,n1 › › ›μkm pPmq ́ μkm ́ ̃Pm,n1 akm ` ̄› › › Hkm ̄› › › Hkm ď ckm,1? n ` ckm,2 n1 ` ckm,3 logpn1{δq n1 a g f f e N ̃ Xm ď akm ` ckm,1? n ` ckm,2 n1 ` ckm,3 logpn1{δq n1 a ̧ , hence 12a2 km logpn1{δq n1 ̃ g f f e Xm N 12a2 km logpn1{δq n1 ̧ , and by union bound that their product is for any δ P p0, 1 „ ź › › ›μkm pPmq ́ μkm ́ akm ` ̃Pm,n1 ȷ M q with probability at least 1 ́ M δ ̄› › › Hkm ď mPrM s « ź ď akm ` mPrM s a ckm,1? n ` ckm,2 n1 ` ckm,3 logpn1{δq n1 g f f e ̃ 12a2 km logpn1{δq n1 Xm N ̧ff , „ ź mPrM s › › ›μkm pPmq ́ μkm ́ ̃Pm,n1 akm ` « ź ď akm ` mPrM s ́ ckm,1? n ` ckm,2 n1 ` ̄ ȷ ̄› › › Hkm ́ ź mPrM s a ckm,3 logpn1{δq n1 ̄ ́ n1 δ akm ď g f f e Xm N ̃ 12a2 km logpn1{δq n1 ̧ff ź ́ akm , mPrM s provided that n1 ě max constants ckm,1 " 2akm a 67, 12a2 km }Ckm} ́1 2 logp6{δq, ckm,2 " 4 op log ? for all m P rM s, with Ckm " E rφkm pXmq b φkm pXmqs and a 3akm logp12{δq, ckm,3 " 12 3 logp12{δqakm, with m P rM s. Combining the M ` 1 terms by union bound yields the stated result. A.2.4 Lemma to the Proof of Lemma 4.4 Lemma A.4 (Deviation bound for U-statistics based HSIC estimator). It holds that ̇ ˆ ˇ ˇ ˇHSIC2 k,u ̄ ́ ˆPn ́ HSIC2 ˇ ˇ k pPq ˇ " 1 ? n , OP where HSIC2 k,u is the U-statistic based estimator of HSIC2 k. Proof. We show that (3) can be expressed as a sum of U-statistics and then bound the terms individually. First, square (3) to obtain » fi » fi HSIC2 kpPq " E px1,...,xM q,px1 1,...,x1 M q„P ź – ` km xm, x1 m ̆ fl ` Ex1,x1 1„P1,...,xM ,x1 M „PM ź – ` km xm, x1 m ̆ fl loooooooooooooooooooooooooooooomoooooooooooooooooooooooooooooon mPrM s loooooooooooooooooooooooooooooomoooooooooooooooooooooooooooooon mPrM s A » fi B ́ 2 E px1,...,xM q„P,x1 , M „PM looooooooooooooooooooooooooooooooomooooooooooooooooooooooooooooooooon 1„P1,...,x1 mPrM s mq kmpxm, x1 fl ź – C where A, B, and C can be estimated by U-statistics A1 and split t as αt ` βt ` p1 ́ α ́ βqt, with α, β ą 0 and α ` β ă 1. One obtains n, and C 1 n, B1 n, respectively. Let HSIC2 k,u ́ˇ ˇ ˇHSIC2 P kpPq ́ HSIC2 k,u ́ ˆPn ̄ˇ ˇ ˇ ě t ̄ `ˇ ˇA ́ A1 n ˇ ̆ ˇ ě αt ` P `ˇ ˇB ́ B1 n ˇ ̆ ˇ ě βt ` ` P 2 ˇ ˇC ́ C 1 n ˇ ̆ ˇ ě p1 ́ α ́ βqt . ď P ̄ ́ ˆPn " A1 n ` B1 n ́ 2C 1 n, Doubling and rewriting Theorem A.2, we have that for U-statistics and any δ P p0, 1q ̈ ̨ d P ̋|Un ́ θ| ě mpb ́ aq2 lnp 2 δ q 2n ‚ď δ. ́ ̄ Now, choosing the pθ, Un, uq triplet to be pA, A1 n, βtq, observing that a ď kpx, yq ď b as k is bounded, we obtain that |A1 in probability and so is their sum. n, αtq, pB, B1 n, p1 ́α ́βqt C, C 1 2 ? n, |B1 n ́ B| n ́ A| , respectively, setting m " 2M , and ? n are bounded n, and |C 1 n ́ C| ? A.2.5 Proof of Lemma 4.4 We consider the decomposition ˇ ˇ ˇHSIC2 k ́ ˆPn ̄ ́ HSIC2 ˇ ˇ k pPq ˇ ď ̄ ̄ˇ ˇ ˇ ˇ ˇHSIC2 ˇ k looooooooooooooooooomooooooooooooooooooon ́ HSIC2 ́ ˆPn ˆPn k,u ́ ˇ ˇ ˇ ˇ ˇHSIC2 k pPq ˇ , loooooooooooooooooomoooooooooooooooooon ́ HSIC2 ́ ˆPn k,u ̄ ` t1 t2 by using the triangle inequality, where HSICk,u is the U-statistic based HSIC estimator. ́ ̄ Second term (t2): Lemma A.4 establishes that t2 " 1? n . OP First term (t1): To bound t1, first, by Markov's inequality (Lemma A.2) observe that ́ˇ ˇ ˇHSIC2 k ́ ˆPn ̄ P ́ HSIC2 k,u ́ ˆPn ̄ˇ ̄ ˇ ˇ ě a ď ́ˇ ˇ ˇHSIC2 k ̄ ́ ˆPn E ́ HSIC2 k,u , looooooooooooooooooooooomooooooooooooooooooooooon a ":ε ̈ ̋ P ̈ ̋ P ˇ ˇ ˇHSIC2 k ˇ ˇ ˇHSIC2 k ́ ̄ ́ ˆPn ́ HSIC2 k,u ˆPn ́ ̄ ́ ˆPn ́ HSIC2 k,u ˆPn ̄ˇ ˇ ˇ ě ̄ˇ ˇ ˇ ă ̄ ̨ ́ˇ ˇ ˇHSIC2 k ́ ˆPn ̄ E ́ HSIC2 k,u ε ́ˇ ˇ ˇHSIC2 k ́ ˆPn ̄ E ́ HSIC2 k,u ́ ˆPn ̄ˇ ˇ ˇ ́ ˆPn ̄ˇ ˇ ˇ ‚ď ε, ̄ ̨ ‚ě 1 ́ ε, (24) ́ ̄ ̄ˇ ˇ ˇ ˆPn ˆˇ ˇ ˇHSIC2 k ˆˇ ˇ ˇHSIC2 k P P ́ ́ ε ́ HSIC2 k,u ˆPn ̄ ̄ ˆPn ́ HSIC2 k,u ́ ˆPn ́ ˆPn ̄ˇ ˇ ˇ ă ̄ˇ ˇ ˇ ě ̇ ̇ C nε C nε p ̊q ě 1 ́ ε, ď ε, (25) for constant C ą 0 and n large enough, where p ̊q follows from Lemma A.1 (with r " 1). (25) implies that ˇ ˇ ˇHSIC2 k ́ ̄ ˆPn ́ HSIC2 k,u ́ ˆPn ̄ˇ ˇ ˇ " ˆ ̇ . 1 n OP Combining the terms (t1 ` t2): Combining the obtained results for the two terms, one gets that ̄ ̄ ̄ ́ ́ ˇ ˇ ˇHSIC2 k ́ ˆPn ́ HSIC2 k pPq ˇ ˇ ˇ (24) ď ˇ ˇ ˇHSIC2 k ̇ ˆ " OP 1 n ˆPn ` OP ́ HSIC2 ̇ ˆ k,u ̄ˇ ˇ ˇ ` ˇ ˇ ˇHSIC2 ̇ ˆPn ˆ k,u ́ ˆPn ́ HSIC2 k pPq ˇ ˇ ˇ 1 ? n " OP 1 ? n . (26) Hence ˆ ̇ 1 ? n OP ˇ ˇ ˇHSIC2 k (26) ě ́ ̄ ˆPn ́ HSIC2 ˇ ˇ k pPq ˇ " ˇ ˇ ˇHSICk ́ ˆPn ̄ ́ HSICk pPq ˇ ˇ ˇ ̄ ˇ ́ ˇ ˆPn ˇ HSICk loooooomoooooon ` HSICk pPq loooomoooon ˇ ˇ ˇ ˇ ˇ ˇHSICk ́ ˆPn ̄ ě ́ HSICk pPq ˇ ˇ ˇ HSICk pPq , which by dividing with the constant HSICk pPq ą 0 implies the statement. Acknowledgements (5) ě0 ě0 This work was supported by the German Research Foundation (DFG) Research Training Group GRK 2153: Energy Status Data - Informatics Methods for its Collection, Analysis and Exploitation. The major part of this work was carried out while Florian Kalinke was a research associate at the Department of Statistics, London School of Economics. References Mélisande Albert, Béatrice Laurent, Amandine Marrel, and Anouar Meynaoui. Adaptive test of independence based on HSIC measures. The Annals of Statistics, 50(2):858–879, 2022. Nachman Aronszajn. Theory of reproducing kernels. Transactions of the American Mathematical Society, 68:337–404, 1950. Alain Berlinet and Christine Thomas-Agnan. Reproducing Kernel Hilbert Spaces in Probability and Statistics. Kluwer, 2004. Thierry Bertin-Mahieux, Daniel P. W. Ellis, Brian Whitman, and Paul Lamere. The million song dataset. In International Society for Music Information Retrieval Conference (ISMIR), pages 591–596, 2011. Karsten Borgwardt, Elisabetta Ghisu, Felipe Llinares-López, Leslie O'Bray, and Bastian Riec. Graph kernels: State-of-the-art and future challenges. Foundations and Trends in Machine Learning, 13(5-6):531–712, 2020. Dimitri Bouche, Rémi Flamary, Florence d'Alché Buc, Riwal Plougonven, Marianne Clausel, Jordi Badosa, and Philippe Drobinski. Wind power predictions from nowcasts to 4-hour forecasts: a learning approach with variable selection. Renewable Energy, 2023. Gustavo Camps-Valls, Joris M. Mooij, and Bernhard Schölkopf. Remote sensing feature selection by kernel dependence measures. IEEE Geoscience and Remote Sensing Letters, 7(3):587–591, 2010. Shubhadeep Chakraborty and Xianyang Zhang. Distance metrics for measuring joint dependence with application to causal inference. Journal of the American Statistical Association, 114(528):1638–1650, 2019. Antoine Chatalic, Nicolas Schreuder, Alessandro Rudi, and Lorenzo Rosasco. Nyström kernel mean embeddings. In International Conference on Machine Learning (ICML), pages 3006–3024, 2022. Kacper Chwialkowski, Aaditya Ramdas, Dino Sejdinovic, and Arthur Gretton. Fast two-sample testing with analytic representations of probability measures. In Advances in Neural Information Processing Systems (NIPS), pages 1972–1980, 2015. Héctor Climente-González, Chloé-Agathe Azencott, Samuel Kaski, and Makoto Yamada. Block HSIC Lasso: model-free biomarker detection for ultra-high dimensional data. Bioinformatics, 35(14):i427–i435, 2019. Kenji Fukumizu, Arthur Gretton, Xiaohai Sun, and Bernhard Schölkopf. Kernel measures of conditional dependence. In Advances in Neural Information Processing Systems (NIPS), pages 498–496, 2008. Thomas Gärtner, Peter Flach, Adam Kowalczyk, and Alexander Smola. Multi-instance kernels. In International Conference on Machine Learning (ICML), pages 179–186, 2002. Arthur Gretton, Olivier Bousquet, Alex Smola, and Bernhard Schölkopf. Measuring statistical dependence with Hilbert- Schmidt norms. In Algorithmic Learning Theory (ALT), pages 63–78, 2005. Arthur Gretton, Kenji Fukumizu, Choon Hui Teo, Le Song, Bernhard Schölkopf, and Alexander Smola. A kernel statistical test of independence. In Advances in Neural Information Processing Systems (NIPS), pages 585–592, 2008. Arthur Gretton, Karsten Borgwardt, Malte Rasch, Bernhard Schölkopf, and Alexander Smola. A kernel two-sample test. Journal of Machine Learning Research, pages 723–773, 2012. Jorge Guevara, Roberto Hirata, and Stéphane Canu. Cross product kernels for fuzzy set similarity. In International Conference on Fuzzy Systems (FUZZ-IEEE), pages 1–6, 2017. Omar Hagrass, Bharath K Sriperumbudur, and Bing Li. Spectral regularized kernel two-sample tests. Technical report, 2022. (https://arxiv.org/abs/2212.09201). David Haussler. Convolution kernels on discrete structures. Technical report, University of California at Santa Cruz, 1999. (http://cbse.soe.ucsc.edu/sites/default/files/convolutions.pdf). Zhen Huang, Nabarun Deb, and Bodhisattva Sen. Kernel partial correlation coefficient – a measure of conditional dependence. Journal of Machine Learning Research, 23(216):1–58, 2022. Yunlong Jiao and Jean-Philippe Vert. The Kendall and Mallows kernels for permutations. In International Conference on Machine Learning (ICML), pages 2982–2990, 2016. Wittawat Jitkrittum, Zoltán Szabó, Kacper Chwialkowski, and Arthur Gretton. Interpretable distribution features with maximum testing power. In Advances in Neural Information Processing Systems (NIPS), pages 181–189, 2016. Wittawat Jitkrittum, Zoltán Szabó, and Arthur Gretton. An adaptive test of independence with analytic kernel embeddings. In International Conference on Machine Learning (ICML), pages 1742–1751, 2017. Franz J. Király and Harald Oberhauser. Kernels for sequentially ordered data. Journal of Machine Learning Research, 20: 1–45, 2019. Feng Liu, Wenkai Xu, Jie Liu, Guangquan Zhang, Arthur Gretton, and Danica J. Sutherland. Learning deep kernels for non-parametric two-sample tests. In International Conference on Machine Learning (ICML), pages 6316–6326, 2020. Huma Lodhi, Craig Saunders, John Shawe-Taylor, Nello Cristianini, and Chris Watkins. Text classification using string kernels. Journal of Machine Learning Research, 2:419–444, 2002. Russell Lyons. Distance covariance in metric spaces. The Annals of Probability, 41:3284–3305, 2013. Charles Micchelli, Yuesheng Xu, and Haizhang Zhang. Universal kernels. Journal of Machine Learning Research, 7: 2651–2667, 2006. Joris Mooij, Jonas Peters, Dominik Janzing, Jakob Zscheischler, and Bernhard Schölkopf. Distinguishing cause from effect using observational data: Methods and benchmarks. Journal of Machine Learning Research, 17:1–102, 2016. Alfred Müller. Integral probability metrics and their generating classes of functions. Advances in Applied Probability, 29: 429–443, 1997. Niklas Pfister, Peter Bühlmann, Bernhard Schölkopf, and Jonas Peters. Kernel-based tests for joint independence. Journal of the Royal Statistical Society: Series B (Statistical Methodology), pages 5–31, 2018. Novi Quadrianto, Le Song, and Alex Smola. Kernelized sorting. In Advances in Neural Information Processing Systems (NIPS), pages 1289–1296, 2009. Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in Neural Information Processing Systems (NIPS), pages 1177–1184, 2007. Bernhard Schölkopf and Alexander Smola. Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond. MIT Press, 2002. Bernhard Schölkopf, Francesco Locatello, Stefan Bauer, Nan Rosemary Ke, Nal Kalchbrenner, Anirudh Goyal, and Yoshua Bengio. Toward causal representation learning. Proceedings of the IEEE, 109(5):612–634, 2021. Antonin Schrab, Ilmun Kim, Benjamin Guedj, and Arthur Gretton. Efficient aggregated kernel tests using incomplete U-statistics. In Advances in Neural Information Processing Systems (NIPS), pages 18793–18807, 2022. Dino Sejdinovic, Arthur Gretton, and Wicher Bergsma. A kernel test for three-variable interactions. In Advances in Neural Information Processing Systems (NIPS), pages 1124–1132, 2013a. Dino Sejdinovic, Bharath Sriperumbudur, Arthur Gretton, and Kenji Fukumizu. Equivalence of distance-based and RKHS-based statistics in hypothesis testing. Annals of Statistics, 41:2263–2291, 2013b. Robert J. Serfling. Approximation theorems of mathematical statistics. John Wiley & Sons, 1980. Tianhong Sheng and Bharath K. Sriperumbudur. On distance and kernel measures of conditional independence. Journal of Machine Learning Research, 24(7):1–16, 2023. Alexander Smola, Arthur Gretton, Le Song, and Bernhard Schölkopf. A Hilbert space embedding for distributions. In Algorithmic Learning Theory (ALT), pages 13–31, 2007. Le Song, Alexander J. Smola, Arthur Gretton, and Karsten M. Borgwardt. A dependence maximization view of clustering. In International Conference on Machine Learning (ICML), pages 815--822, 2007. Le Song, Alex Smola, Arthur Gretton, Justin Bedo, and Karsten Borgwardt. Feature selection via dependence maximization. Journal of Machine Learning Research, 13(1):1393–1434, 2012. Bharath Sriperumbudur, Arthur Gretton, Kenji Fukumizu, Bernhard Schölkopf, and Gert Lanckriet. Hilbert space embeddings and metrics on probability measures. Journal of Machine Learning Research, 11:1517–1561, 2010. Ingo Steinwart. On the influence of the kernel on the consistency of support vector machines. Journal of Machine Learning Research, 2:67–93, 2001. Ingo Steinwart and Andreas Christmann. Support Vector Machines. Springer, 2008. Zoltán Szabó and Bharath K. Sriperumbudur. Characteristic and universal tensor product kernels. Journal of Machine Learning Research, 18(233):1–29, 2018. Gábor J. Székely and Maria L. Rizzo. Brownian distance covariance. The Annals of Applied Statistics, 3:1236–1265, 2009. Gábor J. Székely, Maria L. Rizzo, and Nail K. Bakirov. Measuring and testing dependence by correlation of distances. The Annals of Statistics, 35:2769–2794, 2007. Andi Wang, Juan Du, Xi Zhang, and Jianjun Shi. Ranking features to promote diversity: An approach based on sparse distance correlation. Technometrics, 64(3):384–395, 2022. Chris Watkins. Dynamic alignment kernels. In Advances in Neural Information Processing Systems (NIPS), pages 39–50, 1999. Stephen Willard. General Topology. Addison-Wesley, 1970. Christopher Williams and Matthias Seeger. Using the Nyström method to speed up kernel machines. In Advances in Neural Information Processing Systems (NIPS), pages 682–688, 2001. Qinyi Zhang, Sarah Filippi, Arthur Gretton, and Dino Sejdinovic. Large-scale kernel methods for independence testing. Statistics and Computing, 28(1):1–18, 2018. V. Zolotarev. Probability metrics. Theory of Probability and its Applications, 28:278–302, 1983.
http://arxiv.org/abs/2302.09923v1
2023-02-20T11:37:28
2023-02-20T11:37:28
Prompt Stealing Attacks Against Text-to-Image Generation Models
Text-to-Image generation models have revolutionized the artwork design process and enabled anyone to create high-quality images by entering text descriptions called prompts. Creating a high-quality prompt that consists of a subject and several modifiers can be time-consuming and costly. In consequence, a trend of trading high-quality prompts on specialized marketplaces has emerged. In this paper, we propose a novel attack, namely prompt stealing attack, which aims to steal prompts from generated images by text-to-image generation models. Successful prompt stealing attacks direct violate the intellectual property and privacy of prompt engineers and also jeopardize the business model of prompt trading marketplaces. We first perform a large-scale analysis on a dataset collected by ourselves and show that a successful prompt stealing attack should consider a prompt's subject as well as its modifiers. We then propose the first learning-based prompt stealing attack, PromptStealer, and demonstrate its superiority over two baseline methods quantitatively and qualitatively. We also make some initial attempts to defend PromptStealer. In general, our study uncovers a new attack surface in the ecosystem created by the popular text-to-image generation models. We hope our results can help to mitigate the threat. To facilitate research in this field, we will share our dataset and code with the community.
[ "Xinyue Shen", "Yiting Qu", "Michael Backes", "Yang Zhang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09923v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09923v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CR", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CR", "cs.LG" ]
Prompt Stealing Attacks Against Text-to-Image Generation Models Xinyue Shen1 Yiting Qu1 Michael Backes1 Yang Zhang1 1CISPA Helmholtz Center for Information Security 3 2 0 2 b e F 0 2 ] R C . s c [ 1 v 3 2 9 9 0 . 2 0 3 2 : v i X r a Abstract Text-to-Image generation models have revolutionized the art- work design process and enabled anyone to create high- quality images by entering text descriptions called prompts. Creating a high-quality prompt that consists of a subject and several modifiers can be time-consuming and costly. In con- sequence, a trend of trading high-quality prompts on special- ized marketplaces has emerged. In this paper, we propose a novel attack, namely prompt stealing attack, which aims to steal prompts from generated images by text-to-image gen- eration models. Successful prompt stealing attacks direct vi- olate the intellectual property and privacy of prompt engi- neers and also jeopardize the business model of prompt trad- ing marketplaces. We first perform a large-scale analysis on a dataset collected by ourselves and show that a successful prompt stealing attack should consider a prompt's subject as well as its modifiers. We then propose the first learning- based prompt stealing attack, PromptStealer, and demon- strate its superiority over two baseline methods quantitatively and qualitatively. We also make some initial attempts to de- In general, our study uncovers a new fend PromptStealer. attack surface in the ecosystem created by the popular text- to-image generation models. We hope our results can help to mitigate the threat. To facilitate research in this field, we will share our dataset and code with the community. 1 Introduction With the advent of Stable Diffusion [40], DALL*E 2 [38], and Midjourney [1], text-to-image generation models have revolutionized the artwork design process and sparked a surge of artwork creation in mainstream media. Rather than relying on professional artists, text-to-image generation models empower anyone to produce digital images, such as photorealistic images and commercial drawings, by entering text descriptions called prompts. According to [18, 27, 33], a high-quality prompt that leads to a high-quality image should consist of a subject and several prompt modifiers. The subject is a natural language description of the image; the prompt modifiers are keywords or key phrases that are related to spe- cific elements or styles of the image. Figure 1 shows an ex- ample of a typical prompt and the resulting generated image. In this example, "cozy enchanted treehouse in ancient forest" is the subject and the rest phrases, e.g., "diffuse lighting," "fantasy," "intricate," "elegant," etc., are prompt modifiers. Figure 1: An image generated by Stable Diffusion [40]. The cor- responding prompt is "cozy enchanted treehouse in ancient for- est, diffuse lighting, fantasy, intricate, elegant, highly detailed, lifelike, photorealistic, digital painting, artstation, illustration, concept art, smooth, sharp focus, art by John Collier and Albert Aublet and Krenz Cushart and Artem Demura and Alphonse Mucha." Although it seems that text-to-image generation models make artwork design much easier, the process of creating high-quality prompts is not simple but challenging and it- erative. To create a desired and stable prompt, users need to constantly search for prompt modifiers and check the cor- responding resulting images. As the impact of each prompt modifier has not been fully understood, this process can be time-consuming and costly. As a result, a new job type, namely prompt engineer, has emerged for people who spe- cialize in producing high-quality prompts. Also, high-quality prompts become new and valuable commodities and are traded in specialized marketplaces, such as PromptBase [2], PromptSea [3], and Visualise AI [4]. The business model of these marketplaces is straightforward: customers browse sample images generated by text-to-image generation mod- els. If they like a sample image, they can purchase the cor- responding prompt. Then, customers can freely generate similar images or modify the prompt's subject to generate other images in a similar style. Prompt trading marketplaces are gaining popularity. For instance, till November 2022, PromptBase has achieved 10K registered users and is con- 1 tinuing to grow.1 In such a context, a natural research question has emerged: given an image generated by a text-to-image generation model, whether an adversary is able to infer its correspond- ing prompt? We name this novel attack as prompt stealing attack. A successful prompt stealing attack can directly vi- olate the intellectual property and privacy of prompt engi- neers. Moreover, it jeopardizes the business model of prompt trading marketplaces. So far, few tools in the open-source community can be tai- lored for stealing prompts [5, 24, 30]. One approach is to ap- ply an image captioning model to a generated image and treat the predicted caption as the image's prompt [24, 30]. How- ever, as the important prompt modifiers are missing in the caption, this approach cannot achieve satisfying results (see Section 4 for more details). Other methods are optimization- based. Take the open-source tool CLIP Interrogator [5] as an example. Given an image, it iteratively calculates the simi- larity between the combinations of modifiers and the image. Once the growth of the similarity saturates, it regards the current combination as the predicted prompt. However, this method has low efficiency due to its design; it also involves many manually defined hyperparameters, which might hin- der its generalizability in the real world. All these open- source tools have made attempts. However, it is still unclear whether and to what extent an adversary can effectively steal prompts from generated images. In this paper, we aim to fill the gap. Our Contributions. We present the first study on prompt stealing attacks against images generated by text-to-image generation models. In particular, we focus on Stable Diffu- sion [40], arguably the most popular and advanced model in this field. We start by collecting a large-scale dataset from Lex- ica [6], a well-known image gallery with 5M+ prompts and generated images from Stable Diffusion. Overall, we col- lect 250,000 pairs of prompts and images. After preprocess- ing and de-duplication on prompts, we are left with 61,467 prompt-image pairs (see Section 3.1). We name the dataset as Lexica-Dataset. Our quantitative and qualitative analysis on Lexica-Dataset shows that both a prompt's subject and its modifiers are important factors for the generated image's quality (see Section 3.2). This suggests a successful prompt stealing attack should consider both subjects and modifiers. We then classify modifiers into different categories to pro- vide a fine-grained analysis. We find that the artist modifiers play an essential role in generated images' outlook. Based on the findings above, we propose the first learning- based prompt stealing attack, PromptStealer. PromptStealer consists of two key components: an image captioning model and a multi-label classifier. Given a target image, the im- age captioning model generates its caption as the final stolen prompt's subject. The multi-label classifier is used to predict the prompt modifiers of the stolen prompt. After applying the image captioning model and the multi-label classifier to the target image, we concatenate the caption/subject and the prompt modifiers together to obtain the final stolen prompt. Experimental results on Lexica-Dataset show that Prompt- Stealer outperforms the two baseline methods across seman- tic, modifier, and image similarities. For instance, Prompt- Stealer achieves 0.66, 0.43, and 0.79 in these metrics, respec- tively, while the corresponding results for the better baseline CLIP Interrogator [5] are 0.52, 0.01, and 0.77. Another ad- vantage of PromptStealer lies in its efficiency. For instance, PromptStealer takes 0.01 seconds to steal one prompt on an NVIDIA DGX-A100 server. To compare, CLIP Interrogator needs 7.89 seconds under the same setting. We also qualita- tively evaluate PromptStealer and find that the images gener- ated by stolen prompts are similar to the target images. More- over, we show that the performance of PromptStealer can be further boosted by involving the adversary in the loop. We then make the first attempt to mitigate prompt steal- ing attacks by proposing PromptShield. This method adds an optimized noise to an image relying on the technique of adversarial examples such that the adversary cannot infer the image's prompt appropriately. Based on the findings from Section 3, the perturbation targets the most important cate- gory of prompt modifiers, i.e., artist. Experimental results show that PromptShield works well (see Section 5); how- ever, it requires strong assumptions for the defender, and its performance is reduced by the adaptive attack. Implications. Our work, for the first time, reveals the threat of prompt stealing in the ecosystem created by the popular text-to-image generation models. We believe our results can provide guidance to the stakeholders to mitigate the risks. Moreover, we hope to raise awareness of academia to work on the safety and security issues of advanced text-to-image generation models. We will share our dataset and code with the research community to facilitate the research in this field. 2 Background 2.1 Text-to-Image Generation Models Text-to-Image generation models aim to generate high- quality digital images with natural language descriptions, namely prompts. With the advancement of diffusion mod- els, text-to-image generation achieves a giant leap and has gained significant attention in recent months [38,40,42]. Im- ages generated by these models can be used in various ar- eas, such as art and fashion industry. In addition to diffusion models, there are several other approaches to construct text- to-image generation models [9, 15] relying on GANs [16]. These approaches differ in terms of their model architectures and techniques, but all aim at capturing the relationship be- tween text and visual content. In this work, we focus on Stable Diffusion as it is the state-of-the-art and arguably the most popular text-to-image generation model. Besides, compared to other models like DALL*E 2 and Midjounry, Stable Diffusion is open-source and the community that promotes the usage of Stable Dif- fusion is very active. For instance, since the release of Sta- ble Diffusion in March 2022, more than 110K people have joined the Reddit community to share and discuss images generated by Stable Diffusion.2 1https://daily.tinyprojects.dev/185. 2https://www.reddit.com/r/StableDiffusion/. 2 (a) (b) Figure 2: Two examples from Lexica-Dataset, and the corresponding generated images without artist modifiers and without any modifiers. The yellow highlight represents the artist modifiers. For the latter two cases, we generate four images with different random seeds to eliminate the potential biases. 2.2 The Marketplace of Text-to-Image Gener- ation Models With the development of text-to-image generation models, a new ecosystem has emerged. To generate a high-quality image, one usually needs to constantly search for prompt modifiers and check the corresponding resulting images. As the impact of each prompt modifier is not clear, this pro- cess can be time-consuming and costly. One example is the logo of OctoSQL, an open-source CLI project for querying databases. The designers use DALL*E 2 to create the logo and spend around $30 interacting with the paid API.3 As a re- sult, prompts engineers, people who specialize in producing high-quality prompts, start to sell their prompts in specialized marketplaces, such as PromptBase [2], PromptSea [3], and Visualise AI [4]. In these marketplaces, a customer explores sample images generated by different prompts. If they like a certain image, they can purchase the corresponding prompt through the marketplace. On PromptBase, each prompt's cost lies in the range between $1.99 and $9.99. After getting the prompt, the customer can freely generate similar images or modify the prompt's subject to generate other images in a similar style. Prompt trading marketplaces are gaining pop- ularity. By November 2022, PromptBase has more than 10K users registered, and the number is still increasing. 3 Data Analysis on Lexica-Dataset In this section, we first elaborate on the data collection pro- cess for Lexica-Dataset, then undertake a detailed analysis of the dataset. 3.1 Data Collection To the best of our knowledge, no large-scale prompt-image datasets are available by the time we perform this study. To assess prompt stealing attacks, we collect a dataset by our- selves via Lexica [6]. There are two reasons for us to choose Lexica. First, Lexica is a well-known image gallery of Sta- 3https://jacobmartins.com/posts/how-i-used-dalle2-to-gene rate-the-logo-for-octosql/. ble Diffusion; it contains 5M+ prompt-image pairs extracted from Stable Diffusion's discord server.4 Lexica covers the art creations of many Stable Diffusion's active users, such as artists and prompt engineers. This allows us to better simu- late the real-world attack scenario. Second, Lexica provides a query API5 that given a specific prompt, returns the 50 most similar prompts and the corresponding images. Note that similar prompts are likely from the same user during their prompt engineering process. Therefore, the data from Lexica can closely reflect people's real-world usage of Stable Diffu- sion. As Lexica only provides a query API and does not release its public dataset, we regard an open-source prompt dataset on Hugging Face6 as a starting point for our data collection. This dataset contains 80K prompts crawled from Lexica, which are used to train a prompt generator. As this dataset does not contain any images and other metadata, e.g., the im- age download link, we cannot directly use it. To address this, we randomly sample 5,000 prompts from the dataset, then query these prompts to Lexica's query API. As mentioned above, the API returns 50 results for each query, including images, prompts, grid, etc. In the end, we crawl 250,000 prompts and the corresponding generated images. We filter out the prompts and images that could not be parsed cor- rectly. Also, images belonging to the grid type (each of those images contains several generated images stitched together) are neglected as well. Finally, after the de-duplication of prompts, we get 61,467 prompt-image pairs. We name the dataset as Lexica-Dataset. As mentioned before, each prompt consists of a subject and several prompt modifiers. Thus, we further decompose prompts in Lexica-Dataset into subjects and prompt modi- fiers. Concretely, we split each prompt by commas. The first part is regarded as the subject according to [27, 33], while the rest are treated as prompt modifiers. We standardize the format of some modifiers, e.g., "8 k" to "8k," "3 d" to "3d." 4https://discord.com/invite/stablediffusion. 5https://lexica.art/docs. 6https://huggingface.co/datasets/Gustavosta/Stable-Diffusio n-Prompts. 3 ImagesgeneratedbypromptwithoutmodifiersLexica-DatasetimageImagesgeneratedbypromptwithoutartistsa treasure chest, black and white, fantasy art, object art, in the style of masami kurumada,illustration, epic, fantasy, intricate, hyper detailed, artstation, concept art, smooth, sharp focus, ray tracingLexica-DatasetpromptLexica-DatasetimagefullbodyportraitofabeautifulKurdishbridewearingabeautifulweddingdress,verydetailedeyes,hyperrealistic,beautifulandsymmetricalface,verydetailedpaintingby Claude Monet and Alphonse Mucha,ornate,trendingonartstation,extremelyhighdetail,incrediblyintricate,claude monetLexica-DatasetpromptImagesgeneratedbypromptwithoutmodifiersImagesgeneratedbypromptwithoutartists (a) Subject/prompt length distribution. (b) Modifier count distribution. (c) Modifier appearance distribution. Figure 3: General statistics of prompts in Lexica-Dataset. We also remove the style-evocation words, including "in the style of," "inspired by," "art by," "in style of," and "trend- ing on," etc. In the end, we obtain 77,616 prompt modifiers. Figure 2 depicts some samples from the dataset. To facilitate research in this field, we will release Lexica-Dataset as well as our code to academia. 3.2 Data Analysis Next, we perform some data analysis on Lexica-Dataset. Subjects and Prompt Modifiers. Figure 3a depicts the length distribution of subjects and prompts in Lexica- Dataset. On average, the length of a subject is 55.97 char- acters, while the length of a prompt is 236.86 characters. This means a subject takes only 23.63% of a prompt, and the rest is assembled with prompt modifiers. Figure 3b fur- ther depicts the distribution of modifier count per prompt. On average, each prompt contains 10.52 modifiers. This might suggest prompt modifiers play an essential role in the image generation process. To further investigate this, Figure 2 also shows some generated images without prompt modifiers. As we can see, modifiers indeed largely influence image quality in terms of style and details. Take the treasure chest as an example (see Figure 2a), if the modifiers are not considered, Stable Diffusion generates a plain treasure chest. Meanwhile, by considering various modifiers, the original image depicts a more stylized treasure chest with many fine-grained details. These results imply that a successful prompt stealing attack should not only consider the target prompt's subject but also put efforts into recovering the modifiers. In other words, us- ing an image captioning model to get the caption (subject) of a target image is insufficient for prompt stealing. Experiment results in Section 4 further confirm this. On the other hand, we emphasize that the subject also plays an essential role in a prompt as it describes the main content of the image. For the modifiers, we further show the distribution of their appearance times in Figure 3c. We can observe a long-tail distribution. Specifically, Lexica-Dataset contains 61,467 prompts and 77,616 modifiers. Among them, only 7,672 (9.88%) modifiers are used more than ten times and 1,109 (1.43%) modifiers are used more than 100 times. From the adversary's perspective, this long-tail distribution eases the requirements for prompt stealing attacks, as a relatively small modifier set can already cover most modifiers used in prompts (see Section 4). Modifiers in Category-Level. We further attribute prompt modifiers into different categories. The open-source tool CLIP Interrogator [5] defines five categories for modifiers, i.e., trending, artist, medium, movement, and flavor, and of- fers a relatively complete modifier list for each category. In our analysis, we adopt the same set of categories and assign all modifiers in Lexica-Dataset to them. Concretely, a mod- ifier in Lexica-Dataset is considered as part of a category if it belongs to the corresponding modifier list from CLIP In- terrogator. Table 1 shows the top 10 prompt modifiers with respect to their appearance times in each category of Lexica- Dataset. We find that users are less likely to use movement modifiers. The highest one is "fantasy art" with appearance times being only 1,567. This is probably because the us- age of movement modifiers requires background knowledge of art. Conversely, the top three modifiers in the flavor cat- egory are all well-known image quality boosters [33], such as "highly detailed," "8k," and "sharp focus." On average, 14.32%, 6.11%, 3.25%, 0.98%, and 75.33% of the modifiers in a prompt belong to the artist, trending, medium, move- ment, and flavor categories, respectively. Excluding the cat- egory flavor which contains various kinds of modifiers, the artist category occupies the largest proportion of prompts compared to the rest. This reveals that users are more likely to use artist modifiers to lead the generated images to cer- tain visual styles. Figure 2 further shows some examples of generated images without artist modifiers. In Figure 2b, the artist modifiers "Claude Monet" and "Alphonse Mucha" in- deed heavily influence the final outlook and fine-grained de- tails of the original image, compared to the images without any artist modifiers. A similar observation can be made in the example depicted in Figure 2a. Next, we investigate the semantic relations among mod- ifiers of different categories. Diffusion-based text-to-image generation models like Stable Diffusion rely on CLIP [37] to obtain text embeddings of prompts. We thereby utilize CLIP's text encoder to obtain modifiers' embeddings and vi- sualize them via a T-SNE [48] plot (see Figure 4). For each category, we consider the top 20 modifiers with respect to their appearance times. We find that the modifiers in the artist category are tightly grouped and distant from others. Mean- while, the rest four categories are relatively mixed. The artist category being different from the others again shows the im- portance of the artist modifiers in the image generation pro- cess. Meanwhile, it is expected that other categories are close to each other. For instance, movement modifiers are often ac- companied by medium modifiers. This has also been uncov- ered in a previous qualitative study [27] and recommended 4 05001,0001,500Length Distribution01,0002,000FrequencyPromptSubject0255075Modifier Count Per Prompt02,5005,0007,500Frequency70,00075,00080,000020,00040,000Modifier Appearance Times050100Count Table 1: Top 10 prompt modifiers and their appearance times for each category. No. Trending # Artist # Medium # Movement # Flavor 11,552 7,273 6,237 concept art digital art vector art 24,095 7,483 127 1,567 fantasy art art nouveau 1,132 hyperrealism 1,041 highly detailed 8k sharp focus # 26,818 22,987 22,774 1 2 3 4 5 6 7 8 9 artstation cgsociety deviantart 46,357 3,822 2,309 greg rutkowski artgerm artgerm and rutkowski alphonse mucha greg and pixiv 1,018 wlop pinterest 646 ilya kuvshinov behance instagram zbrush central cg society 321 127 57 52 alphonse mucha rossdraws craig mullins james jean 10 polycount 51 rhads 5,989 3,918 3,716 2,802 2,341 2,133 1,976 an ultrafine de- tailed painting detailed a matte painting poster art an oil painting pixel art a painting a character por- trait detailed 83 photorealism 924 digital painting 18,211 63 street art 447 intricate 58 51 42 40 surrealism romanticism art deco realism 388 384 377 292 illustration octane render smooth elegant 39 rococo 290 4k 18,002 17,473 14,394 13,906 13,081 10,325 Figure 4: T-SNE visualization of modifier embeddings with re- spect to different categories. by DALL*E 2 prompt book [7]. Takeaways. To summarize, we have established the first prompt-image dataset Lexica-Dataset. Our data analysis reveals that besides its subject, a prompt's modifiers also play an essential role in determining its generated image's outlook. This suggests a successful prompt stealing attack should consider both the subject and modifiers of a prompt. Moreover, we attribute prompt modifiers into five different categories and discover that the artist modifiers heavily in- fluence generated images' styles and details. 4 Prompt Stealing Attack Based on the findings in Section 3, we propose the first learning-based prompt stealing attack PromptStealer. In this section, we start by introducing the threat model, then present the attack methodology. In the end, we show the experimen- tal results. 4.1 Threat Model Scenario. Our attack is designed for the scenario shown in Figure 5. First, a prompt engineer or an artist performs an it- erative exploring process to find an ideal prompt that can lead to a high-quality generated image on a text-to-image gener- ation model. We refer to this prompt as the target prompt. Then, the prompt engineer can sell the prompt via market- 5 Figure 5: The scenario of prompt trading and prompt stealing. places like PromptBase [2]. To do so, the engineer provides an example image generated by the target prompt to the mar- ketplace. We refer to this example image as the target image. If a regular user is interested in the style of the target image, the user can get the target prompt by trading with the prompt engineer through the marketplace. After getting the target prompt, one of the usage scenarios for the user is that they modify the prompt's subject to generate other images with a similar style (see Section 2). Conversely, an adversary aims to steal the target prompt from a target image. This behavior directly violates the prompt engineer's intellectual property and privacy. In ad- dition, it also jeopardizes the business model of the prompt trading marketplace like PromptBase. We refer to the prompt stolen by the adversary as the stolen prompt. Moreover, the adversary can feed the stolen prompt to the text-to-image generation model again, and the generated image here is re- ferred to as the stolen image. Adversary's Goal. Given a target image generated by a text- to-image generation model, the goal of the adversary is to steal the target prompt that leads to the target image. The stolen prompt ideally should satisfy the following four quan- titative goals. • Semantic Similarity. The stolen prompt should share high semantic similarity with the target prompt, which is normally measured in the text embedding space. This is important as text-to-image generation models essen- tially condition on the text embeddings during the im- age generation process. Here, the semantic similarity considers both subjects and prompt modifiers. 20100102015105051015trendingartistmediummovementflavorPrompt EngineeringTarget PromptTarget ImageMarketplacePrompt EngineerUserTarget PromptTradingUsageAdversaryStolen PromptStolen Image • Modifier Similarity. The stolen prompt should contain as many modifiers of the target prompt as possible. As the modifiers take an essential role in guaranteeing the quality of the generated image (see Section 3), higher modifier similarity results in better attack performance. • Image Similarity. By feeding the stolen prompt to the text-to-image generation model again, the adversary ex- pects the model to generate a similar stolen image to the target image. • Efficiency. Efficiency refers to the speed of stealing a prompt; it is always desired by the adversary to mount their attacks on a large scale efficiently. Besides, considering the usage of the target prompt men- tioned in Section 2, the stolen prompt should also lead to images depicting different subjects in the style of the target image. Therefore, we also qualitatively assess PromptStealer from this angle. Adversary's Capability. We assume the adversary's capa- bilities in a real-world setting. First, the adversary can col- lect public prompts and the corresponding images via online services like Lexica. Second, the adversary has black-box access to the target text-to-image generation model. 4.2 PromptStealer There is no doubt that an adversary can try many ways to steal the prompt from a target image. The simplest way is to use the adversary's experience to describe the image heuris- tically and guess the corresponding prompt. However, this method heavily relies on the adversary's knowledge and is difficult to be extended to a large scale. Another approach is to directly apply an existing image captioning model to the target image and treat the returned caption as the stolen prompt. However, this approach cannot obtain the prompt modifiers which play an essential role in the target prompt as shown in Section 3.2. A more sophisticated approach is the optimization-based method, like the open-source tool CLIP Interrogator [5]. This method iteratively calculates the sim- ilarity between the combinations of modifiers and the target image. Once the similarity stops rising, it regards the current combination as the stolen prompt. The complete process of CLIP Interrogator can be found in Algorithm 1 in Appendix. Due to its design, CLIP Interrogator has low efficiency (see results in Section 4.4). Moreover, many key operations of CLIP Interrogator are based on manually defined hyperpa- rameters. For instance, in one step, CLIP Interrogator se- lects 2,048 flavor modifiers out of 100,971 (Line 23 in Algo- rithm 1). In another case, the whole process of CLIP Inter- rogator is repeated exactly 25 times (Line 24 in Algorithm 1). These manually defined hyperparameters might make CLIP Interrogator sensitive to different settings, thus hindering its generalizability in the real world. Instead, in this work, we propose the first learning-based approach for prompt stealing attack, namely PromptStealer. The design principle of PromptStealer is based on our obser- vations in Section 3, i.e., a successful prompt stealing attack should focus on both the subject and modifiers of a target 6 prompt. PromptStealer uses different tools to steal the sub- ject and prompt modifiers. Specifically, PromptStealer con- sists of two key components: an image captioning model and a multi-label classifier. • Image Captioning Model. Given the target image, the image captioning model is used to generate the subject of the stolen prompt. In this work, we adopt BLIP [24], a state-of-the-art image captioning model. Concretely, we use the BLIP model pre-trained on the MS-COCO dataset.7 • Multi-Label Classifier. The multi-label classifier takes the target image as input and returns multiple labels, which are treated as prompt modifiers. In this work, we rely on ML-Decoder [39] to establish the multi-label classifier. ML-Decoder is a state-of-the-art multi-label classifier based on residual networks [19] and can eas- ily scale to thousands of labels due to the novel group- decoding scheme. We reset the multi-label head layer with Lexica-Dataset's modifier set and then fine-tune the pre-trained ML-Decoder8 on Lexica-Dataset. In ad- dition, we apply a Sigmoid activation layer at the end of ML-Decoder to normalize the outputs to prediction posteriors. The labels/modifiers whose posteriors are higher than a predefined threshold are regarded as the stolen prompt's modifiers. After applying the image captioning model and the multi- label classifier to the target image, we concatenate the subject and the prompt modifiers together to obtain the final stolen prompt. 4.3 Experimental Settings Text-to-Image Generation Model. We focus on Stable Dif- fusion as it is one of the most prevalent text-to-image genera- tion models in the field. Besides, the open-source nature and the active community support (e.g., Lexica) of this model enable us to perform a large-scale evaluation. Most of our experiments are directly performed on Lexica-Dataset. In certain cases, we also need to use Stable Diffusion to gener- ate images for evaluation. To this end, we adopt the official Stable Diffusion v1.4 model.9 For each image generation process, we sample 50 steps with default settings [50]. The size of the generated image is 512×512. We also consider other representative text-to-image gen- eration models, like DALL*E 2 and Midjounery. However, they are not open-source and only provide non-free APIs. This makes it financially infeasible for us to collect large- scale datasets from them. As an alternative, we directly ap- ply PromptStealer trained on Lexica-Dataset (based on Sta- ble Diffusion) to them as a case study to test our approach's generalizability (see Section 4.8). Attack Model. For PromptStealer, we use BLIP [24] as the image captioning model and ML-Decoder [39] as the multi- label classifier. In total, we have 77,616 prompt modifiers 7https://github.com/salesforce/BLIP. 8https://github.com/Alibaba-MIIL/ML_Decoder. 9https://huggingface.co/CompVis/stable-diffusion-v1-4. Figure 6: The performance of PromptStealer and the two baselines. The green dot line in the third figure marks the average image similarity between the target images and the images generated by the corresponding target prompts. Table 2: The average running time (efficiency) of PromptStealer and the two baselines. The time is measured on an NVIDIA DGX-A100 server. Method Time (s) Image Captioning CLIP Interrogator PromptStealer 0.01 7.89 0.01 in Lexica-Dataset, which can be all treated as labels for the multi-label classifier. However, many modifiers only appear a few times (see Figure 3c). Therefore, in our main experi- ments, we only consider modifiers that appear more than 10 times (7,672 modifiers) as labels. We also explore the effect of label number on PromptStealer in Section 4.6. We choose 0.6 as the posterior threshold to decide whether a label will appear in the modifier set of the stolen prompt. The impacts of different thresholds are investigated in Section 4.6 as well. PromptStealer is trained on 80% of the samples in Lexica- Dataset, and the rest samples are used for testing. Baseline Model. We consider two baseline attack models in our experiments. The first baseline model is a pre-trained image captioning model. Given an image, it produces a cap- tion for the image, which is directly regarded as the stolen prompt. Here, the image captioning model is the same one used in PromptStealer [24]. The second baseline model is CLIP Interrogator version 2 [5]. We use the complete mod- ifier set of Lexica-Dataset, i.e., 77,616 prompt modifiers, in CLIP Interrogator. Evaluation Metric. As discussed in Section 4.1, the adver- sary has four quantitative goals: semantic similarity, modifier similarity, image similarity, and efficiency. Thus, we adopt four quantitative metrics for these goals, respectively. • Semantic Similarity. The semantic similarity is the cosine similarity between the embeddings of the target prompt and the stolen prompt. We use CLIP's text en- coder to get the embeddings. • Modifier Similarity. The modifier similarity is the Jaccard similarity between the modifiers of the target prompt and those of the stolen prompt. • Image Similarity. The image similarity is the cosine similarity between the embeddings of the target and stolen images. Note that the image generation process of Stable Diffusion involves randomness, that is, one prompt can lead to different images given different ran- dom seeds. Therefore, to make the image similarity metric more stable, for each stolen prompt, we gener- ate four stolen images from Stable Diffusion (by vary- ing the random seed). We then calculate the similarity between each stolen image and the target image and, in the end, average the results. Here, to obtain an image's embedding, we rely on CLIP's image encoder. • Efficiency. We report the average stealing time per prompt for this metric. Besides we also provide qualitative evaluations to assess the stolen prompts and stolen images. 4.4 Quantitative Evaluation Figure 6 shows the performance of PromptStealer together with the two baselines. We find that PromptStealer outper- forms both baseline models across semantic, modifier, and image similarities. Concretely, PromptStealer achieves 0.66, 0.43, and 0.79 in these metrics, respectively, while the corre- sponding results for the better baseline CLIP Interrogator are 0.52, 0.01, and 0.77. Besides, the image captioning model itself is not sufficient to achieve a successful prompt stealing attack. It only achieves a 0.19 semantic similarity and a 0.65 image similarity. Note that image captioning has no result in modifier similarity as it does not generate modifiers. Among all the three metrics, PromptStealer outperforms CLIP Interrogator the most in modifier similarity. Moreover, we emphasize that CLIP Interrogator considers a much larger set of modifiers than PromptStealer (77,616 vs. 7,673). This further shows the advantage of PromptStealer. One possi- ble reason for CLIP Interrogator to achieve such low perfor- mance lies in its accumulation mechanism (Line 20 in Algo- rithm 1). More concretely, if CLIP Interrogator selects the wrong set of initial modifiers, the final result can be heavily affected. On the other hand, the multi-label classifier adopted by PromptStealer does not face this problem. For the image similarity metric, PromptStealer performs slightly better than CLIP Interrogator ostensibly (0.79 vs. 0.77). However, due to the randomness in the text-to-image generation process, even feeding the target prompt directly to the model yields an image similarity of 0.81, which is the up- 7 ImageCaptioningCLIPInterrogatorPromptStealerSemantic Similarity0.00.20.40.60.8SimilarityImageCaptioningCLIPInterrogatorPromptStealerModifier Similarity0.00.20.40.60.8ImageCaptioningCLIPInterrogatorPromptStealerImage Similarity0.00.20.40.60.8 (a) (b) Figure 7: Two attack examples of PromptStealer and the two baselines. The text below each image is the stolen prompt. The red color marks the correctly predicted modifiers. (a) Target (b) PromptStealer (a) Target (b) PromptStealer Figure 8: Transferability results of the example in Figure 7a. Figure 9: Transferability results of the example in Figure 7b. per bound of our attack. Therefore, we conclude that Prompt- Stealer achieves very strong performance in image similarity as well. Table 2 shows the efficiency of PromptStealer and the two baselines. We observe that PromptStealer and the image cap- tioning model, i.e., BLIP, outperform CLIP Interrogator to a large extent. For instance, BLIP and PromptStealer take both 0.01 seconds on an NVIDIA DGX-A100 server to steal one prompt. To compare, CLIP Interrogator needs 7.89 seconds under the same setting. This is because CLIP Interrogator re- lies on an iterative process to generate the stolen prompt. We also find that PromptStealer costs the same time as the image captioning model, even though PromptStealer contains one more component, i.e., the multi-label classifier. This is be- cause of the loose coupling of PromptStealer: PromptStealer can infer the subject and the modifiers simultaneously. 4.5 Qualitative Evaluation Figure 7 shows two attack examples of PromptStealer and the baselines. Here, for each stolen prompt, we let Stable Diffusion generate four images with different random seeds to eliminate the potential biases. In both cases, we can see that the stolen images by PromptStealer are more similar to the target images compared to the baselines. Take Figure 7b as an example, the stolen images by the image captioning method are the least similar to the target image. Concretely, the first, second, and fourth stolen images by image caption- ing are in vintage style, while the third image has some mod- ern features with respect to color and clothing fabric. How- ever, none of the images share a similar style with the tar- get image. With modifiers introduced, we observe the qual- ities of the stolen images generated by CLIP Interrogator improve a lot. All four images show the same vintage yel- low tint as the target image. However, the wrong modifiers steer the stolen images in the wrong direction, thus reducing the efficacy of CLIP Interrogator. For example, the modi- fier "looks like alison brie," which is not part of the target prompt, directs the results toward the celebrity Alison Brie (see the first, second, and fourth images). To compare, we find that PromptStealer is able to recover a large proportion of the modifiers of the target prompt. The large coverage of modifiers thus promises coherence between the target and stolen images. As mentioned before, an important usage of the prompt traded through the marketplace is that the user can mod- ify its subject to generate other images with a similar style. 8 a study of cell shaded cartoon of the interior of a bioshockstyle art deco city, illustration, post grunge, concept art by josangonzalesand wlop, by jamesjean, victongai, davidrubin, mike mignola, lauriegreasley, highly detailed, sharp focus, trending on artstation, hq, deviantart, art by artgema painting of a cityat nighta painting of a cityat night, cyberpunk art, stephanmartinière, cgsociety, antonfadeevand moebius, sketchfab, retro sci -fi : : a storyboard drawing, wlop: :ImageCaptioningCLIPInterrogatora painting of a cityat night, highly detailed, sharp focus, illustration, deviantart, by jamesjean, vibrant colors, by victongai, concept, wide shot, hq, lauriegreasley, artgem, by mike mignola, by josangonzalesand wlop, davidrubinPromptStealerTargetImageA full portrait of a beautiful post apocalyptic Bedouin explorer, intricate, elegant, highly detailed, digital painting, artstation, concept art, smooth, sharp focus, illustration, art by KrenzCushartand Artem Demuraand alphonsemuchaa woman in a costume with a guna woman in a costume with a gun, a character portrait, jaimejones, cgsociety, half the painting is glitched, woman in tattered clothes revealing body, female merchant, looks like alisonbrie, barbarian girl, stylized portraita woman in a costume with a gun, artstation, highly detailed, concept art, sharp focus, digital painting, intricate, illustration, smooth, elegant, by krenzcushartand artemdemuraand alphonsemuchaImageCaptioningCLIPInterrogatorPromptStealerTargetImageObject[city][village][town][metropolis]Object[city][village][town][metropolis]Object[explorer][man][elder][kid]Object[woman][man][elder][kid] Figure 10: Impacts of label number on PromptStealer. Figure 11: Impacts of threshold on PromptStealer. We refer to this usage as transferability. Ideally, the stolen prompt should have high transferability as well. Figure 8 shows some transferability examples of the target and stolen prompts in Figure 7a. Here, we replace "city" in the subject of the stolen prompt with "village," "town," and "metropo- lis." We find that the new images for PromptStealer also look quite natural, similar to the new images for the target prompt. In Figure 9, we make the same observation for the example in Figure 7b. This finding indicates that the stolen prompts by PromptStealer have high transferability. 4.6 Ablation Study We further conduct ablation studies on two key hyperparame- ters of PromptStealer, i.e., label number and posterior thresh- old. In the main experimental setting, we only consider mod- ifiers appearing more than 10 times in Lexica-Dataset as the labels (7,672) for the multi-label classifier. We are interested in whether changing the label number affects the attack per- formance. To this end, we consider two other variants, i.e., modifiers appear more than 50 times and 100 times which lead to 1,966 labels and 1,109 labels, respectively. Fig- ure 10 shows the results. We find that for semantic, mod- ifier, and image similarities, PromptStealer with 1,109 la- bels and 1,966 labels have slightly weaker performance than PromptStealer with 7,672 labels. For instance, the seman- tic similarities for 1,109, 1,966, and 7,672 labels are 0.64, 0.65, and 0.66, respectively. This is reasonable as a relatively small modifier set can already cover most modifiers in target prompts, as shown in Figure 3c. Figure 11 shows the results regarding the impact of the posterior threshold for the multi-label classifier. We find that PromptStealer obtains the highest modifier similarity and im- age similarity when the threshold is set to 0.6. For seman- 9 Figure 12: Two examples of improving PromptStealer by man- ually modifying subjects, i.e., adversary in the loop. The red color marks the correctly predicted modifiers. tic similarity, the highest result (0.67) is achieved when the threshold is 0.3, which is very close to the semantic similarity (0.66) when the threshold is 0.6. In conclusion, 0.6 is a suit- able threshold for the multi-label classifier of PromptStealer. 4.7 Adversary in the Loop We acknowledge that PromptStealer is far away from being perfect. Figure 12 shows some failed cases of PromptStealer. We find that the main reason for these failed cases to happen is that PromptStealer cannot accurately capture the key sub- jects from the target images, such as celebrities and animals. However, the adversary can easily improve this by manually modifying the stolen prompt with their knowledge, e.g., re- placing "woman" with "counselor deanna troi,"10 or modify- ing the misidentified "owl" to "wolf." Examples in Figure 12 show the effects of involving the adversary in the loop. As we can see, the attack results improve significantly. Besides involving an adversary in the loop, more advanced machine learning models can be used to solve the issue as well, like adding a subject detector in the image captioning model. We leave this as future work. 4.8 Open-World Evaluation Other Dataset. So far, all the testing samples for Prompt- Stealer are from Lexica-Dataset. Next, we check whether PromptStealer can be generalized to target images from other datasets as well. To this end, we download some testing samples from PromptDB [8], another marketplace containing prompt-image pairs by Stable Diffusion. In our case study, we randomly choose three prompt-image pairs from three different categories, i.e., backgrounds, animals, and concept art, as Figure 13 shows. We observe PromptStealer can suc- cessfully capture the semantic meaning in the target prompts. 10https://en.wikipedia.org/wiki/Deanna_Troi. 1,0002,0003,0004,0005,0006,0007,0008,000Label Number0.00.20.40.60.81.0SimilarityModiferSemanticImage0.20.30.40.50.60.70.80.9Threshold0.00.20.40.60.81.0SimilarityModifierSemanticImagecounselordeannatroi, intricate, elegant, highly detailed, digital painting, artstation, concept art, smooth, sharp focus, illustration, art by artgermand gregrutkowskiand alphonsemuchaand william-adolphebouguereaua painting of a woman in a blue dress, artstation, highly detailed, concept art, sharp focus, intricate, smooth, elegant, by artgermand gregrutkowskiand alphonsemucha[woman]->[counselordeannatroi]StolenImagesTargetImageStolenImages(Adversary in the Loop)blue feathered wolf with wings on a beautiful fantasy landscape, standing facing front, regal, elegant, winter, snow, moonlit, hd, illustration, epic, d & d, fantasy, intricate, elegant, highly detailed, digital painting, artstation, concept art, smooth, sharp focus, illustration, wallpaper, art by artgermand gregrutkowskiand alphonsemuchaand jinxiaodian image of an owl with wingsflying in the sky, artstation, highly detailed, concept art, sharp focus, digital painting, intricate, illustration, fantasy, d & d, epic, digital illustration, wallpaper, snow,full moon, winter, moonlit[owl]->[wolf]StolenImagesTargetImageStolenImages(Adversary in the Loop) Figure 14: Two attack examples of PromptStealer in open- world evaluation (other model DALL*E 2). The target and stolen images are generated by DALL*E 2. The red color marks the correctly predicted modifiers. Figure 13: Three attack examples of PromptStealer in open- world evaluation (other dataset). The three target prompt- image pairs are collected from PromptDB [8] (based on Stable Diffusion). The red color marks the correctly predicted modi- fiers. For instance, for the second target image, PromptStealer can successfully infer "monkey" in the subject and many modi- fiers like "unreal engine," "intricate," and "cinematic." Other Text-to-Image Generation Models. DALL*E 2 and Midjourney are also mainstream text-to-image generation models. However, as mentioned before, the two models are still not open-source, so we could not conduct large-scale quantitative experiments on them. Instead, we perform a case study and hope it could shed light on the generalizability of PromptStealer on these unseen models. Concretely, we first use two target prompts from Lexica-Dataset to generate two target images from DALL*E 2 and Midjourney. We then di- rectly apply the trained PromptStealer to steal the prompts from the two target images and use the corresponding text- to-image generation models again to get the stolen images. The results are displayed in Figure 14 and Figure 15. We find that even though PromptStealer has never seen images generated from DALL*E 2 and Midjourney before, it still manages to catch some of the key prompt modifiers, such as "octane render," "artstation," "volumetric lighting." This indicates that PromptStealer still works on these unseen text- to-image generation models to a certain extent. We also no- tice that PromptStealer does not perform as well as it does on Stable Diffusion. For example, it cannot accurately deduce the artist modifiers. This could be caused by the different architectures and weights of these text-to-image generation models. One possible solution is to train PromptStealer on multiple datasets related to different models like DALL*E 2 Figure 15: Two attack examples of PromptStealer in open- world evaluation (other model Midjourney). The target and stolen images are generated by Midjourney. The red color marks the correctly predicted modifiers. and Midjourney. However, as no dataset is available now, we leave this as future work. 5 Defense After demonstrating the efficacy of our prompt stealing at- tack PromptStealer, we further propose a defense method, namely PromptShield. We start by describing the methodol- ogy of PromptShield, then provide quantitative and qualita- tive evaluation results. 10 The most enchanting, mystical lighthouse in the world, photorealistic and surrounded by a violently stormy sea. Against a thunder and lightening sky, 3d render, colorful, highly detailed, insane resolution, 8k, illustration, ink, pixar, bright, photorealistica lighthouseon a small island in the middle of the ocean, highly detailed StolenImagesTargetImage3d fluffy monkey, closeup cute and adorable, cute big circular reflective eyes, long fuzzy fur, Pixar render, unreal engine cinematic smooth, intricate detail, cinematica close up of a monkeywith big eyes, unreal engine, summer vibrancy, soft shade, detective pikachu, intricate, cinematicStolenImagesStolenImagesTiny cute isometric camera, soft smooth lighting, with soft colors, 100mm lens, 3d blender render, trending on polycount, modular constructivism, blue background, physically based rendering, centereda blueand pink cameraon a graysurface, octane render, 3dTargetImageTargetImagea deloreancar driving down a road at night, concept art, 8k, octane render, 4k, cinematic, cinematic lighting, hd, dramatic lighting, unreal engine 5, 3d,hyperrealistic, hyper realistic, photorealism, calm, unreal engine render ultra realistic deloreandmc5 with pop -up headlights drifting on ancient highway wreckage in space, dark cinematic, volumetric, realistic, 3 d render, realistic render, cinematic lighting, volumetric lighting, atmospheric, cinematic, unreal engine 5, unreal engine render, octane render, hd, photorealism, hyper realistic, 8 k a painting of a woman standing in front of a castle, artstation, concept art, 8k, sharp focus, digitalart, high quality, oil painting, jama jurabaev, brush hard TargetImageStolenImagesTargetImageStolenImagesA full portrait of a beautiful post apocalyptic Bedouin explorer, intricate, elegant, highly detailed, digital painting, artstation, concept art, smooth, sharp focus, illustration, art by KrenzCushartand Artem Demuraand alphonsemuchaa car driving through a foggy field at night, 8k, octane render,smooth, cinematic lighting, cgsociety, volumetric lighting, hyper detailed, by craig mullins, by makotoshinkai, photorealismultra realistic deloreandmc5 with pop -up headlights drifting on ancient highway wreckage in space, dark cinematic, volumetric, realistic, 3 d render, realistic render, cinematic lighting, volumetric lighting, atmospheric, cinematic, unreal engine 5, unreal engine render, octane render, hd, photorealism, hyper realistic, 8 k A full portrait of a beautiful post apocalyptic Bedouin explorer, intricate, elegant, highly detailed, digital painting, artstation, concept art, smooth, sharp focus, illustration, art by KrenzCushartand Artem Demuraand alphonsemuchaa painting of a woman sitting on a rock, artstation, sharp focus, by gregrutkowski, cinematic, digitalart, by wlop, hd, 3d, by craig mullins, pascal blancheTargetImageStolenImagesTargetImageStolenImages Figure 16: The performance of PromptShield against PromptStealer. The green dot line in the third figure marks the average image similarity between the target images and the images generated by the corresponding target prompts. 5.1 PromptShield The adversary relies on machine learning models to real- ize PromptStealer. To mitigate the attack, one natural so- lution is to reduce PromptStealer's machine learning mod- els' performance. So far, the most effective approach in this field is adversarial examples; thus, we adopt it to estab- lish PromptShield. Specifically, we aim to add an optimized noise/perturbation to a target image to obtain a shielded im- age such that PromptStealer cannot infer the stolen prompt from the shielded image effectively. PromptShield has two goals, i.e., effectiveness and utility. High effectiveness indi- cates the performance of PromptStealer drops significantly on shielded images; high utility implies perturbations on the shielded images are imperceptible to humans. PromptStealer consists of two machine learning models: an image captioning model and a multi-label classifier. Tech- nically, PromptShield can generate shielded images against either of the models or both. Here, we focus on the multi- label classifier instead of the image captioning model. The reason is that if PromptShield creates a shielded image to mislead the image captioning model, then PromptStealer will obtain a subject misaligned with the shielded image. By manually checking, the adversary can easily fix the error in the subject, as we show in Section 4.7, which reduces the ef- fectiveness of PromptShield. Meanwhile, if the shielded im- age is against the multi-label classifier, then PromptStealer will infer a stolen prompt with wrong or missing modifiers. As each prompt has multiple modifiers and the total number of modifiers is large, it is not easy for the adversary to spot which modifiers are missing or wrong. To generate a shielded image against the multi-label clas- sifier, PromptShield can choose any or all of the 7,672 la- bels/modifiers. Here, we choose the modifiers in the artist category. The reasons are twofold. First, as shown in Section 3.2, artist modifiers play important roles in driving the generated images to specific styles. Second, focusing on artist modifiers also directly protects artists' intellectual properties. The concrete process of PromptShield is as follows. For the modifier set of a target prompt, we first remove all its artist modifiers to obtain a shielded modifier set. Then, we optimize a noise for the target image such that the final shielded image is classified towards the shielded modifier set. In other words, we do not mislead the multi-label classifier to classify the shielded image to a different set of artist mod- ifiers. Instead, we generate the noise that can ideally remove the artist-related information from the target image. For opti- mization, we adopt I-FGSM [21]. We set the iterative step to 100 and ε to 0.2. We also evaluate the performance of another representative method, namely C&W [11]. The performance is reported in Section A.2 in Appendix. As the design prin- ciple of PromptShield is general, we further apply it to the optimization-based baseline attack CLIP Interrogator. The results are listed in Section A.3 in Appendix. Note that we assume the defender has white-box access to the multi-label classifier of PromptStealer. We acknowledge that this is a strong assumption and the main weakness of our defense. 5.2 Experimental Settings We follow the same experimental settings in Section 4.3 for the text-to-image generation model and the attack model. Evaluation Metric. We design our evaluation metrics based on the two goals of the defender: effectiveness and utility. • Effectiveness. We adopt the same quantitative metrics, i.e., semantic similarity, modifier similarity, and image similarity, from Section 4.3 as the effectiveness metrics. • Utility. For utility, we measure the mean squared error (MSE) between the target image and the shielded im- age. Lower MSE implies higher utility. 5.3 Quantitative Evaluation Figure 16 shows the effectiveness of PromptShield. We ob- serve that the artist modifiers exhibit the greatest reduction in similarity (from 0.49 to 0.06) while the overall modifier similarity increases. This is expected, as the shielded image contains less information related to artist modifiers, the at- tack model has a higher capacity to predict other modifiers more accurately. On the other hand, we find that both se- mantic and image similarities decrease. Concretely, the se- mantic similarity decreases from 0.66 to 0.62, and the im- age similarity decreases from 0.79 to 0.71. Considering the previous worse baseline (the image captioning method) only gets a 0.65 image similarity, we conclude that PromptShield achieves strong performance in defending against Prompt- Stealer. Regarding utility, we find PromptShield performs well in producing concealed noise. The average MSE between the target and shielded images is 0.0007 for PromptStealer which implies that the added noise is imperceptible to humans. 11 UnshieldedShieldedSemantic Similarity0.00.20.40.6SimilarityUnshieldedShieldedModifier Similarity0.00.20.40.60.8ArtistMediumFlavorMovementTrendingAllUnshieldedShieldedImage Similarity0.00.20.40.60.8 on CLIP Interrogator and use the generated noise to de- fend PromptStealer; however, the experimental results are not promising. In addition, our evaluation shows that the defense performance can be reduced by the adaptive attack, which trains the multi-label classifier with shielded images and ground-truth modifiers (see Figure 22 in Appendix). We emphasize that our goal is to assess whether the defense un- der a strong assumption is effective, and we hope our re- sults can provide guidance for developing more advanced de- fenses in the future. 6 Related Work 6.1 Prompt Engineering Prompt engineering in text-to-image generation models aims to improve the quality of generated images by developing prompt design guidelines [36]. Researchers have approached this topic from different perspectives. Liu and Chilton [27] qualitatively investigate what prompt components and model parameters can produce high-quality images and provide seven suggestions for prompt design. They emphasize that using proper modifiers, rather than rephrasing the prompt with the same modifier set, is a key factor in image gen- eration quality. Oppenlaender [33] presents a taxonomy of prompt modifiers based on an ethnographic study and high- lights the significance of correctly using prompt modifiers. Pavlichenko and Ustalov [36] study a human-in-the-loop ap- proach to find the most useful combination of prompt mod- ifiers with a genetic algorithm. To bypass the laborious hu- man engineering, Hao et al. [18] then propose prompt adapta- tion, a framework that automatically adjusts user input to per- formant prompts with modifiers gathered from Lexica. Over- all, these works suggest that modifiers, especially proper modifiers, are crucial in generating high-quality images. In addition to our data analysis in Section 3.2, these previous works also inspire the design of PromptStealer. 6.2 Open-Source Prompt Stealing Methods As text-to-image generation models only gain their popular- ity recently, prompt stealing is still a very novel problem. So far, only a few tools in the open-source community can be tailored to steal prompts [5, 24, 30]. One simple approach is relying on image captioning models [24, 30]. Mokady et al. propose ClipCap that connects a CLIP image encoder and a language model (GPT2) with a simple network to translate an image into a descriptive sentence [30]. BLIP, proposed by Li et al., adopts the multimodal mixture of encoder-decoder architecture and an additional filter to remove the noisy cap- tions during the caption generation process [24]. However, these methods fail to reverse prompts satisfactorily because they do not consider important prompt modifiers. Other methods for prompt stealing are optimization-based. Among them, the most famous one is the open-source tool CLIP In- terrogator [5] that relies on CLIP to iteratively calculate the similarity between combinations of modifiers and the target image. However, this method is inefficient due to its iterative design. Also, it involves many manually defined hyperpa- rameters. Instead, PromptStealer is the first learning-based Figure 17: Two defense examples of PromptShield against PromptStealer. The red color marks the correctly predicted modifiers. We observe comparable results when C&W is adopted as the optimization method for PromptShield (see Section A.2 in Appendix). In addition, PromptShield also achieves promising results on CLIP Interrogator (see Section A.3). 5.4 Qualitative Evaluation Figure 17 shows two defense examples of PromptShield against PromptStealer. In both cases, we can see that the stolen images originating from the shielded images are less similar to the target images. Take the first target image in Figure 17 as an example. The target prompt is "Iron Gi- ant, Retrofuturism, Simon Stålenhag," where "Retrofutur- ism" is a movement modifier and "Simon Stålenhag" is an artist modifier. We find that for the unshielded target im- age, the artist modifier can be successfully stolen by Prompt- Stealer. However, after applying PromptShield, the attack model cannot predict the artist modifier from the shielded image. Moreover, even though the stolen prompt based on the shielded image contains the correct movement modifier "Retrofuturism," the stolen images are quite different from the target image without the artist modifier. Besides, by com- paring the target and shielded images, we find they are quite similar, demonstrating the utility of PromptShield. 5.5 Limitations As mentioned before, PromptShield is effective but it re- quires a strong assumption for the defender, i.e., white-box access to the attack model. We have also experimented with the transfer defense. Concretely, we apply PromptShield 12 amanstandinginfrontofagiantspaceship,artstation,bybeeple,bysimonstalenhag,bysimonstålenhag,lowlevela man sitting on a bench in front of a spaceship, retrofuturismPromptStealeronShieldedImagesagirlinawhiteshirtstandinginaforest,artstation,bywlop,detailed,byrossdraws,bymakotoshinkai,stanleyartgermlau,colorful,detailedface,ambientlightinga girlin a white shirt standing in a forest, stanleyartgermlau, detailed face, ambient lighting, mid shot, single centeredsubjectPromptStealeronShieldedImagesIron Giant, Retrofuturism, Simon Stålenhaggreen recycle girl, single centeredsubject, mid shot, ambient lighting, detailed face, by makotoshinkai, stanleyartgermlau, wlop, rossdrawsUnshieldedShieldedUnshieldedShieldedPromptStealerPromptStealer prompt stealing attack. Based on the experimental results in Section 4, our approach outperforms the above-mentioned image captioning methods and optimization-based methods to a large extent. In recent years, researchers have uncovered various types of attacks against machine learning models, such as adversar- ial examples [11,12,22,23,34,35,47,49], membership infer- ence [10,14,25,26,31,43,45,46], backdoor [13,17,20,28,29, 32, 41, 44, 52], etc. However, most of these works focus on classification models. Meanwhile, the security and privacy vulnerabilities of text-to-image generation models have re- ceived little attention. To the best of our knowledge, there is only one work [51] focusing on investigating membership in- ference attacks against text-to-image generation models. We hope our study can inspire more research in this field. 7 Conclusion In this paper, we propose the first prompt stealing attack against the popular text-to-image generation models. A suc- cessful prompt stealing attack directly violates the intellec- tual property and privacy of prompt engineers. Also, it threatens the business model of prompt trading marketplaces. In detail, we first collect a dataset Lexica-Dataset and per- form a large-scale measurement on it to show that a success- ful prompt stealing attack should consider a target prompt's subject as well as its modifiers. We then propose the first learning-based prompt stealing attack, PromptStealer. Ex- perimental results show that PromptStealer outperforms the two baseline methods both quantitatively and qualitatively. We further make the first attempt to investigate the defense method against PromptStealer. In general, our study shed light on the threats existing in the ecosystem created by the popular text-to-image generation models. We hope our re- sults can provide guidance to the stakeholders to mitigate the risks. To facilitate research in this field, we will share our dataset and code. References [1] https://midjourney.com/. 1 [2] https://promptbase.com/. 1, 3, 5 [3] https://www.promptsea.io/. 1, 3 [4] https://visualise.ai/. 1, 3 [5] https://github.com/pharmapsychotic/clip-interrog ator. 2, 4, 6, 7, 12 [6] https://lexica.art/. 2, 3 [7] https://dallery.gallery/the-dalle-2-prompt-book /. 5 [8] https://promptdb.ai/. 9, 10 [9] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large Scale GAN Training for High Fidelity Natural Image Synthe- sis. In International Conference on Learning Representations (ICLR), 2019. 2 [10] Nicholas Carlini, Steve Chien, Milad Nasr, Shuang Song, An- dreas Terzis, and Florian Tramèr. Membership Inference At- tacks From First Principles. In IEEE Symposium on Security and Privacy (S&P), pages 1897–1914. IEEE, 2022. 13 [11] Nicholas Carlini and David Wagner. Towards Evaluating the Robustness of Neural Networks. In IEEE Symposium on Se- curity and Privacy (S&P), pages 39–57. IEEE, 2017. 11, 13 [12] Jianbo Chen, Michael I. Jordan, and Martin J. Wainwright. HopSkipJumpAttack: A Query-Efficient Decision-Based At- In IEEE Symposium on Security and Privacy (S&P), tack. pages 1277–1294. IEEE, 2020. 13 [13] Xiaoyi Chen, Ahmed Salem, Michael Backes, Shiqing Ma, Qingni Shen, Zhonghai Wu, and Yang Zhang. BadNL: Back- door Attacks Against NLP Models with Semantic-preserving In Annual Computer Security Applications Improvements. Conference (ACSAC), pages 554–569. ACSAC, 2021. 13 [14] Christopher A. Choquette Choo, Florian Tramèr, Nicholas Carlini, and Nicolas Papernot. Label-Only Membership Infer- ence Attacks. In International Conference on Machine Learn- ing (ICML), pages 1964–1974. PMLR, 2021. 13 [15] Katherine Crowson, Stella Biderman, Daniel Kornis, Dashiell Stander, Eric Hallahan, Louis Castricato, and Edward Raff. VQGAN-CLIP: Open Domain Image Generation and Editing with Natural Language Guidance. In European Conference on Computer Vision (ECCV), pages 88–105. Springer, 2022. 2 [16] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative Adversarial Nets. In Annual Con- ference on Neural Information Processing Systems (NIPS), pages 2672–2680. NIPS, 2014. 2 [17] Tianyu Gu, Brendan Dolan-Gavitt, and Siddharth Grag. Bad- Identifying Vulnerabilities in the Machine Learning nets: Model Supply Chain. CoRR abs/1708.06733, 2017. 13 [18] Yaru Hao, Zewen Chi, Li Dong, and Furu Wei. Op- CoRR timizing Prompts for Text-to-Image Generation. abs/2212.09611, 2022. 1, 12 [19] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In IEEE Con- ference on Computer Vision and Pattern Recognition (CVPR), pages 770–778. IEEE, 2016. 6 [20] Jinyuan Jia, Yupei Liu, and Neil Zhenqiang Gong. BadEn- coder: Backdoor Attacks to Pre-trained Encoders in Self- In IEEE Symposium on Security and Supervised Learning. Privacy (S&P). IEEE, 2022. 13 [21] Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adver- sarial Examples in the Physical World. CoRR abs/1607.02533, 2016. 11 [22] Bo Li and Yevgeniy Vorobeychik. Scalable Optimization of Randomized Operational Decisions in Adversarial Classifica- tion Settings. In International Conference on Artificial Intelli- gence and Statistics (AISTATS), pages 599–607. JMLR, 2015. 13 [23] Huichen Li, Xiaojun Xu, Xiaolu Zhang, Shuang Yang, and Bo Li. QEBA: Query-Efficient Boundary-Based Blackbox At- In IEEE Conference on Computer Vision and Pattern tack. Recognition (CVPR), pages 1218–1227. IEEE, 2020. 13 [24] Junnan Li, Dongxu Li, Caiming Xiong, and Steven C. H. Hoi. BLIP: Bootstrapping Language-Image Pre-training for Uni- fied Vision-Language Understanding and Generation. CoRR abs/2201.12086, 2022. 2, 6, 7, 12 [25] Zheng Li, Yiyong Liu, Xinlei He, Ning Yu, Michael Backes, and Yang Zhang. Auditing Membership Leakages of Multi- Exit Networks. In ACM SIGSAC Conference on Computer and Communications Security (CCS), pages 1917–1931. ACM, 2022. 13 13 [26] Zheng Li and Yang Zhang. Membership Leakage in Label- Only Exposures. In ACM SIGSAC Conference on Computer and Communications Security (CCS), pages 880–895. ACM, 2021. 13 [27] Vivian Liu and Lydia B. Chilton. Design Guidelines for Prompt Engineering Text-to-Image Generative Models. In An- nual ACM Conference on Human Factors in Computing Sys- tems (CHI), pages 384:1–384:23. ACM, 2022. 1, 3, 4, 12 [28] Yingqi Liu, Shiqing Ma, Yousra Aafer, Wen-Chuan Lee, Juan Zhai, Weihang Wang, and Xiangyu Zhang. Trojaning Attack on Neural Networks. In Network and Distributed System Se- curity Symposium (NDSS). Internet Society, 2018. 13 [29] Yunfei Liu, Xingjun Ma, James Bailey, and Feng Lu. Re- flection Backdoor: A Natural Backdoor Attack on Deep Neu- ral Networks. In European Conference on Computer Vision (ECCV), pages 182–199. Springer, 2020. 13 [30] Ron Mokady, Amir Hertz, and Amit H. Bermano. ClipCap: CLIP Prefix for Image Captioning. CoRR abs/2111.09734, 2021. 2, 12 [31] Milad Nasr, Reza Shokri, and Amir Houmansadr. Compre- hensive Privacy Analysis of Deep Learning: Passive and Ac- tive White-box Inference Attacks against Centralized and Fed- erated Learning. In IEEE Symposium on Security and Privacy (S&P), pages 1021–1035. IEEE, 2019. 13 [32] Tuan Anh Nguyen and Anh Tran. Input-Aware Dynamic Backdoor Attack. In Annual Conference on Neural Informa- tion Processing Systems (NeurIPS). NeurIPS, 2020. 13 [33] Jonas Oppenlaender. A Taxonomy of Prompt Modifiers for Text-To-Image Generation. CoRR abs/2204.13988, 2022. 1, 3, 4, 12 [34] Nicolas Papernot, Patrick D. McDaniel, Ian Goodfellow, Somesh Jha, Z. Berkay Celik, and Ananthram Swami. Prac- tical Black-Box Attacks Against Machine Learning. In ACM Asia Conference on Computer and Communications Security (ASIACCS), pages 506–519. ACM, 2017. 13 [35] Nicolas Papernot, Patrick D. McDaniel, Somesh Jha, Matt Fredrikson, Z. Berkay Celik, and Ananthram Swami. The Limitations of Deep Learning in Adversarial Settings. In IEEE European Symposium on Security and Privacy (Euro S&P), pages 372–387. IEEE, 2016. 13 [36] Nikita Pavlichenko and Dmitry Ustalov. Best Prompts for CoRR Text-to-Image Models and How to Find Them. abs/2209.11711, 2022. 12 [37] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning Transferable Visual Models From Natural Language Supervision. In International Conference on Machine Learning (ICML), pages 8748–8763. PMLR, 2021. 4 [38] Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical Text-Conditional Image Gen- eration with CLIP Latents. CoRR abs/2204.06125, 2022. 1, 2 [39] Tal Ridnik, Gilad Sharir, Avi Ben-Cohen, Emanuel Ben Baruch, and Asaf Noy. ML-Decoder: Scalable and Versatile Classification Head. CoRR abs/2111.12933, 2021. 6 [40] Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-Resolution Image Syn- In IEEE Conference thesis with Latent Diffusion Models. on Computer Vision and Pattern Recognition (CVPR), pages 10684–10695. IEEE, 2022. 1, 2 [41] Aniruddha Saha, Akshayvarun Subramanya, and Hamed Pir- In AAAI Con- siavash. Hidden Trigger Backdoor Attacks. ference on Artificial Intelligence (AAAI), pages 11957–11965. AAAI, 2020. 13 [42] Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S. Sara Mahdavi, Rapha Gontijo Lopes, Tim Salimans, Jonathan Ho, David J. Fleet, and Mohammad Norouzi. Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding. CoRR abs/2205.11487, 2022. 2 [43] Ahmed Salem, Yang Zhang, Mathias Humbert, Pascal Berrang, Mario Fritz, and Michael Backes. ML-Leaks: Model and Data Independent Membership Inference Attacks and De- In Network and Dis- fenses on Machine Learning Models. tributed System Security Symposium (NDSS). Internet Society, 2019. 13 [44] Xinyue Shen, Xinlei He, Zheng Li, Yun Shen, Michael Backes, and Yang Zhang. Backdoor Attacks in the Supply Chain of Masked Image Modeling. CoRR abs/2210.01632, 2022. 13 [45] Reza Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov. Membership Inference Attacks Against Machine Learning Models. In IEEE Symposium on Security and Pri- vacy (S&P), pages 3–18. IEEE, 2017. 13 [46] Liwei Song, Reza Shokri, and Prateek Mittal. Privacy Risks of Securing Machine Learning Models against Adversarial Ex- amples. In ACM SIGSAC Conference on Computer and Com- munications Security (CCS), pages 241–257. ACM, 2019. 13 [47] Florian Tramèr, Alexey Kurakin, Nicolas Papernot, Ian Good- fellow, Dan Boneh, and Patrick McDaniel. Ensemble Adver- sarial Training: Attacks and Defenses. In International Con- ference on Learning Representations (ICLR), 2017. 13 [48] Laurens van der Maaten and Geoffrey Hinton. Visualizing Data using t-SNE. Journal of Machine Learning Research, 2008. 4 [49] Yevgeniy Vorobeychik and Bo Li. Optimal Randomized Clas- sification in Adversarial Settings. In International Conference on Autonomous Agents and Multi-agent Systems (AAMAS), pages 485–492. IFAAMAS/ACM, 2014. 13 [50] Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. High-Resolution Image Syn- thesis and Semantic Manipulation With Conditional GANs. In IEEE Conference on Computer Vision and Pattern Recogni- tion (CVPR), pages 8798–8807. IEEE, 2018. 6 [51] Yixin Wu, Ning Yu, Zheng Li, Michael Backes, and Yang Zhang. Membership Inference Attacks Against Text-to-image Generation Models. CoRR abs/2210.00968, 2022. 13 [52] Yuanshun Yao, Huiying Li, Haitao Zheng, and Ben Y. Zhao. Latent Backdoor Attacks on Deep Neural Networks. In ACM SIGSAC Conference on Computer and Communications Secu- rity (CCS), pages 2041–2055. ACM, 2019. 13 14 Algorithm 1: Pseudocode for CLIP Interrogator (version 2.0) Input: Target image X, keywords List K f lavor, Kartist , Kmedium, Kmovement , Ktrending Output: Predicted prompt p 1 Function FindTopK(vimage, text_list, K): 2 vt = CLIP(text_list) sim = Sim(vimage, vt ) t = FindTopKItem(text_list, sim, K) return t; 3 4 5 6 7 Function Sim(vimage, vt ): 8 vimage = normalize(vimage) vt = normalize(vt ) return matrix_multiplication(vimage, vT t ) 9 10 11 12 Function Main: // get the subject p = BLIP(X) // get the clip image embedding of target image vx = CLIP(X) // find top1 modifiers in 4 categories kartist = FindTopK (vx, Kartist ,1) kmedium = FindTopK (vx, Kmedium,1) kmovement = FindTopK (vx, Kmovement ,1) ktrending = FindTopK (vx, Ktrending,1) // get candidate prompt list tpertubation = GetPertubations(p, kartist , kmedium, kmovement , ktrending) // find the best prompt p = FindTopK (vx, tpertubation,1) vp = CLIP(p) simbest = Sim(vimage, vp) // find top 2048 flavor modifiers k f lavor = FindTopK (vx, K f lavor, 2048) // loop 25 times, add the best flavor modifier to prompt until similarity satures for i to 25 do p f lavors = [ p + "," + k for k in k f lavor] p = FindTopK (vx, p f lavors, 1) kbest = p.split(",")[-1] k f lavor remove kbest Vp = CLIP(p) sim = Sim(vimage, vp) if sim » simbest then simbest = sim else break return p 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 A Appendix A.1 Algorithm for CLIP Interogator A.2 PromptShield With C&W C&W is another representative method in generating adver- sarial examples. Different from I-FGSM, C&W utilizes two losses to control the attack effectiveness and utility. In our experiments, we set the iterative step to 100, the learning rate to 0.05, and the loss trade-off hyperparameter to 0.001. Quantitative Evaluation. Figure 18 reports the effective- ness of PromptShield (C&W). We observe that semantic, modifier, and image similarities decrease from 0.66, 0.43, and 0.79 to 0.58, 0.21, and 0.74, respectively. Similar to the results shown in Figure 16, the artist modifiers drop the greatest in similarity (from 0.49 to 0.13). Regarding utility, we find C&W also produces invisible noise. The average MSE between the target and shielded images is 0.08. Qualitative Evaluation. Figure 19 shows two defense ex- amples of PromptShield (C&W) against PromptStealer. In both cases, we can see that the stolen images from the shielded images are very different from the target images. Besides, we find that C&W tends to lead the stolen images to mispredict the artist modifiers. For instance, in the first target image in Figure 19, the artist modifier in the target prompt is "Simon Stålenhag." After adding concealed noise, the stolen prompt contains some unexpected artist modifiers, such as "donato giancola" and "studio ghibli," which mislead the stolen images to a disparate style. A.3 PromptShield Against CLIP Interrogator As PromptShield adds perturbations to mislead the attack model, it can be easily migrated to any other prompt stealing attacks relying on machine learning models. In this experi- ment, we show the generality of PromptShield via applying it against CLIP Interrogator. Specifically, we use I-FGSM as the optimization method as it produces smaller noise on the target images (see Section 5.3 and Section A.2). We follow the same experiment settings in Section 5.2. Quantitative Evaluation. Similar to PromptShield on PromptStealer, we observe the semantic, modifier, and im- age similarities decrease significantly for CLIP Interrogator (see Figure 20). Specifically, the values of these metrics de- crease from 0.52, 0.0108, and 0.77 to 0.33, 0.0059, and 0.51, respectively. By examining the changes in different modifier categories, we find that the artist modifiers have the greatest drops in similarity (from 0.04 to 0.01). Besides, the noise is minimal, i.e., the average MSE between the target and shielded images is 0.0002. Qualitative Evaluation. Figure 21 shows two defense ex- amples of PromptShield against CLIP Interrogator. In both examples, we find that the addition of imperceptible noise successfully misleads the attack model, i.e., the stolen im- ages from the shielded images are quite different from the target images. We also observe that the shielded images lead CLIP Interrogator to predict incorrect modifiers. Take the first case in Figure 21 as an example. The stolen prompt deriving from the shielded image contains modifiers like 15 Figure 18: The performance of PromptShield (C&W) against PromptStealer. The green dot line in the third figure marks the average image similarity between the target images and the images generated by the corresponding target prompts. Figure 19: Two defense examples of PromptShield (C&W) against PromptStealer. The red color marks the correctly predicted modi- fiers. "holography," "m 1 abrams tank," "incredible post - process- ing lighting," and "brain scan." However, non of the modi- fiers belong to the target modifier set, resulting in the dissim- ilarity between the stolen images and the target image. 16 UnshieldedShieldedSemantic Similarity0.00.20.40.6SimilarityUnshieldedShieldedModifier Similarity0.00.20.40.60.8ArtistMediumFlavorMovementTrendingAllUnshieldedShieldedImage Similarity0.00.20.40.60.8amanstandinginfrontofagiantspaceship,artstation,bybeeple,bysimonstalenhag,bysimonstålenhag,lowlevela man sitting on a bench in a futuristic city, artstation, 8k, by donatogiancola, by studio ghibli, by victongai, by waynebarlowe, by timhildebrandt, by brucepenningtonPromptStealeronShieldedImagesagirlinawhiteshirtstandinginaforest,artstation,bywlop,detailed,byrossdraws,bymakotoshinkai,stanleyartgermlau,colorful,detailedface,ambientlightinga girlstanding in front of a tree, artstation, matte painting, by conradroset, watercolor, ink stylePromptStealeronShieldedImagesIron Giant, Retrofuturism, Simon Stålenhaggreen recycle girl, single centeredsubject, mid shot, ambient lighting, detailed face, by makotoshinkai, stanleyartgermlau, wlop, rossdrawsUnshieldedShieldedUnshieldedShieldedPromptStealerPromptStealer Figure 20: The performance of PromptShield against CLIP Interrogator. The green dot line in the third figure marks the average image similarity between the target images and the images generated by the corresponding target prompts. Figure 21: Two defense examples of PromptShield against CLIP Interrogator. The red color marks the correctly predicted modifiers. Figure 22: The performance of PromptShield against PromptStealer. Shielded (Adaptive) represents the adaptive attack's perfor- mance. The green dot line in the third figure marks the average image similarity between the target images and the images generated by the corresponding target prompts. 17 UnshieldedShieldedSemantic Similarity0.00.20.40.6SimilarityUnshieldedShieldedModifier Similarity0.00.20.40.60.8ArtistMediumFlavorMovementTrendingAllUnshieldedShieldedImage Similarity0.00.20.40.60.8a man standing in front of a giantspaceship, cyberpunk art, simonstalenhag, procreate on behance, ship control panel close -up, low-emission-neon, wipeout2 0 4 8, futurism aesthetic, ai assisted digital painting, ( cyberpunk ) a man standing in front of a giantspaceship, holography, m 1 abramstank, incredible post -processing lighting, brain scanUnshieldedShieldedCLIPInterrogatorCLIPInterrogatoronShieldedImagesa girlin a white shirt standing in a forest, a detailedpainting, cgsociety, anime keyframe, studio ghibliepic character withd, android wlop, live 2d, 千葉雄大, ( ( ( ( jungle ) ) ) ) a girlin a white shirt standing in a forest, a photo, titian, glitches, justinbieber, (((winking))), detail ", yiosgsghdUnshieldedShieldedCLIPInterrogatorCLIPInterrogatoronShieldedImagesIron Giant, Retrofuturism, Simon Stålenhaggreen recycle girl, single centeredsubject, mid shot, ambient lighting, detailed face, by makotoshinkai, stanleyartgermlau, wlop, rossdrawsUnshieldedShieldedShielded(Adaptive)Semantic Similarity0.00.20.40.6SimilarityUnshieldedShieldedShielded(Adaptive)Modifier Similarity0.00.20.40.60.8ArtistMediumFlavorMovementTrendingAllUnshieldedShieldedShielded(Adaptive)Image Similarity0.00.20.40.60.8
http://arxiv.org/abs/2302.09921v2
2023-07-17T00:59:31
2023-02-20T11:34:16
Free-Form Variational Inference for Gaussian Process State-Space Models
Gaussian process state-space models (GPSSMs) provide a principled and flexible approach to modeling the dynamics of a latent state, which is observed at discrete-time points via a likelihood model. However, inference in GPSSMs is computationally and statistically challenging due to the large number of latent variables in the model and the strong temporal dependencies between them. In this paper, we propose a new method for inference in Bayesian GPSSMs, which overcomes the drawbacks of previous approaches, namely over-simplified assumptions, and high computational requirements. Our method is based on free-form variational inference via stochastic gradient Hamiltonian Monte Carlo within the inducing-variable formalism. Furthermore, by exploiting our proposed variational distribution, we provide a collapsed extension of our method where the inducing variables are marginalized analytically. We also showcase results when combining our framework with particle MCMC methods. We show that, on six real-world datasets, our approach can learn transition dynamics and latent states more accurately than competing methods.
[ "Xuhui Fan", "Edwin V. Bonilla", "Terence J. O'Kane", "Scott A. Sisson" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09921v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09921v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "stat.ML" ]
3 2 0 2 l u J 7 1 ] G L . s c [ 2 v 1 2 9 9 0 . 2 0 3 2 : v i X r a Free-Form Variational Inference for Gaussian Process State-Space Models Xuhui Fan 1 Edwin V. Bonilla 2 Terence J. O'Kane 3 Scott A. Sisson 4 Abstract Gaussian process state-space models (GPSSMs) provide a principled and flexible approach to mod- eling the dynamics of a latent state, which is observed at discrete-time points via a likelihood model. However, inference in GPSSMs is compu- tationally and statistically challenging due to the large number of latent variables in the model and the strong temporal dependencies between them. In this paper, we propose a new method for in- ference in Bayesian GPSSMs, which overcomes the drawbacks of previous approaches, namely over-simplified assumptions, and high computa- tional requirements. Our method is based on free- form variational inference via stochastic gradient Hamiltonian Monte Carlo within the inducing- variable formalism. Furthermore, by exploiting our proposed variational distribution, we provide a collapsed extension of our method where the inducing variables are marginalized analytically. We also showcase results when combining our framework with particle MCMC methods. We show that, on six real-world datasets, our ap- proach can learn transition dynamics and latent states more accurately than competing methods. 1. Introduction State-space models (SSMs; Murphy, 2023, Ch. 29) charac- terize the underlying dynamics of a latent state given a set of observations via a transition function and an observation model. As a modeling framework, they provide a general ap- proach for understanding time-series data (Kitagawa, 1987) and for data assimilation problems (Katzfuss et al., 2016). Applications of SSMs abound and span diverse areas such as econometrics (Tsay, 2005), control engineering (Ogata et al., 2010) and neuroscience (Brown et al., 1998). 1University of Newcastle, Australia 2CSIRO's Data61, Aus- tralia 3CSIRO's Environment, Australia 4University of New South Wales, Australia. Correspondence to: Xuhui Fan <[email protected]>. Proceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). 1 In this paper, we focus on Bayesian SSMs, where the transi- tion function describing the dynamics of the system is given a prior distribution. A paradigmatic example of Bayesian SSMs are Gaussian process state-space models (GPSSMs; Frigola, 2015), where this prior distribution is a Gaussian process (GP; Williams & Rasmussen, 2006). Due to their Bayesian non-parametric nature, GPSSMs represent a prin- cipled and flexible approach to Bayesian SSMs. However, the flexibility of Gaussian processs (GPs) adds significant computational and statistical challenges to the already difficult problem of inference in Bayesian SSMs. In- deed, even for non-Bayesian SSMs, standard problems such as filtering, smoothing, and prediction are, in general, ana- lytically intractable1. Having a GP prior over the transition function in SSMs increases the number of latent variables significantly; incorporates strong (and potentially long-term) dependencies across states; and introduces a cubic time com- plexity as a function of the number of observations. Within the GP community, significant advances have been made addressing the computational issues in GP regression and classification problems, most notably using inducing- variable approximations (Titsias, 2009; Hensman et al., 2015; Rossi et al., 2021) but also random-feature expansions (Cutajar et al., 2017; Marmin & Filippone, 2022) and, more recent innovative approaches such as the Vecchia approxi- mation (Sauer et al., 2022). Although these approximations are applicable to GP-based dynamic models, the challenges above remain prevalent within the context of GPSSMs. Nevertheless, previous approaches have developed insight- ful and practical algorithms for inference in GPSSMs, mainly based on inducing-variable approximations, which is also our main underpinning methodology for scalable GPs. In outlining the most relevant approaches, our main object of interest is the approximate joint posterior over state tra- jectories x0:T and inducing variables u, q(x0:T , u), where T + 1 is the length of the trajectory. We consider two main aspects of this joint distribution: (i) whether the dependen- cies between state trajectories and inducing variables are captured and (ii) whether their corresponding distributions are unconstrained, i.e., not restricted to a sub-optimal para- metric form. The seminal variational Gaussian process state 1With the notable exception of the linear-Gaussian case where the optimal solution is given by the Kalman filter (Kalman, 1960). Free-Form Variational Inference for Gaussian Process State-Space Models space model (VGPSSM) proposed by Frigola et al. (2014) as well as the subsequent identifiable Gaussian process state space model (IGPSSM) of Eleftheriadis et al. (2017) use mean-field approaches, therefore, ignoring the posterior de- pendencies between state trajectories and inducing variables. The more recent methods, namely the probabilistic recur- rent state space model (PRSSM) of Doerr et al. (2018) and the variationally coupled dynamic trajectories (VCDT) of Ialongo et al. (2019) introduce couplings across state trajec- tories and inducing variables. However, their posteriors are constrained to be Gaussians. Thus, these previous works have either assumed independence between state trajecto- ries and inducing variables or imposed strong parametric constraints in their corresponding posteriors or both. As shown by Ialongo et al. (2019), a mean-field posterior can yield poor practical performance. Similarly, a Gaussian assumption on the state posterior or the inducing variable posterior is also very strong and, by definition, will not gen- erally capture the true posterior even in the limit of infinite computation. To address these issues, we propose a free- form variational inference approach to posterior estimation in GPSSMs that models the full joint distribution over states and inducing variables, q(x0:T , u), without any mean-field or parametric assumptions. We refer to our method as free- form variational dynamics (FFVD) and summarize the major differences between its posterior assumptions and those of previous approaches in Table 1. Below we describe our contributions in more detail. (i) Flexible posterior: We develop FFVD, an inference algorithm for GPSSMs based on stochastic gradient Hamil- tonian Monte Carlo (SGHMC; Chen et al., 2014; Havasi et al., 2018), which represents the posterior over states and inducing variables using samples. FFVD lifts the limitations of previous variational approaches to GPSSMs, which have ignored couplings in this posterior or have assumed a con- strained parametric form. More precisely, FFVD captures the posterior correlations between states and inducing vari- ables; does not constrain this posterior to any parametric form, and, is scalable to a large number of observations. (ii) Collapsed inference that accelerates convergence: we show that (i) our formulation allows us to collapse the in- ducing variables u, (ii) sample from the lower-dimensional marginal q(x0:T ) and, at the end of the sampling procedure, (iii) obtain samples from the conditional q(u | x0:T ), for which we derive a closed-form expression. We show that collapsing accelerates convergence significantly. (iii) Extensions with particle Markov chain Monte Carlo (PMCMC): we further investigate whether more elabo- rate inference algorithms, such as PMCMC (Andrieu et al., 2010), that account for the sequential nature of the problem can provide more accurate posteriors. (iv) State-of-the-art performance: we showcase the prop- erties and benefits of our approach compared to previous methods such as VGPSSM, PRSSM and VCDT in a syn- thetic example and six system identification benchmarks. Overall, our method provides state-of-the-art performance when evaluated on these problems, while having compa- rable computational requirements to previous approaches. Our code and supplementary material can be found at https://github.com/xuhuifan/FFVD. 2. Inference in Gaussian Process Models Gaussian processs (GPs) are priors over functions where ev- ery subset of function values follow a Gaussian distribution. We use f (x) ∼ GP (mf (x), κf (x, x′; θ)) to denote that f is distributed according to a GP with mean function mf (*) and covariance function κf (*, *; θ), where θ are referred to as the GP hyper-parameters2. By definition, a GP prior over functions implies a finite prior over T function values f = [f (x1), . . . , f (xT )]⊤, i.e., f ∼ N (f ; m, K), where m and K are obtained by evaluating the mean function and covariance function at all the inputs X := {x1, . . . , xT }. In supervised learning settings, we are given input-output observations {xt, yt}T t=1 and a conditional likelihood model p(y | f ). Inference involves estimating the posterior distribu- tion p(f | y, X) and the hyper-parameters θ from data. Con- sequently, we can use these to estimate the posterior predic- tive distribution at a new point x⋆, i.e., p(f (x⋆) | X, y, x⋆). Notoriously, these tasks have cubic time complexity as a function of the number of training observations, i.e., O(T 3), arising from algebraic operations involving the computa- tion of the inverse covariance and its log determinant. This motivates the need for sparse approximations. 2.1. Sparse GP Approximations via Inducing Variables To deal with the cubic computational complexity of infer- ence in GP models, we focus on inducing-variable approx- imations based on variational inference, as originally pro- posed by Titsias (2009) and made scalable to very large datasets by Hensman et al. (2013). The main idea of these approximations is to augment the space of function values with a set of M inducing variables u := {ui} and their corresponding inducing inputs Z := {zi}. Thus, inference involves estimating the posterior q(u, f ) ≈ p(u, f | X, y) and the GP hyper-parameters θ via variational inference. Under the assumption that q(u, f ) := q(u)p(f | u) where p(f | u) is the conditional prior, the variational objective, the so-called evidence lower bound (ELBO), decomposes over the observations, and inference can be carried out with time complexity of O(M 3), providing significant advantages when M ≪ T . 2We have simply assumed identity mean functions. 2 Free-Form Variational Inference for Gaussian Process State-Space Models Table 1. Comparison across methods in terms of their assumptions on the variational distribution. The rows refer to whether the variational posterior captures the dependencies between the state trajectories and the inducing variables (coupled q(x0:T , u)); the distribution over states is unconstrained (unconstrained q(x0:T | u) or q(x0:T )), i.e., not restricted to a sub-optimal parametric form; and whether the distribution over the inducing variables is also unconstrained (unconstrained q(u)). Our method is referred to as FFVD. VGPSSM IGPSSM PRSSM VCDT FFVD Coupled q(x0:T , u) Unconstrained q(x0:T | u) or q(x0:T ) Unconstrained q(u) ✗ ✓ ✓ ✗ ✗ ✗ ✓ ✗ ✗ ✓ ✗ ✗ ✓ ✓ ✓ 3. Gaussian Process State-Space Models outputs f 1:t−1 and inputs x0:t−2, Let us assume we are given a time series of T multi- dimensional observations y1:T and denote their correspond- ing latent states with x0:T , where x0 is the initial state. Here we denote the time series xt1:t2 := {xt1, . . . , xt2 }, and similarly for y1:T . In general, xt ∈ Rdx and yt ∈ Rdy . Gaussian process state-space models (GPSSMs) formulate a discrete-time state-space model (SSM) where the transition dynamics is given by a GP. The full generative process is: x0 ∼ p(x0), f (x) ∼ GP(mf (x), κf (x, x′; θ)), f t := f (xt−1), xt | f t ∼ N (xt; f t, Q), yt | xt ∼ p(yt | xt, φ), (1) (2) (3) where Q is the transition process covariance, and φ is the vector of parameters of the conditional likelihood p(yt | xt, φ). Although our framework does not make any parametric assumptions about this conditional likelihood, in our experiments in § 7, we adopt the same setting as in pre- vious works (Ialongo et al., 2019; Doerr et al., 2018) and set p(yt | xt, φ) := N (yt; Cxt + d, R), with φ = {C, d, R}, where C, d are the weights and bias of the linear transfor- mation on xt and R is the observation covariance. 3.1. Joint Distribution As shown by Frigola (2015), to sample f t, instead of con- ditioning on an infinite-dimensional function, we can con- dition only on the transitions seen up to (but not including) time t, i.e., {(xi−1, f i)}t−1 i=1. We can then write the joint distribution over latent variables and observations as: p(y1:T , x0:T , f 1:T ) = p(x0) T (cid:89) t=1 p(f t | f 1:t−1, x0:t−1)p(xt | f t)p(yt | xt), (4) p(f t | f 1:t−1, x0:t−1) = p(f t | xt−1, f 1:t−1, x0:t−2) = N (f t; μf , Σf ), (5) (6) with conditional mean and covariance given by μf = mt−1 + Kt−1,0:t−2K−1 Σf = Kt−1 − Kt−1,0:t−2K−1 0:t−2(f 1:t−1 − m0:T −2) (7) 0:t−2K0:t−2,t−1), (8) where the subscript notation indicates the mean vectors and covariance matrices obtained from evaluating the mean function and covariance function, respectively, at the cor- responding ranges, mt1:t2 := mf (xt1:t2 ), mt := mt:t, Kt1:t2,t3:t4 := κf (xt1:t2, xt3:t4 ; θ), Kt1:t2 := Kt1:t2,t1:t2 and Kt := Kt:t. 3.2. Multidimensional Latent States & Control Inputs In the case of multidimensional latent states, i.e., dx > 1, we assume independent GPs on each dimension, each with its own mean function and covariance function. Because of this independence assumption, each GP only has to condition on its own function evaluations. Therefore, for simplicity in the notation, we do not index the means and covariances with re- spect to their dimension d and consider the underlying GPs, their means, and covariance functions as multi-dimensional. Furthermore, as we shall see in § 7, our experiments con- sider additional control inputs (at) that affect the transitions in a Markovian way. This is easy to incorporate in our framework by augmenting our input space and, therefore, indexing the GPs in the higher-dimensional space given by the concatenation [x⊤, a⊤]⊤. However, since the control inputs are fixed and deterministic, we do not need to include them as part of out inference method and do not make them explicit in our subsequent mathematical development. 3.3. Sparse GPSSM where p(x0), p(xt | f t), p(yt | xt) are defined as above and, for the edge case of t = 1, we have: p(f 1 | x0) = N (f 1; mf (x0), κf (x0, x0; θ)). Furthermore, we recognize each conditional distribution p(f t | f 1:t−1, x0:t−1) in Eq. (4) as the GP prediction at a single point xt−1 using noiseless In order to make the GPSSM inherently scalable, similarly to the standard supervised regression setting with GPs de- scribed in § 2, we augment the full GPSSM model with M inducing variables and corresponding inducing inputs u := {ui}M i=1. This gives rise to the i=1 and Z := {zi}M 3 Free-Form Variational Inference for Gaussian Process State-Space Models sparse GPSSM model: p(y1:T , x0:T , f 1:T , u | Z) = p(u | Z)p(x0) T (cid:89) t=1 p(f t | f 1:t−1, x0:t−1, u, Z)p(xt | f t)p(yt | xt), (9) where the prior over the inducing variables is determined by the GP prior, i.e., p(u | Z) = N (mZ, KZ) with mZ := mf (Z) and KZ := κf (Z, Z; θ). Besides having a prior over the inducing variables u, the main difference with our previous full-model formulation of § 3.1 is that the conditional distributions over f t have been augmented with inducing variables u and corresponding inducing in- puts Z. Each conditional, p(f t | f 1:t−1, x0:t−1, u, Z) = p(f t | xt−1, f 1:t−1, u, x0:t−2, Z), is the predictive (GP re- gression) distribution of f t at test input xt−1 when observ- ing (f 1:t−1, u) at their respective locations (x0:t−2, Z). 4. Free-Form Variational Inference In this section, we develop a posterior estimation method using variational inference (VI). We show that under a spe- cific form of the approximate posterior, we can estimate the joint posterior over {x0:T , u} in free-form, i.e., optimally, without making any assumptions such as independence be- tween state trajectories and inducing variables, typical of mean-field approaches (Frigola et al., 2014; Eleftheriadis et al., 2017), or constraining the form of the posterior to sub-optimal parametric forms (Ialongo et al., 2019; Doerr et al., 2018). 4.1. Variational Family and Evidence Lower Bound Variational inference is underpinned by the maximization of the evidence lower bound (ELBO), which is equivalent to minimizing the Kullback-Leibler (KL) divergence be- tween the approximate posterior and the true posterior. This objective is given by LELBO(q) := Eq(x0:T ,u,f 1:T ) [log p(y1:T , x0:T , f 1:T , u | Z) (10) − log q(x0:T , u, f 1:T )] , where p(y1:T , x0:T , f 1:T , u | Z) is the joint distribution in Eq. (9) and q(x0:T , u, f 1:T ) is our proposed approximate joint posterior, which we define as q(f 1:T | x0:T , u) := T (cid:89) t=1 p(f t | f 1:t−1, x0:t−1, u, Z), (11) q(x0:T , u, f 1:T ) := q(x0:T , u)q(f 1:T | x0:T , u). (12) It is easy to show that the ELBO, as defined in Eq. (10), is a lower bound on the log marginal likelihood, i.e., LELBO(q) ≤ log p(y | Z). We see that our joint variational posterior over state trajectories x0:T , inducing variables u and latent function values f 1:T in Eq. (12) uses the condi- tional prior over the latent function values in Eq. (11). This is, of course, an assumption and limits the flexibility of our approximate posterior. However, all previous scalable varia- tional approaches to GPSSMs, such as VGPSSM, IGPSSM, PRSSM and VCDT, have made the very same assumption. Indeed, these types of approximations where the conditional prior is used to define the join variational posterior have become customary and necessary to avoid the cubic time complexity of inference in GP models. See § 8 for further discussion on the limitations of our approach. Nevertheless, our proposed joint variational distribution in Eq. (12), will allow us to derive an optimal variational distribution q(x0:T , u) in free-form, without imposing any parametric constraints over it and, instead, represent it via samples. We will describe this in the next section. 4.2. Evidence Lower Bound Maximization Our first step is to expand the expression for the ELBO in Eq. (10) using our joint model distribution in Eq. (9) and our proposed variational distribution in Eqs. (11) and (12). We first note that our definition of the variational distribution in Eq. (12) uses the same conditional prior as in the joint distribution in Eq. (9). Therefore, this term cancels out, avoiding the computation of operations on fully-coupled high-dimensional distributions over latent functions. Thus, we have that: (cid:90) LELBO(q) = (cid:40) q(x0:T , u) − log q(x0:T , u) (cid:104) + log p(x0)p(u | Z) (cid:105) p(yt | xt) T (cid:89) t=1 + Eq(f 1:T | x0:T ,u) (cid:41) (cid:105) p(xt | f t) (cid:104) log T (cid:89) t=1 dx0:T du. (13) Next we aim to maximize the ELBO functional above with respect to q(x0:T −1, u) subject to the constraint (cid:82) q(x0:T −1, u) dx0:T −1du = 1. We can do this by solving the corresponding Euler-Lagrange equation: (cid:40) ∂ ∂q(x0:T , u) − q(x0:T , u) log q(x0:T , u) + q(x0:T , u) log (cid:104) p(x0)p(u | Z) + q(x0:T , u)Eq(f 1:T | x0:T ,u) (cid:104) log T (cid:89) t=1 (cid:105) p(yt | xt) T (cid:89) t=1 (cid:41) (cid:105) p(xt | f t) = 0. (14) 4 Free-Form Variational Inference for Gaussian Process State-Space Models By doing the corresponding derivatives we obtain −log q(x0:T , u)−1+log (cid:104) p(x0)p(u | Z) (cid:105) p(yt | xt) T (cid:89) t=1 + Eq(f 1:T | x0:T ,u) (cid:104) log T (cid:89) t=1 (cid:105) p(xt | f t) = 0. (15) Now the expectation above can be solved in closed form: Eq(f 1:T | x0:T ,u) (cid:104) log T (cid:89) t=1 (cid:105) p(xt | f t) T (cid:88) = Ep(f t | xt−1,u,Z) log p(xt | f t) t=1 T (cid:88) (cid:20) t=1 = log N (xt; uxt, Q) − (cid:21) Tr(Q−1Bt−1) , (16) 1 2 where p(f t | xt−1, u, Z) is the GP predictive distribution over the function values f t at locations xt−1 given the in- ducing variables u at inducing inputs Z, i.e., p(f t | xt−1, u, Z) = N (f t; μxt, Bt−1), μxt := mt−1 + At−1(u − mZ). Here we have defined At−1 := Kt−1,ZK−1 Z , Bt−1 := Kt−1 − Kt−1,ZK−1 Z KZ,t−1, (17) (18) (19) (20) and the cross-covariance term Kt−1,Z := κf (xt−1, Z; θ) and similarly for KZ,t−1. Finally, Tr(*) is the trace operator and, as defined at the beginning of § 3, Q is the transition noise covariance. 4.2.1. OPTIMAL VARIATIONAL POSTERIOR With this, we obtain the form of the optimal variational distribution q∗(u, x0:T ) up to a normalizing constant Zq as: log q∗(u, x0:T ) = log p(u | Z) + log p(x0) T (cid:88) (cid:104) + t=1 log p(yt | xt) + log N (xt; μxt, Q) − 1 2 (cid:105) Tr(Q−1Bt−1) + log Zq. (21) Here we note that the function values f 1:T have, effectively, been marginalized variationally. The optimal joint posterior over inducing variables and state trajectories depends on the prior over the inducing variables p(u | Z) stemming from the GP functional prior, the prior over the initial state p(x0) and the conditional likelihood terms p(yt | xt). It also depends on the resulting transitions mapping xt−1 to xt via the densities N (xt; μxt, Q), where μxt depends on xt−1 in a nonlinear way, as specified by Eq. (19). The final trace term, Tr(Q−1Bt−1), can be seen as a regularization term acting on state transitions, encouraging higher transition variances and, therefore, helping prevent overfitting. 4.2.2. ALTERNATIVE PERSPECTIVE An alternative way to obtain the optimal joint posterior over state trajectories and inducing variable is by bounding the true log joint marginal log p(y1:T , x0:T , u | Z) using Jensen's inequality. We give the details in Appendix E. This has been used by previous work in standard regression settings (see, e.g., Rossi et al., 2021, and references therein). However, our setting considers the more complex case of GPSSMs. Additionally, our development shows much more clearly the optimal nature of the variational posterior, as we have obtained it via calculus of variations. 4.3. Posterior Sampling Having the form of the optimal posterior in Eq. (21), we can then set the latent variables Ψ := {u, x0:T } and have ̃q(Ψ) ∝ q(Ψ) ≈ p(Ψ | y1:T ). Thus, we can draw samples from our approximate posterior using stochas- tic gradient Hamiltonian Monte Carlo (SGHMC; Chen et al., 2014; Havasi et al., 2018) and the energy func- tion U (Ψ) = − log p(Ψ, y1:T ) = − log p(Ψ | y1:T ) + log Zq ≈ − log ̃q(Ψ) + log Zq. Using this procedure, sam- ples from the target distribution can be obtained even with noisy gradients (e.g., with mini-batches) without requiring the evaluation of Metropolis ratios. Importantly, other vari- ables such as GP hyper-parameters θ and inducing locations Z can be easily included in Ψ using suitable priors and incorporating them in our objective in Eq. (21). 4.3.1. COMPUTATIONAL COST & PRIOR WHITENING An interesting aspect of GPSSM models is that, despite their apparent Markovian nature, sampling at time T re- quires conditioning on all the previous T − 1 points. This is due to the non-parametric coupled GP prior over the tran- sition function, making inference in the full model O(T 3) in time. Sparse variational inference approaches, such as those based on inducing variable approximations, still re- quire expectations over entire trajectories and, unlike stan- dard supervised i.i.d settings, their time complexity is inher- ently dependent on T . Evaluation of the stochastic gradient Hamiltonian Monte Carlo (SGHMC) objective in Eq. (21) for sampling in our free-form variational dynamics (FFVD) algorithm is O(M 2T ). this is the same cost as that attained for ELBO evaluation in variationally coupled dynamic trajec- tories (VCDT), which like our FFVD, models dependencies between state trajectories and inducing variables. Here we expand on the details of the computational cost 5 Free-Form Variational Inference for Gaussian Process State-Space Models of our approach when compared to VCDT. Our SGHMC objective in Eq. (21) is very similar to the ELBO used in VCDT. The ELBO in VCDT requires expectations over q(u) and q(xt, xt−1|u). Given the factorization assumptions and the Gaussian constraints on these distributions, these ex- pectations are estimated straightforwardly via Monte Carlo samples. The time complexity of evaluating Eq. (21) or the ELBO in VCDT once (using one sample) is the same, i.e., O(M 3 + M 2T ). The overall time complexity of both algorithms, FFVD and VCDT, depends on (i) the number of samples (noting, again, that VCDT also requires samples from the approximate posterior to estimate the gradients of the ELBO) and (ii) the number of iterations (either the length of the SGHMC chain in FFVD or the number of epochs for gradient-based optimization in VCDT). As described in Appendix I, our experimental setting followed closely that of the original VCDT paper, which used S = 100 samples for training and S = 105 for predictions. Similarly, we used S = 100 samples for FFVD. Remarkably, the number of iterations in our experiments for FFVD was 50, 000 while for VCDT was 200, 000 to achieve convergence. Furthermore, our analysis in Appendix J shows that, in fact, our FFVD algorithm converges in less than 10,000 iterations. As in previous work (see, e.g., Hensman et al., 2015), we have observed that whitening the prior over the inducing variables improves the performance of our algorithm. See details of our whitening procedure and the resulting unnor- malized log posterior in Appendices D and E.1. 4.4. Smoothing and Predictive Distributions We are interested in estimating the smoothing dis- tribution p(x0:T | y1:T ) and the predictive distribution p(yT +1:T ′ | y1:T ) for T ′ ≥ T . At the end of our SGHMC procedure, we have S samples from our joint approximate posterior q(x0:T , u) ≈ p(x0:T | y1:T ), i.e., {x(s) s=1 and, therefore, the smoothing distribution (i.e., the marginal posterior over x0:T ) is readily available through this Monte Carlo approximation. 0:T , u(s)}S We can also make one-step-ahead predictions using our posterior samples. In particular, using Eqs. (2) and (17) we have that: p(xt | xt−1, u, Z) = N (xt; mt−1 + At−1(u − mZ), Bt−1 + Q), (22) ∀t > T . Thus, replacing the values of At−1, Bt−1 using Eqs. (19) and (20) we can make predictions for the next 6 state using samples as x(s) t t−1, u(s) ∼ N (xt; μ(s) | x(s) t = m(s) μ(s) t = K(s) Σ(s) t−1 + K(s) t−1 − K(s) t−1,ZK−1 t−1,ZK−1 , Σ(s) t ) with Z (u(s) − mZ), Z K(s) Z,t−1 + Q. t (23) | x(s) For a general likelihood model, we can sample the (noisy) targets using y(s) t ∼ p(yt | x(s) , φ). In the case of a Gaussian conditional likelihood, as described in § 3, we can see that given samples from the latent state, the predictive distribution is a Gaussian t t y(s) t | x(s) t−1, u(s) ∼ N (yt; Cμ(s) t + d, CΣ(s) t C⊤ + R). (24) where the samples of {x(s) running SGHMC on their joint space. T , u(s)} are readily available after 5. Collapsing Inducing Variables So far we have described our method to obtain samples from the optimal variational posterior over the joint distribution of state trajectories and inducing variables using Eq. (21) and SGHMC. In this section we show that we can, in fact, inte- grate out the inducing variables u from our joint variational distribution and obtain the optimal marginal distribution for latent states x0:T . We start by retaking Eq. (21) and isolating the terms that depend on the inducing variables, (cid:90) q∗(x0:T ) = q∗(u, x0:T )du = p(x0) T (cid:89) u (cid:20) p(yt | xt) exp(− t=1 Tr(Q−1Bt−1)) (cid:21) 1 2 (cid:90) u p(u | Z) T (cid:89) t=1 N (xt; μxt, Q)du, (25) where we note that μxt, as defined as in Eq. (18), depends on the inducing variables u. With this, we can complete the square and identify the terms in the integral as products of Gaussian distributions, whose normalization constant is a Gaussian. Therefore, we have q∗(x0:T ) = p(x0) (cid:89) (cid:104) p(yt|xt) exp(− t 1 2 Tr(Q−1Bt−1)) N (xt; mt−1, Q) (cid:105) /N ( ̃x; 0, ̃Σx), (26) Free-Form Variational Inference for Gaussian Process State-Space Models where the Gaussian in the denominator is determined by 5.2. Particle Markov chain Monte Carlo (PMCMC) ̃x = T (cid:88) t=1 ̃Σx = I + ̃A ⊤ t−1Q−1(xt − mt−1), T (cid:88) t=1 ̃A ⊤ t−1Q−1 ̃At−1, ̃At−1 = Kt−1,Z(L⊤ Z )−1, (27) (28) (29) where LZ is the Cholesky decomposition of KZ, i.e., KZ = LZL⊤ Z . We note here that ̃x is actually a projection of the cumulative uncorrelated inputs Q−1(xt − mt−1) via the projection matrix L−1 Z KZ,t−1 and, therefore, ̃x ∈ RM . Furthermore, in this collapsed version, the terms unrelated to u are kept the same as those in the original optimal joint distribution in Eq. (21). The individual Gaussian transitions for the latent states are now N (xt; mt−1, Q) since u has been integrated out and we recall that mt−1 = mf (xt−1). The additional term, which is the inverse of a multivari- ate Gaussian distribution, records the cumulative projected trajectory with the corresponding projected variances. Max- imizing q∗(x0:T ) would tend to minimize this density func- tion, which pushes the latent states away from 0 and also decreases the values of the Q regulated variance. Our algorithm in this collapsed version runs SGHMC using as energy function Ψ(x0:T ) = − log q(x0:T ) to obtain sam- ples {x(s) 0:T } from the marginal q∗(x0:T ) and then uses the closed-form expression for the conditional (Appendix G) to obtain {u(s)|x(s) 0:T }. 5.1. Advantages of Collapsed Algorithm Collapsing the inducing variables u will generally tend to improve the convergence of our algorithm, as we are re- quired to sample from a significantly lower number of latent variables. The computational cost is similar to that of the uncollapsed algorithm since despite avoiding the computa- Z in p(u | Z), we require a similar term, L−1 tion of K−1 Z , in the evaluation of the projected Gaussian distributions. It is important to emphasize one particular difference in our approach with respect to the closely related VCDT algorithm of Ialongo et al. (2019). As described before, Ialongo et al. (2019) also propose a coupled joint posterior between state trajectories and inducing variables. Their factorization is qVCDT = q(u)q(x0:T | u), and they impose additional Gaus- sian constraints on these densities. Our implicit assumed factorization is qFFVD = q(x0:T )q(u | x0:T ), which allows us to obtain the optimal variational distribution without im- posing any additional parametric constraints, integrate out the inducing variables analytically and get a Monte Carlo approximation to the optimal marginal q(x0:T ) via samples. We also provide an expression for the conditional q(u | x0:T ) in closed-form. Details can be found in Appendix G. It is clear that the latent states are constructed in a Markovian manner when the transition function f (*) is given, as the value of the current latent state is dependent on the previous latent state's value. Therefore, we can use PMCMC methods (Andrieu et al., 2010) to infer the posterior distribution of the Markov structured latent states x0:T . This Bayesian treatment might improve performance over SGHMC, as it incorporates the sequential nature of the problem into the sampling algorithm. The advantages of PMCMC over stan- dard sequential Monte Carlo approaches have been docu- mented previously, see. e.g., Andrieu et al. (2010). Here we note that Frigola et al. (2013) also proposed a PMCMC treat- ment for x0:T . However, their algorithm is very different from ours as it is based on the fully-independent conditional approximation (see, e.g., Quinonero-Candela & Rasmussen, 2005). More details can be found in Appendix K. 6. Related Work We have already described the main differences between our method and closely-related approaches throughout the pa- per, e.g., in §§ 1, 4 and 5. We refer the reader to Appendix K for more details. Other works have considered the GPSSM in partially observable unstable settings (Curi et al., 2020), combined variational inference with the Laplace approxima- tion (Lindinger et al., 2022) or used sample-based inference with a reduced rank approximation (Svensson et al., 2016). With regards to scalable GPs, we note they have been the subject of much research effort in machine learning, with extensions to more general frameworks such as composi- tional models (see, e.g., Wilson & Nickisch, 2015; Salim- beni & Deisenroth, 2017; Yu et al., 2019; Cutajar et al., 2017; Havasi et al., 2018; Rossi et al., 2021; Duncker et al., 2019; Heinonen et al., 2018; Hegde et al., 2022; Auzina et al., 2022; Bui, 2018). Our approach can be seen as a gen- eralization of the fully-Bayesian supervised learning method proposed by Rossi et al. (2021) to state-space models, where we have included the non-trivial component of GP-transition dynamics and have proposed a collapsed optimal variational distribution for state trajectories. Other models for GPs on sequential data have been pro- posed, see, for example, Frigola (2015) for an excellent overview. Of interest here is the state-space model view of GPs that for time-series data with dx = 1 and Marko- vian covariance functions can provide exact inference in linear time O(T ) (Solin, 2016). This has been extended to non-Gaussian likelihood models and made more efficient us- ing several computational primitives (Nickisch et al., 2018). More recently, there has been some work on using the sig- nature kernel (Toth & Oberhauser, 2020; Salvi et al., 2021) within GP models. In particular, Lemercier et al. (2021) generalize variational orthogonal features (Burt et al., 2020; 7 Free-Form Variational Inference for Gaussian Process State-Space Models Figure 1. Results on synthetic data. Left: Observations shown as green dots, Ground truth as a solid black line, and FFVD's mean fitting as a dashed red line with one standard deviation error bars. Right: Histograms of p-values for the hypothesis test that each marginal posterior over states {xt} (top) and inducing variables {ui} (bottom) is generated from a Normal distribution. Figure 2. Training (t <= 150) and test performance (t >= 150) on the Furnace dataset. The black solid line is the underlying ground truth signal and the dashed red line is FFVD's mean pre- diction. The blue solid line indicates the training/test split. An underlying dx = 4-dimensional latent stated was used. Hensman et al., 2017) to the sequential case, constructing inducing variables associated with the signature kernel that yield a variational inference algorithm that does not require any matrix inversion. 7. Experiments We evaluate our FFVD method on synthetic data and on six real-world system identification benchmarks (Ialongo et al., 2019; Doerr et al., 2018), comparing it with VGPSSM (Frigola et al., 2014), PRSSM (Doerr et al., 2018), VCDT (Ialongo et al., 2019), and use a LSTM network (Hochreiter & Schmidhuber, 1997) as a baseline non-GP based model. All experiment details can be found in Appendix I. 7.1. Synthetic Data Figure 3. Traceplot of the training log-likelihood when using SGHMC (FFVD-M) and when collapsing the inducing variables FFVD-C-M. Collapsing generally improved convergence. gions containing latent states. As the number of latent states increases, FFVD more accurately approximates the true function. A lack of fit in regions without latent states is to be expected. Having a good fit, we are now interested in knowing whether the true posterior (as estimated by our algorithm) is close to a Gaussian distribution. The right panel in Fig. 1 indicates that more than 10% of the latent states x0:T and more than 50% of the inducing variables u do not provide enough support for the hypothesis that their marginal distributions follow a Normal distribution (see Appendix I). This brings into question the parametric assumptions over the variational posterior made by previous work (e.g., Ialongo et al., 2019; Doerr et al., 2018). 7.2. Real-World Data Here we evaluate the different methods using six system identification benchmarks with a latent state dimension dx = 4, as used by Ialongo et al. (2019); Doerr et al. (2018). See more details in Appendix I. Predictive performance: The test performance is shown in Table 2 and Table 3, where we see that FFVD attains the best NMLL values in three out of the six benchmarks and obtains lowest RMSE values in four out of the six benchmarks (in bold). Furthermore, for Actuator and Dryer, FFVD-C-M ranks second among all the algorithms (underlined). The performance of VGPSSM and PRSSM is usually worse than others, which is likely due to their strong mean-field and parametric assumptions, respectively. LSTM obtains good performance on three datasets, although its deterministic structure is different from our random function setting. The performance of VCDT is the closest to our FFVD methods, as it models a coupled q(x0:T , u). We generate data from a sparse GPSSM with a squared expo- nential covariance function. Our goal here is to investigate the properties of our FFVD algorithm. Therefore, we fix the value of all parameters to their ground-truth values except for the latent states x0:T and the inducing variables u. The left panel of Fig. 1 illustrates that FFVD effectively learns the intricate transition function with two modes within re- Qualitative analysis: In addition to this quantitative eval- uation, we can see a qualitative illustration of using our algorithm for predicting the training and test (future) obser- vations in Fig. 2. This is an example of good generalization, although it is (of course) not consistent across all problems, given the limited training data. Finally, we analyze the con- vergence of our algorithm in Fig. 3, where we see that FFVD- 8 202x420f(x)0100.00.20.40.60.81.0p-value0510050100150200250300t21012y01000020000300004000050000Iterations05101520253035Marginal log-likelihoodFFVD-MFFVD-C-M Free-Form Variational Inference for Gaussian Process State-Space Models Table 2. Test root mean square error (RMSE) values ± one standard deviations on the real-world system identification benchmarks. Our method, FFVD, when using SGHMC (FFVD-M); the collapsed version (FFVD-C-M); and when using PMCMC (FFVD-P). Methods LSTM VGPSSM PRSSM VCDT Actuator Ballbeam Drive Dryer Flutter Furnace 0.586 ± 0.411 0.027 ± 0.023 0.537 ± 0.108 0.115 ± 0.029 0.912 ± 0.562 1.261 ± 0.610 0.580 ± 0.274 0.497 ± 0.381 0.239 ± 0.040 0.073 ± 0.011 0.059 ± 0.013 0.011 ± 0.002 0.722 ± 0.087 0.813 ± 0.101 0.585 ± 0.017 0.241 ± 0.023 0.017 ± 0.042 0.142 ± 0.003 1.482 ± 0.218 1.371 ± 0.156 1.782 ± 0.324 1.115 ± 0.358 1.243 ± 0.407 1.166 ± 0.011 FFVD-M 0.358 ± 0.242 FFVD-C-M 0.259 ± 0.209 FFVD-P 0.388 ± 0.087 0.019 ± 0.018 0.009 ± 0.011 0.199 ± 0.045 0.673 ± 0.207 0.775 ± 1.615 0.342 ± 0.057 0.205 ± 0.313 0.065 ± 0.112 0.317 ± 0.050 0.280 ± 0.193 0.663 ± 0.189 0.562 ± 0.088 0.571 ± 0.185 0.548 ± 0.051 0.669 ± 0.174 Table 3. Test negative mean log likelihood (NMLL) values ± one standard deviation on the real-world system identification benchmarks. Methods as in Table 2. Methods Ballbeam Actuator Furnace Flutter Dryer Drive 1.09 ± 0.11 0.29 ± 0.17 VGPSSM PRSSM VCDT FFVD-M −0.03 ± 0.10 0.92 ± 0.07 0.40 ± 0.09 0.09 ± 0.05 −0.60 ± 0.07 −1.14 ± 0.13 1.23 ± 0.01 1.66 ± 0.01 0.46 ± 0.09 0.52 ± 0.07 −0.02 ± 0.01 −0.08 ± 0.09 2.38 ± 0.21 0.51 ± 0.11 6.13 ± 0.48 0.48 ± 0.33 −0.43 ± 0.05 2.40 ± 0.27 3.46 ± 0.31 7.49 ± 0.07 −0.36 ± 0.02 −0.65 ± 0.01 Table 4. Mean training running times in seconds (T) and mean RMSE (R) as a function of the number of iterations on Furnace. Iterations VGPSSM PRSSM VCDT FFVD-M 10 0.71 1.58 17.44 1.64 26.96 1.39 3.19 1.50 100 5.84 1.49 205.91 1.60 269.71 1.44 26.33 1.44 500 27.96 1.37 1 128.02 1.41 1 613.25 1.33 121.42 0.74 1 000 53.25 1.35 2 137.59 1.40 3 374.78 1.25 238.68 0.75 T R T R T R T R C-M uses less iterations (∼ 8 000 iterations) than FFVD-M (∼ 40 000 iterations) to achieve similar performance. This confirms the benefits of collapsing the inducing variables and sampling only on the lower-dimensional space of state trajectories. We can see these analyses for all benchmarks in Appendices J.1 and J.2. Running times: We illustrate the advantages of our ap- proach when considering running time as a function of the number of iterations in Table 4. We can clearly see that our approach is around 10 times faster than PRSSM/VCDT and obtains the best RMSE values after 100 iterations. VGPSSM runs fastest at the expense of higher prediction errors. These time results were done using a Macbook Pro 2021 with 16GB in memory, M1 chip, and 8 cores. It is noted that caution must be taken with interpreting these results, as they 9 depend on implementation specifics, computer architectures along with other practical details. 8. Conclusions, Limitations and Future Work We have presented FFVD, a new variational inference al- gorithm for GPSSMs. Unlike previous approaches, FFVD does not make any independence or parametric assumptions on the joint variational posterior over state trajectories and inducing variables q(x0:T , u) and, instead, represents the posterior via samples from the "optimal" variational dis- tribution. However, as described in § 4.1, despite having a free-form posterior over state trajectories and inducing variables, our approach is still an approximation in that it assumes the conditional posterior over the latent functions to be the same as the conditional prior. This is a customary and necessary (albeit questionable) assumption in scalable variational methods for general GP models. Our method also assumes independent GPs over the state dimensions. However, one can expect the dynamics to be correlated across dimensions, bringing a need for the so- called multi-output/multi-task GPs. This has been a fairly extensive area of research and we believe a weight-space view of such models could be suitable, where dimensions are correlated through a weight matrix. Approximate infer- ence algorithms in this setting can be developed in O(dx), where dx is the state dimensionality, or even independent of dx (see, e.g., Aglietti et al., 2019, in the context of Cox process models). As we would like to scale up to very high-dimensional spaces, we leave this to future work. Free-Form Variational Inference for Gaussian Process State-Space Models References Aglietti, V., Damoulas, T., and Bonilla, E. V. Efficient inference in multi-task Cox process models. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 537–546. PMLR, 2019. Andrieu, C., Doucet, A., and Holenstein, R. Particle Markov chain Monte Carlo methods. Journal of the Royal Statis- tical Society: Series B (Statistical Methodology), 72(3): 269–342, 2010. Auzina, I. A., Yildiz, C., and Gavves, E. Latent GP-ODEs with informative priors. In A causal view on dynamical systems, NeurIPS 2022 workshop, 2022. Bauer, M., van der Wilk, M., and Rasmussen, C. E. Under- standing probabilistic sparse Gaussian process approx- imations. Advances in neural information processing systems, 29, 2016. Brown, E. N., Frank, L. M., Tang, D., Quirk, M. C., and Wilson, M. A. A statistical paradigm for neural spike train decoding applied to position prediction from ensemble firing patterns of rat hippocampal place cells. Journal of Neuroscience, 18(18):7411–7425, 1998. Doerr, A., Daniel, C., Schiegg, M., Duy, N.-T., Schaal, S., Toussaint, M., and Sebastian, T. Probabilistic recurrent state-space models. In ICML, pp. 1280–1289, 2018. Duncker, L., Bohner, G., Boussard, J., and Sahani, M. Learning interpretable continuous-time models of latent In Proceedings of the stochastic dynamical systems. 36th International Conference on Machine Learning, pp. 1726–1734, 2019. Eleftheriadis, S., Nicholson, T., Deisenroth, M., and Hens- man, J. Identification of Gaussian process state space models. Advances in neural information processing sys- tems, 30, 2017. Frigola, R. Bayesian time series learning with Gaussian processes. PhD thesis, University of Cambridge, 2015. Frigola, R., Lindsten, F., Sch ̈on, T. B., and Rasmussen, C. E. Bayesian inference and learning in Gaussian process state-space models with particle MCMC. In NIPS, pp. 3156–3164, 2013. Frigola, R., Chen, Y., and Rasmussen, C. E. Variational Gaussian process state-space models. In NIPS, pp. 3680– 3688, 2014. Bui, T. D. Efficient Deterministic Approximate Bayesian Inference for Gaussian Process models. PhD thesis, Uni- versity of Cambridge, 2018. Havasi, M., Hern ́andez-Lobato, J. M., and Murillo-Fuentes, J. J. Inference in deep Gaussian processes using stochastic gradient Hamiltonian Monte Carlo. NeurIPS, 31, 2018. Burt, D. R., Rasmussen, C. E., and van der Wilk, M. Variational orthogonal features. arXiv preprint arXiv:2006.13170, 2020. Chen, T., Fox, E., and Guestrin, C. Stochastic gradient In ICML, pp. 1683–1691. Hamiltonian Monte Carlo. PMLR, 2014. Curi, S., Melchior, S., Berkenkamp, F., and Krause, A. Structured variational inference in partially observable unstable Gaussian process state space models. In Bayen, A. M., Jadbabaie, A., Pappas, G., Parrilo, P. A., Recht, B., Tomlin, C., and Zeilinger, M. (eds.), Proceedings of the 2nd Conference on Learning for Dynamics and Control, volume 120 of Proceedings of Machine Learning Research, pp. 147–157. PMLR, 10–11 Jun 2020. Cutajar, K., Bonilla, E. V., Michiardi, P., and Filippone, M. Random feature expansions for deep Gaussian processes. In Precup, D. and Teh, Y. W. (eds.), Proceedings of the 34th International Conference on Machine Learning, vol- ume 70 of Proceedings of Machine Learning Research, pp. 884–893. PMLR, 06–11 Aug 2017. Hegde, P., Yıldız, c., L ̈ahdesm ̈aki, H., Kaski, S., and Heinonen, M. Variational multiple shooting for Bayesian ODEs with Gaussian processes. In Proceedings of the Thirty-Eighth Conference on Uncertainty in Artificial In- telligence, pp. 790–799, 2022. Heinonen, M., Yildiz, C., Mannerstr ̈om, H., Intosalmi, J., and L ̈ahdesm ̈aki, H. Learning unknown ODE models In Proceedings of the 35th with Gaussian processes. International Conference on Machine Learning, pp. 1959– 1968, 2018. Hensman, J., Fusi, N., and Lawrence, N. D. Gaussian processes for big data. In Uncertainty in Artificial Intelli- gence. AUAI Press, 2013. Hensman, J., Matthews, A. G., Filippone, M., and Ghahra- mani, Z. MCMC for variationally sparse Gaussian pro- cesses. In NIPS, pp. 1648–1656, 2015. Hensman, J., Durrande, N., Solin, A., et al. Variational Fourier features for Gaussian processes. J. Mach. Learn. Res., 18(1):5537–5588, 2017. D'agostino, R. and Pearson, E. S. Tests for departure from Hochreiter, S. and Schmidhuber, J. Long short-term memory. normality. Biometrika, 60(3):613–622, 1973. Neural computation, 9(8):1735–1780, 1997. 10 Free-Form Variational Inference for Gaussian Process State-Space Models Ialongo, A. D., Van Der Wilk, M., Hensman, J., and Ras- mussen, C. E. Overcoming mean-field approximations in recurrent Gaussian process models. In ICML, pp. 2931– 2940, 2019. I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 30. Cur- ran Associates, Inc., 2017. Kalman, R. E. A New Approach to Linear Filtering and Prediction Problems. Journal of Basic Engineering, 82 (1):35–45, 1960. doi: 10.1115/1.3662552. Katzfuss, M., Stroud, J. R., and Wikle, C. K. Understand- ing the Ensemble Kalman Filter. The American Statisti- cian, 70(4):350–357, 2016. doi: 10.1080/00031305.2016. 1141709. Kitagawa, G. Non-Gaussian state-space modeling of non- stationary time series. Journal of the American statistical association, 82(400):1032–1041, 1987. Lemercier, M., Salvi, C., Cass, T., Bonilla, E. V., Damoulas, T., and Lyons, T. J. SigGPDE: Scaling sparse Gaussian processes on sequential data. In International Conference on Machine Learning, pp. 6233–6242. PMLR, 2021. Lindinger, J., Rakitsch, B., and Lippert, C. Laplace ap- proximated Gaussian process state-space models. In The 38th Conference on Uncertainty in Artificial Intelligence, 2022. Marmin, S. and Filippone, M. Deep gaussian processes for calibration of computer models (with discussion). Bayesian Analysis, 17(4):1301–1350, 2022. Murphy, K. P. Probabilistic Machine Learning: Advanced Topics. MIT Press, 2023. URL http://probml. github.io/book2. Nickisch, H., Solin, A., and Grigorevskiy, A. State space Gaussian processes with non-Gaussian likelihood. In Dy, J. and Krause, A. (eds.), Proceedings of the 35th Inter- national Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 3789– 3798. PMLR, 10–15 Jul 2018. Ogata, K. et al. Modern control engineering, volume 5. Prentice hall Upper Saddle River, NJ, 2010. Quinonero-Candela, J. and Rasmussen, C. E. A unify- ing view of sparse approximate Gaussian process regres- sion. The Journal of Machine Learning Research, 6: 1939–1959, 2005. Rossi, S., Heinonen, M., Bonilla, E., Shen, Z., and Filip- pone, M. Sparse Gaussian processes revisited: Bayesian approaches to inducing-variable approximations. In AIS- TATS, pp. 1837–1845, 2021. Salimbeni, H. and Deisenroth, M. Doubly stochastic varia- tional inference for deep Gaussian processes. In Guyon, Salvi, C., Cass, T., Foster, J., Lyons, T., and Yang, W. The signature kernel is the solution of a Goursat PDE. SIAM Journal on Mathematics of Data Science, 3(3):873–899, 2021. Sauer, A., Cooper, A., and Gramacy, R. B. Vecchia- approximated deep Gaussian processes for computer ex- periments. Journal of Computational and Graphical Statistics, 0(0):1–14, 2022. Solin, A. Stochastic differential equation methods for spatio- temporal Gaussian process regression. PhD thesis, Aalto University, 2016. Svensson, A., Solin, A., S ̈arkk ̈a, S., and Sch ̈on, T. Compu- tationally efficient Bayesian learning of Gaussian process state space models. In Proceedings of the 19th Interna- tional Conference on Artificial Intelligence and Statistics, pp. 213–221, 2016. Titsias, M. Variational learning of inducing variables in sparse Gaussian processes. In AISTATS, pp. 567–574, 2009. Toth, C. and Oberhauser, H. Bayesian learning from se- quential data using Gaussian processes with signature covariances. In International Conference on Machine Learning, pp. 9548–9560. PMLR, 2020. Tsay, R. S. Analysis of financial time series. John wiley & sons, 2005. Williams, C. K. and Rasmussen, C. E. Gaussian processes for machine learning. MIT press Cambridge, MA, 2006. Wilson, A. and Nickisch, H. Kernel interpolation for scal- able structured Gaussian processes (KISS-GP). In Bach, F. and Blei, D. (eds.), Proceedings of the 32nd Interna- tional Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 1775– 1784, Lille, France, 07–09 Jul 2015. PMLR. Wilson, J. T., Borovitskiy, V., Terenin, A., Mostowsky, P., and Deisenroth, M. P. Efficiently sampling functions from Gaussian process posteriors. 37th International Confer- ence on Machine Learning, ICML 2020, PartF16814: 10223–10233, 2020. Yu, H., Chen, Y., Low, B. K. H., Jaillet, P., and Dai, Z. Im- plicit Posterior Variational Inference for Deep Gaussian Processes. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alch ́e Buc, F., Fox, E., and Garnett, R. (eds.), Ad- vances in Neural Information Processing Systems 32, pp. 14475–14486. Curran Associates, Inc., 2019. 11 Free-Form Variational Inference for Gaussian Process State-Space Models A. Basic Results on Gaussian Distributions A.1. Conditional Gaussian Distribution Assuming the joint Gaussian distribution p(x) = N (x; μ, Σ) over the random vector x such that: x = (cid:21) (cid:20)xa xb , μ = (cid:21) (cid:20)μa μb , Σ = (cid:20)Σaa Σab Σba Σbb, (cid:21) where Σba = ΣT ab, we have that the conditional distributions are given by: p(xb | xa) = N (xb; μb + ΣbaΣ−1 aa (xa − μa), Σbb − ΣbaΣ−1 aa Σab). A.2. Expectation over log of Normal Distribution With an approximate marginal posterior q(f ⋆) and a Normal distribution p(y | f ⋆) of the form: q(f ⋆) = N (f ⋆; μ⋆, Σ⋆), p(y | f ⋆) = N (y; f ⋆, Σy), we can compute Eq(f ⋆) log p(y | f ⋆) = log N (y; μ⋆, Σy) + Tr(Σ−1 y Σ⋆). (30) (31) (32) (33) (34) B. Posterior Marginal in Sparse GP Models In variational sparse GP models we usually have the joint Gaussian model p(f ⋆, u) and a posterior distribution over q(u) with p(f ⋆) = N (m⋆, K⋆), p(u) = N (u; mZ, KZ), Cov(f ⋆, u) = K⋆,Z, q(u) = N (u; μu, Σu), q(f ⋆, u) := q(u)p(f ⋆ | u), (cid:90) q(f ⋆) = q(f ⋆, u) du, (35) (36) (37) (38) (39) (40) and we wish to compute: where we have omitted conditional dependencies on x⋆ and Z for simplicity in the notation. For example this is necessary to compute the expectations over the conditional log likelihood term during inferencce or to make predictions on a new test point. Using Eq. (31) we obtain: p(f ⋆ | u) = N (f ⋆; m⋆ + K⋆,ZK−1 Z (u − mZ), K⋆ − K⋆,ZK−1 Z KZ,⋆). (41) In order to integrate out over q(u) we know that the result is a Gaussian with mean and covariances obtained from the following linear transformation of u: f ⋆ = m⋆ + K⋆,ZK−1 Z (u − mZ) + ε, ε ∼ N (0, K⋆ − K⋆,ZK−1 Z KZ,⋆). Thus, we obtain: q(f ⋆) = N (cid:0)f ⋆; m⋆ + K⋆,ZK−1 = N (cid:0)f ⋆; m⋆ + K⋆,ZK−1 Z (μμ − mZ), K⋆,ZK−1 Z (μμ − mZ), K⋆ + K⋆,ZK−1 Z ΣuK−1 Z KZ,⋆ + K⋆ − K⋆,ZK−1 Z KZ,⋆ (cid:1) . Z (Σu − KZ) K−1 Z KZ,⋆ (42) (43) (44) (cid:1) C. Graphical Model Fig. 4 illustrates GPSSM's graphical model. 12 Free-Form Variational Inference for Gaussian Process State-Space Models Figure 4. Generative process of the GPSSM (left panel) and the sparse GPSSM (right panel). D. Details of Prior Reparameterization: Whitening Prior over Inducing Variables Here we show a more detailed derivation of the prior reparameterization and, consequently, the new form of the required conditional distribution. We know that our prior over the inducing variables is p(u) = N (u; mZ, KZ) and that we use the new whitened prior v = L−1 Z = KZ and p(v) = N (v; 0, IM ). We also have that the marginal prior over f ⋆ is p(f ⋆) = N (f ⋆; m⋆, K⋆). It follows that p(f , v) is a Gaussian with cross-covariance: Z (u − mZ) with LZLT Cov(f ⋆, v) = E[(f ⋆ − m⋆)(L−1 Z (u − mZ))T ] (L−1 Z )T (cid:124) = E[(f ⋆ − m⋆)(u − mZ)T ] (cid:125) (cid:123)(cid:122) Cov(f ⋆,u) Z )T . = K⋆,Z(L−1 Hence, using Eq. (31), we have that: p(f ⋆ | , x⋆, v, Z) = N (f ⋆; m⋆ + K⋆,Z(L−1 p(f ⋆ | , x⋆, v, Z) = N (f ⋆; m⋆ + K⋆,Z(L−1 Z )T v, K⋆ − K⋆,Z(L−1 Z )T v, K⋆ − K⋆,ZK−1 Z )T L−1 Z KZ,⋆). Z KZ,t), (45) (46) (47) (48) (49) Alternatively, we can simply obtain this result by replacing u with u = mZ + LZv in the conditional distribution. Here we note that this is consistent with the GP definition in that if we were to integrate out the variables v from the joint model p(f ⋆, v) we would obtain the exact GP prior p(f ⋆). D.1. Posterior Marginal With the whitened join model p(f ⋆, v), Gaussian approximate posterior q(v) and a variationally sparse GP model we have: p(f ⋆ | v) = N (f ⋆; m⋆ + K⋆,Z(L−1 Z )T v, K⋆ − K⋆,ZK−1 Z KZ,⋆), q(v) = N (v; μv, Σv), q(f ⋆, v) := q(v)p(f ⋆ | v). It is easy to show that the posterior marginal q(f ⋆) = (cid:82) q(f ⋆, v) dv is: qv(f ⋆) = N (f ⋆; m⋆ + K⋆,Z(L−1 Z )T μv, K⋆ + K⋆,Z(L−1 Z )T (Σv − IM )L−1 Z KZ,⋆). (50) (51) (52) (53) E. Free-Form Posterior Estimation By Bounding the Log Marginal Likelihood Directly Computing the log marginal: log p(y0:T −1, x0:T −1, u | Z) = log p(u | Z)p(x0)p(y0 | x0) (cid:34) (cid:35) p(yt | xt) + L(x0:T −1, u, Z), (54) T −1 (cid:89) t=1 13 f1f2f3x0x1x2x3y1y2y3u,zf1f2f3x0x1x2x3y1y2y3 Free-Form Variational Inference for Gaussian Process State-Space Models where L(x0:T −1, u, Z) := log (cid:34) (cid:90) T −1 (cid:89) f 1:T −1 t=1 p(xt | f t)p(f t | f 1:t−1, x0:t−1, u, Z) df 1:T −1 , (55) (cid:35) which we note is a log of an expectation, which we can bounded using Jensen's inequality: L(x0:T −1, u, Z) ≥ E(cid:81)T −1 t=1 p(f t | f 1:t−1,x0:t−1,u,Z) log T −1 (cid:89) t=1 p(xt | f t) = T −1 (cid:88) t=1 Ep(f t | xt−1,u,Z) log p(xt | f t), (56) (57) where p(f t | xt−1, u, Z) is the GP predictive distribution over f t at xt−1 given the (pseudo observations) inducing variables u at inducing inputs Z: p(f t | xt−1, u, Z) = N (f t; At−1u, Bt−1) with At−1 = Kt−1,ZK−1 Z Bt−1 = Kt−1 − Kt−1,ZK−1 Z KZ,t−1. Hence, the expectations in Eq. (57) can be computed in closed-form: Ep(f t | xt−1,u,Z) log p(xt | f t) = log N (xt; At−1u, Q) − 1 2 Tr(Q−1Bt−1). Thus, we have that: log p(y0:T −1, x0:T −1, u | Z) ≥ log [p(u | Z)p(x0)p(y0 | x0)] + (58) (59) (60) (61) T −1 (cid:88) (cid:20) log p(yt | xt) + log N (xt; At−1u, Q) − t=1 (cid:21) Tr(Q−1Bt−1) . (62) 1 2 Then setting the latent variables Ψ := {u, x0:T −1}, we can obtain the approximate log unnormalized posterior: log ̃q(Ψ) := log p(u | Z) + log p(x0) + log p(y0 | x0) + T −1 (cid:88) (cid:20) log p(yt | xt) + log N (xt; At−1u, Q) − t=1 (cid:21) Tr(Q−1Bt−1) . (63) 1 2 where ̃q(Ψ) ∝ q(Ψ) ≈ p(Ψ | y0:T −1). Thus, we can draw samples from our approximate posterior using SGHMC and the energy function U (Ψ) = − log p(Ψ, y0:T −1) = − log p(Ψ | y0:T −1) + C ≈ − log ̃q(Ψ) + C. E.1. Whitened Version In the whitened version, v = L−1 Z (u − mZ) or u = mZ + LZv and the effective prior is Letting ̃u = (u, Z, θ), ̃v = (v, Z, θ), the determinant of the Jacobian can be calculated as: p(v) = N (v; 0, I). (64) | ∂ ̃u ∂ ̃v | = = (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∂(mZ +LZ v) ∂v ∂Z ∂v ∂θ ∂v ∂(mZ +LZ v) ∂Z ∂Z ∂Z ∂θ ∂Z LZ 0 0 ∂(mZ +LZ v) ∂Z I 0 ∂(mZ +LZ v) ∂θ 0 I (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∂(mZ +LZ v) ∂θ ∂Z ∂θ ∂θ ∂θ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) = LZ 0 0 14 0 I 0 0 0 I (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) = |LZ| = |KZ| 1 2 (65) Free-Form Variational Inference for Gaussian Process State-Space Models Thus, we can re-write the approximate log unnormalized posterior as: log ̃q(v, x0:T −1) = log |KZ| 1 2 − log |KZ| 1 2 − 1 2 v⊤v + log p(x0) + log p(y0 | x0)+ T −1 (cid:88) t=1 (cid:20) log p(yt | xt) + log N (xt; Kt−1,Z(L−1 Z )T v, Q) − (cid:21) Tr(Q−1Bt−1) . 1 2 = log p(v) + log p(x0) + log p(y0 | x0)+ T −1 (cid:88) (cid:20) log p(yt | xt) + log N (xt; Kt−1,Z(L−1 Z )T v, Q) − t=1 F. Collapsed Method We can integrate out u in Eq. (21) to obtain the marginal distribution of x1:T . (cid:21) Tr(Q−1Bt−1) . (66) 1 2 q∗(x1:T ) = (cid:90) u q∗(u, x1:T )du = (cid:90) u p(u | Z)p(x0) T (cid:89) t=1 (cid:20) p(yt | xt) exp(− 1 2 (cid:21) Tr(Q−1Bt−1))N (xt; μxt, Q) du (67) = p(x0) T (cid:89) t=1 (cid:20) p(yt | xt) exp(− 1 2 Tr(Q−1Bt−1)) (cid:21) (cid:90) u p(u) T (cid:89) t=1 N (xt; μxt, Q)du. (68) In the case of using our prior re-parameterization, i.e., whitened inducing variables, v and for multidimensional states and, therefore, multi-output GPs, we can write the integral above for dimension d as: (cid:90) v(d) p(v(d)) T (cid:89) t=1 N (x(d) t ; m(d) t−1 + ̃A (d) t−1v(d), Qd)dv(d) = T (cid:89) t=1 N (x(d) t ; m(d) t−1, Qd) exp (g(d))⊤(H(d))−1g(d) (cid:21) (cid:16) (cid:20) 1 2 det(H(d)) (cid:17) 1 2 where (cid:32) g(d) := I + T (cid:88) t=1 ( ̃A (d) t−1)⊤Q−1 d ( ̃A (d) t−1) (cid:33)−1 (cid:32) (cid:88) t (x(d) t − m(d) t−1)⊤Q−1 d (cid:33)⊤ , ̃A (d) t−1 (cid:32) H(d) = I + T (cid:88) ( ̃A t=1 (d) t−1)⊤Q−1 d ( ̃A (cid:33)−1 (d) t−1) (d) t−1 = K(d) ̃A Z = L(d) K(d) t−1,Z((L(d) Z (L(d) Z )⊤. Z )⊤)−1, (69) (70) (71) (72) Thus, our optimal log variational posterior marginal over state trajectories x0:T is log q∗(x0:T ) = log p(x0) + T (cid:88) t=1 [log p(yt | xt) + log N (xt; mt−1, Q)] − 1 2 dx(cid:88) (cid:34) T (cid:88) d=1 t=1 Tr(Q−1 d B(d) (cid:35) t−1) + log det(H(d))−1 − ( ̃x(d))⊤H(d)( ̃x(d)) , (73) where ̃x(d) := (cid:80)T t=1( ̃A (d) t−1)⊤Q−1 d (x(d) t − m(d) t−1). 15 Free-Form Variational Inference for Gaussian Process State-Space Models Algorithm 1 Particle MCMC for inferring latent states x0:T Require: Number of particles S, observations y1:T , samples of x′ 1:T in the previous iteration, likelihood parameters t = 1 for i = 1, . . . , S. 1:T = x′ 1:T φ = {C, d, R}, Initialize state x0, weights W (i) Fix the last particle as setting x(S) for t = 1, . . . , T do Generate x(i) t Calculate weight W i Normalize the weights as W if t < T then (i) from Eq. (22) for i = 1, . . . , S − 1. t = pφ(yt|x(i) t ) for i = 1, . . . , S t = W (i) t / (cid:80) i W (i) t For i′ = 1, . . . , S − 1, re-sample the index ji′ from the categorical distribution, with the event probabilities being (W For i′ = 1, . . . , S − 1, let x(i′) and set W i′ , . . . , W (S) t (1) t ). 1:t := x(ji′ ) 1:t t = 1/S else Re-sample the index j∗ from the categorical distribution, with the event probabilities being (W Return x0:T :== x(j∗) 1:T end if end for (1) t , . . . , W (S) t ). G. Closed-Form Optimal Variational Conditional Distribution over Inducing Variables Given a trajectory, the optimal variational conditional over the whitened inducing variables given a state trajectory is given by: q(v | x0:T ) = dx(cid:89) d=1 N (v(d); g(d), H(d)), (74) where g and H are given in Eqs. (70) and (71), respectively. A similar expression can be obtained for the original (non-whitened) inducing variables u. Of importance here is that our formulation has allowed us to obtain an optimal conditional variational distribution, given the state trajectories, over the inducing variables in closed form. We see then that, in effect, our approximate posterior is qFFVD(x0:T , u) = q(x0:T )q(u | x0:T ). In order to make predictions, we run SGHMC to obtain samples {x(s) 0:T } from the marginal p(x0:T ) and then use the closed-form expression for the conditional to obtain {u(s) | x(s) 0:T }. Running SGHMC over the much lower-dimensional space of state trajectories (instead of the joint space of trajectories and inducing variables) should generally converge faster. Or experiments with both versions of the algorithm confirm this. G.1. Optimal Closed-Form Conditional vs Assumed Parametric Factorizations We contrast our variational distribution with that of the variational Gaussian process state space model (VGPSSM; Frigola et al., 2014) and the variationally coupled dynamic trajectories (VCDT; Ialongo et al., 2019). While, implicitly, our variational distribution is qFFVD(x0:T , u) := q(x0:T )q(u | x0:T ) the VGPSSM and VCDT assume qVGPSSM(x0:T , u) := q(x0:T )q(u) and qVCDT(x0:T , u) := q(x0:T | u)q(u), respectively. Although the former (VGPSSM) obtained an "optimal" posterior (given the factorization assumption), it is a mean-field approximation and ignores the dependencies between state trajectories and inducing variables. The latter (VCDT), does not make a mean-field assumption but its factorization forces parametric constraints over the individual distributions. In fact, Ialongo et al. (2019) assume Gaussian posteriors for both the marginal q(u) and each of the time-dependent conditionals in q(x0:T | u). Our proposal is the only variational distribution that is theoretically optimal while yielding a closed-form conditional. H. Particle Markov chain Monte Carlo (MCMC) We can use the sequential structure of the latent states x0:T for efficient inference. More specifically, using the transition in Eq. (22). The details of this are given in Algorithm 1. 16 Free-Form Variational Inference for Gaussian Process State-Space Models I. Experiment Details Regarding the variational Gaussian process state space model (VGPSSM), probabilistic recurrent state space model (PRSSM), and VCDT, we download the authors' implementations from their websites. For a fair comparison, we try to follow the same treatment for hyper-parameters across all methods. We note, however, that the Matlab implementation of VGPSSM does not provide inference for GP hyper-parameters θ, conditional likelihood parameters φ, inducing inputs Z, process variance Q or observation variance R. I.1. Settings for synthetic data In generating the synthetic data, we set the kernel's signal variance σ = 2.0 and lengthscale l = 0.5 in the sparse GPSSM. we reduce the impact of observational error and set the observation variance as small as σ2 = 0.01, i.e., each observation would be generated as yt ∼ N (xt, 0.01). We also set the process variance Q = 0.01. The number of inducing points is set to 20, and these 20 inducing points are evenly spread in the interval [−2, 2]. We set the length of the training trajectory as 120, the number of iterations as 50 000, and the number of posterior samples as 50. I.1.1. TESTING THE MARGINALS FOR GAUSSIANITY We conduct a hypothesis test for each individual trajectory state and inducing variable. Given the 50 posterior samples for xt (or um), which we denote them as {x(s) s=1), we use the implementation of scipy.stats.normaltest from Python's scipy package to test whether we have sufficient evidence to reject the hypothesis that xt (or um) follows a Gaussian distribution. scipy.stats.normaltest is based on the work of D'agostino & Pearson (1973). s=1 (or {u(s) t }50 m }50 I.2. Settings for Real-world Data We adopt similar settings as in Ialongo et al. (2019) to initialize the hyper-parameters for all the models, which first uses a factorized nonlinear model to optimize θ, x0:T , u, Z, C, d, R, Q. We use the identity function as the mean function and the squared exponential function with automatic relevance determination (ARD) in GPSSM. When dealing with more than 1 latent dimension, which requires a multi-output GP, we use a different set of kernel hyper-parameters for each output. We set the number of inducing points to M = 100 and the number of dimensions for latent states x0:T to dx = 4. We set standard diagonal Gaussian priors for the initial latent state x0 and (where applicable) for likelihood parameters C, d, the logarithm of observation standard deviation log(R)/2 and process variance log(Q). For optimizing these hyper-parameters, we use Adam, with default settings for the optimizer parameters except for a decayed learning rate. We run our FFVD algorithm for 50 000 iterations and VCDT for 200 000. We set the learning rate as 0.01 and the decay parameter as 0.05 during SGHMC sampling. We used S = 105 posterior samples for VCDT (as in the results in the original paper) and S = 100 for ours. Following the evaluation in Ialongo et al. (2019), we use the root mean square error (RMSE) between the models' predictions and the ground truth in the future 30 time steps (not seen in training) as the comparison criterion for all the methods. Regarding the benchmarks, we have 1 024 observations for Actuator, 1 000 observations for Ballbeam, 500 observations for Drive, 1 000 observations for Dryer, 1 024 for Flutter, and 296 observations for Furnace. Training lengths are: Ttrain = 500, 500, 250, 500, 500, 150, respectively, and test lengths are the rest of the sequences. All these observations are 1-dimensional but, as in previous work, we consider dx = 4-dimensional latent states. Each benchmark also contains a 1-dimensional control input vector a ∈ RT ×1. I.3. Details of Performance Metrics We use the test RMSE and the negative mean log likelihood (NMLL). Given samples from the predictive distribution {ˆy(s) t } we can compute the RMSE as: RMSE = 1 T T (cid:88) (cid:16) t=1 yt − E{ˆy(s) t } (cid:17)2 , (75) where E{ˆy(s) t } is estimated as the empirical mean. 17 Free-Form Variational Inference for Gaussian Process State-Space Models If the corresponding method gives us {x(s) t }, then we can estimate the NMLL as: NMLL = − 1 S 1 T S (cid:88) T (cid:88) s=1 t=1 log N (yt; Cx(s) t + d, R). If the method only provides us with {ˆy(s) t } then a reasonable estimate is: NMLL = − 1 T T (cid:88) t=1 log N (yt; E{ˆy(s) t }, V{ˆy(s) t }), where E{ˆy(s) t }, V{ˆy(s) t } are the empirical mean and variance of the predicted samples. For FFVD, we simply use: NMLLFFVD = − 1 S 1 T S (cid:88) T (cid:88) s=1 t=1 where μ(s) t and Σ(s) t are given by Eq. (23). I.3.1. DATA NORMALIZATION log N (yt; Cμ(s) t + d, CΣ(s) t C⊤ + R), The normalization (i.e., standardization) of observations is given by the transformation: ̃yt = yt − my σy , (76) (77) (78) (79) where my and σy are the mean and standard deviation of the training data. Let us denote the (cid:94)RMSE and (cid:94)NMLL as the error metrics in the normalized space. It is easy to show we can obtain the metrics in the original space as: (cid:94)RMSE RMSE = σy NMLL = log σy + (cid:94)NMLL. (80) (81) I.4. Reproducibility As mentioned in the main paper, our code is publicly available at https://github.com/xuhuifan/FFVD. J. Additional Results J.1. Training and Test Performance on All Benchmarks Fig. 5 shows the training and testing regimes and predictions for the six system identification benchmarks considered. J.2. Traceplot of Log-Likelihood on Training data for FFVD-M and FFVD-C-M Figure 6 shows the convergence trace plots for all benchmarks. K. Extended Related Work Here we give more details about the differences between our method and closely related approaches for inference in the GPSSM. The VGPSSM of Frigola et al. (2014) is the first developing variational approaches to inference in GPSSMs, and it uses mean-field assumptions to factorize the variational distribution of inducing variables u and latent state trajectories x0:T as qVGPSSM(u, x0:T ) = q(u)q(x0:T ). This assumption clearly overlooks the complex dependencies between u and x0:T . Doerr et al. (2018) model these dependencies with their PRSSM algorithm, but make the unrealistic assumption of the posterior dynamics over the latent state trajectories being the same as the prior. Ialongo et al. (2019) show that this assumption can have critical consequences on the posterior and predictive distributions and propose a more general 18 Free-Form Variational Inference for Gaussian Process State-Space Models Figure 5. Training and test performance on benchmarks. Row 1 (left to right): Actuator, Ballbeam, Drive; row 2 (left to right): Dryer, Flutter, Furnace. Figure 6. Traceplot of log-likelihood on training data for FFVD-M and FFVD-C-M. Row 1 (left to right): Actuator, Ballbeam, Drive; row 2 (left to right): Dryer, Flutter, Furnace. algorithm called VCDT. Although a significant improvement over previous methods, VCDT assumes posterior Gaussian distributions. When considering our main object of interest, i.e., the posterior over the state trajectories, under the standard and most commonly used GP setting with non-linear kernels, a Gaussian posterior assumption never holds, as the latent states are inputs to the kernel. Hence, our approach is theoretically superior to VCDT and provides a new baseline with broad practical applicability. As mentioned in the main paper, Frigola et al. (2013) also proposed a PMCMC algorithm for inference over state trajectories. However, the algorithm is based on the fully-independent conditional approximation (FIC; Quinonero-Candela & Rasmussen, 2005). As reported in Frigola et al. (2013), a na ̈ıve implementation of their algorithm has a time complexity of O(M 2T 2), which is significantly higher than ours. A much more efficient implementation with O(M 2T ) time complexity that requires significant tracking of intermediate data structures and factorizations is hinted at in the original paper. Unfortunately, the corresponding code has not been made publicly available. Furthermore, model approximations such as those in FIC can have surprising consequences, such as incorrectly estimating the noise variance to be almost zero or ignoring additional inducing inputs, see, e.g., Bauer et al. (2016) for a thorough discussion. Consequently, we see our variational approach as more principled. K.1. Reduced-Rank Approaches Here we discuss the related approach of Svensson et al. (2016), which we will refer to as reduced rank (RRANK). As with random feature approximations, RRANK exploits the covariance function-spectral density duality via the Wiener-Khinchin theorem to approximate the underlying GPs with a linear-in-the-parameters model, where the feature maps can be obtained analytically for specific kernels. 19 02004006008001000t321012y02004006008001000t2024y0100200300400500t21012y02004006008001000t2101y02004006008001000t21012y050100150200250300t21012y01000020000300004000050000Iterations05101520253035Marginal log-likelihoodFFVD-MFFVD-C-M01000020000300004000050000Iterations05101520253035Marginal log-likelihoodFFVD-MFFVD-C-M01000020000300004000050000Iterations05101520253035Marginal log-likelihoodFFVD-MFFVD-C-M01000020000300004000050000Iterations05101520253035Marginal log-likelihoodFFVD-MFFVD-C-M01000020000300004000050000Iterations05101520253035Marginal log-likelihoodFFVD-MFFVD-C-M01000020000300004000050000Iterations05101520253035Marginal log-likelihoodFFVD-MFFVD-C-M Free-Form Variational Inference for Gaussian Process State-Space Models While these types of approaches have their own weaknesses and strengths with respect to inducing variable approximations, one crucial difference with our method is that their approximation is only applicable to stationary kernels. Therefore our method is, by definition, much more general. Furthermore, as noted by Wilson et al. (2020), those types of approximations to the covariance function based on finite-dimensional feature maps are known to exhibit undesirable pathologies at test time. In particular, the feature maps used by Svensson et al. (2016) can become increasingly ill-behaved in high-data regimes. Consequently, we believe the advantages of our approach (that avoids the stationarity assumption and its corresponding practical deficiencies) justify its use as an additional tool for practitioners and researchers. Nevertheless, here we briefly report some results using the Matlab code provided by Svensson et al. (2016). The RMSE values obtained on Actuator, Ballbeam, Drive, Dryer, Flutter, and Furnace are 0.33, 0.11, 0.73, 1.35, 1.86, and 9.66, respectively. While these results are generally competitive with our approach and other baselines, they are inferior to the results reported with our algorithm. 20
http://arxiv.org/abs/2302.09915v1
2023-02-20T11:18:24
2023-02-20T11:18:24
TA-MoE: Topology-Aware Large Scale Mixture-of-Expert Training
Sparsely gated Mixture-of-Expert (MoE) has demonstrated its effectiveness in scaling up deep neural networks to an extreme scale. Despite that numerous efforts have been made to improve the performance of MoE from the model design or system optimization perspective, existing MoE dispatch patterns are still not able to fully exploit the underlying heterogeneous network environments. In this paper, we propose TA-MoE, a topology-aware routing strategy for large-scale MoE trainging, from a model-system co-design perspective, which can dynamically adjust the MoE dispatch pattern according to the network topology. Based on communication modeling, we abstract the dispatch problem into an optimization objective and obtain the approximate dispatch pattern under different topologies. On top of that, we design a topology-aware auxiliary loss, which can adaptively route the data to fit in the underlying topology without sacrificing the model accuracy. Experiments show that TA-MoE can substantially outperform its counterparts on various hardware and model configurations, with roughly 1.01x-1.61x, 1.01x-4.77x, 1.25x-1.54x improvements over the popular DeepSpeed-MoE, FastMoE and FasterMoE.
[ "Chang Chen", "Min Li", "Zhihua Wu", "Dianhai Yu", "Chao Yang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09915v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09915v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 5 1 9 9 0 . 2 0 3 2 : v i X r a TA-MoE: Topology-Aware Large Scale Mixture-of-Expert Training Chang Chen1∗†, Min Li2,3,5∗, Zhihua Wu4, Dianhai Yu4, Chao Yang2,3,5‡ 1Center for Data Science, Peking University 2School of Mathematical Sciences, Peking University 3National Engineering Laboratory for Big Data Analysis and Applications, Peking University 4Baidu Inc. 5Institute for Computing and Digital Economy, Peking University charlie_chen,[email protected] [email protected] wuzhihua02,[email protected] Abstract Sparsely gated Mixture-of-Expert (MoE) has demonstrated its effectiveness in scaling up deep neural networks to an extreme scale. Despite that numerous efforts have been made to improve the performance of MoE from the model design or system optimization perspective, existing MoE dispatch patterns are still not able to fully exploit the underlying heterogeneous network environments. In this paper, we propose TA-MoE, a topology-aware routing strategy for large-scale MoE trainging, from a model-system co-design perspective, which can dynamically adjust the MoE dispatch pattern according to the network topology. Based on communication modeling, we abstract the dispatch problem into an optimization objective and obtain the approximate dispatch pattern under different topologies. On top of that, we design a topology-aware auxiliary loss, which can adaptively route the data to fit in the underlying topology without sacrificing the model accuracy. Experiments show that TA-MoE can substantially outperform its counterparts on various hardware and model configurations, with roughly 1.01x-1.61x, 1.01x- 4.77x, 1.25x-1.54x improvements over the popular DeepSpeed-MoE, FastMoE and FasterMoE systems. 1 Introduction The scale of model parameters in neural networks has increased from millions to trillions in recent years, which promotes model accuracy in many domain, such as language processing [2; 3; 4] and computer vision [27; 23]. However, the limited hardware resources, e.g., memory capability and communication bandwidth, have constrained the model size to further scale up. To relieve this tension and improve the model performance, Mixture of Expert (MoE) with a sparsely gated structure was recently reintroduced [16; 26; 25]. The core structure of MoE is a group of small "expert" networks and a gate network. Guided by the gate result, input data is dynamically routed to only a sub-group of experts for computation. Compared with dense training methods, the sparsely activated feature of MoE can significantly reduce the computation burden, extend the model size, and achieve higher accuracy [5; 6; 11; 13]. ∗Equal Contribution. †Work done during internship at Baidu Inc.. ‡Corresponding author. 36th Conference on Neural Information Processing Systems (NeurIPS 2022). Since MoE plays a vital role in large-scale model training, efficient MoE parallel training has recently received much attention. As one of the most popular MoE training approaches (Figure 1), expert parallelism [11; 6] distributes experts to different devices, and each device is responsible for a different batch of training samples. Correspondingly, extra global communication is necessary for data exchanges among devices. Recent works aim to increase expert parallelism performance from two aspects. On the one hand, the dynamic pattern of MoE results in severe computation load-imbalance problems that a small number of experts may receive, process, and send the majority of data. Several approaches were proposed to make full use of the available experts, such as adding an auxiliary loss [26], controlling expert capacity [11; 6], and optimizing the assignment scheme for a balanced load [12; 28; 22]. On the other hand, global communication is another main obstacle to efficient MoE training. Most of the recent works reduced the communication cost from a system perspective, such as computation and communication overlapping [9], customized communication operation acceleration [21; 18], and adaptive routing [17]. In addition to the continuing efforts made to improve the performance of MoE, there are still two major challenges. With the development of the complicated distributed network environments, the existing even dispatch method may cause network contention in the slowest links, leading to poor communication performance, especially on heterogeneous networks. Although a few early works [9] have proposed methods to dispatch more data to slow links, these methods may make the expert load imbalanced and could influence the model accuracy. Efficient communication demands more delicate dispatch strategies. How to improve the training efficiency without sacrificing the model accuracy is still worth studying. Besides, most of the existing communication optimizations for MoE [21; 17] are studied with a specific hardware environment. How to develop methods that can adapt to a variety of hardware environments is also of great practical value. To tackle these challenges, we design TA-MoE, a topology-aware large scale MoE training method that can adaptively adjust the communication volume to fit the underlying network topology. By abstracting the dispatch problem into an optimization objective based on the communication mod- eling, we obtain the approximate dispatch pattern under different topologies. On top of that, an auxiliary topology loss with pattern-related coefficients is proposed, which can dynamically adjust the communication volume without interfering with the model convergence. TA-MoE can also be easily incorporated into the widely used MoE systems, such as DeepSpeed-MoE [21] and FastMoE [8]. We conduct experiments on various typical network topologies and model configurations. Results show that TA-MoE can substantially outperform DeepSpeed-MoE and FastMoE with roughly 1.01x- 1.61x speedup and 1.01x-4.77x speedup on different configurations without sacrificing the model accuracy. Compared with the recently proposed Hir gate of FasterMoE, our method can achieve 1.25x-1.54x speedup on time to convergence. Besides, a more detailed analysis of communication and data dispatch pattern further demonstrates the effectiveness of the proposed data dispatch strategy. The code of TA-MoE is available at: https://github.com/Chen-Chang/TA-MoE 2 Related Work Several frameworks have featured sophisticated designs to support efficient MoE training. GShard [11] and DeepSpeed-MoE [21] subtly composed several einsum operators into the computation of MoE but introduced redundant zero computation and extra memory consumption. FastMoE [8] customized the essential computation kernels to improve resource utilization effectively. To further enhance the performance, most of the systems adopted an auxiliary loss [26] to achieve an even dispatch pattern and enforced the number of data processed by each expert below some uniform capacity. Based on these popular implementations, recent works aim to improve the MoE training performance from mainly two aspects: model structure design and communication optimization. From the perspective of model design, BASE Layer [12] and the work of expert choice routing [28] assigned an equal number of tokens to each expert by delicate designs of the gate. Instead of learning the weight of the gate, Hash Layers [22] adopted an efficient hash function to guide the dispatch. The hybrid structure of PR-MoE [21] improved the parameter efficiency by fixing one shared expert. BaGuaLu [15] re-distributed the data chunks evenly, damaging the model accuracy. However, almost all of these high-level algorithms are agnostic of the complicated underlying hardware effect on training performance. 2 As for communication optimization, DeepSpeed-MoE [21] and HetuMoe [18] implemented a hierar- chical all-to-all communication kernel to improve network utilization. Tutle [17] designed adaptive routing techniques coupled with a specific network architecture. Despite of these delicate designs, the improvement space of system-level optimization is significantly constrained by the dispatch patterns of MoE. Recently, FasterMoE [9] made an initial try to take the dispatch pattern into consideration by setting a compulsory ratio of intra-node to inter-node dispatch chunk sizes but sacrificed some model accuracy. In this paper, we propose a topology-aware routing strategy that enables an effi- cient communication pattern to fit into the underlying topology without sacrificing the convergence performance. 3 Background 3.1 MoE Model Structure Figure 1: The popular expert parallelism method of MoE. A MoE layer consists of a gate network G and a set of N expert networks E0, . . . , EN −1. For the gate module, the softmax activation function is widely used, reflecting each expert's normalized fitness for dealing with an incoming sample. Usually, only the experts with the top k fit scores are selected to process the sample. The final output y of the MoE layer is the aggregation of computed results. Expert parallelism has been one of the most popular methods in existing MoE training systems [21; 8]. As shown in figure 1, the N experts are evenly assigned to P devices, with each device i holding E = N/P experts Ei∗E, . . . , E(i+1)∗E−1. Besides, the input tokens are also evenly partitioned over multiple devices with different small batches of the same size S in a traditional data-parallel way. For each process, the shape of the dispatched data is [k ∗ S, d], where d represents the hidden size. Each expert receives a combined batch of tokens (Global Exchange) and then carries out the computation. During the global communication, the number of samples sent to Ee from process i is cie, and the shape of the transferred samples is [cie, d]. Afterward, the expert sends the calculated result back with a similar global exchange pattern. However, the number of the tokens processed by different experts may be highly imbalanced that a small group of experts may receive the majority of data, like Expert 2 in Figure 1. Therefore, a load-balance auxiliary loss term laux [26] is added to the train loss as an overall loss function: mi = (cid:88) x G(x)/S, laux = N −1 (cid:88) (mie ∗ (cie/S)) e=0 (1) The auxiliary loss can dynamically adjust the value of cie into target k ∗ S/N . To further ensure load balance, a uniform data process capacity C is set for each expert in many MoE training systems. DeepSpeed-MoE [21] decomposes the expert capacity C evenly into the local capacity for each process and prunes the exchange size by the local capacity directly: cie ≤ Cie = C/P . FastMoE [8] efficiently uses the capacity with two extra all-to-all communication for exchange sizes: (cid:80)P −1 i=0 cie ≤ C. 3.2 Network Topology The network environments are very complicated for distributed training on modern GPU clusters. As shown in Figure 2, there are four kinds of typical network topologies: homogeneous, ring, symmetric tree and asymmetrical tree. Homogeneous and ring structures are frequently used topologies for the 3 Gate NetworkExpert Network 0Global ExchangeAggregate Token 0 Token 0Global ExchangeToken 1Token 2 Token 0Token 3Token 1Gate NetworkExpert Network 1Aggregate Token 1Gate NetworkExpert Network 2Aggregate Token 2 Token 2Token 3Gate NetworkExpert Network 3Aggregate Token 3Device 0Device 1Device 2Device 3 (a) Homogeneous (b) Ring (c) Symmetric Tree (d) Asymmetrical Tree Figure 2: Typical network topologies on modern GPU clusters. (a) A homogeneous node connected with NVSwitch. (b) A typical ring topology connected with NVLinks [19]. (c) A 2-layer symmetric tree topology of [2,2]. (d) A 3-layer asymmetrical tree topology of [[2,2],[2]]. intra-node environment. For a homogeneous structure, devices are always connected by the network with the same bandwidth, e.g., NVSwitch [20]. As for the ring topology, it is usually symmetrical. The bandwidths between adjacent devices may differ due to different numbers of connected links. The communication of nonadjacent devices has to hop through intermediate devices and the slowest link may become the bottleneck. Hierarchical tree is a common topology abstraction for multi-node distributed environments. Compared with the intra-node environment, inter-node links suffer from limited and volatile bandwidth (4∼25GB/s) and potentially degrade the communication performance. For convenience, we denote a tree topology as a nested list where the elements within the same sub-list are connected by the same switch. For a symmetric tree structure, we use Li to represent the number of the child nodes of each node in layer i. As for an asymmetrical tree structure, it is the most common topology for distributed training, which can be very irregular. 3.3 Motivation The existing load-balanced data distribution of Equation 1 is unable fully exploit the complicated distributed environments. To demonstrate it, we set up an experiment on a [2, 2] symmetric tree topology cluster, where the devices are named 0, 1 (same node) and ˆ0, ˆ1 (same node), respectively. We dispatch 128MB 4 data with two dispatch patterns: (1) even dispatch and (2) uneven dispatch that a greater proportion of data is exchanged with a neighbor device. Table 1 shows the detailed dispatch proportions and the corresponding performance. Compared with even dispatch, uneven dispatch improves the overall communication performance by roughly 30%. This is mainly because the communication stress on inter-node links is relieved by transferring a smaller proportion of data. With the variety of distributed network topologies and their continuous development, the existing static even dispatch pattern is not effective enough. There is an urgent need for a routing strategy that can dynamically adapt to the underlying network environments. Table 1: The communication performance of [[0,1],[ˆ0, ˆ1]] network topology. Ratio of data Time (μs) Dispatch Pattern Even Uneven Even Uneven 0 ↔ 0 1/4 1/4 144 144 0 ↔ 1 1/4 1/2 758 1492 0 ↔ ˆ0 1/4 1/8 5609 2835 0 ↔ ˆ1 1/4 1/8 5618 2861 All 1 1 14019 10765 4 Topology Aware Routing Strategy In this section, we first abstract the data dispatch problem into an optimization objective based on the communication model. Through some analysis, we obtain the target dispatch pattern under different topologies, which can eliminate the communication bottleneck during MoE training. Guided by the target pattern, we design a topology-aware routing loss to adaptively adjust the dispatch volume. 4.1 Communication Model We characterize the communication cost using the well-known α-β cost model, where α and β represent the fixed communication latency and the inverse bandwidth (i.e., transferring costs of each word), respectively. For convenience, αij and βij are used to denote the latency and inverse 4Here, 128MB is used as a demonstration, which is the upper-bound transfer size of most of the typical MoE training tasks. 4 NVSwitchGPUGPUGPUGPUGPUGPUGPUGPUGPUGPUGPUGPUGPUGPUGPUGPUGPUGPUCPUCPULayer 0Layer1GPUGPUGPUGPUGPUGPUCPUCPUCPULayer 0Layer 1Layer 2 bandwidth between the i-th and j-th GPU. During the training of MoE, the amount of data transferred from GPU i to Ee in GPU j is cie ∗ d ∗ b, where d ∗ b is the transferred element size. To reduce the overheads of multiple send-receives between two GPUs, we merge the multiple small data chunks into a larger data chunk for delivery. The total amount of data delivered from GPU i to GPU j is (cid:80)E∗(j+1)−1 cie ∗ d ∗ b. A global data exchange consists of P ∗ P peer-to-peer data deliveries, e=E∗j among which the slowest delivery, as a lower-bound, constrains the final communication performance. Most of the global exchange implementations [21; 18; 24] are designed to approach the lower-bound. Therefore, our ultimate objective function is to minimize the slowest send-receive communication cost: min c max i,j (αij + βij ∗ cie ∗ d ∗ b) (2) E∗(j+1)−1 (cid:88) e=E∗j For efficient MoE training, two constraint conditions should be satisfied. First, for any process i, the sent data size, i.e., k ∗ S, should be equal to the sum of received data size of all experts: k ∗ S = (cid:88) cie, ∀i ∈ {0, ..., P − 1}. (3) e∈{0,...,N −1} Second, to make full use of all the experts and pursue a better model accuracy, the data chunks dispatched to each expert should be balanced: k ∗ S E = (cid:88) i∈{0,...,P −1} cie, ∀e ∈ {0, ..., N − 1}. (4) 4.2 Model Optimization To get the target dispatch pattern, we need to solve the optimization problem in Equation 2. Nev- ertheless, Equation 2 contains plentiful parameters of a specific network, which complicates the solving process. Meanwhile, in some irregular topologies, some devices may suffer from quite limited bandwidth when communicating with other devices. According to Equation 2, the experts assigned to these devices may receive a quite small dispatch chunk size from the other processes, which may make the experts lack of sufficient data exchanges and lead to expert isolation phenomenon. To tackle these problems, we simplify the optimization problem to accelerate the solving process and smooth the values of αij, βij for an approximate result to prevent expert isolation. Since each send-receive communication shares the same α, β in homogeneous network, the target dispatch chunk size ˆcie is equal to the load-balanced chunk size k∗S N . In the following part, we focus on the analysis of the optimization problem under heterogeneous topologies. On a n-layer symmetric tree topology, for any device i, all the devices can be split into n sub-groups of Gi = {Gi t is the group of devices whose shortest path from device i are across t switches. Multiple hops in cross-switch communication will suffer from extra overheads and the most limited bandwidth in the hops dominates the final bandwidth. Therefore, we can simplify t|t < n}. Gi the original αij, βij into n value: αl = , which can precisely characterize the underlying topology and eliminate the noise of profiling. Then we get a hierarchical matrix ˆα, ˆβ: , βl = (cid:80) ((cid:81)l I(j∈Gi i<j k=0 Lk)∗(Ll−1)/2 l )∗αij (cid:80) ((cid:81)l I(j∈Gi i<j k=0 Lk)∗(Ll−1)/2 l )∗βij ˆαij = (cid:88) l I(j ∈ Gi l) ∗ αl, ˆβij = I(j ∈ Gi l) ∗ βl (cid:88) l (5) Take equation 3 and 4 as optimization constraint conditions, we simplify the optimization problem as follows: min c T lower comm = min c max i,j ( ˆαij + ˆβij ∗ E∗(j+1) (cid:88) e=E∗j cie ∗ d ∗ b) s.t. k ∗ S E = k ∗ S = (cid:88) cie ∗ d ∗ b, ∀e ∈ {0, ..., N − 1}, i∈{0,...,P −1} (cid:88) e∈{0,...,N −1} cie ∗ d ∗ b, ∀i ∈ {0, ..., P − 1}, (6) c ≥ 0 5 Then, we can get the near optimal solution after omitting the small latency term: ˆcie = k ∗ S 1 ˆβij E ∗ (cid:80) j ∗ ˆβi(cid:98) e E (cid:99) (7) The optimal data distribution of the above min-max problem is only related to the bandwidth: the volume of ˆcie is linear to the bandwidth. The rationale behind the optimal result is that higher bandwidth links should bear more loads for an overall communication balanced workflow. The ring topology also shows a hierarchical characteristic and the solution for ring topology has the same pattern as symmetric trees. Under some irregular asymmetric topology, the optimal result of Equation 2 may result in some experts assigned to the devices of most limited bandwidth in lack of data exchanges with the rest of the devices. Compared to the data distribution of other experts, data chunks from local devices occupy a larger proportion of received data chunks in those isolated experts. For the fairness among the experts, we transform the asymmetric topology into a symmetric one by merging the separate nodes into the close symmetric sub-trees. For example, [[2,2][2]] in figure 2(d) can be merged as symmetric structure [[2,2,2]]. After that, we can optimize the lower bound of communication as the symmetric structure. 4.3 Routing Strategy Once getting the target data dispatch volumes among processes, we can use it to guide the MoE training. To not sacrifice the model accuracy, instead of setting a compulsory dispatch ratio directly, we design a topology-aware adaptive routing loss. pi = N orm(1/ˆci), li topo = N ∗ P ∗ N −1 (cid:88) (pie ∗ mie ∗ (cie)/S) ∀i ∈ {0, ..., P − 1} (8) e=0 As shown in Equation 8, we set a penalty weight pi as the adjustment coefficients for the topology loss li topo of each process i. We set the normalized 1/ˆci as pi to make sure cie approximates the value of ˆcie. Normalization functions that enlarge the penalty of the low-bandwidth transfer, e.g., softmax, are also preferable. As shown in the calculation of li topo, the data dispatched to Ee with limited bandwidth will suffer from a larger penalty weight pie. Despite of these penalty modifications, auxiliary loss occupies a small proportion of the final loss, and the value of the auxiliary loss decreases when experts' number scales up. Therefore, our final topology loss is expanded N ∗ P times to keep the magnitude of loss value. There are a number of advantages of the proposed topology-aware strategy. On the one hand, compared to setting a compulsory dispatch ratio, the proposed loss can adjust the communication volume to fit in the underlying topologies in a mild way without damaging the convergence. A compulsory dispatch ratio has a high potential to overwhelm the influence of the train loss and sacrifice the model accuracy. With the topology loss, the train loss can still dominate in the final loss value. As a result, the dispatch results are mainly influenced by the train loss for a better model accuracy. Besides, the topology-aware strategy has more potential to utilize the token information for efficient sparse training. Guided by the topology-aware loss, the tokens nearby are more likely to be processed by the same expert. Since the correlation of adjacent tokens contains the vital information in sparse attention [10], the experts in sparsely gated routing structure may also be more likely to extract important information from adjacent tokens. In addition, the topology-aware loss can be easily incorporated to existing MoE systems, such as DeepSpeed-MoE and FastMoE. Taking FastMoE as an example, one just needs to directly replace the popular load-balanced loss laux with the proposed topology-aware loss ltopo. Since local capacity threshold Cie is adopted in DeepSpeed-MoE for load balance, one can modify the local capacity sizes to be consistent with the proposed dispatch pattern by setting Cie to be proportional to the target data chunk sizes ˆcie. Instead of padding the data chunks with extra zeros to be the same size as DeepSpeed-MoE, one all-to-all communication is added to get the information of send-receive data chunk sizes and dispatch data chunks according to the sizes. 6 5 Evaluation Experiment setup To demonstrate the effectiveness of TA-MoE, we carry out a series of experi- ments on three typical NVIDIA GPU clusters with different network topology, and some represen- tative model configurations. Table 2 lists the cluster settings. The testbed is three typical clusters from the PaddleCloud5 platform. For cluster A, each node consists of 8 NVIDIA Tesla 40GB A100 GPUs connected with NVSwitch, which shows high performance for both computation and network communication. Clusters B and C are equipped with 8 NVIDIA Tesla 32GB V100 GPUs in each node. The nodes in cluster B are connected by the same switch, while cluster C is composed of a large number of servers and switches that are interconnected through an internal network infrastructure. Besides, the software configurations are set as CUDA 11.0, NCCL 2.8.4 and CUDA 11.1, NCCL 2.8.3, for cluster A and cluster B, C, respectively. Table 2: Cluster Setting. Clusters A B C GPU Intra-Node Inter-Node Symmetric Same switch 40G-A100 NVSwitch 100GB/s RoCE/4 100GB/s RoCE/8 32G-V100 NVlink 100GB/s RoCE/8 32G-V100 NVlink x (cid:88) x x (cid:88) x Since the transformer architecture is the most common base structure of MoE, we focus the experi- ments on problems related to transformer-based model, with GPT-3 Medium [2] as the base model and multi-layer perception as the expert. In our experiments, the number of the experts are chosen among {8, 16, 32, 48, 64} with each device deployed with one expert. Both the Switch top-1 [6] and the GShard top-2 gates [11] are tested with the weight of auxiliary loss set as 1.0. For the consistency of the experiment, we implement the models by a single framework Paddle [1] and train on the open-source openwebtext2 dataset [7]. More detailed specifications of model settings can be found in Table 3. To be more general, we also add the tests of MoE on Swin Transformer based MoE tasks in Section A.3 of the Appendix. These results further demonstrate the effectiveness of the proposed topology-aware routing algorithm on different model architectures. Table 3: Detailed specifications of the GPT models. Gate Switch GShard Switch & GShard Switch & GShard Layers Hidden size Intermediate size Batch size Data type Capacity factor Clusters 12 12 12 12 1024 1024 1024 1024 4096 2048 2048 2048 6 6 4 4 FP16 FP16 FP32 FP32 1.0 2.0 1.2 1.2 A A B C Methodology We incorporate TA-MoE into widely used DeepSpeed-MoE [21] and FastMoE [8] implementations. Because TA-MoE modifies the gate structure, we first compare the validation loss w.r.t. steps to ensure that TA-MoE will not interfere with the convergence on various model scales. On top of that, we test the overall throughput and the speedup of TA-MoE over these two classical baselines. To be more comprehensive, we also compare with the recently proposed FasterMoE Hir gate [9] on the metric of time to convergence performance. Besides, a detailed analysis of communication costs, as well as the distribution of the dispatch are also given. Accuracy and Performance Like some well- recognized related works, e.g., BASE layer and DeepSpeed-MoE, we have depicted the validation performance of every fixed interval step in Figure 3 as the comparison metric. We first compare the validation loss w.r.t steps of TA-MoE and the repre- sentative FastMoE on cluster C. As shown in Figure 3, the loss curves of TA-MoE and FastMoE are con- sistent to converge under different training scales of 8 experts to 48 experts. These results demonstrate that 5A Cloud Platform of Baidu Inc. Figure 3: Validation loss w.r.t. steps. 7 020000400006000080000100000steps2.53.046Validation LossBaseline_E8TA-MoE_E8Baseline_E16TA-MoE_E16Baseline_E32TA-MoE_E32Baseline_E48TA-MoE_E48 the TA-MoE can adaptively adjust the data dispatch volume without sacrificing the model accuracy. To be more comprehensive, we also add the perplexity (PPL) metric in Table 4 of the Appendix, which gives similar effective results. Switch Gate GShard Gate A r e t s u l C B r e t s u l C C r e t s u l C Figure 4: Performance of TA-MoE over DeepSpeed-MoE and FastMoE under different hardware and model settings. To demonstrate the advantages of TA-MoE in terms of training performance, we compare it with both DeepSpeed-MoE and FastMoE on various hardware and model configurations. The performance indica- tors including throughout (tokens/s) and the speedups are depicted in Figure 4. It is clear that TA-MoE can bring significant performance improvements over its counterparts under almost all the configu- rations. When compared with the DeepSpee-MoE, the achieved speedup is about 1.05x-1.61x. As for FastMoE, the performance improvement is around 1.01x-4.77x. More speedups are achieved on Fast- MoE than DeepSpeed-MoE. This is because TA-MoE has a more dynamic dispatch pattern and larger ad- justable space based on FastMoE. 8 Figure 5: Comparison with FasterMoE. E8E16E32E48E6402468Throughput (tokens/s)1e51.54x1.47x1.18x1.15x1.61x1.13x1.11x1.05xOOMFastMoE BaselineFastMoE+TA-MoEDeepSpeed BaselineDeepSpeed+TA-MoEE8E16E32E48E6401234561e52.40x1.30x1.26x1.18x1.35x1.25x1.13x1.15xOOME8E16E32E48E640.00.20.40.60.81.01.2Throughput (tokens/s)1e51.01x1.17x1.23x1.32x1.23x1.02x1.21x1.16x1.23x1.13xE8E16E32E48E640.00.20.40.60.81.01.21e51.02x1.28x1.58x1.60x1.49x1.01x1.30x1.27x1.25x1.19xE8E16E32E48E640.00.20.40.60.81.01.2Throughput (tokens/s)1e51.01x1.16x1.36x1.29x1.22x1.02x1.24x1.31x1.22x1.13xE8E16E32E48E640.00.20.40.60.81.01.21e51.02x1.28x4.77x2.57x1.71x1.01x1.38x1.39x1.25x1.18x050010001500200025003000time(min)2.72.82.93.13.546Validation Loss1.54x1.47x1.25xFasterMoE_E32TA-MoE_E32 It is also observed that more improvements are obtained on Cluster C, which can reach 4.77x for some cases, due to the relief of its serious network contention of cross-switch communication. In addition, the comparison of the results of Switch and GShard gate reveals that TA-MoE can behave better in adjusting larger volume of data. To be more comprehensive, we make further comparisons with the recently proposed FasterMoE [9]. Because the compulsory dispatch strategy of FasterMoE affects the convergence, we take the validation loss w.r.t time as the comparison metric. Clusters C are selected as the representative testing clusters. As shown in Figure 5, TA-MoE can converge faster than FasterMoE. We evaluate the time to reach the validation loss values of 3.1, 2.9, and 2.8, and TA-MoE can converge faster by about 1.25x, 1.47x and 1.54x. The results further verify that the proposed adaptive routing loss is more effective than the compulsive dispatch method, which sacrifices model accuracy for training performance. Communication Analysis To better show the effects of the dynamical dispatch strategy, we further analyze communication and computation cost, and the distribution of data dispatch on cluster C. As shown in Figure 6(a), thanks to the proposed TA-MoE strategy, the communication cost is reduced rapidly, with roughly 1.16x to 6.4x speedups. It is also observed that the maximum speedup is achieved for 32 experts on four cross-switch nodes. This is because the four nodes are deployed under four different switches, and cross-switch links severely bottleneck the data exchange. Once the tension is relieved, the obtained benefits can be dramatic. In addition, we visualize the dispatch pattern of an example with 64 expert by depicting the number of the tokens of Rank 0-7 sending to other ranks. More details of the dispatch distributions for other expert scales are attached to Section A.2 of the Appendix. In Figure 6(b), as expected, most of the data of Rank 0-7 are dispatched to low-overheads nearby ranks, which further verifies the effectiveness of adaptive topology-aware loss. (a) Breakdown of communication and computation. (b) Distribution of data dispatch of Rank 0-7. Figure 6: Analysis of communication and computation cost and the distribution of data dispatch. 6 Conclusion In this paper, a topology-aware routing strategy, TA-MoE, was proposed to stress the mismatch between the data dispatch pattern and the network topology. Based on communication modeling, we abstract the dispatch problem into an optimization objective and obtain the approximate dispatch pattern under different topologies. On top of that, a topology-aware auxiliary loss was designed, which can adaptively route the data to fit in the underlying topology without sacrificing the model accuracy. Experiments show that the proposed method can substantially outperform its counterparts on a variety of the hardware and model configurations, with roughly 1.01x-1.61x, 1.01x-4.77x, 1.25x-1.54x improvements over the popular DeepSpeed-MoE, FastMoE and FasterMoE systems. In the future, we plan to take more delicate communication operators into consideration of dynamic dispatch pattern and extend our work to more hardware environments. 7 Acknowledgement This work was supported by National Key R&D Program of China (2021ZD0110501). 9 E8E16E32E48E6401234567Computation and Communication Cost (ms)1e31.16x1.92x6.40x2.42x1.51xFastMoE-CommFastMoE-CompTA-MoE-CommTA-MoE-Comp0102030405060Rank id of 64 Experts0.00.20.40.60.81.0Dispatched Token Number1e3BaselineRank-0Rank-1Rank-2Rank-3Rank-4Rank-5Rank-6Rank-7 References [1] Baidu. PaddlePaddle. https://github.com/paddlepaddle/paddle, 2022. [2] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 1877–1901. Curran Associates, Inc., 2020. [3] Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022. [4] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In Jill Burstein, Christy Doran, and Thamar Solorio, editors, Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 4171–4186. Association for Computational Linguistics, 2019. [5] Nan Du, Yanping Huang, Andrew M. Dai, Simon Tong, Dmitry Lepikhin, Yuanzhong Xu, Maxim Krikun, Yanqi Zhou, Adams Wei Yu, Orhan Firat, Barret Zoph, Liam Fedus, Maarten Bosma, Zongwei Zhou, Tao Wang, Yu Emma Wang, Kellie Webster, Marie Pellat, Kevin Robinson, Kathleen S. Meier-Hellstern, Toju Duke, Lucas Dixon, Kun Zhang, Quoc V. Le, Yonghui Wu, Z. Chen, and Claire Cui. GLaM: Efficient scaling of language models with mixture-of-experts. ArXiv, abs/2112.06905, 2021. [6] William Fedus, Barret Zoph, and Noam Shazeer. Switch Transformers: Scaling to trillion parameter models with simple and efficient sparsity. CoRR, abs/2101.03961, 2021. [7] Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, Shawn Presser, and Connor Leahy. The Pile: An 800gb dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027, 2020. [8] Jiaao He, Jiezhong Qiu, Aohan Zeng, Zhilin Yang, Jidong Zhai, and Jie Tang. FastMoE: A fast mixture-of-expert training system. CoRR, abs/2103.13262, 2021. [9] Jiaao He, Jidong Zhai, Tiago Antunes, Haojie Wang, Fuwen Luo, Shangfeng Shi, and Qin Li. FasterMoE: modeling and optimizing training of large-scale dynamic pre-trained models. In Proceedings of the 27th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pages 120–134, 2022. [10] 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. Journal of Machine Learning Research, 22(241):1–124, 2021. [11] Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. GShard: Scaling giant models with condi- tional computation and automatic sharding. In International Conference on Learning Represen- tations, 2021. [12] Mike Lewis, Shruti Bhosale, Tim Dettmers, Naman Goyal, and Luke Zettlemoyer. BASE layers: Simplifying training of large, sparse models. CoRR, abs/2103.16716, 2021. [13] Junyang Lin, An Yang, Jinze Bai, Chang Zhou, Le Jiang, Xianyan Jia, Ang Wang, Jie Zhang, Yong Li, Wei Lin, Jingren Zhou, and Hongxia Yang. M6-10T: A sharing-delinking paradigm for efficient multi-trillion parameter pretraining. CoRR, abs/2110.03888, 2021. 10 [14] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. CoRR, abs/2103.14030, 2021. [15] Zixuan Ma, Jiaao He, Jiezhong Qiu, Huanqi Cao, Yuanwei Wang, Zhenbo Sun, Liyan Zheng, Haojie Wang, Shizhi Tang, Tianyu Zheng, et al. BaGuaLu: targeting brain scale pretrained models with over 37 million cores. In Proceedings of the 27th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pages 192–204, 2022. [16] Saeed Masoudnia and Reza Ebrahimpour. Mixture of experts: a literature survey. Artificial Intelligence Review, 42:275–293, 2012. [17] Microsoft. Tutel: An efficient mixture-of-experts implementation for large dnn model training. https://github.com/microsoft/tutel, 2021. [18] Xiaonan Nie, Pinxue Zhao, Xupeng Miao, and Bin Cui. HetuMoE: An efficient trillion-scale mixture-of-expert distributed training system. arXiv preprint arXiv:2203.14685, 2022. [19] NVIDIA. NVLINK. https://www.nvidia.com/en-us/data-center/nvlink/, 2022. [20] NVIDIA. NVSWITCH: The world's highest-bandwidth on-node switch. https://images. nvidia.com/content/pdf/nvswitch-technical-overview.pdf, 2022. [21] Samyam Rajbhandari, Conglong Li, Zhewei Yao, Minjia Zhang, Reza Yazdani Aminabadi, Ammar Ahmad Awan, Jeff Rasley, and Yuxiong He. DeepSpeed-MoE: Advancing mixture- of-experts inference and training to power next-generation AI scale. CoRR, abs/2201.05596, 2022. [22] Stephen Roller, Sainbayar Sukhbaatar, arthur szlam, and Jason Weston. Hash layers for large sparse models. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, volume 34, pages 17555–17566. Curran Associates, Inc., 2021. [23] Carlos Riquelme Ruiz, Joan Puigcerver, Basil Mustafa, Maxim Neumann, Rodolphe Jenatton, André Susano Pinto, Daniel Keysers, and Neil Houlsby. Scaling vision with sparse mixture of experts. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. [24] Aashaka Shah, Vijay Chidambaram, Meghan Cowan, Saeed Maleki, Madan Musuvathi, Todd Mytkowicz, Jacob Nelson, Olli Saarikivi, and Rachee Singh. Synthesizing collective com- munication algorithms for heterogeneous networks with TACCL. CoRR, abs/2111.04867, 2021. [25] Noam Shazeer, Youlong Cheng, Niki Parmar, Dustin Tran, Ashish Vaswani, Penporn Koanan- takool, Peter Hawkins, HyoukJoong Lee, Mingsheng Hong, Cliff Young, Ryan Sepassi, and Blake Hechtman. Mesh-TensorFlow: Deep learning for supercomputers. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, NIPS'18, page 10435–10444. Curran Associates Inc., 2018. [26] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc V. Le, Geoffrey E. Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of- experts layer. CoRR, abs/1701.06538, 2017. [27] Bichen Wu, Chenfeng Xu, Xiaoliang Dai, Alvin Wan, Peizhao Zhang, Masayoshi Tomizuka, Kurt Keutzer, and Peter Vajda. Visual transformers: Token-based image representation and processing for computer vision. CoRR, abs/2006.03677, 2020. [28] Yan-Quan Zhou, Tao Lei, Han-Chu Liu, Nan Du, Yanping Huang, Vincent Zhao, Andrew M. Dai, Zhifeng Chen, Quoc V. Le, and James Laudon. Mixture-of-experts with expert choice routing. ArXiv, abs/2202.09368, 2022. 11 A Appendix A.1 Perplexity Evaluation Results Table 4: Perplexity Evaluation Result. To further validate the model convergence performance, we list the perplexity (PPL) at 10w step (near 7 days) of GPT-Medium (12 layers, hidden size 1024, intermediate size 2048, GShard, Capacity factor 1.2) with different expert numbers on the openwebtext2 dataset. Combined with the information in Figure 3 of the paper, we can find that TA-MoE does not influence the convergence of the model when compared with the well-known FastMoE baseline. Expert Scale TA-MoE Valid PPL Baseline Valid PPL 8 16 32 48 17.97 15.18 13.37 12.55 18.12 15.39 13.53 12.49 A.2 Data Dispatch Distribution Figure 7 further elaborates the data dispatch patterns of GPU rank 0-7 (within a node) on 8, 16, 32, 48 experts. We also list the Rank-0 dispatch information of FastMoE with even distribution method as the baseline. On a single node topology, each rank prefers to dispatch data to the expert within a node. The topology influence on the data dispatch preference is relatively small, because the bandwidth variance within a node is small. Multi-node topology results show a consistent "ladder-like" distribution trend that the ranks within a node has a high preference to dispatch the data to intra-node rank group, instead of transferring data to inter-node ranks. These results verify the effectiveness of the proposed adaptive topology-aware method. Figure 7: The data dispatch distribution of rank 0 to 7 on 16, 32, 48 GPUs and experts. 12 01234567Rank id of 8 Experts0.00.51.01.52.0Dispatched Token Number1e3BaselineRank-0Rank-1Rank-2Rank-3Rank-4Rank-5Rank-6Rank-702468101214Rank id of 16 Experts0.00.20.40.60.81.01.2Dispatched Token Number1e3BaselineRank-0Rank-1Rank-2Rank-3Rank-4Rank-5Rank-6Rank-7051015202530Rank id of 32 Experts0.00.20.40.60.81.01.2Dispatched Token Number1e3BaselineRank-0Rank-1Rank-2Rank-3Rank-4Rank-5Rank-6Rank-7010203040Rank id of 48 Experts0.00.20.40.60.81.0Dispatched Token Number1e3BaselineRank-0Rank-1Rank-2Rank-3Rank-4Rank-5Rank-6Rank-7 Figure 8: Speedup of TA-MoE over FastMoE on Swin Transformer Based Model. A.3 Tests on Swin Tranformer Based MoE Tasks To further validate the generality of TA-MoE, we also carry out an experiment of Vision Tasks on ImageNet-1k dataset. The well-known vision transformer architecture Swin Transformer [14] is picked as the base model. The detailed model configurations are listed in Table 5. We evaluate the speedup on Cluster A with 16 and 32 GPUs as an illustration, where 16 GPUs configurations represents symmetric tree topology and 32 GPUs configurations represents asymmetric tree topology. As shown in Figure 8, we can achieve 1.18x and 1.20x speedup when compared with FastMoE on 16, and 32 GPUs, respectively. Table 5: Detailed specifications of the Swin-Transformer model. Name Layers Gate Stage 1 Stage 2 Stage 3 Stage 4 Swin Transformer v1 12 GShard concat 4x4, 96-d, LN {win.sz. 7x7, dim 96, head3} x2 concat 2x2, 192-d, LN {win.sz. 7x7, dim 192, head6} x2 concat 2x2, 384-d, LN {win.sz. 7x7, dim 384, head12} x6 concat 2x2, 768-d, LN {win.sz. 7x7, dim 768, head324} x2 Capacity factor 1.2 13 E16E320.00.51.01.52.0Time cost/iter (s)1.18x1.20xFastMoETA-MoE
http://arxiv.org/abs/2302.09913v3
2023-06-02T10:06:49
2023-02-20T11:15:18
ByzSecAgg: A Byzantine-Resistant Secure Aggregation Scheme for Federated Learning Based on Coded Computing and Vector Commitment
In this paper, we propose ByzSecAgg, an efficient secure aggregation scheme for federated learning that is protected against Byzantine attacks and privacy leakages. Processing individual updates to manage adversarial behavior, while preserving privacy of data against colluding nodes, requires some sort of secure secret sharing. However, the communication load for secret sharing of long vectors of updates can be very high. ByzSecAgg solves this problem by partitioning local updates into smaller sub-vectors and sharing them using ramp secret sharing. However, this sharing method does not admit bi-linear computations, such as pairwise distance calculations, needed by outlier-detection algorithms. To overcome this issue, each user runs another round of ramp sharing, with different embedding of data in the sharing polynomial. This technique, motivated by ideas from coded computing, enables secure computation of pairwise distance. In addition, to maintain the integrity and privacy of the local update, ByzSecAgg also uses a vector commitment method, in which the commitment size remains constant (i.e. does not increase with the length of the local update), while simultaneously allowing verification of the secret sharing process. In terms of communication loads, ByzSecAgg significantly outperforms the state-of-the-art scheme, known as BREA.
[ "Tayyebeh Jahani-Nezhad", "Mohammad Ali Maddah-Ali", "Giuseppe Caire" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09913v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09913v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CR", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CR", "cs.DC", "cs.IT", "cs.LG", "math.IT" ]
ByzSecAgg: A Byzantine-Resistant Secure Aggregation Scheme for Federated Learning Based on Coded Computing and Vector Commitment Tayyebeh Jahani-Nezhad, Mohammad Ali Maddah-Ali, and Giuseppe Caire 1 3 2 0 2 n u J 2 ] R C . s c [ 3 v 3 1 9 9 0 . 2 0 3 2 : v i X r a Abstract-In this paper, we propose ByzSecAgg, an efficient secure aggregation scheme for federated learning that is protected against Byzantine attacks and privacy leakages. Processing indi- vidual updates to manage adversarial behavior, while preserving privacy of data against colluding nodes, requires some sort of secure secret sharing. However, the communication load for secret sharing of long vectors of updates can be very high. ByzSecAgg solves this problem by partitioning local updates into smaller sub-vectors and sharing them using ramp secret sharing. However, this sharing method does not admit bi-linear computations, such as pairwise distance calculations, needed by outlier-detection algorithms. To overcome this issue, each user runs another round of ramp sharing, with different embedding of data in the sharing polynomial. This technique, motivated by ideas from coded computing, enables secure computation of pairwise distance. In addition, to maintain the integrity and privacy of the local update, ByzSecAgg also uses a vector commitment method, in which the commitment size remains constant (i.e. does not increase with the length of the local update), while simultaneously allowing verification of the secret sharing process. In terms of communication loads, ByzSecAgg significantly outperforms the state-of-the-art scheme, known as BREA. Index Terms-Federated learning, Secure aggregation, Byzantine-robustness, Vector Commitment. I. INTRODUCTION F Ederated learning (FL) is an emerging distributed learning framework that allows a group of distributed users (e.g., mobile devices) to collaboratively train a global model with their local private data, without sharing the data [1]–[3]. Specifically, in a FL system with a central server and several users, during each training iteration, the server sends the current state of the global model to the users. Receiving the global model, each user then calculates a local update with its local data, and sends the local update to the server. By aggregating the local updates, the server can update the global model for the next iteration. While the local datasets are not directly shared with the server, several studies have shown that a curious server can launch model inversion attacks to reveal information about the training data of the individual users from their local updates [4], [5]. Therefore, the key challenge to protect users' data privacy is to design secure aggregation protocols, which allow the aggregation of the local updates to T. Jahani-Nezhad and G. Caire are with the Electrical Engineering and Computer Science Department, Technische Universität Berlin, 10587 Berlin, Germany (e-mail: [email protected], [email protected]) M. A. Maddah-ali are with the Department of Electrical and Computer En- gineering, University of Minnesota, Twin Cities (e-mail: [email protected]) be computed without revealing each individual data. Moreover, as some users may randomly drop out of the aggregation process (due to low batteries or unstable connections), the server should be able to robustly recover the aggregated local updates of the surviving users in a privacy-preserving manner. As such motivated, a secure aggregation protocol SecAgg is proposed in [6]. In SecAgg, the local updates are masked before being sent to the server, using the private and shared random vectors, such that the shared parts can be canceled out when aggregated. One of the major challenges for SecAgg is the communication load, which grows quadratically with the number of users. There has been a series of works aiming to improve the communication efficiency of SecAgg (see, e.g., [7]–[13]). For instance, SwiftAgg+, recently proposed in [14], significantly reduces the communication overheads without any compromise on worst-case information-theoretic security, and achieves optimal communication loads within diminishing gaps for secure aggregation. In [7]–[14], the honest-but-curious model for secure ag- gregation is considered in which users correctly follow the protocol but some of them may try to gather information about other users' private information, potentially through collusion. However, some studies have also addressed the malicious model in which Byzantine adversaries have more capabilities and may run poisoning attacks, i.e., manipulate their inputs to change the outcome of the aggregation [15]– [17]. The problem of robustness against Byzantine adversaries in distributed and federated learning is well-researched in two categories: distance-based methods [18]–[21] and validation data-based methods [22], [23]. However, those defenses come with some potential privacy issues, as they require the server to process the local model updates. As a Byzantine resistant secure aggregation scheme, in [24], BREA is proposed in which users share their model updates with others using Shamir secret sharing and then calculate the pairwise distance between the received shares. The server then uses this information to identify and exclude Byzantine users from the aggregation process. BREA suffers from two major shortcomings: (1) to verify secret sharing, in BREA every single element of data is committed separately, (2) The secret sharing is not designed efficiently. As a result, the loads of commitment and sharing grow linearly with the aggregated size of all local updates. An alternative approach is proposed in [25], which involves grouping users anonymously and randomly into subgroups with a hierarchical tree structure. The aggregation method similar to SecAgg is performed within each subgroup, and then the process repeats at the next level of subgroups toward the root. The anonymity and randomness of the grouping reduce the probability of successful Byzantine attacks, as attackers do not know which subgroup the compromised device belongs to. However, in that approach, smaller subgroups result in reduced privacy for participants, while larger subgroups make it easier for the Byzantine attacker to hide their malicious model among the honest ones. In [26], a similar idea is proposed, which involves repeating the random grouping multiple times to save more updates of benign users through robust aggregation. However, that approach increases the communication loads and also reveals some information about the local updates. In [27], ELSA is proposed, which utilizes a distributed trust setup where two servers in separate trust domains work together to emulate the role of a central coordinating server. Each iteration begins with two servers selecting a group of users to participate and sharing the current global model with them. These users then use the cryptography module to securely share their local updates with the two servers. The servers then use an interactive protocol to combine these updates and find the aggregation. In this paper, we propose ByzSecAgg, a scheme for Byzantine-robust secure aggregation in a federated learning setting with a single server. The proposed scheme reduces the communication loads, and is robust against user dropouts, collusion and Byzantine adversarial attacks, and it involves the following steps: • Each user partitions its local update vector into smaller sub- vectors and broadcasts constant-size commitments of them, regardless of the size of the local update. This ensures that the sub-vectors can be proven to be unchanged during the scheme, while still keeping them hidden. • Users securely share these sub-vectors with others using ramp secret sharing, and these shares can be verified using the commitments. • Each user creates another polynomial function to send additional shares of their sub-vectors to other users, allowing for the computation of pairwise distance of shares through coded computing. • The server then uses these pairwise distances of shares to recover the pairwise distances of the true local updates. Using these distances, the server employs a distance-based outlier detection algorithm to select a subset of users for aggregation. • Finally, the server obtains the aggregation of local updates of the selected users by communicating with the users who locally aggregate the secret shares of the model updates that belong to the selected users. ByzSecAgg ensures the privacy of individual local models by performing computations using secret shares, which prevent users from learning the true values of local updates. Addition- ally, the server is not able to obtain any information about the local models beyond the aggregation and the pairwise distances. Furthermore, the commitments in ByzSecAgg are binding and computationally hiding. This means that users cannot obtain any information from the commitments, but they 2 are still able to verify the authenticity of the messages received from others and validity of sharings. Table I shows the comparison between the baseline frame- work BREA in [24] and ByzSecAgg in terms of the communi- cation loads. For a fair comparison, we consider three metrics: the server communication load, the per-user communication load and the commitments size. Server communication in- dicates the total size of all messages which are sent or received by the server, per-user communication denotes the total size of all messages which are sent by each user, and the commitments size represents the size of commitments made by users required for message verification. Compared with the baseline, as shown in Table I, in the system consisting of N users, ByzSecAgg reduces server and per-user communi- cation loads, as well as significantly decreasing commitment size. The proposed scheme allows for K, a design parameter, to be in the range [1 : N −D+1 − A − T ], where D, T and A denote the maximum number of dropouts, colluding users, and Byzantine adversaries, respectively, for which the scheme is designed. Based on system parameters N and L, which is the size of each local update, the optimal value of K for minimizing communication loads can be chosen. For instance, for large L, in extreme case we can choose K = O(N ), which significantly decreases the server and per-user communication loads. Note that in the special case when K = 1, the server and per-user communication loads in ByzSecAgg are equivalent to those in BREA. However, unlike BREA, the commitment size remains constant in ByzSecAgg, regardless of the size of local updates. 2 A. Notation For n ∈ N the notation [n] represents set {1, . . . , n}. In addition, for n1, n2 ∈ Z the notation [n1 : n2] denotes the set {n1, . . . , n2}. Furthermore, the cardinality of set S is denoted by |S|. In addition, we denote the difference of two sets A, B as A\B, that means the set of elements which belong to A but not B. In addition, E[X] and H(X) refer to the expected value and the entropy of random value X respectively. Pr(A) is the probability of event A. II. PROBLEM FORMULATION We consider the Byzantine-robust secure aggregation prob- lem, for a federated learning system, consisting of a server and N users. The objective of the server is to train a global model wg ∈ RL, with dimension L ∈ N, using the data held at users, by minimizing a global cost function L(wg). In round t of the training phase, the server broadcasts the global model w(t) g ∈ RL to all users. Then each user n, n ∈ [N ] computes a private local update wn ∈ RL based on its private local dataset. In this paper, we focus on perfect secure aggregation schemes, which rely on operations in a finite field to protect the privacy of the local updates [6]–[14]. Consider that each user employs an element-wise stochastic quantization method that involves a rounding function Q : R → R and a mapping function Λ : R → F, which maps the integer numbers to elements of a finite field F. The finite field is considered TABLE I COMMUNICATION LOADS OF BYZANTINE-ROBUST SECURE AGGREGATION FRAMEWORKS IN FEDERATED LEARNING. HERE N IS THE TOTAL NUMBER OF THE USERS, L IS THE LOCAL UPDATES SIZE, T IS THE NUMBER OF COLLUDING USERS, D IS THE NUMBER OF DROPOUTS, A IS THE NUMBER OF BYZANTINE ADVERSARIES. IN BY ZSE CAG G, PARAMETER K ∈ [1 : N −D+1 − A − T ] CAN BE CHOSEN BASED ON THE NETWORK. 2 3 Approach BREA [24] ByzSecAgg Server communication (2A + T + 1)L + (T + A + 1 2 )N (N − 1) (1 + 2A+T K )L + (T + A + K − 1 2 )N (N − 1) Per-user communication N L + N (N −1) 2 N L + N (N −1) , K L + 3N (N −1) 2N 2 2 if K = 1 if K > 1 , (cid:40) Commitments size T N L N (2T + 1), N (3K + 4T − 2), if K = 1 if K > 1 (cid:40) large enough to prevent hitting the boundary in the process of aggregation. User n also has a collection of local random variables Zn, whose elements are selected uniformly at random from FL, and independently of each other and of the local updates. It is assumed that each user has an authenticated broadcast channel through which messages can be sent and received by all users. Additionally, it is assumed that each user has an error-free point-to-point communication link to every other user and the server. Let M(L) n→n′ ∈ F∗ ∪ {⊥} denote the message that user n sends to user n′ in finite field F in the algorithm. In addition, let X(L) n ∈ F∗ ∪ {⊥} denote the message sent by user n to the server. The null symbol ⊥ represents the case no message is sent. Here F∗ = ∪l∈NFl. The message M(L) n→n′ is a function of wn, Zn. We denote the corresponding encoding function by φ(L) is a function of wn, Zn, and the messages that user n has received from other users. We denote the corresponding encoding function by φ(L) n . Let Us refer to a subset of users selected by the server, and their local updates are used for aggregation. Let XS = {X(L) n }n∈S represent the set of messages the server receives from a subset of users S. The received messages from the users are decoded by the server using the decoding function ψ(L). Function Ω : (F∗)|S| → FL represents both the aggregation rule and the user selection method utilized by the server as the outlier detection method. The server updates the global model by applying function Ω to the decoded received messages, as n→n′. Similarly, X(L) n w(t+1) g = w(t) g − δtΛ−1 (cid:18) Ω(cid:0)ψ(L)(X(L) n , n ∈ S)(cid:1) (cid:19) , where δt is the learning rate at round t and Λ−1 : F → R is a demapping function. In this setting, we assume that a subset of users D ⊂ [N ] drops out, i.e., stay silent (or send ⊥ to other users and the server) during the protocol execution. We denote the maximum number of dropped-out users as D ∈ N. We also assume that some of the users collude to gain information about the local updates of the honest users. The maximum number of colluding users is denoted by T ∈ N. Furthermore, we also assume some of the users are Byzantine adversaries, who engage in adversarial behaviors of two dif- ferent types: (Type 1) The adversaries may aim to prevent the global model to converge and choose malicious local update parameters, i.e., poisoning attacks (Type 2) the adversaries inconsistent with the may send messages to other nodes, protocol. The maximum number of Byzantine adversaries in the system is denoted by A ∈ N. We consider that all Byzantine adversaries are probabilistic polynomial time (PPT) algorithms with respect to a security parameter κ ∈ N [28]. It means that the Byzantine adversaries can run an algorithm within polynomial time and uses probabilistic methods to try to break the security of the system with a given security parameter κ. Note that the identities of dropouts, colluding users, and Byzantine adversaries are not known beforehand. In addition, to enable verification of the messages in this adversarial system to protect against type 2 error, we use a vector commitment scheme. A vector commitment scheme is a cryptographic primitive that enables a user to commit to a vector with the following desirable features. It is compu- tationally infeasible to determine the committed vector from the commitment value. It is also computationally infeasi- ble to find a different vector that maps to the same com- mitment value. More precisely, vector commitment scheme VC=(Setup,Commit,Witness,Verify) includes the following components: • Setup: 1κ → (pp, sp): this protocol is run by a trusted or distributed authority at the beginning to take security parameter κ and generates some public parameters (pp) and some local secret parameters (sp). • Commit:(pp, ν) → C: this algorithm takes vector ν as input and outputs a commitment C. • Witness: (pp, ν) → ω: this algorithm takes vector ν as input and computes a witness ω. • Verify:(pp, C, ω) → b ∈ {True,False}: this algorithm takes a witness ω and a commitment C as input and returns either True or False based on the validity of the witness. A Byzantine-robust secure aggregation scheme consists of the encoding functions φ(L) n→n′, φ(L) n , n, n′ ∈ [N ], the decoding function ψ(L), the aggregation rule Ω, and the vector com- mitment scheme VC such that the following conditions are satisfied: 1. Correctness: • Correctness of Commitments: For an honest user n with quantized local update ̄wn of data and a com- mitment Cn = Commit(pp, ̄wn), the created wit- ness ωn = Witness(pp, ̄w) successfully satisfies Verify(pp, Cn, ωn) = True. • Correctness of the Final Result: Despite the presence of at most D dropouts, A Byzantine adversaries, and T col- luding users, the server maintains the capability to recover ̄w ≜ 1 ̄wn which must be the outcome of n∈Us |Us| Ω(cid:0)ψ(L)(X(L) n , n ∈ S)(cid:1). (cid:80) 2. Robustness against Byzantine Adversaries: • Commitment Binding: The algorithm Commit should create a binding and deterministic commitment to the data. For- mally, for adversary A who can simulate any user, it must hold (cid:18) Pr (pp, sp) ← Setup(1κ), (ν, ν′) ← A(pp, sp) : ν ̸= ν′ ∧ Commit(ν) = Commit(ν′) (cid:19) ≤ ε(κ), where function ε(.) is a negligible function, which means for all c > 0 there exists a kc such that for all k > kc we have ε(k) < 1 kc . In short, this means that a Byzantine adversary committer can present two distinct values of ν with the same commitment C with vanishing probability. • Global Model Resiliency: The aggregation rule Ω should prioritize global model resiliency, even in the presence of up to A Byzantine adversaries (type 1), by ensuring that at the end of each iteration, the output of the aggregation rule remains close to the true gradient. Formally, at each iteration of the training process, for the true gradient vector g ≜ ∇L(w(t) g ), the output of the aggregation rule, i.e., n , n ∈ S)(cid:1) must satisfy a well-defined gGAR ≜ Ω(cid:0)ψ(L)(X(L) closeness criterion ξ(gGAR, g, N, A). • Malicious Computation Results: The general scheme should maintain robustness against any malicious computation re- sults produced by Byzantine adversaries (type 2) that may be sent to the server and other users during each step of the scheme. 3. Privacy Constraint: • Hiding Property: If a proof (pp, Cn) and a witness ωn for quantized local update ̄wn, n ∈ [N ] are given and the verification Verify(pp,Cn,ωn) returns True, no user can figure out the value of ̄wn with non-negligible probability. • Privacy of Individual Local Updates: The privacy constraint ensures that no group of up to T colluding users can extract any information about the local models of other honest users. In addition, after receiving XS and colluding with up to T colluding users, the server should not gain any information about local updates of the honest users, beyond the aggregation of them, and beyond what is strictly required by the user selection (outlier detection) method. For a Byzantine-robust secure aggregation scheme satisfy- ing the above conditions, we define average per-user commu- nication load and the server communication load as follows: Definition 1 (Average per-user communication load). denoted by Ruser, is defined as the aggregated size of all messages sent by users, i.e., Ruser = 1 N (cid:88) n,n′∈[N ], n′̸=n (cid:0)H(M(L) n→n′) + H(X(L) n )(cid:1), where H(X) refer to the entropy of random variable X. Here, it represents the number of symbols (bits) required to transmit the messages. Definition 2 (Server communication load). denoted by Rserver, 4 is defined as the aggregated size of all messages received by the server, i.e., Rserver = (cid:88) n∈[N ] H(X(L) n ). In this paper, we propose ByzSecAgg, a novel single- server Byzantine-robust secure aggregation scheme to meet the aforementioned conditions. In ByzSecAgg, each user partitions its local update vector of length L into K smaller sub-vectors of length L K and broadcasts constant-size commit- ments of them. Users then use ramp sharing [29] to share the sub-vectors with others, which can be verified using the commitments. This method allows for a major reduction in communication loads, however, it makes computing the pairwise distances between the local updates and removing the outliers challenging. To address this issue, we use techniques inspired by coded computing [30]–[32], where each user runs another ramp sharing, where data vectors are embedded in the coefficients differently. These two sets of shares admit the computation of the pairwise distances in a very efficient way. The server then receives the pairwise distances of the shares, which are used to recover the pairwise distances of the local updates. These distances are used in the multi-Krum algorithm [18], as the outlier detection method, to select m users for aggregation. Finally, communication with the server is required so that the server can obtain the aggregation of local updates of the selected users. To be able to verify that users follow the sharing protocol correctly and also not change their data in the second round of sharing, we need to be able to verify it against some commitment. We suggest using some linear commitment scheme [33] that unlike many existing solutions, the size of the commitment remains constant and does not grow with the size of data. III. PRELIMINARIES it is essential In order to develop a secure aggregation scheme that is resilient to Byzantine adversarial behavior, particularly of type 1, to employ a robust aggregation method. Specifically, in this paper, we leverage the multi-Krum al- gorithm proposed in [18]. More in general, any alternative aggregation methods that are robust against type 1 adversarial attacks can also be employed in ByzSecAgg. A. Multi-Krum Algorithm In the distributed stochastic gradient descent (SGD) prob- lem, and in the presence of Byzantine adversaries (type 1), using the average of all users' gradients to update the model parameters is not robust since a single Byzantine user can cause an arbitrarily large error in the update. To handle this, the server must use a gradient aggregation rule (GAR) Ω that is resistant to malicious gradients that may be produced by up to A Byzantine adversaries. At iteration t, assume that each g , ζ (t) honest user n calculates an estimate w(t) n = G(w(t) n ) of the gradient of the cost function L, where ζ (t) is a n random variable representing the sample or mini-batch of samples drawn from user n's dataset, and w(t) is the global g model parameter received from the server. On the other hand, Byzantine adversarial users may send some arbitrary vector to the server (type 1 adversarial attack). One method to measure resilience against such Byzantine users is through the concept of (γ, A)-Byzantine resilience, as introduced and supported by convergence theories in [18]. g , ζ (t) i ), with E Definition 3 ((γ, A)-Byzantine Resilience [18]). Consider N vectors w1, . . . , wN ∈ RL which are gradient vectors received by the server from N users. If user i is non-Byzantine, then wi is independent identically distributed random vector, wi ∼ G(w(t) g ). Vector wi for a Byzantine user can be any arbitrary vector. For any angular value 0 ≤ γ < π/2 and any integer 0 ≤ A ≤ N denoting the maximum number of Byzantine adversaries, a gradient aggregation rule (GAR) Ω is called (γ, A)-Byzantine resilient if vector wGAR ≜ Ω(w1, . . . , wN ) satisfies the following two conditions: G = ∇L(w(t) ζ(t) i 1) ⟨E[wGAR], g⟩ ≥ (1 − sin γ)∥g∥2 > 0, where g is the true gradient g ≜ ∇L(w(t) g ). 2) For r ∈ {2, 3, 4}, E[∥wGAR∥r] by E[∥wGAR∥r] ≤ c (cid:80) r1+***+rk=r where c is a generic constant and r1, . . . , rk are non- negative integers. is upper bounded E[∥G∥r1] . . . E[∥G∥rk ], In this definition, Condition 1 ensures that the angle between the true gradient g and the output wGAR is small enough and on average the output is in the same direction as the true gradient. Condition 2 ensures that the second, third, and fourth-order moments of the output of the gradient aggregation rule are bounded by a linear combination of the moments of a correct estimator of the gradient. This is generally necessary to ensure the convergence of the SGD algorithm. Krum algorithm [18] is a gradient aggregation rule which is resilient to the presence of A Byzantine adversaries users in a distributed system consisting of N users as long as N > 2A + 2. The Krum aggregation algorithm returns the gradient computed by the user with the lowest score, which is determined by considering the N − A − 2 closest gradients to that user's gradient. More precisely, let w1, . . . , wN be the gradients received by the server. Krum algorithm assigns to each vector wi score s(i) ≜ (cid:80) ∥wi − wj∥2, where i → j j:i→j denotes that wj belongs to the N − A − 2 closest vector (in terms of squared distance) to wi for any i ̸= j. The output of Krum algorithm is KR(w1, . . . , wN ) = wi∗ , where i∗ is the gradient with the lowest score, i.e., for all i we have s(i∗) ≤ s(i). ( [18]). Consider random vectors i.i.d. 1 Lemma ∈ RL such that wi ∼ G(wg, ζi), w1, . . . , wN with EG(wg, ζi) = ∇L(wg). Define Lσ2(wg) ≜ E[∥G(wg, ζi) − ∇L(wg)∥2]. Let ̃w1, . . . , ̃wA be any A random vectors that may depend on the wi's. If N > 2A + 2 Lσ < ∥∇L(wg)∥, where η(N, A) is defined as and η(N, A) (cid:115) √ η(N, A)≜ N − A + (cid:18) 2 A(N − A − 2) + A2(N − A − 1) N − 2A − 2 (cid:19) then the Krum algorithm is (γ, A)-Byzantine resilience, where 5 0 ≤ γ < π 2 is defined by sin γ = η(N,A) √ Lσ ∥∇L(wg)∥ . The convergence analysis of the SGD using Krum algorithm is presented in [18]. The proof relies on certain conditions regarding the learning rates and the gradient estimator. In addition, in that paper, a strongest variant of Krum algorithm is proposed called multi-Krum. In multi-Krum, m ∈ [N ], m < N − 2A − 2, gradient vectors wi∗ m are selected that have the lowest scores and the output of the algorithm is the average of the selected vectors, i.e., 1 m , . . . , wi∗ k=1 wi∗ (cid:80)m . 1 k The main goal of ByzSecAgg is to design a scheme that is efficient in terms of communication loads and ensures the privacy conditions, despite the presence of Byzantine users with adversarial behavior (type 1 and type 2), colluding users, and dropouts. IV. THE PROPOSED SCHEME In this section, we explain ByzSecAgg in details. Consider a federated learning system with one server and N users. The scheme is designed to handle a maximum number of T colluding users, a maximum number of D dropout users, and a maximum number of A Byzantine users, as defined in Section II. The adversaries are assumed to be probabilistic polynomial time (PPT) algorithms with respect to the secu- rity parameter κ. The set of colluding users, dropouts, and adversaries are not known beforehand. User n has a local update wn ∈ RL. We focus on perfect secure aggregation schemes, which rely on operations in a finite field to protect the privacy of the local updates [6]–[14]. We choose a finite field, GF (p) denoted by Fp, for some prime number p which is large enough. User n samples vectors Zn = {zn,j, j ∈ [T ]} and ̃Zn = { ̄zn,j, j ∈ [T ]} uniformly at p , for some parameter K ∈ N. In addition, random from F user n samples random scalars Rn = {r(j) n,i, i ∈ [2(K + T ) − 1]\{K}, j ∈ [N ]} uniformly at random from Fp. Each user takes the following steps: L K 1) Quantization: User n converts its local update vector wn ∈ RL in real numbers to vector ̄wn ∈ FL p in finite field. This conversion allows for the use of finite field operations, which play a crucial role in protecting the privacy of the local updates. To achieve this, each user first applies the stochastic rounding function in [24], [34] element-wise as follows Qq(x) = (cid:40) ⌊qx⌋ q ⌊qx⌋+1 q with probability 1 − (qx − ⌊qx⌋), with probability qx − ⌊qx⌋, (1) where integer q ≥ 1 is the number of quantization levels and ⌊x⌋ is the largest integer that is less than or equal to x. Note that the rounding function is unbiased, i.e., E[Qq(x)] = x. In addition, to represent negative values in the finite field, a mapping function is needed. The quantized version of the local update of user n denoted by ̄wn is defined as follows ̄wn ≜ Λ (cid:18) (cid:19) qQq(wn) , (2) , where Λ : R → Fp is a mapping function which is applied element-wise and defined as (cid:40) Λ(x) = x if x ≥ 0, x + p if x < 0. (3) It should be noted that in this step, any rounding function that ensures the convergence of the model can be utilized. There are no restrictions on selecting the rounding function in the proposed method. 2) Partitioning the local updates: User n partitions its quantized local update ̄wn into K ∈ Z sub-vectors, i.e., ̄wn = [ ̄wn,1, ̄wn,2, . . . , ̄wn,K]T , 2 K and − A − T ]. If the value of K does not where each part ̄wn,k, k ∈ [K] is a vector of size L K ∈ [1 : (N −D+1) divide L, we can zero-pad the quantized local models. 3) Broadcasting the Commitments: Since all steps are done in the presence of adversarial behavior of type 2, some initial hiding commitments are needed. This enables each user to commit to certain values without revealing any information about those values. Using the commitments, each user can verify that the messages being received are effectively the ones for which the commitment was created and ensure that all users follow the protocol honestly. Inspired by the commitment scheme in [33], we consider a scheme where each user n produces the commitments as follows C (n) i =    L (gβj−1 K(cid:81) j=1 L (gβj−1 K(cid:81) j=1 L )[ ̄wn,i]j , if i ∈ [K], )[zn,i−K ]j , if i ∈ [K + 1 : K + T ], (gβj−1 (gβj−1 K(cid:81) j=1 N (cid:81) j=1 )[ ̃zn,i−K−T ]j , if i ∈ [K + T + 1 : K + 2T ], )r(j) n,i−K−2T , if i∈[K+2T +1:3K+4T −1] , i̸=2K+2T (4) , gβ1 where [ ̄wn,i]j is the j-th entry of ̄wn,i, and g is a generator of cyclic group G with product operation, of prime order p ≥ 22κ. In addition, β ∈ Fp is a secret parameter generated by a trusted authority. The trusted authority then generates public parameters (gβ0 ). Recall that the size of each commitment is equal to a single group element. These commitments are binding, and computationally hiding under the assumption that the discrete logarithm problem is hard in G (see proofs in Subsection V). 4) Secret Sharing (First Round): User n forms the following polynomial function. , . . . , gβmax ( L ,N )−1 K 6 n sends one valuation of its created polynomial function at α ̃n to user ̃n, for ̃n ∈ [N ]. In particular, user n sends vector sn, ̃n ≜ Fn(α ̃n) to user ̃n, and each vector has a size of L K . In this step, if a user m drops out and stays silent, Fm(.) are just presumed to be zero. Since the proposed secret sharing is based on ramp sharing scheme, the local update is kept private against T colluding users by adding T independent random vectors in (5) to the message [14], [29]. 5) Verification (First Round): Having received the shares s ̃n,n from users ̃n ∈ [N ], user n can verify them. Since each evaluation of polynomial function F ̃n(x) is a linear combination (coded version) of its coefficients, due to the linear homomorphism, the verification of s ̃n,n can be done using the encoding of the commitments C ( ̃n) as follows i L K(cid:89) j=1 (gβj−1 )[s ̃n,n]j ?= K+T (cid:89) j=1 (C ( ̃n) j )αj−1 n . (6) Using this verification, user n ensures that it receives a valid evaluation of polynomial F ̃n(.) in (5). 6) Secret Sharing (Second Round): In this step, if K ≥ 2, user n forms the polynomial function ̃Fn(x) = K (cid:88) k=1 ̄wn,kxK−k + T (cid:88) t=1 ̃zn,txK+t−1, (7) and sends ̃sn, ̃n ≜ ̃Fn(α ̃n) to user ̃n for n, ̃n ∈ [N ]. In addition, user n creates the scalar polynomial function N (j) n (x) = 2(K+T )−1 (cid:88) i=1,i̸=K r(j) n,ixi−1, for j ∈ [N ]\{n}, (8) and sends N (j) ≜ N (j) n, ̃n coefficient of xK−1 in polynomial N (j) n (α ̃n) to user ̃n for j ∈ [N ]\{n}. The n (x) is equal to zero. In this step, each user communicates with other users and sends a vector of size L K and N − 1 scalar values. It is worth nothing that the structure of the created polynomial function ̃Fn(x) in this step is different from the polynomial in Step 4. Note that for K = 1, the second round of secret sharing is not necessary, and only the first round is enough. 7) Verification (Second Round): To ensure that user n receives a valid evaluation of polynomials ̃F ̃n(x) and N (j) ̃n (x) from user ̃n, it can check L K(cid:89) (gβj−1 )[ ̃s ̃n,n]j ?= j=1 K (cid:89) (C ( ̃n) j )αK−j n K+2T (cid:89) j=1 i=K+T +1 (C ( ̃n) i )αi−T −1 n , N (cid:89) (gβj−1 )N (j) ̃n,n ?= 3K+4T −1 (cid:89) (C ( ̃n) i )αi−K−2T −1 n , (9) Fn(x) = K (cid:88) k=1 ̄wn,kxk−1 + T (cid:88) t=1 zn,txK+t−1, (5) j=1 i=K+2T +1, i̸=2K+2T where the coefficient of K first terms are the partitions of ̄wn,k, for k ∈ [K]. Each user n uses its polynomial function Fn(.) to securely share its local update with other users. Let {αi ∈ Fp : i ∈ [N ]} be a set of N distinct non-zero values in Fp. This set is revealed to all users, such that each user using the available commitments. In this verification, user n can not only confirm that it receives a valid evaluation of polynomial ̃F ̃n(x) from user ̃n, but it can also ensure that user ̃n correctly creates polynomial ̃F ̃n(x) without any malicious behavior. This is because the initial commitments made in Step 3 are utilized for verification. 8) Computing Noisy Inner Products of Shares: In this step, user n calculates the following inner product and sends the result to the server. i,j = ⟨Fi(αn) − Fj(αn), ̃Fi(αn) − ̃Fj(αn)⟩ + N (j) ̄d(n) i,n + N (i) j,n, (10) where i, j ∈ [N ] and i < j. Here, one can see that the inner product of the shares, ̄d(n) i,j , is an evaluation of a polynomial function ̄di,j(x) ≜ 2(K+T −1) (cid:88) l=0 al;i,jxl + N (j) i (x) + N (i) j (x), (11) at point αn, where al,i,j is the coefficient of xl. In this expansion, it can be shown that the coefficient of xK−1 is K (cid:88) aK−1,i,j = ∥ ̄wi,k − ̄wj,k∥2. k=1 i,j = ∥Fi(αn) − Fj(αn)∥2 For K = 1, user n computes ̄d(n) and sends the result to the server. 9) Distance Recovery at the Server: Since ̄di,j(x) is a polynomial function of degree 2(K +T −1), the server can use Reed-Solomon decoding [35] to recover all the coefficients of this polynomial using 2(K + T ) − 1 evaluations of ̄di,j(x). Since in the setting, there are at most A adversarial users (type 2), ̄di,j(x) can only be correctly recovered if the server least 2(K + T + A) − 1 outcomes from the receives at users. In addition, ̄d(n) i,j , for that are sent to the server from the non-adversarial users n ∈ [N ]\D are indeed equal to ̄di,j(αn), for i < j ∈ [N ]. Therefore, the server is able to recover ̄di,j(x). The coefficient of xK−1 in ̄di,j(x) is equal to aK−1;i,j = ∥ ̄wi − ̄wj∥2 that the server looks for in order to find the outliers. According to (10), the remaining recovered coefficients of ̄di,j(x) are distorted by noise and do not disclose any additional details about the local updates apart from the targeted pairwise distance sought by the server. Then the server converts the calculated distances from the finite field to the real domain as follows. Λ−1(aK−1;i,j) q2 di,j = , (12) where Λ−1 : Fp → R is a demapping function which is applied element-wise and is defined as Λ−1( ̄x) = (cid:40) ̄x ̄x − p if p−1 if 0 ≤ ̄x < p−1 2 , 2 ≤ ̄x < p. (13) Assuming a sufficiently large field size p, we can guarantee the accurate recovery of pair-wise distances. 10) Outlier Detection at the Server: A distance-based outlier detection method (or a closeness criterion) can be employed to make sure that the local updates selected by the server are consistent with each other. This will help to eliminate any local updates that are significantly different from the others (adversarial behavior of type 1) and may not be suitable for inclusion in the update. In this scheme, multi-Krum algorithm (see [18] and Subsection III-A) is utilized for this purpose. Upon completion of the algorithm, the server selects a group 7 of m users whose local updates are close to each other and broadcasts a list of the chosen users, denoted by Us ⊂ [N ]. the multi-Krum algorithm ensures the As stated in [18], resiliency of the global model, as defined in Section II, and the convergence of the sequence of gradients (See Subsection V). 11) Aggregation of the Shares: Each user calculates the aggregation of shares of users belong to set Us, i.e., sn = (cid:80) F ̃n(αn), and sends it to the server. In this step, each user sends a vector of size L 12) Recovering the Aggregation: Let us define K to the server. ̃n∈Us Fn(x) = K (cid:88) k=1 xk−1 (cid:88) n∈Us ̄wn,k (14) F(x) ≜ (cid:88) n∈Us T (cid:88) + xK+t−1 (cid:88) n∈Us zn,t, t=1 as a polynomial of degree K + T − 1. Let XS ≜ {sn}n∈S denote the set of messages received by the server, where S = [N ]\D. We note that sn, for non-Byzantine users, is the evaluation of F(x) at αn. Thus, if the server receives a minimum of K + T + 2A results from the users, it can accurately recover the polynomial function F(x) using Reed- Solomon decoding. In this decoding process, the first K terms correspond to the partitions of ̄w = (cid:80) ̄wn. To ensure suc- cessful aggregation, the field size p must be sufficiently large to avoid encountering boundary issues during the process. n∈Us After recovering the aggregate of the users' local updates, the server updates the global model for the next iteration using the following procedure. w(t+1) g = w(t) g − δt q|Us| Λ−1(cid:0) ̄w(cid:1), (15) where demapping function Λ−1(.) is defined in (13), and δt is the learning rate at round t. Algorithm 1 summarizes ByzSecAgg based on the afore- mentioned steps. Remark 1: The proposed scheme uses some methods to mitigate adversarial behaviors of type 1 and type 2. To protect against adversarial behavior of type 1, where attempts are made to manipulate the global model at the server by altering their local updates, ByzSecAgg employs a distance- based outlier detection mechanism (multi-Krum algorithm). This mechanism ensures the robustness of the global model against such adversarial modifications. Additionally, to protect the privacy of local updates in the outlier detection mech- anism, ByzSecAgg proposes a privacy-preserving distance computation method, inspired by ramp secret sharing and coded computing. For protection against adversarial behavior of type 2, first a vector commitment scheme is utilized in ByzSecAgg to ensure that users follow the protocol correctly when creating secret shares of their local updates in two different rounds. In addition, the ideas from error-correcting codes are used to ensure the correctness of the calculations of users. Remark 2: To eliminate outliers while minimizing commu- Algorithm 1 The proposed Byzantine-Resistant Secure Ag- gregation Scheme: ByzSecAgg 1: for each iteration t = 0, . . . , T do 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: i from the server , i ∈ [3K + 4T − 1] for each user n ∈ [N ] in parallel do Get the global model w(t) g Compute the local update wn based on the local dataset Create the quantized update ̄wn from (2) Partition the local update into K parts Generate commitments C (n) from (4) and broadcast them Compute the first-round secret share sn, ̃n from (5) and send to user ̃n ∈ [N ] Verify the received shares {s ̃n,n} ̃n∈[N ] using (6) Compute the second-round secret shares ̃sn, ̃n and noises shares {N (j) n, ̃n}j∈[N ] using (7) and (8) re- spectively and send to user ̃n ∈ [N ] Verify the received shares ̃s ̃n,n and {N (j) by testing (9) Compute values ̄d(n) and send to the server i,j , for i, j ∈ [N ], using (10) ̃n,n}j∈[N ] end for Server recovers pairwise distances ∥ ̄wi − ̄wj∥2, for i < j ∈ [N ] after receiving the result using Reed- Solomon decoding Server converts the calculated distances from the finite field to the real domain and recovers {di,j}i<j∈[N ] using (12). Server selects set Us of users by applying multi-Krum algorithm on {di,j}i<j∈[N ] Server broadcast set Us to all users for user n = 1, . . . , N do Calculate the aggregation of the first-round shares of users belong to set Us and send the result to the server end for Server recovers ̄w = (cid:80) ̄wn after receiving suffi- n∈Us cient results from users and employing Reed-Solomon decoding Server updates the global model using (15) 22: 23: end for nication requirements, ByzSecAgg uses two different rounds of secret sharing to securely calculate the pairwise distance between the local updates. It is worth noting that the second round of secret sharing is designed to only allow the server to calculate the pairwise distance between the local updates, rather than the pairwise distance between the partitions of local updates. V. ANALYSIS OF THE PROPOSED SCHEME A. Main results In this subsection, we present the main results, achieved by ByzSecAgg described in Section IV. 8 t δ2 t δt = ∞ and (cid:80) function L is Theorem 1. We assume that (i) the cost three times differentiable with continuous derivatives, and is non-negative, i.e., L(x) ≥ 0; (ii) the learning rates satisfy (cid:80) t < ∞; (iii) the second, the third, and the fourth moments of the quantized gradient estimator satisfy EQ,ζ∥Qq(G(wg, ζ))∥r ≤ Ar + Br∥wg∥r for some constant Ar and Br, where r ∈ 2, 3, 4; (iv) there exist for all wg ∈ RL, a constant 0 ≤ γ < π/2 such that 4q2 ≤ ∥∇L(wg)∥ sin γ; (v) the gradi- η(N, A) ent of the cost function L satisfies that for ∥wg∥2 ≥ R, there exists constants ε > 0 and 0 ≤ θ < π/2 − γ such that Lσ2(wg) + L (cid:113) ∥∇L(wg)∥ ≥ ε > 0, g L(wg) ∥wg∥∥∇L(wg)∥ ≥ cos θ. wT Then, ByzSecAgg guarantees, • Robustness against D dropouts, and A Byzantine adver- sarial users (Type 1 and Type 2) such that the trained model is (γ, A)-Byzantine resilient, • The sequence of the gradients ∇L(w(t) g ) converges al- most surely to zero, • Any group of up to T colluding users cannot extract any information about the local models of other honest users. The server cannot gain any information about local updates of the honest users, beyond the aggregation of them and pair-wise distances. In addition, the communication loads in ByzSecAgg are as follows Rserver = (cid:0)1 + Ruser ≤ min( (cid:1)L + (T + A + K − 2A + T K , N )L + (cid:0)1 + 2I(K > 1)(cid:1) N (N − 1) 1 2 )N (N − 1), , 2N K 2 2 symbols from Fp, where I(.) is an indicator function, for some K ∈ N in [1 : N −D+1 − A − T ] N ≥ 2A + D + max(2K + 2T − 1, m + 3) and m < N − 2A − D − 2. Furthermore, the size of the commitment for each user in the achievable scheme remains constant, equal to (K +2T )+I(K > 1)(2K +2T −2), regardless of the size of the individual local updates, i.e., L. Remark 3: As explained in Section IV, K and m are designed parameters. K is the number of partitions of the local updates. By changing K, one can change Rserver and Ruser. One option is to choose K such that the aggregation of the per- user communication load and the server communication load is minimized. On the other hand, m is the number of users whose local updates are selected by the server for aggregation, as discussed in Subsection III-A and Section IV. Proof. In the following, we prove that ByzSecAgg satisfies the following conditions: 1) Correctness: • Correctness of Commitments: The function h(x) ≜ gx, in (4), creates a bijection mapping between the finite field Fp and cyclic group G, where g is a generator of G. This function also has the linear homomorphic property which states that ∀a1, . . . , an ∈ Fp and ∀x1, . . . , xn ∈ Fp we have (cid:19) (cid:18) n (cid:88) h n (cid:89) aixi = h(xi)ai. i=1 i=1 If the user is honest, it will share the evaluations of the same polynomial Fn(x) (cid:0) ̃Fn(x) and N (j) n (x)(cid:1) in the first (sec- ond) round of secret sharing that it had initially committed to in Step 3. Due to the linearly homomorphic property of the commitments in (4), the verification step in (6) (in (9)) passes for the shares of the honest user. • Correctness of the Final Result: The received vectors by the server at the end of Step 12 are different evaluations of polynomial F(x) of degree K + T − 1 defined in (14). The correctness condition of the final result of ByzSecAgg is satisfied as the server can correctly recover (cid:80) ̄wn by utilizing the Reed-Solomon decoding after receiving K + T + 2A outcomes from the users with at most A adversarial outcomes. n∈Us 2) Robustness against Byzantine Adversaries: • Commitment Binding: The Discrete Logarithm (DL) As- sumption [36] states that given a prime p, a generator g of G, and an element a ∈ Fp, no adversary with a probabilistic polynomial-time algorithm can compute a given g and ga, i.e., Pr[A(cid:0)g, ga(cid:1) = a] = ε(κ) (negligible) for any such adversarial algorithm A. In addition, consider the polynomial function qwn,i (x) de- fined as qwn,i (x) ≜ [ ̄wn,i]1 + x[ ̄wn,i]2 + * * * + x L K −1[ ̄wn,i] L K , i ≜ gqwn,i (β) = gqνn,i (β). where [ ̄wn,i]j is the j-th entry of the i-th partition of the quantized local update ̄wn. It can be verified that commitments C (n) in (4) for i ∈ [K] are equal to gqwn,i (β). i By contradiction, assume that there exists an adversary A that breaks the binding property of commitments. This means that the adversary creates two vectors ̄wn,i and ̄νn,i, where ̄wn,i ̸= ̄νn,i but C (n) In this case, it can be shown that the adversary can break the DL assumption, which means it is able to recover secret β by having gβ. Define the polynomial function ̃q(x) as qwn,i(x)−qνn,i(x). The corresponding commitment is equal to ̃C (n) ≜ g ̃q(β) = gqwn,i (β)/gqνn,i (β) = 1 because the i commitment scheme is homomorphic. Therefore, ̃q(β) = 0, which means that β is a root of the polynomial ̃q(x). The adversary can easily solve the instance of the discrete logarithm problem and find the secret parameter β by factoring ̃q(x) [37]. This implies that breaking the biding property would enable solving a problem that is assumed to be computationally difficult, reinforcing the notion that the commitment scheme must possess the biding property. Additionally, for the evaluation binding, we can present a similar argument. Let's assume there exists an adversar- ial algorithm A that breaks the evaluation binding prop- erty of commitment C and computes two different eval- uations for Fn(x) in (5) at point α that satisfy Verify in (6). We can construct an algorithm B that uses A to break the DL assumption. B presents a DL instance (g, gβ, . . . , gβ K ). Algorithm A outputs commitments C L 9 and two distinct values for share, i.e., Fn(α) and F′ n(α), that satisfy (6). Specifically, we have L (gβj−1 K(cid:81) j=1 )[Fn(α)]j = L (gβj−1 K(cid:81) j=1 )[F′ n(α)]j = L K+T (cid:81) j=1 (C (n) j )αj−1 . Consequently, we observe that (gβj−1 )[Fn(α)]j −[F′ n(α)]j = 1. This K(cid:81) j=1 j=1 xj−1([Fn(α)]j − [F′ that β is a root of polynomial F ′′(x) = implies (cid:80) L n(α)]j). Therefore, algorithm B K can compute β by factoring F ′′(x) once it receives the results from A. Thus, the success probability of solving the DL instance is the same as the success probability of A. • Malicious Computation Result (Type 2 Adversarial Attack): Here we discuss the adversarial attack of type 2 and how ByzSecAgg resolves it: – The transmission of invalid secret shares in Step 4 and Step 6: this kind of attack is thwarted through the utiliza- tion of the commitments, in which the validity of secret shares at each round can be confirmed by verifying (6) and (9), provided that N − D ≥ 2A + 1. – The transmission of incorrect pairwise distance of shares to the server in Step 8 or incorrect aggregation of the shares of selected users in Step 11: since the values sent at each of these two steps must represent different evaluation points of a certain polynomial, this kind of attack will be detected and corrected based on Reed-Solomon decoding algorithm with at most D erasures and at most A errors, provided that N − D ≥ 2(K + T + A) − 1 in Step 8 and N − D ≥ K + T + 2A in Step 11. g , ζ (t) • Global Model Resiliency (Type 1 Adversarial Attack): Byzantine users have the ability to modify their local up- dates to manipulate the global model and can send arbitrary vectors as their local updates to the server. Additionally, in line with classical assumptions in machine learning literature, each data sample used for computing the local update is uniformly and independently drawn by honest users. To detect outliers, ByzSecAgg uses the multi-Krum algorithm introduced in Subsection III-A. Instead of the estimator G(w(t) n ), in the proposed scheme, the local update of the honest user is created using the quantized estimator Qq(G(w(t) is demonstrated that even when the multi-krum algorithm is applied to the quantized vector Qq(wn) (as used in Step 1 of the proposed scheme), it remains (α, A)-Byzantine resilient and the sequence of the gradients converges almost surely to zero. This is due to the fact that the quantization is unbiased and has a bounded variance. According to Subsection III-A if m < N − 2A − D − 2, the multi-Krum algorithm can prevent this type of attack and ensure that the scheme is (γ, A)-Byzantine resilient and guarantees the convergence. Note that the first five conditions in Theorem 1, i.e., (i)- (v), are essential in the convergence proof of multi-Krum algorithm (see [18], [24]). n )). In [24], g , ζ (t) it 3) Privacy Constraint: • Hiding Property: For the sake of contradiction, suppose there exists an adversarial algorithm A that can break the hiding property of commitment C and correctly compute vector ν ∈ Fp. We will demonstrate how to utilize A to construct another algorithm B that can break the Discrete Logarithm (DL) assumption. Let (g, ga) be a DL instance that B aims to solve. B se- p and computes (g, g ̃β, . . . , g ̃βL−1 lects a random ̃β ∈ FL ). It then considers a vector ν = [a, ν1, ν2, . . . , νL], where ν1, ν2, . . . , νL−1 ∈ Fp are chosen arbitrarily, and the first entry of the vector a is the answer for the DL instance. Since B knows ga, it can compute the vector commitment as C = ga.g and sends it to A. Upon receiving the commitment, A computes and returns vector ν. At this point, B can extract the solution a, as it corresponds to the DL instance. Thus, the success probability of solving the DL instance using B is equiva- lent to the success probability of A. The aforementioned construction illustrates that if an adversary A can break the hiding property of commitment C, then we can utilize it to construct another algorithm B capable of breaking the DL assumption. (cid:80) i=1L−1νi ̃βi i • Privacy of Individual Local Updates: The hiding property of the commitments ensures that neither the server nor any user can compute the local model ̄wn (as well as noise vectors zn and ̃zn) from the commitments C (n) in (4). Thus, by considering the messages exchanged during the scheme, it is sufficient to stablish the privacy of each local update against a group of up to T colluding users, denoted by set T . Denote the colluding users by ̃U1, ̃U2, . . . , ̃UT . Let us define the set of messages received by ̃Ui as M ̃Ui , which includes two types of messages: sn,i, ̃sn,i and N j n,i for n, j ∈ [N ] \ {T ∪ D}, j ̸= n. These messages correspond to the shares from the first and second round of secret sharing in Step 4 and Step 6, respectively. According to (5) and (7), the fact that the random vectors are chosen uniformly and independently at random from F p , and directly from the privacy guarantee in ramp secret sharing [29], for n ∈ [N ] \ T , we have L K Pr(cid:0) ̄wn = ν(cid:12) (cid:12)M ̃Ui = Pr(cid:0) ̄wn = ν(cid:12) = Pr(cid:0) ̄wn = ν(cid:1), , i ∈ [T ](cid:1) (cid:12)sn,i, ̃sn,i, i ∈ [T ](cid:1) ̃n∈Us which means that the colluding users cannot gain any further information about the local updates of the other users. Furthermore, the server is also provided with ̄d(n) for i,j i < j ∈ [N ] and sn = (cid:80) s ̃n,n from users n ∈ [N ] \ D, from which it can reconstruct ̄d(n) i,j (x) as defined in (11), as well as the polynomial function F(x) as defined in (14). Therefore, from F(x) the server can recover the aggregation ̄w = (cid:80) ̄wn and from the coefficient of xK−1 in ̄d(n) i,j (x) it can recover the mutual distance ∥ ̄wi − ̄wj∥2. It is important to note that due to the inclusion of random noises during the computation in Step 8 by each user, the server cannot retrieve any other details about the local models. The only information that n∈Us 10 can be obtained are the mutual distances between the models, which play a vital role in outlier detection. Communication Loads in the Proposed Scheme: According to Step 12, the total number of vectors that are needed to be received by the server to recover the final aggregation is T +K +2A, each of size L K symbols. Moreover, in order to recover the pairwise distance di,j between ̄wi and ̄wj, the server needs 2(K + T + A) − 1 symbols of size a single field element from the users, for i, j ∈ [N ], i ̸= j. the server communication load in ByzSecAgg is Thus, (cid:1)L + (T + A + K − 1 Rserver ≤ (cid:0)1 + 2A+T 2 )N (N − 1), where the inequality is a result of the presence of dropped-out users in the setting. K In ByzSecAgg, each user participates in two rounds of secret sharing. In the first round, they send one vector of size L K symbols and in the second round, they send one vector of size L K + N symbols to each of the other users. Additionally, each user sends one vector of size L K symbols to the server. However, if K = 1, the second round of secret sharing is not performed. In addition, each user sends at most N (N −1) pair- wise distances of size a single field element to the server. Thus, the per-user communication load in ByzSecAgg is upper-bounded as Ruser ≤ 2N . In addition, the commitment size for each user is only K + 2T symbols when K = 1, and 3K + 4T − 2 symbols when K > 1, where each symbol has the size of a single group element. K L + 3N (N −1) 2 2 Therefore, the communication loads Rserver and Ruser in The- orem 1 are achieved. Additionally, according to discussions in Subsection V to meet all requirements, the inequality N ≥ 2A + D + max(2K + 2T − 1, m + 3), (16) must be fulfilled. In addition, the following condition 1 ≤ K ≤ N − D + 1 2 must be satisfied for the number of partitions of the local updates, where K ∈ Z. − A − T, (17) B. Comparison with BREA [24] The comparison results between ByzSecAgg and BREA [24] are summarized in Table I, which highlights the dif- ferences between the two schemes based on the defined parameters. This subsection presents a comparison between these two schemes in terms of communication loads in various simulation scenarios. Figure 1 compares the communication loads, measured in symbols, between ByzSecAgg and BREA. The simulation involves N = 1000 users, with T = 0.1N colluding users, A = 0.1N Byzantine adversaries, and D = 0.2N potential dropouts. The comparison focuses on three metrics: (a) per- user communication load, (b) server communication load, and (c) commitment size. Various neural networks, includ- ing GoogleNet [38], ResNet [39], and AlexNet [40], with different parameter numbers (L) are considered. The results demonstrate that ByzSecAgg achieves order-wise reduction in communication loads and commitment sizes compared to BREA. In this comparison, for ByzSecAgg, the number of 11 (a) (b) (c) Fig. 1. The comparison of communication loads, measured in symbols, between ByzSecAgg and BREA [24] with varying number of local update parameters (L). The figure illustrates the comparison using N = 1000 users, including T = 0.1N colluding users, A = 0.1N Byzantine adversaries, and D = 0.2N potential dropouts. Three metrics are considered: (a) per-user communication load, (b) server communication load, and (c) commitment size. (a) (b) (c) Fig. 2. The comparison of ByzSecAgg and BREA [24] in terms of communication loads while varying the number of users. The experiment considers ResNet34 with L = 21.8M parameters. Out of the total users (N ), T = 0.1N are colluding users, A = 0.1N are Byzantine adversaries, and D = 0.2N may drop out. The comparison evaluates three metrics: (a) per-user communication load, (b) server communication load, and (c) commitment size. partitions (K) is selected to minimize the aggregation of per- user communication load and server communication load. As it is shown, the commitment size of the proposed scheme remains constant and is not influenced by the length of local updates. The slight variations observed in the graph are due to changes in the selected value for K. Figure 2 illustrates the communication loads of the two schemes as the number of users (N ) varies. The simulation considers L = 21.8M parameters, T = 0.1N colluding users, A = 0.1N Byzantine adversaries, and D = 0.2N dropouts. Similarly, in this comparison, for ByzSecAgg the number of partitions (K) is selected to minimize the aggregation of per-user communication load and server communication load. Note that compared to BREA, the proposed scheme achieves the same performance in terms of convergence and resilience properties. VI. CONCLUSION In this paper, we propose ByzSecAgg, an efficient se- cure aggregation scheme for federated learning that mitigates Byzantine adversarial attacks while protecting the privacy of local updates. ByzSecAgg employs techniques individual such as ramp secret sharing and coded computing to reduce communication loads and enable secure computation of pair- wise distances, which are used for distance-based outlier de- tection algorithms. Additionally, we use a linear commitment scheme with a constant commitment size to ensure message integrity during the protocol and protect against adversarial behaviors of Byzantine users. In terms of communication loads, ByzSecAgg outperforms the state-of-the-art BREA and offers the advantage of a constant commitment size, regardless of local update sizes. Furthermore, it achieves the same level of performance in terms of convergence and resilience properties. REFERENCES [1] B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas, "Communication-efficient learning of deep networks from decentralized data," in Artificial intelligence and statistics, pp. 1273–1282, PMLR, 2017. [2] P. Kairouz, H. B. McMahan, B. Avent, A. Bellet, M. Bennis, A. N. Bhagoji, K. Bonawitz, Z. Charles, G. Cormode, R. Cummings, et al., "Advances and open problems in federated learning," arXiv preprint arXiv:1912.04977, 2019. [3] T. Li, A. K. Sahu, A. Talwalkar, and V. Smith, "Federated learning: Challenges, methods, and future directions," IEEE Signal Processing Magazine, vol. 37, no. 3, pp. 50–60, 2020. [4] L. Zhu and S. Han, "Deep leakage from gradients," in Federated learning, pp. 17–31, Springer, 2020. [5] J. Geiping, H. Bauermeister, H. Dröge, and M. Moeller, "Inverting gradients–how easy is it to break privacy in federated learning?," arXiv preprint arXiv:2003.14053, 2020. 02040608010012014010810910101011GoogleNetResNet18ResNet34AlexNetVGG1602040608010012014010910101011GoogleNetResNet18ResNet34AlexNetVGG1602040608010012014010210310410510610710810910101011GoogleNetResNet18ResNet34AlexNetVGG16010020030040050060070080090010001081091010010020030040050060070080090010001081091010010020030040050060070080090010001001011021031041051061071081091010 12 [29] G. R. Blakley and C. Meadows, Security of ramp schemes, pp. 242–268. 1984. [30] K. Lee, M. Lam, R. Pedarsani, D. Papailiopoulos, and K. Ramchandran, "Speeding up distributed machine learning using codes," IEEE Trans- actions on Information Theory, vol. 64, no. 3, pp. 1514–1529, 2017. [31] Q. Yu, M. Maddah-Ali, and S. Avestimehr, "Polynomial codes: an opti- mal design for high-dimensional coded matrix multiplication," Advances in Neural Information Processing Systems, vol. 30, 2017. [32] H. Akbari-Nodehi and M. A. Maddah-Ali, "Secure coded multi-party computation for massive matrix operations," IEEE Transactions on Information Theory, vol. 67, no. 4, pp. 2379–2398, 2021. [33] K. Nazirkhanova, J. Neu, and D. Tse, "Information dispersal with provable retrievability for rollups," arXiv preprint arXiv:2111.12323, 2021. [34] S. Gupta, A. Agrawal, K. Gopalakrishnan, and P. Narayanan, "Deep learning with limited numerical precision," in International conference on machine learning, pp. 1737–1746, PMLR, 2015. [35] S. Lin and D. J. Costello, Error control coding, vol. 2. Prentice hall New York, 2001. [36] A. Kate, G. M. Zaverucha, and I. Goldberg, "Constant-size commitments to polynomials and their applications," in International conference on the theory and application of cryptology and information security, pp. 177– 194, Springer, 2010. [37] V. Shoup, A computational introduction to number theory and algebra. Cambridge university press, 2009. [38] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich, "Going deeper with convolutions," in Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1–9, 2015. [39] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. [40] A. Krizhevsky, I. Sutskever, and G. E. Hinton, "Imagenet classification with deep convolutional neural networks," Communications of the ACM, vol. 60, no. 6, pp. 84–90, 2017. [6] K. Bonawitz, V. Ivanov, B. Kreuter, A. Marcedone, H. B. McMahan, S. Patel, D. Ramage, A. Segal, and K. Seth, "Practical secure aggregation for privacy-preserving machine learning," in proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 1175–1191, 2017. [7] J. So, B. Güler, and A. S. Avestimehr, "Turbo-aggregate: Breaking the quadratic aggregation barrier in secure federated learning," IEEE Journal on Selected Areas in Information Theory, vol. 2, no. 1, pp. 479–489, 2021. [8] J. H. Bell, K. A. Bonawitz, A. Gascón, T. Lepoint, and M. Raykova, "Secure single-server aggregation with (poly) logarithmic overhead," in Proceedings of the 2020 ACM SIGSAC Conference on Computer and Communications Security, pp. 1253–1269, 2020. [9] B. Choi, J.-y. Sohn, D.-J. Han, and J. Moon, "Communication- computation efficient secure aggregation for federated learning," arXiv preprint arXiv:2012.05433, 2020. [10] Y. Zhao and H. Sun, "Information theoretic secure aggregation with user dropouts," in 2021 IEEE International Symposium on Information Theory (ISIT), pp. 1124–1129, IEEE, 2021. [11] R. Schlegel, S. Kumar, E. Rosnes, and A. G. i Amat, "Codedpaddedfl and codedsecagg: Straggler mitigation and secure aggregation in feder- ated learning," IEEE Transactions on Communications, 2023. [12] J. So, C. He, C.-S. Yang, S. Li, Q. Yu, R. E Ali, B. Guler, and S. Avestimehr, "Lightsecagg: a lightweight and versatile design for secure aggregation in federated learning," Proceedings of Machine Learning and Systems, vol. 4, pp. 694–720, 2022. [13] T. Jahani-Nezhad, M. A. Maddah-Ali, S. Li, and G. Caire, "Swiftagg: Communication-efficient and dropout-resistant secure aggregation for federated learning with worst-case security guarantees," in 2022 IEEE International Symposium on Information Theory (ISIT), pp. 103–108, 2022. [14] T. Jahani-Nezhad, M. A. Maddah-Ali, S. Li, and G. Caire, "Swiftagg+: Achieving asymptotically optimal communication loads in secure ag- gregation for federated learning," IEEE Journal on Selected Areas in Communications, vol. 41, no. 4, pp. 977–989, 2023. [15] S. Shen, S. Tople, and P. Saxena, "Auror: Defending against poisoning attacks in collaborative deep learning systems," in Proceedings of the 32nd Annual Conference on Computer Security Applications, pp. 508– 519, 2016. [16] E. Bagdasaryan, A. Veit, Y. Hua, D. Estrin, and V. Shmatikov, "How to backdoor federated learning," in International Conference on Artificial Intelligence and Statistics, pp. 2938–2948, PMLR, 2020. [17] L. Lyu, H. Yu, X. Ma, C. Chen, L. Sun, J. Zhao, Q. Yang, and P. S. Yu, "Privacy and robustness in federated learning: Attacks and defenses," IEEE Transactions on Neural Networks and Learning Systems, pp. 1– 21, 2022. [18] P. Blanchard, E. M. El Mhamdi, R. Guerraoui, and J. Stainer, "Ma- chine learning with adversaries: Byzantine tolerant gradient descent," Advances in Neural Information Processing Systems, vol. 30, 2017. [19] R. Guerraoui, S. Rouault, et al., "The hidden vulnerability of distributed learning in byzantium," in International Conference on Machine Learn- ing, pp. 3521–3530, PMLR, 2018. [20] C. Fung, C. J. Yoon, and I. Beschastnikh, "Mitigating sybils in federated learning poisoning," arXiv preprint arXiv:1808.04866, 2018. [21] D. Yin, Y. Chen, R. Kannan, and P. Bartlett, "Byzantine-robust dis- tributed learning: Towards optimal statistical rates," in International Conference on Machine Learning, pp. 5650–5659, PMLR, 2018. [22] C. Xie, S. Koyejo, and I. Gupta, "Zeno: Distributed stochastic gradient descent with suspicion-based fault-tolerance," in International Confer- ence on Machine Learning, pp. 6893–6901, PMLR, 2019. [23] C. Xie, S. Koyejo, and I. Gupta, "Zeno++: Robust fully asynchronous sgd," in International Conference on Machine Learning, pp. 10495– 10503, PMLR, 2020. [24] J. So, B. Güler, and A. S. Avestimehr, "Byzantine-resilient secure federated learning," IEEE Journal on Selected Areas in Communications, vol. 39, no. 7, pp. 2168–2181, 2020. [25] Z. Zhang, J. Li, S. Yu, and C. Makaya, "Safelearning: Enable back- door detectability in federated learning with secure aggregation," arXiv preprint arXiv:2102.02402, 2021. [26] R. K. Velicheti, D. Xia, and O. Koyejo, "Secure byzantine-robust distributed learning via clustering," arXiv preprint arXiv:2110.02940, 2021. [27] M. Rathee, C. Shen, S. Wagh, and R. A. Popa, "Elsa: Secure aggregation for federated learning with malicious actors," Cryptology ePrint Archive, 2022. [28] J. Katz and Y. Lindell, Introduction to Modern Cryptography. Chapman and Hall/CRC, 2008.
http://arxiv.org/abs/2302.09908v2
2023-03-05T23:10:24
2023-02-20T11:09:37
A Sidecar Separator Can Convert a Single-Talker Speech Recognition System to a Multi-Talker One
Although automatic speech recognition (ASR) can perform well in common non-overlapping environments, sustaining performance in multi-talker overlapping speech recognition remains challenging. Recent research revealed that ASR model's encoder captures different levels of information with different layers -- the lower layers tend to have more acoustic information, and the upper layers more linguistic. This inspires us to develop a Sidecar separator to empower a well-trained ASR model for multi-talker scenarios by separating the mixed speech embedding between two suitable layers. We experimented with a wav2vec 2.0-based ASR model with a Sidecar mounted. By freezing the parameters of the original model and training only the Sidecar (8.7 M, 8.4% of all parameters), the proposed approach outperforms the previous state-of-the-art by a large margin for the 2-speaker mixed LibriMix dataset, reaching a word error rate (WER) of 10.36%; and obtains comparable results (7.56%) for LibriSpeechMix dataset when limited training.
[ "Lingwei Meng", "Jiawen Kang", "Mingyu Cui", "Yuejiao Wang", "Xixin Wu", "Helen Meng" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09908v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09908v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.SD", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.SD", "cs.AI", "cs.CL", "cs.LG", "eess.AS" ]
A SIDECAR SEPARATOR CAN CONVERT A SINGLE-TALKER SPEECH RECOGNITION SYSTEM TO A MULTI-TALKER ONE Lingwei Meng, Jiawen Kang, Mingyu Cui, Yuejiao Wang, Xixin Wu, Helen Meng The Chinese University of Hong Kong, Hong Kong SAR, China {lmeng, jwkang, mycui, wangy, wuxx, hmmeng}@se.cuhk.edu.hk 3 2 0 2 r a M 5 ] D S . s c [ 2 v 8 0 9 9 0 . 2 0 3 2 : v i X r a ABSTRACT Although automatic speech recognition (ASR) can perform well in common non-overlapping environments, sustaining performance in multi-talker overlapping speech recognition remains challenging. Recent research revealed that ASR model's encoder captures differ- ent levels of information with different layers – the lower layers tend to have more acoustic information, and the upper layers more lin- guistic. This inspires us to develop a Sidecar separator to empower a well-trained ASR model for multi-talker scenarios by separating the mixed speech embedding between two suitable layers. We ex- perimented with a wav2vec 2.0-based ASR model with a Sidecar mounted. By freezing the parameters of the original model and train- ing only the Sidecar (8.7 M, 8.4% of all parameters), the proposed approach outperforms the previous state-of-the-art by a large mar- gin for the 2-speaker mixed LibriMix dataset, reaching a word error rate (WER) of 10.36%; and obtains comparable results (7.56%) for LibriSpeechMix dataset when limited training. Index Terms- multi-talker speech recognition, speech separa- tion, end-to-end speech recognition, domain adaptation 1. INTRODUCTION End-to-end automatic speech recognition (ASR) for common non- overlapping environments has made significant progress recently [1, 2]. However, multi-talker (also known as multi-speaker) speech recognition, where overlapping may exist, still remains a challenge [3]. There are two mainstream end-to-end paradigms that aim to tackle the challenge: (i) cascade architectures that jointly fine-tune speech separation and speech recognition modules [4, 5]; and (ii) complete end-to-end models customized deliberately for multi- talker overlapping speech scenarios [6, 7, 8, 9, 10, 11, 12]. However, the former approach may see performance degradation in modules' original domains, and the latter does not take full advantage of the readily available advancements made for single-talker ASR. This motivates us to find a low-cost and loose-coupling approach to adapt well-trained single-talker ASR models for multi-talker scenes without distorting the original model's parameters. Recent research investigated the information captured in the lay- ers within the encoders of ASR models. Shim et al. [13] found that the transformer-based encoder extracts acoustic representations in its lower layers, and linguistic representations in the upper layers. Layer-wise analyses of self-supervised speech representation mod- els, such as wav2vec 2.0 [14], proved that they encode representa- tions following an acoustic-linguistic hierarchy from lower to upper layers as well [15, 16], which was further discussed in the context of neuroscience [17, 18]. Similar findings have also been reported for CNN- / RNN-based models [19, 20]. Enlightened by the above findings, we assume that there exists a lower suitable location between the encoder's two layers where the Fig. 1. (a) a well-trained single-talker ASR system; (b) the proposed strategy with a Sidecar separator mounted, taking 2 talkers as an example. On both sides of Sidecar, we add a convolutional layer to coordinate its input-overlapped and output-separated embeddings. multi-speaker overlapped acoustic embedding can be well-separated by drawing on speech separation techniques. In speech separation, research demonstrated that predicting masks for separation is usually superior to directly predicting separated embeddings [21, 22]. As a representative, the TasNet architecture [23] predicts masks in the time domain for mixed speech embeddings and achieves impressive results. Subsequently, Luo et al. [24] proposed the well-recognized Conv-TasNet, which predicts masks using a convolutional neural network, which made a further leap in performance. Inspired by the recent analyses of ASR models and methodolo- gies in speech separation, we introduce a promising strategy to adapt off-the-shelf well-trained ASR models to multi-talker scenarios. As shown in Fig. 1, we mount a Sidecar separator between two suitable layers of a well-trained ASR model. On both sides of the Sidecar, there is a simple convolutional layer helping to coordinate the input- overlapping and output-separated embeddings of the Sidecar. The proposed approach has three key advantages: • The approach is low-cost and loose-coupling for converting a well-trained single-talker ASR model to a multi-talker one, without complicated customization on the model structure or on the training scheme. • The original ASR model is well-trained and fixed, and only Sidecar (8.7 M, 8.4% of all parameters) needs tuning, making the training feasible within limited time and GPU resources. LinguisticLayersSidecarSeparatorDecodertext.1text.2DecoderASREncodertextfrozentuned⊙element-wise multiplication⊙overlappedspeechAcousticLayersLinguisticLayersConvAcousticLayersConv(a)(b)maskscleanspeech • Experiments leveraging a wav2vec 2.0-based ASR model mounted with a Sidecar are conducted, achieving a WER of 10.36% on 2-speaker LibriMix dataset and 7.56% on LibriSpeechMix dataset with limited training. Moreover, by visualizing Sidecar-predicted masks (Fig. 3), we find that among channel dimensions different features encode differ- ent speakers' information. And in the time domain, there exist clear distinctions between the periods of speech for different speakers, and the periods of overlapping speech. 2. MULTI-TALKER ASR SYSTEM WITH SIDECAR The proposed methodology consists of three main components - a well-trained single-talker ASR model with parameters frozen, a Sidecar separator, and the training objective. As shown in Fig. 1, with the cooperation of two convolutional layers, Sidecar is plugged between two layers of ASR encoder and forms a multi-talker ASR system. No language models or lexicons are used in this work. With permutation invariant training (PIT) [25], the model is op- timized using connectionist temporal classification (CTC) loss [26]. 2.1. Well-trained single-talker ASR model A typical end-to-end ASR model contains an encoder to synthesize waveform or acoustic features into high-level representations, and a decoder to model the representations into language tokens. It often takes much time and effort to train an ASR model from scratch, let alone in multi-talker environments. With many off-the-shelf single- talker models already available, we try to reuse the single-talker model on multi-talker overlapping speech recognition. Wav2vec 2.0 [14] is a well-recognized pre-trained speech repre- sentation model based on self-supervised learning (SSL), attracting interest in the field. Many ASR models taking wav2vec 2.0 as the encoder reported state-of-the-art performance [27]. In our experiments, we use a well-trained wav2vec 2.0 base- based ASR model, the same as used in [14], which contains a CNN feature extractor, a Transformer encoder, and a fully-connected layer as the decoder. Specifically, the model takes a waveform as input and extracts acoustic features with a 7-layer CNN feature extractor. After a linear projection, the features are fed into the encoder consisting of 12 layers of Transformer blocks for generating high-level represen- tations. We obey the paradigm in [14] and only use a fully-connected layer as the decoder for letter-level prediction. We directly use the model parameters released by fairseq [28], denoted as W2V-CTC in the following parts. 2.2. Sidecar separator Inspired by the findings that the ASR encoder captures more acoustic information in its lower layers and more linguistic information in the upper layers [13, 15, 20], we propose using a Sidecar separator to address multi-talker speech recognition, drawing on methodologies in speech separation. As shown in Fig. 2, similar to Conv-TasNet [24], the Sidecar is a temporal convolutional network consisting of stacked 1-D dilated convolutional blocks, which allows the Sidecar to model the long- term dependencies of the acoustic embeddings while maintaining a small size. By ablation study, we plug the Sidecar into the most suitable position between two "acoustic" layers of the ASR encoder. Since the original ASR model is frozen, to alleviate the "transplant rejection", we use a 3-kernel-size convolutional layer to filter Side- car's input-mixed and output-separated embeddings, respectively. Fig. 2. (a) Sidecar structure; (b) Details in ConvBlock. Referring to Conv-TasNet [24], the Sidecar consists of stacked 1-D dilated con- volutional blocks. d represents the dilation rate. In the forward process, the preceding-layer-generated mixed speech embedding is filtered by a convolutional layer, and fed into the Sidecar to generate the speaker-dependent masks. Then, the filtered mixed speech embedding will be element-wise multiplied by the masks, and further adjusted by another convolutional layer to obtain the separated embeddings. The separated embeddings of different speakers will go in parallel through the rest of the model and be transcribed into text. This is technically implemented by concatenating the separated embeddings onto the batch dimension. 2.3. Training objective We favor the use of permutation invariant training (PIT) with only ASR loss, which is CTC loss in this work. This can already achieve satisfactory performance. In addition to PIT-CTC loss, we also tried two reconstruction ob- jectives: maximize scale-invariant signal-to-noise ratio (SI-SNR) or minimize mean squared error (MSE). Since the multi-talker dataset is simulated from single-speaker speeches, reconstruction loss aims to drive the predicted separated embeddings as close as possible to corresponding clean single-speaker embeddings. The clean single- speaker embeddings are generated by the transformer layer before where the Sidecar is plugged in, and the permutation of speakers is determined by PIT-CTC loss. Although introducing a reconstruction loss can provide a minor performance gain (Table 4), we do not recommend this. Because it requires input not only mixed speech but also clean single-speaker speeches, which significantly increases the computational burden. 3. A BASELINE SYSTEM FOR CONTROL We attribute the effectiveness of this work to two aspects: the knowl- edge of the well-trained single-talker ASR model, and the Sidecar which can efficiently adapt the former to multi-talker scenarios by predicting speaker-dependent masks rather than their embeddings. The contribution of a well-trained model is intuitive, while the boost in performance provided by Sidecar can be indistinct. Considering this, we designed a baseline system, which also leverages the same ASR model as our proposed approach, but directly predicts speaker-dependent speech embeddings like [8]. Specifically, in the same position as Sidecar is in our proposed ap- proach, the baseline model duplicates the preceding encoder layer to predict speaker-dependent embeddings. Except for the two dupli- cated layers, other parameters are frozen. d=2K-1Point-ConvLayerNormConvBlockConvBlockConvBlockConvBlockConvBlockConvBlock......ConvBlockConvBlockConvBlock...d=1d=2Point-ConvReLUPoint-ConvPReLULayerNormDepth-ConvPReLULayerNormPoint-Convmasks(a)(b)... Note that, unlike our proposed approach, this Baseline does not maintain the property of keeping the original model parameters un- changed, because it fine-tunes the layers of the original model. Table 1. Comparison of different systems on LibriMix. Evaluated by WER (%). "Transf." refers to "Transformer" and "ft." refers to "fine-tune the whole model". 4. EXPERIMENTAL SETUP 4.1. Datasets The experiments are performed on two benchmark datasets: Lib- riMix [29] and LibriSpeechMix [10]. Both of them are simulated from LibriSpeech dataset but with different protocols. LibriMix. It is simulated with the mixtures of two or three speak- ers, in a clean or noisy environment. We focus on its 2-speaker- clean subset Libri2Mix-clean. Libri2Mix-clean's training, develop- ment, and test set contain 270 hours, 11 hours, and 11 hours of 2- speaker's mixed speeches, respectively. The mixtures are made in a left-aligned style. Therefore, the shorter source speech will be fully overlapped by the longer one from the beginning. LibriSpeechMix. It only has standard dev and test sets. We focus on the 2-speaker "dev-clean-2mix" and "test-clean-2mix" for validation and test. The 2-speaker training set is homemade from the 960-hour LibriSpeech training dataset (LS-960) using the same protocol as [10]. LibriSpeechMix randomly samples a delay time for a second utterance so the mixture is partially overlapping. Compared with LibriSpeechMix, LibriMix has larger overlap ra- tios, which greatly challenges the model in separating overlaps. 4.2. Model settings Well-trained single-talker ASR model. In accordance with the paradigm in [14], the used W2V-CTC model contains a CNN feature extractor, a Transformer encoder, and a fully-connected layer as the decoder. We directly reuse the parameters released by Fairseq1 [28], which was first pre-trained on unlabeled LS-960 with contrastive loss and diversity loss, then fine-tuned on labeled LS-960 with CTC loss. It reached a WER of 3.4% on LibriSpeech test-clean dataset, and 8.9% on test-other dataset. Sidecar separator. Referring to [24], in our Sidecar separator, K convolutional blocks with dilation rates 1, 2, 4, ..., 2K−1 are repeated R times. We take K = 8, R = 3, which performs better. We discard skip-connection paths of convolutional blocks, and change the final sigmoid activation to ReLU to fit our task. The Sidecar uses 128 bottleneck-channels, and 768 input- / output- channels. Ablation experiments (Section 5.4) have been conducted to explore the most suitable Sidecar location. As a result, we plug the Sidecar right after the second transformer layer and before the third, which gave the best performance. With W2V-CTC frozen, it only has 8.7 M (8.4% of all parameters, about half of the Baseline) for tuning. Training settings. We optimize the proposed model and Baseline using a 2e-4 learning rate with a three-stage schedule and Adam op- timizer, for at most 100 k updates. It takes about 7 hours for models' convergence with 8 NVIDIA V100 GPUs, thanks to Sidecar's small size and the ejection start provided by the well-trained model. In the following, we denote the proposed model as W2V-Sidecar. 5. RESULTS AND DISCUSSION 5.1. Results On LibriMix dataset We compared different systems on the two benchmark datasets. The corresponding results are shown in Table 1 and Table 2. 1https://github.com/facebookresearch/fairseq/tree/main/examples/wav2vec System (a) PIT-Transf. [5] (b) Conditional Conformer [30] (c) Conv-TasNet + Transf. [5] (d) DPRNN-TasNet + Transf. [5] (e) Baseline (proposed) (f) W2V-Sidecar (proposed) (g) W2V-Sidecar-ft. (proposed) Dev 26.58 24.50 21.00 15.30 11.60 9.76 7.68 Test 26.55 24.90 21.90 14.50 12.27 10.36 8.12 Table 2. Comparisons of different systems on LibriSpeechMix. Evaluated by WER (%). "-" refers to "not reported" and "ft." refers to "fine-tune the whole model". System (a) PIT-BiLSTM [10] (b) SOT-BiLSTM [10] (c) SURT-non-streaming [11] (d) SOT-transf. [31] (e) Baseline (proposed) (f) W2V-Sidecar (proposed) (g) W2V-Sidecar-ft. (proposed) †With heavier training data. Dev - - - - 9.50 7.76 6.01 Test 11.10 11.20 7.20† 5.30† 9.41 7.56 5.69 For 2-speaker LibriMix (Table 1), the designed Baseline (e) for control already outperforms previous methods by a large margin. We attribute this improvement to the knowledge of the well-trained model. Then, by comparing the proposed W2V-Sidecar (f) with Baseline (e), we find the introduction of Sidecar further boosts the WER with even less trainable parameters (8.7 M, 8.4% of all param- eters, about half of Baseline). This confirms that predicting masks is more effective than directly separating embeddings as discussed in [22]. Besides, the Sidecar serves in a plug-and-play style with- out distorting the original parameters. This low-coupling property allows the model to be more flexible for multiple scenarios. Moreover, as an option, we also train a W2V-Sidecar-ft (g), which fine-tunes all model parameters. The training settings are the same as (e). Since the model is initialized with well-trained parame- ters, the W2V-Sidecar-ft's convergence is also fast. Not surprisingly, the model achieves even more impressive results. 5.2. Results On LibriSpeechMix dataset For the comparison on the LibriSpeechMix dataset, we only focus on those non-streaming models with no additional auxiliary such as speaker labels or additional training datasets. As shown in Table 2, our Baseline (e) achieves better perfor- mance than (a) and (b) even with fewer training efforts. As a sim- ilar trend, the Sidecar (f) brings a further performance boost. And as an option, the W2V-Sidecar-ft (g) reaches a better result at the cost of losing the loose-coupling property. We also list the results of Systems (c) and (d), which with different setups, for a comprehen- sive comparison. They gain further improvements from their signif- icantly heavier training efforts. Compared with (a)-(d), the proposed systems (e)-(f) are trained efficiently with only 7 hours using 8 GPUs. Moreover, systems (a), (b), and (d) have larger model sizes than the proposed W2V-Sidecar (94.4 M frozen + 8.7 M trainable). 5.3. Visualization of Sidecar predicted masks To better understand what Sidecar has learned, we investigate its generated masks with visualization. For a better view, we per- form element-wise softmax on the two masks derived from a mixed speech embedding to highlight pairwise differences. This process produces two essentially identical matrices, and we just take one. Then we normalize each channel (or feature) using its mean and standard deviation along the time steps to avoid swamping those channels which with minor differences between the two masks. Af- terward, we reorder the channel dimension according to hierarchical clustering based on the pairwise distances of the channels. We randomly take three typical cases as examples: an almost non-overlapped case, a partially overlapped case, and a case in which the shorter speech is fully overlapped. We find interesting clues from their masks' visualization (Fig. 3). The masks show strong tempo- ral correlations with the input speech, and distinctly tell the mixture boundaries. This indicates that different feature sub-spaces (or chan- nel groups) capture different speakers' information, so the speaker boundaries emerge when close channels are clustered. 5.4. Ablation studies Sidecar location. We explored the optimal location for the Side- car. We mark the locations by the transformer blocks index. E.g., location 0 is right before the first block; location 1 is between the first and second blocks, etc. The results are summarized in Table 3. Among the locations, the result of location 2 exceeds the previous layers, and deeper locations show a dramatic decrease in results. This trend is mutually supportive of existing layer-wise analysis research [13, 15], and aligns with our previous hypothesis: the sepa- ration is better performed on acoustic-related representations, which contain sufficient low-semantics information to catch phonetic-level differences. We argue that location 0 is too close to the raw input, where meaningful phonetic-level representations have yet to be well- synthesized. Meanwhile, speaker information matters, as the discus- sion about Fig. 3. However, if the ASR encoder goes deeper, the speaker information will be eliminated. As a result, location 2 is a compromised scale in semantics. Reconstruction loss. As reconstruction loss plays a dominant role in speech separation tasks, a natural question is whether introducing reconstruction loss can help our task. In this part, we explore in- troducing MSE or SI-SNR loss to the Sidecar strategy. In Table 4, our experiments show that introducing reconstruction loss can make slight improvements. However, the computational burden is signifi- cantly increased because it requires not only mixed speech input but also clean single-talker recordings. We argue that adding a constraint on low-level embeddings for such a high-semantic task may not be very helpful because the mapping can be an ill-posed problem. 5.5. Limitations and future work This work has several limitations. First, although we used PIT as our training scheme, our strategy also naturally fits serialized out- put training (SOT), which usually needs to train from scratch. We are interested in whether Sidecar can accelerate SOT's training with a well-trained ASR model. Second, according to Fig. 3, Sidecar explicitly encodes speaker information. We are excited about the prospects of its application to speech diarization, especially com- bined with SOT. Third, we only implement Sidecar on the ASR task. We also expect its applicability to other downstream tasks when overlapping exists. Finally, to adopt a generally popular speech rep- resentation model, we only use wav2vec 2.0-based model. We will try the Sidecar on other SSL or non-SSL models in the future. Fig. 3. Visualization of generated masks and input waveforms. We use different colors to distinguish speakers. Purple represents over- lapping. The horizontal of masks is time dimension, and the vertical is channel dimension. Sidecar encodes speaker information with dif- ferent channels and indicates clear distinctions in time domain. Table 3. Ablation study on Sidecar location, evaluated by WER (%). Location LibriMix Dev Test 0 1 2 3 4 6 9 12 12.18 11.22 9.76 12.06 16.14 30.03 56.38 61.78 13.01 11.87 10.36 12.65 16.88 30.32 57.11 62.72 Table 4. Ablation study on using reconstruction loss, by WER (%). LibriMix LibriSpeechMix Dev 9.76 9.69 9.74 Test 10.36 10.16 10.32 Dev 7.76 7.43 7.90 Test 7.56 7.20 7.34 W2V-Sidecar w/ SISNR w/ MSE 6. CONCLUSION Inspired by the findings that ASR encoder captures more acoustic representations in its lower layers and more linguistic in the upper layers, we propose plugging a Sidecar separator into a well-trained single-talker ASR model and converting it to a multi-talker one. The original ASR model is frozen, and only 8.4% of all parameters need tuning. With efficient training, the proposed method outperforms previous state-of-the-art by a large margin on the 2-speaker mixed LibriMix dataset, reaching a WER of 10.36% dataset; and compara- ble results (7.56%) on the LibriSpeechMix dataset. Visualizations of Sidecar-predicted masks indicate that in chan- nel dimension, different features encode different speakers' infor- mation. And in the time domain, there exist significant distinctions between different speaker speech periods and overlapping periods. 7. ACKNOWLEDGEMENTS This research is partially supported by the HKSARG Research Grants Council's Theme-based Research Grant Scheme (Project No. T45-407/19N) and by the CUHK Stanley Ho Big Data Decision Analytics Research Centre. (a) Almostnon-overlapped(b)Partiallyoverlapped(c) Shorter speech is fully overlapped 8. REFERENCES [1] William Chan, Navdeep Jaitly, Quoc Le, and Oriol Vinyals, "Listen, attend and spell: A neural network for large vocab- ulary conversational speech recognition," in IEEE ICASSP, 2016. [2] Anmol Gulati, James Qin, Chung-Cheng Chiu, Niki Par- mar, Yu Zhang, Jiahui Yu, Wei Han, Shibo Wang, Zheng- dong Zhang, Yonghui Wu, and Ruoming Pang, "Conformer: Convolution-augmented transformer for speech recognition," in Interspeech, 2020. [3] Zhongxin Bai and Xiao-Lei Zhang, "Speaker recognition based on deep learning: An overview," Neural Networks, 2021. [4] Shane Settle, Jonathan Le Roux, Takaaki Hori, Shinji Watan- abe, and John R Hershey, "End-to-end multi-speaker speech recognition," in IEEE ICASSP, 2018. [5] Song Li, Beibei Ouyang, Fuchuan Tong, Dexin Liao, Lin Li, and Qingyang Hong, "Real-time end-to-end monaural multi- speaker speech recognition," in Interspeech, 2021. [6] Hiroshi Seki, Takaaki Hori, Shinji Watanabe, Jonathan Le Roux, and John R. Hershey, "A purely end-to-end system for multi-speaker speech recognition," in ACL, 2018. [7] Wangyou Zhang, Xuankai Chang, Yanmin Qian, and Shinji Watanabe, "Improving end-to-end single-channel multi-talker IEEE/ACM Transactions on Audio, speech recognition," Speech, and Language Processing, 2020. [8] Xuankai Chang, Wangyou Zhang, Yanmin Qian, Jonathan Le Roux, and Shinji Watanabe, "End-to-end multi-speaker speech recognition with transformer," in IEEE ICASSP, 2020. [9] Anshuman Tripathi, Han Lu, and Hasim Sak, end multi-talker overlapping speech recognition," ICASSP, 2020. "End-to- in IEEE [10] Naoyuki Kanda, Yashesh Gaur, Xiaofei Wang, Zhong Meng, and Takuya Yoshioka, "Serialized output training for end-to- end overlapped speech recognition," in Interspeech, 2020. [11] Liang Lu, Naoyuki Kanda, Jinyu Li, and Yifan Gong, "Stream- ing multi-talker speech recognition with joint speaker identifi- cation," in Interspeech, 2021. [12] Naoyuki Kanda, Jian Wu, Yu Wu, Xiong Xiao, Zhong Meng, Xiaofei Wang, Yashesh Gaur, Zhuo Chen, Jinyu Li, and Takuya Yoshioka, "Streaming multi-talker ASR with token-level seri- alized output training," in Interspeech, 2022. [13] Kyuhong Shim, Jungwook Choi, and Wonyong Sung, "Under- standing the role of self attention for efficient speech recogni- tion," in Proceedings of International Conference on Machine learning, 2021. [14] Alexei Baevski, Yuhao Zhou, Abdelrahman Mohamed, and Michael Auli, "wav2vec 2.0: A framework for self-supervised learning of speech representations," 2020. [15] Ankita Pasad, Ju-Chieh Chou, and Karen Livescu, "Layer-wise analysis of a self-supervised speech representation model," in IEEE ASRU, 2021. [16] Jui Shah, Yaman Kumar Singla, Changyou Chen, and Ra- jiv Ratn Shah, "What all do audio transformer models hear? probing acoustic representations for language delivery and its structure," arXiv preprint arXiv:2101.00387, 2021. [17] Juliette Millet, Charlotte Caucheteux, Pierre Orhan, Yves Boubenec, Alexandre Gramfort, Ewan Dunbar, Christophe Pallier, and Jean-Remi King, "Toward a realistic model of speech processing in the brain with self-supervised learning," 2022. [18] Aditya R. Vaidya, Shailee Jain, and Alexander G. Huth, "Self- supervised models of audio effectively explain human cortical responses to speech," in Proceedings of International Confer- ence on Machine Learning, 2022. [19] Archiki Prasad and Preethi Jyothi, "How accents confound: Probing for accent information in end-to-end speech recogni- tion systems," in ACL, 2020. [20] Chung-Yi Li, Pei-Chieh Yuan, and Hung-Yi Lee, "What does a network layer hear? analyzing hidden representations of end- to-end ASR through speech synthesis," in IEEE ICASSP, 2020. [21] DeLiang Wang and Jitong Chen, "Supervised speech separa- tion based on deep learning: An overview," IEEE/ACM Trans- actions on Audio, Speech, and Language Processing, 2018. [22] Yuxuan Wang, Arun Narayanan, and DeLiang Wang, "On training targets for supervised speech separation," IEEE/ACM transactions on audio, speech, and language processing, 2014. [23] Yi Luo and Nima Mesgarani, "TasNet: time-domain audio separation network for real-time, single-channel speech sepa- ration," in IEEE ICASSP, 2018. [24] Yi Luo and Nima Mesgarani, "Conv-TasNet: Surpassing ideal time-frequency magnitude masking for speech separa- tion," IEEE/ACM transactions on audio, speech, and language processing, 2019. [25] Dong Yu, Morten Kolbaek, Zheng-Hua Tan, and Jesper Jensen, "Permutation invariant training of deep models for speaker- independent multi-talker speech separation," in IEEE ICASSP, 2017. [26] Alex Graves, Santiago Fern ́andez, Faustino Gomez, and J ̈urgen Schmidhuber, "Connectionist temporal classification: La- belling unsegmented sequence data with recurrent neural net- works," in Proceedings of International Conference on Ma- chine learning, 2006. [27] Yu-An Chung, Yu Zhang, Wei Han, Chung-Cheng Chiu, James Qin, Ruoming Pang, and Yonghui Wu, "W2v-BERT: Com- bining contrastive learning and masked language modeling for self-supervised speech pre-training," in IEEE ASRU, 2021. [28] Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli, "fairseq: A fast, extensible toolkit for sequence modeling," in Proceed- ings of NAACL-HLT 2019: Demonstrations, 2019. [29] Joris Cosentino, Manuel Pariente, Samuele Cornell, Antoine "LibriMix: An open- arXiv Deleforge, and Emmanuel Vincent, source dataset for generalizable speech separation," preprint arXiv:2005.11262, 2020. [30] Pengcheng Guo, Xuankai Chang, Shinji Watanabe, and Lei Xie, "Multi-speaker ASR combining non-autoregressive Con- former CTC and conditional speaker chain," in Interspeech, 2021. [31] Naoyuki Kanda, Guoli Ye, Yashesh Gaur, Xiaofei Wang, Zhong Meng, Zhuo Chen, and Takuya Yoshioka, "End-to- end speaker-attributed ASR with transformer," in Interspeech, 2021.
http://arxiv.org/abs/2302.09904v2
2023-05-27T07:44:21
2023-02-20T11:02:55
HyFL: A Hybrid Framework For Private Federated Learning
Federated learning (FL) has emerged as an efficient approach for large-scale distributed machine learning, ensuring data privacy by keeping training data on client devices. However, recent research has highlighted vulnerabilities in FL, including the potential disclosure of sensitive information through individual model updates and even the aggregated global model. While much attention has been given to clients' data privacy, limited research has addressed the issue of global model privacy. Furthermore, local training at the client's side has opened avenues for malicious clients to launch powerful model poisoning attacks. Unfortunately, no existing work has provided a comprehensive solution that tackles all these issues. Therefore, we introduce HyFL, a hybrid framework that enables data and global model privacy while facilitating large-scale deployments. The foundation of HyFL is a unique combination of secure multi-party computation (MPC) techniques with hierarchical federated learning. One notable feature of HyFL is its capability to prevent malicious clients from executing model poisoning attacks, confining them to less destructive data poisoning alone. We evaluate HyFL's effectiveness using an open-source PyTorch-based FL implementation integrated with Meta's CrypTen PPML framework. Our performance evaluation demonstrates that HyFL is a promising solution for trustworthy large-scale FL deployment.
[ "Felix Marx", "Thomas Schneider", "Ajith Suresh", "Tobias Wehrle", "Christian Weinert", "Hossein Yalame" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09904v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09904v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CR", "cs.DC", "cs.IT", "math.IT" ]
HyFL: A Hybrid Framework For Private Federated Learning Felix Marx Technical University of Darmstadt Thomas Schneider Technical University of Darmstadt Ajith Suresh Technology Innovation Institute (TII) Tobias Wehrle Technical University of Darmstadt Christian Weinert Royal Holloway, University of London Hossein Yalame Technical University of Darmstadt 3 2 0 2 y a M 7 2 ] G L . s c [ 2 v 4 0 9 9 0 . 2 0 3 2 : v i X r a ABSTRACT Federated learning (FL) has emerged as an efficient approach for large-scale distributed machine learning, ensuring data privacy by keeping training data on client devices. However, recent research has highlighted vulnerabilities in FL, including the potential dis- closure of sensitive information through individual model updates and even the aggregated global model. While much attention has been given to clients' data privacy, limited research has addressed the issue of global model privacy. Furthermore, local training at the client's side has opened avenues for malicious clients to launch powerful model poisoning attacks. Unfortunately, no existing work has provided a comprehensive solution that tackles all these issues. Therefore, we introduce HyFL, a hybrid framework that enables data and global model privacy while facilitating large-scale deploy- ments. The foundation of HyFL is a unique combination of secure multi-party computation (MPC) techniques with hierarchical fed- erated learning. One notable feature of HyFL is its capability to prevent malicious clients from executing model poisoning attacks, confining them to less destructive data poisoning alone. We evalu- ate HyFL's effectiveness using an open-source PyTorch-based FL implementation integrated with Meta's CrypTen MPC framework. Our performance evaluation demonstrates that HyFL is a promising solution for trustworthy large-scale FL deployment. 1 INTRODUCTION Federated learning (FL) [58] is a revolutionary approach for large- scale distributed machine learning that emerged in the past decade and has had a profound impact on both academia [90] and indus- try [41, 53, 69]. FL shares some objectives with privacy-preserving machine learning (PPML) [15, 38, 59, 79] but differs in its approach to training a model: In PPML, training on the entire set of avail- able data is either outsourced to a remote party or done collabora- tively while ensuring data privacy. In contrast, FL involves multiple rounds of training, where each round consists of selected clients lo- cally training a model on their private data and a central party performing aggregation of these models to update a global model. Initially, FL appeared to indeed offer privacy since the training data remains on the client devices, and only model updates (so- called gradients) are transmitted. However, subsequent research has demonstrated that these gradients still reveal a significant amount of information, enabling the central aggregator to infer sensitive details about the clients' private training data [36, 94]. To address this issue, secure aggregation (SA) schemes [3, 11] were introduced, where only the aggregated result is revealed to the central party, effectively concealing the individual gradients. Recent research in the field of FL and secure aggregation has focused on addressing various related issues, such as handling dropouts [3, 11], enhancing communication- and computation effi- ciency for both clients and servers [4, 58], and improving resilience against stronger corruptions [61, 68]. Additionally, to improve scal- ability in large-scale deployments involving hundreds or even tens of thousands of clients, hierarchical FL (HFL) has been intro- duced [12, 83, 87], which implements multiple levels of aggregators. However, FL furthermore poses three new challenges that re- quire careful attention. The first pertains to the orchestration of the entire training process by a single aggregator, which necessitates placing complete trust in that entity. This may not be acceptable, especially in scenarios involving multiple organizations forming a consortium, and increases the risks of data breaches or unexpected disruptions. Moreover, serious privacy vulnerabilities have been identified when using secure aggregation with a single aggrega- tor [8, 9, 33, 77, 84]: Recent studies like Mandrake [92] have demon- strated the effectiveness of privacy attacks even when utilizing se- cure aggregation techniques across a large number of clients, cast- ing doubts on the credibility of such schemes [10, 64]. While some approaches employ differential privacy (DP) [62] or costly proofs to ensure computational correctness by the aggregator [14, 68], these methods are impractical for large-scale deployments. Recent works therefore suggest a distributed aggregator setup based on secure multi-party computation (MPC) techniques to distribute ag- gregation tasks among multiple servers, ensuring privacy despite potential collusion among a subset of them [4, 32, 35, 68]. The second concern arises when corrupt clients intentionally manipulate the locally trained model to reduce the system's ac- curacy or to introduce backdoors to extract sensitive information in future rounds [82, 86]. This method of model poisoning is more potent than data poisoning [76], which involves manipulating the underlying dataset (and is the only way to cause harm in PPML schemes). Although numerous defenses have been proposed against model poisoning attacks [16, 75], the most effective ones remain impractical for large-scale deployment due to the significant com- putation and communication costs they entail [61]. Additionally, recent research has introduced even more potent model poisoning strategies that can circumvent state-of-the-art defenses [75]. The third concern is the current lack of global model privacy. Initially, FL focused on enhancing user participation and improving model accuracy rather than safeguarding the model itself. However, with the widespread adoption of FL in various industries, the need for privacy protection becomes apparent. For example, consider a consortium of five hospital groups aiming to collaboratively train a model using data provided by their affiliated hospitals to find a cure for a specific illness [69]. While the consortium may be willing to pay the affiliated hospitals for acquiring the training data, they would prioritize keeping the trained model confidential due to task sensitivity, financial investments, and potential legal implications. Furthermore, failing to maintain the privacy of the global model could enable a corrupt participant to exploit it for their own use or sell it to interested third parties, thereby undermining the con- sortium's joint efforts. Although there have been a few successful attempts in collaborative learning [34, 91, 93], only a limited num- ber of studies have focused on preserving the privacy of the global model in FL [54, 73]. Most of these studies have relied on homo- morphic encryption (HE) schemes [1] or variations thereof, which primarily address semi-honest corruptions. Moreover, several of these works do not consider the collusion of a subset of clients with the aggregator and thereby provide a weaker notion of security. To summarize, we identify three pressing issues in FL when considering a large-scale deployment: P1: Recently, there have been significant concerns raised about the privacy vulnerabilities associated with using secure aggregation with only a single aggregator [8, 9, 33, 77, 84, 92]. P2: Malicious participants can perform attacks (e.g., model poi- soning [31, 82], data poisoning [6, 81], or backdoor attacks [2, 86]) to manipulate the aggregated model. P3: Unrestricted access to the aggregated model allows extrac- tion of traces of original training data, necessitating global model privacy [10, 64, 92]. Besides the aforementioned issues, a large-scale FL deployment needs to account for participant heterogeneity in terms of band- width, jurisdiction, trust assumptions, and computational power. Although various works have addressed these issues individually or in combination, a comprehensive solution remains elusive, which is the goal of this work. Our Contributions. In this paper, we address all of the issues outlined above in a unified framework called HyFL that enables private and robust distributed machine learning at scale. Our frame- work is based on a novel abstraction that also captures existing regular and hierarchical FL architectures in a hybrid manner. Briefly, in our framework, FL participants use secret-sharing techniques to securely outsource training data to distributed train- ing clusters that are based on MPC. The participants then might leave and only sporadically return to provide more training data – this makes our framework robust against real-world issues such as drop-outs, requires no interaction between clients, and relieves resource-constraint (mobile or edge) devices from significant work- load. The models, which are trained by the clusters with MPC- based PPML techniques, are then aggregated across all training clusters using one or multiple levels of distributed aggregators. For secure distributed aggregation, we again utilize MPC. Note that after aggregation, models are not publicly released but in secret-shared form handed back to training clusters for the next training itera- tion. After training is completed, known secure inference protocols can be used to allow private queries [55] in a controlled (poten- tially rate-limited) way. This architecture design addresses issues P1 and P3 by relying on a distributed instead of single aggregator and notably achieves global model privacy due to a novel combination of FL with PPML techniques. We observe that a neat property of our framework is the strictly limited attack surface: similar to PPML, malicious participants are 2 restricted to weaker data-poisoning attacks as there is no possi- bility to access and manipulate the model itself. However, while defending against data poisoning in PPML is highly non-trivial, we show experimentally that state-of-the-art data-poisoning at- tacks in the suggested hierarchical configuration are less effective than in plain FL. Furthermore, we implement and evaluate different robust aggregation schemes to further mitigate the effect of such attacks; for this, we additionally propose new heuristics that im- prove the efficiency for the corresponding MPC implementation. Specifically, we propose a lightweight variant of the "Trimmed Mean" [89] defense, for our setting with only data-poisoning at- tacks. This addresses issue P2. Finally, we implement all HyFL components in an open-source PyTorch-based FL framework that utilizes Meta's CrypTen frame- work [44] for instantiating MPC, which we also extend for our use case with several general-purpose functionalities like optimized oblivious sorting algorithms. We then evaluate the performance when training neural networks for standard image classification tasks in realistic network settings and using GPU-accelerated AWS EC2 instances. This way, we show that the computation and com- munication overhead induced by incorporating secure computation techniques is feasible even for large-scale deployments. For ex- ample, one round of training LeNet on the MNIST dataset for 5 epochs with batch size 80 takes less than 5 minutes for a cluster with 10 participants, and global aggregation among 10 clusters happens in less than 1 second. Moreover, we find that the impact of MPC-induced inaccuracies is less than 0.1%, and models trained with HyFL converge significantly faster than in plain FL. In summary, we provide the following contributions: C1: New scalable (hierarchical) FL framework called HyFL that achieves complete model privacy, supports resource-limited mo- bile or edge devices, and significantly limits the attack surface for malicious participants to data poisoning attacks. C2: Analysis of data-poisoning attacks in hierarchical setting with new efficiency improvements for secure robust aggregation. C3: Open-source implementation and evaluation of HyFL on standard image classification tasks. In Tab. 1, we furthermore clarify how HyFL distinguishes itself from related works. 2 PRELIMINARIES 2.1 Privacy Enhancing Technologies (PETs) Privacy enhancing technologies (PETs) are techniques that allow for computations on data while maintaining the privacy of that data. In the literature, three PETs are prominently discussed: secure multi-party computation (MPC), homomorphic encryption (HE), and differential privacy (DP). Secure Multi-Party Computation (MPC). MPC [39, 88] enables a set of mutually distrusting parties to evaluate a public function f () on their private data while preserving input data privacy. The cor- ruption among the parties is often modelled via an adversary that may try to take control of the corrupted parties and coordinate their actions. There exists various orthogonal traits of adversar- ial corruption like honest vs dishonest majority, semi-honest vs Table 1: Comparison of HyFL and previous works. Notations: S – Aggregation Server(s), C – Client, GM – Global Model, LM – Local Model, MPC – Secure Multi-party Computation, HE – Homomorphic Encryption, AHE – Additively HE, MHE-Multi-party HE, DP – Differential Privacy. Since the body of literature is vast, comparison is made against a subset representing each category (cf. §3 for details). Categories Aggregation (Plain) Aggregation (Robust) Secure Aggregation (Single S) Secure Aggregation (Multi S) Hierarchical FL (HFL) Representative Work(s) Method Privacy (S) Privacy (C) GM LM GM Defense Cross Device No Client Interaction Dropout Handling [58] [7] [89] [16] [11] [67] [54] [32] ∗ [34] ∗ [73] [61] [12] [83] [87] – – – – Masking AHE AHE MPC MHE MHE MPC Masking – DP ✗ ✗ ✗ ✗ ✗ ✓ ✗ ✓ ✓ ✓ ✓ ✗ ✗ ✗ ✓ ✗ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✗ ✗ ✗ ✗ ✗ ✗ ✓ ✗ ✓ ✓ ✗ ✗ ✗ ✗ ✓ ✗ ✓ ✓ ✓ ✗ ✗ ✗ ✗ ✗ ✗ ✓ ✗ ✗ ✗ ✓ ✓ ✗ ✓ ✓ ✗ ✗ ✗ ✓ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✗ ✓ ✓ ✗ ✗ ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✗ ✗ ✓ ✓ ✓ ✓ ✓ Hybrid FL (HyFL) This work MPC ∗ Represents collaborative learning in the N -party setting, rather than the Federated Learning (FL) setting. malicious corruption, etc. [30, 46, 52]. When the numbers of com- puting parties is small, MPC is practically efficient [18, 20, 47, 66]. In our prototype implementation of HyFL, we utilize Meta's CrypTen framework [44], which for efficiency reasons operates in a semi- honest two-party setting while involving a trusted third "helper" party that generates correlated randomness [23, 24, 44, 65]. Homomorphic Encryption (HE). HE schemes [37, 70] enable compu- tation on encrypted data without the need for decryption. Additive homomorphic encryption (AHE) is a widely used method that al- lows for the generation of a new ciphertext representing the sum of multiple plaintexts through operations on their corresponding original ciphertexts [63]. In scenarios involving multiple parties, recent multi-party homomorphic encryption (MHE) schemes have been shown to reduce the communication complexity of their MPC counterpart, but incur a significant computation overhead [60]. Fur- thermore, they are only secure against semi-honest corruptions, with the exception of [17]'s recent work. [1] presents a comprehen- sive survey of various HE schemes. Differential Privacy (DP). The concept of DP [29] is based on the idea of adding noise to data in order to reduce information leakage when sharing it, while still allowing for meaningful computations to be carried out on the data. Though DP techniques offer some protection against attacks in federated learning, they also reduce the utility of the data and the resulting ML model. Additionally, achieving robust and accurate models necessitates significant pri- vacy budgets, leaving the actual level of privacy achieved in practice uncertain [62]. We refer to [27] for more details. 2.2 Federated Learning (FL) Unlike conventional PPML techniques, FL [45, 58] enables training of a machine learning model over distributed data by allowing the model to be trained locally on each device using its own data. The locally trained models are then transferred to a central server and combined to form a global model. At a high level, an FL scheme iterates through the following steps: (1) The global server S sends the current global model Wt to a selected subset of n out of N clients. (2) Each selected client Ci , i ∈ [n] utilizes its own local training data Di for E epochs to fine-tune the global model and obtains an updated local model wi t +1: wi t +1 ← Wt − ηCi ∂L(Wt , Bi,e ) ∂Wt , where L is a loss function, ηCi is the clients' learning rate, and Bi,e ⊆ Di is a batch drawn from Di in epoch e, where e ∈ [E]. The local model updates wi t +1 are then transmitted back to S. (3) S employs an aggregation rule fagg to combine the received t +1, resulting in a global model Wt +1, which local model updates wi will serve as the starting point for next iteration: , . . . , wn Wt +1 ← Wt − ηS * fagg (wi where ηS is the server's learning rate. t +1 t +1), The above procedure is repeated until a predefined stopping criterion is satisfied, e.g., a specified number of training iterations or a specific level of accuracy. Aggregation. While there exist a number of different aggregation functions, Google suggested FedAvg [58], which aggregates the models efficiently using a simple weighted average, given by FedAvg(w 1 t +1 , . . . , wn t +1) = n ∑︁ i=1 |Di | |D | wi t +1 , where wi notes the total number of training data samples. t +1 is the model trained on |Di | data samples and |D | de- 3 3 RELATED WORK This section provides a succinct overview of related work. Secure Aggregation. Previous research had assumed that the use of standard FL with plain aggregation would protect the privacy of client data. However, later works have shown that it is possible to extract private information from individual model updates [36, 94]. To address this concern, secure aggregation (SA) schemes have been proposed [11, 56]. These schemes ensure that the aggregator S only receives the final aggregated model, rather than individual models, thus preserving the privacy of client data. Single-Server SA (Single S). When utilizing a single aggrega- tor S, several works used masking techniques [71] to hide individ- ual updates from the aggregator [3, 11]. However, more recent stud- ies, such as [67], have shifted their focus towards using HE-based techniques, specifically AHE [1], to completely hide the aggregated model from the server and make it available to the users. Similarly, PrivFL [54] proposed a HE-based pairwise training between clients and the aggregator, followed by an aggregation step like FL [54]. This approach protects the global model from the clients and reveals it only to the aggregator, while preserving privacy of individual updates. Nevertheless, these approaches do not offer complete pri- vacy for the global model, as it is disclosed either to the aggregator or to the client. Consequently, if the aggregator and the client col- lude, the privacy of the underlying scheme can be compromised. Moreover, recent research has shown that a single malicious server can reconstruct individual training data points from users' local models even when using secure aggregation protocols [10, 64, 92]. Multi-Server SA (Multi S). In this case, the aggregation will be carried out by a group of servers in a private and distributed fashion [32]. One major advantage of these schemes is that, unlike a single aggregator case, users do not need to communicate with each other or perform any key setup. In an orthogonal direction, works such as Spindle [34] and Poseidon [73] adopt MHE techniques to perform collaborative learning, but in a federated fashion. How- ever, these works do not scale well with the number of parties and are thus limited for a cross-device setting. Recent works like [28] and [61] propose private and robust FL by combining techniques from HE and MPC, but will incur significant overhead in both com- putation and communication for a cross-device setting. In HyFL, we employ a multi-server aggregation scheme with two servers and a helper, and mitigate scalability issues of existing works, especially for a heterogeneous cross-device setting. Hierarchical Federated Learning (HFL). A modified approach to stan- dard FL, called hierarchical FL (HFL), was introduced to address scal- ability and heterogeneity issues in real-world systems [12, 26, 83]. In HFL, aggregation occurs at multiple levels, forming a hierar- chical structure in which the aggregated values from one level serve as inputs for the next higher level. This procedure eventually leads to the top level, where the final model is aggregated [26, 83]. Previous works in the HFL setting have primarily focused on im- proving scalability and communication. However, the recent work of [87] introduced methods for ensuring the privacy of individual client updates in HFL, allowing for secure aggregation. Despite this advancement, [87] did not address global model privacy or 4 robustness against malicious users, which are crucial goals for our proposed HyFL framework. Poisoning & Robust Aggregation. One potential drawback of FL over PPML techniques is that FL increases the attack surface for malicious actors: in FL, each user trains their own model locally, allowing them to potentially manipulate their model [2, 5, 6, 31, 81]. To counter these kind of poisoning attacks, various robust aggregation methods have been proposed, in which local models are analyzed and appropriate measures such as outlier removal, norm scaling, and so on are applied [7, 16, 50, 74, 89]. See [76] for a comprehensive overview of different robust aggregations. 4 HYFL FRAMEWORK We now present the details of our HyFL framework, which aims to address multiple key requirements: global model privacy, scalability, support for resource-constraint (mobile/edge) devices, reduction of attack surface, ability to defend against multiple remaining threats, and high levels of user engagement. Additionally, our framework seeks to capture various proposed architectures for FL in a single abstraction. We illustrate our framework in Fig. 1 and detail the underlying algorithm in Alg. 1. 4.1 HyFL Architecture Our HyFL framework is based on a three-layer1 architecture and extends the established hierarchical FL (HFL) paradigm [12, 83, 87]. In HFL, clients are initially organized into clusters, and their local models are aggregated at cluster level; these cluster-level models are then further aggregated globally, resulting in an additional layer of aggregation. We adopt the hierarchical approach in HyFL for two main reasons: firstly, to efficiently realize our distinct model train- ing approach for global model privacy, and secondly, to facilitate large-scale deployments across heterogeneous clients. However, there is one key difference: at the cluster level, HyFL does not perform aggregation of models but private training on collective client data. This differs from both traditional and hierarchical FL since the data is not kept solely on the client devices. Nevertheless, HyFL ensures that the data remains within the trusted domain of the client, allowing for accurate modeling of trust relationships between clients in real-world situations, such as trust among mem- bers of the same region or country [57]. Furthermore, this type of hierarchy is ubiquitous in real-world scenarios such as P2P gaming, organizations, and network infrastructures [42, 51, 78]. We provide details for each layer in HyFL next. We focus on the sequence of operations performed by the entities in our architec- ture (cf. Fig. 1) for a training over T iterations while considering necessary MPC protocols and setup requirements. Since we have a generic design, we design our framework in the FMPC-hybrid model with the MPC protocols abstracted, and their specifics are given in Tab. 3 in §4.1.5. The notations used in HyFL are listed in Tab. 2. 4.1.1 Layer III: Clients. This layer is composed of NM distinct (with i ∈ [NM ]), called clusters, which are sets of clients CU i formed based on specific criteria relevant to the application (e.g., European Union (EU) member states for the EU smart metering scheme [21, 22]). Similar to standard FL, only a random subset 1Additional layers can be easily incorporated depending on the scale of deployment. Layer I: Global Servers GSi ∈ G; i ∈ [NG ] G Training Data Adversary A MPC Server (Cluster) Private ML Training Layer II: MPC Clusters CS j i ∈ Mi ; i ∈ [NM ], j ∈ [NMi ] M1 MNM Cluster Models Layer III: Clients j i ∈ Ci ; i ∈ [NM ], j ∈ [NCi ] C MPC Server (Global) Secure Aggregation Aggregated ML Model Figure 1: Three-layer architecture in HyFL for federated training of a machine learning model. C1 CNM j i of clients, denoted by Ci ⊆ CU i algorithm in an iteration t ∈ [1,T ]. j i ∈ Ci (with j ∈ [NCi ]) holding During iteration t, each client C , will be selected by the training data DC t uses the Share protocol to securely distribute its data to a set of cluster servers Mi . As detailed in §4.1.2, Mi constitute a representative group of high-performance servers that clients have a sufficient level of trust in. HyFL allows clients to share input and then leave at any time. They can also rejoin the system later and provide additional data in the next iteration they get selected. Hence, the clusters CU i are dynamic and change with each iteration. Our method differs from the standard concept of "data resid- ing at the clients" in FL, but we expect it to not negatively impact user engagement as data remains within the users' trust zone. Ad- ditionally, the reduced computational load allows for the use of resource-constrained devices in training complex models and elimi- nates the need for shared-key setup among clients, making it easier to handle dropouts. Table 2: Notations used in our HyFL framework. Notation Description G Set of Global MPC Servers. Set of MPC Servers in the i-th cluster. Set of Clients in the i-th cluster. Selected Clients in the i-th cluster. Size of the set s ∈ { G, Mi, Cj }. Mi CU i Ci Ns NM Total number of clusters. Wt GSi j CS i Global model available at round t . Layer I MPC Global Server; GSi ∈ G. Layer II MPC Cluster Server; CS Here, i ∈ [NM ], j ∈ [NMi ] Layer III Client; C Secret sharing semantics for s ∈ { G, M j }. j i ∈ Mi . j C i ⟨*⟩s j i ∈ Ci , i ∈ [NM ], j ∈ [NCi ] 4.1.2 Layer II: MPC Clusters. The second layer consists of NM sets of distributed training servers Mi (with i ∈ NM ), called MPC clusters, with each Mi corresponding to the cluster CU in Layer III. i In iteration t, Layer I servers (denoted by G) initiate ML training by sharing the current global model Wt −1 among servers in Mi . As will be discussed in §4.1.3, Wt −1 is also in a secret-shared form among G, represented by ⟨Wt −1⟩ G. To account for varying avail- ability and trustworthiness of servers across regions, MPC clusters in HyFL may use different MPC configurations and differ, e.g., in their corruption threshold and security model [30]. Therefore, G uses the Reshare protocol to convert the secret shares of ⟨Wt −1⟩ G to those of Mi , i.e., ⟨Wt −1⟩ Mi . Given ⟨Wt −1⟩ Mi , servers in Mi use Train to employ MPC- based PPML techniques for private ML training [43, 44] on the cu- mulative data from all clients in the cluster Ci , denoted by ⟨Dt ⟩ Mi . This data may include leftover data from the same cluster in the previous iteration. Furthermore, by utilizing a larger pool of train- ing data, we can leverage the known benefits of batching, resulting in faster convergence [13, 40]. After completing training, servers in Mi utilize Reshare to secret-share the updated model with the Layer I servers, i.e., ⟨W i t ⟩ G. To preserve the system's integrity, the servers for each MPC cluster must be chosen with care to ensure that clients are willing to share their data among the servers and that not all of the servers are colluding. One possible option is to build non-profit partnerships, such as in the MOC alliance [95], where organizations with mutual distrust can securely co-locate servers in the same data center with high-speed network connections. Alternatively, trusted entities like government organizations with limited infrastructure can host their servers in confidential cloud computing environments [72]. If a client lacks trust in the HyFL servers in its current cluster, the client can propose a new cluster with a partner who the system recognizes as an entity that can provide a non-colluding server. 5 Layer I: Global Servers. The top layer consists of a set of MPC 4.1.3 servers G, named Global Servers, that securely aggregate trained models from all the MPC clusters in Layer II, similarly to a stan- dard FL scheme with a distributed aggregator [4, 32, 35, 68]. Given the locally trained models W i t for i ∈ [NM ], servers in G execute the secure aggregation protocol Agg [56] to compute the updated global model in secret-shared form, i.e., ⟨Wt ⟩ G. Global servers G use the Reshare protocol to distribute the aggregated model Wt to each of the Layer II clusters Mi to start the next iteration (t + 1). The distributed aggregator model, as outlined in §1, circum- vents the possibility of several privacy attacks that were recently presented for single-server aggregators even when relying on ma- liciously secure aggregation protocols [8, 9, 33, 77, 84, 92]; for ex- ample, by excluding certain inputs from the computation and thus influencing only the correctness but not security of the protocol, a malicious single server can mount privacy attacks that allow to infer information about particular participants and their training data. In contrast, in our distributed aggregator setting, even when having only semi-honest protocol security, such attacks do not go unnoticed as long as at least one of the servers behaves honestly. 4.1.4 HyFL - The Complete Picture. Alg. 1 (FL-Train) provides the training algorithm in HyFL. Though HyFL has a three-layer architecture, it can easily accommodate more levels of hierarchy depending on the size of the deployment. For this, additional layers of MPC clusters can be added between layers I and II, with the clusters performing secure aggregation instead of PPML training. # M = (cid:208)i Mi , C = (cid:208)i Ci ; i ∈ NM # W0 – initial model, D – client C's data # WT – global model after T iterations # in parallel i – total clients in i-th cluster # in parallel Algorithm 1 FL-Train: Training in HyFL Actors: G, M, C Input: W0, {DC }C ∈C Output: ⟨WT ⟩ 1: initialize: ⟨W0 ⟩G ← Share(W0, G) 2: for each training iteration t ∈ [1,T ] do 3: 4: for all i ∈ NM do ⟨Wt −1 ⟩Mi ← G.Reshare(⟨Wt −1 ⟩G, Mi ) Ci ← Mi .Sample( CU # CU for all j ∈ [NCi ] do i , t ) j i .Share(DC t , Mi ) j i 5: 6: 7: 8: 9: 10: 11: j i ⟨DC t j i ⟩Mi ← C ← (cid:208) ⟨DC t end for ⟨Dt ⟩Mi ⟨W i ⟨W i end for ⟨Wt ⟩G ← G.Agg( { ⟨W i j ∈ [NCi ] 12: 13: 14: end for t ⟩Mi t ⟩G ← Mi .Reshare(⟨W i ← Mi .Train(⟨Wt −1 ⟩Mi t ⟩Mi , ⟨Dt ⟩Mi , G) ) t ⟩G }i ∈ [NM ] ) ⟩Mi (cid:208) ⟨Dt −1 ⟩Mi # D 0 = ∅ Existing schemes for global model privacy, such as [54] and [32], only protect the model from either clients or aggregator servers, leaving the possibility of collusion especially in a cross-device set- ting. HyFL addresses this issue by keeping the global model in a secret-shared fashion, ensuring that no single entity or group of col- luding entities (up to an allowed corruption threshold) can access the model. This provides a stronger sense of privacy and also protec- tion against unauthorized use or misuse, such as a client disclosing the trained model to another organization for further training or 6 commercial use. For scenarios demanding disclosure of the global model to authorized entities, such as consortium members, the global servers can utilize the Reveal protocol. 4.1.5 MPC Functionalities in HyFL. The MPC functionalities uti- lized in HyFL and called in Alg. 1 as well as Alg. 2 are listed in Tab. 3 and discussed in the following. While Share and Reshare are used for generating the secret shares as per the underlying MPC seman- tics, Reveal is used to reconstruct the secret towards a designated party. The Train and Predict functionalities correspond to PPML training and inference protocols, respectively. Similarly, Agg de- notes the secure aggregation functionality in FL (cf. §3). In HyFL, these functionalities are realized using Meta's CrypTen framework, in which two semi-honest MPC servers carry out the computa- tion with the help of a trusted third party that provides correlated randomness [24, 25, 44]. However, HyFL is not bound to any spe- cific MPC setting and could be instantiated using any MPC protocol. Table 3: MPC functionalities used in HyFL framework. Algorithm Input(s) Description Share Reshare Agg Train Predict Reveal TM-List TopK-Hitter D , V ⟨D ⟩U , V { ⟨W j ⟩ } ⟨W ⟩, ⟨D ⟩ ⟨W ⟩, ⟨Q ⟩ ⟨D ⟩U , V W, α U, Γ Generates secret shares of D as per target V 's sharing semantics (⟨D ⟩V ). Converts secret shares of D from source U 's sharing semantics to target V . Performs secure aggregation over j secret-shared ML models. Performs PPML Training on ML model W using the data D . Performs PPML Inference on ML model W using the query Q . Reconstructs secret-shared data D towards members in target set V . Performs Trimmed Mean algorithm and returns 2α outlier values (top and bottom α) for each index position in elements of W Returns list of Γ values that occur most frequently in U 4.1.6 Threat Model and Privacy Analysis. Given the hybrid nature of our framework, we consider a mixed adversarial corruption in HyFL and assume a centralized adversary A orchestrating the corruption. As described in §4.1.2, HyFL considers that the nature of the corruption can differ amongst MPC clusters including the global servers. We model this by defining a corruption strategy Stγ for the entities in the set γ ∈ {G, Mi, C}i ∈NM . For γ = C, A is allowed to corrupt a subset of clients maliciously, capturing data poisoning attacks, but is assumed to respect the standard honest-majority as- sumption among the clients in FL. The corruption strategy for the other two cases can vary depending on the context. For example, A can choose to maliciously corrupt certain MPC clusters Mi (reflect- ing an unjustified trust assumption in the cluster), while corrupting the rest, including G, in a semi-honest manner. Additionally, A cor- rupts either a minority or majority of the entities in a set, depending on the number of trustworthy entities in that set (although we have to assume at least one trustworthy entity in each set). However, we limit HyFL to static adversaries only, meaning that the corrup- tion strategy is determined at the beginning of the protocol and remains unchanged throughout the execution. We refer to [30, 52] for elaborate details on various traits of adversaries in MPC. We model the training process in HyFL as an ideal function- ality FHyFL, and assume that clients have securely shared their training data with their respective MPC clusters. In each iteration t, FHyFL receives the shares of the current modelWt −1 from the global servers (G) and the shares of the training data from each cluster's servers in Mi for i ∈ NM . Using these shares, FHyFL reconstructs the current global model and the training data for each cluster. Next, FHyFL trains the model Wt −1 using the data from each cluster, resulting in a cluster model. These cluster models are then com- bined using an aggregation algorithm to obtain the updated global model Wt for this iteration. Finally, FHyFL distributes Wt to each cluster based on its specific sharing semantics. Theorem 4.1. Algorithm FL-Train (Alg. 1) securely realises the FHyFL functionality in the FMPC-hybrid model, assuming the presence of a static adversary A, who corrupts the entities in γ ∈ {G, Mi, C}i ∈NM using a predefined corruption strategy Stγ . Proof Sketch. In FL-Train, a client can maliciously tamper with its data before sharing it with an MPC cluster. However, this behavior is allowed in the FHyFL functionality. The underlying se- cure aggregation algorithms (Agg) handle and address such attacks, which fall outside the scope of MPC. Nonetheless, FMPC ensures the secure evaluation of these aggregation algorithms. Similarly, the correctness of Share, Reshare, and Train algorithms is guar- anteed by the FMPC functionality. Therefore, a malicious server within a cluster or at the global level cannot introduce errors into the system without being detected. At a high level, the underly- ing MPC protocols employ techniques such as error correction or replication in honest-majority settings, while dishonest-majority □ scenarios utilize message authentication codes. 4.2 Private Inference in HyFL In HyFL, after the defined number of training iterations T are com- pleted, the MPC clusters begin to function as clusters for ML in- ference. Here, we again utilize PPML techniques to enable clients to query their clusters in a privacy-preserving way [44, 55]. Con- sider the scenario where client C holding query Q wants to use the inference service on a model W that is secret-shared with a clus- ter Mk . This is accomplished by C generating ⟨Q ⟩ Mk using Share, followed by cluster servers in Mk invoking Predict on ⟨W⟩ Mk and ⟨Q ⟩ Mk to generate the inference result in secret-shared form. Finally, Mk reveals the result to C using Reveal protocol. 4.3 Abstraction of Existing FL Schemes One notable feature of our HyFL architecture (cf. Fig. 1) is its ca- pability to encompass multiple existing FL frameworks, as shown in Tab. 4. This abstraction not only simplifies comparisons but also facilitates advanced hybrid designs, including the integration of differential privacy. Standard FL with a single aggregator (Single S) [58] is a variant of HyFL, where each Layer III cluster Ci consists of only one client that also serves as the MPC cluster server Mi in Layer II. Thus, it is sufficient to conduct ML training without privacy concerns and then send the results to a single global server G in Layer I for aggre- gation. The case of distributed aggregators (Multi S) [32] follows similarly, except secure aggregation being performed at Layer I with multiple (NG > 1) global servers. Finally, existing hierarchical FL schemes [87] share a similar three-layer architecture with HyFL, but have a single server at both the global and cluster level (NG = 1, NMi = 1). While HyFL employs PPML training at the cluster-server level, hierarchical FL uses secure aggregation. Additionally, clients in the hierarchical FL approach perform local model training, as opposed to data sharing in HyFL. Advanced hybrid designs in HyFL could incorporate data from privileged clients, such as trusted consortium members, without hiding the global model. The client can train the model locally and Table 4: Abstraction of existing FL schemes (cf. Tab. 1) us- ing our HyFL architecture (cf. Fig. 1). S denotes aggrega- tion server(s), S.Agg. denotes secure aggregation, and (S.)Agg. marks secure aggregation as optional. See Tab. 2 for other notations. Scheme Aggregation (Single S) Aggregation (Multi S) Hierarchical FL Hybrid FL (HyFL) This Work Layer I NG = 1 (S.)Agg. NG > 1 Ns Role Ns Layer II NMi = 1 Layer III Remark NCi = 1 Mi = Ci ML Training NMi = 1 NCi = 1 Role S.Agg. ML Training Ns Role Ns NG = 1 (S.)Agg. NG > 1 NMi = 1 (S.)Agg. NMi > 1 NCi > 1 ML Training NCi > 1 Role S.Agg. PPML Training Data Sharing Mi = Ci Mi ≠ Ci Mi ≠ Ci share the gradients with aggregation servers. Another hybrid could include a collaborative training model like SafeNet [19], which re- sists poisoning attacks to some extent. SafeNet defines the global model as an ensemble of verified models, with the majority predic- tion determining the final output. This setup can replace an MPC cluster and its associated clients in HyFL. The ensemble models can be aggregated or subjected to MPC-based clustering [61] to obtain a single model. The remaining process follows the HyFL architecture, replacing operations in SafeNet on the plain model with corresponding MPC counterparts. Additionally, the training in the MPC clusters, resilient to poisoning attacks, can be categorized as attested training. The global servers can use a simple or mildly ro- bust aggregation scheme to incorporate updates from these clusters, decreasing the likelihood of error propagation to higher layers. 5 PERFORMANCE EVALUATION We evaluate the performance of HyFL in terms of accuracy as well as computation and communication overhead empirically. Implementation. We implement HyFL based on the CrypTen MPC framework developed by Meta [44]. CrypTen provides a Py- Torch-style interface and implements MPC operations with GPU support. Specifically, CrypTen implements semi-honest arithmetic and Boolean two- and multi-party protocols that use a third "helper" party to generate correlated randomness. CrypTen provides a "sim- ulation" mode where the specified computation is performed on a single node in plaintext yet simulates all effects that computation in MPC would have on the results (e.g., due to limited fixed-point precision and trunction). We leverage this mode to efficiently eval- uate HyFL accuracy and later the impact of data-poisoning attacks; yet we run the full MPC computation to obtain realistic run-time and communication measurements. In all our experiments, the fixed- point precision in CrypTen is set to 22 decimal bits (the maximum developer-recommended number). We use CrypTen to implement (a) private training on Layer II and (b) distributed aggregation on Layer I. CrypTen out of the box supports private inference between Layer II and III, which, how- ever, is not the focus of our evaluation. We extend CrypTen with an identity layer to enable model conversions and re-sharing. Addi- tionally, we extend the implementation of convolutional layers to enable full GPU-accelerated training for such model architectures. 7 Moreover, we provide the necessary code to orchestrate the vari- ous parties and components, thereby creating a unified simulation framework. Setup. Plaintext FL and CrypTen-based HyFL simulations are run on a single computing platform equipped with two Intel Xeon Platinum 8168 CPUs, 1.5TB RAM, and 16 NVIDIA Tesla V100 GPUs. To provide realistic results for a distributed MPC deployment with two computational and one helper party, we use three Ama- zon AWS g3s.xlarge instances with 4 vCPUs, and 8GB GPU mem- ory on a NVIDIA Tesla M60. These instances are located in the same AWS availability zone (due to high costs associated with rout- ing traffic between different zones), yet we simulate intra- and inter-continental network connections by setting the bandwidth and latency to 1Gbps/100Mbps and 20ms/100ms, respectively. Tasks. Following prior work [4], we evaluate HyFL on two stan- dard image classification tasks: recognizing (a) hand-written dig- its using LeNet trained on MNIST [49] and (b) objects in one of 10 classes using ResNet9 trained on CIFAR10 [48]. We simu- late 1000 clients from which 100 are randomly selected per round. For plain FL, we use batch size 8 and learning rate 0.005, and train locally for 5 epochs before central aggregation. For HyFL, we sim- ulate 10 Layer II clusters that use a correspondingly scaled batch size of 80 and a learning rate of 0.05 [40]. Overview. We run an empirical accuracy evaluation to answer the following questions: Q1: What is the accuracy difference between FL [58] and HyFL (in plaintext)? Q2: What is the impact on accuracy for HyFL when moving from plaintext to (simulated) MPC? Q3: What are the run-time and communication overheads of (MPC-based) HyFL compared to FL? In the following, we describe how we answer the individual questions and discuss our results. Q1 – FL vs HyFL. In Fig. 2, we compare the validation accu- racy of FL and HyFL for image classification tasks for 500 rounds. Here, we note that HyFL converges significantly faster than reg- ular FL, e.g., after 500 rounds of training ResNet9 on CIFAR10, HyFL reaches 85.68% validation accuracy, whereas regular FL only reaches 65.95%. We attribute this to HyFL pooling training data at cluster level and thus being able to exploit the known benefits of batching [13, 40]. Plots for up to 2000 epochs can be found in Fig. 6 in App. A.1.4. Q2 – Impact of MPC. In Fig. 3, we compare the plaintext val- idation accuracy (cf. Q1) to our CrypTen simulation to measure the impact of MPC (i.e., fixed-point representation with 22 bit dec- imal representation and truncation). Here, we can only provide results for LeNet/MNIST, as ResNet9 training on GPU in CrypTen is currently not supported due to limitations in the backward pass implementation. While there is a slight difference in initial rounds, both implementations quickly converge to almost the same valida- tion accuracy, with only a small difference on the order of 0.1%. Q3 – MPC Overhead. Finally, we study the overhead of MPC for secure training and aggregation. For this, we measure the run-times Figure 2: Validation accuracy for FL and HyFL for 500 itera- tions (top: LeNet/MNIST, bottom: ResNet9/CIFAR10). Figure 3: Validation accuracy for FL and HyFL in plaintext and MPC (CrypTen simulation) for LeNet/MNIST training. and communication for one iteration of LeNet/MNIST training (i.e., 5 local epochs) in AWS for one cluster (with 1Gbps bandwidth and 20ms latency) and one iteration of global aggregation (with 100Mbps bandwidth and 100ms latency). The training on cluster level takes 315.17s and requires 5279.25MB inter-server communi- cation, which is multiple orders of magnitude overhead compared to local plaintext training in PyTorch (which only takes 0.07s). The aggregation over 10 cluster inputs is very efficient with 0.023s run-time and has no communication overhead since only linear operations are required, which can be conducted locally in MPC. Additional overhead that must be considered for clients is shar- ing data with the training cluster servers. In our setup, clients on expectation have to upload 3.31MB and 9.86MB in total for 500 rounds of training for MNIST and CIFAR10, respectively. Further- more, we have to account for sharing the trained models from training clusters to the aggregation servers. Given the number of model parameters and CrypTen sharing semantics, each training cluster must transfer 0.49MB and 39.19MB per server for LeNet and ResNet9, respectively. This clearly shows that it is significantly more efficient for participants to upload their training data in secret- shared form compared to down- and uploading model parameters for each training round. Note that in our evaluation setup, training clusters and the aggregation layer use the same MPC configuration, hence no interactive re-sharing is necessary. 8 0100200300400500Epochs0255075100Accuracy45047550095100FLHyFL0100200300400500Epochs0255075100Accuracy4504755006080FLHyFL0100200300400500Epochs020406080100Accuracy45047550097.2597.5045047550098.7599.00PlaintextCrypTenFLHyFL 6 ATTACKS Malicious FL participants can try to manipulate the global model to either produce specific outputs for specific inputs or simply degrade the overall accuracy. These attacks are referred to as back- door [2, 86] and poisoning attacks [80], respectively. In terms of poisoning attacks, the two options are to perform data poison- ing [6, 81] or model poisoning [31, 82]. Since models in our set- ting are not available to clients at any time, malicious participants are inherently limited to manipulate the training data they provide. This rules out the entire class of more powerful model-poisoning attacks [76]. Hence, we evaluate the the effectiveness of state- of-the-art data-poisoning attacks in the HyFL setting as well as possible mitigations. Specifically, we consider the following data poisoning attacks: random label flipping (RLF [85]), static label flip- ping (SLF [31, 76]), dynamic label flipping (DLF [76]), and targeted label flipping (TLF [81]). The attacks are detailed in App. A.1.1. 6.1 Robust Aggregation Schemes The most common FL aggregation scheme is "FedAvg", which sim- ply computes a (weighted) average of all inputs (cf. §2.2). In contrast, robust aggregation schemes detect and then exclude outliers, and are thus a suitable mitigation against data poisoning. An overview of such schemes is given in [76] and [35]. From the surveyed schemes, we identify "FLTrust" [16] and "Trimmed Mean" (TM) [89] as the most MPC-efficient ones. FLTrust assumes that the aggregator has access to a clean data set to run training on the most recent global model; then, it measures the cosine similarity of the own training result against the inputs of participants and excludes the least similar ones. Trimmed Mean, for each coordinate, computes the mean across the provided gradient updates and excludes the values that deviate the most in either direction of the mean. For our experiments, the number of excluded coordinates corresponds to the maximum as- sumed poison rate in the system (e.g., when assuming at most 20% of clients are corrupted, we discard the top and bottom 20%). Per- forming this aggregation obliviously in MPC requires implementing costly sorting to determine the ranking in each coordinate. We observe that, intuitively, data poisoning in contrast to model poisoning does not result in specific coordinates producing extreme outliers. Hence, we propose a heuristic "Trimmed Mean Variant" that computes the mean and ranking only for a small randomly sampled subset of coordinates. Then, during aggregation, it excludes those gradient updates that occurred the most as outliers in the sample. We detail the algorithm of our variant in Alg. 2. Our algorithm uses two additional MPC functionalities: TM-List and TopK-Hitter. TM-List takes as input a set of vectors, say W, consisting of β-sized vectors of the form W i j for i ∈ [β], j ∈ [NW ]. Moreover, the values in the vector come from a fixed source (the Layer II MPC clusters in our case) and are thus represented as a tuple of the form W i j = (ui, vi ) j . Here, ui denotes the source ID (MPC cluster in HyFL) and vi represents the corresponding value. W.l.o.g., consider the first index position of these vectors (i = 1). TM-List sorts the list {(u, v) j } j ∈ [NW ] using the value v as the key and selects the IDs (u) associated with the top and bottom α val- ues. Intuitively, the operation results in selecting the MPC clusters whose local updates fall in either the top-α or bottom-α position 9 Algorithm 2 Our Trimmed Mean (TM) Variant in HyFL Input: W = {W i }i ∈ [NM ] , α, β, γ Output: ⟨WAGG ⟩ 1: initialize: Z ← ∅ 2: I ← sample random β indices from [1, γ ]. 3: U ← TM-List(WI, α ) # γ = |W i |, α – trim threshold, β – sample size # aggregated model after removing outliers # WI –Truncated W with only indices in I, TM-List performs Trimmed Mean algorithm and returns 2α outlier values (top and bottom α) for each index in I, | U | = 2α β # set of outliers 4: V ← TopK-Hitter( U, 2α ) # returns list of 2α indices that occur most frequently in U 5: for all i ∈ V do 6: Z ← Z (cid:208){W i } 7: end for 8: ⟨WAGG ⟩ ← Agg(W \ Z) among all the updates at that index. This procedure is performed in parallel for all β indices and results in a set U of 2αβ IDs (with duplicates). The TopK-Hitter functionality, parameterized by Γ, takes this set U as input and returns a set of Γ values that occur most frequently in U. 6.2 Evaluation We now empirically evaluate the impact of data-poisoning attacks on HyFL considering different (robust) aggregation schemes. For this, we implement all four attacks-RLF, SLF, DLF, TLF-in our framework and add CrypTen-based implementations of the three robust aggregation schemes. Using the setup described in §5, we want to answer the following questions: Q4: What is the impact of data-poisoning attacks on the accuracy of FL and HyFL using FedAvg and robust aggregation schemes? Q5: What is the run-time and communication overhead for dif- ferent robust aggregation schemes in MPC? Q6: How does our TM variant compare to regular TM w.r.t. accuracy and MPC performance. In the following, we outline our approach to answering the questions and provide a detailed analysis of our findings. Q4 – Attack Impact. For our evaluation, we consider three poison rates (0.01, 0.1, 0.2) and distributions of attackers: in the equally- distributed setting, we assume that on expectation each cluster has the same number of malicious clients; in the focused setting, we assume that malicious clients are concentrated on as few clusters as possible while there is still an honest majority in each cluster (a standard assumption in FL); finally, in the cluster-focused setting, we see what happens if we lift the honest-majority assumption and concentrate all malicious clients in as few clusters as possi- ble. In Fig. 4, we study the effectiveness of the most powerful DLF data-poisoning attack on both regular FL and HyFL when train- ing ResNet9 on CIFAR10 in the equally distributed and focused setting. Additional experimental outcomes are given in App. A.1.5. For the fairly aggressive 0.2 poison rate, we see in both visualized attacker distributions a significant negative impact of the DLF attack on FL when using FedAvg with drops below 30% accuracy. How- ever, these can be successfully mitigated with robust aggregation schemes. While there is also negative impact on HyFL, especially in the focused setting, the accuracy even with FedAvg never drops Figure 4: Validation accuracy for FL and HyFL with FedAvg, FLTrust, and trimmed mean as aggregation schemes under DLF attack for three different poison rates (top: equally distributed, bottom: focused setting). below that of FL. And even though robust aggregation schemes help to slightly smoothen the curve, we conclude that applying defenses in HyFL against data-poisoning attacks can be considered optional but not strictly necessary. Q5 – Robust Aggregation in MPC. We evaluate the run-time and communication overhead of our FLTrust and TM implementation in CrypTen in Tab. 5. The run-time overhead for both robust ag- gregation schemes compared to FedAvg is four to five orders of magnitude. Also, FLTrust requires 5× more run-time and communi- cation than TM. Given that both produce fairly similar results when applied to HyFL, the overhead for FLTrust seems not warranted. Table 5: Communication and run-time for various aggrega- tion schemes in CrypTen. Figure 5: Accuracy of trimmed mean (TM) and our vari- ant (with sample sizes 10, 100, and 1000) against focused DLF attacks on HyFL at 0.2 poison rate for ResNet9/CIFAR10. Parameter FedAvg Trimmed Mean FLTrust Communication (in MB) Runtime (in s) 0 0.023 1021.59 326.57 5329.19 1713.44 compared to the original. In the studied inter-continental WAN setting, this has severe impact but does not correspond to actual compute time. Q6 – Trimmed Mean Variant. In Fig. 5, we compare the effective- ness of our TM variant to the original TM [89] for three sample sizes (10, 100, and 1000). It turns out that our heuristic approach barely reduces the effectiveness, even with aggressive parameters. In fact, in the focused setting, the TM variant outperforms the original. This is because our variant completely excludes gradient updates of (poisoned) outliers, whereas in regular trimmed mean, those poisoned updates might still be considered for some coordi- nates. Results for all other settings are presented in App. A.1.6. In Tab. 6, we also provide run-times and communication results for our optimizations. Compared to the original with 1021.59MB of communication, we can see an improvement by two orders of mag- nitude with a communication of 11.90MB for the variant with 100 random samples. However, we see a higher and fairly stable run- time across all three examined variants. This is because the algo- rithm for determining the overall ranking of outliers across co- ordinates increases the number of MPC communication rounds Table 6: Communication and run-time for our TM variant with sample sizes 10, 100, and 1000 in CrypTen. Parameter TM-10 TM-100 TM-1000 Communication (in MB) Runtime (in s) 9.69 558.05 11.90 558.26 33.94 561.50 Overall, if HyFL is combined with a robust aggregation scheme, our TM variant offers an excellent trade-off between accuracy and MPC overhead compared to significantly more expensive FLTrust and the original TM. 7 CONCLUSION In this work, we presented HyFL, a novel unified abstraction and framework for (hierarchical) federated learning that provides global model privacy, faster convergence, smaller attack surface and better resilience against poisoning attacks than regular FL. 10 025050075010001250150017502000Poison: 0.01020406080100DLF - Equally Distributed18001900200070801800190020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100DLF - Equally Distributed18001900200070801800190020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100DLF - Equally Distributed18001900200070801800190020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100DLF - Focused18001900200070801800190020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100DLF - Focused18001900200070801800190020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100DLF - Focused18001900200070801800190020008090FedAvgFLTrustTrimmed MeanFLHyFL0500100015002000Epochs020406080100Accuracy1800190020008090TMTM - 10TM - 100TM - 1000 As part of future work, we plan to investigate potential fur- ther performance improvements by incorporating quantization techniques for private training [43] and secure aggregation [4]. Additionally, we envision the design of novel robust aggregation schemes that are specifically targeted at mitigating data poisoning, and incorporating defense mechanisms already at the PPML level to then have "attested" inputs at the aggregation level. ACKNOWLEDGMENTS This project received funding from the European Research Coun- cil (ERC) under the European Union's Horizon 2020 research and innovation program (grant agreement No. 850990 PSOTI). It was co-funded by the Deutsche Forschungsgemeinschaft (DFG) within SFB 1119 CROSSING/236615297 and GRK 2050 Privacy & Trust/ 251805230. REFERENCES [1] Abbas Acar, Hidayet Aksu, A. Selcuk Uluagac, and Mauro Conti. 2018. A Survey on Homomorphic Encryption Schemes: Theory and Implementation. Comput. Surveys (2018). [2] Eugene Bagdasaryan, Andreas Veit, Yiqing Hua, Deborah Estrin, and Vitaly Shmatikov. 2020. How To Backdoor Federated Learning. In AISTATS. [3] James Henry Bell, Kallista A. Bonawitz, Adrià Gascón, Tancrède Lepoint, and Mar- iana Raykova. 2020. Secure Single-Server Aggregation with (Poly)Logarithmic Overhead. In CCS. [4] Yaniv Ben-Itzhak, Helen Möllering, Benny Pinkas, Thomas Schneider, Ajith Suresh, Oleksandr Tkachenko, Shay Vargaftik, Christian Weinert, Hossein Yalame, and Avishay Yanai. 2022. ScionFL: Efficient and Robust Secure Quantized Aggre- gation. CoRR abs/2210.07376 (2022). [5] Arjun Nitin Bhagoji, Supriyo Chakraborty, Prateek Mittal, and Seraphin B. Calo. 2019. Analyzing Federated Learning through an Adversarial Lens. In ICML. [6] Battista Biggio, Blaine Nelson, and Pavel Laskov. 2012. Poisoning Attacks against Support Vector Machines. In ICML. [7] Peva Blanchard, El Mahdi El Mhamdi, Rachid Guerraoui, and Julien Stainer. 2017. Machine Learning with Adversaries: Byzantine Tolerant Gradient Descent. In NeurIPS. [8] Franziska Boenisch, Adam Dziedzic, Roei Schuster, Ali Shahin Shamsabadi, Ilia Shumailov, and Nicolas Papernot. 2021. When the Curious Abandon Honesty: Federated Learning Is Not Private. CoRR abs/2112.02918 (2021). [9] Franziska Boenisch, Adam Dziedzic, Roei Schuster, Ali Shahin Shamsabadi, Ilia Shumailov, and Nicolas Papernot. 2022. All You Need Is Matplotlib. http://www. cleverhans.io/2022/04/17/fl-privacy.html. [10] Franziska Boenisch, Adam Dziedzic, Roei Schuster, Ali Shahin Shamsabadi, Ilia Shumailov, and Nicolas Papernot. 2023. Is Federated Learning a Practical PET Yet? CoRR abs/2301.04017 (2023). [11] Keith Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H. Bren- dan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. 2017. Practical Secure Aggregation for Privacy-Preserving Machine Learning. In CCS. [12] Kallista A. Bonawitz, Hubert Eichner, Wolfgang Grieskamp, Dzmitry Huba, Alex Ingerman, Vladimir Ivanov, Chloé Kiddon, Jakub Konečný, Stefano Mazzocchi, Brendan McMahan, Timon Van Overveldt, David Petrou, Daniel Ramage, and Jason Roselander. 2019. Towards Federated Learning at Scale: System Design. In MLSys. [13] Léon Bottou, Frank E. Curtis, and Jorge Nocedal. 2018. Optimization Methods for Large-Scale Machine Learning. SIAM Rev. (2018). [14] Lukas Burkhalter, Hidde Lycklama, Alexander Viand, Nicolas Küchler, and Anwar Hithnawi. 2023. RoFL: Robustness of Secure Federated Learning. In IEEE S&P. [15] José Cabrero-Holgueras and Sergio Pastrana. 2021. SoK: Privacy-Preserving Computation Techniques for Deep Learning. PETS (2021). [16] Xiaoyu Cao, Minghong Fang, Jia Liu, and Neil Zhenqiang Gong. 2021. FLTrust: Byzantine-robust Federated Learning via Trust Bootstrapping. In NDSS. [17] Sylvain Chatel, Christian Mouchet, Ali Utkan Sahin, Apostolos Pyrgelis, Carmela Troncoso, and Jean-Pierre Hubaux. 2023. PELTA – Shielding Multiparty-FHE against Malicious Adversaries. Cryptology ePrint Archive, Paper 2023/642. [18] Harsh Chaudhari, Ashish Choudhury, Arpita Patra, and Ajith Suresh. 2019. AS- TRA: High Throughput 3PC over Rings with Application to Secure Prediction. In CCSW@CCS. [19] Harsh Chaudhari, Matthew Jagielski, and Alina Oprea. 2022. SafeNet: The Un- reasonable Effectiveness of Ensembles in Private Collaborative Learning. In IEEE SaTML. [20] Harsh Chaudhari, Rahul Rachuri, and Ajith Suresh. 2020. Trident: Efficient 4PC Framework for Privacy Preserving Machine Learning. In NDSS. [21] European Commission. 2014. Benchmarking Smart Metering Deployment in the EU-27 with a Focus on Electricity. COM/2014/0356 final (2014). [22] Colette Cuijpers and Bert-Jaap Koops. 2013. Smart Metering and Privacy in Europe: Lessons from the Dutch Case. In European Data Protection: Coming of Age. [23] Ivan Damgård, Helene Haagh, Michael Nielsen, and Claudio Orlandi. 2019. Commodity-Based 2PC for Arithmetic Circuits. In IMACC. [24] Ivan Damgård, Valerio Pastro, Nigel P. Smart, and Sarah Zakarias. 2012. Multi- party Computation from Somewhat Homomorphic Encryption. In CRYPTO. [25] Daniel Demmler, Thomas Schneider, and Michael Zohner. 2015. ABY - A Frame- work for Efficient Mixed-Protocol Secure Two-Party Computation. In NDSS. [26] Yongheng Deng, Feng Lyu, Ju Ren, Yongmin Zhang, Yuezhi Zhou, Yaoxue Zhang, and Yuanyuan Yang. 2021. SHARE: Shaping Data Distribution at Edge for Communication-Efficient Hierarchical Federated Learning. In ICDCS. [27] Damien Desfontaines and Balázs Pejó. 2020. SoK: Differential Privacies. PETS (2020). [28] Ye Dong, Xiaojun Chen, Kaiyun Li, Dakui Wang, and Shuai Zeng. 2021. FLOD: Oblivious Defender for Private Byzantine-Robust Federated Learning with Dishonest-Majority. In ESORICS. [29] Cynthia Dwork and Aaron Roth. 2014. The Algorithmic Foundations of Differen- tial Privacy. Found. Trends Theor. Comput. Sci. (2014). [30] David Evans, Vladimir Kolesnikov, and Mike Rosulek. 2018. A Pragmatic Intro- duction to Secure Multi-Party Computation. Foundations and Trends in Privacy and Security (2018). [31] Minghong Fang, Xiaoyu Cao, Jinyuan Jia, and Neil Zhenqiang Gong. 2020. Local Model Poisoning Attacks to Byzantine-Robust Federated Learning. In USENIX Security. [32] Hossein Fereidooni, Samuel Marchal, Markus Miettinen, Azalia Mirhoseini, He- len Möllering, Thien Duc Nguyen, Phillip Rieger, Ahmad-Reza Sadeghi, Thomas Schneider, Hossein Yalame, and Shaza Zeitouni. 2021. SAFELearn: Secure Aggre- gation for Private Federated Learning. In DLS@S&P. [33] Liam H. Fowl, Jonas Geiping, Wojciech Czaja, Micah Goldblum, and Tom Gold- stein. 2022. Robbing the Fed: Directly Obtaining Private Data in Federated Learning with Modified Models. In ICLR. [34] David Froelicher, Juan Ramón Troncoso-Pastoriza, Apostolos Pyrgelis, Sinem Sav, Joao Sa Sousa, Jean-Philippe Bossuat, and Jean-Pierre Hubaux. 2021. Scalable Privacy-Preserving Distributed Learning. PETS (2021). [35] Till Gehlhar, Felix Marx, Thomas Schneider, Ajith Suresh, Tobias Wehrle, and Hossein Yalame. 2023. SAFEFL: MPC-friendly Framework for Private and Robust Federated Learning. In DLS@S&P. [36] Jonas Geiping, Hartmut Bauermeister, Hannah Dröge, and Michael Moeller. 2020. Inverting Gradients – How Easy Is It to Break Privacy in Federated Learning?. In NeurIPS. [37] Craig Gentry. 2009. Fully Homomorphic Encryption Using Ideal Lattices. In STOC. [38] Ran Gilad-Bachrach, Nathan Dowlin, Kim Laine, Kristin E. Lauter, Michael Naehrig, and John Wernsing. 2016. CryptoNets: Applying Neural Networks to Encrypted Data with High Throughput and Accuracy. In ICML. [39] Oded Goldreich, Silvio Micali, and Avi Wigderson. 1987. How to Play any Mental Game or A Completeness Theorem for Protocols with Honest Majority. In STOC. [40] Priya Goyal, Piotr Dollár, Ross B. Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. 2017. Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour. CoRR abs/1706.02677 (2017). [41] Chaoyang He, Songze Li, Jinhyun So, Mi Zhang, Hongyi Wang, Xiaoyang Wang, Praneeth Vepakomma, Abhishek Singh, Hang Qiu, Li Shen, Peilin Zhao, Yan Kang, Yang Liu, Ramesh Raskar, Qiang Yang, Murali Annavaram, and Salman Avestimehr. 2020. FedML: A Research Library and Benchmark for Federated Machine Learning. CoRR abs/2007.13518 (2020). [42] Cheol-Ho Hong and Blesson Varghese. 2019. Resource Management in Fog/Edge Computing: A Survey on Architectures, Infrastructure, and Algorithms. Comput. Surveys (2019). [43] Marcel Keller and Ke Sun. 2022. Secure Quantized Training for Deep Learning. In ICML. [44] Brian Knott, Shobha Venkataraman, Awni Y. Hannun, Shubho Sengupta, Mark Ibrahim, and Laurens van der Maaten. 2021. CrypTen: Secure Multi-Party Com- putation Meets Machine Learning. In NeurIPS. [45] Jakub Konečn`y, H Brendan McMahan, Felix X Yu, Peter Richtárik, Ananda Theertha Suresh, and Dave Bacon. 2016. Federated Learning: Strategies for Improving Communication Efficiency. CoRR abs/1610.05492 (2016). [46] Nishat Koti, Shravani Patil, Arpita Patra, and Ajith Suresh. 2023. MPClan: Protocol Suite for Privacy-Conscious Computations. J. Cryptol. (2023). [47] Nishat Koti, Arpita Patra, Rahul Rachuri, and Ajith Suresh. 2022. Tetrad: Actively Secure 4PC for Secure Training and Inference. In NDSS. [48] Alex Krizhevsky. 2009. Learning Multiple Layers of Features from Tiny Images. Technical Report. 11 [49] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. 1998. Gradient- based Learning Applied to Document Recognition. Proc. IEEE (1998). [50] Liping Li, Wei Xu, Tianyi Chen, Georgios B Giannakis, and Qing Ling. 2019. RSA: Byzantine-Robust Stochastic Aggregation Methods for Distributed Learning from Heterogeneous Datasets. In AAAI. [51] Tao Lin, Sebastian U. Stich, Kumar Kshitij Patel, and Martin Jaggi. 2020. Don't Use Large Mini-batches, Use Local SGD. In ICLR. [52] Yehuda Lindell. 2020. Secure Multiparty Computation. Commun. ACM (2020). [53] Heiko Ludwig, Nathalie Baracaldo, Gegi Thomas, Yi Zhou, Ali Anwar, Shashank Rajamoni, Yuya Ong, Jayaram Radhakrishnan, Ashish Verma, and Mathieu Sinn. 2020. IBM Federated Learning: an Enterprise Framework White Paper V0. 1. CoRR abs/2007.10987 (2020). [54] Kalikinkar Mandal and Guang Gong. 2019. PrivFL: Practical Privacy-preserving Federated Regressions on High-dimensional Data over Mobile Networks. In CCSW@CCS. [55] Zoltán Ádám Mann, Christian Weinert, Daphnee Chabal, and Joppe W. Bos. 2022. Towards Practical Secure Neural Network Inference: The Journey So Far and the Road Ahead. Cryptology ePrint Archive, Paper 2022/1483. [56] Mohamad Mansouri, Melek Önen, Wafa Ben Jaballah, and Mauro Conti. 2023. SoK: Secure Aggregation Based on Cryptographic Schemes for Federated Learning. PETS (2023). [57] Sergio Marti and Hector Garcia-Molina. 2006. Taxonomy of Trust: Categorizing P2P Reputation Systems. Computer Networks (2006). [58] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Agüera y Arcas. 2017. Communication-Efficient Learning of Deep Net- works from Decentralized Data. In AISTATS. [59] Payman Mohassel and Yupeng Zhang. 2017. SecureML: A System for Scalable Privacy-Preserving Machine Learning. In IEEE S&P. [60] Christian Mouchet, Juan Troncoso-Pastoriza, Jean-Philippe Bossuat, and Jean- Pierre Hubaux. 2021. Multiparty Homomorphic Encryption from Ring-Learning- With-Errors. PETS (2021). [61] Thien Duc Nguyen, Phillip Rieger, Huili Chen, Hossein Yalame, Helen Möllering, Hossein Fereidooni, Samuel Marchal, Markus Miettinen, Azalia Mirhoseini, Shaza Zeitouni, Farinaz Koushanfar, Ahmad-Reza Sadeghi, and Thomas Schneider. 2022. FLAME: Taming Backdoors in Federated Learning. In USENIX Security. [62] Ahmed El Ouadrhiri and Ahmed Abdelhadi. 2022. Differential Privacy for Deep and Federated Learning: A Survey. IEEE Access (2022). [63] Pascal Paillier. 1999. Public-Key Cryptosystems based on Composite Degree Residuosity Classes. In EUROCRYPT. [64] Dario Pasquini, Danilo Francati, and Giuseppe Ateniese. 2022. Eluding Secure Aggregation in Federated Learning via Model Inconsistency. In CCS. [65] Arpita Patra, Thomas Schneider, Ajith Suresh, and Hossein Yalame. 2021. ABY2.0: Improved Mixed-Protocol Secure Two-Party Computation. In USENIX Security. [66] Arpita Patra and Ajith Suresh. 2020. BLAZE: Blazing Fast Privacy-Preserving Machine Learning. In NDSS. [67] Le Trieu Phong, Yoshinori Aono, Takuya Hayashi, Lihua Wang, and Shiho Moriai. 2018. Privacy-Preserving Deep Learning via Additively Homomorphic Encryp- tion. IEEE Trans. Inf. Forensics Secur. (2018). [68] Mayank Rathee, Conghao Shen, Sameer Wagh, and Raluca Ada Popa. 2023. ELSA: Secure Aggregation for Federated Learning with Malicious Actors. In IEEE S&P. [69] Nicola Rieke, Jonny Hancox, Wenqi Li, Fausto Milletarì, Holger R. Roth, Shadi Albarqouni, Spyridon Bakas, Mathieu N. Galtier, Bennett A. Landman, Klaus H. Maier-Hein, Sébastien Ourselin, Micah J. Sheller, Ronald M. Summers, Andrew Trask, Daguang Xu, Maximilian Baust, and M. Jorge Cardoso. 2020. The future of digital health with federated learning. npj Digit. Medicine 3 (2020). [70] Ronald L. Rivest, Len Adleman, and Michael L. Dertouzos. 1978. On Data Banks and Privacy Homomorphisms. Foundations of Secure Computation (1978). [71] Frank Rubin. 1996. One-Time Pad Cryptography. Cryptologia (1996). [72] Mark Russinovich, Manuel Costa, Cédric Fournet, David Chisnall, Antoine Delignat-Lavaud, Sylvan Clebsch, Kapil Vaswani, and Vikas Bhatia. 2021. Toward Confidential Cloud Computing. Commun. ACM (2021). [73] Sinem Sav, Apostolos Pyrgelis, Juan Ramón Troncoso-Pastoriza, David Froelicher, Jean-Philippe Bossuat, Joao Sa Sousa, and Jean-Pierre Hubaux. 2021. POSEIDON: Privacy-Preserving Federated Neural Network Learning. In NDSS. [74] Thomas Schneider, Ajith Suresh, and Hossein Yalame. 2023. Comments on "Privacy-Enhanced Federated Learning Against Poisoning Adversaries". IEEE Trans. Inf. Forensics Secur. (2023). [75] Virat Shejwalkar and Amir Houmansadr. 2021. Manipulating the Byzantine: Optimizing Model Poisoning Attacks and Defenses for Federated Learning. In NDSS. [76] Virat Shejwalkar, Amir Houmansadr, Peter Kairouz, and Daniel Ramage. 2022. Back to the Drawing Board: A Critical Evaluation of Poisoning Attacks on Pro- duction Federated Learning. In IEEE S&P. [77] Jinhyun So, Ramy E. Ali, Basak Guler, Jiantao Jiao, and Salman Avestimehr. 2021. Securing Secure Aggregation: Mitigating Multi-Round Privacy Leakage in Federated Learning. CoRR abs/2106.03328 (2021). [78] Lakshminarayanan Subramanian, Sharad Agarwal, Jennifer Rexford, and Randy H. Katz. 2002. Characterizing the Internet Hierarchy from Multiple Van- tage Points. In INFOCOM. [79] Ajith Suresh. 2021. MPCLeague: Robust MPC Platform for Privacy-Preserving Machine Learning. CoRR abs/2112.13338 (2021). [80] Zhiyi Tian, Lei Cui, Jie Liang, and Shui Yu. 2022. A Comprehensive Survey on Poisoning Attacks and Countermeasures in Machine Learning. Comput. Surveys (2022). [81] Vale Tolpegin, Stacey Truex, Mehmet Emre Gursoy, and Ling Liu. 2020. Data Poisoning Attacks Against Federated Learning Systems. In ESORICS. [82] Hongyi Wang, Kartik Sreenivasan, Shashank Rajput, Harit Vishwakarma, Saurabh Agarwal, Jy-yong Sohn, Kangwook Lee, and Dimitris S. Papailiopoulos. 2020. Attack of the Tails: Yes, You Really Can Backdoor Federated Learning. In NeurIPS. [83] Zhiyuan Wang, Hongli Xu, Jianchun Liu, He Huang, Chunming Qiao, and Yang- ming Zhao. 2021. Resource-Efficient Federated Learning with Hierarchical Ag- gregation in Edge Computing. In INFOCOM. [84] Yuxin Wen, Jonas Geiping, Liam Fowl, Micah Goldblum, and Tom Goldstein. 2022. Fishing for User Data in Large-Batch Federated Learning via Gradient Magnification. In ICML. [85] Han Xiao, Huang Xiao, and Claudia Eckert. 2012. Adversarial Label Flips Attack on Support Vector Machines. In ECAI. [86] Chulin Xie, Keli Huang, Pin-Yu Chen, and Bo Li. 2020. DBA: Distributed Backdoor Attacks against Federated Learning. In ICLR. [87] He Yang. 2021. H-FL: A Hierarchical Communication Efficient and Privacy- Protected Architecture for Federated Learning. In IJCAI. [88] Andrew Chi-Chih Yao. 1986. How to Generate and Exchange Secrets (Extended Abstract). In FOCS. [89] Dong Yin, Yudong Chen, Kannan Ramchandran, and Peter L. Bartlett. 2018. Byzantine-Robust Distributed Learning: Towards Optimal Statistical Rates. In ICML. [90] Xuefei Yin, Yanming Zhu, and Jiankun Hu. 2022. A Comprehensive Survey of Privacy-preserving Federated Learning: A Taxonomy, Review, and Future Directions. ACM Comput. Surv. (2022). [91] Chengliang Zhang, Junzhe Xia, Baichen Yang, Huancheng Puyang, Wei Wang, Ruichuan Chen, Istemi Ekin Akkus, Paarijaat Aditya, and Feng Yan. 2021. Citadel: Protecting Data Privacy and Model Confidentiality for Collaborative Learning. In ACM SoCC. [92] Joshua C. Zhao, Atul Sharma, Ahmed Roushdy Elkordy, Yahya H. Ezzeldin, Salman Avestimehr, and Saurabh Bagchi. 2023. Secure Aggregation in Feder- ated Learning is not Private: Leaking User Data at Large Scale through Model Modification. CoRR abs/2303.12233 (2023). [93] Wenting Zheng, Ryan Deng, Weikeng Chen, Raluca Ada Popa, Aurojit Panda, and Ion Stoica. 2021. Cerebro: A Platform for Multi-Party Cryptographic Collaborative Learning. In USENIX Security. [94] Ligeng Zhu, Zhijian Liu, and Song Han. 2019. Deep Leakage from Gradients. In NeurIPS. [95] Michael Zink, David E. Irwin, Emmanuel Cecchet, Hakan Saplakoglu, Orran Krieger, Martin C. Herbordt, Michael Daitzman, Peter Desnoyers, Miriam Leeser, and Suranga Handagala. 2021. The Open Cloud Testbed (OCT): A Platform for Research into new Cloud Technologies. In IEEE CloudNet. A ADDITIONAL DETAILS FOR HYFL A.1.1 Data-Poisoning Attacks in HyFL. In data-poisoning attacks, malicious clients can perform arbitrary manipulations to the train- ing data. State-of-the-art attacks are based on label flipping, where clients keep the legitimate training samples, yet exchange the asso- ciated labels according to different strategies. We implement four label-flipping attacks in HyFL, and the de- tails are presented next. In the attack scenario, we assume a single attacker controlling all malicious clients, coordinating their actions. Only one attack occurs at a time, and if multiple clients have the same data sample, their poisoned labels will be the same. The as- sumption is that each malicious client poisons all its data samples to maximize the attack's impact. The data is poisoned once and the labels remain constant throughout the model's training. A1: Random Label Flipping (RLF [85]): Each poisoned sample is assigned a random class label, i.e., for num_classes classes in the dataset, define new_label = randint(0, num_classes − 1). 12 A2: Static Label Flipping (SLF [31, 76]): Uses a fixed permutation to determine the new label for each poisoned sample, given by the equation new_label = num_classes − old_label − 1. A3: Dynamic Label Flipping (DLF [76]): Employs a surrogate model to flip the labels for each sample. In our implementation, we aggregate the data from all malicious clients and utilize it to train a model with the same architecture as the one used in HyFL training. Once trained, this model is utilized for inference and the labels are assigned to the least probable output determined by the surrogate model. The term "dynamic" is used because the labels rely on the trained model, and by altering the training configuration, the poisoned labels will be modified accordingly. The exact training settings of the surrogate model are given in Tab. 7. A4: Targeted Label Flipping (TLF [81]): Simply flips all labels from a source class to a target class. In HyFL, we always set the source class as 0 and the target class as 1. Table 7: Training parameters for surrogate model in DLF. Parameter Epochs Batch Size Learning Rate Momentum Weight Decay Values 50 128 0.05 0.9 0.0005 A.1.2 CrypTen Implementation Details. CrypTen lacks a built-in oblivious sorting functionality, so we implement privacy-preserving sorting for so-called CrypTensors. Sorting is necessary to compute trimmed mean and our optimized trimmed mean variant. We mini- mize the number of comparisons by implementing a bitonic sorting network that generates the necessary comparisons between ele- ments to allow for a non-stable sorting algorithm. For trimmed mean, it is not necessary to preserve the relative order of same valued keys as each of them would have been seen as suspicious anyway. The comparisons are stored in plaintext, as they do not reveal any information about the data. The comparison steps are only computed once and then executed in parallel for each coordi- nate. For 100 elements, we perform 1077 comparisons and for 10 elements only 31. As the result of each comparison is hidden, we perform the swap operation for each pairs as described in Lst. 1. 1 compare_indices = list ( comparision_generator ( tensors . size (1) )) 2 for (i , j) in compare_indices : 3 b = tensors [: , i ]. gt ( tensors [: , j ]) h = b * tensors [: , i ] + (1 - b ) * tensors [: , j] l = b * tensors [: , j ] + (1 - b ) * tensors [: , i] tensors [: , i ] = l tensors [: , j ] = h 4 5 6 7 Listing 1: CrypTen: Parallel Sorting When computing the proposed trimmed mean variant, we are only interested in the indices of the outliers and therefore only perform the swap operations on an indices list. This is done to minimize the compute operations and thereby reduce time and communication. After identifying which gradients were most often detected as outliers and then computing the set of benign indices, lastly we compute the sum over those while preserving privacy. The procedure is shown in Lst. 2. 13 1 def bincount ( self , indices , num_bins ): 2 indices_list = crypten . cryptensor ( torch . arange (0 , num_bins )) counts = crypten . stack ([ indices for _ in range ( num_bins )], dim 3 4 =1) . eq ( indices_list ). sum ( dim =0) return counts [ None , :] 5 6 def exclude_topk_indices ( self , indices , k): 7 sorted_indices = self . sort ( indices ). reshape ( -1) n = sorted_indices . shape [0] return sorted_indices [:n -k] 8 9 10 11 benign_indices = self . exclude_topk_indices ( 12 self . bincount ( outlier_indices , num_bins =n) , k= self . exclude_topk ) 13 14 15 all_indices = crypten . cryptensor ( torch . arange (0 , n). repeat ( benign_indices . size (0) , 1) ).t () 16 agg_sum = gradients . matmul ( all_indices . eq ( benign_indices )) . sum ( dim =1) 17 18 return agg_sum / (n - self . exclude_topk ) Listing 2: CrypTen: Sum of Benign Updates A.1.3 Run configuration. In this section, we list all the hyper pa- rameters used during training that do not change between runs. Parameters that change between runs are explained in the appro- priate section. Tab. 8 shows the settings that affect the training by the clients and MPC clusters respectively. We consider 1000 clients overall from which 100 are randomly sampled during each training iteration. In the FL setting, all sampled clients provide their computed update directly to the aggregation server. In the HyFL setting, each of the 10 MPC clusters has 100 associated clients from which each samples 10 clients at random. Each client has 200 data points assigned to it at random with duplicates allowed between clients. To allow for a fair comparison between FL and HyFL, we scale the learning rate from 0.005 for the FL setting to 0.05 for the HyFL setting. Each client and MPC cluster performs 5 local training epochs with either a batch size of 8 or 80, respectively, following the recommendation of Goyal et al. [40]. Table 8: Training parameteres used in PyTorch and CrypTen. Parameter # clients # clients selected per round # MPC clusters # clients per MPC cluster # clients per MPC cluster per round size of client datasets learn rate # local epochs batch size FL HyFL 1000 100 - - - 10 100 10 200 0.005 0.05 5 8 80 Tab. 9 shows the hyper parameters used by the aggregation server. The trimmed mean threshold α has been chosen such that it can exclude all malicious updates on either side in the FL setting. The worst-case scenario we consider is a 0.2 poison rate, which is equivalent to approximately 20 malicious clients selected per round. In the HyFL setting, the cluster-focused setting is the strongest adversarial setting and we therefore appropriately scale α. For the trimmed mean variant, we exclude complete updates based on how Table 9: Robust aggregation parameters. Parameter Trimmed Mean α Trimmed Mean Variant excluded gradients FLTrust root data set size FL HyFL 20 40 2 4 200 often they were detected as outliers and therefore need to double α to later aggregate the same number of parameters per coordinate. FLTrust uses a root data set to calculate the server model. To be most effective, the server model must be similar to the benign models and therefore the root dataset must be representative for the whole dataset. Therefore, we sample (like for all clients) 200 data points for that dataset. A.1.4 Additional Results for Q1. Fig. 6 shows the full 2000 training iterations. As seen in Fig. 2, HyFL trains the model faster than reg- ular FL and converges to a higher validation accuracy. For MNIST, HyFL achieves 98.95% compared to 98.72% for regular FL, and 89.04% compared to 82.14% on CIFAR10, respectively. A.1.5 Additional Results for Q4. ResNet9/CIFAR10. Here, we present the full evaluation results for ResNet9 trained on CIFAR10 under attack. We evaluate FedAvg, FLTrust, and trimmed mean in regular FL and HyFL under four different data-poisoning attacks with three different poison rates and three different distributions of malicious clients. Fig. 7 shows the results for equally-distributed malicious clients for 2000 rounds. Fig. 8 shows the focused attack and Fig. 9 shows cluster-focused results. HyFL outperforms regular FL in nearly all settings and has more than 5% higher validation accuracy after 2000 rounds. In both regu- lar FL and HyFL, all three aggregation schemes show robustness against data poisoning in the realistic settings with 0.01 and 0.1 poison rate and equally-distributed as well as focused attacks. This is not the case for a poison rate of 0.2. Especially FedAvg as a non- robust aggregation scheme struggles to converge. Even robust ag- gregations cannot fully counteract the attacks. The same is true for the cluster-focused attack distribution. Here, all aggregations have spikes in their validation accuracy; only FLTrust manages to train a model comparable to the other settings. This is because FLTrust is designed to be robust against model poisoning, and the cluster- focused setting is the closest to a model-poisoning attack. LeNet/MNIST. We now show additional evaluation results for LeNet trained on MNIST. The settings are the same as previously. Fig. 10 shows equally-distributed, Fig. 11 shows focused, and Fig. 12 shows the cluster-focused attack distribution for 2000 iterations. As for ResNet9, HyFL trains the model faster than regular FL, but both converge to a similar accuracy in most cases after 2000 rounds. Here, the advantage of HyFL over regular FL mostly lies in the faster convergence: after only 100 rounds of training, HyFL nearly reaches 98% accuracy, regardless of the attack or attack setting. Also, there is little difference between the three aggregation schemes for the realistic settings. For the 0.2 poison rate, FedAvg starts to struggle a lot to train the model. This can mostly be seen for FedAvg in regular FL and sometimes in HyFL. A.1.6 Additional Results for Q6. ResNet9/CIFAR10. We present the extended evaluation of the trimmed mean variant for CIFAR10 under all attacks and attack settings in HyFL. The plots are divided into the three distributions for malicious clients and show the evaluation results for 2000 it- erations. Fig. 13 shows equally-distributed, Fig. 14 shows focused, and Fig. 15 shows cluster-focused. We compare trimmed mean with our trimmed mean variant when samling 10, 100 and 1000 coordinates. In most cases, all four aggregations perform equally and the final validation accuracy is nearly the same. The only difference can be seen with the cluster-focused attack distribution and 0.2 poison rate. Here, trimmed mean achieves a substantially lower accuracy than the trimmed mean variant. We assume that is because cluster- focused acts more like a model poisoning attack and trimmed mean variant deals better with this by discarding whole gradients rather than operating coordinate-wise. LeNet/MNIST. We also compared trimmed mean against our trimmed mean variant for LeNet being trained on MNIST. However, almost all settings, the aggregations perform very similar. Hence, we omit the full plots. Figure 6: Validation accuracy for FL and HyFL for 2000 epochs (top: LeNet/MNIST, bottom: ResNet9/CIFAR10) 14 0500100015002000Epochs0255075100Accuracy18001900200098.599.0FLHyFL0500100015002000Epochs0255075100Accuracy1800190020008090FLHyFL Figure 7: Validation accuracy for ResNet9/CIFAR10 training with FedAvg, FLTrust, and trimmed mean for 2000 iterations under RLF, SLF, DLF, and TLF attacks in the equally-distributed setting. 15 025050075010001250150017502000Poison: 0.01020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL Figure 8: Validation accuracy for ResNet9/CIFAR10 training with FedAvg, FLTrust, and trimmed mean for 2000 iterations under RLF, SLF, DLF, and TLF attacks in the focused setting. 16 025050075010001250150017502000Poison: 0.01020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL Figure 9: Validation accuracy for ResNet9/CIFAR10 training with FedAvg, FLTrust, and trimmed mean for 2000 iterations under RLF, SLF, DLF, and TLF attacks in the cluster-focused setting. 17 025050075010001250150017502000Poison: 0.01020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL Figure 10: Validation accuracy for LeNet/MNIST training with FedAvg, FLTrust, and trimmed mean for 2000 iterations under RLF, SLF, DLF, and TLF attacks in the equally-distributed setting. 18 025050075010001250150017502000Poison: 0.01020406080100RLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100RLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100RLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100SLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100SLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100SLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100DLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100DLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100DLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100TLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100TLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100TLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL Figure 11: Validation accuracy for LeNet/MNIST training with FedAvg, FLTrust, and trimmed mean for 2000 iterations under RLF, SLF, DLF, and TLF attacks in the focused setting. 19 025050075010001250150017502000Poison: 0.01020406080100RLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100RLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100RLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100SLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100SLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100SLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100DLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100DLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100DLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100TLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100TLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100TLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL Figure 12: Validation accuracy for LeNet/MNIST training with FedAvg, FLTrust, and trimmed mean for 2000 iterations under RLF, SLF, DLF, and TLF attacks in the cluster-focused setting. 20 025050075010001250150017502000Poison: 0.01020406080100RLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100RLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100RLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100SLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100SLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100SLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100DLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100DLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100DLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100TLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100TLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100TLF1800185019001950200090951001800185019001950200095.097.5100.0FedAvgFLTrustTrimmed MeanFLHyFL Figure 13: Validation accuracy for ResNet9/CIFAR10 training with trimmed mean and our trimmed mean variant for 2000 iterations under RLF, SLF, DLF, and TLF attacks in the equally-distributed setting. 21 025050075010001250150017502000Poison: 0.01020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL Figure 14: Validation accuracy for ResNet9/CIFAR10 training with trimmed mean and our trimmed mean variant for 2000 iterations under RLF, SLF, DLF, and TLF attacks in the focused setting. 22 025050075010001250150017502000Poison: 0.01020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL Figure 15: Validation accuracy for ResNet9/CIFAR10 training with trimmed mean and our trimmed mean variant for 2000 iterations under RLF, SLF, DLF, and TLF attacks in the cluster-focused setting. 23 025050075010001250150017502000Poison: 0.01020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100RLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100SLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100DLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.01020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.1020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL025050075010001250150017502000Poison: 0.2020406080100TLF180018501900195020007080180018501900195020008090FedAvgFLTrustTrimmed MeanFLHyFL
http://arxiv.org/abs/2302.09893v2
2023-09-10T18:06:56
2023-02-20T10:40:29
Efficient Generator of Mathematical Expressions for Symbolic Regression
We propose an approach to symbolic regression based on a novel variational autoencoder for generating hierarchical structures, HVAE. It combines simple atomic units with shared weights to recursively encode and decode the individual nodes in the hierarchy. Encoding is performed bottom-up and decoding top-down. We empirically show that HVAE can be trained efficiently with small corpora of mathematical expressions and can accurately encode expressions into a smooth low-dimensional latent space. The latter can be efficiently explored with various optimization methods to address the task of symbolic regression. Indeed, random search through the latent space of HVAE performs better than random search through expressions generated by manually crafted probabilistic grammars for mathematical expressions. Finally, EDHiE system for symbolic regression, which applies an evolutionary algorithm to the latent space of HVAE, reconstructs equations from a standard symbolic regression benchmark better than a state-of-the-art system based on a similar combination of deep learning and evolutionary algorithms.\v{z}
[ "Sebastian Mežnar", "Sašo Džeroski", "Ljupčo Todorovski" ]
10.1007/s10994-023-06400-2
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1007/s10994-023-06400-2", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.09893v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09893v2", "@rel": "related", "@type": "application/pdf" } ]
[ "Mach Learn (2023)" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "I.2.0; I.2.6" ]
3 2 0 2 p e S 0 1 ] G L . s c [ 2 v 3 9 8 9 0 . 2 0 3 2 : v i X r a Efficient Generator of Mathematical Expressions for Symbolic Regression Sebastian Mežnar1,2*, Sašo Džeroski1 and Ljupčo Todorovski3,1 1*Department of Knowledge Technologies, Jožef Stefan Institute, Jamova cesta 39, Ljubljana, 1000, Slovenia. 2Jožef Stefan International Postgraduate School, Jamova cesta 39, Ljubljana, 1000, Slovenia. 3Faculty of Mathematics and Physics, University of Ljubljana, Jadranska 21, Ljubljana, 1000, Slovenia. *Corresponding author(s). E-mail(s): [email protected]; Contributing authors: [email protected]; [email protected]; Abstract We propose an approach to symbolic regression based on a novel vari- ational autoencoder for generating hierarchical structures, HVAE. It combines simple atomic units with shared weights to recursively encode and decode the individual nodes in the hierarchy. Encoding is performed bottom-up and decoding top-down. We empirically show that HVAE can be trained efficiently with small corpora of mathematical expressions and can accurately encode expressions into a smooth low-dimensional latent space. The latter can be efficiently explored with various opti- mization methods to address the task of symbolic regression. Indeed, random search through the latent space of HVAE performs better than random search through expressions generated by manually crafted proba- bilistic grammars for mathematical expressions. Finally, EDHiE system for symbolic regression, which applies an evolutionary algorithm to the latent space of HVAE, reconstructs equations from a standard sym- bolic regression benchmark better than a state-of-the-art system based on a similar combination of deep learning and evolutionary algorithms. Keywords: Symbolic regression, Equation discovery, Generative models, Variational autoencoders, Evolutionary algorithms 1 2 Efficient Generator of Mathematical Expressions for Symbolic Regression 1 Introduction Symbolic regression (also known as equation discovery) aims at discovering closed-form equations in collections of measured data [1, 2]. Methods for symbolic regression explore the vast space of candidate equations to find those that fit the given data well. They often employ modeling knowledge from the domain of use to constrain the search space of candidate equations. The knowledge is usually formalized into grammars [3] or libraries of model components, such as entities and processes [4]. Knowledge-based equation discovery methods have successfully solved practical modeling problems in various domains [5, 6]. Grammars and libraries of model components are used to generate candidate expressions that might appear in the discovered equations. However, they must be manually crafted, which is a severe obstacle to their broader use. The central aim of this article is to develop a novel generative model of mathematical expressions that can be used for efficient symbolic regression. The model can be trained from a corpus of mathematical expressions from the domain of interest, thus automatically tailoring the space of candidate equations to the application at hand. The developed generative model must have two essential properties to be applicable in such a scenario. First, it should be trainable from a small number of mathematical expressions, e.g., collected from a textbook or from scientific literature in the application domain. Second, the model should encode the expressions in a low-dimensional latent space. The latter space can then be efficiently explored by optimization methods to solve the task of symbolic regression. Lowering the dimensionality of the latent space will significantly increase the efficiency of symbolic regression. Recently, several variational autoencoders (VAEs) have been shown to be efficient generative models. CVAE [7] employs a VAE based on recurrent neural networks to encode discrete expressions into a continuous latent space and then decode points from the latent space back into discrete mathematical expressions. This decoder can be used to generate expressions. However, CVAE still generates invalid sequences and requires extensive training data to reduce the likelihood of generating invalid expressions [8]. The grammar variational autoencoder, GVAE [9], and its successor, SD-VAE [10], employ a context-free grammar to ensure the syntactic validity of the generated expressions. Instead of directly training models on sequences, they model the distribution of parse trees that are produced by the grammar while deriving syntactically (and, in the case of SD-VAE, semantically) valid expressions. We claim that grammars are an unnecessarily powerful and too general formalism for generating mathematical expressions. Grammars add syntactic categories to the expression symbols rendering the parse trees, i.e., the structures modeled with the autoencoder, more complex than the original sequences. This overhead on training expressions inevitably translates to a requirement for more extensive training data and a latent space with larger dimensionality, reducing the efficiency of optimization methods for symbolic regression operating in that latent space. Efficient Generator of Mathematical Expressions for Symbolic Regression 3 We propose a novel variational autoencoder for hierarchical data objects, HVAE, to address these issues. It builds upon the ideas of variational autoen- coders for hierarchical data [11] and gated recursive convolutional neural networks [12]. HVAE combines simple atomic units with shared weights to encode and decode the individual nodes in the hierarchy. The atomic units are extensions of the standard gated recurrent unit (GRU) cells. The encoding units are stacked into a tree that follows the hierarchy of the training object, and they encode the hierarchy bottom-up, compiling the codes of the descen- dants to encode the ancestor nodes. The decoding units proceed top-down and use the decoded symbols of the ancestor nodes to decide upon the need to extend the hierarchy with descendant nodes. We claim that HVAE can be efficiently trained to generate valid mathematical expressions from a training set of modest size, while using a low-dimensional latent space. We exploit these expected properties of our HVAE to implement a novel approach for symbolic regression, EDHiE. It performs an evolutionary search through the latent space of a HVAE trained on mathematical expression trees as shown in Figure 1. The genetic operations utilize the HVAE encoder to obtain the expressions' latent codes, generate new individuals with crossover and mutation in the latent space, and decode the latter back to mathemati- cal expressions. EDHiE can then evaluate the fit of the obtained expressions against the measurements. We conjecture that the performance of EDHiE on standard benchmarks [13, 14] would compare favorably to that of a state-of-the- art symbolic regression methods [15]. The results of our empirical evaluation of HVAE and EDHiE confirm our conjectures. HVAE can achieve better recon- struction of the training expressions with order-of-magnitude fewer training examples while using latent spaces with fewer dimensions. EDHiE outperforms alternative methods for symbolic regression on the task of reconstructing the ten equations in the Ngyuen benchmark. We can summarize the contributions of this work as follows: • We propose HVAE, a variational autoencoder for hierarchical data, that can be efficiently trained to generate mathematical expressions from modest amounts of data, while using a low-dimensional latent space. • We introduce EDHiE, a symbolic regression approach that exploits HVAE to efficiently search through the space of candidate equations. The remainder of the paper is organized as follows. Section 2 reviews related work on generative models and symbolic regression. We introduce the hierarchical variational autoencoder HVAE and the symbolic regression approach EDHiE in Section 3. Section 4 presents the results of the empirical evaluation of HVAE and EDHiE. Finally, Section 5 summarizes and discusses the contributions of the presented work and outlines directions for further research. 4 Efficient Generator of Mathematical Expressions for Symbolic Regression Fig. 1: A schematic representation of the EDHiE approach. In the first step, we train a HVAE model. In the second step, we explore the latent space of the HVAE model with an evolutionary algorithm. The red dot represents the best expression in a given iteration. 2 Related work Most of the early successful applications of generative models have been in the domains of text, speech, images, and video, i.e., they have been mainly used for generating unstructured data objects composed of continuous data elements. The discrete data structures that generative models have most often tackled are strings or sequences of characters, where the data elements are discrete symbols. The models that use strings as input (and output) usually do so by training a recurrent neural network [16], most commonly using seq2seq autoencoders [17]. A major problem of sequence-to-sequence autoencoders is that they do not guarantee the syntactic correctness of the generated expressions. One way to solve this problem is to learn an additional validation model for checking the correctness of the generated sequence [18]. Grammar variational autoencoders (GVAE) [9] use context-free grammars for specifying the space of valid struc- tured data objects. Each data object can be then represented as a sequence of grammar productions (rewrite rules) that derives it. In turn, GVAE encode sequences of rewrite rules that derive objects instead of the objects themselves. The structure of the decoder is constrained to generate valid sequences of rewrite rules that are then used together with the grammar to generate valid expressions. Dai et al. [10] propose the use of attribute grammars, i.e., context-free grammars that attach attributes to the grammar's syntactic categories. By Efficient Generator of Mathematical Expressions for Symbolic Regression 5 prescribing properties and relationships between the attributes, such grammars can also encode semantic constraints on the derived data objects. The attribute grammars, together with SD-VAE, i.e., syntax-directed VAE, can generate expressions that are consistent with a set of both syntactic and semantic con- straints. Alternative generalizations of grammars have been used for generative modeling of program source code in high-level languages [19]. Most of the above approaches can also generate mathematical expressions. However, they need the complex formalism of grammars to generate more complex data structures, most often molecular structures [7, 10]. Since mathe- matical expressions can be represented as simpler structures, i.e., binary trees, our work concerns generative models for hierarchical (tree-structured) data. Hierarchical data have been tackled by generative models in several ways. By making a node depend on its parent and previous sibling, DRNN [20] combines representations obtained from the depth-wise and width-wise recurrent cells to generate new nodes, which proves useful for recovering the structure of a tree. On the other hand, Tree-LSTM [21] and JT-VAE [11] focus on adapting equations for recurrent cells to encode (and decode) hierarchical structures more efficiently. Tree-LSTM proposes a generalization of the LSTM cell for encoding trees into a representation that proves effective for classification tasks and semantic relatedness of sentence pairs. JT-VAE adapts recurrent cells for tree message passing. Trees are used as scaffolding for the graph that represents molecules. Encoding and decoding are thus split into four parts: encoding of the graph, encoding of the tree, decoding of the tree, and decoding of the graph. While these adaptations are similar to the ones presented in our work, their focus is on encoding more general structures that are unrelated to mathematical expressions. Note that our model falls into the general framework of gated recursive convolutional neural networks [12] that combine atomic units with shared parameters in a hierarchy. The output of the root node produces a fixed-length encoding of a data object with an arbitrarily complex structure. Another model, marginally related to ours, is the one of equivalence neural networks [22]. The encoding produced by these networks follows the expressions' semantic similarity and equivalence, in contrast to their syntactic similarity, which is followed by all the other approaches, including ours. Finally, our work is also related to algorithms for equation discovery and symbolic regression. Most of them generate candidate expressions for equations first and then estimate the values of their constant parameters by matching the equations against data in the second phase. Classical symbolic regression approaches [1, 23, 24], based on evolutionary algorithms, use stochastic genera- tors of expression trees: At the beginning, the expression trees are randomly sampled, and later on, they are transformed using the evolutionary stochastic operations of mutation and cross-over. In contrast, process-based modeling approaches [4] generate equations by following domain-specific knowledge (pro- vided by the user) that specifies a set of entities (variables) and processes 6 Efficient Generator of Mathematical Expressions for Symbolic Regression (interactions among entities). Grammar-based approaches to equation discov- ery employ user-specified context-free grammars (which can also be based on domain knowledge), deterministic [25] or probabilistic [3], as efficient generators of expressions. Recently, many symbolic regression approaches based on neural networks have been proposed [14, 26–30]. In particular, Deep Symbolic Optimization, DSO approaches symbolic regression (among other optimization tasks [15]) by combining neural networks and reinforcement learning with evolutionary algorithms. The neural networks are used to sample the individuals in the initial population of the evolutionary algorithm and are retrained at each iteration to focus on expressions leading to better fit. It is closely related to our work, since it combines similar methods. Yet our focus here is on efficient neural networks for generating mathematical expressions that are trained before the beginning of the evolutionary process. 3 Methodology We start this section by briefly introducing the task of symbolic regression and the search space of mathematical expressions (Section 3.1). After this, we introduce variational autoencoders and the structure of the hierarchical variational autoencoder, HVAE (Section 3.2). We finish the section by explaining how to use HVAE for generating mathematical expressions and how to combine it with an evolutionary algorithm for symbolic regression (Section 3.3). 3.1 Symbolic regression and expression trees Symbolic regression (SR) is the machine learning task of discovering equations in collections of measured data. Symbolic regression methods take a data set S consisting of multiple measurements of a set of real-valued variables V = {x1, x2, . . . , xp, y}, where y is a designated target variable. The output of SR is an equation of the form y = f (x1, x2, . . . , xp), where the right-hand side of the equation is a closed-form mathematical expression. The equation should provide an optimal fit against the measurements from S, i.e., minimize the discrepancy between the observed values of the target variable y and values calculated by using the equation. Symbolic regression methods usually follow the parsimony principle, preferring simpler expressions over more complex ones. Symbolic regression methods search through the space of candidate math- ematical expressions for the right-hand side of the equation to find the one that optimally fits the measurements. Mathematical expressions can be repre- sented in different ways. We commonly use the infix notation, where operators are placed between two sub-expressions they operate on, e.g., A + B, where A and B are sub-expressions. Infix notation uses parentheses to indicate the order in which the operations need to be performed. Prefix (Polish) or post- fix (reverse Polish) notations do not need parentheses since the operators are written before or after the two sub-expressions, e.g., +AB or AB+. The three notations correspond to different traversals of the nodes in an expression tree. Efficient Generator of Mathematical Expressions for Symbolic Regression 7 The latter is a hierarchical data structure, where the inner nodes correspond to mathematical operators and functions, while the leaf nodes correspond to variables and constants. In symbolic regression, the constants' values are fitted against the measured data from S, while variables include elements from V without the target variable. We assume binary expression trees since standard arithmetic operators are binary. We take that the second descendant node is null in the inner nodes corresponding to single-argument functions. We define the height of an expression tree as the number of nodes on the longest path from the root node to one of the leaves. Figure 2 depicts an example expression tree with a height of four, along with the corresponding mathematical expression in different notations. Fig. 2: An expression tree with a height of four and three sequence-based representations of the corresponding mathematical expression. Our model generates expression trees, as they have several advantages over sequences (strings). Firstly, it is easy to achieve syntactic correctness, since operators and functions are in the inner nodes, while variables and constants are in the leafs. Secondly, information needs to travel at most log n steps up the tree (up to the tree's height) instead of n steps along the sequence (up to the length of the sequence). Lastly, sub-expressions can be encoded independently of each other during the encoding process. 3.2 Hierarchical variational autoencoder In recent years, variational autoencoders [31] have emerged as one of the most popular generative models. The reason for this is that, when trained correctly, variational autoencoders map the observed data with an unknown distribution into a latent representation with a known distribution. This results in a continuous latent space, from which one can sample and synthesize new data. In contrast to a (deterministic) autoencoder, where the encoder outputs a latent representation z that is directly fed into the decoder, the encoder in the variational autoencoder outputs the parameters for an approximate posterior distribution, e.g., μ and σ in the case of a latent space parameterized by a multivariate Gaussian distribution. Thus, a representation z that is fed into the decoder is sampled from the underlying distribution with the learned parameters (μ, σ). The loss of 8 Efficient Generator of Mathematical Expressions for Symbolic Regression (a) Encoding (b) Decoding Fig. 3: The processes of (a) encoding and (b) decoding the expression tree of x + cos x. The acronyms EC and DC stand for "encoding cell" (introduced in Section 3.2.2) and "decoding cell" (introduced in Section 3.2.3). the variational autoencoder is the reconstruction error, i.e., the difference between the input to the encoder and the output of the decoder. Additionally, variational autoencoders typically use Kullback-Leibler (KL) divergence [32] as the regularization term for the loss. The loss can thus be calculated as: J(x, μz, σz) = Jrec(x) + λ * KL(N (μz, σz) ∥ N (0, I)), (1) where Jrec(x) is the reconstruction loss of x and λ ≥ 0 the regularization cost parameter. In case the underlying distribution is Gaussian, KL divergence to an isotropic unit Gaussian can be estimated as KL(N (μz, σz) ∥ N (0, I)) = 1 2 (1 + log σ2 z − μ2 z − σ2 z ). (2) We use cost annealing [33] to focus on the reconstruction error (i.e., use small values of λ) at the beginning and then gradually shift the focus towards the smoothness of the latent space by increasing the value of λ. 3.2.1 Model overview Our approach uses a variational autoencoder structure that consists of an encoder and a decoder. The encoder takes tree-structured data as input and outputs a distribution in the latent vector space, represented with the mean (μz) and the logarithm of the variance (log σz) vectors. The decoder works in the opposite direction, sampling a point from the latent vector space as input and transforming it into a binary expression tree. To make the backward propagation possible, we sample points with the reparametrization trick. Trees are encoded recursively, starting from leafs and ending at root nodes. To encode a subtree with a root in n, we first encode its left and right subtrees. We then pass their codes, along with the symbol in the node n, as inputs to the Efficient Generator of Mathematical Expressions for Symbolic Regression 9 encoding cell (further described in Section 3.2.2). This cell outputs the code of the subtree rooted in n. At the beginning of the recursion, in each leaf node, the codes corresponding to the (missing) children are assumed to be vectors of zeros. Once the root of the tree is encoded, its code is passed through two fully connected layers that give the mean and log-variance vectors that form the latent representation of the tree. Figure 3a illustrates the recursive encoding process on the expression x + cos x. The first layer of the decoder transforms the sampled point from the latent space into the code of the hierarchy. After this, the tree is generated recursively by passing the code of the current node (subtree) through the decoding cell (further described in section 3.2.3). This cell takes the code of the node (subtree) as input and generates a node symbol, along with the codes of the two child nodes. There are three possible symbol types. If we encounter an operator, both child nodes are generated recursively. On the other hand, if the symbol represents a function, we only generate the left child. Lastly, if the symbol is either a variable or a constant, no further child nodes are generated in this branch. This process is shown in Figure 3b, where the expression x + cos x is decoded. During training, we follow the structure of the encoded tree and try to predict the correct node symbols. In turn, we jointly learn to predict the structure of the expression tree and the symbols inside the node, since the structure is determined by the symbols. We calculate the loss using cross-entropy on a sequence of symbols obtained with the in-order traversal of the expression tree. Some additional implementation details are explained in Appendix D. 3.2.2 Encoder The encoding proceeds in two phases. The first follows the hierarchy of the input and applies the encoding cell to each node of the hierarchy as described above. In the second phase, the code of the root node is transformed into the mean and log-variance vectors of the input's latent representation. Encoding comprises a GRU21 cell, which we have adapted from the GRU cell [34]. The (output) code h in GRU21 is computed from the input vector x, and codes hl of the left and hr of the right child with the following equations: r = φS(Wirx + bir + Whr(hl ++ hr) + bhr) u = φS(Wiux + biu + Whu(hl ++ hr) + bhu) n = tanh(Winx + bin + r ∗ (Whn(hl ++ hr) + bhn)) h = (1 − u) ∗ n + u 2 ∗ hl + u 2 ∗ hr, (3) (4) (5) (6) where φS denotes the Sigmoid activation function. In these expressions, r, u, and n represent the standard reset gate, update gate and candidate activation vectors from a GRU cell. When compared to the original equations of the GRU cell, Equations (3),(4),(5) exhibit two differences. First, instead of the code of the previous symbol in the sequence, the concatenation of the codes hl and 10 Efficient Generator of Mathematical Expressions for Symbolic Regression hr of the child nodes is used (denoted by (hl ++ hr)). Second, the dimension of the weight matrices Whr, Whu, Whn must be dim(hl) + dim(hr) instead of dim(h). Thus, while Equation (6) remains similar to the original one, we change the second term (from its usual form u ∗ ht−1) to u 2 ∗ hr, to retain information from the codes of the two child nodes. Recall that ∗ denotes the element-wise multiplication of vectors. 2 ∗ hl + u In the second phase, the model transforms the code of the root node into the latent representation of the input expression through two fully-connected layers. 3.2.3 Decoder The decoding also comprises two phases. In the first, a fully-connected layer transforms a point from the latent vector space into the code of the root node. In the second phase, the decoding cell is recursively deployed to decode each of the nodes in the expression tree. Fig. 4: The structure of the decoding cell. Figure 4 depicts the structure of the decoding cell. The cell is composed of a fully connected layer, a softmax layer, and the GRU12 cell, an adaptation of the original GRU cell. The input code is first passed through the sequence of a fully- connected and a softmax layer. The latter creates the vector of probabilities, from which the most probable output symbol is chosen. If the output symbol is either a constant or a variable, the decoding stops. Otherwise, the output vector is also used as an input to the GRU12 cell, together with the code that is given as input into the decoding cell. The GRU12 cell produces two codes, one for the left and one for the right child. GRU12 computes the two codes hl and hr for the child nodes using the input vector x and the code h with the following equations: r = φS(Wirx + bir + Whrh + bhr) u = φS(Wiux + biu + Whuh + bhu) n = tanh(Winx + bin + r ∗ (Whnh + bhn)) d = (1 − u) ∗ n + u ∗ (h ++ h) (7) (8) (9) (10) Efficient Generator of Mathematical Expressions for Symbolic Regression d ≡ hl ++ hr 11 (11) There are two major differences between GRU12 and the original GRU cell. First, the vectors r,u, and n in Equations (7),(8),(9) are of dimension 2 * dim(h) instead of dim(h). Consequently, all bias vectors are of dimension 2 * dim(h), and all weight matrices have an output dimension of 2 * dim(h). Second, in Equation (10), the code h is concatenated with itself to make the dimensions in the equation match. Vector d is then split in half in Equation 11. The first part is used as a code for the left child, while the second is used as a code for the right child. 3.3 Generating expressions for symbolic regression Recall that the goal of symbolic regression is to efficiently search through the space of mathematical expressions and find the one that, when used on the right-hand of an equation, fits given measurements well. In this section, we explain how to use HVAE for generating expressions. 3.3.1 HVAE as a generative model We can generate expressions in two ways, corresponding to two different sym- bolic regression scenarios. The first way, which aims at discovering equations from data, samples random vectors from the standardized Gaussian distribution N (0, I) in the latent space and passes them through the decoder. On the other hand, we might want to generate expressions in a scenario that corresponds to the revision of existing equations to fit newly gathered data. Here, we want to generate mathematical expressions that are similar to the one given as input. Our approach achieves this by encoding an expression and sampling its immediate neighborhood in the latent space. We expect these points to be decoded into expressions similar to the one given as input. We will show that HVAE meets this expectation in Section 4.1.4. 3.3.2 Evolutionary algorithm operators Finally, we can search the latent space spanned by our model with evolution- ary algorithms [35], one of the most commonly used paradigms for symbolic regression. Evolutionary algorithms explore the search space by first randomly sampling individuals for the initial population. Then they repetitively generate new populations by combining pairs of individuals from the current population with the genetic operators of mutation and crossover. An individual in a population is in our case a real-valued vector z, corre- sponding to the code of an expression tree in the latent vector space. Using the HVAE model, z can be decoded into an expression tree. To calculate the individual's fit against the training data, we first fit the values of the constant parameters in the decoded expression tree and then measure the error of the equation with the resulting expression on the right-hand side (with respect to 12 Efficient Generator of Mathematical Expressions for Symbolic Regression the training data). We generate the initial population by randomly sampling individuals from the Gaussian distribution N (0, I). Crossover combines two individuals, referred to as parents zA and zB, into an offspring zO. We generate the latter as a convex combination of zA and zB, i.e. zO = (1 − a) * zA + a * zB, where a is sampled from the uniform distribution on the interval [0, 1]. For values of a close to 0 and 1, the offspring is close to one of the parents, while values of a close to 0.5 lead to an offspring equally dissimilar to both parents. The mutation operator transforms an individual z into a mutated individual zM . To perform a mutation, we first decode z into an expression tree and immediately encode it back into its latent space representation to obtain the value of σz. Now, we can mutate z into an individual with a syntactically similar expression by sampling from N (μz, σz) or into a random individual by sampling the offspring zO from N (0, I). Similarly to the case of crossover, we interpolate between these two extremes by sampling from N (a * μz + (1 − a) * 0, a * σz + (1 − a) * I) = N (a * μz, a * σz + (1 − a) * I), where a is randomly sampled from the uniform distribution on the interval [0, 1]. When a is close to 0, the offspring zO is chosen at random (see the first paragraph of Section 3.3.1). On the other hand, when a is close to 1, zO is syntactically similar to z (second paragraph of Section 3.3.1). We implement the EDHiE (Equation Discovery with Hierarchical variational autoEncoders) approach for symbolic regression by combining HVAE with evo- lutionary algorithms using these operators. Our implementation uses pymoo [36] for evolutionary algorithms and ProGED [3] functionality for evaluating the fit of a candidate equation. 4 Evaluation In this section, we will investigate the validity of our hypothesis that the hier- archical variational autoencoder is a more efficient generator of mathematical expressions than the alternative VAEs for sequences by conducting two series of computational experiments. In the first series, we are going to evaluate the performance and efficiency of HVAE on the task of generating mathematical expressions. In the second series, we will evaluate the performance of EDHiE on the symbolic regression downstream task. 4.1 The performance of HVAE We start this section by introducing the experimental setup (Section 4.1.1). We continue with reporting the experimental results of evaluating HVAE with respect to the reconstruction error (Section 4.1.2), efficiency in terms of the size of training data needed, the dimensionality of the latent space (Section 4.1.3), and finally the smoothness of the latent space (Section 4.1.4). In Appendix B, we further justify our claim that points close in the latent space of HVAE are decoded into similar expressions. Efficient Generator of Mathematical Expressions for Symbolic Regression 13 4.1.1 Experimental setup Data sets. We estimate the reconstruction error of the variational autoencoders on a collection of six synthetic data sets, ranging from small ones, including simple expressions, to large ones, including complex expressions. The data sets are as follows: AE4-2k, AE5-15k, and AE7-20k have 2, 15, and 20 thousand mathematical expressions with trees with a maximum height of four, five, and seven. These expressions can contain constants, variables, and the operators +,−,*,/, and ˆ. Trig4-2k, Trig5-15k, and Trig7-20k are the same as above, but the expressions also contain the sine and cosine functions. We create these data sets with the ProGED [3] system by randomly sampling mathematical expressions from a given probabilistic context-free grammar. The generated expressions are simplified using the Python library SymPy [37]. The context-free grammars that constrain the output of GVAE and the ones used to generate the data sets are documented in Appendix A. Parameter setting. We train GVAE and CVAE for 150 epochs with the following values of their hyper-parameters: latent dimension = 128, hidden dimension = 128, batch size = 64, kernel sizes of the convolution layers = 2, 3, 4, and the ADAM optimizer [38]. For reconstruction results created with our approach (HVAE), the hyper-parameters are: latent size = 128, batch size = 32, and the ADAM optimizer with the default learning rate. For the first 1,800 iterations i, we calculate the regularization cost parameter λ using λi = 0.5 * (tanh i−4,500 2 + 1), after this, we set λi to λ1,800. Estimating the reconstruction error. The Levenshtein distance [39] (often referred to as the edit distance) quantifies the dissimilarity of two strings in terms of the number of insertion, removal, and substitution operations that are needed to transform one string into the other. We use this distance to test how well our autoencoder recreates expressions. We first pass the expression through the VAE to get the predicted expression. If needed, we validate the syntactical correctness of the latter and transform it into an expression tree. We then traverse the input and the output trees in post-order (left child, right child, node symbol) to obtain the input and the output expressions in the postfix notation (which does not require parentheses and is hence more suited for calculating the distance between expressions). Finally, we calculate the edit distance between those two strings. To estimate the reconstruction error on unseen expressions, we use five-fold cross-validation with the same splits across all methods. GVAE and CVAE sometimes produce invalid expressions, which we discard from the evaluation. Because of this, the results in Section 4.1.2 and 4.1.3 might be biased in favor of CVAE due to many syntactically incorrect expressions being discarded. Note that GVAE has fixed-size input (and output) that might be too short for encoding all the grammar rules needed to derive an expression. In those cases, GVAE returns empty strings, which we consider invalid expressions. 14 Efficient Generator of Mathematical Expressions for Symbolic Regression CVAE, on the other hand, produces syntactically incorrect expressions such as xc(/x)c) sin sin(c)), * * x − c * / sin(x)), or (/x(−x)c) (presented here in infix notation). 4.1.2 Out-of-sample reconstruction error Table 1 compares the out-of-sample reconstruction error and the ratio of invalid expressions for the three variational autoencoders. Our hierarchical VAE significantly outperforms the other two methods on all data sets. An interesting observation is that GVAE works consistently better on expressions involving trigonometric functions, while HVAE and CVAE perform worse. The reason for the opposite effect is probably the following: for GVAE, functions only represent yet another production rule in the grammar, while for HVAE and CVAE they drastically change the structure of the expression (tree). This translates to better performance of GVAE, as expressions with trigonometric functions are usually shorter, given that the nodes corresponding to the trigonometric functions have only one descendant instead of the usual two. Table 1: The out-of-sample reconstruction error and the percentages of syntac- tically incorrect expressions generated by the three variational autoencoders. HVAE GVAE CVAE Dataset Edit distance Invalid Edit distance Invalid Edit distance Invalid AE4-2k Trig4-2k AE5-15k Trig5-15k AE7-20k Trig7-20k 0.076 (± 0.024) 0.119 (± 0.026) 0.079 (± 0.014) 0.093 (± 0.010) 0.501 (± 0.017) 0.530 (± 0.036) 0.0 (± 0.0) 0.0 (± 0.0) 0.0 (± 0.0) 0.0 (± 0.0) 0.0 (± 0.0) 0.0 (± 0.0) 0.2 (± 0.0) 3.959 (± 0.135) 3.199 (± 0.068) 0.0 (± 0.0) 2.827 (± 0.280) < 0.1 (± 0.0) 1.489 (± 0.195) < 0.1 (± 0.0) 5.201 (± 0.289) < 0.1 (± 0.0) 3.423 (± 0.467) < 0.1 (± 0.0) 3.873 (± 0.132) 3.619 (± 0.045) 1.547 (± 0.466) 2.086 (± 0.346) 3.654 (± 0.349) 3.660 (± 0.287) 33.8 (± 1.1) 48.3 (± 0.6) 3.5 (± 0.0) 13.9 (± 0.0) 9.9 (± 0.0) 26.3 (± 0.1) The percentages of invalid expressions generated by the approaches show that our approach always produces syntactically correct expressions, while GVAE and CVAE sometimes fail to produce valid outputs. The fraction of such expressions is quite small when the GVAE approach is used (see the explanation above) but quite significant when CVAE is used. Lastly, we can notice that, as expected, longer expressions are harder to recreate and thus have higher edit distance and a higher percentage of invalid expressions than shorter ones, provided enough training data is used. 4.1.3 Training efficiency and the latent space dimensionality We proceed to test our conjectures about the efficiency of training the generators of mathematical expressions. We expect that HVAE would require less training data and a lower dimensionality of the latent space to achieve the same levels of reconstruction error in comparison to other approaches. The latter is especially important because of the exploration of the latent space, which is more efficient in low-dimensional latent spaces. Efficient Generator of Mathematical Expressions for Symbolic Regression 15 (a) Size of the training set (b) Dimensionality of the latent space Fig. 5: The impact of the (a) training data set size and (b) dimensionality of the latent space on the reconstruction error of the three autoencoders. Figure 5a depicts the impact of the number of expressions in the training set on the reconstruction error for the three different generative models. Again, HVAE significantly outperforms the other two VAEs. Its reconstruction error is estimated to be consistently lower than 0.25, even when trained on 2 thousand examples only. This error is an order of magnitude lower than the lowest error of 1.5 achieved by the second best model, GVAE, when trained on the whole data set of 12 thousand examples. Figure 5b shows the impact of the dimensionality of the latent space on the reconstruction error across different VAEs. In line with the previous results, HVAE significantly outperforms both CVAE and GVAE. HVAE with latent space of dimension 16 performs on par or better than GVAE and CVAE with latent spaces of 256 dimensions. We can see that the reconstruction error quickly raises when the latent space dimension is less than 32, but otherwise, the reconstruction error is consistently low. Even with a latent space size of 16, our approach is still comparable to the other two methods with a latent space of dimension 256. This allows us to reduce the dimensionality of the latent space by two orders of magnitude, which makes HVAE an excellent candidate for generating expressions for symbolic regression. The reason for the superior efficiency of HVAE is the use of expression trees, as subexpressions are always encoded into the same code, regardless of their position in the expression. This significantly reduces the space of possible codes and allows for training the model in a way that better generalizes to the repetitive subexpressions (subpatterns) it encounters. 4.1.4 Latent space smoothness Finally, we expect the latent space of HVAE to be smooth in the sense that samples close to the latent representation of the input expression are decoded into expressions similar to the one given as input. We investigate the validity of this conjecture by applying linear interpolation (performing a homotopic 16 Efficient Generator of Mathematical Expressions for Symbolic Regression transformation) between two expressions in the latent space. Assume that we are given two expressions, A and B. Using the model, we encode them into their latent representations zA and zB. We can then generate new latent representations zα by combining the two representations with the formula zα = (1 − α) * zA + α * zB, where α ∈ {i/n : i ∈ N ∧ i ≤ n}. Decoding the latent representations zα in a smooth latent space should produce intermediate expressions that represent a smooth transition from A to B in n steps. Table 2: Examples of linear interpolation between two expressions in the latent spaces of the three VAEs. Expressions that are colored red are syntactically incorrect. Here, we set n = 4 and α = i/4, 0 ≤ i ≤ 4. α HVAE GVAE CVAE Expression A c * cos c + c α = 0 α = 0.25 α = 0.5 α = 0.75 α = 1 Expression B Expression A α = 0 α = 0.25 α = 0.5 α = 0.75 α = 1 Expression B sin x x + x x + x sin x x + x c * x + c c * sin c + c c*sin c c + x sin(x−sin c) x sin(x−c) x sin(x−c) x sin c sin c c * cos c + c c * cos c + c c + c x + x x + x cos c + c * x ccos c * x x − x c + x x + c * c sin(x−c) x sin(x−c) x x − sin(c * x) x − sin(c * x) x * sin c − sin(c * x) c * sin x + x c * cos x c + c c * x * cos x c * x * cos x c + c c + c x − sin(c * x) x sin(c*x) x sin(c*x) c + cos c c * x * cos( x c ) c c * x * cos( x c ) + c c * x * cos( x c ) + c c * cos c + c c * cos c + x cos c + c − x c − cos c − x x + x sin c xx * sin x c * sin x x * sin c c cos(x(c) − c* sin(x−c) x sin(x−c) x x − sin(c * x) x − sin(c * x) x − cos(c * x) c cos − cos *c) − c c * x * cos( c x ) c c * x * cos( x c ) + c c * x * cos( x c ) + c Table 2 shows the results of such a linear interpolation in the latent spaces of the different VAEs. HVAE and GVAE produce continuous latent spaces where the transition from expression A to expression B is indeed smooth. CVAE also produces a smooth transition, but some of the intermediate expressions might be syntactically incorrect. The second interpolation in the lower part of the table is an example of a smooth transition in the HVAE latent space. We can see that at each step only a few expression symbols change and that these changes are rarely redundant. Appendix B provides further examples of interpolations with visualizations of the expression trees. 4.2 Evaluating EDHiE In the second series of experiments, we evaluate the performance of EDHiE. We start the section by introducing the experimental setup (Section 4.2.1). We then report on the impact of the dimensionality of the latent space on the performance of symbolic regression (Section 4.2.2). Furthermore, we compare the performance of EDHiE with that of other methods for symbolic regression on the Nguyen benchmark (Section 4.2.3) and report the performance of EDHiE on the Feynman benchmark (Section 4.2.4). Efficient Generator of Mathematical Expressions for Symbolic Regression 17 4.2.1 Experimental setup Data sets. The Nguyen [13] benchmark contains eight equations with one non- target variable and two equations with two non-target variables. The right-hand sides of these equations are shown in the second column of Table 3. We generate two data sets (train and test) with five thousand simulated measurements for each equation. We use the train set to select the best expressions and the test set to evaluate their performance with the metrics described below. We sample points from the interval [−20, 20] for equations 1-6, the interval [0, 40] for equation 7, [0, 80] for equation 8, and [0, 20] for equations 9 and 10. We further evaluate our approach on the 16 equations involving up to two variables from the Feynman benchmark [14]. The right-hand sides of these equations are shown on in the last column of Table 3. Because equations in the Feynman benchmark represent real-world equations, each of the equations FM-3, FM-4, FM-5, and FM-7 contains two entries. Each entry comes with its own variables and data sets of measurements. Table 3: Expressions from the Nguyen (first two columns on the left-hand side) and Feynman (last three columns on the right-hand side) benchmarks. ID NG-1 NG-2 NG-3 NG-4 NG-5 NG-6 NG-7 NG-8 NG-9 NG-10 Expression ID ID-Feynman Expression x3 + x2 + x FM-1 I.6.2a x4 + x3 + x2 + x x5 + x4 + x3 + x2 + x x6 + x5 + x4 + x3 + x2 + x sin x2 * cos x − 1 sin x + sin(x + x2) ln(x + 1) + ln(x2 + 1) x sin x + sin y2 2 sin x * cos y √ √ ( FM-2 FM-3 FM-4 FM-5 FM-6 FM-7 FM-8 FM-9 I.6.2 I.12.1, I.12.5 I.14.4, II.8.31 I.25.13, I.29.4 I.26.2 I.34.27, III.12.43 I.39.1 II.3.24 FM-10 FM-11 FM-12 II.11.28 II.27.18 II.38.14 2 2 (2π)−0.5e− x2 2π * y)−1e− (x/y)2 xy 0.5 xy2 x/y arcsin(x sin y) (2π)−1xy 1.5 xy x 4πy2 1+xy 1−(0.3 xy) xy2 x 2*(1+y) Evaluation process. We compare the performance of EDHiE on the Nguyen benchmark equations to the performance of three other symbolic regression sys- tems. ProGED [3] uses probabilistic grammars as generators of mathematical expressions. DSO [30] combines deep neural networks with evolutionary algo- rithms. PySR [24] employs evolutionary optimization with operators directly applied to the expression trees. We run each system ten times on each equation and evaluate at most 100,000 sampled expressions. All approaches use the same library of tokens and/or grammars, further described in Appendix A. When running PySR, we allow fitting the values of the constant parameters since it can not be turned off in the implementation. The dimensionality of the latent space of HVAE is set to 32; the ADAM optimizer uses the default learning rate. We elaborate on the setting of the dimensionality of the latent space in the next section. Appendix C gives the complete report on the experiments in latent spaces with varying dimensions. 18 Efficient Generator of Mathematical Expressions for Symbolic Regression Estimating the performance. We use three metrics: the number of successful reconstructions, i.e., runs leading to an equation equivalent to the original one; the mean R2 of the best equation; and the number of expressions sampled to achieve reconstruction. We consider a run successful if we find an expression where the RMSE between the target and predicted values is lower than 10−10. To guarantee accurate reporting, we manually check if the original and expression with the lowest RMSE are equivalent. In each run, we use the expression with the lowest RMSE to calculate the bounded R2 metric on the test set using the formula R2(ˆy, y) = max 0, 1 − (cid:18) (cid:19) (cid:80) (cid:80) i(yi − ˆyi)2 i(yi − y)2 , (12) where ˆyi denotes the predicted value of the target variable (calculated by using the equation), yi is the measured value of the target variable, and y is the mean value of y in the training data set. Lastly, we show the average number (across the ten runs) of unique expressions considered before reconstructing the original equation. To this end, we count the unique expressions that the symbolic regression system has considered before the reconstructed equation is encountered in the generation process for all the methods that report this. 4.2.2 The impact of the dimensionality of the latent space Let us start with a series of computational experiments exploring the latent space for encoding mathematical expressions with random sampling. Here, we perform symbolic regression by taking randomly sampled points in the latent space and decoding them into expressions that are then evaluated on the measurements/data. The expression that fits the data best is selected as the candidate for the discovered equation. Table 4 shows the number of successful runs of the random sampling approaches based on the three VAEs, CVAE, GVAE, and HVAE. In the further discussion of results, we use the name HVAR for HVAE with random sampling. We can see here a typical example of the curse of dimensionality at work. When the symbolic regression algorithm explores high-dimensional latent spaces, it can easily slip into parts of those spaces that do not lead to optimal equations. Table 4: The performance of symbolic regression (number of successful recon- structions) by randomly sampling with CVAE, GVAE, and HVAE on the Nguyen benchmark. Equation\Approach CVAE Latent space size 32 64 GVAE 32 64 128 HVAR 32 64 128 128 NG-1 NG-2 NG-3 NG-4 NG-5 NG-6 NG-7 NG-8 Total/Mean 4 0 0 0 0 0 0 10 14 2 0 0 0 0 0 0 10 12 2 0 0 0 0 0 0 3 5 10 2 0 0 0 2 0 10 24 9 4 0 1 0 0 0 10 24 10 3 0 0 0 0 0 10 23 10 10 0 0 0 4 0 10 34 10 5 0 0 0 4 0 10 29 10 9 1 0 0 0 0 10 30 Efficient Generator of Mathematical Expressions for Symbolic Regression 19 Table 5: Comparison of the performance of symbolic regression (number of successful reconstructions, R2, and number of evaluated equations) with random sampling on the Nguyen benchmark. We compare sampling from a manually- crafted probabilistic grammar (ProGED) with sampling using a trained HVAE (HVAR). Name NG-1 NG-2 NG-3 NG-4 NG-5 NG-6 NG-7 NG-8 NG-9 NG-10 Total/Mean ProGED [3] Successful Average R2 Evaluated HVAR (Ours) Successful Average R2 Evaluated 10 2 0 0 0 0 0 10 1 0 23 1.00 (± 0.00) 1.00 (± 0.01) 1.00 (± 0.01) 1.00 (± 0.01) 0.01 (± 0.01) 0.60 (± 0.11) 0.99 (± 0.01) 1.00 (± 0.00) 0.56 (± 0.14) 0.65 (± 0.11) 0.78 (± 0.31) 2374 (± 1451) 7680 (± 670) NA NA NA NA NA 319 (± 287) 12602 (± 0) NA 10 10 0 0 0 4 0 10 5 0 39 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.01) 1.00 (± 0.01) 0.00 (± 0.00) 0.81 (± 0.20) 0.99 (± 0.01) 1.00 (± 0.00) 0.83 (± 0.21) 0.55 (± 0.08) 0.81 (± 0.31) 901 (± 1332) 9729 (± 5337) NA NA NA 37619 (± 2773) NA 392 (± 456) 23236 (± 11844) NA This shows that the ability of HVAE to encode mathematical expressions in low- dimensional latent spaces is crucial for the performance of symbolic regression with HVAR. Based on the results of the experiments in Table 4 and Appendix C, in the remainder of this section, we use 32-dimensional latent space for EDHiE. 4.2.3 Comparison on the Nguyen equations In the next series of experiments, we compare the performance of HVAR, the random sampling method using HVAE, to the one of ProGED-the latter samples mathematical expressions using manually crafted probabilistic grammar. Table 5 reports the results of the comparison. The results show that the generator used within HVAE is not worse than the probabilistic grammar. To our surprise, HVAR outperforms ProGED significantly. First, it successfully reconstructs five (of the ten) equations from the Nguyen benchmark in ten runs, one more than ProGED. Second, for the three equations of NG-2, NG-6, and NG-9, the reconstruction is achieved faster, i.e., by evaluating fewer candidate expressions. Furthermore, we check the contribution of the evolutionary approach in EDHiE over the random sampling method HVAR. To this end, we compare the last three columns of Table 5 with the last three columns of Table 6. EDHiE successfully reconstructs all ten equations from the Nguyen benchmarks in at least one of the ten runs. In three cases, the equations are reconstructed in every run. Note also that the successful reconstructions with EDHiE require fewer evaluations of candidate equations than the random sampling approaches. Table 6 compares EDHiE with PySR, which uses evolutionary operators on expression trees directly (i.e., without embedding them into a latent space), and DSO, that similarly to our approach, combines deep learning with evo- lutionary optimization. Overall, EDHiE performs better than the other two methods across all metrics1: it achieves the highest total number of successful 1PySR does not report the number of evaluated equation. Hence, we could not include them in Table 6. 20 Efficient Generator of Mathematical Expressions for Symbolic Regression Table 6: Comparison of the performance of the symbolic regression systems EDHiE, DSO, and PySR on the Nguyen benchmark. Name NG-1 NG-2 NG-3 NG-4 NG-5 NG-6 NG-7 NG-8 NG-9 NG-10 Total/Mean EDHiE (our) Successful Mean R2 Evaluated DSO [30] Successful Mean R2 Evaluated PySR [24] Successful Mean R2 10 10 6 3 3 8 8 10 8 1 66 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.01) 1.00 (± 0.01) 0.32 (± 0.45) 0.88 (± 0.14) 1.00 (± 0.01) 1.00 (± 0.00) 0.95 (± 0.15) 0.70 (± 0.17) 0.89 (± 0.21) 573 (± 261) 5803 (± 4148) 20931 (± 4858) 21346 (± 4479) 20615 (± 8394) 12772 (± 7923) 19203 (± 3595) 405 (± 174) 7041 (± 3933) 31863 (± 6970) 10 10 10 8 0 1 10 10 2 0 61 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.01) 0.00 (± 0.00) 0.59 (± 0.15) 1.00 (± 0.00) 1.00 (± 0.00) 0.60 (± 0.20) 0.56 (± 0.10) 0.78 (± 0.31) 4565 (± 327) 12206 (± 9186) 8053 (± 3766) 32946 (± 15613) NA 49599 (± 0) 22579 (± 10264) 5521 (± 1779) 39786 (± 28197) NA 10 10 2 0 0 4 7 10 10 1 54 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.01) 0.99 (± 0.01) 0.16 (± 0.15) 0.86 (± 0.13) 0.99 (± 0.01) 1.00 (± 0.00) 1.00 (± 0.00) 0.80 (± 0.16) 0.88 (± 0.26) reconstructions. EDHiE has more successful reconstructions for five equations than PySR and less for a single equation, NG-9. The superior performance of EDHiE relative to PySR indicates that evolutionary optimization is more efficient in the latent space than in the space of expression trees. For four equations, EDHiE achieves successful reconstruction more often than DSO. In the two instances of reconstructing NG-3 and NG-4, DSO achieves success twice as often as our method. Finally, note that the experiments on the Nguyen benchmark were performed on noise-free synthetic data. The results of the experiments on synthetic data with added noise, reported in Appendix C.3, show that EDHiE is robust to noise: The increasing noise level has little effect on the reconstruction success rate while significantly increasing the rank of the successfully reconstructed equation in the list of evaluated equations, sorted with respect to increasing RMSE. Appendix C also includes additional results on the Nguyen benchmark by random sampling of CVAE, GVAE, and HVAE latent space with varying number of dimensions. Table 7: Results of EDHiE on the 16 equations from the Feynman database that include at most two non-target variables. Name FM-1 FM-2 FM-3.1 FM-3.2 FM-4.1 FM-4.2 FM-5.1 FM-5.2 FM-6 FM-7.1 FM-7.2 FM-8 FM-9 FM-10 FM-11 FM-12 Successful Mean R2 Evaluated 10 0 10 10 10 10 10 10 0 10 10 10 10 5 10 10 1.00 (± 0.00) 0.98 (± 0.01) 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.00) 0.99 (± 0.01) 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.00) 0.99 (± 0.01) 1.00 (± 0.00) 1.00 (± 0.00) 4311 (± 1914) NA 38 (± 37) 53 (± 28) 184 (± 123) 188 (± 204) 63 (± 44) 101 (± 109) NA 43 (± 36) 39 (± 39) 62 (± 45) 950 (± 72) 22668 (± 21676) 62 (± 42) 924 (± 795) Total/Mean 135 1.00 (± 0.01) Efficient Generator of Mathematical Expressions for Symbolic Regression 21 4.2.4 Results on the Feynman equations In this section, we evaluate the ability of EDHiE to reconstruct real equations from the domain of physics included in the Feynman database. Table 7 presents the results of symbolic regression on a subset of 16 equations from the database with up to two non-target variables. EDHiE successfully reconstructs 13 equations in all the runs. Most of these equations are simple; thus, EDHiE explores small search spaces comprising less than two hundred evaluated expres- sions. A more complex equation FM-10 is reconstructed in five out of ten runs exploring more than 20 thousand expressions on average. The equation FM-6 could not be reconstructed in any of the runs since it includes the function arcsin that has not been included in our token library. Finally, EDHiE fails to reconstruct the most complex equation FM-2. 5 Discussion and conclusion We introduce a novel variational autoencoder for hierarchies, HVAE, that can be efficiently trained to generate valid mathematical expressions represented as expression trees. Compared to generators based on variational autoencoders for sequences, HVAE has three significant advantages. First, it consistently generates valid expressions. Second, its performance is robust even for small training sets: HVAE trained from only two thousand expressions achieves much lower reconstruction error than sequential VAEs trained from 12 thousand examples. Third, the HVAE operating in 32-dimensional latent space has a lower reconstruction error than sequential VAEs with comparable latent spaces. The ability of HVAE to encode mathematical expressions in a low- dimensional latent space makes it an excellent proxy for exploring the search space of candidate expressions in symbolic regression. Indeed, when performing a random search through the latent space, we achieve comparable performance with a random search through the space of candidate expressions defined by a manually crafted probabilistic grammar. EDHiE, a symbolic regression sys- tem that performs evolutionary optimization in the latent space of the HVAE, significantly outperforms methods based on random search and achieves per- formance comparable to the state-of-the-art symbolic regression system DSO based on a similar combination of evolutionary algorithms and deep learning. The comparison of EDHiE with PySR, a genetic programming approach oper- ating on expression trees directly, shows the benefit of performing evolutionary optimization in the latent space. HVAE has been used here for symbolic regression, but its potential to efficiently generate and encode hierarchies makes it useful in many different contexts, e.g., generating molecular structures or more general symbolic expres- sions. Analysis of its performance in these application domains is a promising direction for further research. Moreover, the ability of HVAE to learn from small corpora of expressions might prove helpful in retraining the generator after each generation of the evolutionary search, much like the iterative learning in DSO. This will narrow its focus to generating better expressions, leading 22 Efficient Generator of Mathematical Expressions for Symbolic Regression to more accurate equations. In general, training the generator on expressions involved in mathematical models that have proved useful in a domain of inter- est will enable seamless integration and transfer of background knowledge in symbolic regression. Code availability. The implementation of HVAE and EDHiE and the scripts needed for performing their evaluation, presented in this article, can be found at https://github.com/smeznar/HVAE. Acknowledgments. The authors acknowledge the financial support of the Slovenian Research Agency via the research core funding No. P2-0103, project No. N2-0128, and by the ARRS Grant for young researchers (first author). The authors especially appreciate the helpful comments and suggestions by Nikola Simidjievski and the fruitful discussions within the SHED discussion group (with Jure Brence, Boštjan Gec, and Nina Omejc). Declarations • Funding: The authors acknowledge the financial support of the Slovenian Research Agency via the research core funding No. P2-0103, project No. N2- 0128, and by the ARRS Grant for young researchers (first author). • Conflict of interest/Competing interests: Not applicable • Ethics approval: Not applicable • Consent to participate: Not applicable • Consent for publication: Not applicable • Availability of data and materials: All data used in this work is available in repositories https://github.com/smeznar/HVAE. • Code availability: The code used in experiments is available in repositories https://github.com/smeznar/HVAE. • Authors' contributions: Conceptualization: Sebastian Mežnar, Ljupčo Todor- ovski; Methodology: Sebastian Mežnar, Ljupčo Todorovski; Writing - original draft preparation: Sebastian Mežnar, Ljupčo Todorovski; Writing - review and editing: Sebastian Mežnar, Ljupčo Todorovski, Sašo Džeroski; Funding acquisition: Sašo Džeroski; Resources: Sašo Džeroski; Supervision: Ljupčo Todorovski, Sašo Džeroski; Software: Sebastian Mežnar; Visualization: Sebas- tian Mežnar; Data curation: Sebastian Mežnar; Investigation: Sebastian Mežnar; Validation: Sebastian Mežnar. References [1] Schmidt, M., Lipson, H.: Distilling free-form natural laws from experi- mental data. Science 324(5923), 81–85 (2009). https://doi.org/10.1126/ science.1165893 [2] Todorovski, L.: Equation discovery. In: Encyclopedia of Machine Learning and Data Mining, pp. 410–414. Springer, ??? (2017). Chap. 5. https: //doi.org/10.1007/978-1-4899-7687-1_258 Efficient Generator of Mathematical Expressions for Symbolic Regression 23 [3] Brence, J., Todorovski, L., Džeroski, S.: Probabilistic grammars for equation discovery. Knowledge-Based Systems 224, 107077 (2021). https: //doi.org/10.1016/j.knosys.2021.107077 [4] Bridewell, W., Langley, P., Todorovski, L., Džeroski, S.: Inductive process modeling. Machine Learning 71(1), 1–32 (2008). https://doi.org/10.1007/ s10994-007-5042-6 [5] Radinja, M., Škerjanec, M., Šraj, M., Džeroski, S., Todorovski, L., Atanasova, N.: Automated modelling of urban runoff based on domain knowledge and equation discovery. Journal of Hydrology 603, 127077 (2021). https://doi.org/10.1016/j.jhydrol.2021.127077 [6] Simidjievski, N., Todorovski, L., Kocijan, J., Dzeroski, S.: Equation dis- covery for nonlinear system identification. IEEE Access 8, 29930–29943 (2020). https://doi.org/10.1109/access.2020.2972076 [7] Gómez-Bombarelli, R., Wei, J.N., Duvenaud, D., Hernández-Lobato, J.M., Sánchez-Lengeling, B., Sheberla, D., Aguilera-Iparraguirre, J., Hirzel, T.D., Adams, R.P., Aspuru-Guzik, A.: Automatic chemical design using a data- driven continuous representation of molecules. ACS Central Science 4(2), 268–276 (2018). https://doi.org/10.1021/acscentsci.7b00572 [8] Kusner, M.J., Hernández-Lobato, J.M.: GANS for Sequences of Discrete Elements with the Gumbel-softmax Distribution. arXiv (2016). https: //doi.org/10.48550/ARXIV.1611.04051 [9] Kusner, M.J., Paige, B., Hernández-Lobato, J.M.: Grammar variational autoencoder. In: Proceedings of the 34th International Conference on Machine Learning - Volume 70. ICML'17, pp. 1945–1954. JMLR.org, ??? (2017). https://doi.org/10.48550/ARXIV.1703.01925 [10] Dai, H., Tian, Y., Dai, B., Skiena, S., Song, L.: Syntax-Directed Variational Autoencoder for Structured Data (2018) [11] Jin, W., Barzilay, R., Jaakkola, T.: Junction tree variational autoencoder for molecular graph generation. In: Artificial Intelligence in Drug Discovery, pp. 228–249. The Royal Society of Chemistry, ??? (2021). https://doi.org/ 10.1039/9781788016841-00228 [12] Cho, K., van Merrienboer, B., Bahdanau, D., Bengio, Y.: On the properties of neural machine translation: Encoder-decoder approaches. arXiv, ??? (2014). https://doi.org/10.48550/ARXIV.1409.1259 [13] Uy, N.Q., Hoai, N.X., O'Neill, M., McKay, R.I., Galván-López, E.: Semantically-based crossover in genetic programming: application to real- valued symbolic regression. Genetic Programming and Evolvable Machines 24 Efficient Generator of Mathematical Expressions for Symbolic Regression 12(2), 91–119 (2011) [14] Udrescu, S.-M., Tegmark, M.: AI Feynman: A physics-inspired method for symbolic regression. Science Advances 6(16), 2631 (2020) [15] Mundhenk, T.N., Landajuela, M., Glatt, R., Santiago, C.P., Faissol, D.M., Petersen, B.K.: Symbolic Regression via Neural-Guided Genetic Program- ming Population Seeding. arXiv (2021). https://doi.org/10.48550/ARXIV. 2111.00053 [16] Sherstinsky, A.: Fundamentals of Recurrent Neural Network (RNN) and Long Short-Term Memory (LSTM) network. Physica D: Nonlinear Phenomena 404, 132306 (2020). https://doi.org/10.1016/j.physd.2019. 132306 [17] Sutskever, I., Vinyals, O., Le, Q.V.: Sequence to sequence learning with neural networks. In: Proceedings of the 27th International Conference on Neural Information Processing Systems - Volume 2. NIPS'14, pp. 3104–3112. MIT Press, Cambridge, MA, USA (2014) [18] Janz, D., van der Westhuizen, J., Paige, B., Kusner, M.J., Hernández- Lobato, J.M.: Learning a generative model for validity in complex discrete structures. In: The Sixth International Conference on Learning Representations (2017). https://doi.org/10.48550/ARXIV.1712.01664 [19] Bielik, P., Raychev, V., Vechev, M.: PHOG: Probabilistic model for code. In: Balcan, M.F., Weinberger, K.Q. (eds.) Proceedings of The Thirty-Third International Conference on Machine Learning. Proceedings of Machine Learning Research, vol. 48, pp. 2933–2942. New York, New York, USA (2016) [20] Alvarez-Melis, D., Jaakkola, T.: Tree-structured decoding with doubly- recurrent neural networks. In: ICLR (2017) [21] Tai, K.S., Socher, R., Manning, C.D.: Improved semantic representations from tree-structured long short-term memory networks. In: Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1556–1566. Association for Computational Linguistics, Beijing, China (2015). https://doi.org/10.3115/v1/P15-1150 [22] Allamanis, M., Chanthirasegaran, P., Kohli, P., Sutton, C.: Learning con- tinuous semantic representations of symbolic expressions. In: Proceedings of the 34th International Conference on Machine Learning - Volume 70, pp. 80–88. JMLR.org, ??? (2017) [23] Guimerà, R., Reichardt, I., Aguilar-Mogas, A., Massucci, F.A., Miranda, Efficient Generator of Mathematical Expressions for Symbolic Regression 25 M., Pallarès, J., Sales-Pardo, M.: A Bayesian machine scientist to aid in the solution of challenging scientific problems. Science Advances 6(5), 6971 (2020). https://doi.org/10.1126/sciadv.aav6971 [24] Cranmer, M.: Interpretable Machine Learning for Science with PySR and SymbolicRegression.jl (2023) [25] Todorovski, L., Dzeroski, S.: Declarative bias in equation discovery. In: Pro- ceedings of the Fourteenth International Conference on Machine Learning. ICML '97, pp. 376–384. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA (1997) [26] Martius, G., Lampert, C.H.: Extrapolation and learning equations (2016) [27] Biggio, L., Bendinelli, T., Neitz, A., Lucchi, A., Parascandolo, G.: Neural Symbolic Regression that Scales. In: Proceedings of 38th International Conference on Machine Learning (ICML). Proceedings of Machine Learning Research, vol. 139, pp. 936–945. PMLR, ??? (2021). https://proceedings. mlr.press/v139/biggio21a.html [28] d'Ascoli, S., Kamienny, P.-A., Lample, G., Charton, F.: Deep symbolic regression for recurrent sequences. arXiv preprint arXiv:2201.04600 (2022) [29] Kamienny, P.-A., d'Ascoli, S., Lample, G., Charton, F.: End-to-end sym- bolic regression with transformers. arXiv (2022). https://doi.org/10.48550/ ARXIV.2204.10532 [30] Petersen, B.K., Landajuela, M., Mundhenk, T.N., Santiago, C.P., Kim, S.K., Kim, J.T.: Deep symbolic regression: Recovering mathematical expressions from data via risk-seeking policy gradients. In: Proc. of the International Conference on Learning Representations (2021) [31] Kingma, D.P., Welling, M.: Auto-Encoding Variational Bayes. In: 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings (2014) [32] Kullback, S., Leibler, R.A.: On Information and Sufficiency. The Annals of Mathematical Statistics 22(1), 79–86 (1951). https://doi.org/10.1214/ aoms/1177729694 [33] Bahuleyan, H.: Natural Language Generation with Neural Variational Models (2018) [34] Cho, K., van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., Bengio, Y.: Learning phrase representations using RNN encoder–decoder for statistical machine translation. In: Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing 26 Efficient Generator of Mathematical Expressions for Symbolic Regression (EMNLP), pp. 1724–1734. Association for Computational Linguistics, Doha, Qatar (2014). https://doi.org/10.3115/v1/D14-1179 [35] Koza, J.R.: Genetic programming as a means for programming computers by natural selection. Statistics and Computing 4(2), 87–112 (1994). https: //doi.org/10.1007/BF00175355 [36] Blank, J., Deb, K.: pymoo: Multi-objective optimization in python. IEEE Access 8, 89497–89509 (2020) [37] Meurer, A., Smith, C.P., Paprocki, M., Čertík, O., Kirpichev, S.B., Rocklin, M., Kumar, A., Ivanov, S., Moore, J.K., Singh, S., Rathnayake, T., Vig, S., Granger, B.E., Muller, R.P., Bonazzi, F., Gupta, H., Vats, S., Johansson, F., Pedregosa, F., Curry, M.J., Terrel, A.R., Roučka, v., Saboo, A., Fernando, I., Kulal, S., Cimrman, R., Scopatz, A.: Sympy: symbolic computing in python. PeerJ Computer Science 3, 103 (2017). https://doi.org/10.7717/ peerj-cs.103 [38] Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. In: Bengio, Y., LeCun, Y. (eds.) 3rd International Conference on Learning Rep- resentations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings (2015) [39] Levenshtein, V.I.: Binary codes capable of correcting deletions, insertions, and reversals. Soviet physics. Doklady 10, 707–710 (1965) Appendix A Grammars and token libraries In the empirical evaluation of the hierarchical autoencoder, we use several context-free grammars and different token libraries. Grammars used to generate synthetic data sets are probabilistic. Mathematical expressions in the data sets with a name prefix of AE include the five common binary arithmetic operators and are generated using the following grammar: S → SAF [0.4] | F [0.6] A → + [0.5] | − [0.5] F → F BT [0.4] | T [0.6] B → * [0.5] | / [0.5] T → (S) [0.25] | c [0.375] | x [0.375] Data sets with a name prefix Trig include, in addition, the trigonometric functions of sine and cosine and are generated using the same grammar as the one above, with different productions for the non-terminal (syntactic category) Efficient Generator of Mathematical Expressions for Symbolic Regression 27 T and a new non-terminal L: T → (S) [0.15] | cos(S) [0.05] | sin(S) [0.05] | L [0.75] L → c [0.5] | x [0.5]. While we do not explicitly have the power operator in the grammars to be used during the generation of the data sets, exponentiation (and thus the power operator) can occur during the simplification of the generated expressions. Because of this, expressions in the data sets also contain the power operator. In addition, GVAE also needs grammars for generating valid expressions. When applied to the data sets with a name prefix of AE, GVAE uses the following grammar: S → S + T | S − T | S * T | T → (S) | x | c S T | ST | T For the data sets with the name prefix of Trig, GVAE uses the same grammar as above with different productions for the non-terminal symbol T : T → (S) | sin(S) | cos(S) | x | c. CVAE uses the token library {+, −, *, /,ˆ, x, c, (, ), "} for data sets with the name prefix AE, and {+, −, *, /,ˆ, sin, cos, x, c, (, ), "} for data sets with the name prefix Trig. For experiments on the Nguyen benchmark, we use the grammar: E → E + F [0.2] | E − F [0.2] | F [0.6] F → E * T [0.2] | E/T [0.2] | T [0.6] T → V [0.4] | (E)P [0.2] | (E) [0.2] | R(E) [0.2] V → x [1.0] P → ˆ2 [0.39] | ˆ3 [0.26] | ˆ4 [0.19] | ˆ5 [0.16] R → sin [0.2] | cos [0.2] | eˆ[0.2] | log [0.2] | sqrt [0.2] for ProGED, GVAE, and to generate training examples for HVAE. HVAE and DSO use the token library {x, +, −, *, /,ˆ2,ˆ3,ˆ4,ˆ5, sin, cos, exp, log, sqrt}, while CVAE uses token {(, ), "} in addition to the tokens used by HVAE and DSO. For expressions with two non-target variables, we add token y and change the non-terminal symbol V to: V → x [0.5] | y [0.5]. 28 Efficient Generator of Mathematical Expressions for Symbolic Regression For experiments on the Feynman benchmark, we use the grammar: E → E + F [0.2] | E − F [0.2] | F [0.6] F → E * T [0.2] | E/T [0.2] | T [0.6] T → V [0.4] | c [0.3] | A [0.3] A → (E)P [0.1] | (E) [0.55] | R(E) [0.35] V → x [1.0] P → ˆ2 [0.8] | ˆ3 [0.2] R → sin [0.25] | cos [0.25] | eˆ[0.25] | sqrt [0.25] generate to tokens {x, c, +, −, *, /,ˆ2,ˆ3, sin, cos, exp, sqrt}. For expressions with two non-target variables, we add token y and change the non-terminal symbol V to: examples training HVAE and for V → x [0.5] | y [0.5]. Appendix B Additional latent space smoothness results Additional examples of linear interpolation with HVAE are shown in Table B1. We can see that the space is continuous, as the expressions smoothly transition from Expression 1 to Expression 2. This is best seen in example 1 from the Trig5-15k data set, where in each step, only a few (relevant) symbols change. In the first step, sin c and x change to c. Then in the next step, c + c and sin x change to x. In the next step x changes to c and x/c changes to x * sin c. In c the last step x + c changes to xc. While most of the time, expressions change gradually, this is not always the case. This can be best seen in the examples from the AE4-2k data set, where only the expressions at α = 0.5 differ from the starting ones. Since we write expressions as a sequence, it is not always obvious how the underlying expression tree changes during interpolation. Visualization of the gradual change for two pairs of expressions is shown in Figure B1. Trees are being transformed by changing their structure and the symbols inside nodes. These transformations are interrelated as changing a constant or a variable into an operator also transforms the structure. This is best seen in the transition between α = 0 and α = 0.25 for the expression trees at the bottom of Figure B1. However, the structure of the expression tree does not always change. This is most noticeable for transitions between α = 0 and α = 0.5 for expression trees at the top of Figure B1. Here only an operator changes at each step. Efficient Generator of Mathematical Expressions for Symbolic Regression 29 Dataset α Example 1 Example 2 AE4-2k AE7-20k Trig5-15k Expression A α = 0 α = 0.25 α = 0.5 α = 0.75 α = 1 Expression B Expression A α = 0 α = 0.25 α = 0.5 α = 0.75 α = 1 Expression B c * (x + c) + xc c c * (x + c) + xc c c * (x + c) + xc c c * x + x+c c c − x + x+c c c − x + x+c c c − x + x+c c c*xc+xc + c c c*xc+xc + c c c+xc c + c c*xc c + x c c − xc c c − xc c c − xc c Expression A c + sin c + sin x c + sin c + sin x c + c + sin x c − x x + x x − x x − x c − x c c c c α = 0 α = 0.25 α = 0.5 α = 0.75 α = 1 Expression B x + c − x * sin c xc − x * sin c xc − x * sin c c − x * c + x c − x * c + x c − x * c + x c − c * x + x c+c*x c c+c*x c c+c*x c c*x c−x + c − x + c c*x c−x + c − x + c c * (c − x) + c − x + c c * x * c − x + c c*xc c+x + x c*xc c+x + x c*xc c+x + x xc * cos c + x xc * cos c + x x * cos c + x c * cos c + cos xc c + cos xc c c + cos xc c c + cos xc c Table B1: Linear interpolation of examples in the HVAE latent space. The first row shows examples from the AE4-2k data set, the second examples from the AE7-20k data set, and the third from the Trig5-15k data set. Here n = 4 and α = i 4 , 0 ≤ i ≤ 4. Appendix C Additional results on the Nguyen benchmark In this appendix, we show additional results of the empirical evaluation. First, we show the performance of HVAR on the first eight equations from the Nguyen benchmark with random sampling (By sampling points from the standardized Gaussian distribution) and different dimensions of the latent space in Section C.1. Next, we show the learning curves of approaches HVAR, ProGED, and EDHiE in Section C.2. After this, we show the performance of EDHiE on noisy data in Section C.3. Finally, we conclude this section in C.4 by showing the performance of CVAE with random sampling and GVAE with both random sampling and an evolutionary algorithm. 30 Efficient Generator of Mathematical Expressions for Symbolic Regression Fig. B1: Examples of linearly interpolated mathematical expressions visualized as expression trees. C.1 Dimensions Table C2 shows the results of evaluation using HVAE with different dimensions of the latent vector space. Here new expressions are generated by randomly sampling points from the standardized Gaussian distribution and decoding them. We can see overall, models, where the dimension of the latent vector space is either 16 or 32, perform the best. HVAE 32 produces expressions that usually have a slightly higher mean R2, while HVAE 16 usually needs to evaluate less unique expressions to generate the desired one. Because we prefer the number of successful runs and the mean R2 metrics, we select the model with the latent vector space dimension 32 for experiments where the HVAE model is coupled together with evolutionary algorithms. Table C2: The performance of HVAR (number of successful reconstructions, R2, and number of evaluated equations) with varying number of latent dimensions on the Nguyen benchmark. Name NG-1 NG-2 NG-3 NG-4 NG-5 NG-6 NG-7 NG-8 Total/Mean HVAR 16 Successful Mean R2 Evaluated HVAR 32 Successful Mean R2 Evaluated HVAR 64 Successful Mean R2 Evaluated HVAR 128 Successful Mean R2 Evaluated 10 10 1 0 0 3 0 10 34 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.01) 1.00 (± 0.01) 0.00 (± 0.00) 0.75 (± 0.18) 1.00 (± 0.01) 1.00 (± 0.00) 0.84 (± 0.33) 500 (± 378) 4407 (± 2904) 16595 (± 0) NA NA 13345 (± 425) NA 345 (± 276) 10 10 0 0 0 4 0 10 34 1.00 (± 0.00) 1.00 (± 0.00) 1.00 (± 0.01) 1.00 (± 0.01) 0.00 (± 0.01) 0.81 (± 0.13) 0.99 (± 0.01) 1.00 (± 0.00) 0.85 (± 0.32) 901 (± 1332) 9729 (± 5337) NA NA NA 37619 (± 2773) NA 392 (± 456) 10 5 0 0 0 4 0 10 29 1.00 (± 0.00) 1.00 (± 0.01) 1.00 (± 0.01) 1.00 (± 0.01) 0.01 (± 0.01) 0.74 (± 0.22) 1.00 (± 0.01) 1.00 (± 0.00) 0.84 (± 0.33) 1985 (± 2270) 14435 (± 8279) NA NA NA 26169 (± 12187) NA 233 (± 171) 10 9 1 0 0 0 0 10 30 1.00 (± 0.00) 1.00 (± 0.01) 1.00 (± 0.01) 1.00 (± 0.01) 0.04 (± 0.07) 0.57 (± 0.09) 1.00 (± 0.01) 1.00 (± 0.00) 0.83 (± 0.33) 1544 (± 1523) 14261 (± 13074) 24562 (± 0) NA NA NA NA 273 (± 205) C.2 Learning curves Optimization algorithms continually enhance solutions over time by itera- tively exploring the input space to minimize an objective function or maximize performance. The learning curve serves as a valuable measure for evaluating Efficient Generator of Mathematical Expressions for Symbolic Regression 31 algorithmic performance, illustrating how the chosen metric evolves as opti- mization progresses. Steep improvements in the learning curve indicate rapid convergence towards better solutions, while plateaus or slow convergence sug- gest challenges in finding superior solutions. By analyzing the learning curve, we can be gain an insight into the algorithm's effectiveness, convergence, stability, and potential for further improvement. Figure C2 shows the learning curves of HVAR, ProGED, and EDHiE on six equations from the Nguyen benchmark. We can see that overall EDHiE performs the best as it achieves the highest R2 score and needs to test the least expression to do so. This is not true on equation NG-8, where the other two approaches find the desired expressions quicker. This happens because all approaches find the desired expression quickly and the evolution part of EDHiE does not yet come into effect. C.3 Robustness to noise In practical scenarios, working with noisy data is common, making it crucial for symbolic regression approaches to perform well in the presence of noise. The performance of EDHiE on noisy data is demonstrated in Table C3. To generate noisy data sets, we sample values ε from a Gaussian distribution N (0, I) and add them to the target values y using the formula ̃y = y * (1 + ηε), where η represents the noise level. To evaluate our approach on noisy data, we employ two metrics: the number of successful runs and the mean rank. We execute our approach on noisy data, rank all the generated expressions based on their RMSE, and evaluate these expressions using noiseless data. A run is considered successful if we find an expression that achieves an RMSE below 10−10 on noiseless data. In the case of a successful run, we record the rank of the first expression with an RMSE below 10−10 and use it to calculate the mean rank. Table C3: The performance of EDHiE with varying level of noise added to synthetic data from the Nguyen benchmark. η Name NG-1 NG-2 NG-3 NG-4 NG-5 NG-6 NG-7 NG-8 NG-9 NG-10 Total 0.01 0.02 0.05 Successful Mean Rank Successful Mean Rank Successful Mean Rank 0.1 Successful 10 10 5 2 4 6 10 10 9 1 67 7.30 (6.74) 1.10 (0.30) 39.40 (4.41) 85.00 (38.00) 1.00 (0.00) 1.00 (0.00) 1.00 (0.00) 1.00 (0.00) 1.00 (0.00) 1.00 (0.00) 7.33 (18.38) 10 10 3 4 1 6 8 10 7 0 59 6.00 (6.20) 1.20 (0.40) 32.67 (20.98) 57.00 (6.16) 1.00 (0.00) 1.00 (0.00) 1.00 (0.00) 1.50 (1.50) 1.00 (0.00) NA 7.37 (16.10) 10 10 3 2 2 6 9 10 9 1 62 9.00 (8.04) 6.80 (3.09) 34.33 (9.81) 52.50 (6.50) 1.00 (0.00) 1.00 (0.00) 1.00 (0.00) 1.70 (1.19) 1.00 (0.00) 1.00 (0.00) 6.61 (11.91) 10 10 2 0 4 9 9 10 8 1 63 Mean Rank 14.60 (16.27) 175.10 (42.15) 50.50 (1.50) NA 1.00 (0.00) 1.00 (0.00) 1.11 (0.31) 3.30 (3.44) 1.00 (0.00) 1.00 (0.00) 32.75 (65.10) 0.2 Successful 10 10 3 2 5 7 8 10 8 1 64 Mean Rank 23.80 (13.91) 222.80 (28.72) 169.33 (25.85) 210.50 (4.50) 1.00 (0.00) 1.00 (0.00) 10.00 (3.46) 5.10 (4.39) 1.00 (0.00) 1.00 (0.00) 55.42 (87.83) The results demonstrate that the number of successful runs remains rel- atively consistent across different noise levelsm indicating the robustness of our approach. Additionally, we can see that the mean rank increases as the amount of noise rises. This outcome is expected, as higher noise levels allow 32 Efficient Generator of Mathematical Expressions for Symbolic Regression (a) NG-1 (b) NG-5 (c) NG-6 (d) NG-8 (e) NG-9 (f) NG-10 Fig. C2: Learning curves for HVAR, ProGED, and EDHiE on the selected equations from the Nguyen benchmark. Curves for the equations NG-2, NG- 3, NG-4, and NG-7 are omitted since they resemble the curve for the NG-1 equation. Efficient Generator of Mathematical Expressions for Symbolic Regression 33 more expressions to overfit the noisy data. In practical applications, expressions that overfit can be eliminated by assigning complexity scores to each expression and selecting less complex expressions from the Pareto front. C.4 Performance of CVAE and GVAE on symbolic regression Table C4 shows the results of the CVAE baseline. Models presented in the table use the same parameters as they do in Section 4.1.1 apart from the dimension of the latent vector space. We can see that this baseline performs very poorly, as it finds only the two simplest equations. The main reason for this is the high number of invalid expressions (more than 96.8%) the baseline produces. Table C4: Results of symbolic regression by random sampling of the CVAE latent space with varying number of dimensions on the Nguyen benchark. Name NG-1 NG-2 NG-3 NG-4 NG-5 NG-6 NG-7 NG-8 Total/Mean CVAE 32 Successful Mean R2 Invalid CVAE 64 Successful Mean R2 Invalid CVAE 128 Successful Mean R2 Invalid 4 0 0 0 0 0 0 10 14 1.00 (± 0.01) 1.00 (± 0.01) 0.99 (± 0.01) 0.99 (± 0.01) 0.00 (± 0.00) 0.49 (± 0.01) 0.71 (± 0.29) 1.00 (± 0.00) 96851 (± 57) 96816 (± 38) 96857 (± 59) 96867 (± 39) 96846 (± 46) 96843 (± 55) 96837 (± 49) 96801 (± 48) 0.77 (± 0.34) 96839 (± 20) 2 0 0 0 0 0 0 10 12 1.00 (± 0.01) 1.00 (± 0.01) 0.99 (± 0.01) 0.99 (± 0.01) 0.00 (± 0.00) 0.49 (± 0.02) 0.60 (± 0.32) 1.00 (± 0.00) 98131 (± 57) 98143 (± 38) 98131 (± 47) 98151 (± 60) 98148 (± 46) 98127 (± 43) 98108 (± 27) 98146 (± 39) 0.75 (± 0.34) 98135 (± 13) 2 0 0 0 0 0 0 3 5 1.00 (± 0.01) 1.00 (± 0.01) 0.97 (± 0.07) 0.99 (± 0.01) 0.00 (± 0.00) 0.09 (± 0.15) 0.14 (± 0.28) 0.58 (± 0.42) 99243 (± 25) 99247 (± 18) 99250 (± 22) 99238 (± 17) 99239 (± 18) 99227 (± 24) 99249 (± 31) 99229 (± 34) 0.59 (± 0.42) 99240 (± 8) Lastly, Table C5 shows the results of the GVAE baseline. We can see that GVAE performs better than CVAE but worse than HVAE. For the GVAE Evo approach we use the GVAE baseline with the latent space dimension 64 together with the evolutionary operators presented in Section 3.3.2. Here, different models find different equations: GVAE 32 finds the equation NG-6, while GVAE 64 finds NG-4, and GVAE Evo NG-3. Overall GVAE Evo performs the best as it successfully finishes 4 runs more than other models. Table C5: Results of symbolic regression by random sampling and evolutionary optimization in the GVAE latent space with varying number of dimensions on the Nguyen benchark. Name NG-1 NG-2 NG-3 NG-4 NG-5 NG-6 NG-7 NG-8 Total/Mean GVAE 32 Successful Mean R2 Invalid GVAE 64 Successful Mean R2 Evaluated GVAE 128 Successful Mean R2 Invalid GVAE Evo Successful Mean R2 Invalid 10 2 0 0 0 2 0 10 24 1.00 (± 0.00) 1.00 (± 0.01) 1.00 (± 0.01) 1.00 (± 0.01) 0.00 (± 0.01) 0.59 (± 0.20) 0.92 (± 0.02) 1.00 (± 0.00) 15972 (± 95) 15917 (± 111) 15985 (± 107) 15900 (± 115) 15896 (± 102) 15925 (± 120) 15987 (± 123) 15986 (± 132) 0.81 (± 0.33) 15946 (± 37) 9 4 0 1 0 0 0 10 24 1.00 (± 0.01) 1.00 (± 0.01) 1.00 (± 0.01) 1.00 (± 0.01) 0.00 (± 0.01) 0.49 (± 0.00) 0.92 (± 0.00) 1.00 (± 0.00) 58229 (± 149) 58295 (± 150) 58383 (± 153) 58318 (± 169) 58322 (± 137) 58327 (± 162) 58268 (± 107) 58252 (± 157) 0.81 (± 0.34) 58299 (± 45) 10 3 0 0 0 0 0 10 23 1.00 (± 0.00) 1.00 (± 0.01) 1.00 (± 0.01) 1.00 (± 0.01) 0.00 (± 0.00) 0.49 (± 0.00) 0.91 (± 0.03) 1.00 (± 0.00) 72863 (± 96) 72840 (± 110) 72802 (± 101) 72848 (± 105) 72808 (± 97) 72787 (± 183) 72865 (± 116) 72825 (± 186) 0.80 (± 0.34) 72830 (± 27) 10 7 1 0 0 0 0 10 28 1.00 (± 0.00) 1.00 (± 0.01) 1.00 (± 0.01) 1.00 (± 0.01) 0.00 (± 0.01) 0.53 (± 0.09) 0.92 (± 0.00) 1.00 (± 0.00) 0 (± 1) 0 (± 1) 1 (± 0) 0 (± 0) 0 (± 1) 1 (± 1) 0 (± 1) 0 (± 1) 0.81 (± 0.34) 0 (± 0) 34 Efficient Generator of Mathematical Expressions for Symbolic Regression Appendix D Implementation details This section provides implementation details that are not part of the methodology but are crucial for the reproducibility of our approach and its implementation. These details include batching, encoding/decoding, and training. D.1 Batching Since our approach works on expression trees with varying structures, we cannot employ standard batching methods. Instead, we represent a batch of expression trees with a Python object we refer to as a "batched node". A batched node contains a list of symbols, a left (batched) child node, and a right (batched) child node. Since an expression tree may not contain all the nodes in the batched tree, the list of symbols within a batched node might include an empty string as a placeholder for the missing symbol. During training, each batched node also contains a target matrix, a prediction matrix, and a mask vector. The target matrix comprises one-hot symbol encodings, with empty strings represented by zero values. The decoding cell generates the prediction matrix, which, in turn, predicts the target matrix. Finally, the mask vector is a binary vector where the value at index i equals one if the node appears in the expression tree i and equals zero otherwise. D.2 Encoding/Decoding The encoding process involves traversing the batched node using a post-order traversal. We first visit and encode the left (batched) child, followed by the right (batched) child. Finally, we generate the code for the batched node using codes obtained from the child nodes. Decoding is performed in reverse. We start by decoding the (batched) root code, which yields a list of symbols, the codes for the left and right (batched) child nodes, and the masks for the left and right child nodes. The masks for the left and right child nodes are calculated using symbols produced by the decoding cell and the mask of the current node. Specifically, if the value of the current mask at a given position is 0, the corresponding values in the mask for the left and right child nodes remain 0. Otherwise, the masks are assigned values appropriate to the symbol type: both 1 for an operator, 1, and right 0 for a function, and both 0 for a variable or constant. When all values in a mask become 0, the decoding process for this branch terminates. D.3 Training Expression trees have two components: the binary tree structure and the symbols within the nodes. However, the structure of the binary tree can be inferred from the symbols present in the nodes. Therefore, it is sufficient for our approach to learn to reconstruct the symbols occurring in the nodes. Efficient Generator of Mathematical Expressions for Symbolic Regression 35 When training the model, we restrict the output tree's structure to match the input structure. Specifically, we utilize the input batched node and incorporate a prediction matrix into each node. We then calculate the reconstruction error using the target and prediction sequences obtained through an in-order traversal of the batched node. While computing the cross-entropy loss, we apply a masking technique to exclude nodes that do not occur in an expression tree from the loss calculation, effectively removing them from the training process.
http://arxiv.org/abs/2302.09880v3
2023-10-30T10:14:02
2023-02-20T10:15:36
Towards Unbounded Machine Unlearning
Deep machine unlearning is the problem of `removing' from a trained neural network a subset of its training set. This problem is very timely and has many applications, including the key tasks of removing biases (RB), resolving confusion (RC) (caused by mislabelled data in trained models), as well as allowing users to exercise their `right to be forgotten' to protect User Privacy (UP). This paper is the first, to our knowledge, to study unlearning for different applications (RB, RC, UP), with the view that each has its own desiderata, definitions for `forgetting' and associated metrics for forget quality. For UP, we propose a novel adaptation of a strong Membership Inference Attack for unlearning. We also propose SCRUB, a novel unlearning algorithm, which is the only method that is consistently a top performer for forget quality across the different application-dependent metrics for RB, RC, and UP. At the same time, SCRUB is also consistently a top performer on metrics that measure model utility (i.e. accuracy on retained data and generalization), and is more efficient than previous work. The above are substantiated through a comprehensive empirical evaluation against previous state-of-the-art.
[ "Meghdad Kurmanji", "Peter Triantafillou", "Jamie Hayes", "Eleni Triantafillou" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09880v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09880v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CR" ]
3 2 0 2 t c O 0 3 ] G L . s c [ 3 v 0 8 8 9 0 . 2 0 3 2 : v i X r a Towards Unbounded Machine Unlearning Meghdad Kurmanji∗ University of Warwick Peter Triantafillou University of Warwick Jamie Hayes Google DeepMind Eleni Triantafillou Google DeepMind Abstract Deep machine unlearning is the problem of 'removing' from a trained neural network a subset of its training set. This problem is very timely and has many applications, including the key tasks of removing biases (RB), resolving confusion (RC) (caused by mislabelled data in trained models), as well as allowing users to exercise their 'right to be forgotten' to protect User Privacy (UP). This paper is the first, to our knowledge, to study unlearning for different applications (RB, RC, UP), with the view that each has its own desiderata, definitions for 'forgetting' and associated metrics for forget quality. For UP, we propose a novel adaptation of a strong Membership Inference Attack for unlearning. We also propose SCRUB, a novel unlearning algorithm, which is the only method that is consistently a top performer for forget quality across the different application-dependent metrics for RB, RC, and UP. At the same time, SCRUB is also consistently a top performer on metrics that measure model utility (i.e. accuracy on retained data and gener- alization), and is more efficient than previous work. The above are substantiated through a comprehensive empirical evaluation against previous state-of-the-art. 1 Introduction Can we make a deep learning model 'forget' a subset of its training data? Aside from being scientifically interesting, achieving this goal of deep machine unlearning is increasingly important and relevant from a practical perspective and this research direction is enjoying significant attention recently [Triantafillou et al., 2023]. Regulations such as EU's General Data Protection Regulation [Mantelero, 2013] stipulate that individuals can request to have their data 'deleted' (the 'right to be forgotten'). Nowadays, given the ubiquity of deep learning systems in a wide range of applications, including computer vision, natural language processing, speech recognition and healthcare, allowing individuals to exercise this right necessitates new technology. Unlearning aims to fill this need. However, unlearning has several additional important applications where privacy with respect to a subset of individual training examples isn't necessarily a consideration: removing out-of-date examples, outliers, poisoned samples [Jagielski et al., 2018], noisy labels [Northcutt et al., 2021], or data that may carry harmful biases [Fabbrizzi et al., 2022]. In fact, we are the first to argue that the definition of 'forgetting' is application-dependent, and unlearning comes with different desiderata and priorities in different scenarios. For instance, for a privacy application, 'forgetting' the data of users who requested deletion is the primary objective and we may be willing to sacrifice model performance to some degree, in exchange for reliably defending Membership Inference Attacks (MIAs). In other cases, for instance, when deleting outdated data to keep a model current, maintaining the model's performance throughout such 'cleanup' operations may be the primary consideration, and guaranteeing that no trace of the old data is left behind may be irrelevant. While previous work does not establish such distinctions, we study three scenarios and propose a method that is the most consistent top-performer across applications and metrics. ∗Correspondence to [email protected]. 37th Conference on Neural Information Processing Systems (NeurIPS 2023). Unfortunately, removing the influence of a subset of the training set from the weights of a trained model is hard, since deep models memorize information about specific instances [Zhang et al., 2020, 2021, Arpit et al., 2017] and their highly non-convex nature makes it difficult to trace the effect of each example on the model's weights. Of course, we can apply the naive solution of retraining the model from scratch without the cohort of data to be forgotten. This procedure indeed guarantees that the weights of the resulting model aren't influenced by the instances to forget (it performs 'exact unlearning'), but the obvious drawback is computational inefficiency: retraining a deep learning model to accommodate each new forgetting request isn't viable in practice. To mitigate that cost, recent work turned to approximate unlearning [Izzo et al., 2021, Golatkar et al., 2020a,b] where the goal is to modify the weights of the trained model to approximate those that would have been obtained by exact unlearning. That is, they strive to achieve 'indistinguishability' between the approximate and exact solutions, typically accompanied by theoretical guarantees for the quality of that approximation. This goal is also mirrored in the metrics used by these works: the model's error on the deleted data is desired to be just as high as the error of the 'exact' retrained model (which truly never saw that data). The argument is that an error higher than that reference point may cause susceptibility to membership inference attacks: a noticeably poor performance on an example can reveal that it was unlearned. In this work, we show empirically that such approximate unlearning methods often perform poorly in practice (in one or more of RB, RC and UP). We hypothesize that this is due to potential violations of assumptions made by these methods, e.g. that the 'optimal' solution of unlearning is close in weight space to the original model [Golatkar et al., 2020a,b] (due to assumptions of stability of SGD and 'small enough' forget sets). Further, we find these previous methods scale poorly to the size of the training set and the model, often making them impractical. To address these issues, we propose a new unlearning model, SCalable Remembering and Unlearning unBound (SCRUB) that departs from that methodology. SCRUB bears a novel teacher-student formulation, where the student model selectively disobeys an all-knowing teacher, to inherit from it only knowledge that does not pertain to the data to be deleted. This method is 'unbound' from limiting assumptions (e.g., to facilitate formal guarantees), poor scalability limits, and is not tailored to a single unlearning application. We find that SCRUB can yield a very high error on the deleted data, which is desired in some scenarios but may cause susceptibility to membership inference attacks. To mitigate this when relevant, we extend SCRUB with a novel 'rewinding' procedure that pinpoints the 'checkpoint' of the unlearning process to use such that the error on the deleted data approximates the reference point of being 'just high enough'. We also propose the first, to our knowledge, adaptation of the state-of-the-art LiRA MIA [Carlini et al., 2022] to the framework of unlearning, as a metric for UP. Overall, we perform a comprehensive evaluation using different baselines, datasets, architectures and three application scenarios. We find that SCRUB is by far the most consistent top performer out of all state-of-the-art methods considered. SCRUB is able to ensure high forget quality, satisfying different forget-quality metrics for different applications while also being a top performer with respect to model utility (accuracy on retained data, and generalization). Our findings highlight the need to consider a broad spectrum of applications when evaluating unlearning algorithms, to better understand their properties and trade-offs. 2 Problem Definition for Unlearning Unbound Notation and preliminaries Let D = {xi, yi}N i=1 denote a training dataset containing N examples, where the i'th example is represented by a vector of input features xi and a corresponding class label yi. Let f (*; w) denote a function parameterized by trainable weights w. In this work, we study the case where f is represented by a deep neural network, trained in a supervised manner via empirical risk minimization. Specifically, we define the loss function as L(w) = 1 i=1 l(f (xi; w), yi) where N l denotes the cross entropy loss. (cid:80)N Deep Machine Unlearning We now formalize the problem of deep machine unlearning. We assume that we are given a model f (*; wo) that has been trained on D, where f denotes a neural network and wo its trained parameters, obtained by minimizing the above loss function. We will refer to this as the 'original model' (i.e. before any unlearning intervention is performed). We are also given a 'forget set' Df = {xi, yi}Nf i=1 ⊂ D, comprised of Nf examples from D and a 'retain set' Dr of Nr training examples that the model is still allowed to retain information for. For simplicity, we consider the standard scenario where Dr is the complement of Df or, in other words, Df ∪ Dr = D. 2 Given f (*; wo), Df and Dr, the goal of deep machine unlearning is to produce a new set of weights wu such that the 'unlearned model' f (*; wu) has 'forgotten' Df without hurting the 'utility' of the original model (its performance on the retained data Dr and generalization to data outside of D). We argue that defining (and measuring) 'forgetting' is application-dependent. Our work is the first, to the best of our knowledge, to perform a thorough empirical evaluation of unlearning algorithms on three different application scenarios, each with its own definition of forgetting and associated metrics. Defining and measuring 'forgetting' We consider three different application scenarios in this work, each with their own definition of forgetting and associated metrics. 1) Removing biases. We want maximal error on Df : the model should never predict the assigned labels of forget examples, since they reflect unintended behaviour. 2) Resolving confusion. A model may be 'confused' due to incorrect labels in its dataset. A successful unlearning algorithm resolves this if mislabeled examples are placed in the forget set (see metrics in Section 5). 3) User privacy. Success from a privacy perspective is associated with a forget error only as high as that of retraining-from-scratch; a higher forget error could lead to vulnerability to Membership Inference Attacks (MIAs). In all of the above cases, in addition to achieving forgetting, we seek unlearning algorithms that don't damage model utility, i.e. accuracy on retained data and generalization ability, and that unlearning is efficient enough to be preferable over the simple and expensive solution of retraining the model. Fundamental trade-offs A top-performing unlearning algorithm must simultaneously achieve three feats: (i) obtain high 'forget quality', (ii) ensure continued high accuracy on retained and unseen data, and (iii) efficiency / scalability. In practice, there are fundamental trade-offs in two different dimensions. The first dimension involves trade-offs between (i), (ii) and (iii), for example achieving good 'forget quality' at the expense of efficiency. Retraining from scratch is such an example, but, as we will show later, some methods suffer from inefficiencies even worse than retraining. Another common issue we will observe is achieving good 'forget quality' at the expense of utility. The second dimension involves trade-offs within the context of achieving good 'forget quality' across applications, since the metric for this quality is application-specific, and an algorithm may perform strongly on one such metric but poorly on others. SCRUB is designed to handle these trade-offs and is shown empirically to consistently outperform previous methods across the board. 3 SCalable Remembering and Unlearning unBound (SCRUB) We present SCRUB, a new unlearning algorithm based on a novel casting of the unlearning problem into a teacher-student framework. We design SCRUB to meet the desiderata of unlearning: efficiently 'forgetting' without hurting model utility. Because we argue that the definition of forgetting is application-dependent, we propose a recipe that works across applications: We first design SCRUB to strive for maximal forget error, which is desirable in some scenarios (e.g. RB and RC) but not in others (e.g. UP). To address the latter case, we complement SCRUB with a novel 'rewinding' procedure that can reduce the forget set error appropriately when required. SCRUB is 'unbound' from limiting assumptions (e.g., to facilitate formal guarantees), poor scalability limits and is by far the most consistent method in forgetting across applications while preserving model utility. 3.1 The SCRUB We consider the original model wo as the 'teacher' and we formulate our goal as training a 'student' wu that selectively obeys that teacher. Intuitively, our goal for wu is twofold: forget Df while still remembering Dr. To that effect, wo should be obeyed when teaching about Dr, but disobeyed when teaching about Df . Our code is available for reproducibility 2. En route to deriving our training objective, let us first define: d(x; wu) = DKL(p(f (x; wo))∥p(f (x; wu))) In words, d(x; wu) is the KL-divergence between the student and teacher output distributions (softmax probabilities) for the example x. We make the dependence of d on wu explicit, since we will optimize the student weights wu while keeping the teacher weights frozen wo, treating them as a constant. 2https://github.com/Meghdad92/SCRUB 3 Concretely, we begin by initializing the student wu to the weights of the teacher wo. Since the teacher weights wo were trained on all of D, the teacher performs well on both constituents of D, namely both of Dr and Df . Therefore, the student has good performance on Dr at initialization, already fulfilling one of our desiderata. Can we then start from this solution and modify it to unlearn Df ? In principle, one could do this by optimizing: min wu − 1 Nf (cid:88) xf ∈Df d(xf ; wu) (1) However, in practice, when performing this maximization of the distance between the student and teacher on the forget set, we noticed that, while indeed the performance on Df degrades, as desired, it unfortunately also results in degrading performance on Dr. To amend that, we propose to simultaneously encourage the student to 'stay close' to the teacher on retain examples, while encouraging it to 'move away' from the teacher on forget examples, adding a contrastive flavour. Formally, the optimization objective becomes: min wu 1 Nr (cid:88) xr∈Dr d(xr; wu) − 1 Nf (cid:88) xf ∈Df d(xf ; wu) (2) Furthermore, SCRUB also simultaneously optimizes for the task loss on the retain set, to further strengthen the incentive to perform well there. Our final training objective is then the following: min wu α Nr (cid:88) xr∈Dr d(xr; wu) + γ Nr (cid:88) l(f (xr; wu), yr) − (xr,yr)∈Dr 1 Nf (cid:88) xf ∈Df d(xf ; wu) (3) where l stands for the cross-entropy loss and the α and γ are scalars that we treat as hyperparameters. In practice, we found that optimizing the objective in Equation 3 is challenging, due to oscillations in the loss. Intuitively, this is due to trying to simultaneously satisfy two objectives, which may interfere with each other, namely moving close to the teacher on some data points while moving away from it on others. To address this, SCRUB provides a practical recipe for optimization, reminiscent of 'tricks' used in other min-max-like problems like Generative Adversarial Networks [Goodfellow et al., 2014] where the discriminator is trained for several steps before each update to the generator. Specifically, SCRUB iterates between performing an epoch of updates on the forget set (the max- step) followed by an epoch of updates on the retain set (the min-step), in an alternating fashion. Guarding against hurting retain performance due to this alteration of min-steps and max-steps, SCRUB also performs a sequence of additional min-steps at the end of the sequence to restore the retain performance in the event that it was harmed. SCRUB training stops when the forget error has increased without harming the retain set error. We find in practice this point can be reached with a small number of epochs. We provide pseudocode, training plots and ablations in the Appendix. 3.2 SCRUB and Rewind (SCRUB+R) By construction, SCRUB encourages obtaining a high error on the forget set. This is desired for some application scenarios. However, an uncharacteristially high error on deleted examples can make them identifiable, causing vulnerability to membership inference attacks. SCRUB+R addresses this. To this end, we are after a procedure for selecting the checkpoint of SCRUB where the forget set error is 'just high enough'. One could obtain a reference point for that by retraining from scratch without the forget set and recording the error of that model on the forget set. However, that would defeat the purpose of unlearning, as we want to avoid that computation. Therefore, we propose a different way of establishing a reference point. First, we create a validation set of the same distribution as the forget set. For instance, if the forget set has only examples of class 0, we keep only examples of class 0 in the validation set too. Next, we train SCRUB as usual, storing a model checkpoint every epoch. At the end of its training, where the forget error is typically the highest, we measure the error on the constructed validation set. This will serve as the reference point for the desired forget set error. Finally, we 'rewind' to the checkpoint where the forget error is closest to that reference point. 4 (a) CIFAR-10 class unlearning. (b) CIFAR-10 selective. (c) CIFAR-5 selective. Figure 1: RB results: SCRUB is the only consistent top-performer in terms of forgetting and preserving utility. It is also highly efficient: second only to Bad-T which, however, fails at forgetting and damages utility. In all subfigures, each point represents the average across ResNet and All-CNN variants. For large-scale results, we also compute the scale-up factor: the fraction of the runtime of retraining from scratch over the runtime of the given unlearning algorithm (multiplied by 5 here, for visualization purposes). We find that selective unlearning is harder for all methods, especially for EU-k and Fisher (see Figure 1a vs 1b). CF-k and Finetuning perform similarly (they perform poorly) in all cases, so their lines occlude one another. Complete tables are in the Appendix. The intuition is that the last step of unlearning approximates 'maximally forgetting'. Consequently, the error on the identically-distributed validation set approximates the error of a model that never learned about that distribution from the forget set: any correct predictions on the held-out examples are due only to the generalization power of the model that was trained only on the retain set. Therefore, we choose that validation set error to serve as the reference point for how high we would like the forget set error to be for UP applications. We show empirically that this rewinding procedure greatly increases the defense against membership inference attacks, making SCRUB a strong performer for applications where privacy is a consideration. 4 Related Work Unlearning definitions Despite prior work on unlearning, this research problem is still in its infancy and we lack a well-established formal definition. The term 'unlearning' was coined in Cao and Yang [2015], where, in the context of certain structured problems, unlearning is defined to be successful if deleting an example yields the same outputs on a dataset as if that example had never been inserted. Ginart et al. [2019] introduce a more relaxed probabilistic definition for machine unlearning inspired by Differential Privacy [Dwork et al., 2014] that requires the unlearned model to yield outputs that are similar to those that would have been produced by a model retrained from scratch without the forget set. This led to the development of 'approximate learning' methods that aren't identical to retrain-from-scratch ('exact unlearning') but 'similar' [Guo et al., 2019, Golatkar et al., 2020a]. Sekhari et al. [2021] and Neel et al. [2021] adopt similar DP-inspired definitions of (approximate) unlearning based on the goal of indistinguishability from retrain-from-scratch. However, there is a recent line of criticism against the idea of defining or measuring unlearning success based on indistinguishability from retrain-from-scratch. Thudi et al. [2022b] theoretically show that we can obtain arbitrarily similar model weights from training on two non-overlapping datasets. This implies that reaching a particular point in parameters space isn't a sufficient condition for having unlearned. Furthermore, Goel et al. [2022] argue that it's not a necessary condition either: retraining from scratch may arrive at different model distributions due to changes in e.g. hyperparameters [Yang and Shami, 2020]. Therefore, a unlearning method may be unnecessarily penalized for not matching a particular retrained-from-scratch model. In our work, we take a practical viewpoint and define unlearning as 'forgetting' in an efficient manner and without hurting model utility, for three different application-specific metrics for forgetting that we discuss in the next section. Unlearning methods Cao and Yang [2015] introduce unlearning and provide an exact forgetting algorithm for statistical query learning. [Bourtoule et al., 2021] proposed a training framework by sharding data and creating multiple models, enabling exact unlearning of certain data partitions. Ginart et al. [2019] introduce a probabilistic definition for machine unlearning inspired by Differential 5 Privacy [Dwork et al., 2014], and formed the origin of the idea of the model indistinguishability goal. More recently, Guo et al. [2019], Izzo et al. [2021], Sekhari et al. [2021] built upon this framework and introduced unlearning methods that can provide theoretical guarantees under certain assumptions. Further, Huang and Canonne [2023] provide bounds for 'deletion capacity' in the DP-based unlearning methods using the group property of DP. [Graves et al., 2021] proposed two methods applicable to deep networks. The first randomly re-labels the forget set and retrains for a small number of updates, while the second stores the index of examples that participated in each batch and the per-batch parameter updates, and unlearns by 'undoing' the affected updates. This requires a lot of storage and can also lead to a poor proxy of the model that would have been obtained had those parameter updates not happened in the first place, especially for larger sequences. [Golatkar et al., 2020a] proposed an information-theoretic procedure for removing information about Df from the weights of a neural network and [Golatkar et al., 2020b, 2021] propose methods to approximate the weights that would have been obtained by unlearning via a linearization inspired by NTK theory [Jacot et al., 2018] in the first case, and based on Taylor expansions in the latter. However, [Golatkar et al., 2020a,b] scale poorly with the size of the training dataset, as computing the forgetting step scales quadratically with the number of training samples. [Golatkar et al., 2021] addresses this issue, albeit under a different restrictive assumption: that a large dataset is available for pre-training that will remain 'static', in that no forgetting operations will be applied on it; an assumption that is not met in many important applications (e.g. healthcare, medical images). Some more recent works propose modifications to the original model training, to make the resulting model more amenable to unlearning. Thudi et al. [2022a] propose a regularizer to reduce the 'verification error', which is an approximation to the distance between the unlearned model and a retrained-from-scratch model. The goal is to make unlearning easier in the future. Additionally, they propose a single gradient update that reverses the effect of Df . This regularizer, however, may have a negative effect on the model's performance, and the single gradient unlearning step only removes the effect that Df has had in the first iteration of training. [Zhang et al., 2022] present a training process that quantizes gradients and applies randomized smoothing. This process is designed to make unlearning unnecessary in the future and comes with certifications under some conditions. However, a deletion request that causes too large a change to the data distribution (e.g. if doing class unlearning), may exceed the 'deletion budget' and invalidate their assumptions. Related research areas Differential Privacy (DP) [Dwork et al., 2014] and Life-Long Learning (LLL) [Parisi et al., 2019] have shared goals with unlearning. DP seeks to ensure that the trained model doesn't store information about any training instance; a strong goal that is difficult to achieve for deep neural networks [Abadi et al., 2016]. In contrast, in unlearning we only desire to remove the influence of the training instances in the forget set, which can be seen as a relaxation of the same problem. LLL seeks to continuously update a model to solve new sets of tasks, without 'catastrophically forgetting' previously-learned tasks. The notion of forgetting a task, though, is distinct from that of forgetting a training example: the performance on a task can degrade, without having removed the influence of particular examples from the model weights. Teacher-student and contrastive methods The teacher-student methodology has been used in a different contexts, e.g. self-supervised [Grill et al., 2020, Chen and He, 2021] and semi-supervised learning [Xie et al., 2020]. Knowledge Distillation [Hinton et al., 2015] can also be thought of as a teacher-student approach with the additional desire for compression, where the student is chosen to have a smaller architecture than the teacher. In addition, our training objective has a contrastive flavour [Chen et al., 2020, He et al., 2020], due to both pulling the student close to the teacher, and pushing it away from it, for different parts of the training set. For unlearning, [Kim and Woo, 2022, Wu et al., 2022] propose methods with a two-stage pipeline: 'neutralization' / forgetting followed by a 'retraining' / restoring, that restores performance that may be lost in the first phase. Both use distillation only in the second phase on only the retain set. In contrast, SCRUB employs a single phase where we carefully design a teacher-student formulation to both encourage forgetting the requested data and retaining the other knowledge, simultaneously. Most similar to our work in that regard is the method of [Chundawat et al., 2022] that employs a related but different teacher-student objective that encourages moving close to a 'Bad Teacher' for the forget set (we thus refer to this as 'Bad-T'). Moving close to a different, 'bad', teacher for forget examples is fundamentally different from our goal of moving away from the (single) teacher as in SCRUB. We find that Bad-T forgets poorly compared to SCRUB in all applications, and degrades model quality. 6 ResNet All-CNN Model Retrain Original Finetune NegGrad+ CF-k EU-k Fisher NTK Bad-T SCRUB IC test error (↓) mean std IC retain error (↓) mean std Fgt test error (↓) mean std Fgt retain error (↓) mean std IC test error (↓) mean std IC retain error (↓) mean std Fgt test error (↓) mean std Fgt retain error (↓) mean std 24.0 56.0 52.0 47.5 54.8 47.0 51.5 37.5 47.3 19.0 1.8 3.0 3.1 5.3 2.0 4.8 7.5 4.0 9.7 3.9 0.0 0.0 0.0 0.0 0.0 8.3 26.3 0.0 6.0 0.0 0.0 0.0 0.0 0.0 0.0 4.7 9.5 0.0 6.2 0.0 18.3 92.0 79.3 69.0 85.3 63.3 79.0 52.0 27.0 19.7 4.2 7.9 10.1 13.5 7.0 9.7 3.6 10.6 8.7 7.5 0.0 0.0 0.0 0.0 0.0 3.7 20.0 0.0 0.3 0.0 0.0 0.0 0.0 0.0 0.0 2.5 7.9 0.0 0.6 0.0 19.0 49.0 43.7 42.3 47.8 59.5 56.8 36.7 39.3 26.0 1.3 4.8 7.3 11.3 5.8 5.2 8.7 4.1 8.2 4.4 0.0 6.0 0.0 0.0 0.0 38.3 31.7 3.0 3.0 0.0 0.0 10.39 0.0 0.0 0.0 6.7 14.0 5.2 1.0 0.0 11.3 80.7 67.3 62.0 76.3 68.7 78.3 54.3 25.7 18.0 4.6 12.6 16.0 22.6 14.4 15.6 15.5 9.0 5.0 11.1 0.0 6.0 0.0 0.0 0.0 19.7 17.7 3.0 1.0 0.0 0.0 10.4 0.0 0.0 0.0 10.4 11.5 5.2 1.0 0.0 Table 1: RC-application results: SCRUB is the strongest performer in terms of resolving class confusion. These results are on CIFAR-5 with ResNet and All-CNN, where we confused 50 samples of class 0 by mislabeling them as class 1, and 50 of class 1 by mislabeling them as class 0. 5 Experiments 5.1 Experimental setup Overview of applications and metrics We consider three sets of forget-quality metrics, for different applications. First, we consider the scenario of Removing Biases (RB) where we desire the highest possible forget set error (reflecting that we want the model to never predict the associated labels of the forget set, since those capture an unintended behaviour / bias). Next, inspired by Goel et al. [2022], we consider unlearning for Resolving Confusion (RC) between classes, caused by a portion of the model's original training set being mislabelled. Finally, we consider a scenario of data deletion for User Privacy (UP). In this case, we use Membership Inference Attacks (MIAs) to measure success (including the first, to our knowledge, adaptation of the state-of-the-art LiRA MIA [Carlini et al., 2022] to unlearning), where unlearning succeeds if the attacker is unable to tell apart forgotten examples from truly unseen ones. In all cases, aside from achieving the application-specific forgetting goal, we also measure utility (performance on Dr and a test set Dt) as an additional metric. Experimental details We utilize the same two datasets from previous work: CIFAR-10 [Krizhevsky et al., 2009] and Lacuna-10 [Golatkar et al., 2020a], which is derived from VGG-Faces [Cao and Yang, 2015], and the same two architectures: All-CNN [Springenberg et al., 2014] and ResNet-18 [He et al., 2016]. For consis- tency with previous work, we pre-train the original model on CIFAR-100 / Lacuna- 100 for the CIFAR-10 / Lacuna-10 ex- periments, respectively [Golatkar et al., 2020a,b]. We run each experiment with 3 random seeds and report the mean and standard deviation. (a) Small-scale. (b) Large-scale. Figure 2: The number of times each method was a top performer in forgetting in RB-application. A model is a top-performer if its 95% confidence interval overlaps with that of the best mean. Small-scale counts are over {ResNet, All-CNN} x {CIFAR, Lacuna} (4 total), large- scale additionally x {class, selective} (8 total). SCRUB is the most consistent top-performer. We consider two settings throughout the pa- per: small-scale and large-scale. The for- mer allows comparisons with NTK, which doesn't scale beyond it. For the small-scale, we exactly follow the setup in [Golatkar et al., 2020b] that uses only 5 classes from each of CIFAR and Lacuna ('CIFAR-5' / 'Lacuna-5'), with 100 train, 25 validation and 100 test examples per class. The forget set contains 25 examples from class 0 (5%). For the large-scale, we exactly follow the setup in [Golatkar et al., 2020a] that uses all 10 classes of each of CIFAR and Lacuna, and considers both a class unlearning scenario where the forget set is the entire training set for class 5 (10%), as well as a selective unlearning one where 100 examples of class 5 are forgotten (0.25% in CIFAR and 2% in Lacuna). We note that the Appendix contains complete results for all scenarios (several are ommitted from the main paper due to space constraints) and also contains the complete experimental details and hyperparameters. 7 Unlearning algorithms We compare against state-of-the-art approaches as well as various baselines: Retrain: Retraining from scratch without the forget set. This is assumed to not be viable in practice, but we include it as a reference. Original: The 'original' model trained on all of D without any unlearning. Finetuning: Finetunes the original model on data from the retain set Dr. NegGrad+: Similar to Finetuning, starts from the original model and finetunes it both on data from the retain and forget sets, negating the gradient for the latter. Previous work considered a weaker baseline that only trains on the forget set, with a negative gradient (NegGrad). We tune the stronger NegGrad+ to achieve a good balance between the two objectives in the same way as SCRUB. Fisher Forgetting [Golatkar et al., 2020a]. NTK Forgetting [Golatkar et al., 2020b]. Catastrophic Forgetting-k (CF-k) and Exact Unlearning-k (EU-k) [Goel et al., 2022]: they freeze the first k layers of the original model and either finetune the remaining layers on Dr (CF-k) or train them from scratch on Dr (EU-k). Bad-T: the concurrent teacher-student method of [Chundawat et al., 2022]. We utilize the public code for the NTK and Fisher for correctness. We implement Bad-T ourselves (no code was available). 5.2 Unlearning for Removing Biases (RB) In RB, we desire to achieve the highest possible error on Df , without hurting the error of Dr and Dt. Some example scenarios are removing biases from trained models, outdated or incorrect information. A maximal forget error on Df in this case is desirable as it reflects that we want the model to never make the predictions that were deemed harmful or no longer valid or accurate. We report the results for this scenario in Figures 1 and 2. We also report complete results in the Appendix for all architectures, datasets and baselines. As shown in Figure 2, SCRUB is by far the most consistent method in terms of achieving high forget quality (highest forget error), while it doesn't hurt retain and test errors. 5.3 Unlearning for Resolving Confusion (RC) In this section, following Goel et al. [2022], we study unlearning for resolving confusion between two classes that the original model suffers from due to a part of its training set being mislabelled. Specifically, we place all and only the mislabeled training examples in the forget set. A successful unlearning algorithm would thus entirely resolve the model's confusion. In more detail, the setup is: 1) Mislabel some portion of the training dataset (we mislabeled examples between classes 0 and 1 of each of CIFAR-5 and Lacuna-5), 2) Train the 'original model' on the (partly mislabeled) training dataset, and 3) Unlearn with the confused examples as the forget set. We consider the following metrics inspired from Goel et al. [2022] that are variants of the model's error on examples from the confused classes (lower is better for both). We outline them below and define them formally in the Appendix. • Interclass Confusion IC-ERR (e.g. IC test error, IC retain error). This counts mistakes where an example from either of the two confused classes was incorrectly predicted to belong to any other class. • FGT-ERR (e.g. Fgt test error, Fgt retain error). This metric counts only misclassification between the confused classes, i.e. an example of class 0 being predicted as belonging to class 1, or vice versa. We observe from Table 1 that, across the board, SCRUB is by far the most consistent method in terms of eliminating class confusion without damaging the quality of the model (on retain and test sets). 5.4 Unlearning for User Privacy (UP) Next, we consider a privacy-critical application: the deletion of the data of a user exercising their right-to-be-forgotten. We use Membership Inference Attacks (MIAs) as the metric where the goal is that, after applying unlearning, an attacker can't tell apart examples that were unlearned from those that were truly never seen, thus protecting the privacy of the user requesting deletion. While previous unlearning papers have reported MIA results [Golatkar et al., 2020a], those MIAs are simple and far from state-of-the-art MIAs used in privacy and security papers. Indeed, it's not trivial to adapt such MIAs to the unlearning protocol. To initiate bridging this gap, we report results on two MIAs: 1) a simple one that is closer to the typical MIAs used in the unlearning literature, and 8 (a) Forget 100 examples. (b) Forget 150 examples. (c) Forget 175 examples. (d) Forget 200 examples. Figure 3: MIA results for different sizes of forget set on CIFAR-10 with ResNet. Error bars show 95% confidence intervals. Rewinding is most useful for smaller forget sizes (see the discussion in Section 5.4). SCRUB+R successfully defends MIAs, comparably to the Retrain oracle. 2) the first, to our knowledge, adaptation of the state-of-the-art LiRA attack [Carlini et al., 2022] to the unlearning protocol. We describe both at a high-level here and in detail in the Appendix. Basic attack We train a binary classifier (the 'attacker') on the unlearned model's losses on forget and test examples for the objective of classifying 'in' (forget) versus 'out' (test). The attacker then makes predictions for held-out losses (losses the attacker wasn't trained on) that are balanced between forget and test losses. For a perfect defense, the attacker's accuracy is 50%, indicating that it is unable to separate the two sets, marking a success for the unlearning method. mean Class Class Model ResNet Selective All-CNN std mean std mean std mean Selective std 1.67 0.67 0.69 1.19 0.34 2.27 1.10 1.71 1.71 54.00 65.33 64.00 66.67 65.00 53.00 59.67 78.00 58.67 Retrain Original Finetune NegGrad+ CF-k EU-k Bad-T SCRUB 49.33 71.10 75.57 69.57 75.73 54.20 54.00 52.20 SCRUB+R 52.20 We present Basic MIA results in Table 2 for CIFAR-10. We observe that SCRUB+R is a strong performer. EU-k can also perform strongly in this metric, though not as consis- tently. We also observe that rewinding was only triggered once, for selective unlearning. Recall that, in both selective and class unlearning, the forget set contains examples coming from a sin- gle class, but in the former, it doesn't contain all examples of that class; the rest are in the re- tain set. Thus, we indeed expect that rewinding would be more useful for selective unlearning: the smaller the portion of a class in the forget set, the larger the remainder of that class in the retain set and consequently, the better we expect the model to generalize on held-out examples of that class (lower error), making it in turn more likely to need to rewind, in order to also lower the forget set error commensurately. In Figure 3 we plot results for different variants of selective unlearning, with different number of examples in the forget set (from the same class) and indeed find that for smaller numbers, rewinding is triggered. Our take-away is that, when needed, rewinding can substantially improve SCRUB's MIA results. Table 2: Basic MIA results (for UP): SCRUB successfully defends MIA. Note the rewinding procedure of SCRUB+R was triggered only once; see discussion in Section 5.4 and Figure 3. In the Appendix, we also show that the forget error of SCRUB(+R) is close to that of Retrain, as desired. 48.73 71.40 74.97 70.03 72.93 51.60 77.67 54.30 54.30 55.00 66.50 68.00 72.00 69.00 66.50 63.4 52.00 52.00 4.00 0.50 1.00 0.00 2.00 3.50 1.2 0.00 0.00 0.24 0.70 1.27 1.92 1.06 1.22 4.11 2.24 2.24 1.63 0.47 0.82 1.70 0.00 3.27 4.19 2.45 1.89 LiRA-for-unlearning attack In the standard privacy setting, the LiRA attacker trains a large number of 'shadow models' [Carlini et al., 2022], for which it controls which examples are in the training set each time (by construction). To then predict the membership status of a 'target example', it estimates two Gaussian distributions: the distribution of confidences of that example under shadow models that trained on it, and the distribution of its confidences under shadow models that didn't. It predicts that the target example is 'in' if the likelihood of the former is larger than that of the latter. We propose the first, to our knowledge, adaptation of LiRA for unlearning. This is a strong attack where we allow the attacker knowledge of the unlearning algorithm. Concretely, for each shadow model, the attacker also produces a 'shadow unlearned' model by applying the given unlearning algorithm several times, using a large number of forget sets (similar to Chen et al. [2021]). Now, for each 'target example', this setup allows the attacker to estimate a different pair of Gaussians: the distribution of (confidences of) that target example under models where it was forgotten, and as before, under models where it was not seen. The attacker predicts the example was forgotten if its likelihood under the former is larger than under the latter. We present all details and findings in the Appendix and observe that SCRUB+R outperforms the other methods in defending this attack. 9 5.5 Overview of results and take-aways Finetuning is a poor method: it may retain model utility but fails to forget. The previous state-the- art NTK and Fisher models aren't among the top-performers either. The former performs poorly across the board in terms of forgetting and doesn't scale beyond small datasets. The latter sometimes performs well in RB in terms of forgetting, though not always and it is very slow (Figure 1), exceeding the runtime of Retrain; as also observed in [Goel et al., 2022]. NegGrad+, our proposed enhancement over the NegGrad baseline, is a strong baseline in terms of achieving a balance between forgetting and utility (it performs well in several settings in terms of RB, albeit not as consistently as SCRUB) and we encourage future work to report this baseline, though SCRUB outperforms it, especially for RC. CF-k inherits the performance profile of Finetune: it maintains utility but forgets poorly. On the other hand, EU-k more reliably forgets (performs strongly in UP, and often in RB), which is expected relative to CF-k due to retraining part of the network, but SCRUB outperforms it significantly in terms of RC and is more consistently a top performer in RB. A notable failure case that we discovered for EU-k in RB is selective unlearning (notice the contrast between EU-k's forget error between e.g. Figures 1a and 1b). This finding may speak to where class vs instance information is stored in neural networks and warrants further investigation. Bad-T is very efficient, but performs poorly in terms of forgetting, across all applications and also damages model utility. Overall, SCRUB is by far the most consistent in successfully forgetting under different metrics without hurting utility and being efficient. In the Appendix, we discuss limitations of our work, broader impact, future work and present full experimental results and all details including hyperparameters and pseudocode. 6 Discussion and Conclusion Despite substantial recent attention [Triantafillou et al., 2023], unlearning is a young area of research. In this work, we propose SCRUB, an unlearning method that is unbound from limiting assumptions and poor scalability limits. SCRUB(+R) is found empirically to perform very strongly: it is by far the most consistent method in achieving good forgetting quality with respect to different application- dependent metrics, while incurring only minimal utility degradation. As such, we believe that SCRUB fills the important need for scalable unlearning methods that perform well in practice on several metrics of interest. However, important questions remain open for future work. Crucially, despite progress in this direction, a well-established formal definition of the problem of unlearning remains elusive, and consequently we also lack well-established metrics for measuring (theoretically or empirically) the quality of unlearning algorithms. In this work, we focus on empirical evaluation with respect to different application-dependent metrics for forgetting quality that we believe are relevant in real-world applications. However, as the unlearning community matures, we hope that success criteria for (different applications of) unlearning will be formalized and standardized. Further, an important limitation of SCRUB is the absence of theoretical guarantees, making it perhaps ill-suited for certain application scenarios. While methods that come with guarantees exist, they either aren't applicable to deep neural networks, or we find through our empirical analysis that they perform poorly and don't scale beyond small datasets. Therefore, future work that theoretically studies scalable methods like SCRUB would be very valuable. In absence of that, continuing to study and better understand the trade-offs offered by different methods is an important direction. On the practical side, we hope that future work continues to push the limits of scalability and studies unlearning in larger models, different architectures, different training objectives like self-supervised learning and different domains and modalities, including foundation language models. Broader Impact While recent advances in deep learning represent exciting opportunities for our community, they also come with great responsibility. As researchers, we are responsible for under- standing and mitigating the issues associated with the widespread use of deep learning technology. Machine learning models may carry harmful biases, unintended behaviours, or compromise user privacy. Our work is intended to take a step in addressing these issues via a post-processing 'unlearn- ing' phase that makes progress over previous solutions in practice, as we show through an extensive empirical investigation. However, SCRUB does not come with theoretical guarantees and we can not prove that applying SCRUB perfectly mitigates those issues, so caution must be taken in practice and proper auditing of machine learning models is critical. 10 Acknowledgments and Disclosure of Funding We would like to thank Fabian Pedregosa for countless insightful discussions, especially on the topic of membership inference attacks. References Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC conference on computer and communications security, pages 308–318, 2016. Devansh Arpit, Stanisław Jastrz ̨ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. In International conference on machine learning, pages 233–242. PMLR, 2017. Lucas Bourtoule, Varun Chandrasekaran, Christopher A Choquette-Choo, Hengrui Jia, Adelin Travers, Baiwu Zhang, David Lie, and Nicolas Papernot. Machine unlearning. In 2021 IEEE Symposium on Security and Privacy (SP), pages 141–159. IEEE, 2021. Yinzhi Cao and Junfeng Yang. Towards making systems forget with machine unlearning. In 2015 IEEE Symposium on Security and Privacy, pages 463–480. IEEE, 2015. Nicholas Carlini, Steve Chien, Milad Nasr, Shuang Song, Andreas Terzis, and Florian Tramer. Membership inference attacks from first principles. In 2022 IEEE Symposium on Security and Privacy (SP), pages 1897–1914. IEEE, 2022. Min Chen, Zhikun Zhang, Tianhao Wang, Michael Backes, Mathias Humbert, and Yang Zhang. When machine unlearning jeopardizes privacy. In Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security, pages 896–911, 2021. Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning. PMLR, 2020. Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021. Vikram S Chundawat, Ayush K Tarun, Murari Mandal, and Mohan Kankanhalli. Can bad teaching induce forgetting? unlearning in deep networks using an incompetent teacher. arXiv preprint arXiv:2205.08096, 2022. Cynthia Dwork, Aaron Roth, et al. The algorithmic foundations of differential privacy. Foundations and Trends® in Theoretical Computer Science, 9(3–4):211–407, 2014. Simone Fabbrizzi, Symeon Papadopoulos, Eirini Ntoutsi, and Ioannis Kompatsiaris. A survey on bias in visual datasets. Computer Vision and Image Understanding, page 103552, 2022. Antonio Ginart, Melody Guan, Gregory Valiant, and James Y Zou. Making ai forget you: Data deletion in machine learning. Advances in neural information processing systems, 32, 2019. Shashwat Goel, Ameya Prabhu, and Ponnurangam Kumaraguru. Evaluating inexact unlearning requires revisiting forgetting. arXiv preprint arXiv:2201.06640, 2022. Aditya Golatkar, Alessandro Achille, and Stefano Soatto. Eternal sunshine of the spotless net: Selective forgetting in deep networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9304–9312, 2020a. Aditya Golatkar, Alessandro Achille, and Stefano Soatto. Forgetting outside the box: Scrubbing deep networks of information accessible from input-output observations. In European Conference on Computer Vision, pages 383–398. Springer, 2020b. 11 Aditya Golatkar, Alessandro Achille, Avinash Ravichandran, Marzia Polito, and Stefano Soatto. Mixed-privacy forgetting in deep networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 792–801, 2021. Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Advances in neural information processing systems, 27, 2014. Laura Graves, Vineel Nagisetty, and Vijay Ganesh. Amnesiac machine learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 11516–11524, 2021. Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent-a new approach to self-supervised learning. Advances in neural information processing systems, 33:21271–21284, 2020. Chuan Guo, Tom Goldstein, Awni Hannun, and Laurens Van Der Maaten. Certified data removal from machine learning models. arXiv preprint arXiv:1911.03030, 2019. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9729–9738, 2020. Geoffrey Hinton, Oriol Vinyals, Jeff Dean, et al. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2(7), 2015. Yiyang Huang and Clément L Canonne. Tight bounds for machine unlearning via differential privacy. arXiv preprint arXiv:2309.00886, 2023. Zachary Izzo, Mary Anne Smart, Kamalika Chaudhuri, and James Zou. Approximate data deletion from machine learning models. In International Conference on Artificial Intelligence and Statistics, pages 2008–2016. PMLR, 2021. Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. Advances in neural information processing systems, 31, 2018. Matthew Jagielski, Alina Oprea, Battista Biggio, Chang Liu, Cristina Nita-Rotaru, and Bo Li. Manipulating machine learning: Poisoning attacks and countermeasures for regression learning. In 2018 IEEE Symposium on Security and Privacy (SP), pages 19–35. IEEE, 2018. Junyaup Kim and Simon S Woo. Efficient two-stage model retraining for machine unlearning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4361–4369, 2022. Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. Alessandro Mantelero. The eu proposal for a general data protection regulation and the roots of the 'right to be forgotten'. Computer Law & Security Review, 29(3):229–235, 2013. Seth Neel, Aaron Roth, and Saeed Sharifi-Malvajerdi. Descent-to-delete: Gradient-based methods for machine unlearning. In Algorithmic Learning Theory, pages 931–962. PMLR, 2021. Curtis G Northcutt, Anish Athalye, and Jonas Mueller. Pervasive label errors in test sets destabilize machine learning benchmarks. arXiv preprint arXiv:2103.14749, 2021. German I Parisi, Ronald Kemker, Jose L Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 113:54–71, 2019. Ayush Sekhari, Jayadev Acharya, Gautam Kamath, and Ananda Theertha Suresh. Remember what you want to forget: Algorithms for machine unlearning. Advances in Neural Information Processing Systems, 34:18075–18086, 2021. 12 Reza Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov. Membership inference attacks against machine learning models. In 2017 IEEE symposium on security and privacy (SP), pages 3–18. IEEE, 2017. Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014. Anvith Thudi, Gabriel Deza, Varun Chandrasekaran, and Nicolas Papernot. Unrolling sgd: Under- standing factors influencing machine unlearning. In 2022 IEEE 7th European Symposium on Security and Privacy (EuroS&P), pages 303–319. IEEE, 2022a. Anvith Thudi, Hengrui Jia, Ilia Shumailov, and Nicolas Papernot. On the necessity of auditable algorithmic definitions for machine unlearning. In 31st USENIX Security Symposium (USENIX Security 22), pages 4007–4022, 2022b. Eleni Triantafillou, Fabian Pedregosa, Jamie Hayes, Peter Kairouz, Isabelle Guyon, Meghdad Kur- manji, Gintare Karolina Dziugaite, Peter Triantafillou, Kairan Zhao, Lisheng Sun Hosoya, Julio C. S. Jacques Junior, Vincent Dumoulin, Ioannis Mitliagkas, Sergio Escalera, Jun Wan, Sohier Dane, Maggie Demkin, and Walter Reade. Neurips 2023 - machine unlearning, 2023. URL https://kaggle.com/competitions/neurips-2023-machine-unlearning. Chen Wu, Sencun Zhu, and Prasenjit Mitra. Federated unlearning with knowledge distillation. arXiv preprint arXiv:2201.09441, 2022. Qizhe Xie, Minh-Thang Luong, Eduard Hovy, and Quoc V Le. Self-training with noisy student improves ImageNet classification. In Conference on Computer Vision and Pattern Recognition, pages 10687–10698, 2020. Li Yang and Abdallah Shami. On hyperparameter optimization of machine learning algorithms: Theory and practice. Neurocomputing, 415:295–316, 2020. Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning (still) requires rethinking generalization. Communications of the ACM, 64(3):107–115, 2021. Yuheng Zhang, Ruoxi Jia, Hengzhi Pei, Wenxiao Wang, Bo Li, and Dawn Song. The secret revealer: Generative model-inversion attacks against deep neural networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 253–261, 2020. Zijie Zhang, Yang Zhou, Xin Zhao, Tianshi Che, and Lingjuan Lyu. Prompt certified machine unlearning with randomized gradient smoothing and quantization. Advances in Neural Information Processing Systems, 35:13433–13455, 2022. 13 7 Appendix This Appendix contains the following sections: • Section 8: Limitations and Future Work • Section 9: Experimental Details and Pseudocode • Section 10: Formal Description of Metrics • Section 11: Membership Inference Attacks: Description and Additional Findings • Section 12: Ablations and Sensitivity Analysis • Section 13: Larger-scale settings • Section 14: Additional Results for Removing Biases (RB) • Section 15: Additional Results for Resolving Confusion (RC) • Section 16: Additional Results for User Privacy (UP) 8 Limitations and Future Work SCRUB has shown impressive results in terms of being consistently a top-performer in terms of unlearning, with a minimal drop in performance compared to previous works. However, SCRUB has limitations that we hope future work will address. A significant step for future work is to develop theoretical guarantees for the gains provided by our methods. We opted to focus on an empirical approach for the following reasons: First, while theoretical guarantees abound for linear models, deep networks pose additional significant challenges. Second, methods accompanied with theoretical guarantees suffer from practical limitations with respect to accuracy and/or scalability. For these reasons we opted to approach the problem from a practical standpoint, pushing the envelope by developing unlearning algorithms which are top performers across many important different application scenarios, different evaluation metrics, different architectures and datasets. We look forward to future work that strives to strike a compromise between effective unlearning, good performance, scalability, and theoretical insights. Another limitation of SCRUB is the difficulty and instability associated with tuning the min-max objective, as shown in the literature e.g. for GANs. For instance, this can lead to oscillating behaviour, as we show in Figure 6. We remedy this to a large extent in practice by providing a practical algorithm that works well, showing consistently improved results over prior work, but there is room for improvement on this front for future work. SCRUB's rewinding procedure also has limitations. We find in practice throughout all of our experiments that it can help to substantially increase the success of SCRUB's defense on MIA in scenarios where the forget error obtained by SCRUB at the end of unlearning is 'too high'. However, a different failure case which can also appear is that SCRUB's forget error at the end of training is 'too low'. This can happen due to the way in which we tune hyperparameters, which is designed to not harm the retain and validation performance too much, and thus can in some cases lead to 'premature stopping' before the forget error reaches the same level as a reference point for how high it would be if the model had truly never seen those examples. We highlight that addressing all possible issues that can arise in all scenarios and provide an unlearning algorithm that performs strongly across the board is extremely challenging. The fact that we have observed failure cases for each algorithm, be it SCRUB or other baselines, is indicative of the extensiveness of the experimentation we conducted. Our work has made important strides in designing consistently strong-performing unlearning methods and we look forward to future contributions in this direction. We hope that future work also continues to push the limits of scalability. We believe that our work constitutes an important step in this direction. However, the datasets and models we consider aren't too large, in order to allow comparisons to previous works that would not be feasible to run for larger scale experiments. An interesting topic of future work is investigating the interplay between SCRUB and other scalable algorithms like NegGrad+ with increasing amounts of scale. Another really interesting future work direction is to investigate how different unlearning algorithms interact with different architectures, like Transformers, and loss functions, like self-supervised learning. 14 9 Experimental Details and Pseudocode Algorithm 1 SCRUB Require: Teacher weights wo Require: Total max steps MAX-STEPS Require: Total steps STEPS Require: Learning rate ε wu ← wo i ← 0 repeat if i < MAX-STEPS then wu ← DO-MAX-EPOCH(wu) end if wu ← DO-MIN-EPOCH(wu) until i < STEPS Datasets. We have used CIFAR-10 and Lacuna- 10 datasets for evaluation purposes. CIFAR-10 consists of 10 classes with 60000 color images of size 32 x 32. In our experiments, the train, test, and validation sizes are 40000, 10000, and 10000 respectively. Lacuna-10 is a dataset de- rived from VGG-Faces [Cao and Yang, 2015]. We have followed the same procedure described in [Golatkar et al., 2020a] to build Lacuna. We randomly select 10 celebrities (classes) with at least 500 samples. We use 100 samples of each class to form the test-set, and the rest make the train-set. All the images are resized to 32 x 32. We also use CIFAR-100 and Lacuna-100 to pre- train the models. Lacuna-100 is built in a similar way as Lacuna-10, and there is no overlap be- tween the two datasets. We have not applied any data augmentation throughout the experiments. Small-Scale datasets. We followed the same procedure as decribed in [Golatkar et al., 2020b] to create the small versions of CIFAR-10 and Lacuna-10, namely CIFAR-5 and Lacuna-5. To this end, we take the first 5 classes of each dataset and randomly sample 100 images for each class. We make the train and test sets by sampling from the respective train and test sets of CIFAR-10 and Lacuna-10. We also make 25 samples from each class from the train set to create the validation sets. Algorithm 2 DO-MAX-EPOCH Require: Student weights wu Require: Learning rate ε Require: Batch size B Require: Forget set Df Require: Procedure NEXT-BATCH b ← NEXT-BATCH(Df , B) repeat wu ← wu + ε∇wu 1 |b| d(xf ; wu) (cid:88) xf ∈b b ← NEXT-BATCH(Df , B) until b size 128. Models. We use the same models with the same architectural modifications in [Golatkar et al., 2020a,b]. For All-CNN, the number of layers is reduced and batch normalization is added before each non-linearity. For Resnet, ResNet-18 ar- chitecture is used. For small scale experiments, the number of filters is reduced by 60% in each block. For the large-scale experiments, the exact architecture has been used. Pretraining. Following the previous work for consistency, we apply pretraining. Specifically, for CIFAR datasets, we have pretrained the mod- els on CIFAR-100. For Lacuna, we have pre- trained the models on Lacuna-100. We pretrain the models for 30 epochs using SGD with a fixed learning rate of 0.1, Cross-Entropy loss function, weight decay 0.0005, momentum 0.9, and batch Baselines. 'Original' is the model trained on the entire dataset D. For 'Retrain', we train the same architecture on Dr, with the same hyperparameters used during training of the original model. For 'Finetune', we fine-tune the 'original' model on Dr for 10 epochs, with a fixed learning rate of 0.01 and weight-decay 0.0005. For 'NegGrad+', we fine-tune the 'original' model using the following loss: L(w) = β × 1 |Dr| l(f (xi; w), yi) − (1 − β) × 1 |Df | |Dr| (cid:88) i=1 |Df | (cid:88) j=1 l(f (xj; w), yj) (4) Where β ∈ [0, 1]. We have tuned β to get a high forget-error while not destroying retain-error and validation-error. For small-scale experiments, β = 0.95 and we have trained for 10 epochs, with SGD, 0.01 lr and 0.1 weight-decay. For large-scale experiments β = 0.9999 and we have trained for 5 epochs, with SGD, 0.01 lr, and 0.0005 weight-deay. Please note that small β result in explosion quickly. For 'CF-k', we freeze the first k layers of the network and finetune the rest layers with Dr. We use the same setting as 'Finetune' baseline. For 'EU-k' we freeze the first k layers, and 15 model dataset unlearning-type forget-set bs retain-set bs max steps min steps ResNet All-CNN CIFAR-10 CIFAR-10 Lacuna-10 Lacuna-10 CIFAR-5 Lacuna-5 CIFAR-10 CIFAR-10 Lacuna-10 Lacuna-10 CIFAR-5 Lacuna-5 class selective class selective selective selective class selective class selective selective selective 512 16 128 32 32 32 512 16 32 8 16 32 128 64 128 32 32 32 256 64 32 32 32 32 2 5 5 4 10 5 3 5 4 2 5 5 3 5 5 4 10 10 4 5 4 4 10 10 Table 3: SCRUB's hyperparameters for each experiment re-initialize the weights of the remaining layers and retrain them with Dr. As all the models are pretrained on larger datasets, for re-initializing we use the weights of the pretrained models. For 'EU-k' we use the same settings as the 'Retrain' baseline. In both 'EU-k' and 'CF-k' baselines, for both ResNet and All-CNN we freeze all the layers except for the last block of the network. For Resnet the last block is block4 and for All-CNN, the last block of layers is the 9th sequential block. For Bad-T, we follow the specifications given in Chundawat et al. [2022] with possible tuning of the parameters in different settings to get the highest forget-error without damaging retain-error. More specifically, for all models we perform one epoch of unlearning using Adam optimizer, and a temperature scalar of 4. Also, we use the whole retain-set compared to 30% reported in their paper as we empirically observed that using only 30% of retain-set for Bad-T yields high test errors. Algorithm 3 DO-MIN-EPOCH Require: Student weights wu Require: Learning rate ε Require: Batch size B Require: Retain set Dr Require: Procedure NEXT-BATCH SCRUB pseudocode and parameters. We train SCRUB using Algorithm 1. Throughout the experiments, we tune the parameters to get a high forget-error while retaining the retain and validation error of the original model. We use the same optimizer for both min and max steps. We observed that for small-scale settings 'Adam' optimizer works better, while in large-scale set- tings both 'Adam' and 'SGD' could be used. For all experiments, we initialize the learning rate at 0.0005 and decay it by 0.1 after a number of min and max steps. Decaying the learning rate is cru- cial to control the oscillating behaviour of our min and max optimization. We apply a weight decay of 0.1 for small-scale setting and 0.0005 for large scale experiments, with a momentum of 0.9. Finally, we use different batch sizes for the forget-set and the retain-set to control the number of iteration in each direction, i.e the max and the min respectively. We report these in Table 3. γl(f (xr; wu), yr) b ← NEXT-BATCH(Dr, B) b ← NEXT-BATCH(Dr, B) repeat wu ← wu − ε∇wu αd(xr; wu) + until b (xr,yr)∈b 1 |b| (cid:88) System specification. For scale-up experiments, the code is executed in Python 3.8, on an Ubuntu 20 machine with 40 CPU cores, a Nvidia GTX 2080 GPU and 256GB memory. 10 Formal Description of Metrics In this section, we give more details and mathematical definitions of the metrics that we use throughout the paper. We first mathematically define the forget, retain and test errors, and then other application- dependent metrics, for Resolving Confusion (RC) and User Privacy (UP). 16 Forget, retain and test errors Here, we define the retain error, forget error and test error. Let Dr, Df and Dt denote the retain and forget portions of the training dataset, and a test dataset of heldout examples, respectively. We define error (Err) as follows: Err(D) = 1 − 1 |D| (cid:88) (xi,yi)∈D 1[arg max(f (xi; w)) == yi] (5) where f , parameterized by w is the neural network model (comprised of a feature extractor followed by a softmax classifier layer), arg max(f (xi; w)) is the label that the model thinks is most likely for example xi, and 1[x] is the indicator function that returns 1 if x is True and 0 otherwise. Based on the above, the retain error, forget error and test error are computed as Err(Dr), Err(Df ) and Err(Dt), respectively. Metrics for Unlearning for Resolving Confusion (RC) We now define the class confusion metrics inspired by Goel et al. [2022]. Specifically, we explore a scenario where the forget set has confused labels (e.g. for two classes A and B, examples of A are labelled as B, and vice versa). The idea here is that, because mislabelled examples are only present in the forget set, successful unlearning (removing the influence of the forget set) would lead to a model that is not at all confused between classes A and B. In more detail, the setup we follow is: 1) We first mislabel some portion of the training dataset (we mislabelled examples between classes 0 and 1 of each of CIFAR-5 and Lacuna-5 in our experiments), 2) train the 'original model' on the (partly mislabelled) training dataset (it has mislabelled examples for classes 0 and 1 but correct labels for the remaining classes), 3) perform unlearning where the forget set contains all and only the confused examples. Given this, the goal for the unlearning algorithm is to resolve the confusion of the original model. We consider the following metrics (using terminology consistent with Goel et al. [2022]). They are presented in order of decreasing generality, and increasing focus on measuring degrees of confusion between the two classes considered. • Error (e.g. test error, retain error, forget error). This counts all mistakes, so anytime that an example of some class is predicted to be in any other class, it will be counted. These are the same metrics that we use for the rest of the paper (see Equation 5). For test and retain error, lower is better, whereas for forget error, higher is better. • Interclass Confusion IC-ERR (e.g. IC test error, IC retain error). This counts only mistakes that involve examples from the confused classes A and B. Specifically, it counts instances of any example of class A being predicted to be in any other class , and similarly for class B. Compared to Error, this metric is more focused towards understanding the result of the introduced confusion, since it only considers cases that relate to the confused classes. A successful unlearning method would make no such errors, so lower is better for each of IC test error and IC retain error. • FGT-ERR (e.g. Fgt test error, Fgt retain error). This metric counts only misclassification between the confused classes A and B. Here, a mistake of an example of class A (or B) being predicted to be in class other than A or B will not be counted. Only mistakes of an example of class A being predicted to be in class B, and vice versa, are counted. This is the most focused metric that directly measures the amount of remaining confusion between the two classes in question. A successful unlearning method would make no such errors, so lower is better for each of Fgt test and Fgt retain. More formally, Error is the same as defined in Equation 5. Let us now mathematically define IC-ERR and FGT-ERR. We denote by C w,D the confusion matrix for model parameterized by w on the dataset D, and let DA denote the part of the dataset D that belongs to class A. So, for example DrA denotes the part of the retain set Dr that belongs to class A, and the entry C w,D A,B of the confusion matrix stores the number of times that a sample belonging to class A was (mis)classified as belonging to class B in the dataset D by the model parameterized by w. Then, we have: (cid:80) k C w,D A,k + (cid:80) |DA| + |DB| k′ C w,D B,k′ IC-ERR(D, A, B; w) = 17 (6) where k ̸= A, k′ ̸= B. So, for example, the 'IC test error' column in our tables is computed via IC-ERR(Dt, 0, 1; w), where Dt denotes the test set, and 0 and 1 are the two classes confused in our experiments. Analogously, 'IC retain error' is computed as IC-ERR(Dr, 0, 1; w) Finally: FGT-ERR(D, A, B; w) = C w,D A,B + C w,D B,A (7) That is, FGT-ERR only measures the misclassification between the two confused classes A and B. So, for example, the 'Fgt test error' in our tables is computed as FGT-ERR(Dt, 0, 1; w) and analogously 'Fgt retain error' is computed as FGT-ERR(Dr, 0, 1; w). User Privacy (UP) Metrics Please see the next section for full details for each of the two Membership Inference Attacks (MIAs) that we use and experimental results. 11 Membership Inference Attacks: Description and Additional Findings As mentioned in our paper, we utilize two different MIAs: 1) a 'Basic MIA' that is similar to the ones typically used in unlearning papers (but far from the state-of-the-art of MIAs used by privacy and security colleagues), and 2) the first, to our knowledge, adaptation of the state-of-the-art LiRA attack [Carlini et al., 2022] to the framework of unlearning ('LiRA-for-unlearning' MIA). In this section, we use the term 'target model' to refer to the model that is being attacked and the term 'target example' to refer to an example whose membership status ('in' or 'out') the attacker tries to predict, based on the 'behaviour' (e.g loss value) of that example under the 'target model'. In both attacks that we consider, the target model is the unlearned model, and target examples are either forget set ('in') or test set ('out') examples. The unlearning algorithm successfully defends an MIA if the attacker can't tell apart examples that were unlearned (forget set examples) from examples that were truly never seen. 11.1 Basic MIA Returning to our previous notation, let l(f (x; wu), y) denote the cross-entropy loss of the unlearned model (a deep network f with weights wu) on example x with label y. We abbreviate this as l(x, y) from now on; dropping the dependence on f and wu. eval = {(l(xi, yi), yb train = {(l(xi, yi), yb The attacker is a binary classifier that takes as input loss values, coming from either the forget set Df or a held-out test set Dt, and predicts whether the example whose loss value was presented was in the training set of the original model. We train this attacker via supervised learning on a class-balanced labelled training set for this binary problem: Db i )} where each xi is an example coming either from Df or Dt, and its binary label yb i is defined as being 0, if xi ∈ Dt and 1 if xi ∈ Df . Once the binary classifier attacker is trained, we use it to make predictions for a held-out evaluation set of the binary problem: Db i )} that is also balanced between examples coming from Df and Dt, but is disjoint from Db The attacker succeeds if it achieves high accuracy on Db eval, meaning that it can tell apart examples that were part of the original training set from those that weren't, which marks a defeat for the unlearning model in terms of this metric, since it has 'left traces behind' (in this case, in terms of loss values) and leaks information about membership in the forget set. We consider that an optimal defense against this MIA corresponds to a 50% attack accuracy; that is, no better than randomly guessing whether an example had been trained on. In principle, the Retrain oracle should defend optimally: it in fact did not train on the forget set, so the forget and test sets are simply two different held-out sets for this model whose loss values should generally be indistinguishable from each other if these sets are identically-distributed. We find in our experiments, presented in the main paper, that SCRUB+R is able to defend this MIA comparably to Retrain, and outperforms the other baselines in its ability to consistently do so. train. Experimental details In practice, if the distribution of the forget set and the test set are very different from each other, their loss values will be very distinguishable. This means that the binary classifier can tell them apart easily, but without having truly learned to infer membership in the 18 Figure 4: ROC curves for the strong LiRA-for-unlearning attack (Area Under the Curve (AUC) is also reported in the legend, for each unlearning method). Different subplots correspond to different target models (we trained the target unlearned model 5 times for each unlearning method, using different random seeds, and different forget sets). Positives are examples in the forget set, and negatives in the test set. A true positive means that the attacker correctly identified that an example was forgotten, whereas a false positive means that it incorrectly predicted that a test example was forgotten. We are primarily interested in the area of small False Positive Rate [Carlini et al., 2022] and a good unlearning method is associated with a smaller True Positive Rate, i.e. fewer successes for the attacker, especially in the region of interest. We observe that SCRUB(+R) defends the strong LiRA-for-unlearning attack more successfully than the other baselines. training dataset. This makes the attacker's evaluation unreliable. To circumvent this problem, we ought to pick the held-out test set from the same distribution. More specifically, if the forget set is examples from the 'cat' class of CIFAR10 dataset, we use the same class for our held-out test set. In our experiments, we clip the loss values to a range between [-400, +400] to remove anomalies. Also, we use the default LogisticRegression() classifier of the Python's scikit-learn library as our attack model, and perform a cross-validation with 5 random splits. We report the average accuracy of the evaluation part of each of the 5 folds as the MIA score. Ideally (for a perfect defense), this score is closest to 50%, indicating that the attacker fails to tell apart the forget set from the test set. We present additional results for the Basic MIA attack in Section 16. 11.2 LiRA-for-unlearning attack In the standard privacy setting, the LiRA attacker [Carlini et al., 2022] trains a large number of 'shadow models' [Shokri et al., 2017], for which it controls which examples are in the training set each time (by construction). To then predict the membership status of a 'target example', it estimates two Gaussian distributions, using the shadow models: the distribution of confidences of that example under shadow models that trained on it, and the distribution of its confidences under shadow models that didn't. Then, it computes the confidence of the target example under the target model and it predicts that the target example was 'in' if the likelihood of the target confidence under the former Gaussian is larger than that under the latter Gaussian. Adapting LiRA to the framework of unlearning is not trivial, and we are not aware of this done in any previous work. We propose the first, to our knowledge, adaptation of LiRA for unlearning. This is a strong attack where we allow the attacker knowledge of the unlearning algorithm. Concretely, for each shadow model, the attacker also produces a 'shadow unlearned' model by applying the given unlearning algorithm several times, using a large number of forget sets (similar to Chen et al. [2021]). Now, for each 'target example', this setup allows the attacker to estimate a different pair of Gaussians: the distribution of (confidences of) that target example under models where it was forgotten, and as before, under models where it was not seen. The attacker then computes the confidence of the target example under the target model, and predicts the example was forgotten if its likelihood under the former is larger than under the latter. 19 103102101100False Positive Rate103102101100True Positive RateOriginal = 0.92SCRUB = 0.72SCRUB+R = 0.72NegGrad+ = 0.80CF-k = 0.92EU-k = 0.84103102101100False Positive Rate103102101100True Positive RateOriginal = 0.92SCRUB = 0.73SCRUB+R = 0.74NegGrad+ = 0.80CF-k = 0.91EU-k = 0.82103102101100False Positive Rate103102101100True Positive RateOriginal = 0.92SCRUB = 0.74SCRUB+R = 0.74NegGrad+ = 0.79CF-k = 0.92EU-k = 0.81103102101100False Positive Rate103102101100True Positive RateOriginal = 0.92SCRUB = 0.74SCRUB+R = 0.73NegGrad+ = 0.79CF-k = 0.92EU-k = 0.81103102101100False Positive Rate103102101100True Positive RateOriginal = 0.92SCRUB = 0.73SCRUB+R = 0.73NegGrad+ = 0.79CF-k = 0.92EU-k = 0.81 Experimental setup: overview We run our LiRA-for-unlearning attack on selective unlearn- ing on CIFAR-10, for the scenario where the forget set has size 200 and comes from class 5. Attacker: For the attacker, we first train 256 'shadow original' models on random splits of half of the CIFAR-10 training set. Let D de- note the original dataset. To train each shadow model, we split D in half, and use one half to as the 'training set' and the other half as the 'test set' of that particular shadow model. Then, for each of these 'shadow original' models, we run unlearning on 10K different forget sets (for each unlearning method). Specifically, the for- get set is a random subset of 200 examples of class 5, sampled from the training set of the cor- responding 'shadow original' model. After this procedure, for every example in class 5, we se- lect 256 associated shadow models when it was not included in training, and 256 shadow models when it was unlearned (i.e. it was in the forget set). After this, the LiRA attack proceeds as normal, where we take each in / out distribution and apply a likelihood ratio test on an unknown example to infer membership. Figure 5: Sensitivity of SCRUB to γ and α. To create this plot, we ran SCRUB many times for dif- ferent values of γ ([0.1, 0.5, 1, 2, 3]) and α ([0.1, 0.5, 1, 2, 3]). The x-axis is represents combinations of these values. t-error, f-error and r-error refer to test, forget and retain error, respectively. We find that SCRUB is not very sensitive to these hyper- parameters: the retain error remains low across values, and there are several different settings to these hyperparameters for which we can obtain the desired results for test and forget errors too. Defender: We next train the target model that LiRA-for-unlearning will attack. For this, we begin by training the 'original' model, on (a random split of) half of D. Then, we apply the given unlearning algorithm on a randomly-sampled forget set, which is a subset of the original model's training set of size 200, coming from class 5, in the same way as was done by the shadow models. Implementation note We run this attack at a much larger scale than the remaining experiments of the paper (we run 10K unlearning runs, on different forget sets, for each of the 256 'shadow original' models). We do this because the strength of the attacker is heavily dependent on the number of shadow original/unlearned models, and we wanted to benchmark our baselines against a very strong attacker. Therefore, to allow better scaling, instead of implementing SCRUB+R as rewinding, we implement it through filtering runs of SCRUB that don't satisfy the condition of SCRUB+R that the forget set error should be close to the validation error (where, as explained in the main paper, this refers to the validation set that is constructed to have the same distribution as the forget set; containing examples of only the same class as the one in the forget set). We used 0.1 as our threshold. Computing the 'confidence' Consistent with [Carlini et al., 2022], the confidence of an example (x, y) (where y denotes the ground-truth class label) is defined as softmax(f (x))[y]. In words, the confidence is the softmax probability of the correct class. Following Carlini et al. [2022], we apply logit-scaling to each confidence, to make their distributions Gaussian. Conclusions and findings Figure 4 plots the ROC curve, showing the False Positive Rate and True Positive Rate of the attacker, in log-log scale. Different subplots correspond to different target unlearned models, each of which was trained with a different random seed, and different retain/forget set split. A successful defense is associated with a smaller Area Under the Curve (AUC); meaning fewer True Positives for the attacker. Carlini et al. [2022] however advocate that the AUC is not a good indicator of the attacker's strength and, instead, they argue that we should primarily consider the region of the ROC curve associated with very small False Positive Rates. We observe that, especially in that region, SCRUB(+R) is the strongest method in terms of defending our LiRA-for-unlearning attack (and also we observe that SCRUB(+R) has the best AUC too). The improved NegGrad+ baseline that we also proposed in this paper is also a strong model in terms of defending this attack. 20 (a) Only max steps (Equation 1). (b) SCRUB with insufficient max steps. (c) SCRUB with too many max steps. (d) SCRUB. Figure 6: Illustration of training dynamics of SCRUB variants, on CIFAR-5 with a ResNet model. Performing the right interleaving of min-steps and max-steps is important for achieving a good balance between high forget error and low retain and validation errors. We found that CF-k is not able to improve the privacy of the original model in most cases, while EU-k can sometimes improve but only slightly, and not reliably. Limitations To stay consistent with previous work on unlearning, as mentioned previously, we turn off data augmentations. Consequently, the 'original model' (before unlearning is applied) has overfitted more than a state-of-the-art CIFAR model would. Indeed, as can be seen from Figure 4, the 'Original' model has poor privacy (the attacker has a high True Positive Rate). We note that this is the first, to our knowledge, investigation of privacy of unlearning algorithms using strong MIAs, and we hope that future work continues to investigate increasingly more realistic scenarios with models closer to the state-of-the-art, and considers unlearning on original models of varying degrees of privacy and generalization ability. 12 Ablations and Sensitivity Analysis In this section, we illustrate the training dynamics of SCRUB and the importance of different design choices. As a reminder, the student is initialized from the teacher and subsequently undergoes an alternating sequence of max-steps and min-steps; the former encouraging the student to move far from the teacher on the forget set, and the latter encouraging it to stay close to the teacher on the retain set. We also found it useful to perform a sequence of additional min-steps after the alternating sequence. We now explore the effect of these decisions. First, we show that performing only max-steps, by optimizing Equation 1, is not a good solution. Simply pushing the student away from the teacher on the forget set achieves forgetting but unfortu- nately also hurts the retain and validation set performance (Figure 6a). Therefore, alternating between max-steps and min-steps is necessary. However, it is important to find the right balance. For instance, as seen in Figure 6b, performing too few max-steps leads to the unwanted consequence of the forget error dropping. On the other hand, removing the final sequence of only min-steps is also harmful, as shown in Figure 6c that trains for a larger number of epochs of an equal number of (alternating) max-steps and min-steps without achieving a good balance at any point throughout the trajectory. On the other hand, SCRUB (Figure 6d) achieves a good balance of high forget error and low retain and validation error simultaneously. We also ablate the cross-entropy term in Equation 3, which provides a small but consistent added protection against degrading performance in Figure 10. We show additional examples of training dynamics (Figures 7, 8, 9). 21 (a) Performing only max steps (Equation 1). (b) SCRUB with insufficient max steps. (c) SCRUB with too many max steps. (d) SCRUB. Figure 7: Illustration of training dynamics of SCRUB variants, on CIFAR-5 with All-CNN. Per- forming the right interleaving of min-steps and max-steps is important for achieving a good balance between high forget error and low retain and validation errors. Table 4: Results for class-unlearning. Class-0 (400 examples) of Cifar-100 (40k examples). The numbers are averaged over 3 runs. Model Test error (↓) Retain error (↓) std mean mean std Forget error (↑) mean std Basic MIA std mean Original Retrain NegGrad+ Bad-T@epoch1 Bad-T@epoch10 SCRUB+R SCRUB 35.84 36.92 43.16 44.14 43.33 37.60 38.27 0.76 1.02 3.13 1.84 1.27 1.18 3.08 0.07 0.09 6.86 8.78 7.74 0.12 0.78 0.02 0.06 5.16 2.08 3.21 0.10 2.47 0.00 100.00 49.50 63.83 85.33 100.00 100.00 0.00 0.00 12.79 24.64 4.18 0.00 0.00 61.67 55.67 64.67 61.67 63.33 57.33 48.33 16.20 34.09 18.07 20.57 28.15 28.99 12.25 Finally, we also investigate the sensitivity of SCRUB's results on the γ and α hyperparameters, in Figure 5. We find that SCRUB is not very sensitive to these hyperparameters: the retain error remains low across values, and there are several different settings to these hyperparameters for which we can obtain the desired results for test and forget errors too. 13 Larger-scale Settings In this section, we scale up to an even larger setting, by choosing a larger model and performing a larger classification task. The experiments here are conducted on VGG16+BN with almost 138M parameters, and CIFAR-100, with varying forget set sizes. The results are reported in Table 4 and Table 5. Furthermore, for these experiments we train Bad-T for different number of iterations (recall that Bad-T originally proposes 1 epoch of unlearning) to study if its performance would improve with longer iterations. The results suggest that, again, SCRUB is consistently among the top performers across all the metrics. Furthermore, the results show that longer iterations does not improve Bad-T in any of the metrics. 22 (a) Performing only max steps (Equation 1). (b) SCRUB with insufficient max steps. (c) SCRUB with too many max steps. (d) SCRUB. Figure 8: Illustration of training dynamics of SCRUB variants, on Lacuna-5 with ResNet. Performing the right interleaving of min-steps and max-steps is important for achieving a good balance between high forget error and low retain and validation errors. (a) Performing only max steps (Equation 1). (b) SCRUB with insufficient max steps. (c) SCRUB with too many max steps. (d) SCRUB. Figure 9: Illustration of training dynamics of SCRUB variants, on Lacuna-5 with All-CNN. Per- forming the right interleaving of min-steps and max-steps is important for achieving a good balance between high forget error and low retain and validation errors. 23 (a) CIFAR-5 with ResNet. (b) CIFAR-5 with All-CNN. (c) Lacuna-5 with ResNet. (d) Lacuna-5 with All-CNN. Figure 10: Effect of adding the cross-entropy loss in Equation 3. Dashed lines omit cross-entropy while solid lines use it. We find that the addition of cross-entropy offers an additional protection to maintaining the model's performance during the unlearning procedure. This sometimes comes at the cost of smaller forget set error, compared to the forget set error that would have been achieved if cross-entropy was omitted from the loss. Table 5: Results for selective unlearning. 10 examples from class-0 of Cifar-100 dataset.The numbers are averaged over 10 runs. Forget Size Model Test error (↓) Retain error (↓) mean mean std std 10 20 Original Retrain NegGrad+ Bad-T@epoch1 Bad-T@epoch10 SCRUB+R SCRUB Original Retrain NegGrad+ Bad-T@epoch1 Bad-T@epoch10 SCRUB+R SCRUB 37.46 37.54 45.98 47.23 47.09 38.40 38.18 37.46 37.74 45.56 46.46 45.88 38.39 38.29 4.99 5.24 6.79 5.76 5.65 4.70 4.78 4.99 5.31 7.00 6.28 5.70 4.63 4.61 0.54 0.57 11.64 13.79 13.80 0.69 0.48 0.54 0.56 11.14 12.95 12.03 0.68 0.49 1.74 1.84 12.02 10.28 9.79 2.07 1.44 1.74 1.77 12.57 11.71 9.44 2.00 1.42 24 Forget error (↑) mean std Basic MIA std mean 0.00 19.00 44.00 66.00 96.00 40.00 45.00 0.00 19.50 47.00 55.50 92.00 23.00 29.00 0.00 15.81 11.15 18.22 8.07 13.33 13.60 0.00 12.00 9.89 16.20 10.25 8.70 16.28 58.00 45.00 55.00 62.00 77.00 61.00 56.00 63.00 49.00 67.50 55.00 70.00 49.50 54.50 9.10 19.04 23.88 30.20 17.25 17.59 19.76 10.96 11.47 13.94 21.59 10.87 11.68 18.54 Model Finetune Fisher NegGrad+ CF-k EU-k Bad-T SCRUB CIFAR-10 Lacuna-10 ResNet All-CNN ResNet All-CNN class selective class selective class selective class selective 3.8 0.08 3.4 3.55 1.41 19.07 7.84 3.09 0.07 2.96 3.17 1.26 20.44 7.41 3.33 0.16 2.30 3.37 1.34 17.91 6.36 3.03 0.14 2.97 2.91 1.20 17.03 5.33 1.7 0.08 1.66 3.42 1.39 20.05 2.17 2.03 0.07 1.5 3.20 1.28 20.27. 1.95 2.16 0.16 2.41 3.27 1.32 16.32 2.81 2.00 0.15 2.27 3.11 1.26 16.02 2.48 Table 6: Scale-up factor: the fraction of the runtime of retrain from scratch over the runtime of each given unlearning algorithm. That is, a scale-up value of X for an unlearning algorithm means that that algorithm runs X times faster than retrain from scratch. Model Retrain Original Finetune Fisher NTK NegGrad+ CF-k EU-k Bad-T SCRUB CIFAR-5 Test error (↓) Retain error (↓) std mean mean std Forget error (↑) Test error (↓) Retain error (↓) mean mean mean std std std Lacuna-5 24.9 24.2 24.3 31.6 24.4 25.5 22.6 23.5 27.73 24.2 2.5 2.6 2.4 3.4 2.6 1.1 1.9 1.1 1.89 1.6 0.0 0.0 0.0 14.0 0.0 0.0 0.0 0.0 5.12 0.0 0.0 0.0 0.0 6.0 0.0 0.0 0.0 0.0 1.56 0.0 28.8 0.0 0.0 4.8 22.4 41.3 0.0 10.7 8.00 40.8 5.9 0.0 0.0 5.2 9.2 6.1 0.0 2.3 8.64 1.8 5.8 5.7 5.6 14.0 5.6 6.1 5.8 5.9 5.00 6.2 0.4 0.4 0.3 3.6 0.5 0.7 0.4 0.6 0.33 0.73 0.0 0.0 0.0 6.7 0.0 0.0 0.0 0.0 0.14 0.0 0.0 0.0 0.0 3.3 0.0 0.0 0.0 0.0 0.10 0.0 Forget error (↑) mean std 4.8 0.0 0.0 6.4 0.0 1.3 0.0 0.0 0.00 24.8 3.4 0.0 0.0 8.3 0.0 2.3 0.0 0.0 0.00 5.2 Table 7: Small-scale results with ResNet for the Removing Biases (RB) application. SCRUB is the top-performer in terms of forgetting with minimal performance degradation. 14 Additional Results for Removing Biases (RB) In this section, we provide the results for all scenarios we studied for the Removing Biases (RB) application for ResNet and All-CNN, on both CIFAR and Lacuna, for both small-scale and large-scale, for completeness, in Tables 7, 8, 9, 10, 11, 12. Model Test error (↓) Retain error (↓) mean mean std std CIFAR-5 Forget error (↑) mean std Test error (↓) std mean Lacuna-5 Retain error (↓) mean std Forget error (↑) mean std Retrain 24.36 1.61 0.13 0.28 28.8 9.12 4.6 0.38 0.0 0.0 4.67 6.41 24.08 23.48 42.64 24.16 26.07 22.67 25.87 25.87 23.88 Original Finetune Fisher NTK NegGrad+ CF-k EU-k Bad-T SCRUB 0.0 0.0 16.83 8.29 10.58 0.00 6.93 4.99 8.2 Table 8: Small-scale results with All-CNN for the Removing Biases (RB) application. SCRUB is the top-performer in terms of forgetting with minimal performance degradation. 0.47 10.76 13.87 0.47 0.76 0.70 0.20 0.66 0.72 0.0 13.22 14.54 0.0 0.12 0.00 0.00 0.79 0.0 0.17 0.04 31.83 0.17 0.56 0.00 3.23 9.68 0.08 0.0 0.0 15.2 13.6 36.00 0.00 8.00 10.67 40.8 0.0 40.03 40.43 4.68 13.86 0.00 0.00 0.00 4.13 0.0 19.33 39.33 3.33 12.00 0.00 0.00 0.00 25.33 0.38 0.09 10.47 0.38 0.49 0.00 1.69 0.45 0.12 0.0 6.63 51.09 0.0 0.14 0.00 0.00 2.32 0.0 4.53 9.77 52.53 4.47 5.27 4.67 5.20 8.87 3.87 1.86 1.91 6.56 1.77 1.21 1.55 0.64 1.80 1.78 25 Model Retrain Original Finetune Fisher NegGrad+ CF-k EU-k Bad-T SCRUB CIFAR-10 Test error (↓) Retain error (↓) mean mean std std Lacuna-10 Forget error (↑) Test error (↓) Retain error (↓) mean mean mean std std std 14.72 16.56 16.41 26.42 17.84 15.31 18.73 19.56 15.73 0.16 0.1 0.09 1.41 1.46 0.12 0.42 1.44 0.17 0.0 0.0 0.0 2.45 1.74 0.00 0.00 11.34 0.51 0.0 0.0 0.0 0.84 2.55 0.00 0.00 1.82 0.02 100.0 0.0 0.0 100.0 91.26 0.03 98.79 94.67 100.0 0.0 0.0 0.0 0.0 7.73 0.01 0.18 6.12 0.0 2.87 3.07 3.02 3.33 3.41 2.89 3.19 3.37 3.69 0.34 0.26 0.37 0.54 0.17 0.22 0.17 0.50 0.36 0.0 0.0 0.0 0.0 0.00 0.00 0.01 1.06 0.28 0.0 0.0 0.0 0.0 0.00 0.00 0.02 0.47 0.23 Forget error (↑) mean std 99.75 0.0 0.0 100.0 14.90 0.00 4.06 67.60 100.0 0.56 0.0 0.0 0.0 1.78 0.00 0.83 24.26 0.0 Table 9: Large-scale, class unlearning results with ResNet for the Removing Biases (RB) applica- tion. SCRUB and EU-k are the top-performers in this setting in terms of forgetting with minimal performance degradation. Note, however, that EU-k doesn't perform strongly across the board and in particular performs very poorly in selective unlearning (notice the contrast between EU-k's forget error between Figures 1a and 1b Fisher is also a top-performer in terms of forget error in this setting too, but on CIFAR causes a large degradation in test error, as is often observed for this method. Model Retrain Original Finetune Fisher NegGrad+ CF-k EU-k Bad-T SCRUB CIFAR-10 Test error (↓) Retain error (↓) std mean mean std Lacuna-10 Forget error (↑) Test error (↓) Retain error (↓) mean mean mean std std std 13.97 15.56 15.39 27.4 17.87 14.99 15.30 16.98 15.06 0.19 0.25 0.22 2.28 0.31 0.23 0.69 0.40 0.14 0.0 0.0 0.0 3.66 0.58 0.00 0.13 5.84 0.12 0.0 0.0 0.0 1.03 0.13 0.00 0.14 0.43 0.03 100.0 0.0 0.0 99.0 87.22 0.00 100.00 81.93 100.0 0.0 0.0 0.0 0.0 1.67 0.00 0.00 3.50 0.0 1.59 1.56 1.67 1.78 1.63 1.48 1.74 2.56 2.0 0.36 0.33 0.44 0.29 0.17 0.36 0.45 0.09 0.4 0.0 0.0 0.0 0.0 0.00 0.00 0.00 0.37 0.0 0.0 0.0 0.0 0.0 0.00 0.00 0.00 0.18 0.0 Forget error (↑) mean std 100.0 0.0 0.0 89.0 6.56 0.00 77.19 38.65 100.0 0.0 0.0 0.0 0.0 1.13 0.00 39.51 36.80 0.0 Table 10: Large-scale, class unlearning results with All-CNN for the Removing Biases (RB) appli- cation. SCRUB is the top-performer in terms of forgetting with minimal performance degradation. Model Retrain Original Finetune Fisher NegGrad+ CF-k EU-k Bad-T SCRUB CIFAR-10 Test error (↓) Retain error (↓) mean mean std std Lacuna-10 Forget error (↑) Test error (↓) Retain error (↓) mean mean mean std std std 17.4 17.36 17.37 21.23 22.7 17.4 21.8 23.47 18.04 0.14 0.14 0.11 0.27 0.6 0.1 0.2 1.57 0.2 0.0 0.0 0.0 2.88 4.1 0.0 0.4 14.53 0.0 0.0 0.0 0.0 0.54 0.5 0.0 0.6 1.65 0.0 29.67 0.0 0.0 3.0 53.7 0.0 23.7 34.67 70.33 3.21 0.0 0.0 2.65 6.8 0.0 3.5 1.70 4.16 2.7 2.73 2.63 3.1 4.7 2.7 2.9 7.30 3.0 0.2 0.15 0.12 0.35 0.2 0.2 0.1 2.20 0.0 0.0 0.0 0.0 0.0 0.9 0.0 0.0 3.26 0.0 0.0 0.0 0.0 0.0 0.1 0.0 0.0 1.83 0.0 Forget error (↑) mean std 1.0 0.0 0.0 0.0 13.0 0.0 0.0 0.33 4.67 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.47 3.06 Table 11: Large-scale, selective unlearning results with ResNet for the Removing Biases (RB) application. SCRUB and NegGrad+ are the top-performers in terms of forgetting, though NegGrad+ has worse test performance than SCRUB in both cases. Note also that NegGrad+ isn't as consistent at forgetting across settings as SCRUB. 26 Model Retrain Original Finetune Fisher NegGrad+ CF-k EU-k Bad-T SCRUB CIFAR-10 Test error (↓) Retain error (↓) mean mean std std Lacuna-10 Forget error (↑) Test error (↓) Retain error (↓) mean mean mean std std std 16.47 16.43 16.5 21.39 21.36 16.29 17.62 22.43 16.55 0.21 0.08 0.18 1.22 0.34 0.07 0.61 0.37 0.11 0.0 0.0 0.0 4.0 3.23 0.00 0.11 10.13 0.0 0.0 0.0 0.0 1.44 0.37 0.00 0.11 0.15 0.0 25.67 0.0 0.0 13.0 45.33 0.00 0.33 1.67 29.33 2.31 0.0 0.0 11.27 2.89 0.00 0.58 1.25 3.21 1.6 1.53 1.43 1.87 2.77 1.53 1.83 4.90 2.07 0.44 0.31 0.21 0.21 0.25 0.31 0.47 2.10 0.31 0.0 0.0 0.0 0.01 0.40 0.00 0.00 1.34 0.0 0.0 0.0 0.0 0.02 0.07 0.00 0.00 1.20 0.0 Forget error (↑) mean std 0.67 0.0 0.0 0.0 8.67 0.00 0.00 0.67 1.67 0.58 0.0 0.0 0.0 0.58 0.00 0.00 0.94 0.58 Table 12: Large-scale, selective unlearning results with All-CNN for the Removing Biases (RB) application. SCRUB and NegGrad+ are the top-performers in terms of forgetting, though NegGrad+ has worse test performance than SCRUB in both cases. Note also that NegGrad+ isn't as consistent at forgetting across settings as SCRUB, as can be seen in Figure 2 model Retrain Original Finetune NegGrad+ CF-k EU-k Fisher NTK SCRUB Test error (↓) Retain error (↓) mean mean std std Forget error (↑) mean std IC test error (↓) mean std IC retain error (↓) mean std Fgt test error (↓) mean std Fgt retain error (↓) mean std 26.67 41.0 38.13 36.27 39.6 37.47 44.8 32.6 25.93 2.87 2.09 1.42 0.42 1.64 1.62 2.36 2.51 3.13 0.0 0.0 0.0 0.0 0.0 7.33 21.33 0.0 1.08 0.0 0.0 0.0 0.0 0.0 1.26 3.45 0.0 0.52 90.33 0.0 0.0 12.67 0.0 43.67 32.0 60.33 96.0 1.53 0.0 0.0 21.94 0.0 2.08 11.53 0.58 1.73 24.0 56.0 52.0 47.5 54.83 47.0 51.5 37.5 19.0 1.8 3.04 3.12 5.27 2.02 4.77 7.47 4.0 3.91 0.0 0.0 0.0 0.0 0.0 8.33 26.33 0.0 0.0 0.0 0.0 0.0 0.0 0.0 4.73 9.5 0.0 0.0 18.33 92.0 79.33 69.0 85.33 63.33 79.0 52.0 19.67 4.16 7.94 10.07 13.53 7.02 9.71 3.61 10.58 7.51 0.0 0.0 0.0 0.0 0.0 3.67 20.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.52 7.94 0.0 0.0 Table 13: Results on CIFAR-5 with ResNet for the Resolving Confusion (RC) application. (Confused class 0,1; 50-50 samples). SCRUB is the best-performer by far in terms of eliminating the confusion via unlearning (see the IC error and Fgt error columns), while not hurting performance for other classes (see e.g. the usual Error metrics in the first 3 groups of columns). 15 Additional Results for Resolving Confusion (RC) We show the full results are in Tables 13, 14, 15, 16, 17, 18, 19, 20 for all settings. We observe that across the board, SCRUB is a top-performer on this metric too (see the captions of the individual tables for more details about performance profile). 16 Additional results for User Privacy (UP) We present Basic MIA results for all settings in Tables 21, 22, 23, 24, 25, 26, 27, 28. We find that SCRUB, especially equipped with its rewinding procedure, is able to consistently have a strong defense against MIAs. model Retrain Original Finetune NegGrad+ CF-k EU-k Fisher NTK SCRUB Test error (↓) Retain error (↓) mean 24.4 mean 0.0 std 2.75 std 0.0 Forget error (↑) mean 90.67 std 4.04 IC test error (↓) mean 19.0 std 1.32 IC retain error (↓) mean 0.0 std 0.0 Fgt test error (↓) mean 11.33 std 4.62 Fgt retain error (↓) mean 0.0 std 0.0 37.07 34.33 33.53 36.13 51.6 51.93 32.2 25.0 4.67 3.35 4.47 4.21 1.0 2.95 2.84 3.14 1.5 0.0 0.0 0.0 27.67 35.17 0.75 0.0 2.6 0.0 0.0 0.0 3.5 3.92 1.3 0.0 5.67 3.0 13.33 0.33 52.67 31.0 43.33 93.33 9.81 5.2 21.36 0.58 6.03 11.53 14.15 2.52 49.0 43.67 42.33 47.83 59.5 56.83 36.67 26.0 4.77 7.29 11.34 5.8 5.22 8.69 4.07 4.44 6.0 0.0 0.0 0.0 38.33 31.67 3.0 0.0 10.39 0.0 0.0 0.0 6.66 14.01 5.2 0.0 80.67 67.33 62.0 76.33 68.67 78.33 54.33 18.0 12.58 16.04 22.65 14.43 15.57 15.53 9.02 11.14 6.0 0.0 0.0 0.0 19.67 17.67 3.0 0.0 10.39 0.0 0.0 0.0 10.41 11.5 5.2 0.0 Table 14: Results on CIFAR-5 with All-CNN for the Resolving Confusion (RC) application. (Confused class 0,1; 50-50 samples). SCRUB is the best-performer by far in terms of eliminating the confusion via unlearning (see the IC error and Fgt error columns), while not hurting performance for other classes (see e.g. the usual Error metrics in the first 3 groups of columns). 27 model Test error (↓) Retain error (↓) mean mean std std Forget error (↑) mean std IC test error (↓) mean std IC retain error (↓) mean std Fgt test error (↓) mean std Fgt retain error (↓) mean std Retrain 6.0 Original Finetune NegGrad+ CF-k EU-k Fisher NTK SCRUB 27.07 18.8 17.8 22.27 15.27 35.87 14.53 8.47 0.2 3.33 4.26 2.95 4.31 3.19 3.33 5.22 1.17 0.0 1.67 0.0 1.67 0.08 0.83 17.75 0.0 0.33 0.0 0.88 0.0 0.72 0.14 0.38 3.78 0.0 0.14 99.67 4.33 14.67 55.33 10.67 62.0 27.33 51.67 96.0 0.58 1.53 6.03 2.08 5.03 12.49 3.79 23.18 1.0 7.17 57.5 37.67 33.17 46.33 29.33 60.0 27.17 11.33 2.57 6.26 11.15 5.25 10.97 9.0 5.27 11.3 3.82 0.0 6.67 0.0 5.33 0.33 2.33 31.0 0.0 1.33 0.0 3.51 0.0 1.53 0.58 1.53 7.94 0.0 0.58 0.0 108.0 63.67 56.67 81.67 43.67 109.0 43.33 9.33 0.0 14.18 22.01 12.9 23.01 16.29 14.53 25.32 1.53 0.0 6.67 0.0 4.33 0.33 0.33 30.0 0.0 1.33 0.0 3.51 0.0 1.53 0.58 0.58 7.0 0.0 0.58 Table 15: Results on Lacuna-5 with ResNet for the Resolving Confusion (RC) application. (Confused class 0,1; 50-50 samples). SCRUB is the best-performer by far in terms of eliminating the confusion via unlearning (see the IC error and Fgt error columns), while not hurting performance for other classes (see e.g. the usual Error metrics in the first 3 groups of columns). NTK in some cases is able to resolve confusion, but not consistently, and it also suffers from higher Test Error. model Test error (↓) Retain error (↓) mean mean std std Forget error (↑) mean std IC test error (↓) mean std IC retain error (↓) mean std Fgt test error (↓) mean std Fgt retain error (↓) mean std Retrain 4.2 Original Finetune NegGrad+ CF-k EU-k Fisher NTK SCRUB 25.47 12.8 12.8 21.27 17.0 49.6 12.87 3.87 0.87 2.32 2.8 9.06 1.63 8.91 4.73 6.63 0.7 0.0 5.75 0.0 2.5 0.58 3.92 39.25 2.83 0.0 0.0 5.63 0.0 3.12 0.8 3.99 7.45 4.91 0.0 100.0 20.33 23.0 90.0 9.33 92.33 40.0 72.33 100.0 0.0 25.74 7.94 6.56 0.58 4.93 9.54 12.06 0.0 5.33 56.17 25.83 20.33 47.0 35.0 57.67 25.5 4.33 2.25 4.93 7.75 17.04 4.58 18.26 10.79 17.88 1.26 0.0 23.0 0.0 5.0 2.33 13.0 42.33 11.33 0.0 0.0 22.54 0.0 6.24 3.21 11.36 11.59 19.63 0.0 0.0 105.67 39.67 12.67 82.67 3.67 88.67 35.67 0.0 0.0 8.08 12.74 11.68 10.12 4.73 11.68 24.03 0.0 0.0 23.0 0.0 2.67 2.33 0.0 29.67 10.0 0.0 0.0 22.54 0.0 3.79 3.21 0.0 16.86 17.32 0.0 Table 16: Results on Lacuna-5 with All-CNN for the Resolving Confusion (RC) application. (Confused class 0,1; 50-50 samples). SCRUB is the best-performer by far in terms of eliminating the confusion via unlearning (see the IC error and Fgt error columns), while not hurting performance for other classes (see e.g. the usual Error metrics in the first 3 groups of columns). model retrain original finetune NegGrad+ CF-k EU-k SCRUB Test error (↓) Retain error (↓) std mean mean std Forget error (↑) mean std IC test error (↓) mean std IC retain error (↓) mean std Fgt test error (↓) mean std Fgt retain error (↓) mean std 18.7 21.86 20.85 23.41 20.93 20.03 18.01 0.07 0.37 0.37 0.32 0.38 0.19 0.18 0.0 0.0 0.0 3.87 0.0 0.25 0.02 0.0 0.0 0.0 0.31 0.0 0.08 0.01 98.57 0.0 0.0 80.07 0.0 95.55 95.45 0.28 0.0 0.0 6.77 0.0 0.54 0.26 14.78 31.23 26.75 41.08 27.27 17.85 15.07 0.18 0.45 0.48 0.6 0.76 0.67 0.99 0.0 0.0 0.0 20.29 0.0 0.18 0.04 0.0 0.0 0.0 1.52 0.0 0.03 0.03 31.33 356.0 255.0 46.0 267.33 53.0 30.33 2.08 11.53 10.58 8.72 16.17 7.94 3.79 0.0 0.0 0.0 0.67 0.0 3.33 0.33 0.0 0.0 0.0 1.15 0.0 2.31 0.58 Table 17: Results on CIFAR-10 with ResNet for the Resolving Confusion (RC) application. (Con- fused class 0,1; 2000-2000 samples). model retrain original finetune NegGrad+ CF-k EU-k SCRUB Test error (↓) Retain error (↓) std mean mean std Forget error (↑) mean std IC test error (↓) mean std IC retain error (↓) mean std Fgt test error (↓) mean std Fgt retain error (↓) mean std 16.43 19.95 18.72 21.74 19.31 17.66 15.92 0.03 0.23 0.11 0.44 0.23 0.23 0.17 0.0 0.0 0.0 4.48 0.0 1.36 0.2 0.0 0.0 0.0 0.34 0.0 0.19 0.06 98.42 0.0 1.05 87.65 0.0 87.9 87.47 0.15 0.0 0.61 2.98 0.0 1.28 1.46 14.37 30.18 24.33 40.05 27.45 16.82 14.98 0.24 0.66 0.2 0.44 0.61 0.79 0.13 0.0 0.0 0.0 21.8 0.0 2.89 0.39 0.0 0.0 0.0 0.66 0.0 0.46 0.15 23.67 348.67 223.67 44.0 294.0 63.67 54.0 2.31 13.58 6.66 5.2 4.36 8.62 3.61 0.0 0.0 0.0 2.33 0.0 91.67 9.67 0.0 0.0 0.0 3.21 0.0 12.58 2.52 Table 18: Results on CIFAR-10 with All-CNN for the Resolving Confusion (RC) application. (Confused class 0,1; 2000-2000 samples). 28 model retrain original finetune NegGrad+ CF-k EU-k SCRUB Test error (↓) Retain error (↓) mean mean std std Forget error (↑) mean std IC test error (↓) mean std IC retain error (↓) mean std Fgt test error (↓) mean std Fgt retain error (↓) mean std 2.43 7.37 4.17 5.63 5.4 3.0 3.07 0.32 0.31 0.5 0.38 0.4 0.26 0.59 0.0 1.21 0.0 0.31 0.07 0.0 0.0 0.0 0.12 0.0 0.22 0.06 0.0 0.0 99.83 15.83 56.83 71.33 33.83 90.17 98.5 0.29 4.19 9.44 9.88 3.33 4.65 0.5 3.33 27.67 11.17 19.33 17.33 6.0 6.83 0.58 1.26 1.76 1.04 1.76 1.8 1.26 0.0 8.26 0.0 2.12 0.45 0.0 0.0 0.0 0.8 0.0 1.51 0.39 0.0 0.0 0.0 46.0 15.67 8.33 27.67 2.0 0.67 0.0 4.36 3.51 2.31 3.51 2.65 0.58 0.0 36.33 0.0 0.0 2.0 0.0 0.0 0.0 3.51 0.0 0.0 1.73 0.0 0.0 Table 19: Results on Lacuna-10 with ResNet for the Resolving Confusion (RC) application. (Con- fused class 0,1; 200-200 samples). model retrain original finetune NegGrad+ CF-k EU-k SCRUB Test error (↓) Retain error (↓) mean mean std std Forget error (↑) mean std IC test error (↓) mean std IC retain error (↓) mean std Fgt test error (↓) mean std Fgt retain error (↓) mean std 2.13 7.83 3.0 4.3 5.27 2.53 2.1 0.25 0.55 0.7 0.52 0.47 0.67 0.4 0.0 1.21 0.0 0.4 0.11 0.09 0.0 0.0 0.52 0.0 0.06 0.07 0.02 0.0 99.83 16.0 74.5 89.67 33.33 97.83 97.5 0.29 4.92 6.08 4.25 1.61 2.08 1.73 2.5 31.33 6.5 15.33 18.5 5.17 4.17 1.32 1.76 2.0 2.47 2.29 1.04 0.58 0.0 8.26 0.0 2.73 0.76 0.38 0.0 0.0 3.53 0.0 0.39 0.47 0.35 0.0 0.0 56.33 9.0 4.67 31.33 0.33 0.33 0.0 3.79 3.0 3.21 3.51 0.58 0.58 0.0 36.33 0.0 0.0 3.33 0.67 0.0 0.0 15.53 0.0 0.0 2.08 0.58 0.0 Table 20: Results on Lacuna-10 with All-CNN for the Resolving Confusion (RC) application. (Confused class 0,1; 200-200 samples). method Retrain Test error Forget error Retain error MIA mean 16.71 std mean 26.67 0.05 std mean 0.00 3.09 std mean 51.33 0.00 Original Finetune NegGrad+ CF-k EU-k Bad-T SCRUB 16.71 16.86 21.65 16.82 18.44 22.43 17.01 SCRUB+R 16.88 0.07 0.13 0.40 0.03 0.21 0.37 0.20 0.19 0.00 0.00 47.00 0.00 0.33 1.67 33.00 26.33 0.00 0.00 3.74 0.00 0.47 1.25 5.89 4.50 0.00 0.00 4.54 0.00 0.32 10.13 0.00 0.00 0.00 0.00 0.70 0.00 0.02 0.15 0.00 0.00 68.67 69.33 73.00 69.67 66.00 77.67 51.00 49.33 std 6.13 3.09 2.05 1.41 1.89 2.94 4.11 1.41 2.49 Table 21: Basic MIA for All-CNN architecture on CIFAR-10 for selective unlearning, for the User Privacy (UP) application. Retain error MIA method Retrain Test error std 0.07 mean 13.98 Forget error mean 100.00 std mean 0.00 0.00 Original Finetune NegGrad+ CF-k EU-k Bad-T SCRUB 15.70 14.53 17.04 15.72 15.76 16.98 14.93 SCRUB+R 14.93 0.09 0.13 0.11 0.06 0.28 0.40 0.17 0.17 0.00 1.31 59.91 0.00 100.00 81.93 100.00 100.00 0.00 0.54 1.53 0.00 0.00 3.50 0.00 0.00 0.00 0.00 0.43 0.00 0.24 5.84 0.09 0.09 std mean 48.73 0.00 0.00 0.00 0.09 0.00 0.02 0.43 0.02 0.02 71.40 74.97 70.03 72.93 51.60 58.07 54.30 54.30 std 0.24 0.70 1.27 1.92 1.06 1.22 1.76 2.24 2.24 Table 22: Basic MIA for All-CNN architecture on CIFAR-10 for class unlearning, for the User Privacy (UP) application. 29 std 1.63 0.47 0.82 1.70 0.00 3.27 4.19 2.45 1.89 std 1.67 0.67 0.69 1.19 0.34 2.27 0.31 1.71 1.71 method Retrain Test error std mean 29.33 0.15 Forget error std 2.49 Retain error mean 0.00 std mean 54.00 0.00 MIA mean 17.38 Original Finetune NegGrad+ CF-k EU-k Bad-T SCRUB 17.41 17.48 21.69 17.53 19.77 23.47 17.01 SCRUB+R 17.54 0.15 0.16 0.07 0.19 0.04 1.57 0.03 0.28 0.00 0.00 45.33 0.00 13.67 34.67 71.67 19.33 0.00 0.00 2.62 0.00 0.47 1.70 0.94 14.64 0.00 0.00 3.94 0.00 0.06 14.53 0.01 0.01 0.00 0.00 0.43 0.00 0.01 1.65 0.01 0.01 65.33 64.00 66.67 65.00 53.00 59.67 78.00 58.67 Table 23: Basic MIA for ResNet architecture on CIFAR-10 for selective unlearning, for the User Privacy (UP) application. method Retrain Test error std 0.10 mean 14.69 Original Finetune NegGrad+ CF-k EU-k Bad-T SCRUB 16.33 15.10 17.41 15.29 17.05 19.56 15.33 SCRUB+R 15.33 0.14 0.16 0.09 0.02 0.07 1.44 0.06 0.06 Retain error MIA Forget error mean 100.00 std mean 0.00 0.00 std mean 49.33 0.00 0.00 0.33 61.00 0.04 97.48 11.34 100.00 100.00 0.00 0.17 1.14 0.04 0.28 1.82 0.00 0.00 0.00 0.00 0.44 0.00 0.05 94.67 0.08 0.08 0.00 0.00 0.05 0.00 0.01 6.12 0.01 0.01 71.10 75.57 69.57 75.73 54.20 54.33 52.20 52.20 Table 24: Basic MIA for ResNet architecture on CIFAR-10 for class unlearning, for the User Privacy (UP) application. method Retrain Original Finetune NegGrad+ CF-k EU-k Bad-T SCRUB SCRUB+R Test error Forget error Retain error MIA mean 1.50 std mean 0.33 0.08 std mean 0.00 0.47 std mean 52.00 0.00 1.57 1.40 3.60 1.57 3.90 4.90 1.67 1.67 0.24 0.16 0.14 0.12 1.47 2.10 0.19 0.19 0.00 0.00 14.33 0.00 0.00 1.34 0.00 0.00 0.00 0.00 1.25 0.00 0.00 1.20 0.00 0.00 0.00 0.00 0.87 0.00 0.76 0.67 0.00 0.00 0.00 0.00 0.07 0.00 0.63 0.94 0.00 0.00 59.00 57.33 51.00 58.33 52.00 67.67 57.67 57.67 std 2.16 2.16 3.30 1.63 2.49 3.56 6.94 0.94 0.94 Table 25: Basic MIA for All-CNN architecture on Lacuna-10 for selective unlearning, for the User Privacy (UP) application. 30 method Retrain Original Finetune NegGrad+ CF-k EU-k Bad-T SCRUB SCRUB+R Test error std 0.09 mean 1.67 Forget error std mean 0.00 100.00 1.70 1.67 2.00 2.07 4.15 2.56 1.96 1.96 0.21 0.27 0.00 0.14 1.22 0.09 0.34 0.34 0.00 0.00 14.27 0.00 62.08 38.65 100.00 100.00 0.00 0.00 0.74 0.00 44.26 36.80 0.00 0.00 Retain error mean 0.00 std mean 55.67 0.00 MIA 0.00 0.00 0.00 0.00 0.81 0.37 0.00 0.00 0.00 0.00 0.00 0.00 0.53 0.18 0.00 0.00 58.00 56.33 54.33 52.33 52.67 63.33 50.33 50.33 std 2.62 1.63 1.25 2.05 2.05 3.68 2.49 2.62 2.62 Table 26: Basic MIA for All-CNN architecture on Lacuna-10 for class unlearning, for the User Privacy (UP) application. method Retrain Original Finetune NegGrad+ CF-k EU-k Bad-T SCRUB SCRUB+R Test error Forget error Retain error MIA mean 2.50 std mean 1.67 0.24 std mean 0.00 0.94 std mean 49.67 0.00 2.53 2.67 4.30 2.47 2.60 7.30 2.97 2.97 0.25 0.05 0.43 0.25 0.00 2.20 0.25 0.25 0.00 0.00 12.67 0.00 0.00 3.26 6.00 6.00 0.00 0.00 3.30 0.00 0.00 1.83 3.27 3.27 0.00 0.00 0.95 0.00 0.03 0.33 0.00 0.00 0.00 0.00 0.08 0.00 0.00 0.47 0.00 0.00 56.67 53.67 54.00 56.00 56.00 67.33 50.67 50.67 std 3.09 1.70 0.94 2.16 0.82 2.83 3.40 4.03 4.03 Table 27: Basic MIA for ResNet architecture on Lacuna-10 for selective unlearning, for the User Privacy (UP) application. method Retrain Original Finetune NegGrad+ CF-k EU-k Bad-T SCRUB SCRUB+R Test error std 0.19 mean 2.52 Forget error std mean 0.00 100.00 Retain error mean 0.00 std mean 55.00 0.00 MIA 2.81 3.04 2.74 2.81 2.48 3.37 3.26 3.26 0.28 0.19 0.26 0.28 0.14 0.50 0.38 0.38 0.00 0.00 9.48 0.00 7.71 67.60 99.90 99.90 0.00 0.00 0.64 0.00 2.52 24.26 0.15 0.15 0.00 0.00 0.00 0.00 0.00 1.06 0.07 0.07 0.00 0.00 0.00 0.00 0.00 0.47 0.05 0.05 56.00 54.67 53.67 56.00 54.33 58.00 54.33 54.33 std 2.94 2.45 1.25 4.03 2.45 3.09 2.94 2.49 2.49 Table 28: Basic MIA for ResNet architecture on Lacuna-10 for class unlearning, for the User Privacy (UP) application. 31
http://arxiv.org/abs/2302.09875v2
2023-02-28T00:51:47
2023-02-20T10:06:49
Backstepping Temporal Difference Learning
Off-policy learning ability is an important feature of reinforcement learning (RL) for practical applications. However, even one of the most elementary RL algorithms, temporal-difference (TD) learning, is known to suffer form divergence issue when the off-policy scheme is used together with linear function approximation. To overcome the divergent behavior, several off-policy TD-learning algorithms, including gradient-TD learning (GTD), and TD-learning with correction (TDC), have been developed until now. In this work, we provide a unified view of such algorithms from a purely control-theoretic perspective, and propose a new convergent algorithm. Our method relies on the backstepping technique, which is widely used in nonlinear control theory. Finally, convergence of the proposed algorithm is experimentally verified in environments where the standard TD-learning is known to be unstable.
[ "Han-Dong Lim", "Donghwan Lee" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09875v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09875v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
3 2 0 2 b e F 8 2 ] G L . s c [ 2 v 5 7 8 9 0 . 2 0 3 2 : v i X r a BACKSTEPPING TEMPORAL DIFFERENCE LEARNING Han-Dong Lim Department of Electrical Engineering KAIST, Daejeon, 34141, South Korea [email protected] Donghwan Lee Department of Electrical Engineering KAIST, Daejeon, 34141, South Korea [email protected] ABSTRACT Off-policy learning ability is an important feature of reinforcement learning (RL) for practical applications. However, even one of the most elementary RL algo- rithms, temporal-difference (TD) learning, is known to suffer form divergence issue when the off-policy scheme is used together with linear function approxi- mation. To overcome the divergent behavior, several off-policy TD-learning al- gorithms, including gradient-TD learning (GTD), and TD-learning with correc- tion (TDC), have been developed until now. In this work, we provide a unified view of such algorithms from a purely control-theoretic perspective, and propose a new convergent algorithm. Our method relies on the backstepping technique, which is widely used in nonlinear control theory. Finally, convergence of the pro- posed algorithm is experimentally verified in environments where the standard TD-learning is known to be unstable. 1 INTRODUCTION Since Mnih et al. (2015), which has demonstrated that deep reinforcement learning (RL) outper- forms human in several video games (Atari 2600 games), significant advances has been made in RL theory and algorithms. For instance, Van Hasselt et al. (2016); Lan et al. (2020); Chen et al. (2021) proposed some variants of the so-called deep Q-network (Mnih et al., 2015) that achieves higher scores in Atari games than the original deep Q-network. An improved deep RL was devel- oped in Badia et al. (2020) that performs better than average human scores across 57 Atari games. Not only performing well in video games, but Schrittwieser et al. (2020) also have shown that an RL agent can self-learn chess, Go, and Shogi. Furthermore, RL has shown great success in real world applications, e.g., robotics (Kober et al., 2013), healthcare (Gottesman et al., 2019), and recommen- dation systems (Chen et al., 2019). Despite the practical success of deep RL, there is still a gap between theory and practice. One of the notorious phenomena is the deadly triad (Sutton & Barto, 2018), the diverging issue of the algorithm when function approximation, off-policy learning, and bootstrapping are used together. One of the most fundamental algorithms, the so-called temporal-difference (TD) learning (Sutton, 1988), is known to diverge under the deadly triad, and several works have tried to fix this issue for decades. In particular, the seminar works Sutton et al. (2008; 2009) introduced the so-called GTD, gradient-TD2 (GTD2), and TDC, which are off-policy, and have been proved to be convergent with linear function approximation. More recently, Ghiassian et al. (2020) suggested regularized version of TDC called TD learning with regularized correction (TDRC), and showed its favorable features under off-policy settings. Moreover, Lee et al. (2021) developed several variants of GTD based on primal dual formulation. On the other hand, backstepping control (Khalil, 2015) is a popular method in designing stable controllers for nonlinear systems with special structures. The design technique offers a wide range of stable controllers, and is proved to be robust under various settings. It has been used in various fields including quadrotor helicopters (Madani & Benallegue, 2006), mobile robots (Fierro & Lewis, 1997), and ship control (Fossen & Strand, 1999). Using backstepping control technique, in this paper, we develop a new convergent off-policy TD-learning which is a single time-scale algorithm. In particular, the goal of this paper is to introduce a new unifying framework to design off-policy TD- learning algorithms under linear function approximation. The main contributions are summarized as follows: 1 • We propose a systemic way to generate off-policy TD-learning algorithms including GTD2 and TDC from control theoretic perspective. • Using our framework, we derive a new TD-learning algorithm, which we call backstepping TD (BTD). • We experimentally verify its convergence and performance under various settings including where off-policy TD has known to be unstable. In particular, most of the previous works on off-policy TD-learning algorithms (e.g., GTD2 and TDC) are derived based on optimization perspectives starting with an objective function. Then, the convergence is proved by proving stability of the corresponding O.D.E. models. In this paper, we follow reversed steps, and reveal that an off-policy TD-learning algorithm (called backstepping TD) can be derived based on control theoretic motivations. In particular, we develop stable O.D.E. models first using the backstepping technique, and then recover back the corresponding off-policy TD-learning algorithms. The new analysis reveals connections between off-policy TD-learning and notions in control theory, and provides additional insights on off-policy TD-learning with simple concepts in control theory. This sound theoretical foundation established in this paper can potentially motivate further analysis and developments of new algorithms. Finally, we briefly summarize TD learning algorithms that guarantee convergence under linear func- tion approximation. GTD (Sutton et al., 2008), GTD2 and TDC (Sutton et al., 2009) have been de- veloped to approximate gradient on mean squared projected Belllman error. Later, GTD and GTD2 has been discovered to solve minimax optimization problem (Macua et al., 2014; Liu et al., 2020). Such sadde-point view point of GTD has led to many interesting results including Du et al. (2017); Dai et al. (2018); Lee et al. (2021). TDRC (Ghiassian et al., 2020) adds an additional term similar to regularization term to one-side of parameter update, and tries to balance between the performance of TD and stability of TDC. TDC++ (Ghiassian et al., 2020) also adds an additional regularization term on both sides of the parameter update. Even though TDRC shows good performance, it uses additional parameter condition to ensure convergence, whereas TDC++ does not. 2 PRELIMINARIES 2.1 NONLINEAR SYSTEM THEORY Nonlinear system theory will play an important role throughout this paper. Here, we briefly review basics of nonlinear systems. Let us consider the continuous-time nonlinear system x0 ∈ Rn, ̇xt = f (xt, ut), (1) where x0 ∈ Rn is the initial state, t ∈ R, t ≥ 0 is the time, xt ∈ Rn is the state, ut ∈ Rn is the control input, and f : Rn × Rn → Rn is a nonlinear mapping. An important concept in dealing with nonlinear systems is the equilibrium point. Considering the state-feedback law ut = μ(xt), the system can be written as ̇xt = f (xt, ut) = f (xt, μ(xt)) =: f (xt), and a point x = xe in the state-space is said to be an equilibrium point of (1) if it has the property that whenever the state of the system starts at xe, it will remain at xe (Khalil, 2015). For ̇xt = f (xt), the equilibrium points are the real roots of the equation f (x) = 0. The equilibrium point xe is said to be globally asymptotically stable if for any initial state x0 ∈ Rn, xt → xe as t → ∞. An important control design problem is to construct a state-feedback law ut = μ(xt) such that the origin becomes the globally asymptotically stable equilibrium point of (1). To design a state- feedback law to meet such a goal, control Lyapunov function plays a central role, which is defined in the following definition. Definition 2.1 (Control Lyapunov function (Sontag, 2013)). A positive definite function V : Rn → R is called a control Lyapunov function (CLF) if for all x (cid:54)= 0, there exists a corresponding control input u ∈ Rm that satisfies the inequality, ∇xV (x)(cid:62)f (x, u) < 0 for all x (cid:54)= 0. Once such a CLF is found, then it guarantees that there exists the control law that stabilizes the system. Moreover, the corresponding state-feedback control law can be extracted from the CLF, e.g., μ(x) = arg minu ∇xV (x)(cid:62)f (x, u) provided that the minimum exists and unique. The concept of control Lyapunov function will be used in the derivations of our main results. For the autonomous 2 system, ̇xt = f (xt), and Lypaunov function V : Rn → R, Lie derivative is defined as Lf V (x) := ∇xV (x)(cid:62)f (x) so that ̇V (xt) = Lf V (xt) along the solution. 2.2 STOCHASTIC APPROXIMATION AND O.D.E. APPROACH Including Q-learning (Watkins & Dayan, 1992) and TD-learning (Sutton, 1988), reinforcement learning algorithms can be considered as stochastic approximation (Robbins & Monro, 1951) de- scribed by xk+1 = xk + αk(f (xk) + (cid:15)k), (2) where f : Rn → Rn is a nonlinear mapping, and (cid:15)k is an i.i.d. noise. Borkar and Meyn the- orem (Borkar & Meyn, 2000) is a well-known method to bridge the asymptotic convergence of stochastic approximation and the stability of its corresponding O.D.E. model, which can be ex- pressed as ̇xt = f (xt), x0 ∈ Rn, (3) where x0 ∈ Rn is initial state, and t ∈ R, t ≥ 0 is the time. Borkar and Meyn theorem (Borkar & Meyn, 2000) states that under the conditions in Assumption 7.1 in the Appendix, global asymptotic stability of the O.D.E. (3) leads to asymptotic convergence of the stochastic approximation update (2), which is formally stated in the following lemma. Lemma 2.1 (Borkar and Meyn theorem (Borkar & Meyn, 2000)). Suppose that Assumption 7.1 in the Appendix holds, and consider the stochastic approximation in (2). Then, for any initial x0 ∈ Rn, supk≥0 ||xk|| < ∞ with probability one. In addition , xk → xe as k → ∞ with probability one, where xe is the unique equilibrium point of the O.D.E. in (3). The main idea of Borkar and Meyn theorem is as follows: iterations of a stochastic recursive al- gorithm follow the solution of its corresponding O.D.E. in the limit when the step-size satisfies the so-called Robbins-Monro condition (Robbins & Monro, 1951) in (33) in the Appendix. Therefore, by proving asymptotic stability of the O.D.E., we can induce convergence of the original algorithm. In this paper, we will use an O.D.E. model of TD-learning, which is expressed as a linear time- invariant system. 2.3 BACKSTEPPING CONTROL This section provides the concept of the backstepping control (Kokotovic, 1992; Khalil, 2015), which will be the main tool in this paper to derive TD-learning algorithms. The backstepping tech- nique is a popular tool for generating a CLF (control Lyapunov function) for nonlinear systems with specific structures. In particular, let us start with the following general nonlinear system: ̇yt = f (yt) + g(yt)xt ̇xt = ut, (4) where yt ∈ Rm, xt ∈ Rm are the states, ut ∈ Rm is the input, and f : Rm → Rm and g : Rm → R are continuous functions. The first system is a nonlinear system with a particular affine structure, and the second system is simply an integrator. It can be seen as a cascade interconnection of two systems, where the second system's state is injected to the input of the first system. The backstepping control technique gives us a systematic way to generate a CLF for such particular nonlinear systems provided that the first system admits a CLF independently. To this end, we suppose that the first system admits a CLF. Through the backstepping approach, designing a stable control law for the above system can be summarized in the following steps: Step 1. Consider xt in (4) as virtual input ̃x(yt) (state-feedback controller), and consider the fol- lowing system: ̇λt = f (yt) + g(yt) ̃x(yt). Design ̃x(yt) such that the above system admits a CLF V , i.e., it admits a positive definite and radially unbounded function V such that its time derivative is negative definite, i.e., ̇V (yt) < 0, ∀yt (cid:54)= 0. Step 2. Denote the error between the virtual state-feedback controller ̃x(yt) and state variable xt as zt := xt − ̃x(yt). Now, rewrite the original O.D.E. in (4) with the new variable (yt, zt): (cid:21) (cid:20)yt zt d dt = (cid:20)f (yt) + g(yt) ̃x(yt) + g(yt)zt ut − ̇ ̃x(yt) (cid:21) 3 Step 3. Design the control input ut such that the above system is stable. One popular choice is to consider the CLF Vc(yt, zt) := V (yt) + ||zt||2/2, where V (yt) is defined in Step 1. Then choose ut such that the time derivative of Vc(yt, zt) to be negative definite. A simple example of designing stabilizing control law by backstepping technique is given in Ap- pendix Section 7.3. 2.4 MARKOV DECISION PROCESS In this paper, we consider a Markov decision process (MDP) characterized by the tuple (S, A, P, γ, r), where S := {1, 2, . . . , |S|} stands for the set of finite state space, |S| denotes the size of S, A := {1, 2, . . . , |A|} denotes the set of finite action space, |A| is the size of A, γ ∈ (0, 1) is the discount factor, P : S × A × S → [0, 1] denotes the Markov transition kernel, and r : S × A × S → R means the reward function. In particular, if an agent at state s ∈ S, takes action a ∈ A, then the current state transits to the next state s(cid:48) ∈ S with probability P(s, a, s(cid:48)), and the agent receives reward r(s, a, s(cid:48)). Each element of the state to state transition matrix under policy π, denoted by P π ∈ R|S|×|S| is [P π]ij := (cid:80) 1 ≤ i, j ≤ |S|, where [P π]ij corresponds to i-th row and j-th column element of matrix P π. Moreover, the stationary state distribution induced by policy μ, is denoted as dμ : S → [0, 1], i.e., dμ(cid:62)P μ = dμ(cid:62). With the above setup, we define the following matrix notations: π(a|i)P(i, a, j), a∈A  dμ(1) Dμ :=   . . .   ∈ R|S|×|S|, Rπ =  dμ(|S|)     Ea∼π[r(s, a, s(cid:48))|s = 1] Ea∼π[r(s, a, s(cid:48))|s = 2] ... Ea∼π[r(s, a, s(cid:48))|s = |S|]     ∈ R|S|, k=0 γkr(Sk, Ak, Sk+1)(cid:12) where Dμ is a diagonal matrix of the state distribution induced by behavior policy μ, each element of Rπ is the expected reward under policy π at the corresponding state. The pol- icy evaluation problem aims to approximate the value function at state s ∈ S, vπ(s) := E (cid:2) (cid:80)∞ (cid:12) S0 = s, π(cid:3), where the trajectory is generated under policy π : S × A → [0, 1]. In this paper, we consider the linear function approximation to approximate the value function vπ(s). In particular, we parameterize the value function vπ(s) with φ(cid:62)(s)ξ, where φ : S → Rn is a pre-selected feature vector with φ(s) := [φ1(s) * * * φn(s)], φ1, . . . , φn : S → R are feature functions, and ξ ∈ Rn is the learning parameter. The goal of the policy evaluation problem is then to approximate the value function vπ(s) using this linear parameterization, i.e., φ(cid:62)(s)ξ ≈ vπ(s). Moreover, using the matrix notation Φ := [φ(1), φ(2), * * * , φ(|S|)](cid:62) ∈ R|S|×n, called the feature matrix, the linear parameterization can be written in the vector form Φξ. We also assume that Φ is full column rank matrix throughout the paper, which is a standard assumption (Sut- ton et al., 2008; 2009; Ghiassian et al., 2020; Lee et al., 2021). 2.5 TEMPORAL DIFFERENCE LEARNING k following s(cid:48) This section provides a brief background on TD-learning (Sutton, 1988). Suppose that we have access to stochastic samples of state sk from the state stationary distribution induced by the behav- ior policy μ, i.e., sk ∼ dμ(*), and action is chosen under behavior policy μ, i.e., ak ∼ μ(*|sk). Then, we observe the next state s(cid:48) k ∼ P(*, ak, sk), and receive the reward rk := r(sk, ak, s(cid:48) k). Using the simplified notations for the feature vectors φk := φ(sk), φ(cid:48) k). the TD-learning update at time step k with linear function approximation can be expressed as ξk+1 = ξk + αkρkδk(ξk)φk, where αk > 0 is the step-size, δk(ξk) := rk + γφ(cid:48)(cid:62) k ξk is called the temporal difference or temporal difference error (TD-error), and ρk := ρ(sk, ak) = π(ak|sk) μ(ak|sk) is called the importance sampling ratio (Precup et al., 2001). The importance sampling ratio re- weights the TD-error to handle the mismatch between the behavior policy μ and target policy π. It is known that TD-learning with linear function approximation and off-policy learning scheme does not guarantee convergence in general. The above stochastic approximation aims to find fixed point of the following projected Bellman equation, which is, after some manipulations, expressed as: k ξk − φ(cid:62) k = φ(s(cid:48) Φ(cid:62)DμΦξ∗ − γΦ(cid:62)DμP πΦξ∗ = Φ(cid:62)DμRπ. (5) 4 To simplify the expressions, let use introduce one more piece of notations: A := Es∼dμ(s),s(cid:48)∼P π(s(cid:48)|s)[φ(s)(φ(s) − γφ(s(cid:48)))(cid:62)] = Φ(cid:62)DμΦ − γDμP πΦ ∈ Rn×n, b := Es∼dμ(s),a∼π(a|s),s(cid:48)∼P (s(cid:48)|s,a)[r(s, a, s(cid:48))φ(s)] = Φ(cid:62)DμRπ ∈ Rn×1. Even though we can use arbitrary distribution, for simplicity we assume stationary distribution of μ. Now, we can rewrite (5) compactly as Aξ∗ = b. (6) The corresponding O.D.E. for TD-learning can be written as ̇ξt = Aξt − b, ξ0 ∈ Rn. Using the coordinate transform xk := ξk − ξ∗, we get the O.D.E. ̇xt = Axt, x0 ∈ Rn, whose origin is globally asymptotically stable equilibrium point if ρ(s, a) = π(a|s) μ(a|s) = 1 for all (s, a) ∈ S × A. Throughout the paper we will use the vector xk := ξk − ξ∗ to represent the coordinate transform of ξk to the origin, and will use ξt and xt to denote the corresponding continuous-time counterparts of ξk and xk, respectively. 2.6 GRADIENT TEMPORAL DIFFERENCE LEARNING To fix the instability issue of off-policy TD-learning under linear function approximation, Sutton et al. (2008) and Sutton et al. (2009) introduced various stable off-policy TD-learning algorithms, called GTD (gradient TD-learning), GTD2, and TDC (temporal difference correction). The idea be- hind these algorithms is to minimize the mean-square error of projected Bellman equation (MSPBE) x(cid:62)Dx, and the global min- minξ∈Rn imizer of MSPBE corresponds to the solution of (6). The core idea of the algorithms is to introduce an additional variable λk ∈ Rn to approximate the stochastic gradient descent method for MSPBE as an objective function. In particular, GTD2 update can be written as 2 ||Φ(cid:62)Dμ(Rπ +γP πΦξ−Φξ)||2 (Φ(cid:62)DμΦ)−1, where ||x||D := √ 1 λk+1 = λk + αk(−φ(cid:62) k λk + ρkδk(ξk))φk, ξk+1 = ξk + αk(φ(cid:62) k λkφk − ρkγφ(cid:62) k λkφ(cid:48) k). We denote λt to denote continuous time part of λk. Since the fixed point for λk is zero, it doesn't require coordinate transformation. It is a single time-scale algorithm because it uses a single step- size αk. The corresponding O.D.E. is expressed as ̇λt = −Cλt − Axt, ̇xt = A(cid:62)λt, where C := Es∼dμ(s)[φ(s)φ(cid:62)(s)] = Φ(cid:62)DμΦ ∈ Rn×n. Similarly, TDC update can be written as λk+1 = λk + αk(−φ(cid:62) ξk+1 = ξk + βk(−ρkγφ(cid:62) k λk + ρkδk(ξk))φk k λkφ(cid:48) k + ρkδk(ξk)φk), (7) (8) where the step-sizes, αk and βk, satisfy αk/βk → 0 as k → ∞ and the Robbins and Monro step-size condition (Robbins & Monro, 1951) in (33) in Appendix. It is a two time-scale algorithm because it uses two time-steps, αk and βk. 3 DESIGNING TD-LEARNING THROUGH BACKSTEPPING We briefly explain the motivation for our algorithmic development. Borkar and Meyn the- orem (Borkar & Meyn, 2000) in Lemma 2.1 is a typical tool to prove convergence of Q- learning (Borkar & Meyn, 2000; Lee & He, 2019) and TD-learning (Sutton et al., 2009; Lee et al., 2021). Most of the previous works on off-policy TD-learning algorithms (e.g., GTD2 and TDC) first start with an objective function, and then derive GTD algorithms based on optimization per- spectives. Then, the convergence is proved using the corresponding O.D.E. models and stability theory of linear time-invariant systems. A natural question arises is, can we derive off-policy TD- learning algorithms following a reversed step? In other words, can we develop a stable O.D.E. model first using tools in control theory, and then recover back the corresponding off-policy TD-learning algorithms? In this paper, we reveal that a class of off-policy TD-learning algorithms can be derived based on purely control theoretic motivations following such a reversed process. By doing so, this work provides additional insights on off-policy TD-learning algorithms and gives a sound theoretical foundation on off-policy TD-learning algorithms for further developments of new algorithms. 5 Designing stabilizing control laws for continuous-time nonlinear system has been successful over the past decades (Khalil, 2015). One such technique, so called backstepping, is a popular controller design method in non-linear control literature (Khalil, 2015). With the help of the backstepping method (Khalil, 2015), we design stabilizing control laws for continuous-time systems, and then the corresponding off-policy TD-learning algorithms are derived, and are shown to be convergent via Borkar and Meyn theorem (Borkar & Meyn, 2000) in Lemma 2.1. The brief procedure is explained in the following steps: Step 1) Choose an appropriate continuous-time dynamic model such that (a) we can recover the TD-fixed point ξ∗ in (6) via its equilibrium point; (b) the corresponding stochastic approximation algorithm can be implementable only through transitions of MDP and accessible data.; Step 2) Using the backstepping method, design a control input to stabilize the dynamic model chosen in Step 1). 3.1 BACKSTEPPING TD Now, we introduce a new off-policy TD-learning algorithm, which we call Backstepping TD (BTD). Firstly, we will develop a stabilizing control law for the following the continuous-time system: ̇λt = (−C + ηA)λt − Axt ̇xt = ut (9) (10) The idea stems from finding a control system for which we can easily apply the backstepping tech- inque. In details, the backstepping techinqiue can be applied to the two interconnected systems where one subsystem, namely (4), can be stabilized with xt in (4) as a control input. Therefore, our first aim is to find such a system. To this end, we can try a natural choice of O.D.E. to solve the TD problem, i.e., ̇λt = Aλt, which is however unstable in the off-policy case. Therefore, we can develop a modified O.D.E. ̇λt = (−C + ηA)λt − Axt, where xt is the control input, the neg- ative definite matrix −C is introduced to stabilize the system, and η > 0 is introduced to provide additional degrees of freedom in design. Now, the constructed system can be stabilized through the state-feedback controller xt = ηλt and admits the simple control Lypaunov function V (λ) = ||λ||2. Moreover, A should be included in the right-hand side in order to implement the corresponding algorithm without knowing the solution because xk = ξk − ξ∗ and ξ∗ should be removed using Aξ∗ = b in the final step. Simply setting xt = ηλt may cancel out A in the right-hand side, the O.D.E. becomes ̇λt = −Cλt, Therefore, as mentioned before, we can apply the backstepping tech- nique by adding an additional dynamic controller. As the next step, the backstepping technique is applied, and one needs to observe what would be the final form of the control system. In summary, if we consist f (λt) with the combination of A and −C (not necessarily −C, it may be −I) , it can be a reasonable candidate to apply the backstepping technique. Cancelling A with virtual input only leaves −C, which guarantees stability from its negative definiteness. Therefore, (9) and (10) is a reasonable candidate for the dynamics where we can apply the backstepping technique. In particular, our aim is to design an appropriate control input ut for the above system such that the origin is the unique asymptotically stable equilibrium point, i.e., (λt, xt) → 0 as t → ∞ for any (λ0, x0) ∈ Rn × Rn. The overall procedure is depicted in Figure 1 in the Appendix, and we show how to choose the control input ut in the following lemma. Lemma 3.1. Consider the O.D.E. in (9) and (10). If we choose the control input ut := (A(cid:62) +η2A− ηC)λt − ηAxt, then the above O.D.E. has globally asymptotically stable origin, i.e., (λt, xt) → (0, 0) as t → ∞ for any (λ0, x0) ∈ Rn × Rn. Proof sketch. The proof follows the steps given in the backstepping scheme in Section 3. First, substituting xt in (9) with a virtual controller ̃x(λt), we will design a control law ̃x(λt) that stabilizes the following new virtual system: ̇λt = (−C + ηA)λt − A ̃x(λt). (11) One natural choice of the virtual controller is ̃x(λt) = ηλt. Plugging it into (11) leads to ̇λt = −Cλt, and we can verify the global asymptotic stability of the above system with the following Lyapunov function: V (λt) := ||λt||2 2 2 . 6 (12) We now consider the original O.D.E. in (9) and (10). Applying simple algebraic manipulations yield ̇λt = −Cλt − A(xt − ηλt), ̇xt = ut. The error between xt and the virtual controller ̃x(λt) can be expressed as new variable zt, which is zt := xt − ̃x(λt) = xt − ηλt. Rewriting the O.D.E. in (9) and (10) with (λt, zt) coordinates, we have ̇λt = −Cλt − Azt ̇zt = ut + ηCλt + ηAzt. (13) To prove the global asymptotic stability of the above system, consider the function Vc(λt, zt) := V (λt)+ 1 2 where V (λt) is defined in (12). By taking ut as ut = A(cid:62)λt −ηCλt −ηAzt, we can apply LaSall'es invariance principle in Lemma 7.1. The full proof is in Appendix Section 7.4.1. 2 ||zt||2 Using the relation zt := xt − ηλt, the control input in the original coordinate (λt, xt) can be written as ut := A(cid:62)λt − ηCλt − ηAzt = (A(cid:62) + η2A − ηC)λt − ηAxt. Plugging this input into the original open-loop system in (9) and (10), the closed-loop system in the original coordinate (λt, xt) can written as ̇λt = (−C + ηA)λt − Axt ̇xt = (A(cid:62) + η2A − ηC)λt − ηAxt, (14) (15) whose origin is also globally asymptotically stable according to Lemma 3.1. Recovering back from xt to ξt, we have d dt (cid:20) −C + ηA −A A(cid:62) + η2A − ηC −ηA approximation of the O.D.E. in Theorem 3.1 becomes . The corresponding stochastic (cid:21) (cid:20)λt ξt (cid:20) b ηb (cid:20)λt ξt + = (cid:21) (cid:21) (cid:21) λk+1 = λk + αk(((−1 + η)φ(cid:62) ξk+1 = ξk + αk(((−η + η2)φ(cid:62) k − ηρkγφ(cid:48)(cid:62) k − η2ρkγφ(cid:48)(cid:62) k )λk + ρkδk(ξk))φk k )λkφk + ηρkδk(ξk)φk + (φ(cid:62) k λkφk − ρkγφ(cid:62) k λkφ(cid:48) (16) k)). (17) The equilibrium point of the above O.D.E. is (0, ξ∗). Hence, we only need to transform the coordi- nate of ξt to xt = ξt − ξ∗, which results to the O.D.E. in (14) and (15). With the above result, we are now ready to prove convergence of Algorithm 1. The proof simply follows from Borkar and Meyn theorem in Lemma 2.1, of which the details can be found in Sutton et al. (2009). Theorem 3.1. Under the step size condition (33) , with Algorithm 1 in Appendix, ξk → ξ∗ as k → ∞ with probability one, where ξ∗ is the fixed point of (6). Proof. The proof is done by checking Assumption 7.1 in Appendix. Remark 3.1. Theorem 3.1 doesn't require any condition on η. Therefore, we can set η = 0, which results to GTD2 developed in Sutton et al. (2009). 3.2 RECOVERING SINGLE TIME-SCALE TDC In this section, we derive a single-time scale version of TDC (Sutton et al., 2009) through the back- stepping design in the previous section. TDC (Sutton et al., 2009) was originally developed as a two-time scale algorithm in Sutton et al. (2009). Even though the two time-scale method provides theoretical guarantee for a larger class of algorithms, the single time-scale scheme provides more simplicity in practice, and shows faster convergence empirically. Subsequently, Maei (2011) pro- vided a single-time scale version of TDC by multiplying a large enough constant η > 0 to the faster time scale part (7), which leads to λk+1 = λk + βkη(−φ(cid:62) ξk+1 = ξk + βk(−ρkγφ(cid:62) k λk + ρkδk(ξk))φk k λkφ(cid:48) k + ρkδk(ξk)φk), where η > max (cid:8)0, −λmin (cid:0)C −1(A + A(cid:62))/2(cid:1)(cid:9) . 7 (18) (19) (20) Here, we derive another version of single-time TDC by multiplying a constant to the slower time- scale part in (8), which results in λk+1 = λk + αk(−φ(cid:62) ξk+1 = ξk + αkβ(φ(cid:62) k λk + ρkδk(ξk))φk k λkφ(cid:48) k λkφk − ρkγφ(cid:62) k + ρkδk(ξk)φk), where β satisfies 0 < β < − λmin(C) λmin(A) if λmin(A) < 0, else β > 0. (21) (22) (23) We can derive the above algorithm following similar steps as in Section 3.1. Let us first consider the following dynamic model: ̇λt = −Cλt − Axt ̇xt = ut (24) (25) Using the backstepping technique, we can prove that the above system admits the origin as a global asymptotically stable equilibrium point with the control input ut := β (cid:0)(A(cid:62) − C)λt − Aξt (cid:1), which is shown in the following lemma: Lemma 3.2. Consider the O.D.E. in (24) and (25). Suppose that we choose the control input ut := β (cid:0)(A(cid:62) − C)λt − Aξt (cid:1)), and β satisfies condition (23). Then, the above O.D.E. has globally asymptotically stable origin, i.e., (λt, xt) → (0, 0) as t → ∞. The proof of Lemma 3.2 is given in Appendix Section 7.4.2. By Borkar and Meyn theorem in Lemma 2.1, we can readily prove the convergence of Algorithm 2 in Appendix, which uses stochastic recursive update (21) and (22). Theorem 3.2. Consider Algorithm 2 in Appendix. Under the step size condition (33), and if β satisfies (23), ξk → ξ∗ as k → ∞ with probability one, where ξ∗ is the fixed point of (6). We will call the Algorithm 4 as TDC-slow, and single-time version of TDC suggested by Maei (2011) as TDC-fast. Other than the multiplication of a constant reflecting two-time scale property, we can make TDC into a single-time algorithm, which we call a single time-scale TDC2, while the original version in Maei (2011) will be called the single time-scale TDC. The derivation is given in Appendix Section 7.5. The performance of such versions of TDC are evaluated in Appendix Sec- tion 7.9.1. Even though not one of the algorithms outperforms each other, TDC-slow and TDC2 shows better performance in general. 3.3 GENERALIZING TDC++ This section provides versions of TDC++ (Ghiassian et al., 2020), which is variant of TDC. With an additional regularization term ξk on both updates of TDC in (7) and (8), the update is written as follows: λk+1 = λk + αkη(−φ(cid:62) ξk+1 = ξk + αk(−ρkγφ(cid:62) k λk + ρkδk(ξk))φk − βλk) (26) k λkφ(cid:48) where η > 0 satisfies (20) and β > 0 is a new parameter. Note that TDC++ can be simply viewed as variant of TDC by adding the term βλk in the update, which can be seen as a regularization term. Therefore, letting β = 0 yields the original TDC. In this paper, we prove that our controller design leads to the following update: k − βλk + ρkδk(ξk)φk), (27) λk+1 = λk + αkη(−φ(cid:62) ξk+1 = ξk + αk(−ρkγφ(cid:62) k λk + ρkδk(ξk))φk − βλk) k λkφ(cid:48) k + (1 − κη)φ(cid:62) k λkφk − κβηλk + ρkκηδk(ξk)φk), where κ and β are new parameters and when κ = 1/η it becomes TDC++. The difference with the original TDC++ can be seen in their corresponding O.D.E. forms. The corresponding O.D.E. (cid:21) . for (26) and (27) (original TDC++) can be expressed as: d dt (cid:20) −η(C + βI) −ηA A(cid:62) − C − βI −A (cid:20)λt xt = (cid:21) Meanwhile, the O.D.E. corresponding to (28) and (29) (new TDC++) becomes d dt 8 (28) (29) (cid:21) (cid:20)λt xt (cid:21) (cid:20)λt xt = (cid:20) −η(C + βI) −ηA A(cid:62) − κη(C + βI) −κηA behavior of new TDC++. The result shows that in general, smaller κ leads to better performance. The results are given in Appendix Section 7.9. . We experiment under different of κ and η to examine the (cid:21) (cid:20)λt xt (cid:21) Lemma 3.3. Consider the following O.D.E.: ̇λt = −η(C + βI)λt − ηAxt ̇xt = ut. (30) (31) Suppose that we choose the control input ut := (A(cid:62) − κη(C + βI))λt − κηAxt. Assume η > 0 and β and κ satisfies the following condition: β + κλmin(A) > λmin(C). Then, the above O.D.E. has globally asymptotically stable origin, i.e., (λt, xt) → (0, 0) as t → ∞. The proof is given in Appendix Section 7.4.3. With Lemma 2.1, we can prove the convergence of stochastic update with (28) and (29) whose pseudo code is given in Algorithm 5 in Appendix. Theorem 3.3. Consider Algorithm 5 in Appendix. Under the step-size condition (33) and if η satisfies (20), then ξk → ξ∗ as k → ∞ with probability one, where ξ∗ is the TD fixed point in (6). Remark 3.2. We can replace the regularization term with nonlinear terms satisfying certain condi- tions. The details are given in Appendix Section 7.6. 4 EXPERIMENTS We verify the performance and convergence of the proposed BTD under standard benchmarks to evaluate off-policy TD-learning algorithms, including Baird environment (Baird, 1995), Ran- domWalk (Sutton et al., 2009) with different features, and Boyan chain (Boyan, 2002). The details about the environments are given in Appendix Section 7.7. From the experiments, we see how BTD behaves under different coefficients η ∈ {−0.5, −0.25, 0, 0.25, 0.5}. We measure the Root Mean-Squared Projected Bellman Error (RMSPBE) as the performance metric, and every results are averaged over 100 runs. From Table 1, the result with η = 0.5 shows the best performance except at Baird, where η = 0, corresponding to GTD2 performs best. There exist two aspects on the role of η. First of all, it can be thought of as a parameter that can mitigate the effect of instability coming from matrix A in (9). For example, a smaller η can stabilize the system. However, as a trade off, if η is too small, then the update rate might be too small as well. As a result, the overall convergence can be slower. Furthermore, η also controls the effect of −C in (13) in the BTD update rules, where −C corresponds to (−η + η2)φ(cid:62) k λkφk in (17). Note that the role of η in the final BTD update rule in (17) shows different perspectives compared to that in (9). In particular, η = 1/2 maximizes the effect of −C in (17). From Table 1, it leads to reasonably good performances in most domains. Another natural choice is to multiply η to −C instead of A. However, in such cases, we need to introduce another constrain η > 0, whereas in the current BTD, convergence is guaranteed for all η ∈ R. Finally, we note that simply multiplying −C by a large positive constant does not lead to good results in general. This is because in this case, it may increase variance, and destabilize the algorithm. Overall results are given in Appendix Section 7.8. Table 1: Backstepping TD, step-size = 0.01 η Env Boyan Dependent Inverted Tabular Baird -0.5 -0.25 0 0.25 0.5 1.51 ± 0.66 0.11 ± 0.19 0.21 ± 0.25 0.17 ± 0.28 0.1 ± 0.64 1.481 ± 0.656 0.097 ± 0.163 0.173 ± 0.218 0.147 ± 0.238 0.09 ± 0.629 1.452 ± 0.647 0.086 ± 0.142 0.151 ± 0.193 0.133 ± 0.208 0.085 ± 0.625 1.428 ± 0.64 0.079 ± 0.128 0.139 ± 0.177 0.124 ± 0.191 0.087 ± 0.628 1.408 ± 0.635 0.076 ± 0.122 0.136 ± 0.172 0.122 ± 0.188 0.092 ± 0.637 9 5 CONCLUSION In this work, we have proposed a new framework to design off-policy TD-learning algorithms from control-theoretic view. Future research directions would be extending the framework to non-linear function approximation setting. 6 ACKNOWLEDGEMENTS This work was supported by the National Research Foundation under Grant NRF- 2021R1F1A1061613, Institute of Information communications Technology Planning Evaluation (IITP) grant funded by the Korea government (MSIT)(No.2022-0-00469), and the BK21 FOUR from the Ministry of Education (Republic of Korea). (Corresponding author: Donghwan Lee.) REFERENCES Adrià Puigdomènech Badia, Bilal Piot, Steven Kapturowski, Pablo Sprechmann, Alex Vitvitskyi, Zhaohan Daniel Guo, and Charles Blundell. Agent57: Outperforming the atari human benchmark. In International Conference on Machine Learning, pp. 507–517. PMLR, 2020. Leemon Baird. Residual algorithms: Reinforcement learning with function approximation. In Machine Learning Proceedings 1995, pp. 30–37. Elsevier, 1995. Vivek S Borkar and Sean P Meyn. The ode method for convergence of stochastic approximation and reinforcement learning. SIAM Journal on Control and Optimization, 38(2):447–469, 2000. Justin A Boyan. Technical update: Least-squares temporal difference learning, 2002. Xinshi Chen, Shuang Li, Hui Li, Shaohua Jiang, Yuan Qi, and Le Song. Generative adversarial user model for reinforcement learning based recommendation system. In International Conference on Machine Learning, pp. 1052–1061. PMLR, 2019. Xinyue Chen, Che Wang, Zijian Zhou, and Keith Ross. Randomized ensembled double q-learning: Learning fast without a model. arXiv preprint arXiv:2101.05982, 2021. Bo Dai, Albert Shaw, Lihong Li, Lin Xiao, Niao He, Zhen Liu, Jianshu Chen, and Le Song. Sbeed: Convergent reinforcement learning with nonlinear function approximation. In International Con- ference on Machine Learning, pp. 1125–1134. PMLR, 2018. Simon S Du, Jianshu Chen, Lihong Li, Lin Xiao, and Dengyong Zhou. Stochastic variance reduction methods for policy evaluation. In International Conference on Machine Learning, pp. 1049–1058. PMLR, 2017. Rafael Fierro and Frank L Lewis. Control of a nonholomic mobile robot: Backstepping kinematics into dynamics. Journal of robotic systems, 14(3):149–163, 1997. Thor I Fossen and Jan P Strand. Tutorial on nonlinear backstepping: Applications to ship control. 1999. Sina Ghiassian, Andrew Patterson, Shivam Garg, Dhawal Gupta, Adam White, and Martha White. Gradient temporal-difference learning with regularized corrections. In International Conference on Machine Learning, pp. 3524–3534. PMLR, 2020. Omer Gottesman, Fredrik Johansson, Matthieu Komorowski, Aldo Faisal, David Sontag, Finale Doshi-Velez, and Leo Anthony Celi. Guidelines for reinforcement learning in healthcare. Nature medicine, 25(1):16–18, 2019. Hassan K Khalil. Nonlinear control, volume 406. Pearson New York, 2015. Jens Kober, J Andrew Bagnell, and Jan Peters. Reinforcement learning in robotics: A survey. The International Journal of Robotics Research, 32(11):1238–1274, 2013. 10 Petar V Kokotovic. The joy of feedback: nonlinear and adaptive. IEEE Control Systems Magazine, 12(3):7–17, 1992. Qingfeng Lan, Yangchen Pan, Alona Fyshe, and Martha White. Maxmin q-learning: Controlling the estimation bias of q-learning. arXiv preprint arXiv:2002.06487, 2020. Donghwan Lee and Niao He. A unified switching system perspective and ode analysis of q-learning algorithms. arXiv preprint arXiv:1912.02270, 2019. Donghwan Lee, Han-Dong Lim, Jihoon Park, and Okyong Choi. Versions of gradient temporal difference learning. arXiv preprint arXiv:2109.04033, 2021. Bo Liu, Ji Liu, Mohammad Ghavamzadeh, Sridhar Mahadevan, and Marek Petrik. Finite-sample analysis of proximal gradient td algorithms. arXiv preprint arXiv:2006.14364, 2020. Sergio Valcarcel Macua, Jianshu Chen, Santiago Zazo, and Ali H Sayed. Distributed policy evalu- ation under multiple behavior strategies. IEEE Transactions on Automatic Control, 60(5):1260– 1274, 2014. Tarek Madani and Abdelaziz Benallegue. Backstepping control for a quadrotor helicopter. In 2006 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 3255–3260. IEEE, 2006. Hamid Reza Maei. Gradient temporal-difference learning algorithms. 2011. A Rupam Mahmood, Huizhen Yu, Martha White, and Richard S Sutton. Emphatic temporal- difference learning. arXiv preprint arXiv:1507.01569, 2015. Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Belle- mare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. nature, 518(7540):529–533, 2015. Doina Precup, Richard S Sutton, and Sanjoy Dasgupta. Off-policy temporal-difference learning with function approximation. In ICML, pp. 417–424, 2001. Herbert Robbins and Sutton Monro. A stochastic approximation method. The annals of mathemati- cal statistics, pp. 400–407, 1951. Julian Schrittwieser, Ioannis Antonoglou, Thomas Hubert, Karen Simonyan, Laurent Sifre, Simon Schmitt, Arthur Guez, Edward Lockhart, Demis Hassabis, Thore Graepel, et al. Mastering atari, go, chess and shogi by planning with a learned model. Nature, 588(7839):604–609, 2020. Eduardo D Sontag. Mathematical control theory: deterministic finite dimensional systems, vol- ume 6. Springer Science & Business Media, 2013. Richard S Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3 (1):9–44, 1988. Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018. Richard S Sutton, Csaba Szepesvári, and Hamid Reza Maei. A convergent o (n) algorithm for off-policy temporal-difference learning with linear function approximation. Advances in neural information processing systems, 21(21):1609–1616, 2008. 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. In Proceedings of the 26th Annual International Conference on Machine Learning, pp. 993–1000, 2009. Hado Van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double q- learning. In Proceedings of the AAAI conference on artificial intelligence, volume 30, 2016. Christopher JCH Watkins and Peter Dayan. Q-learning. Machine learning, 8(3):279–292, 1992. 11 7 APPENDIX 7.1 TECHINICAL DETAILS We elaborate the conditions for the Borkar and Meyn Theorem (Borkar & Meyn, 2000). Consider the stochastic approximation in (2). Assumption 7.1. 1. The mapping f : Rn → Rn is globally Lipschitz continuous, and there exists a function f∞ : Rn → Rn such that lim c→∞ f (cx) c = f∞(x), ∀x ∈ Rn. (32) 2. The origin in Rn is an asymptotically stable equilibrium for the O.D.E.: ̇xt = f∞(xt). 3. There exists a unique globally asymptotically stable equilibrium xe ∈ Rn for the ODE ̇xt = f (xt) , i.e., xt → xe as t → ∞. 4. The sequence {mk, k ≥ 1} where Gk is sigma-algebra generated by {(xi, mi, i ≥ k)}, is a Martingale difference sequence. In addition , there exists a constant C0 < ∞ such that for any initial x0 ∈ Rn , we have E[||mk+1||2|Gk] ≤ C0(1 + ||xk||2), ∀k ≥ 0. 5. The step-sizes satisfies the Robbins-Monro condition (Robbins & Monro, 1951) : ∞ (cid:88) k=0 αk = ∞, ∞ (cid:88) k=0 α2 k < ∞. (33) Furthermore, we introduce an important tool to prove stability of O.D.E.. Lemma 7.1 (LaSall'es Invariance Principle (Khalil, 2015)). Let the origin be an equilibrium point for (3). Let V : Rn → R be a continuously differentiable and positive definite function satisfying the below conditions: 1. V (x) is radially unbounded function , i.e., ||x|| → ∞ implies V (x) → ∞, 2. Consider the Lie derivative Lf V (x) := ∇xV (x)(cid:62)f (x) so that ̇V (xt) = Lf V (xt) along the solution, and it is negative semi-definite, i.e., Lf V (x) ≤ 0 for all x ∈ Rn. Let S := {x ∈ Rn | Lf V (x) = 0}, and suppose that no solution can stay identically in S other than trivial solution x ≡ 0, where we say that a solution stays identically in S if x(t) ∈ S, ∀t ≥ 0 . Then, the origin is globally asymptotically stable. Definition 7.1 (Invariant set (Khalil, 2015)). A set M is an invariant set with respect to ̇x = f (x) if x0 ∈ M → xt ∈ M for all t ≥ 0. 7.2 OMIITTED PSEUDO CODES AND DIAGRMAS Algorithm 1 Backstepping TD 1: Initialize ξ0, λ0 ∈ Rn. 2: Set the step-size (αk)∞ 3: for iteration k = 0, 1, . . . do 4: 5: 6: 7: end for k=0, and the behavior policy μ. Sample sk ∼ dμ and ak ∼ μ Sample s(cid:48) k ∼ P (sk, ak, *) and rk+1 = r(sk, ak, s(cid:48) k) Update λk and ξk using (16) and (17) respectively 12 Algorithm 2 TDC-slow 1: Initialize ξ0, λ0 ∈ Rn. 2: Set the step-size (αk)∞ 3: for iteration k = 0, 1, . . . do 4: 5: 6: 7: end for k=0, and the behavior policy μ. Sample sk ∼ dμ and ak ∼ μ Sample s(cid:48) k ∼ P (sk, ak, *) and rk+1 = r(sk, ak, s(cid:48) k) Update λk and ξk using (18) and (19) respectively Algorithm 3 TDC++2 1: Initialize ξ0, λ0 ∈ Rn. 2: Set the step-size (αk)∞ 3: for iteration k = 0, 1, . . . do 4: 5: 6: 7: end for k=0, and the behavior policy μ. Sample sk ∼ dμ' and ak ∼ μ k ∼ P (sk, ak, *) and rk+1 = r(sk, ak, s(cid:48) Sample s(cid:48) k) Update λk and ξk using (28) and (29) respectively u (cid:82) x −A + (cid:82) λ −C + ηA u (cid:82) x + −A + −ηλ u + (cid:82) z −A + −η ̇λ λ λ (cid:82) −C (cid:82) −C Figure 1: Backstepping diagram 7.3 EXAMPLE OF BACKSTEPPING Here, we provide a simple example to design control law using backstepping control. 13 Example 7.1. Consider the following two-dimensional system: ̇λt = −λ3 ̇xt = ut, t − λt + xt (34) where λt, xt ∈ R are the states, and ut ∈ R is control input. First, considering xt in (34) as virtual input xs(λt), it is easy to check that xs(λt) = λt satisfies the condition in Step 1 in Section 2.3. Substituting xt in (34) with xs(λt), we have The globally asymptotically stability of the above system cab be established with the following Lya- punov function: ̇λt = −λ3 t . Let zt := xt − xs(λt). Expressing the O.D.E. in (34) with (λt, zt), we have V (λt) = λ2 t 2 . t + zt ̇λt = −λ3 ̇xt = ut + λ3 t − zt. Suppose we choose a candidate Lyapunov function: Vc(λt, zt) = V (λt) + z2 t 2 The time derivative of Vc(λt, zt) becomes ̇Vc(λt, zt) = −λ4 t + λtzt + zt(ut + λ3 t − zt). To make the time derivative negative definite, we can design the control law as: which leads to the following inequality: ut := −λt − λ3 t , ̇Vc(λt, zt) ≤ −λ4 t − z2 t Now, we can conclude that the origin of the system becomes globally asymptotically stable. 7.4 OMITTED PROOFS 7.4.1 PROOF OF LEMMA 3.1 Proof. In this proof, we follow the steps given in the backstepping scheme in Section 3. First, substituting xt in (9) with a virtual controller ̃x(λt), we will design a control law ̃x(λt) that stabilizes the following new virtual system: ̇λt = (−C + ηA)λt − A ̃x(λt). (35) Even though matrix C is positive definite, due to matrix A, the system may be unstable. One natural choice of the virtual controller is ̃x(λt) = ηλt. Plugging into (35) leads to ̇λt = −Cλt. The system now has a globally asymptotically stable origin due to the positive definiteness of matrix C. It is straightforward to verify the global asymptotic stability of the above system with the following Lyapunov function: V (λt) := ||λt||2 2 2 . (36) With this result in mind, we now consider the original O.D.E. in (9) and (10). Applying simple algebraic manipulations yield ̇λt = −Cλt − A(xt − ηλt), ̇xt = ut. The error between xt and the 14 virtual controller ̃x(λt) can be expressed as new variable zt, which is zt := xt − ̃x(λt) = xt − ηλt. Rewriting the O.D.E. in (9) and (10) with (λt, zt) coordinates, we have ̇λt = −Cλt − Azt ̇zt = ut + ηCλt + ηAzt. (37) To prove the global asymptotic stability of the above system, consider the function Vc(λt, zt) := V (λt) + 1 2 where V (λt) is defined in (36) . The time derivative of the Lyapunov function along the system's solution becomes 2 ||zt||2 ̇Vc(λt, zt) = λ(cid:62) t (−Cλt − Azt) + z(cid:62) t (ut + ηCλt + ηAzt) = −||λt||2 C + z(cid:62) t (−A(cid:62)λt + ut + ηCλt + ηAzt). (cid:20) λt zt (cid:21) = (cid:21) A(cid:62) (cid:21) (cid:20) λt zt =: f (λt, zt), and we have ̇Vc = −||λt||2 By taking ut as ut = A(cid:62)λt − ηCλt − ηAzt, the corresponding closed-loop system is d dt (cid:20) −C −A 0 C ≤ 0 for all (λt, zt) (cid:54)= (0, 0). Since the inequality is not strict, Lyapunov theory cannot be directly applied. Therefore, we will use LaSall'es invariance principle in Lemma 7.1 in Appendix. Define the Lie derivative Lf V (λ, z) := − (cid:107)λ(cid:107)2 ̇Vc(λt, zt) = Lf V (λt, zt) along the solution. Consider a solution (λt, zt), t ≥ 0 and the set S := {(λ, z) | Lf V (λ, z) = 0} = {(λ, z) | λ = 0}. Suppose that the solution, (λt, zt), t ≥ 0, is inside S, i.e., (λt, zt) ∈ S, t ≥ 0. Then, we should have λ ≡ 0, which implies from (37) that z ≡ 0. Therefore, S can only contain the trivial solution (λ, z) ≡ (0, 0). Therefore, from LaSall'es invariance principle in Lemma 7.1 and noting that Vc is radially unbounded, the closed-loop system admits the origin as a globally asymptotically stable equilibrium point. Using the relation zt := xt − ηλt, we can also easily conclude that the closed-loop system in the original coordinate (λt, xt) admits the origin as a globally asymptotically stable equilibrium point. C so that 7.4.2 PROOF OF LEMMA 3.2 Proof. One simple option is to set the virtual controller ̃x(λt) := 0, which would result to GTD2 as in Section 3.1. Instead, we take the virtual controller as ̃x(λt) := βλt, and plug into xt in (24), which results to ̇λt = −Cλt − βAλt = (−C − βA)λt. The above system is globally asymptotically stable since −C − βA ≺ 0, which results from the condition on β in (23). Using change of coordinates, we introduce the new variable zt, The O.D.E. in (24) and (25) can be rewritten as zt := xt − ̃x(λt) = xt − βλt. ̇λt = (−C − βA)λt − Azt ̇zt = ut + (βC + β2A)λt + βAzt. (38) Now consider the following candidate Lyapunov function: Vc(λt, zt) = β 2 ||λt||2 + 1 2 ||zt||2. The time derivative of the Lyapunov function along the system's solution becomes, ̇Vc = βλT = βλT t ((−C − βA)λt − Az) + z(cid:62) t ((−C − βA)λt) + z(cid:62) t (ut + (βC + β2A)λt + βAzt) t (ut − βAT λt + (βC + β2A)λt + βAzt). 15 (cid:21) (cid:20)λt zt = (cid:21) βA(cid:62) (cid:21) (cid:20)λt zt := f (λt, zt), and we have ̇Vc = −β||λt||2 By taking ut = βA(cid:62)λt−(βC +β2A)λt−βAzt, the corresponding closed-loop system is d dt (cid:20)−C − βA −A 0 −C+βA ≤ 0 for all (λt, zt) (cid:54)= (0, 0). We will again use LaSall'es invariance principle in Lemma 7.1 in Appendix. Define the ̇Vc(λt, zt) = Lf V (λt, zt) along the solution. Lie derivative Lf V (λ, z) := −β||λ||2 Consider a solution (λt, zt), t ≥ 0 and the set S := {(λt, zt)|Lf V (λ, z) = 0} = {(λ, z)|λ = 0}. Suppose that the solution (λt, zt), t ≥ 0, is inside S, i.e., (λt, zt) ∈ S, t ≥ 0. Then, we should have λ ≡ 0, wchih implies from (38) that z ≡ 0. Therefore, S can only contain the trivial solution (λ, z) ≡ (0, 0). Therefore, from LaSall'es invariance principle in Lemma 7.1 and noting that Vc is radially unbounded, the closed-loop system admits the origin as a globally asymptotically stable equilibrium point. Using the relation zt = xt − βλt, we can also conclude that the closed- loop system in the original coordinate (λt, xt) admits the origin as a globally asymptotically stable equilibrium point. C+βA so that Using the relation zt := xt −βλt , the control input in the original coordinate (λt, xt) can be written as ut = βA(cid:62)λt − (βC + β2A)λt − βAzt = βA(cid:62)λt − (βC + β2A)λt − βA(xt − βλt) = (βA(cid:62) − βC)λt − βAxt. Plugging this input into the original open-loop system in (24) and (25), the closed-loop system in the original coordinate (λt, zt) can be written as ̇λt = −Cλt − Axt, ̇xt = β(A(cid:62) − ηC)λt − βAxt, (39) (40) whose origin is also globally asymptotically stable according to Lemma 3.2. Recovering back from xt to ξt, we have ̇λt = −Cλt − Aξt + b, ̇ξt = β(A(cid:62) − ηC)λt − βAξt + βb, whose corresponding stochastic approximation is (21) and (22). 7.4.3 PROOF OF LEMMA 3.3 Proof. The proof is similar to Lemma 3.1, hence we breifly explain the procedure. Let the virtual controller ̃x(λt) = κλt. We first need to check −ηC − κηA − ηβI is negative definite. From the condition that β + κλmin(A) > λmin(C), −ηC − κηA − ηβI becomes negative definite. Using coordinate transform , we define the new variable zt, zt = xt − ̃x(λt) = xt − κλt. Expressing (30) and (31) in (λt, zt), we have ̇λt = −η(C + βI + κA)λt − ηAzt ̇zt = ut + ηκ(C + βI + κA)λt + ηκAzt. Now, consider the following positive definite function V (λt, zt), and its time derivative: V (λt, zt) = 1 2η ||λt||2 2 + 1 2 ||zt||2 2, ̇V = −λ(cid:62) = −λ(cid:62) t (C + βI + κA)λt − Azt) + (z(cid:62) t (C + βI + κA)λt + (z(cid:62) t )(ut + ηκ(C + βI + κA)λt + κηAzt) t )(−A(cid:62)λt + ut + κη(C + βI + κA)λt + κηAzt) 16 (cid:21) (cid:21) = A(cid:62) (cid:20)λt zt (cid:21) (cid:20)λt zt (cid:20)−η(C + βI + κA) −ηA Taking ut = A(cid:62)λt − ηκ(C + βI + κA)λt − κηAzt, the corresponding closed-loop system becomes d C+βI+κA ≤ dt 0. To use LaSall'es invariance principle in Lemma 7.1 given in Appendix, first define the Lie deriva- tive Lf V (λ, z) := −||λ||2 C+βI+κA along the solution. Consider the solution (λt, zt), t ≥ 0 and the set S := {(λ, z)|Lf V (λ, z) = 0} = {(λ, z)|λ = 0}. Suppose that the solution (λt, zt), t ≥ 0 is inside S, i.e., (λt, zt) ∈ S, t ≥ 0. Therefore, S can only contain the trivial solution (λ, z) ≡ (0, 0). Applying Lasall'es invariance principle in Lemma 7.1, we can conclude that the original coordinate (λt, xt) admits the origin as globally asymptotically stable equilibrium point. := f (λt, zt), and we have ̇Vc = −||λt||2 0 Using the relation zt := xt − κλt, the control input in the original coordinate (λt, xt) can be written as ut = AT λt − ηκ(C + βI + κA)λt − κηAzt = AT λt − ηκ(C + βI + κA)λt − κηA(xt − κλt) = (AT − κηβI − κηC)λt − κηAxt. Plugging this input into the original open-loop system in (30) and (31), the closed-loop system in the original coordinate (λt, xt) can be written as ̇λt = −η(C + βI)λt − ηAxt ̇xt = (A(cid:62) − κη(C + βI))λt − κηAxt. Recovering back from xt to ξt we have ̇λt = −η(C + βI)λt − ηAξt + b ̇ξt = (A(cid:62) − κη(C + βI))λt − κηAξt + κηb, whose corresponding stochastic approximation is (28) and (29). 7.5 DERIVATION OF SINGLE TIME-SCALE TDC2 In Section 3.2, we discussed turning TDC into single-time scale algorithm reflecting the two-time scale property. Other than multiplication of constant reflecting two-time scale property, we can make TDC into single-time scale algorithm as follows: λk+1 = λk + αk(−ηφ(cid:62) ξk+1 = ξk + αk((φ(cid:62) k) − ηφkλkφk + ρkδk(ξk)φk) k λk + ρkδk(ξk))φk) k λkφk − ρkγφ(cid:62) k λkφ(cid:48) (42) (41) It can be shown that the above stochastic update follows from stabilizing controller design in the following lemma: Lemma 7.2. Consider the following O.D.E.: ̇λt = −ηCλt − Axt ̇xt = ut (43) Suppose we choose the control input ut := (A(cid:62) − ηC)λt − Axt, and η satisfies condition (20). Then, the above O.D.E. has globally asymptotically stable origin, i.e., (λt, xt) → (0, 0) as t → ∞. Proof. Considering xt in (43) as virtual controller xs(λt), one possible option is to take xs(λt) := 0. Using backstepping method as in Section 3, it results to O.D.E. corresponding to GTD2 (Sutton et al., 2009). Instead, we choose the virtual controller xs(λt) := λt. Substituting xt with xs(t) in (43), we can rewrite (43) as follows: ̇λt = −ηCλt − Axs(t) = (−ηC − A)λt. Since −ηC − A ≺ 0 due to the condition on η in (20), the origin of the above system is globally asymptotically stable. Now, denote the error between the virtual controller xs(t) and xt as zt := xt − xs(λt) = xt − λt . Using change of coordinates, we can rewrite the O.D.E. in (43) as follows: ̇λt = (−ηC − A)λt − Azt ̇zt = ut + (ηC + A)λt + Azt (44) 17 Now, let us define the following positive definite function: 1 2 V (λt, zt) = ||λt||2 + 1 2 ||zt||2 The time derivative of the above function becomes, ̇V = λ(cid:62) = λ(cid:62) t ((−ηC − A)λt − Azt) + z(cid:62) t (−ηC − A)λt + z(cid:62) t (ut + (ηC + A)λt + Azt) t (ut − A(cid:62)λt + (ηC + A)λt + Azt). Take ut (cid:20)−ηC − A −A 0 (cid:21) (cid:21) (cid:20)λt zt := A(cid:62)λt − (ηC + A)λt − Azt, the corresponding closed-loop system is d dt (cid:21) (cid:20)λt zt = A(cid:62) := f (λt, zt), and we have ̇Vc = −||λt||2 ηC+A ≤ 0. To use LaSall'es in- variance principle in Lemma 7.1 given in Appendix, first define the Lie derivative Lf V (λ, z) := −||λ||2 ηC+A along the solution. Consider the solution (λt, zt), t ≥ 0 and the set S := {(λ, z)|Lf V (λ, z) = 0} = {(λ, z)|λ = 0}. Suppose that the solution (λt, zt), t ≥ 0 is inside S, i.e., (λt, zt) ∈ S, t ≥ 0. Therefore, S can only contain the trivial solution (λ, z) ≡ (0, 0). Ap- plying Lasall'es invariance principle in Lemma 7.1, we can conclude that the original coordinate (λt, xt) admits the origin as globally asymptotically stable equilibrium point. Using the relation zt := xt − λt, the control input in the original coordinate (λt, xt) can be written as ut = A(cid:62)λt − (ηC + A)λt − Azt = A(cid:62)λt − (ηC + A)λt − A(xt − λt) = (A(cid:62) − ηC)λt − Axt. Plugging this input into the original open-loop system in (43), the closed-loop system in the original coordinate (λt, xt) can be written as ̇λt = −ηCλt − Axt ̇xt = (A(cid:62) − ηC)λt − Axt. Recovering back from xt to ξt we have ̇λt = −ηCλt − Aξt + b ̇ξt = (A(cid:62) − ηC)λt − Aξt + b, whose corresponding stochastic approximation is (41) and (42). Remark 7.1. The difference from the update in Algorithm 2 can be seen in their corresponding O.D.E. respectively. Multiplying large constant η to C is enough to make the origin of the O.D.E. stable. By Borkar and Meyn theorem in Lemma 2.1, we can readily prove the convergence of Algorithm 4. Theorem 7.1. Consider Algorithm 4 given in the Appnedix, which uses stochastic recursive up- date (41) and (42). Under the step-size condition (33) and if η satisfies (20), then ξk → ξ∗ as k → ∞ with probability one, where ξ∗ is the TD fixed point in (6). Algorithm 4 Single-time scale TDC2 1: Initialize ξ0, λ0 ∈ Rn. 2: Set the step-size (αk)∞ 3: for iteration k = 0, 1, . . . do 4: 5: 6: 7: end for Sample sk ∼ dμ and ak ∼ μ Sample s(cid:48) k ∼ P (sk, ak, *) and rk = r(sk, ak, s(cid:48) k) Update λk and ξk using (41) and (42) respectively k=0, and the behavior policy μ. Comparison on performance on versions of TDC are given in Section 7.9.1. 18 7.6 TDC++ WITH NONLINEAR TERMS This section provides replacing the so-called regularization term in TDC++ with nonlinear term including ReLU and Leaky ReLU. The basic motiviation is that treating the regularization term as known disturbance, we can cancel the nonlinear term through backstepping. The condition on nonlinear function f : Rn → Rn are as follows: Assumption 7.2. 1. f : Rn → Rn is Lipschitz continuous. 2. For some positive constant c > 0, ||f (λk)||2 2 ≤ c||λk||2 2. 3. f is zero at origin. 4. limc→∞ f (cλk)/c → 0 or limc→∞ f (cλk)/c → f (λk). Remark 7.2. Such nonlinear terms include ReLU and Leaky ReLU. Overall we can prove that the below stochastic recursive update is convergent: λk+1 = λk + αkη(−φ(cid:62) ξk+1 = ξk + αk(−ρkγφ(cid:62) k λk + ρkδk(ξk))φk − βf (λk)) k + (1 − κη)φ(cid:62) k λkφ(cid:48) where fk := f (λk). It has the following corresponding O.D.E. form: k λkφk − κβηf (λk) + κρkηδk(ξk)φk), ̇λt = −ηCλt − ηβdt − ηAxt ̇xt = (A(cid:62) − κηC)λt − κηβf (λt) − κηAxt. The global asymptotic stability of the above O.D.E. is stated in the following lemma: Lemma 7.3. Consider the following O.D.E.: ̇λt = −ηCλt − ηβf (λt) − ηAxt ̇xt = ut. (45) (46) (47) (48) Suppose we choose the control input ut := (AT − κηβf (λt) − ηC)λt − κηAxt. Assume η > 0 and κ and β satisfies the following condition: 1. 2.   0 < κ < −λmin(C)λmin (cid:16) A+A(cid:62) 2 (cid:17) 0 < κ  if λmin if λmin (cid:16) A+A(cid:62) 2 (cid:16) A+A(cid:62) 2 (cid:17) (cid:17) < 0 ≥ 0 β < 1 c λmax(C + κA) (49) (50) Then, the above O.D.E. has globally asymptotically stable origin, i.e., (λt, xt) → (0, 0) as t → ∞. Proof. The proof is similar to Lemma 3.1, hence we briefly explain the procedure. Let the virtual controller ̃x(λt) = κλt. We first need to check that has globally asymptotically stable origin. Consider the candidate Lyapunov function ̇λt = −ηCλt − ηβf (λt) − ηκAλt V (λt) = ||λt||2 2 2 , which leads to ̇V (λt) = −η(C + κA)||λt||2 2 − ηβf (λt)(cid:62)λt ≤ −η(C + κA − cβI)||λt||2 2. 19 ̇V becomes negative definite function due to (49) and (50). Now, using coordinate transform , we define the error variable zt, zt = xt − ̃x(λt) = xt − κλt. Expressing (30) and (31) in (λt, zt), we have ̇λt = −η(C + κA)λt − ηβf (λt) − ηAzt ̇zt = ut + κη(C + κA)λt + κηβf (λt) + κηAzt. Now, consider the following positive definite function V (λt, zt), and its time derivative: V (λt, zt) 1 2η = ||λt||2 2 + 1 2 ||zt||2 2 ̇V = λ(cid:62) = −λ(cid:62) t (−(C + κA)λt − βf (λt) − Az) + (z(cid:62) t ((C + κA)λt − βf (λt)) + (z(cid:62) t )(ut + κη(C + κA)λt + κηβf (λt) + κηAzt) t )(−A(cid:62)λt + ut + κη(C + κA)λt + κηβf (λt) + κηAzt) To achieve ̇V ≤ 0, we can choose ut as follows: ut = A(cid:62)λt − κη(C + βf (λt) + A)λt − κηAzt = A(cid:62)λt − κη(C + βf (λt) + A)λt − κηA(xt − λt) = (A(cid:62) − κηC)λt − κηβf (λt) − κηAxt Using Lasall'es Invariance Principle in Lemma 7.1 and similar arguments as before, we can show that the origin is globally asymptotically stable. The proof is complete. By Borkar and Meyn theorem in Lemma 2.1, we can readily prove the convergence of Algorithm 5. Theorem 7.2. Consider Algorithm 5. Under the step-size condition (33) and if η satisfies (20), then ξk → ξ∗ as k → ∞ with probability one, where ξ∗ is the TD fixed point in (6). Algorithm 5 TDC++ with nonlinear terms 1: Initialize ξ0, λ0 ∈ Rn. 2: Set the step-size (αk)∞ 3: for iteration k = 0, 1, . . . do 4: 5: 6: 7: end for Sample sk ∼ dμ' and ak ∼ μ k ∼ P (sk, ak, *) and rk+1 = r(sk, ak, s(cid:48) Sample s(cid:48) k) Update λk and ξk using (45) and (46) respectively k=0, and the behavior policy μ. Here, we present experimental results on TDC++ with nonlinear terms. As shown in below, replacing simple regularization term λk with Relu function increases the performance. We set κ = 1, η = 1, β = 1 and step-size a s 0.01. When f is Relu and LeakyRelu, we call it TDCRelu and TDCLeaky respectively. Table 2: Best case comparison Algorithms Env Boyan Dependent Inverted Tabular Baird TDCRelu TDCLeaky TDC++ 1.392 ± 0.558 0.138 ± 0.143 0.358 ± 0.21 0.178 ± 0.174 0.078 ± 0.624 1.423 ± 0.55 0.139 ± 0.143 0.36 ± 0.211 0.179 ± 0.175 0.078 ± 0.624 2.381 ± 0.256 0.201 ± 0.192 0.493 ± 0.243 0.25 ± 0.245 0.087 ± 0.627 20 7.7 EXPERIMENT ENVIRONMENTS 7.7.1 BARID COUNTER-EXAMPLE Baird's counter-example (Baird, 1995) is a well-known example where TD-learning diverges with over-parameterized linear function approximation. The environment consists of seven states. There are two actions for each state, namely solid and dash action. Solid action leads to the seventh state deterministically, and dash action leads to state other than seventh state with probability 1/6 and no transition occurs with probability 5/6. The behavior policy selects dashed action with probability 1/7, and solid action with 6/7. As in Baird (1995), we set the initial parameters as [1, . . . , 10, 1]. The target policy π only selects solid action at every state. Φ :=          2 0 0 2 0 0 0 0 0 0 0 0 0 0 1 7 Dμ :=   . . . ∈ R7×8, P π =         1 1 1 1 1 1 2 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 2 0 0 0 2 0 0 0 2 0 0 0   ∈ R7×7, Rπ = 0 ∈ R7,  0 0 2 0 0 0 0 1 7  0 0  0   0   0   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0         1 1 1 1 1 1 1 ∈ R7×7, where 0 denotes zero column vector with appropriate dimension. 7.7.2 BOYAN CHAIN Boyan Chain (Boyan, 2002) has thirteen states with four features and was designed as on-policy problem. There are two actions and except at state one, where the reward is minus two, each ac- tion occurs reward minus three. The behavior policy selects each action under same probability. For states one, five, nine, and 13, the feature vectors are [0,0,0,1],[0,0,1,0],[0,1,0,0], and [1,0,0,0] respectively. The other states are averages over its neighbouring states. Φ :=                    0 0 0 0 0 1 0 1 3/4 1/4 1/2 1/2 1/4 3/4 0 0 0 0 0 0 0 0 0 3/4 1/4 1/2 1/2 3/4 1/4 1 0 3/4 0 1/2 0 1/4 0 0 0                    0 0 0 0 0 0 0 0 0 1/4 1/2 3/4 1 ∈ R13×4, j = i + 1 or j = 13 or for i = 13, 1 ≤ i ≤ 11, 1 ≤ j ≤ 13 j = 13 , [P π]ij = if (cid:26) 1 2 1  1 13 Dμ :=   i = j + 1 i = 12,   ∈ R13×13,  if . . . Rπ := [−3 −3 1 13 * * * −3 −2 0](cid:62) ∈ R13 21 7.7.3 RANDOM WALK Random walk (Sutton et al., 2009) has five states and two terminal states. Zero rewards occurs except at the last state with a plus one reward. The behavior policy μ selects each action with same probabil- ity. Following Sutton et al. (2009), we use three different representations, namely tabular, dependent, and inverted features. The diagonal terms are all zero, and off-diagonal terms have a value 1/2, i.e., the feature map of the first state becomes [0, 1/2, 1/2, 1/2, 1/2]. For the dependent feature case, we √ have [1/ 2] for each state. 3], [0, 1/ 2, 0], [1/ 3], [1/ 3, 1/ 3, 1/ 3, 1/ 2, 1/ 2, 1/ 3, 1/ √ √ √ √ √ √ √ √ √ Φtabular := Φdependent := , Φinverted := 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0  0 0  0   0   0   0 0          0 0 0 0 0 0 0  0 1 √ 1/ √ 1/ 0 0 0 2 3 0 0 √ 1/ √ 1/ √ 1/ 0 0 0 0 0 2 √ 3 1/ √ 2 1/ 1 0         , P π :=     3   2           1 0.6 0 0 0 0 0         0 0 1/2 1/2 1/2 1/2 0 0 0 0.6 0 0 0 0 0 1/2 0 1/2 1/2 1/2 0 0 0.4 0 0.6 0 0 0 0 1/2 1/2 0 1/2 1/2 0 0 1/2 1/2 1/2 0 1/2 0         0 1/2 1/2 1/2 1/2 0 0 , 0 0 0.4 0 0.6 0 0 0 0 0 0.4 0 0.6 0 0 0 0 0 0.4 0 0         0 0 0 0 0 0.4 1 . 7.8 EXPERIMENT ON BTD Table 3: Backstepping TD, step-size = 0.1 η Env Boyan Dependent Inverted Tabular Baird -0.5 -0.25 0 0.25 0.5 0.336 ± 0.475 0.041 ± 0.073 0.05 ± 0.105 0.075 ± 0.117 0.07 ± 0.596 0.327 ± 0.466 0.037 ± 0.065 0.044 ± 0.092 0.068 ± 0.109 0.063 ± 0.593 0.321 ± 0.457 0.035 ± 0.06 0.041 ± 0.083 0.064 ± 0.104 0.06 ± 0.594 0.317 ± 0.45 0.034 ± 0.057 0.04 ± 0.079 0.063 ± 0.102 0.06 ± 0.597 0.317 ± 0.443 0.036 ± 0.057 0.041 ± 0.078 0.065 ± 0.101 0.063 ± 0.602 7.9 EXPERIMENT ON VERSIONS OF TDC++ Table 4: new TDC++, step-size = 0.01, η = 1/2, β = 1 κ Env Boyan Dependent Inverted Tabular Baird 1/8 1/4 1/2 1 2 2.404 ± 0.242 0.166 ± 0.16 0.366 ± 0.18 0.217 ± 0.216 0.101 ± 0.681 2.4 ± 0.241 0.163 ± 0.156 0.369 ± 0.183 0.214 ± 0.209 0.098 ± 0.679 2.393 ± 0.243 0.165 ± 0.156 0.39 ± 0.194 0.215 ± 0.206 0.094 ± 0.677 2.382 ± 0.255 0.191 ± 0.182 0.478 ± 0.233 0.238 ± 0.227 0.096 ± 0.681 2.374 ± 0.302 0.296 ± 0.27 0.726 ± 0.342 0.342 ± 0.315 0.127 ± 0.711 22 Table 5: new TDC++, step-size = 0.01, η = 1, β = 1 1/8 1/4 1/2 1 2 2.402 ± 0.241 0.163 ± 0.156 0.367 ± 0.181 0.213 ± 0.204 0.078 ± 0.625 2.398 ± 0.241 0.163 ± 0.155 0.373 ± 0.186 0.213 ± 0.203 0.076 ± 0.623 2.391 ± 0.243 0.168 ± 0.161 0.4 ± 0.199 0.218 ± 0.21 0.076 ± 0.622 2.381 ± 0.256 0.201 ± 0.192 0.493 ± 0.243 0.25 ± 0.245 0.087 ± 0.627 2.374 ± 0.306 0.31 ± 0.285 0.746 ± 0.356 0.36 ± 0.343 0.122 ± 0.655 Table 6: new TDC++, step-size = 0.01, η = 2, β = 1 1/8 1/4 1/2 1 2 2.401 ± 0.24 0.163 ± 0.156 0.368 ± 0.182 0.213 ± 0.203 0.073 ± 0.609 2.397 ± 0.24 0.163 ± 0.156 0.376 ± 0.187 0.214 ± 0.205 0.073 ± 0.609 2.39 ± 0.243 0.17 ± 0.164 0.405 ± 0.202 0.222 ± 0.216 0.076 ± 0.61 2.38 ± 0.256 0.206 ± 0.198 0.502 ± 0.248 0.257 ± 0.256 0.089 ± 0.618 2.374 ± 0.307 0.317 ± 0.293 0.757 ± 0.363 0.37 ± 0.358 0.125 ± 0.651 κ Env Boyan Dependent Inverted Tabular Baird κ Env Boyan Dependent Inverted Tabular Baird 7.9.1 COMPARISON BETWEEN TDC In this section we compare single time version of TDC suggested by Maei (2011), which we denote it as TDC-fast for convenience. We call Algorithm 2 as TDC-slow, and Algorithm 4 as TDC2. Under step-size set as 0.01 and 0.1, we swept over η ∈ [0.01, 0.1, 0.5, 1, 2, 4] and report best performance. The experiment shows that depending on hyper-parameters and step-size, the performance differs. In general, TDC-slow and TDC2 shows better performance than TDC-fast. Table 7: Best case comparison, step-size = 0.01 Algorithms Env Boyan Dependent Inverted Tabular Baird TDC-fast TDC-slow TDC2 0.89 ± 0.637 0.059 ± 0.088 0.084 ± 0.115 0.095 ± 0.124 0.057 ± 0.585 0.874 ± 0.615 0.051 ± 0.083 0.074 ± 0.106 0.078 ± 0.159 0.074 ± 0.614 0.533 ± 0.587 0.043 ± 0.098 0.077 ± 0.123 0.069 ± 0.159 0.074 ± 0.614 Table 8: Best case comparison, step-size = 0.1 Algorithms Env Boyan Dependent Inverted Tabular Baird TDC-fast TDC-slow TDC2 0.323 ± 0.439 0.031 ± 0.046 0.032 ± 0.056 0.052 ± 0.088 0.053 ± 0.607 0.286 ± 0.321 0.028 ± 0.053 0.032 ± 0.058 0.05 ± 0.092 0.05 ± 0.591 0.268 ± 0.33 0.031 ± 0.047 0.032 ± 0.058 0.052 ± 0.088 0.052 ± 0.609 The full results are given in Appendix Section 7.9.2. 7.9.2 RESULTS ON VERSIONS OF TDC Here, we give the full results on the experiments on versions of TDC. We marked '-' in the table if the algorithm diverges. 23 Table 9: TDC-fast, step-size = 0.01 0.01 0.1 0.5 1 2 0.89 ± 0.637 0.578 ± 0.318 0.575 ± 0.337 0.496 ± 0.211 - 1.049 ± 0.546 0.251 ± 0.177 0.274 ± 0.179 0.235 ± 0.172 - 1.353 ± 0.511 0.084 ± 0.101 0.12 ± 0.128 0.107 ± 0.139 0.133 ± 0.752 1.393 ± 0.557 0.065 ± 0.09 0.094 ± 0.12 0.096 ± 0.13 0.074 ± 0.614 1.414 ± 0.586 0.059 ± 0.088 0.084 ± 0.115 0.095 ± 0.124 0.057 ± 0.585 Table 10: TDC-fast, step-size = 0.1 0.01 0.1 0.5 1 2 0.533 ± 0.352 0.314 ± 0.274 0.321 ± 0.25 0.343 ± 0.239 - 0.338 ± 0.356 0.059 ± 0.103 0.075 ± 0.112 0.092 ± 0.126 - 0.327 ± 0.414 0.033 ± 0.052 0.036 ± 0.064 0.053 ± 0.09 0.064 ± 0.623 0.324 ± 0.43 0.031 ± 0.047 0.032 ± 0.058 0.052 ± 0.088 0.054 ± 0.608 0.323 ± 0.439 0.031 ± 0.046 0.032 ± 0.056 0.053 ± 0.087 0.053 ± 0.607 Table 11: TDC-slow, step-size = 0.01 0.01 0.1 0.5 1 2 2.804 ± 0.145 0.474 ± 0.213 0.612 ± 0.207 0.771 ± 0.343 1.844 ± 2.12 2.574 ± 0.17 0.222 ± 0.156 0.299 ± 0.193 0.272 ± 0.243 0.218 ± 1.011 1.898 ± 0.413 0.094 ± 0.108 0.132 ± 0.142 0.128 ± 0.153 0.084 ± 0.665 1.393 ± 0.557 0.065 ± 0.09 0.094 ± 0.12 0.096 ± 0.13 0.074 ± 0.614 0.874 ± 0.615 0.051 ± 0.083 0.074 ± 0.106 0.078 ± 0.116 0.084 ± 0.638 Table 12: TDC-slow, step-size = 0.1 0.01 0.1 0.5 1 2 2.588 ± 0.168 0.223 ± 0.154 0.295 ± 0.183 0.273 ± 0.236 0.215 ± 0.951 1.433 ± 0.613 0.058 ± 0.087 0.08 ± 0.109 0.097 ± 0.12 0.055 ± 0.584 0.452 ± 0.571 0.028 ± 0.053 0.032 ± 0.068 0.05 ± 0.092 0.05 ± 0.591 0.324 ± 0.43 0.031 ± 0.047 0.032 ± 0.058 0.052 ± 0.088 0.054 ± 0.608 0.286 ± 0.321 0.042 ± 0.047 0.041 ± 0.055 0.064 ± 0.085 - η Env Boyan Dependent Inverted Tabular Baird η Env Boyan Dependent Inverted Tabular Baird β Env Boyan Dependent Inverted Tabular Baird β Env Boyan Dependent Inverted Tabular Baird Table 13: TDC2, step-size = 0.01 η Env Boyan DependentRep InvertedRep TabularRep BairdRep 0.01 0.1 0.5 1 2 0.73 ± 0.574 0.051 ± 0.106 0.109 ± 0.14 0.083 ± 0.166 - 0.533 ± 0.587 0.043 ± 0.098 0.093 ± 0.134 0.069 ± 0.159 - 0.883 ± 0.652 0.045 ± 0.086 0.077 ± 0.123 0.076 ± 0.134 0.125 ± 0.72 1.393 ± 0.557 0.065 ± 0.09 0.094 ± 0.12 0.096 ± 0.13 0.074 ± 0.614 1.894 ± 0.41 0.104 ± 0.11 0.137 ± 0.133 0.133 ± 0.149 0.076 ± 0.62 24 Table 14: TDC2, step-size = 0.1 η Env Boyan DependentRep InvertedRep Tabular Baird 0.01 0.1 0.5 1 2 0.324 ± 0.313 0.049 ± 0.052 0.053 ± 0.067 0.068 ± 0.095 - 0.275 ± 0.274 0.043 ± 0.049 0.046 ± 0.063 0.062 ± 0.091 - 0.268 ± 0.33 0.034 ± 0.046 0.035 ± 0.058 0.053 ± 0.087 4.492 ± 57.657 0.324 ± 0.43 0.031 ± 0.047 0.032 ± 0.058 0.052 ± 0.088 0.054 ± 0.608 0.456 ± 0.569 0.032 ± 0.055 0.036 ± 0.067 0.055 ± 0.093 0.052 ± 0.609 7.9.3 OVERALL COMPARISON BETWEEN THE ALGORITHMS Table 15: Overall comparison, step-size = 0.01 Algorithms Env Boyan Dependent Inverted Tabular Baird TD GTD2 BTD (η = 0.5) TDC-fast TDC-slow TDC2 ETD 0.536 ± 0.699 1.452 ± 0.647 1.408 ± 0.635 0.89 ± 0.637 0.874 ± 0.615 0.533 ± 0.587 0.469 ± 0.599 0.016 ± 0.029 0.086 ± 0.142 0.076 ± 0.122 0.059 ± 0.088 0.051 ± 0.083 0.043 ± 0.098 0.019 ± 0.023 0.03 ± 0.041 0.151 ± 0.193 0.136 ± 0.172 0.084 ± 0.115 0.074 ± 0.106 0.077 ± 0.123 0.032 ± 0.035 0.028 ± 0.036 0.133 ± 0.208 0.122 ± 0.188 0.095 ± 0.124 0.078 ± 0.159 0.069 ± 0.159 0.021 ± 0.028 - 0.085 ± 0.625 0.092 ± 0.637 0.057 ± 0.585 0.074 ± 0.614 0.074 ± 0.614 - Even though TD and ETD ( Emphatic Temporal-Difference learning) (Mahmood et al. (2015)) shows good performance in several domains, it shows unstable behavior in Baird's counter example. TDC-fast shows better performance than other algorithms in Baird's counter example, but in other domains it shows worse performance than TDC-slow or TDC2 as can be seen in Table 7. Moreover, when η = 0.5, BTD shows better performance than GTD2 except at Baird's counter example. 7.10 O.D.E. RESULTS In this section, we see how each O.D.E. dyanmics of TD-learning algorithm dynamics behave in Baird counter example. 25 (a) TD (b) GTD2 (c) TDC-fast, η = 1 (d) BTD, η = 0.5 Figure 2: O.D.E. dynamics of first element of λt in Baird counter example As can be seen in (a), the O.D.E. behavior of TD shows divergence, whereas other algorithms including GTD2, TDC-fast, and BTD show stable behavior. GTD2 and BTD, compared to TDC, show some oscillatory behavior, which may cause slow convergence compared to TDC in Baird counter example. 7.11 BACKGROUND ON GTD2 AND TDC Sutton et al. (2009) introduced GTD2 and TDC to find the global minimizer of MSPBE: 1 2 (cid:13)Φ(cid:62)DμΦθ − γΦ(cid:62)DμP πΦθ − Φ(cid:62)DR(cid:13) (cid:13) 2 C−1 . (cid:13) Taking gradient fo the above equation with respect to θ, we get (Φ(cid:62)DμΦ − γΦ(cid:62)DμP πΦ)(cid:62)C −1 (cid:0)Φ(cid:62)DμΦθ − γΦ(cid:62)DμP πΦθ − Φ(cid:62)DR(cid:1) . The above gradient is equal to E[(γφ(cid:48) k ξk)φk], and due to the inverse operation and double sampling issue (dependency of φ(cid:48) k in the first term and last term), stochastic samples would lead to significant biases. Hence, GTD2 and TDC try to approximate the stochastic gradient of MSPBE, i.e., the term (Φ(cid:62)DμΦ − γΦ(cid:62)DμP πΦ)(cid:62)C −1. k ]−1E[(rk + γφ(cid:48)(cid:62) k ]E[φkφ(cid:62) k − φk)φ(cid:62) k ξk − φ(cid:62) 26
http://arxiv.org/abs/2302.09871v1
2023-02-20T10:03:01
2023-02-20T10:03:01
Attitudes and Latent Class Choice Models using Machine learning
Latent Class Choice Models (LCCM) are extensions of discrete choice models (DCMs) that capture unobserved heterogeneity in the choice process by segmenting the population based on the assumption of preference similarities. We present a method of efficiently incorporating attitudinal indicators in the specification of LCCM, by introducing Artificial Neural Networks (ANN) to formulate latent variables constructs. This formulation overcomes structural equations in its capability of exploring the relationship between the attitudinal indicators and the decision choice, given the Machine Learning (ML) flexibility and power in capturing unobserved and complex behavioural features, such as attitudes and beliefs. All of this while still maintaining the consistency of the theoretical assumptions presented in the Generalized Random Utility model and the interpretability of the estimated parameters. We test our proposed framework for estimating a Car-Sharing (CS) service subscription choice with stated preference data from Copenhagen, Denmark. The results show that our proposed approach provides a complete and realistic segmentation, which helps design better policies.
[ "Lorena Torres Lahoz", "Francisco Camara Pereira", "Georges Sfeir", "Ioanna Arkoudi", "Mayara Moraes Monteiro", "Carlos Lima Azevedo" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09871v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09871v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "econ.EM", "@scheme": "http://arxiv.org/schemas/atom" }
[ "econ.EM", "cs.LG" ]
Attitudes and Latent Class Choice Models using Machine Learning Lorena Torres Lahoz1∗, Francisco Camara Pereira 1, Georges Sfeir1, Ioanna Arkoudi1, Mayara Moraes Monteiro1, Carlos Lima Azevedo1 1DTU Management, Technical University of Denmark Building 116, Bygningstorvet, 2800 Kongens Lyngby ∗Corresponding author: [email protected] February 21, 2023 Abstract Latent Class Choice Models (LCCM) are extensions of discrete choice models (DCMs) that cap- ture unobserved heterogeneity in the choice process by segmenting the population based on the assumption of preference similarities. We present a method of efficiently incorporating attitudi- nal indicators in the specification of LCCM, by introducing Artificial Neural Networks (ANN) to formulate latent variables constructs. This formulation overcomes structural equations in its capability of exploring the relationship between the attitudinal indicators and the decision choice, given the Machine Learning (ML) flexibility and power in capturing unobserved and complex behavioural features, such as attitudes and beliefs. All of this while still maintain- ing the consistency of the theoretical assumptions presented in the Generalized Random Utility model and the interpretability of the estimated parameters. We test our proposed framework for estimating a Car-Sharing (CS) service subscription choice with stated preference data from Copenhagen, Denmark. The results show that our proposed approach provides a complete and realistic segmentation, which helps design better policies. Keywords Machine learning, Latent Class Choice Models, Car-Sharing, Psychometric Indicators, Deep Learning. 3 2 0 2 b e F 0 2 ] M E . n o c e [ 1 v 1 7 8 9 0 . 2 0 3 2 : v i X r a 1 1 Introduction Latent Class Choice Models (LCCMs) are extensions of discrete choice models (DCMs) that are typically implemented to capture unobserved heterogeneity in the choice process by seg- menting the population based on the assumption of preference similarities. Traditionally, the latent classes are often defined by the socio-economic characteristics of the decision-makers [1, 2, 3]. However, incorporating individuals' attitudes and/or perceptions, typically measured using psychometric indicators, into the specification of the latent classes can offer additional behavioural insights, allowing for a more realistic market segmentation that can help design more appropriate strategies and effective policies [4, 5, 6]. In this study, we explore a new method of efficiently incorporating attitudinal indicators in the specification of LCCM by relying on Machine Learning (ML) techniques. All this while preserving the benefits of the economic and behavioural interpretability of DCMs. There are many examples in the literature of employing ML in DCMs, such as the ones reviewed in section 2.3. However, there is a lack of effective use of ML techniques for incorpo- rating attitudinal variables into the model formulation. Even though such variables have been included in traditional DCMs, a complex interaction with the decision-making process should be expected [7]. We hypothesise that ML could be a good starting point to explore it, given its flexibility and power in capturing unobserved and complex interactions. Therefore, we propose a model that includes latent classes and latent variables, the latter being defined as an Artificial Neural Network (ANN). Finally, the developed model follows the generalized random utility model [3] theoretical structure, which provides us with a discrete representation of heterogeneity, and, therefore, higher-level behavioural insights into the composition of the latent classes. This has been shown to allow for more accurate market segmentation and policies that account for the different char- acteristics, preferences, and attitudes of individuals in each market segment (see for example [8], [9]). 2 Literature Review 2.1 Latent Class Choice Models (LCCM) Based on McFadden's model [10], Walker and Ben-Akiva [3] presented a practical general- ized random utility model with extensions for latent variables and classes. They extended basic Random Utility Model (RUM) to relax assumptions and enrich the model's capabilities. Latent classes refer to unobserved population groups, in which each individual has an associated prob- ability of belonging to each group/class. LCCM are a particular case of mixed logit models. Mixed logit models are defined as logit models where the coefficients of the utility function vary across decision-makers according to a given density f (β) [11]. Therefore, unobserved heterogeneity is captured by assuming a param- eter distribution over the population, where each individual has a slightly different behaviour toward the same attribute of the alternatives. For the particular case of LCCM, the hypothesis is that there may be discrete segments of decision-makers that are not immediately identifiable from the data. Hence, the population can be probabilistically segmented into groups with different preferences and decision proto- cols or that behave differently towards a decision, signified by class-specific utility equations for each class. This segmentation could lead to more practical results, such as more efficient design policies [3]. 2 Although mixed logit models are highly flexible and can approximate any random utility model [12], they are more challenging to interpret and use in practice as they do not identify the causes for the variations of taste among decision-makers. On the other hand, evidence in the literature suggests that latent class models are very convenient, flexible, and intuitive to account for taste heterogeneity in discrete choice models [13]. A critical part of LCCMs is specifying the class membership model since it is not defined be- forehand. Traditionally, straightforward logit formulations are employed since they allow for a closed-form expression of the probability to belong to each class. Moreover, they typically base their segmentation on only socio-demographic variables [1, 2, 3]. In the following sections, we will explore different class membership formulations that include information about attitudinal variables. As we have mentioned, incorporating individuals' atti- tudes and/or perceptions into the specification of the latent classes helps construct more realistic population segments, allowing for more accurate and successful policies [13, 4]. 2.2 Latent Psychosocial Constructs in DCM Apart from the attributes of the alternatives and the characteristics of the decision-maker, ac- cording to psychological theory, there exist more complex, unobserved constructs that may have a relevant effect on how we make choices. Some of these latent factors can be the decision maker's lifestyle, attitudes, or perceptions [14]. Psychometric indicators measure the effect of unobserved attributes on individuals' preferences on topics related to the choice. They are additional information that can helps specify and esti- mate latent classes. Atasoy et al. [15] estimated an LCCM where psychometric indicators are included in the maximum likelihood estimation to improve the model's accurancy. The psy- chometric indicators were modelled as conditional on the latent class k. Therefore, the item- response probability of observing indicator In was given by Pn(In|k) that was defined as a pa- rameter jointly estimated with the choice and the class membership model. The model evidence that includes the psychometric indicators allows for richer analysis and generates significantly different estimates for the class membership model. Another approach for including attitudinal variables in DCM models can be found in work de- veloped by Hurtubia et al. [13]. Psychometric indicators are introduced by assuming that the probability of giving an agreement level to an attitudinal question also depends on the respon- dent's class. In this case, they use an ordinal logit approach to model the response probability Pn(Ik|k), since the responses to the indicators consist of a few ordered integer values corre- sponding with the level of agreement with the statement on a Likert scale [16]. The advantage of this formulation is the close form of the ordinal logit used to measure the indicators, which allows for a more straightforward estimation procedure, where the choice and the response to the indicators are estimated together. Another study [17] has gone further by including latent variables and latent classes, to model the relationship between normative beliefs, modality styles, and travel behaviour. Normative beliefs refer to the individual's perception of the opinion of others concerning a specific be- haviour, while modality style describes the part of an individual's lifestyle characterized by using a particular set of travel modes. The study shows evidence of associations between travel behaviour and different latent psychosocial constructs. Their model exemplifies how the socio- psychological approach, which originated in social psychology, can extend conventional travel behaviour analysis. However, due to the model's complexity, sequencial estimation procedure is employed, encountering identification issues for some coefficients. Finally, Alonso-González et al.[18] presented an exploratory factor analysis and latent class 3 cluster analysis of attitudinal variables performed to divide individuals into groups concerning their inclination to adopt MaaS (Mobility as a Service). Even though the model is enriched with a series of covariates referring to socioeconomic, mobility, and technology-related characteris- tics, they do not improve the model; they only help cluster identification. Attitudinal variables are the ones defining the structure of the latent classes. The previous examples have highlighted the importance and relevance of including attitudes, preferences, and beliefs in DCMs, especially in LCCM. They have proved to be relevant for improving the model estimation and creating more realistic and meaningful classes. 2.3 Machine Learning for Taste Heterogeneity in DCM In recent years, the use of ML techniques has increased, mainly due to their power to improve prediction accuracy. However, one of the main criticisms of ML techniques vs. econometric models is that it provides results that are less interpretable. Thus, in the transportation field, researchers have also focused on providing interpretable and meaningful estimates from ML applications, so that they can be more useful for travel analysis and policy decisions. Some interesting works are, for example, Sifringer et al. [19], which, based on previous works [20],[21],[22], included an additional term in the utility layer called the Learning Term, which was estimated separately with a Dense Neural Network, using a priori disregard explanatory variables. This model outperformed previous formulations while keeping the interpretability of the other terms of the utility. Following this idea and based on Pereira [24] previous work, Arkoudi et al [23] proposed an embedding encoding for the socio-characteristic variables that provided a latent representation of these variables in concordance with individuals' choices. Moreover, they included a Learning Term that increased the model's accuracy. However, this embedding formulation does not consider information about attitudinal indicators since these variables cannot be directly included in the utility specifications. Furthermore, none of these works provided latent classes or variables formulations. The work developed by Han et al [25], proposed a nonlinear LCCM by using a neural network to specify the class membership model. In their application, a model with eight latent classes out- performed the previous ones in prediction accuracy. Due to non-linearity, the proposed LCCM was less transparent and lost interpretability. The work of Sfeir et al. presented two model formulations for the construct of latent class choice models using Gaussian process [26] and Mixture models [27], while Wong et al. [28] employed a generative non-parametric ML ap- proach, a Boltzmann machine, to estimate latent variables. Although these works allowed for more flexibility in the definition of these latent constructs, none of them relied on attitudinal indicators' information. To summarize, the theory of LCCM has been widely explored and successfully employed for many decades, and more recently, ML techniques have provided practical solutions for situations where the traditional discrete choice models were more constrained, improving their estimation and flexibility. However, the employment of ML for incorporating attitudinal information in DCM is still in the earliest steps of research, given its theoretical and practical underlying com- plexity. 3 Methodology In this section, we present our model formulation following the generalized random utility model structure (Figure 1) presented by Walker et al., 2002 [3] and the added modifications for the 4 incorporation of latent variables through the employment of ANN in the latent class model. In Figure 1, solid arrows represent structural equations (cause-effect relationships), and dashed arrows represent measurement equations (relationship between observable indicators and the underlying latent variable). Figure 1: Generalized random utility model [3] 3.1 Latent Class Choice Models (LCCM) LCCMs are composed of two sub-models: a class membership model and a class-specific choice model. The former computes the probability of an individual n belonging to a certain class, while the latter assigns the probability of choosing each alternative, given that individual n belongs to a certain class k. Typically, in the class membership model is define as logit, where the utility of an individual n belonging to class k can be expressed as follows: Unk = ASCk + Qnγk + υnk (1) where ASCK is the alternative-specific value for each class k, Qn is a vector containing the characteristics of individual n, γk is a vector of the unknown parameters that need to be estimated and υnk is an error term that is assumed to be independently and identically distributed Extreme Value Type I over individuals and classes. Thus, the probability that individual n belongs to class k given their characteristics is the logit formula: P (qnk|Qn, γk) = eQnγk k′=1 eQnγk′ ∑K (2) where qnk = 1 if the individual belongs to class k and 0 otherwise. As for the class-specific choice model, it returns the probability that an individual n chooses a specific alternative, given that he/she belongs to a certain class k. The utility of individual n choosing alternative i, given that he/she belongs to class k is formu- lated as: Uni|k = Vni|k + εni|k = Xniβk + εni|k (3) 5 where Vnit|k is the observed part of the utility, and εnit|k is an independent and normally dis- tributed Extreme Value Type I error term distributed over individuals, alternatives and classes. Xni is the vector of observed attributes of alternative i and normally includes an alternative- specific constant, and βk is the vector of unknown parameters that need to be estimated. Therefore, the probability that individual n chooses alternative i, conditioned on class k, is for- mulated as: P (yni|Xni, qnk, βk) = |k (4) eVni|k j′=1 eVnj′ ∑J where yni is 1 if individual n chooses alternative i and 0 otherwise, and J is the total number of alternatives. Conditional on the class, the probability of observing yn is formulated as: P (yn|Xn, qnk, βk) = J ∏ (P (ynj|Xnj, qnk, βk))ynj j=1 (5) where yn is a J vector of all choices ynj of an individual n and Xn is a J vector of Xnj. The unconditional probability of observing yn can be calculated by mixing the previous condi- tional choice probability with the probability of belonging to each class k, as follows: P (yn) = K ∑ k=1 P (qnk|Qn, γk)P (yn|Xn, qnk, βk) Finally, the likelihood over all individuals N, considering independence between them, is: P (y) = N ∏ K ∑ n=1 k=1 P (qnk|Qn, γk)P (yn|Xn, qnk, βk) (6) (7) In section 5.1, we employ this LCCM formulation as a baseline for our new model. 3.2 Latent Variables and Latent Classes with ANN for Incorporation of Attitudinal Indicators The straightforward solution for incorporating the attitudinal indicators in DCMs would include their responses directly into the utility of the latent classes. However, there are three main rea- sons to avoid this approach. Firstly, this type of data is not always available for forecasting since these types of surveys are usually expensive and time-consuming. Therefore, the model can predict the class membership model probability even when no information about attitudinal indicators is provided. The second reason is that the multicollinearity inherent in the responses makes it difficult to estimate the unknown parameters correctly and can lead to inconsistent estimates. In this sense, even a low-dimensional representation of the indicators, e.g., factor analysis, cannot be included directly in the utility unless the correlated error terms are added. Lastly, and more importantly, there is no apparent justification that such attitudinal information can uncover some causal relationship directly with behaviour. Instead, the literature points out that these indicators seem to be the consequences of some latent constructs, which combined can represent individuals' attitudes [29]. We follow the generalized random utility model structure presented by [3] to address the pre- viously mentioned issues. Moreover, we include the information on the attitudinal indicators 6 by employing an ANN to formulate the latent variables constructs, which provides more flexi- bility in how the latent variables are formulated. The graphical representation of the proposed formulation is shown in Figure 2. Finally, we decided not to include the arrow between the latent variables and the utilities, and the revealed preference indicators, since we did not find it relevant to our concrete application. However, these relations can be included for other cases by following the same principle as in Figure 1 [3]. Figure 2: Graphical representation of the model formulation 3.2.1 Latent classes with latent variables formulation The utility of the class membership model can be written as: Unk = Vnk + υnk (8) where Vnk is the representative utility of individual n belonging to class k and, as defined in the traditional LCCM, υnk is the error term that is assumed to be independent and identically distributed Extreme Value Type I over individuals and classes ans defined in 1. In this case, we define Vnk as: Vnk = ASCk + Qnγk + rnδk + ωnbk (9) where ASCk is the alternative-specific value for class k, Qn is the vector containing socio- characteristics of individual n, and γk, the vector of unknown parameters that need to be esti- mated for each class k. In addition, rn is the vector of latent variables for individual n and δk the corresponding vector of unknown parameters specific to class k, that also need to be estimated. Finally, ωn is an individual-specific constant with its corresponding coefficient bk for each class k. The term ωn represents the individual variation of all the latent variables caused by the variance of their underlying distributions. It is formulated as a one-layer ANN that gets activated by the ID of each decision maker in the train set (Idn is 1 for decision-maker n and 0 otherwise) w(1) 1n Idn ωn = N ∑ 1 7 (10) where w(1) 1n are the weights of the layer. Since only the difference between classes matters, we introduce the corresponding bk term for each class, which accounts for the effect of the latent variables variation for each of the latent classes. Given the distribution of the error term (υnk), the probability P (qnk|Qn, γk, rn, bk) can be ex- pressed as: P (qnk|Qn, γk, rn, bk) = eVnk k′=1 eVnk′ ∑K (11) As it is standard practice in class membership models, the utility of one class is set to zero due to the parameters' identification since only the differences in utility matter. 3.2.2 Latent variables formulation as ANN The novelty of this work is the employment of ANN for the construction of latent variables. We propose a non-linear relationship between the socio-characteristics of the individuals and the latent constructs by employing two densely connected layers. It can be expressed as follows: H ∑ rzn = a2( M ∑ w(2) zh a1( w(1) hmQmn)) (12) h=0 m=0 where M is the number of socio-demographic variables used to predict the answer to the indi- cators, and H is the number of hidden units in the hidden layer. w(1) hm are the weights of the first layer, and a1 represents the first activation function defined as a Rectified Linear Unit (ReLU) (a1(x) = max(0, x)); for the second layer, a linear activation function is applied a2(x) = x, and the weights are represented by w(2) zh . By adding an extra input Q0n, which is set to one and extending the sum to go from zero, we avoid writing the intercept term. The number of latent variables, defined as Z, the number of hidden neurons in the hidden layer, H, and the number of densely connected layers are dimensions that the researcher can tune since they are not observed in the data. Employing different values for these hyperparameters for a different model application does not invalidate the proposed formulation and can help achieve higher model prediction for the test data. The formulation presented is based on the hypothesis that the socio-characteristics of the indi- viduals define the latent variables. Moreover, these latent constructs influence the response to specific attitudinal indicators. 3.2.3 The ordinal measurement model We focus on the case where indicators take the form of questions that receive an ordered re- sponse, as in Likert scales [16]. Each option of the scale represents a level of agreement with a particular statement. Thus, we define the utility of individual n for indicator p, as a measurement of the level of agreement with its statement, and we formulated it as: Upn = Vpn + νpn = rnαp + cpωn + νpn (13) where Vpn is the representative utility of individual n to indicator p and νpn is the error term that is assumed to be independently and identically distributed Extreme Value Type I over individu- als and indicators. rn is a vector of length Z containing the latent variables of individual n, αp is also a vector of size Z with its corresponding parameters to be estimated. ωn is the individual- specific parameter estimated together with the latent class model, and cp is its corresponding 8 coefficient for each indicator p . Therefore, the probability that individual n answers with a certain level of agreement l to indi- cator p is expressed as: P (Ipln = 1|rn, αp, cp, ωn) = P (τ p l−1 < Upn < τ p l ) (14) where we define Ipln as 1 if individual n answers with a level of agreement l to indicator p and 0 otherwise. τ p l are strictly increasing class-specific thresholds that define an ordinal relation between the utility Upn and the level of agreement to indicator p. Finally, the probability of individual n providing an answer l to indicator p can be computed as an ordinal softmax: P (Ipln = 1|rn, αp, cp, ωn) = P (τ p = P rob(νvp < τ p l − Vpn) − P (νvp < τ p l−1 < Upn < τ p l ) =P (τ p l−1 − Vpn) = = l−1 < Vpn + νvp < τ p eτp l −Vpn 1 + eτp eτp 1 + eτp l −Vpn − l ) = l−1−Vpn l−1−Vpn (15) where one threshold per indicator is set to zero, as only the difference between them matters. The final model formulation is presented in Figure 3. Maximizing the log-likelihood with re- spect to the unknown parameters will not lead to a closed-form solution. Thus, the estimation becomes more complex and challenging as empirical singularity issues could appear at some iterations [30]. To overcome these problems, we employ the Expectation-Maximization (EM) algorithm (Dempster et al., 1977 [31]), a powerful method used for maximizing the likelihood in models with latent variables. 9 Figure 3: Model architecture1 3.2.4 EM algorithm We estimate all components of the proposed model together since simultaneous estimation usu- ally leads to more efficient estimates than sequential estimation [32], [14]. For this purpose, we employ the EM algorithm, which combines an expectation step with a maximization one until convergence is reached. We start by randomly initializing the unknown parameters. After that, we estimate the expected values of the latent variables (E-step) using Bayes' theorem. Then, we update the unknown parameters' values using log-likelihood maximi- sation (M-step). Finally, we evaluate the log-likelihood with the updated values of the unknown 1The expressions without simplifying for P (k = 1) and P (k = K) can be found in equation (11), for P (Ipnl = 1) and P (Ipnl = L) in equation (15) and for P (ynj = 1|k = K) and similars in equation (5). 10 parameters and check for convergence. We return to the E-step until convergence is reached. In this case, the convergence is defined by the number of iterations. We can rewrite the joint likelihood assuming that the clusters are observed as follows: ]qnk P (y, q, Q, X) = [ N ∏ K ∏ n=1 k=1 N ∏ K ∏ X eVnk k′=1 eVnk′ [ ∑K J ∏ n=1 k=1 j=1 eVnj|k j′=1 eVnj′ ∑J ]ynj qnk |k The function is divided into two parts when we take the logarithm of the likelihood: ] ] [ [ LL = qnklog N ∑ K ∑ n=1 k=1 eVnk k′=1 eVnk′ ∑K N ∑ K ∑ J ∑ + n=1 k=1 j=1 ynjqnklog eVnt|k j′=1 eVn′t|k ∑J (16) (17) this equation can be solved by equating its derivatives to zero with respect to each of the un- known parameters of the choice model if qnk is assumed to be known. In order to find the initial values of qnk, we estimate the expectation of qnk (E-step) using Bayes's theorem: E[qnk] = γqnk = [ ∏J j=1 eVnj|k Vnj′ e ∑J ]ynj |k j′=1 [ eVk ∑K k′=1 [ eVk′ eVk ∑K k′=1 ∑K k′=1 eVk′ ∏J j=1 eVnj|k Vnj′ e ∑J j′=1 ]ynj ] |k (18) where γqnk is considered as the posterior probability of the classes. Combining equations (17) and (18), we can formulate the expected value of the log-likelihood as: E(LL) = N ∑ K ∑ J ∑ n=1 k=1 j=1 ynjγqnklog [ eVnj|k j′=1 eVnj′ ∑J |k ] + + N ∑ K ∑ n=1 k=1 γqnklog ] [ eVk k′=1 eVk′ ∑K (19) By setting the derivatives of the expected log-likelihood to zero with respect to the unknown parameters βk of the choice model, we can estimate them with the following equation: βk = argmaxβk N ∑ J ∑ n=1 j=1 ynjγqnk log ] [ eVnj|k j′=1 eVnj′ ∑J |k (20) where no closed-form solution can be obtained. Thus, we employ the gradient-based numerical optimization method BFGS [33]. For the unknown parameters of the class membership, back-propagation with cross-entropy loss is applied since the parameters are encoded inside a neural network. As presented in [19], min- imizing the cross entropy loss is equivalent to maximizing the log-likelihood function, which allows us to compute the Hessian matrix and, therefore, provides useful post-estimation indica- tors such as the standard deviation or the confidence intervals of the parameters of the model. After convergence is reached, we can calculate the probability of observing a vector of choices y for all individuals as follows: P (y) = N ∏ K ∑ n=1 k=1 P (qnk|Qn, γk, rn, bk) J ∏ j=1 (P (ynj|Xnj, qnk, βk) )ynj (21) 11 To benchmark our proposed model we use the formulation presented in [3] as baseline. One can represent it in graphical representation, similarly as in 3, with the difference that the relation between the indicators' utility and the decision-makers' socio-demographic characteristics is linear. 4 Data The data used in this study comes from a survey carried out for the Share-More project 2, which aimed to analyse individual preferences towards car-sharing (CS) services under different per- sonalized incentive schemes. The data was collected through a tailor-made online survey (available in both web and mobile versions), from July 16th to August 6th 2020, in Copenhagen (CPH). Respondents were recruited through panels, and the eligibility criteria were being more than 18 years old and having a valid driver's license. The survey yielded a total of 542 complete answers and was available in English and Danish. The average duration was around 15 minutes. It included five relevant parts: 1. A brief introduction to the project and its objective. 2. A survey on the subject's socio-demographic characteristics (Qn), including experience with CS. 3. A survey addressing questions regarding the respondents' attitudes toward private and CS. The respondents' perceptions in regard to car ownership and CS usage were measured by their level of agreement with relevant statements using a 5-point Likert scale. The statements employed are presented in Table 1. 4. A survey with questions related to preferences about CS incentives. 5. A Stated Preference (SP) experiment with different options for CS plans, taking into ac- count possible incentive schemes for CPH. 2https://eitum-sharemore.net.technion.ac.il/ 12 Indicator Description I1 I2 I3 I4 I5 I6 I7 I8 I9 I10 I11 I12 I13 I14 I15 I16 I17 I feel stressed when driving It is difficult to find parking Owning and using a car is a big expense It's easy for me to conduct my daily trips without a private car Driving a car is the most convenient way to move around For me the car is a status symbol I am worried about the environmental footprints of my car Car sharing is more affordable than owning my own car Car sharing is a more environmentally friendly alternative to car ownership By using car-sharing, I do not have to deal with vehicle maintenance and repair Thanks to car sharing, I can save from the fuel, taxes, insurance and parking expenses associated with private vehicle ownership Having access to different types of vehicles is an important advantage Using car-sharing service can lower my transport expenses Using car-sharing whenever I need it can make my life easier I would not need to buy a car because I have car-sharing Car-sharing is more convenient than public transport I wouldn't mind sharing my personal car with other people Table 1: Attitudinal indicators employed in the survey The sample socio-characteristics (Qn) are described in Table 2. More than 90% of respon- dents stated to be aware of CS services, which indicates that they are well-known. The sample is quite balanced regarding gender and proportionally representative of the population in terms of age. Most of the respondents live in the city centre and are employed. For the level of education, more than 60% of the population have at least a bachelor's degree. Moreover, most respondents live in households of 1 or 2 members, up to one car and have two or more bikes at home. Given the income level, most respondents earn around average (350.000 kr./year) or above, which is likely related to the high level of education of the sample. 13 Car -sharing membership status Car-sharing awareness Gender Age Place of residence Employment status Level of education Size of the household Number of cars in the household Number of bicycles in the household Income Car-sharing member Past-car sharing member Non-car-sharing member Yes No Man Woman Prefer not to say 18-30 31-40 41-50 51-60 More than 60 City center Suburbs Another city in the metropolitan region Outside the metropolitan region Student Employed Unemployed On leave Retired Other Less than high school High school diploma or equivalent Bachelor's degree Master's degree Doctoral degree Other Did not answer 1 2 3 4 >4 0 1 2 >2 0 1 2 >2 Low (Up to 250.000 kr.) Medium (251-500.000 kr.) High (Over 500.000 kr.) Did not answer Total 96 64 383 490 53 267 275 1 146 88 97 88 124 235 190 71 47 74 354 12 7 100 8 39 150 169 134 8 17 26 152 223 80 68 20 139 304 91 9 40 128 156 219 82 140 221 100 % 17.68 11.79 70.53 90.24 9.76 49.17 50.64 0.18 26.89 16.21 17.86 16.21 22.84 43.28 34.99 13.08 8.66 13.63 65.19 2.21 1.29 18.42 1.47 7.18 27.62 31.12 24.68 1.47 3.13 4.79 27.99 41.07 14.73 12.52 3.68 25.60 55.99 16.76 1.66 7.37 23.57 28.73 40.33 15.1 25.8 40.7 18.4 Table 2: Copenhagen Sample characteristics 14 For further details on the survey and the CPH data collection and sampling processes, the reader is referred to [34, 35]. Our analysis focuses on the data from parts 2, 4 and 5 of the questionnaire, using the latter for modelling the choice of CS subscription plans. In this SP, each respondent answered 3 exper- iment tasks which presented 4 CS alternative plans with 8 associated attributes Xn, (one-time subscription cost, usage cost, walking time to access the vehicle, probability to get a shared vehicle, CS vehicle type, CS vehicle engine type, walking time from parking location to des- tination and extra features) and the option to select 'None of the alternatives.' Figure 4 shows an example of a choice task presented to the respondents. To minimize response bias, the order of appearance of the attributes was random for each individual but was the same for the three tasks presented to the same individual. Figure 4: Example of choice task presented to respondents As the name suggests, in one-way CS (station-based), or OWSB, the cars can be found in fixed locations (stations) around the city. The user can take a vehicle from one of the fixed loca- tions available and return it to the same place or another fixed location available in the service. In one-way CS (free-floating), or OWFF, the users can pick up or return the car in any available parking spot in the city within a delimited coverage area of the service (thus, no fixed stations), giving extra freedom to users. In roundtrip CS (RT), one can pick up a car at fixed stations scat- tered around the city, and need to drop it off at the same location. Finally, peer-to-peer (P2P) CS services are those which make it possible for vehicle owners to rent out their cars to other users for a defined time period, also relying on fixed (and identical) pick-up and drop-off locations for a given ride. The attributes of the alternatives included in the tasks and their corresponding levels were se- lected by considering the published literature and qualitative surveys previously conducted dur- ing the Share-More project [34, 35]. The cost of usage was presented in cost per minute, hour or day to test the influence of these units on respondents' choices. 15 5 Results 5.1 Baseline Model Results To benchmark the proposed model, we tried to use the formulation presented in the general- ized random utility model [3] as a baseline. One can represent it in graphical representation, similarly as in Figure 3, with the difference that the relation between the indicators' utility and the decision-makers socio-demographic characteristics is linear instead of a densely connected layer. However, the class membership formulation's simplicity made the model unable to con- verge for our data, making the Hessian matrix for the variance computation not invertible. To have a benchmark model with comparable magnitude for the likelihood, we have estimated the model with a traditional LCCM as a baseline without including the attitudinal variables. We have employed 20% of the data for testing, dividing the data into train and test with 433 and 109 individuals, respectively. The results are presented in Table 2: Model No Classes No parameters Null LL -2047.21 LCCM -2047.21 LCCM 30 43 2 3 LL -1599.41 -1568.14 AIC BIC R-squared Test null LL Test LL -400.52 -398.73 -515.02 -515.02 0.22 0.23 3258.81 3413 3234.29 3487 Table 3: LCCM results without attitudinal variables For the models above, we have used the same socio-characteristics for constructing the class membership as in our proposed formulation. More specifically, we employed age, binary vari- ables that indicate if the decision-makers have a bike or car at home, their CS membership status, kids at home, or if they are students or retired. However, we found that having a car at home, being retired or being a student is not statistically significant under this formulation. When applying the proposed formulation, we can effectively include this information in the model, which improve our characterization of the latent space. Given the probability of each individual in the sample and its corresponding socio-characteristics, we have represented the classes in Figure 5, by using the Bayes Theorem to compute: Pn(socio − characteristic|K = k) (22) where k is the corresponding class number. Figure 5: Representation of the class membership of the LCCM model Figure 5 is compared in the next subsection with the proposed model results. 16 5.2 Proposed Model Results We have explored our proposed formulation for different numbers of latent classes and latent variables. We have employed the same train/test split as for the baseline model. It is important to note that our EM process has been replicated five times with random initializations. We have computed the likelihood variance between the different obtained model estimates to check for stability. The results are summarized in the following table: No Classes 2 3 3 No latent variables 2 2 3 EM iterations 15 30 25 Null LL LL -2047.21 -1575.32 -2047.21 -1539.56 -2047.21 -1531.41 Variance LL 14.62 22.01 26.36 R-squared 0.23 0.25 0.25 Test null LL -515.02 -515.02 -515.02 Test LL -404.72 402.72 -400.73 Variance Test LL 0.28 9.8 9.36 Table 4: Model results The model with three latent classes and two latent variables has given the best overall esti- mation. Even though the model with three classes and three latent classes has a slightly better fit, when another latent variable is included, its corresponding estimates parameters were not statistically significant, which made us reject this model formulation. Comparing the results from Tables 3 and 4, we observe an increase in the training likelihood for our formulation. On the other hand, we do not provide better results for the test data, but just comparable ones. This could be due to the small size of the test sample or to the fact that we don't have access to attitudinal information or wn values in the test stage, which can affect the prediction accuracy. We now analyse the parameters of the best model, where all the data has been used for the esti- mation. Variable ASCCS f ree−f loating ASCCS station−based ASCCS peer to peer ASCroundtrip βOne time subscription cost βU sage cost(OW F F ,OW ST ,RT ) βU sage cost(P 2P ) βU sage cost per day βU sage cost per hour βOnly combustion cars βP robability of f inding a shared car βW alking time f rom parking to destination Class specific choice model Class 2 -2.71(1.34) -2.64(1.34) 0.47(1.45) -3.50(0.40) -1.12(0.51) -0.16(0.09) -5.57(1.31) -2.40(0.74) -0.99(0.50) 0.09(0.33) 1.38(1.35) 0.02(0.04) Class 3 -1.68(0.89) 0.07(0.80) 1.50(0.83) 0.15(0.80) -0.35(0.22) -0.34(0.08) -3.86(0.80) -1.09(0.39) -0.43(0.34) -0.66(0.20) 2.70(0.75) 0.03(0.02) Class 1 3.50(0.46) 3.04(0.48) 4.12(0.52) 2.97(0.48) -1.00(0.17) 0.05(0.04) -1.30(0.39) -0.35(0.24) -0.10(0.21) -0.23(0.12) 0.13(0.44) -0.05(0.01) Table 5: Estimate and standard deviation of the parameters of the class-specific choice model 17 Variable ASCclass1 ASCclass2 γkidsathome,class1 γkidsathome,class2 δr1,class1 δr1,class2 δr2,class1 δr2,class2 bclass1 bclass2 Parameter St error P-value 0.031 0.0057 0.050 0.22 0.17 0.0009 0.27 0.00 0.17 0.00 0.97 -1.40 0.56 -0.45 0.18 -0.48 0.12 -0.44 0.61 -4.014 0.45 0.51 0.29 0.37 0.13 0.14 0.10 0.11 0.44 0.54 Table 6: Parameters of the class membership model Table 5 shows the estimated parameters of the class-specific choice model with its corre- sponding standard deviation. The utility for not choosing any of the CS services offered is set to zero for parameter identification. Based on the values and signs of the estimated beta parameters, we observe that class 1 and class 2 are more negatively affected by the subscription cost, while class 3 is less influenced by this cost, but more negatively affected by the cost usage. In general, P2P presents a higher alternative-specific value than the other alternatives for all the classes. However, this is compen- sated by the βU sage cost(P 2P ) values being also more damaging in the three classes. Class 2 is the one less inclined about the P2P CS type since it has the lowest ASC-P2P and the more negative βU sage cost(P 2P ) estimator. On the other hand, individuals with a high probability of belonging to class 3 are the most concerned if the type of engine is just combustion. Thus, CS could possibly be seen as an electric alternative to those who are more worried about the environmental foot- print of their trips. Given the beta values for displaying the cost in hours (βU sage cost per hour) or days (βU sage cost per day), Table 5 also shows a bias towards displaying the price per minute (base- line) instead of per day or hour across all the classes, related to the fact that CS users tend to drive it for short time periods. Regarding the probability of finding a car, it is a more important feature for classes 2 and 3, which make them more dependent on the availability of the service. Overall, class 2 seems to be less prone to use any CS, given all its estimated parameters. The parameters of the class membership model are summarised in Table 6. Given the prob- ability of each individual in the sample and its corresponding socio-characteristics, we have represented the classes in Figure 6. Individuals with a higher probability of belonging to class 1 have around 20% probability of being a CS member, a bit above the sample average (17.5%). They also tend to have more kids at home, as well as bikes than the other classes. Studies like [37] have shown that when there are significant life changes, such as the birth of a child, people become more inclined to use CS. On the other hand, class 2 presents the lowest probability of being a CS member and having kids or bikes at home. Retired people tend to have more predis- position for this class, while students have less. This is aligned with evidence in the literature [38] suggesting that young people are more prone to use this service. Finally, class 3 has the same probability of being a CS member as class 1, but it is also the class with less probability of having a car at home which could make them more dependent on the availability of the service. 18 Figure 6: Representation of the class membership of our proposed model Comparison between Figure 5 and Figure 6, shows that the configuration of the classes with respect to the socio-characteristics changes when we include attitudinal information, as is expected. However, bearing in mind that the betas values of the two models are slightly different and classes cannot be directly compared. Continuing with the proposed formulation results, in order to understand the implications of the coefficient of the latent variables in the utility of the class membership model, we have plotted the latent constructs for each individual in the sample and characterised them with their socio- characteristics. Figure 7 provides us with a visual understanding of how these latent variables are constructed and distributed. Figure 7: Latent variables representation characterised by socio-characteristics By analysing the parameters for the latent variables in Table 6 and looking at their distribu- tions in Figure 7, we notice that the values of the first latent variable (r1) are always negative. 19 The more negative value of r1, the more probable is to belong to class 2, and therefore, the less inclined people are to use CS services. A negative value of r2 seems to have the same effect. Thus, individuals with a more negative combination of r1 and r2 tend to be less inclined about CS and the other way around. Figure 7, suggests that students are more prone to use the service while retired people are the least predisposed. Moreover, having or not having a car seems to determine the clusters in which the rs values are structured, as we can see in the upper right plot of Figure 7. The coefficients of the ωn parameter are a representation of the heterogeneity present in the classes. Therefore, class three seems to be more heterogeneous. Finally, the parameters of the utility for each of the indicators are presented in Table 7. The mean accuracy for all the indicators given the ordinal logit probability is 0.44. Indicator I1 I2 I3 I4 I5 I6 I7 I8 I9 I10 I11 I12 I13 I14 I15 I16 I17 α1 0.24 0.43 -0.14 -0.22 -0.40 0.19 -0.026 -0.40 0.09 -0.070 -0.40 -0.33 -0.040 0.019 -0.095 -0.17 0.17 α2 0.42 0.34 0.28 0.27 0.24 -0.38 0.23 0.14 0.045 0.19 -0.083 -0.016 0.044 -0.10 0.45 0.43 0.34 c 0.65 -0.14 0.65 0.87 0.56 -0.62 1.59 2.59 1.72 2.56 2.28 2.97 1.80 2.40 2.42 2.35 1.60 Table 7: Parameters of the measurement model Finally, it is interesting to see how the answers for some indicators are distributed in the latent space. Figures 7 and 8, show that people with a car at home agree more with the statement that the car is a status symbol. For indicator 15, people with a more positive value of r2 seem to agree more with the statement that they wouldn't need a car if they have CS, as we would expect given the r2 coefficients of Table 6 and the positive α2 coefficient for the utility of indicator 15 in Table 7. 20 Figure 8: Latent variables representation characterized by the answers to indicators 6 and 15 6 Conclusions We focused on the relevance and impact of adding attitudinal information to the models, evi- dencing its importance in configuring the latent classes for heterogeneity representation. We propose a new way to account for complex (and non-linear) constructs of latent classes by ex- tending the general random utility model with ML frameworks for latent space representation. We have tested our proposed framework for estimating a car-sharing (CS) service subscription choice with SP data from Copenhagen, Denmark. Our results confirm that the inclusion of at- titudinal variables provides a DCM more behaviorally realistic. For example, individuals who are more inclined towards the concept of CS tend to be grouped together in classes with higher parameter estimates of the utility of choosing different CS plans. Also, as expected, such classes are sensitive to different attributes of the CS plans, but, more importantly, the complex struc- ture of such classes can be modelled by considering non-linear formulations learned by an ANN framework. This confirms that complex beliefs and attitudes play a key role in CS subscription decision-making, and including this information allows for more accurate estimation and a bet- ter understanding of the classes. From the application perspective, it provides us with extra insights to help us design better poli- cies by having a more realistic population segmentation. In our CS application, when creating new approaches to attract and retain CS members, attitudinal information allows us to focus on changing beliefs and mindsets that we know are closely related to individual choices. Finally, it also helps to understand better how the decision-making process works from a theoretical point of view. We have also improved our understanding of how the features of the CS business can maintain and attract new members. We have noted the importance of the subscription and usage cost throughout all the models. In addition, the price format is relevant to the decision, and the price per minute display is the most attractive, possibly driven by the past experience in the case-study at stake. We have also observed that the availability of cars is essential in attracting new members, which can be seen as an improvement opportunity for CS companies. Choosing an electric car is more favourable for those more inclined to use CS, so having a fleet with electric vehicles can be essential to maintain CS members. Our study also has a few limitations. Regarding our proposed model at the estimation level, the values of the latent variables change between iterations, even though the underlying struc- ture and model probabilities are kept between runs. This is the main difference between an ML learning approach and a traditional DCM estimation, where all the parameters need to be identi- fiable. On the other hand, convergence is defined empirically by setting the number of iterations due to small fluctuations in the convergence of the EM algorithm. Also, given the small sample 21 size, we could not divide the dataset in training, validation, and testing; therefore, the hyper- parameters referring to the number of nodes and layers in the NN were not tuned according to the validation samples. Regarding our overall model architecture, and in order to improve the prediction performance, further work can be done, trying to apply other types of explainable AI (XAI) and other latent space representations (word embeddings) [23]. Although this work has its limitations, we are optimistic that this analysis has opened the door to future research on integrating attitudinal variables in DCMs through ML techniques. This inves- tigation could improve the overall model fit and prediction accuracy, thanks to the representation of heterogeneity due to ML techniques' ability to capture complex unobserved patterns. How- ever, we always have to bear in mind that the transparency and interpretability of new modelling frameworks are of utmost importance. 6.1 Acknowledgements We thank Share-More project for providing the data used in this study and eMOTIONAL Cities- Grant agreement ID: 945307, funding from EU's Horizon 2020. 3 3https://emotionalcities-h2020.eu/ 22 References [1] Hess, S., Ben-Akiva, M., Gopinath, D., Walker, J. (2009). Taste heterogeneity, correla- tion, and elasticities in latent class choice models, in Transportation Research Board 88th Annual Meeting. [2] Hess, S. (2014). Latent class structures: Taste heterogeneity and beyond, Handbook of Choice Modelling, pp. 311–329. doi: 10.4337/9781781003152.00021. [3] Walker, J., & Ben-Akiva, M. (2002). Generalized random utility model. Mathematical social sciences, 43(3), 303-343. [4] Motoaki, Y., & Daziano, R. A. (2015). A hybrid-choice latent-class model for the analysis of the effects of weather on cycling demand. Transportation Research Part A: Policy and Practice, 75, 217-230 [5] Haustein, S., Hunecke, M., 2013. Identifying target groups for environmentally sustainable transport: assessment of different segmentation approaches. Curr. Opin. Environ. Sustain. https://doi.org/10.1016/j.cosust.2013.04.009. [6] Haustein, S., 2012. Mobility behavior of the elderly: An attitude-based segmenta- tion approach for a heterogeneous target group. Transportation (Amst) 39, 1079–1103. https://doi.org/10.1007/s11116-011-9380-7 [7] Bahamonde-Birke, F.J., Kunert, U., Link, H. et al. About attitudes and perceptions: finding the proper way to consider latent variables in discrete choice models. Transportation 44, 475–493 (2017). https://doi.org/10.1007/s11116-015-9663-5 [8] Weibo Li, Maria Kamargianni (2020) An Integrated Choice and Latent Variable Model to Explore the Influence of Attitudinal and Perceptual Factors on Shared Mobility Choices and Their Value of Time Estimation. Transportation Science 54(1):62-83. https://doi.org/10.1287/trsc.2019.0933 [9] Paulssen, M., Temme, D., Vij, A. et al. Values, attitudes and travel behavior: a hierarchi- cal latent variable mixed logit model of travel mode choice. Transportation 41, 873–888 (2014). https://doi.org/10.1007/s11116-013-9504-3 [10] McFadden, D., Economic Choices. The American Economic Review, Vol. 91, No. 3 (Jun., 2001), pp. 351-378 [11] Train K.,(2009) Discrete Choice Methods with Simulation, Cambridge University Press. 153- 168. [12] McFadden, D., Train, K. (2000). Mixed MNL models for discrete response. Journal of applied econometrics 15: 447-470. [13] Hurtubia, R., Nguyen, M. H., Glerum, A., & Bierlaire, M. (2014). Integrating psychome- tric indicators in latent class choice models. Transportation Research Part A: Policy and Practice, 64, 135-146. [14] McFadden, D., 1986. The choice theory approach to market research. Market. Sci. 5 (4), 275–297. 23 [15] Atasoy, B., Glerum, A., & Bierlaire, M. (2011). Mode choice attitudinal latent class: a Swiss case-study. Second International Choice Modeling Conference, July 2011 [16] Likert, R. (1932) A technique for the measurement of attitudes. Arch. Psychol. 22 (140). [17] Krueger, R., Vij, A., Rashidi, T.H..(2016). Normative belief and modality styles: a latent class and latent variable model of travel behaviour. Springer Science+Business Media New York. [18] Alonso-González, M. J., Hoogendoorn-Lanser, S., van Oort, N., Cats, O., Hoogendoorn, S. Drivers and barriers in adopting Mobility as a Service (MaaS) – A latent class cluster analysis of attitudes, (2020). Transportation Research Part A: Policy and Practice, Volume 132, Pages 378-401, ISSN 0965-8564,https://doi.org/10.1016/j.tra.2019.11.022. [19] Sifringer, B., Lurkin, V., & Alahi, A. (2020). Enhancing discrete choice models with rep- resentation learning. Transportation Research Part B: Methodological, 140, 236-261. [20] Bentz, Y., & Merunka, D. (2000). Neural networks and the multinomial logit for brand choice modelling: a hybrid approach. Journal of Forecasting, 19(3), 177-200. [21] Hruschka, H., Fettes, W., Probst, M., & Mies, C. (2002). A flexible brand choice model based on neural net methodology a comparison to the linear utility multinomial logit model and its latent class extension. OR spectrum, 24(2), 127-143. [22] Hruschka, H., Fettes, W., & Probst, M. (2004). An empirical comparison of the validity of a neural net based multinomial logit choice model to alternative model specifications. European Journal of Operational Research, 159(1), 166-180. [23] Arkoudi, I., Azevedo, C. L., & Pereira, F. C. (2021). Combining Discrete Choice Mod- els and Neural Networks through Embeddings: Formulation, Interpretability and Perfor- mance. arXiv preprint arXiv:2109.12042. [24] Pereira, F. C. (2019). Rethinking travel behavior modeling representations through em- beddings. arXiv preprint arXiv:1909.00154. [25] Han, Y., 2019. Neural-Embedded Discrete Choice Models. [26] Sfeir, G., Rodrigues, class choice models. Transportation Research Part C: Emerging Technologies, 136. https://doi.org/10.1016/j.trc.2022.103552 F., Abou-Zeid, M. Gaussian process latent [27] Sfeir, G., Abou-Zeid, M., Rodrigues, F., Pereira, F.C., Kaysi, I. (2021). Latent class choice model with a flexible class membership component: A mixture model approach. Journal of Choice Modelling, 41, 100320. https://doi.org/10.1016/j.jocm.2021.100320 [28] Wong, M., Farooq, B., Bilodeau, G.A., 2018. Discriminative Conditional Restricted Boltz- mann Machine for Discrete Choice and Latent Variable Modelling. J. Choice Model. 29, 152–168. https://arxiv.org/abs/1706.00505 [29] Ben-Akiva, M., Walker J., Bernardino A. T., Gopinath, D. A., Morikawa, T., & Poly- doropoulou, A. (2002). Integration of choice and latent variable models. Chapter 21 In: Mahmassani, Hani S. (Ed.), In perpetual motion: Travel behaviour research opportunities and application challenges. Emerald Group Publishing Limited, Bingley, United Kingdom, pp. 431–470. 24 [30] Train, K.E., 2008. EM algorithms for nonparametric estimation of mixing distributions. J. Choice Model. 1, 40–69. https://doi.org/10.1016/S1755-5345(13)70022-8 [31] Dempster, A.P., Laird, N.M., Rubin, D.B., 1977. Maximum Likelihood from J. R. Stat. Soc. Ser. B 39, 1–38. Incomplete Data via the EM Algorithm. https://doi.org/10.1177/019262339101900314 [32] Train, K., D. McFadden and A. Goett (1986). The Incorporation of Attitudes in Econo- metric Models of Consumer Choice. Cambridge Systematics working paper. [33] Nocedal, J., Wright, S.J., Robinson, S.M., 1999. Numerical Optimization. Springer, New York. [34] Frenkel, A., Shiftan, Y., Gal-Tzur, A., Tavory, S. S., Lerner, O., Antoniou, C., Cantelmo, G., Amini, R. E., Lima Azevedo, C. M., Monteiro, M.M., Kamargianni, M., Shachar, F. S., Israel, D., Behrisch, C., Schiff, K., Shalev, J., & Peretz, D.(2021). Share More: Shared MObility Rewards - Summary report. https://orbit.dtu.dk/en/publications/share- more-shared-mobility-rewards-summary-report [35] Monteiro, M. M.; Azevedo, C. M. L.; Kamargianni, M.; Cantelmo, G.; Tavory, S. S.; Gal-Tzur, A.; Antoniou, C.; Shiftan, Y. Car-Sharing Subscription Preferences and the Role of Incentives: The Case of Copenhagen, Munich, and Tel Aviv-Yafo. arXiv preprint arXiv:2206.02448 [36] Københavns Kommune. City of Cyclists. https://urbandevelopmentcph.kk.dk/artikel/city- cyclists Accessed Apr. 30, 2020. [37] Priya Uteng, T., T. E. Julsrud, and C. George. The Role of Life Events and Context in Type of Car Share Uptake: Comparing Users of Peer-to-Peer and Cooperative Programs in Oslo, Norway. Transportation Research Part D: Transport and Environment, Vol. 71, No. June 2018, 2019, pp.186–206. https://doi.org/10.1016/j.trd.2019.01.009. [38] Prieto, M., G. Baltas, and V. Stan. Car Sharing Adoption Intention in Urban Areas: What Are the Key Sociodemographic Drivers? Transportation Research Part A: Policy and Prac- tice, Vol. 101, 2017, pp. 218–227. https://doi.org/10.1016/j.tra.2017.05.012. 25
http://arxiv.org/abs/2302.09865v2
2023-03-07T07:23:38
2023-02-20T09:56:51
Can discrete information extraction prompts generalize across language models?
We study whether automatically-induced prompts that effectively extract information from a language model can also be used, out-of-the-box, to probe other language models for the same information. After confirming that discrete prompts induced with the AutoPrompt algorithm outperform manual and semi-manual prompts on the slot-filling task, we demonstrate a drop in performance for AutoPrompt prompts learned on a model and tested on another. We introduce a way to induce prompts by mixing language models at training time that results in prompts that generalize well across models. We conduct an extensive analysis of the induced prompts, finding that the more general prompts include a larger proportion of existing English words and have a less order-dependent and more uniform distribution of information across their component tokens. Our work provides preliminary evidence that it's possible to generate discrete prompts that can be induced once and used with a number of different models, and gives insights on the properties characterizing such prompts.
[ "Nathanaël Carraz Rakotonirina", "Roberto Dessì", "Fabio Petroni", "Sebastian Riedel", "Marco Baroni" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09865v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09865v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.AI", "cs.LG" ]
3 2 0 2 r a M 7 ] L C . s c [ 2 v 5 6 8 9 0 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 CAN DISCRETE INFORMATION EXTRACTION PROMPTS GENERALIZE ACROSS LANGUAGE MODELS? Nathana ̈el Carraz Rakotonirina,1 Roberto Dess`ı,1,2, Fabio Petroni,3 Sebastian Riedel,4 Marco Baroni1,5 1Universitat Pompeu Fabra, 2Meta AI, 3Samaya AI, 4University College London, 5ICREA ABSTRACT We study whether automatically-induced prompts that effectively extract informa- tion from a language model can also be used, out-of-the-box, to probe other lan- guage models for the same information. After confirming that discrete prompts induced with the AutoPrompt algorithm outperform manual and semi-manual prompts on the slot-filling task, we demonstrate a drop in performance for Au- toPrompt prompts learned on a model and tested on another. We introduce a way to induce prompts by mixing language models at training time that results in prompts that generalize well across models. We conduct an extensive analysis of the induced prompts, finding that the more general prompts include a larger proportion of existing English words and have a less order-dependent and more uniform distribution of information across their component tokens. Our work pro- vides preliminary evidence that it's possible to generate discrete prompts that can be induced once and used with a number of different models, and gives insights on the properties characterizing such prompts.1 1 INTRODUCTION NLP has shifted to a paradigm where very large pre-trained language models (LMs) are adapted to downstream tasks through relatively minor updates (Bommasani et al., 2021; Liu et al., 2021). In the most extreme case, task adaptation does not require modifying the LM or even accessing its internals at all, but simply formulating a linguistic query that elicits an appropriate, task-specific response by the model (Petroni et al., 2019a; Radford et al., 2019). This has promising practical applications, as one could easily imagine proprietary LMs only exposing a natural-language-based interface, with downstream agents extracting the information they need by formulating the appropriate queries.2 In this scenario, one fundamental question is how robust the querying protocol is to changes in the underlying LM. On the one hand, the same downstream agent might want to query multiple LMs. On the other, if the LM provider updates the model, this should not break the downstream pipeline. On a more theoretical level, the properties of an emergent robust protocol might give us insights on the general language processing capabilities of neural networks, and how they relate to natural language. We present a systematic study of the extent to which LM query protocols, that, following current usage, we call prompting methods, generalize across LMs. Extending and confirming prior results, we find that discrete prompts that are automatically induced through an existing optimization proce- dure (Shin et al., 2020) outperform manually and semi-manually crafted prompts, reaching a good performance level when tested with the same LM used for prompt induction. While the automati- cally induced discrete prompts also generalize better to other LMs than (semi-)manual prompts and currently popular "soft" prompts, their overall generalization performance is quite poor. We next show that a simple change to the original training procedure, namely using more than one LM at prompt induction time, leads to discrete prompts that better generalize to new LMs. The proposed procedure, however, is brittle, crucially relying on the "right" choice of LMs to mix at prompt in- duction. We finally conduct the first extensive analysis of automatically induced discrete prompts, 1The code to reproduce our analysis is available at https://github.com/ncarraz/prompt_ generalization. 2As a concrete example, one of the most powerful current LMs, GPT3, is only available via a text-based API (https://beta.openai.com/overview). 1 Published as a conference paper at ICLR 2023 Figure 1: Cartoon summary of our main results. Prompts induced using a single language model have a significant drop of performance when used to query other models. The problem is allevi- ated when prompts are exposed to multiple models in the induction phase. Subtle but consistent differences in the nature of the induced prompts also emerge. tentatively identifying a set of properties characterizing the more general prompts, such as a higher incidence of existing English words and robustness to token shuffling and deletion. 2 RELATED WORK Prior work such as Petroni et al. (2019a) and Radford et al. (2019) demonstrated that LMs can be directly adapted to new tasks through appropriate querying methods. This led to an explosion of work on so-called "prompt engineering" (see Liu et al., 2021, for a thorough review). Much of this work focuses on crafting appropriate manual or semi-manual prompts and/or on tuning LMs to better respond to such prompts (e.g., Schick & Sch ̈utze, 2021; Sanh et al., 2022). Going beyond manual prompts, Shin et al. (2020) introduced the AutoPrompt algorithm to generate prompts using gradient-guided search, and demonstrated that such prompts often outperform manual ones. While automatically induced prompts suffer of issues such as low-interpretability, we think it is important to continue focusing on them because, besides their better performance (a result we confirm here for AutoPrompt across a range of LMs), they are more promising than manual prompts in terms of scalability, especially in contexts in which it is not sufficient to formulate a single prompt template for a whole task, but each input query demands a distinct prompt formulation (Zhang et al., 2022). Concurrent and later work has proposed to replace discrete strings, such as those generated by AutoPrompt, with sequences of arbitrary vectors from the LM's embedding space (Lester et al., 2021; Zhong et al., 2021). We confirm here that these continuous, or "soft" prompts outperform AutoPrompt when trained and tested on the same LM. However, they cannot be used in our envis- aged multiple-LM scenario. First, they require access to a model inner representations, beyond the standard natural language querying interface, so that embeddings can be passed as input. Second, continuous prompts, by their nature, won't generalize out-of-the-box to other LMs. Trivially, they can't generalize across models with different embedding dimensionality. Even when models share dimensionality, there is no reason why the absolute position of a vector in the embedding space of a model should meaningfully transfer to another model. Discretizing soft prompt tokens to their near- est vocabulary neighbours in order to overcome these issues does not help either. Khashabi et al. (2021) demonstrated that it is possible to find well-performing soft prompts whose nearest neighbor projections are arbitrarily fixed discrete tokens. Appendix B elaborates on the failure of soft prompts to generalize across models, as well as the problematic behaviour of discretized soft prompts. We are not aware of much previous work that has addressed the challenge of LM-to-LM transfer- ability. Wallace et al. (2019) studied this problem in the context of textual adversarial attacks (that can be seen as a special case of prompting, and indeed their attack method is closely related to AutoPrompt). Similarly to us, they notice some performance drop when transferring adversarial "triggers" to different LMs, and they show that this can be mitigated by an ensembling approach where two triggers generated using variants of the same LM are combined. Su et al. (2022) study LM-to-LM transferability in the context of continuous prompts. Since, as we just discussed, such prompts are not directly transferable, they induce a projection from the embedding space of the source LM to that of the target LM, thus considering a very different scenario from the type of "out-of-the-box" transferability we are interested in here. 2 Published as a conference paper at ICLR 2023 3 EXPERIMENTAL SETUP 3.1 DATA We focus on the task of slot-filling which, since its introduction in LM evaluation through the LAMA benchmark (Petroni et al., 2019a), has been extensively used to probe the knowledge contained in LMs (AlKhamissi et al., 2022). More specifically, we use the T-ReX split (Elsahar et al., 2018) of LAMA. Each fact in T-ReX is represented as a triple (cid:104)subject, relation, object(cid:105)-for example, (cid:104)Dante, place of birth, Florence(cid:105). LMs are queried using cloze prompts as in "Dante was born in ." A LM is said to have properly stored a fact if it can successfully predict the ground-truth object given a prompt and the corresponding subject. We have decided to focus primarily on this task because the prompts convey actual semantic information (characterizing the relation between the subject and the object) rather than just metalinguistic information (as would be the case, for example, for a machine-translation prompt, which might express something like: "translate the next sentence from English to French"). Furthermore, the task requires learning a different prompt for each relation, which can be seen as a first step toward fully flexible prompts that would change with each single input (Zhang et al., 2022). The LAMA test set contains 41 relations, each with up to 1,000 facts. We also evaluate on the more challenging LAMA-UHN subset (Poerner et al., 2019), addressing some of the weaknesses of the original LAMA, in Appendix D. All prompting methods are trained using the training data collected by Shin et al. (2020), which include 1,000 facts for each relation type, drawn from either the original T-REx dataset or Wikidata. LAMA also provides manual prompts, which we will use in our experiments. Since each LM class in our experiments (see Section 3.2 below) has its own vocabulary, a common subset must be used for fair comparison. This is obtained from the intersection of the vocabularies of all models considered. Furthermore, the training and test datasets are filtered to ensure that each object is included in the common vocabulary. There are 11,511 case-sensitive items in the common vocabulary. The filtered test set contains 25,358 facts, while the training set contains 25,247 facts. We evaluate prompting methods using micro-averaged accuracy (precision@1). 3.2 LANGUAGE MODELS Our experiments cover the three main types of LM. We use pre-trained LMs without any kind of parameter updating. Table 1 shows the LMs considered in this study. Masked LMs They produce representations using both the left and right context. Given a se- quence x = [x1, ..., xn], they estimate the probability of a token xi given its left and right context p(xi) = p(xi|x1, ..., xi−1, xi+1, ..., xn). Left-to-right LMs They predict the next token conditioned on previous ones or assign a probabil- ity to a sequence of tokens. Given a sequence of tokens x = [x1, ..., xn], left-to-right LMs assign a probability p(x) to the sequence using the chain rule p(x) = (cid:81) t p(xt|x1, ..., xt−1). Sequence-to-sequence LMs They are composed of a bidirectional encoder that uses both left and right context and a left-to-right decoder that do not share parameters. 3.3 PROMPT INDUCTION METHODS Prompts are either manually crafted or generated automatically by prompting methods. In this study, we have selected 3 different prompting methods that are representative of semi-manual, discrete and continuous induction methods, respectively. They have been shown to perform well on the slot filling task and associated code is publicly available. LPAQA Starting from seed manual prompts, Jiang et al. (2020) generate a diverse candidate prompt set using mining- and paraphrasing-based methods. For each relation, the best perform- ing candidate on the training data is selected. To improve performance, the authors also propose 3 Published as a conference paper at ICLR 2023 Table 1: Pre-trained language models considered in this study. Type Model Masked BERTBASE (Devlin et al., 2019) Masked BERTLARGE (Devlin et al., 2019) Masked DistilBERT (Sanh et al., 2019) Masked RoBERTaBASE (Liu et al., 2019) RoBERTaLARGE (Liu et al., 2019) Masked DistilRoBERTa (Sanh et al., 2019) Masked GPT2 (Radford et al., 2019) Left-to-right GPT2MEDIUM (Radford et al., 2019) Left-to-right Left-to-right GPT2LARGE (Radford et al., 2019) Left-to-right GPT2XL (Radford et al., 2019) Seq2seq BARTBASE (Lewis et al., 2019) Seq2seq BARTLARGE (Lewis et al., 2019) Seq2seq T5SMALL (Raffel et al., 2020) Seq2seq T5BASE (Raffel et al., 2020) Seq2seq T5LARGE (Raffel et al., 2020) #Parameters Training Corpus 110M 340M 66M 125M 355M 82M 117M 345M 774M 1.5B 140M 400M 60M 220M 770M WebText (40GB) Wikipedia (en) & BookCorpus (16GB) Wikipedia (en) & BookCorpus & CC-News & OpenWebText & Stories (160GB) OpenWebText (38GB) Wikipedia (en) & BookCorpus & CC-News & OpenWebText & Stories (160GB) C4 & Wiki-DPR (765GB) prompt ensembling. However, ensembling tends to increase performance independently of the un- derlying prompting method (see Appendix A). Consequently, we will only focus on the top-1 prompt selection method here. We consider LPAQA a semi-manual method because it needs to be seeded with manual prompts, and mining retrieves further human-generated strings. AutoPrompt It is an automated method proposed by Shin et al. (2020) to generate discrete prompts using gradient-guided search (Wallace et al., 2019). The prompts are composed of a se- quence of tokens selected from the vocabulary of the LM. The number of tokens is pre-defined. The process is divided into two phases. For each specific token position, a set of candidates that maxi- mize the likelihood on a batch of training data is first created. Then, the candidates are re-evaluated on a different batch, with the best one retained. Even though the generated prompts are less inter- pretable, they perform better than manual prompts. In our experiments, we use 5-token prompts and run the algorithm for 1,000 iterations. OptiPrompt Zhong et al. (2021) propose an automated method to generate continuous prompts. They are dense vectors in the embedding space of the LM that are learned using gradient descent on a separate training dataset. Except for the learning rate, which is increased to 3e-2 for the T5 models for proper convergence, we use the same hyperparameters as the original implementation. We initialize vectors randomly. 4 RESULTS AND ANALYSIS 4.1 PROMPTING METHOD PERFORMANCE We start by evaluating the performance of the different prompting methods.3 Prompts are induced with a specific LM and then evaluated by retrieving objects from the same LM. Table 2 summarizes the results. For reference, a majority-class baseline always picking the most common object for each relation reaches 26.91% accuracy (note that this baseline has partial access to the ground truth in order to retrieve the most common object of each relation). The random baseline is virtually at 0%. AutoPrompt clearly outperforms LAMA and LPAQA, although it lags behind OptiPrompt. We thus confirm that soft prompts are the way to go if you have access to a model embedding space and are not interested in generalization across models. If either of these conditions is not met, AutoPrompt is preferable to manual and semi-manual prompts. Masked models tend to perform better as source LMs. This could be attributed to the fact that they were pre-trained with a fill-in-the-blank task (Devlin et al., 2019), which is exactly how the slot filling task is formulated. 3Following Petroni et al. (2019b), when testing manual and LPAQA prompts with left-to-right LMs, only the tokens before [MASK] are used. [MASK] is always the last AutoPrompt and OptiPrompt token. 4 Published as a conference paper at ICLR 2023 Table 2: Comparison of different prompting methods using micro-averaged accuracy (precision@1). Model BERTBASE BERTLARGE DistilBERT RoBERTaBASE RoBERTaLARGE DistilRoBERTa GPT2 GPT2MEDIUM GPT2LARGE GPT2XL BARTBASE BARTLARGE T5SMALL T5BASE T5LARGE average st dev LAMA LPAQA AutoPrompt OptiPrompt 48.26 50.88 44.76 44.73 47.39 44.21 39.28 38.43 44.14 47.76 43.05 45.06 28.10 40.51 44.42 43.39 5.40 50.09 49.52 29.79 39.63 44.12 41.17 11.36 18.59 12.91 15.42 39.63 26.56 31.44 39.59 42.00 32.62 13.12 41.18 42.15 13.14 32.80 40.54 32.43 9.63 18.29 19.97 21.31 32.43 36.78 20.94 32.70 36.07 28.69 10.56 34.82 35.81 6.75 26.36 31.63 23.80 7.23 13.74 15.50 16.98 22.95 27.07 14.94 24.35 28.21 22.00 9.17 Figure 2: Prompt generalization. For each relation, a prompt is induced from the source LM. At test time, the prompt is tested on the target LM. 4.2 AUTOPROMPT GENERALIZATION In this section, we investigate AutoPrompt's ability to generalize across different LMs.4 Prompts are induced using a Source LM and then evaluated on a Target LM, which can be the same or different from the Source (Figure 2). The results, relative to single-model LM performance, are shown in Figure 3. AutoPrompt generally performs best when the Source and Target LMs are the same, as shown by the fact that off-diagonal values are mostly negative. The performance gap gets bigger as we transfer across different LM types. Prompts are generally more stable across different sizes of the same model, such as BERTBASE and BERTLARGE. The drop in generalization performance of left-to-right models is less dramatic simply because, for these models, the original same-source-and-target performance is already low. We also verify the impact of model size on generalization. For each source model, we define the generalization drop score as the average of the corresponding column in Figure 3. It measures the average drop in accuracy when prompts from a source model are tested on a different target, with respect to the original same-source-and-target accuracy. We discovered that performance drop and source model size are highly correlated (0.6). We do not have a clear explanation for this correlation, but we think it is an intriguing observation that should be further studied in the prompt analysis literature. 4Appendix B confirms that OptiPrompt prompts do not generalize well. Appendix C shows that AutoPrompt outperforms LPAQA also in terms of generalization. 5 Published as a conference paper at ICLR 2023 Figure 3: AutoPrompt relative performance across LMs. Each column represents a Source LM and each row a Target LM. Each value represents the difference between the accuracy achieved by the Target LM when using prompts induced with the Source LM and the accuracy obtained when Target is also used for training. 4.3 MIXED-TRAINING AUTOPROMPT GENERALIZATION We propose a simple modification to AutoPrompt training to generate prompts that generalize better. Recall that the AutoPrompt algorithm involves two phases: one in which candidate prompts are generated, and one in which the prompts are evaluated. Rather than relying on the same model for the two phases, we now use two different LMs. The first model, which we call the generator, proposes a set of candidates. Then, the second model, that we call the evaluator, evaluates the candidates and chooses the best one. To avoid a combinatorial explosion, we focus on combining the single LMs of each class that per- formed best in the same-source-and-target setup (Table 2 above). For each pair, we arbitrarily use the best of the two LMs (in the same-source-and-target setup) as generator. We deliberately avoid picking models based on generalization performance (Figure 3), as in a realistic settings we might not have advance access to the new architectures we need to generalize to. Table 3 compares the performance of standard and mixed AutoPrompt (we extend these experiments to LAMA-UHN in Appendix D). The BERTBASE/T5LARGE mix has the highest average accuracy. Although it does not perform as well as BERTBASE on the BERT models, it transfers better to all the other models (including the RoBERTa family). This mixed AutoPrompt variant even outperforms the best seq2seq model T5LARGE on all sequence-to-sequence models (including T5LARGE itself). It also outperforms GPT2MEDIUM on two GPT2 variants. If these results are very encouraging, Table 3 also shows that simply mixing models does not guar- antee good generalization. When we replace BERTBASE with T5LARGE as generator, generalization performance is actually worse than when using T5LARGE alone, and combining BERTBASE as gener- ator with GPT2MEDIUM as evaluator leads to minor generalization improvements compared to using BERTBASE alone. Some preliminary insights on the best mixing strategy are offered in Appendix E. 6 Published as a conference paper at ICLR 2023 Table 3: AutoPrompt mixed training. The first three columns report generalization accuracy for the single best LM in each class; the next three columns evaluate their combination. Source Target BERTBASE BERTLARGE DistilBERT RoBERTaBASE RoBERTaLARGE DistilRoBERTa GPT2 GPT2MEDIUM GPT2LARGE GPT2XL BARTBASE BARTLARGE T5SMALL T5BASE T5LARGE Average BERTBASE GPT2MEDIUM T5LARGE BERTBASE/T5LARGE BERTBASE/GPT2MEDIUM T5LARGE/GPT2MEDIUM 50.09 47.01 15.75 32.31 37.79 31.71 4.70 14.38 17.95 18.34 28.98 26.73 15.78 29.26 32.32 26.87 18.02 22.54 4.37 21.31 24.07 18.28 9.71 18.59 15.68 15.02 24.11 25.20 16.23 22.04 28.90 18.94 20.83 26.43 4.71 20.28 26.06 17.24 6.04 12.51 13.52 13.09 21.62 20.32 11.89 26.58 42.00 18.88 41.13 40.51 15.08 36.01 38.63 33.49 10.19 16.29 22.33 19.74 34.57 33.73 19.31 36.67 44.51 29.48 38.64 39.6 13.35 30.56 34.24 28.53 7.53 22.49 19.95 23.19 31.62 29.15 18.28 32.06 35.71 26.99 16.47 16.29 3.65 17.24 21.16 16.58 8.12 16.47 14.84 18.87 18.84 18.94 7.99 16.99 27.22 15.98 training LM(s) semantic overlap BERTBASE 5.3* GPT2MEDIUM 0.97 T5LARGE 2.43* BERTBASE/T5LARGE 3.29* BERTBASE/GPT2MEDIUM 3.51* T5LARGE/GPT2MEDIUM 1.44 real-word ratio 81.7 68.8 71.9 86.0 88.6 73.3 shuffled accuracy non-normalized 11.5 (3.1) 6.0 (1.2) 15.1 (2.6) 11.5 (3.1) 9.5 (3.1) 9.7 (2.4) ratio 23.0 (6.2) 32.4 (6.7) 36.0 (6.1) 27.9 (7.4) 24.5 (8.0) 35.8 (9.0) Table 4: AutoPrompt prompt analysis. The semantic overlap column reports the t-score for the dif- ference in semantic overlap between matching and mismatched prompts (see text for explanation), with * marking significant scores at α=0.05. The real-word ratio column reports percentage ratios of corpus-attested English words among space-/punctuation-mark delimited tokens appearing in a prompt set. The shuffled accuracy columns report percentage accuracy after token shuffling, di- vided by the original accuracy in the ratio column (averages of 10 random shufflings with standard deviations in parenthesis). 4.4 PROMPT ANALYSIS We study the prompts generated by AutoPrompt through single-model and mixed training, looking for differences that might hint at how the latter generalize better. Since the prompt examples in Table 8 (Appendix F) suggest that there are no huge differences directly visible to the "naked eye", we undertake a quantitative analysis led by the following hypotheses. 1) Each LM has its own peculiarities, but they all share English as training language. Prompts op- timized on a single model might overfit the quirks of that model, but mixed-training prompts might capture more general properties of English that are shared across models. We thus hypothesize that prompts that generalize better will have a larger semantic overlap with manually crafted English prompts. 2) Modern LMs use sub-word tokenization strategies that differ from model to model. AutoPrompt is thus free to combine sub-words into non-word sequences (e.g., slalomgraphers, pub- lishedtoon in Table 8) that might in turn be tokenized differently by different models, leading to inter-model brittleness. We thus conjecture that prompts that generalize better will contain a larger proportion of real English words. 3) Natural languages rely on word order to express meaning, but it's less clear that LMs are capturing genuine syntactic rules (Sinha et al., 2021). It's more likely that, to the extent that prompts crucially rely on token order, this is exploiting statistical co-occurrence quirks of specific LMs. We thus conjecture that a "bag-of-token" prompt sequence that does not require the tokens to be in any special order will be more general than one where order matters and, consequently, generalizing prompts will be more robust to token shuffling. 4) On a related point, single-model-optimized prompts might concentrate information in the slots the source model is most sensitive to, but such slots might vary from model (type) to model (type). We thus conjecture that generalizing prompts will distribute information more evenly across tokens and thus they will be more robust to single-token deletion. 7 Published as a conference paper at ICLR 2023 Semantic overlap with English The manual LAMA prompts are our English reference point. We measure semantic overlap as the cosine between a vector representing an AutoPrompt-generated prompt and a LAMA prompt. Specifically, we use fastText (Bojanowski et al., 2017) to represent prompts, both because it offers independent representations from those of any of the LMs we are comparing, and because it relies on vocabulary- and tokenization-independent n-gram-based se- quence representations. Instead of reporting difficult-to-interpret absolute cosines, we report the t-score for the cosine difference between cases where AutoPrompt prompts are compared to the LAMA prompts for the same T-ReX relation, and cases where AutoPrompt prompts are compared to different-relation LAMA prompts. In other words, the larger this value is, the clearer the dif- ference in semantic overlap is between meaningful and random prompt comparisons. Results are in the first column of Table 4. There is a strong correlation (>0.9 Pearson) between a prompt se- mantic overlap with English and its accuracy when tested on the model used as source/generator during training. This is encouraging in itself, suggesting that more effective AutoPrompt prompts are also more semantically transparent. However, our hypothesis that better generalization implies higher semantic overlap is disproven: there is a clear decrease in overlap between BERTBASE-based prompts and the better generalizing ones obtained through BERTBASE/T5LARGE mixed-training. Real-word ratio We verify whether a space- or punctuation-marked delimited character sequence in a prompt is an existing English word by checking if it appears in the list of 56k words occurring at least 1k times in the ukWaC corpus (Baroni et al., 2009). This corpus was not used for training any of the models, thus minimizing biases towards any of them. The minimum occurrence threshold was determined by manual inspection, observing that rarer strings tend not to be real words but "corpus detritus" (numbers, dates, code fragments, typos). The second column of Table 4 reports percentage attested-word ratios among the tokens produced by AutoPrompt for the whole T-ReX relation set in various training setups. For reference, this ratio is at 99.4% for the manual LAMA prompts. The generalizing BERTBASE/T5LARGE setup clearly outperforms single-model training on BERTBASE on this metric, tentatively confirming our hypothesis that more word-like strings will transfer better across models. Note however that BERTBASE/GPT2MEDIUM, a mixed-training setup that does not generalize better than BERTBASE-based training alone, features prompts sporting an even higher proportion of existing words. So, the latter might be a common property of mixed-training-induced prompts, but not one that automatically entails better generalization. Shuffling We shuffle the tokens in each prompt, and compute the resulting T-ReX accuracy when retrieving information from the LM used as source/generator during AutoPrompt training. To tease the effect of shuffling apart from the absolute performance of a prompt set, we also report the ratio of accuracy after shuffling to accuracy with unshuffled prompts. We repeat the shuffling experiment 10 times, and report averaged accuracies/ratios and standard deviations in the last two columns of Table 4. By superficially eyeing AutoPrompt prompts such as those in Table 8, one could think they are bags of tokens, but the ratios show that token order matters, as there is always a big drop in per- formance after shuffling. Indeed, by closer inspection of the prompts in Table 8, we notice that some of them do have a sentence flavor ('[X] teaches modelling frescoes downtown in [Y]"). Our hypoth- esis that the generalizing BERTBASE/T5LARGE prompts are less order-sensitive than the BERTBASE ones is confirmed (compare the ratios of these setups). The extra robustness of BERTBASE/T5LARGE might be due to the fact that T5LARGE itself is particularly robust to shuffling, and it remains to be seen if for mixed-training prompts there is a causal relationship between robustness to shuffling and generalization. Note that the relatively high ratio of GPT2MEDIUM might be due to a flooring effect, as this setup has low accuracy before and after shuffling. Token deletion To verify if information is equally distributed across the 5 tokens of an Auto- Prompt prompt, for each prompt set we compute T-ReX accuracy (retrieving information from the matching source/generator model) after removing a single token, repeating the experiment for each token position. Figure 4 reveals that BERTBASE-based prompts are concentrating a lot of information towards the end of the sequence, and in particular on the last token, with a huge drop in performance if the latter is deleted. While the same tendency to pack information towards the end of the se- quence is present in the better-generalizing BERTBASE/T5LARGE prompts, the drop is less dramatic (especially when taking into account the fact that the latter prompts start from a lower full-sequence accuracy). Figure 5 in Appendix G shows that all generated prompts have a tendency to pack more information at the end of the sequence (which is remarkable, as their encoders are based on the fully 8 Published as a conference paper at ICLR 2023 (a) BERTBASE (b) BERTBASE/T5LARGE Figure 4: Percentage accuracy after dropping the token in each position of an AutoPrompt-generated 5-token prompt. The dashed horizontal line marks full-sequence accuracy. symmetric transformer architecture), but T5LARGE generates prompts that are less affected by single- token deletion. The higher robustness of BERTBASE/T5LARGE compared to BERTBASE might thus be inherited from T5LARGE, and further studies should ascertain whether there is a causal relation be- tween smoother information distribution and better generalization for mixed-training prompts. 5 DISCUSSION Take-home points Automatically induced discrete prompts, such as those derived with the Auto- Prompt algorithm, strike a good balance between (semi-)manual prompts, that they outperform in retrieval quality and (potentially) scalability, and soft prompts, that can only be used out-of-the-box on the model they were induced from, and require access to inner model structures to function. How- ever, the standard AutoPrompt method must be adapted to get good performance across language models. In particular, a simple modification in which AutoPrompt is trained using two language models leads to prompts that better generalize to further models. The better-generalizing prompts induced in this way look quite similar to prompts induced with the standard method. However, a probing analysis suggests that there are systematic differences, and in particular that the generalizing prompts tend to feature a larger proportion of existing English words, and to be more robust to ablations that probe sensitivity to token order and asymmetries in information distribution. In sum, our results suggest that it is viable to use a learning-based algorithm to generate "universal" discrete prompts that can be employed to extract information from a variety of pre-trained language models, only requiring access to their standard discrete-string interface. Limitations and directions for further work Our results are based on a single task, slot filling, and a single data-set (T-ReX). We believe this is a good starting point, because in slot filling a separate, semantically contentful prompt must be learned for each relation, but future work should extend the investigation to different tasks, including tasks where successful knowledge retrieval requires more than recalling a single word, as in the LAMA/T-ReX setup we used. We used a single discrete prompt induction algorithm, AutoPrompt, confirming that it is generat- ing high-quality prompts. However, this method generates a single fixed prompt for each task or sub-task. True scalability will only be achieved with prompting methods that can generate an appro- priate query for each different input they receive, and we intend to design discrete-prompt-induction algorithms matching this desideratum (see Haviv et al. (2021) for a step in this direction). Another reason to focus on algorithm development is that the single-model comparison between AutoPrompt and the OptiPrompt soft prompts shows there is still large room to improve retrieval quality. Our analysis revealed systematic differences between the best model-specific and generalizing prompts. However, it is not clear that any of these differences is causally connected with generaliza- tion improvement. In future work, we would like to better understand the relation between properties such as robustness to shuffling and generalization. A particular exciting direction is to favour the emergence of such properties through appropriate auxiliary functions at prompt-induction time, and verify whether they lead to further improvements in generalization performance. 9 Published as a conference paper at ICLR 2023 ACKNOWLEDGMENTS We thank the reviewers for constructive feedback. We thank the members of the UPF COLT group for discussion and advice. UPF has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No. 101019291). This paper reflects the authors' view only, and the funding agency is not responsible for any use that may be made of the information it contains. Fabio Petroni conducted work on the project while at Meta AI. REPRODUCIBILITY STATEMENT All datasets, pre-trained models and prompting methods used in this paper are publicly available. We use the same hyperparameters as the original implementation of the prompting methods unless it is clearly specified in the text. Code to reproduce the results as well as the common vocabulary and the filtered datasets will be shared upon acceptance. ETHICS STATEMENT Prompting relies on pre-trained language models, and thus inherits most ethical risks inherent in such models (Weidinger et al., 2022). As we are not introducing new models, we are not adding new potential issues tied to LMs. As the examples in Table 8 show, automated prompting methods tend to produce opaque prompts. This characteristic might be exploited for harmful purposes, such as adversarial attacks in which a model is "triggered" to produce unwanted information through an apparently innocuous prompt (Wallace et al., 2019). We believe that this provides further motivation for our focus on discrete prompts, that are more directly human-readable than soft prompts. We showed in particular in Section 4.4 that there is a very high correlation (>.9) between the quality of automatically-induced prompts in the relevant information retrieval task and the degree of semantic transparency of the prompts. If this result could be extended, it would constitute very good news on the interpretability front, suggesting that very high-quality prompts will also be more human-interpretable, making it harder to exploit opaque prompts for harmful purposes. REFERENCES Badr AlKhamissi, Millicent Li, Asli Celikyilmaz, Mona Diab, and Marjan Ghazvininejad. A review on language models as knowledge bases. arXiv preprint arXiv:2204.06031, 2022. Marco Baroni, Silvia Bernardini, Adriano Ferraresi, and Eros Zanchetta. The WaCky wide web: A collection of very large linguistically processed web-crawled corpora. Language Resources and Evaluation, 43(3):209–226, 2009. Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5:135–146, 2017. Rishi Bommasani, Drew Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, Erik Brynjolfsson, Shya- mal Buch, Dallas Card, Rodrigo Castellon, Niladri Chatterji, Annie Chen, Kathleen Creel, Jared Davis, Dorottya Demszky, Chris Donahue, Moussa Doumbouya, Esin Durmus, Stefano Ermon, John Etchemendy, Kawin Ethayarajh, Li Fei-Fei, Chelsea Finn, Trevor Gale, Lauren Gillespie, Karan Goel, Noah Goodman, Shelby Grossman, Neel Guha, Tatsunori Hashimoto, Peter Hender- son, John Hewitt, Daniel Ho, Jenny Hong, Kyle Hsu, Jing Huang, Thomas Icard, Saahil Jain, Dan Jurafsky, Pratyusha Kalluri, Siddharth Karamcheti, Geoff Keeling, Fereshte Khani, Omar Khat- tab, Pang Wei Koh, Mark Krass, Ranjay Krishna, Rohith Kuditipudi, Ananya Kumar, Faisal Lad- hak, Mina Lee, Tony Lee, Jure Leskovec, Isabelle Levent, Xiang Li, Xuechen Li, Tengyu Ma, Ali Malik, Christopher Manning, Suvir Mirchandani, Eric Mitchell, Zanele Munyikwa, Suraj Nair, Avanika Narayan, Deepak Narayanan, Ben Newman, Allen Nie, Juan Carlos Niebles, Hamed 10 Published as a conference paper at ICLR 2023 Nilforoshan, Julian Nyarko, Giray Ogut, Laurel Orr, Isabel Papadimitriou, Joon Sung Park, Chris Piech, Eva Portelance, Christopher Potts, Aditi Raghunathan, Rob Reich, Hongyu Ren, Frieda Rong, Yusuf Roohani, Camilo Ruiz, Jack Ryan, Christopher R ́e, Dorsa Sadigh, Shiori Sagawa, Keshav Santhanam, Andy Shih, Krishnan Srinivasan, Alex Tamkin, Rohan Taori, Armin Thomas, Florian Tram ́er, Rose Wang, William Wang, Bohan Wu, Jiajun Wu, Yuhuai Wu, Sang Xie, Michi- hiro Yasunaga, Jiaxuan You, Matei Zaharia, Michael Zhang, Tianyi Zhang, Xikun Zhang, Yuhui Zhang, Lucia Zheng, Kaitlyn Zhou, and Percy Liang. On the opportunities and risks of foundation models. https://arxiv.org/abs/2108.07258, 2021. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of NAACL, pp. 4171–4186, Minneapolis, MN, 2019. Hady Elsahar, Pavlos Vougiouklis, Arslen Remaci, Christophe Gravier, Jonathon Hare, Frederique Laforest, and Elena Simperl. T-rex: A large scale alignment of natural language with knowledge base triples. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), 2018. Tatsunori B Hashimoto, David Alvarez-Melis, and Tommi S Jaakkola. Word embeddings as metric recovery in semantic spaces. Transactions of the Association for Computational Linguistics, 4: 273–286, 2016. Adi Haviv, Jonathan Berant, and Amir Globerson. BERTese: Learning to speak to BERT. In Proceedings of EACL, pp. 3618–3623, Online, 2021. Zhengbao Jiang, Frank F Xu, Jun Araki, and Graham Neubig. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423–438, 2020. Daniel Khashabi, Shane Lyu, Sewon Min, Lianhui Qin, Kyle Richardson, Sameer Singh, Sean Prompt wayward- arXiv preprint Welleck, Hannaneh Hajishirzi, Tushar Khot, Ashish Sabharwal, et al. ness: The curious case of discretized interpretation of continuous prompts. arXiv:2112.08348, 2021. Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. In Proceedings of EMNLP, pp. 3045–3059, Punta Cana, Dominican Republic, 2021. Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. Bart: Denoising sequence-to-sequence pre- arXiv preprint training for natural language generation, arXiv:1910.13461, 2019. translation, and comprehension. Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pre- train, prompt, and predict: A systematic survey of prompting methods in natural language pro- cessing. https://arxiv.org/abs/2107.13586, 2021. Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representa- tions of words and phrases and their compositionality. Advances in neural information processing systems, 26, 2013. Fabio Petroni, Tim Rockt ̈aschel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, Alexander H Miller, and Sebastian Riedel. Language models as knowledge bases? arXiv preprint arXiv:1909.01066, 2019a. Fabio Petroni, Tim Rockt ̈aschel, Sebastian Riedel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, and Alexander Miller. Language models as knowledge bases? In Proceedings EMNLP, pp. 2463– 2473, Hong Kong, China, 2019b. Nina Poerner, Ulli Waltinger, and Hinrich Sch ̈utze. Bert is not a knowledge base (yet): Factual knowledge vs. name-based reasoning in unsupervised qa. arXiv preprint arXiv:1911.03681, 3, 2019. 11 Published as a conference paper at ICLR 2023 Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1–67, 2020. Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019. Victor Sanh, Albert Webson, Colin Raffel, Stephen Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Arun Raja, Manan Dey, Saiful Bari, Canwen Xu, Urmish Thakker, Shanya Sharma Sharma, Eliza Szczechla, Taewoon Kim, Gunjan Chhablani, Nihal Nayak, De- bajyoti Datta, Jonathan Chang, Mike Tian-Jian Jiang, Han Wang, Matteo Manica, Sheng Shen, Zheng Xin Yong, Harshit Pandey, Rachel Bawden, Thomas Wang, Trishala Neeraj, Jos Rozen, Abheesht Sharma, Andrea Santilli, Thibault Fevry, Jason Alan Fries, Ryan Teehan, Teven Le Scao, Stella Biderman, Leo Gao, Thomas Wolf, and Alexander Rush. Multitask prompted train- In Proceedings of ICLR, Online, 2022. Published ing enables zero-shot task generalization. online: https://openreview.net/group?id=ICLR.cc/2022/Conference. Timo Schick and Hinrich Sch ̈utze. It's not just size that matters: Small language models are also few-shot learners. In Proceedings of NAACL, pp. 2339–2352, Online, 2021. Thibault Sellam, Steve Yadlowsky, Jason Wei, Naomi Saphra, Alexander D'Amour, Tal Linzen, Jasmijn Bastings, Iulia Turc, Jacob Eisenstein, Dipanjan Das, et al. The multiberts: Bert repro- ductions for robustness analysis. arXiv preprint arXiv:2106.16163, 2021. Taylor Shin, Yasaman Razeghi, Robert Logan IV, Eric Wallace, and Sameer Singh. AutoPrompt: Eliciting knowledge from language models with automatically generated prompts. In Proceedings of EMNLP, pp. 4222–4235, virtual conference, 2020. Koustuv Sinha, Robin Jia, Dieuwke Hupkes, Joelle Pineau, Adina Williams, and Douwe Kiela. Masked language modeling and the distributional hypothesis: Order word matters pre-training for little. In Proceedings of EMNLP, pp. 2888–2913, Punta Cana, Dominican Republic, 2021. Yusheng Su, Xiaozhi Wang, Yujia Qin, Chi-Min Chan, Yankai Lin, Huadong Wang, Kaiyue Wen, Zhiyuan Liu, Peng Li, Juanzi Li, Lei Hou, Maosong Sun, and Jie Zhou. On transferability of prompt tuning for natural language processing. In Proceedings of NAACL, pp. 3949–3969, Seattle, WA, 2022. Eric Wallace, Shi Feng, Nikhil Kandpal, Matt Gardner, and Sameer Singh. Universal adversarial triggers for attacking and analyzing NLP. In Proceedings of EMNLP, pp. 2153–2162, Hong Kong, China, 2019. Laura Weidinger, Jonathan Uesato, Maribeth Rauh, Conor Griffin, Po-Sen Huang, John Mellor, Amelia Glaese, Myra Cheng, Borja Balle, Atoosa Kasirzadeh, Courtney Biles, Sasha Brown, Zac Kenton, Will Hawkins, Tom Stepleton, Abeba Birhane, Lisa Anne Hendricks, Laura Rimell, William Isaac, Julia Haas, Sean Legassick, Geoffrey Irving, and Iason Gabriel. Taxonomy of risks posed by language models. In Proceedings of FAccT, pp. 214–229, Seoul, Korea, 2022. Yue Zhang, Hongliang Fei, Dingcheng Li, and Ping Li. PromptGen: Automatically generate prompts using generative models. In Findings of NAACL, pp. 30–37, Seattle, WA, 2022. Zexuan Zhong, Dan Friedman, and Danqi Chen. Factual probing is [mask]: Learning vs. learning to recall. arXiv preprint arXiv:2104.05240, 2021. A PROMPT ENSEMBLING Discrete prompt ensembling for knowledge extraction was introduced by Jiang et al. (2020) using LPAQA. Instead of selecting the top-1 prompt from a set of candidates, multiple prompts are com- bined in order to improve performance. The authors argue that ensembling improves the extraction 12 Published as a conference paper at ICLR 2023 Table 5: Direct OptiPrompt transfer across LMs with same embedding dimension. Source Target BERTBASE DistilBERT RoBERTaBASE DistilRoBERTa GPT2 BARTBASE T5BASE BERTBASE DistilBERT RoBERTaBASE DistilRoBERTa GPT2 BARTBASE T5BASE 48.25 11.89 2.27 2.12 0.01 1.20 4.17 33.71 46.41 2.02 1.88 0.04 0.72 4.53 0.62 0.97 46.17 39.86 0.15 1.02 4.89 1.24 0.83 41.04 45.26 0.01 0.05 4.64 1.02 1.64 2.67 2.48 40.57 0.60 2.89 1.00 0.81 3.13 2.87 0.00 44.3 4.92 0.19 0.64 4.90 3.81 0.00 0.27 42.08 of knowledge that appeared in different contexts within the training data. Since the idea of ensem- bling is distinct from the specifics of the LPAQA method, in this appendix we check if ensembling also helps AutoPrompt. Specifically we experiment with the optimized ensembling approach used with LPAQA by Jiang et al. (2020), which associates learnable weights to each prompt. For ensembling purposes, multiple candidate prompts for each relation are required. One way to obtain these candidate prompts for AutoPrompt is by inducing prompts from instances of the same model trained with different seeds. Considering the computational cost of retraining the models our- selves, we use the already available MultiBERT collection (Sellam et al., 2021), which contains 25 instances of BERTBASE trained with different seeds. Unfortunately, unlike the models in Table 1, the MultiBERTs were trained on uncased data, which means we can only evaluate on the MultiBERTs themselves. Specifically, we use seed-0 MultiBERT as our target model, and obtain the AutoPrompt prompts from the remaining MultiBERTs. For LPAQA, we use seed-0 MultiBERT for training and testing, obtaining the candidate prompts with the standard LPAQA mining and paraphrasing proce- dure. First, we confirm that in this different setup AutoPrompt is still outperforming LPAQA in top-1 eval- uation (39.40% vs. 35.17% T-ReX accuracies, respectively). Second, ensembling helps both mod- els. However, ensembled LPAQA barely reaches the performance of top-1 Automprompt (39.21%), whereas ensembled AutoPrompt further improves to 42.43% accuracy. B SOFT PROMPT GENERALIZATION Transferring soft prompts across models is not as straightforward as with discrete prompts. In or- der to transfer the vectors, the source and target must have the same embedding dimension. We experiment with the subset of models that have a common embedding dimension of 768. Table 5 confirms that soft prompts generalize extremely poorly. The only exception is decent student/teacher transfers for distilled models, probably because their embeddings were initialized with those of the corresponding teacher models. A more general approach consists in discretizing the soft prompts to their nearest vocabulary neigh- bors (Mikolov et al., 2013; Hashimoto et al., 2016), and using the resulting vocabulary item se- quences as prompts. OptiPrompt vectors can be initialized with random numbers, random vocab- ulary embeddings or manual prompts. When initialized with random vocabulary embeddings or manual prompts, the nearest neighbor projections of the resulting vectors are always identical to the initialization tokens, making the process vacuous. However, when the vectors are initialized to random numbers, the nearest neighbors of the optimized vectors are the same for multiple rela- tions.5 As expected, unlike the corresponding soft prompts, these discretized prompts perform very poorly. For example, when training on BERTBASE, OptiPrompt soft prompts achieve 48.26% T-ReX accuracy. The corresponding discretized prompts only achieve 1.21% accuracy. 5This might be related to the "prompt waywardness" phenomenon observed by Khashabi et al. (2021), who showed that, for any arbitrary embedding, it is possible to find a well-performing soft prompt that has that embedding as its nearest neigbhor. 13 Published as a conference paper at ICLR 2023 Table 6: Comparison of LPAQA and AutoPrompt across LMs. Each method is trained on the LM leading to the best same-source-and-target performance. Source LPAQA Target BERTBASE BERTLARGE DistilBERT RoBERTaBASE RoBERTaLARGE DistilRoBERTa GPT2 GPT2MEDIUM GPT2LARGE GPT2XL BARTBASE BARTLARGE T5SMALL T5BASE T5LARGE Average BERTLARGE 38.01 42.14 7.24 27.68 33.68 22.21 7.88 14.88 17.15 18.01 26.74 28.47 16.38 27.76 31.20 23.96 AutoPrompt BERTBASE 50.09 47.01 15.75 32.31 37.79 31.71 4.70 14.38 17.95 18.34 28.98 26.73 15.78 29.26 32.32 26.87 C LPAQA GENERALIZATION AutoPrompt is better than LPAQA in the same-source-and-target setup, as demonstrated in Table 2. Table 6 further shows that AutoPrompt also generalizes better than LPAQA to other target models (we train the latter on BERTLARGE, since this is the LPAQA setup reaching the best same-source- and-target accuracy). D LAMA-UHN RESULTS LAMA-UHN (UnHelpfulNames) (Poerner et al., 2019) is a subset of LAMA where facts that can be answered based on entity names alone were removed. The dataset is built using two heuristics. The first one filters facts whose object is a case-insensitive substring of the subject entity name. The second heuristic deletes a triple if a given model can infer information such as native language, nationality or place of birth using the subject's surface form only. We use the original dataset with BERTBASE as filtering model. Table 7 shows that the generalization results still hold. The difference between BERTBASE and BERTBASE/T5LARGE is smaller, possibly due to a ceiling effect with this harder data-set, but (once we exclude the non-generalizing same-source-and-target BERTBASE case), it is statistically significant (paired t-test, α=0.05). E CHOOSING MODELS FOR MIXED-TRAINING We study to what extent same-target-same-source accuracies of component models are good predic- tors of mixture generalization accuracy. To avoid a combinatorial explosion, we fix BERTBASE (the best model in the same-target-same-source setup) as either generator or evaluator, and pair it with 15 different LMs. The correlation across 15 mixtures is at 0.22 when BERTBASE is fixed as generator, and at 0.49 when it is fixed as evaluator. Overall, this suggests that single-model setup performance is a good predictor of mixture quality. We attribute the lower score with BERT-as-generator to a mild ceiling effect in this case. Indeed, we observe that, on average, performance is better when using BERTBASE as generator than as evaluator. This is likely due to the fact that the generator model does most of the "heavy lifting" in the mixture, as it is the one finding candidate prompts, that are then simply reranked by the evaluator. It thus makes sense to use the best single-model-setup system used as the generator in a mixture. 14 Published as a conference paper at ICLR 2023 Table 7: AutoPrompt generalization evaluated on LAMA-UHN. BERTBASE GPT2MEDIUM T5LARGE BERTBASE/T5LARGE BERTBASE/GPT2MEDIUM T5LARGE/GPT2MEDIUM 39.80 37.91 13.51 25.35 30.82 24.98 2.54 9.28 11.63 11.02 22.25 19.62 6.04 20.36 23.46 19.90 13.69 17.88 3.02 16.57 18.91 14.17 6.65 14.19 10.88 9.78 18.81 18.74 7.79 13.71 20.70 13.70 15.00 20.73 3.54 14.82 20.14 11.71 3.68 9.43 9.78 9.57 15.18 13.80 3.83 15.19 31.48 13.19 31.03 32.00 13.11 28.23 31.62 24.61 6.48 10.09 15.06 12.54 26.21 25.07 9.55 25.98 34.25 21.72 28.61 32.25 11.64 23.52 28.18 21.03 3.83 15.02 13.30 16.36 23.19 21.24 7.86 21.19 25.84 19.54 13.98 13.81 2.88 13.99 18.14 13.01 5.22 11.96 10.87 13.48 14.63 14.53 3.30 11.74 19.37 12.06 Source Target BERTBASE BERTLARGE DistilBERT RoBERTaBASE RoBERTaLARGE DistilRoBERTa GPT2 GPT2MEDIUM GPT2LARGE GPT2XL BARTBASE BARTLARGE T5SMALL T5BASE T5LARGE Average Finally, when fixing BERTBASE as generator, we observe that, in the majority of cases, we obtain better generalization results by using a different evaluator than BERTBASE itself, suggesting that mixed-training generalizes better compared to single model training even when randomly selecting one of the two models. F PROMPT EXAMPLES Table 8 shows manual (LAMA) and AutoPrompt prompts for a randomly picked set of T-ReX re- lations. We present examples for AutoPrompt trained on BERTBASE, the best choice in the same- source-and-target setup, and for mixed training using BERTBASE as generator model and T5LARGE as evaluator (BERTBASE/T5LARGE), since this combination results in the best generalization perfor- mance. For comparison, we also present prompts obtained using GPT2MEDIUM as source model, since this is a setup with relatively low performance in both the same-source-and-target and gener- alization evaluations. We note that the two better models generally produce prompts that have at least some degree of semantic/lexical relevance to the relation. This might be to some degree the case for GPT2MEDIUM as well, but much more opaquely so. Interestingly, for the two better models at least, the most transparent information is concentrated towards the end of the string. For example, the BERTBASE location prompt ends with headquartered in, and the corresponding BERTBASE/T5LARGE prompt ends with headquarters in. The BERTBASE manufacturer prompt ends with marketed by, and the corresponding BERTBASE/T5LARGE prompt ends with maker. Both these observations (higher se- mantic relevance of better-performing prompts and higher information concentration at the end of the prompt string) are confirmed by the quantitative analyses reported in Section 4.4 of the main text. By qualitative inspection, the only noticeable difference between the BERTBASE prompts (better in the non-generalizing setup) and the BERTBASE/T5LARGE ones (better at generalization) is that the latter contain a higher proportion of well-formed English words (as opposed to concatenations of word pieces that do not result in existing words). Again, this is quantitatively confirmed by the analysis in Section 4.4 15 Published as a conference paper at ICLR 2023 ] Y [ n i n w o t n w o d ] Y [ n w o t n w o d s e o c s e r f g n i l l e d o m s e h c a e t ] X [ ] Y [ d n a s i r a P ( l a u d m y n o d u e s p ] X [ y l s s e l e l i x e s e e fl d n a l l ] X [ ] Y [ n i d e i d ] X [ h t a e d f o e c a l p ] Y [ d a e r p s y l l u f e c a e p ] Y [ x o d o h t r o ] Y [ e t i s o p p o n o i g i l e r n o i g i l e r ] Y [ e h t d e p l e h s e u q s o m y t s a n y d ] X [ s e t u t i t s n o c d f f f u \ d 8 f 9 u \ u n g / " : " ] X [ l a t n e m a d n u f d e fi i t n e d i n u e v e i l e b ] X [ h t i w d e t a i l fi f a s i ] X [ n o i g i l e r E G R A L 5 T / E S A B T R E B M U I D E M 2 T P G E S A B T R E B l a u n a M n o i t a l e r s n m u l o c o w t g n i w o l l o f e h T . s t p m o r p A M A L d e t f a r c - y l l a u n a m s w o h s n m u l o c l a u n a M e h T . t e s b u s n o i t a l e r X e R - T m o d n a r a r o f s t p m o r p e l p m a x E : 8 e l b a T h g u o r h t d e t a r e n e g t p m o r p s w o h s n m u l o c t s a l e h T . y l e v i t c e p s e r , I M U D E M 2 T P G d n a E S A B T R E B s l e d o m e c r u o s s a g n i s u t p m o r P o t u A y b d e t a r e n e g s t p m o r p w o h s . s t o l s t c e j b o d n a t c e j b u s e h t r o f d n a t s ] Y [ d n a ] X [ , s e s a c l l a n I . l e d o m r o t a u l a v e s a E G R A L 5 T d n a l e d o m r o t a r e n e g s a E S A B T R E B g n i s u , g n i n i a r t d e x i m t p m o r P o t u A ] Y [ r e k a m ] Y [ y b d e t e k r a m g n i d l e fi n o i l l i b y b d e s i v e d ] X [ . ] Y [ t e b a h p i k a s a n o s n h o J n e g a w 0 5 6 ] X [ y r a n i b s e d u t i t l a n s i ] X [ ] Y [ y b d e c u d o r p s i ] X [ r e r u t c a f u n a m l a n fi i m e s d l r o w d e m a e r t s ] X [ ] Y [ g n i t n e s e r p e r n o t n i m d a b ] Y [ d n a y n a m r e G [ y r l a v i r e l y t s e ] X [ n o o t d e h s i l b u p a s r e v s e m o c ] X [ ] Y [ n i d e t a e r c s a w ] X [ n i g i r o f o y r t n u o c ] Y [ e d i s t u o d e s a b y l g n i d e s i l a i c e p s ] X [ ] Y [ n i s r e t r a u q d a e h & g n i k i b c i h p a r g o f n i ] X [ ] Y [ n i n o i t a d o m m o c c a ] Y [ n i d e r e t r a u q d a e h s r e h p a r g m o l a l s s t s a r t n o c ] X [ ] Y [ n i d e t a c o l s i ] X [ n o i t a c o l 16 Published as a conference paper at ICLR 2023 (a) BERTBASE (b) GPT2MEDIUM (c) T5LARGE (d) BERTBASE/T5LARGE (e) BERTBASE/GPT2MEDIUM (f) T5LARGE/GPT2MEDIUM Figure 5: Percentage accuracy after dropping the token in each position of an AutoPrompt-generated 5-token prompt. The dashed horizontal line marks full-sequence accuracy. G TOKEN DELETION FULL RESULTS Figure 5 reports the T-ReX accuracy for AutoPrompt prompt sets obtained using different LMs or LM combinations, always tested on the LM used for AutoPrompt training (the generator LM in mixed-training setups), when one token at a time is removed from the full prompt sequence. 17
http://arxiv.org/abs/2303.01245v1
2023-02-20T09:48:11
2023-02-20T09:48:11
An Incremental Gray-box Physical Adversarial Attack on Neural Network Training
Neural networks have demonstrated remarkable success in learning and solving complex tasks in a variety of fields. Nevertheless, the rise of those networks in modern computing has been accompanied by concerns regarding their vulnerability to adversarial attacks. In this work, we propose a novel gradient-free, gray box, incremental attack that targets the training process of neural networks. The proposed attack, which implicitly poisons the intermediate data structures that retain the training instances between training epochs acquires its high-risk property from attacking data structures that are typically unobserved by professionals. Hence, the attack goes unnoticed despite the damage it can cause. Moreover, the attack can be executed without the attackers' knowledge of the neural network structure or training data making it more dangerous. The attack was tested under a sensitive application of secure cognitive cities, namely, biometric authentication. The conducted experiments showed that the proposed attack is effective and stealthy. Finally, the attack effectiveness property was concluded from the fact that it was able to flip the sign of the loss gradient in the conducted experiments to become positive, which indicated noisy and unstable training. Moreover, the attack was able to decrease the inference probability in the poisoned networks compared to their unpoisoned counterparts by 15.37%, 14.68%, and 24.88% for the Densenet, VGG, and Xception, respectively. Finally, the attack retained its stealthiness despite its high effectiveness. This was demonstrated by the fact that the attack did not cause a notable increase in the training time, in addition, the Fscore values only dropped by an average of 1.2%, 1.9%, and 1.5% for the poisoned Densenet, VGG, and Xception, respectively.
[ "Rabiah Al-qudah", "Moayad Aloqaily", "Bassem Ouni", "Mohsen Guizani", "Thierry Lestable" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2303.01245v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2303.01245v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CR", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CR", "cs.LG" ]
An Incremental Gray-box Physical Adversarial Attack on Neural Network Training Rabiah Al-qudah1, Moayad Aloqaily1, Bassem Ouni2, Mohsen Guizani1, Thierry Lestable2 1Mohamed Bin Zayed University of Artificial Intelligence (MBZUAI), UAE 2Technology Innovation Institute, Abu Dhabi, UAE E-mails: 1{rabiah.alqudah; moayad.aloqaily; mohsen.guizani}@mbzuai.ac.ae 2{bassem.ouni; thierry.lestable}@tii.ae 3 2 0 2 b e F 0 2 ] R C . s c [ 1 v 5 4 2 1 0 . 3 0 3 2 : v i X r a Abstract-Neural networks have demonstrated remarkable success in learning and solving complex tasks in a variety of fields. Nevertheless, the rise of those networks in modern computing has been accompanied by concerns regarding their vulnerability to adversarial attacks. In this work, we propose a novel gradient-free, gray box, incremental attack that targets the training process of neural networks. The proposed attack, which implicitly poisons the intermediate data structures that retain the training instances between training epochs acquires its high- risk property from attacking data structures that are typically unobserved by professionals. Hence, the attack goes unnoticed despite the damage it can cause. Moreover, the attack can be executed without the attackers' knowledge of the neural network structure or training data making it more dangerous. The attack was tested under a sensitive application of secure cognitive cities, namely, biometric authentication. The conducted experiments showed that the proposed attack is effective and stealthy. Finally, the attack effectiveness property was concluded from the fact that it was able to flip the sign of the loss gradient in the conducted experiments to become positive, which indicated noisy and unstable training. Moreover, the attack was able to decrease the inference probability in the poisoned networks compared to their unpoisoned counterparts by 15.37%, 14.68%, and 24.88% for the Densenet, VGG, and Xception, respectively. Finally, the attack retained its stealthiness despite its high effectiveness. This was demonstrated by the fact that the attack did not cause a notable increase in the training time, in addition, the Fscore values only dropped by an average of 1.2%, 1.9%, and 1.5% for the poisoned Densenet, VGG, and Xception, respectively. Index Terms-Adversarial Attacks, Data Poisoning, Neural Networks, Iris Recognition. I. INTRODUCTION Cognitive cities [1] are proactive, hyper-connected, and citizen-driven cities that are designed to minimize resource consumption, in order to achieve sustainability. In addition, the vast advancement in Artificial Intelligence (AI) and Internet of Things (IoT) technologies have enhanced the evolution of research that integrates both technologies to deliver and automate services for cognitive cities' residents. In fact, the great development that emerged from the integration of those technologies has brought unforeseen exposures to cybersecu- rity, in addition to novel attacks that need to be addressed in order to deliver secure automation to cognitive cities. Securing access to different services and facilities, such as connected buildings and data centers, and managing the flow of foot traffic are crucial requirements when adopting the cognitive city paradigm. Those requirements can be im- plemented using biometric authentication such as fingerprint recognition and iris recognition. Despite the benefits of bio- metric authentication, privacy concerns and security attacks pose serious challenges to this technology after deployment. Attacks that target biometric recognition systems typically include presenting human characteristics or artifacts directly to a biometric system to interfere or bias with its standard operation. Such attacks can result in granting access to unau- thorized individuals into secured premises, allowing tailgating, or triggering denial of service by rejecting the biometrics of authorized individuals. For instance, in 2017, the Chaos Computer Club executed a successful attack on the Samsung Galaxy S8 iris scanner using a simple photograph and a contact lens [2]. On a different note, neural networks have gained wide pop- ularity in the past decade due to their supremacy in terms of accuracy and minimal need for human intervention. Moreover, those networks are data hungry and are very sensitive to patterns they are exposed to during the training phase. On the other hand, neural networks are vulnerable and can be biased even with the introduction of simple adversarial attacks. For example, altering a single pixel in the data fed to an image classifier can disrupt the learning experience and result in a biased model [3]. Adversarial attacks are considered white box when the attacker has full access to the neural network and data, while gray box attacks assume having access to either and black box attacks assume access to neither. Those attacks can be categorized into digital attacks and physical attacks. Digital attacks engineer pixel values of input images, whereas physical attacks insert pixel patches that represent real world objects into the input image instance. Attacker goals can vary from faulting the predictions of a certain class, in what is called "targeted attacks". Moreover, an attack can be "non-targeted" and aim to fault the model in general. Furthermore, attacks that target faulting the inference phase have been extensively studied in the literature. On the contrary, only a handful of papers focused on faulting the training phase and the intermediate values related to its computations. In 2022, Breier et al. introduced the first attack that directly targets the training phase by perturbing the ReLu values while training [4]. In fact, the lack of research attention on attacks that target the training phase puts many applications that rely on neural networks in jeopardy. In this work, we propose and test a novel attack that focuses on faulting the training process of neural networks in the domain of biometric authentication through iris recognition. The contributions of this work can be summarized as follows: This method includes adding noise whose direction is the same as the gradient of the cost function with respect to the data using a trained model. The work in [4], proposed the first attack that targets the training phase by changing the values of the ReLu function to bias the neural network. The novel attack was proven to be effective and stealthy. 1) We introduce a novel gradient-free, data poisoning attack that incrementally and directly targets the training set during the training process of a neural network with minimal knowledge by the attacker. To the best of this is the first attack that executes our knowledge, between training epochs and targets the intermediate data structures of the training phase. 2) We conduct extensive experimental verification on the proposed attack to test its effectiveness and stealthiness. We define four evaluation criteria to quantify the effect of the attack, namely, the average of the loss change, the average inference probability, the training time dif- ference, and the performance degradation measure. 3) We experiment the proposed attack on an important aspect of a cognitive city, namely, iris recognition. To the best of our knowledge, this is the first attempt to test the effect of an adversarial attack that occurs during training on the domain of iris recognition. The rest of this paper is organized as follows: the most recent literature on the domain of physical attacks and iris recognition is presented in Section II. The proposed methods are outlined in Section III. The results are described and discussed in Section IV. Finally, Section V concludes and summarizes the main highlights and observations of this work. II. RELATED WORK A. Attacks on Neural Networks Patch attacks are physical attacks that replace a subset of pixels in an image with pixels from adversarial patches to bias a model [5]. While many studies have proposed attacks that target faulting the inference phase [6], [7], only a handful of papers focused on faulting the training phase and the intermediate values related to its computations [4]. For example, Zhao et al. [6] applied the alternating direction method of multipliers at the inference time to solve the optimization problem of the targeted fault sneaking attack. The results showed that the attack was successful and stealthy, moreover, the success rate was approximately 100% when the number of targeted images was less than 10. Whereas, the success rate decreased as the number of fooled images increased. Furthermore, the work in [7] studied the effects of bitwise perturbations at inference time on 19 deep networks. The vulnerable parameters of the experimented networks were identified using heuristic functions. The results showed that most deep architectures have at least one parameter that causes an accuracy loss of over 90% when a bit-flip is executed on their bitwise representation. In addition, the Fast Gradient Sign Method (FGSM) has been widely used in the literature as an attacking strategy [8]. B. Attacks on Iris Recognition Systems The crucial role iris recognition has played in securing premises, in addition to the threatening effects of breaching such authentication systems, have made iris biometric authen- tication systems an active target for adversarial attacks. A novel morph attack on iris recognition systems was tackled in [9]. Sharma et al. generated morphed iris images using the Indian Institute of Technology Delhi (IITD) Iris Database and West Virginia University (WVU) multi-modal datasets. The morph attack achieved a success rate higher than 90% on two state-of-the-art iris recognition methods, which indicates the vulnerability of iris recognition systems. In order to protect against the increasing attacks, researchers have also focused on studying countermeasures and detection mechanisms for iris recognition attacks. For example, Thukral et al. [10] proposed an iris spoofing detection system that utilized Gabor filters and Histogram of Gradient (HOG) bins to extract features. Next, a Support Vector Machine (SVM) was used to detect if the extracted features represented fake or real iris. The proposed system was able to detect spoofing attacks with an accuracy of 98%. Finally, Tapia et al. [11] tackled testing the liveness of the scanned iris to protect the system from being fooled by printed images or artificial eyes. The proposed work utilized a MobileNetV2 network, which was trained from scratch. Moreover, the authors increased the number of filters and weighted each class based on the number of its instances. The proposed method was able to accurately classify irises with competitive Bona Fide Classification Error Rates (BPCER) of less than 4% in all experiments. III. PHYSICAL GRAY-BOX ADVERSARIAL ATTACKS A labeled training set of size s can be represented as DS = {(xi, yi)}s i=1, where yi ∈ Y and Y is the set of all possible output classes for an image classification problem. When training a deep classifier, we aim to optimize a dis- criminant function F that maps each instance,xi, to the class associated with the highest class probability, as can be seen in Equation 1. This optimization process takes place during the training process by passing DS to a deep classifier for a number of training rounds. The number of training rounds will be referred to as Epochs throughout the rest of this paper. The aforementioned setting of training F without any attacks will be referred to as the base model throughout this work. F → argmax(P (Y | xi)) (1) A. Attack Definition In our proposed attack, an attacker aims to corrupt the training process by perturbing the training instances incre- mentally between training epochs in order to optimize a corrupted poisoned discriminant function F (cid:48) that produces faulty probability distributions over the possible output classes. The attack is executed implicitly in multiple rounds. In each poisoning round, a poisoning procedure that selects X ⊆ DS of size |X| = α ∗ s is executed, where α ∈ (0%, 100%] is the poisoning percentage coefficient. The attacker's goal is to replace X = {(xi, yi)}|X| i=1 with a poisoned set X (cid:48) = {g(xi), yi)}|X| i=1, where g(.) is the poisoning function that modifies xi at a pixel level. The poisoning function replaces the pixels that fall within a selected area, namely P atchArea, with faulty pixels, x(cid:48), in order to corrupt the image representation and result in a faulty training process. The poisoning function can be seen in Equation 2, where W and H are the width and height of the training image instance xi. g(x) =    x(cid:48) u,v if (u, v) ∈ P atchArea , u ∈ [0, W ), v ∈ [0, H) xu,v Else (2) The attack targets the intermediate data structures, where the training instances are saved. In addition, it is executed incrementally between training epochs, such that a different X is selected every poisoning round in order to accumulate the poisoned training instances and increase the effectiveness of the attack. The attack frequency coefficient determines the number of poisoning rounds and is called β ∈ [1, Epochs]. When the value of β is chosen to be 1, then the attack will be executed after each training epoch causing an increased risk of damage. On the contrary, if the value is chosen to be Epochs, then the poisoning process will only happen once after the first training epoch. B. Poisoning Strategy Function g(.) in Equation 2 replaces pixels in a training instance within the defined poisoning area, P atchArea. This poisoning procedure can be implemented in multiple ways. In this work, we opted to implement g(.) to execute local pertur- bations and global perturbations [12]. It is worth mentioning that only one type of perturbations was considered in each of the conducted experiments in this work. In the local perturbations setting, a small area called physi- cal patch in the training instance is selected and replaced with pixels from another image. In this work, the physical patch was chosen to be close to the training set domain, hence it was an image of a human eye. It is worth mentioning that the size of the P atchArea and its location are randomized, and optimizing them is out of the scope of this work [5]. On the other hand, in the global perturbations setting, all the instances in X are replaced with another randomly selected image from the training set. This way the classifier will be exposed to a highly redundant training set which corrupts the training process by increasing the risk of overfitting. Both poisoning strategies are not easy to blacklist, since the local setting only alters a small area of each instance and the global perturbation setting uses an image from within the training instances in a manner that imitates image augmentation, which is a benign, widely used technique in training neural networks. C. Attack Characteristics The attack specifications can be summarized as: 1) The attack is non-targeted: the attack definition in III-A shows that no restrictions apply on the choice of yi in X. Moreover, the value of yi remains unchanged after poisoning takes place in X (cid:48). 2) The attack does not affect packets delay: the attack only targets the training phase, whereas the inference phase is executed in the usual manner. Hence, the attack is stealthy in the sense that it does not affect the packet delay when the deep classifier is deployed on the cloud. 3) The attack samples without replacement: to guarantee faster and stealthier execution, X is sampled every poisoning round without replacement; that is an instance can only be included once in X at a certain poisoning round, however an instance can be included in multiple poisoning rounds. This implies that the network will be exposed to a different training set after every poisoning round, which results in a higher training instability. 4) The attack is incremental for increased effectiveness: the poisoned instances in X (cid:48) accumulate in the train- ing set after each poisoning round and throughout the training phase, which in turn intensifies the effect of poisoning even at a low value of α. 5) The attack is gradient-free [13] and is gray box: the attack is gray box since we assume that the attacker only has access to the intermediate data structures of the training process without the need to access the physical path of the training instances or the neural network architecture. In other words, the attack is agnostic to the neural network architecture. The attack is also gradient- free since it perturbs the training data between epochs without the need to access the gradients of the attacked neural network. 6) The attack targets intermediate data structures: typ- ically developers' efforts are more focused on preparing and preprocessing the training set before training. On the other hand, what happens during training and the values of the intermediate data structures that keep the training instances are overlooked, especially that the training is usually conducted on powerful servers with limited physical access. Hence, this attack which poisons the data implicitly between training epochs, acquires its high risk property from attacking data structures that are typically not monitored by professionals, and hence the attack goes unnoticed despite the damage it causes. D. Evaluation Metrics In each experiment, the neural networks will be evaluated and compared in terms of the following evaluation measures: 1) Attack effectiveness measures: an attack is called effec- tive if it achieves its intended goals. In our proposed attack, the goal is to expose the deep classifier to an unstable training process, which in turn, will result in faulty probability distributions produced by the network at the inference stage. a) Average of Loss Change (ALC): the loss function is typically expected to decrease as the training process progresses. This is due to backpropagation, which reflects what the network learned during each training epoch. The ALC measures the av- erage change in the loss value over the training epochs, and the sign of this evaluation metric is a leading element, as it reflects whether the loss was decreasing or increasing throughout training. Executing the attack is expected to cause instability in the training process due to the noisy poisoned increase the ALC value. The data and, hence, ALC can be defined as follows, where the (cid:96) is the loss and Epochs is the number of training epochs: ALC = (cid:80)Epochs i=1 ((cid:96)i − (cid:96)i−1) Epochs − 1 (3) b) Average Inference Probability (AIP): the softmax function is typically used in the last layer of deep classifiers to normalize the output to a probability distribution over the possible output classes. Each test instance is classified as the class of the highest probability. In this evaluation criterion, we assess the effect of the attack on the probabilities pro- duced by the model at the inference stage, as typ- ically higher probabilities imply more confidence about the selected class. As a result, a decreased average probability reflects the effectiveness of the attack on the final output of the model. AIP can be calculated using Equation 4, where ti is a test instance. AIP = Average(argmax(P (Y | ti))) (4) 2) Attack stealthiness measures: an attack is called stealthy if the evaluation metrics of the corrupted classifier F (cid:48) are close to the metrics of the base model F [4]. a) Training Time Difference (T T D): training a neural network can be a lengthy process, especially when the training instances are large. Hence, it is crucial to ensure that executing the attack will not cause an observable added amount of time to the training phase, in order to keep the attack unnoticed. The T T D measure can be defined as follows: T T D = T rainingT ime(cid:48) − T rainingT imebase (5) where T rainingT imebase is the time taken to train the base model, and T rainingT ime(cid:48) is the training time when the neural network is trained with poisoned data. b) Performance Degradation Measure (PDM): in or- der to confirm the attack stealthiness, the metrics of the poisoned classifier need to be reasonably close to the metrics of the base classifier. In this evaluation criterion, the difference between the macro Fscore of the base model and each poisoned model is calculated, as described in Equation 6, where F score(cid:48) is the Fscore of a poisoned model. P DM = F scorebase − F score(cid:48) (6) E. Datasets The proposed attack perturbs images and hence can target any computer vision application. Nevertheless, we opted to apply it to an iris recognition dataset, due to the significance of this domain. The CASIA Iris Subject Ageing dataset [14] was considered in our experiments. This dataset was collected by the National Laboratory of Pattern Recognition (NLPR) in China in April 2009 and April 2013. In this work, the subset of CASIA Iris Subject Ageing which was collected in 2009 using the H100 sensor was chosen due to its high diversity and good size. The subset comprises 37912 instances of the left and right eyes of 48 individuals. The dataset instances pose some challenging scenarios, like glasses, partially closed eyes, Moreover, some instances have very low brightness. The cross-validation method was used to train and evaluate the neural networks, and 100 images from each user subject were randomly selected for the test dataset. F. Technical and Experimental Setup Three state-of-the-art deep classifiers, namely, Densenet, VGG, and Xception were considered for this work. Moreover, the number of epochs was set to 10, the cross entropy loss function was used and the networks were trained with a learning rate of .01 on the Google Colab Pro platform which utilizes NVIDIA GPUs. It is worth mentioning that the code of this work is available on Github [15]. Each of the 3 considered deep classifiers were experimented with α values of 5%, 10%,15%, and 20%, as 20% is typically the maximum poisoning percentage considered in the literature [16]. In the experiments description and results, the local perturbations poisoning strategy will be referred to as P , and the global perturbations strategy will be referred to as R. IV. RESULTS AND DISCUSSION In this section, the results of evaluating the proposed attack will be presented in detail. Figures 1, 2, and 3 depict the results of the evaluation metrics described in III-D. In all figures, the result of the base model is depicted as the origin point (α = 0%). A. Analysis of Attack Effectiveness Figure 1 depicts the ALC results for the 3 considered deep classifiers. A positive ALC value indicates increasing loss values and poor training, whereas a low negative value indi- cates a more stable training process. From Figure 1, it can be noted that increasing α was always associated with increased ALC values, hence, it can be concluded that increasing the poisoning percentage increases the effectiveness of the attack. Fig. 1. Experimental results of the Average of Loss Change (ALC) values Fig. 2. Experimental results of the Average Inference Probability (AIP) values Fig. 3. Experimental results of the Performance Degradation Measure (PDM) values On a different note, increasing the attack frequency (i.e., a lower β) resulted in increased effectiveness in all experiments. In the experiments where β's value was set to 1, the ALC kept increasing as the value of α increased, and the value was positive in all experiments where α ≥ 10%. On the other hand, when β = Epochs, the ALC results were increasing but negative in all experiments, which means that the loss values were still decreasing but at a lower rate compared to the base model and the experiments of higher frequency. The AIP results are depicted in Figure 2, where it can be seen that increasing the value of α resulted in decreasing the AIP in all experiments. However, this decrease varied in the experiments; for example, the decrease was slight, even when α increased, in the experiments where β=Epochs. On the other hand, increasing α with a higher frequency (β = 1) resulted in a more noticeable drop in the AIP values. For example, it can be seen in Figure 2(c) that the AIP value dropped by 24.88% when α = 20% and β = 1 in the random poisoning experiment, R. Whereas, the AIP value only dropped by 5% when we only changed the value of β to be equal to the number of Epochs. Furthermore, the highest drop in the AIP in the poisoned networks compared to their unpoisoned counterparts at inference time was 15.37%, 14.68%, and 24.88% for the Densenet, VGG, and Xception, respectively. Overall, we can conclude that the attack was effective in all conducted experiments. Moreover, the attack effectiveness has a positive correlation with the percentage α and frequency β. B. Analysis of Attack Stealthiness It is crucial to keep the proposed attack undetected. The attack can be easily noticed if it takes long to execute, thus, to ensure the attack stealthiness, the T T D measure is monitored 0%5%10%15%20%The poisoning percentage coefficient ()0.30.20.10.00.10.2ALC(a) The ALC values for DenseNetB=1,PB=Epochs,PB=1,RB=Epochs,R0%5%10%15%20%The poisoning percentage coefficient ()0.30.20.10.00.10.2ALC(b) The ALC values for VGGB=1,PB=Epochs,PB=1,RB=Epochs,R0%5%10%15%20%The poisoning percentage coefficient ()0.30.20.10.00.10.2ALC(c) The ALC values for XceptionB=1,PB=Epochs,PB=1,RB=Epochs,R0%5%10%15%20%The poisoning percentage coefficient ()65707580859095100AIP (%)(a) The AIP values for DenseNetB=1,PB=Epochs,PB=1,RB=Epochs,R0%5%10%15%20%The poisoning percentage coefficient ()65707580859095100AIP (%)(b) The AIP values for VGGB=1,PB=Epochs,PB=1,RB=Epochs,R0%5%10%15%20%The poisoning percentage coefficient ()65707580859095100AIP (%)(c) The AIP values for XceptionB=1,PB=Epochs,PB=1,RB=Epochs,R0%5%10%15%20%The poisoning percentage coefficient ()0246810PDM (%)(a) The PDM values for DenseNetB=1,PB=Epochs,PB=1,RB=Epochs,R0%5%10%15%20%The poisoning percentage coefficient ()0246810PDM (%)(b) The PDM values for VGGB=1,PB=Epochs,PB=1,RB=Epochs,R0%5%10%15%20%The poisoning percentage coefficient ()0246810PDM (%)(c) The PDM values for XceptionB=1,PB=Epochs,PB=1,RB=Epochs,R in all experiments. Among all conducted experiments, the maximum T T D value was 63 seconds. Hence, the attack did not add a noticeable period of time to the training time of the base model. Moreover, to monitor the stealthiness of the attack, the P DM values were recorded as can be seen in Figure 3. The maximum P DM value was recorded for the VGG network with α = 20% and β = 1 in the random poisoning experiment, R. Overall, the average P DM values were 1.2%, 1.9%, and 1.5% for the Densenet, VGG, and Xception, respectively. Hence, it can be concluded that the attack demonstrated a stealthy behavior. C. Analysis of Poisoning Strategy As explained in Section III-B, the attack was experimented under local perturbations setting (P ) and global perturbations setting (R). The influence of the perturbation type was highly associated with the value of β. It can be seen in Figures 1, 2 and 3 that in the experiments of low frequency, where β = Epochs, both perturbation types achieved comparable results. On the other hand, when the poisoning rounds were executed after every epoch, where β=1, the attack showed the highest effectiveness in the global perturbations setting, P . Finally, the results showed that the proposed attack is effective and stealthy. Those properties increase when the attack is intensified by increasing the value of α, increas- ing the number of affected pixels, similar to the case of global perturbations, and decreasing β for higher execution frequency. Moreover, the proposed attack inherits its riskiness from attacking unobserved data structures that usually reside on powerful servers with limited physical access. The attack is also incremental and accumulates poisoned data gradually to intensify its effectiveness across the training epochs. In addition, the attack requires no knowledge about the neural network structure, as all experiments in this work were con- ducted using the same injection code. V. CONCLUSION AND FUTURE WORK Neural networks are vulnerable to adversarial attacks. More- over, the digital transformation adopted worldwide implies continuous acquisition and analytics of big streams of data, which has brought novel digital threats and unforeseen ex- posures to cybersecurity. In this work, we propose a novel gradient-free, gray box, incremental attack that targets the intermediate data structures of the training phase of neural networks. The attack has 3 main parameters: the attack per- centage coefficient, the attack frequency coefficient, and the poisoning strategy. In all conducted experiments, it was noted that the attack stealthiness and effectiveness had a positive correlation with the aforementioned parameters. Moreover, the attack resulted in unstable training, as it made the loss values increase which in turn indicates poor learning and generalization. Moreover, the attack was able to decrease the probability of the output class (AIP ) in the poisoned net- works compared to their unpoisoned counterparts at inference time by 15.37%, 14.68%, and 24.88% for the Densenet, VGG, and Xception, respectively. Despite its effectiveness, the attack remained stealthy as it only dropped the Fscore values by 1.2%, 1.9%, and 1.5% for the poisoned Densenet, VGG, and Xception, respectively. In future works, further sensitivity analyses will be con- ducted on existing and new parameters, such as the type of communication protocol, and the area and size of the patch the attack will be compared to other iris area. Moreover, recognition attacks. ACKNOWLEDGEMENTS This research was supported by the Technology Innovation Institute (TII), Abu Dhabi, UAE, under the CyberAI project (grant number: TII/DSRC/2022/3036). REFERENCES [1] J. Machin, E. Batista, A. Ballest ́e, and A. Solanas, "Privacy and security in cognitive cities: A systematic review," Applied Sciences, vol. 11, p. 4471, 05 2021. [2] A. Morales, J. Fierrez, J. Galbally, and M. Gomez-Barrero, "Introduc- tion to iris presentation attack detection," in Handbook of Biometric Anti-Spoofing, 2nd Ed., 2019. [3] J. Su, D. V. Vargas, and K. Sakurai, "One pixel attack for fooling deep neural networks," IEEE Transactions on Evolutionary Computation, vol. 23, no. 5, pp. 828–841, 2019. [4] J. Breier, X. Hou, M. Ochoa, and J. Solano, "Foobar: Fault fooling backdoor attack on neural network training," IEEE Transactions on Dependable and Secure Computing, pp. 1–1, 2022. [5] X. Li and S. Ji, "Generative dynamic patch attack," 2021. [6] P. Zhao, S. Wang, C. Gongye, Y. Wang, Y. Fei, and X. Lin, "Fault sneak- ing attack: a stealthy framework for misleading deep neural networks," 2019 56th ACM/IEEE Design Automation Conference (DAC), pp. 1–6, 2019. [7] S. Hong, P. Frigo, Y. Kaya, C. Giuffrida, and T. Dumitras ̧, "Terminal brain damage: Exposing the graceless degradation in deep neural net- works under hardware fault attacks," in Proceedings of the 28th USENIX Conference on Security Symposium, ser. SEC'19. USA: USENIX Association, 2019, p. 497–514. [8] V. W. Anelli, A. Bellog ́ın, Y. Deldjoo, T. Di Noia, and F. A. Merra, "Msap: Multi-step adversarial perturbations on recommender sys- tems embeddings," The International FLAIRS Conference Proceedings, vol. 34, April 2021. [9] R. Sharma and A. Ross, "Image-level iris morph attack," in 2021 IEEE International Conference on Image Processing (ICIP), 2021, pp. 3013– 3017. [10] A. Thukral, Jyoti, and M. Kumar, "Iris spoofing through print attack us- ing svm classification with gabor and hog features," in 2022 International Conference for Advancement in Technology (ICONAT), 2022, pp. 1–6. [11] J. E. Tapia, S. Gonzalez, and C. Busch, "Iris liveness detection using a cascade of dedicated deep learning networks," IEEE Transactions on Information Forensics and Security, vol. 17, pp. 42–52, 2022. [12] C. Yang, A. Kortylewski, C. Xie, Y. Cao, and A. Yuille, "Patchat- tack: A black-box texture-based attack with reinforcement learning," in Computer Vision – ECCV 2020, A. Vedaldi, H. Bischof, T. Brox, and J.-M. Frahm, Eds. Cham: Springer International Publishing, 2020, pp. 681–698. [13] M. Alzantot, Y. Sharma, S. Chakraborty, H. Zhang, C.-J. Hsieh, and M. Srivastava, "Genattack: Practical black-box attacks with gradient- free optimization," 2018. [14] National Laboratory of Pattern Recognition (NLPR) - Institute of Au- tomation, Chinese Academy of Sciences (CASIA), "CASIA Iris Subject Ageing," http://biometrics.idealtest.org/, Accessed in October 4th 2022. Training https://github.com/Artifitialleap- Data MBZUAI/IncrementalTrainingDataPoisoning, October 2022. [15] Artifitialleap-MBZUAI, "Incremental Attack," [16] M. Jagielski, A. Oprea, B. Biggio, C. Liu, C. Nita-Rotaru, and B. Li, "Manipulating machine learning: Poisoning attacks and countermeasures for regression learning," 2018 IEEE Symposium on Security and Privacy (SP), pp. 19–35, 2018.
http://arxiv.org/abs/2302.12205v1
2023-02-20T09:38:12
2023-02-20T09:38:12
Harris Hawks Feature Selection in Distributed Machine Learning for Secure IoT Environments
The development of the Internet of Things (IoT) has dramatically expanded our daily lives, playing a pivotal role in the enablement of smart cities, healthcare, and buildings. Emerging technologies, such as IoT, seek to improve the quality of service in cognitive cities. Although IoT applications are helpful in smart building applications, they present a real risk as the large number of interconnected devices in those buildings, using heterogeneous networks, increases the number of potential IoT attacks. IoT applications can collect and transfer sensitive data. Therefore, it is necessary to develop new methods to detect hacked IoT devices. This paper proposes a Feature Selection (FS) model based on Harris Hawks Optimization (HHO) and Random Weight Network (RWN) to detect IoT botnet attacks launched from compromised IoT devices. Distributed Machine Learning (DML) aims to train models locally on edge devices without sharing data to a central server. Therefore, we apply the proposed approach using centralized and distributed ML models. Both learning models are evaluated under two benchmark datasets for IoT botnet attacks and compared with other well-known classification techniques using different evaluation indicators. The experimental results show an improvement in terms of accuracy, precision, recall, and F-measure in most cases. The proposed method achieves an average F-measure up to 99.9\%. The results show that the DML model achieves competitive performance against centralized ML while maintaining the data locally.
[ "Neveen Hijazi", "Moayad Aloqaily", "Bassem Ouni", "Fakhri Karray", "Merouane Debbah" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12205v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12205v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CR", "eess.SP" ]
Harris Hawks Feature Selection in Distributed Machine Learning for Secure IoT Environments Neveen Hijazi1, Moayad Aloqaily1, Bassem Ouni2, Fakhri Karray1, Merouane Debbah2 1Mohamed Bin Zayed University of Artificial Intelligence (MBZUAI), UAE 2Technology Innovation Institute (TII), Abu Dhabi, UAE E-mails: 1{neveen.hijazi; moayad.aloqaily; fakhri.karray}@mbzuai.ac.ae 2{bassem.ouni; merouane.debbah}@tii.ae 3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 5 0 2 2 1 . 2 0 3 2 : v i X r a Abstract-The development of the Internet of Things (IoT) has dramatically expanded our daily lives, playing a pivotal role in the enablement of smart cities, healthcare, and buildings. Emerging technologies, such as IoT, seek to improve the quality of service in cognitive cities. Although IoT applications are helpful in smart building applications, they present a real risk as the large number of interconnected devices in those buildings, using heterogeneous networks, increases the number of potential IoT attacks. IoT applications can collect and transfer sensitive data. Therefore, it is necessary to develop new methods to detect hacked IoT devices. This paper proposes a Feature Selection (FS) model based on Harris Hawks Optimization (HHO) and Random Weight Network (RWN) to detect IoT botnet attacks launched from compromised IoT devices. Distributed Machine Learning (DML) aims to train models locally on edge devices without sharing data to a central server. Therefore, we apply the proposed approach using centralized and distributed ML models. Both learning models are evaluated under two benchmark datasets for IoT botnet attacks and compared with other well-known classification techniques using different evaluation indicators. The experimental results show an improvement in terms of accuracy, precision, recall, and F-measure in most cases. The proposed method achieves an average F-measure up to 99.9%. The results show that the DML model achieves competitive performance against centralized ML while maintaining the data locally. Index Terms-IoT, Harris Hawks Optimization, Cognitive Cities, Smart Buildings, Distributed Machine Learning. I. INTRODUCTION Internet of Things (IoT) is one of the most significant revolutions of the 21st century and can be simply described as a set of connected smart edge devices. These devices can be found in many applications we encounter across our daily lives including healthcare, smart cities, transportation systems, and smart grids [1]. IoT environments typically consist of collections of distributed heterogeneous devices with low computational memory, and they have the ability to expand with other interconnected networks, which results in many security concerns [2]. The enormous increase in IoT devices and their lack of security guarantees has motivated attackers to launch attacks by setting up large-scale IoT botnet attacks. A botnet is a network of devices connected to IoT devices that are infected by malware. In addition, compromised devices have a simple infection process, which makes every vulnerable device a bot candidate. Some of the most popular examples of IoT botnet attacks are Mirai, BASHLITE, and Phishing [3]. Consequently, this highlights the importance of increasing security measures to identify the most critical cyberattacks in a smart IoT environment. Intrusion Detection Systems (IDSs) are security systems that detect attacks and malicious activities in networks, such as botnet attacks. ML techniques can play an essential role in IDS structures to classify and predict attacks. Different ML techniques are used to detect anomalies and attacks in cybersecurity, such as K-Nearest Neighbor (KNN), Support Vector Machines (SVM), and Decision Trees (DT) [4], [5]. However, IoT devices continuously produce vast amounts of data that is challenging to deal with using traditional ML techniques and requires complex models to process such as deep learning technique [1]. Therefore, there is a need for more efficient searching and learning algorithms, which has led to the emergence of metaheuristic algorithms. Metaheuristics algorithms are a well-regarded choice to solve high-dimensional problem through the utilization of the feature selection technique [6]. The objective of this technique is to generate a highly accurate general model while minimizing the number of selected features in order to reduce computational time. Therefore, various works have utilized metaheuristic algorithms in feature selection methods such as Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and Harris Hawks Optimization (HHO) [5], [7]. Distributed ML is a valuable approach, it aims to train one or more ML models for a network of users, each having a local dataset. Thus, distributed ML reduces data transmissions within centralized ML and minimizes the risks of privacy leaks. In addition, it can reduce the risk of a single point of failure compared to centralized ML [8]. Distributed ML can be applied in various applications such as healthcare [9] and wireless network [2]. In this study, we propose a hybrid model based on the HHO and Random Weight Network (RWN) al- gorithms to detect botnet attacks launched from compromised IoT devices. The proposed approach performs wrapper FS based on two main stages: centralized and distributed ML. Wrapper FS consists of three repeated steps including search algorithm, learning algorithm, and an evaluation measure. In our work, we used HHO as a search algorithm to select the near-optimal feature subset of the input features and optimized the RWN structure simultaneously to increase the prediction power. Then, RWN is applied as a learning algorithm to fit the training dataset according to the selected solution. Finally, evaluation measures are applied to assess the quality of the selected solution. The proposed approach is compared with other metaheuristics approaches [10]. The contributions of this work can be summarized as 1) We propose an intrusion detection system based on HHO with RWN. 2) We apply RWN as the base classifier in wrapper FS, unlike most of the literature that uses KNN. 3) We utilize the HHO algorithm to achieve two different objectives simultaneously, including, near-optimal sub- set of features and number of hidden neurons in RWN. 4) We leverage distributed ML to maintain data privacy and apply the proposed approach using a distributed ML scheme. The rest of the paper is organized as follows. Section II presents the background and related works of Harris Hawks Optimization, Random Weight Network algorithms, and De- centralized machine learning. The methodology and proposed approach are described in detail in Section III. The conducted experiments and the obtained results are discussed in Section IV. Finally, we conclude our work and provide suggestions for future directions in Section V. II. BACKGROUND AND RELATED WORK A. Harris Hawks Optimization (HHO) HHO is a meta-heuristic optimization algorithm developed by A. Heidari et al. [11]. The HHO algorithm was inspired by the behavior of Harris Hawks. Precisely, HHO uses a multi-agent system where each agent represents a solution and collaborates with other agents to search for the global optimal solution. The algorithm starts with a set of initial solutions, and then updates the solutions by exchanging information and searching in a new direction. The algorithm terminates when a stopping criterion is met, such as reaching a maximum number of iterations or finding a solution that meets a certain fitness threshold. HHO uses a combination of global and local search techniques to balance the exploration and exploitation of a search space in order to find the global optimum solution. In the exploration phase, candidate solutions are randomly gen- erated and evaluated for potential optimization. The selection of the solution generation strategy is based on a probabil- ity of either considering the location of already discovered solutions or relying on randomly determined positions. The exploitation phase of the HHO algorithm is a key component that influences the optimization performance. In this phase, the algorithm uses the surprise pounce strategy to search for optimal solutions in the problem space. The algorithm follows four different chasing strategies: Soft Besiege, Hard Besiege, Soft Besiege with progressive rapid dives, and Hard Besiege with advanced fast dives. The choice of strategy is based on the energy of the prey, where the prey energy loses its energy while escaping the hawk. Thus, the hawks alternate between different exploitative behaviors based on the prey's energy during running. HHO is applied in different and broad applications in the literature. For instance, O. Alzubi et al. [4] proposed an SVM combined with HHO for Android malware detection. Their research relied on two targets, the first goal was to determine the best hyperparameters for the SVM, and the second was to determine the weights of the features to determine the most important ones, thus improving the detection process by using the HHO algorithm. Their approach was compared against existing techniques using four different datasets. The results showed superior performance over other metaheuris- tic algorithms and state-of-art classifiers. Another work also mentioned the importance of HHO [12]. In this study, S. Sokkalingam et al. proposed three hybrid ML approaches with feature selection methods for IDS: SVM-PSO, SVM-HHO- PSO, and SVM-HHO. The performance of these methods was evaluated using the NSL-KDD dataset and compared with various classifiers. The experimental outcomes indicated that SVM-HHO-PSO achieved the best results compared to other methods. B. Random Weight Networks (RWN) RWN is a computational neural network model developed by Schmidt et al. [13] to handle the training process of a Single Hidden Layer Feedforward Neural Network (SLFN), where a node can be a subnet that consist of extra hidden node. RWN has overcome the problems of back-propagation, such as slow convergence and high probability of being trapped in a local minimum. In RWN, the input weights and the hidden biases are initialized randomly; then, the output weights are analytically computed using the Moore–Penrose generalized inverse method. Compared to other gradient descent methods used in SLFN, the RWN learning rate is speedy and has better generalization performance. Moreover, RWN does not need human intervention to set the parameters manually such as learning rate, number of epochs, etc. RWN has only one parameter that needs to be initialized, which is the number of hidden neurons. RWN is a powerful learning algorithm, which is used in a wide range of applications. For example, H. Faris et al. [5] proposed a hybrid email spam detection system based on GA and RWN. The proposed approach performs a wrapper FS method using an RWN classifier. The GA is used to select the optimal features and determine the number of neurons in the hidden layer of the RWN. Their approach detected spam emails and achieved excellent results in terms of accuracy, recall, and precision. Another hybrid method proposed by E. Rawashdeh et al. in [14]. In this study, the authors depended on RWN and PSO. The aim of the work was to optimize the structure of the RWN and to find the best subset of features. PSO was used to find the best subset of features, as well as the number of hidden neurons in RWN. The proposed approach was evaluated on thirty datasets, compared with other state-of- the-art methods, and showed superior results in most datasets. C. Distributed Machine Learning (DML) In this approach of learning, a generic model is distributed by the server to all clients or devices. The devices then customize the model through local training and testing with their own data, enabling predictions and insights from live data generated by the device. This approach keeps the data local, reducing security and privacy concerns, but the downside is that IoT devices are not well-suited for intensive computation [2]. Distributed ML has gained more attention in recent years. For instance, F. Zerka et al. [9] applied several ML algorithms using a distributed framework to preserve medical data pri- vacy. Their approach was compared with the centralized ML approach using four small medical datasets. The results show the distributed approach delivers similar performance that to the centralized approach, while preserving privacy of the patient data. A. Tuladhar et al. [15] investigated a distributed ML model by ensemble using three classifiers: ANNs, SVM, and Random Forests (RF). Their approach was evaluated on four medical datasets. They found improvement in results when increasing the number of locally trained models in the ensemble. The authors suggested using the proposed approach on small datasets. According to the No Free Lunch theorem (NLF) [16], there is no single optimization algorithm that outperforms the others in all optimization problems. Therefore, this field of research offers opportunities for improvement and the development of new techniques that can tackle a wider range of problems and applications. This will ultimately lead to more competitive and improved results when compared to current algorithms. Overall, it can be understood from the literature that applying evolutionary algorithms with RWN is gaining more attention from researchers. HHO is a recent optimization algorithm that has been applied in different applications and has achieved promising results compared to other metaheuristic techniques. it provides good exploration and exploitation. Moreover, Therefore, it would be wise to use these properties with a robust learning algorithm, such as RWN. In conclusion, the proposed approach differs from previous studies by proposing a wrapper FS based on HHO and RWN algorithms to solve the IoT botnet detection problem, and applying the proposed approach within distributed ML that addresses IoT security and privacy issues. III. METHODOLOGY The proposed work is conducted based on a two-stage: centralized and distributed ML models. We apply the FS method, model construction, evaluation, and assessment in each stage. The main contribution lies in FS and the phases of model construction, where a new model based on HHO and RWN is proposed. This section presents the details of the proposed approach, which is based on using HHO for FS while simultaneously optimizing the RWN structure. A. Data Preprocessing Two benchmark datasets were used for this work: N-BaIoT dataset [17] and Phishing legitimate dataset [18]. The N-BaIoT dataset is obtained from the University of California at Irvine (UCI) machine learning repository. This dataset represents a real IoT network consisting of nine devices: a baby monitor, Fig. 1. An overview of the proposed approach. two doorbells, four security cameras, a thermostat, and a web- cam. The second dataset was collected from Kaggle datasets. The dataset comprises 48 features extracted from 10,000 web pages, with 5000 being phishing pages and the other 5000 being legitimate ones [18]. Using the preliminary dataset without any preprocessing may impact the overall performance of the obtained model. Because we deal with massive and real datasets, they may contain inconsistent and redundant data. In order to get the best possible results, we apply data integration and data normalization. In the integration step, we integrated the data for the N-BaIoT dataset according to each device type. For example, the four different types of security cameras are merged into one file. All the devices in the N-BaIoT dataset have 115 features and 7,062,606 instances. These devices typically connect to IoT networks through Wi-Fi. For each device, data were collected during normal operation and various attacks conducted by the BASHLITE and Mirai botnet. The total number of attacks carried out by BASHLITE and Mirai were 555,932 and 2,838,272 respectively. The integration step's benefit is reducing the number of generated models [17]. For the normalization step, we apply the Min- Max normalization method to both datasets to make all the input values within a consistent scale [0,1]. B. Wrapper Feature Selection based on HHO-RWN In this work, we apply an FS method on the training dataset to eliminate irrelevant features, reduce data dimensionality, and increase prediction performance. Two well-known meth- ods in feature selection are filter-based and wrapper-based approaches. In our work, we used a wrapper-based approach. Wrapper FS consists of three main components: the search algorithm, learning algorithm, and evaluation of the features. Wrappers are more potent than filters when accuracy is more MaliciousBenignDatasetsTraining setTesting set34%66%Training set with selected features and number of hidden nodesRWNTesting set with selected features and number of hidden nodesFinal evaluation based on testing setEndHHORWNFitnessSelected featuresPre-processing important than speed. This is because they explore the relevant subset of features in the search space of a particular classifier, where most studies use the same classifier used in the learning process [5]. On the other hand, the drawback of the wrappers is that they require a high computational time. Most studies use fast classifiers such as KNN as a primary classifier [5]. In our proposed approach, we utilize RWN as the base classifier; in addition to the fast-learning property, RWN has good generalization performance. Our wrapper-based ap- proach selects HHO to search for the relevant feature subsets. In order to apply a metaheuristic optimization algorithm for a given task, two crucial design issues have to be addressed: the solution representation and the fitness function used to evaluate the solution, which are discussed below: As mentioned earlier, the proposed approach was applied in two stages: centralized and distributed ML. In the centralized ML model, we trained the proposed approach and other traditional ML techniques by using the entire training dataset. Then we use the centralized ML model as a reference to compare the performance of each corresponding distributed ML model in each dataset. In contrast, the distributed ML models, representing various IoT devices, were trained on local datasets. We split the training datasets by sampling without replacement method to ensure the diversity (i.e. different parts of the training datasets) for each user. So, each user has local data and applies the proposed approach and other ML techniques, thus distributed ML contributes to preserve the data privacy. 1) Solution Representation: A hawk in HHO represents a candidate solution for the targeted problem. A solution in our work consists of two parts. The first part is a set of binary bits 1 or 0, which indicate if the corresponding features are selected or not. The second part of the candidate solution consists of a group of binary bits that determine the number of hidden nodes in RWN. The length of the solution is L + M, where L is the number of features in the dataset, and M is the number of bits reserved to represent the maximum number of hidden neurons. 2) Fitness Function: A fitness function is needed to assess the quality of the solutions. In this work, we use a fitness function that addresses three objectives: increasing the classification accuracy, reducing the dimensionality of the dataset by selecting the relevant features, and de- creasing the complexity of the RWN in terms of the number of hidden nodes. This fitness function is defined in Eq. 1. F itness = αErr + β f F + γ n N (1) The parameters α, β, and γ are three factors within the range [0–1] that control the weight of each of the classifi- cation rate, number of selected features, and hidden neurons, respectively. Err represents the classification error rate of the RWN classifier, f denotes the number of selected features, F is the total number of original features in the dataset, n is the number of neurons determined by the evaluated HHO solution, and N is the maximum number of possible neurons in the RWN. The maximum number of neurons is set to 1024, which is represented by ten elements in the solution. Usually, the error rate is measured as (Err = 1−Acc), where Acc represents the classification accuracy. To consider the imbalanced datasets, we use the F-measure instead of accuracy in the error rate measure. Thus, the error rate in our case becomes (Err = 1 − F measure). After we obtained the selected features from the FS process, we must remove the irrelevant features and keep only the selected features from the training and testing data which will highly improve the performance measure. The proposed approach is illustrated in Fig.1. The code is available in the GitHub [19]. IV. RESULTS AND DISCUSSION This section presents a performance evaluation of the pro- posed approach through experiments on the datasets. All the experiments were performed using a PC with Intel Core (TM) i7-165G7 2.8 GHz and 16 GB RAM. The proposed approach was implemented and tested in Python 3.9.12. Initially, the datasets are divided into (66% and 34%) for training and testing, respectively. The training dataset is further distributed into (75% and 25%) for training and validation, respectively. Since Evolutionary Algorithms (EAs) are based on random- ness, experiments must be repeated several times to reduce the random effect in EAs performance. Therefore, the proposed approach was tested under 30 independent runs, while the number of iterations was 100 and the population size was 200. Commonly, the population size should be large enough to guarantee the diversity of the solutions [20]. Most recent references have set the value of the population size to 200 or less [7], [10]. Therefore, we used the maximum population size value of many studies. Also, many previous works have set the values of α, β, and γ, fitness function parameters to 0.99, 0.01, and 0.01, respectively [5], [7]. Therefore, this paper uses the same values of these parameters in the fitness function. In addition, we compare the performance with other known classifiers commonly used in the literature, including KNN, SVM, Adaboost, and DT. This experiment aims to show the motivation for using RWN as a primary classifier within the FS method and as a final classifier. Because the datasets are imbalanced, considering the accuracy ratio for evaluation is misleading. Therefore, we should examine other metrics such as recall, precision, and F-measure. For all results, the best results were indicated by a bold typeface. The results of accuracy, recall, precision, and F-measure values of the cen- tralized and distributed ML models are shown in Tables I and II, respectively. According to the HHO-RWN results in Table I, we can see that all average accuracy values are enhanced compared to SVM and Adaboost classifiers. The accuracy rate has improved up to 2.6% compared to HHO-SVM in Security camera device. Regarding the average precision results, we can observe that all values in HHO-RWN are higher than other classifiers. The precision enhancement rate reached 6.6% in Phishing legitimate dataset. As for the average F-measure, Fig. 2. The convergence curves for centralized ML models during training iterations. Fig. 3. The convergence curves for distributed ML models during training iterations. HHO-RWN outperforms the other classifiers with 4 out of 5 devices in the N-BaIoT dataset. It also achieved the best average F-measure result in Phishing legitimate dataset. The maximum result accomplished by HHO-RWN with 99.9%. The F-measure rate has improved by 8.0% compared to HHO- SVM in Webcam device. Table II illustrates the results for the distributed ML model. We can observe that HHO-RWN and HHO-DT obtained the highest F-measure with 99.9% in the Webcam dataset, and HHO-Adaboost achieved the second highest with 99.5%. The F-measure rate has improved up to 9.3%. The precision rate has enhanced up to 14.5% in Phishing legitimate dataset. According to the average recall results, the maximum result achieved by HHO-RWN with 99.0%, and the improvement rate reached 24.0% in the Security camera device. Additionally, we compare the performance of centralized and distributed ML models. The average F-measure of distributed ML yields the best results in the Security camera device with 99.9%, and it shares the same results with the centralized ML model in the Baby Monitor device with 99.8% and in the Webcam device with 99.9%, and is very competitive in the other cases. Overall, the results in the distributed ML scheme showed promising performance. In the distributed ML scheme, we trained the proposed approach on a portion of the training dataset. While in the centralized scheme, the proposed approach has been trained in the entire training dataset, leading to higher generalization and better performance. The convergence curves of the HHO-RWN in centralized and distributed ML models with other classifiers are shown in Figs. 2 and 3, respectively for all datasets, according to the measurement of fitness. It can be seen that the different selec- tion schemes show a similar convergence pattern. However, the proposed approach is relatively preferable with regards to the convergence rate. Noting that 100 iterations are used to moni- tor convergence in all cases. It is reasonable to say that the best feature subsets and the best number of hidden neurons that are selected by the proposed approach enable it to obtain higher values based on the four metrics measured on the testing dataset. Table III shows the comparison of average accuracy, recall, and precision values between HHO-RWN and other metaheuristics. According to the collected results, HHO-RWN achieved the highest average accuracy among all algorithms for two devices. HHO-RWN recorded the best performance with a 0.999% accuracy at the Baby monitor device. When evaluating HHO-RWN ability to correctly identify anomalies, the results were the best in two devices. Table III also reveals that HHO-RWN achieved the best average precision values among two devices. Since privacy and security factors are essential in many applications, distributed ML is a promising learning solution. It enables the training of machine learning models locally, so there is no need to transfer the data to a central cloud. Thus, the reduction in heavy data transmissions will minimize the number of potential attacks consequently decreasing the risks of privacy leakage. Therefore, the choice of whether to build a centralized or distributed model depends on the target application and the nature of the data. We can say that choosing the appropriate learning scheme depends on the application's environment, priorities, and objectives while considering factors of privacy, performance, and computational resources. V. CONCLUSION Due to the dramatic increase in the number of IoT devices deployed online and the security sensitives of these devices, hackers and attackers exploit the increase of such devices to deploy different types of attacks. Intrusion detection systems are one of the techniques allocated to protecting the IoT network. The main aim of the proposed approach is to detect IoT botnet attacks by utilizing HHO to improve RWN and at the same time, to perform FS based on centralized and distributed ML models. Experimental results revealed that the proposed model performs well in centralized and distributed models to detect attacks on smart IoT devices. For future work, we plan to integrate the proposed approach using Federated Learning (FL) to improve security and privacy issues. In addition, investigate the efficiency of the proposed approach for other types of applications such as the healthcare system. ACKNOWLEDGEMENTS This research was supported by the Technology Innovation Institute (TII), Abu Dhabi, UAE, under the CyberAI project 020406080100Iteration0.0020.0040.0060.0080.0100.0120.014FitnessBaby_MonitorHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN020406080100Iteration0.0020.0030.0040.0050.0060.0070.0080.0090.010FitnessDoorbellHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN020406080100Iteration0.0020.0040.0060.0080.0100.0120.0140.0160.018FitnessThermostatHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN020406080100Iteration0.000.010.020.030.040.050.06FitnessSecurity_cameraHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN020406080100Iteration0.0040.0060.0080.010FitnessWebcamHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN020406080100Iteration0.030.040.050.060.070.080.090.10FitnessPhishing_legitimateHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN020406080100Iteration0.0040.0060.0080.0100.0120.014FitnessBaby_MonitorHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN020406080100Iteration0.0040.0060.0080.0100.012FitnessDoorbellHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN020406080100Iteration0.0050.0100.0150.0200.025FitnessThermostatHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN020406080100Iteration0.000.010.020.030.040.050.060.07FitnessSecurity_cameraHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN020406080100Iteration0.0040.0060.0080.0100.012FitnessWebcamHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN020406080100Iteration0.040.050.060.070.080.090.100.11FitnessPhishing_legitimateHHO-AdaboostHHO-SVMHHO-DTHHO-kNNHHO-RWN TABLE I EVALUATION RESULTS OF PROPOSED APPROACH AND OTHER COMPARATIVE METHODS UNDER THE CENTRALIZED LEARNING SCHEME. HHO-KNN HHO-SVM HHO-Adaboost HHO-DT HHO-RWN Prec F-measure Acc Rec Prec F-measure Acc Rec Prec F-measure Acc Rec Prec F-measure Acc Rec Prec F-measure Acc Rec Datasets 0.996 0.989 0.993 0.994 Baby Monitor 0.999 0.989 0.987 0.993 Doorbell 0.999 0.958 0.978 0.992 Thermostat 0.998 0.991 0.985 0.970 Security camera 0.997 0.992 0.989 0.993 Webcam Phishing legitimate 0.951 0.953 0.947 0.951 0.991 0.954 0.991 0.979 0.996 0.982 0.982 0.954 0.984 0.983 0.984 0.988 0.974 0.720 0.974 0.963 0.996 0.978 0.996 0.919 0.906 0.899 0.909 0.821 0.997 0.992 0.988 0.992 0.995 0.990 0.973 0.992 0.998 0.851 0.972 0.996 0.997 0.980 0.991 0.992 0.998 0.992 0.982 0.995 0.967 0.942 0.944 0.944 0.990 0.993 0.993 0.985 0.994 0.995 0.992 0.977 0.998 0.995 0.933 0.976 0.997 0.993 0.991 0.960 0.999 0.993 0.992 0.953 0.965 0.957 0.972 0.965 0.999 0.996 0.995 0.998 0.998 0.984 0.996 0.997 0.995 0.968 0.995 0.999 1.000 0.992 1.000 0.990 0.998 0.997 0.998 0.999 0.974 0.973 0.975 0.974 TABLE II EVALUATION RESULTS OF PROPOSED APPROACH AND OTHER COMPARATIVE METHODS UNDER THE DISTRIBUTED LEARNING SCHEME. HHO-KNN HHO-SVM HHO-Adaboost HHO-DT HHO-RWN Prec F-measure Acc Rec Prec F-measure Acc Rec Prec F-measure Acc Rec Prec F-measure Acc Rec Prec F-measure Acc Rec Datasets 0.991 0.997 0.991 0.996 Baby Monitor 0.998 0.991 0.982 0.997 Doorbell 0.997 0.945 0.926 0.997 Thermostat 0.998 0.988 0.988 0.971 Security camera Webcam 0.996 0.990 0.992 0.990 Phishing legitimate 0.941 0.886 0.927 0.930 0.989 0.972 0.990 0.994 0.995 0.989 0.982 0.997 0.984 0.980 0.984 0.981 0.970 0.750 0.950 0.924 0.990 0.988 0.994 0.906 0.909 0.857 0.827 0.898 0.992 0.995 0.998 0.996 0.993 0.984 0.994 0.998 0.996 0.943 0.965 0.997 0.997 0.983 0.992 0.994 0.996 0.996 0.996 0.995 0.969 0.958 0.959 0.958 0.996 0.990 0.966 0.990 0.993 0.990 0.970 0.999 0.997 0.895 0.969 0.998 0.999 0.981 0.983 0.998 0.999 0.998 0.996 0.999 0.959 0.936 0.935 0.959 0.998 0.994 0.991 0.998 0.996 0.980 0.994 0.996 0.992 0.971 0.993 0.997 0.997 0.990 0.997 0.998 0.995 0.996 0.994 0.999 0.969 0.970 0.972 0.963 TABLE III COMPARISON BETWEEN HHO-RWN AND OTHER METAHEURISTICS IN TERMS OF ACCURACY, RECALL, AND PRECISION Dataset Recall HHO-RWN NSGA-II MOPSO-L ́evy SPEA-II HHO-RWN NSGA-II MOPSO-L ́evy SPEA-II HHO-RWN NSGA-II MOPSO-L ́evy SPEA-II Accuracy Precision Baby Monitor 0.999 0.998 Doorbell 0.995 Thermostat 0.565 0.487 0.289 0.937 0.989 0.998 0.604 0.801 0.327 0.996 0.984 0.968 0.985 0.693 0.149 0.920 0.780 0.997 0.967 0.902 0.157 0.995 0.996 0.995 0.479 0.256 0.022 0.710 1.000 0.957 0.521 0.559 0.000 (grant number: TII/DSRC/2022/3036). REFERENCES [1] M. Aloqaily, S. Otoum, I. Al Ridhawi, and Y. Jararweh, "An intrusion detection system for connected vehicles in smart cities," Ad Hoc Networks, vol. 90, p. 101842, 2019. [2] B. Ghimire and D. B. Rawat, "Recent advances on federated learning for cybersecurity and cybersecurity for federated learning for internet of things," IEEE Internet of Things Journal, 2022. [3] C. Kolias, G. Kambourakis, A. Stavrou, and J. Voas, "Ddos in the iot: Mirai and other botnets," Computer, vol. 50, no. 7, pp. 80–84, 2017. [4] O. A. Alzubi, J. A. Alzubi, A. Al-Zoubi, M. A. Hassonah, and U. Kose, "An efficient malware detection approach with feature weighting based on harris hawks optimization," Cluster Computing, vol. 25, no. 4, pp. 2369–2387, 2022. [5] H. Faris, A.-Z. Ala'M, A. A. Heidari, I. Aljarah, M. Mafarja, M. A. Hassonah, and H. Fujita, "An intelligent system for spam detection and identification of the most relevant features based on evolutionary random weight networks," Information Fusion, vol. 48, pp. 67–83, 2019. [6] Z. Chkirbene, A. Erbad, R. Hamila, A. Mohamed, M. Guizani, and M. Hamdi, "Tidcs: A dynamic intrusion detection and classification system based feature selection," IEEE Access, vol. 8, pp. 95 864–95 877, 2020. [7] N. M. Hijazi, H. Faris, and I. Aljarah, "A parallel metaheuristic approach for ensemble feature selection based on multi-core architectures," Expert Systems with Applications, vol. 182, p. 115290, 2021. [8] Y. Jiang, K. Zhang, Y. Qian, and L. Zhou, "Anonymous and efficient authentication scheme for privacy-preserving distributed learning," IEEE Transactions on Information Forensics and Security, 2022. [9] F. Zerka, V. Urovi, F. Bottari, R. T. Leijenaar, S. Walsh, H. Gabrani- Juma, M. Gueuning, A. Vaidyanathan, W. Vos, M. Occhipinti et al., "Privacy preserving distributed learning classifiers–sequential learning with small sets of data," Computers in Biology and Medicine, vol. 136, p. 104716, 2021. [10] M. Habib, I. Aljarah, and H. Faris, "A modified multi-objective particle swarm optimizer-based l ́evy flight: An approach toward intrusion detec- tion in internet of things," ARABIAN JOURNAL FOR SCIENCE AND ENGINEERING, 2020. [11] A. A. Heidari, S. Mirjalili, H. Faris, I. Aljarah, M. Mafarja, and H. Chen, "Harris hawks optimization: Algorithm and applications," Future generation computer systems, vol. 97, pp. 849–872, 2019. [12] S. Sokkalingam and R. Ramakrishnan, "An intelligent intrusion detection system for distributed denial of service attacks: A support vector ma- chine with hybrid optimization algorithm based approach," Concurrency and Computation: Practice and Experience, vol. 34, no. 27, p. e7334, 2022. [13] W. F. Schmidt, M. A. Kraaijveld, R. P. Duin et al., "Feed forward neural networks with random weights," in International conference on pattern recognition. IEEE Computer Society Press, 1992, pp. 1–1. [14] E. F. Rawashdeh, I. Aljarah, and H. Faris, "A cooperative coevolutionary method for optimizing random weight networks and its application for medical classification problems," Journal of Ambient Intelligence and Humanized Computing, vol. 12, no. 1, pp. 321–342, 2021. [15] A. Tuladhar, S. Gill, Z. Ismail, N. D. Forkert, A. D. N. Initiative et al., "Building machine learning models without sharing patient data: A simulation-based analysis of distributed learning by ensembling," Journal of biomedical informatics, vol. 106, p. 103424, 2020. [16] D. H. Wolpert and W. G. Macready, "No free lunch theorems for optimization," IEEE transactions on evolutionary computation, vol. 1, no. 1, pp. 67–82, 1997. [17] Y. Meidan, M. Bohadana, Y. Mathov, Y. Mirsky, A. Shabtai, D. Breiten- bacher, and Y. Elovici, "N-baiot-network-based detection of iot botnet attacks using deep autoencoders," IEEE Pervasive Computing, vol. 17, no. 3, pp. 12–22, 2018. [18] C. L. Tan, "Phishing dataset for machine learning: Feature evaluation," Mendeley Data, vol. 1, 2018. [19] N. Hijazi, M. Aloqaily, B. Ouni, F. Karray, and M. Debbah, "Harris hawks feature selection in distributed machine learning for secure iot environments." [Online]. Available: https://github.com/Artifitialleap- MBZUAI/Harris-Hawks-Feature-Selection-in-Distributed-Machine-L earning-for-Secure-IoT-Environments [20] H. Fukumoto and A. Oyama, "Study on improving efficiency of multi- objective evolutionary algorithm with large population by m2m decom- position and elitist mate selection scheme," in 2018 IEEE Symposium Series on Computational Intelligence (SSCI). IEEE, 2018, pp. 1180– 1187.
http://arxiv.org/abs/2302.09854v1
2023-02-20T09:35:13
2023-02-20T09:35:13
Faster Region-Based CNN Spectrum Sensing and Signal Identification in Cluttered RF Environments
In this paper, we optimize a faster region-based convolutional neural network (FRCNN) for 1-dimensional (1D) signal processing and electromagnetic spectrum sensing. We target a cluttered radio frequency (RF) environment, where multiple RF transmission can be present at various frequencies with different bandwidths. The challenge is to accurately and quickly detect and localize each signal with minimal prior information of the signal within a band of interest. As the number of wireless devices grow, and devices become more complex from advances such as software defined radio (SDR), this task becomes increasingly difficult. It is important for sensing devices to keep up with this change, to ensure optimal spectrum usage, to monitor traffic over-the-air for security concerns, and for identifying devices in electronic warfare. Machine learning object detection has shown to be effective for spectrum sensing, however current techniques can be slow and use excessive resources. FRCNN has been applied to perform spectrum sensing using 2D spectrograms, however is unable to be applied directly to 1D signals. We optimize FRCNN to handle 1D signals, including fast Fourier transform (FFT) for spectrum sensing. Our results show that our method has better localization performance, and is faster than the 2D equivalent. Additionally, we show a use case where the modulation type of multiple uncooperative transmissions is identified. Finally, we prove our method generalizes to real world scenarios, by testing it over-the-air using SDR.
[ "Todd Morehouse", "Charles Montes", "Ruolin Zhou" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09854v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09854v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.SP", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.SP", "cs.LG" ]
Faster Region-Based CNN Spectrum Sensing and Signal Identification in Cluttered RF Environments Todd Morehouse, Charles Montes, and Ruolin Zhou Department of Electrical and Computer Engineering University of Massachusetts, Dartmouth, MA 1 3 2 0 2 b e F 0 2 ] P S . s s e e [ 1 v 4 5 8 9 0 . 2 0 3 2 : v i X r a Abstract-In this paper, we optimize a faster region-based convolutional neural network (FRCNN) for 1-dimensional (1D) signal processing and electromagnetic spectrum sensing. We target a cluttered radio frequency (RF) environment, where multiple RF transmission can be present at various frequencies with different bandwidths. The challenge is to accurately and quickly detect and localize each signal with minimal prior information of the signal within a band of interest. As the number of wireless devices grow, and devices become more complex from advances such as software defined radio (SDR), this task becomes increasingly difficult. It is important for sensing devices to keep up with this change, to ensure optimal spectrum usage, to monitor traffic over-the-air for security concerns, and for identifying devices in electronic warfare. Machine learning object detection has shown to be effective for spectrum sensing, however current techniques can be slow and use excessive resources. FRCNN has been applied to perform spectrum sensing using 2D spectrograms, however is unable to be applied directly to 1D signals. We optimize FRCNN to handle 1D signals, including fast Fourier transform (FFT) for spectrum sensing. Our results show that our method has better localization performance, and is faster than the 2D equivalent. Additionally, we show a use case where the modulation type of multiple uncooperative transmissions is identified. Finally, we prove our method generalizes to real world scenarios, by testing it over-the-air using SDR. I. INTRODUCTION Wireless communications continue to become more prolific and more complex due to cheapening hardware and advances in fields like machine learning (ML) and software defined radio (SDR). Sensing becomes an increasingly difficult task as frequency congestion increases and device use increasingly complex patterns. Machine learning has improved a device's ability to adapt, with technologies such as online learning allowing new patterns, behaviors, and capabilities, to be real- ized in the field. Additionally, wireless devices continue to be deployed in increasingly diverse environments, including very urban and very remote areas. These devices experience very diverse wireless channels in congestion levels, noise levels, and multipath effects. These changes and effects all impact spectrum sensing, the process of identifying signals within a wide spectrum band. Spectrum sensing is vital for allocating spectrum resources for communications, and for organizations to monitor activities. Adaptive radios must ensure to use an available portion of the spectrum, and do not interfere with devices that have higher priority. To achieve this, devices must accurately locate any other transmissions in a band. Government, military, and commercial sectors may wish to monitor communications for security threats over RF, or improper use of spectrum. Electronic warfare may wish to identify adversary communications or interference. The ability to accurately locate each transmission present is paramount for each of these tasks. Popular traditional spectrum sensing techniques include energy-based and eigenvalue-based detection methods, such as MED, and AGM, which require prior knowledge of noise power [1]. Newer eigenvalue-based methods have addressed the drawbacks, but are still inflexible in domains with dynamic users [1], [2]. Deep learning methods often employ techniques, such as convolutional neural networks (CNNs), that do not require prior knowledge of the signal-to-noise ratio (SNR) conditions [3]. APASS, implemented by Xie et al [4] is a CNN method to identify if a primary user is active on a channel, and outperforms traditional detectors. More recently, object detection and segmentation methods have been used to localize signals in multi-user environment. In O'Shea et al [5], the authors showed that you-only-look-once (YOLO) can be used to find signals present in a spectrogram. In Prasad et al [6], [7] the authors used faster region-based CNN (FRCNN) to jointly detect signals within the spectrogram image, and classify detections as Bluetooth, WiFi, or microwave oven interference. They were able to achieve a mean average precision (mAP) of 0.713 under the SNR interval between 15dB and 50dB. They tested their system over-the-air (OTA), but were only able to achieve a mAP of 0.125. In Vagollari et al [8], the authors used YOLO and FRCNN to localize signals within a spectrogram, and classify them by their modulation type. They were able to achieve an mAP of 87% and a generalized intersection over union (gIoU) of 90%. They found that FRCNN outperforms YOLO for spectrum sensing. Other authors investigated object detection on frequency contents only. In Ghanney and Ajib [9], the authors locate RF interference within a FFT generated plot. In order to process the plot with YOLO, they save images of the plots. Their results achieve an mAP of 0.81 at an IoU of 0.5. In Kayraklik et al [10], the authors generate power spectral density (PSD) plots from baseband signals collected OTA. They save their PSD plots as images so that they can be processed by You Only Learn One Representation (YOLOR) and Detectron2. A. Challenges in Current Research Our literature review shows that current implementations are limited to images by their object detection baselines. In this paper, we show that by optimizing FRCNN to process 1D FFTs directly, we can significantly reduce computational cost. In signal processing, especially wireless signals, data is often one dimensional. In the spectrum sensing case, if time information is not required, then the process can be performed with only a single dimension. In order to create images, additional information needs to be added or extracted. Using spectrograms can organize time information as well as spectral information, however, this requires significantly more collected data, and the additional data requires more computation to perform detection. In one paper, the authors to generate an image [9], but render an FFT as a plot this introduces more data without new information. These approaches introduce two major issues: an introduction of a second dimension increases search space and computational complexity, and in the FFT plot case, adding sources of error due to the limitations of rendering an image. Object detection in a 2D case requires exponentially higher computation than for a 1D case. We show a cost comparison between the two techniques in Sec. I-B. Plotting an FFT to generate an image is an effective way to utilize standard FRCNN to perform 1D spectrum sensing, however it is costly in both computation and performance. The increased dimension will increase data size, without adding any additional information. Furthermore, when the plot is rendered, points and lines that are close together overlap, blurring them together. This can be seen in Fig. 10, where we plot an FFT. The resolution in parts with high variance is lost, resulting in a solid shape. B. Cost of 2D and 1D Spectrum Sensing In this example, we show the difference in data size and acquisition time between a 2D and 1D spectrum sensing scenario. First, consider a receiver operating at a 200kHz baseband sample rate, and using an FFT size of 1024. Thus, in order to create one vector of size 1024 for spectrum sensing, we must receive samples for t = 1024/200000 = 5.12ms. If we wish to generate a square spectrogram with the same FFT size, then we must collect 10242 samples, or approximately 1.05 MS. Thus, we would need to record for 5.24s. Thus, to achieve the same frequency sensing resolution, we would need to record 1024x longer, and 1024x more data. We can reduce this cost by reducing the FFT size to something smaller, like 128. This still results in recording for 128x longer and 128x more data, while having a lower frequency resolution. Thus, we can see that a 1D scenario can be significantly more favorable for performing spectrum sensing. C. Our Approach We identify and localize RF signals in frequency domain using 1D FRCNN. Additionally, we consider a dynamic en- vironment, where no centralized channel allocation is present. This allows wireless devices to transmit at any frequency and bandwidth, requiring a more sophisticated detection. The FRCNN algorithm is a modification to CNNs, allowing object detection and segmentation. It is applied in this project to de- tect and isolate received signals. The standard implementations of FRCNN are intended for processing images, and are not fit for processing received baseband samples directly. Therefor, 2 we optimized FRCNN for the 1D signal case by modifying the ML architecture and optimizing anchor box proposals. In a use case, we show how each detected signal can be separated, and classified by its modulation type. This can be extended to further applications in classification or signal processing, such as performing security related checks, or locating a radio to communicate with. We test our system over-the-air (OTA), using two USRP N2901 software defined radios (SDRs). These devices allow controlling the physical layer of wireless communications using high level software, and provide an easy platform to integrate machine learning with communications. We used these radios to broadcast test signals, which were received on a separate radio, and processed with our spectrum sensing algorithm. D. Novelty and Contribution of our Research Our work optimizes FRCNN for 1D signals, greatly reduc- ing the computational complexity, and improving the perfor- mance in spectrum sensing for detecting and locating signals. The contributions of our research are as follows 1) Redesigning the ML architecture of FRCNN for 1D signals 2) Optimization of the feature extraction layers for spec- trum sensing 3) Application of 1D FRCNN for spectrum sensing in cluttered and unknown RF environments The ML architecture of FRCNN consists of operations de- signed for working with 2D features from images. These operations had to be redesigned to process 1D signals. Ad- ditionally, several stages of FRCNN involve preprocessing the data, including generating a dataset to train the region proposal network, pooling features for the classifier, and selecting detections after classification. These stages need to handle 1D inputs and features. The feature extraction layers of FRCNN are typically designed to extract relevant image features, thus, state-of-the-art networks such as RESNET should be ideal. However, signal features are not the same, and may not be analogous to image features. We first evaluate different feature extractors for the spectrum sensing application, then optimize the best extractor for performance and inference time. Finally, we show that our optimizations provide superior performance over 2D FRCNN with spectrograms as well as over a baseline energy-based detection method. Additionally, we show that our optimizations are significantly faster than 2D FRCNN. We measured the mAP, mIoU, probability of detection (Pd), and probability of false alarm (Pfa) over the SNR range of -5dB to +20dB. The mAP was measured to be 0.716, mIoU as 0.586, Pd as 0.823, and Pfa as 0.166. Directly comparing metrics to other papers is difficult, due to differences in simulated channel conditions and metric measurement methods. In Vagollari et al [8] the authors use the generalized IoU, while we use the simple IoU, and they do not provide an SNR for the measured gIoU. In Prasad et al [7], the authors calculate the interpolated mAP, but do not give a probability threshold, which is typical for this method, and in Ghanney and Ajib [9], the mAP is not well defined. Therefor, we implement a 2D spectrogram spectrum sensing method using FRCNN, using techniques from these papers, to give an accurate comparison of our results. However, if we give a direct comparison between mAP, ours is comparible with Prasad et al [7], while being lower than Ghanney and Ajib [9]. Our OTA mAP significantly outperforms Prasad et al [7], where ours measured 0.826 compared to their 0.125. When comparing with our implementation of 2D FRCNN, we show significant improvement mIoU by 91%, our primary metric, with slightly improved mAP by 4%. E. Paper Organization This paper is organized into the following sections: First we describe our optimized FRCNN model in Sec. II. In Sec. III, we describe the RF environment that we apply our work to. In Sec. IV we describe each spectrum sensing methodology we test in this paper, including our approach. In Sec. V we discuss how we measure performance. In Sec. VI we analyze different FRCNN parameters and their effect on performance, and in Sec. V we go into detail on how we test each methodology. In Sec. VII, we show a use-case of our 1D FRCNN with Automatic Modulation Classification, and we show our test results for simulation and over-the-air in Sec. VIII. Finally we conclude on the research in Sec. IX. II. OPTIMIZING FRCNN In this section, we introduce our optimized FRCNN, design decisions that we made, and how we constructed the network. Faster region-Based CNN [11] is an object detection ML model that makes heavy uses of CNNs in each stage. For spectrum sensing this allows detection of transmitters within a received signal. However, the architecture is designed for image processing. We optimize the three major components of FRCNN for 1D signal processing, including the convolu- tional feature extractor, region proposal network (RPN), and classifier stage, shown in order in Fig. 1. A. Feature Extraction Base Layers The first part of FRCNN is feature extraction, achieved using a fully convolutional network. The goal is to have each feature map to a region in the input. For an image, this region would be a windowed subsection condensed into a single feature. Condensing intervals reduces the search space, since only the feature matrix needs to be analyzed to propose and find features. However, higher levels of feature extraction reduce the granularity, since larger sections of the input are being condensed into a single feature. Thus, a trade- off needs to be balanced between greater data reduction, feature complexity, inference time, and accuracy. Additionally, wireless signals have unique features that should be focused on. Thus, a different approach should be taken over image processing techniques. We analyzed different architectures for their feature extraction performance, as well as different levels of feature extraction. This is detailed in Sec. VI. To ensure that the feature matrix maps directly to the input, the downscaling factor must be an integer divisor of the input size, to avoid truncation. Otherwise, this truncation would result in innaccurate mapping of features to locations in the signal space. 3 Fig. 1: FRCNN Flowchart B. Anchor Intervals and Region Proposals Anchor intervals are an efficient way to search for objects within a dataspace, by using predefined locations and aspect ratios called anchors. The goal of the region proposal network is to identify which anchors overlap a ground truth, given an input. To achieve this, the feature matrix, which is proportional to the input size, is used. Each element of the feature matrix maps to an anchor box in the input data. The region proposal network consists of a three layer convolutional network, shown in Fig. 2. First, a 3x1 convolutional layer serves as an interme- diate layer, performing further feature extraction and setting the feature depth. The output of this is broken into two separate 1x1 convolutions, for classification and regression separately. For the classifier convolution, the number of features is set to the number of anchor boxes. The regression layer predicts intervals, therefore number of filters is twice the number of anchor boxes, allowing it to predict two points for each anchor box. The outputs are a n x k classification matrix matrix, and an n x 2k regression matrix, where n represents the feature matrix size, and k represents the number of anchors. This gives a probability and interval for each anchor box on each feature region. C. Region Pooling and Classification The region pooling and classification fine tune proposed regions from the RPN. Since the number of proposed re- gions will always be the same, many will be duplicates or background detections. Thus, the classifier stage must process each proposed region to evaluate if an object actually exists, Feature MatrixFeature ExtractionProposed RegionsRegion ProposalNetworkWindowed FeaturesROI PoolingClassifierFFT InputIntervalsProbabilities 4 Fig. 3: Deep learning layers of the classifier and ROI pooling "background", and a regression is given as the anchor box that it overlaps. IOU(A,B) = |A ∩ B| |A ∪ B| (1) L = − 1 N N (cid:88) i i log (pi) + (1 − p∗ p∗ i ) log (1 − pi) (2) L = − 1 N N (cid:88) i p∗ i log pi L = (cid:26) 1 2 (ti − t∗ |ti − t∗ i )2 i | − 1 2 if|ti − t∗ i | < 1.0 otherwise (cid:27) (3) (4) We use separate loss functions for the RPN classification and regression outputs. The classifier uses binary crossentropy loss, shown in Eq. 2. The loss is calculated between the predicted probability for each proposal, pi, and an indicator if the proposal overlaps a ground truth, p∗ i . The indicator is 1 for a positive overlap, and 0 for a negative overlap. The RPN regression uses smooth L1 loss, shown in Eq. 4, where ti represents the predicted regression target, and t∗ i represents the ground truth overlap. The final classifier stage consists of separate classification and regression outputs. The regression output is trained with the same smooth L1 loss used for the RPN, shown in Eq. 4. The classifier uses categorical crossentropy, shown in Eq. 3. The predicted probabilities are represented by pi, while the true probabilities are represented by p∗ i . This is used since the FRCNN final classifier can have multiple classes, instead of simply "background" and "foreground". Fig. 2: Convolutional layers of the RPN and best fit a bounding interval to the object. The classifier uses regression and the feature matrix to best fit an interval to the object. The architecture for this could be seen in Fig. 3. First, the features around each proposed region of interest are windowed, then resized to a 1x7 vector. This standard size allows it to be processed by the next step, a fully connected layer. First, the features are flattened, then processed by two fully connected layers. Finally, the result is passed to two different fully connected layers for classification and regression. The classification is either "foreground" or "background", or alternatively, a set of custom classes. The regression output is two points for each proposal and class. The output of the classifier is a fixed number of predictions each time, however the number of objects present is not fixed. In order to output only detected objects, thresholding is applied for each output probabilities. We chose a probability threshold of 0.70. That is, any detection with a probability less than 0.70, was considered background and discarded. This allows only very confident predictions to be output. D. Training the Model We train the network using a two-step training process, where we alternate between training the RPN and the classifier. First, the RPN is trained on an input signal to produce propos- als. Then, the RPN proposals, and the feature matrix, are used to train the classifier. These two steps are alternated until the entire model is fully trained. To achieve this, an intermediate dataset is needed to train the RPN, consisting of classification and regression targets for anchors. The downscaling factor between the input signal and feature matrix is determined by the feature extraction layers. Thus, the dimension of the feature matrix is known, and the anchor locations can be found from this. For each feature, the anchor locations are screened for overlaps with ground truths by their IOU, calculated using Eq. 1. If the IoU with any ground truth is found to be greater than 0.7, then it is considered a positive overlap. Likewise, an IoU less than 0.3 is considered a negative overlap. If the IoU is between 0.3 and 0.7, then the overlap is considered ambiguous, and not used for training. This ambiguous classification helps the RPN is learning on confident samples. to ensure that For each feature, a classification is given as "foreground" or Conv 3x1Conv 1x1 Conv 1x1 Anchor RegressionAnchor ProposalsFeature MatrixFeatureWindowingResizeInterval RegressionInterval ProbabilitiesFeature MatrixFully ConnectedLayerFully ConnectedLayerFully ConnectedLayerFully ConnectedLayer III. RF TESTBED B. Synthesized Testbed 5 In this research, we focus on determining the frequency location of each transmission, from the perspective of a receiver. This is illustrated in Fig. 4, where a single receiver observes multiple transmitters. The goal of the optimized FRCNN sensing algorithm is to locate all signals present in frequency domain. In this section, we discuss the wireless environment that we design the model around, how we syn- thesize the environment to train and test the network, and how we construct an OTA test to evaluate the model. Fig. 4: Illustration of a wideband receiver A. Wireless Environment First, we define the wireless environment that we are oper- ating in. We consider a spectrum of arbitrary size, where mul- tiple transmitters are present. We observe the entire spectrum from a single receiver. Each transmission may occur at any center frequency within the band, and occupy any bandwidth. An example from a receiver's perspective is shown in Fig. 5, where five transmissions are present, relative to the center frequency of the receiver. This scenario represents a decentral- ized and independent sensor, where channel allocations may be unknown or nonexistent. A simple spectrum sensing method of identifying if a channel is occupied would lose most of the information present. For many applications, this approach will not meet requirements. Instead, a better approach is to use object detection, to detect and localize each transmission present. Fig. 5: Receiver's Perspective of the Wireless Environment Machine learning models require large amounts of diverse data for training, otherwise overfitting will occur and the model will not generalize. We elected to synthesize our training data, allowing us to generate as many samples as needed, and to generate diverse scenarios through simulated channel impairments. Diverse channel impairments allows our model to be deployed in different scenarios, without requiring retraining. Collecting data OTA is possible, but significantly more challenging, since channel effects are difficult to control and data can be difficult to label. In previous research, we synthesized our training and test data, and showed that our approach generalizes well to OTA tests [12]–[14]. The dataset generated must satisfy the input and output of the model shown in Fig. 1. To generate the input, each transmitted signal is generated independently. The process for synthesizing samples could be seen in Fig. 6. For each signal, random binary data is generated, then modulated. The modulation type is chosen at random. Each signal is then pulse shaped using a raised cosine filter, and resampled to achieve a desired bandwidth. The signal is finally shifted by its center frequency offset in frequency domain. This process is repeated a total of five times, where each center frequency and bandwidth is chosen at random. Then, if any signals are overlapping in frequency domain, one of the signals is removed at random. This selection process results in a random number of transmitters. Finally, all of the signals are mixed together, by summing them in time domain. This process generates random environments, where the number of transmissions are random, as well as their corresponding center frequencies and bandwidths. y = x (cid:80) |x2| (cid:113) 1 N (5) Channel effects were applied to each mixed signal, as shown in Fig. 7. Before AWGN could be applied, the signal's power was normalized to 1, using Eq. 5. We considered an indoor system, where a direct line of sight was present between all transmitters and the receiver. Thus, a Rician multipath process was used. Finally, the FFT of the signal was taken, to be used for training FRCNN, along with the frequency location of each signal present, as shown in Fig. 6. This process was repeated to generate a total of 3,000 training samples. C. OTA Testbed An OTA testbed was designed to model Fig. 4. To create this, we used SDR, allowing us to control the transmitted waveforms, as well as to process the received waveform using machine learning. We used 2x USRP N2901, which are capable of 2x2 MIMO each. The SDRs were configured as three transmitters, and one receiver. They were placed in an indoor environment, where each transmitter had a direct line of sight path to the receiver. The radios were configured to operate at a center frequency of 5 GHz, with a sample rate of 200kHz for each channel. Each radio was calibrated to the Transmitter 1Transmitter 2Transmitter 3ReceiverWidebandReceived SignalAWGN Multipath Fading Timing Offsets Frequency Offsets AttenuationChannel-2-1.5-1-0.500.511.52Carrier Offset Frequency, fc + f (Hz)105-70-60-50-40-30-20-100AmplitudeSpectrum from Receiver's Perspective 6 Fig. 6: Process for synthesizing signals in MATLAB Fig. 7: Channel Impairment Process for Synthesized Signals same center frequency, to remove any center frequency offset from hardware, and thus collect more accurate metrics. To control each transmission's center frequency and bandwidth, offsets and pulse shaping were applied to the baseband signals before transmitting, following the same process for synthesiz- ing signals. A random bitstream was generated, modulated, and pulse shaped, then resampled to a desired bandwidth. Finally, a center frequency offset was applied, and the signal was transmitted. An example from the receiver's perspective could be seen in Fig. 5. Controlling the center frequency in baseband allowed easier collection of metrics for OTA tests, since the frequency location of each signal was known by software. IV. SPECTRUM SENSING METHODOLOGIES A. Energy-based Spectrum Sensing To compare our results to popular energy-based spectrum sensing, we implement a base-line solution. This approach identifies when a transmitter is present when the signal energy exceeds a threshold. Multiple transmitters can be identified and localized using changepoint detection, which finds the points that exceed an energy threshold. In doing this, individual signals can be located. First, the FFT of a received signal is taken, so that its frequency contents can be observed. Next, the FFT output is scanned from left to right, looking for parts where the energy exceeds the noise floor. The intervals between these detections are considered a transmission, and the detections themselves are the frequency bounds. The noise floor must first be estimated, and a threshold determined from this. A simple estimate is to use bot the mean and standard deviation of a received signal frame, and to sum them together as γ. The equation for finding the noise floor threshold, γ, is shown in Eq. 6, where μ is the mean of the FFT frame, si is the ith sample of the frame, and N is the length of the frame. For frames with a signal present, this will be slightly higher than the noise. For frames with no signal present, this will be the peaks of the noise. An example of this energy-based detection on an FFT frame could be seen in Fig. 8. γ = μ + (cid:115) (cid:80)N (si − μ)2 N (6) Fig. 8: Example detection using energy-based spectrum sens- ing. B. Spectrogram Spectrum Sensing using FRCNN The standard implementation of FRCNN can process 2D inputs, and therefor cannot be used to perform spectrum sensing on an FFT directly. To work around this, other authors have used the STFT to generate spectrograms, such as in Prasad et al [6], [7]. To compare our results with this approach, we implement 2D FRCNN spectrum sensing algorithm based on their approach. Since spectrograms are created by taking the FFT of many signals over time, they require significantly more data to create than if a single FFT was used. In order to produce a square image, the number of frames must be the FFT bin size. It is typical to use a smaller FFT size to reduce total data size, which comes at a tradeoff of reduced frequency resolution. We reduced the FFT size for spectrograms to 128, requiring 16,384 samples per spectrogram, compared to 1024 samples per frame for energy-based and 1D FRCNN spectrum sensing. Spectrograms incorporate time-frequency information into the same image. Therefor, an advantage of spectrograms is that the bounding boxes represent detections in both domains, unlike the energy-based and 1D FRCNN, which only detect frequency information. An example of using FRCNN on spectrograms could be seen in Fig. 9. C. Spectrum Sensing using Optimized 1D FRCNN In our optimized 1D FRCNN, we process FFT signals directly, bypassing the need to generate large spectrograms. The FFT is performed on a received baseband mixed-signal, is eas- and converted to decibels, which is a form that ier to distinguish signals from noise. This resultant signal contains the same frequency information as a spectrogram equivalent, but consists of significantly less data compared to spectrograms. The resultant output from our optimized 1D FRCNN are bounding intervals, representing a single detected Modulate & Pulse ShapeApplyFrequencyOffsetsMix SignalsGenerate DataMixed SignalApply TimeOffsetsRemoveOverlappingSignalsAWGN Rician Fading AttenuationImpaired SignalGenerated SignalChannel20015010050050100150200Frequency (kHz)706050403020100Amplitude (dB)ThresholdEnergy-Based Detection 7 we define these metrics, and how we measure them. These measurements may be different than other approaches, since we are comparing traditional energy-based methods to object detection methods. We consider the mIoU as our primary performance metric, as we are optimizing for the ability to localize all signals present, while minimizing false positive detections. However, other metrics give different insights to our model, that might be more relevant to other applications. A. Average Precision Object detection and data retrieval tasks often use the average precision (AP) or mean average precision (mAP) as performance measurements. The precision of a detector is the ability to make correct predictions, and recall is the ability to find all objects. Precision does not include missed objects, while recall does not include false predictions. To measure them, we first categorize predictions. Ground truths are objects that exist within an input. For example, the cars that exist within an image. Detections are the output object location and classifications of the detector. A true positive (TP) is when the detection overlaps a ground truth, where a false positive (FP) is a detection that overlaps no ground truth. A false negative (FN) is when there is no detection for a ground truth. True negatives (TN) are if there is no detection and no ground truth, and are not evaluated. We can count the number of TPs, FPs, and FNs by running the detector on a test dataset, and find the precision and recall by Eq. 7 and Eq. 8. We can construct a precision-recall (PR) curve by measuring the precision and recall for each input image or signal. Finally, we can find the AP by taking the area under the PR curve. Precision = TP TP + FP Recall = TP TP + FN (7) (8) To determine if a detection is true or false, we use the IoU, which measures the overlap between two objects, shown in Eq. 1. For 2D detection, these are typically bounding box detections, while for our 1D architecture, these are intervals. Typically, a detection is considered positive if the IoU with any ground truth is greater than 0.5, and negative if it is less than or equal to 0.5. Detectors will give a probability for each detection. For FRCNN, the probability corresponds to a class. At minimum, there are two classes, foreground representing an object, and background representing no detection, however detectors can be configured to have more. We threshold the probability to de- termine if a detection is positive or negative. If the probability is above a threshold, the detection is considered positive. This can improve performance by removing poor samples. Since the probability threshold changes which detections are positive or negative, it also changes the precision and recall, and thus the AP. The mAP can measure a detector's performance across different thresholds, by finding the AP for each threshold, and averaging them together. A common method of finding the AP is through interpo- lation. This method can be superior to the standard way of Fig. 9: Example detection using spectrograms and 2D FRCNN. transmission, as well as the confidence in each prediction. These predictions are then thresholded by their confidence, such that only highly confident samples are considered positive detections. All other samples are discarded. An example of using 1D FRCNN on an FFT frame could be seen in Fig. 10. Fig. 10: Example detection using FFTs and 1D FRCNN. V. MEASURING PERFORMANCE To measure performance, we use four metrics: The mean average precision (mAP), the mean intersection over union (mIoU), the probability of detection (Pd), and the probability of false alarm (Pfa). In object detection, the mAP is one of the most common metrics [6]–[9], [11], [15]–[20]. However, in spectrum sensing, the Pd and Pfa are the most common metrics for spectrum sensing [1]–[4]. The mAP and mIoU are typical measurements for object detectors, while Pd and Pfa are typical metrics for spectrum sensing. In this section, 01020304050607080Time (ms)1007550250255075100Frequency (kHz)2D FRCNN Spectrogram Detection1000007500050000250000250005000075000100000Frequency Offset (Relative to Fc), fo (Hz)706050403020100Amplitude, (dB)Spectrum Sensing Results finding AP, since recall values may not be evenly distributed between [0,1], and may be concentrated around a single point. First, we sort each detection by its probability in descending order. Then, each prediction is determined to be a truth if its IoU with any ground truth is greater than 0.5, and false otherwise. The total number of false negatives are counted from this. Then, the precision and recall is calculated for each sample, with the number of true positives and false positives accumulating. Some recalls may have multiple precision val- ues. For these, the maximum precision is used. Finally, the PR curve is divided into even spaced points, typically eleven. The precision at each point is averaged together to find the AP. B. Mean Intersection over Union In order to address some of the shortcomings from AP, we introduce the mean intersection over union (mIoU). The average precision tends to over estimate the ability of the detector in cases where the number of false positives are high, but false negatives are low. This is due to having mostly high recall, while precision can be very low. This is exacerbated by the common practice of assuming the PR curve starts at a precision of 1, and ends at a recall of 0, as well as in interpolated AP, where we take the maximum precision for each recall level. Additionally, the AP makes binary predictions of overlaps. If the IoU is greater than a threshold, then it is considered overlapping a ground truth. Therefor, the AP may overestimate how well the detector localizes objects. Finding the mean of IoUs can address both of these concerns. For spectrum sensing, many applications require accurate localization of transmissions in frequency domain. When sharing spectrum, inaccurate localization can result in poor spectrum usage, or interference between trans- mitters. Other sensing tasks may require learning information about a transmitter from its spectral patterns, or separating transmissions. To find the mIoU, we first loop through every input signal and corresponding detection. For each detection, we calculate the IoU with all ground truths. If the IoU is greater than 0.5, it is considered overlapping, and the IoU is recorded. If the IoU is less than 0.5, or if it is a duplicate detection, the IoU is recorded as zero. Additionally, for any ground truths that had no detections overlapping, a value of zero is recorded for the IoU. For the multiclass case, misclassifications are considered a false positive, thus even if the IoU of a detection with a ground truth is high, it will still be considered zero if it is misclassified. Finally, the mean of all recorded IoUs is taken as the mIoU. An mIoU of zero is a detector that is unable to locate any objects, while an mIoU of one is a detector that locates all objects perfectly. There are some shortcomings to the way we define and mea- sure the mIoU. Both duplicate detections, and false positive detections over noise, are weighted equally. While these can both be viewed as negative, in some applications, duplicate detections may not be an issue. Additionally, detections that are close to overlapping, but do not have an IoU greater than 0.5, will be factored into the metric as an IoU of 0.0, which may underestimate the ability of the detector. An alternative 8 to using the mIoU could be to find the AP over a range of IoU thresholds from 0.5 to just under 1.0, then averaging all APs together as the mAP. This would allow the mAP to incorporate the detector's ability to localize objects, but would not address the first issue, when false negatives are low and false positives are high. In this research, we focus on the mIoU as our primary metric, as it is the most fitting for spectrum sensing using object detection. C. Probability of Detection The probability of detection is defined as the probability that a signal is detected, Pd = P (T > γ|H1), where γ is an amplitude threshold and H1 is the event that a signal exists. This is a common metric in spectrum sensing to measure a system's ability to find all signals present. In traditional spectrum sensing, this is the probability that the signal amplitude exceeds a threshold, given a transmitter is present. In the object detection case, this is better defined as the probability that a prediction overlaps a ground truth. To adapt this to the object detection case, we use the true positive rate (TPR), which is defined by Eq. 9. Since FRCNN outputs bounding box predictions, they must first be sorted by true/false and positive/negative samples. To do this, we apply IoU and probability thresholding. Additionally, in the multiclass case, a misclassification will not be considered a detection. To keep results consistent, all models, including the energy-based spectrum sensing method, will evaluate their probability of detection with the TPR. TPR = TP TP + FN (9) D. Probability of False Alarm The probability of false alarm is another common spectrum sensing metric, which is defined as the probability that a signal will be detected, when none exists, Pf a = P (T > γ|H0), where γ is a threshold, and H0 is the event that no signal exists. In the object detection case, this is better defined as the probability that a detection does not overlap a ground truth. In other words, a false alarm is a detection over noise, or where the overlap with a signal is below a threshold. In the multiclass case, a misclassification will still be considered a false alarm. The false discovery rate (FDR) can be defined as the ratio of false positives to number of detections, shown in Eq. 10. To keep results consistent, all models, including the energy- based spectrum sensing method, will evaluate their probability of false alarm with the FDR. FDR = nfa ndet (10) E. Inference Time Machine learning algorithms often take longer to process data than their signal processing counter parts. Downscaling FRCNN to process 1D signals reduces the amount of data that needs to be processed, and thus should decrease processing takes to run the time. For ML/DL networks, is called the inference time. In the FRCNN case, model the time it this is the time it takes to to find all signals present in an input, without including preprocessing times. To compare the different techniques, the average inference time is measured between energy-based, 1D FRCNN, and 2D FRCNN. For the FRCNN cases, this is the time between inputting an FFT or spectrogram into the network, and collecting each output detection, including postprocessing such as NMS. For energy- based, this is the time it takes to estimate an energy threshold, search the FFT, and organize all detections. The inference times are heavily dependent on hardware, and thus the absolute time measured may not be the most useful metric, thus when reporting inference time, we normalize the time relative to the baseline energy-based method. VI. ANALYSIS OF FRCNN PARAMETERS The base of the network plays an important role in extract- ing features for the RPN and classifier. It directly controls key parameters such as resolution, inference time, memory usage, and complexity. Since the number of anchor boxes is directly related to the feature matrix size, increasing the stride or feature reduction will reduce the resolution of the RPN layer, and make each anchor represent a larger area of the input. However, increased number of layers can increase complexity, and improve the features that are extracted. Additionally, other parameters such as the number of filters in each layer, or the general structure of feature extraction layers, can impact the performance of the network. In this section, we evaluate the difference in performance for different configurations of the feature extraction layer. Then we conclude on a configuration that best suits the application at hand. A. VGG net feature extraction with different levels of stride The baseline architecture used is VGG net. In the original FRCNN paper [11], the authors used VGG-16, pre-trained on ImageNet, as their feature extraction layers. Here, our baseline uses 19 layers instead of 16, achieving a stride of 16. An illustration of this architecture is shown in Fig. 11. Each block consists of three convolutions, with a filter size of 3x1. To ensure the dimension of the feature matrix is proportional to the input signal, each convolution pads the output. Then, the block ends with a 2x1 max pooling layer, with 2x1 stride, dividing the input dimension by 2. The final block does not have a pooling layer. The number of blocks can be changed to achieve higher or lower stride, complexity, and more refined features. A lower stride results in less downscaling of the input, and thus more features. Since each feature represents an anchor box, the granularity of anchor boxes can be increased. In turn, a higher stride results in more downscaling of the input, and thus less features. However, these features will be more refined, include more of the input image, and reduce inference time. A trade-off must be struck between increasing the granularity of features, the number of anchor boxes, and the complexity. As a baseline, we use this VGG net setup. We test it with strides of 2, 4, 8, 16, and 32. Each increase in stride is an increment on the previous layers. These are summarized in Table I, as well as the number of filters for the output convolution. 9 Fig. 11: Architecture of the VGG feature extraction network. Downscale Factor 2 4 8 16 32 Filter Count 64 128 256 512 512 TABLE I: VGG Network Parameters B. Resnet feature extraction We test an additional common image processing architecture called Resnet, of which the typical architecture could be seen in Fig. 12. The core of ResNet is the skip connection, which forwards parameters through the network. This allows some blocks to be skipped, if they do not contribute to the output. We compare the use of these skip layers, by applying them to the outlined VGG net. A skip layer is added in parallel with each block, where the features are concatenated together after the third convolution. Following this, batch normalization is added to improve training, and max pooling is performed to achieve data reduction. The resnet method was only tested for a stride of 16. C. Signal Processing Architecture In previous research, we used an architecture designed and tuned for signal processing [13], [14], illustrated in Fig. 13. The network consists of linear blocks of convolutional layers, ReLU activation, batch normalization, and max pooling. The filter size of the convolutional layer was designed around the samples per symbol of the waveform, which relates the bandwidth of the signal to the receiver's sample rate. We test this architecture as well, using a stride of 16. D. Filter Sizes In Prasad et al [7], the authors downscaled FRCNN for the spectrum sensing case. While they still used images, Convolution 3x1Convolution 3x1Convolution 3x1Max Pooling 2x1SignalInputFeatureMatrixBlockrepeated toachievestrideSingle Block 10 E. Comparison of Configurations To compare the architectures, each network was trained individually. Three datasets were generated, one for each train- ing, validation, and testing. The same three datasets were used for training and evaluating each network. Each configuration was trained for epochs, with 10,000 samples each epoch. The Adam optimizer, with an initial learning rate of 10−5 was used. While higher performance could be achieved with more training epochs, a majority of learning is achieved in the first 4 epochs. This was verified using the validation loss. Thus, 4 epochs was chosen to reduce total training time to evaluate each architecture. We measure the mean-IoU at SNR levels of -5, 5, and 20 dB using synthesized data. We choose the mean-IoU here as it measures the detector's ability to: detect all signals present, to not raise false alarms, and localize each signal. These results are shown in Fig. 14. Additionally, we measure the average inference time for each configuration. This is the time it takes to process a single frame of data. We normalize the inference time to the highest measured, since absolute times will depend on the specific hardware used for testing. The comparison between different architectures inference time could be seen in Fig. 15. When comparing each architecture, we find that VGG net achieves the highest mIoU, with comparable inference times to other networks. VGG16 achieves 58% higher mIoU than the second highest network, the signal network. Additionally, the inference time is approximately the same as Resnet, which are both the lowest, with 70% relative inference time. Therefor, we choose VGG- net as our feature extraction network. Next, we evaluate the downscaling factor for our feature extraction network. As the downscaling factor increases, the inference time trends down, with the exception of factor of 8 being slightly faster than a factor of 16, although both are comparable. The highest mIoU is for VGG8, at 20dB SNR, but only by 6% over a stride of VGG32. However, at lower SNR, VGG16 achieves 17% higher mIoU over VGG32. Therefor, we choose VGG with a downscaling factor of 16 as our feature extraction layers due to its highest average mIoU, with decent inference time. However, it should be noted, that if inference time is more important, VGG32 is 25% faster than VGG16, with comparable mIoU. VII. A USE CASE OF 1D FRCNN IN SIGNAL CLASSIFICATION We provide a use case of our optimized 1D FRCNN using AMC, which is the process of identifying the modulation type of a given signal. In previous research, we used CNNs to achieve this with raw baseband samples [12], [13]. In this use case, we show how this can be extended to the mixed signal case, to identify the modulation type of each transmitter present. The process is illustrated in Fig. 16. In this model, baseband samples from the receiver are supplied as the input. The model outputs the modulation type for every signal present. This process detects each transmitter in frequency domain, separates each transmission in time domain, then classifies the transmissions individually. First the FFT is performed on the received baseband samples, and Fig. 12: Architecture of the Resnet feature extraction network. Fig. 13: Architecture of the signal processing feature extraction network. they found that the high number of filters were unnecessary, and even detrimental, for this application. They reduced the number of filters in the RPN's first convolutional layer from 512 to 128. In the classifier, they reduced the number of filters in both fully connected layers from 4096 to 2048. We also test this downscaling for the VGG net with 16 stride, to see if we can achieve similar performance gains. In our results, we label this as the downscaled version. Convolution 3x1Convolution 3x1Convolution 3x1Max Pooling 2x1SignalInputFeatureMatrixRepeated4x (16 stride)Conv 1x1 Skip LayerConcatConvolution 8x1Batch NormMax Pooling 2DSignalInputFeatureMatrixRepeated4x (16 stride) with a different signal processing block. y(t) = s(t) * e−j2πfot h[n] = B f s sinc( B f s * n) 11 (11) (12) Fig. 14: Mean IoU performance of different FRCNN architec- tures. Fig. 16: AMC Use Case Process. VIII. RESULTS We create four spectrum sensing methods including energy- based, 2D FRCNN with spectrograms, our optimized 1D FRCNN, and our 1D FRCNN with an AMC use case. For each of these methods, we measure the mAP, mIoU, probability of detection, and probability of false alarm. We first test each method offline, using the synthesized dataset, giving easy and accurate control over the SNR of the channel. Each metric is tested over the SNR range of -5dB to +20dB. Then, we test the optimized 1D FRCNN with AMC over-the-air, and measure the four metrics at a consistent SNR. First, we create the baseline energy-based spectrum sensing this in Python, using the numpy method. We implement package. The implementation follows the process outlined in Sec. IV-A. For each frame, a noise threshold is calculated using Eq. 6. Then, the FFT is searched to see where the amplitude exceeds the calculated threshold. To add hysteresis, the amplitude must drop below the threshold five consecutive times. This prevents sudden energy spikes from triggering the spectrum sensing algorithm. For each test SNR, a dataset is run independently at the specified SNR. Metrics are calculated after every image is processed. The energy-based process does not produce probabilities, therefor, all detections are assumed to have a probability of 1.0 for calculating metrics. Next, a baseline 2D FRCNN spectrum sensing method using spectrograms is created. This implementation uses Yinghan Xu's [21] code as an implementation in Python using Ten- sorflow and Keras. The example is modified to support our spectrogram dataset, using uncompressed tiff files and no resizing of the spectrogram, as well as our changed hyper- parameters and architecture, which are shown in Table II. The Fig. 15: Inference times of different FRCNN architectures. the result is fed into the FRCNN model to find the location of all signals. Next, for each detection, the signal must be extracted from the baseband samples. This can achieved using the detected center frequency and bandwidth from FRCNN. This is done by removing the center frequency offset using Eq. 11, where s(t) is the input signal, and fo is the frequency offset. Next, a lowpass filter expressed in Eq. 12 is configured using the detected bandwidth, where B is the bandwidth, fs is the sampling frequency, and n is the nth tap of the filter. This is then applied by convolving the filter taps with the baseband samples. The result is the individual signal of interest, isolated from all other signals. Finally, the filtered baseband samples are fed into the AMC CNN, and a classification is produced. This same process could be applied to other signal processing applications, by replacing the modulation classification block -505101520Signal-to-noise Ratio (SNR, dB)00.10.20.30.40.50.6Mean-IoUFRCNN Architecture ComparisonsVGG Stride2VGG Stride4VGG Stride8VGG Stride16VGG Stride32DownscaledSignalResnetNormalized Inference Times of FRCNN ArchitecturesVGG Stride32VGG Stride8VGG Stride16ResnetDownscaledSignalVGG Stride4VGG Stride200.10.20.30.40.50.60.70.80.91Normalized Inference TimeSignalInputFRCNNFFTSignalExtractionAMCModulation Types architecture is trained over 40 epochs using 1000 spectrogram images. The dataset mixes spectrograms between 10dB and 40dB SNR. For testing, datasets at each SNR are created and tested independently. Each image is run individually, and checked against ground-truths. After an entire dataset for a specific SNR is run, the four metrics are calculated. A probability threshold of 0.7 is applied to each detection, where detections with probabilities below 0.7 are considered negative detections. Finally, we test our optimized 1D FRCNN method. We use Yinghan Xu's [21] as a reference and baseline for FRCNN so that we could create our 1D optimized version. The hyperpa- rameters used are shown in Table II. The network is trained over 20 epochs, with each epoch containing 10,000 samples. We used 10,000 samples in the dataset to counteract overfitting that occurred at 2,000 samples. For testing, each SNR dataset is run and tested independently. After an entire dataset is run, the four metrics are calculated. A probability threshold of 0.9 is applied to each detection, where detections with probabilities below 0.9 are considered negative detections. This threshold was found to give the highest mIoU results after testing thresholds between 0.0 and 0.9. Parameter rpn overlap min rpn overlap max nms overlap Optimizer Learn Rate Num Epochs Epoch Length 1D 0.3 0.7 0.5 2D 0.3 0.7 0.6 Adam Adam 10−5 10−5 40 20 1000 10000 TABLE II: Training Hyperparameters The mAP measured over SNR could be seen in Fig. 17. The average mAP over SNR is 0.239 for energy-based, 0.686 for 2D FRCNN, and 0.716 for our 1D FRCNN spectrum sensing. Both FRCNN methods significantly outperform energy-based sensing. Our method outperforms 2D spectrograms at low SNR, however, the mAP falls below 2D after 10dB SNR. The higher mAP shows the ability of our method to correctly detect all signals, without making false detections. The mIoU measured over SNR could be seen in Fig. 18. The average mIoU over SNR is 0.125 for energy-based, 0.307 for 2D FRCNN, and 0.587 for our 1D FRCNN spectrum sensing. Under all SNR conditions, our method localizes transmissions better than other approaches. The Pd measured over SNR could be seen in Fig. 19. The average Pd over SNR is 0.469 for energy-based, 0.940 for 2D FRCNN, and 0.823 for our 1D FRCNN spectrum sensing. The 2D spectrogram method has the highest probability of detecting transmissions, especially at low SNR. Our 1D method had higher Pd than energy-based at low SNR, but significantly under-performed compared to 2D, however, as SNR increases, both 1D and 2D methods converged to a Pd of nearly 1.0. The Pfa measured over SNR could be seen in in Fig. 20. The average Pfa over SNR is 0.169 for energy-based, 0.276 for 2D FRCNN, and 0.166 for our 1D FRCNN. Our optimized version performs the best on average, over all SNRs. However, energy-based averages almost the same, and performs significantly better 12 at high SNR. The 2D spectrogram method performs poorly at low SNR, but the Pfa quickly reaches the same levels as other methods at 15dB SNR. The relative inference time of each method is shown in Table III. These are normalized to the highest inference time, 2D FRCNN. The energy-based method significantly outperformed both ML-based methods, being about 500 times faster than our optimized 1D method. However, our optimization to FRCNN significantly improved inference time, by a factor of 4 over the original 2D FRCNN. Method Energy-Based 1D FRCNN 2D FRCNN Relative Time 5.00 * 10−4 0.250 1.00 TABLE III: Normalized Inference Times Our optimizations to FRCNN significantly improve the localization performance and the inference speed for spec- trum sensing. The mIoU, our primary performance metric, increases by 91%, however the mAP increases only slightly by 4%. Compared to energy-based, both FRCNN methods significantly outperform at all SNRs. Our optimized version improved mIoU by 470%, and mAP by 300% compared to energy-based sensing. For detecting all transmissions present, 2D FRCNN performed the best at low SNR, while both our optimized version and 2D perform just as well at SNRs above 15dB. Under the SNR intervals tested, energy-based under- performs compared to FRCNN methods, however, it trends towards the same Pd for increasing SNR. Finally, when com- paring probability of false alarm, our method had a low Pfa at very low SNR, however, the false alarm rate only marginally improved as SNR increased. Meanwhile, both energy-based and 2D FRCNN had significantly lower Pfa at higher SNR. 2D FRCNN had high Pfa at low SNR, being almost 2x higher than the other methods at 5dB SNR. Our optimized FRCNN shows improved detection and localization performance, as well as faster inference time over 2D FRCNN. In applications where detecting all signals present is prioritized, 2D FRCNN still outperforms our optimized version. Additionally, only the spectrogram case with 2D FRCNN can jointly localize in time and frequency domain, if an application requires that. Energy- based still fits best in applications that require fast inference times, significantly outperforming both ML based methods. A. AMC Use Case Results We test our AMC use case using the same outlined metrics, however the dataset must change to include mixed-signal time- domain samples, as well as the class labels for each detection. The time-domain samples are used after FRCNN detection to isolate each signal, so that AMC can be performed on it. The class labels refer to the modulation of each time- domain signal. First, a dataset was generated to train the AMC CNN described in Sec. VII, created from 9,000 samples of the 1D FRCNN dataset. Each sample of the FRCNN dataset contained on average three transmissions, with random modulation types. Each transmission was lowpass filtered to isolate it, and the frequency offset was removed. To simulate errors in FRCNN, we apply a ±2kHz random frequency offset, 13 Fig. 17: Mean Average Precision vs SNR Fig. 18: Mean Intersection over Union vs SNR Fig. 19: Probability of Detection vs SNR Fig. 20: Probability of False Alarm vs SNR and a bandwidth offset between 70% and 150% of the signal's original bandwidth. Additionally, we window an empty part of the spectrum to simulate a "No Signal" case. The AMC model is then trained over 40 epochs, with a total of 37548 training samples, 2492 validation samples, and 12533 test samples. The large number of test samples was chosen to ensure overfitting was not occurring. After training, the combined FRCNN and AMC system was tested, and metrics were measured for mAP, mIoU, Pd, and Pfa over the SNR range of -5dB to +20dB. These results could be seen compared to energy based, 2D FRCNN, and our optimized 1D FRCNN without AMC, in Fig. 17-20. First, it should be noted that compared to standalone FRCNN, combining AMC reduces the mAP, mIoU, and Pd. The ability of the system to detect and localize signals does not change, however, mislabelling signals will reduce each of these metrics. For example, a detected signal classified as "BPSK", when it was actually "PAM4", would factor in as a false positive detection, and an IoU of 0. The average mAP drops by 11% to 0.638, the average mIoU drops by 30% to 0.413, and the Pd drops by 28% to 0.594. However, the Pfa improves, dropping by 10% to 0.149, significantly outperforming all models. The Pfa metric is not effected by false positives over ground truths, and thus misclassifications, but the introduction of a "No Signal" class filters out additional false positive detections over noise. This use case shows that our optimized FRCNN model can be applied to mixed signal classification, when multiple and unknown signals are present in an uncontrolled band. B. Over-the-Air Results Finally, we test our system OTA by using SDR. We test our combined AMC and FRCNN model, to show the feasibility of this system to a realistic and real-world environment. We used the same trained models for 1D FRCNN and AMC that we collected metrics on. Two USRP N2901 SDRs were used to create the cluttered environment, where a total of five simul- taneous transmissions were tested. A single antenna receiver observed the spectrum, and applied our spectrum sensing and AMC algorithm. Each SDR channel was configured to operate at a 5GHz center frequency, with a 200kHz baseband sample rate. GNURadio was used to interface the SDRs with a PC, -505101520Signal to Noise Ratio (SNR, dB)0.10.20.30.40.50.60.70.80.9mAPMean Average Precision vs SNREnergyFRCNN 2DFRCNN 1DFRCNN 1D w/ AMC-505101520Signal to Noise Ratio (SNR, dB)00.10.20.30.40.50.60.70.8mIoUMean IoU vs SNREnergyFRCNN 2DFRCNN 1DFRCNN 1D w/ AMC-505101520Signal to Noise Ratio (SNR, dB)00.10.20.30.40.50.60.70.80.91PdProbability of Detection vs SNREnergyFRCNN 2DFRCNN 1DFRCNN 1D w/ AMC-505101520Signal to Noise Ratio (SNR, dB)00.10.20.30.40.50.6PfaProbability of False Alarm vs SNREnergyFRCNN 2DFRCNN 1DFRCNN 1D w/ AMC and ZMQ was used to transfer samples between GNURadio and Python for ML. A total of three different transmitter configurations were run, described in Table IV. These were created by generating the transmit waveforms in Python, and frequency multiplexing them in baseband. When received, this has the same effect as transmitting each signal at a different center frequency. Received samples were binned into frames of 1024, and processed using FRCNN. Each run was conducted until a total of 1000 frames were received, and each frame was processed online, as they were received. Since the SDR frame period was approximately 5ms, while the FRCNN inference time on our hardware was approximately 500ms, the system could not be run in real time. Instead, the spectrum was periodically observed, at the same rate as the inference time. While FRCNN was processing the received samples, current received samples were dropped, to ensure only the most recent samples were used. An FFT plot of each run could be seen in Fig. 21-23, where the estimated center frequency, bandwidth, and modulation type are displayed above each detection. After running each test, the mAP, mIoU, Pd, and Pfa were calculated for each run, then averaged together, and could be seen in Table V. Compared to offline tests at 20dB SNR, the mAP, mIoU, and Pd remained the same, with at most a 1.6% change between mAP. The Pfa decreased significantly, by about 90%, from 0.009 to 0.001. This is most likely due to the OTA SNR being higher. Compared to other literature that measures OTA performance, we show a significant improvement in OTA results. In Prasad et al [7], the authors found that their model did not generalize OTA, and produced an mAP of only 0.125. With our mAP of 0.826, we show that our system is capable of generalizing to real-world environments, and performing significantly better OTA. Fig. 21: OTA Run 1 with FRCNN Detection. Signal Number fc B Mod Type Run 1 TABLE IV: OTA Configurations mAP mIoU Pd Pfa Run 1 0.728 0.509 0.675 0.000 Run 2 0.885 0.739 0.877 0.002 Run 3 0.904 0.817 0.932 0.000 Average 0.839 0.688 0.828 0.001 TABLE V: OTA Results 14 Fig. 22: OTA Run 2 with FRCNN Detection. Fig. 23: OTA Run 3 with FRCNN Detection. IX. CONCLUSION In this research, we optimized FRCNN for 1D spectrum sensing, enabling FRCNN to be applied to 1D signals, a feature that was not previously possible. To perform spectrum sensing, we preprocess received signals with the FFT, to reveal frequency information. RF data was synthesized to train the optimized algorithm for spectrum sensing, as well as for testing the performance. Our optimizations improved the model in localization performance and inference time. Overall, the mIoU averaged 470% improvement over energy-based, and 91% improvement over 2D spectrograms. Optimizing for the 1D case improved inference time by 4 times compared to 2D spectrograms, however, compared to energy-based detection, ML approaches are still significantly slower, even with our optimizations. While our model performed well in detecting transmissions, 2D spectrograms had higher Pd at low SNR, while energy based had lower Pfa at high SNR. To demonstrate the application of our optimizations, we provide a use case for multi-signal AMC. Time-domain samples are filtered to isolate individual signals based on FRCNN detections. Since this introduces a new source of error, labelling error, it causes the mAP and mIoU to drop slightly. However, by also analyzing signals in time domain, false negatives can be filtered out, greatly improving the false alarm rate. The Pfa for our AMC use case is comparable to energy-based. Over-the-air tests were performed with our optimized FRCNN and AMC use case. We used two USRP N2901, to transmit up to 5 signals simultaneously, within a 200kHz band. We demonstrate that a single antenna receiver can use our architecture to accurately locate all signals. The demonstration was performed online, 1000007500050000250000250005000075000100000Frequency Offset (relative to fc), f (Hz)60504030201001020Amplitudef=-40.6kHzbw=25.0kHz16qamf=60.9kHzbw=21.9kHzpam4f=-1.6kHzbw=15.6kHzbpskf=-75.0kHzbw=12.5kHz16qamRx FFT (fc=5GHz)1000007500050000250000250005000075000100000Frequency Offset (relative to fc), f (Hz)604020020Amplitudef=59.4kHzbw=12.5kHzpam4f=18.8kHzbw=25.0kHzbpskf=-50.0kHzbw=25.0kHz16qamRx FFT (fc=5GHz)1000007500050000250000250005000075000100000Frequency Offset (relative to fc), f (Hz)60504030201001020Amplitudef=78.1kHzbw=18.8kHz16qamf=0.0kHzbw=18.8kHzpam4f=35.9kHzbw=15.6kHzbpskf=-70.3kHzbw=15.6kHzpam4f=-34.4kHzbw=25.0kHz16qamRx FFT (fc=5GHz) 15 [10] S. Kayraklik, Y. Alag ̈oz, and A. F. Cos ̧kun, "Application of Object Detection Approaches on the Wideband Sensing Problem," in 2022 IEEE International Black Sea Conference on Communications and Networking (BlackSeaCom), Jun. 2022, pp. 341–346. [11] S. Ren, K. He, R. Girshick, and J. Sun, "Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks," Jun. 2015. [Online]. Available: https://arxiv.org/abs/1506.01497v3 [12] C. Gravelle, T. Morehouse, and R. Zhou, "Deep Learning-Enabled Real- Time Recognition of Wireless Signals," in 2019 IEEE International Symposium on Dynamic Spectrum Access Networks (DySPAN), Nov. 2019, pp. 1–2, iSSN: 2334-3125. [13] T. Morehouse, N. Rahimi, M. Shao, and R. Zhou, "Baseband Modu- lation Classification using Incremental Learning," in 2020 IEEE 63rd International Midwest Symposium on Circuits and Systems (MWSCAS), Aug. 2020, pp. 225–228, iSSN: 1558-3899. [14] T. Morehouse, C. Montes, M. Bisbano, J. F. Lin, M. Shao, and learning-based jammer classification," in R. Zhou, "Incremental Artificial Intelligence and Machine Learning for Multi-Domain Operations Applications III, T. Pham, L. Solomon, and M. E. Hohil, Eds. Online Only, United States: SPIE, Apr. 2021, p. 78. [Online]. Available: https://www.spiedigitallibrary.org/conference-proceedings-of-spie/ 11746/2588003/Incremental-learning-based-jammer-classification/10. 1117/12.2588003.full [15] Z. Li and J. Wang, "An improved algorithm for deep learning YOLO network based on Xilinx ZYNQ FPGA," in 2020 International Confer- ence on Culture-oriented Science & Technology (ICCST), Oct. 2020, pp. 447–451. [16] R. Bassiouny, A. Mohamed, K. Umapathy, and N. Khan, "An Inter- pretable Object Detection-Based Model For The Diagnosis Of Neonatal Lung Diseases Using Ultrasound Images," in 2021 43rd Annual Inter- national Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), Nov. 2021, pp. 3029–3034, iSSN: 2694-0604. [17] J. U. Kim and Y. Man Ro, "Attentive Layer Separation for Object Classification and Object Localization in Object Detection," in 2019 IEEE International Conference on Image Processing (ICIP), Sep. 2019, pp. 3995–3999, iSSN: 2381-8549. [18] K. N. Renu Chebrolu and P. Kumar, "Deep Learning based Pedestrian Detection at all Light Conditions," in 2019 International Conference on Communication and Signal Processing (ICCSP), Apr. 2019, pp. 0838– 0842. [19] Z. Wu, C. Liu, C. Huang, J. Wen, and Y. Xu, "Deep Object Detection with Example Attribute Based Prediction Modulation," in ICASSP 2022 - 2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), May 2022, pp. 2020–2024, iSSN: 2379-190X. [20] L. Liu, B. Zhou, G. Liu, D. Lian, and R. Zhang, "Yolo-Based Multi- Model Ensemble for Plastic Waste Detection Along Railway Lines," in IGARSS 2022 - 2022 IEEE International Geoscience and Remote Sensing Symposium, Jul. 2022, pp. 7658–7661, iSSN: 2153-7003. implemented "Faster R-CNN (object [21] Y. Xu, detection) by Images. . . ," Keras Feb. https://towardsdatascience.com/ faster-r-cnn-object-detection-implemented-by-keras-for-custom-data-from-googles-open-images-125f62b9141a custom data [Online]. Available: from Google's Open for 2019. to show the ability to integrate the model with a receiver system. Compared to other papers that collected OTA metrics, our model performed significantly better. In Prasad et al [7] the authors measured an OTA mAP of 0.125, while our mAP was measured 0.826. However, our work could still benefit from several improvements, including faster inference improved probabiltiy of detection and probality of times, false alarm, and greater performance at low SNR. In future applications, we plan to extend our work to other object detection in signal processing, integration into larger systems, and implementation on an FPGA for real-time acceleration. Our results contribute to broader spectrum sensing research, as well as object detection in signal processing. We show improved spectrum sensing results, beyond state of the art, for cluttered RF environments. Additionally, we improve the inference time over previous FRCNN methods. Our work can also be extended to other signal processing applications, where object detection is useful, such as localizing anomalies in a signal. ACKNOWLEDGEMENTS This work was supported by AFRL Beyond 5G SDR Uni- versity Challenge program, the University of Massachusetts Dartmouth's Marine and Undersea Technology (MUST) Re- search Program funded by the Office of Naval Research (ONR) under Grant No. N00014-20-1-2170, and ONR Naval Engineering Education Consortium (NEEC) program under Grant No. N00174-22-1-0008. REFERENCES [1] W. Zhao, H. Li, M. Jin, Y. Liu, and S.-J. Yoo, "Eigenvalues-Based Universal Spectrum Sensing Algorithm in Cognitive Radio Networks," IEEE Systems Journal, vol. 15, no. 3, pp. 3391–3402, Sep. 2021, conference Name: IEEE Systems Journal. [2] C. Liu, J. Wang, X. Liu, and Y.-C. Liang, "Maximum Eigenvalue-Based Goodness-of-Fit Detection for Spectrum Sensing in Cognitive Radio," IEEE Transactions on Vehicular Technology, vol. 68, no. 8, pp. 7747– 7760, Aug. 2019, conference Name: IEEE Transactions on Vehicular Technology. [3] J. Xie, J. Fang, C. Liu, and X. Li, "Deep Learning-Based Spectrum Sensing in Cognitive Radio: A CNN-LSTM Approach," IEEE Commu- nications Letters, vol. 24, no. 10, pp. 2196–2200, Oct. 2020. [4] J. Xie, C. Liu, Y.-C. Liang, and J. Fang, "Activity Pattern Aware Spectrum Sensing: A CNN-Based Deep Learning Approach," IEEE Communications Letters, vol. 23, no. 6, pp. 1025–1028, Jun. 2019, conference Name: IEEE Communications Letters. [5] T. O'Shea, T. Roy, and T. C. Clancy, "Learning robust general radio signal detection using computer vision methods," in 2017 51st Asilomar Conference on Signals, Systems, and Computers, Oct. 2017, pp. 829– 832, iSSN: 2576-2303. [6] K. N. R. S. V. Prasad, K. B. Dsouza, V. K. Bhargava, S. Mallick, and H. Boostanimehr, "A Deep Learning Framework for Blind Time- Frequency Localization in Wideband Systems," in 2020 IEEE 91st Vehicular Technology Conference (VTC2020-Spring), May 2020, pp. 1– 6, iSSN: 2577-2465. [7] K. N. R. S. V. Prasad, K. B. D'souza, and V. K. Bhargava, "A Downscaled Faster-RCNN Framework for Signal Detection and Time- Frequency Localization in Wideband RF Systems," IEEE Transactions on Wireless Communications, vol. 19, no. 7, pp. 4847–4862, Jul. 2020, conference Name: IEEE Transactions on Wireless Communications. [8] A. Vagollari, V. Schram, W. Wicke, M. Hirschbeck, and W. Gerstacker, "Joint Detection and Classification of RF Signals Using Deep Learning," in 2021 IEEE 93rd Vehicular Technology Conference (VTC2021-Spring), Apr. 2021, pp. 1–7, iSSN: 2577-2465. [9] Y. Ghanney and W. Ajib, "Radio Frequency Interference Detection using Deep Learning," in 2020 IEEE 91st Vehicular Technology Conference (VTC2020-Spring), May 2020, pp. 1–5, iSSN: 2577-2465.
http://arxiv.org/abs/2302.13850v1
2023-02-20T09:02:10
2023-02-20T09:02:10
Exploring the Advantages of Transformers for High-Frequency Trading
This paper explores the novel deep learning Transformers architectures for high-frequency Bitcoin-USDT log-return forecasting and compares them to the traditional Long Short-Term Memory models. A hybrid Transformer model, called \textbf{HFformer}, is then introduced for time series forecasting which incorporates a Transformer encoder, linear decoder, spiking activations, and quantile loss function, and does not use position encoding. Furthermore, possible high-frequency trading strategies for use with the HFformer model are discussed, including trade sizing, trading signal aggregation, and minimal trading threshold. Ultimately, the performance of the HFformer and Long Short-Term Memory models are assessed and results indicate that the HFformer achieves a higher cumulative PnL than the LSTM when trading with multiple signals during backtesting.
[ "Fazl Barez", "Paul Bilokon", "Arthur Gervais", "Nikita Lisitsyn" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.13850v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.13850v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "q-fin.ST", "@scheme": "http://arxiv.org/schemas/atom" }
[ "q-fin.ST", "cs.LG" ]
3 2 0 2 b e F 0 2 ] T S . n i f - q [ 1 v 0 5 8 3 1 . 2 0 3 2 : v i X r a EXPLORING THE ADVANTAGES OF TRANSFORMERS FOR HIGH-FREQUENCY TRADING A PREPRINT Fazl Barez Edinburgh Centre for Robotics The University of Edinburgh [email protected] Paul Bilokon Department of Computing Imperial College London [email protected] Arthur Gervais Department of Computing Imperial College London [email protected] Nikita Lisitsyn Department of Computing Imperial College London [email protected] February 28, 2023 ABSTRACT This paper explores the novel deep learning Transformers architectures for high-frequency Bitcoin-USDT log-return forecasting and compares them to the traditional Long Short-Term Memory models. A hybrid Transformer model, called HFformer, is then introduced for time series forecasting which incorporates a Transformer encoder, linear decoder, spiking activa- tions, and quantile loss function, and does not use position encoding. Furthermore, possible high-frequency trading strategies for use with the HFformer model are discussed, including trade sizing, trading signal aggregation, and minimal trading threshold. Ultimately, the per- formance of the HFformer and Long Short-Term Memory models are assessed and results indicate that the HFformer achieves a higher cumulative PnL than the LSTM when trading with multiple signals during backtesting1. 1 Introduction Forecasting Financial Time Series (FTS) has been of interest to financial market participants who are in- It has historically been approached using terested in making profitable trades on the financial markets. stochastic and machine learning models. Stochastic methods include linear models such as Autoregres- sive Integrated Moving Average (ARIMA) [1] that support non-stationary time series and non-linear mod- els, including the Generalized Autoregressive Conditional Heteroskedasticity (GARCH) [2] model. Machine learning methods are data-driven approaches, among which Recurrent Neural Networks (RNNs) [3], more specifically, Long Short-Term Memory (LSTM) networks [4], have been especially popular for time series prediction. Periodically, new deep learning models are being adopted in quantitative research to find the most accurate models in FTS forecasting that would lead to more efficient trading strategies. Recently, a new type of deep learning [5] architecture called Transformer [6], relying on Attention [7], was introduced for Natural Language Processing (NLP) applications. Transformers have since been used in other applications such as computer vision tasks [8] and more recently in time series forecasting. This paper will focus on the application of Transformers in high-frequency FTS forecasting. FTS are characterized by properties including frequency, auto-correlation, heteroskedasticity, drift, and seasonality [9]. The frequency of trading strategies ranges from milliseconds to minutes and days. Most studies on FTS forecasting [10, 11] focus on minute frequencies as millisecond trading data is expensive. For 1The code will be publicly available upon publication Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT the results of this paper to be in line with real-world trading conditions, we will use millisecond frequency tick price and level 2 Limit Order Book (LOB) data [12] which will allow us to focus on the bid and ask prices and quantities of the first ten levels of the LOB. We will be using data collected from the Binance cryptocurrency exchange for the Bitcoin - USDT trading pair. Traders require automated systems to make decisions based on the order book and tick price data at millisecond frequencies. Stochastic modeling has long been used to describe prices as exogenous random variables, however, it relies on assumptions that may oversimplify the complexity of financial markets. Con- trary to stochastic modeling, deep learning forecasting relies on a data-driven approach to learn past dynam- ics to predict future behavior. Deep learning approaches have shown promising results in High-Frequency Trading (HFT) strategies [10]. Currently, LSTMs are the most widely used deep learning architecture for FTS forecasting [13]. However, LSTMs are affected by vanishing and exploding gradient problems for long time series [14], and they are sequential structures that are difficult to parallelize. Transformers use multi-head Attention to capture long-term dependencies and are naturally paralleliz- able, which makes them a good candidate for low-latency trading strategies. However, Transformers were not specifically engineered for modeling local sequential structures and require finely tuned position embed- dings. Modeling short- and long-range temporal dependencies while accounting for FTS properties (e.g., seasonality and auto-correlation) remains an open question [15, 16]. In this paper, we compare the performance of existing deep learning architectures for FTS forecasting. We then introduce an improved deep learning model called the HFformer, which combines certain features of previously compared architectures. Finally, we compare the performance of the HFformer to existing architectures in the context of FTS forecasting. We focus on describing the collected cryptocurrency data and detailing the pre-processing of the data before feeding it into deep learning models. Then, we cover the LSTM and original Transformer encoder-decoder architecture and compare their forecasting performance. We focus on understanding more recent Transformer architectures precisely engineered for time series forecasting: Autoformer and FEDformer. We evaluate the idiosyncrasies of these novel architectures and compare their performance to the original Transformer. We combine some novelties introduced by time series Transformer architectures to create a Transformer specifically optimized for HFT, which we refer to as HFformer. Finally, we compare the HFformer's performance to the most currently used deep learning architecture for FTS forecasting, the LSTM, on larger datasets. We also compare the trades done by both architectures. We conclude by presenting possible trading strategies and assessing their performance. 2 Background and Related Work 2.1 FTS The world financial markets have undergone a technological revolution in the past decades. The execution time of market orders decreased from 25 ms in 2000 to less than 0.017 ms in 2017 [17]. The trades are spaced randomly and endogenously [18] as more trading occurs during market openings and closings, breaking news, and abrupt price changes. This leads to auto-correlated prices and quantities. FTS are non-stationary as they exhibit seasonality at different scales linked to the market opening hours, underlying assets, and economic events. Properties such as trend, drift, auto-correlation, and heteroskedasticity make FTS forecasting a challenging problem. 2.2 Traditional Methods for FTS Stochastic FTS forecasting relies on linear and non-linear methods. Linear models include Moving Average (MA), Autoregressive (AR), and ARIMA [19] models. Linear models can solve stationary and non-stationary time series. Non-linear models such as GARCH and GARCH-based models are used to forecast stock market volatility exhibiting heteroskedasticity [20]. Currently, LSTMs are successfully used for minute-frequency FTS forecasting [21] for one- and multi- step forecasting [22]. Convolutional Neural Networks (CNNs) and LSTM-CNNs are used to extract informa- tion from LOBs [10]. Spiking Neural Networks (SNNs) predict price spikes for HFT strategies [23]. Attention layers have been combined with LSTMs [24] for NLP sentiment classification tasks. Recently, LSTM encoder-decoder architectures with dual Attention have been used to make the encoder and decoder hidden state selection more relevant for FTS forecasting [11]. 2.3 Transformers for FTS Initially introduced for NLP, the Transformer has shown state-of-the-art performance for forecasting time series [25]. The Transformer requires a positional encoding, such as Time2Vec [26], to be added to the 2 Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT input embeddings to model time series. Novel Transformer designs [27] have focused on reducing the O(L2) complexity by using causal convolutions or sparse bias in the Attention module to process longer sequences. Other structural changes were made to improve time series forecasting. The Autoformer [15] has a mod- ified auto-correlation Attention module that selects the top-k similar sub-sequences. The Temporal Fusion Transformer (TFT) [28] uses static covariate encoders, gating layers for noise suppression, and recurrent layers for local processing. The FEDformer [16] performs a Fourier and Wavelet time series decomposition using the Attention mechanism. 3 Exploratory Data Analysis 3.1 FTS data Level 2 LOB data is collected from the Binance cryptocurrency exchange for the BTC-USDT trading pair using Binance's 100 ms LOB web socket2. Most of the collected LOB snapshots for the BTC-USDT trading pair are within 100 ms. We then proceed to compute the weighted midprice defined as follows: M idpricet = qa;1 t * pa;1 t + qb;1 2 t * pb;1 t (1) where pa;1 t at time t. , qa;1 t , pb;1 t , and qb;1 t are the bid price and quantity and ask price and quantity of level 1 of the LOB We process the collected LOB data by dropping snapshots with the same consecutive midprice value as the analysis will be done at trade time rather than wall clock time. This is done because we are interested in predicting the values at which the future trades will occur, and this brings the distribution of the observed values closer to a normal distribution (cf. subsubsection 3.1.1). In this paper, the terms "midprice" and "weighted midprice" will be used interchangeably. 3.1.1 Log-Returns One challenge with FTS is that the range of values varies significantly, even for the same financial asset. If we want to apply a deep learning method to forecast FTS, we need to transform the time series to remove the non-stationarity. Usually, three price time series transformations are proposed: • price differencing: dt+1 = pt+1 − pt t+1 = pt+1−pt • returns: r∗ pt • log-returns: rt+1 = log(pt+1) − log(pt) All three of these methods remove the non-stationarity of prices. However, using price differencing preserves the units and will be proportional to the underlying price of the asset, which is undesirable in the case of Bitcoin because of its high volatility. On the contrary, returns and log-returns are unitless as it is a ratio of two prices. Returns represent the change in asset price as a percentage and are therefore widely used in finance for their convenience. From now on, we focus on forecasting log-returns over different time horizons. We define log-returns the following way: rt+τ = log(pt+τ ) − log(pt) = log (cid:19) (cid:18) pt+τ pt (2) where τ ∈ {1, ..., 30}. τ is the value of the forecasting horizon. The range of considered forecasting horizons can be justified using the Augmented Dickey-Fuller (ADF) stationarity test, which tests for different horizons of the log-returns. As the prediction horizon increases, the information contained in the observed prices, quantities, and historical returns becomes less informative for future predictions (cf. Figure 1) because the time series becomes less stationary. A lower value means that the time series exhibits stronger stationary properties. 2More details on Binance's LOB web socket can be found at https://www.binance.com/en/binance-api. 3 Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT Figure 1: Augmented Dickey-Fuller stationarity test for different log-return horizons of four different samples of 9000 LOB snapshots. 3.1.2 LOB The LOB contains information about the bid and ask prices and the quantities offered at those prices (cf. Figure 2). Market participants can choose to place different types of orders. Market orders are executed at the current market price if the offered quantity allows; otherwise, the order will be partially filled until completion at higher levels of the LOB for buy orders and lower levels of the LOB for sell orders. This can sometimes lead to price slippage, resulting in a less desirable average fill price. Another strategy is to place a limit order which will be executed only at the specified price or better as mentioned in the order. Depending on the limit price, these orders will appear at a certain level in the LOB. Figure 2: Bid-ask pressure for 10 levels of bid and ask for BTC-USDT. Figure 2 shows two examples of the bid-ask pressure. In the first case, the midprice will have a greater resistance to change than in the second case since a larger amount of BTC would need to be bought or sold to move the midprice. From Figure 3, we notice that as the bid pressure builds up in the LOB, the weighted midprice starts to move higher and vice-versa for the ask pressure. This leads us to explore the predictive power of the information contained in the LOB for forecasting future log-returns. 3.1.3 Normalization of FTS To improve the performance of machine learning methods, input data needs to be normalized. Traditionally, the normalization parameters from the training set are applied to the test set (e.g., the mean and standard deviation of the training data). However, as in the case of the BTC-USDT pair, the mean and standard deviation of the prices and quantities fluctuate significantly. Taking this into account, we propose to use online normalization. The online normalization of the input data is done by computing the mean and standard deviation of the data contained in the look-back window. We then normalize the data in the look-back window using the computed mean and standard deviation. Later, we will test the performance of the forecasting models for look-back windows of sizes 100, 200, 300, and 400 timesteps (cf. Figure 12). During data normalization, it is important not to compute any estimates based on future values that we want to forecast to avoid contaminating the training set. 4 20406080100Horizon18161412108ADF statisticAugmented Dickey-Fuller Stationarity Test - BTC-USDT30199.530200.030200.530201.030201.530202.030202.530203.0Price01234567AmountLOB Snapshot 1218462184821850218522185421856Price0.00.51.01.52.02.53.03.54.0AmountLOB Snapshot 2 Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT Figure 3: LOB bid-ask pressure for 10 aggregated levels. 4 LSTM and Transformers for FTS 4.1 LSTM Recurrent Neural Networks (RNNs) are neural networks that were developed to work with sequential data to model dependencies of arbitrary length. The goal is to learn the mapping between x1:T and y1:T by encoding the input sequence into a hidden state ht that is then decoded into yt: ht = φh(Whht−1 + Wxxt + bh) yt = φy(Wyht + by) (3) (4) where Wh, Wx, Wy, bh, by are learned parameters and φh and φy are activation functions. However, RNNs suffer from vanishing/exploding gradients due to the backpropagation mechanism used during Gradient Descent (GD). GD is an iterative optimization algorithm used to find a given function's local optimum to reduce the difference between the predicted and true values. Various loss functions are used to compute the difference between the true and predicted values, which is then propagated back to modify the weights of the model. This issue is mitigated by using memory cell states and gating mechanisms in LSTMs: f t = σ(Wf * [ht−1, xt] + bf ) it = σ(Wi * [ht−1, xt] + bi) ot = σ(Wo * [ht−1, xt] + bo) ̃ct = tanh(Wc * [ht−1, xt] + bc) ct = f (cid:12) ct−1 + it (cid:12) ̃ct ht = ot (cid:12) ct (5) (6) (7) (8) (9) (10) where Wf , Wi, Wo, Wc, bf , bi, bo, bc and σ* is the sigmoid activation function. 4.2 Transformer 4.2.1 Attention A scaled dot-product Attention [6] mechanism is a key-value lookup based on a query matrix Q, key matrix K, and value matrix V described as: Attention(Q, K, V ; α) = α (cid:32) QKT (cid:112)dq (cid:33) V (11) where Q ∈ RN ×dq , K ∈ RM ×dq , V ∈ RM ×dv , and α(.) is an activation function applied row-wise. dq and dv represent the dimensions of the query and value vectors respectively. The sof tmax(.) activation function is used in Transformers and is defined as: sof tmax(xi) = exp(xi) j exp(xj) (cid:80) (12) Intuitively sof tmax(.) transforms a vector x into a probability vector for which the sum of elements adds up to 1. 5 100020003000400050006000Timesteps0.00.20.40.60.81.0Bid-Ask PressureLOB Bid-Ask Pressure - 10 Levels Aggregated - BTC-USDT30190302003021030220302303024030250 Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT Transformers, compared to RNNs, are easily parallelizable and can be fed multiple consecutive time series in a batch to encode and decode. However, providing consecutive time series may prevent the Trans- former from learning, as it could use the time series in the batch to see the "future." Masked Attention prevents the Transformer from seeing future values: M askedAttention(Q, K, V ; α, M ) = α mask (cid:32) (cid:32) (cid:33)(cid:33) , M V QKT (cid:112)dq (13) where M nm is 0 for masking and 1 otherwise. When M nm = 0, set (QKT )nm = −∞ which in the case = 0. Therefore, the value vm will not contribute to the Attention of sof tmax(.) will result in exp output for query qn. (cid:18) (cid:19) QKT√ dq Transformers combine multiple Attention heads into a multi-head Attention module where each head captures different parts of the sequence, which allows for coarser and finer encodings of the time series. 4.2.2 Position Encoding Notice that scaled dot-product Attention is permutation equivariant: Attention(P Q, K, V ; α) = α (cid:33) (cid:32) P QKT (cid:112)dq V = P α (cid:33) (cid:32) QKT (cid:112)dq V = P Attention(Q, K, V ; α) (14) As the ordering information matters in time series forecasting, where we input a sequence of queries q1, . . . , qN , we construct a modified version of the query matrix Q: where f (.) is a summation and concatenation, and P E(n) is the position encoding of input with index n, which could be learned or computed. We use sinusoid embedding to encode FTS ordering information. (cid:101)Q = ( (cid:101)q1, . . . , (cid:101)qN )T , (cid:101)qn = f (qn, P E(n)) (15) 4.2.3 Layer Normalization Layer normalization [29] is used to stabilize the training of the neural network. Let y = {y1, . . . , yn} = W x + b be the output of a feed-forward layer before going through an activation function. The layer normalization is defined as: y ← y − ˆy σ , ˆy = 1 n n (cid:88) k=1 yk, σ = (cid:118) (cid:117) (cid:117) (cid:116) 1 n n (cid:88) k=1 (yk − ˆy)2 In Transformers, layer normalization is applied with a residual connection: Add&N orm(x) = LayerN orm(x + Sublayer(x)) (16) (17) where Sublayer(.) can either be a multi-head Attention layer or a point-wise feed-forward network. 4.2.4 Point-wise Feed-forward Network Transformers use the point-wise feed-forward network as the feed-forward layer. The output of the multi- head Attention layer after the Add&Norm layer is a N × dout matrix which contains the Attention results for N queries. The point-wise feed-forward network processes this matrix row by row. 4.3 Novel Transformer Architectures 4.3.1 Autoformer The Autoformer uses a new type of Attention based on auto-correlation in its encoder and decoder. The encoder eliminates the long-term trend by series decomposition using the Fast Fourier Transform and focuses on modeling seasonal patterns. The past seasonal and trend information from the encoder is then used by the decoder to predict future values. Compared to the Transformer's full Attention module (cf. Figure 4), the auto-correlation Attention (cf. Figure 5) achieves a reduced complexity of O(L log(L)) compared to O(L2) for a length-L time series. The performance improvement is due to querying only the top log(L) entries based on the series periodicity. 6 Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT Figure 4: Attention module in a Transformer [15]. Figure 5: Auto-correlation Attention module in Auto- former [15]. 4.3.2 FEDformer The FEDformer, similar to the Autoformer, uses seasonal-trend decomposition to predict future values. The FEDformer uses either the Fast Fourier Transform or the Wavelet Transform to map the time series into the frequency domain. It then randomly queries the frequency domain Attention module for high-frequency and low-frequency components, which reduces the complexity from O(L2) to O(L) for length-L time series. The goal behind using the frequency domain is to achieve an optimal mix between high-frequency components, which are more affected by local noise, and low-frequency components, which are more affected by the overall trend of the time series. 4.4 HFformer Having evaluated existing Transformer-like architectures, we combine some of their different architectural components into a new Transformer-like architecture called the HFformer. Below is an illustration of the architecture of the HFformer. Figure 6: HFformer - Architecture. 4.4.1 Transformer Encoder with Spiking Activation The HFformer's encoder is based on a Transformer encoder with activation functions that were modified to be spiking: SpikingActivation(x) = (cid:26)x, 0, if x ≥ threshold, if x < threshold. (18) 7 ProcessEncoderProcessAdd & NormFeed ForwardMulti-Head AttentionAdd & NormLOBLinearPredicted Log-Returns QuantilesDecoderSpiking ActivationInput EmbeddingN xx M Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT where the threshold is learned during training. We use a combination of the spiking activation with a PReLU activation function. The Pytorch-Spiking Python library3 provides the implementation of the spiking activation. Due to the noisy nature of the LOB data, a spiking activation function reduces the noise propagated through the Transformer encoder by learn- ing a passing threshold below which the information is not propagated in the encoder. 4.4.2 Linear Decoder The linear decoder contains two linear layers connected by a PReLU activation function. The decoder needs to output a single value for each forecast horizon as we forecast log-returns. Shifting from an autoregressive decoder to a linear decoder helps to reduce error propagation and decrease the training time. 4.4.3 No Positional Encoding The positional encoding was removed from the model. As a result, the model's performance was improved, and the training time was reduced as the number of trainable parameters decreased. Positional encoding was introduced for NLP tasks. It is used as an augmentation technique for the self-Attention mechanism, which is invariant to the sequence order. However, as we no longer require an autoregressive decoder since we use a linear decoder, the positional encoding becomes less relevant. Additionally, the amount of information provided to the Transformer encoder increases with the position dimension, which could serve as a form of positional encoding [30]. 4.4.4 Quantile Loss The quantile loss is defined as follows: L(ˆyp i , yi) = max[q(ˆyp i − yi), (q − 1)(ˆyp i − yi)] (19) where ˆyp for the loss. i is the model's output for a given quantile p and yi is the true value. The mean reduction is used The HFformer works with MSE and MAE loss. However, quantile loss allows forecasting an interval around the predicted value. This is helpful when the inter-quartile range becomes larger than the mean inter-quartile range, which could signify a low certainty about the forecasted value and therefore one might decide not to enter the trade. 5 Experiments 5.1 Data To compare the performance of different deep learning architectures, we use a subset of 100,000 LOB snap- shots, where 80,000 LOB snapshots are used for training and 20,000 for validation (cf. Figure 7 and Fig- ure 8). Figure 7: Subset of LOB snapshots used to assess model performance - Midprice. Figure 8: Subset of LOB snapshots used to assess model performance - Bid-Ask pressure. The same subset of LOB snapshots is used later for comparing different Transformer architectures. 5.2 Setup The input data fed into the models consists of 38 features: • 9 bid prices and the 9 associated quantities • 9 ask prices and the 9 associated quantities 3More details about the Pytorch-Spiking Python library can be found at https://github.com/nengo/pytorch-spiking. 8 2.002.022.042.062.082.10Timesteps1e6218002200022200224002260022800230002320023400MidpriceMidprice - BTC-USDTValidationTraining2.05002.05052.05102.05152.05202.05252.0530Timesteps1e60.00.20.40.60.81.0Bid-Ask PressureLOB Bid-Ask Pressure - 10 Levels Aggregated - BTC-USDT21800218502190021950220002205022100Price Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT • historical lagged log-return variable log (cid:16) M idpricet M idpricet−τ (cid:17) where τ is the forecast horizon • the weighted midprice The model's output is the log-return for a given forecast horizon τ ∈ {1, ..., 30}. The training uses the adaptive moment estimation Adam with Weight Decay (AdamW) [31] optimizer. The AdamW optimizer estimates the first and second moment of the gradient and adapts the learning rate for each input feature. The decoupled weight decay improves the convergence to an optimum. The Mean Squared Error (MSE) and Mean Average Error (MAE) loss functions were considered for the LSTM, Transformer, Autoformer, FEDformer, and HFformer models. Models trained with the MSE loss, although more sensitive to outliers than the MAE loss, yielded a higher out-of-sample R2 score. 5.3 Evaluation Out-of-sample R2 is used to assess the performance of the models for forecasting log-returns at different horizons. R2 has the advantage of being interpretable relative to a baseline score. However, R2 is sensitive to outliers. Finally, after each training epoch, the model's performance is evaluated using training and validation sets to avoid overfitting. 5.4 Results Figure 9: Autoformer vs. FEDformer vs. Transformer vs. LSTM vs. HFformer - Log-returns. From Figure 9, we notice that the LSTM outperforms the Transformer model for all forecasting horizons. This could be due to the high noise-to-signal ratio that the LOB contains. The Transformer is more sensitive to noise as it is a more complex neural network which may lead it to overfit the training data even if the training is done using a validation set to reduce the chances of overfitting. We will later see that the Transformer's encoder performance improves with noise-reducing activation functions and larger training sets. Among Transformer-like architectures, the Autoformer achieves the best performance on shorter fore- casting horizons (cf. Figure 9). The Autoformer and FEDformer require an additional input feature which is the date and time timestamp, as both of these models use a time embedding. The frequency of the target time series (e.g., seconds, minutes, and hours) is used as a hyperparameter. The HFformer outperforms the other Transformer-like architectures, however, it underperforms the LSTM (cf. Figure 9), however, as the size of the training dataset increases, the HFformer attains better forecasting results than the LSTM during backtesting. The hyperparameters are listed in Table 5. 5.5 Ablation Study We conduct an ablation study to determine the impact of different suggested improvements used in the HFformer compared to the original Transformer architecture. The following ablations are made: • the spiking activation combined with the PReLU activation function is replaced with a PReLU activa- tion function • the positional encoding is added back • the linear decoder is replaced with the autoregressive Transformer decoder 9 51015202530Forecast Horizon0.100.050.000.050.100.15Out-of-Sample R2AutoformerFEDformerTransformer Enc-DecLSTMHFformer Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT Figure 10: Ablation study for the HFformer - Log-returns. We notice from Figure 10 that a major improvement in the R2 score is achieved by replacing the Trans- former decoder with a linear decoder. Adding a spiking activation and removing the positional encoding result in marginal improvements. 5.6 Look-back Window: LSTM vs. HFformer We experiment with the size of the look-back window to find out which size will yield the best performance for longer forecasting horizons. The LSTM and HFformer models are trained and tested with different look- back window sizes using the same data as previously. Figure 11: Look-back window size impact on the HF- former - Log returns. Figure 12: Look-back window size impact on the LSTM - Log-returns. We notice that increasing the size of the look-back window positively affected the performance of the LSTM (cf. Figure 12). However, there was no noticeable change for the HFformer (cf. Figure 11). 5.7 Training and Validation Sets The LSTM and HFformer models are trained on sets of the following size: • Training set with 80,000 LOB snapshots and validation set with 20,000 LOB snapshots • Training set with 300,000 LOB snapshots and validation set with 60,000 LOB snapshots • Training set with 600,000 LOB snapshots and validation set with 120,000 LOB snapshots Figure 13: Size of validation and test sets impact on the HFformer and LSTM - Log-returns. 10 51015202530Forecast Horizon0.100.050.000.050.100.150.20Out-of-Sample R2OriginalWithout spiking activationWith positional encodingWith Transformer decoder51015202530Forecast Horizon0.0000.0250.0500.0750.1000.1250.1500.1750.200Out-of-Sample R2Input window 100Input window 200Input window 300Input window 40051015202530Forecast Horizon0.0000.0250.0500.0750.1000.1250.1500.1750.200Out-of-Sample R2input window 100input window 200input window 300input window 40051015202530Forecast Horizon0.0000.0250.0500.0750.1000.1250.1500.1750.200Out-of-Sample R2LSTM: Training size 80k, validation size 20kHFformer: Training size 80k, validation size 20kLSTM: Training size 300k, validation size 60kHFformer: Training size 300k, validation size 60kLSTM: Training size 600k, validation size 120kHFformer: Training size 600k, validation size 120k Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT From Figure 13, we notice that as the training and validation sets increases the absolute performance of both models decreases. However, it is important to consider larger training and validation sets, as during live trading, it can be technically challenging to continuously retrain the model and may lead to overfitting. The LSTM outperforms the HFformer on smaller training and validation datasets. The HFformer's forecasting performance improves relative to the LSTM's as the size of the training and validation sets increases. 5.8 Classification Performance Previous comparisons have been based on R2, which assesses the regressional quality of the model. We now proceed to study the classification performance of the HFformer and LSTM. For the following comparisons, we use the HFformer and LSTM models trained on 600,000 LOB snapshots and validated on 120,000 LOB snapshots. The classification performance is assessed on a test set of size 200,000 LOB snapshots. We define two classes: • buy, when the predicted log-return is positive • sell, when the predicted log-return is negative The ratios are the true positive rates for each class. The first comparison is based on true positives and false positives. The second comparison is a mix of classification and regression. The computed ratios are weighted ratios where the weights are the true values of the log-returns. The motivation behind this comparison is to assess whether both of the models can classify relatively large log-returns correctly. This is important in the case of volatile assets such as Bitcoin since, if the model fails to predict large log-return changes, the trading strategy will result in large drawdowns and limited upsides. Figure 14: Classification performance of the HFformer and LSTM - Log-returns. Figure 15: Classification performance with weights of the HFformer and LSTM - Log-returns. We notice that, on average, the HFformer exhibits a slightly better classification performance than the LSTM (cf. Figure 14). For the weighted ratio, the overall performance of the HFformer is similar to the LSTM(cf. Figure 15). However, the HFformer has a smaller gap between the correct buys and correct sells ratios. We will later examine the impact of having a model that flags buy and sell opportunities in a more balanced way. 5.9 Backtesting 5.9.1 Strategies The HFformer and LSTM models were trained on June 2022 data and are now backtested on BTC-USDT LOB snapshots collected over 2 days (July 21st and 22nd, 2022). The backtesting is based on the following assumptions: • No trading fee, which is a realistic assumption as there are no spot trading fees on Binance for the BTC-USDT pair • The delay from receiving the snapshots, processing them, and placing a trade is around 200 ms, which is approximately equivalent to 2 ticks for the LOB snapshots that were collected • The orders are market orders • 0.0002% of the amount bought then sold for long trades (and vice-versa for short trades) is sub- tracted from the Profit and Loss (PnL) to simulate price slippage • A fixed quantity of 0.1 BTC is traded The following trading strategies are considered: 11 51015202530Forecast Horizon0.30.40.50.60.70.80.9RatioHFformer: Ratio of correct buys and sellsHFformer: Ratio of correct sellsHFformer: Ratio of correct buysLSTM: Ratio of correct buys and sellsLSTM: Ratio of correct sellsLSTM: Ratio of correct buys51015202530Forecast Horizon0.30.40.50.60.70.80.91.0Weighted RatioHFformer: Weighted ratio of correct buys and sellsHFformer: Weighted ratio of correct sellsHFformer: Weighted ratio of correct buysLSTM: Weighted ratio of correct buys and sellsLSTM: Weighted ratio of correct sellsLSTM: Weighted ratio of correct buys Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT • Strategy 1: the trading horizon is 28 ticks. We use the HFformer and LSTM models trained on the specific horizon to generate a trade signal. If the signal is positive, we open a long position of 0.1 BTC with a delay of 2 ticks and close it after 28 ticks plus 2 ticks of delay. Similarly, if the signal is negative, we open a short position and proceed with a similar method to the long strategy. While running strategy 1, when we create a scatter plot of profitable and unprofitable trades based on start and end signals, we notice a relationship between the sign of the signals and the profitability of trades (cf. Figure 17). • Strategy 2: the trading horizon is 28 ticks. We use three HFformer and three LSTM models trained on the specific horizon and +/- 2 horizons. Only if all 3 signals are positive, we open a long position of 0.1 BTC with a delay of 2 ticks and close it after 28 ticks plus 2 ticks of delay. Similarly, if all 3 signals are negative, we open a short position and proceed with a similar method to the long strategy. • Strategy 3: similar to Strategy 2, however, instead of using 3 signals to trade, we use 5 signals: signals for horizons 26, 27, 28, 29, and 30. 5.9.2 Results Strategy 1 results in a final PnL of -10.42 USDT and a total of 13,743 trades for the HFformer and in a final PnL of -32.54 USDT and a total of 13,743 trades for the LSTM. From Figure 16 and Figure 17, we notice that most profitable trades happen when the HFformer model outputs start and end signals of the same sign. One possible explanation is that profitable trades occur when the upward or downward trend predicted by the model lasts longer than the forecasting horizon. Therefore, one possible improvement to this trading strategy is to use multiple forecasting horizons to assess whether to go into a trade. The multiple forecasting horizons can include short forecasting horizons (e.g., 26 and 27), which are shorter than the main forecasting horizon (e.g., 28 in strategy 1) to reduce the chance of falsely flagging a trading opportunity. Additionally, longer forecasting horizons (e.g., 29 and 30) can be used to confirm that the upward or downward trend duration will last beyond the trade delay (e.g., 2 ticks in strategy 1). This leads us to strategy 2. Figure 16: Cumulative PnL - Strategy 1 - HFformer vs. LSTM. Figure 17: Relationship between PnL and start and end signals outputted by the model - Strategy 1 - HF- former. Figure 18: Relationship between PnL and start and end signals outputted by the model - Strategy 1 - LSTM. 12 020004000600080001000012000Trades402002040PnLHFformerLSTM0.40.30.20.10.00.10.20.30.4Start Signal0.40.30.20.10.00.10.20.30.4End SignalUnprofitable tradeProfitable trade0.40.30.20.10.00.10.2Start Signal0.40.30.20.10.00.10.2End SignalUnprofitable tradeProfitable trade Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT Strategy 2 results in a final PnL of 120.04 USDT and a total of 11,928 trades for the HFformer and in a final PnL of 9.67 USDT and a total of 12,932 trades for the LSTM. We notice an improvement in the PnL and a reduction in the total number of trades. The total number of trades decreases as all three models with different forecast horizons need to output a signal of the same sign for a trade to occur. Figure 19: Cumulative PnL - Strategy 2 - HFformer vs. LSTM. From Table 1, we see that the correlation between adjacent signals is high but not 1. This allows exploring the option of adding more signals and reducing the number of potentially unprofitable trades by only placing trades when the same signal is exhibited for more models. PnL Signal - 26 Signal - 28 Signal - 30 PnL 1 0.002603 0.007165 -0.002530 Signal - 26 Signal - 28 Signal - 30 1 0.938949 0.852447 1 0.867870 1 Table 1: Correlation table for PnL and signals for forecast horizons of 26, 28, and 30 ticks - HFformer. PnL Signal - 26 Signal - 28 Signal - 30 PnL 1 0.000514 0.005031 0.001102 Signal - 26 Signal - 28 Signal - 30 1 0.968979 0.972374 1 0.970612 1 Table 2: Correlation table for PnL and signals for forecast horizons of 26, 28, and 30 ticks - LSTM. Strategy 3 results in a final PnL of 138.78 USDT and a total of 10,976 trades for the HFformer. By adding two signals, the cumulative PnL has improved by 15.61% compared to strategy 2. As expected, the number of trades decreased by 7.98% compared to strategy 2 and 20.13% compared to strategy 1. Strategy 3 results in a final PnL of 85.71 USDT and a total of 12,226 trades for the LSTM. By adding two signals, the cumulative PnL has improved nine-fold. As expected, the number of trades decreased by 5.46% compared to strategy 2 and 11.04% compared to strategy 1. Comparing Table 3 and Table 4, we notice that the signals for different forecasting horizons of the HFformer are less correlated than the signals generated by the LSTM. Therefore when HFformer signals are combined, we get fewer trades, but these trades exhibit stronger buy or sell signals. As a result, the HFformer signals, on average, result in a higher PnL than the LSTM signals (cf. Figure 19 and Figure 20). 13 020004000600080001000012000Trades250255075100125150PnLHFformerLSTM Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT Figure 20: Cumulative PnL - Strategy 3 - HFformer vs. LSTM. PnL Signal - 26 Signal - 27 Signal - 28 Signal - 29 Signal - 30 PnL 1 0.009710 0.013158 0.004809 0.014907 0.010281 Signal - 26 Signal - 27 Signal - 28 Signal - 29 Signal - 30 1 0.943009 0.860272 0.923525 0.914158 1 0.877412 0.932065 0.919749 1 0.858861 0.861871 1 0.912567 1 Table 3: Correlation table for PnL and signals for forecast horizons of 26, 27, 28, 29, and 30 ticks - HFformer. Signal - 26 Signal - 27 Signal - 28 Signal - 29 Signal - 30 PnL 1 0.007214 0.011843 0.008985 0.007163 0.010961 PnL Signal - 26 Signal - 27 Signal - 28 Signal - 29 Signal - 30 Table 4: Correlation table for PnL and signals for forecast horizons of 26, 27, 28, 29, and 30 ticks - LSTM. 1 0.971106 0.974401 0.957233 0.965258 1 0.972183 0.956653 0.968503 1 0.953691 0.964354 1 0.955223 1 We assess HFformer's performance using 1 to 11 trading signals (cf. Figure 21). The predictions are made for horizon 25 and signals are added progressively by an increment of 1 from each side. We notice an improvement in the cumulative PnL when adding signals. However, after 7 signals the cumulative PnL stagnates. Therefore, for the following experiments we will be using 7 signals. Figure 21: Cumulative PnL - Main horizon 25 - HFformer. 14 020004000600080001000012000Trades250255075100125150PnLHFformerLSTM02000400060008000100001200014000Trades0255075100125150175PnLHFformer: 1 signalHFformer: 3 signalsHFformer: 5 signalsHFformer: 7 signalsHFformer: 9 signalsHFformer: 11 signals Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT 5.9.3 More on Trading Signal Aggregation Figure 22: Trade signal magnitude (top) and correlation between PnL and trade signal magnitude (bottom) - Trade sizing - Main forecasting horizon 25 with 1, 3, 5 and 7 signals - HFformer. From Figure 22, we notice that as we aggregate more signals through summation and then take the absolute value of this sum, the correlation between the PnL and the aggregated signals' magnitude increases (except for the case with five aggregated signals plotted in orange). To perform this comparison, we compute the magnitudes of the aggregated signals and then sort the signals in ascending order. We then compute the correlation between the signal magnitudes and the PnL by batches of 200 observations. Based on these observations, we can improve the trading strategies presented above by using aggregated sums of signals instead of only focusing on the sign of the signals. Additionally, we can disregard trading signals below a certain minimum threshold. 5.9.4 Trade Sizing Figure 23: Cumulative PnL - Trade sizing - Main forecasting horizon 25, 7 signals, and 2 and 5 trade sizing thresholds - HFformer. Finally, we assess HFformer's performance using trade sizing (cf. Figure 23). The trade sizing is done depending on the absolute value of the sum of the trade signals. We use two sets of thresholds: 15 020004000600080001000012000Signal0.00.51.01.52.02.53.0Signal MagnitudeHFformer: signals 22, 23, 24, 25, 26, 27, 28 summedHFformer: signals 23, 24, 25, 26, 27 summedHFformer: signals 24, 25, 26 summedHFformer: signal 2501020304050Signal Magnitude0.150.100.050.000.050.100.15Correlation Between PnL and Signal MagnitudeHFformer: signals 22, 23, 24, 25, 26, 27, 28 summedHFformer: signals 23, 24, 25, 26, 27 summedHFformer: signals 24, 25, 26 summedHFformer: signal 250200040006000800010000Trades050100150200PnLHFformer: 7 signals, without trade sizingHFformer: 7 signals, with trade sizing (2 thresholds)HFformer: 7 signals, with trade sizing (5 thresholds) Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT • 2 thresholds: above the highest threshold 0.15 BTC is traded, 0.1 BTC for the medium threshold, and 0.05 BTC otherwise • 5 thresholds: above the highest threshold, 0.15 BTC is traded, 0.125 BTC for the second highest threshold, 0.1 BTC for the third highest threshold, 0.075 for the fourth highest threshold, 0.05 for the fifth highest threshold, and 0.025 BTC otherwise The thresholds above were chosen by observing the distribution of outputted signals using training data. For this experiment, we use 7 signals with a main forecasting horizon of 25 ticks. We notice an increase in the cumulative PnL when using trade sizing. The standard deviation of the cumulative PnL increases from 0.49 USDT without trade sizing to 0.58 USDT with trade sizing using 2 thresholds. However, when the number of thresholds for trade sizing is increased to 5, the PnL does not increase significantly, but the standard deviation of the PnL drops to 0.41 USDT. A lower standard deviation of the PnL will yield a better Sharpe ratio long-term and reduce the volatility of the high-frequency strategy. Moreover, from Figure 24, we notice that the ratio of trades with a positive PnL over the total number of trades (i.e., the ratio of winning trades) increases as the magnitude of the trading signal increases in line with previous observations. Therefore, one proposed improvement to the trading strategy is to increase the quantity traded proportionally to the strength of the trading signal. Finally, we complement the existing trading strategy from Figure 23 with a minimal threshold require- ment for a trade to occur. The minimal threshold is set using training data observations. As previously, we compute the sum of trading signals from the models and take the absolute value. The minimal trad- ing threshold is proportional to the number of signals. From Figure 25 we notice an improvement in the cumulative PnL by 4.53% and a decrease in the number of trades from 11,485 to 8,851. Figure 24: Wining trades ratio - Trade sizing - Main forecasting horizon 25, 7 signals, and 2 and 5 trade sizing thresholds - HFformer. Figure 25: Cumulative PnL - Trade sizing with minimal threshold - Main forecasting horizon 25, 7 signals, and 5 trade sizing thresholds - HFformer. 16 0.020.040.060.080.100.120.14Quantity Traded0.4850.4900.4950.5000.5050.5100.5150.520Ratio of Winning TradesHFformer: 7 signals, 5 thresholdsHFformer: 7 signals, 2 thresholds0.020.040.060.080.100.120.14Quantity Traded0100020003000400050006000Total TradesHFformer: 7 signals, 5 thresholdsHFformer: 7 signals, 2 thresholds0200040006000800010000Trades050100150200PnLHFformer: 7 signals, with trade sizing (5 thresholds) and minimal thresholdHFformer: 7 signals, with trade sizing (5 thresholds) Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT 6 Legal and Ethical Considerations The strategies and models presented in this paper are purely for scientific research and curiosity. Algorithmic trading may result in capital loss and requires continuous risk monitoring. The strategies should first be paper traded, and various risks should be assessed (e.g., price, liquidity, compliance, and regulatory risks) before being deployed in live trading. Simplifications to the trading environment have been made during backtesting for this paper. Therefore, results may vary significantly if the models are deployed live. Moreover, machine learning methods are evaluated based on classification and regression metrics without rigorous mathematical proofs, unlike statistical methods. As a result, machine learning methods' performance can significantly vary depending on the input data and could lead to unexpected model outputs. Algorithmic trading is regulated by financial authorities (e.g., Financial Industry Regulatory Authority and Security Exchange Commission for US securities). Regulatory risks need to be considered and monitored when trading in financial markets. The trading strategies need to be reviewed and monitored to be in accordance with continuously changing market regulations. 7 Limitations and Future Lines of Research The HFformer and LSTM results were achieved using a simplified backtesting environment, which did not account for factors including: • the impact of the executed order on the market • the actual execution price; this is set to the weighted midprice in our model • the available BTC quantities; the executed quantity is 0.1 BTC • any connection issues; the data was fed into the model at the same rate • trading fees; the trading fee was set to zero, which is a realistic assumption for the BTC-USDT pair on Binance. However, trading on traditional exchanges usually requires paying a transaction fee • a longer backtesting period; the backtesting period is 2 days The following future lines of research can be undertaken: • Improve the LOB snapshot pre-processing pipeline to reduce the noisiness of the data with auto- mated feature selection by using autoencoders [32] • Perform a more extensive performance assessment of the HFformer on large forecast horizons and use altcoin trading pairs such as ETH-USDT • Implement the HFformer with other types of Attention modules such as auto-correlation Attention [15] • Implement a more realistic backtesting environment that accounts for the impact of the placed order and emulates the activity of other participants in the market to assess the performance of the HFformer • Test the HFformer's forecasting performance on traditional financial data by using LOB data from other papers focused on LOB deep learning models for midprice forecasting of traditional assets[10] 8 Conclusion This paper studied the LSTM, Transformer, Autoformer, FEDformer, TFT, and HFformer deep learning archi- tectures for high-frequency FTS forecasting. Through experimentation, we combined various components of multiple Transformer architectures to form the HFformer, a Transformer-like architecture adapted for HFT. When testing the LSTM and HFformer models, we achieved a higher R2 score than the other deep learning architectures for log-returns forecasting from 1 to 30 ticks ahead. Moreover, the LSTM and HFformer models achieved similar performance for classification tasks. Finally, the LSTM and HFformer models were backtested on different trading strategies involving 1, 3, and 5 trade signals. As a result, it was found that using more than 1 trade signal decreases the number of trades and increases the cumulative PnL of a long-short trading strategy. The HFformer, which uses the multi-head Attention mechanism, generates long and short trade signals that result in a more balanced trading strategy than the LSTM. Moreover, the trade signals generated by the HFformer for different forecasting horizons are less correlated than the LSTM signals. As a result, a trading 17 Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT strategy that combines multiple trade signals around a given forecasting horizon was proposed. This trading strategy reduces the false positive trade signals by only engaging in trades when all signals are of the same sign, which results in higher cumulative PnLs and fewer trading fees. Finally, the proposed trading strategies were complemented with trade sizing to improve the cumulative PnL. By using different trading quantities based on the strength of the trading signal, the cumulative PnL increased, and in some cases, the volatility of the trading strategy decreased. Additionally, ignoring trade signals below a predefined minimal threshold reduced the total number of trades and positively contributed to the average trade PnL. Although these improvements and strategies have been backtested on a large amount of BTC-USDT LOB data collected over 2 days and a month after the training and validation data, these methods may yield different results when trading another cryptocurrency pair or financial asset. Additionally, machine learning methods may sometimes be less generalizable than traditional statistical methods as the machine learning methods are data-driven. References [1] Box GE, Jenkins GM, Reinsel GC, Ljung GM. Time series analysis: forecasting and control. John Wiley & Sons; 2015. pages 1 [2] Engle RF. Autoregressive conditional heteroscedasticity with estimates of the variance of United King- dom inflation. Econometrica: Journal of the econometric society. 1982:987-1007. pages 1 [3] Rumelhart DE, Hinton GE, Williams RJ. Learning internal representations by error propagation. Cali- fornia Univ San Diego La Jolla Inst for Cognitive Science; 1985. pages 1 [4] Hochreiter S, Schmidhuber J. Long short-term memory. Neural computation. 1997;9(8):1735-80. pages 1 [5] LeCun Y, Bengio Y, Hinton G. Deep learning. nature. 2015;521(7553):436-44. pages 1 [6] Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, et al. Attention is all you need. Advances in neural information processing systems. 2017;30. pages 1, 5 [7] Bahdanau D, Cho K, Bengio Y. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:14090473. 2014. pages 1 [8] Liu Z, Lin Y, Cao Y, Hu H, Wei Y, Zhang Z, et al. Swin transformer: Hierarchical vision transformer using shifted windows. In: Proceedings of the IEEE/CVF International Conference on Computer Vision; 2021. p. 10012-22. pages 1 [9] Tsay RS. Analysis of financial time series. John wiley & sons; 2005. pages 1 [10] Kolm PN, Turiel J, Westray N. Deep Order Flow Imbalance: Extracting Alpha at Multiple Horizons from the Limit Order Book. Available at SSRN 3900141. 2021. pages 1, 2, 17 [11] Qin Y, Song D, Chen H, Cheng W, Jiang G, Cottrell G. A dual-stage attention-based recurrent neural network for time series prediction. arXiv preprint arXiv:170402971. 2017. pages 1, 2 [12] Cartea ́A, Jaimungal S, Penalva J. Algorithmic and high-frequency trading. Cambridge University Press; 2015. pages 2 [13] Sezer OB, Gudelek MU, Ozbayoglu AM. Financial time series forecasting with deep learning: A sys- tematic literature review: 2005–2019. Applied soft computing. 2020;90:106181. pages 2 [14] Pascanu R, Mikolov T, Bengio Y. On the difficulty of training recurrent neural networks. In: Interna- tional conference on machine learning. PMLR; 2013. p. 1310-8. pages 2 [15] Xu J, Wang J, Long M, et al. Autoformer: Decomposition transformers with auto-correlation for long- term series forecasting. Advances in Neural Information Processing Systems. 2021;34. pages 2, 3, 7, 17 [16] Zhou T, Ma Z, Wen Q, Wang X, Sun L, Jin R. FEDformer: Frequency enhanced decomposed transformer for long-term series forecasting. arXiv preprint arXiv:220112740. 2022. pages 2, 3 [17] Angel J. Retail Investors Get a Sweet Deal: The Cost of a SIP of Stock Market Data. Available at SSRN 3268916. 2018. pages 2 [18] Hautsch N. Modelling irregularly spaced financial data: theory and practice of dynamic duration models. vol. 539. Springer Science & Business Media; 2011. pages 2 18 Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT [19] Ariyo AA, Adewumi AO, Ayo CK. Stock price prediction using the ARIMA model. In: 2014 UKSim- AMSS 16th International Conference on Computer Modelling and Simulation. IEEE; 2014. p. 106-12. pages 2 [20] Franses PH, Van Dijk D. Forecasting stock market volatility using (non-linear) Garch models. Journal of forecasting. 1996;15(3):229-35. pages 2 [21] Fischer T, Krauss C. Deep learning with long short-term memory networks for financial market predic- tions. European Journal of Operational Research. 2018;270(2):654-69. pages 2 [22] Lim B, Zohren S. Time-series forecasting with deep learning: a survey. Philosophical Transactions of the Royal Society A. 2021;379(2194):20200209. pages 2 [23] Gao K, Luk W, Weston S. High-Frequency Trading and Financial Time-Series Prediction with Spiking Neural Networks. Wilmott. 2021;2021(113):18-33. pages 2 [24] Wang Y, Huang M, Zhu X, Zhao L. Attention-based LSTM for aspect-level sentiment classification. In: Proceedings of the 2016 conference on empirical methods in natural language processing; 2016. p. 606-15. pages 2 [25] Wu N, Green B, Ben X, O'Banion S. Deep transformer models for time series forecasting: The influenza prevalence case. arXiv preprint arXiv:200108317. 2020. pages 2 [26] Kazemi SM, Goel R, Eghbali S, Ramanan J, Sahota J, Thakur S, et al. Time2vec: Learning a vector representation of time. arXiv preprint arXiv:190705321. 2019. pages 2 [27] Li S, Jin X, Xuan Y, Zhou X, Chen W, Wang YX, et al. Enhancing the locality and breaking the mem- ory bottleneck of transformer on time series forecasting. Advances in Neural Information Processing Systems. 2019;32. pages 3 [28] Lim B, Arik SO, Loeff N, Pfister T. Temporal fusion transformers for interpretable multi-horizon time series forecasting. arXiv preprint arXiv:191209363. 2019. pages 3 [29] Ba JL, Kiros JR, Hinton GE. Layer normalization. arXiv preprint arXiv:160706450. 2016. pages 6 [30] Irie K, Zeyer A, Schl ̈uter R, Ney H. Language modeling with deep transformers. arXiv preprint arXiv:190504226. 2019. pages 8 [31] Loshchilov I, Hutter F. Decoupled weight decay regularization. arXiv preprint arXiv:171105101. 2017. pages 9 [32] Han K, Wang Y, Zhang C, Li C, Xu C. Autoencoder inspired unsupervised feature selection. In: 2018 IEEE international conference on acoustics, speech and signal processing (ICASSP). IEEE; 2018. p. 2941-5. pages 17 The following Github repositories were used to build the deep learning models: • LSTM: https://github.com/lkulowski/LSTM encoder decoder • Transformer: https://github.com/AIStream-Peelout/flow-forecast • Autoformer and FEDformer: https://github.com/cure-lab/DLinear • Spiking activation: https://github.com/nengo/pytorch-spiking 9 Appendix The training of the deep learning models was done on Google Colab4 using an Nvidia P100 GPU. The training LOB data for the USDT-BTC trading pair collected from Binance's API can be found below: • raw LOB data: https://drive.google.com/drive/folders/1GXXiVyXXCXenNsGWRAmMb Xd1Xvf- lZq5?usp=sharing • processed LOB YkL5W5YhKOLHw?usp=sharing data: https://drive.google.com/drive/folders/1GVJ050lVeS6vFjZ9CER The hyperparameters that were used to train the LSTM, Transformer, Autoformer, FEDformer, and HF- former models were found through grid search and are listed below: 4The Google Colab platform can be found at https://colab.research.google.com/notebooks/. 19 Exploring the Advantages of Transformers for High-Frequency Trading A PREPRINT Model Layers Activation Func- tion Optimizer Loss Function Batch Size LSTM 5 layers size 16 PReLU PReLU GELU GELU Transformer Autoformer FEDformer HFformer and 1 1 encoder decoder size 128 with 8 Attention heads both 2 encoders and 2 de- coders both of size 128 with 8 Attention length label heads, 50, and factor 3 2 encoders and 2 decoders both of size 128 with 8 Attention heads, length label 50, and Legendre base en- 1 Transformer coder and 1 linear decoder size 64 with 6 Attention heads both AdamW with 0.001 learning rate AdamW with 0.0001 learning rate MSE MSE 64 64 AdamW with 0.0002 learning rate MSE 256 AdamW with 0.0005 learning rate MSE 256 Spiking PReLU with AdamW with 0.04 learning rate MSE 256 Table 5: LSTM, Transformer, Autoformer, FEDformer, and HFformer hyperparameters. 20
http://arxiv.org/abs/2302.09838v1
2023-02-20T08:55:00
2023-02-20T08:55:00
JNDMix: JND-Based Data Augmentation for No-reference Image Quality Assessment
Despite substantial progress in no-reference image quality assessment (NR-IQA), previous training models often suffer from over-fitting due to the limited scale of used datasets, resulting in model performance bottlenecks. To tackle this challenge, we explore the potential of leveraging data augmentation to improve data efficiency and enhance model robustness. However, most existing data augmentation methods incur a serious issue, namely that it alters the image quality and leads to training images mismatching with their original labels. Additionally, although only a few data augmentation methods are available for NR-IQA task, their ability to enrich dataset diversity is still insufficient. To address these issues, we propose a effective and general data augmentation based on just noticeable difference (JND) noise mixing for NR-IQA task, named JNDMix. In detail, we randomly inject the JND noise, imperceptible to the human visual system (HVS), into the training image without any adjustment to its label. Extensive experiments demonstrate that JNDMix significantly improves the performance and data efficiency of various state-of-the-art NR-IQA models and the commonly used baseline models, as well as the generalization ability. More importantly, JNDMix facilitates MANIQA to achieve the state-of-the-art performance on LIVEC and KonIQ-10k.
[ "Jiamu Sheng", "Jiayuan Fan", "Peng Ye", "Jianjian Cao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09838v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09838v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.LG" ]
JNDMIX: JND-BASED DATA AUGMENTATION FOR NO-REFERENCE IMAGE QUALITY ASSESSMENT Jiamu Sheng1, Jiayuan Fan∗1, Peng Ye2, Jianjian Cao2 1Academy for Engineering and Technology, Fudan University, Shanghai, China 2School of Information Science and Technology, Fudan University, Shanghai, China 3 2 0 2 b e F 0 2 ] V C . s c [ 1 v 8 3 8 9 0 . 2 0 3 2 : v i X r a ABSTRACT Despite substantial progress in no-reference image quality assessment (NR-IQA), previous training models often suffer from over-fitting due to the limited scale of used datasets, resulting in model performance bottlenecks. To tackle this challenge, we explore the potential of leveraging data aug- mentation to improve data efficiency and enhance model ro- bustness. However, most existing data augmentation methods incur a serious issue, namely that it alters the image quality and leads to training images mismatching with their original labels. Additionally, although only a few data augmentation methods are available for NR-IQA task, their ability to en- rich dataset diversity is still insufficient. To address these issues, we propose a effective and general data augmentation based on just noticeable difference (JND) noise mixing for NR-IQA task, named JNDMix. In detail, we randomly inject the JND noise, imperceptible to the human visual system (HVS), into the training image without any adjustment to its label. Extensive experiments demonstrate that JNDMix significantly improves the performance and data efficiency of various state-of-the-art NR-IQA models and the commonly used baseline models, as well as the generalization ability. More importantly, JNDMix facilitates MANIQA to achieve the state-of-the-art performance on LIVEC and KonIQ-10k. Index Terms- No-reference image quality assessment, Data augmentation, Just noticeable difference 1. INTRODUCTION No-reference image quality assessment (NR-IQA) is a sig- nificant task to automatically predict image quality scores without using reference image information. With the de- velopment of deep learning techniques, a large number of learning-based NR-IQA methods achieve good performance. Using pre-trained models based on a large-scale dataset like ImageNet [1] can help NR-IQA models to extract relevant features for distorted images with the limited scale of used ∗Corresponding author. This work was supported in part by the National Natural Science Foun- dation of China under Grant 62101137 and Grant 62071127, and in part by the Zhejiang Lab Project under Grant 2021KH0AB05. Fig. 1: An original image is processed by five different data augmentation methods. Visually, the other four data augmen- tation methods cause highly noticeable image quality degra- dation, except JNDMix. datasets. Therefore, many recent works [2, 3, 4, 5, 6] utilize ImageNet pre-trained backbone to achieve the state-of-the-art performance on the NR-IQA benchmarks. A key challenge of learning-based NR-IQA methods is the lack of sufficiently large labeled datasets, as manu- ally annotating image quality labels is expensive and time- consuming. As a result, the learning-based NR-IQA methods usually suffer from over-fitting when training deep models [7]. To some extent, using pre-trained models can allevi- ate this issue, but this metric is not specifically designed for NR-IQA task, and the model performance bottleneck still exists. Therefore, it is necessary to design a novel approach to improve the data efficiency of the NR-IQA model. Data augmentation is a practical and simple way to im- prove generalizability and data efficiency of models, which can effectively alleviate the above problems on NR-IQA task. So far, data augmentation methods are widely used in various vision tasks, that include geometric transformations (e.g., ran- dom cropping [8], horizontal flipping [9], cutout [10]), color space transformations (e.g., color jittering [11]), mixing im- ages (e.g., mixup [12], CutMix [13]), resizing [14], noise in- jection [15], etc. Unfortunately, most of data augmentation methods mentioned above, are mainly developed for specific vision tasks and not available for the NR-IQA task, since the highly noticeable image quality degradation is caused [16]. a)Original imagef)JNDMixb)Resize(224x224)e)Random crop(224x224)d)Cutoutc)Gaussian noise As shown in Fig. 1, noise injection with Gaussian noise di- rectly introduces distortions to the image; resizing, cutout and random cropping can impact image composition, thus alter- ing the image quality. Although a few augmentation methods such as horizontal flipping and random cropping are widely used in NR-IQA task [17], they are not specifically designed for NR-IQA task and are still limited in their effectiveness in enriching dataset diversity. More seriously, random cropping leads to the loss of image information and introduces geomet- ric deformation, resulting in generated patches mismatching with their labels, while existing models using random crop- ping ignore the above problem and still use the original labels to train. Hence, a general and effective data augmentation method is urgently needed for the NR-IQA task. Intuitively, it is reasonable that the noise injection aug- mentation without noticeable image quality degradation is suitable for NR-IQA task. As the characteristic of the human visual system (HVS), just noticeable difference (JND) is de- fined as the minimum visual content changes that human can perceive [18]. Namely, for each pixel, JND is a threshold, and the HVS will not perceive any changes under it. Hence, we believe the change under JND as a kind of noise, named JND noise, which can be used in noise injection augmentation. In NR-IQA datasets, the labels are the quality of images subjec- tively scored by the human. Due to the imperceptibility of JND noise, the image injecting JND noise will have the same subjective quality score as the original image. In this paper, we are the first to propose a general data augmentation method based on JND noise mixing (JNDMix) specifically for NR-IQA task. In detail, we randomly inject JND noise to the training image, and it will not alter the im- age quality visually so that the generated image can remain the original label. The seminal proposal of JNDMix tack- les the long-standing problem with existing data augmenta- tion methods available for NR-IQA task, in particular, further enriching the diversity of training images. Hence, JNDMix can help NR-IQA models effectively to improve model per- formance while enhancing data efficiency over previous state- of-the-art methods. We conduct extensive experiments on two IQA benchmarks, LIVEC and KonIQ-10k. And the results demonstrate that JNDMix bring the significant improvements in performance and data efficiency of various state-of-the-art NR-IQA models and baseline models. More importantly, our proposed JNDMix helps MANIQA to achieve the state-of- the-art performance on LIVEC and KonIQ-10k. The cross- dataset evaluation results also verify the great generalization ability of our proposed method for NR-IQA models. Besides, our approach is general and can be flexibly added to any NR- IQA method. 2. METHOD In this section, we will present the details of our proposed general data augmentation method, depicted in Fig. 2. Fig. 2: Overview of JNDMix data augmentation workflow. 2.1. Random JND Noise Injection Procedure Let x ∈ RW ×H×C and y denote an original training image and its label, respectively. The goal of JNDMix is to generate a new training image ̃x and its associated label ̃y. The origi- nal training image x and the associated generated JND image xjnd are formed into an image pair to jointly generate a new training image. Firstly, each pixel of the JND image xjnd is multiplied by the random ratio λ to generate a random JND noise xjnd where each pixel is less than the JND threshold. Then we inject our random JND noise xjnd into the associated training image. For each pixel, the injection noise can either add the noise to the original pixel value or subtract the noise, so we have to multiply a random matrix r ∈ RW ×H×C that is random on each pixel, with only 1 and −1. Finally, the novel training image, named JND distorted image, is gener- ated after the above process. This random JND noise injection procedure can be formulated as follows: xnoise = λxjnd ̃x = x ⊕ (r * xnoise) (1) (2) where ⊕ is element-wise sum. (*) is element-wise product. Random ratio λ is sampled from the uniform distribution (0, 1). 2.2. Model Training In the training phase, the generated JND distorted image ̃x re- places the original training image x in the model, but we do not need to adjust the associated quality score label y. The image quality scores in the dataset are obtained by subjective human scoring, while JND noise can not be perceived by hu- mans theoretically, so the subjective scores of JND distorted image will not change. Thus, the following equation is ob- tained: ̃y = y (3) Then, the new training sample ( ̃x, ̃y) generated by JNDMix is used to train the model with its original training settings and loss function. In each training iteration, each JNDMix-ed sample ( ̃x, ̃y) is generated by multiplying the JND image by a resampled random ratio to enrich the training sample's di- versity, and diverse training samples reduce over-fitting. Our method is very general and concise, so it can be flexibly added to any NR-IQA method. ImageJND ImageRandom Ratio ∈0,1Random Matrix ∈−1,1JND DistortedImageJND Noise⨁⨂⨂ Table 1: Model performance improvements with JNDMix across different state-of-the-art models. Table 3: Data-efficiency improvements with JNDMix in the state-of-the-art models HyperIQA and DBCNN. Method DBCNN (100%) w/ JNDMix HyperIQA (100%) w/ JNDMix MANIQA (100%) w/ JNDMix LIVEC KonIQ-10k SRCC 0.851 0.854 +0.003 0.859 0.870 +0.011 0.886 0.897 +0.011 PLCC 0.869 0.876 +0.007 0.882 0.883 +0.001 0.908 0.918 +0.010 SRCC 0.906 0.915 +0.009 0.906 0.911 +0.005 0.923 0.927 +0.004 PLCC 0.923 0.930 +0.007 0.917 0.924 +0.007 0.941 0.943 +0.002 Table 2: Model performance improvements with JNDMix across different baseline models. Method Resnet34 (100%) w/ JNDMix Resnet50 (100%) w/ JNDMix ViT (100%) w/ JNDMix LIVEC KonIQ-10k SRCC 0.824 0.842 +0.018 0.838 0.851 +0.013 0.776 0.815 +0.039 PLCC 0.849 0.868 +0.019 0.868 0.872 +0.004 0.816 0.858 +0.042 SRCC 0.905 0.910 +0.005 0.916 0.920 +0.004 0.901 0.906 +0.005 PLCC 0.920 0.928 +0.008 0.931 0.932 +0.001 0.915 0.923 +0.008 Method HyperIQA (100%) w/ JNDMix HyperIQA (50%) w/ JNDMix HyperIQA (25%) w/ JNDMix HyperIQA (10%) w/ JNDMix DBCNN (100%) w/ JNDMix DBCNN (50%) w/ JNDMix DBCNN (25%) w/ JNDMix DBCNN (10%) w/ JNDMix LIVEC KonIQ-10k SRCC 0.859 0.870 +0.011 0.820 0.821 +0.001 0.787 0.790 +0.003 0.700 0.740 +0.040 0.851 0.854 +0.003 0.814 0.815 +0.001 0.764 0.787 +0.023 0.699 0.718 +0.019 PLCC 0.882 0.883 +0.001 0.843 0.855 +0.012 0.809 0.818 +0.009 0.736 0.773 +0.037 0.869 0.876 +0.007 0.843 0.849 +0.006 0.793 0.812 +0.019 0.740 0.756 +0.016 SRCC 0.906 0.911 +0.005 0.892 0.902 +0.010 0.880 0.885 +0.005 0.851 0.861 +0.010 0.906 0.915 +0.009 0.902 0.907 +0.005 0.888 0.893 +0.005 0.869 0.873 +0.004 PLCC 0.917 0.924 +0.007 0.908 0.913 +0.005 0.896 0.900 +0.004 0.866 0.874 +0.008 0.923 0.930 +0.007 0.918 0.924 +0.006 0.907 0.910 +0.003 0.889 0.893 +0.004 3. EXPERIMENTS 3.1. Experimental Settings Datasets and Evaluation Metrics. We assess different NR-IQA models and JNDMix on two commonly used IQA datasets: LIVEC [19] and KonIQ-10k [20]. LIVEC contains 1162 images taken in the real world by various photos using various camera devices, resulting in complex and composite distortions. KonIQ-10k consists of 10073 images chosen from the large public multimedia dataset YFCC100m[21]. Two commonly used evaluation metrics Spearman's rank order correlation coefficient (SRCC) and Pearson's linear cor- relation coefficient (PLCC) are adopted to evaluate the perfor- mance of NR-IQA models. These datasets are randomly split into 80% images for training, and 20% images for testing. In data-efficient ex- periments, we always use the 20% images for testing regard- less of different fractions of the training dataset. We conduct 10 times of this random dataset splitting operation for each experiment and the average SRCC and PLCC values are re- ported to evaluate performance. Models and Implementation Details. To evaluate our pro- posed data augmentation method, we utilize JNDMix on these three representative state-of-the-art NR-IQA models: DBCNN [2], HyperIQA [3], MANIQA [4]. Also, three base- line models are adopted to evaluate JNDMix effectiveness: Resnet34, Resnet50 [22] and Vision Transformer (ViT) [23], which are pretrained on ImageNet [1]. The JND images are generated by RGB-JND [24] model to generate JND noise. For rigorous comparison, the training settings for all models trained with JNDMix are the same as without it, including learning rate schedule, weight decay, data pre-processing and augmentations, etc. For three state-of-the-art models, we uti- lize their original codebases and training settings to train. For Resnet34 and Resnet50, we utilize AdamW [25] optimization with a mini-batch of 24, and set the base learning rate to 5e-5 with a cosine decay schedule. For ViT, we utilize AdamW optimization with a mini-batch of 8, and set base learning rate to 1e-5 with a cosine decay schedule. 3.2. JNDMix improves IQA benchmarks state-of-the-art We train three representative state-of-the-art models in NR- IQA task, DBCNN, HyperIQA, and MANIQA, to study if JNDMix can improve state-of-the-art NR-IQA models on two IQA benchmarks, LIVEC and KonIQ-10k. Table 1 shows the results of applying JNDMix on the state-of-the-art mod- els. All models using JNDMix have significant improvements based on their original state-of-the-art performance. Specifi- cally, it provides a gain of +0.011 SRCC and +0.01 PLCC on LIVEC, resulting in MANIQA with the state-of-the-art per- formance of 0.897 SRCC and 0.918 PLCC on LIVEC, as well as achieve the state-of-the-art performance of 0.927 SRCC and 0.943 PLCC on KonIQ-10k. Additionally, we reveal that JNDMix improves the per- formance of baseline models such as Resnet34, Resnet50 and Vision Transformer (ViT). Table 2 illustrates that we get ex- cellent improvements over these baseline models. JNDMix improves ViT from 0.816 to 0.858 with a gain of +0.042 in Table 4: Data-efficiency improvements with JNDMix in the baseline models Resnet34 and Resnet50. Method Resnet34 (100%) w/ JNDMix Resnet34 (50%) w/ JNDMix Resnet34 (25%) w/ JNDMix Resnet34 (10%) w/ JNDMix Resnet50 (100%) w/ JNDMix Resnet50 (50%) w/ JNDMix Resnet50 (25%) w/ JNDMix Resnet50 (10%) w/ JNDMix LIVEC KonIQ-10k SRCC 0.824 0.834 +0.010 0.788 0.811 +0.023 0.738 0.758 +0.020 0.635 0.674 +0.039 0.835 0.842 +0.007 0.801 0.812 +0.011 0.751 0.767 +0.016 0.657 0.681 +0.024 PLCC 0.849 0.855 +0.006 0.816 0.834 +0.018 0.746 0.766 +0.020 0.609 0.653 +0.044 0.868 0.872 +0.004 0.827 0.840 +0.013 0.768 0.794 +0.026 0.682 0.695 +0.013 SRCC 0.905 0.910 +0.005 0.890 0.898 +0.008 0.869 0.881 +0.012 0.850 0.859 +0.009 0.916 0.920 +0.004 0.902 0.910 +0.008 0.886 0.892 +0.006 0.863 0.868 +0.005 PLCC 0.920 0.928 +0.008 0.908 0.914 +0.006 0.888 0.900 +0.012 0.871 0.878 +0.007 0.931 0.932 +0.001 0.917 0.923 +0.006 0.902 0.908 +0.006 0.880 0.884 +0.004 PLCC on LIVEC, and also achieves a great improvement on Resnet34 with a gain of +0.019 PLCC. 3.3. JNDMix helps data-efficiency In this section, we demonstrate that JNDMix is effective to improve model performance across different dataset sizes and helps data efficiency of models. Table 3 illustrates that JNDMix always improves the perfomance of HyperIQA and DBCNN across all fractions of LIVEC and KonIQ-10k, which implies the data efficiency improvement of the state-of- the-art models. JNDMix provides a surprising improvement of +0.04 SRCC in the low data regime (10% of data) while still being effective with a improvement of +0.007 PLCC in the high data regime on LIVEC. We detect that the per- formance growth brought by JNDMix is increasing with the decrease of the dataset sizes, which is also reflected in the difference in performance improvements between the two datasets, where the images of LIVEC is 10 times less than those of KonIQ-10k. Table 4 reveals that JNDMix also greatly helps data efficiency of baseline models with the maximum gain of +0.044 PLCC in the low data regime (10% of data). 3.4. JNDMix improves generalization ability To show the generaliazation ability of NR-IQA models, the cross dataset evaluations are performed. We train MANIQA on different fractions of KonIQ-10k and test it on LIVEC. Ta- ble 5 proves that JNDMix is effective to improve generaliza- tion ability of NR-IQA models across different dataset sizes. Table 5: Results of cross dataset evaluations trained on dif- ferent fractions of datasets adopting the state-of-the-art model MANIQA. Training Testing KonIQ-10k LIVEC LIVEC KonIQ-10k Method MANIQA (100%) w/ JNDMix MANIQA (50%) w/ JNDMix MANIQA (25%) w/ JNDMix MANIQA (10%) w/ JNDMix MANIQA (100%) w/ JNDMix SRCC 0.844 0.856 +0.012 0.837 0.843 +0.006 0.828 0.837 +0.009 0.797 0.808 +0.011 0.790 0.803 +0.013 PLCC 0.868 0.880 +0.012 0.858 0.863 +0.005 0.854 0.862 +0.008 0.828 0.836 +0.008 0.849 0.861 +0.012 Table 6: Performance of MANIQA with different noise in- jection on 100% LIVEC. Method MANIQA w/ JNDMix w/ JND injection w/ Gaussian noise injection SRCC PLCC 0.908 0.886 0.918 0.897 0.911 0.891 0.825 0.796 3.5. Ablation Study To study the contribution of JND noise injection, we conduct ablation study by injecting different noises. Table 6 shows the performance of MANIQA with different noise injection trained on 100% LIVEC. 'JND injection' means we do not use JND noise generated by multiplying the JND image with a resampled random ratio, but directly add the JND image to the training image. 'Gaussian noise injection' means we in- ject the Gaussian noise to generate the new training image. The results reveal that injecting Gaussian noise leads to per- formance degradation and adding the JND image results in smaller improvement than JNDMix. 4. CONCLUSION Data augmentation is vital to many vision tasks, and however, no effective data augmentation method specifically designed for NR-IQA task is proposed. In this paper, we are the first to propose a general data augmentation method for NR-IQA task, and rigorously study the JNDMix, finding it highly ef- fective and general. JNDMix works well across a variety of different model architectures and helps their data efficiency, both on LIVEC and KonIQ-10k. The JNDMix augmenta- tion method is simple and can be flexibly plugged into any NR-IQA model codebase. We wish that our method will be widely used in NR-IQA task and the lack of data augmenta- tion methods in NR-IQA task will receive attention. 5. REFERENCES [1] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei, "Imagenet: A large-scale hierarchical image database," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2009, pp. 248–255. [2] Weixia Zhang, Kede Ma, Jia Yan, Dexiang Deng, and Zhou Wang, "Blind image quality assessment using a deep bilinear convolutional neural network," IEEE Transactions on Circuits and Systems for Video Technology, vol. 30, no. 1, pp. 36–47, 2018. [3] Shaolin Su, Qingsen Yan, Yu Zhu, Cheng Zhang, Xin Ge, Jin- qiu Sun, and Yanning Zhang, "Blindly assess image quality in the wild guided by a self-adaptive hyper network," in Pro- ceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020, pp. 3667–3676. [4] Sidi Yang, Tianhe Wu, Shuwei Shi, Shanshan Lao, Yuan Gong, Mingdeng Cao, Jiahao Wang, and Yujiu Yang, "MANIQA: Multi-dimension Attention Network for No-Reference Image Quality Assessment," in Proceedings of the IEEE/CVF Con- ference on Computer Vision and Pattern Recognition, 2022, pp. 1191–1200. [5] Peng Ye, Baopu Li, Yikang Li, Tao Chen, Jiayuan Fan, and "b-DARTS: Beta-Decay Regularization for Wanli Ouyang, in Proceedings of the Differentiable Architecture Search," IEEE/CVF Conference on Computer Vision and Pattern Recog- nition. IEEE, 2022, pp. 10874–10883. [6] Peng Ye, Baopu Li, Tao Chen, Jiayuan Fan, Zhen Mei, Chen Lin, Chongyan Zuo, Qinghua Chi, and Wanli Ouyang, "Effi- cient joint-dimensional search with solution space regulariza- tion for real-time semantic segmentation," International Jour- nal of Computer Vision, vol. 130, no. 11, pp. 2674–2694, 2022. [7] Hancheng Zhu, Leida Li, Jinjian Wu, Weisheng Dong, and Guangming Shi, "MetaIQA: Deep meta-learning for no- reference image quality assessment," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recog- nition, 2020, pp. 14143–14152. [8] Chun-Hsiao Yeh, Cheng-Yao Hong, Yen-Chi Hsu, and Tyng- Luh Liu, "SAGA: Self-Augmentation with Guided Attention for Representation Learning," in IEEE International Confer- ence on Acoustics, Speech and Signal Processing. IEEE, 2022, pp. 3463–3467. [9] Niall McLaughlin, Jesus Martinez Del Rincon, and Paul Miller, "Data-augmentation for reducing dataset bias in person re- identification," in IEEE International conference on advanced video and signal based surveillance. IEEE, 2015, pp. 1–6. [10] Terrance DeVries and Graham W Taylor, "Improved regular- ization of convolutional neural networks with cutout," arXiv preprint arXiv:1708.04552, 2017. [11] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Van- houcke, and Andrew Rabinovich, "Going deeper with convo- lutions," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2015, pp. 1–9. [12] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz, "mixup: Beyond Empirical Risk Minimization," in International Conference on Learning Representations, 2018. [13] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo, "Cutmix: Regular- ization strategy to train strong classifiers with localizable fea- tures," in Proceedings of the IEEE/CVF international confer- ence on computer vision, 2019, pp. 6023–6032. [14] Ross Girshick, Ilija Radosavovic, Georgia Gkioxari, Piotr Doll ́ar, and Kaiming He, "Detectron," 2018. [15] Francisco J Moreno-Barea, Fiammetta Strazzera, Jos ́e M Jerez, Daniel Urda, and Leonardo Franco, "Forward noise adjustment scheme for data augmentation," in IEEE symposium series on computational intelligence. IEEE, 2018, pp. 728–734. [16] Junjie Ke, Qifei Wang, Yilin Wang, Peyman Milanfar, and Feng Yang, "Musiq: Multi-scale image quality transformer," in Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021, pp. 5148–5157. [17] Qingsen Yan and Dong Gong, "Two-stream convolutional net- works for blind image quality assessment," IEEE Transactions on Image Processing, vol. 28, no. 5, pp. 2200–2211, 2018. [18] Charles F Hall and Ernest L Hall, "A nonlinear model for the spatial characteristics of the human visual system," IEEE Transactions on systems, man, and cybernetics, vol. 7, no. 3, pp. 161–170, 1977. [19] Deepti Ghadiyaram and Alan C Bovik, "Massive online crowdsourced study of subjective and objective picture qual- ity," IEEE Transactions on Image Processing, vol. 25, no. 1, pp. 372–387, 2015. [20] Vlad Hosu, Hanhe Lin, Tamas Sziranyi, and Dietmar Saupe, "KonIQ-10k: An ecologically valid database for deep learn- ing of blind image quality assessment," IEEE Transactions on Image Processing, vol. 29, pp. 4041–4056, 2020. [21] Bart Thomee, David A Shamma, Gerald Friedland, Benjamin Elizalde, Karl Ni, Douglas Poland, Damian Borth, and Li-Jia Li, "YFCC100M: The new data in multimedia research," Com- munications of the ACM, vol. 59, no. 2, pp. 64–73, 2016. [22] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun, "Deep residual learning for image recognition," in Proceed- ings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 770–778. [23] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa De- hghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al., "An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale," in International Conference on Learning Representations, 2020. [24] Jian Jin, Dong Yu, Weisi Lin, Lili Meng, Hao Wang, and Huax- "Full RGB Just Noticeable Difference (JND) iang Zhang, Modelling," arXiv preprint arXiv:2203.00629, 2022. [25] Ilya Loshchilov and Frank Hutter, "Decoupled weight decay regularization," in International Conference on Learning Rep- resentations, 2018.
http://arxiv.org/abs/2302.09834v1
2023-02-20T08:47:23
2023-02-20T08:47:23
Transductive Matrix Completion with Calibration for Multi-Task Learning
Multi-task learning has attracted much attention due to growing multi-purpose research with multiple related data sources. Moreover, transduction with matrix completion is a useful method in multi-label learning. In this paper, we propose a transductive matrix completion algorithm that incorporates a calibration constraint for the features under the multi-task learning framework. The proposed algorithm recovers the incomplete feature matrix and target matrix simultaneously. Fortunately, the calibration information improves the completion results. In particular, we provide a statistical guarantee for the proposed algorithm, and the theoretical improvement induced by calibration information is also studied. Moreover, the proposed algorithm enjoys a sub-linear convergence rate. Several synthetic data experiments are conducted, which show the proposed algorithm out-performs other existing methods, especially when the target matrix is associated with the feature matrix in a nonlinear way.
[ "Hengfang Wang", "Yasi Zhang", "Xiaojun Mao", "Zhonglei Wang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09834v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09834v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG", "stat.ME" ]
3 2 0 2 b e F 0 2 ] L M . t a t s [ 1 v 4 3 8 9 0 . 2 0 3 2 : v i X r a Transductive Matrix Completion with Calibration for Multi-Task Learning∗ Hengfang Wang1, Yasi Zhang2, Xiaojun Mao3, and Zhonglei Wang4 1School of Mathematics and Statistics, Fujian Normal University, China 2Department of Statistics, University of California, Los Angeles, USA 3School of Mathematical Sciences, Ministry of Education Key Laboratory of Scientific and Engineering Computing, Shanghai Jiao Tong University, China 4Wang Yanan Institute for Studies in Economics and School of Economics, Xiamen University, China Abstract Multi-task learning has attracted much attention due to growing multi-purpose re- search with multiple related data sources. Moreover, transduction with matrix comple- tion is a useful method in multi-label learning. In this paper, we propose a transductive matrix completion algorithm that incorporates a calibration constraint for the features under the multi-task learning framework. The proposed algorithm recovers the incom- plete feature matrix and target matrix simultaneously. Fortunately, the calibration information improves the completion results. In particular, we provide a statistical guarantee for the proposed algorithm, and the theoretical improvement induced by calibration information is also studied. Moreover, the proposed algorithm enjoys a sub-linear convergence rate. Several synthetic data experiments are conducted, which show the proposed algorithm out-performs other existing methods, especially when the target matrix is associated with the feature matrix in a nonlinear way. 1 Introduction With the advent of the big data era, massive amounts of information and data have been collected by modern high-tech devices, including web servers, environmental sensors, x-ray imaging machines, and so on. Based on multiple data sources related to learning pur- poses, algorithms have been developed to achieve various learning goals. Multi-task learning (MTL) [1], for example, implements a robust learner for multiple tasks incorporating multi- ple sources, and it can be widely used in practice, including web search, medical diagnosis, natural language processing, and computer version. ∗An abridged version of this paper will appear in the 2023 IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP 2023). E-mail addresses: [email protected], [email protected], [email protected], [email protected]. 1 MTL has advantages for analyzing the multi-response structure. For i " 1, . . . , n, let yi P Rm be the vector of interest of length m, where n is the number of instances, and each element corresponds to a particular task. Denote Y " pyijq to be the n ˆ m response matrix, consisting of the n realizations of yi. If the responses for a specific task are categorical, it is essentially a multi-label learning problem. As for continuous responses, it turns out to be a multi-response regression problem if additional features are available. As the exponential family is flexible to handle different data types, regardless of categorical or continuous, for each task, we assume that yij independently comes from an exponential family distribution with parameter z‹,ij, which forms Z‹ " pz‹,ijq. The goal is to learn the underlying Z‹ based on Y. Moreover, entries of Y may suffer from missingness which makes it difficult to learn Z‹. To tackle this difficulty and estimate Z‹ simultaneously, matrix completion (MC) [2, 3, 4, 5, 6] algorithms have been developed under the low-rank and other regularity assumptions. The recovery of the target matrix without any additional features is studied in [7]. Noisy MC is investigated in [8, 9] from the exponential family with fully observed features. In MTL problems, features related to the responses may exist, but it is inevitable that such features also suffer from missingness. Goldberg et al. (2010) [10] studied such a problem under multi-label learning. Specifically, they studied single-task binary response matrix given feature matrix where both matrices were subject to missingness. Xu et al. (2018) [11] proposed the co-completion method by additionally penalizing the trace norm of the feature matrix. A recent work [12] considered this problem via a smoothed rank function approach. Under the noiseless case, [13] studied the error rate in the scenario with corrupted side information. Calibration [14, 15, 16] is widely used to incorporate such prior knowledge in the learning procedure, and it improves the estimation efficiency. In this vein, [17] studied the calibration with local polynomial regression between responses and features. Later, [18] generalized this idea to the so-called model calibration under a parametric framework. Afterward, [19] gen- eralized the idea to a functional type calibration equation. As far as we know, no calibration related work has been done under the MC framework. In this paper, we focus on MTL problems incorporating incomplete features, and we assume that certain prior knowledge about the features is also available. Our work can be embodied in the following toy example. For the well-known Netflix movie rating problem [20], we aim to simultaneously complete rating and like-dislike matrices incorporating an incomplete feature matrix, consisting of age, gender, and so on. However, all three matrices suffer from missingness. When additional information such as the summary statistics for age, gender, etc., can be obtained from the census survey, we investigate the benefits of such additional information incorporated by the calibration method. In a nutshell, we propose a Transductive Matrix Completion with Calibration (TMCC) algorithm, and the prior in- formation about the features is considered by an additional calibration constraint. As far as we know, this is the first paper exploring multi-task learning under a matrix completion framework with calibration. Methodologically, our method has two merits: (i) the target and feature matrices can be completed simultaneously; (ii) calibration information can be incorporated. Theoretically, we show the statistical guarantee of our method, and the ben- efit of calibration is also discussed. Besides, we have validated that the convergence rate of the proposed algorithm is Op1{k2q. Numerically, synthetic data experiments show that our 2 proposed method performs better than other existing methods, especially when the target matrix has a nonlinear transformation from the feature matrix. Notations. Denote rns as the set t1, . . . , nu. Given an arbitrary matrix S " psijq P Rn1ˆn2, n2 ijq1{2. Denote the singular values of S as j"1 s2 the Frobenius norm of S is }S}F " p σ1pSq, . . . , σn1^n2pSq in descending order. The operator norm is }S} " σmaxpSq " σ1pSq and the nuclear norm }S}‹ " σipSq. Besides, let σminpSq " σn1^n2pSq. n1 i"1 ř ř ř n1^n2 i"1 2 Model and Algorithm Suppose there are S response matrices, Yp1q, . . . , YpSq. For example, Yp1q can be a like- dislike matrix, and Yp2q can be a rating matrix, whose rows correspond to users, columns correspond to movies, and S " 2. Denote the number of instances by n, the number of tasks for s-th response matrix by ms. For s P rSs, we have Ypsq " pypsq ij q P Rnˆms, and ypsq ij can be either discrete or continuous for i P rns. We assume that within the same response matrix, all entries follow the same generic exponential family. For example, all entries of Yp1q follow Bernoulli distributions with different success probabilities. Let Rpsq y " prpsq y,ijq P Rnˆms be the corresponding indicator matrix for Ypsq. is observed, then rpsq y,ij " 0. Furthermore, assume that Ypsq is generated from a low-rank matrix Zpsq ‹,ijq P Rnˆms by the exponential family via a base function hpsq and a link function gpsq, namely, the density function f psqpypsq ‹,ij ́ ‹,ijqu, for s P rSs. For instance, suppose gpsqpzpsq gpsqpzpsq ij q " p2πσ2q ́1{2 exp t ́pypsq ij q2{p2σ2qu, and the corresponding exponential family is the Gaussian distribution with mean σ2zpsq ij zpsq ‹,ijq2{2 and hpsqpypsq ij |zpsq ‹,ijq " σ2pzpsq y,ij " 1; otherwise, rpsq ‹,ij and variance σ2 with support R. In particular, if ypsq ij ‹,ijq " hpsqpypsq ij q exptypsq ‹ " pzpsq Denote X‹ " px‹,ijq P Rnˆd as the true feature matrix consisting of d feature, and it is assumed to be low-rank. Let X " pxijq P Rnˆd be a noisy version of the true feature matrix, i.e., X " X‹ ` (cid:15), where (cid:15) " p(cid:15)ijq P Rnˆd is a noise matrix with Ep(cid:15)q " 0, and its entries are independent. As the feature matrix is also incomplete, in a similar fashion, we denote Rx " prx,ijq P Rnˆd as the corresponding indicator matrix of X. That is, we only observe an incomplete matrix Rx ̋ X, where ̋ denotes the Hadamard product. Let target matrix Z‹ " rZp1q ‹ s be the collection of hidden parameter matrices. Our goal is to recover Z‹. We believe that some hidden connection between X‹ and Z‹ may provide us benefits for MTL. ‹ , . . . , ZpSq Our method can be illustrated in Fig 1, where logitppq " logtp{p1 ́ pqu, for p P p0, 1q. In this example, we have three observed matrices whose entries are from Bernoulli, Gaussian, and Poisson distributions, correspondingly, and are subject to missingness. In addition, we have an incomplete feature matrix related to the target matrix and calibration information for the true feature matrix. By the proposed TMCC algorithm, we can complete the true feature matrix and target matrix simultaneously. Given density functions tf psquS s"1, or collection of tgpsquS s"1 and thpsquS s"1, the negative 3 Feature Bernoulli Gaussian Poisson Observed Matrix 1.5 ? -0.3 ̈ ̈ ̈ -1.1 ? 0.1 -0.5 ̈ ̈ ̈ ? 2.3 ... ? ? ... ? ̈ ̈ ̈ ? ... . . . -2.2 ̈ ̈ ̈ ? ... 2.9 ? 1 ? ... ? 0 ? ? ... 1 1 ? 0 ... ? ̈ ̈ ̈ ̈ ̈ ̈ ̈ ̈ ̈ . . . ̈ ̈ ̈ ? 0 ? ... 1 -0.4 0.7 -0.3 ̈ ̈ ̈ ? ? 0.1 ? ̈ ̈ ̈ -0.5 ? ... 0.1 ? ... ? 0.1 ̈ ̈ ̈ ... . . . ̈ ̈ ̈ ? ? ... 0.2 1 ? 2 ... ? ? ? ? ... 4 ? 1 ? ... ? ̈ ̈ ̈ ̈ ̈ ̈ ̈ ̈ ̈ . . . ̈ ̈ ̈ 2 ? 2 ... 3 noiseless feature logit of probability (Bernoulli) with calibration constraint AX‹ " B Target Matrix mean (Gaussian) log of mean (Poisson) T M C C ( s i m u l t a n e o u s l y r e c o v e r ) 1.5 1.3 -0.3 ̈ ̈ ̈ -1 0.3 0.2 0.8 ̈ ̈ ̈ 0.2 -0.2 0.8 -0.3 ̈ ̈ ̈ 0.9 0.3 0.3 1.2 0 -0.5 ̈ ̈ ̈ 1.3 0.7 0.6 0.7 ̈ ̈ ̈ 0.1 0.6 0.2 -1.1 ̈ ̈ ̈ -0.5 0 0.3 0 0 ̈ ̈ ̈ ̈ ̈ ̈ n 2.1 -0.3 -1.5 ̈ ̈ ̈ ... . . . ̈ ̈ ̈ 3 ... -0.4 ... -2 -1.2 ... 2.9 0.2 0.7 0.1 ̈ ̈ ̈ ... . . . 0.1 0.9 0.3 ̈ ̈ ̈ ... ... 0.3 ... 0.6 0.4 ... 0.2 0.1 ̈ ̈ ̈ 0.5 ... ... . . . 1.1 -0.7 ̈ ̈ ̈ -1.3 ... 0.3 0 ... 0.3 ̈ ̈ ̈ 0.3 ... ... . . . 0.5 0.7 0.5 ̈ ̈ ̈ 0.3 0 0.3 ... 0.3 d m1 m2 m3 Figure 1: Algorithm Illustration, where a Question Mark Represents a Missing Value. quasi log-likelihood function for Z: is ̆ ` Z: (cid:96)0 " ́ Sÿ ÿ ! ) rpsq y,ij log f psqpypsq ij |z:psq ij q s"1 pi,jqPrnsˆrmss Sÿ ÿ " rpsq y,ij s"1 pi,jqPrnsˆrmss "! ́ypsq ij z:psq ij ` gpsq ̄) ́ z:psq ij )ı ! hpsqpypsq ij q ` log (1) where Z: " rZ:p1q, . . . , Z:pSqs and Z:psq " pz:psq with the second term of (1), we refine (1) as ij q P Rnˆms. As the argument Z: is irrelevant Sÿ ÿ ̆ ` (cid:96) Z: " rpsq y,ij s"1 pi,jqPrnsˆrmss ! ́ypsq ij z:psq ij ` gpsq ̄) ́ z:psq ij . ř S Let Y " rYp1q, . . . , YpSqs be the collection of each specific task, D " d ` s"1 ms and M‹ be the concatenated matrix rX‹, Z‹s P RnˆD. Suppose we have an additional calibration constraint AX‹ " B, where A and B are available. To incorporate the calibration constraint, 4 the estimation procedure can be formulated as xM " arg min M:PRnˆD „ 1 nD " (cid:96) ̆ ` Z: ` fτ1 `τ1 ̆ M: ` ` τ2 ̆ Lτ1,τ2 M: ": arg min M:PRnˆD ": arg min M:PRnˆD * ` X: ́ X › ›M: › ›2 F ` τ2 ̆› ›2 F › › ‹ ı 1 2 › ›Rx ̋ ` › ›AX: ́ B › › › ›M: ‹ , (2) pX, pZs and we employ the commonly used square loss to complete where M: " rX:, Z:s, xM " r the feature part. One trivial case is that when the calibration information is strong enough, i.e., A is invertible, the feature matrix X‹ can be exactly recovered. Note that our learning object is quite general. When S " 1, the entries within the only response matrix come from Bernoulli distributions, and there's no third term related to calibration in (2), our learning object degenerates to the case considered in [10], and [11]. However, [10] had an additional assumption that there exists a linear relationship between the feature matrix and the hidden parameter matrix. We do not make such a structural assumption. Besides, [11] used additional nuclear norms to penalize the feature matrix for single task learning. When there is no feature information, the objective function will degenerate to the case in [7]. We propose a Transductive Matrix Completion with Calibration (TMCC) algorithm to obtain the estimator in (2). In the algorithm, the ij-th element of the gradient Bfτ1pM:q with respect to M: is ́ ̄ Bfτ1pM:qij " $ '''& '''% rx,ij nD ry,ij nD x: ij ́ xij # ́ypsq ij ̋ ` ` 2τ1pATAX: ́ ATBqij, + , Bgpsqpz:psq ij ̋ q Bz:psq ij ̋ for j P rds, for s ́1ÿ k"1 sÿ mk ` d ă j ď mk ` d, k"1 ř s ́1 k"1 mk. For any generic matrix S with the singular value decomposition where j ̋ " j ́ d ́ (SVD) S " UΣVT, Σ " diagpσiq, σ1 ě ̈ ̈ ̈ ě σr and r " rankpSq. Denote the singular value soft threshold operator by TcpSq " Udiagppσi ́ cq`qVT for a constant c ą 0 and x` " maxpx, 0q. The detailed algorithm is presented in Algorithm 1. The parameter K is a predetermined integer that controls the learning depth of TMCC, and η is a predetermined constant for the step size. Within the algorithm, κ in the Algorithm 1 is a predetermined stopping criterion. The proposed algorithm iteratively updates the gradient and does singular value thresholding (SVT) [21], in addition to an accelerated proximal gradient decent [22] step to get a fast convergence rate. 3 Theoretical Guarantee In this section, we first provide convergence rate analysis for TMCC algorithm. Before that, we make the following technical assumptions. 5 Algorithm 1: TMCC algorithm Input: Incomplete matrices X, Y; indicator matrices Rx, Ry; calibration constraint matrices A and B, tuning parameters τ1, τ2; learning depth K, step size η, stopping criterion κ. Initialize: Random matrices Mp0q " Mp1q P RnˆD, c " 1. 1 for k " 1 to K do 2 Compute θ " pc ́ 1q{pc ` 2q. Compute Q " p1 ` θqMpkq ́ θMpk ́1q. Compute T " Q ́ ηBfτ1pQq. Compute Mpk`1q " Tητ2pTq. if Lτ1,τ2pMpk`1qq ą Lτ1,τ2pMpkqq then c " 1; else if c " c ` 1; ˇ ˇ ˇLτ1,τ2pMpk`1qq ́ Lτ1,τ2pMpkqq ˇ M; " Mpk`1q; break; ď κ then Output: M; 3 4 5 6 7 8 9 10 11 12 Assumption 1. There exists a positive constant pmin such that „" * " * min min sPrSs min pi,jqPrnsˆrmss πpsq y,ij , min pi,jqPrnsˆrds πx,ij ě pmin, where πx,ij " Pprx,ij " 1q, πpsq such that y,ij " Pprpsq y,ij " 1q. Further, there exists a positive constant γ ˆ„  „  „ max max iPrns tπx,i ̈ ` πy,i ̈u , max jPrds πx, ̈j , max sPrSs max jPrmss  ̇ πpsq y, ̈j ď γ, where πx,i ̈ " ř jPrds πx,ij, πx, ̈j " ř iPrns πx,ij, πpsq y, ̈j " ř iPrns πpsq y,ij, πy,i ̈ " ř sPrSs ř jPrmss πpsq y,ij. Assumption 2. There exists a positive constant α, such that max t}X‹}8 , }Z‹}8u ď α. Assumption 3. Let D " r ́α ́ δ, α ` δs, for some δ ą 0. For any z P D, there exist positive constants Lα and Uα, such that Lα ď pgpsqq2pzq ď Uα, where gpsq is the link function of exponential family for s-th response matrix, for s P rSs. Assumption 4. There exists a positive constant ζ, for any λ P R, such that Epeλ(cid:15)ij q ď eλ2ζ{2, where (cid:15)ij's are noises for the feature matrix. Assumption 5. There exists a constant C ą 0, such that σminpAq ě C ą 0. 6 Assumption 1 controls the sampling probabilities for our model. The first part ensures that all the sampling probabilities are bounded away from zero. The second part aims to bound the operator norm of a Rademacher matrix of the same dimension as M‹ stochas- tically. Although we assume that the parameter matrix Z‹ is bounded in Assumption 2, the support of entries in Y can be unbounded. For instance, the support of a Poisson distribution is unbounded, while its mean is fixed. In other words, Assumption 2 implies M‹ P G8pαq :" tG P RnˆD : }G}8 ď αu. Assumption 3 is mild under the canonical expo- nential family framework. That is, we have Varpys ‹,ijq ą 0 for each i, j. We extend it a little bit with tolerance δ for ease of proof. Furthermore, define ̃Lα " pLα ^ 1q and ̃Uα " pUα _ζ _1q. Assumption 4 implies that the errors for the feature matrix come from sub-Gaussian distributions. Assumption 5 indicates that the calibration matrix A should be of full rank. The following Theorem 1 shows the convergence rate of the proposed algorithm is Op1{k2q. Theorem 1. Suppose that Assumption 1 „ 4 hold, τ1 ď tnDσ2 sequences tMpkqu generated by Algorithm 1 satisfy c1 minrtσmaxpAqu ́2pnDαq ́1{2, minpAqu ́1 ̃Lαpmins and τ2 " pnDq ́12c2tp ̃Uαq1{2 _ 1{δutγ1{2 ` plogpn _ Dqq3{2u. The ‹,ijqq " pgpsqq2pzs ij|gspzs ` fτ1 Mpkq ̆ ́ fτ1 pM‹q ď 2 ̃L › ›Mp0q ́ M‹ ηpk ` 1q2 › ›2 F , with probability at least 1 ́ 4{pn ` Dq, where ̃L is a constant related to c1 and α1{2 ̃Uα. The following theorem presents the statistical guarantee for the proposed method. ̃Lαpmin and τ2 " Theorem 2. Suppose that Assumption 1 „ 4 hold, τ1 ď tnDσ2 pnDq ́12c2tp ̃Uαq1{2_1{δutγ1{2`plogpn_Dqq3{2u. Then, with probability as least 1 ́4{pn`Dq, * › › › pX ́ X‹ + › › ›pZ ́ Z‹ 8τ1 ̃Lαpmin # minpAqu ́1c1 σ2 minpAq 1 nD 1 nD › › 2 › F › › 2 › F ` ` " ď crankpM‹q nDp2 min α2 ` where c, c1, c2 are positive constants. (cid:32) ̃Uα _ 1{δ2 ̃L2 α γ ` log3pn _ Dq , (3) ( Theorem 2 implies that our recovered error for the target matrix, in the sense of squared Frobenius norm, is bounded by the right hand side of (3), with probability approaching 1 when n and D are large enough. Suppose the feature matrix is also regarded as a response matrix from Gaussian noise with unit variance, by directly applying the Theorem 7 in [7], we have pnDq ́1p} F q less than the terms in the second line of (3). Fortunately, with the help of calibration information, we have a constant order improvement. Specifically, together with Assumption 5, we have pX ́X‹}2 pZ ́Z‹}2 F `} › › 2 › F › › 1 › pX ́ X‹ nD " 8τ1 1 ̃Lαpmin nD ` piq ă ` 1 nD σ2 minpAq › › 2 › F › › ›pZ ́ Z‹ * › › › pX ́ X‹ › › 2 › F ` 1 nD › › ›pZ ́ Z‹ › › 2 › F , where the inequality piq is strict, which is one of the main theoretical contributions of this paper. 7 4 Experiments ‹{}X0 ‹ " PQT and X‹ " X0 We conduct a simulation study to illustrate the performance of the proposed method. Let P P Rnˆr and Q P Rdˆr whose entries are generated independently from a uniform distribution over p0, 1q. Then, let X0 ‹}8. We further generate coefficient matrix Wpsq P Rdˆms whose elements are independently generated from a uniform distribution over p0, 1q for s " 1, 2, 3. Let rZpsq ‹ " X‹Wpsq. We call this setting as "linear" case. By rZpsq rZpsq normalization, we have Zpsq ‹ }8. Specifically, Yp1q has Bernoulli entries with ‹ {} support t0, 1u, Yp2q has Poisson entries and Yp3q has Gaussian entries with known σ2 " 1. All the link between Ypsq and Zpsq are the same as those in Section 2. For calibration information, suppose we know the column means for X‹, i.e., A " p1{nq11ˆn and B " AX‹. On the other hand, we have a "nonlinear" case, i.e., we assume that rZpsq is generated by an element-wise nonlinear transformation of X‹. Specifically, let zpsq ‹,ij " tpsqpx‹,ijq, where tp1qpxq " x2 ` x ` 0.5, tp2qpxq " ́x2 ́ x, tp3qpxq " ́x2 ́ 2x ` 0.2. The normalization procedure is the same as the "linear" case. The proposed method TMCC is compared with three other approaches. ‹ " ‹ 1. MC 0: Exactly the same as modified TMCC except for the gradient updating procedure. No calibration information is considered. Therefore in Bfτ1pM:qij the term 2τ1pATAX: ́ ATBqij is eliminated. 2. CMC SI: Collective matrix completion (CMC) [7] is used to complete the parameters for the target matrix, and Soft-Impute (SI) method from [23] is used to complete the feature matrix separately. 3. TS: A two-stage method, where, at the first stage, only the feature matrix is imputed by the Soft-Impute method, and at the second stage, the method MC 0 is applied to the concatenated matrix joined by the feature matrix and the observed response matrices. Specifically, MC 0 and TMCC share the same strategy, i.e. simultaneously recovering all matrices, while CMC SI chooses to recover separately and TS opts to recover step by step. In the experiments, we set n " 1500, d " 500, m1 " m2 " m3 " 500 and choose learning depth K " 1000 and stopping criterion κ " 10 ́7. Further, we compare different methods with rank r P t5, 10, 15u. The missing rate ν P t60%, 80%u of both the feature matrix and response matrix are the same in each experiment. For TMCC, we tune τ1 and τ2 on one independent validation set and apply the same parameters to all other repeated 50 simulations. Further, other compared methods employ the same procedure as TMCC while they only have to be tuned for the parameter τ2. pXq " } The performance of each method is evaluated via the mean value and standard deviation of the relative errors (RE) based on repeated experiments. Specifically, the relative error pX ́ X‹}F {}X‹}F and that of target matrix of a recovered feature matrix is REp REp pZ ́ Z‹}F {}Z‹}F . Experiment results are summarized in Fig 2 and Fig 3. pZq " } In Fig 2, it is an unsurprising fact that TMCC surpasses MC 0 with the help of calibration information. For instance, in the linear case with ν " 60%, the mean of RE of ˆX by MC 0 is 0.51 with standard error (SE) 0.0417 when r " 5 while that by TMCC is 0.25 with SE 0.0040. TMCC's RE is less than half of MC 0's and situations in other cases are alike. Besides, CMC SI and TS perform the best in all scenarios. Specifically, the mean of RE of ˆX by CMC SI is 0.01 with SE 0.0005, and that by TS is 0.01 with SE 0.0006 when r " 10 in 8 Figure 2: Relative Error of Feature Matrix (with the Black Lines Representing ± the Stan- dard Error) Figure 3: Relative Error of Target Matrix (with the Black Lines Representing ± the Standard Error) the nonlinear case with ν " 60%. It is because both CMC SI and TS complete the feature matrix without considering the target matrix. However, our primary goal is to recover Z‹, i.e., achieving a low relative error of ˆZ. In Fig 3, the far lower relative error of ˆX by CMC SI and TS does not bring a lower relative error of ˆZ. Of all the four approaches, CMC SI is the only one that fails to take advantage of the feature matrix to recover the target matrix. That is why it attains the greatest relative error of the target matrix. For example, its mean of RE of ˆZ is 0.46 with SE 0.0046 when r " 15 in the linear case with ν " 80% and 0.53 with SE 0.0057 when r " 15 in the nonlinear case with ν " 60%, more than twice of the other three methods. Besides, TS, MC 0, and TMCC behave similarly in the linear case while they display great differences in the nonlinear case. When the relationship between X‹ and Z‹ is not linear, simultaneously recovering demonstrates great strength compared with recovering step by step and recovering separately. In the nonlinear case with ν " 80%, the means of RE of ˆZ by CMC SI, TS, MC 0, and TMCC are 0.66, 0.58, 0.52, and 0.46 respectively when r " 5. Situations in other cases are almost the same. What is noteworthy is that TMCC also overtakes MC 0 with respect to target matrices, which implies the power of calibration information again. Overall, relatively low standard errors indicate the stability of these algorithms. 9 5 Conclusion We proposed a statistical framework for multi-task learning under exponential family matrix completion framework with known calibration information. Statistical guarantee of our proposed estimator has been shown and a constant order improvement is achieved compared with existing methods. We have also shown that the proposed algorithm has a convergence rate of Op1{k2q. The simulation study also shows that our proposed method has numerical benefits. References [1] Rich Caruana, "Multitask learning," Machine Learning, vol. 28, no. 1, pp. 41–75, 1997. [2] Benjamin Recht, "A simpler approach to matrix completion," Journal of Machine Learning Research, vol. 12, no. Dec, pp. 3413–3430, 2011. [3] Raghunandan Keshavan, Andrea Montanari, and Sewoong Oh, "Matrix completion from noisy entries," Advances in neural information processing systems, vol. 22, 2009. [4] Vladimir Koltchinskii, Karim Lounici, and Alexandre B Tsybakov, "Nuclear-norm penalization and optimal rates for noisy low-rank matrix completion," The Annals of Statistics, vol. 39, no. 5, pp. 2302–2329, 2011. [5] Sahand Negahban and Martin J Wainwright, "Restricted strong convexity and weighted matrix completion: Optimal bounds with noise," Journal of Machine Learning Re- search, vol. 13, no. May, pp. 1665–1697, 2012. [6] Tony Cai and Wen-Xin Zhou, "A max-norm constrained minimization approach to 1-bit matrix completion," Journal of Machine Learning Research, vol. 14, no. 1, pp. 3619–3647, 2013. [7] Mokhtar Z Alaya and Olga Klopp, "Collective matrix completion," Journal of Machine Learning Research, vol. 20, no. 148, pp. 1–43, 2019. [8] Jianqing Fan, Wenyan Gong, and Ziwei Zhu, "Generalized high-dimensional trace re- gression via nuclear norm regularization," Journal of Econometrics, vol. 212, no. 1, pp. 177–202, 2019. [9] Genevi`eve Robin, Olga Klopp, Julie Josse, ́Eric Moulines, and Robert Tibshirani, "Main effects and interactions in mixed and incomplete data frames," Journal of the American Statistical Association, vol. 115, no. 531, pp. 1292–1303, 2020. [10] Andrew Goldberg, Ben Recht, Junming Xu, Robert Nowak, and Jerry Zhu, "Trans- duction with matrix completion: Three birds with one stone," in Advances in neural information processing systems, 2010, pp. 757–765. 10 [11] Miao Xu, Gang Niu, Bo Han, Ivor W Tsang, Zhi-Hua Zhou, and Masashi Sugiyama, "Matrix co-completion for multi-label classification with missing features and labels," arXiv preprint arXiv:1805.09156, 2018. [12] Ashkan Esmaeili, Kayhan Behdin, Mohammad Amin Fakharian, and Farokh Marvasti, "Transduction with matrix completion using smoothed rank function," arXiv preprint arXiv:1805.07561, 2018. [13] Kai-Yang Chiang, Inderjit S Dhillon, and Cho-Jui Hsieh, "Using side information to reliably learn low-rank matrices from missing and corrupted observations," Journal of Machine Learning Research, vol. 19, no. 1, pp. 3005–3039, 2018. [14] Jean-Claude Deville and Carl-Erik S ̈arndal, "Calibration estimators in survey sam- pling," Journal of the American Statistical Association, vol. 87, no. 418, pp. 376–382, 1992. [15] Carl-Erik S ̈arndal, Bengt Swensson, and Jan Wretman, Model assisted survey sampling, Springer Science & Business Media, 2003. [16] Wayne A Fuller, Sampling statistics, John Wiley & Sons, 2011. [17] F Jay Breidt and Jean D Opsomer, "Local polynomial regresssion estimators in survey sampling," The Annals of Statistics, vol. 28, no. 4, pp. 1026–1053, 2000. [18] Changbao Wu and Randy R Sitter, "A model-calibration approach to using complete auxiliary information from survey data," Journal of the American Statistical Associa- tion, vol. 96, no. 453, pp. 185–193, 2001. [19] Jae Kwang Kim and Mingue Park, "Calibration estimation in survey sampling," Inter- national Statistical Review, vol. 78, no. 1, pp. 21–39, 2010. [20] James Bennett and Stan Lanning, "The netflix prize," in Proceedings of KDD cup and workshop. Citeseer, 2007, vol. 2007, p. 35. [21] Jian-Feng Cai, Emmanuel J Cand`es, and Zuowei Shen, "A singular value thresholding algorithm for matrix completion," SIAM Journal on Optimization, vol. 20, no. 4, pp. 1956–1982, 2010. [22] Shuiwang Ji and Jieping Ye, "An accelerated gradient method for trace norm minimiza- tion," in Proceedings of the 26th annual international conference on machine learning, 2009, pp. 457–464. [23] Rahul Mazumder, Trevor Hastie, and Robert Tibshirani, "Spectral regularization algo- rithms for learning large incomplete matrices," Journal of Machine Learning Research, vol. 11, no. Aug, pp. 2287–2322, 2010. [24] Olga Klopp, "Noisy low-rank matrix completion with general sampling distribution," Bernoulli, vol. 20, no. 1, pp. 282–303, 2014. 11 Appendix In this appendix, we provide technical proofs and computational time comparisons for our main article. Specifically, it is organized as follows: • Section A introduces necessary preliminary; • Section B presents proof of Theorem 1; • Section C presents proof of Theorem 2; • Section D provides auxiliary lemmas; • Section E provides computational time comparison for the simulations. A PRELIMINARY In the following, we investigate the theoretical properties of the proposed TMCC algorithm. Before going through those theoretical results, we first introduce some useful matrix norm inequalities. For two matrices S and T with the same dimension, define the inner product in terms of the trace of the matrix product, i.e., xS, Ty " trpSTTq. We have trace duality inequality ˇ ˇ ˇ ˇtrpSTTq ď }S} }T}‹ , and bound for nuclear norm Further, a }S}‹ ď rankpSq }S}F . σminpSq }T}F ď }ST}F , (A.4) (A.5) (A.6) where the proof of (A.6) is presented in Lemma 2. Suppose the SVD of S is USΣSVT S . Let rPS " SpSTSq ́1ST be the projection matrix based on S. Define P K T rPVK , rPFqF for a matrix F. Notice that P K where FK " pI ́ S pTq is not a projection since it is not idempotent. Let PSpTq " T ́ P K S pTq and we have S pTq " rPUK S S rank tPSpTqu ď 2rankpSq. By [24], we have }S}‹ ́ }T}‹ ď }PSpS ́ Tq}‹ ` › ›P K › › S pS ́ Tq . ‹ Finally, we define the Bregman divergence. (A.7) (A.8) Definition 1. Let C be a closed set. For a continuously-differentiable function F : C Ñ R, the Bregman divergence associated with F between x, y P C is dF px, yq " F pxq ́ F pyq ́ x∇F pyq, x ́ yy. 12 Mathematically, dF px, yq is equivalent to the first-order Taylor expansion error of F pxq evaluated at y. Denote ΣR to be an n ˆ D matrix, consisting of i.i.d. Rademacher sequences tξx,ij : i P rns, j P rdsu and tξpsq y,ij : i P rns, j P rmssu for s P rSs. Specifically, pn,dqÿ Sÿ pn,msqÿ ΣR " ξx,ijrx,ijEx,ij ` pi,jq s"1 pi,jq y,ijrpsq ξpsq y,ijEpsq y,ij, where Ex,ij " eipnqejpDqT and Epsq canonical bases, eiplq is the j-th unit vector of length l and ̃j " j ` d ` y,ij " eipnqe ̃jpDqT are RnˆD matrices lying in the set of ř s ́1 t"1 mt. B PROOF OF THEOREM 1 Proof. Given two arbitrary matrices S, T P RnˆD, we have (cid:32) |fτ1pSq ́ fτ1pTq| ˇ ) ! ˇ ̃(cid:96)pSq ́ ̃(cid:96)pTq ˇ ˇ ˇ ˇ ˇ ˇ ̃(cid:96)pSq ́ ̃(cid:96)pTq ˇ ` τ1 › ́ › ĂM ›∇ ̃(cid:96) !? ́ ́ τ1 ˇ (cid:32) ˇ ̄› › › }S ́ T}‹ ` τ1σ2 ̄› › › › ĂM ›∇ ̃(cid:96) › ` 2τ1σ2 n ^ D " ď ď ď }A pS ́ M‹q}2 }A pS ́ M‹q}2 F ́ }A pT ́ M‹q}2 F (ˇ ˇ F ́ }A pT ́ M‹q}2 F (ˇ ˇ ˇ 1pAq }S ́ T}F }S ` T ́ 2M‹}F ? ) 1pAq nDα }S ́ T}F , ĂMq}. ́ ĂM where ĂM P G8pαq. We focus on bound of }∇ ̃(cid:96)p › ̄› › › ›∇ ̃(cid:96) › › › › › ›∇ ̃(cid:96)pM‹q › ` › › › › ›∇ ̃(cid:96)pM‹q › ` › › › › ĂMq ́ ∇ ̃(cid:96)pM‹q ›∇ ̃(cid:96)p › › › Sÿ › › › › s"1 y,ijEpsq rpsq 1 nD y,ij ˆ pi,jqPrnsˆrmss ÿ ď ď ÿ pi,jqPrnsˆrds ` ÿ pi,jqPrnsˆrmss y,ijEpsq rpsq ı y,ij › › › › ›∇ ̃(cid:96)pM‹q › ` ď a Sÿ › › › › › › s"1 ̃Uα nD " ? c2p ̃Uα _ 1{δq γ ` tlogpn _ Dqu3{2 ď ď c3? nD . nD ` ? 2 nDα ̃Uα nD ! pgpsqq1p ̃zpsq ) ‹,ijq ́ pgpsqq1pzpsq ‹,ijq › › › › N pxijqu › › N p ̃xijq ́ g1 rx,ijEx,ij tg1 ˇ ˇ ‹,ij ́ zpsq ˇ ̃zpsq ‹,ij ˇ ˇ ˇ ` ÿ pi,jqPrnsˆrds rx,ijEx,ij | ̃xij ́ xij| › › › › › › 13 Therefore, as long as τ1 ď c1tσ1pAqu ́2pnDαq ́1{2, there exists positive constant ̃L " 2c1 ` c3 such that fτ1p ̈q is ̃L-Lipchitz. The remaining proof can be obtained by followed the proof of Theorem 4.1 in [22]. C PROOF OF THEOREM 2 Proof. In general, we use the connection between exponential family distributions and Breg- man divergence to argue the basic inequality implied by our estimation procedure. Then, a key quantity can be bounded and the results can be obtained by the standard argument for matrix completion. Specifically, by basic inequality, we have ij ` gpsqpˆzpsq ij q ) ÿ ` pi,jqPrnsˆrds rx,ij 2 pˆxij ́ xijq2 fi fl ! ́ypsq ij z‹,ij ` gpsqpzpsq ‹,ijq rpsq y,ij F ` τ2 }M‹}‹ ! ́ypsq ij z‹,ij ` gpsqpzpsq ‹,ijq rpsq y,ij ) ` ) ` ÿ pi,jqPrnsˆrds ÿ pi,jqPrnsˆrds rx,ij 2 rx,ij 2 fi fl px‹,ij ́ xijq2 fi fl ` τ2 }M‹}‹ , px‹,ij ́ xijq2 where the calibration information implies the last equality. Let gN pxq " x2{2, expanding quadratic terms of xij, and we have ij ` gpsqpˆzpsq ij q ) fi rx,ij t ́xij ˆxij ` gN pˆxijqu fl ÿ ` pi,jqPrnsˆrds ! ́ypsq ij ˆzpsq › › › › ›xM › ‹ ` τ2 » – Sÿ ÿ rpsq y,ij s"1 ` τ1 » pi,jqPrnsˆrmss › › › › 2 ›A pX ́ B › F Sÿ – ÿ s"1 pi,jqPrnsˆrmss ` τ1 }AX‹ ́ B}2 » ÿ Sÿ – s"1 pi,jqPrnsˆrmss 1 nD ď 1 nD " 1 nD 1 nD » – Sÿ ÿ rpsq y,ij s"1 ` τ1 » pi,jqPrnsˆrmss › › › › 2 ›A pX ́ B › F ! ́ypsq ij ˆzpsq › › › › ›xM › ‹ ` τ2 ď 1 nD Sÿ – ÿ s"1 pi,jqPrnsˆrmss rx,ij t ́xijx‹,ij ` gN px‹,ijqu fi fl ` τ2 }M‹}‹ . ! ́ypsq ij z‹,ij ` gpsqpzpsq ‹,ijq ) ` ÿ rpsq y,ij pi,jqPrnsˆrds 14 Rearranging the terms, we obtain ̈ 1 nD Sÿ ̋ ÿ s"1 pi,jqPrnsˆrmss ÿ " rpsq y,ij ́ypsq ij ́ ij ́ zpsq pzpsq ‹,ij ̄ ` ! gpsqppzpsq ij q ́ gpsqpzpsq ‹,ijq ̨ )ı ` rx,ij ˆ r ́xijpˆxij ́ x‹,ijq ` tgN pˆxijq ́ gN px‹,ijqus ‚ pi,jqPrnsˆrds ď ́ τ1 " ́ τ1 › › › › 2 ›A pX ́ B › F › ́ › pX ́ X‹ ›A › › ›xM ́ }M‹}‹ ́ ́ }M‹}‹ ́ ` τ2 ̄ › › › › ‹ › ›xM ` τ2 ̄› › 2 › F ̄ › › › ‹ . (C.9) Plug in the Bregman divergence into (C.9) with (A.4), and we have 1 nD ď ́ τ1 » Sÿ – ÿ s"1 › › ›A pX ́ B » pi,jqPrnsˆrmss › › 2 › F ÿ Sÿ ` τ2 – 1 nD ! rpsq y,ijdgpsq ́ }M‹}‹ ́ ‹,ij ́ ij , zpsq pzpsq › › ̄ › › ›xM › ‹ ̆ !` ̄) ` ÿ ! rpsq x,ijdgN ppxij, x‹,ijq pi,jqPrnsˆrds ́ ) fi fl rpsq y,ij ˆ gpsq 1 pzpsq ‹,ijq ́ ypsq ij ) ́ ̄ ij ́ zpsq pzpsq ‹,ij ` s"1 pi,jqPrnsˆrmss ÿ rx,ij tpgN q1px‹,ijq ́ xiju pˆxij ́ x‹,ijq fi fl › › ›A pX ́ B › › ›A pX ́ B pi,jqPrnsˆrds › › 2 › F › › 2 › F ` τ2 ` τ2 " ́ τ1 ď ́ τ1 ́ }M‹}‹ ́ ́ }M‹}‹ ́ ř ̄ ̄ › › › › ›xM › › › ‹ › › ›xM › ‹ ́ x∇ ̃(cid:96)pM‹q, xM ́ M‹y › › › › › › ›xM ́ M‹ ›∇ ̃(cid:96)pM‹q › ` › › › ‹ , (C.10) pi,jqPrnsˆrds rx,ij ˆt ́xijx‹,ij `gN px‹,ijqus. With an additional Sÿ $ & where ̃(cid:96)pM‹q " pnDq ́1r(cid:96)pZ‹q` assumption that τ2 ě 2}∇ ̃(cid:96)pM‹q}, together with (A.5) and (A.7), (C.10) yields ́ ij , zpsq pzpsq ́ pX ́ X‹ › ́ › pX ́ X‹ ›A s"1 pi,jqPrnsˆrmss ̄› ́ › xM ́ M‹ › ‹ › › ›xM ́ M‹ % › › ›PM a 2rankpM‹q rpsq y,ijdgpsq ̄› › 2 › F 1 nD pi,jqPrnsˆrds ́ τ1 rx,ijdgN pˆxij, x‹,ijq ÿ ÿ ď ` ď ‹,ij ̄ . › › ›A ́ τ1 › › › F ̄› › 2 › F 3τ2 2 3τ2 2 , . - (C.11) Meanwhile, as Lαpx ́ yq2 ď 2dgpsqpx, yq ď Uαpx ́ yq2 and 2dgN px, yq " px ́ yq2, we have ∆2 ̃(cid:96) ď 2 ̃LαnD $ & Sÿ ÿ % s"1 pi,jqPrnsˆrmss rx,ijdgN pˆxij, x‹,ijq , . - , ́ ̄ rpsq y,ijdgpsq ij , zpsq pzpsq ‹,ij ` ÿ pi,jqPrnsˆrds 15 where ∆2 ̃(cid:96) " 1 nD $ & Sÿ % s"1 ÿ ́ pzpsq ij ́ zpsq ‹,ij ̄ 2 ` rpsq y,ij ÿ pi,jqPrnsˆrmss pi,jqPrnsˆrds rx,ij pˆxij ́ x‹,ijq2 , . - . Put (C.11) and (C.12) together, and we obtain " ∆2 ̃(cid:96) ď 2 ̃Lα a 3τ2 2 2rankpM‹q › › ›xM ́ M‹ › › ›A ́ pX ́ X‹ ́ τ1 › › › F * . ̄› › 2 › F (C.12) (C.13) With Lemma 1 and 5 in the Appendix, follow the proof of Theorem 3 in [7], our main theorem is proved. D AUXILIARY LEMMAS Lemma 1. Let arbitrary matrices S, T P G8pαq. Assume that τ2 ě 2}∇ ̃(cid:96)pTq} and ̃(cid:96)pSq ` τ2}S}‹ ď ̃(cid:96)pTq ́ τ1}ApSrds ́ Trdsq}2 F ` τ2}T}‹, where Srds consists of the first d columns of S. Then we have › ›P K › › ‹ ď 3 }PTpS ́ Tq}F ́ 2τ1τ ́1 TpS ́ Tq a minpAq 2 σ2 1. 2. }S ́ T}‹ ď 4 2rankpTq }S ́ T}F ́ 2τ1τ ́1 2 σ2 minpAq › › ›2 ›Srds ́ Trds F , › › ›2 ›Srds ́ Trds F . Proof. Rearranging the terms, we have τ2 p}S}‹ ́ }T}‹q ď ̃(cid:96)pTq ́ ̃(cid:96)pSq ́ τ1 › › ›2 ›ApSrds ́ Trdsq F . (D.14) By convexity of ̃(cid:96)p ̈q and (A.4), we have ̃(cid:96)pTq ́ ̃(cid:96)pSq ď x∇ ̃(cid:96)pTq, T ́ Sy ď › › › › ›∇ ̃(cid:96)pTq › }T ́ S}‹ ď τ2 2 }T ́ S}‹ . (D.15) Plug (D.15) in (D.14) with (A.8), and we obtain › › ‹ ́ τ2 }PTpS ́ Tq}‹ ď TpS ́ Tq › ›P K τ2 τ2 2 }T ́ S}‹ ́ τ1 › › ›2 ›ApSrds ́ Trdsq F . Rearranging terms, we have › ›P K › › TpS ́ Tq ‹ ď3 }PTpS ́ Tq}‹ ́ ď3 }PTpS ́ Tq}‹ ́ › › ›2 ›ApSrds ́ Trdsq F › › ›2 › F , pSrds ́ Trdsq σ2 minpAq 2τ1 τ2 2τ1 τ2 16 where the first part is proved. For the second part, we have }S ́ T}‹ › ›P K › ›P K › › TpS ́ Tq ` PTpS ́ Tq TpS ́ Tq " ď ‹ › › ‹ ` }PTpS ́ Tq}‹ › › σ2 pSrds ́ Trdsq minpAq › ›Srds ́ Trds σ2 minpAq 2τ1 τ2 › ›2 F 2τ1 τ2 › ›2 F . ď4 }PTpS ́ Tq}‹ ́ a ď4 2rankpTq }S ́ T}F ́ Lemma 2. Given S and T of arbitrary matrices with the same dimension, σminpSq }T}F ď }ST}F . Proof. By singular value decomposition, let S " USΛSVT cyclic property of trace operator, S and T " UTΛTVT T. Then by the }ST}2 F " ` ` › ›USΣSVT S UTΣTVT T › ›2 F SUSΣSVT TVSΣSUT VTΣTUT SVT VSΣ2 S UTΣTVT TVTΣTUT T ̆ ` UTΣTVT TVTΣTUT minpSqTr T minpSq }T}2 F . " tr " tr ě σ2 " σ2 ̆ S UTΣTVT T ̆ The following three lemmas can be adapted from [7]. Lemma 3 (Modified Lemma 5 of [7]). Suppose that Assumption 1 holds. There exists a positive constant c, such that c E p}ΣR}q ď ! ? γ ` a ) log pn _ Dq nD . Lemma 4 (Modified Lemma 6 of [7]). Suppose that Assumption 1, 3 and 4 hold and there exists a positive constant c, such that a ı › › › › ›∇ ̃(cid:96)pM‹q › ď cp ̃Uα _ 1{δq γ ` tlogpn _ Dqu3{2 holds with probability at least 1 ́ 4{pn ` Dq. " ? nD 17 Lemma 5 (Modified Lemma 19 of [7]). Suppose that Assumption 1 „ 3 hold. Let β " 946ppminnDq ́1α2 logpn ` Dq. Let HpM‹, α, β, μ, θq " ! ? H P G8pαq : }H ́ M‹}‹ ď * › › ›xM ́ M‹ ą β . › › 2 › Π,F 1 nD μ }H ́ M‹}F ́ θ › ›Hrds ́ M‹rds › ›2 F , Then, for any H P HpM‹, α, β, μ, θq, ˇ ˇ ˇ ˇ∆ ̃(cid:96)pH, M‹q ́ }H ́ M‹}2 ˇ ˇ ˇ ˇ ď Π,F 1 nD 1 2nD }H ́ M‹}2 Π,F ` 1392nDα2μ pmin tEp}ΣR}qu2 ` 5567α2 nDpmin , with probability at least 1 ́ 4pn ` Dq ́1. E Computational Time Comparison In terms of accuracy, our algorithm outperforms others. For the computational time, our algorithm enjoys a sublinear rate, which is the same as the CMS SI method. Besides, TS and MC 0 methods are just small deviations from TMCC method, and they enjoy the same sublinear convergence rate. We present the computational behavior among different methods under the missing rate ν " 80%, rank r = 15 with 50 trials. Further, the stopping criterion for the objective is κ " 1e ́ 7. For TS, the first stage (Feature matrix recovery) stopping criterion is κ0 " 1e ́ 12. The results are presented in Table 1, where the running time for TS consists of the time for the first stage plus that for the second stage. The results show the comparable elapsed time for the four methods. Table 1: Computational Time for Different Scenarios. Transformation Measure CMC SI TS MC 0 TMCC Linear Nonlinear Average Time(s) 569.82 1865.40 (185.19+1680.21) 676.20 Standard Error 78.19 801.61 (107.40+753.79) 50.86 926.53 125.39 Average Time(s) 271.78 1072.69 (201.79+870.90) 1141.88 1108.50 Standard Error 28.13 323.55 (110.12+255.70) 476.88 247.77 18
http://arxiv.org/abs/2302.09833v2
2023-05-03T20:03:53
2023-02-20T08:42:06
Domain-Specific Pre-training Improves Confidence in Whole Slide Image Classification
Whole Slide Images (WSIs) or histopathology images are used in digital pathology. WSIs pose great challenges to deep learning models for clinical diagnosis, owing to their size and lack of pixel-level annotations. With the recent advancements in computational pathology, newer multiple-instance learning-based models have been proposed. Multiple-instance learning for WSIs necessitates creating patches and uses the encoding of these patches for diagnosis. These models use generic pre-trained models (ResNet-50 pre-trained on ImageNet) for patch encoding. The recently proposed KimiaNet, a DenseNet121 model pre-trained on TCGA slides, is a domain-specific pre-trained model. This paper shows the effect of domain-specific pre-training on WSI classification. To investigate the effect of domain-specific pre-training, we considered the current state-of-the-art multiple-instance learning models, 1) CLAM, an attention-based model, and 2) TransMIL, a self-attention-based model, and evaluated the models' confidence and predictive performance in detecting primary brain tumors - gliomas. Domain-specific pre-training improves the confidence of the models and also achieves a new state-of-the-art performance of WSI-based glioma subtype classification, showing a high clinical applicability in assisting glioma diagnosis. We will publicly share our code and experimental results at https://github.com/soham-chitnis10/WSI-domain-specific.
[ "Soham Rohit Chitnis", "Sidong Liu", "Tirtharaj Dash", "Tanmay Tulsidas Verlekar", "Antonio Di Ieva", "Shlomo Berkovsky", "Lovekesh Vig", "Ashwin Srinivasan" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09833v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09833v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.AI", "cs.LG" ]
Domain-Specific Pre-training Improves Confidence in Whole Slide Image Classification Soham Rohit Chitnis1, Sidong Liu2,∗, Tirtharaj Dash3, Tanmay Tulsidas Verlekar1, Antonio Di Ieva2,∗, Shlomo Berkovsky2,∗, Lovekesh Vig4, Ashwin Srinivasan1 3 2 0 2 y a M 3 ] V C . s c [ 2 v 3 3 8 9 0 . 2 0 3 2 : v i X r a Abstract- Whole Slide Images (WSIs) or histopathology images are used in digital pathology. WSIs pose great challenges to deep learning models for clinical diagnosis, owing to their size and lack of pixel-level annotations. With the recent advancements in computational pathology, newer multiple-instance learning-based models have been proposed. Multiple-instance learning for WSIs necessitates creating patches and uses the encoding of these patches for diagnosis. These models use generic pre-trained models (ResNet-50 pre- trained on ImageNet) for patch encoding. The recently proposed KimiaNet, a DenseNet121 model pre-trained on TCGA slides, is a domain-specific pre-trained model. This paper shows the effect of domain-specific pre-training on WSI classification. To investigate the effect of domain-specific pre-training, we considered the current state-of-the-art multiple-instance learning models, 1) CLAM, an attention-based model, and 2) TransMIL, a self-attention-based model, and evaluated the models' confidence and predictive performance in detecting primary brain tumors - gliomas. Domain-specific pre-training the models and also achieves improves the confidence of a new state-of-the-art performance of WSI-based glioma subtype classification, showing a high clinical applicability in assisting glioma diagnosis. We will publicly share our code and experimental results at https://github.com/ soham-chitnis10/WSI-domain-specific. Keywords- Domain-specific Pre-training, Whole Slide Image Classification, Multiple Instance Learning, Brain Tumor I. INTRODUCTION Currently, histopathology is the clinical gold standard for tumor assessment and diagnosis. With advancements in digital pathology and artificial intelligence (AI), deep learning techniques have shown great potential in assisting tumor diagnosis. However, deep learning-based approaches require either manually annotated whole slide images (WSIs) or large datasets with slide-level labels in a weakly su- pervised setting. The slide-level labels may correspond to small regions from the gigapixel WSIs. Therefore, most of the approaches rely on pixel, patch, or regions-of-interest (ROI) level annotations [1], [2], [3], [4]. There have been attempts to assign the same label to each patch [5], but these approaches suffer from noisy training and are not applicable *Sidong Liu and Antonio Di Ieva were supported by an Australian NHMRC Ideas Grant. 1Soham Rohit Chitnis, Tanmay Tulsidas Verlekar, and Ashwin Srinivasan are with Department of Computer Science & Information Systems, Birla Institute of Technology and Science, Pilani 2Sidong Liu, Antonio Di Ieva and Shlomo Berkovsky are with Faculty of Medicine, Health and Human Sciences, Macquarie University 3Tirtharaj Dash is with Boolean Lab, University of California, San Diego 4Lovekesh Vig is with TCS Research, India when the slide-level label corresponds to tiny regions from the image. Recently proposed multiple-instance learning models use feature embedding [6], [7], [8], [9], [10], [11]. Clustering- constrained Attention Multiple instance learning (CLAM) [10] is a deep learning-based digital pathology framework for weakly supervised WSI classification using attention- based instance-level clustering. The CLAM algorithm does not require ROI extraction, or pixel or tile or patch-level annotations. The algorithm works based on the attention scores assigned to the tiles or patches during the training, where the highest attention scores are considered positive evidence of the class. A ResNet50 network [12] pre-trained on the ImageNet dataset is used for extracting features from tiles or patches obtained from the segmented tissue region. CLAM produces interpretable heatmaps that allow medical practitioners to visualize the tissue regions that contribute to the predictions of the model. These heatmaps displaying the morphological features can be verified by trained patholo- gists whether the decisions made by the model align with the manual diagnostic determinations. TransMIL [11] is a recently proposed model which is based on a transformer model. Just like CLAM, TransMIL only requires a slide-level label and also shows great interpretability. Training a deep neural network from scratch for specific problem statements may not be feasible due to limited avail- able data, or training may take a very long time. Therefore, many researchers exploit pre-trained models. In domain- specific pre-training, the models are first pre-trained on a large dataset, followed by a fine-tuning over the domain- specific dataset. Generally, in computer vision, models pre- trained on ImageNet data have been used for domain-specific downstream tasks. We call a model pre-trained on ImageNet as generic pre-trained, and the model fine-tuned on a domain- specific dataset as domain-specific pre-trained. Current state-of-the-art WSI classification models, such as CLAM and TransMIL, are based on features extracted by generic pre-trained models, e.g., ResNet50 pre-trained on ImageNet samples, which differ from WSIs in terms of color, texture, morphological, and geometric representations. However, the impact of domain-specific pre-training on WSI classification has not yet been investigated. Our main con- tributions are as follows: • We introduce Confidence as an evaluation metric for WSI classification. • We investigate the impact of domain-specific pre- training on the model's performance and confidence. II. EMPIRICAL EVALUATION standard cross-entropy loss, and the instance clustering loss is a smooth SVM loss. For the instance clustering level, we consider B = 8, which is 8 positive and negative samples. A. Aims We conjecture that domain-specific pre-training improves not just the accuracy, but also the confidence in prediction of the models for WSI classification. We will test this conjecture using the following pre-training methods (a) a generic pre- trained model, DenseNet121 (pre-trained on ImageNet Data), (b) a domain-specific pre-trained model, KimiaNet (pre- trained on WSIs). Generic and domain-specific pre-trained models are used as inputs to two different approaches for constructing models for WSI: (a) CLAM and (b) TransMIL. TransMIL It uses a self-attention-based mechanism to model the correlation between the patches. TransMIL has two transformer layers for aggregating the morphological information. TransMIL has adopted the approximation for self-attention proposed in the Nystr ̈om method [20]. It uses the Pyramid Positional Encoding Generator (PPEG) for positional encoding, which can encode global and context information. TransMIL uses the standard cross-entropy loss for training the model. B. Datasets D. Evaluation Metrics Two datasets are used for pre-training feature extrac- tors, including ImageNet and The Cancer Genome Atlas (TCGA). ImageNet dataset is a classical collection of nat- ural images for the visual recognition task [13]. ResNet50 and DenseNet121 Networks are pre-trained on this dataset. TCGA is the large domain-specific dataset on which Kimi- aNet was trained. This is a publicly available repository [14], [15], [16] with 30,072 WSIs. KimiaNet was trained on a subset of this dataset with 11,579 WSIs with permanent hematoxylin and eosin (H&E) sections. Further details are available in [17]. The Digital Brain Tumor Atlas (DBTA) dataset [18] is the classification models. DBTA used to train and test dataset consists of 3,115 slides of 126 brain tumor types. A subset of this dataset contains a total of 866 histopathology slides of 791 patients with the 5 primary brain tumor types with molecular subtypes based on the 2021 WHO classi- fication of central nervous system tumors [19], including 117 astrocytoma-IDH mutant, 66 astrocytoma-IDH wildtype, 176 oligodendroglioma-IDH wildtype, 34 glioblastoma-IDH mutant, and 473 glioblastoma-IDH wildtype WSIs. The 70:15:15 split is used for the training, validation, and test sets. As several patients have multiple slides, we ensure that different slides of a patient do not exist in both the training and test sets. C. Models We focus on the recently developed state-of-the-art models, CLAM [10], and TransMIL [11], both of which are multiple-instance learning models. branch (CLAM-SB) and multiple CLAM: We consider two variants of CLAM, namely single branches (CLAM-MB). CLAM uses attention-based pooling [6] to aggregate the slide-level representations from patch-level representations. CLAM has N multi-class attention branches for the N multi-classification problem, which are used to score the class-specific slide-level representations. During training, it has the instance clustering level, which can learn the class-specific features; therefore, CLAM uses a weighted loss of the slide-level classification, and the instance-level clustering loss is used. The slide-level classification is the The state-of-the-art models have used accuracy and Area Under the Receiver Operating Characteristic Curve (AUC) as the evaluation metrics for benchmarking. We also evaluate the confidence of models, which is the average class prob- ability of the predicted class. Confidence is given by the equation (1), where ypred is the predicted class-label, and x is a sample from the test set X. Conf idence = (cid:80) x P (ypred|x) |X| (1) E. Algorithms and Machines We train all models on NVIDIA Tesla V100-SXM2 GPU with 32GB memory. The code has been implemented using PyTorch Deep Learning Framework, and Python net:cal library [21] is used for evaluation of the confidence of the model. III. METHOD A. Pre-Processing The gigantic size of WSIs poses challenges in training a model in an end-to-end fashion and would require expensive computing power; therefore, multiple-instance learning models are proposed. In the context of WSI classification, we consider the slide as the bag and the patches of the slides as the instances. Figure 1 shows the key steps of the WSI pre-processing pipeline. Segmentation and patching For the segmentation and patching of each slide, we use the highly efficient method proposed by CLAM [10]. Patches of size 256 x 256 are cropped from the segmented foreground contours. DBTA has the slide image captured at 20x and 40x resolution. The higher the number of patches, leading to higher computational requirements. Therefore all models have been trained at 20x magnification. the magnification, the higher Feature extraction The MIL-based models require cre- ating patches from the slides. CLAM [10] and TransMIL [11] methods require a feature extraction process. They the features using a generic pre-trained model, extract The following additional details are relevant: - data-seed is responsible for the train/validation/test split, and model-seed is responsible for the initializa- tion of model parameters. The number of data-seed is 5 and the number of model-seed is 3 in this study, so there are 15 combinations in total. In all cases, average values over all 15 experiments of accuracy, AUC, and confidence are used for comparison. - We train models for 200 epochs in each run and use 'early stopping' with patience of 20 epochs. We train the model for at least 50 epochs to ensure the model has converged. The learning rate is set to 2e-4 with weight decay of 1e-5. The batch size is set to 1. - Adam optimizer [23] is used for training CLAM, and Lookahead optimizer [24] is used for training Trans- MIL. - Multinomial sampling is used to mitigate the class imbalance problem in the training set. The multinomial sampling probabilities are inversely proportional to the frequency of the ground truth. IV. RESULTS The main results from our experiments comparing generic and domain-specific pre-training are presented in Table I. The most interesting observation is that domain-specific pre- training results in higher average confidence in prediction (by 0.3% to 1.3%), which appears to be less well-known. The impact of domain-specific pre-training on the model's test accuracy and AUC are not conclusive. For example, when using CLAM as the classification model, KimiaNet results in higher accuracy, but DenseNet results in higher AUC, and it is the opposite when using TransMIL. We also note that, unlike the results in [11], which showed a clear advantage of using the transformer-based approach, we find results for TransMIL are mixed. This may be due to differences in the dataset we have used, which is different to the benchmarks used, or due to differences in hyper-parameter tuning. TABLE I EVALUATION OF DOMAIN-SPECIFIC PRE-TRAINING Models CLAM-SB CLAM-MB TransMIL AUC Accuracy Confidence DenseNet 95.86 (± 1.80) 96.53 (± 1.73) 95.52 (± 2.76) KimiaNet 95.69 (± 1.99) 96.27 (± 1.51) 96.85 (± 1.20) DenseNet 88.24 (± 3.74) 88.74 (± 2.64) 90.58 (± 1.93) KimiaNet 89.84 (± 2.60) 89.72 (± 4.03) 89.36 (± 2.30 DenseNet 92.64 (± 3.37) 93.08 (± 2.67) 93.28 (± 4.98) KimiaNet 93.51 (± 2.52) 94.37 (± 4.18) 93.57 (± 3.43) Table II shows a comparison between ResNet50 and DenseNet121. We note that the structure of the generic pre- trained model also plays an important role in improving both predictive accuracy (by 1.1% to 4.6%) and confidence (by 1.6% to 9.6%). Since the DenseNet structure is uti- lized by KimiaNet, the gains made by using the DenseNet structure are incorporated in the results with KimiaNet. In combination, we believe the results provide evidence for the improved performance on model's confidence with domain- specific pre-training, irrespective of the CLAM or TransMIL models used for classification. Fig. 1. The WSI pre-processing pipeline. ResNet50 network pre-trained of the ImageNet data. There- fore, ResNet50 is considered the baseline. DenseNet archi- tecture has shown better results on the ImageNet dataset due to the dense connections between all layers with match- ing feature-maps sizes [22]. Instead of the generic pre- trained model (DenseNet121), we propose to use the domain- specific pre-trained network called KimiaNet [17], which is a DenseNet121 network pre-trained on TCGA data. We will consider the DenseNet121 network, pre-trained on ImageNet, for comparison with KimiaNet, whose structure is the same. B. Experimental Procedure Our procedure to test the experimental conjecture in Sec. II-A is straightforward: 1) Let a slide be denoted by s, where s ∈ S , the set of slides 2) For each s ∈ S , segment and create patches; the set of all patches of s is denoted by p pre-training method each 3) For in {ResNet50, DenseNet121, KimiaNet} • For each p, extract features • Let D denote an array of data seeds, and M denote an array of model seeds • For each data-seed in D: – Split the dataset into train/validation/test sets – For each model-seed in M : ∗ Use the selected features to train each classi- fication model in {CLAM-SB, CLAM-MB, TransMIL} ∗ Estimate the test accuracy, AUC, and confi- dence of the classification model Classification of glioma types (i.e., astrocytoma, oligoden- droglioma, and glioblastoma) is generally a difficult task; the current state-of-the-art performance is accuracy of 0.861 and AUC of 0.961 [25]. Classification of glioma molecular subtypes is also challenging; for instance, the best binary classification performance of the IDH-gene molecular sub- type is accuracy of 0.882, and AUC of 0.931 [26]. We test our models on the classification of both glioma types and molecular subtypes, which is a more challenging task, yet the models that use KimiaNet or DenseNet with TransMIL outperform this prior art. TABLE II EVALUATION OF THE STRUCTURE OF FEATURE EXTRACTOR Models CLAM-SB CLAM-MB TransMIL AUC Accuracy Confidence ResNet 95.43 (± 1.35) 96.70 (± 1.03) 95.40 (± 2.53) DenseNet 95.86 (± 1.80) 96.53 (± 1.73) 95.52 (± 2.76) ResNet 83.67 (± 4.23) 87.65 (± 2.87) 88.18 (± 3.53 DenseNet 88.24 (± 3.74) 88.74 (± 2.64) 90.58 (± 1.93) ResNet 83.05 (± 4.85) 89.07 (± 4.18) 91.69 (± 3.92) DenseNet 92.64 (± 3.37) 93.08 (± 2.67) 93.28 (± 4.98) V. CONCLUSIONS This work is the first study that investigates the impact of domain-specific pre-training in WSI classification and uses confidence as a metric to evaluate the model's performance. We first consider the DenseNet model pre-trained on Im- ageNet and assess its accuracy, AUC and confidence when combined with CLAM and TransMIL to classify brain tumor WSIs. We then explore KimiaNet, a DenseNet121 model pre- trained on TCGA slides to tackle the same problem. We propose domain-specific pre-training of KimiaNet improves the classification accuracy, AUC and confidence of CLAM and TransMIL. The evaluation of our proposal on the DBTA dataset suggests that KimiaNet is a better feature extractor than generic DenseNet and ResNet, as it improves CLAM and TransMIL's confidence. Additionally, using TransMIL with KimiaNet achieves a new state-of-the-art performance of WSI-based glioma classification, which shows high clini- cal applicability of the model in assisting glioma diagnosis, particularly in predicting the molecular subtypes. This study also sheds light on the impact of the feature extractor's structure on the prediction performance. In our future work, we will investigate if advanced convolutional structures can further benefit multiple-instance learning models and im- prove their classification performance. REFERENCES [1] S. Wang, Y. Zhu et al., "Rmdl: Recalibrated multi-instance deep learning for whole slide gastric image classification," Medical Image Analysis, vol. 58, p. 101549, 12 2019. [2] P.-H. C. Chen, K. Gadepalli et al., "An augmented reality microscope with real-time artificial intelligence integration for cancer diagnosis," Nature Medicine, vol. 25, pp. 1453–1457, 9 2019. [3] K. Nagpal, D. Foote et al., "Development and validation of a deep learning algorithm for improving gleason scoring of prostate cancer," npj Digital Medicine, vol. 2, p. 48, 6 2019. [4] B. E. Bejnordi, M. Veta et al., "Diagnostic assessment of deep learning algorithms for detection of lymph node metastases in women with breast cancer," JAMA, vol. 318, p. 2199, 12 2017. [5] N. Coudray, P. S. Ocampo et al., "Classification and mutation pre- diction from non–small cell lung cancer histopathology images using deep learning," Nature Medicine, vol. 24, pp. 1559–1567, 10 2018. [6] M. Ilse, J. Tomczak, and M. Welling, "Attention-based deep multiple instance learning," in Proceedings of the 35th International Conference on Machine Learning, ser. Proceedings of Machine Learning Research, J. Dy and A. Krause, Eds., vol. 80. PMLR, 10–15 Jul 2018, pp. 2127–2136. [Online]. Available: https: //proceedings.mlr.press/v80/ilse18a.html [7] N. Tomita, B. Abdollahi, J. Wei, B. Ren, A. Suriawinata, and S. Hassanpour, "Attention-Based Deep Neural Networks for Detection of Cancerous and Precancerous Esophagus Tissue on Histopathological Slides," JAMA Network Open, vol. 2, no. 11, pp. e1 914 645–e1 914 645, 11 2019. [Online]. Available: https: //doi.org/10.1001/jamanetworkopen.2019.14645 [8] N. Hashimoto, D. Fukushima et al., "Multi-scale domain-adversarial multiple-instance CNN for cancer subtype classification with non- images," CoRR, vol. abs/2001.01599, annotated histopathological 2020. [9] N. Naik, A. Madani et al., "Deep learning-enabled breast cancer hormonal receptor status determination from base-level h&e stains." Nature communications, vol. 11, p. 5727, 11 2020. [10] M. Y. Lu, D. F. K. Williamson, T. Y. Chen, R. J. Chen, M. Barbieri, and F. Mahmood, "Data-efficient and weakly supervised computational pathology on whole-slide images," Nature Biomedical Engineering, vol. 5, pp. 555–570, 3 2021. [11] Z. Shao, H. Bian et al., "Transmil: Transformer based correlated multiple instance learning for whole slide image classication," in Neural Information Processing Systems, 2021. [12] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," CoRR, vol. abs/1512.03385, 2015. [13] O. Russakovsky, J. Deng et al., "Imagenet large scale visual recogni- tion challenge," International Journal of Computer Vision, vol. 115, pp. 211–252, 12 2015. [14] D. A. Gutman, J. Cobb et al., "Cancer digital slide archive: an informatics resource to support integrated in silico analysis of tcga pathology data." Journal of the American Medical Informatics Asso- ciation : JAMIA, vol. 20, pp. 1091–8, 2013. [15] K. Tomczak, P. Czerwi ́nska, and M. Wiznerowicz, "The cancer genome atlas (tcga): an immeasurable source of knowledge." Con- temporary oncology (Poznan, Poland), vol. 19, pp. A68–77, 2015. [16] L. A. Cooper, E. G. Demicco, J. H. Saltz, R. T. Powell, A. Rao, and A. J. Lazar, "Pancancer insights from the cancer genome atlas: the pathologist's perspective." The Journal of pathology, vol. 244, pp. 512–524, 4 2018. [17] A. Riasatian, M. Babaie et al., "Fine-tuning and training of densenet for histopathology image representation using tcga diagnostic slides," Medical Image Analysis, vol. 70, p. 102032, 5 2021. [18] T. Roetzer-Pejrimovsky, A.-C. Moser et al., "The digital brain tumour atlas, an open histopathology resource," Scientific Data, vol. 9, p. 55, 2 2022. [19] D. N. Louis, A. Perry et al., "The 2021 who classification of tumors of the central nervous system: a summary," Neuro-Oncology, vol. 23, pp. 1231–1251, 8 2021. [20] Y. Xiong, Z. Zeng et al., "Nystr ̈omformer: A nystr ̈om-based algorithm for approximating self-attention," CoRR, vol. abs/2102.03902, 2021. [21] F. K ̈uppers, J. Kronenberger, A. Shantia, and A. Haselhoff, "Multi- variate confidence calibration for object detection," in The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, June 2020. [22] G. Huang, Z. Liu, and K. Q. Weinberger, "Densely connected convo- lutional networks," CoRR, vol. abs/1608.06993, 2016. [23] D. P. Kingma and J. Ba, "Adam: A method for stochastic optimiza- tion," CoRR, vol. abs/1412.6980, 2014. [24] M. R. Zhang, J. Lucas, G. Hinton, and J. Ba, Lookahead Optimizer: K Steps Forward, 1 Step Back. Red Hook, NY, USA: Curran Associates Inc., 2019. [25] L. Jose, S. Liu et al., "Artificial Intelligence–Assisted Classification of Gliomas Using Whole-Slide Images," Archives of Pathology & Laboratory Medicine, 11 2022. [Online]. Available: https: //doi.org/10.5858/arpa.2021-0518-OA [26] S. Liu, Z. Shah et al., "Isocitrate dehydrogenase (IDH) status prediction in histopathology images of gliomas using deep learning," Scientific Reports, vol. 10, 05 2020. [Online]. Available: https: //doi.org/10.1038/s41598-020-64588-y
http://arxiv.org/abs/2302.09832v2
2023-05-24T18:08:20
2023-02-20T08:37:44
TAMUNA: Doubly Accelerated Federated Learning with Local Training, Compression, and Partial Participation
In federated learning, a large number of users collaborate to learn a global model. They alternate local computations and communication with a distant server. Communication, which can be slow and costly, is the main bottleneck in this setting. In addition to communication-efficiency, a robust algorithm should allow for partial participation, the desirable feature that not all clients need to participate to every round of the training process. To reduce the communication load and therefore accelerate distributed gradient descent, two strategies are popular: 1) communicate less frequently; that is, perform several iterations of local computations between the communication rounds; and 2) communicate compressed information instead of full-dimensional vectors. We propose TAMUNA, the first algorithm for distributed optimization and federated learning, which harnesses these two strategies jointly and allows for partial participation. TAMUNA converges linearly to an exact solution in the strongly convex setting, with a doubly accelerated rate: it provably benefits from the two acceleration mechanisms provided by local training and compression, namely a better dependency on the condition number of the functions and on the model dimension, respectively.
[ "Laurent Condat", "Ivan Agarský", "Grigory Malinovsky", "Peter Richtárik" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09832v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09832v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "math.OC" ]
TAMUNA: Doubly Accelerated Federated Learning with Local Training, Compression, and Partial Participation Laurent Condat1 Ivan Agarský2,3 Grigory Malinovsky1 Peter Richtárik1 1King Abdullah University of Science and Technology (KAUST) Thuwal, Kingdom of Saudi Arabia 2Brno University of Technology Brno, Czech Republic 3Kempelen Institute of Intelligent Technologies (KInIT) Bratislava, Slovakia May 2023 Abstract In federated learning, a large number of users collaborate to learn a global model. They alternate local computations and communication with a distant server. Communication, which can be slow and costly, is the main bottleneck in this setting. In addition to communication-efficiency, a robust algorithm should allow for partial participation, the desirable feature that not all clients need to participate to every round of the training process. To reduce the communication load and therefore accelerate distributed gradient descent, two strategies are popular: 1) communicate less frequently; that is, perform several iterations of local computations between the communication rounds; and 2) communicate compressed information instead of full-dimensional vectors. We propose TAMUNA, the first algorithm for distributed optimization and federated learning, which harnesses these two strategies jointly and allows for partial participation. TAMUNA converges linearly to an exact solution in the strongly convex setting, with a doubly accelerated rate: it provably benefits from the two acceleration mechanisms provided by local training and compression, namely a better dependency on the condition number of the functions and on the model dimension, respectively. 3 2 0 2 y a M 4 2 ] G L . s c [ 2 v 2 3 8 9 0 . 2 0 3 2 : v i X r a 1 Contents 1 Introduction 1.1 Formalism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Asymmetric communication regime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Communication efficiency in FL: state of the art 1.3.1 Local Training (LT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.2 Partial Participation (PP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.3 Communication Compression (CC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4.1 Combining LT and PP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4.2 Combining LT and CC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4 Challenges and contributions 2 Proposed algorithm TAMUNA 3 Iteration and communication complexities 4 Experiments A Proof of Theorem 1 A.1 The random variable dt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.2 From Algorithm 2 to TAMUNA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B Proof of Theorem 2 C Sublinear convergence in the convex case 3 3 4 5 5 6 6 7 8 9 11 13 15 23 28 30 32 33 2 1 Introduction Federated Learning (FL) is a novel paradigm for training supervised machine learning models. Initiated a few years ago (Konečný et al., 2016a,b; McMahan et al., 2017; Bonawitz et al., 2017), it has become a rapidly growing interdisciplinary field. The key idea is to exploit the wealth of information stored on edge devices, such as mobile phones, sensors and hospital workstations, to train global models, in a collaborative way, while handling a multitude of challenges, like data privacy (Kairouz et al., 2021; Li et al., 2020; Wang et al., 2021). In contrast to centralized learning in a datacenter, in FL, the parallel computing units have private data stored on each of them and communicate with a distant orchestrating server, which aggregates the information and synchronizes the computations, so that the process reaches a consensus and converges to a globally optimal model. In this framework, communication between the parallel workers and the server, which can take place over the internet or cell phone network, can be slow, costly, and unreliable. Thus, communication dominates the overall duration and cost of the process and is the main bottleneck to be addressed by the community, before FL can be widely adopted and applied in our daily lives. The baseline algorithm of distributed Gradient Descent (GD) alternates between two steps: one round of parallel computation of the local function gradients at the current model estimate, and one round of communication of these gradient vectors to the server, which averages them to form the new estimate for the next iteration. To decrease the communication load, two strategies can be used: 1) communicate less frequently, or equivalently do more local computations between successive communication rounds; or 2) compress the communicated vectors. We detail these two strategies in Section 1.3. Moreover, in practical applications where FL is deployed, it is unrealistic to assume that all clients are available 100% of the time to perform the required computation and communication operations. Thus, partial participation is an essential feature in practice, whereby only part of the clients need to participate in any given round of the process, while maintaining the overall convergence guarantees. In this paper, we propose a new randomized algorithm named TAMUNA, which combines local training and compression for communication-efficient FL. It is variance-reduced (Hanzely & Richtárik, 2019; Gorbunov et al., 2020a; Gower et al., 2020), so that it converges to an exact solution (with exact gradients), and provably benefits from the two mechanisms: the convergence rate is doubly accelerated, with a better dependency on the condition number of the functions and on the dimension of the model, in comparison with GD. In addition, TAMUNA handles partial participation of the clients. In the remainder of this section, we formulate the setup, we propose a new model to characterize the communication complexity, we present the state of the art, and we summarize our contributions. 1.1 Formalism We consider a distributed client-server setting, in which n ≥ 2 clients perform computations in parallel and communicate back and forth with a server. We study the convex optimization problem: minimize x∈Rd f (x) := 1 n n (cid:88) i=1 fi(x), (1) where each function fi : Rd → R models the individual cost of client i ∈ [n] := {1, . . . , n}, based on its underlying private data. The number n of clients, as well as the dimension d ≥ 1 of the 3 model, are typically large. This problem is of key importance as it is an abstraction of empirical risk minimization, the dominant framework in supervised machine learning. For every i ∈ [n], the function fi is supposed L-smooth and μ-strongly convex,1 for some L ≥ μ > 0 (a sublinear convergence result is derived in the Appendix for the merely convex case, i.e. μ = 0). Thus, the sought solution x⋆ of (1) exists and is unique. We define κ := L μ . We focus on the strongly convex case, because the analysis of linear convergence rates in this setting gives clear insights and allows us to deepen our theoretical understanding of the algorithmic mechanisms under study; in our case, local training, communication compression, and partial participation. The analysis of algorithms converging to a point with zero gradient in (1) with nonconvex functions relies on significantly different proof techniques (Karimireddy et al., 2021; Das et al., 2022), so the nonconvex setting is out of the scope of this paper. To solve the problem (1), the baseline algorithm of Gradient Descent (GD) consists in the simple iteration, for t = 0, 1, . . . , xt+1 := xt − γ n n (cid:88) i=1 ∇fi(xt), for some stepsize γ ∈ (0, 2 L ). That is, at iteration t, xt is first broadcast by the server to all clients, which compute the gradients ∇fi(xt) in parallel. These vectors are then sent to the server, which averages them and performs the gradient descent step. It is well known that for γ = Θ( 1 L ), GD converges linearly, with iteration complexity O(κ log ε−1) to reach ε-accuracy. Since d-dimensional vectors are communicated at every iteration, the communication complexity of GD in number of reals is O(dκ log ε−1). Our goal is a twofold acceleration of GD, with a better dependency to both κ and d in this complexity. We want to achieve this goal by leveraging the best of the two popular mechanisms of local training and communication compression. 1.2 Asymmetric communication regime Uplink and downlink communication. We call uplink communication (UpCom) the parallel transmission of data from the clients to the server and downlink communication (DownCom) the broadcast of the same message from the server to all clients. UpCom is usually significantly slower than DownCom, just like uploading is slower than downloading on the internet or cell phone network. This can be due to the asymmetry of the service provider's systems or protocols used on the communication network, or cache memory and aggregation speed constraints of the server, which has to decode and average the large number n of vectors received at the same time during UpCom. Communication complexity. We measure the UpCom or DownCom complexity as the expected number of communication rounds needed to estimate a solution with ε-accuracy, multiplied by the number of real values sent during a communication round between the server and any client. Thus, the UpCom or DownCom complexity of GD is O(dκ log ε−1)). We leave if for future work to refine this model of counting real numbers, to take into account how sequences of real numbers are quantized into bitstreams, achieving further compression (Horváth et al., 2022; Albasyoni et al., 2020). 1A function f : Rd → R is said to be L-smooth if it is differentiable and its gradient is Lipschitz continuous with constant L; that is, for every x ∈ Rd and y ∈ Rd, ∥∇f (x) − ∇f (y)∥ ≤ L∥x − y∥, where, here and throughout the paper, the norm is the Euclidean norm. f is said to be μ-strongly convex if f − μ 2 ∥ * ∥2 is convex. We refer to Bauschke & Combettes (2017) for such standard notions of convex analysis. 4 A model for the overall communication complexity. Since UpCom is usually slower than DownCom, we propose to measure the total communication (TotalCom) complexity as a weighted sum of the two UpCom and DownCom complexities: we assume that the UpCom cost is 1 (unit of time per transmitted real number), whereas the downCom cost is α ∈ [0, 1]. Therefore, TotalCom = UpCom + α.DownCom. (2) A symmetric but unrealistic communication regime corresponds to α = 1, whereas ignoring downCom and focusing on UpCom, which is usually the limiting factor, corresponds to α = 0. We will provide explicit expressions of the parameters of our algorithm to minimize the TotalCom complexity for any given α ∈ [0, 1], keeping in mind that realistic settings correspond to small values of α. Thus, our model of communication complexity is richer than only considering α = 0, as is usually the case. 1.3 Communication efficiency in FL: state of the art Two approaches come naturally to mind to decrease the communication load: Local Training (LT), which consists in communicating less frequently than at every iteration, and Communication Compression (CC), which consists in sending less than d floats during every communication round. In this section, we review existing work related to these two strategies and to Partial Participation (PP). 1.3.1 Local Training (LT) LT is a conceptually simple and surprisingly powerful communication-acceleration technique. It consists in the clients performing multiple local GD steps instead of only one, between successive communication rounds. This intuitively results in "better" information being communicated, so that less communication rounds are needed to reach a given accuracy. As shown by ample empirical evidence, LT is very efficient in practice. It was popularized by the FedAvg algorithm of McMahan et al. (2017), in which LT is a core component. However, LT was heuristic and no theory was provided in their paper. LT was analyzed in several works, in the homogeneous, or i.i.d. data, regime (Haddadpour & Mahdavi, 2019), and in the heterogeneous regime, which is more representative in FL (Khaled et al., 2019, 2020; Stich, 2019; Woodworth et al., 2020; Gorbunov et al., 2021; Glasgow et al., 2022). It stands out that LT suffers from so-called client drift, which is the fact that the local model obtained by client i after several local GD steps approaches the minimizer of its local cost function fi. The discrepancy between the exact solution x⋆ of (1) and the approximate solution obtained at convergence of LT was characterized in Malinovsky et al. (2020). This deficiency of LT was corrected in the Scaffold algorithm of Karimireddy et al. (2020) by introducing control variates, which correct for the client drift, so that the algorithm converges linearly to the exact solution. S-Local-GD (Gorbunov et al., 2021) and FedLin (Mitra et al., 2021) were later proposed, with similar convergence properties. Yet, despite the empirical superiority of these recent algorithms relying on LT, their communication complexity remains the same as vanilla GD, i.e. O(dκ log ε−1). Most recently, a breakthrough was made with the appearance of accelerated LT methods. Scaffnew, κ log ε−1) proposed by Mishchenko et al. (2022), is the first LT-based algorithm achieving O(d accelerated communication complexity. In Scaffnew, communication is triggered randomly with a small probability p at every iteration. Thus, the expected number of local GD steps between two κ instead of communication rounds is 1/p. By choosing p = 1/ κ (Scaman et al., 2019) is obtained. In this paper, we propose to go even further and tackle the κ, the optimal dependency on √ √ √ 5 multiplicative factor d in the complexity of Scaffnew. Scaffnew has been extended in Malinovsky et al. (2022), using calls to variance-reduced (Gorbunov et al., 2020a; Gower et al., 2020) stochastic gradient estimates instead of exact gradients. It was also analyzed as a particular case of a general class of randomized primal–dual algorithms in Condat & Richtárik (2023). Without compression and in case of full participation, TAMUNA reverts to Scaffnew. A different approach was developed by Sadiev et al. (2022a) with the APDA-Inexact algorithm, and then by Grudzień et al. (2023) with the 5GCS algorithm: in both algorithms, the local steps correspond to an inner loop to compute a proximity operator inexactly. 1.3.2 Partial Participation (PP) PP, a.k.a. client sampling, is the property that not all clients need to participate in a given round, consisting of a series of local steps followed by communication with the server. This is an important feature for a FL method, since in practice, there are many reasons for which a client might be idle and unable to do any computation and communication for a certain period of time. PP in SGD-type methods is now well understood (Gower et al., 2019; Condat & Richtárik, 2022), but its combination with LT has remained unconvincing so far. Indeed, Scaffold allows for LT and PP, but its communication complexity does not benefit from LT. Scaffnew does not allow for PP. This was the motivation for Grudzień et al. (2023) to develop 5GCS, which is, to the best of our knowledge, the first and only algorithm enabling LT and PP, and enjoying accelerated communication. We refer to Grudzień et al. (2023) for a detailed discussion of the literature of LT and PP. 5GCS is completely different from Scaffnew and based on Point-SAGA (Defazio, 2016) instead of GD. Thus, it is an indirect, or two-level, combination of LT and PP: PP comes from the random selection of the activated proximity operators, whereas LT corresponds to an inner loop to compute these proximity operators inexactly. TAMUNA is a direct combination of LT and PP as two intertwined stochastic processes. TAMUNA reverts to Scaffnew in case of full participation (and no compression); in other words, TAMUNA is the first generalization of Scaffnew to PP, and it fully retains its LT-based communication acceleration benefits. Throughout the paper, we denote by c ∈ {2, . . . , n} the cohort size, or number of active clients participating in every round. We report in Table 1 the communication complexity of the two known algorithms converging linearly to the exact solution, while allowing for LT and PP, namely Scaffold and 5GCS. Scaffold is not accelerated, with a complexity depending on κ, and 5GCS is accelerated with respect to κ but not d. Also, in 5GCS the number of local steps in each communication round is fixed of order at least (cid:0)(cid:112) cκ n + 1(cid:1) log κ, whereas in TAMUNA it is random and typically much smaller, of order (cid:112) sκ n + 1, where s can be as small as 2, see (14). 1.3.3 Communication Compression (CC) To decrease the communication complexity, a widely used strategy is to make use of (lossy) compres- sion; that is, a possibly randomized mapping C : Rd → Rd is applied to the vector x that needs to be communicated, with the property that it is much faster to transfer C(x) than the full d-dimensional vector x. A popular sparsifying compressor is rand-k, for some k ∈ [d] := {1, . . . , d}, which multiplies k elements of x, chosen uniformly at random, by d/k, and sets the other ones to zero. If the receiver knows which coordinates have been selected, e.g. by running the same pseudo-random generator, only these k elements of x are actually communicated, so that the communication complexity is divided by the compression factor d/k. Another sparsifying compressor is top-k, which keeps the k elements 6 Table 1: UpCom complexity (α = 0) of linearly converging algorithms with LT or CC and allowing for PP (with exact gradients). The (cid:101)O notation hides the log ε−1 factor (and other log factors for Scaffold). c ∈ {2, . . . , n} is the number of participating clients. Algorithm DIANA-PP (a) Scaffold 5GCS TAMUNA LT CC ✓ ✗ ✗ ✓ ✗ ✓ ✓ ✓ (cid:16)√ (cid:101)O UpCom (cid:101)O(cid:0)(1 + d c c )κ + d n (cid:101)O(dκ + d n c ) √ κ(cid:112) n c + d n √ κ c + d c √ n κ(cid:112) n (cid:101)O(cid:0)d √ (cid:1) (cid:1) d (cid:17) c c + d n √ κ(cid:112) n √ d (a) using independent rand-1 compressors, for instance. Note that c and d c is better than d c κ + d n c + d n √ κ √ n κ + d n c , so that TAMUNA has a better complexity than DIANA-PP. c + d n c is better than of x with largest absolute values unchanged and sets the other ones to zero. Some compressors, like rand-k, are unbiased; that is, E[C(x)] = x for every x ∈ Rd, where E[*] denotes the expectation. On the other hand, compressors like top-k are biased (Beznosikov et al., 2020). The variance-reduced algorithm DIANA (Mishchenko et al., 2019) is a major contribution to the field, as it converges linearly with a large class of unbiased compressors. For instance, when the clients use independent rand-1 compressors for UpCom, the UpCom complexity of DIANA is O(cid:0)(κ(1 + d n ) + d) log ε−1(cid:1). If n is large, this is much better than with GD. DIANA was later extended in several ways (Horváth et al., 2022; Gorbunov et al., 2020a); in particular, DIANA-PP is a generalized version allowing for PP (Condat & Richtárik, 2022). Algorithms converging linearly with biased compressors have been proposed recently, like EF21 (Richtárik et al., 2021; Fatkhullin et al., 2021; Condat et al., 2022b), but the theory is less mature and the acceleration potential not as clear as with unbiased compressors. We summarize existing results in Table 2. Our algorithm TAMUNA benefits from CC with specific unbiased compressors, with even more acceleration than DIANA. Also, the focus in DIANA is on UpCom and its DownCom step is the same as in GD, with the full model broadcast at every iteration, so that its TotalCom complexity can be worse than the one of GD. Extensions of DIANA with bidirectional CC, i.e. compression in both UpCom and DownCom, have been proposed (Gorbunov et al., 2020b; Philippenko & Dieuleveut, 2020; Liu et al., 2020; Condat & Richtárik, 2022), but this does not improve its TotalCom complexity; see also Philippenko & Dieuleveut (2021) and references therein on bidirectional CC. We note that if LT is disabled (L(r) ≡ 1), TAMUNA is still new and does not revert to a known algorithm with CC. 1.4 Challenges and contributions Our new algorithm TAMUNA builds upon the LT mechanism of Scaffnew and enables PP and CC, which are essential features for applicability to real-world FL setups. In short, TAMUNA = (S)GD + LT (cid:125) (cid:124) (cid:123)(cid:122) Scaffnew + PP + CC. We focus on the strongly convex setting but we also prove sublinear convergence of TAMUNA in the merely convex case in the Appendix. We emphasize that the problem can be arbitrarily heterogeneous: we don't make any assumption on the functions fi beyond smoothness and strong 7 Table 2: TotalCom complexity of linearly converging algorithms using Local Training (LT), Com- munication Compression (CC), or both, in case of full participation and exact gradients. The (cid:101)O notation hides the log ε−1 factor. Algorithm DIANA (a) EF21 (b) Scaffold FedLin S-Local-GD Scaffnew 5GCS ✗ ✓ ✓ ✓ ✓ ✓ FedCOMGATE ✓ ✓ TAMUNA LT CC ✓ ✗ (cid:16) (cid:101)O TotalCom )κ + d + αd2(cid:17) TotalCom=UpCom when α = 0 (cid:101)O(cid:0)(1 + d n )κ + d(cid:1) (1 + αd + d+αd2 n (cid:101)O(dκ) (cid:101)O(dκ) (cid:101)O(dκ) (cid:101)O(dκ) √ (cid:101)O(d κ) √ κ) (cid:101)O(d (cid:101)O(dκ) √ κ√ n + d + κ + d √ d (cid:16)√ ✓ ✗ ✗ ✗ ✗ ✗ ✓ ✓ (cid:101)O (cid:101)O(dκ) (cid:101)O(dκ) (cid:101)O(dκ) (cid:101)O(dκ) √ κ) (cid:101)O(d √ κ) (cid:101)O(d (cid:101)O(dκ) √ κ√ n + d κ + d √ (cid:17) √ √ (cid:17) κ α d (cid:16)√ d (cid:101)O (a) using independent rand-1 compressors, for instance. Note that O( and O(d √ κ√ n + d) is better than O( d n κ + d), so that TAMUNA has a better complexity than DIANA. √ √ d κ + d) is better than O(κ + d) (b) using top-k compressors with any k, for instance. convexity, and there is no notion of data similarity whatsoever. We also stress that our goal is to deepen our theoretical understanding of LT, CC and PP, and to make these 3 intuitive and effective mechanisms, which are widely used in practice, work in the best possible way when harnessed to (stochastic) GD. Thus, we establish convergence of TAMUNA in Theorem 1 with stochastic GD steps of bounded variance, which is more general than exact GD steps, but only to illustrate the robustness of our framework. A thorough analysis would need to consider the general setting of possibly variance-reduced (Gorbunov et al., 2020a; Gower et al., 2020) SGD local steps, as was done for Scaffnew in Malinovsky et al. (2022). We leave it for future work, since we focus on the communication complexity, and stochastic gradients can only worsen it. Reducing the computation complexity using accelerated (Nesterov, 2004) or stochastic GD steps is somewhat orthogonal to our present study. Let us elaborate on the double challenge of combining LT with PP and CC. Our notations are summarized in Table 3 for convenience. 1.4.1 Combining LT and PP With the recent breakthrough of Scaffnew (Mishchenko et al., 2022), we now understand that LT is not only efficient in practice, but also grounded in theory, and yields communication acceleration if the number of local steps is chosen appropriately. However, Scaffnew does not allow for PP. It has been an open and challenging question to know whether its powerful randomized mechanism would be compatible with PP. In fact, according to Grudzień et al. (2023), the authors of Scaffnew "have tried-very hard in their own words-but their efforts did not bear any fruit." In this paper, we break this lock: TAMUNA handles LT and PP, and fully benefits from the acceleration of LT, whatever the participation level; that is, its communication complexity depends on κ, not κ. √ Combining LT and PP is difficult: we want PP not only during communication whenever it 8 Algorithm 1 TAMUNA 1: input: stepsizes γ > 0, η > 0; number of participating clients c ∈ {2, . . . , n}; sparsity index for compression s ∈ {2, . . . , c}; initial model estimate ̄x(0) ∈ Rd at the server and initial control variates h(0) n ∈ Rd at the clients, such that (cid:80)n 1 , . . . , h(0) i=1 h(0) i = 0. 2: for r = 0, 1, . . . (rounds) do 3: choose a subset Ω(r) ⊂ [n] of size c uniformly at random choose the number of local steps L(r) ≥ 1 for clients i ∈ Ω(r), in parallel, do := ̄x(r) (initialization received from the server) x(r,0) i for l = 0, . . . , L(r) − 1 (local steps) do x(r,l+1) i ∇fi end for (cid:0)x(r,l) i − γg(r,l) := x(r,l) i i (cid:1) of variance σ2 i + γh(r) i , where g(r,l) i is an unbiased stochastic estimate of (cid:17) (cid:16) end for UpCom: the server and active clients agree on a random binary mask q(r) = (cid:0)q(r) i∈Ω(r) ∈ Rd×c generated as explained in Figure 1, and every client i ∈ Ω(r) sends the compressed vector C(r) to the server, where C(r) i x(r,L(r)) i∈Ω(r) C(r) ̄x(r+1) := 1 i s for clients i ∈ Ω(r), in parallel, do i + η (cid:17) (cid:17) (cid:0) ̄x(r+1) is received from the server(cid:1) (v) denotes v multiplied elementwise by q(r) (aggregation by the server) x(r,L(r)) i (cid:80) (cid:0) ̄x(r+1)(cid:1) − C(r) x(r,L(r)) i (cid:17) (cid:16) (cid:16) (cid:16) (cid:1) . i i i i i γ C(r) i := h(r) h(r+1) i end for for clients i /∈ Ω(r), in parallel, do (the client is idle) := h(r) i h(r+1) i end for 18: 19: end for 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: occurs, but also with respect to all computations before. The simple idea of allowing at every round some clients to be active and to proceed normally, and other clients to be idle with unchanged local variables, does not work. A key property of TAMUNA is that only the clients which participated in a given round make use of the updated model broadcast by the server to update their control variates (step 14). From a mathematical point of view, our approach relies on combining the two stochastic processes of probabilistic communication and random client selection in two different ways, for updating after communication the model estimates xi on one hand, and the control variates hi on the other hand. Indeed, a crucial property is that the sum of the control variates over all clients always remains zero. This separate treatment was the key to the success of our design. 1.4.2 Combining LT and CC It is very challenging to combine LT and CC. In the strongly convex and heterogeneous case considered here, the methods Qsparse-local-SGD (Basu et al., 2020) and FedPAQ (Reisizadeh et al., 2020) do not converge linearly. The only linearly converging LT + CC algorithm we are aware of is FedCOMGATE (Haddadpour et al., 2021). But its rate is O(dκ log ε−1), which does not show any acceleration. We note that random reshuffling, which can be seen as a kind of LT, has been 9 Table 3: Summary of the main notations used in the paper. LT CC PP L μ κ = L/μ d n, i [n] = {1, . . . , n} α i , σ2 := (cid:80) σ2 i σ2 i c ∈ {2, . . . , n} Ω ⊂ [n] s ∈ {2, . . . , c} q = (qi)c r L, l p t, T γ, η, χ xi hi ̄x(r) τ i=1 local training communication compression partial participation (a.k.a. client sampling) smoothness constant strong convexity constant condition number of the functions dimension of the model number and index of clients weight on downlink communication (DownCom), see (2) variance of the stochastic gradients, see (3) number of active clients (a.k.a. cohort size). Full participation if c = n index set of active clients sparsity index for compression. No compression if s = c random binary mask for compression, as detailed in Figure 1 index of rounds number and index of local steps in a round inverse of the expected number of local steps per round indexes of iterations stepsizes local model estimate at client i local control variate tracking ∇fi model estimate at the server at round r convergence rate combined with CC in Sadiev et al. (2022b); Malinovsky & Richtárik (2022). Like for PP, the program of combining LT and CC looks simple, as it seems we just have to "plug" compressors into Scaffnew. Again, this simple approach does not work and the key is to have separate stochastic mechanisms to update the local model estimates and the control variates. In our previous work (Condat et al., 2022a), we managed to design a specific compression mechanism compatible with LT and proposed CompressedScaffnew, which combines the LT mechanism of Scaffnew and this new CC mechanism. CompressedScaffnew is the first algorithm, to the best of our knowledge, to exhibit a doubly-accelerated linear rate, by leveraging LT and CC. However, like Scaffnew, CompressedScaffnew only works in case of full participation. We stress that this successful combination of LT and CC does not help in combining LT and PP: a non-participating client does not participate to communication whenever it occurs, but it also does not perform any computation before. Therefore, there is no way to enable PP in loopless algorithms like Scaffnew and CompressedScaffnew, where communication can be triggered at any time. Whether a client participates or not must be decided in advance, at the beginning of a round consisting of a sequence of local steps followed by communication. Our new algorithm TAMUNA is the first to solve this challenge. It works with any level of PP, with as few as two clients participating in every round. TAMUNA relies on the same dedicated design of the compressors as CompressedScaffnew, explained in Figure 1 and such that the messages sent by the different clients complement each other, to keep a tight control of the variance after aggregation. We 10 (a) (b) (c) (d) c ⌋ or ⌈ sd Figure 1: The random sampling pattern q(r) = (q(r) i=1 ∈ Rd×c used for communication is generated )c i by a random permutation of the columns of a fixed binary template pattern, which has the prescribed number s ≥ 2 of ones in every row. In (a) with (d, c, s) = (5, 6, 2) and (b) with (d, c, s) = (5, 7, 2), with ones in blue and zeros in white, examples of the template pattern used when d ≥ c s : for every row k ∈ [d], there are s ones at columns i = mod(s(k − 1), c) + 1, . . . , mod(sk − 1, c) + 1. Thus, there are ⌊ sd c ⌉ ones in every column vector qi. In (c), an example of sampling pattern obtained after a permutation of the columns of the template pattern in (a). In (d) with (d, c, s) = (3, 10, 2), an example of the template pattern used when c s ≥ d: for every column i = 1, . . . , ds, there is 1 one at row k = mod(i − 1, d) + 1. Thus, there is 0 or 1 one in every column vector qi. We can note that when d = c s and c s ≥ d for constructing the template pattern are equivalent, since they give exactly the same set of sampling patterns when permuting their columns. These two rules make it possible to generate easily the columns q(r) of q(r) on the fly, without having to generate the whole mask q(r) explicitly. s , the two different rules for d ≥ c i currently don't know how to use any other type of compressors in TAMUNA. Thus, by combining LT and CC, TAMUNA establishes the new state of the art in communication efficiency. For instance, with exact gradients, if α is small and n is large, its TotalCom complexity in case of full participation is (cid:16)(cid:16)√ √ O d κ + d (cid:17) log ε−1(cid:17) ; our general result is in Theorem 2. Thus, TAMUNA enjoys twofold acceleration, with κ thanks to LT and d instead of d thanks to CC. √ √ κ instead of 2 Proposed algorithm TAMUNA Its main loop is over the rounds, The proposed algorithm TAMUNA is shown as Algorithm 1. indexed by r. A round consists of a sequence, written as an inner loop, of local steps indexed by l and performed in parallel by the active clients, followed by compressed communication with the server and update of the local control variates hi. The c active, or participating, clients are selected randomly at the beginning of the round. During UpCom, every client sends a compressed version of its local model xi: it sends only a few of its elements, selected randomly according to the rule explained in Figure 1 and known by both the clients and the server (for decoding). At the end of the round, the aggregated model estimate ̄x(r+1) formed by the server is sent only to the active clients, which use it to update their control variates hi. This update consists in overwriting only the coordinates of hi which have been involved in the communication process; that is, for which the mask q(r) has a one. Indeed, the received vector ̄x(r+1) does not contain relevant i information to update hi at the other coordinates. 11 The update of the local model estimates xi at the clients takes place at the beginning of the round, when the active clients download the current model estimate ̄x(r) to initialize their local steps. So, it seems that there are two DownCom steps from the server to the clients per round (steps 6 and 14), but the algorithm can be written with only one: ̄x(r+1) can be broadcast by the server at the end of round r not only to the active clients of round r, but also to the active clients of the next round r + 1, at the same time. We keep the algorithm written in this way for simplicity. Thus, the clients of index i /∈ Ω(r), which do not participate in round r, are completely idle: they don't compute and don't communicate at all. Their local control variates hi remain unchanged, and they don't even need to store a local model estimate: they only need to receive the latest model estimate x(r) from the server when they participate in the process. In TAMUNA, unbiased stochastic gradient estimates of bounded variance σ2 i can be used: for every i ∈ [n], (cid:104) g(r,l) E i (cid:105) | x(r,l) i = ∇fi (cid:0)x(r,l) i (cid:1), E (cid:20)(cid:13) (cid:13)g(r,l) (cid:13) i − ∇fi (cid:0)x(r,l) i (cid:1)(cid:13) 2 (cid:13) (cid:13) (cid:21) | x(r,l) i ≤ σ2 i , (3) for some σi ≥ 0. We have g(r,l) i=1 σ2 i . Our main result, stating linear convergence of TAMUNA to the exact solution x⋆ of (1), or to a neighborhood if σ > 0, is the following: (cid:1) if σi = 0. We define the total variance σ2 := (cid:80)n (cid:0)x(r,l) i = ∇fi i Theorem 1 (fast linear convergence). Let p ∈ (0, 1]. In TAMUNA, suppose that at every round r ≥ 0, L(r) is chosen randomly and independently according to a geometric law of mean p−1; that is, for every L ≥ 1, Prob(L(r) = L) = (1 − p)L−1p. Also, suppose that and η := pχ, where 0 < γ < 2 L 0 < χ ≤ n(s − 1) s(n − 1) ∈ (cid:21) , 1 . (cid:18) 1 2 For every total number t ≥ 0 of local steps made so far, define the Lyapunov function t := Ψ n γ (cid:13) (cid:13) ̄xt − x⋆(cid:13) 2 + (cid:13) γ p2χ n − 1 s − 1 n (cid:88) i=1 (cid:13) (cid:13)h(r) (cid:13) i − h⋆ i (cid:13) 2 (cid:13) (cid:13) , (4) (5) (6) where x⋆ is the unique solution to (1), h⋆ i = ∇fi(x⋆), r ≥ 0 and l ∈ {0, . . . , L(r) − 1} are such that and Then, for every t ≥ 0, t = r−1 (cid:88) ˆr=0 L(ˆr) + l, ̄xt := 1 s (cid:88) C(r) i (cid:16) x(r,l) i (cid:17) . i∈Ω(r) t(cid:105) (cid:104) E Ψ 0 ≤ τ tΨ + γσ2 1 − τ , 12 (7) (8) (9) where (cid:18) τ := max (1 − γμ)2, (γL − 1)2, 1 − p2χ (cid:19) s − 1 n − 1 < 1. (10) Also, if σ = 0, ( ̄x(r))r∈N converges to x⋆ and (h(r) i )r∈N converges to h⋆ i , almost surely. The complete proof is in the Appendix. We give a brief sketch here. The analysis is made for a single-loop version of the algorithm, shown as Algorithm 2, with a loop over the iterations, indexed by t, and one local step per iteration. Thus, communication does not happen at every iteration but is only triggered randomly with probability p. Its convergence is proved in Theorem 3. Indeed, the contraction of the Lyapunov function happens at every iteration and not at every round, whose size is random. That is why we have to reindex the local steps to obtain a rate depending on the number of iterations t so far. We detail in the Appendix how Theorem 3 on Algorithm 2 yields Theorem 1 on TAMUNA. We note that in (8), ̄xt is actually computed only if l = 0, in which case ̄xt = ̄x(r). We also note that the theorem depends on s but not on c. The dependence on c is hidden in the fact that s is upper bounded by c. Remark 1 (setting η). In the conditions of Theorem 1, one can simply set η = p which is independent of n and s. However, the larger η, the better, so it is recommended to set 2 in TAMUNA, η = p n(s − 1) s(n − 1) . (11) Also, as a rule of thumb, if the average number of local steps per round is L, one can replace p by L−1. We can comment on the difference between TAMUNA and Scaffold, when CC is disabled (s = c). In TAMUNA, hi is updated by adding ̄x(r+1) − x(r,L(r)) i estimate ̄x(r+1) and the latest local estimate x(r,L(r)) is used instead, which involves the "old" global estimate ̄x(r). Moreover, this difference is scaled by the number of local steps, which makes it small. That is why no acceleration from LT can be obtained in Scaffold, whatever the number of local steps. This is not a weakness of the analysis in Karimireddy et al. (2020) but an intrinsic limitation of Scaffold. . By contrast, in Scaffold, ̄x(r) − x(r,L(r)) , the difference between the latest global i i We can also note that the neighborhood size in (9) does not show so-called linear speedup; that is, it does not decrease when n increases. The properties of performing LT with SGD steps remain little understood (Woodworth et al., 2020), and we believe this should be studied within the general framework of variance reduction (Malinovsky et al., 2022). Again, this goes far beyond the scope of this paper, which focuses on communication. 3 Iteration and communication complexities We consider in this section that exact gradients are used (σ = 0),2 since our aim is to establish a new state of the art for the communication complexity, regardless of the type of local computations. We place ourselves in the conditions of Theorem 1. 2If σ > 0, it is possible to derive sublinear rates to reach ε-accuracy for the communication complexity, by setting γ proportional to ε, as was done for Scaffnew in Mishchenko et al. (2022, Corollary 5.6). 13 We first remark that TAMUNA has the same iteration complexity as GD, with rate τ ♯ := n−1 ≤ τ ♯. This is max(1 − γμ, γL − 1)2, as long as p and s are large enough to have 1 − χp2 s−1 remarkable: LT, CC and PP do not harm convergence at all, until some threshold. Let us consider the number of iterations (= total number of local steps) to reach ε-accuracy, i.e. t(cid:105) (cid:104) E L ), and χ = Θ(1), the iteration complexity of TAMUNA Ψ ≤ ε. For any s ≥ 2, p ∈ (0, 1], γ = Θ( 1 is Thus, by choosing (cid:18)(cid:18) O κ + (cid:19) n sp2 log ε−1 (cid:19) . (cid:18) p = min Θ (cid:18)(cid:114) n sκ (cid:19) (cid:19) , 1 , which means that the average number of local steps per round is (cid:104) E L(r)(cid:105) (cid:18) = max Θ (cid:18)(cid:114) sκ n (cid:19) (cid:19) , 1 , the iteration complexity becomes (cid:16)(cid:16) O κ + n s (cid:17) log ε−1(cid:17) . (12) (13) We now consider the communication complexity. Communication occurs at every iteration with probability p, and during every communication round, DownCom consists in broadcasting the full d-dimensional vector ̄x(r), whereas in UpCom, compression is effective and the number of real values sent in parallel by the clients is equal to the number of ones per column in the sampling pattern q, which is ⌈ sd c ⌉ ≥ 1. Hence, the communication complexities are: DownCom: O pd κ + (cid:18) (cid:18) (cid:19) n sp2 log ε−1 (cid:19) , (cid:18) UpCom: O p (cid:18) sd c (cid:19) (cid:18) + 1 κ + (cid:19) n sp2 log ε−1 (cid:19) . TotalCom: O p (cid:18) (cid:18) sd c (cid:19) (cid:18) + 1 + αd κ + (cid:19) n sp2 log ε−1 (cid:19) . For a given s, the best choice for p, for both DownCom and UpCom, is given in (12), for which (cid:18) (cid:18) O p κ + (cid:19)(cid:19) n sp2 = O (cid:18)(cid:114) nκ s + (cid:19) n s and the TotalCom complexity is TotalCom: O (cid:18)(cid:18)(cid:114) nκ s + (cid:19)(cid:18) sd c n s (cid:19) + 1 + αd log ε−1 (cid:19) . We see the first acceleration effect due to LT: with a suitable p < 1, the communication complexity only depends on κ, not κ, whatever the participation level c and compression level s. √ Without compression, i.e. s = c, whatever α, the TotalCom complexity becomes (cid:18)(cid:114) nκ c log ε−1 (cid:19) . n c O + (cid:19) (cid:18) d We can now set s to further accelerate the algorithm, by minimizing the TotalCom complexity: 14 Theorem 2 (doubly accelerated communication). In the conditions of Theorem 1, suppose that σ = 0, γ = Θ( 1 L ), χ = Θ(1), and (cid:18) p = min Θ (cid:18)(cid:114) n sκ (cid:19) (cid:19) , 1 , s = max (cid:16) 2, (cid:107) (cid:106) c d , ⌊αc⌋ (cid:17) . Then the TotalCom complexity of TAMUNA is (cid:18)(cid:18)√ O √ d (cid:114) n κ c √ + d √ n c κ + d n c √ + α d (cid:19) √ (cid:114) n κ c log ε−1 (cid:19) . (14) (15) As reported in Tables 1 and 2, TAMUNA improves upon all known algorithms using either LT or CC on top of GD, even those working only with full participation. Corollary 1 (dependence on α). As long as α ≤ max( 2 α = 0, in which we only focus on UpCom, and the TotalCom complexity is d , n c , 1 κc ), there is no difference with the case (cid:18)(cid:18)√ O √ d (cid:114) n κ c √ + d √ n c κ + d (cid:19) n c log ε−1 (cid:19) . On the other hand, if α ≥ max( 2 c , 1 d , n κc ), the complexity increases and becomes (cid:18)√ √ αd O (cid:114) n c κ log ε−1 (cid:19) , (16) (17) but compression remains operational and effective with the α factor. It is only when α = 1 that s = c, i.e. there is no compression, and that the Upcom, DownCom and TotalCom complexities all become √ (cid:18) √ O d κ (cid:114) n c log ε−1 (cid:19) . Thus, in case of full participation (c = n), TAMUNA is faster than Scaffnew for every α ∈ [0, 1]. Corollary 2 (full participation). In case of full participation (c = n), the TotalCom complexity of TAMUNA is (cid:18)(cid:18)√ √ d κ + d + d + α d κ √ √ (cid:19) log ε−1 (cid:19) . √ √ κ n O 4 Experiments Carrying out large-scale experiments is beyond the scope of this work, which focuses on studying the foundational algorithmic and theoretical properties of a specific class of algorithms. Nonetheless, we provide illustrations and confirm our results using a practical logistic regression problem. The global loss function is defined as f (x) = 1 M M (cid:88) (cid:16) (cid:16) log 1 + exp m=1 (cid:16) −bma⊤ mx (cid:17)(cid:17) + μ 2 ∥x∥2(cid:17) , (20) 15 (18) (19) (a) w8a, n = 1000, α = 0, c = n (b) w8a, n = 1000, α = 0.1, c = n (c) w8a, n = 1000, α = 0, c = 0.1n (d) w8a, n = 1000, α = 0.1, c = 0.1n Figure 2: Logistic regression experiment in the case n > d. The dataset w8a has d = 300 features and n = 1000, so n ≈ 3d. The first row shows a comparison in the full participation regime, while the second row shows a comparison in the partial participation regime with 10% of clients. On the left, α = 0, while on the right, α = 0.1. where the variables am ∈ Rd and bm ∈ {−1, 1} represent the data samples, and M denotes the total number of samples. The function f in (20) is divided into n separate functions fi, with any remainder from dividing M by n discarded. We select the strong convexity constant μ so that κ = 104. For our analysis, we choose n = 1000 and examine two scenarios: in the first one, we have d > n using the 'real-sim' dataset with d = 20958, and in the second one, we have n > d using the 'w8a' dataset with d = 300, from the widely-used LIBSVM library (Chang & Lin, 2011). Additionally, we consider two cases for each scenario: α = 0 and α = 0.1, where α is the weight on DownCom defined in (2). We measure the convergence error f (x) − f (x⋆) with respect to TotalCom, i.e. the total number of communicated reals, as defined in Section (1.2). Here, x denotes the model known by the server; for TAMUNA, this is ̄x(r). This error serves as a natural basis for comparing algorithms, and since 2 ∥x − x⋆∥2 for any x. Consequently, the error converges f is L-smooth, we have f (x) − f (x⋆) ≤ L linearly at the same rate as Ψ in Theorem 1.. 16 (a) real-sim, n = 1000, α = 0, c = n (b) real-sim, n = 1000, α = 0.1, c = n (c) real-sim, n = 1000, α = 0, c = 0.1n (d) real-sim, n = 1000, α = 0.1, c = 0.1n Figure 3: Logistic regression experiment in the case d > n. The dataset real-sim has d = 20, 958 features and n = 1000, so n ≈ d/20. The first row shows a comparison in the full participation regime, while the second row shows a comparison in the partial participation regime with 10% of clients. On the left, α = 0, while on the right, α = 0.1. We compare the performance of three algorithms allowing for PP, namely Scaffold, 5GCS, and TAMUNA, for two participation scenarios: c = n and c = 0.1n (10% participation). In the full participation case, we add Scaffnew to the comparison. In order to ensure theoretical conditions that guarantee linear convergence, we set γ and η for TAMUNA as γ = 2 L + μ , η = p n(s − 1) s(n − 1) , where the remaining parameters s and p are fine-tuned to achieve the best communication complexity. In our experimental setup, we found that using s = 40 and p = 0.01 resulted in excellent performance. The conditions of Theorem 1 are met with these values, so linear convergence of TAMUNA is guaranteed. We adopt the same values of γ and p for Scaffnew. For Scaffold, we use p−1 local steps, which is the same, on average, as for TAMUNA and Scaffnew; the behavior of Scaffold changed marginally with other values. We also set γ to its highest value that ensures convergence. In the case of 5GCS, we tune γ, τ , and the number of local steps to achieve the best communication complexity. 17 The models in all algorithms, as well as the control variates in TAMUNA, Scaffnew and Scaffold, are initialized with zero vectors. The results are shown in Figures 2 and 3. Each algorithm is run multiple times with different random seeds, depending on its variance (7 times for TAMUNA, 5 times for Scaffnew, and 3 times for Scaffold and 5GCS). The shaded area in the plots shows the difference between the maximum and minimum convergence error achieved over these runs. Additionally, the progress of the first run for each algorithm is depicted with a thicker line and markers. As can be seen, our proposed algorithm TAMUNA outperforms all other methods. In case of full participation, Scaffnew outperforms Scaffold and 5GCS, which shows the efficiency of its LT mechanism. TAMUNA embeds the same mechanism and also benefits from it, but it outperforms Scaffnew thanks to CC, its second communication-acceleration mechanism. The difference between TAMUNA and Scaffnew is larger for α = 0 than for α = 0.1, as explained by our theory; the difference would vanish if α tends to 1. TAMUNA is applicable and proved to converge with any level of PP, whereas Scaffnew only applies to the full participation case. References Albasyoni, A., Safaryan, M., Condat, L., and Richtárik, P. Optimal gradient compression for distributed and federated learning. preprint arXiv:2010.03246, 2020. Basu, D., Data, D., Karakus, C., and Diggavi, S. N. Qsparse-Local-SGD: Distributed SGD With IEEE Journal on Selected Areas in Quantization, Sparsification, and Local Computations. Information Theory, 1(1):217–226, 2020. Bauschke, H. H. and Combettes, P. L. Convex Analysis and Monotone Operator Theory in Hilbert Spaces. Springer, New York, 2nd edition, 2017. Bertsekas, D. P. Convex optimization algorithms. Athena Scientific, Belmont, MA, USA, 2015. Beznosikov, A., Horváth, S., Richtárik, P., and Safaryan, M. On biased compression for distributed learning. preprint arXiv:2002.12410, 2020. Bonawitz, K., Ivanov, V., Kreuter, B., Marcedone, A., McMahan, H. B., Patel, S., Ramage, D., Segal, A., and Seth, K. Practical secure aggregation for privacy-preserving machine learning. In Proc. of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 1175–1191, 2017. Chang, C.-C. and Lin, C.-J. LIBSVM: A library for support vector machines. ACM Trans- Software available at actions on Intelligent Systems and Technology, 2:27:1–27:27, 2011. http://www.csie.ntu.edu.tw/%7Ecjlin/libsvm. Condat, L. and Richtárik, P. MURANA: A generic framework for stochastic variance-reduced optimization. In Proc. of the conference Mathematical and Scientific Machine Learning (MSML), PMLR 190, pp. 81–96, 2022. Condat, L. and Richtárik, P. RandProx: Primal-dual optimization algorithms with randomized proximal updates. In Proc. of Int. Conf. Learning Representations (ICLR), 2023. 18 Condat, L., Agarský, I., and Richtárik, P. Provably doubly accelerated federated learning: The first theoretically successful combination of local training and compressed communication. preprint arXiv:2210.13277, 2022a. Condat, L., Li, K., and Richtárik, P. EF-BV: A unified theory of error feedback and variance reduction mechanisms for biased and unbiased compression in distributed optimization. In Proc. of Conf. Neural Information Processing Systems (NeurIPS), 2022b. Das, R., Acharya, A., Hashemi, A., Sanghavi, S., Dhillon, I. S., and Topcu, U. Faster non-convex federated learning via global and local momentum. In Proc. of Conf. on Uncertainty in Artificial Intelligence (UAI), 2022. Defazio, A. A simple practical accelerated method for finite sums. In Proc. of 30st Conf. Neural Information Processing Systems (NIPS), volume 29, pp. 676–684, 2016. Fatkhullin, I., Sokolov, I., Gorbunov, E., Li, Z., and Richtárik, P. EF21 with bells & whistles: Practical algorithmic extensions of modern error feedback. preprint arXiv:2110.03294, 2021. Glasgow, M. R., Yuan, H., and Ma, T. Sharp bounds for federated averaging (Local SGD) and continuous perspective. In Proc. of Int. Conf. Artificial Intelligence and Statistics (AISTATS), PMLR 151, pp. 9050–9090, 2022. Gorbunov, E., Hanzely, F., and Richtárik, P. A unified theory of SGD: Variance reduction, sampling, quantization and coordinate descent. In Proc. of 23rd Int. Conf. Artificial Intelligence and Statistics (AISTATS), PMLR 108, 2020a. Gorbunov, E., Kovalev, D., Makarenko, D., and Richtárik, P. Linearly converging error compensated SGD. In Proc. of Conf. Neural Information Processing Systems (NeurIPS), 2020b. Gorbunov, E., Hanzely, F., and Richtárik, P. Local SGD: Unified theory and new efficient methods. In Proc. of 24th Int. Conf. Artificial Intelligence and Statistics (AISTATS), PMLR 130, pp. 3556–3564, 2021. Gower, R. M., Loizou, N., Qian, X., Sailanbayev, A., Shulgin, E., and Richtárik, P. SGD: General analysis and improved rates. In Proc. of 36th Int. Conf. Machine Learning (ICML), volume PMLR 97, pp. 5200–5209, 2019. Gower, R. M., Schmidt, M., Bach, F., and Richtárik, P. Variance-reduced methods for machine learning. Proc. of the IEEE, 108(11):1968–1983, November 2020. Grudzień, M., Malinovsky, G., and Richtárik, P. Can 5th Generation Local Training Methods Support Client Sampling? Yes! In Proc. of Int. Conf. Artificial Intelligence and Statistics (AISTATS), April 2023. Haddadpour, F. and Mahdavi, M. On the Convergence of Local Descent Methods in Federated Learning. preprint arXiv:1910.14425, 2019. Haddadpour, F., Kamani, M. M., Mokhtari, A., and Mahdavi, M. Federated learning with com- pression: Unified analysis and sharp guarantees. In Proc. of Int. Conf. Artificial Intelligence and Statistics (AISTATS), PMLR 130, pp. 2350–2358, 2021. 19 Hanzely, F. and Richtárik, P. One method to rule them all: Variance reduction for data, parameters and many new methods. preprint arXiv:1905.11266, 2019. Horváth, S., Ho, C.-Y., Horváth, L., Sahu, A. N., Canini, M., and Richtárik, P. Natural compression for distributed deep learning. In Proc. of the conference Mathematical and Scientific Machine Learning (MSML), PMLR 190, 2022. Horváth, S., Kovalev, D., Mishchenko, K., Stich, S., and Richtárik, P. Stochastic distributed learning with gradient quantization and variance reduction. Optimization Methods and Software, 2022. Kairouz, P. et al. Advances and open problems in federated learning. Foundations and Trends in Machine Learning, 14(1–2), 2021. Karimireddy, S. P., Kale, S., Mohri, M., Reddi, S., Stich, S. U., and Suresh, A. T. SCAFFOLD: Stochastic controlled averaging for federated learning. In Proc. of 37th Int. Conf. Machine Learning (ICML), pp. 5132–5143, 2020. Karimireddy, S. P., Jaggi, M., Kale, S., Mohri, M., Reddi, S., Stich, S. U., and Suresh, A. T. Breaking the centralized barrier for cross-device federated learning. In Proc. of Conf. Neural Information Processing Systems (NeurIPS), 2021. Khaled, A., Mishchenko, K., and Richtárik, P. Better communication complexity for local SGD. In NeurIPS Workshop on Federated Learning for Data Privacy and Confidentiality, 2019. Khaled, A., Mishchenko, K., and Richtárik, P. Tighter theory for local SGD on identical and heterogeneous data. In Proc. of 23rd Int. Conf. Artificial Intelligence and Statistics (AISTATS), PMLR 108, 2020. Konečný, J., McMahan, H. B., Ramage, D., and Richtárik, P. Federated optimization: distributed machine learning for on-device intelligence. arXiv:1610.02527, 2016a. Konečný, J., McMahan, H. B., Yu, F. X., Richtárik, P., Suresh, A. T., and Bacon, D. Federated learning: Strategies for improving communication efficiency. In NIPS Private Multi-Party Machine Learning Workshop, 2016b. arXiv:1610.05492. Li, T., Sahu, A. K., Talwalkar, A., and Smith, V. Federated learning: Challenges, methods, and future directions. IEEE Signal Processing Magazine, 3(37):50–60, 2020. Liu, X., Li, Y., Tang, J., and Yan, M. A double residual compression algorithm for efficient distributed learning. In Proc. of Int. Conf. Artificial Intelligence and Statistics (AISTATS), PMLR 108, pp. 133–143, 2020. Malinovsky, G. and Richtárik, P. Federated random reshuffling with compression and variance reduction. preprint arXiv:arXiv:2205.03914, 2022. Malinovsky, G., Kovalev, D., Gasanov, E., Condat, L., and Richtárik, P. From local SGD to local fixed point methods for federated learning. In Proc. of 37th Int. Conf. Machine Learning (ICML), volume PMLR 119, pp. 6692–6701, 2020. 20 Malinovsky, G., Yi, K., and Richtárik, P. Variance reduced ProxSkip: Algorithm, theory and In Proc. of Conf. Neural Information Processing Systems application to federated learning. (NeurIPS), 2022. McMahan, H. B., Moore, E., Ramage, D., Hampson, S., and y Arcas, B. A. Communication-efficient learning of deep networks from decentralized data. In Proc. of Int. Conf. Artificial Intelligence and Statistics (AISTATS), PMLR 54, 2017. Mishchenko, K., Gorbunov, E., Takáč, M., and Richtárik, P. Distributed learning with compressed gradient differences. arXiv:1901.09269, 2019. Mishchenko, K., Malinovsky, G., Stich, S., and Richtárik, P. ProxSkip: Yes! Local Gradient Steps In Proc. of the 39th International Provably Lead to Communication Acceleration! Finally! Conference on Machine Learning (ICML), July 2022. Mitra, A., Jaafar, R., Pappas, G., and Hassani, H. Linear convergence in federated learning: Tackling client heterogeneity and sparse gradients. In Proc. of Conf. Neural Information Processing Systems (NeurIPS), 2021. Nesterov, Y. Introductory lectures on convex optimization: a basic course. Kluwer Academic Publishers, 2004. Philippenko, C. and Dieuleveut, A. Artemis: tight convergence guarantees for bidirectional compres- sion in federated learning. preprint arXiv:2006.14591, 2020. Philippenko, C. and Dieuleveut, A. Preserved central model for faster bidirectional compression in distributed settings. In Proc. of Conf. Neural Information Processing Systems (NeurIPS), 2021. Reisizadeh, A., Mokhtari, A., Hassani, H., Jadbabaie, A., and Pedarsani, R. FedPAQ: A communication-efficient federated learning method with periodic averaging and quantization. In Proc. of Int. Conf. Artificial Intelligence and Statistics (AISTATS), pp. 2021–2031, 2020. Richtárik, P., Sokolov, I., and Fatkhullin, I. EF21: A new, simpler, theoretically better, and practically faster error feedback. In Proc. of 35th Conf. Neural Information Processing Systems (NeurIPS), 2021. Sadiev, A., Kovalev, D., and Richtárik, P. Communication acceleration of local gradient methods via an accelerated primal-dual algorithm with an inexact prox. In Proc. of Conf. Neural Information Processing Systems (NeurIPS), 2022a. Sadiev, A., Malinovsky, G., Gorbunov, E., Sokolov, I., Khaled, A., Burlachenko, K., and Richtárik, P. Federated optimization algorithms with random reshuffling and gradient compression. preprint arXiv:2206.07021, 2022b. Scaman, K., Bach, F., Bubeck, S., Lee, Y. T., and Massoulié, L. Optimal convergence rates for convex distributed optimization in networks. Journal of Machine Learning Research, 20:1–31, 2019. Stich, S. U. Local SGD converges fast and communicates little. In Proc. of International Conference on Learning Representations (ICLR), 2019. 21 Wang, J. et al. A field guide to federated optimization. preprint arXiv:2107.06917, 2021. Woodworth, B. E., Patel, K. K., and Srebro, N. Minibatch vs Local SGD for heterogeneous distributed learning. In Proc. of Conf. Neural Information Processing Systems (NeurIPS), 2020. 22 Algorithm 2 1: input: stepsizes γ > 0, χ > 0; probability p ∈ (0, 1]; number of participating clients c ∈ {2, . . . , n}; compression index s ∈ {2, . . . , c}; initial estimates x0 n ∈ Rd such that (cid:80)n i = 0, sequence of independent coin flips θ0, θ1, . . . with Prob(θt = 1) = p, and for every t with θt = 1, a subset Ωt ⊂ [n] of size c chosen uniformly at random and a random i)i∈Ωt ∈ Rd×c generated as explained in Figure 1. The compressed vector binary mask qt = (qt i (v) is v multiplied elementwise by qt Ct i. n ∈ Rd and h0 1, . . . , h0 1, . . . , x0 i=1 h0 2: for t = 0, 1, . . . do 3: for i = 1, . . . , n, at clients in parallel, do ˆxt i := xt i − γgt if θt = 1 then i + γht i, where gt i is an unbiased stochastic estimate of ∇fi(xt i) of variance σ2 i i to the server, which aggregates ̄xt := 1 s (cid:80) j∈Ωt Ct j(ˆxt j) and broadcasts it to all i + pχ γ (cid:0)Ct i ( ̄xt) − Ct i (ˆxt i)(cid:1) 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: if i ∈ Ωt then send ˆxt clients ht+1 i else := ht := ht i ht+1 i end if xt+1 i else := ̄xt := ˆxt i := ht i xt+1 i ht+1 i end if end for 17: 18: end for Appendix A Proof of Theorem 1 We first prove convergence of Algorithm 2, which is a single-loop version of TAMUNA; that is, there is a unique loop over the iterations and there is one local step per iteration. In Section A.2, we show that this yields a proof of Theorem 1 for TAMUNA. We can note that in case of full participation (c = n, Ωt ≡ [n]), Algorithm 2 reverts to our previous algorithm CompressedScaffnew (Condat et al., 2022a). To simplify the analysis of Algorithm 2, we introduce vector notations: the problem (1) can be written as find x⋆ = arg min f (x) s.t. W x = 0, (21) i=1 fi(xi) is L-smooth and μ-strongly convex, the linear operator W : X → X maps x = (xi)n x∈X i=1 ∈ X is a collection of vectors xi ∈ Rd, f : x ∈ X (cid:55)→ where X := Rd×n, an element x = (xi)n (cid:80)n i=1 to (xi − 1 i=1. The constraint W x = 0 means that x minus its average is zero; that is, x has n identical components x1 = * * * = xn. Thus, (21) is indeed equivalent to (1). We have W = W ∗ = W 2. We also rewrite Algorithm 2 using vector notations as Algorithm 3. It converges linearly: j=1 xj)n (cid:80)n 23 Algorithm 3 i=1 h0 input: stepsizes γ > 0, χ > 0; probability p ∈ (0, 1], parameter ω ≥ 0; number of participating clients c ∈ {2, . . . , n}; compression index s ∈ {2, . . . , c}; initial estimates x0 ∈ X and h0 ∈ X such that (cid:80)n i = 0; sequence of independent coin flips θ0, θ1, . . . with Prob(θt = 1) = p, and for every t with θt = 1, a subset Ωt ⊂ [n] of size c chosen uniformly at random and a random binary mask qt = (qt i (v) is v multiplied elementwise by qt i. for t = 0, 1, . . . do i)i∈Ωt ∈ Rd×c generated as explained in Figure 1. The compressed vector Ct i=1 ≈ ∇f (xt) i)n ˆxt := xt − γgt + γht, where gt = (gt if θt = 1 then ̄xt := ( ̄xt)n xt+1 := ̄xt dt := (dt i)n j∈Ωt Ct (cid:26) (1 + ω) (cid:0)Ct 0 otherwise i=1, where ̄xt := 1 s i=1 with dt i = (cid:80) j(ˆxt j) i (ˆxt i) − Ct i ( ̄xt)(cid:1) if i ∈ Ωt, else xt+1 := ˆxt dt := 0 end if ht+1 := ht − pχ γ(1+ω) dt end for Theorem 3 (fast linear convergence). In Algorithm 3, suppose that 0 < γ < 2 ω = n−1 p(s−1) − 1. For every t ≥ 0, define the Lyapunov function L , 0 < χ ≤ n(s−1) s(n−1) , Ψt := 1 γ (cid:13) (cid:13)xt − x⋆(cid:13) 2 + (cid:13) γ(1 + ω) pχ (cid:13) (cid:13)ht − h⋆(cid:13) 2 , (cid:13) (22) where x⋆ is the unique solution to (21) and h⋆ := ∇f (x⋆). Then Algorithm 3 converges linearly: for every t ≥ 0, E(cid:2)Ψt(cid:3) ≤ τ tΨ0 + γσ2 1 − τ , where (cid:18) τ := max (1 − γμ)2, (γL − 1)2, 1 − p2χ (cid:19) s − 1 n − 1 < 1. Also, if σ = 0, (xt)t∈N and (ˆxt)t∈N both converge to x⋆ and (ht)t∈N converges to h⋆, almost surely. Proof. We consider the variables of Algorithm 3. For every t ≥ 0, we denote by F t 0 the σ-algebra generated by the collection of X -valued random variables x0, h0, . . . , xt, ht, and by F t the σ-algebra generated by these variables, as well as the stochastic gradients gt. dt is a random variable; as proved in Section A.1, it satisfies the 3 following properties, on which the convergence analysis of Algorithm 3 relies: for every t ≥ 0, 1. E(cid:2)dt | F t(cid:3) = W ˆxt. 2. E 2 | F t(cid:105) (cid:104)(cid:13) (cid:13)dt − W ˆxt(cid:13) (cid:13) ≤ ω (cid:13) (cid:13)W ˆxt(cid:13) 2 . (cid:13) 24 (23) (24) i=1 dt i = 0. t ≥ 0, (cid:80)n 3. dt belongs to the range of W ; that is, (cid:80)n We suppose that (cid:80)n i=1 h0 i = 0; that is, W ht = ht. For every t ≥ 0, we define ˆht+1 := ht − pχ i=1 ˆxt i=1, with ̄xt♯ := 1 n also define ̄xt♯ := ( ̄xt♯)n ̄xt is an unbiased random estimate. i=1 ht (cid:80)n i = 0. Then, it follows from the third property of dt that, for every γ W ˆxt, wt := xt − γgt and w⋆ := x⋆ − γ∇f (x⋆). We i, of which i; that is, ̄xt♯ is the exact average of the ˆxt Let t ≥ 0. We have E (cid:104)(cid:13) (cid:13)xt+1 − x⋆(cid:13) 2 (cid:13) | F t(cid:105) = pE (cid:105) (cid:104)(cid:13) (cid:13) ̄xt − x⋆(cid:13) 2 | F t, θt = 1 (cid:13) + (1 − p) (cid:13) (cid:13)ˆxt − x⋆(cid:13) 2 , (cid:13) Since E(cid:2) ̄xt | F t, θt = 1(cid:3) = ̄xt♯, E (cid:105) (cid:104)(cid:13) (cid:13) ̄xt − x⋆(cid:13) 2 | F t, θt = 1 (cid:13) = with (cid:13) (cid:13) (cid:13) ̄xt♯ − x⋆(cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ̄xt♯ − x⋆(cid:13) 2 (cid:13) (cid:13) + E (cid:20)(cid:13) (cid:13) ̄xt − ̄xt♯(cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:21) | F t, θ = 1 , = (cid:13) 2 − (cid:13) (cid:13)ˆxt − x⋆(cid:13) (cid:13) (cid:13)W ˆxt(cid:13) 2 . (cid:13) (cid:105) (cid:104)(cid:13) (cid:13) ̄xt − x⋆(cid:13) 2 | F t, θt = 1 To analyze E , where the expectation is with respect to the active subset Ωt (cid:13) and the mask qt, we can remark that the expectation and the squared Euclidean norm are separable with respect to the coordinates of the d-dimensional vectors. So, we can reason on the coordinates independently on each other, even if the the coordinates, or rows, of qt are mutually dependent. Also, for a given coordinate k ∈ [d], choosing s elements at random among the c elements ˆxt i,k with i ∈ Ωt, with Ωt chosen uniformly at random too, is equivalent to selecting s elements ˆxt i,k among all i ∈ [n] uniformly at random in the first place. Thus, for every coordinate k ∈ [d], it is like a subset (cid:101)Ωt k ⊂ [n] of size s, which corresponds to the location of the ones in the k-th row of qt, is chosen uniformly at random and ̄xt k = 1 s ˆxt i,k. (cid:88) i∈(cid:101)Ωt k Then, as proved in Condat & Richtárik (2022, Proposition 1), E (cid:20)(cid:13) (cid:13) ̄xt − ̄xt♯(cid:13) (cid:13) 2 (cid:13) (cid:13) where Moreover, (cid:21) | F t, θt = 1 = n   E (cid:101)Ωt k     d (cid:88) k=1 ˆxt i,k − 1 s (cid:88) i∈(cid:101)Ωt k 1 n n (cid:88) j=1  2 ˆxt j,k   | F t   = ν (cid:13)  (cid:13)W ˆxt(cid:13) 2 , (cid:13) ν := n − s s(n − 1) (cid:20) ∈ 0, (cid:19) . 1 2 (25) 2 = (cid:13) (cid:13)ˆxt − x⋆(cid:13) (cid:13) (cid:13) = (cid:13) = (cid:13) = (cid:13) = (cid:13) (cid:13)wt − w⋆(cid:13) 2 + γ2 (cid:13) (cid:13) 2 − γ2 (cid:13) (cid:13)wt − w⋆(cid:13) (cid:13) (cid:13)wt − w⋆(cid:13) 2 − γ2 (cid:13) (cid:13) 2 − γ2 (cid:13) (cid:13)wt − w⋆(cid:13) (cid:13) 2 − γ2 (cid:13) (cid:13)wt − w⋆(cid:13) (cid:13) (cid:13)ht − h⋆(cid:13) 2 + 2γ⟨wt − w⋆, ht − h⋆⟩ (cid:13) (cid:13)ht − h⋆(cid:13) 2 + 2γ⟨ˆxt − x⋆, ht − h⋆⟩ (cid:13) (cid:13)ht − h⋆(cid:13) 2 + 2γ⟨ˆxt − x⋆, ˆht+1 − h⋆⟩ − 2γ⟨ˆxt − x⋆, ˆht+1 − ht⟩ (cid:13) (cid:13)ht − h⋆(cid:13) 2 + 2γ⟨ˆxt − x⋆, ˆht+1 − h⋆⟩ + 2pχ⟨ˆxt − x⋆, W ˆxt⟩ (cid:13) 2 + 2γ⟨ˆxt − x⋆, ˆht+1 − h⋆⟩ + 2pχ (cid:13) (cid:13)ht − h⋆(cid:13) (cid:13) (cid:13)W ˆxt(cid:13) 2 . (cid:13) 25 Hence, E (cid:104)(cid:13) (cid:13)xt+1 − x⋆(cid:13) 2 (cid:13) | F t(cid:105) = p (cid:13) = (cid:13) = (cid:13) 2 + (1 − p) (cid:13) (cid:13)W ˆxt(cid:13) (cid:13) 2 + pν (cid:13) (cid:13)W ˆxt(cid:13) 2 − p (cid:13) (cid:13)ˆxt − x⋆(cid:13) (cid:13) (cid:13) (cid:13)W ˆxt(cid:13) 2 − p(1 − ν) (cid:13) (cid:13)ˆxt − x⋆(cid:13) 2 (cid:13) (cid:13) (cid:13)ht − h⋆(cid:13) (cid:13)wt − w⋆(cid:13) 2 − γ2 (cid:13) 2 + 2γ⟨ˆxt − x⋆, ˆht+1 − h⋆⟩ (cid:13) (cid:13) (cid:13)W ˆxt(cid:13) + (cid:0)2pχ − p(1 − ν)(cid:1) (cid:13) 2 . (cid:13) (cid:13)ˆxt − x⋆(cid:13) 2 (cid:13) On the other hand, using the 3 properties of dt stated above, we have E (cid:104)(cid:13) (cid:13)ht+1 − h⋆(cid:13) 2 (cid:13) | F t(cid:105) ≤ = = = = (cid:13) (cid:13) ht − h⋆ − (cid:13) (cid:13) (cid:13) (cid:13) ht − h⋆ + (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) pχ γ(1 + ω) W ˆxt (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13)W ˆxt(cid:13) (cid:13) 2 (cid:13) + ωp2χ2 γ2(1 + ω)2 (cid:13) 2 (cid:13) (cid:13) (cid:13) + ˆht+1 − ht(cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) ˆht+1 − ht(cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) + 1 1 + ω 1 1 + ω (cid:0)ˆht+1 − ht(cid:1) (cid:0)ˆht+1 − h⋆(cid:1) (cid:0)ht − h⋆(cid:1) + ω (1 + ω)2 (cid:13)ht − h⋆(cid:13) (cid:13) 2 + (cid:13) ω (1 + ω)2 (cid:13) 2 ω (cid:13) (cid:13) 1 + ω (cid:13) ω2 ˆht+1 − h⋆(cid:13) (cid:13) 1 2 (cid:13) (cid:13) (cid:13) (cid:13) (1 + ω)2 (1 + ω)2 ˆht+1 − h⋆(cid:13) (cid:13) 2ω 2 (1 + ω)2 ⟨ht − h⋆, ˆht+1 − h⋆⟩ + (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)ht − h⋆(cid:13) (cid:13) 2 − (cid:13) ω (1 + ω)2 (1 + ω)2 ⟨ht − h⋆, ˆht+1 − h⋆⟩ ω (cid:13)ht − h⋆(cid:13) (cid:13) 2 . (cid:13) 1 + ω ω (1 + ω)2 ˆht+1 − h⋆(cid:13) (cid:13) 1 2 (cid:13) (cid:13) (cid:13) (cid:13) 1 + ω 2ω + + + Moreover, ˆht+1 − h⋆(cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) = (cid:13) (cid:13) 2 (cid:13)(ht − h⋆) + (ˆht+1 − ht) (cid:13) (cid:13) (cid:13) (cid:13) ˆht+1 − ht(cid:13) 2 (cid:13)ht − h⋆(cid:13) 2 + (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)ht − h⋆(cid:13) 2 + 2⟨ˆht+1 − h⋆, ˆht+1 − ht⟩ − (cid:13) (cid:13)ht − h⋆(cid:13) 2 − (cid:13) − 2 = (cid:13) = (cid:13) = (cid:13) + 2⟨ht − h⋆, ˆht+1 − ht⟩ ˆht+1 − ht(cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) ⟨ˆht+1 − h⋆, W (ˆxt − x⋆)⟩ ˆht+1 − ht(cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) p2χ2 γ2 p2χ2 γ2 (cid:13)W ˆxt(cid:13) (cid:13) 2 − 2 (cid:13) (cid:13)W ˆxt(cid:13) (cid:13) 2 − 2 (cid:13) pχ γ pχ γ pχ γ = (cid:13) (cid:13)ht − h⋆(cid:13) 2 − (cid:13) = (cid:13) (cid:13)ht − h⋆(cid:13) 2 − (cid:13) ⟨W (ˆht+1 − h⋆), ˆxt − x⋆⟩ ⟨ˆht+1 − h⋆, ˆxt − x⋆⟩. 26 (26) | F t(cid:105) (cid:13) (cid:13)ht − h⋆(cid:13) 2 . (cid:13) Hence, E (cid:104)(cid:13) (cid:13)xt+1 − x⋆(cid:13) 2 (cid:13) | F t(cid:105) + 1 γ ≤ = E | F t(cid:105) (cid:104)(cid:13) (cid:13)ht+1 − h⋆(cid:13) 2 (cid:13) γ(1 + ω) pχ 2 − γ (cid:13) (cid:13)wt − w⋆(cid:13) (cid:13) (cid:13) 1 γ + 2⟨ˆxt − x⋆, ˆht+1 − h⋆⟩ + (cid:13)ht − h⋆(cid:13) 2 + (cid:13) γ pχ (cid:13)W ˆxt(cid:13) (cid:13) 2 − 2⟨ˆht+1 − h⋆, ˆxt − x⋆⟩ + (cid:13) (cid:13)ht − h⋆(cid:13) (cid:13) 2 (cid:13) pχ γ (cid:18) 2 − − 1 γ + pχ γ (cid:13)wt − w⋆(cid:13) (cid:13) 2 + (cid:13) (cid:18) pχ γ p(1 − ν) γ − (cid:19) − γ (cid:18) γ(1 + ω) pχ (cid:13)W ˆxt(cid:13) (cid:13) 2 . (cid:13) (cid:19) (cid:19) (1 − ν) (cid:13) (cid:13)W ˆxt(cid:13) 2 (cid:13) p γ (cid:13)ht − h⋆(cid:13) (cid:13) 2 (cid:13) γω pχ (cid:13)ht − h⋆(cid:13) (cid:13) 2 (cid:13) Since we have supposed 0 < χ ≤ 1 − ν = n(s − 1) s(n − 1) ∈ (cid:21) , 1 , (cid:18) 1 2 we have Finally, E (cid:104)(cid:13) (cid:13)xt+1 − x⋆(cid:13) 2 (cid:13) | F t(cid:105) + 1 γ ≤ 1 γ (cid:13) (cid:13)wt − w⋆(cid:13) 2 + (cid:13) E γ(1 + ω) pχ γ(1 + ω) pχ (cid:104)(cid:13) (cid:13)ht+1 − h⋆(cid:13) 2 (cid:13) (cid:19) (cid:18) 1 − pχ 1 + ω E (cid:104)(cid:13) (cid:13)wt − w⋆(cid:13) 2 | F t (cid:13) 0 (cid:105) ≤ (cid:13) (cid:13)(Id − γ∇f )xt − (Id − γ∇f )x⋆(cid:13) 2 + γ2σ2, (cid:13) and according to Condat & Richtárik (2023, Lemma 1), 2 ≤ max(1 − γμ, γL − 1)2 (cid:13) (cid:13)(Id − γ∇f )xt − (Id − γ∇f )x⋆(cid:13) (cid:13) (cid:13) (cid:13)xt − x⋆(cid:13) 2 . (cid:13) Therefore, E(cid:2)Ψt+1 | F t 0 (cid:3) ≤ max (cid:18) (1 − γμ)2, (γL − 1)2, 1 − (cid:19) pχ 1 + ω Ψt + γσ2 = max (cid:18) (1 − γμ)2, (γL − 1)2, 1 − p2χ (cid:19) s − 1 n − 1 Ψt + γσ2. (27) Using the tower rule, we can unroll the recursion in (27) to obtain the unconditional expectation of Ψt+1. If σ = 0, using classical results on supermartingale convergence (Bertsekas, 2015, Proposition A.4.5), it follows from (27) that Ψt → 0 almost surely. Almost sure convergence of xt and ht follows. Finally, by Lipschitz continuity of ∇f , we can upper bound ∥ˆxt − x⋆∥2 by a linear combination of ∥xt − x⋆∥2 and ∥ht − h⋆∥2. It follows that E → 0 linearly with the same rate τ and that ˆxt → x⋆ almost surely, as well. (cid:104)(cid:13) (cid:13)ˆxt − x⋆(cid:13) (cid:13) 2(cid:105) 27 A.1 The random variable dt We study the random variable dt used in Algorithm 3. If θt = 0, dt = 0. If, on the other hand, θt = 1, for every coordinate k ∈ [d], a subset (cid:101)Ωt k ⊂ [n] of size s is chosen uniformly at random. These sets ((cid:101)Ωt k=1 are mutually dependent, but this does not matter for the derivations, since we can reason on the coordinates separately. Then, for every k ∈ [d] and i ∈ [n], k)d (cid:40) dt i,k := (cid:16) (cid:80) a i,k − 1 ˆxt s 0 otherwise, j∈(cid:101)Ωt k (cid:17) ˆxt j,k if i ∈ (cid:101)Ωt k, (28) for some value a > 0 to determine. We can check that (cid:80)n depends only on W ˆxt and not on ˆxt; in particular, if ˆxt E(cid:2)dt i this section are conditional to ˆxt). So, let us calculate this expectation. j, where the expectation is with respect to θt and the (cid:101)Ωt i=1 dt 1 = * * * = ˆxt i = 0. We can also note that dt n, dt i = 0. We have to set a so that k (all expectations in (cid:3) = ˆxt j=1 ˆxt i − 1 n (cid:80)n Let k ∈ [d]. For every i ∈ [n], E(cid:2)dt i,k (cid:3) = p  aˆxt i,k − s n a s EΩ:i∈Ω   ˆxt j,k   ,  (cid:88)  j∈Ω where EΩ:i∈Ω denotes the expectation with respect to a subset Ω ⊂ [n] of size s containing i and chosen uniformly at random. We have  EΩ:i∈Ω (cid:88)  ˆxt j,k j∈Ω   = ˆxt i,k + s − 1 n − 1 (cid:88) j∈[n]\{i} ˆxt j,k = n − s n − 1 ˆxt i,k + s − 1 n − 1 n (cid:88) j=1 ˆxt j,k. Hence, for every i ∈ [n], E(cid:2)dt i,k (cid:3) = p (cid:18) a − s n a s n − s n − 1 (cid:19) ˆxi,k − p s n a s s − 1 n − 1 n (cid:88) j=1 ˆxj,k. Therefore, by setting we have, for every i ∈ [n], a := n − 1 p(s − 1) , (29) E(cid:2)dt i,k (cid:3) = p (cid:18) 1 p s n n − 1 s − 1 − 1 p n − s s(s − 1) (cid:19) ˆxi,k − 1 n n (cid:88) j=1 ˆxj,k = ˆxi,k − 1 n n (cid:88) j=1 ˆxj,k, as desired. Now, we want to find the value of ω such that E (cid:104)(cid:13) (cid:13)dt − W ˆxt(cid:13) (cid:13) 2(cid:105) ≤ ω (cid:13) (cid:13)W ˆxt(cid:13) 2 (cid:13) (30) 28 or, equivalently, (cid:34) n (cid:88) E i=1 (cid:35) (cid:13) (cid:13)dt i (cid:13) 2 (cid:13) ≤ (1 + ω) n (cid:88) i=1 (cid:13) (cid:13) (cid:13) ˆxt i − (cid:13) (cid:13) (cid:13) 1 n n (cid:88) j=1 ˆxt j (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) . We can reason on the coordinates separately, or all at once to ease the notations. We have (cid:34) n (cid:88) E i=1 (cid:35) (cid:13) (cid:13)dt i (cid:13) 2 (cid:13) = p s n n (cid:88) i=1 EΩ:i∈Ω (cid:13) (cid:13) (cid:13) aˆxt (cid:13) (cid:13) (cid:13) i − a s (cid:88) j∈Ω ˆxt j (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) . For every i ∈ [n], EΩ:i∈Ω (cid:13) (cid:13) (cid:13) aˆxt (cid:13) (cid:13) (cid:13) i − a s (cid:88) j∈Ω ˆxt j (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) = EΩ:i∈Ω (cid:16) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) a − (cid:17) a s ˆxt i − a s = (cid:16) (cid:13) (cid:13) (cid:13) a − (cid:17) ˆxt i (cid:13) 2 (cid:13) (cid:13) a s + EΩ:i∈Ω ˆxt j (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:88) j∈Ω\{i} (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) a s (cid:88) j∈Ω\{i} ˆxt j (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:43) ˆxt j . (cid:42) (cid:16) − 2 a − (cid:17) a s ˆxt i, a s EΩ:i∈Ω (cid:88) j∈Ω\{i} We have and EΩ:i∈Ω EΩ:i∈Ω (cid:88) j∈Ω\{i} ˆxt j = s − 1 n − 1 (cid:88) j∈[n]\{i} ˆxt j = s − 1 n − 1  j − ˆxt ˆxt i    n (cid:88) j=1 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:88) j∈Ω\{i} ˆxt j (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) = EΩ:i∈Ω (cid:88) (cid:13) (cid:13)ˆxt j (cid:13) 2 + EΩ:i∈Ω (cid:13) (cid:88) (cid:88) (cid:10)ˆxt j, ˆxt j′ (cid:11) = s − 1 n − 1 j∈Ω\{i} (cid:88) j∈[n]\{i} (cid:13) (cid:13)ˆxt j (cid:13) 2 + (cid:13) s − 1 n − 1 j∈Ω\{i} s − 2 n − 2 j′∈Ω\{i,j} (cid:88) (cid:88) (cid:10)ˆxt j, ˆxt j′ (cid:11) j∈[n]\{i} j′∈[n]\{i,j} = s − 1 n − 1 (cid:18) 1 − = s − 1 n − 1 n − s n − 2 s − 2 n − 2   n (cid:88) j=1 ˆxt j (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:88) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) j∈[n]\{i} (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) j=1 j − ˆxt ˆxt i (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) . s − 2 n − 2 (cid:19) (cid:88) j∈[n]\{i} (cid:13) (cid:13)ˆxt j (cid:13) 2 + (cid:13) s − 1 n − 1 s − 2 n − 2  (cid:13) (cid:13)ˆxt j 2 − (cid:13) (cid:13) (cid:13) (cid:13)ˆxt i (cid:13) 2 (cid:13)  + s − 1 n − 1 29 Hence, (cid:34) n (cid:88) E i=1 (cid:35) (cid:13) (cid:13)dt i (cid:13) 2 (cid:13) = p s n n (cid:88) i=1 (cid:16) (cid:13) (cid:13) (cid:13) a − (cid:17) ˆxt i (cid:13) 2 (cid:13) (cid:13) a s + ps a2 (s)2 s − 1 n − 1 n − s n − 2 n (cid:88) j=1 (cid:13) (cid:13)ˆxt j (cid:13) 2 (cid:13) − p s n a2 (s)2 s − 1 n − 1 n − s n − 2 − 2p s n a s s − 1 n − 1 (cid:16) a − a s = (n − 1)2 psn n (cid:88) i=1 (cid:13) (cid:13)ˆxt i (cid:13) 2 + (cid:13) n (cid:88) (cid:13) (cid:13)ˆxt i (cid:13) 2 + p (cid:13) s n a2 (s)2 s − 1 n − 1 s − 2 n − 2 n (cid:88) i=1 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) j=1 i=1 (cid:17) n (cid:88) (cid:42) ˆxt i, n (cid:88) j − ˆxt ˆxt i (cid:43) j=1 i=1 (n − 1)2 ps(s − 1)n n − s n − 2 n (cid:88) i=1 (cid:13) (cid:13)ˆxt i (cid:13) 2 (cid:13) + 1 ps s − 2 s − 1 n − 1 n − 2 + 1 psn s − 2 s − 1 n − 1 n − 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 n (cid:88) i=1 ˆxt i (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) − 2 1 psn s − 2 s − 1 n − 1 n − 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 ˆxt i (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)ˆxt i (cid:13) 2 + 2 (cid:13) n − 1 psn n (cid:88) i=1 (cid:13) (cid:13)ˆxt i (cid:13) 2 − 2 (cid:13) n − 1 psn (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 j − ˆxt ˆxt i (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ˆxt i (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) = (n − 1)(n + 1) psn n (cid:88) i=1 (cid:13) (cid:13)ˆxt i (cid:13) 2 + (cid:13) (n − 1)2 ps(s − 1)n n − s n − 2 n (cid:88) i=1 (cid:13) (cid:13)ˆxt i (cid:13) 2 (cid:13) − n − 1 psn s s − 1 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 ˆxt i (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) + 1 psn s − 2 s − 1 n − 1 n − 2 n (cid:88) i=1 (cid:13) (cid:13)ˆxt i (cid:13) 2 (cid:13) = (n2 − 1)(s − 1)(n − 2) + (n − 1)2(n − s) + (s − 2)(n − 1) ps(s − 1)n(n − 2) n (cid:88) i=1 (cid:13) (cid:13)ˆxt i (cid:13) 2 (cid:13) − n − 1 p(s − 1)n (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 ˆxt i (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) = n − 1 p(s − 1) = n − 1 p(s − 1) n (cid:88) i=1 n (cid:88) i=1 (cid:13) (cid:13)ˆxt i (cid:13) 2 − (cid:13) n − 1 p(s − 1)n (cid:13) (cid:13) (cid:13) ˆxt i − (cid:13) (cid:13) (cid:13) 1 n n (cid:88) j=1 ˆxt j (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) . (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 ˆxt i (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) Therefore, (30) holds with and we have a = 1 + ω. ω = n − 1 p(s − 1) − 1 (31) A.2 From Algorithm 2 to TAMUNA TAMUNA is a two-loop version of Algorithm 2, where every sequence of local steps followed by a communication step is grouped into a round. One crucial observation about Algorithm 2 is the 30 following: for a client i /∈ Ωt, which does not participate in communication at iteration t with θt = 1, its variable xi gets overwritten by ̄xt anyway (step 12 of Algorithm 2). Therefore, all local steps it performed since its last participation are useless and can be omitted. But at iteration t with θt = 0, it is still undecided whether or not a given client will participate in the next communication step at iteration t′ > t, since Ωt′ has not yet been generated. That is why TAMUNA is written with two loops, so that it is decided at the beginning of the round which clients will communicate at the end of the round. Accordingly, at the beginning of round r, a client downloads the current model estimate (step 6 of TAMUNA) only if it participates (i ∈ Ω(r)), to initialize its sequence of local steps. Otherwise (i /∈ Ω(r)), the client is completely idle: neither computation nor downlink or uplink communication is performed in round r. Finally, a round consists of a sequence of successive iterations with θt = 0 and a last iteration with θt = 1 followed by communication. Thus, the number of iterations, or local steps, in a round can be determined directly at the beginning of the round, according to a geometric law. Given these considerations, Algorithm 2 and TAMUNA are equivalent. In TAMUNA, the round and local step indexing is denoted by parentheses, e.g. (r, l), to differentiate it clearly from the iteration indexing. To obtain Theorem 1 from Theorem 3, we first have to reindex the local steps to make the equivalent iteration index t in Algorithm 2 appear, since the rate is with respect to the number of iterations, not rounds, whose size is random. The almost sure convergence statement follows directly from the one in Theorem 3. Importantly, we want a result related to the variables which are actually computed in TAMUNA, without including virtual variables by the idle clients, which are computed in Algorithm 2 but not in TAMUNA. That is why we express the convergence result with respect to ̄xt, which relates only to the variables of active clients; also, ̄xt is the model estimate known by the server whenever communication occurs, which matters at the end. Note the bar in Ψ in (6) to differentiate it from Ψ in (22). Thus, we continue the analysis of Algorithms 2 and 3 in Section A, with same definitions and notations. Let t ≥ 0. If θt = 0, we choose Ωt ⊂ [n] of size c uniformly at random and a random binary mask qt = (qt j) (in Theorem 1, for simplicity, Ωt and qt are the ones that will be used at the end of the round; this choice is valid as it does not depend on the past). Ωt, qt and ̄xt are already defined if θt = 1. We want to study E , where the expectation is with respect to Ωt and qt, whatever θt. Using the i)i∈Ωt ∈ Rd×c, and we define ̄xt := 1 s j∈Ωt Ct j(ˆxt (cid:80) 2 | F t(cid:105) (cid:104)(cid:13) (cid:13) ̄xt − x⋆(cid:13) (cid:13) derivations already obtained, 2 | F t(cid:105) (cid:104)(cid:13) (cid:13) ̄xt − x⋆(cid:13) (cid:13) nE = (cid:13) = (cid:13) 2 − (cid:13) (cid:13)ˆxt − x⋆(cid:13) (cid:13) (cid:13)wt − w⋆(cid:13) 2 − γ2 (cid:13) (cid:13) + (2pχ + ν − 1) (cid:13) 2 − γ2 (cid:13) (cid:13)wt − w⋆(cid:13) (cid:13) + (cid:0)2pχ − p(1 − ν)(cid:1) (cid:13) (cid:13)W ˆxt(cid:13) 2 + ν (cid:13) (cid:13)W ˆxt(cid:13) 2 (cid:13) (cid:13) (cid:13)ht − h⋆(cid:13) 2 + 2γ⟨ˆxt − x⋆, ˆht+1 − h⋆⟩ (cid:13) (cid:13)W ˆxt(cid:13) 2 (cid:13) (cid:13)ht − h⋆(cid:13) 2 + 2γ⟨ˆxt − x⋆, ˆht+1 − h⋆⟩ (cid:13) (cid:13)W ˆxt(cid:13) 2 . (cid:13) ≤ (cid:13) Hence, n γ E 2 | F t(cid:105) (cid:104)(cid:13) (cid:13) ̄xt − x⋆(cid:13) (cid:13) + γ(1 + ω) pχ (cid:13)wt − w⋆(cid:13) (cid:13) 2 + (cid:13) E (cid:104)(cid:13) (cid:13)ht+1 − h⋆(cid:13) 2 (cid:13) γ(1 + ω) pχ (cid:18) 1 − pχ 1 + ω | F t(cid:105) (cid:19) (cid:13)ht − h⋆(cid:13) (cid:13) 2 (cid:13) ≤ 1 γ 31 and E (cid:104)(cid:13) (cid:13) ̄xt − x⋆(cid:13) 2 | F t (cid:13) 0 (cid:105) + n γ γ(1 + ω) pχ E (cid:104)(cid:13) (cid:13)ht+1 − h⋆(cid:13) 2 (cid:13) (cid:18) ≤ max (1 − γμ)2, (γL − 1)2, 1 − p2χ Using the tower rule, (cid:105) | F t 0 (cid:19) s − 1 n − 1 Ψt + γσ2. E (cid:104)(cid:13) (cid:13) ̄xt − x⋆(cid:13) (cid:13) 2(cid:105) n γ + γ(1 + ω) pχ E (cid:104)(cid:13) (cid:13)ht+1 − h⋆(cid:13) (cid:13) 2(cid:105) ≤ τ tΨ0 + γσ2 1 − τ . Since in TAMUNA, x0 1 = * * * = x0 0 n = ̄x0 = ̄x(0), Ψ = Ψ0. This concludes the proof of Theorem 1. B Proof of Theorem 2 We suppose that the assumptions in Theorem 2 hold. s is set as the maximum of three values. Let us consider these three cases. 1) Suppose that s = 2. Since 2 = s ≥ ⌊αc⌋ and 2 = s ≥ ⌊ c d ⌋, we have α ≤ 3 c and 1 ≤ 3d c . Hence, O (cid:19)(cid:18) sd c + (cid:18)(cid:114) nκ n s s (cid:18) d nκ + n(cid:1) c √ (cid:19) n c nκ c + d d + = O (cid:0)√ (cid:18) = O (cid:19) + 1 + αd d c + (cid:19) d c . (32) 2) Suppose that s = ⌊ c c ≤ 1 2 , so that αd ≤ 1 + d and d d ⌋. Then sd c ≤ 1. Since s ≥ ⌊αc⌋ and ⌊ c d ⌋ = s ≥ 2, we have αc ≤ s+1 ≤ c d +1 c ≤ 2. Hence, (cid:18)(cid:114) nκ s (cid:18)(cid:114) nκ s = O O + + (cid:19) + 1 + αd (cid:19)(cid:18) sd c (cid:19) . n s n s n s Since 2s ≥ c d , we have 1 s ≤ 2d c and O = O + (cid:18)(cid:114) nκ s (cid:114) nκ d c (cid:18)√ (cid:19)(cid:18) sd c (cid:19) + d n c (cid:19) + 1 + αd . (33) 3) Suppose that s = ⌊αc⌋. This implies α > 0. Then s ≤ αc. Also, 2s ≥ αc and 1 d and 1 ≤ αd + d c . Since s = ⌊αc⌋ ≥ 2, we have 1 d ⌋, we have αc + 1 ≥ c s = ⌊αc⌋ ≥ ⌊ c s ≤ 2 αc . Since c ≤ α 2 and 32 1 ≤ 2αd. Hence, O = O = O (cid:18)(cid:114) nκ s (cid:18)(cid:114) nκ αc (cid:18)√ αd + n s n αc (cid:114) nκ c + (cid:19)(cid:18) sd c (cid:19) + 1 + αd (cid:19) (αd + αd + αd) + d (cid:19) . n c (34) By adding up the three upper bounds (32), (33), (34), we obtain the upper bound in (15). C Sublinear convergence in the convex case In this section only, we remove the hypothesis of strong convexity: the functions fi are only assumed to be convex and L-smooth, and we suppose that a solution x⋆ ∈ Rd to (1) exists. Also, for simplicity, we only consider the case of exact gradients (σ = 0). Then we have sublinear ergodic convergence: Theorem 4 (sublinear convergence). In Algorithm 2 suppose that σ = 0 and that 0 < γ < 2 L and 0 < χ < n(s − 1) s(n − 1) ∈ (cid:21) , 1 . (cid:18) 1 2 For every i = 1, . . . , n and T ≥ 0, let ̃xT i := 1 T + 1 T (cid:88) t=0 xt i. Then E (cid:104)(cid:13) (cid:13)∇f ( ̃xT i )(cid:13) (cid:13) 2(cid:105) = O (cid:19) . (cid:18) 1 T (35) (36) (37) (cid:80)n i=1 ∇fi(x⋆) = 0. Proof. A solution x⋆ ∈ Rd to (1), which is supposed to exist, satisfies ∇f (x⋆) = 1 n x⋆ is not necessarily unique but h⋆ i := ∇fi(x⋆) is unique. We define the Bregman divergence of a L-smooth convex function g at points x, x′ ∈ Rd as 2L ∥∇g(x) − ∇g(x′)∥2. We Dg(x, x′) := g(x) − g(x′) − ⟨∇g(x′), x − x′⟩ ≥ 0. We have Dg(x, x′) ≥ 1 note that for every x ∈ Rd and i = 1, . . . , n, Dfi(x, x⋆) is the same whatever the solution x⋆. For every t ≥ 0, we define the Lyapunov function Ψt := 1 γ n (cid:88) i=1 (cid:13) (cid:13)xt i − x⋆(cid:13) 2 + (cid:13) γ p2χ n − 1 s − 1 n (cid:88) i=1 (cid:13) (cid:13)ht i − h⋆ i (cid:13) 2 , (cid:13) (38) Starting from (26), we have, for every t ≥ 0, E(cid:2)Ψt+1 | F t(cid:3) = ≤ 1 γ 1 γ n (cid:88) i=1 n (cid:88) i=1 E (cid:104)(cid:13) (cid:13)xt+1 i − x⋆(cid:13) 2 (cid:13) | F t(cid:105) + γ p2χ n − 1 s − 1 n (cid:88) i=1 E (cid:104)(cid:13) (cid:13)ht+1 i − h⋆ i (cid:13) 2 (cid:13) | F t(cid:105) (cid:13) (cid:0)xt (cid:13) i − γ∇fi(xt i)(cid:1) − (cid:0)x⋆ − γ∇fi(x⋆)(cid:1)(cid:13) 2 (cid:13) + (cid:18) γ p2χ n − 1 s − 1 (cid:19) n (cid:88) − γ i=1 (cid:13) (cid:13)ht i − h⋆ i (cid:13) 2 + (cid:13) p γ (χ − 1 + ν) n (cid:88) i=1 (cid:13) (cid:13) (cid:13) ˆxt i − (cid:13) (cid:13) (cid:13) 1 n n (cid:88) j=1 ˆxt j (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) , 33 with (cid:13) (cid:0)xt (cid:13) i − γ∇fi(xt 2 = (cid:13) i)(cid:1) − (cid:0)x⋆ − γ∇fi(x⋆)(cid:1)(cid:13) (cid:13) i) − ∇fi(x⋆), xt i − x⋆⟩ i − x⋆(cid:13) 2 − 2γ⟨∇fi(xt (cid:13) (cid:13)∇fi(xt i) − ∇fi(x⋆)(cid:13) 2 (cid:13) (cid:13)xt + γ2 (cid:13) (cid:13)xt i − x⋆(cid:13) 2 − (2γ − γ2L)⟨∇fi(xt (cid:13) where the second inequality follows from cocoercivity of the gradient. Moreover, for every x, x′, Dfi(x, x′) ≤ ⟨∇fi(x) − ∇fi(x′), x − x′⟩. Therefore, i) − ∇fi(x⋆), xt i − x⋆⟩, ≤ (cid:13) E(cid:2)Ψt+1 | F t(cid:3) ≤ Ψt − (2 − γL) n (cid:88) i=1 Dfi(xt i, x⋆) − γ n (cid:88) i=1 (cid:13) (cid:13)ht i − h⋆ i (cid:13) 2 + (cid:13) p γ (χ − 1 + ν) n (cid:88) i=1 (cid:13) (cid:13) (cid:13) ˆxt i − (cid:13) (cid:13) (cid:13) 1 n n (cid:88) j=1 ˆxt j (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) . Telescopic the sum and using the tower rule of expectations, we get summability over t of the three negative terms above: for every T ≥ 0, we have (2 − γL) n (cid:88) T (cid:88) i=1 t=0 E(cid:2)Dfi(xt i, x⋆)(cid:3) ≤ Ψ0 − E(cid:2)ΨT +1(cid:3) ≤ Ψ0, n (cid:88) T (cid:88) γ i=1 t=0 E (cid:104)(cid:13) (cid:13)ht i − h⋆ i 2(cid:105) (cid:13) (cid:13) ≤ Ψ0 − E(cid:2)ΨT +1(cid:3) ≤ Ψ0, p γ (1 − ν − χ) n (cid:88) T (cid:88) i=1 t=0  E  (cid:13) (cid:13) (cid:13) ˆxt i − (cid:13) (cid:13) (cid:13) 1 n n (cid:88) j=1 ˆxt j 2  ≤ Ψ0 − E(cid:2)ΨT +1(cid:3) ≤ Ψ0. (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (39) (40) (41) Taking ergodic averages and using convexity of the squared norm and of the Bregman divergence, we can now get O(1/T ) rates. We use a tilde to denote averages over the iterations so far. That is, for every i = 1, . . . , n and T ≥ 0, we define and ̃xT i := 1 T + 1 T (cid:88) t=0 xt i ̃xT := 1 n n (cid:88) i=1 ̃xT i . The Bregman divergence is convex in its first argument, so that, for every T ≥ 0, n (cid:88) i=1 Dfi( ̃xT i , x⋆) ≤ n (cid:88) i=1 1 T + 1 T (cid:88) t=0 Dfi(xt i, x⋆). Combining this inequality with (39) yields, for every T ≥ 0, (2 − γL) n (cid:88) i=1 E(cid:2)Dfi( ̃xT i , x⋆)(cid:3) ≤ Ψ0 T + 1 . 34 (42) Similarly, for every i = 1, . . . , n and T ≥ 0, we define ̃hT i := 1 T + 1 T (cid:88) t=0 ht i and we have, for every T ≥ 0, n (cid:88) i=1 (cid:13) ̃hT i − h⋆ (cid:13) (cid:13) i (cid:13) 2 (cid:13) (cid:13) ≤ n (cid:88) i=1 1 T + 1 T (cid:88) t=0 (cid:13) (cid:13)ht i − h⋆ i (cid:13) 2 . (cid:13) Combining this inequality with (40) yields, for every T ≥ 0, γ n (cid:88) i=1 E (cid:20)(cid:13) ̃hT i − h⋆ (cid:13) (cid:13) i 2(cid:21) (cid:13) (cid:13) (cid:13) ≤ Ψ0 T + 1 . Finally, for every i = 1, . . . , n and T ≥ 0, we define and and we have, for every T ≥ 0, ̃ˆxT i := 1 T + 1 T (cid:88) t=0 ˆxt i ̃ˆxT := 1 n n (cid:88) i=1 ̃ˆxT i , n (cid:88) i=1 i − ̃ˆxT (cid:13) (cid:13) 2 ̃ˆxT (cid:13) (cid:13) (cid:13) (cid:13) ≤ n (cid:88) i=1 1 T + 1 T (cid:88) t=0 (cid:13) (cid:13) (cid:13) ˆxt i − (cid:13) (cid:13) (cid:13) 1 n n (cid:88) j=1 ˆxt j (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) . Combining this inequality with (41) yields, for every T ≥ 0, (cid:20)(cid:13) 2(cid:21) i − ̃ˆxT (cid:13) ̃ˆxT (cid:13) (cid:13) (cid:13) (cid:13) (1 − ν − χ) n (cid:88) E p γ i=1 ≤ Ψ0 T + 1 . Next, we have, for every i = 1, . . . , n and T ≥ 0, (cid:13) (cid:13)∇f ( ̃xT i )(cid:13) 2 (cid:13) ≤ 2 (cid:13) ≤ 2L2 (cid:13) (cid:13)∇f ( ̃xT (cid:13) ̃xT i ) − ∇f ( ̃xT )(cid:13) + 2 (cid:13) 2 (cid:13) (cid:13)∇f ( ̃xT )(cid:13) + 2 (cid:13) i − ̃xT (cid:13) 2 2 (cid:13) (cid:13) (cid:13)∇f ( ̃xT )(cid:13) 2 (cid:13) . Moreover, for every T ≥ 0 and solution x⋆ to (1), = (cid:13) (cid:13)∇f ( ̃xT )(cid:13) (cid:13) 2 (cid:13) (cid:13)∇f ( ̃xT ) − ∇f (x⋆)(cid:13) 2 (cid:13) 1 n n (cid:88) (cid:13)∇fi( ̃xT ) − ∇fi(x⋆)(cid:13) (cid:13) 2 (cid:13) i=1 n (cid:88) i=1 2 n ≤ ≤ ≤ (cid:13) (cid:13)∇fi( ̃xT ) − ∇fi( ̃xT i )(cid:13) 2 (cid:13) + 2 n n (cid:88) i=1 (cid:13) (cid:13)∇fi( ̃xT i ) − ∇fi(x⋆)(cid:13) 2 (cid:13) 2L2 n n (cid:88) i=1 (cid:13) (cid:13) ̃xT i − ̃xT (cid:13) 2 (cid:13) + 4L n n (cid:88) i=1 Dfi( ̃xT i , x⋆). 35 (43) (44) (45) (46) There remains to control the terms (cid:13) (cid:13) ̃xT i − ̃xT (cid:13) 2: we have, for every T ≥ 0, (cid:13) n (cid:88) i=1 (cid:13) (cid:13) ̃xT i − ̃xT (cid:13) 2 (cid:13) ≤ 2 ≤ 2 n (cid:88) i=1 n (cid:88) i=1 For every i = 1, . . . , n and t ≥ 0, (cid:13) (cid:13)( ̃xT (cid:13) i − ̃xT ) − ( ̃ˆxT (cid:13) 2 i − ̃ˆxT ) (cid:13) (cid:13) + 2 n (cid:88) i=1 i − ̃ˆxT (cid:13) (cid:13) 2 ̃ˆxT (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ̃xT (cid:13) i − ̃ˆxT i (cid:13) 2 (cid:13) (cid:13) + 2 n (cid:88) i=1 (cid:13) i − ̃ˆxT (cid:13) 2 ̃ˆxT (cid:13) (cid:13) (cid:13) (cid:13) . (47) i = xt ˆxt i − γ(cid:0)∇fi(xt i) − ht i (cid:1) so that, for every i = 1, . . . , n and T ≥ 0, i − ̃ˆxT ̃xT i = γ 1 T + 1 T (cid:88) t=0 ∇fi(xt i) − γ ̃hT i and (cid:13) (cid:13) ̃xT (cid:13) i − ̃ˆxT i (cid:13) 2 (cid:13) (cid:13) = γ2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 1 T + 1 ≤ 2γ2 1 T + 1 t=0 T (cid:88) T (cid:88) ∇fi(xt i) − ̃hT i (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)∇fi(xt 2 + 2γ2 (cid:13) i) − ∇fi(x⋆)(cid:13) ̃hT i − h⋆ (cid:13) (cid:13) (cid:13) i (cid:13) 2 (cid:13) (cid:13) Dfi(xt i, x⋆) + 2γ2 (cid:13) ̃hT i − h⋆ (cid:13) (cid:13) i (cid:13) 2 (cid:13) (cid:13) . (48) ≤ 4Lγ2 t=0 T (cid:88) t=0 1 T + 1 Combining (45), (46), (47), (48), we get, for every T ≥ 0, n (cid:88) i=1 (cid:13) (cid:13)∇f ( ̃xT i )(cid:13) 2 (cid:13) ≤ 2L2 ≤ 2L2 = 4L2 ≤ 8L2 n (cid:88) i=1 n (cid:88) i=1 n (cid:88) i=1 n (cid:88) i=1 (cid:13) (cid:13) ̃xT i − ̃xT (cid:13) 2 (cid:13) + 2n (cid:13) (cid:13)∇f ( ̃xT )(cid:13) 2 (cid:13) (cid:13) (cid:13) ̃xT i − ̃xT (cid:13) 2 (cid:13) + 2L2 n (cid:88) (cid:13) (cid:13) ̃xT i − ̃xT (cid:13) 2 (cid:13) + 4L (cid:13) (cid:13) ̃xT i − ̃xT (cid:13) 2 (cid:13) + 4L i=1 n (cid:88) Dfi( ̃xT i , x⋆) (cid:13) (cid:13) ̃xT (cid:13) i − ̃ˆxT i (cid:13) 2 (cid:13) (cid:13) i=1 n (cid:88) + 8L2 i=1 i − ̃ˆxT (cid:13) (cid:13) 2 ̃ˆxT (cid:13) (cid:13) (cid:13) (cid:13) + 4L n (cid:88) i=1 n (cid:88) i=1 Dfi( ̃xT i , x⋆) Dfi( ̃xT i , x⋆) ≤ 32L3γ2 1 T + 1 n (cid:88) T (cid:88) i=1 t=0 Dfi(xt i, x⋆) + 16L2γ2 n (cid:88) i=1 (cid:13) ̃hT i − h⋆ (cid:13) (cid:13) i (cid:13) 2 (cid:13) (cid:13) + 8L2 n (cid:88) i=1 i − ̃ˆxT (cid:13) (cid:13) 2 ̃ˆxT (cid:13) (cid:13) (cid:13) (cid:13) + 4L n (cid:88) i=1 Dfi( ̃xT i , x⋆). 36 Taking the expectation and using (39), (43), (44) and (42), we get, for every T ≥ 0, E (cid:104)(cid:13) (cid:13)∇f ( ̃xT i )(cid:13) (cid:13) 2(cid:105) n (cid:88) i=1 ≤ 32L3γ2 1 T + 1 + 16L2γ2 n (cid:88) n (cid:88) T (cid:88) E(cid:2)Dfi(xt i, x⋆)(cid:3) t=0 i=1 (cid:20)(cid:13) ̃hT i − h⋆ (cid:13) (cid:13) i E (cid:13) (cid:13) (cid:13) 2(cid:21) i=1 2(cid:21) (cid:20)(cid:13) i − ̃ˆxT (cid:13) ̃ˆxT (cid:13) (cid:13) (cid:13) (cid:13) E + 8L2 n (cid:88) i=1 + 4L n (cid:88) i=1 E(cid:2)Dfi( ̃xT i , x⋆)(cid:3) . ≤ = 32L3γ2 Ψ0 T + 1 2 − γL (cid:20) 32L3γ2 + 4L 2 − γL + 16L2γ Ψ0 T + 1 + + 16L2γ + 8L2γ p(1 − ν − χ) (cid:21) Ψ0 T + 1 8L2γ p(1 − ν − χ) . Ψ0 T + 1 + 4L 2 − γL Ψ0 T + 1 Hence, with γ = Θ (cid:0) p L (cid:112) c n (cid:1), χ satisfying δ ≤ χ ≤ 1 − ν − δ for some δ > 0, and h0 i = ∇fi(x0), for every i ∈ [n], then for every ε > 0, we have E (cid:104)(cid:13) (cid:13)∇f ( ̃xT i )(cid:13) (cid:13) 2(cid:105) ≤ ε n (cid:88) i=1 after iterations and (cid:32) O L2 p (cid:114) n c (cid:13)x0 − x⋆(cid:13) (cid:13) 2 (cid:13) ε (cid:33) (cid:32) O L2 (cid:114) n c (cid:13)x0 − x⋆(cid:13) (cid:13) 2 (cid:13) ε (cid:33) (49) (50) (51) communication rounds. We note that LT does not yield any acceleration: the communication complexity is the same whatever p. CC is effective, however, since we communicate much less than d floats during every communication round. This convergence result applies to Algorithm 2. ̃xT i i, including the ones for clients not participating in the next communication round. The result still applies to TAMUNA, with, for every i ∈ [n], ̃xT which are actually computed, since this is a random subsequence of all xt i. i defined as the average of the x(r,l) in (36) is an average of all xt i 37
http://arxiv.org/abs/2302.09831v1
2023-02-20T08:37:08
2023-02-20T08:37:08
Escaping limit cycles: Global convergence for constrained nonconvex-nonconcave minimax problems
This paper introduces a new extragradient-type algorithm for a class of nonconvex-nonconcave minimax problems. It is well-known that finding a local solution for general minimax problems is computationally intractable. This observation has recently motivated the study of structures sufficient for convergence of first order methods in the more general setting of variational inequalities when the so-called weak Minty variational inequality (MVI) holds. This problem class captures non-trivial structures as we demonstrate with examples, for which a large family of existing algorithms provably converge to limit cycles. Our results require a less restrictive parameter range in the weak MVI compared to what is previously known, thus extending the applicability of our scheme. The proposed algorithm is applicable to constrained and regularized problems, and involves an adaptive stepsize allowing for potentially larger stepsizes. Our scheme also converges globally even in settings where the underlying operator exhibits limit cycles.
[ "Thomas Pethick", "Puya Latafat", "Panagiotis Patrinos", "Olivier Fercoq", "Volkan Cevher" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09831v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09831v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "math.OC", "@scheme": "http://arxiv.org/schemas/atom" }
[ "math.OC", "cs.LG" ]
3 2 0 2 b e F 0 2 ] C O . h t a m [ 1 v 1 3 8 9 0 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2022 Escaping limit cycles: Global convergence for con- strained nonconvex-nonconcave minimax problems Thomas Pethick ̊ Puya Latafat: Panagiotis Patrinos: Olivier Fercoq; Volkan Cevher ̊ Abstract This paper introduces a new extragradient-type algorithm for a class of nonconvex-nonconcave minimax problems. It is well-known that finding a local solution for general minimax problems is computationally intractable. This ob- servation has recently motivated the study of structures sufficient for convergence of first order methods in the more general setting of variational inequalities when the so-called weak Minty variational inequality (MVI) holds. This problem class captures non-trivial structures as we demonstrate with examples, for which a large family of existing algorithms provably converge to limit cycles. Our results require a less restrictive parameter range in the weak MVI compared to what is previously known, thus extending the applicability of our scheme. The proposed algorithm is applicable to constrained and regularized problems, and involves an adaptive step- size allowing for potentially larger stepsizes. Our scheme also converges globally even in settings where the underlying operator exhibits limit cycles. 1 Introduction Many machine learning applications, from generative adversarial networks (GANs) to robust re- inforcement learning, result in nonconvex-nonconcave constrained minimax problems, which pose notorious difficulties to the scalable first order methods. Indeed, there is no shortage of results illus- trating divergent or cycling behavior when going beyond minimization problems (Benaım & Hirsch, 1999; Hommes & Ochea, 2012; Mertikopoulos et al., 2018b; Hsieh et al., 2021). Traditionally, minimax problems have been studied for more than half a century under the umbrella of the variational inequalities (VIs). The extragradient-type algorithms from the VI literature was recently brought to the awareness of the machine learning community (Mertikopoulos et al., 2018a; Gidel et al., 2018; Böhm et al., 2020), and have provided a principled way of stabilizing training and avoiding Poincaré recursions. However, these results mostly concern the convex-concave setting. In nonconvex-nonconcave minimax problems, or more generally nonmonotone variational inequali- ties (VIs), even finding a local solution is in general intractable. This has been made precise through exponential lower bound of the classical optimization type (Hirsch & Vavasis, 1987) and computa- tional complexity results (Papadimitriou, 1994; Daskalakis et al., 2021b). This is in sharp contrast to minimization problems, where only finding a global solution is intractable. The recent result of (Hsieh et al., 2021) provides some intuition behind this difference by showing that the asymptotic limits of most schemes, including extragradient, can converge to attracting limit cycles. To make progress in lieu of these negative results, Diakonikolas et al. (2021) proposes a simple generalization of extragradient, called (EG+), that can converge to a stationary point even for a class of nonmonotone problems provided that the weak Minty variational inequality (MVI) holds. This problem class is parametrized by a constant ρ, which controls the degree of nonconvexity. However, given the range of ρ in Diakonikolas et al. (2021), the new class is still too small to include even the simplest counterexample of Hsieh et al. (2021) for the general Robbins-Monro schemes. ̊Laboratory for Information and Inference Systems (LIONS), EPFL ([email protected]) :Department of Electrical Engineering (ESAT-STADIUS), KU Leuven ;Laboratoire Traitement et Communication d'Information, Télécom Paris, Institut Polytechnique de Paris 1 Published as a conference paper at ICLR 2022 Figure 1: Forsaken (Hsieh et al., 2021, Example 5.2) provides an example where the weak MVI constant ρ does not satisfy algorithmic requirements of (EG+) and (EG+) does not converge to a stationary point but rather the attracting limit cycle (left). In contrast, adaptively choosing the extrapolation stepsize large enough with our new method, called (CurvatureEG+), is sufficient for avoiding the limit cycles (right). The repellant limit cycle is indicated in black and the stream plot shows the vectorfield Fz. The blue and red curves indicate multiple trajectories of the algorithms starting from initializations indicated in black. See Appendix C.4 for properties of Forsaken. Contributions Building on the analysis in Diakonikolas et al. (2021), we propose a new adaptive scheme, called (CurvatureEG+), that converges even in the difficult counter example of Hsieh et al. (2021) as illustrated in Fig. 1. Our main contributions are summarized below. 1. We propose an adaptive extragradient-type algorithm that converges for a larger range of ρ, the parameter in the weak MVI assumption (cf. Assumption I(iii)) than previously known. 2. More importantly, we show that convergence is ensured if 2ρ ` γk ą 0, where γk is the extrapola- tion stepsize. This is crucial since by selecting γk through a backtracking procedure larger stepsizes are allowed, which in turn implies convergence for more negative values of ρ, thus capturing a larger class of problems. In addition, we show that the linesearch eventually passes without triggering any backtrack if initialized based on the Jacobian of F (cf. Section 4). 3. We present a non-adaptive variant of our algorithm (CEG+), and show that for particular pa- rameter choices (EG+) of Diakonikolas et al. (2021), and when ρ " 0 the celebrated forward- backward-forward (FBF) algorithm of Tseng (2000) are recovered, thus unifying and generalizing both methods. We improve upon Diakonikolas et al. (2021) by not only relaxing the problem class but also the stepsize range. We show that our results are tight by providing a matching lower bound, thus providing a complete picture of (EG+) under weak MVI. Related work The community has resorted to various approaches to make progress for nonconvex-nonconcave minimax problems. One line of work focuses on deriving local convergence results (Mazumdar et al., 2019; Fiez & Ratliff, 2020; Heusel et al., 2017). For global results, the two primary approaches have been to either assume a global oracle for the inner problem (Jin et al., 2019; Davis & Drusvyatskiy, 2018) or assume particular problem structure such as the Polyak- Łojasiewicz condition (Nouiehed et al., 2019; Yang et al., 2020) or concavity for the inner problem (Rafique et al., 2019). We follow the same tradition of assuming structure, but from the general perspective of operator theory. The idea of studying minimax and related problems through the lens of variational inequality has a long history (Minty, 1962; Rockafellar, 1976; Polyak, 1987; Bertsekas, 1997), with recent renewed interest due to its relevance for minimax formulations (Mertikopoulos et al., 2018a; Gidel et al., 2018; Azizian et al., 2020). One relaxation of the monotone case for which we have positive results is that of Minty varia- tional inequalities (MVI) (Mertikopoulos et al., 2018a; Song et al., 2021; Zhou et al., 2017; Liu et al., 2021), which includes all quasiconvex-concave and starconvex-concave problems. Diakoniko- las et al. (2021) introduced the relaxed condition of weak MVI. In the unconstrained setting they showed non-asymptotic convergence results under a restricted problem constant ρ. Similarly to us, Lee & Kim (2021a) extends the regime but under the stronger condition of cohypomonotonicity. 2 Published as a conference paper at ICLR 2022 They do so by studying a more evolved variant of extragradient building on anchoring techniques. We instead directly improve upon (EG+) and generalize it to new settings. In the stochastic setting, usually the stepsize for the extrapolation step is diminishing. This is the case in Böhm et al. (2020) where they consider a forward-backward-forward type scheme. However, they remain in the monotone setting, where the limit cycles are non-attracting, as exemplified by a bilinear game. Hsieh et al. (2021) recently showed that a large family of algorithms, which includes the extragradient method with diminishing stepsize, can converge to attracting limit cycles. Going beyond this restriction, prior to Diakonikolas et al. (2021), Hsieh et al. (2020) interestingly considers two separate and diminishing stepsizes under the stronger assumption of MVI. 2 Problem formulation and preliminaries In this paper we are interested in finding zeros of an operator (or set-valued mapping) T : (cid:146)n Ñ (cid:146)n that is written as the sum of a Lipschitz continuous (but possibly nonmonotone) operator F and a maximally monotone operator A. That is, we wish to find z P (cid:146)n such that the general inclusion 0 P T z (cid:66) Az ` Fz (2.1) holds. The set of all such points is denoted by zer T (cid:66) tz P Rn | 0 P T zu. Throughout the paper problem (2.1) is studied under the following assumptions (definitions can be found in Appendix A). Assumption I. In problem (2.1), (i) Operator A : (cid:146)n Ñ (cid:146)n is a maximally monotone operator. (ii) Operator F : (cid:146)n Ñ (cid:146)n is L-Lipschitz continuous. (iii) Weak Minty variational inequality (MVI) holds, i.e., there exists a nonempty set S‹ Ď zer T 2L , 8q such that for all z‹ P S‹ and some ρ P p ́ 1 xv, z ́ z‹y ě ρ}v}2, for all pz, vq P gph T . (2.2) Generally, we do not require the weak Minty assumption to hold at every z‹ P zer T . In fact, as shown in Theorem 3.1 nonemptiness of S‹ is sufficient for ensuring that the limit points belong to zer T . Interestingly, despite nonmonotonicity of F, global (as opposed to subsequential) convergence can be established when S‹ " zer T , an assumption that is still weaker than cohypomonotonicity. VIs provide a convenient abstraction for a range of problems. We mention some central examples below but otherwise defer to the overview in Facchinei & Pang (2007). Subsequently, we provide examples where the weak MVI holds. Example 1: (minimax optimization). A comprehensive way to capture a wide range of applications in machine learning is to consider structured minimax problems of the form Lpx, yq (cid:66) φpx, yq ` gpxq ́ hpyq, maximize yP(cid:146)ny minimize xP(cid:146)nx (2.3) where φ is not necessarily convex in x or concave in y. Functions g and h are proper extended real-valued lower semicontinuous and convex, with easy to compute proximal maps. Common ex- amples for g and h involve regularizers such as (cid:96)1, (cid:96)2 norms, or indicator functions of sets al- lowing us to capture constrained minimax problems. The first order optimality condition asso- ciated with this problem may be written in the form of the structured inclusion (2.1) by letting Fz " p∇xφpx, yq, ́∇yφpx, yqq, Az " pBgpxq, Bhpyqq. As it will become clear in the next section (cf. Algorithm 1), the main computations involved in the proposed scheme are evaluations of F and resolvent JA " pid ` Aq ́1. Recall that the resolvent of a maximally monotone operator is firmly nonexpansive with full domain (cf. (Bauschke & Combettes, 2017, Sect. 23)). If A " B f is the subdifferential operator of a convex function f , then its resolvent is the proximal mapping. For instance when A is as in Example 1, then its resolvent is given by JApx, yq " pproxgpxq, proxhpyqq. Example 2: (N-player games). More generally, we can consider a continuous game of N players in normal form. Denote the decision variables z :" pzi; z ́iq :" pz1, ..., zNq and let the loss incurred by 3 Published as a conference paper at ICLR 2022 the ith player be Lipzi; z ́iq " φipzq ` gipziq where φi is the payoff function and gi typically enforce constraints on zi. Then we seek a Nash equilibrium, which is any decision which is unilaterally stable, i.e., Lipz‹ i ; z‹ ́iq ď Lipzi; z‹ ́iq @zi and i P rNs (cid:66) t1, . . . , Nu. (2.4) The corresponding first order optimality conditions may be written as Az " pBg1pz1q, . . . , BgNpzNqq and Fz " p∇z1 φ1pzq, . . . , ∇zN φNpzqq. A solution to (2.1) thus returns a candidate for which the first order condition of the above problems is satisfied. In the monotone case these two solution concepts coincide, while in the more general case of weak MVI, we provide examples where this still holds. In particular, we introduce in Sec- tion 5 a nonconvex-nonconcave minimax game which additionally exhibits limit cycles for Fz. As a consequence most schemes including gradient descent ascent, extragradient and optimistic gradi- ent descent ascent do not converge to a stationary point globally (Hsieh et al., 2021). However, the global Nash equilibrium satisfies Assumption I(iii) with ρ ą ́1{2L, which we show is sufficient for global convergence of (CEG+). The weak MVI condition is satisfied in certain reinforcement learning settings. Specifically, Di- akonikolas et al. (2021); Daskalakis et al. (2021a) considers a two-player zero-sum game where the weak MVI holds, while neither MVI nor cohypomonotonicity holds. Interestingly, the formulation requires constraint-a condition they do not handle. We thus provide the first provable algorithm for this setting. Weak MVI also contains all quasiconvex-concave and starconvex-concave problems. For further examples, the literature on cohypomonotonicity (Bauschke et al., 2020) is relevant since it implies weak MVI, see for instance Lee & Kim (2021b, Example 1). 3 Generalizing Extragradient+ Our starting point is the Extragradient+ (EG+) algorithm of Diakonikolas et al. (2021) which is identical to extragradient (Korpelevich, 1976) except for the second stepsize being smaller. They only treat the inclusion (2.1) when A " 0, and in our notation require ρ P p ́1{8L, 0s. Specifically, ̄zk " zk ́ γkFzk, where they choose γk " 1{L and ̄αk " 1{2 (Diakonikolas et al., 2021, Thm. 3.2). We generalize (EG+) in Algorithm 1 to take the operator A into account-consequently we capture constraint and regularized problems as well. In addition, the scheme is adaptive in ̄αk. We will show that the weaker requirement of ρ P p ́1{2L, 8q suffices even for the more general inclusion (2.1). zk`1 " zk ́ ̄αkγkF ̄zk (EG+) The main convergence results of Algorithm 1 are established in the next theorem. The proof is largely inspired by recent developments in operator splitting techniques in the framework of mono- tone inclusions (Latafat & Patrinos, 2017; Giselsson, 2021). The key idea lies in interpreting each iteration of the algorithm as a projection onto a certain hyperplane, an interpretation that dates back to Solodov & Tseng (1996); Solodov & Svaiter (1999). ` ‰ Theorem 3.1. Suppose that Assumption I holds, and let λk P p0, 2q, γk P where txu` (cid:66) maxt0, xu, δk P p ́γk{2, ρs, lim infkÑ8 λkp2 ́ λkq ą 0, and lim infkÑ8pδk ` γk{2q ą 0. Consider the sequences pzkqkP(cid:142), p ̄zkqkP(cid:142) generated by Algorithm 1. Then for all z‹ P S‹, t ́2ρu`, 1{L min k"0,1,...,m 1 γ2 k }H ̄zk ́ Hzk}2 ď 1 κpm`1q }z0 ́ z‹}2, (3.1) where κ " lim infkÑ8 λkp2 ́ λkqpδk ` γk{2q2. Moreover, the following holds (i) p ̄zkqkP(cid:142) is bounded and its limit points belong to zer T ; (ii) if in addition lim supkÑ8 γk ă 1{L and S‹ " zer T , then pzkqkP(cid:142), p ̄zkqkP(cid:142) both converge to some z‹ P zer T . Note that whenever lim supkÑ8 γk ă 1 L , Lemma A.3(ii) may be used to derive a similar inequality in terms of } ̄zk ́ zk} by lower bounding }H ̄zk ́ Hzk} in (3.1). We also remark that tighter rates may be obtained in the regime ρ ě 0, however, this will not be pursued in this work. 4 Published as a conference paper at ICLR 2022 Algorithm 1 (AdaptiveEG+) Deterministic algorithm for problem (2.1) Initialize z0 " zinit P (cid:146)n, λk P p0, 2q, γk P Repeat for k " 0, 1, . . . until convergence ̆ zk ́ γkFzk 1.1: Let ̄zk " id ` γkA 1.2: Compute stepsize , δk P p ́γk{2, ρs, t ́2ρu`, 1{L ́1 ̆ ` ` ` ‰ αk " δk γk ` x ̄zk ́ zk, H ̄zk ́ Hzky }H ̄zk ́ Hzk}2 , where H " id ́ γkF. 1.3: Update the vector zk`1 " zk ` λkαkpH ̄zk ́ Hzkq Return zk`1 3.1 Non-adaptive stepsize variant Although we do not incur additional costs for evaluating the adaptive stepsize αk in step 1.2, it proves instructive to present a variant with constant stepsize. As a result we compare the range of our stepsizes against Diakonikolas et al. (2021) showing an improvement by a factor of 3{2. Moreover, in the monotone case (ρ " 0), with a certain choice of stepsizes the algorithm reduces to the celebrated forward-backward-forward (FBF) algorithm of Tseng (2000). We remark that the relation of FBF to projection-type algorithms was noted in Tseng (2000), (Giselsson, 2021, Sect. 6.2.1). ` To this end, in this subsection consider the following non-adaptive variant of Algorithm 1 that gen- eralizes (EG+). Letting ̄αk P p0, 1 ` 2δk{γkq: ̄zk " (CEG+) The convergence of this algorithm is an immediate byproduct of Theorem 3.1. To see this, note that the zk`1 update in step 1.3 may be written as zk`1 " zk ` 2ηkαkpH ̄zk ́ Hzkq, for ηk P p0, 1q. Therefore, convergence is still ensured for any ̄αk ă 2αk as the difference may be absorbed by the relaxation parameter ηk. Note that by 1{2-cocoercivity of H (cf. Lemma A.3(i)) zk`1 " zk ` ̄αkpH ̄zk ́ Hzkq. zk ́ γkFzk id ` γkA ́1 ̆ ` ̆ , ̄αk ă 2δk γk ` 1 ď 2δk γk ` 2xH ̄zk ́ Hzk, ̄zk ́ zky }H ̄zk ́ Hzk}2 " 2αk, (3.2) establishing the validity of the prescribed stepsize range. The convergence of the non-adaptive vari- ant is summarized in the next corollary that for simplicity is stated with constant parameters (drop- ping subscripts k). ` ‰ Corollary 3.2 (Constant stepsize). Suppose that Assumption I holds, and let γ P , t ́2ρu`, 1{L δ P p ́γ{2, ρs, and ̄α P p0, 1 ` 2δ{γq. Consider the sequences pzkqkP(cid:142), p ̄zkqkP(cid:142) generated according to the update rule (CEG+). Then, min k"0,1,...,m }H ̄zk ́ Hzk}2 ď }z0 ́ z‹}2 κpm ` 1q , (3.3) where κ " ̄αp1 ` 2δ γ ́ ̄αq. Moreover, the claims of Theorems 3.1(i) and 3.1(ii) hold true. The setting of Diakonikolas et al. (2021) in (EG+) involves the stepsizes γk " 1{L, αk " 1{2. Note that when restricting to A " 0, the iterates (CEG+) simplify to this form owing to the fact that H ̄zk ́ Hzk " ̄zk ́ γF ̄zk ́ Hzk " ́γF ̄zk. In comparison, in our setting if δ " ρ " ́1{8L (the smallest ρ permitted in Diakonikolas et al. (2021)) is selected, then based on our analysis in Corollary 3.2 we may select γk " 1{L, and ̄αk P p0, 3{4q, thus the upper bound for the second stepsize is 3{2 times that of Diakonikolas et al. (2021). ` ̆ t ́2ρu`, 1{L Remark 3.3 (relation to FBF). In Corollary 3.2 the range of stepsizes γ, ̄α may alternatively be set , ̄α P p0, 1`2δ{γs. This is due to the fact that if γ ă 1{L (strictly), then H is strictly as γ P 1{2-cocoercive. Therefore, in (3.2), 1` 2δ γ is permitted. Although this may appear to be of little practical significance, by setting γ P p0, 1{Lq, δ " ρ " 0, and ̄α " 1 in (CEG+), we obtain zk`1 " ̄zk ` γFzk ́ γF ̄zk, which is the forward-backward-forward (FBF) algorithm of Tseng (2000), (Bauschke & Combettes, 2017, Thm. 26.17)). γ ă 2αk holds, and thus the stepsize ̄α " 1` 2δ 5 Published as a conference paper at ICLR 2022 Figure 2: The grey region indicates where convergence provably cannot be guaranteed by Theorem 3.4. The dashed line indicates where ρ " ́1{8L. This is the condition under which (Diakonikolas et al., 2021, Thm. 3.2) shows the first convergence result p ̨q. Corollary 3.2 improves their result by matching the lower bound for any ̄α, in particular for ̄α " 3{4 p q. The adaptive scheme in Theorem 3.1 matches the smallest possible ρ for any (EG+) scheme with fixed stepsize p(cid:4)q. (cid:32) 3.2 Lower bounds We show that the result in Corollary 3.2 is tight by providing a matching lower bound when A " 0. We do so by fixing ̄αk and showing a stepsize dependent lower bound. In particular, note that if ̄αk " 1{2 as in Diakonikolas et al. (2021, Thm. 3.2), then Theorem 3.4 implies a lower bound of ρ ą ́1{4L for the (EG+) scheme. The lower bound is contextualized in Fig. 2 by relating it to our convergence results and existing results in the literature. Theorem 3.4. Consider a sequence pzkqkPN generated according to (EG+) fixing γk " γ " 1{L and ̄αk " ̄α P p0, 1q. Let ́ρL ě 1 ́ ̄α 2 . Then, there exists an F : (cid:146)n Ñ (cid:146)n, n ą 1, satisfying Assumption I(ii) and Assumption I(iii) for which the sequence will not converge. 4 Adaptively taking larger stepsizes using local curvature As made apparent in the analysis in Section 3 (cf. Appendix B.1) the bound on the smallest weak MVI constant ρ in Assumption I(iii) may be replaced with the requirement that ρ ą ́γk{2 for all k P (cid:142). Therefore, larger stepsizes γk would guarantee global convergence for an even larger class of problems. Since a global Lipschitz constant is inherently pessimistic the natural question then becomes how to locally choose a maximal stepsize without diverging. The proposed scheme involves a backtracking linesearch that uses the local curvature for its initial guess. The reason being that this will immediately pass, close enough to the solution z‹, by argu- ment of continuity. More precisely, we will set the initial guess to something slightly smaller than }JFpzkq} ́1, where JFpzq denotes the Jacobian of F at z and } ̈ } is the spectral norm. Note that, de- spite the use of second order information, the scheme remains efficient since }JFpzq} only requires one eigenvalue computation performed through Jacobian-vector product (Pearlmutter, 1994). Given an initial point z0 " zinit and ν P p0, 1q, the final scheme which we denote (CurvatureEG+) proceeds for k " 0, 1, . . . as follows: 1. Obtain γk and ̄zk according to Algorithm 2 with γinit " ν}JFpzkq} ́1 2. Compute zk`1 according to steps 1.2 and 1.3 of Algorithm 1 (CurvatureEG+) The above intuitive reasoning is made precise in the next lemma where it is shown that backtracking linesearch will terminate in finite time and that γinit will be immediately accepted asymptotically. Algorithm 2 Lipschitz constant backtracking Initialize zk P (cid:146)n, τ P p0, 1q, ν P p0, 1q 2.1: Set initial guess γ " γinit, and let Gγpzkq (cid:66) while γ}FpGγpzkqq ́ Fzk} ą ν}Gγpzkq ́ zk} do γ Ð τγ ` ̆ id ` γA ` ́1 zk ́ γFzk ̆ Return γk " γ and ̄zk " Gγpzkq 6 Published as a conference paper at ICLR 2022 Lemma 4.1 (Lipschitz constant backtracking). Suppose that F : (cid:146)n Ñ (cid:146)n is a L-Lipschitz contin- uous operator. Consider the linesearch procedure in Algorithm 2. Then, (i) The linesearch terminates in finite time with γ ě mintγinit, ντ{Lu; (ii) Suppose that pzkqkP(cid:142) converges to z‹ P zer T . If F is continuously differentiable, and γinit P p0, ν}JFpzkq} ́1q with ν P p0, 1q, then eventually the backtrack will never be invoked (γinit would be accepted). The convergence results for (CurvatureEG+) are deduced based of the above lemma and The- orem 3.1 and are provided in Corollary B.1 in Appendix B.2. We illustrate the behavior of (CurvatureEG+) in Fig. 1 and in Section 6. 5 Constructing toy examples When Assumption I(iii) holds for negative ρ, limit cycles of the underlying operator Fz can emerge. We illustrate this with simple polynomial examples for which all the properties of interest can be computed in closed form. Definition 1 (PolarGame). A PolarGame denotes a two-player game whose associated operator F has limit cycles at }z}2 " ci for all i P rks where ci ‰ 0. This turns out to be particularly easy to construct in polar coordinates as the name suggests (see Appendix C.1). Apart from introducing arbitrary number of limit cycles it also gives us control over ρ. This is illustrated in the following instantiations capturing three important cases. Example 3: (PolarGame). Consider Fz " pψpx, yq ́ y, ψpy, xq ` xq where }z}8 ď 11{10 and ψpx, yq " 1 16 axp ́1 ` x2 ` y2qp ́9 ` 16x2 ` 16y2q. We have the following three cases: 4 then ρ P p ́ 1 where L denotes the Lipschitz constant of F restricted to the constraint set. For all cases F exhibits limit cycles at }z} " 1 and }z} " 3{4. Proof is deferred to Appendix C.2. (i) a " 1 then ρ P p ́ 1 3 then ρ P p ́ 1 3L q (iii) a " 1 2L q (ii) a " 3 8L , ́ 1 2L , ́ 1 L , ́ 1 10L q Example 4: (minimax). following polynomial game: In the particular case of constrained minimax problem we introduce the minimize |x|ď4{3 maximize |y|ď4{3 φpx, yq :" xy ` ψpxq ́ ψpyq, (GlobalForsaken) where ψpzq " 2z6 21 ́ z4 3 ` z2 3 . We provide proof of the following properties in Appendix C.3: (i) There exists a repellant limit cycle and an attracting limit cycle of F. (ii) z‹ " p0, 0q is a global Nash equilibrium for which Assumption I(iii) holds inside the constraint with ρ ą ́1{2L, where L denotes the Lipschitz constant of F restricted to the constraint set. 6 Experiments The algorithms considered in the experiments include the adaptive Algorithm 1, (CurvatureEG+), and constant stepsize methods that can be seen as instances of (CEG+) for various choices of γk and ̄αk. When γk " 1{L and ̄αk " 1 we recover a constrained variant of extragradient, which we denote CEG. When ̄αk " 1{2 we denote the scheme CEG+, which is the direct generalization to the constraint setting of the (EG+) scheme studied in Diakonikolas et al. (2021, Thm. 3.2). Note that this choice of ̄αk restricts the problem class for which we otherwise can have guaranteed convergence according to Corollary 3.2. When ̄αk is chosen adaptively according to Algorithm 1 we refer to it as AdaptiveEG+. Finally, when γk is additionally chosen adaptively we use the name (CurvatureEG+). In the stochastic setting, when γk " 1{k and αk " 1, effectively both stepsizes diminish, and we recover a constrained variant of the popular stochastic extragradient scheme (see e.g. Hsieh et al. 7 Published as a conference paper at ICLR 2022 (a) Example 3 (a " 1) (b) Example 5 (ρ " ́1{3L) Figure 3: Deterministic setting. In (a) we have an instance of Example 3 with ρ ă ́1{2L for which Theorem 3.4 provides lower bound for extrapolation stepsize γk " 1{L. However, adaptively choosing γk larger can converge as illustrated with (CurvatureEG+). In addition, (b) confirms with Example 5, that (CEG+) for ̄αk " 1{2 and CEG may indeed not converge even when ρ " ́1{3L. In contrast, both AdaptiveEG+ and (CurvatureEG+) converges to the stationary point. Note that picking ̄αk ă 1{3 would lead to convergence of (CEG+) by Corollary 3.2. See Fig. 6 and Fig. 7 for supplementary experiments. (a) Example 4 (b) Example 5 (ρ " ́1{3L) Figure 4: Stochastic setting. In (a) we test the stochastic algorithms on our nonconvex-nonconcave con- strained minimax example. The cycling behavior of SEG is inline with Hsieh et al. (2021), who shows that the sequence generated by SEG can converge to limit cycles of the underlying operator F. On the other hand, we observe that SEG+ escapes the attracting limit cycle. In (b) we also provide a more challenging example motivated by our lower bound. (2021, Algorithm 3)), which we refer to as SEG. We also consider a heuristic variant where γk " 1{L and only αk is decreasing, which we refer to as SEG+. We test the algorithms on the constructed examples and confirm their convergence guarantees. Specifically, we apply the algorithms to the minimax problem in Example 4, the PolarGames in Example 3, and a worst case construction, Example 5, from the proof of the lower bound (cf. Ap- pendix B.3). For Example 5 we choose the problem parameters such that ρ " ́1{3L according to (B.13), and additionally add an (cid:96)8-ball constraint to keep the iterates bounded. To simulate the stochastic setting we add Gaussian noise to calls of F. Results for the deterministic setting and stochastic setting can be found in Fig. 3 and Fig. 4 respectively. 7 Conclusion This paper introduced an EG-type algorithm for a class of nonconvex-nonconcave minimax prob- lems that satisfy the weak Minty variational inequality (MVI). The range of parameter in the weak 8 Published as a conference paper at ICLR 2022 MVI was extended compared to EG+ of Diakonikolas et al. (2021), and tightness of our results were demonstrated through construction of a counter example. In addition, EG+ (Diakonikolas et al., 2021), as well as the forward-backward-forward algorithm (Tseng, 2000) were all shown to be spe- cial cases of our scheme. Furthermore, (CurvatureEG+) was proposed that performs a backtracking linesearch on the extrapolation stepsize γk allowing for larger stepsizes and relaxes the condition ρ ą 1 2L to ρ ą ́γk{2 which is often a much weaker condition. More importantly, it is shown that asymptotically the linesearch always passes with γk " ν}JFpzkq} ́1 for any ν P p0, 1q, thus rat- ifying the name (CurvatureEG+). Future direction include exploring applications of the proposed algorithm in particular in the setting of GANs. It is also interesting to develope a variance reduced variant of the algorithm for finite sum minimax problems. 8 Acknowledgments and disclosure of funding We would like to especially thank Yu-Guan Hsieh for providing valuable feedback and discussion. This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement n° 725594 - time-data). This work was supported by the Swiss National Science Foundation (SNSF) under grant number 200021_205011. The work of the second and third author was supported by the Research Founda- tion Flanders (FWO) postdoctoral grant 12Y7622N and research projects G081222N, G0A0920N, G086518N, and G086318N; Research Council KU Leuven C1 project No. C14/18/068; Fonds de la Recherche Scientifique – FNRS and the Fonds Wetenschappelijk Onderzoek – Vlaanderen un- der EOS project no 30468160 (SeLMA); European Union's Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No. 953348. The work of Olivier Fercoq was supported by the Agence National de la Recherche grant ANR-20-CE40-0027, Optimal Primal-Dual Algorithms (APDO). References Waïss Azizian, Ioannis Mitliagkas, Simon Lacoste-Julien, and Gauthier Gidel. A tight and unified analysis of gradient-based methods for a whole spectrum of differentiable games. In International Conference on Artificial Intelligence and Statistics, pp. 2863–2873. PMLR, 2020. Heinz H. Bauschke and Patrick L. Combettes. Convex analysis and monotone operator theory in Hilbert spaces. CMS Books in Mathematics. Springer, 2017. ISBN 978-3-319-48310-8. Heinz H Bauschke, Walaa M Moursi, and Xianfu Wang. Generalized monotone operators and their averaged resolvents. Mathematical Programming, pp. 1–20, 2020. Michel Benaım and Morris W Hirsch. Mixed equilibria and dynamical systems arising from ficti- tious play in perturbed games. Games and Economic Behavior, 29(1-2):36–72, 1999. Dimitri P Bertsekas. Nonlinear programming. Journal of the Operational Research Society, 48(3): 334–334, 1997. Axel Böhm, Michael Sedlmayer, Ernö Robert Csetnek, and Radu Ioan Bo ̧t. Two steps at a time– taking gan training in stride with tseng's method. arXiv preprint arXiv:2006.09033, 2020. Constantinos Daskalakis, Dylan J Foster, and Noah Golowich. Independent policy gradient methods for competitive reinforcement learning. arXiv preprint arXiv:2101.04233, 2021a. Constantinos Daskalakis, Stratis Skoulakis, and Manolis Zampetakis. The complexity of constrained min-max optimization. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, pp. 1466–1478, 2021b. Damek Davis and Dmitriy Drusvyatskiy. Stochastic subgradient method converges at the rate $O(kˆ{- 1/4})$ on weakly convex functions. arXiv:1802.02988 [cs, math], February 2018. Jelena Diakonikolas, Constantinos Daskalakis, and Michael Jordan. Efficient methods for struc- In International Conference on Artificial tured nonconvex-nonconcave min-max optimization. Intelligence and Statistics, pp. 2746–2754. PMLR, 2021. 9 Published as a conference paper at ICLR 2022 Francisco Facchinei and Jong-Shi Pang. Finite-dimensional variational inequalities and comple- mentarity problems. Springer Science & Business Media, 2007. Tanner Fiez and Lillian Ratliff. Gradient descent-ascent provably converges to strict local minmax equilibria with a finite timescale separation. arXiv preprint arXiv:2009.14820, 2020. Gauthier Gidel, Hugo Berard, Gaëtan Vignoud, Pascal Vincent, and Simon Lacoste-Julien. arXiv preprint inequality perspective on generative adversarial networks. A variational arXiv:1802.10551, 2018. Pontus Giselsson. Nonlinear forward-backward splitting with projection correction. SIAM Journal on Optimization, 31(3):2199–2226, 2021. doi: 10.1137/20M1345062. 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. Advances in neural information processing systems, 30, 2017. M Hirsch and S Vavasis. Exponential lower bounds for finding Brouwer fixed points. In Proceedings of the 28th Symposium on Foundations of Computer Science, pp. 401–410, 1987. Cars H Hommes and Marius I Ochea. Multiple equilibria and limit cycles in evolutionary games with logit dynamics. Games and Economic Behavior, 74(1):434–441, 2012. Ya-Ping Hsieh, Panayotis Mertikopoulos, and Volkan Cevher. The limits of min-max optimization algorithms: Convergence to spurious non-critical sets. In International Conference on Machine Learning, pp. 4337–4348. PMLR, 2021. Yu-Guan Hsieh, Franck Iutzeler, Jérôme Malick, and Panayotis Mertikopoulos. Explore aggres- sively, update conservatively: Stochastic extragradient methods with variable stepsize scaling. arXiv preprint arXiv:2003.10162, 2020. Chi Jin, Praneeth Netrapalli, and Michael I. Jordan. What is local optimality in nonconvex- nonconcave minimax optimization? arXiv:1902.00618 [cs, math, stat], June 2019. Galina M Korpelevich. The extragradient method for finding saddle points and other problems. Matecon, 12:747–756, 1976. Puya Latafat and Panagiotis Patrinos. Asymmetric forward–backward–adjoint splitting for solving monotone inclusions involving three operators. Computational Optimization and Applications, 68(1):57–93, Sep 2017. Sucheol Lee and Donghwan Kim. Fast extra gradient methods for smooth structured nonconvex- nonconcave minimax problems. arXiv preprint arXiv:2106.02326, 2021a. Sucheol Lee and Donghwan Kim. Semi-anchored multi-step gradient descent ascent method for structured nonconvex-nonconcave composite minimax problems. arXiv preprint arXiv:2105.15042, 2021b. Mingrui Liu, Hassan Rafique, Qihang Lin, and Tianbao Yang. First-order convergence theory for weakly-convex-weakly-concave min-max problems. Journal of Machine Learning Research, 22 (169):1–34, 2021. Eric V. Mazumdar, Michael I. Jordan, and S. Shankar Sastry. On finding local Nash equilibria (and only local Nash equilibria) in zero-sum games. arXiv:1901.00838 [cs, math, stat], January 2019. Panayotis Mertikopoulos, Bruno Lecouat, Houssam Zenati, Chuan-Sheng Foo, Vijay Chan- drasekhar, and Georgios Piliouras. Optimistic mirror descent in saddle-point problems: Going the extra (gradient) mile. arXiv preprint arXiv:1807.02629, 2018a. Panayotis Mertikopoulos, Christos Papadimitriou, and Georgios Piliouras. Cycles in adversarial In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on regularized learning. Discrete Algorithms, pp. 2703–2717. SIAM, 2018b. George J Minty. Monotone (nonlinear) operators in hilbert space. Duke Mathematical Journal, 29 (3):341–346, 1962. 10 Published as a conference paper at ICLR 2022 Maher Nouiehed, Maziar Sanjabi, Tianjian Huang, Jason D Lee, and Meisam Razaviyayn. Solv- ing a class of non-convex min-max games using iterative first order methods. arXiv preprint arXiv:1902.08297, 2019. Christos H Papadimitriou. On the complexity of the parity argument and other inefficient proofs of existence. Journal of Computer and system Sciences, 48(3):498–532, 1994. Barak A Pearlmutter. Fast exact multiplication by the hessian. Neural computation, 6(1):147–160, 1994. Boris T Polyak. Introduction to optimization. Optimization Software New York, 1987. Hassan Rafique, Mingrui Liu, Qihang Lin, and Tianbao Yang. Non-convex min-max optimization: Provable algorithms and applications in machine learning. arXiv:1810.02060 [cs, math], January 2019. R. T. Rockafellar and R. J.-B. Wets. Variational analysis, volume 317. Springer Science & Business Media, 2009. R Tyrrell Rockafellar. Monotone operators and the proximal point algorithm. SIAM journal on control and optimization, 14(5):877–898, 1976. Ralph Tyrell Rockafellar. Convex analysis. Princeton University Press, 1970. M. V. Solodov and P. Tseng. Modified projection-type methods for monotone variational inequali- ties. SIAM Journal on Control and Optimization, 34(5):1814–1830, 1996. Mikhail V Solodov and Benar F Svaiter. A hybrid projection-proximal point algorithm. Journal of convex analysis, 6(1):59–70, 1999. Chaobing Song, Zhengyuan Zhou, Yichao Zhou, Yong Jiang, and Yi Ma. Optimistic dual extrap- olation for coherent non-monotone variational inequalities. arXiv preprint arXiv:2103.04410, 2021. Gerald Teschl. Ordinary differential equations and dynamical systems, volume 140. American Mathematical Soc., 2012. P. Tseng. A modified forward-backward splitting method for maximal monotone mappings. SIAM Journal on Control and Optimization, 38(2):431–446, 2000. Junchi Yang, Negar Kiyavash, and Niao He. Global convergence and variance-reduced optimization for a class of nonconvex-nonconcave minimax problems. arXiv preprint arXiv:2002.09621, 2020. Zhengyuan Zhou, Panayotis Mertikopoulos, Nicholas Bambos, Stephen Boyd, and Peter W Glynn. In I. Guyon, U. V. Stochastic mirror descent in variationally coherent optimization problems. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. 11 Published as a conference paper at ICLR 2022 A Preliminary definitions Notationally we will use txu` (cid:66) maxt0, xu throughout. We additionally recall some standard defini- tions and results and refer to Bauschke & Combettes (2017); Rockafellar (1970)) for further details. An operator or set-valued mapping A : (cid:146)n Ñ (cid:146)d maps each point x P (cid:146)n to a subset Ax of (cid:146)d. We will use the notation Apxq and Ax interchangably. We denote the domain of A by dom A (cid:66) tx P (cid:146)n | Ax ‰ Hu, its graph by gph A (cid:66) tpx, yq P (cid:146)n ˆ (cid:146)d | y P Axu, and the set of its zeros by zer A (cid:66) tx P (cid:146)n | 0 P Axu. The inverse of A is defined through its graph: gph A ́1 (cid:66) tpy, xq | px, yq P gph Au. The resolvent of A is defined by JA (cid:66) pid ` Aq ́1, where id denotes the identity operator. Definition A.1 ((co)monotonicity Bauschke et al. (2020)). An Operator A : (cid:146)n Ñ (cid:146)n is said to be ρ-monotone for some ρ P (cid:146), if for all px, yq, px1, y1q P gph A ρ}x ́ x1}2 ď xx ́ x1, y ́ y1y, and it is said to be ρ-comonotone if for all px, yq, px1, y1q P gph A ρ}y ́ y1}2 ď xx ́ x1, y ́ y1y. The operator A is said to be maximally (co)monotone if its graph is not strictly contained in the graph of another (co)monotone operator. We say that A is monotone if it is 0-monotone. When ρ ă 0, ρ-comonotonicity is also referred to as |ρ|-cohypomonotonicity. Definition A.2 (Lipschitz continuity and cocoercivity). Let D Ď (cid:146)n be a nonempty subset of (cid:146)n. A single-valued operator A : D Ñ (cid:146)n is said to be L-Lipschitz continuous if for any x, x1 P D and β-cocoercive if }Ax ́ Ax1} ď L}x ́ x1}, β}Ax ́ Ax1}2 ď xx ́ x1, Ax ́ Ax1y. Moreover, A is said to be nonexpansive if it is 1-Lipschitz continuous, and firmly nonexpansive if it is 1-cocoercive. The resolvent operator JA is firmly nonexpansive (with dom JA " (cid:146)n) if and only if A is (maximally) monotone. The following lemma plays an important role in our convergence analysis. Lemma A.3. Let A : (cid:146)n Ñ (cid:146)n denote a single valued operator. Then, (i) A is 1-Lipschitz if and only if T " id ́ A is 1{2-cocoercive. (ii) If A is L-Lipschitz, then T " id ́ ηA, η P p0, 1{Lq, is p1 ́ ηLq-monotone, and in particular }T u ́ T v} ě p1 ́ ηLq}u ́ v} for all u, v P (cid:146)n. Proof. The first claim follows directly from (Bauschke & Combettes, 2017, Prop.4.11). That T is strongly monotone is a consequence of the Cauchy Schwarz inequality and Lipschitz continuity of A: xT v ́ T u, v ́ uy " }v ́ u}2 ́ ηxAv ́ Au, v ́ uy ě p1 ́ ηLq}v ́ u}2. In turn, the last claim follows from the Cauchy-Schwarz inequality. B Proofs and further results B.1 Proofs of Section 3 12 Published as a conference paper at ICLR 2022 Proof of Theorem 3.1. Let H " id ́ γkF. By Step 1.1 Hzk P ̄zk ` γkA ̄zk. Therefore, pHzk ́ H ̄zkq P A ̄zk ` F ̄zk (B.1) In what follows we will show that Algorithm 1 is equivalent to taking a forward-backward step followed by a correction step. Consider the updates 1 γk ̄zk (cid:66) pid ` γkAq ́1 zk ́ γkFzk , ` ̆ zk`1 " p1 ́ λkqzk ` λk ΠDk pzkq, where Dk (cid:66) Note that ! w | xHzk ́ H ̄zk, ̄zk ́ wy ě δk γk (B.2) ) . }Hzk ́ H ̄zk}2 xH ̄zk ́ Hzk, ̄zk ́ zky ` δk γk (B.3) where in the inequality Lemma A.3(i) was used. Hence, by (B.3) the stepsize αk is positive and bounded away from zero. Moreover, if zk P Dk, then from (B.3) we may conclude that }H ̄zk ́Hzk} ď 0 which implies that the generated sequence remains constant and ̄zk P zer T (cf. (B.1)). }H ̄zk ́ Hzk}2 ě p 1 q}H ̄zk ́ Hzk}2 2 ` δk γk The projection onto Dk for any v R Dk is given by ΠDk pvq " v ` x ̄zk ́ v, Hzk ́ H ̄zky ́ δk γk }Hzk ́ H ̄zk}2 }Hzk ́ H ̄zk}2 pHzk ́ H ̄zkq Moreover, (B.1) together with Assumption I(iii) at ̄zk yields 1 γk }Hzk ́ H ̄zk}2 ě δk γ2 k xHzk ́ H ̄zk, ̄zk ́ z‹y ě ρ γ2 k (B.4) thus ensuring z‹ P S‹ Ď Dk. The projection onto Dk is then given by ΠDk pzkq " zk `αkpH ̄zk ́Hzkq, where αk is as in step 1.2. Finally, since the projection ΠDk is firmly nonexpansive, it follows from (Bauschke & Combettes, 2017, Cor. 4.41) that the mapping p1 ́ λkqid ` λk ΠDk is λk{2-averaged. Consequently, we may con- clude that pzkqkP(cid:142) is Fejér monotone relative to S‹ (Bauschke & Combettes, 2017, Prop. 4.35(iii)). That is for all z‹ P S‹ }Hzk ́ H ̄zk}2, }zk`1 ́ z‹}2 ď }zk ́ z‹}2 ́ λkp2 ́ λkqα2 k}H ̄zk ́ Hzk}2. (B.3) ď }zk ́ z‹}2 ́ εk γ2 k }H ̄zk ́ Hzk}2, (B.5) where εk (cid:66) λkp2 ́λkqp γk 2 `δkq2. The convergence rate in (3.1) is obtained by telescoping (B.5). Since lim infkÑ8 εk ą 0, p 1 }H ̄zk ́ Hzk}2qkP(cid:142) converges to zero. Moreover, p}zk ́ z‹}2qkP(cid:142) converges γ2 k and the sequence pzkqkP(cid:142) is bounded. Since γk is bounded, and F and the resolvents pid ` γkAq ́1 are Lipschitz continuous (cf. (Bauschke & Combettes, 2017, Cor. 23.9)), so is their composition. Hence, p ̄zkqkP(cid:142) is also bounded. Let p ̄zkqkPK be a subsequence converging to some ̄z P (cid:146)n. Combined with the fact that p 1 }H ̄zk ́ Hzk}2qkP(cid:142) converges to zero, we may conclude from (B.1) along with (Bauschke γ2 k & Combettes, 2017, Prop. 20.38) and Lipschitz continuity of F that ̄z P zer T . Finally, if in addition γ " lim supkÑ8 γk ă 1{L, then p1 ́ γLq} ̄zk ́ zk} ď }H ̄zk ́ Hzk} (invoke Lemma A.3(ii)). There- fore, p} ̄zk ́ zk}qkP(cid:142) converges to zero, which in turn implies that a subsequence pzkqkPK1 converges to a point z1 iff so does the subsequence p ̄zkqkPK1. Hence, pzkqkPK also converges to ̄z P zer T . Conse- quently, if Assumption I(iii) holds at all of the zeros of T , i.e., if S‹ " zer T , then the second claim follows by invoking (Bauschke & Combettes, 2017, Thm. 5.5). Proof of Corollary 3.2 (Constant stepsize). The proof of convergence was already given prior to the statement of the corollary. It remains to derive (3.3). By Assumption I(iii) and owing to 1{2- cocoercivity of H (cf. Lemma A.3(i)) xzk ́ z‹, H ̄zk ́ Hzky " x ̄zk ́ z‹, H ̄zk ́ Hzky ` xzk ́ ̄zk, H ̄zk ́ Hzky (B.4) ď ́ p 1 2 ` δk γk q}H ̄zk ́ Hzk}2. (B.6) Therefore, provided that ̄α ą 0 we have }zk`1 ́ z‹}2 " }zk ́ z‹}2 ` ̄α2}H ̄zk ́ Hzk}2 ` 2 ̄αxzk ́ z‹, H ̄zk ́ Hzky 2 ` δ (B.6) ď }zk ́ z‹}2 ́ ̄αp2p 1 γ q ́ ̄αq}H ̄zk ́ Hzk}2. Telescoping the above inequality yields the claimed inequality. 13 Published as a conference paper at ICLR 2022 B.2 Convergence results and proofs of Section 4 The convergence results for (CurvatureEG+) are provided in the next corollary where ρ in Assump- tion I(iii) is allowed to take potentially larger values provided that ρ ą ́γk{2. Note that owing to the lower bound on γk (cf. Lemma 4.1(i)), the weak MVI assumption in the corollary is always satisfied if ρ P p ́ντ{2L, 8q, however, in practice γk may take larger values. Corollary B.1. Suppose that Assumptions I(i) and I(ii) hold, and consider the sequences pzkqkP(cid:142), p ̄zkqkP(cid:142) generated by (CurvatureEG+). Suppose that Assumption I(iii) holds for some ρ P (cid:146) satisfying γk ` 2ρ ą 0, and let δk P p ́γk{2, ρs, λk P p0, 2q, lim infkÑ8 λkp2 ́ λkq ą 0, and lim infkÑ8pδk ` γk{2q ą 0. Then, (i) The sequence p} ̄zk ́ zk}2qkP(cid:142) vanishes; (ii) p ̄zkqkP(cid:142), pzkqkP(cid:142) are bounded, and have the same limit points belonging to zer T ; (iii) if in addition S‹ " zer T , then pzkqkP(cid:142), p ̄zkqkP(cid:142) both converge to some z‹ P zer T . Moreover, if zk, ̄zk Ñ z‹ P zer T (as is the case in B.1(iii)), and F is continuously differentiable, then eventually the backtrack will never be invoked. Proof. Observe that in the proof of Theorem 3.1 1-Lipschitz continuity of γkF is only used at the generated points ̄zk and zk (see (B.3)), and is thus ensured by the linesearch Algorithm 2. Therefore, it is easy to see that αk is positive and bounded away from zero provided that ρ ą ́γk{2 , see (B.3). Moreover, since γk}F ̄zk ́ Fzk} ď ν} ̄zk ́ zk}, arguing as in Lemma A.3(ii) we obtain }H ̄zk ́ Hzk} ě p1 ́ νq} ̄zk ́ zk}. Hence, it follows from (B.5) that }zk`1 ́ z‹}2 ď }zk ́ z‹}2 ́ εkp1 ́νq γ2 k } ̄zk ́ zk}2, ř kP(cid:142) } ̄zk ́ zk}2 ă 8, By telescoping the inequality and noting that γk is bounded, we obtain implying B.1(i). Noting this and arguing as in the last part of the proof of Theorem 3.1 establishes B.1(ii), B.1(iii). The last claim is the direct consequence of Lemma 4.1(ii). Proof of Lemma 4.1 (Lipschitz constant backtracking). 4.1(i): Since F is L-Lipschitz continuous the linesearch would terminate in finite steps. Either γinit satisfies the condition, or else the back- track procedure is invoked, which in turn implies the previous candidate γ{τ should have violated the condition leading the the claimed lower bound. 4.1(ii): Since the resolvent pid`γAq ́1 and F are Lipschitz continous, so is their composition. Hence, Gγpzkq Ñ Gγpz‹q. Furthermore, by definition z‹ ́ γFz‹ P Gγpz‹q ` γApGγpz‹qq. Consequently, using monotonicity of A at Gγpz‹q and z‹, and that ́Fz‹ P Az‹ yields 0 ď xz‹ ́ γFz‹ ́ Gγpz‹q ` Fz‹, Gγpz‹q ́ z‹y " ́ }z‹ ́ Gγpz‹q}2. Thus Gγpz‹q " z‹. Using the fact that both pGγpzkqqkP(cid:142) and pzkqkP(cid:142) converges to z‹ P zer T : lim kÑ8 }FpGγpzkqq ́ Fzk} }Gγpzkq ́ zk} ď lim sup z,z1Ñz‹ }Fz1 ́ Fz} }z1 ́ z} " lip Fpz‹q " }JFpz‹q}, where (Rockafellar & Wets, 2009, Thm. 9.7) was used. The claim follows from continuity of JF and the fact that pzkqkP(cid:142) converges to z‹. B.3 Proofs of Section 3.2 To prove the lower bound we introduce the following unconstrained bilinear minimax problem with an unstable critical point. Example 5: Consider the following minimax problem: minimize xPR maximize yPR f px, yq :" axy ` b 2 px2 ́ y2q, (B.7) where b ă 0 and a ą 0. 14 Published as a conference paper at ICLR 2022 Proof of Theorem 3.4. The associated operator of Example 5 can easily be computed, Fz " pay ` bx, by ́ axq, (B.8) where z " px, yq. In this particular case, both L and ρ turn out to be constants. By simple calculation we have, a }JFpzq} " a2 ` b2, ρ " b a2 ` b2 (B.9) where } ̈ } is the spectral norm. Since the norm of the Jacobian is constant it equates the global Lipschitz constant, L " }JFpzq}. By linearity of F, one step of (EG+) is conveniently also a linear operator. Specifically, ̨ ́ ̈ ̄ ̄ ? p1 ́ ̄αqa2`b ́ ̄α ́ ? a2`b2 a2`b2 ́2b a ̄α a2`b2` ̄αb`b ̄ ́ ? a ̄α ́ ́ a2`b2 ́2b ? a2`b2 p1 ́ ̄αqa2`b ́ ̄α a2`b2` ̄αb`b ̄ ‹ ‚. (B.10) zk`1 " T zk with T :" ̊ ̋ We know that a linear dynamical system is globally asymptotically stable if and only if the spectral radius of the linear mapping is strictly less than 1. a2`b2 a2`b2 Let λ1, λ2 be the eigenvalues of T . Then the spectral radius is the largest absolute value of the eigenvalues. For T this becomes, d p2p ̄α ́ 1q ̄α ` 1qa2 ́ 2 ̄αp ̄α ` 1qb a2 ` b2 ́ b ` ? ̆ ` b2 . (B.11) a2 ` b2 |λi| " max iPt1,2u So we can ask what c in ρ " ́ c this equality with maxi |λi| ă 1, we obtain, L needs to be for the sequence pzkqkPN to converge. Solving for c in provided that we pick c ă 1 ́ ̄α 2 , ? 1 ́ c2 c " ́ a b . (B.12) (B.13) Equation (B.13) provides a specification for Example 5. As long as (B.12) is satisfied, (EG+) is guaranteed to converge for γk " 1{L. On the other hand, since (B.10) is a linear system, we simulta- neously learn that picking c any larger would imply non-convergence through maxi |λi| ě 1 (given z0 ‰ 0). We can trivially embed problem (B.10) into a higher dimension to generalize the result. Noting that c " ́ρL completes the proof. We provide Mathematica code to verify each step of the above proof.1 C Toy examples In the following appendix, L denotes the Lipschitz constant of F restricted to the constraint set and ρ is the parameter of the weak MVI (Assumption I(iii)) when restricted to the constraint set. This restriction of the definitions is warranted, since zk remains within the constraint set in all simulations, while ̄zk is guaranteed to stay within by definition of Step 1.1 in Algorithm 1 (and likewise for all other considered method treating problem (2.1)). All computer-assisted calculations can be found in the supplementary code.1 C.1 Constructing a PolarGame (Definition 1) Recall Definition 1 which considers a vectorfield F : Rn Ñ Rn with limit cycles at r P tc1, ..., cku where ci ‰ 0 for all i P rks. Such a vectorfield can be constructed for n " 2 by departing from the 1The supplementary code can be found at https://github.com/LIONS-EPFL/weak-minty-code/. 15 Published as a conference paper at ICLR 2022 ùñ Figure 5: We can construct the desired properties in polar coordinates pr, θq and subsequently transform it into a vectorfield in cartesian coordinates px, yq. This is illustrated by a PolarGame with attracting limit cycles at radius }z} " 1 and repellant limit cycle at }z} " 3{4 for the associated operator Fz as indicated in red and blue respectively. (a) a " 1 (b) a " 3{4 (c) a " 1{3 Figure 6: Example 3 for different values of a (and thereby different values of ρ). Note that even extragra- dient may escape the limit cycles even though ρ ă 0. This is not in conflict with the negative results of Hsieh et al. (2021) since the stepsize is not diminishing. However, in the general case even extragradient with fixed stepsize will not converge as shown by the lower bound in Theorem 3.4. following dynamics in polar coordinates, kź " ́a ̈ rptq prptq ` ciq ̈ prptq ́ ciq i"1 " ́b ̈ rptq, Br Bt Bθ Bt (C.1) with a, b ‰ 0. Transforming this dynamics into cartesian coordinates yields the desired vectorfield, F, while subsequently integrating with respect to x and y yields the two potentials associated with the two players. Note that the roots t ́ciuk i"1 for the polynomial defining 9r are not strictly necessary for showing existence of limit cycles, but leads to a simpler form for Fz. We illustrate the construction in Fig. 5. Proposition 1. Let Fz " p 9x, 9yq be the evolution in cartesian coordinates of the associated vectorfield in polar coordinates defined by (C.1). Then the only stationary point of F is at the origin p0, 0q and there exists a limit cycle at r " ci for all i P rks. a x2 ` y2. It is easy to see from (C.1) that the only stationary point is at r " 0. By Proof. Let r " construction, 9r is a polynomial with roots ci for all i P rks, so any trajectory starting on the circle defined by r " ci remains in that set. However, 9θ is strictly nonzero. As a consequence Fz is nonzero, so r " ci must define a limit cycle, which proofs the claim. 16 Published as a conference paper at ICLR 2022 (a) Example 4 (b) Example 5 (ρ " 1{3L) Figure 7: In (a) we observe that all algorithms converge, despite F having an attracting limit cycle in Example 4. However, note that in the stochastic setting, where diminishing stepsize is required, SEG does not converge to the critical point (see Fig. 4a). In (b) we demonstrate that when ρ " ́1{3L, picking ̄αk ă 1{3 for (CEG+) is necessary for convergence in general. See Section 6 for the experimental setup. C.2 Proof for properties of Example 3 The operator F : R2 Ñ R2 defined in Example 3 is obtained by constructing the associated dynamics in polar coordinates, Br Bt Bθ Bt " ́a ̈ rptq ̈ prptq ` 1q ̈ prptq ́ 1q ̈ prptq ` 3{4q ̈ prptq ́ 3{4q " ́rptq. (C.2) This can easily be verified by a change of variables. From Proposition 1 it then follows, that there must exist a limit cycle at }z} " 1 and }z} " 3{4. To verify the conditions on ρ we compute the closed form solution to ρ and L in Mathematica: (i) For a " 1 we have ρ " ́ 50176 1050977 and L " (ii) For a " 3{4 we have ρ " ́ 602112 16798825 and L " (iii) For a " 1{3 we have ρ " ́ 150528 9439585 and L " ? ? 2538096 704424929`70246989617 ? ? 7614288 ? ? 2538096 20000 6383574361`635022906553 80000 754424929`73446989617 60000 It can easily be verified that the stated conditions for ρ in Example 3 are met for the values above. This completes the proof. We provide Mathematica code verifying the construction of F and the closed form solutions to L and ρ. C.3 Proof for properties of Example 4 Under the definitions of ρ and L in Appendix C, we claim that the origin p0, 0q in (GlobalForsaken) is a global Nash equilibrium and satisfies Assumption I(iii) with ρ ą ́1{2L. To verify that p0, 0q is indeed a global Nash equilibrium we need to check that the solution cannot be unilaterally improved. In other words, the solution should coincide with px‹, y‹q where x‹ " arg min φpx, 0q x y‹ " arg max φp0, yq. y 17 (C.3) Published as a conference paper at ICLR 2022 We can easily verify this with Minimize in Mathematica, since the functions are polynomial for which a closed form solutions to the global optimization problem will be returned. To find ρ for z‹ " p0, 0q we solve the global minimization problem, minimize z xFz, z ́ z‹y }Fz}2 , (C.4) for which a closed form solution can be found with Mathematica, which when numerically evaluated is approximately ́0.119732. 1 ? b 2 p9409 59721901`74125591q{2835. So ́ 1 We need to compute L to ensure ρ ą ́1{2L. In our case of convex constraints, C, we have that L " supzPC }JFpzq} where } ̈ } denotes the spectral norm (Rockafellar & Wets, 2009, Thm. 9.2 and 9.7). Under our constraint }z}8 ď 4{3, this can similarly be computed in closed form, yielding 2L « ́0.165432 which satisfy the condition ρ ą ́ 1 L " 2L . This completes the proof. Proposition 2. Let F be the associated operator of φ in (GlobalForsaken) defined as Fz " p∇xφpx, yq, ́∇yφpx, yqq. Define the radius as r " }z}. Then, Fz has a stable critical point at the 3{2 ă r ă 2 and at least origin p0, 0q, at least one attracting limit cycle in the region defined by one repellant limit cycle within r ď 3{2. a a Proof. We follow a similar argument as in Hsieh et al. (2021, D.2). We can compute the associated operator F, ̧ ˆ ̇ ̃ 9x 9y " 7 ́ 4x3 4x5 ́x ` 4y5 3 ` 2x 7 ́ 4y3 3 ` y 3 ` 2y 3 . a (C.5) With a change of variables into polar coordinates pr, θq we get that r " x2 ` y2 evolves as, ` ̆ 9r4 cosp4θq ́ 14r2 cosp4θq ` 15r4 ́ 42r2 ` 28 . (C.6) 9r " ́ 1 42 r a 56 ! ? 6 3{2 this reduces to 9r " 3 cosp4θq`5 and we observe that 9r ą 0 for any θ. Likewise for When r " r " 2, we have that 9r " ́ 4 21 p22 cosp4θq`25q which implies 9r ă 0. Since there is no stationary point in the region S " pr, θq : it then follows from the Poincaré-Bendixson theorem (Teschl, 2012, Thm. 7.16) that there must exist at least one attracting limit cycle in S. Further, it is easy to see that p0, 0q is a critical point and that it is stable by inspection of the Jacobian JFpzq. Since S is trapping, it follows from Poincaré–Hopf index theorem, that there must exist a repellant limit cycles in the region defined by r ă 3{2. This completes the proof. 3{2 ă r ă 2 a a ) C.4 Proof of properties for (Hsieh et al., 2021, Example 5.2) This section considers (Hsieh et al., 2021, Example 5.2) on the constraint domain D " tz P (cid:146)n | }z}8 ď 3{2u. We show that the unique critical point z‹ does not satisfies the weak MVI for ρ ą ́1{2L even when restricted to the constraint set z P D. We restate the example with the additional constraint for convenience. Example 6: (Hsieh et al., 2021, Example 5.2) where ψpzq " 1 minimize |x|ď3{2 4 z2 ́ 1 maximize |y|ď3{2 6 z6. 2 z4 ` 1 φpx, yq :" xpy ́ 0.45q ` ψpxq ́ ψpyq, (Forsaken) By using Mathematica, we can obtain a closed form solution of the Lipschitz constant L of F re- stricted to the constraint set, which we find to be L " 1 . Math- 80 ematica can solve approximately for the critical point, yielding z‹ " p0.0780267, 0.411934q. To find ρ we want to globally minimize ρpzq :" xFz,z ́z‹y for z P D. Mathematica finds the candi- date z1 " p ́1.01236, ́0.104749q for which ρpz1q " ́0.477761. So ρ must be at least this small, i.e. ρ ă ́0.477761. Since ́1{2L « ́0.04, this implies that ρ ă ́1{2L. See Forsaken.nb for Mathematica-assisted computations. 801761 ` 993841 1089 }Fz}2 b ? 1 2 ` ̆ 18 Published as a conference paper at ICLR 2022 Figure 8: Demonstration of algorithms on (Hsieh et al., 2021, Example 5.2). Only (CurvatureEG+) con- verges to the critical point, while the remaining methods, CEG, (CEG+) with ̄αk " 1{2, and AdaptiveEG+ converges to an attracting limit cycle. See Section 6 for further specification of the algorithms. This rules out convergence guarantees for both (CEG+) and AdaptiveEG+ (Algorithm 1), which is supported by the simulation in Figure 8. However, as observed, (CurvatureEG+) converges in the simulations. 19
http://arxiv.org/abs/2302.09826v2
2023-06-05T07:08:21
2023-02-20T08:19:19
On the Expressivity of Persistent Homology in Graph Learning
Persistent homology, a technique from computational topology, has recently shown strong empirical performance in the context of graph classification. Being able to capture long range graph properties via higher-order topological features, such as cycles of arbitrary length, in combination with multi-scale topological descriptors, has improved predictive performance for data sets with prominent topological structures, such as molecules. At the same time, the theoretical properties of persistent homology have not been formally assessed in this context. This paper intends to bridge the gap between computational topology and graph machine learning by providing a brief introduction to persistent homology in the context of graphs, as well as a theoretical discussion and empirical analysis of its expressivity for graph learning tasks.
[ "Bastian Rieck" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09826v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09826v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "math.AT", "stat.ML", "55N31 (Primary) 62R40, 68T09 (Secondary)" ]
3 2 0 2 n u J 5 ] G L . s c [ 2 v 6 2 8 9 0 . 2 0 3 2 : v i X r a On the Expressivity of Persistent Homology in Graph Learning Bastian Rieck1, 2 1Helmholtz Munich 2Technical University of Munich Abstract Persistent homology, a technique from computational topology, has recently shown strong empirical performance in the context of graph classification. Being able to capture long range graph properties via higher-order topological features, such as cycles of arbitrary length, in combination with multi-scale topological descriptors, has improved predictive performance for data sets with prominent topological structures, such as molecules. At the same time, the theoretical properties of persistent homology have not been formally assessed in this context. This paper intends to bridge the gap between computational topology and graph machine learning by providing a brief introduction to persistent homology in the context of graphs, as well as a theoretical discussion and empirical analysis of its expressivity for graph learning tasks. 1 Introduction Graph learning is a highly-active research domain in machine learning, fuelled in large parts by the geometric deep learning [11, 12] paradigm as well as the resurgence of new neural network architectures for handling graph data. Methods from computational topology, by contrast, have not yet been applied in this domain at large scales. Even though a large amount of prior work employs topological features to solve graph learning tasks [14, 17, 31, 32, 33, 35, 53, 64, 65, 66, 67], a formal investigation relating expressivity in graph learning and topological machine learning is still lacking. We believe that this is largely driven by an issue of communication between the communities. This paper serves to provide an introduction to topological methods for graph learning, while also proving new results about the expressivity of topological methods in this domain. Here, we understand expressivity as a general concept to signify which graph properties can be captured by a method. This includes being aware of certain substructures in graphs [18], for instance, but also being able to distinguish large classes of non-isomorphic graphs [10, 36, 56]. While graph neural networks have demonstrated substantial gains in this area, our paper focuses on topology-based algorithms, aiming to provide a better understanding of their theoretical and empirical properties. Contributions. Our main contribution is to provide a full characterisation of the expressivity of persistent homology in terms of the Weisfeiler–Leman hierarchy [45, 63]. We prove that persistent homology is at least as expressive as a corresponding Weisfeiler–Leman test for graph isomorphism. Moreover, we show that there exist graphs that cannot be distinguished using k-FWL, the folklore Weisfeiler–Leman algorithm [44], for a specific number of iterations k but that can be distinguished by persistent homology (with or without access to k-cliques in the graph). Along the way, we also prove new properties of filtrations, i.e. descriptor functions that are commonly employed to obtain topological representations of graphs, hinting at their ability to capture information about graph substructures. We complement our theoretical expressivity discussions by an experimental suite that highlights the capabilities of different filtrations for (i) distinguishing certain types of graphs, and (ii) predicting characteristic properties such as the diameter. Guide for readers. Section 2 briefly summarises the main concepts in graph learning. It should be accessible and informative to all readers. Section 2.1 and Section 2.2, by contrast, may be safely skipped by readers that are already well versed in computational topology. Throughout the paper, all Preprint. Under review. new theoretical results are marked by '(∗).' Section 3 outlines advantageous properties of filtrations in the context of graph learning, while Section 4 discusses the expressivity of persistent homology with respect to the Weisfeiler–Leman hierarchy of graph isomorphism tests, extending previous work [35]. 2 Background & Notation (a) (b) FIGURE 1: Two isomorphic graphs. The isomorphism can be understood as a relabelling, a shift of node identities, or, most intuitively, as being able to draw both graphs using a single line. We deal with undirected graphs in this paper. An undirec- ted graph G is a pair G = (V, E) of finite sets of n vertices and m edges, with E ⊆ {{u, v} | u, v ∈ V, u ̸= v}. As is common practice, we will also refer to an edge using tuple notation, with the understanding that (u, v) and (v, u) refer to the same edge. Moreover, we assume our graphs to be simple:1 they must not contain any multi-edges or loops, i.e. edges of the form (v, v). We denote the space of all such graphs by G. Two graphs G = (V, E) and G′ = (V ′, E′) are isomorphic, denoted by G ≃ G′, if there is a bijective function φ : V → V ′ that preserves ad- jacency, i.e. (u, v) ∈ E if and only if (φ(u), φ(v)) ∈ E′. The isomorphism φ is thus preserving edges and connectiv- ity. Since φ is bijective, it has an inverse function, which we will denote by φ−1. Fig. 1 depicts two isomorphic graphs. The problem of figuring out whether two graphs are isomorphic or not is referred to as the graph isomorphism problem. Presently, there is no known algorithm that solves this problem in polynomial time-efficient algorithms exist only for special families of graphs [21, 37]. Hence, all subsequently-discussed graph isomorphism tests are perforce limited with respect to their expressivity, i.e. there exist classes of non-isomorphic graphs that they cannot distinguish. In the context of graph isomorphism tests, we will often require the definition of a multiset, which is a set whose elements are included with multiplicities. We will denote such a multiset by {{}}. Equivariance. Given two graphs G and G′ with n nodes, let Sn refer to the permutation group on n letters. An element σ ∈ Sn acts on a graph by permuting the order of vertices, and, by transitivity, the edges. If G ≃ G′, there is a permutation σ ∈ Sn such that σ(G) = G′. Under the assumption that all graphs have the same number of vertices n, we call a function f : V → Rn permutation-equivariant if f (σ(G)) = σ(f (G)) for a permutation σ, with the understanding that σ acts on Rn by permuting the order of coordinates of the vector.2 The output of a permutation-equivariant function thus changes with the permutation in a predictable manner. 2.1 Topological Features of Graphs The simplest kind of topological features to prescribe to graphs are connected components and cycles. For planar input graphs, i.e. for graphs that can be embedded in the plane such that there are no overlaps between edges, Euler's formula captures structural properties via V − E + F = 2, (1) where F counts the number of faces (including the unbounded one) of the planar embedding. While this formula can be used to comment on the feasibility of some problems in graph theory (see Appendix A), its practical utility is limited. However, it turns out that a similar identity relates connected components and cycles in a graph. Formally, referring to the number of connected components as β0 and the number of cycles as β1, we have β1 = m + β0 − n, where n and m denote the number of vertices and edges, respectively. The two quantities in this formula are also known as the first two Betti numbers of a graph, with β1 also known as the cyclomatic number or the circuit rank [7, pp. 27–30]. While the expressive power of these two numbers is limited, it can be improved by evaluating them alongside a filtration, i.e. a sequence of nested subgraphs of the form ∅ ⊆ G0 ⊆ G1 . . . ⊆ Gk−1 ⊆ Gk = G. 1This is primarily an assumption for notational convenience. The concepts described in this paper can also be extended to more complex scenarios. 2We only consider functions operating on vertices, but the concept can extended to edges as well. (2) 2 (a) Example graph (b) f −1((−∞, 0]) (c) f −1((−∞, 1]) (d) f −1((−∞, 2]) (e) f −1((−∞, 3]) FIGURE 2: An example graph and three different steps of a degree-based filtration. The respective caption indicates the pre-image of the corresponding filtration function. 3 0 0 1 3 2 1 2 0 0 ∞ ∞ n o i t c u r t s e D n o i t c u r t s e D 1 3 2 Creation 1 3 2 Creation (a) D0 (b) D1 FIGURE 3: Persistence diagrams of the filtration depicted in Fig. 2. Points can have different multiplicities; we show essential features, i.e. topological features that persist over the full filtration using an ∞ symbol. Filtrations typically arise from scalar-valued functions of the form f : G → R, which assign vertices and edges a value. Changes in the Betti numbers can then be tracked over the course of the filtration: given a threshold a ∈ R, one analyses the subgraph arising from the pre-image of (−∞, a] of f , denoted f −1((−∞, a]). This leads to per- sistent Betti numbers, which are typically summarised in a persistence diagram, i.e. a topological descriptor, con- sisting of tuples (ai, aj) ∈ R2, with ai referring to the value at which a topological feature was created, and aj referring to the value at which a topological feature was destroyed (for instance, because two connected compon- ents are being merged). The absolute difference in function values |aj − ai| is called the persistence of a topological feature; it indicates the prominence or relevance of said feature. Fig. 2 depicts an example filtration for a simple graph, where we use the degree of each vertex to filter the graph. The calculation of persistent homology along this filtration involves counting the connected components and cycles. We note that these features can only change whenever the filtration function changes. The critical points of the degree filtration are thus the unique degrees of vertices occurring in the graph. Fig. 3 shows the persistence diagrams arising from the filtration. The more complex structure of persistence diagrams (in comparison to the simple Betti numbers) already hints at their capabilities in providing expressive graph descriptors. 2.2 Topological Features of Simplicial Complexes The concepts discussed in Section 2.1 generalise to higher dimensions as well, with the understanding that the connectivity of higher-order structures of a graph-cliques-is being modelled. The resulting framework is referred to as persistent homology; it encompasses the calculations on graphs, extending them to simplicial complexes or other types of combinatorial complexes. The nomenclature is used to reflect the idea that the underlying graphs are originating from manifolds, of which the filtration function f measures certain features. A feature of high persistence is thus to be understood as a feature with that occurs over a large range of values of f . In the context of graphs, there are different constructions for obtaining simplicial complexes; we will subsequently use clique complexes (in which a k-clique is represented by a (k − 1)-simplex) because it is (i) straightforward to implement, and (ii) cliques are known to be characteristic graph structures [10]. Persistent homology is typically calculated using matrix reduction reduction algorithms, whose optimisation is still an ongoing topic of research [5]. We refer readers to Otter et al. [49] for a comprehensive introduction of computational strategies. In the general point cloud setting, a paper by Bauer [4] provides a highly-efficient reference implementation while also stating details on combinatorial optimisation strategies. Readers are invited to read Appendix C for a more detailed exposition of concepts in computational topology. 3 Properties of Filtrations Before we discuss how to create specific filtrations that are useful for graph learning tasks, we first discuss some of their general properties. We briefly expand on the stability properties of filtrations. Given two filtrations f, g of the same graph, a seminal result by Cohen-Steiner, Edelsbrunner, and Harer [19] proves the following bound. 3 Theorem 1 (Bottleneck stability). Let f, g refer to filtrations of a graph G, and let Df and Dg denote their respective persistence diagrams. The bottleneck distance distance is upper-bounded by dB(Df , Dg) ≤ ||f − g||∞, where ∥ * ∥∞ refers to the Hausdorff distance between the two functions. An extension of this theorem, with dB being replaced by the Wasserstein distance, shows that persistence diagrams are also stable in the Lipschitz sense [20]. These stability properties are remarkable because they link a topological quantity with a geometrical one, thus underscoring how persistent homology itself incorporates both geometrical and topological aspects of input data. Stability theorems are a crucial aspect of research in computational topology; readers are invited to read a recent work that provides a concise exposition and deposes of some erroneous assumptions in this context [58]. We continue our enumeration of filtration properties by proving that any filtration induced by an equivariant function is well-behaved under graph isomorphism. Theorem 2. (∗) Let G ≃ G′ be two isomorphic graphs, and φ be the respective isomorphism. For any equivariant filtration f , the corresponding persistence diagrams are equal. Theorem 2 is a consequence of a more general principle, viz. functoriality. It also shows that it is impossible to 'adversarially' pick an equivariant filtration function that leads to a non-zero topological dissimilarity between two non-isomorphic graphs. Furthermore, the theorem guarantees that persistent homology is fundamentally compatible with equivariant function learning, pointing towards the utility of hybrid models that leverage different types of structural properties of graphs. To finish this discussion of general properties, we remark that all filtrations carry information about the diameter (the length of the longest shortest path) and girth (the length of the shortest cycle) of a graph. Theorem 3. (∗) Given any vertex-based filtration f of a graph G with a single connected component, we can upper-bound diam(G), the diameter of G, based on D0, the resulting persistence diagram in dimension 0. Theorem 4. (∗) Given any vertex-based filtration f of a graph G, we can upper-bound the girth of G using the persistence diagrams in dimension 0 and 1. Theorem 3 and Theorem 4 indicate that persistent homology captures more than 'just' topological information about a graph. Similar to Vietoris–Rips filtrations, a topological construction for general metric spaces such as point clouds, persistence diagrams permit inferring additional properties about the input data [13, 41, 60]. This indicates that a topological perspective can complement and enrich graph learning tasks. We note that the respective upper bounds can always be made tighter with task-specific filtrations. 4 The Weisfeiler–Leman Hierarchy Having discussed the properties of specific filtrations, we now analyse the expressivity of persistent homology in the context of the Weisfeiler–Leman hierarchy of graph isomorphism tests. 1-WL, also known as colour refinement, constitutes a simple method for addressing the graph isomorphism problem. It is the backbone of graph expressivity research; readers are referred to Morris et al. [44] for a comprehensive survey of 1-WL, its higher-order variants, and their relation to machine learning research. We follow the terminology of this article and briefly introduce all relevant concepts. Formally, 1-WL proceeds by iteratively calculating a node colouring function C (1) : V → N. The output of this function depends on the neighbours of a given node. For a vertex v at iteration i > 0, we have i C (1) i (v) := RELABEL (cid:16)(cid:16) C (1) i−1(v), (cid:110)(cid:110) C (1) i (u) | u ∈ N (v) (cid:111)(cid:111)(cid:17)(cid:17) , (3) where RELABEL refers to an injective function that maps the tuple of colours to a unique colour, i.e. a unique number. The algorithm is initialised by either using existing labels or the degree of vertices.3 After a finite number of steps, the colour assignments generated using Eq. (3) stabilise. If two graphs give rise to different colour sequences, the graphs are guaranteed to be non-isomorphic. 3Note that Eq. (3) does not recognise an ordering of labels. Initialising 1-WL with a constant value thus leads to the same colouring-up to renaming-after the first iteration. 4 The 1-WL test is computationally easy and constitutes an upper bound for the expressivity of many graph neural network (GNN) architectures [45, 63]. In other words, if 1-WL cannot distinguish two non-isomorphic graphs, GNNs will also not be able to distinguish them. It is already a known result that any 1-WL colouring can be reproduced by creating a special filtration [35]; we restate this result as Theorem 6 in the appendix. The implication is that persistent homology is at least as expressive as 1-WL because there is a filtration that distinguishes all the graphs 1-WL can distinguish. Appendix E shows examples of graphs that can only be distinguished via their topological features, thus proving that a topological perspective is strictly more expressive than 1-WL. Since 1-WL is also unable to distinguish between graphs with different triangle counts or graphs with cycle information, it was generalised to include information about labelling tuples of k nodes (as opposed to only labelling a single node), leading to a hierarchy of algorithms. The variant we shall subsequently describe is also known as the folklore Weisfeiler–Leman algorithm [44]. It can be shown that there are non-isomorphic graphs that cannot be distinguished by k-FWL, but that can be distinguished by (k + 1)-FWL.4 Following Morris et al. [44], k-FWL is based on the idea of assigning colours to subgraphs as opposed to assigning colours to vertices. To achieve this, k-FWL operates on k-tuples of vertices; for iteration i = 0, two tuples v = (v1, . . . , vk) and w = (w1, . . . , wk) are assigned the same colour if the map vj (cid:55)→ wj induces a homomorphism between the subgraphs induced by v and w, respectively. For subsequent iterations with i > 0, we relabel the tuples similar to 1-WL, i.e. C (k) i (v) := RELABEL (cid:16)(cid:16) C (k) i−1(v), (cid:110)(cid:110) C (k) i (φ1(v, u)), . . . , C (k) i (φk(v, u)) | u ∈ N (v) (cid:111)(cid:111)(cid:17)(cid:17) , (4) where φj(v, u) := (v1, . . . , vj−1, u, vj+1, . . . , vk) refers to the function that replaces the jth element of the k-tuple v with u. This induces a neighbourhood relation between tuples and just as in the case of 1-WL, we run the algorithm until the assigned colours of tuples stabilise for one graph. Similarly, if the colour sequences of two graphs differ, the graphs are non-isomorphic. As a generalisation of previous work [35], we can show that any k-FWL colouring can be reproduced with a specific filtration, thus proving that persistent homology is at least as expressive as k-FWL. Theorem 5. (∗) Given k-FWL colourings of two graphs G and G′ that are different, there exists a filtration of G and G′ such that the corresponding persistence diagrams in dimension k − 1 or dimension k are different. We remark that the argumentation of Theorem 5 does not lend itself to a constructive proof since the higher-order setting is more complex. In contrast to the result for 1-WL, we also see that Theorem 5 needs to make use of two types of persistence diagrams. Moreover, while the filtration used in the proof does not necessarily lead to differentiable persistence diagrams (because of non-unique function values), it is possible to rectify this (see Lemma 2 in the Appendix), we can rectify this in practice. Both Theorem 6 and Theorem 5 may not be completely satisfactory because they only show the existence of such a filtration, but make no claims about the expressivity of existing filtrations. We aim to provide a more learning-theoretic approach of this issue in future work. On strictly higher expressivity. Ideally, we would want to extend Theorem 5 to state that persistent homology is strictly more expressive than k-FWL. This is not as straightforward as for k = 1, since we would have to construct families of non-isomorphic graphs that require (k + 1)-FWL to be distinguished but that can be distinguished already with lower-dimensional persistent homology. Currently, we can provide one such counterexample, described in Table 2, consisting of the 4 × 4 rook's graph and the Shrikhande graph. With an appropriate filtration, persistent homology can distinguish these two graphs without requiring more than vertices and edges, whereas 2-FWL is unable to distinguish them. We leave a more general result for future work. 4There are also other variants, for instance the oblivious Weisfeiler–Leman algorithm. It slightly differs in the way tuples are being relabelled, but a paper by Grohe [29] shows that the variant is essentially as powerful as k-FWL (with a minor shift in indices). The reader is referred to Morris et al. [44] and the references therein for an extended discussion of these aspects. 5 5 Experiments The previous sections discussed the theoretical properties of filtrations. Here, we want to briefly comment on their empirical performance. We thus analyse to what extent two different filtrations are capable of distinguishing between different non-isomorphic graphs. Notice that we refrain from performing experiments that require training an additional classifier since such results would be inherently harder to interpret. Experimental setup. We use different data sets of connected cubic graphs [22] and strongly-regular graphs [43]. The latter type of graph is known to be challenging for graph isomorphism tests; we know for instance that 2-FWL cannot distinguish between any such instances [44]. In the following, we will use three different filtrations for each graph: 1. A degree filtration, i.e. v (cid:55)→ deg(v). The degree filtration is the most basic non-trivial filtration of a graph, showing nevertheless surprising empirical performance in graph classification tasks [32, 47, 55]. 2. A filtration based on the eigenvalues of the undirected graph Laplacian, i.e. v (cid:55)→ λv, where λv indicates the eigenvalue of the undirected graph Laplacian corresponding to vertex v. The graph Laplacian is known to capture characteristic properties of a graph; in the context of persistent homology it is often used in the form of a heat kernel signature [14]. 3. A filtration based on the Ollivier–Ricci curvature [48] in the graph, setting v (cid:55)→ −1 and (u, v) (cid:55)→ κ(u, v), with κ denoting the Ollivier–Ricci curvature κ(u, v) := 1 − W1(μα where W1 denotes the first Wasserstein distance,5 and μα on lazy random walk in the graph: u, μα v ), u, μα v denote probability measures based (5) μα u(v) :=    α (1 − α) 0 1 deg(u) u = v (u, v) ∈ E otherwise (6) Notice that Eq. (5) can be generalised to arbitrary pairs of vertices, which entails a slightly different weighting factor. Moreover, the probability measures μα u may be adjusted; recent work investigates the utility of this perspective [23, 59]. We set α = 0 for our subsequent experiments, thus obtaining a non-lazy random walk; the investigation of additional parameters impacts is left for future work. After picking a filtration, we expand the graph by filling in all (k + 1)-cliques and calculating persistent homology up to dimension k. Hence, for k = 1, we leave the graph 'as-is,' making use of connected components and cycles only.6 Our persistent homology calculations result in a set of persistence diagrams for each graph, which we compare in a pairwise manner using the bottleneck distance described by Eq. (15). We consider two graphs to be different whenever the distance between their persistence diagrams is > 1 × 10−8. This setup has the advantage that no additional classifier is required; when dealing with data sets of pairs of non-isomorphic graphs, we may thus simple count the number of non-zero distance pairs. 5.1 Connected Cubic Graphs We start our investigation by distinguishing connected cubic graphs, i.e. 3-regular graphs. These graphs cannot be distinguished by 1-WL, but they can be distinguished by 2-FWL [9, 44]. As such, they provide a good example of how different filtrations harness different types of graph information. Table 1 shows the results. We first observe that the degree filtration is incapable of distinguishing graphs for k = 1. This is a direct consequence of the regularity-since the function is constant on the graph, persistent homology cannot capture any variability. This changes, however, when higher-order structures-triangles-are included for k = 2. We also observe that the Laplacian-based filtration exhibits strong empirical performance; in the absence of additional information, the spectral 5This metric is also known as the Earth Mover's Distance [40]. The Wasserstein distance is a fundamental concept in optimal transport; the monograph by Villani [62] contains a comprehensive introduction to this topic. 6Notice the shift in dimension: a k-simplex has k + 1 vertices, meaning that persistent homology in dimension k contains information about (k + 1)-cliques. 6 TABLE 1: Success rate (↑) of distinguishing pairs of connected cubic graphs when using three different filtrations (D: degree filtration, L: Laplacian filtration, C: Ollivier–Ricci curvature filtration) at varying expansion levels of the graph (denoted by k). Due to the regularity of each graph, k = 3 is omitted since the clique complex of the graph is exactly the same as for k = 2. These graphs can be distinguished by 2-FWL but not by 1-WL. k = 1 k = 2 Filtration D L C D L C 0.000 0.000 0.000 0.000 0.000 1.000 1.000 1.000 1.000 1.000 1.000 0.900 0.994 0.996 0.998 1.000 0.900 0.813 0.801 0.793 1.000 1.000 1.000 1.000 1.000 1.000 0.900 0.994 0.996 0.998 Data cub06 cub08 cub10 cub12 cub14 TABLE 2: Success rate (↑) for distinguishing pairs of strongly-regular graphs when using three different filtrations (D: degree filtration, L: Laplacian filtration, C: Ollivier–Ricci curvature filtration) at varying expansion levels of the graph (denoted by k). None of these pairs of graphs can be distinguished by 2-FWL [8]. Data k = 1 k = 2 Filtration k = 3 D L C D L C D L C sr16622 sr251256 sr261034 sr291467 sr281264 sr351899 sr361446 sr401224 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.733 0.000 0.667 0.461 0.494 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.200 0.000 0.000 0.000 0.022 0.931 1.000 0.829 0.844 0.752 0.833 0.499 0.961 0.992 1.000 0.000 0.200 0.000 1.000 0.000 0.022 0.931 1.000 0.905 0.933 0.801 1.000 0.984 0.919 0.944 1.000 0.952 0.978 0.893 1.000 0.989 0.994 0.989 1.000 0.905 0.933 0.801 1.000 0.984 0.919 0.944 properties captured by the Laplacian help in distinguishing graphs. The Ollivier–Ricci curvature filtration is performing similarly well; in contrast to the Laplacian-based filtration, it does not require the calculation of eigenvalues, which may be prohibitive for larger graphs.7 5.2 Strongly-Regular Graphs The second class of graphs we will be analysing consists of strongly-regular graphs. Such graphs are known to be extremely challenging to distinguish; 2-FWL is unable to distinguish any of these graphs, for instance. Our goal is again to highlight the utility of different filtration function choices. Table 2 summarises the performance. We first observe that for k = 1, i.e. for the original graph without any cliques, few pairs of graphs can be distinguished. Notably, a curvature-based filtration is sufficient to distinguish the two graphs in the sr16622 data set, colloquially also known as the 4 × 4 rook's graph and the Shrikhande graph. Distinguishing between these two graphs is usually said to require knowledge about cliques [8], but it turns out that a suitable filtration is sufficient. However, the empirical expressivity of the curvature- based filtration appears limited for k = 1, improving only for higher-order clique complexes. The Laplacian filtration, by contrast, exhibits strong empirical performance for k = 2, increasing to near-perfect performance for k = 3 in almost all data sets. It is clear that knowledge about higher- order cliques helps in driving performance here. Notice that in contrast to other algorithms [8], no additional embedding of the graphs is required; we are comparing 'raw' persistence diagrams directly. 7 TABLE 3: Success rate (↑) for distinguishing pairs of minimal Cayley graphs when using three different filtrations (D: degree filtration, L: Laplacian filtration, C: Ollivier–Ricci curvature filtration) at varying expansion levels of the graph (denoted by k). Again, k = 3 is omitted because of the regularity. Values for 1-WL are shown as a baseline. k = 1 k = 2 Data cay12 cay16 cay20 cay24 cay32 cay36 cay60 cay63 1-WL D 0.67 0.83 0.61 0.65 0.76 0.69 0.69 0.49 0.67 0.83 0.61 0.66 0.77 0.69 0.69 0.49 L 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 Filtration C 0.95 0.92 0.79 0.93 0.94 0.95 0.95 0.93 D 0.95 0.83 0.61 0.83 0.77 0.84 0.77 0.73 L 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 C 0.95 0.92 0.79 0.93 0.94 0.95 0.95 0.93 5.3 Minimal Cayley Graphs As an additional class of complex graphs, we analyse minimal Cayley graphs, i.e. Cayley graphs that encode a group with a minimal generating set. Minimal Cayley graphs are still a topic of active research in graph theory, with several conjectures yet to be proven [2, 3]. We follow the same experimental setup as described above but also show the performance of 1-WL, calculated via a subtree Weisfeiler–Leman graph kernel [57]. For this baseline calculation, we report all pairs for which the kernel dissimilarity is < 1.0 (given the calculation as normalised histograms, the kernel will exhibit a self-similarity of 1.0). Table 3 shows the results. We observe that the Laplacian filtration is trivially able to distinguish between all these graphs; this is not surprising since spectra of the graphs are known to be characteristic [42]. The performance of the Ollivier–Ricci curvature also points towards the utility of this formulation in practice. Interestingly, the degree filtration is the only filtration that benefits from the availability of higher-order (i.e. clique) information. 5.4 Predicting Graph Properties As our final experiment, we provide an empirical assessment of Theorem 3 and use topological features to predict the diameter of graphs. Specifically, we generate N = 100 Erd ̋os–Rényi graphs with n = 100 vertices and p = 0.1. This edge probability corresponds to the critical connectivity regime, for which closed-form solutions of the diameter distribution are not readily available [30]. We assess the utility of persistent homology by specifying a regression task;8 to this end, we vectorise the persistence diagrams for each filtration using Betti curves [47, 55], a simple technique that creates a curve representation by counting the number of active topological features per threshold ε. While this representation is technically a function, we represent it as a histogram of 10 bins and train a ridge regression classifier via leave-one-out cross-validation to predict the diameter of each graph. We deliberately focus only on zero-dimensional and one-dimensional persistent homology, i.e. we leave k = 1. Using the mean absolute error (MAE) for evaluation, we find that Ollivier–Ricci curvature performs best (0.057), followed by the Laplacian spectrum (0.061), and the degree filtration (0.065). We observe similar things when calculating N = 100 Watts–Strogatz graphs of type (100, 5, 0.1), i.e. we keep the same number of vertices and the same edge rewiring probability p, but connect each node with its 5 nearest neighbours in a ring neighbourhood. Using the same classifier, we again find that Ollivier–Ricci curvature achieves the lowest MAE (0.851), followed by the degree filtration (0.865), and the Laplacian spectrum (1.072). 7Ollivier–Ricci curvature requires solving optimal transport problems, for which highly efficient approximative solvers are available [24]. 8Following Hartmann and Mézard [30], we take the diameter of an Erd ̋os–Rényi graph, which might consist of different connected components, to be the largest diameter of all connected components of the graph. 8 6 Discussion This paper provided an introduction to persistent homology for graph learning. We discussed various aspects of the computation process and provided theoretical evidence of advantageous properties of persistent homology. Our primary insight is that persistent homology is at least as expressive as a corresponding 1-WL or k-FWL test, while in some cases surpassing their discriminative power.9 Our experiments underscore the theoretical expressivity properties, while also demonstrating that persistent homology is able to capture additional properties of a graph. The utility of this method crucially hinges on the choice of a filtration, i.e. a function that is used to assess topological features of the graph. In light of the performance differences in our experiments, we suggest that future work should focus on elucidating properties of classes of such functions. We give an overview of emerging research directions before concluding this work. Beyond Expressivity of Filtrations. Expressivity in terms of distinguishing between special families of graphs is not the be-all and end-all of graph learning research. Considering recent work [10, 18], an investigation of which other properties are being captured by persistent homology would be worthwhile. Theorem 3 and Theorem 4 as well as our experiments provide a first glimpse here. Any such research research can either focus on the overall properties of the persistent homology calculations, i.e. provide results that are independent of the respective filtration, or focus on the expressive power of special classes of filtrations. Along these lines, Southern et al. [59] provide a first empirical analysis of the substructures that are being captured by curvature-based filtrations. Any further results are strongly contingent on the respective filtration, making a learning-theoretical investigation of which filtrations can be learnt in practice an interesting direction for future work [32]. The success of the Laplacian filtration at the experimental tasks may hint at new filtrations based on spectral graph theory that provide a trade-off between utility and computational efficiency. We find that this research direction is overlooked by the computational topology research community, with most of the expressivity/stability results focusing on describing the stability of distance-based filtrations under perturbations [15, 16], with few works focusing on graphs [4]. This paper is but a first attempt at elucidating the theoretical utility of computational topology in a graph learning context; advancing the field will require many more insights. Topology-Driven Baselines & Hybrid Models. While not explicitly assessed in our experimental setup, we envision that persistent homology may well provide a strong baseline for graph learning applications. As previous work shows, even topology-inspired approaches, making use of concepts such as filtrations, can approximate the performance of highly-parametrised models at a fraction of the computational cost [47]. All insights obtained using such topological methods hint at the overall utility of graph structural information for graph learning tasks, but it is not clear whether current graph benchmark data actually exhibit such structures [50]. We thus hope that persistent homology and related techniques will also find more applications in hybrid models, which are able to incorporate geometrical–topological information about graphs. This is an emerging research topic of crucial relevance since there are now numerous graph data sets that combine geometrical information (node coordinates) with topological information. Open Questions. We would like to pose the following questions to the community: 1. Is k-dimensional persistent homology strictly more expressive than k-FWL? 2. Are there classes of continuous filtration functions that are e.g. homotopy-equivalent to the Weisfeiler–Leman set of colours? 3. Which graph properties other than the diameter and girth can be bounded or even decided by persistent homology? Conclusion. Our theoretical analysis of the properties of persistent homology for graph learning tasks show the potential and benefits of a topology-based perspective. We are confident that additional computational topology concepts will enrich and augment machine learning models, leading to new insights about their theoretical and empirical capabilities. 9More specifically, previous work [35] showed that persistent homology is strictly more expressive than 1-WL. In this article, when tackling k ≥ 2, we only provide counterexamples that show that there are graphs that can be distinguished by some filtration but not by 2-FWL, for instance. 9 References [1] V. Arvind, J. Köbler, G. Rattan, and O. Verbitsky. 'On the Power of Color Refinement'. In: Fundamentals of Computation Theory. Ed. by A. Kosowski and I. Walukiewicz. Cham, Switzerland: Springer, 2015, pp. 339–350. [2] L. Babai. 'Automorphism Groups, Isomorphism, Reconstruction'. In: Handbook of Combinat- orics. MIT Press, 1996, pp. 1447–1540. [3] L. Babai. 'Chromatic number and subgraphs of Cayley graphs'. In: Theory and Applications of Graphs. Ed. by Y. Alavi and D. R. Lick. 1978, pp. 10–22. [4] U. Bauer. 'Ripser: efficient computation of Vietoris–Rips persistence barcodes'. In: Journal of Applied and Computational Topology 5.3 (2021), pp. 391–423. DOI: 10.1007/s41468-021-00071-5. [5] U. Bauer, T. B. Masood, B. Giunti, G. Houry, M. Kerber, and A. Rathod. 'Keeping it sparse: Computing Persistent Homology revisited'. 2022. arXiv: 2211.09075 [cs.CG]. [6] P. Bendich, J. S. Marron, E. Miller, A. Pieloch, and S. Skwerer. 'Persistent homology analysis of brain artery trees'. In: The Annals of Applied Statistics 10.1 (2016), pp. 198–218. DOI: 10.1214/15-AOAS886. [7] C. Berge. The Theory of Graphs. Dover Publications, 2001. [8] C. Bodnar, F. Frasca, Y. Wang, N. Otter, G. F. Montufar, P. Lió, and M. Bronstein. 'Weisfeiler and Lehman Go Topological: Message Passing Simplicial Networks'. In: International Confer- ence on Machine Learning (ICML). Ed. by M. Meila and T. Zhang. Proceedings of Machine Learning Research 139. PMLR, 2021, pp. 1026–1037. [9] B. Bollobás. 'Distinguishing Vertices of Random Graphs'. In: Graph Theory. Ed. by B. Bollobás. North–Holland Mathematics Studies 62. Amsterdam, Netherlands: North–Holland, 1982, pp. 33–49. DOI: 10.1016/S0304-0208(08)73545-X. [10] G. Bouritsas, F. Frasca, S. Zafeiriou, and M. M. Bronstein. 'Improving Graph Neural Network Expressivity via Subgraph Isomorphism Counting'. In: IEEE Transactions on Pattern Analysis and Machine Intelligence 45.1 (2023), pp. 657–668. DOI: 10.1109/TPAMI.2022.3154319. [11] M. M. Bronstein, J. Bruna, T. Cohen, and P. Veliˇckovi ́c. 'Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and Gauges'. 2021. arXiv: 2104.13478 [cs.LG]. [12] M. M. Bronstein, J. Bruna, Y. LeCun, A. Szlam, and P. Vandergheynst. 'Geometric Deep Learning: Going beyond Euclidean data'. In: IEEE Signal Processing Magazine 34.4 (2017), pp. 18–42. DOI: 10.1109/MSP.2017.2693418. [13] P. Bubenik, M. Hull, D. Patel, and B. Whittle. 'Persistent homology detects curvature'. In: Inverse Problems 36.2 (2020), p. 025008. DOI: 10.1088/1361-6420/ab4ac0. [14] M. Carrière, F. Chazal, Y. Ike, T. Lacombe, M. Royer, and Y. Umeda. 'PersLay: A Neural Network Layer for Persistence Diagrams and New Graph Topological Signatures'. In: Interna- tional Conference on Artificial Intelligence and Statistics (AISTATS). Ed. by S. Chiappa and R. Calandra. Proceedings of Machine Learning Research 108. PMLR, 2020, pp. 2786–2796. [15] F. Chazal, V. De Silva, M. Glisse, and S. Oudot. The structure and stability of persistence modules. Vol. 10. SpringerBriefs in Mathematics. Cham, Switzerland: Springer, 2016. DOI: 10.1007/978-3-319-42545-0. [16] F. Chazal, V. de Silva, and S. Oudot. 'Persistence stability for geometric complexes'. In: Geometriae Dedicata 173.1 (2014), pp. 193–214. DOI: 10.1007/s10711-013-9937-z. [17] Y. Chen, B. Coskunuzer, and Y. Gel. 'Topological Relational Learning on Graphs'. In: Ad- vances in Neural Information Processing Systems. Ed. by M. Ranzato, A. Beygelzimer, Y. Dauphin, P. Liang, and J. W. Vaughan. Vol. 34. Curran Associates, Inc., 2021, pp. 27029– 27042. [18] Z. Chen, L. Chen, S. Villar, and J. Bruna. 'Can Graph Neural Networks Count Substructures?' In: Advances in Neural Information Processing Systems. Ed. by H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin. Vol. 33. Curran Associates, Inc., 2020, pp. 10383–10395. 'Stability of persistence dia- In: Discrete & Computational Geometry 37.1 (2007), pp. 103–120. DOI: [19] D. Cohen-Steiner, H. Edelsbrunner, and J. Harer. grams'. 10.1007/s00454-006-1276-5. [20] D. Cohen-Steiner, H. Edelsbrunner, J. Harer, and Y. Mileyko. 'Lipschitz functions have Lp- stable persistence'. In: Foundations of Computational Mathematics 10.2 (2010), pp. 127–139. DOI: 10.1007/s10208-010-9060-6. 10 [21] C. J. Colbourn. 'On testing isomorphism of permutation graphs'. In: Networks 11.1 (1981), pp. 13–21. DOI: 10.1002/net.3230110103. [22] K. Coolsaet, S. D'hondt, and J. Goedgebeur. 'House of Graphs 2.0: A database of inter- esting graphs and more'. In: Discrete Applied Mathematics 325 (2023), pp. 97–107. DOI: 10.1016/j.dam.2022.10.013. URL: https://houseofgraphs.org. [23] C. Coupette, S. Dalleiger, and B. Rieck. 'Ollivier–Ricci Curvature for Hypergraphs: A Unified Framework'. In: International Conference on Learning Representations (ICLR). 2023. arXiv: 2210.12048 [cs.LG]. In press. [24] M. Cuturi. 'Sinkhorn Distances: Lightspeed Computation of Optimal Transport'. In: Advances in Neural Information Processing Systems. Ed. by C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Weinberger. Vol. 26. 2013. [25] T. K. Dey and Y. Wang. Computational Topology for Data Analysis. Cambridge, United Kingdom: Cambridge University Press, 2022. DOI: 10.1017/9781009099950. [26] H. Edelsbrunner and J. Harer. 'Persistent homology-a survey'. In: Surveys on discrete and computational geometry: Twenty years later. Ed. by J. E. Goodman, J. Pach, and R. Pollack. Contemporary Mathematics 453. Providence, RI, USA: American Mathematical Society, 2008, pp. 257–282. [27] H. Edelsbrunner, D. Letscher, and A. J. Zomorodian. 'Topological persistence and sim- plification'. In: Discrete & Computational Geometry 28.4 (2002), pp. 511–533. DOI: 10.1007/s00454-002-2885-2. [28] R. J. Gardner, E. Hermansen, M. Pachitariu, Y. Burak, N. A. Baas, B. A. Dunn, M.-B. Moser, and E. I. Moser. 'Toroidal topology of population activity in grid cells'. In: Nature 602.7895 (2022), pp. 123–128. DOI: 10.1038/s41586-021-04268-7. [29] M. Grohe. 'The Logic of Graph Neural Networks'. In: Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). 2021, pp. 1–17. DOI: 10.1109/LICS52264.2021.9470677. [30] A. K. Hartmann and M. Mézard. 'Distribution of diameters for Erd ̋os–Rényi random graphs'. In: Physical Review E 97 (3 2018), p. 032128. DOI: 10.1103/PhysRevE.97.032128. [31] C. Hofer, R. Kwitt, M. Niethammer, and A. Uhl. 'Deep Learning with Topological Signatures'. In: Advances in Neural Information Processing Systems. Ed. by I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett. Vol. 30. 2017, pp. 1634– 1644. [32] C. D. Hofer, F. Graf, B. Rieck, M. Niethammer, and R. Kwitt. 'Graph Filtration Learning'. In: International Conference on Machine Learning (ICML). Ed. by H. Daumé III and A. Singh. Proceedings of Machine Learning Research 119. PMLR, 2020, pp. 4314–4323. arXiv: 1905.10996 [cs.LG]. [33] C. D. Hofer, R. Kwitt, and M. Niethammer. 'Learning Representations of Persistence Bar- codes'. In: Journal of Machine Learning Research 20.126 (2019), pp. 1–45. [34] D. Horak, S. Maleti ́c, and M. Rajkovi ́c. 'Persistent homology of complex networks'. In: Journal of Statistical Mechanics: Theory and Experiment 2009.3 (2009), P03034. DOI: 10.1088/1742-5468/2009/03/P03034. [35] M. Horn, E. De Brouwer, M. Moor, Y. Moreau, B. Rieck, and K. Borgwardt. 'Topological Graph Neural Networks'. In: International Conference on Learning Representations (ICLR). 2022. URL: https://openreview.net/forum?id=oxxUMeFwEHd. [36] C. K. Joshi, C. Bodnar, S. V. Mathis, T. Cohen, and P. Liò. 'On the Expressive Power of Geometric Graph Neural Networks'. 2023. arXiv: 2301.09308 [cs.LG]. [37] P. J. Kelly. 'A congruence theorem for trees'. In: Pacific Journal of Mathematics 7.1 (1957), pp. 961–968. DOI: pjm/1103043674. [38] R. Kwitt, S. Huber, M. Niethammer, W. Lin, and U. Bauer. 'Statistical Topological Data Analysis - A Kernel Perspective'. In: Advances in Neural Information Processing Systems. Ed. by C. Cortes, N. Lawrence, D. Lee, M. Sugiyama, and R. Garnett. Vol. 28. 2015. [39] T. Leinster. 'The Euler characteristic of a category'. In: Documenta Mathematica 13 (2008), pp. 21–49. [40] E. Levina and P. Bickel. 'The Earth Mover's distance is the Mallows distance: some insights from statistics'. In: IEEE International Conference on Computer Vision (ICCV). Vol. 2. 2001, pp. 251–256. DOI: 10.1109/ICCV.2001.937632. 11 [41] S. Lim, F. Memoli, and O. B. Okutan. Vietoris–Rips Persistent Homology, Injective Metric Spaces, and The Filling Radius. 2020. arXiv: 2001.07588 [math.AT]. [42] L. Lovász. 'Spectra of graphs with transitive groups'. In: Periodica Mathematica Hungarica 6.2 (1975), pp. 191–195. McKay. [43] B. strongly-regular https://users.cecs.anu.edu.au/~bdm/data/graphs.html. Collection of graphs. URL: [44] C. Morris, Y. Lipman, H. Maron, B. Rieck, N. M. Kriege, M. Grohe, M. Fey, and K. Borgwardt. 'Weisfeiler and Leman go Machine Learning: The Story so far'. 2021. arXiv: 2112.09992 [cs.LG]. [45] C. Morris, M. Ritzert, M. Fey, W. L. Hamilton, J. E. Lenssen, G. Rattan, and M. Grohe. 'Weisfeiler and Leman Go Neural: Higher-Order Graph Neural Networks'. In: AAAI Conference on Artificial Intelligence. 2019. DOI: 10.1609/aaai.v33i01.33014602. J. R. Munkres. Elements of Algebraic Topology. Menlo Park, California, USA: Addison–Wesley Publishing Company, 1984. [46] [47] L. O'Bray, B. Rieck, and K. Borgwardt. 'Filtration Curves for Graph Representation'. In: International Conference on Knowledge Discovery & Data Mining (KDD). New York, NY, USA: Association for Computing Machinery, 2021, pp. 1267–1275. DOI: 10.1145/3447548.3467442. [48] Y. Ollivier. 'Ricci curvature of metric spaces'. In: Comptes Rendus Mathematique 345.11 (2007), pp. 643–646. DOI: 10.1016/j.crma.2007.10.041. [50] [49] N. Otter, M. A. Porter, U. Tillmann, P. Grindrod, and H. A. Harrington. 'A roadmap for the computation of persistent homology'. In: EPJ Data Science 6.1 (2017), 17:1–17:38. DOI: 10.1140/epjds/s13688-017-0109-5. J. Palowitch, A. Tsitsulin, B. Mayer, and B. Perozzi. 'GraphWorld: Fake Graphs Bring Real Insights for GNNs'. In: Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. 2022, pp. 3691–3701. DOI: 10.1145/3534678.3539203. J. Reininghaus, S. Huber, U. Bauer, and R. Kwitt. 'A stable multi-scale kernel for topological machine learning'. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 2015, pp. 4741–4748. DOI: 10.1109/CVPR.2015.7299106. [51] [52] B. Rieck. 'Persistent Homology in Multivariate Data Visualization'. PhD thesis. Heidelberg University, 2017. DOI: 10.11588/heidok.00022914. [53] B. Rieck, C. Bock, and K. Borgwardt. 'A Persistent Weisfeiler–Lehman Procedure for Graph Classification'. In: International Conference on Machine Learning (ICML). Ed. by K. Chaudhuri and R. Salakhutdinov. Proceedings of Machine Learning Research 97. PMLR, 2019, pp. 5448–5458. [54] B. Rieck, U. Fugacci, J. Lukasczyk, and H. Leitte. 'Clique Community Persistence: A Topolo- gical Visual Analysis Approach for Complex Networks'. In: IEEE Transactions on Visualiza- tion and Computer Graphics 24.1 (2018), pp. 822–831. DOI: 10.1109/TVCG.2017.2744321. [55] B. Rieck, F. Sadlo, and H. Leitte. 'Topological Machine Learning with Persistence Indicator Functions'. In: Topological Methods in Data Analysis and Visualization V. Ed. by H. Carr, I. Fujishiro, F. Sadlo, and S. Takahashi. Cham, Switzerland: Springer, 2020, pp. 87–101. DOI: 10.1007/978-3-030-43036-8_6. arXiv: 1907.13496 [math.AT]. [56] R. Sato. 'A Survey on The Expressive Power of Graph Neural Networks'. 2020. arXiv: 2003.04078 [cs.LG]. [57] N. Shervashidze, P. Schweitzer, E. J. van Leeuwen, K. Mehlhorn, and K. M. Borgwardt. 'Weisfeiler–Lehman Graph Kernels'. In: Journal of Machine Learning Research 12.77 (2011), pp. 2539–2561. [58] P. Škraba and K. Turner. 'Wasserstein Stability for Persistence Diagrams'. 2020. arXiv: [59] 2006.16824 [math.AT]. J. Southern, J. Wayland, M. Bronstein, and B. Rieck. 'Curvature Filtrations for Graph Generat- ive Model Evaluation'. 2023. arXiv: 2301.12906 [cs.LG]. [60] R. Turkeš, G. Montúfar, and N. Otter. 'On the Effectiveness of Persistent Homology'. In: Advances in Neural Information Processing Systems. Ed. by A. H. Oh, A. Agarwal, D. Belgrave, and K. Cho. 2022. URL: https://openreview.net/forum?id=DRjUkfExCix. 12 [61] K. Turner, Y. Mileyko, S. Mukherjee, and J. Harer. 'Fréchet Means for Distributions of Persistence Diagrams'. In: Discrete & Computational Geometry 52.1 (2014), pp. 44–70. DOI: 10.1007/s00454-014-9604-7. [62] C. Villani. Optimal Transport. Old and New. Grundlehren der mathematischen Wissenschaften 338. Springer, 2009. [63] K. Xu, W. Hu, J. Leskovec, and S. Jegelka. 'How Powerful are Graph Neural Net- works?' In: International Conference on Learning Representations (ICLR). 2019. URL: https://openreview.net/forum?id=ryGs6iA5Km. [64] Z. Yan, T. Ma, L. Gao, Z. Tang, Y. Wang, and C. Chen. 'Neural Approxima- tion of Graph Topological Features'. In: Advances in Neural Information Processing Systems. Ed. by A. H. Oh, A. Agarwal, D. Belgrave, and K. Cho. 2022. URL: https://openreview.net/forum?id=qwjrO7Rewqy. [65] X. Ye, F. Sun, and S. Xiang. 'TREPH: A Plug-In Topological Layer for Graph Neural Net- works'. In: Entropy 25.2 (2023). ISSN: 1099-4300. DOI: 10.3390/e25020331. [66] Q. Zhao and Y. Wang. 'Learning metrics for persistence-based summaries and applications for graph classification'. In: Advances in Neural Information Processing Systems. Ed. by H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett. Vol. 32. 2019, pp. 9855–9866. [67] Q. Zhao, Z. Ye, C. Chen, and Y. Wang. 'Persistence Enhanced Graph Neural Network'. In: International Conference on Artificial Intelligence and Statistics (AISTATS). Ed. by S. Chiappa and R. Calandra. Proceedings of Machine Learning Research 108. PMLR, 2020, pp. 2896– 2906. 13 FIGURE 4: A depiction of the utilities problem. Three houses (top row) are supposed to be connected to three different utilities (bottom row; commonly referred to as water, gas, and electricity) without the connection lines crossing one another. The figure shows an incorrect solution in which crossings occur. Using Eq. (1), we can prove that no such solution can exist in the plane. To see this, we set V = 3 and E = 9, as required by the utilities problem. Eq. (1) now states that F = 8. However, we can see that F can be at most half the number of edges, i.e. F ≤ 4. This is true because the edges of any face generated by a planar embedding have to alternate between the houses and utilities, respectively, meaning that every face has at least 4 edges, and each edge belongs to exactly 2 faces. A Using Euler's Formula Euler's formula is typically used to solve certain problems in graph theory, such as the utilities problem described in Fig. 4. While arguably a contrived example in the context of machine learning, it nevertheless proves the point that a fundamental perspective of structural properties of a graph can well be used to reason about them. The expressive power of such simple computational invariants should not be underestimated, with recent work showing how to assign invariants like the Euler characteristic in a more abstract context [39]. B Counting Connected Components Since the main text deals with higher-order topological features, and such features afford a substan- tially less intuitive grasp, we want to briefly comment on how to obtain β0, the number of connected components. As with many problems in computer science, this procedure turns out to be simple if we pick our data structures correctly. Here, we need a union–find data structure, also known as a disjoint set forest. This data structure is built on the vertices of a graph and affords two operations, viz. union (or merge) and find. The merge operation assigns two vertices to the same connected component, while the find operation returns the current connected component of a vertex. Building such a data structure is reasonably easy in programming languages like Python, which offer associ- ative arrays. Algorithm 1 shows one particular pseudo-code implementation of a simple union–find data structure. The pseudo-code assumes that all operations are changing objects 'in place.' Notice that the find operation is implemented implicitly via a lookup in the merge function. A proper object-oriented implementation of a union–find data structure should have these two operations in its public interface. UF ← {} for v ∈ V do UF[v] ← v end for for e = (v, w) ∈ E do merge(UF, v, w) ALGORITHM 1 Using associative arrays to find connected components 1: function get_connected_components(V, E) 2: 3: 4: 5: 6: 7: 8: 9: 10: end function 11: function merge(UF, v, w) if UF[v] ̸= UF[w] then 12: 13: 14: 15: end function end for return {v | UF[v] = v} UF[v] ← w end if 14 C A Primer in Computational Topology With the understanding that our readers have different backgrounds, the following section provides a primer of the most relevant concepts in computational topology. C.1 Simplicial Homology The Betti numbers of a graph are actually a special instance of a more generic concept, known as simplicial homology. We will see that under this framework, the Betti numbers are the ranks of the zeroth and first homology group, respectively. Simplicial homology is not required in order to understand most of the results of this paper, but an appreciation for some of the concepts will be helpful in understanding connections to other concepts. We try to provide a self-contained introduction to the most relevant concepts and refer to the textbook by Munkres [46] for a more in-depth exposition of these concepts. We start by introducing the central object of algebraic topology-the simplicial complex.10 Definition 1 (Simplicial complex). A simplicial complex K is a system of sets that is closed under the subset operation. Thus, for any σ ∈ K and τ ⊆ σ, we have τ ∈ K. An element σ ∈ K with |σ| = k + 1 is also referred to as a k-simplex. We also express this by writing dim σ = k. Moreover, if k is maximal among all the simplices of K, we say that the K is a k-dimensional simplicial complex. Note that there is an unfortunate shift in dimensions: a k-simplex has indeed k + 1 elements. This convention makes sense when we relate it to the concept of dimension. A 0-simplex, i.e. a point or a vertex, should be assigned a dimension of 0. The reader should thus mentally equate the dimension of a simplex with its dimension. The text will aim to quell any confusion about such shifts. The quintessential example of a simplicial complex is a graph G = (V, E). Setting K := V ∪E, we obtain a 1-dimensional simplicial complex. We may calculate additional types of simplicial complexes from a graph, for instance by expanding each (k + 1)-clique into a k-simplex [34, 54]. The simplicial complex on its own is only a set system; to perform calculations with this type of data structure, we need to imbue it with additional operations. One of the most common operations involves defining homomorphisms between the subsets of a simplicial complex K. Definition 2 (Chain group of a simplicial complex). Given a simplicial complex K, the vector space generated over Z2 coefficients whose elements are the k-simplices of K is called the kth chain group, denoted by Ck(K). The elements of a chain group are also referred to as simplicial chains. Elements of the chain group are thus sums of simplices of a compatible dimension. For instance, we may write the sum of all edges of a graph to obtain a valid simplicial chain. Operating over Z2 coefficients means that σ + σ = 0, the empty chain, for all σ ∈ K.11 Simplicial chains permit us to define homomorphisms between chain groups, which will ultimately permit us to treat topological questions with tools of linear algebra. Definition 3 (Boundary homomorphism). Given σ = (v0, . . . , vk) ∈ K, we define the kth boundary homomorphism ∂k : Ck(K) → Ck−1(K) as ∂k(σ) := k (cid:88) (v0, . . . , vi−1, vi+1, . . . , vk), i=0 (7) i.e. a sum of simplices with the ith entry-vertex-of the simplex missing, respectively. It is sufficient to define ∂k on individual simplices; since it is a homomorphism, it extends to arbitrary simplicial chains. Fig. 5 shows an example of this calculation. The boundary operator already assigns some algebraic structure to K, but it turns out that we can use it to assign a set of groups to the simplicial complex. 10Technically, we will be working with abstract simplicial complexes. A definition of a simplicial complex in terms of convex subsets is also possible, but this necessitates understanding certain nuances that are irrelevant to this paper. 11Readers familiar with algebraic topology will recognise Z2 as a deliberate choice of coefficient field for the subsequent calculations. Other choices are possible, but the computational topology community predominantly uses Z2 coefficients in practice, with very few exceptions [28]. However, all the proofs and concepts introduced in this paper apply, mutatis mutandis, for other coefficient sets as well. 15 c b a The triangle is a simple simplicial complex, consisting of one 2-simplex, three 1-simplices and three 0-simplices, respectively. The boundary of the 2-simplex is non-zero: we have ∂2{a, b, c} = {b, c} + {a, c} + {a, b}. The set of edges, on the other hand, does not have a boundary, i.e. ∂1 ({b, c} + {a, c} + {a, b}) = {c} + {b} + {c} + {a} + {b} + {a} = 0, because the simplices cancel each other out. FIGURE 5: Calculating the boundaries of a 2-simplex and the boundary of a simplicial chain consisting of 1-simplices. Notice that the boundary of a boundary is always zero. This is a fundamental property of persistent homology. The figure is slightly adapted from Rieck [52]. Definition 4 (Homology group). We define the kth homology group of a simplicial complex K as Hk(K) := ker ∂k/ im ∂k+1, (8) i.e. a quotient group that we obtain from the two subgroups ker ∂k and im ∂k+1 of Ck. The kth homology group of a simplicial complex contains its k-dimensional topological features in the form of equivalence classes of simplicial chains, also known as homology classes. This rather abstract definition is best understood by an additional simplification step that involves calculating the rank of a homology group. Definition 5 (Betti number). The rank of the kth homology group Hk(K) is known as the kth Betti number, denoted by βk. Despite the rank being a rather coarse summary, Betti numbers turn out to be of immense utility in comparing different simplicial complexes. We may even reproduce Eq. (2) by noting that the Euler characteristic χ(K) := (cid:80) i(−1)i |{σ | dim σ = i}| can also be expressed as a sum of alternating Betti numbers, i.e. χ(K) := (cid:80) i(−1)iβi. For a proof of this surprising fact, see e.g. Munkres [46, p. 124]. Using this equivalence, we see that we can calculate β1 by reshuffling some of the terms, thus also explaining why Eq. (2) exhibits alternating signs. At this point, we have introduced a large amount of algebraic machinery. Changing our focus back to graphs, we may reap some advantageous properties by noting that homology groups are somewhat preserved under graph isomorphism.12 Lemma 1. Let G, G′ be two isomorphic graphs with φ : G → G′ their corresponding isomorphism. Then the homology groups of G and G′ are isomorphic, i.e. Hp(G) ≃ Hp(G′) for all p. Proof. This is a consequence of the functoriality of homology, which implies that any function f : G → G′ induces a function fp : Hp(G) → Hp(G′) on the homology level. This function has the property that it composes in a natural manner with any other function g : G → G′, namely (f ◦ g)p = fp ◦ gp. In other words, functoriality implies that the evaluation order does not matter, or, intuitively, that the induced function commutes with function evaluation. In our case, setting f = φ and g = φ−1, this implies that (φ ◦ φ−1)p = φp ◦ φ−1 p , with idp representing the identity function induced on the homology groups. The same calculations with f, g swapped show that the homology groups are isomorphic, with the isomorphism induced by φ, the isomorphism ■ between G and G′. p , i.e. idp = φp ◦ φ−1 As a direct corollary, the Betti numbers of G and G′ do not change, and in fact, a similar property holds for isomorphic simplicial complexes. This may be seen as a hint about the popularity of simplicial homology in algebraic topology: the framework leads directly to characteristic descriptions that remain invariant under (graph) isomorphism. C.2 Persistent Homology Because of their conceptual simplicity-their calculation in low dimensions only involves knowledge about the connected components of a graph-Betti numbers are somewhat limited in their expressivity. Taking any graph G = (V, E), even the addition of a single edge to G will change its Betti numbers, 12The reader well-versed in algebraic topology may be aware of this property directly, but we find it useful to mention this fact briefly. 16 either by merging two connected components (thus decreasing β0) or by creating an additional cycle (thus increasing β1). This is a direct consequence of Eq. (2), which, effectively, states that the insertion of a new edge e = (u, v) with u, v ∈ V either causes β1 to increase by 1 because m changes, or remain the same in case the number of connected components β0 changes. However, a single edge may only merge two connected components into one, so β0 may also at most decrease by 1. This indicates that Betti numbers are too coarse to be practically useful in large-scale graph analysis. It is possible to turn Betti numbers into a multi-scale descriptor of a graph. This requires certain modifications to the previously-introduced concepts. Similar to Appendix C.1, we will formulate everything in terms of simplicial complexes, again pointing out that this results in a more general description. Definition 6 (Filtration). Given a simplicial complex K, we call a sequence of simplicial complexes filtration if it affords a nesting property of the form ∅ = K0 ⊆ K1 ⊆ * * * ⊆ Km−1 ⊆ Km = K. (9) Since each element of this sequence is a valid simplicial complex, we can also think of this construction as 'growing' K by adding simplices one after the other. Filtrations arise naturally when building simplicial complexes from point cloud data, but even in the context of graphs, we can imagine filtrations as filtering a graph based on some type of data, or function, assigned to its vertices. For instance, we may build a filtration of a graph based on the degree of its vertices, defining Ki to be the subgraph consisting of all vertices satisfying the degree condition, plus all edges whose endpoints satisfy it, i.e. Ki := {v ∈ V | deg(v) ≤ i} ∪ {{u, v} ∈ E | deg(u) ≤ i ∧ deg(v) ≤ i}. (10) Notice that we could also express the second condition more compactly by assigning to each 1-simplex (each edge) the maximum of the weight of its vertices. This construction is sometimes also referred to as a lower-star filtration since it extends a node-level function to higher-order simplices [25]. Not all filtrations have to be defined on the vertex level; as long as each edge in the filtration is preceded by its vertices, we can also build valid filtrations from functions that are primarily defined on edges.13 Setting aside further discussions about how to obtain filtrations for now, filtrations are compatible with the simplicial homology framework introduced above. The boundary operators ∂(*), together with the inclusion homomorphism between consecutive simplicial complexes, induce a homomorphism between corresponding homology groups of any filtration of m simplicial complexes. Given i ≤ j, we write ιi,j : Hk(Ki) → Hk(Kj) to denote this homomorphism. This construction yields a sequence of homology groups 0 = Hk(K0) ι0,1 k−−→ Hk(K1) ι1,2 k−−→ . . . ιm−2,m−1 k−−−−−−→ Hk(Km−1) ιm−1,m k−−−−−→ Hk(Km) = Hk(K) (11) for every dimension k. We then define the kth persistent homology group as Hi,j d := ker ∂k(Ki)/(im ∂k+1(Kj) ∩ ker ∂k(Ki)), containing all topological features-homology classes-created in Ki that still exist in Kj. Following the definition of the ordinary Betti number, we then define the kth persistent Betti number to be the rank of this group, leading to βi,j k . It should be noted that this type of construction k makes use of numerous deep mathematical concepts; for the sake of an expository article, we heavily summarise and compress everything to the most pertinent results. := rank Hi,j (12) The appeal of persistent homology can be seen when we start to make use of the features it captures. If we assume that our filtration is associated with a set of values a0 ≤ a1 ≤ * * * ≤ am−1 ≤ am, such as the function values on the vertices, we can calculate persistence diagrams, i.e. simple topological feature descriptors. Definition 7 (Persistence diagram). The k-dimensional persistence diagram of a filtration is the multiset of points in R2 that, for each pair i, j with i ≤ j, stores the tuple (ai, aj) with multiplicity (cid:17) (cid:16) (cid:16) (cid:17) μ(k) i,j := βi,j−1 k − βi,j k − βi−1,j−1 k − βi−1,j k . (13) 13In Section 5, we will make use of a filtration defined on edge-based curvature values. 17 We will also assign a multiplicity to essential topological features of the simplicial complex, setting (14) which denotes all features that are still present in the last simplicial complex of the filtration, i.e. in Km = K. The persistence diagram thus contain all the information carried by Betti numbers. μ(k) i,∞ := βi,m k − βi−1,m k , Persistence diagrams summarise the topological activity of a filtration. Given a persistence diagram D, for any tuple (ai, aj), the quantity ∥aj − ai∥ is called the persistence of the respective topological feature. Persistence indicates whether a feature, created in some simplicial complex during the filtration, is prominent or not. This notion was originally introduced by Edelsbrunner, Letscher, and Zomorodian [27] to analyse the relevance of topological features of a distance function; the terminology is supposed to indicate the prominence of a topological feature. Features with a high persistence are commonly taken to be relevant, whereas features with a low persistence used to be considered as noise; this assumption is changing as, depending on the filtration, low persistence may also just imply 'low reliability.' [6] Persistence diagrams can be endowed with different metrics and kernels [38, 51], and it is known that the space of persistence diagrams is an Alexandrov space with curvature bounded from below [61]. The most common metric to compare two persistence diagrams is the bottleneck distance, defined as (15) dB(D, D′) := inf ∥x − η(x)∥∞, η : D→D′ sup x∈DD where η ranges over all bijections between the two persistence diagrams. Eq. (15) is solved using optimal transport; different cardinalities are handled by permitting points in one diagram to be transported to their corresponding projection on the diagonal. Another metric is the Wasserstein distance, in which the sup calculation is replaced by a weighted sum over all distances between points in a diagram. D Proofs For the convenience of the reader, we restate all results again before providing their proof. When working with filtrations in the subsequent proofs, it would be ideal to have filtrations that satisfy injectivity on the level of vertices, i.e. f (v) ̸= f (v′) if v ̸= v′. Such injective filtrations have the advantage of permitting gradient-based optimisation schemes [32]. The following lemma, first proved in Horn et al. [35], demonstrates that injectivity is not a strict requirement, though, as it is always possible to find an injective filtration function that is arbitrarily close (in the Hausdorff sense) to a non-injective filtration function. Lemma 2. For all ε > 0 and a filtration function f defined on the vertices, i.e. f : V → Rd, there is an injective function ̃f : V → Rd such that ∥f − ̃f ∥∞ < ε. Proof. Let V = {v1, . . . , vn} be the vertices of a graph and im f = {u1, . . . , um} be their images under f . Since f is not injective, we have m < n. We resolve non-injective vertex pairs iteratively. For u ∈ im f , let V ′ := {v ∈ V | f (v) = u}. If V ′ only contains a single element, we do not have to do anything. Otherwise, for each v′ ∈ V ′, pick a new value from Bε(u) \ im f , where Br(x) ⊂ Rd refers to the open ball of radius r around a point x (for d = 1, this becomes an open interval in R, but the same reasoning applies in higher dimensions). Since we only ever remove a finite number of points, such a new value always exists, and we can modify im f accordingly. The number of vertex pairs for which f is non-injective decreases by at least one in every iteration, hence after a finite number of iterations, we have modified f to obtain ̃f , an injective approximation to f . By always picking new values from balls of radius ε, we ensure that ∥f − ̃f ∥∞ < ε, as required. ■ Theorem 2. (∗) Let G ≃ G′ be two isomorphic graphs, and φ be the respective isomorphism. For any equivariant filtration f , the corresponding persistence diagrams are equal. Proof. Since G ≃ G′, there exists a permutation σ such that σ(G) = G′. Moreover, since f is equivariant, the image of G under f will just be permutation of vectorial coordinates. This, in turn, implies that all weights of vertices and edges of G are permuted. This does not change the calculation of persistent homology, though, because the ordering given by the filtration does not change. The ■ persistence diagrams of G and G′ thus coincide. 18 Theorem 3. (∗) Given any vertex-based filtration f of a graph G with a single connected component, we can upper-bound diam(G), the diameter of G, based on D0, the resulting persistence diagram in dimension 0. Proof. We can provide a procedure to obtain an upper bound d of diam(G) alongside the calculation of D0. To this end, we set d = 0. While calculating D0 with Algorithm 1, we check for each edge whether it is a creator or destroyer. If the edge is a destroyer, we stop. Else, we increase d by one. This procedure works because diam(G) is the diameter of the minimum spanning tree of G. Our estimate d counts the number of edges in such a tree. We thus have diam(G) ≤ d. The bound is tight ■ for some graphs, such as line graphs. Theorem 4. (∗) Given any vertex-based filtration f of a graph G, we can upper-bound the girth of G using the persistence diagrams in dimension 0 and 1. Proof. Similar to Theorem 3, we can use the calculation of D0, the persistence diagram in dimen- sion 0, of the filtration function to obtain an upper bound of the girth of the graph. We calculate D0 with Algorithm 1, checking once again for each edge whether it is a creator or destroyer. If the edge is a destroyer, we stop and set our upper bound of the girth g to be the number of vertices in the two connected components that are being merged by the destroyer edge. Since the addition of the respective edge is guaranteed to create a cycle-the edge is a destroyer-the cycle has to make use of at least two vertices of the respective connected components. Our estimate g thus constitutes an ■ upper bound of the girth of the graph. Theorem 6. Given 1-WL colourings of two graphs G and G′ that are different, there exists a filtration of G and G′ such that their persistence diagrams in dimension 0 are also different. Proof. Since the colourings are different, there is an iteration h of 1-WL such that the label sequences of G and G′ are different. We thus have at least one colour-equivalently, one label-whose count is different. Let L(h) := {l1, l2, . . . } be an enumeration of the finitely many hashed labels at iteration h. We can build a filtration function f by assigning a vertex v with label li to its index, i.e. f (v) := i, and setting f (v, w) := max {f (v), f (w)} for an edge (v, w). The resulting 0-dimensional persistence diagrams for G and G′, denoted by D0 and D′ 0, respectively, now contain tuples of the form (i, j). Moreover, each vertex is guaranteed to give rise to exactly one such pair since each vertex creates a connected component in 0-dimensional persistent homology. Letting μ(i,j)(D0) refer to the multiplicity of a tuple in D0, we know that, since the label count is different, there is at least one ■ 0). Hence, D0 ̸= D′ tuple (k, l) with μ(k,l)(D0) ̸= μ(k,l)(D′ 0. Theorem 5. (∗) Given k-FWL colourings of two graphs G and G′ that are different, there exists a filtration of G and G′ such that the corresponding persistence diagrams in dimension k − 1 or dimension k are different. Proof. The main idea involves harnessing the colours of k-tuples. We first identify all colours c1, c2, . . . with natural numbers 1, 2, . . . We then expand G and G′ to a simplicial complex that contains all k-tuples as its faces.14 Moreover, we assign all simplices in dimensions less than or equal to k − 2 a weight of 0. Each (k − 1)-simplex is assigned its colour according to the respective k-FWL colouring. As a consequence of the pairing lemma of persistent homology, every (k − 1)-simplex is either a creator simplex or a destroyer simplex [26]. We handle the case of creator simplices first. Each creator simplex gives rise to an essential persistence pair in the (k − 1)-dimensional persistence diagram. Each such pair is of the form (i, ∞), where ci is a colour according to k-FWL. Each destroyer simplex, by contrast, destroys a topological feature created by a (k − 2)-simplex, i.e. a (k − 1)-tuples, resulting in a pair of the form (*, j), with again cj being the corresponding k-FWL colour. This pair is part of a (k − 2)-dimensional persistence diagram. 14When dealing with tuples or simplices, there is always the risk of an off-by-one error. In this theorem, despite dealing with k-FWL, only the (k − 1)-simplices, which have k vertices, will be relevant. 19 By assumption, the k-FWL colours of G and G′ are different, so there must exist a colour c whose count is different in G and G′, respectively. Since the sum of all colours arising in the two types of persistence pairs above is the number of colours of k-tuples, there is either a difference in colour counts in the (k − 1)-dimensional or the (k − 2)-dimensional persistence diagrams of G and G′, ■ showing that they are not equal. E Topology and the Weisfeiler–Leman Hierarchy In the following, we want to briefly extend the argumentation of the expressivity of persistent homology with respect to the Weisfeiler–Leman hierarchy. Since 1-WL is oblivious to certain topological structures such as cycles [1], the existence of graphs with different Betti number counts proves that persistent homology is strictly more expressive than 1-WL. For example, consider a graph . This graph has β0 = β1 = 2 since it consists of two consisting of the union of two triangles, i.e. connected components and two cycles. If we change the connectivity slightly to obtain a hexagon, i.e. , we obtain a graph with β0 = β1 = 1. 1-WL is not able to distinguish between these graphs, but persistent homology can, since the Betti numbers of the graph are still encoded in the persistence diagram as essential features. Note that Theorem 6 does not apply to arbitrary filtrations since the theorem requires knowing the correct labels assigned by 1-WL. Finding filtration functions that are able to split graphs in a manner that is provably equivalent to 1-WL remains an open research question. 20
http://arxiv.org/abs/2302.09818v1
2023-02-20T07:46:14
2023-02-20T07:46:14
FormerTime: Hierarchical Multi-Scale Representations for Multivariate Time Series Classification
Deep learning-based algorithms, e.g., convolutional networks, have significantly facilitated multivariate time series classification (MTSC) task. Nevertheless, they suffer from the limitation in modeling long-range dependence due to the nature of convolution operations. Recent advancements have shown the potential of transformers to capture long-range dependence. However, it would incur severe issues, such as fixed scale representations, temporal-invariant and quadratic time complexity, with transformers directly applicable to the MTSC task because of the distinct properties of time series data. To tackle these issues, we propose FormerTime, an hierarchical representation model for improving the classification capacity for the MTSC task. In the proposed FormerTime, we employ a hierarchical network architecture to perform multi-scale feature maps. Besides, a novel transformer encoder is further designed, in which an efficient temporal reduction attention layer and a well-informed contextual positional encoding generating strategy are developed. To sum up, FormerTime exhibits three aspects of merits: (1) learning hierarchical multi-scale representations from time series data, (2) inheriting the strength of both transformers and convolutional networks, and (3) tacking the efficiency challenges incurred by the self-attention mechanism. Extensive experiments performed on $10$ publicly available datasets from UEA archive verify the superiorities of the FormerTime compared to previous competitive baselines.
[ "Mingyue Cheng", "Qi Liu", "Zhiding Liu", "Zhi Li", "Yucong Luo", "Enhong Chen" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09818v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09818v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
FormerTime: Hierarchical Multi-Scale Representations for Multivariate Time Series Classification Mingyue Cheng1, Qi Liu1∗, Zhiding Liu1, Zhi Li2, Yucong Luo1, Enhong Chen1 1Anhui Province Key Laboratory of Big Data Analysis and Application, University of Science and Technology of China & State Key Laboratory of Cognitive Intelligence, Hefei, China, 2 Shenzhen International Graduate School, Tsinghua University, Shenzhen, China {mycheng,doge,prime666}@mail.ustc.edu.cn,{qiliuql,cheneh}@ustc.edu.cn,[email protected] 3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 8 1 8 9 0 . 2 0 3 2 : v i X r a ABSTRACT Deep learning-based algorithms, e.g., convolutional networks, have significantly facilitated multivariate time series classification (MTSC) task. Nevertheless, they suffer from the limitation in modeling long- range dependence due to the nature of convolution operations. Recent advancements have shown the potential of transformers to capture long-range dependence. However, it would incur severe issues, such as fixed scale representations, temporal-invariant and quadratic time complexity, with transformers directly applicable to the MTSC task because of the distinct properties of time series data. To tackle these issues, we propose FormerTime, an hierarchical representation model for improving the classification capacity for the MTSC task. In the proposed FormerTime, we employ a hierar- chical network architecture to perform multi-scale feature maps. Besides, a novel transformer encoder is further designed, in which an efficient temporal reduction attention layer and a well-informed contextual positional encoding generating strategy are developed. To sum up, FormerTime exhibits three aspects of merits: (1) learn- ing hierarchical multi-scale representations from time series data, (2) inheriting the strength of both transformers and convolutional networks, and (3) tacking the efficiency challenges incurred by the self-attention mechanism. Extensive experiments performed on 10 publicly available datasets from UEA archive verify the superiorities of the FormerTime compared to previous competitive baselines. CCS CONCEPTS • Computing methodologies → Neural networks; • Mathe- matics of computing → Time series analysis. KEYWORDS Multivariate time series classification, Time series representations, Self-attention mdoels Qi Liu is corresponding author. Our experiment codes are available at https://github.com/Mingyue-Cheng/FormerTime. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. WWW '23, May 1–5, 2023, Austin, TX, USA © 2023 Copyright held by the owner/author(s). Publication rights licensed to ACM. ACM ISBN 978-1-4503-9416-1/23/04. . . $15.00 https://doi.org/10.1145/3543507.3583205 1 INTRODUCTION Multivariate time series [16, 20, 50] are ubiquitous for many web applications [35, 47], which are sequences of events acquired longi- tudinally and each event is constituted by observations recorded over multiple attributes. For example, the electrocardiogram (ECG) signals [33] in electronic health records (EHRs) can be formulated as multivariate time series data since they can be obtained over time and multiple sensors. Comprehensive analysis of such data can facilitate decision-making in real applications [27, 30], such as human activity recognition, healthcare monitoring, and indus- try detection. Particularly, multivariate time series classification (MTSC) tasks, as one fundamental problem of time series analysis, received significant attention in both academia and industry. Accordingly, numerous efforts [36, 49] have been devoted to the MTSC problem over the last decades. In general, most of these current works can be divided into two categories: pattern-based and feature-based models. The former type usually extracts useful bag-of-patterns or shapelet patterns from the whole time series, and then transforms these extracted patterns into features to be used as inputs for the classifier. Since they are generated in raw time series, the corresponding patterns are often interpretable. The main concern is the often-incurred expensive computation cost during the process of pattern extraction. In contrast, feature-based methods can be very efficient and can be scaled to large-scale time series data but their classification capacity greatly depends on the effectiveness of labor-intensive features based on domain experts. Hence, researchers begin to explore more expressive feature maps for improving classification capacity. Deep learning-based models [6, 17, 22, 24, 39, 49, 50] have achieved remarkable success and have become ever-increasingly prevalent over past advance- ments. The main reason is that discriminative features related to time series can be learned in an end-to-end manner, which sig- nificantly saves manual feature engineering efforts. Among them, convolutional-based methods nearly have become the dominant ap- proach due to the strong representation capacity of convolution op- erations [6, 31]. In general, the strengths of convolutional models in performing time series classification can be summarized as follows: (1) convolutional networks can easily learn multi-scale representa- tions by controlling the strides of convolutional kernels [42], and preserve the capacity of temporal-invariant via the weight-sharing mechanism, which are of great significance for MTSC tasks; (2) Very deep convolutional networks can be stacked by employing residual connections, enabling larger receptive fields for capturing the sequence dependence; (3) Convolution operations can be effi- ciently computed without suffering from limitations of sequence WWW '23, May 1–5, 2023, Austin, TX, USA Mingyue Cheng et al. length or instance number, and thus can be easily scaled to massive datasets. Despite their effectiveness, we argue that the classification performance is still restricted in failing to capture global contexts in convolution operation. Recently proposed transformer architecture [40, 44] have shown promising capacity in capturing global contexts for language mod- eling tasks. Motivated by this, we seek to transfer the powerful capacity of transformers from language domain to time series. How- ever, it would easily incur severe issues in applying the transformer to the MTSC problem. First, in language transformers, only fixed- scale representations can be learned since word tokens serve as the basic elements. By contrast, the information density of a single object in time series is too small to reflect helpful patterns related to class labels. Taking an example in ECG classification, informa- tive patterns are typically characterized by a series of continuous points or various sub-series instead of a single point. As such, multi- scale feature maps [37] are necessary and can take a significant influence on the classification capacity. Second, the capacity of temporal-invariant is largely weakened in vanilla transformers since self-attention is permutation-variant, which may also restrict the final performance [29]. Last, the sequence length of time se- ries usually can be much longer than language sentences, which inevitably incurs an expensive computation burden since the time and memory complexity of the self-attention mechanism in the transformer architecture is quadratic to the sequence length input. Though some pioneering efforts [26, 38, 48] based on transformers have been devoted before, the problems discussed above are still under exploration in the MTSC task. To tackle these severe issues, in this work, we present Former- Time, a hierarchical transformer network for the MTSC task. Specif- ically, we design a hierarchical structure by dividing the whole net- work into several different stages, with different levels of scales as input. We also develop a novel transformer encoder to perform hid- den transformation with two distinct characteristics: (1) we replace the standard self-attention mechanism with our newly designed temporal reduction version to save computation cost; (2) we design a context-aware positional encoding generator, which is designed to not only preserve the order of sequence input but also enhance the capacity of temporal-invariant of the whole model. In general, our FormerTime exhibits the following merits. First, in contrast to convolutional-based classifiers, FormerTime always yields a global reception field, which is useful for capturing the long-range depen- dence and interaction of the whole time series. Second, FormerTime can conveniently learn time series representations on various scales via its hierarchical architecture. Third, in the FormerTime, the in- ductive bias of temporal-invariant is well enhanced by leveraging the contextual positional generators. More importantly, the compu- tation consumption of FormerTime is largely saved, and could be acceptable even for very long sequences. To evaluate the effectiveness of the FormerTime, we conduct extensive empirical studies on 10 public datasets from the UEA archive [2]. The experimental results clearly show that FormerTime can yield strong classification performance in average. It signifi- cantly outperforms compared strong baselines. In summary, we initially demonstrate the potential of transformers in the MTSC problem. To the best of our knowledge, we first the few attempts of transformer-based models in breaking the efficiency bottleneck and achieving great performance improvements. We hope our work can facilitate the study of applying transformers to the MTSC problem. 2 RELATED WORK 2.1 Time Series Classification Tremendous efforts have been devoted to time series classification. Generally speaking, previous works can be roughly divided into two types: pattern-based and feature-based methods. Pattern-based methods typically first extract bag-of-patterns [34] or shapelet patterns [46], and then feed them into a classifier. For example, shapelet-based methods usually extract some useful subsequence, which is distinctive for different classes. Then, distance metrics are employed to generate features for classification. DTW has been proved as an effective distance measurement in time series classifi- cation. Recently proposed work [34] uses symbolic Fourier approx- imation to generate discrete units for classification. The strength of these methods is that the generative patterns are usually in- terpretable [10] while the largest weakness [3, 49] is inevitablely incurring expensive computation in producing discriminative pat- ter features. A series of methods have been proposed to overcome this weakness by either speeding up the computation of distance or constructing the dictionary [46]. In contrast to pattern-based methods, feature-based methods can be more efficient by depending on hand-crafted static features based on domain experts. However, it is difficult to design good features to capture intrinsic proper- ties embedded in various time series data. Therefore, the accuracy of feature-based methods is usually worse than that of sequence distance-based ones. Recently, extracting time series feature with deep neural networks [22, 24, 50] gradually become prevalent in time series classification tasks. As a pioneering attempt, multi- channel convolutional networks [50] have been proposed to deal to capacity of classification for the MTSC problem. Later, a series of convolutional-based methods, like ResNet [19], InceptionTime [23] have also proposed to achieve remarkable success due to their powerful representation ability in extracting time series features. ROCKET [12] employs random convolution kernels to train linear classifiers and has been recognized as a powerful method in recent empirical studies [31]. Other than pure convolutional based meth- ods, [24] perform time series classification by designing a hybrid network, in which both the LSTM layer and stacked convolutional layer along with a squeeze-and-excitation block are simultaneously used to extract features. Besides, mining graph structure among time series with graph convolutional networks for comprehensive analysis have also attracted some researchers [15, 45]. 2.2 Transformers in Time Series. Designed for sequence modeling, the transformer network [40] re- cently achieves great success in nature language processing (NLP). Among multiple advantages of transformers, the ability to capture long-range dependencies and interactions is especially attractive for time series modeling. Hence, a large body of transformer-based methods [43, 51] has been proposed by attempting leveraging trans- formers for time series forecasting or regression. For time series classification, recent advancements still lie in the early stage and mainly focus on multivariate time series classification. [32] studies the transformer for raw optical satellite time series classification FormerTime: Hierarchical Multi-Scale Representations for Multivariate Time Series Classification WWW '23, May 1–5, 2023, Austin, TX, USA and obtains the latest results comparing with convolution-based so- lutions. GTN [26] explores an extension of the transformer network by modeling both channel-wise and step-wise correlations, simulta- neously. Besides, pre-trained transformers are also investigated in time series classification tasks. For example, TST [48] employs the transformer network to learn unsupervised representations of time series so as to alleviate the data sparsity issue. Despite their effec- tiveness, both the efficiency issues incurred by the self-attention and the properties of time series classification task are largely ig- nored in these current works. Although some prior works focusing on improving the efficiency of self-attention were developed [38], these works mainly use heuristic strategies to perform sparse at- tention computation without global context modeling. In this work, we aim to tackle the efficiency bottleneck and achieve performance improvements in the proposed FormerTime. 3 THE FORMERTIME MODEL In this section, we first formally introduce the definition of multi- variate time series classification (MTSC) problem. Then, we intro- duce the overall architecture of our designed FormerTime. After that, we elaborate the FormerTime via respectively introducing two aspects of key designs, i.e., the hierarchical architecture and the de- signed transformer encoder. Finally, we demonstrate the difference between the FormerTime and other relative methods. 3.1 Problem Definitions We introduce the definitions and notations used in the following. D = (X 1, y1), (X 2, y2), ..., (X n, yn) is a dataset containing a collec- tion of pairs (X i, yi ), in which n denotes the number of examples and X i denote a multivariate time series with its corresponding la- bel denoted by yi . Each multivariate time series X = [x1, x2, ..., xl ] contains l ordered elements with m dimensions in each time step. The task of multivariate time series classification is to learn a clas- sifier on D so as to map from the space of inputs X to a probability distribution over the class y. 3.2 Model Architecture Overview An overview of the FormerTime is depicted in Figure 1. The input of the whole model is a set of multivariate time series, involv- ing multiple dimensions (a.k.a. channels). For each dimension, the time series share the same sequence length. To produce multi-scale representations for time series data, we adopt a hierarchical archi- tecture. Specifically, we divide the whole deep network architecture into multiple different stages so as to generate feature maps on various time scales. For simplicity, all stages share a similar archi- tecture, which is composed of a temporal slice partition processing operation and successive Li our designed transformer encoder lay- ers. Relying upon such hierarchical architecture, the time series representation on various scales can be effectively extracted. Mean- while, we use the mean pooling operation over the representation of each temporal point to denote the time series representations. The model's output is the predicted distribution of each possible label class for the given input time series. The FormerTime model can be trained end-to-end by minimizing the cross-entropy loss [7], and the loss is propagated back from the prediction output across the entire network. The following sections would mainly introduce several key designs in the FormerTime. 3.3 Multi-scale Time Series Representations Integrating information on different time scales [5] is essential to the classification capacity in the MTSC task. However, the vanilla transformer model only can produce fixed-scale representations of the sequence input. Thus, we devise a hierarchical architecture for learning time series representations on various time scales. The key idea is that the whole model is divided into several stages so as to hierarchically performing feature maps. Here, we vary the time scale input for different stages by leveraging a temporal slice partition strategy, i.e., aggregating successive neighborhood points with a window slicing operation. Specifically, suppose that we have sequence input X = {x1, x2, ...xl } in stage j, and the window slicing size is s j , which denotes the scale size of the processed time series. Every s j successive points will be grouped into a new temporal slice. Considering the semantic gap issue, we then feed these temporal slices to a trainable linear projection layer to project this raw feature to a new dimension C j . Notably, the weights of this linear projection layer is weight-shared, in which we use d j to denote the stride of projection operations. To some extent, these temporal slices can be regarded as the "tokens" of new time series, analogous to the relationship between word and whole speech input. Assume that the whole model is divided into three stages, and the fine-grained raw time series can be processed into a new granularity version, which contains l slices and each s1 size is s1 × m. Then, the linear projection layer project it into a new ×C1 . dimension C1, and the output is reshaped to size of F1 ∈ R After that, the normalized embeddings of each temporal slice along with its positional embeddings are fed into the transformer encoder with L1 layers. In the same manner, by using the feature maps of the previous stage's output as the input of the next stage, differ- ent scales of time series representations, denoted by Fj , can be effectively learned by stage-wise propagation. l s1 The primary motivation is the information density difference between time series and language domain. Unlike the tokens in language data, which are human-generated signals and highly se- mantic and information-intensive, the time series are naturally redundant, e.g., a missing point can be easily recovered from its neighbors. The benefits of adopting temporal slice operation are two-fold. First, the time scales of sequence data can be flexibly transformed, naturally forcing the network to generate hierarchical feature maps. Second, with this partitioning strategy, the sequence length of the whole time series can be largely reduced before sent into the encoder, saving an amount of computation consumption. 3.4 The Transformer Encoder Network In this subsection, we will introduce our designed encoder to extract the robust global contexts of the whole sequence input. 3.4.1 Temporal Reduction Attention. To capture the global contexts of the whole time series, we would like to benefit from regarding the transformer network as the encoder to perform non-linear hidden representation transformation. One of the core designs of WWW '23, May 1–5, 2023, Austin, TX, USA Mingyue Cheng et al. Figure 1: Illustration of the FormerTime, i.e., a efficient hierarchical transformer architecture for the MTSC task. the vanilla transformer network is to employ a multi-head self- attention mechanism. Each temporal point needs to be computed the attention scores among all other sequence points with the inner product so as to capture the long-range dependence. However, the computation complexity incurred by the attention operation can be very heavy, growing quadratically in the sequence length of the input sequence. Unlike language data, the sequence length of time series data regularly can be very long to uncover the event of classification tasks. Directly leveraging the standard attention computation strategy is memory-expensive, making it hard for transformers to be applicable in time series. To solve this dilemma, inspired by recent works [41], we present a novel attention computation strategy named temporal reduction attention (TRA) mechanism to replace the vanilla self-attention strategy. The core idea of TRA is to compute the attention with a sub-sampled version of all input points. To be more specific, similar to standard self-attention, our TRA receives a query Q, a key K, and a value V as input, and outputs a refined feature. Details of TRA operation in stage j can be formulated as follows: TRA(Q, K, V) = Concat(head0, ..., headNj )WO, in which the Concat denotes the concatenation operation, and Ni is the number of heads in the attention layer. (1) headj = Attention(QWQ j , TR(K)WK j , TR(V)WV j ), (2) ∈ RCj×dhead, WK where WQ j ∈ RCj×dhead are j linear projection parameters. In this way, the dimension of each head is equal to Cj . Here, TR indicates the temporal reduction on N j K and V , which can be written as j ∈ RCj×dhead, WV TR(x) = Norm(Reshape(x, Rj)WT), where x ∈ Rl j ×C j represents a input sequence, and Ri denotes the reduction ratio of the attention layers in stage j. Reshape(x, Rj) is an operation of reshaping the input sequence x to a sequence of size Lj and WT is a linear projection that reduces the dimension R j of the input sequence to C j . Here, we employ layer normalization operation [40] to implement Norm. Like the original attention (3) computation mechanism, our Attention(*) can be represented as Attention(q, k, v) = softmax( √ qk⊺ dhead )v. (4) In this way, the computational cost of our attention operation is 1 of standard self-attention, so our TRA can handle longer input Ri feature maps/sequences without requiring too many resources. The main difference between our TRA and the prior version is that our TRA reduces the temporal scale of K and value V before the attention operation, largely reducing the computational/memory overhead. Note that the capacity of global context modeling is still well-remained in our attention layer. 3.4.2 Contextual Positional Encoding. As claimed in [9, 40], posi- tional information is a key operation in the success of the trans- former network. The main reason is that the self-attention operation can be used to preserve the order of the sequence property of in- put data. Two types of position information in transformers have been widely adopted, including absolute and relative encodings, which respectively denote static and learnable embeddings. For the former type, absolute temporal information provides helpful cues for whenever the object would appear in the whole time se- ries. Despite its effectiveness, it severely weakens the capacity of temporal-invariant since each temporal slice is added with a unique positional encoding. In fact, the temporal invariance plays a sig- nificant role in time series classification tasks since we hope the model to release the same response whenever the discriminative pattern appears in the time series. Though relative positional en- codings can greatly alleviate the aforementioned issues, the relative encodings lack absolute position information, which is important in classification tasks [9, 21]. Previous works have uncovered that one of the main merits of such positional information is that absolute information can be added for enhancing classification performance. Besides, we also argue that these two types of positional infor- mation actually model each temporal slice individually and only achieve sub-optimal performance because that extracted patterns from time series evolve in time and highly depend on their sur- rounding points. QKVFFNTemporalSliceNormTemporalReductionContextualPositionalInformationLinearProjectionLayerMultivariateTimeSeriesTemporalSliceTransformerEncoderNetworkStage1Multi-HeadSelf-AttentionTemporalSliceTransformerEncoderNetworkStage2TemporalSliceTransformerEncoderNetworkStage3Element-wiseAddContextualPositionalInformationMeanPoolingLossTransformerEncoderNetwork FormerTime: Hierarchical Multi-Scale Representations for Multivariate Time Series Classification WWW '23, May 1–5, 2023, Austin, TX, USA Based on the above analysis, we hold that the well-informed po- sitional information should possess two aspects of characteristics. First, making the input sequence permutation-variant but temporal- invariant is a necessity for time series classification. Second, having the ability to provide absolute information also matters. To fulfill the two demands, we find that characterizing the contextual infor- mation among neighboring temporal slices can be sufficient. As shown in Figure 1, we use 1-D convolutional kernel size k along with k zero paddings to extract the localized contextual informa- 2 tion as positional encodings. Note that the zero padding is vital to make the model aware of the absolute position information. 3.4.3 Entire Transformer Encoder Network. Based on the designed temporal reduction attention mechanism and context positional encodings, we organize them together to form a novel transformer encoder block for learning the time series representations. We give a sketch of the newly designed encoder at the bottom of Figure 1. On the basis of the design of standard transformer encoder [40], the entire encoder is composed of successive layers of the TRA layer and followed by a feed-forward neural network (FFN) layer. These two layers are further wrapped with a residual connection to avoid the the vanishing gradient problem. Particularly, we set a trainable parameter α, initialized with zero, according to the previ- ous work [1]. Such a simple trick can further help the FormerTime converge more stable. 3.5 Summary and Remarks In the following, we summarize the characteristics of FormerTime and discuss its relations to transformer-based and convolutional- based approaches in the multivariate time series classification. Relation to Transformer-based Models. Transformer architecture has shown its superiority in global sequence modeling tasks. How- ever, the dot-product computation in self-attention easily incurs quadratic computation and memory consumption on sequence in- put. Hence, the efficiency of the transformer architecture becomes the bottleneck of applying them to time series classification tasks. Besides, the vanilla transformer model lacks some key designs of inductive bias, such as multi-scale representation and temporal in- variance, which can greatly benefit the time series classification task. Although some prior works of efficient transformer variants [38] have been proposed, they fail to solve these two aspects of limita- tions, simultaneously. In contrast, the proposed FormerTime not only breaks the bottleneck of efficiency but also achieves perfor- mance improvements in the MTSC task. Relation to Convolutional-based Models. Recently, researchers have demonstrated the extremely expressive capacity of convolu- tional models in MTSC tasks. In fact, convolutional networks can yield several aspects of strength: 1) their memory and time complex- ity in feature extraction are not constrained by the sequence length of the sequence input, 2) they can easily learn time series with various scales of feature maps with varying strides and preserve the prior capacity of temporal-invariant with the weight-sharing mechanism for the classification task. However, convolution opera- tion cannot achieve a global receptive field of whole sequence input while the global context information is vital for the classification capacity. Our proposed FormerTime not only absorbs the strength Table 1: Statics of datasets in the experiments. Dataset Train Size Test Size Dimensions Length Classes AWR AF CT CR FD FM MI SRS1 SRS2 UWG 144 640 182 1,197 62 50 3,000 896 1,152 315 300 15 1,436 72 3,524 100 100 293 180 320 275 15 1,422 108 5,890 316 278 268 200 120 9 2 3 6 144 28 64 6 7 3 25 3 20 12 2 2 2 2 2 8 of convolutional models but also meets the demands of long-range dependence modeling. 4 EXPERIMENTS 4.1 Experimental Setup 4.1.1 Datasets. We perform all experiments by conducting exper- iments on ten public datasets, which are selected from the well- known UEA multivariate time series classification (MTSC) archive. In reality, the UEA archive has become nearly the most widely used multivariate time series benchmarks. We select a set of 10 multivariate datasets from the UEA archive [2] with diverse char- acteristics in terms of the number, and the length of time series samples, as well as the number of classes. Specifically, we choose: ArticularyWordRecognition (AWR), Atrial Fibrillation (AF), Charac- terTrajectories (CT), Cricket, FaceDetection (FD), FingerMovements (FM), MotorImagery(MI), SelfRegulationSCP1 (SRS1), SelfRegula- tionSCP2 (SRS2), UWaveGestureLibrary (UW). In these original dataset, training and testing set have been well processed. We do not take any processing for these datasets for a fair comparison. We summarize the main characteristics of dataset in Table 1. 4.1.2 Compared Baselines. For comprehensive evaluation, we choose the following prevalent baseline methods for evaluation: Shapelet Transformation (ST) [25], Learning Shapelet (LS) [18], TST [48], GTN [26], Informer [51], MCDCNN [50], MCNN [11], ResNet [19], TCN [4], InceptionTime (IT) [23], MiniROCKET (MR) [13]. Among them, ST and LS are two shapelet-based methods. TST and GTN are two transformer-based models proposed for time series clas- sification. Though Informer is originally proposed for time series forecasting, we also treat it as a competitive baseline to verify the ef- fectiveness of our FormerTime. In addition, the remaining compared baselines are convolutional-based models applied to the MTSC prob- lem. Note that some traditional classifiers [28] are not considered here, since it is difficult to construct hand-crafted features for all time series. Also, we do not choose well-known distance-based methods, like HIVE-COTE [28], as baseline due to their expensive computation consumption. We adopt accuracy as the metric. Implement Details. For learning shapelet (LS), we adopt the 4.1.3 codes in 1 while adopting the publicly available codes 2 to run shapelet transformation (ST). To implement GTN, we use the source code provided by the corresponding authors 3. We implement TST by strictly following the network architecture settings of original 1https://tslearn.readthedocs.io/ 2https://pyts.readthedocs.io/ 3https://github.com/ZZUFaceBookDL/GTN WWW '23, May 1–5, 2023, Austin, TX, USA Mingyue Cheng et al. Table 2: Detailed Hyper-parameter settings of the proposed FormerTime. Datasets AWR AF CT CR FD FM MI SRS1 SRS2 UWG Stage 1 Temporal Slice s_1=2,C_1=64,d_1=2 s_1=16,C_1=64,d_1=8 s_1=16,C_1=64,d_1=8 s_1=8,C_1=64,d_1=8 s_1=2,C_1=64,d_1=2 s_1=4,C_1=64,d_1=4 s_1=8,C_1=64,d_1=8 s_1=2,C_1=64,d_1=2 s_1=16,C_1=64,d_1=8 s_1=8,C_1=64,d_1=8 Encoder L_1=6 R_1=2 N_1=4 Stage 2 Temporal Slice s_2=2,C_2=64,d_2=2 s_2=2,C_2=64,d_2=2 s_2=2,C_2=64,d_2=2 s_2=2,C_2=64,d_2=2 s_2=2,C_2=64,d_2=2 s_2=2,C_2=64,d_2=2 s_2=2,C_2=64,d_2=2 s_2=2,C_2=64,d_2=2 s_2=2,C_2=64,d_2=2 s_2=2,C_2=64,d_2=2 Encoder L_2=6 R_2=2 N_2=4 Stage 3 Temporal Slice s_3=2,C_3=64,d_3=2 s_3=2,C_3=64,d_3=2 s_3=2,C_3=64,d_3=2 s_3=2,C_3=64,d_3=2 s_3=2,C_3=64,d_3=2 s_3=2,C_3=64,d_3=2 s_3=2,C_3=64,d_3=2 s_3=2,C_3=64,d_3=2 s_3=2,C_3=64,d_3=2 s_3=2,C_3=64,d_3=2 Encoder L_3=6 R_3=1 N_3=4 Table 3: Classification performance of compared methods in ten datasets. Bold numbers represent the best results. Datasets IT LS ST MCDCNN TCN MCNN ResNet MR TST GTN Informer Ours AWR AF CT CR FD FM MI SRS1 SRS2 UWG Average MACs (M) 0.9827 0.4400 0.9983 0.9889 0.6820 0.6000 0.5860 0.8942 0.5689 0.8869 0.7628 89 0.9127 0.2533 0.9866 0.9639 0.5129 0.4840 0.5180 0.7038 0.5111 0.8031 0.6649 - 0.8700 0.2667 0.7224 0.9722 0.5085 0.4940 0.6100 0.6724 0.5300 0.7769 0.6423 - 0.7800 0.3733 0.8826 0.6278 0.5000 0.5920 0.5000 0.9079 0.5256 0.8438 0.6533 263 0.9467 0.4933 0.9915 0.9083 0.6801 0.5880 0.6040 0.9031 0.5978 0.7981 0.7511 283 0.8200 0.3467 0.9238 0.9167 0.6747 0.5920 0.5980 0.8949 0.5989 0.8044 0.7170 929 0.9827 0.4000 0.9965 0.9972 0.5760 0.6080 0.5780 0.8730 0.5622 0.7994 0.7373 132 0.9720 0.3333 0.9876 0.9806 0.6065 0.6380 0.5640 0.9352 0.5411 0.9075 0.7466 - 0.9789 0.4000 0.9882 0.9583 0.6005 0.5900 N/A 0.8771 0.5796 0.8271 0.7555 408 0.9767 0.4000 0.9783 0.7917 0.5542 0.5350 N/A 0.8019 0.5611 0.8406 0.7155 1,565 0.9820 0.4267 0.9862 0.9778 0.5265 0.6120 0.6240 0.9188 0.5767 0.8363 0.7467 141 0.9847 0.6000 0.9914 0.9806 0.6872 0.6180 0.6320 0.8867 0.5922 0.8881 0.7861 98 works using PyTorch. We replace the decoder in Informer4 with a linear classifier layer so as to adapt it for MTSC tasks. The remain- ing baselines' code consistently leverages the codes in 5. For full reproducibility of the experiments, we release our codes and make it available 6. The specific hyper-parameters of our FormerTime are listed as follows: • s j : the temporal slice size of stage j; • C j : the hidden size of the output in stage j; • d j : the stride size of window slicing operation of stage j; • Lj : the number of transformer encoders in stage j; • R j : the temporal reduction rate in stage j; • N j : the number of attention heads of temporal reduction attention in stage j. More details of hyper-parameter settings in FormerTime for specific datasets can be found in Table 2. For common hyper-parameters of all models, we set the embedding size as 64. The initialized learning rate is set to 1 × 10−3 without additional processing, and we employ Adam optimizer to guide all model training. All other hyper-parameters and initialization strategies either follow the suggestions from the original works' authors or are tuned on testing datasets. We report the results of each baseline under its optimal hyper-parameter settings. For a fair comparison, all models are trained on the training set and report the accuracy score on the 4https://github.com/zhouhaoyi/Informer2020 5https://timeseriesai.github.io/tsai/ 6https://anonymous.4open.science/r/FormerTime-A17E/ Figure 2: Critical difference diagram over the mean ranks of FormerTime, baseline methods. testing set. All models are trained until achieving the best results. All experiments in our work are repeated for 5 times with 5 different seeds, and we reported the mean value score. 4.2 Experimental Results 4.2.1 Classification Performance Evaluation. Table 3 summarizes the classification accuracy of all compared methods while Figure 2 reports the critical difference diagram as presented in [14]. The results of "N/A" indicates that the corresponding results cannot be run due to the out-of-memory issue. Overall, the accuracy of our proposed FormerTime could outperform previous classifiers on average. Such results demonstrate the success of FormerTime in enhancing the classification capacity in the MTSC problem. For each dataset, the classification performance of FormerTime is either the most accurate one or very close to the best one. These existing proposed models typically cannot always achieve the most distinct results. One may wonder whether the FormerTime can be effective enough. However, the experimental results are largely consistent FormerTime: Hierarchical Multi-Scale Representations for Multivariate Time Series Classification WWW '23, May 1–5, 2023, Austin, TX, USA Table 4: Experimental results w.r.t. studying the hyper- parameter sensitivity with varying stages. Table 5: Experimental results w.r.t. studying the hyper- parameter sensitivity w.r.t. temporal slice size. Datasets AWR AF CT CR FD FM MI SRS1 SRS2 UWG Averge 1 0.9811 0.4222 0.9907 0.9861 0.6750 0.6200 0.6200 0.8760 0.5722 0.9021 0.7645 2 0.9811 0.4667 0.9909 0.9815 0.6793 0.6033 0.6267 0.8692 0.5815 0.8948 0.7675 3 0.9720 0.6000 0.9914 0.9806 0.6776 0.6140 0.6280 0.8771 0.5922 0.8844 0.7817 4 0.9767 0.5778 0.9902 0.9769 0.6748 0.6067 0.6133 0.8840 0.5889 0.8844 0.7774 Datasets AWR AF CT CR FD FM MI SRS1 SRS2 UWG Averge [16,32,64] 0.9720 0.6000 0.9914 0.9806 0.6776 0.6140 0.6280 0.8771 0.5922 0.8844 0.7817 [8,16,32] 0.9740 0.5600 0.9886 0.9806 0.6794 0.6080 0.6280 0.8826 0.5811 0.8881 0.7770 [4,8,16] 0.9820 0.4267 0.9868 0.9778 0.6823 0.6180 0.6160 0.8710 0.5856 0.8781 0.7624 [2,4,8] 0.9847 0.4400 0.9873 0.9667 0.6872 0.6040 0.6180 0.8867 0.5600 0.8775 0.7612 with previous empirical studies [3, 31], i.e., one single model cannot always achieve superior performances in all scenarios. In particular, we observe that FormerTime could surpass other baselines to a large margin in datasets of AF and MI, in which the sequence length of these two datasets is very long. We guess that our temporal slice setting can be very robust for these two datasets. For these baseline approaches, we observe that convolutional- based methods, like MR, exhibit strong classification performances in some datasets, which is analogous to the experimental results of recent empirical studies [31]. We hold the characteristics of multi- scale representation and temporal invariance of the convolution operations make a great contribution. Besides, in MR, the feature of PPV, denoting the proportion of positive values of extracted deep representations, also matters. However, for transformer-based clas- sifiers, it seems that the performance cannot always outperform convolutional algorithms. We guess the main reason behind the per- formance is that: (1) the plain transformer architecture fails to learn hierarchical feature maps from time series data, and (2) the naive po- sitional information might not be suitable for modeling time series since the semantic information of one single temporal point indi- vidually modeled. Besides, compared to these deep learning-based methods, shapelet-based methods exhibit the worst classification performance due to a lack of poor representation capacity. However, in shapelet-based approaches, interpretable sub-sequence patterns can be extracted to make the model more understandable, which is vital in some applications. In time series classification tasks, model efficiency has always been an important concern. Here, we also show the computation cost by recording MACs7 of compared methods. Note that only methods trained with end-to-end manner are reported. Though we adopt a self-attention operation, the computation cost of our methods can be very economical. Particularly, compared to the standard transformer network, our proposed FormerTime could significantly save computation costs. The main reason could be attributed to two aspects: 1) we model the raw time series with hierarchical architecture, which significantly shorten the sequence length, and 2) we develop a temporal reduction layer to ensure each input point can attend to all other data points. 7https://github.com/Lyken17/pytorch-OpCounter Table 6: Experimental results w.r.t. studying the effective- ness of contextual positional embeddings. None 0.9433 0.4667 0.9821 0.9815 0.6740 0.5900 0.6233 0.8635 0.5704 0.8479 0.7543 Learnable 0.9811 0.5556 0.9863 0.9769 0.6774 0.6200 0.6167 0.8749 0.6018 0.8677 0.7758 Datasets AWR AF CT CR FD FM MI SRS1 SRS2 UWG Averge Static 0.9822 0.5111 0.9902 0.9676 0.6804 0.5867 0.5833 0.8817 0.5759 0.8729 0.7632 Ours 0.9720 0.6000 0.9914 0.9806 0.6776 0.6140 0.6280 0.8771 0.5922 0.8844 0.7817 Study of Multi-scale Representations. In this part, we decide 4.2.2 to study the effectiveness of hierarchical feature maps in Former- Time by setting different types of model variants w.r.t. the different number of stages. Specifically, we report the average classification experimental results of ten datasets in Table 4, varying the num- ber of stages from 1 to 4. Note that the total number of layers is consistent in these model variants to eliminate the other influence factors. From the reported results, we observe that feature maps at various scales can indeed perform much better than the single-scale representation versions. Such results demonstrate the importance of multi-scale representation in time series classification tasks. Fur- thermore, we also empirically analyze the effectiveness of hierarchi- cal structure by performing hyper-parameter sensitivity analysis on the size of window slicing in temporal slice partition. The average accuracy of ten datasets is recorded in Table 5. An attractive ex- perimental phenomenon is that FormerTime equipped with a large slice size yields more promising results. We guess that the semantic information of a smaller temporal slice is too small to characterize discriminative patterns of distinguishing other examples. Study of Positional Information Encoding. In the following, 4.2.3 we would like to empirically verify the effectiveness of contextual positional information. A natural choice is to replace the contex- tual embedding with static or learnable version [40], respectively. Moreover, we also evaluate the results of FormerTime without lever- aging any forms of positional embedding information. The average experimental results conducted on ten datasets are shown in Ta- ble 6. From these results, we notice that FormerTime equipped with WWW '23, May 1–5, 2023, Austin, TX, USA Mingyue Cheng et al. Figure 3: Normalized attention score from the first encoder block of the first stage in FormerTime: (1) without taking positional information into account, (2) using static embeddings, (3) using learnable vectors, (4) using our contextual embeddings. Figure 4: Left plot: Visualization of the t-SNE result of the embedding layer output on the AF dataset. Right plot: visu- alization of sub-sequences on raw time series data. contextual positional information could surpass all other model variants, verifying the effectiveness of extracting contextual infor- mation as positional encodings. Also, FormerTime's performance dramatically degrades while absolutely discarding the positional information. We believe this is reasonable because self-attention computation is permutation-variant, whose performance would dramatically degrade if discarding the positional information. To further deeply understand the scheme of several types of positional encoding, we choose one sample from SRS1 data to visualize the attention weights of corresponding model variants. As shown in Figure 3, unlike the widely adopted static and learnable positional embeddings, more specific attention map patterns could be well learned by our contextual positional information generating strate- gies. Also, it seems that most of the temporal slices would produce uniform attention weights if we remove the positional informa- tion. We believe these visualized cases further demonstrate the effectiveness of our contextual information-generating strategies. 4.2.4 Analyzing Semantic of Time Series Slice Representations. In this part, we aim to analyze the semantic descriptions of constructed temporal slices encoded by the embedding layer. To achieve this goal, we apply t-SNE to reduce the embedding of each temporal slice on an example selected from AF datasets. For better understanding, we further map each temporal slice to the raw time series. As shown in Figure 4, we find that the similarity of raw time series data is well-maintained in projected vector space. Such results reflect that the semantics of time series can be accurately represented by their corresponding latent representations. We also observe that the temporal slice nearby in the vector space forms some successive sub- sequences (a.k.a. shapelets) in raw time series. This phenomenon indicates that the embedding learned by the FormerTime retains the potential of preserving the strength of shapelet-based methods. Figure 5: Visualization of the representation of whole time series on the SRS1 (left plot) and UW (right plot) datasets, extracted by pooling operation from the last hidden layer. 4.2.5 Visualization of the Extracted Embeddings. As shown in Fig- ure 5, we visualize the extracted feature vector from FormerTime by applying t-SNE to reduce the dimension. Here, we randomly choose examples from SRS1 and UWG datasets. In this figure, each point denotes an example and the same color denotes the corresponding original class labels. This figure suggests that the proposed Former- Time is able to project the data into an easily separable space to ensure good classification results. 5 CONCLUSION In this work, instead of employing the prevalent convolutional architecture as the main backbones, we proposed FormerTime, a hierarchical transformer network for MTSC tasks. In FormerTime, both the strengths of transformers and CNNs were well absorbed in a unified model for further improving the classification capacity. Specifically, two aspects of vital inductive bias, including multi- scale time series representations and temporal-invariant capacity, are incorporated for enhancing the classification capacity in the MTSC task. Moreover, the terrible computation dilemma incurred by the self-attention mechanism was largely overcome in the pro- posed FormerTime, whose computation costs are acceptable for very long-sequence time series and large-scale data. Extensive ex- periments conducted on 10 publicly available datasets from the UEA archive demonstrated that FormerTime could surpass previ- ous strong baseline methods. In the future, we hope to empower the transferability of FormerTime [8]. ACKNOWLEDGMENTS This research was partially supported by grants from the National Key Research and Development Program of China (No. 2021YFF0901003) w/opositionalembeddingsw/staticembeddingsw/learnableembeddingsw/contextualembeddings FormerTime: Hierarchical Multi-Scale Representations for Multivariate Time Series Classification WWW '23, May 1–5, 2023, Austin, TX, USA REFERENCES [1] Thomas Bachlechner, Bodhisattwa Prasad Majumder, Henry Mao, Gary Cottrell, and Julian McAuley. 2021. Rezero is all you need: Fast convergence at large depth. In Uncertainty in Artificial Intelligence. PMLR, 1352–1361. [2] Anthony Bagnall, Hoang Anh Dau, Jason Lines, Michael Flynn, James Large, Aaron Bostrom, Paul Southam, and Eamonn Keogh. 2018. The UEA multivariate time series classification archive, 2018. arXiv preprint arXiv:1811.00075 (2018). [3] Anthony Bagnall, Jason Lines, Aaron Bostrom, James Large, and Eamonn Keogh. 2017. The great time series classification bake off: a review and experimental evaluation of recent algorithmic advances. Data mining and knowledge discovery 31, 3 (2017), 606–660. [4] Shaojie Bai, J Zico Kolter, and Vladlen Koltun. 2018. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271 (2018). [5] Wei Chen and Ke Shi. 2021. Multi-scale Attention Convolutional Neural Network for time series classification. Neural Networks 136 (2021), 126–140. [6] Mingyue Cheng, Zhiding Liu, Qi Liu, Shenyang Ge, and Enhong Chen. 2022. Towards Automatic Discovering of Deep Hybrid Network Architecture for Se- quential Recommendation. In Proceedings of the ACM Web Conference 2022. 1923– 1932. [7] Mingyue Cheng, Fajie Yuan, Qi Liu, Shenyang Ge, Zhi Li, Runlong Yu, Defu Lian, Senchao Yuan, and Enhong Chen. 2021. Learning Recommender Systems with Implicit Feedback via Soft Target Enhancement. Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval (2021). [8] Mingyue Cheng, Fajie Yuan, Qi Liu, Xin Xin, and Enhong Chen. 2021. Learning transferable user representations with sequential behaviors via contrastive pre- training. In 2021 IEEE International Conference on Data Mining (ICDM). IEEE, 51–60. [9] Xiangxiang Chu, Zhi Tian, Bo Zhang, Xinlong Wang, Xiaolin Wei, Huaxia Xia, and Chunhua Shen. 2021. Conditional positional encodings for vision transformers. arXiv preprint arXiv:2102.10882 (2021). [10] Jonathan Crabbé and Mihaela Van Der Schaar. 2021. Explaining time series predictions with dynamic masks. In ICML. PMLR, 2166–2177. [11] Zhicheng Cui, Wenlin Chen, and Yixin Chen. 2016. Multi-scale convolutional neural networks for time series classification. arXiv preprint arXiv:1603.06995 (2016). [12] Angus Dempster, François Petitjean, and Geoffrey I Webb. 2020. ROCKET: excep- tionally fast and accurate time series classification using random convolutional kernels. Data Mining and Knowledge Discovery 34, 5 (2020), 1454–1495. [13] Angus Dempster, Daniel F Schmidt, and Geoffrey I Webb. 2021. Minirocket: A very fast (almost) deterministic transform for time series classification. In ACM SIGKDD. 248–257. [14] Janez Demšar. 2006. Statistical comparisons of classifiers over multiple data sets. The Journal of Machine learning research 7 (2006), 1–30. [15] Ziheng Duan, Haoyan Xu, Yueyang Wang, Yida Huang, Anni Ren, Zhongbin Xu, Yizhou Sun, and Wei Wang. 2022. Multivariate time-series classification with hierarchical variational graph pooling. Neural Networks 154 (2022), 481–490. [16] Ge Gao, Qitong Gao, Xi Yang, Miroslav Pajic, and Min Chi. [n. d.]. A Reinforce- ment Learning-Informed Pattern Mining Framework for Multivariate Time Series Classification. ([n. d.]). [17] Hardik Goel, Igor Melnyk, and Arindam Banerjee. 2017. R2n2: Residual recur- rent neural networks for multivariate time series forecasting. arXiv preprint arXiv:1709.03159 (2017). [18] Josif Grabocka, Nicolas Schilling, Martin Wistuba, and Lars Schmidt-Thieme. 2014. Learning time-series shapelets. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining. 392–401. [19] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual learning for image recognition. In IEEE CVPR. 770–778. [20] Min Hou, Chang Xu, Zhi Li, Yang Liu, Weiqing Liu, Enhong Chen, and Jiang Bian. 2022. Multi-Granularity Residual Learning with Confidence Estimation for Time Series Prediction. In Proceedings of the ACM Web Conference 2022. 112–121. [21] Md Amirul Islam, Sen Jia, and Neil DB Bruce. 2020. How much position informa- tion do convolutional neural networks encode? arXiv preprint arXiv:2001.08248 (2020). [22] Hassan Ismail Fawaz, Germain Forestier, Jonathan Weber, Lhassane Idoumghar, and Pierre-Alain Muller. 2019. Deep learning for time series classification: a review. Data mining and knowledge discovery 33, 4 (2019), 917–963. [23] Hassan Ismail Fawaz, Benjamin Lucas, Germain Forestier, Charlotte Pelletier, Daniel F Schmidt, Jonathan Weber, Geoffrey I Webb, Lhassane Idoumghar, Pierre- Alain Muller, and François Petitjean. 2020. Inceptiontime: Finding alexnet for time series classification. DMKD 34, 6 (2020), 1936–1962. [24] Fazle Karim, Somshubra Majumdar, Houshang Darabi, and Samuel Harford. 2019. Multivariate LSTM-FCNs for time series classification. Neural Networks 116 (2019), 237–245. [25] Jason Lines, Luke M Davis, Jon Hills, and Anthony Bagnall. 2012. A shapelet transform for time series classification. In Proceedings of the 18th ACM SIGKDD international conference on Knowledge discovery and data mining. 289–297. [26] Minghao Liu, Shengqi Ren, Siyuan Ma, Jiahui Jiao, Yizhou Chen, Zhiguang Wang, and Wei Song. 2021. Gated transformer networks for multivariate time series classification. arXiv preprint arXiv:2103.14438 (2021). [27] Zhiding Liu, Mingyue Cheng, Zhi Li, Qi Liu, and Enhong Chen. 2022. One Person, One Model-Learning Compound Router for Sequential Recommendation. 2022 IEEE International Conference on Data Mining (ICDM) (2022), 289–298. [28] Matthew Middlehurst, James Large, Michael Flynn, Jason Lines, Aaron Bostrom, and Anthony Bagnall. 2021. HIVE-COTE 2.0: a new meta ensemble for time series classification. Machine Learning 110, 11 (2021), 3211–3243. [29] Jeeheh Oh, Jiaxuan Wang, and Jenna Wiens. 2018. Learning to exploit invariances in clinical time-series data using sequence transformer networks. In Machine Learning for Healthcare Conference. PMLR, 332–347. [30] Beanbonyka Rim, Nak-Jun Sung, Sedong Min, and Min Hong. 2020. Deep learning in physiological signal data: A survey. Sensors 20, 4 (2020), 969. [31] Alejandro Pasos Ruiz, Michael Flynn, James Large, Matthew Middlehurst, and Anthony Bagnall. 2021. The great multivariate time series classification bake off: a review and experimental evaluation of recent algorithmic advances. DMKD 35, 2 (2021), 401–449. [32] Marc Russwurm and Marco Körner. 2020. Self-attention for raw optical satellite time series classification. ISPRS journal of photogrammetry and remote sensing 169 (2020), 421–435. [33] Pritam Sarkar and Ali Etemad. 2020. Self-supervised ECG representation learning for emotion recognition. IEEE Transactions on Affective Computing (2020). [34] Patrick Schäfer and Ulf Leser. 2017. Multivariate time series classification with WEASEL+ MUSE. arXiv preprint arXiv:1711.11343 (2017). [35] Omer Berat Sezer, Mehmet Ugur Gudelek, and Ahmet Murat Ozbayoglu. 2020. Financial time series forecasting with deep learning: A systematic literature review: 2005–2019. Applied soft computing 90 (2020), 106181. [36] Chang Wei Tan, Angus Dempster, Christoph Bergmeir, and Geoffrey I Webb. 2022. MultiRocket: multiple pooling operators and transformations for fast and effective time series classification. DMKD (2022), 1–24. [37] Wensi Tang, Guodong Long, Lu Liu, Tianyi Zhou, Michael Blumenstein, and Jing Jiang. 2021. Omni-Scale CNNs: a simple and effective kernel size configuration for time series classification. In International Conference on Learning Representations. [38] Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. 2020. Efficient transformers: A survey. ACM Computing Surveys (CSUR) (2020). [39] Alasdair Tran, Alexander Mathews, Cheng Soon Ong, and Lexing Xie. 2021. Radflow: A recurrent, aggregated, and decomposable model for networks of time series. In Proceedings of the Web Conference 2021. 730–742. [40] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems 30 (2017). [41] Sinong Wang, Belinda Z Li, Madian Khabsa, Han Fang, and Hao Ma. 2020. Lin- former: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768 (2020). [42] Wenhai Wang and Enze at al Xie. 2021. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In IEEE/CVF ICCV. 568–578. [43] Qingsong Wen, Tian Zhou, Chaoli Zhang, Weiqi Chen, Ziqing Ma, Junchi Yan, and Liang Sun. 2022. Transformers in time series: A survey. arXiv preprint arXiv:2202.07125 (2022). [44] Haixu Wu, Jialong Wu, Jiehui Xu, Jianmin Wang, and Mingsheng Long. 2022. Flowformer: Linearizing Transformers with Conservation Flows. In International Conference on Machine Learning. [45] Zonghan Wu, Shirui Pan, Guodong Long, Jing Jiang, Xiaojun Chang, and Chengqi Zhang. 2020. Connecting the dots: Multivariate time series forecasting with graph neural networks. In Proceedings of the 26th ACM SIGKDD international conference on knowledge discovery & data mining. 753–763. [46] Lexiang Ye and Eamonn Keogh. 2009. Time series shapelets: a new primitive for data mining. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining. 947–956. [47] Yi Yin and Pengjian Shang. 2016. Forecasting traffic time series with multivariate predicting method. Appl. Math. Comput. 291 (2016), 266–278. [48] George Zerveas, Srideepika Jayaraman, Dhaval Patel, Anuradha Bhamidipaty, and Carsten Eickhoff. 2021. A transformer-based framework for multivariate time series representation learning. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining. 2114–2124. [49] Xuchao Zhang, Yifeng Gao, Jessica Lin, and Chang-Tien Lu. 2020. Tapnet: Multi- variate time series classification with attentional prototypical network. In Pro- ceedings of the AAAI Conference on Artificial Intelligence, Vol. 34. 6845–6852. [50] Yi Zheng, Qi Liu, Enhong Chen, Yong Ge, and J Leon Zhao. 2014. Time se- ries classification using multi-channels deep convolutional neural networks. In International conference on web-age information management. Springer, 298–310. [51] Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. 2021. Informer: Beyond efficient transformer for long se- quence time-series forecasting. In Proceedings of the AAAI, Vol. 35. 11106–11115.
http://arxiv.org/abs/2302.09817v2
2023-02-23T15:46:35
2023-02-20T07:45:25
Explainable Human-centered Traits from Head Motion and Facial Expression Dynamics
We explore the efficacy of multimodal behavioral cues for explainable prediction of personality and interview-specific traits. We utilize elementary head-motion units named kinemes, atomic facial movements termed action units and speech features to estimate these human-centered traits. Empirical results confirm that kinemes and action units enable discovery of multiple trait-specific behaviors while also enabling explainability in support of the predictions. For fusing cues, we explore decision and feature-level fusion, and an additive attention-based fusion strategy which quantifies the relative importance of the three modalities for trait prediction. Examining various long-short term memory (LSTM) architectures for classification and regression on the MIT Interview and First Impressions Candidate Screening (FICS) datasets, we note that: (1) Multimodal approaches outperform unimodal counterparts; (2) Efficient trait predictions and plausible explanations are achieved with both unimodal and multimodal approaches, and (3) Following the thin-slice approach, effective trait prediction is achieved even from two-second behavioral snippets.
[ "Surbhi Madan", "Monika Gahalawat", "Tanaya Guha", "Roland Goecke", "Ramanathan Subramanian" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09817v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09817v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CV" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 2 v 7 1 8 9 0 . 2 0 3 2 : v i X r a 1 Explainable Human-centered Traits from Head Motion and Facial Expression Dynamics Surbhi Madan, Monika Gahalawat, Student Member, IEEE, Tanaya Guha, Member, IEEE, Roland Goecke, Senior Member, IEEE and Ramanathan Subramanian, Senior Member, IEEE Abstract-We explore the efficacy of multimodal behavioral cues for explainable prediction of personality and interview-specific traits. We utilize elementary head-motion units named kinemes, atomic facial movements termed action units and speech features to estimate these human-centered traits. Empirical results confirm that kinemes and action units enable discovery of multiple trait-specific behaviors while also enabling explainability in support of the predictions. For fusing cues, we explore decision and feature-level fusion, and an additive attention-based fusion strategy which quantifies the relative importance of the three modalities for trait prediction. Examining various long-short term memory (LSTM) architectures for classification and regression on the MIT Interview and First Impressions Candidate Screening (FICS) datasets, we note that: (1) Multimodal approaches outperform unimodal counterparts; (2) Efficient trait predictions and plausible explanations are achieved with both unimodal and multimodal approaches, and (3) Following the thin-slice approach, effective trait prediction is achieved even from two-second behavioral snippets. Index Terms-Kinemes, Head-motion Units, Action Units, Behavioral Analytics, Explainable Prediction, Personality and Interview Traits, Unimodal vs Multimodal (cid:70) 1 INTRODUCTION Personality is a psychological construct that describes hu- man behavior in terms of habitual and fairly stable patterns of emotions, thoughts, and attributes [1], [2]. Personality is typically characterized by the OCEAN traits typified by the big-five model [3]: Openness (creative vs conservative), Conscientiousness (diligent vs disorganized), Extraversion (social vs aloof), Agreeableness (empathetic vs distant) and Neuroticism (anxious vs emotionally stable). Other popu- lar personality models include the big-two model which categorizes these five traits into the Plasticity and Stability dimensions [4], and the 16 personality factors model [5]. Personality plays a crucial role in shaping an individ- ual's behavioral and communication traits, and how one conducts themselves in different social situations. To this end, multimodal non-verbal cues are critical in exhibiting an individual's inter-personal skills in the context of 'multi- media CVs' [6], [7]. Subjective impressions of interviewee's personality traits can influence hiring decisions [8], and even one behavioral modality can explain personality attri- butions [9]. E.g., Conscientiousness characterizing diligence and honesty is reflected in an upright posture and minimal head movements, while Neuroticism indicating anxiety and stress is revealed through fidgeting and camera aversion in self-presentation videos [7]. This paper builds on the above findings, and explores the efficacy of multimodal behavioral cues to explainably • Surbhi Madan is with Department of Computer Science, Indian Institute of Technology Ropar, India. • Monika Gahalawat, Roland Goecke and Ramanathan Subramanian are with the Human-Centred Technology Research Centre, Faculty of Science and Technology, University of Canberra, ACT, Australia. • Tanaya Guha is with the School of Computing Science, University of Glasgow, UK. Fig. 1. Overview of the proposed framework: Kinemes (elementary head motions), action units (atomic facial movements) and speech features employed for explainable trait prediction. predict personality and job interview traits. In particular, we examine (i) elementary head motions termed kinemes, (ii) atomic facial movements called action units (AUs), and (iii) prosodic and acoustic speech features for traits prediction (see Fig. 1 for an overview). We first evaluate the efficacy of unimodal temporal characteristics of individual behavioral channel in predicting these traits using long-short term memory (LSTM) architectures. Next, we explore different multimodal fusion strategies (feature fusion, decision fu- sion, and additive soft attention) to enhance each channel's predictive power and explainability. Recent studies have already shown the effectiveness of kineme patterns for emotional trait prediction [10], [11], while acoustic features Head motion time seriesAction Unit RepresentationKineme RepresentationSpeech RepresentationExtract speech featuresLSTMExplainable Personality and Interview TraitsLow Level Descriptors (LLDs)Sequence of kinemes....Decompose into head motion units (kinemes)Facial featuresAction units (AU) detectionInput video+audio and facial expressions have been successfully employed for estimating personality attributes [1], [12], [13] and candidate hireability (i.e., suitability to hire/interview later) [14], [15]. Examining various LSTM architectures for classification and regression on the diverse FICS [16] and MIT inter- view [17] datasets, we make the following observations: (i) Both kinemes and AUs achieve explanative trait prediction. (ii) Multimodal approaches leverage cue-complementarity to better predict interview and personality attributes than unimodal ones. (iii) Trimodal fusion-based attention scores enable behavioral explanations, and provide insights into the relative contribution of each modality over time. (iv) Adequate predictive power is achieved even with 2 seconds- long behavioral episodes or slices. Overall, we make the following research contributions: • Building upon our initial results [18], we novelly em- ploy kinemes, action units and speech features for the estimation of personality and interview traits. Given the strong correlations among personality and interview traits [16], [19], we show that the three behavioral modalities are both predictive and explanative of these traits. We explore distinct strategies for temporally fus- ing behavioral features. Fusion approaches outperform unimodal ones by a large margin owing to the comple- mentary nature of the cues and modalities. • Our experiments reveal that speech features are highly predictive of interview traits on the MIT dataset [17], and achieve performance comparable to kinemes and AUs for OCEAN trait prediction on the FICS dataset. • Kineme and AU features enable behavioral explana- tions to support their predictions. We employ scores obtained from the additive attention fusion model to assess the relative importance of our three modalities per trait. • We perform ablative studies presenting unimodal and multimodal results over thin-slices of varying lengths. We show that satisfactory continuous and discrete trait prediction performance can be achieved even with 2s slices, with more accurate predictions possible over longer slices in line with expectation. 2 LITERATURE REVIEW This section reviews research on (a) personality and inter- view trait prediction, and (b) multimodal behavior analytics to position our work with respect to the literature. 2.1 Trait Prediction Human thoughts, emotions and behavioral patterns are influenced by their personality, typically characterized via the OCEAN model [3] characterizing human personality in terms of Openness, Conscientiousness, Extraversion, Agree- ableness and Neuroticism. Various non-verbal behavioral cues such as eye movements [20], [21], head motion [22], [23], and facial features [13], [24] have been employed for personality trait prediction. Numerous studies have examined the relationship be- tween a candidate's personality traits and their job- interview performance [14], [17]; For instance, Conscien- tiousness is positively correlated with job and organiza- 2 tional performance [25], [26]. Conscientiousness and Ex- traversion impact interview success [27], [28] and job rat- ings [29]. While Mount et al. [30] observed that Emo- tional stability, Conscientiousness and Agreeableness are positively related to job performance, Rothmannet al. [31] associated Conscientiousness, Extraversion, Emotional sta- bility and Openness with job performance and creativity. While these correlations among personality and interview traits have been discovered via statistical analyses, very few studies have explored the relationships between non-verbal behavioral cues and personality-cum-interview traits in a predictive (regression/classification) setting. Explainable trait prediction: Despite achieving excel- lent performance on multiple prediction problems, deep learning models fall short in terms of explainability and interpretability due to their 'black-box' nature [32]. Recent studies alleviate this issue by interpreting the results of deep learning models, e.g., Wicaksana and Liem [33] predict OCEAN personality traits explicitly focusing on human- explainable features and a transparent decision-making process. Wei et al. [34] propose a deep bimodal regres- sion framework, in which Convolutional Neural Networks (CNNs) are modified to aggregate descriptors for improving regression performance on apparent personality analysis. A CNN-based approach for interpretability is explored, where the authors observe a correlation between AUs and CNN- learned features [35]. Another work [36] trains a deep resid- ual network with audiovisual descriptors for personality trait prediction, where predictions are elucidated via face image visualization and occlusion analysis. 2.2 Multimodal Behavior Analytics Low-level behavioral features have been largely employed for human-centred trait prediction. E.g., head-motion has been modeled with descriptors such as amplitude of Fourier components [37], Euler rotation angles and velocity. Head motion is often restricted to nods and shakes [38]. Yang and Narayanan [39] extract arbitrary head motion patterns, which do not have a physical interpretation. Subramanian et al. [23] predict Extraversion and Neuroticism employing positional and head pose patterns. Audio-visual features are typically combined to achieve effective trait prediction. Low-level speech descriptors such as pitch, intensity, spectral, cepstral coefficients and pause duration are commonly used for personality [40], [41] and affect recognition [42], [43], [44]. Other works use acous- tic, prosodic and linguistic features for personality predic- tion [13], [45]. Many trait prediction studies focus solely on visual cues, with facial cues playing a crucial role. E.g., multivariate regression is employed to infer user personality impressions from Twitter profile images [46], while eigenfaces are com- bined with Support Vector Machines are used to predict if a depicted person scores above/below the median for each of the big-five traits [47]. Meng et al. [48] investigate the connection between gratification-sought (e.g., escape, fashion, entertainment) and personality traits, and find that extroverts are more active in contributing to, and participat- ing in engaging behaviors. Short-term facial dynamics are learned from short videos via an emotion-guided, encoder- based approach for personality analysis in [49]. 2.3 Summary Our literature review reveals the following research gaps: (1) Personality and interview traits are known to be highly correlated based on statistical observations, but few works have explored learning of features that can ef- fectively predict as well as explain these traits. (2) While personality and interview traits have been pre- dicted via machine/deep learning approaches, the ma- jority employs statistics of low-level audiovisual fea- tures (statistics relating to head motion, eye-gaze, fa- cial expression, speech and prosodic), which limits explanations to support the predictions. While head motion patterns have been identified as critical non- verbal behavioral cues, they have not been employed for personality or interview trait prediction. We show how kineme and AU features can intuitively explain trait-specific behaviors. (3) Multimodal behavioral analytics have been largely re- stricted to feature and decision fusion, treating all be- havioral channels equally. Differently, we utilize addi- tive soft attention [50]-based fusion that learns relative contribution of each channel from data. This allows for quantifying and explaining the relative contribution of the different modalities towards the prediction result. 3 METHODOLOGY 3.1 Feature Extraction We now present feature extraction for the three employed modalities: (i) 3D head motions denoted via a sequence of kinemes, (ii) facial action units describing muscle move- ments, and (iii) low-level descriptors for speech represen- tation. As in [18], we encode these features into 2s temporal segments with a 50% overlap to obtain feature vectors. Kineme Representation: A compact approach to model- ing head motion is by representing it in terms of a small number of fundamental and interpretable units termed kinemes [10]; they are analogous to phonemes in human speech [51]. We extract the 3D Euler rotation angles pitch (θp), yaw (θy) and roll (θr) per frame to represent head pose using the Openface toolkit [52]. Head motion for a time pe- riod T can be represented as a time-series of 3D angles: θ = {θ1:T r }. This multivariate time-series θ of length p T is divided into l-overlapping segments, where the ith segment is denoted by a vector h(i) = [θi:i+(cid:96) ]T . These overlapping segments enable shift-invariance and generate better representations of the head motion [11]. , θi:i+(cid:96) r , θi:i+(cid:96) y , θ1:T y , θ1:T p Further, we define the characterization matrix as Hθ = [h(1), h(2), * * * , h(s)] with s denoting the number of seg- ments in the training sample. All N training samples are combined to form the head motion matrix H = [Hθ1|Hθ2| * * * |HθN ], where each column in the matrix H represents a single head motion time-series segment. Non- negative Matrix Factorization is performed on the matrix H to obtain basis and coefficient matrices B and C re- spectively. We then employ Gaussian Mixture modeling to cluster coefficient vectors in a low dimensional space to obtain a k column matrix C∗ (k << N s). The matrix C∗ is transformed as H∗ = BC∗, to obtain kinemes in the original space. Columns of H∗ yield the k kinemes {Ki}K i=1. 3 On learning the kineme representation, any head motion time-series is represented via K by mapping each time series segment to an individual kineme. To obtain the correspond- ing kineme, we compute the characterization matrix h(i) for the ith segment. Lastly, we project h(i) onto the learned subspace spanned by B to get c(i): ˆc = arg min c(i)≥0 (cid:107)h(i) − Bc(i)(cid:107)2 F We maximize the posterior probability P (Ki|ˆc) to associate the ith segment to its corresponding kineme Ki. Thus, we can map a head motion time-series to a kineme sequence. Selected kinemes are extracted from the MIT and FICS datasets are visualized in Figs. 5 and 6. Action Unit Detection: We extract 17 facial action units (AUs) per video frame using Openface. These 17 AUs are described in terms of a value specifying the visibility of an AU, and an intensity score representing AU sharpness on a 5-point scale (minimal to maximal). We employ mean intensity as a threshold to identify the dominant AUs over all 2s frames with 1s overlap as above. We present common AUs from the two datasets in Fig. 7. Speech Feature Extraction: We extracted low-level audio descriptors (LLDs) via the Librosa library [53] following the Interspeech2009 emotion challenge [54]: Fundamental frequency (F0), voice probability, zero-crossing rate (ZCR) and Mel-frequency cepstral coefficients (MFCCs). A local feature vector is created by extracting the LLDs over a sliding window of 93ms with an overlap of 23ms over the entire video duration. These local features are averaged and concatenated to obtain a 23-dimensional feature vector for each 2s segment. For each dataset, these features are normalized to have zero mean and unit variance. 3.2 Models Long short-term memory (LSTM) models for regression and classification: We trained LSTMs with the kineme (LSTM Kin), AU (LSTM AU) and speech sequences (LSTM Aud). We also performed bimodal feature fusion (FF) and decision fusion (DF) with all combinations (LSTM Kin+AU, LSTM Kin+Aud and LSTM AU+Aud), and trimodal LSTM fusion (LSTM Kin+AU+Aud). The kineme sequences are one-hot encoded, where the kineme denoting a given time- window is coded to 1 and the rest to 0. AU sequences are encoded by setting the dominant AUs to 1 and rest to 0 for the time-window, creating a binary 17-element AU vector. Speech sequences are created by z-normalizing LLDs averaged over the time-window. For a behavioral slice involving L time windows with N training samples, the kineme, AU and speech features form 3D matrices of size 16×N × L, 17 ×N × L, and 23 ×N × L respectively. Unimodal and feature fusion (FF): A single hidden LSTM layer is employed for unimodal prediction followed by a dense layer involving one neuron with sigmoidal/linear activation for classification/regression. For bimodal and tri- modal feature fusion, unimodal descriptors are fused by ap- plying a single LSTM layer to each feature. The subsequent outputs are merged followed by a dense layer comprising a single neuron as above (see Fig. 3). The hyperparameters 4 Fig. 2. (a) Additive attention fusion architecture overview, and (b) Attention score computation process (FC layer comprises twelve neurons). N denotes the number of neurons per layer. Linear/sigmoid activation is applied on the dense layer output for regression/classification. such as number of neurons, activation function and dropout rate are tuned via the validation set. An Adam optimizer is utilized for training with learning rate of 0.01. We employ binary cross entropy and mean absolute error as loss func- tions for classification and regression respectively. Attention fusion (LSTM AF): To achieve multimodal ex- planations, we employ attention-based trimodal fusion as in [50] to assign importance weights to the three modalities at each time window (Fig. 2). Dense layers are employed for each cue in [50], while we use one LSTM layer per modality to quantify an importance weight. Also, while we compute weights based on softmax scores generated per time step, [50] focuses only on the channel with maxi- mum attention weight discarding others. As in Fig. 2(a), an LSTM layer is employed for each modality to learn temporal dynamics, resulting in a fixed-length feature vec- tor per modality. Unimodal descriptors are concatenated and passed through a fully connected layer, and a soft- max layer composed of three neurons (Fig. 2(b)). Attention scores generated via the softmax layer are deemed as the relative contribution of each modality per time window. Layer normalization is applied over each unimodal feature vector. To fuse normalized features, we employ an addi- tive layer to sum the weighted unimodal features. This is followed by a dense layer comprising a single neuron with sigmoidal/linear activation for classification/regression. We aggregate weights to compute modality contributions over behavioral slices spanning multiple time windows. Decision fusion (DF): We adopt the fusion weight estima- tion approach [55] outlined below. Assuming the unimodal classifier/regressor scores are p1 and p2 for the bimodal fu- sion, the test sample score is defined as αp1 + (1 − α)p2, α ∈ [0, 1]. We perform grid search with a step-size of 0.05 to identify the optimal α∗ maximizing F1-score and Pearson correlation coefficient (PCC) respectively for classification and regression (the same is extended to trimodal fusion). Fig. 3. Trimodal feature fusion architecture. Linear activation is applied on the dense layer output for regression. N denotes the number of neurons per layer. The dense layer output involves linear activation and 32 neurons in the LSTM layer for regression model. Data3D Data MatrixKineme Vector (16)Chunk SizeN = 12LSTM layerFC layerMerge layerPredictionSigmoidN = 1N = 36N = 12Data3D Data MatrixAUVector (17)Chunk SizeN = 12Data3D Data MatrixSpeechVector (23)Chunk Size 5 scores denoting emotional stability instead of Neuroticism. This MIT dataset [17] comprises audio-visual recordings of 138 mock job interviews with 69 undergraduate students, with videos being 4.7 minutes long on average. All videos are annotated with 16 interviewee-specific traits. We focus on the following traits: recommended hiring score (RH) denoting the candidate's hireability, level of excitement (Ex), friendliness (Fr) and eye-contact (EC). We also examine the Overall (Ov) interview score in prediction experiments. Examples from the two datasets are presented in Figure 4. 4.2 Quantitative Experiments Prediction Settings: We consider both continuous and dis- crete prediction of personality and interview traits. For (binary) classification, we dichotomize trait scores by thresh- olding them at their median value. Tables 1 and 2 present regression results, while Tables 3 and 4 present classification results. Our models are fine-tuned on the FICS dataset via the pre-defined validation set, while hyperparameter tuning is achieved via 10-fold cross-validation (cv) on the smaller MIT Interview dataset. Results reported on the MIT dataset are μ ± σ statistics noted over 50 runs (5 repeated runs of 10-fold cv). Early stopping with a patience value of 4 epochs is employed to prevent model degradation. Chunk vs video-level prediction: To examine trait predic- tion over tiny behavioral episodes (or slices), we segment the original videos into smaller chunks of 2-7s for FICS, and 2-60s for the MIT dataset. All video chunks are assigned the source video label. We then compute metrics over a) all chunks (chunk-level performance), and b) over all videos by assigning the majority label/mean value over all chunks (video-level performance) for classification/regression. A comparison of chunk vs video-level predictions for the three modalities is presented in Figs. 8- 10 Performance Metrics: Due to the imbalanced class dis- tribution in classification, we use two metrics: Accuracy (Acc) and F1-Score. For regression, accuracy (Acc) defined as 1-MAE (Mean Absolute Error) [24] and PCC (Pearson Correlation Coefficient) are considered. 4.3 Results and Discussion Based on Tables 1–4, we make the following observations: • For regression benchmarking (Tables 1, 2), PCC is a more stringent measure than Acc, as very low PCC values are observed with relatively high Acc values for the FICS dataset (Table 2). Tables 1 and 3 show that regression and classification results are comparable for the (smaller) MIT dataset. For FICS, the regression scores are considerably higher than the classification scores, which can be attributed to Gaussian-distributed FICS traits with means around 0.5 [16]. • Speech features achieve optimal interview trait predic- tion (Table 1), while Kineme and AU features perform comparably. Optimal personality trait regression is also achieved with audio features (Table 2), even as AUs significantly outperform kinemes on the FICS dataset. • Higher PCC scores are achieved with multimodal as compared to unimodal methods on both the MIT and FICS datasets. Bimodal and trimodal fusion perform very similarly for both interview and personality trait Fig. 4. FICS (top) and MIT (bottom) exemplars. Fig. 5. Plots of 16 kinemes extracted for the FICS dataset following raster ordering (left to right, top to bottom.) Fig. 6. Selected kineme plots for the MIT dataset. Fig. 7. Common AUs in the FICS and MIT datasets. 4 EXPERIMENTAL RESULTS 4.1 Datasets The FICS dataset [16] contains 10K self-presentation snip- pets derived from YouTube videos of people talking into the camera. Averaging 15s in length, these videos are split into a 3:1:1 proportion for train, validation and test. All videos are annotated with OCEAN trait scores with 'N' 6 TABLE 1 Unimodal and multimodal regression results on the MIT dataset. Accuracy and PCC values are tabulated, with highest PCC achieved per trait denoted in bold. Trait LSTM Kin Unimodal LSTM AU LSTM Audio LSTM FF Trimodal LSTM DF Acc 0.93±0.04 0.95±0.03 0.94±0.04 0.94±0.04 0.95±0.03 PCC 0.84±0.26 0.93±0.10 0.89±0.20 0.89±0.13 0.93±0.10 Acc 0.93±0.04 0.95±0.03 0.94±0.04 0.94±0.04 0.95±0.03 PCC 0.84±0.26 0.93±0.10 0.89±0.20 0.89±0.22 0.93±0.10 Acc 0.96±0.03 0.96±0.03 0.95±0.02 0.95±0.03 0.96±0.03 PCC 0.94±0.10 0.93±0.09 0.95±0.06 0.94±0.08 0.96±0.06 Acc 0.97±0.03 0.97±0.03 0.97±0.02 0.96±0.03 0.97±0.02 PCC 0.96±0.08 0.96±0.08 0.98±0.05 0.96±0.08 0.98±0.03 Acc 0.97±0.01 0.98±0.01 0.95±0.03 0.96±0.03 0.98±0.01 PCC 0.97±0.04 0.97±0.03 0.97±0.06 0.96±0.06 0.98±0.02 Ov RH Ex EC Fr LSTM AF Acc 0.98±0.03 0.97±0.03 0.98±0.02 0.97±0.03 0.98±0.03 PCC 0.95±0.16 0.96±0.07 0.98±0.05 0.96±0.08 0.97±0.05 Bimodal Trait Kin + AU FF Kin + AU DF Kin + Aud FF Kin + Aud DF AU + Aud FF AU + Aud DF Acc 0.97±0.03 0.96±0.04 0.96±0.04 0.96±0.04 0.97±0.03 PCC 0.93±0.15 0.92±0.16 0.93±0.15 0.94±0.13 0.96±0.08 Acc 0.95±0.04 0.94±0.04 0.93±0.04 0.95±0.04 0.95±0.03 PCC 0.89±0.21 0.90±0.19 0.91±0.14 0.91±0.16 0.94±0.09 Acc 0.97±0.02 0.97±0.03 0.97±0.02 0.97±0.03 0.97±0.03 PCC 0.96±0.07 0.96±0.07 0.98±0.04 0.95±0.07 0.97±0.07 Acc 0.96±0.03 0.96±0.03 0.96±0.02 0.95±0.03 0.96±0.03 PCC 0.95±0.06 0.95±0.07 0.97±0.05 0.94±0.10 0.96±0.05 Acc 0.97±0.03 0.97±0.03 0.97±0.02 0.97±0.02 0.97±0.02 PCC 0.97±0.07 0.96±0.07 0.98±0.04 0.96±0.06 0.98±0.04 Acc 0.96±0.03 0.96±0.03 0.97±0.02 0.96±0.03 0.96±0.03 PCC 0.95±0.09 0.95±0.08 0.97±0.05 0.95±0.09 0.96±0.05 Ov RH Ex EC Fr TABLE 2 Unimodal and multimodal regression results on the FICS dataset. Accuracy and PCC values for different methods are tabulated, with highest PCC achieved per trait denoted in bold. Trait LSTM Kin Open Con Extra Agree Neuro Acc 0.872 0.864 0.869 0.885 0.867 PCC 0.060 0.027 0.048 0.046 0.051 Unimodal LSTM AU Acc 0.889 0.882 0.891 0.897 0.885 PCC 0.370 0.317 0.491 0.251 0.370 LSTM Audio LSTM FF Trimodal LSTM DF Acc 0.896 0.888 0.895 0.894 0.887 PCC 0.436 0.418 0.445 0.291 0.465 Acc 0.895 0.891 0.894 0.895 0.890 PCC 0.464 0.434 0.540 0.304 0.484 Acc 0.900 0.894 0.900 0.901 0.895 PCC 0.501 0.504 0.566 0.377 0.517 LSTM AF Acc 0.895 0.888 0.896 0.899 0.891 PCC 0.483 0.428 0.534 0.300 0.481 Bimodal Trait Kin + AU FF Kin + AU DF Kin + Aud FF Kin + Aud DF AU + Aud FF AU + Aud DF Open Con Extra Agree Neuro Acc 0.892 0.880 0.893 0.892 0.884 PCC 0.368 0.304 0.474 0.253 0.365 Acc 0.893 0.881 0.891 0.896 0.887 PCC 0.382 0.282 0.485 0.275 0.387 Acc 0.892 0.883 0.888 0.891 0.880 PCC 0.418 0.387 0.415 0.265 0.410 Acc 0.898 0.890 0.892 0.896 0.890 PCC 0.456 0.446 0.450 0.324 0.472 Acc 0.893 0.887 0.895 0.895 0.888 PCC 0.459 0.450 0.531 0.311 0.455 Acc 0.898 0.895 0.900 0.900 0.897 PCC 0.484 0.510 0.550 0.378 0.533 TABLE 3 Unimodal and multimodal classification results on the MIT dataset. Accuracy and F1-score are tabulated, with highest F1 achieved per trait denoted in bold. Trait LSTM Kin Unimodal LSTM AU LSTM Audio LSTM FF Trimodal LSTM DF Acc 0.83±0.11 0.79±0.12 0.82±0.13 0.79±0.13 0.80±0.15 F1 0.82±0.13 0.79±0.12 0.82±0.13 0.79±0.13 0.80±0.16 Acc 0.82±0.14 0.82±0.12 0.83±0.13 0.81±0.12 0.86±0.09 F1 0.81±0.15 0.82±0.13 0.83±0.14 0.80±0.13 0.85±0.09 Acc 0.94±0.08 0.95±0.07 0.95±0.07 0.93±0.08 0.94±0.07 F1 0.93±0.10 0.95±0.07 0.95±0.08 0.91±0.10 0.94±0.08 Acc 0.97±0.07 0.95±0.09 0.97±0.06 0.95±0.07 0.96±0.06 F1 0.96±0.10 0.95±0.10 0.96±0.06 0.94±0.10 0.95±0.06 Acc 0.97±0.05 0.98±0.06 0.97±0.04 0.95±0.07 0.97±0.05 F1 0.97±0.06 0.98±0.06 0.97±0.05 0.95±0.08 0.96±0.05 Ov RH Ex EC Fr LSTM AF Acc 0.97±0.06 0.95±0.08 0.96±0.06 0.94±0.09 0.95±0.06 F1 0.97±0.07 0.95±0.10 0.96±0.06 0.93±0.10 0.94±0.07 Trait Kin + AU FF Kin + AU DF Kin + Aud FF Kin + Aud DF AU + Aud FF AU + Aud DF Acc 0.80±0.14 0.79±0.12 0.81±0.12 0.78±0.12 0.84±0.10 F1 0.80±0.14 0.79±0.13 0.80±0.12 0.76±0.13 0.84±0.11 Acc 0.85±0.13 0.83±0.13 0.84±0.11 0.84±0.13 0.87±0.11 F1 0.85±0.14 0.83±0.14 0.83±0.12 0.83±0.14 0.86±0.12 Acc 0.96±0.08 0.95±0.08 0.95±0.06 0.93±0.09 0.95±0.06 F1 0.96±0.09 0.94±0.10 0.95±0.07 0.92±0.12 0.94±0.07 Acc 0.96±0.07 0.96±0.07 0.96±0.07 0.94±0.08 0.96±0.07 F1 0.96±0.08 0.96±0.08 0.95±0.08 0.94±0.08 0.95±0.07 Acc 0.97±0.07 0.95±0.07 0.97±0.05 0.93±0.07 0.95±0.07 F1 0.96±0.07 0.95±0.08 0.97±0.05 0.92±0.08 0.95±0.07 Acc 0.96±0.06 0.95±0.07 0.97±0.05 0.94±0.08 0.97±0.06 F1 0.96±0.07 0.95±0.08 0.96±0.05 0.93±0.10 0.96±0.06 Ov RH Ex EC Fr Bimodal TABLE 4 Unimodal and multimodal classification results on the FICS dataset. Accuracy and F1-score for different methods are tabulated, with highest F1 achieved per trait denoted in bold. 7 Trait Open Con Extra Agree Neuro Trait Open Con Extra Agree Neuro LSTM Kin F1 Acc 0.516 0.519 0.513 0.513 0.505 0.505 0.479 0.481 0.518 0.523 Unimodal LSTM AU F1 Acc 0.634 0.635 0.618 0.618 0.651 0.651 0.580 0.580 0.624 0.627 Kin + AU FF F1 Acc 0.628 0.629 0.604 0.604 0.648 0.648 0.586 0.593 0.623 0.626 Kin + AU DF Acc 0.632 0.599 0.657 0.584 0.620 F1 0.632 0.598 0.653 0.583 0.616 LSTM Audio Acc 0.595 0.599 0.624 0.551 0.578 F1 0.590 0.592 0.623 0.545 0.547 LSTM FF F1 0.638 0.623 0.665 0.585 0.611 Acc 0.638 0.623 0.667 0.588 0.618 Bimodal Kin + Aud FF Acc 0.612 0.564 0.649 0.544 0.617 F1 0.598 0.564 0.649 0.450 0.615 Kin + Aud DF Acc 0.641 0.609 0.639 0.592 0.637 F1 0.638 0.607 0.636 0.592 0.635 Trimodal LSTM DF F1 0.672 0.638 0.695 0.598 0.665 Acc 0.676 0.640 0.695 0.599 0.665 AU + Aud FF Acc 0.667 0.620 0.668 0.601 0.652 F1 0.664 0.619 0.667 0.594 0.651 LSTM AF F1 0.633 0.582 0.669 0.560 0.638 Acc 0.633 0.594 0.671 0.565 0.639 AU + Aud DF Acc 0.677 0.637 0.682 0.603 0.656 F1 0.672 0.637 0.682 0.596 0.651 TABLE 5 Soft Additive Attention Fusion Results over the 2s behavioral slice: MIT Dataset (left) and FICS Dataset (right) Trait Ov RH Ex EC Fr Classification F1 0.89±0.10 0.90±0.12 0.91±0.10 0.82±0.14 0.91±0.10 Acc 0.91±0.09 091±0.12 0.92±0.09 0.84±0.12 0.92±0.10 Regression Trait Acc 0.93±0.03 0.92±0.03 0.93±0.02 0.91±0.02 0.93±0.02 PCC 0.92±0.09 0.92±0.08 0.94±0.08 0.90±0.10 0.94±0.05 O C E A N Classification Acc 0.632 0.605 0.656 0.561 0.625 F1 0.619 0.604 0.656 0.556 0.625 Regression PCC Acc 0.475 0.896 0.428 0.888 0.501 0.893 0.326 0.899 0.479 0.887 prediction, with maximum PCC values of 0.98 achieved for the Excited and Friendliness interview traits, and a peak PCC of 0.566 achieved for the Extraversion personality trait on FICS obtained with trimodal fusion. • Focusing on multimodal methods, bimodal combina- tions involving audio outperform others for interview trait prediction. Also, feature fusion is more effective than decision fusion in this case. Slightly different trends are noted for the FICS dataset with decision fusion slightly outperforming feature fusion; optimal PCC values are noted for the AU+Aud combination with decision fusion, implying that speech features in- dividually and in combination with others acquire high predictive power, mirroring findings in [17]. Bimodal predictions improving over unimodal ones conveys that kinemes and AUs provide complementary infor- mation concerning interview and personality traits. • Among trimodal fusion methods, decision fusion slightly outperforms attention and feature fusion on the MIT dataset, while decision, attention and feature fusion approaches perform first, second and third best on the FICS dataset. These results again reveal the complementary utility of the kineme, AU and speech features; optimal performance achieved with trimodal decision fusion conveys that the AU and kineme clas- sifiers improve prediction performance in instances where speech descriptors are ineffective. • Focusing on classification (Tables 3 and 4), considering unimodal results, audio features achieve optimal F1- scores on Interview traits (highest F1 of 0.95 for Rec- ommended Hiring and Excited), while AUs achieve the best classification on personality traits (maximum F1 of 0.651 for Extraversion). AUs and kinemes perform similarly on the MIT dataset, while speech descriptors achieve much higher F1-scores than kinemes on FICS. • Multimodal approaches again outperform unimodal methods in categorizing both interview and personality traits. With respect to bimodal methods, combinations involving speech tend to perform well for both inter- view and personality prediction. There is little to choose between feature and decision fusion for interview trait prediction, while decision fusion slightly outperforms feature fusion for predicting personality traits. • Trimodal fusion performs best producing peak F1 scores of 0.98 and 0.695 for the RH interview, and Ex- traversion personality traits. Decision fusion produces optimal trait classification on both datasets, with feature and attention fusion performing comparably. The above results represent trait prediction at the video level, on examining 15s FICS videos or upon collating clas- sification/regression results over 5–60s chunks/segments on the MIT dataset (the best results obtained by averaging chunk-level values, or computing the majority label over all chunks are listed in Tables 1 and 3). 4.3.1 Thin-slice predictions: We explore trait prediction over short behavioral episodes known as thin slices and present the multimodal results for classification and regression using soft additive attention- fusion over 2s behavioral slice in Table 5. The results convey that reasonable prediction performance can be achieved even with 2s-long slices expressing the efficacy of these small behavioral slices for predicting different traits. Further, we visualize the comparison of chunk and video- level prediction performance for varying time-lengths over all three modalities in Figures 8–10. It can be noted that bet- ter prediction performance has been achieved with video- implying that while level as compared to chunk-level episodic behaviors may be inconsistent with one another, 8 Fig. 8. Chunk vs video-level predictions with kinemes for FICS (left) and MIT (right). dataset. Fig. 9. Chunk vs video-level predictions with AUs for FICS (left) and MIT (right). dataset. Fig. 10. Chunk vs video-level predictions with speech features for FICS (left) and MIT (right). dataset. trait specific behaviors tend to be homogeneous over longer time-span. For the OCEAN traits, kineme-based chunk and video-level PCC values deteriorate over larger time-slices (Fig. 8 (left)) while remaining stable in the case of AU features. The speech features are mostly consistent with different time-slices in case of chunk-level while decreasing slightly for video-level prediction. Conversely, chunk and video-level PCC values increase for all three modalities with increasing time-slice length for the MIT dataset (Fig. 8–10 (right)). This trend highlights that AUs, describing facial behavior, encode more trait specific information, specifically for personality traits as compared to kinemes characterizing head movement and speech features. The better predic- tion with larger time-slices for all modalities over the MIT dataset suggests that interview behavior can be captured better over longer time-span. 5 EXPLAINABILITY & INTERPRETABILITY 5.1 Interpretation via kinemes and AUs Along with their predictive power, kinemes and AUs also enable facile trait-specific behavioral explanations. To this end, we considered the top and bottom 10-percentile videos for each trait, and computed the most frequently occurring AUs and kinemes for the same. The most frequently occur- ring four kinemes, and five dominant AUs for these high (H) and low (L)-rated videos are presented in Table 6. Analysing the table, we make the following remarks: • The presence of kineme 16 (denoting head nodding and shaking) in all OCEAN traits conveys the significance of head motion for the characterization of personal- ity traits. Combination of head nodding and shaking with other kineme representations highlights the sub- 9 TABLE 6 Explaining OCEAN and interview traits via kinemes and AUs. MIT kinemes in bold font are visualized in Figure 6. Dataset Trait Dominant Kin Dominant AUs Inferences O (H) C (H) E (H) A (H) N (H) O (L) C (L) E (L) A (L) N (L) RH (H) Ex (H) EC (H) Fr (H) RH (L) Ex (L) EC (L) Fr (L) 2, 8, 10, 16 1, 8, 10, 16 2, 10, 14, 16 3, 8, 10, 16 2, 8, 10, 16 1, 6, 11, 16 2, 4, 8, 16 1, 4, 10, 16 1, 8, 9, 16 1, 5, 12, 16 16, 14, 3, 4 14, 3, 4, 9 14, 12, 4, 5 16, 3, 11, 14 11, 1, 2, 5 11, 16, 2, 3 13, 7, 16, 11 3, 11, 4, 9 Persistent head movements (as noted in [56]) with nodding and smiling. 7, 12, 14, 25, 26 7, 12, 17, 25, 26 Upward head-tilt indicative of upright demeanor and head nodding. 10, 12, 17, 25, 26 Head tilt-down with nodding, and facial gestures related to speaking. 7, 12, 14, 25, 26 7, 12, 17, 25, 26 4, 10, 14, 17, 26 4, 7, 10, 14, 25 4, 7, 10, 14, 17 4, 14, 17, 25, 26 4, 7, 10, 14, 25 Frequent head nodding and smiling (associated with courteous behavior [57], [58]). Frequent head movements with nodding and smiling. Relatively fewer head movements and frowning. Head tilt-down avoiding eye-contact, head shaking and frowning. Tilt-up, head shaking and frowning. Frequent head movements and frowning. Few head movements, head shaking and frowning. 5, 10, 12, 14, 25 5, 10, 12, 14, 25 6, 7, 10, 14, 25 5, 10, 12, 14, 25 6, 7, 12, 14, 25 4, 6, 7, 14, 25 6, 7, 10, 12, 25 1, 4, 6, 7, 25 Head nodding and smiling, and being expressive. Head nodding and exhibiting persistent head motion. Smiling and expressive. Head up, nodding and showing limited facial emotions. Frequent head movements and smiling. Head shaking and exhibiting minimal facial expressions. Head shaking and nodding. Frowning and showing minimal facial expressions. Frequent nodding is perceived as avoiding eye-contact. Head shaking, frowning and otherwise being minimally expressive. FICS MIT tle difference between high and low-rated personality impressions. Also, note that AUs 25 and 26 signifying talking behavior are present in all videos. • Focusing on other kinemes, high Openness is character- ized by kinemes 2 and 8, which signify persistent head movements. This finding is echoed in [56], where large motion variations are found to associate with high O impressions. Presence of AUs 12 and 14 indicates that a smiling demeanor characterizes high O. Conversely, kineme 6 denoting minimal head motion and AUs 4 and 17 typical of frowning and diffident behavior are commonly noted for low O videos. • Kineme 1 denoting an upward head tilt is associated with high C, while kinemes 2 and 4 depicting tilt- down and head-shaking are associated with low C. This indicates that attempting to maintain eye-contact conveys diligence and honesty, while avoiding eye- contact conveys insincerity. • Extraversion appears to be conveyed better by AUs than kinemes; Dominant AUs for high E include 10, 12 and 17 indicating a friendly and talkative nature, while dominant kinemes 2 and 14 convey significant head movements. Conversely, low E is associated with kineme 4 denoting head-shaking and AUs 4, 7 and 17 indicating frowning, overall conveying a socially distant nature. • High Agreeableness is characterized by kineme 3 (head- nod), and AUs 12 and 14 which constitute a smile. Conversely, kinemes 1, 8 and 9 dominate low A, and they collectively convey persistent head motion. Also, AUs dominant for low A are 4, 14 and 17, cumulatively describing a frown; overall, nodding and smiling is viewed as courteous, while frequent head movements and frowning convey hostility. • Emotional stability (high N) is associated with kinemes 2 and 8, and AUs 7, 12 and 17, indicating persistent head motion and facial expressiveness. On the other hand, a neurotic trait is conveyed via limited head mo- tion and head-shaking (kinemes 1, 5, 12) and frowning (described by AUs 4, 7, 10). • While kinemes for the MIT videos are less discernible, due to smaller face size (Fig. 4) and the fact that they capture an interactional setting, some patterns are nevertheless evident as seen in Fig. 6; these kinemes are highlighted in Table 6. As with FICS, Kineme 14 denoting a head-nod is commonly observed for all high trait videos, while kineme 11 depicting a head-shake is common for all low-trait videos. • High RH scores are elicited with expressive facial behavior involving head-nodding and smiling. Con- versely, low RH scores are associated with head- shaking and exhibiting limited facial expressions. Highly excited behavior is associated with identical AUs as high RH, and persistent head motion. Inversely, low excitement scores are connected with head shaking, and limited facial emotions. • Identical AUs are observed for both high and low eye-contact, implying that head movements primarily impact eye-contact impressions. Head nodding (kineme 14) is associated with high EC, while kinemes 11 and 16 depicting head shaking and frequent head-nodding elicit low EC scores. Therefore interestingly, while head nodding is beneficial, frequent nodding is perceived as avoiding eye-contact. • High friendliness is characterized by kinemes 11, 14 and 16, signifying persistent head motion along with expressive and smiling facial movements (AUs 5, 12 and 14). Conversely, low friendliness is associated with head-shaking (kineme 11) and frowning (AUs 4, 6, 7). 5.2 Attention Score-based Interpretations While Table 6 presents unimodal behavioral explanations via kinemes and AUs, behaviors are expressed and best modeled multimodally as seen from our empirical results (Section 4.3). For multimodal explanations, we explore the 10 Fig. 11. Mean modality-specific attention weights for personality traits (left) and interview traits (right). Error bars denote standard error. attention-fusion network (Fig. 2) to estimate the relative con- tribution of each modality towards trait regression. We visu- alize softmax scores learned by the attention-fusion network as follows. For the FICS dataset, we present mean attention scores obtained over 10 runs on 15s test videos (Fig. 11(left)), while we present softmax scores averaged over 15s chunks for MIT videos across 50 runs (Fig. 11(right)). Our remarks from the weight plots are as follows: head movement [66]. On the surprising finding of AUs and speech features impacting eye-contact, prior studies [67] have revealed a low-yet-meaningful cor- relation between eye contact impressions and vocal acoustic features. Friendliness is best characterized by head movement and voice features, showing that the integration of visual and auditory modalities can be crucial in discerning interviewee friendliness [68]. • Cumulatively, Fig. 11 conveys that while the relative contribution of speech features towards weighted fu- sion is not high for personality trait prediction, they tend to play a significant role in predicting interview traits on the MIT dataset. These observations mirror prior findings; the criticality of visual features such as head movements and facial movements for personality trait recognition has been noted in [14], [59] while the impact of prosodic speech features on interview trait impressions is discussed in [17]. • Fig. 11(left) conveys that either kineme or AU features are most critical for personality trait prediction. Specifi- cally, kinemes maximally contribute to the prediction of Openness and Extraversion, while AUs are most critical for predicting Agreeableness and Neuroticism. Both kinemes and AUs are found to be equally critical for estimating Conscientiousness, in line with the findings in [60]. Extraversion and Openness are conveyed by exaggerated physical and head movements [56], [61], with different head movement patterns representing high and low Extraversion [62]. While Agreeableness is also positively correlated with head movements [61], [62], empathetic behavior is accurately conveyed via facial expressions as denoted by the higher AU weights. Facial movements (e.g., unconcerned or anxious) better convey emotional stability [63]. • From Fig. 11(right), it can be seen that facial movements have relatively less impact on interview trait prediction with the exception of eye contact. This can partly be at- tributed to the smaller face size in MIT videos, limiting the efficacy of AU detection. Conversely, speech fea- tures significantly impact trait prediction with the ex- ception of recommended hiring and eye contact traits. While prosodic speech behavior has been found to considerably influence interview trait impressions [17], [64], other forms of non-verbal behavior such as pos- itive facial expressions and frequent postural changes are known to impact hierabilty [65]. • For the Excited trait, speech plays a prominent role with a high correlation to continuous or restricted 6 CONCLUSION This work demonstrates the efficacy of multimodal (kineme, AU and speech) behavioral cues to achieve explainable pre- diction of OCEAN and interview traits. Our results confirm that efficient trait prediction can be achieved with both unimodal and multimodal approaches. Also, multimodal approaches outperform their unimodal counterparts owing to complementary information provided by trait-specific behavioral cues. In addition, frequently occurring kineme and AU patterns enable behavioral explanations associated with each trait. In terms of limitations, this work extracts all behav- ioral features over a fixed time window (same time-scale); however, behaviors associated with human personality may manifest over different time scales; e.g., facial expression or head motion patterns could be affected by speaking behav- ior (talkative: drastic variation in speaking behavior over video frames, or reserved: lingering silence over most video frames). Investigating the effect of temporal scales will be a future research direction. Trait-specific behavioral patterns can also be utilized to create virtual agents to train users in interviewing or public speaking settings. The authors do not advise using the proposed methodologies for complex processes like job recruitment per se; however, explanatory technologies can be utilized as a complementary tool in decision-making processes. ACKNOWLEDGMENTS We would like to thank A. Samanta, IIT Kanpur for sharing the kineme implementation. REFERENCES [1] J. C. S. J. Junior, Y. G ̈uc ̧l ̈ut ̈urk, M. P ́erez, U. G ̈uc ̧l ̈u, C. Andujar, X. Bar ́o, H. J. Escalante, I. Guyon, M. A. Van Gerven, R. Van Lier et al., "First impressions: A survey on vision-based apparent per- sonality trait analysis," IEEE Transactions on Affective Computing, 2019. 11 [2] A. Vinciarelli and G. Mohammadi, "A survey of personality com- puting," IEEE Transactions on Affective Computing, vol. 5, no. 3, pp. 273–291, 2014. [25] S. Hassan, N. Akhtar, and A. K. Yılmaz, "Impact of the consci- entiousness as personality trait on both job and organizational performance." Journal of Managerial Sciences, vol. 10, no. 1, 2016. [3] R. R. McCrae and P. T. Costa, "Validation of the five-factor model of personality across instruments and observers." Journal of person- ality and social psychology, vol. 52, no. 1, p. 81, 1987. J. M. Digman, "Higher-order factors of the big five." Journal of personality and social psychology, vol. 73, no. 6, p. 1246, 1997. [5] H. E. Cattell and A. D. Mead, "The sixteen personality factor [4] [6] questionnaire (16pf)." 2008. S. Raza and B. Carpenter, "A model of hiring decisions in real employment interviews." Journal of Applied Psychology, vol. 72, pp. 596–603, 1987. [7] L. Batrinca, N. Mana, B. Lepri, F. Pianesi, and N. Sebe, "Please, tell me about yourself: Automatic personality assessment using short self-presentations," 11 2011, pp. 255–262. [8] K. Van Dam, "Trait perception in the employment interview: A five–factor model perspective," International Journal of Selection and Assessment, vol. 11, no. 1, pp. 43–55, 2003. [9] T. DeGroot and J. Gooty, "Trait perception in the employment interview: A five–factor model perspective," Journal of Business and Psychology, vol. 24, no. 2, 2009. [10] A. Samanta and T. Guha, "On the role of head motion in affective expression," in IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2017, pp. 2886–2890. [11] --, "Emotion sensing from head motion capture," IEEE Sensors Journal, vol. 21, no. 4, pp. 5035–5043, 2020. [12] M. Sidorov, S. Ultes, and A. Schmitt, "Automatic recognition of personality traits: A multimodal approach," in Proceedings of the 2014 Workshop on Mapping Personality Traits Challenge and Workshop, 2014, pp. 11–15. [13] O. Kampman, E. J. Barezi, D. Bertero, and P. Fung, "Investigating audio, visual, and text fusion methods for end-to-end automatic personality prediction," arXiv preprint arXiv:1805.00705, 2018. [14] H. Malik, H. Dhillon, R. Goecke, and R. Subramanian, "I am empathetic and dutiful, and so will make a good salesman: Char- acterizing hirability via personality and behavior," 2020. [15] S. Eddine Bekhouche, F. Dornaika, A. Ouafi, and A. Taleb-Ahmed, "Personality traits and job candidate screening via analyzing facial videos," in Proceedings of the IEEE conference on computer vision and pattern recognition workshops, 2017, pp. 10–13. [16] H. J. Escalante, H. Kaya, A. A. Salah, S. Escalera, Y. G ̈uc ̧, U. G ̈uc ̧l ̈u, X. Bar ́o, I. Guyon, J. C. Jacques, M. Madadi et al., "Modeling, recognizing, and explaining apparent personality from videos," IEEE Transactions on Affective Computing, 2020. [17] I. Naim, M. I. Tanveer, D. Gildea, and M. E. Hoque, "Automated analysis and prediction of job interview performance," IEEE Trans- actions on Affective Computing, vol. 9, no. 2, pp. 191–204, 2016. [18] S. Madan, M. Gahalawat, T. Guha, and R. Subramanian, "Head matters: Explainable human-centered trait prediction from head motion dynamics," in Proceedings of the 2021 International Confer- ence on Multimodal Interaction, 2021, pp. 435–443. [19] Y. Gucluturk, U. Guclu, X. Baro, H. J. Escalante, I. Guyon, S. Escalera, M. A. J. van Gerven, and R. van Lier, "Multimodal first impression analysis with deep residual networks," IEEE Trans. Affect. Comput., vol. 9, no. 3, p. 316–329, Jul. 2018. [Online]. Available: https://doi.org/10.1109/TAFFC.2017.2751469 [20] S. Hoppe, T. Loetscher, S. A. Morey, and A. Bulling, "Eye move- ments during everyday behavior predict personality traits," Fron- tiers in human neuroscience, p. 105, 2018. [21] J. F. Rauthmann, C. T. Seubert, P. Sachse, and M. R. Furtner, "Eyes as windows to the soul: Gazing behavior is related to personality," Journal of Research in Personality, vol. 46, no. 2, pp. 147–156, 2012. [22] D. B. Jayagopi, H. Hung, C. Yeo, and D. Gatica-Perez, "Modeling dominance in group conversations using nonverbal activity cues," IEEE Transactions on Audio, Speech, and Language Processing, vol. 17, no. 3, pp. 501–513, 2009. [23] R. Subramanian, Y. Yan, J. Staiano, O. Lanz, and N. Sebe, "On the relationship between head pose, social attention and personality prediction for unstructured and dynamic group interactions," in Proceedings of the 15th ACM on International conference on multimodal interaction, 2013, pp. 3–10. [24] Y. G ̈uc ̧l ̈ut ̈urk, U. G ̈uc ̧l ̈u, X. Baro, H. J. Escalante, I. Guyon, S. Es- calera, M. A. Van Gerven, and R. Van Lier, "Multimodal first im- pression analysis with deep residual networks," IEEE Transactions on Affective Computing, vol. 9, no. 3, pp. 316–329, 2017. [26] J. W. Moy and K. F. Lam, "Selection criteria and the impact of personality on getting hired," Personnel Review, 2004. [27] C. Tay, S. Ang, and L. Van Dyne, "Personality, biographical char- acteristics, and job interview success: a longitudinal study of the mediating effects of interviewing self-efficacy and the moderating effects of internal locus of causality." Journal of Applied Psychology, vol. 91, no. 2, p. 446, 2006. [28] M. R. Barrick and M. K. Mount, "The big five personality dimen- sions and job performance: a meta-analysis," Personnel psychology, vol. 44, no. 1, pp. 1–26, 1991. [29] L. Witt, L. A. Burke, M. R. Barrick, and M. K. Mount, "The interactive effects of conscientiousness and agreeableness on job performance." Journal of applied psychology, vol. 87, no. 1, p. 164, 2002. [30] M. K. Mount, M. R. Barrick, and G. L. Stewart, "Five-factor model of personality and performance in jobs involving interpersonal interactions," Human performance, vol. 11, no. 2-3, pp. 145–165, 1998. [31] S. Rothmann and E. P. Coetzer, "The big five personality dimen- sions and job performance," SA Journal of industrial psychology, vol. 29, no. 1, pp. 68–74, 2003. [32] W. Samek and K.-R. M ̈uller, "Towards explainable artificial intelli- gence," in Explainable AI: interpreting, explaining and visualizing deep learning. Springer, 2019, pp. 5–22. [33] A. S. Wicaksana and C. C. Liem, "Human-explainable features for job candidate screening prediction," in 2017 IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW). IEEE, 2017, pp. 1664–1669. [34] X.-S. Wei, C.-L. Zhang, H. Zhang, and J. Wu, "Deep bimodal regression of apparent personality traits from short video se- quences," IEEE Transactions on Affective Computing, vol. 9, no. 3, pp. 303–315, 2017. [35] C. Ventura, D. Masip, and A. Lapedriza, "Interpreting cnn models for apparent personality trait regression," in Proceedings of the IEEE conference on computer vision and pattern recognition workshops, 2017, pp. 55–63. [36] Y. Gucluturk, U. Guclu, M. Perez, H. Jair Escalante, X. Baro, I. Guyon, C. Andujar, J. Jacques Junior, M. Madadi, S. Escalera et al., "Visualizing apparent personality analysis with deep resid- ual networks," in Proceedings of the IEEE International Conference on Computer Vision Workshops, 2017, pp. 3101–3109. [37] Y. Ding, L. Shi, and Z. Deng, "Low-level characterization of ex- pressive head motion through frequency domain analysis," IEEE Transactions on Affective Computing, 2018. [38] H. Gunes and M. Pantic, "Dimensional emotion prediction from spontaneous head gestures for interaction with sensitive artificial listeners," in International conference on intelligent virtual agents. Springer, 2010, pp. 371–377. [39] Z. Yang and S. S. Narayanan, "Modeling dynamics of expressive body gestures in dyadic interactions," IEEE Transactions on Affec- tive Computing, vol. 8, no. 3, pp. 369–381, 2016. [40] G. An and R. Levitan, "Lexical and acoustic deep learning model for personality recognition." in INTERSPEECH, 2018, pp. 1761– 1765. [41] F. Valente, S. Kim, and P. Motlicek, "Annotation and recognition of personality traits in spoken conversations from the ami meetings corpus," in Thirteenth annual conference of the international speech communication association, 2012. [42] K. Mangalam and T. Guha, "Learning spontaneity to improve emotion recognition in speech," arXiv preprint arXiv:1712.04753, 2017. [43] A. Tawari and M. M. Trivedi, "Speech emotion analysis: Exploring the role of context," IEEE Transactions on multimedia, vol. 12, no. 6, pp. 502–509, 2010. [44] L. Abdel-Hamid, "Egyptian arabic speech emotion recognition using prosodic, spectral and wavelet features," Speech Communi- cation, vol. 122, pp. 19–30, 2020. [45] S. I. Levitan, Y. Levitan, G. An, M. Levine, R. Levitan, A. Rosen- berg, and J. Hirschberg, "Identifying individual differences in gender, ethnicity, and personality from dialogue for deception detection," in Proceedings of the second workshop on computational approaches to deception detection, 2016, pp. 40–44. [46] A. Dhall and J. Hoey, "First impressions-predicting user person- ality from twitter profile images," in International Workshop on Human Behavior Understanding. Springer, 2016, pp. 148–158. [47] N. Al Moubayed, Y. Vazquez-Alvarez, A. McKay, and A. Vincia- relli, "Face-based automatic personality perception," in Proceedings of the 22nd ACM international conference on Multimedia, 2014, pp. 1153–1156. [48] K. S. Meng and L. Leung, "Factors influencing tiktok engagement behaviors in china: An examination of gratifications sought, nar- cissism, and the big five personality traits," Telecommunications Policy, vol. 45, no. 7, p. 102172, 2021. [49] S. Song, S. Jaiswal, E. Sanchez, G. Tzimiropoulos, L. Shen, and M. Valstar, "Self-supervised learning of person-specific facial dy- namics for automatic personality recognition," IEEE Transactions on Affective Computing, 2021. [50] R. Sharma, T. Guha, and G. Sharma, "Multichannel attention network for analyzing visual behavior in public speaking," in 2018 IEEE Winter Conference on Applications of Computer Vision (WACV). IEEE, 2018, pp. 476–484. [51] R. L. Birdwhistell, Kinesics and context: Essays on body motion communication. University of Pennsylvania press, 2010. [52] T. Baltruˇsaitis, P. Robinson, and L.-P. Morency, "Openface: an open source facial behavior analysis toolkit," in 2016 IEEE Winter Conference on Applications of Computer Vision (WACV). IEEE, 2016, pp. 1–10. [53] B. McFee, C. Raffel, D. Liang, D. P. Ellis, M. McVicar, E. Batten- berg, and O. Nieto, "librosa: Audio and music signal analysis in python." [54] B. Schuller, S. Steidl, and A. Batliner, "The interspeech 2009 emo- tion challenge," 2009. [55] S. Koelstra and I. Patras, "Fusion of facial expressions and eeg for implicit affective tagging," Image and Vision Computing, vol. 31, no. 2, pp. 164–174, 2013. [56] M. Koppensteiner, "Motion cues that make an impression: Predicting perceived personality by minimal motion information," Journal of Experimental Social Psychology, vol. 49, no. 6, pp. 1137– 1143, 2013. [Online]. Available: https://www.sciencedirect.com/ science/article/pii/S0022103113001467 [57] R. Ishii, C. Ahuja, Y. I. Nakano, and L.-P. Morency, "Impact of per- sonality on nonverbal behavior generation," in ACM International Conference on Intelligent Virtual Agents, 2020. [58] T. Osugi and J. I. Kawahara, "Effects of head nodding and shaking motions on perceptions of likeability and approachability," Percep- tion, vol. 47, no. 1, pp. 16–29, 2018. [59] B. Lepri, R. Subramanian, K. Kalimeri, J. Staiano, F. Pianesi, and N. Sebe, "Connecting meeting behavior with extraversion-a systematic study," IEEE Transactions on Affective Computing, vol. 3, no. 4, pp. 443–455, 2012. [60] O. Celiktutan and H. Gunes, "Automatic prediction of impressions in time and across varying context: Personality, attractiveness and likeability," IEEE transactions on affective computing, vol. 8, no. 1, pp. 29–42, 2015. [61] E. Oberzaucher and K. Grammer, "Everything is movement: on the nature of embodied communication," Embodied communication in humans and machines, pp. 151–177, 2008. [62] K. Ruhland, K. Zibrek, and R. McDonnell, "Perception of person- ality through eye gaze of realistic and cartoon models," in Proceed- ings of the ACM SIGGRAPH Symposium on Applied Perception, 2015, pp. 19–23. [63] S. M. Breil, S. Osterholz, S. Nestler, and M. D. Back, "13 contri- butions of nonverbal cues to the accurate judgment of personality traits," The Oxford handbook of accurate personality judgment, p. 195, 2021. [64] T. DeGroot and D. Kluemper, "Evidence of predictive and incre- mental validity of personality factors, vocal attractiveness and interview," International Journal of Selection and the situational Assessment, vol. 15, no. 1, pp. 30–39, 2007. [65] S. P. Levine and R. S. Feldman, "Women and men's nonverbal behavior and self-monitoring in a job interview setting," Applied HRM Research, vol. 7, no. 1, pp. 1–14, 2002. [66] S. Walther, F. Ramseyer, H. Horn, W. Strik, and W. Tschacher, "Less structured movement patterns predict severity of positive syndrome, excitement, and disorganization," Schizophrenia bulletin, vol. 40, no. 3, pp. 585–591, 2014. [67] F. Eyben, F. Weninger, L. Paletta, and B. W. Schuller, "The acoustics of eye contact: detecting visual attention from conversational au- dio cues," in Proceedings of the 6th workshop on Eye gaze in intelligent human machine interaction: gaze in multimodal interaction, 2013, pp. 7–12. [68] D. House, "Integrating audio and visual cues for speaker friendli- ness in multimodal speech synthesis," in Eighth Annual Conference of the International Speech Communication Association, 2007. 12 Surbhi Madan is currently pursuing her PhD at the Indian Institute of Technology Ropar, In- dia. She received an M.Tech degree in Com- puter Science and Engineering from the National Institute of Technology, Hamirpur (India). She received her B.Tech. in Information Technology from Uttar Pradesh Technical University, Luc- know (India). Her research interests include af- fective computing, computer vision, and Human- Computer Interaction. Monika Gahalawat received her Master's de- gree in Computer Science and Engineering from the Indian Institute of Technology Roorkee and Bachelor of Engineering degree from Chandi- garh College of Engineering and Technology affiliated with Punjab University in Chandigarh. She's currently a PhD student at the University of Canberra, Australia. Her research interests include computer vision, affective computing, be- havior analysis and human-computer interac- tion. Tanaya Guha received her Ph.D. degree in Elec- trical & Computer Engineering from the Univer- sity of British Columbia, Vancouver, in 2013. She is a Senior Lecturer of Computing Science at University of Glasgow. Her research focuses on developing machine intelligence capabilities to understand human behavior combining ma- chine learning, speech/signal processing and computer vision. She is an elected member of IEEE MSA TC, IEEE MMSP TC and an execu- tive committee member of AAAC. Roland Goecke received his Ph.D. degree in computer science from The Australian National University, Canberra, in 2004. He is Professor of Affective Computing with the University of Canberra, where he is serves as Director of the Human-Centred Technology Research Centre. His research interests include affective comput- ing, pattern recognition, computer vision, hu- man–computer interaction and multimodal signal processing. He is a senior member of the IEEE, and an ACM and AAAC member. Ramanathan Subramanian received his Ph.D. in Electrical and Computer Engg. from NUS in 2008. He is Associate Professor in the School of IT & Systems, University of Canberra. His past affiliations include IIT Ropar, IHPC (Singapore), IIIT Hyderabad and U Glasgow (Singapore), UIUC-ADSC (Singapore). His research focuses on Human-centered computing, especially on modeling non-verbal behavioral cues for interac- tive analytics. He is an IEEE Senior Member, and an ACM and AAAC member.
http://arxiv.org/abs/2302.11571v1
2023-02-20T07:37:03
2023-02-20T07:37:03
Personalized and privacy-preserving federated heterogeneous medical image analysis with PPPML-HMI
Heterogeneous data is endemic due to the use of diverse models and settings of devices by hospitals in the field of medical imaging. However, there are few open-source frameworks for federated heterogeneous medical image analysis with personalization and privacy protection simultaneously without the demand to modify the existing model structures or to share any private data. In this paper, we proposed PPPML-HMI, an open-source learning paradigm for personalized and privacy-preserving federated heterogeneous medical image analysis. To our best knowledge, personalization and privacy protection were achieved simultaneously for the first time under the federated scenario by integrating the PerFedAvg algorithm and designing our novel cyclic secure aggregation with the homomorphic encryption algorithm. To show the utility of PPPML-HMI, we applied it to a simulated classification task namely the classification of healthy people and patients from the RAD-ChestCT Dataset, and one real-world segmentation task namely the segmentation of lung infections from COVID-19 CT scans. For the real-world task, PPPML-HMI achieved $\sim$5\% higher Dice score on average compared to conventional FL under the heterogeneous scenario. Meanwhile, we applied the improved deep leakage from gradients to simulate adversarial attacks and showed the solid privacy-preserving capability of PPPML-HMI. By applying PPPML-HMI to both tasks with different neural networks, a varied number of users, and sample sizes, we further demonstrated the strong robustness of PPPML-HMI.
[ "Juexiao Zhou", "Longxi Zhou", "Di Wang", "Xiaopeng Xu", "Haoyang Li", "Yuetan Chu", "Wenkai Han", "Xin Gao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11571v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11571v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.IV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.IV", "cs.CV", "cs.LG" ]
IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2023 1 Personalized and privacy-preserving federated heterogeneous medical image analysis with PPPML-HMI Juexiao Zhou, Longxi Zhou, Di Wang, Member, IEEE, Xiaopeng Xu, Haoyang Li, Yuetan Chu, Wenkai Han, Xin Gao, Member, IEEE 3 2 0 2 b e F 0 2 ] V I . s s e e [ 1 v 1 7 5 1 1 . 2 0 3 2 : v i X r a Abstract- Heterogeneous data is endemic due to the use of diverse models and settings of devices by hospi- tals in the field of medical imaging. However, there are few open-source frameworks for federated heterogeneous medical image analysis with personalization and privacy protection simultaneously without the demand to modify the existing model structures or to share any private data. In this paper, we proposed PPPML-HMI, an open-source learning paradigm for personalized and privacy-preserving federated heterogeneous medical image analysis. To our best knowledge, personalization and privacy protection were achieved simultaneously for the first time under the federated scenario by integrating the PerFedAvg algorithm and designing our novel cyclic secure aggregation with the homomorphic encryption algorithm. To show the utility of PPPML-HMI, we applied it to a simulated classification task namely the classification of healthy people and patients from the RAD-ChestCT Dataset, and one real-world seg- mentation task namely the segmentation of lung infections from COVID-19 CT scans. For the real-world task, PPPML- HMI achieved ∼5% higher Dice score on average com- pared to conventional FL under the heterogeneous sce- nario. Meanwhile, we applied the improved deep leakage from gradients to simulate adversarial attacks and showed the solid privacy-preserving capability of PPPML-HMI. By applying PPPML-HMI to both tasks with different neural networks, a varied number of users, and sample sizes, we further demonstrated the strong robustness of PPPML-HMI. Index Terms- Medical imaging, Personalization, Feder- ated learning, Privacy, COVID-19 I. INTRODUCTION The research reported in this publication was supported by the King Abdullah University of Science and Technology (KAUST) with grants from the Office of Research Administration (ORA) at KAUST under award numbers FCC/1/1976-44-01, FCC/1/1976-45-01, URF/1/4352-01-01, REI/1/4742-01-01 REI/1/4473-01-01, URF/1/4663- 01-01, BAS/1/1689-01-01 and funding from the AI Initiative REI/1/4811- 10-01. Corresponding author: Xin Gao. Juexiao Zhou and Longxi Zhou are co-first authors. J. Zhou, L. Zhou, D. Wang, X. Xu, H. Li, Y. Chu, W. Han, and X. Gao are with the Computer Science Program, Computer, Electrical and Mathematical Sciences and Engineering Division, King Abdullah University of Science and Technology (KAUST), Thuwal 23955-6900, Kingdom of Saudi Arabia and Computational Bioscience Research Center, King Abdullah University of Science and Technology, Thuwal 23955-6900, Kingdom of Saudi Arabia. (e-mail: [email protected]). D ATA-HUNGRY artificial intelligence (AI), including var- ious machine learning (ML) and deep learning (DL) methods [1], is increasingly being applied to solve miscel- laneous tasks in medical image analysis (MIA) and has led to disruptive innovations in pathology, radiology, and other fields [2]–[8]. However, since modern DL models typically have millions or even more parameters [9], a mass of curated data is usually required to train such data-hungry models to achieve clinical-grade performance [10]–[12]. In contrast, even with modern advanced data science, generating a huge amount of data to train models independently is still challenging for most hospitals and clinics. Therefore, seeking the cooperation of institutions to jointly generate data and train a joint model becomes an ideal solution [13]. In centralized training, the server needs to collect data from all collaborators. Then the model will be trained on the server. Nevertheless, such a strategy leads to concerns related to data security and privacy. For example, training an AI-based lung infection detector [14]–[17] required a large amount of high-quality comput- erized tomography (CT) scans and human-labelled metadata. However, such data is difficult to be obtained and shared in reality because health data is usually highly sensitive and tightly regulated [5], [18]. Hence, federated learning (FL) [19]–[22] was proposed as a learning paradigm that aims to address data governance and privacy issues by collaboratively training models without the need to share the data itself. Federated learning In FL, it is assumed that a set of n (n ≥ 2) users are connected to a server, where each user can only access its own data [19]. Upon that, the users' goal is to acquire a model that captures the features of all users' data without sharing their local data with any other user or server. Though each user can solely train a model with its own data, the independently trained model of each user may not generalize well to other users' data or new samples. Thus the following FL procedure was proposed to learn a more generalized server model. Firstly, all users will receive a copy of the current server model and update the local model using its own data. After that, users send the updated model to the server. Finally, the server aggregates received local models to update the server model for the next broadcasting. This process continues until a generalized server model could be generated [20], [23]. To be more specific, McMahan et al. [20] proposed the federated averaging (FedAvg) algorithm, which 2 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2023 is the most famous aggregation method in the community, to aggregate local models collected by the server. However, previous studies showed that the FedAvg algo- rithm might not converge or could be slowed down when local models drift significantly from each other due to the hetero- geneity of local non-independent and identically distributed (non-IID) data [24]. Therefore, in the presence of heterogene- ity, the server model trained by FL may not generalize well to each user's data [25], which is a significant obstacle to applying FL in practice. Taking the infection segmentation on CT scans as an example, different hospitals may have diverse CT scanners and scanning settings, thus the CT scans will have heterogeneity. With that, the server model trained with FL would be unable to achieve clinical-grade performance on each user's data. the server model Personalized federated learning To apply the FL paradigm with the heterogeneous data as in the case of CT diagnosis, personalized federated learning (PFL) was devised as an enhanced version of FL [26]–[31]. To address person- alization in FL, a two-step approach namely 'FL training + local adaptation' was regarded as the most commonly acknowledged strategy by the FL community [29], [32]. With is firstly trained using FL this strategy, on heterogeneous users' CT data. Unexpectedly, the server model may perform poorly on each user's data due to data heterogeneity. Therefore, a few additional training steps are required to adapt this server model locally and realize the personalization. Depending on the specific strategies used in training, different personalized variants of the FedAvg algorithm were proposed, such as pFedMe [28], Per-FedAvg [27] and APFL [33]. However, all the aforementioned methods were theoretical research, and a little applied attempt has been conducted, especially in the medical analysis field. In addition to optimizing the training strategies for heterogeneous data, FedAVG+Share [34] improves performance on non-IID data by sharing a small amount of data among users. However, the strategy could not be adopted when the user's data is required to be strictly private. FedReplay [35] needs to train a universal and auxiliary encoder network, which encodes each user's data into latent variables that will be used to train the server model for classification. Therefore, given an existing neural network model, e.g. a segmentation model, it needs to be disassembled and restructured to work with FedReplay in FL. Thus FedReplay could not be simply and directly combined with the existing models and also might not be easily used by new users as a closed-source method, which might limit its wide usage. As the latest work, FedPerGNN [36] was specially designed for graph neural networks and thus was limited to the application of graph data, which is usually different from medical imaging data. Privacy in FL and PFL Privacy is a hot and significant topic in the age of medical big data [37]. Nevertheless, previous studies showed that FL is still vulnerable to attacks, such as data poisoning attack [38], membership inference attack [39]–[41], source inference attack (SIA) [42], attribute reconstruction attack [43], and inversion attack [44]–[47], thus compromising data privacy. Similar to FL, PFL is also facing the threat of privacy attacks. Diverse strategies could be used to protect data privacy with FL and PFL. As the latest research, differential privacy (DP) [48] was used to add noise to the gradient transmitted in PFL [36], [49] as same as in FL [50] to protect the privacy of users' data. However, DP adopts the mechanism of adding noise to enhance privacy protection while sacrificing model accuracy [51], resulting in difficulty to achieve clinical-grade performance in practice. Besides, cryptographic approaches, including secure aggregation (SA) [52], [53], homomorphic encryption (HE) [54], multi-party computation (MPC) [55] and etc., realize privacy preservation by sacrificing time and space without affecting the accuracy much. Among these techniques, MPC requires the involvement of multiple servers, which is different from the case with only one server. Conventional SA requires heavy communications between users and the server, which will cause overhead for users with limited resources, while the latest decentralized version of SA [56] transferred the process of aggregation from the server to users, reduced the need for high communication between all users and the server, and further strengthened the privacy protection as the server is usually an un-trusted third party. However, the protocol used in [56] required a three-step process as 'decryption- summation-encryption' to aggregate the local gradients into the transmitted gradients in the loop, which could be further simplified into a two-step process as 'encryption-summation' with the help of HE as in PPPML-HMI. To strengthen privacy protection in FL, several open-source methods, such as FATE [57], PySyft [58], and NVFlare [59], have already been developed to secure gradients during training using techniques like SA and HE. However, these methods are mainly based on the conventional FL and thus could not address the challenges with heterogeneous data while still allowing privacy protection, because personalization and privacy protection are still not addressed simultaneously under the federated scenario. Heterogeneity and privacy in MIA As a representa- tive of many medical tasks that would strongly benefit from personalization and privacy protection, especially in medical imaging, the accurate detection and segmentation of lung infection caused by the severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2, COVID-19) have been such an important task since 2020 [60]. To diagnose lung diseases, imaging is the major source of data and the most com- monly used imaging technologies are X-rays and CT scans [61]. Meanwhile, DL has been widely applied in developing the computer-aided diagnosis (CAD) systems for COVID- 19 [8], [15], [62]–[66]. Most aforementioned works require centralized training, where the research institution acts as a coordinator/server to collect raw CT scans from users like hospitals to train a model centrally. Several problems exist in this process. Firstly, all users need to strictly trust each other and the server in order to share the raw CT scans, which might limit the number of users and available data involved, leading to insufficient training data. Secondly, users have to deliver the private raw CT scans to the server, leading to potential privacy breaches. Therefore, a proper FL approach is necessary to allow users to keep their data private, thus more data providers could participate in the co-training of JUEXIAO ZHOU et al.: PPPML-HMI 3 from COVID-19 CT scans by extending our previous method for the task [8], [15], which was also a general method for segmentation of lung, tracheal, vascular, etc. By applying PPPML-HMI to both tasks with different neural networks, a varied number of users, and sample sizes, we further demonstrated the robustness of PPPML-HMI. Finally, we also applied the improved deep leakage from gradients to simulate adversarial attacks and showed the strong privacy-preserving capability of PPPML-HMI. A. Design of PPPML-HMI II. METHODS PPPML-HMI is built up with two major modules as a train- ing framework: the PFL (Section II − D) and the CSAHE modules (Figure 1, Algorithm 1 and Section II − E). During each round of the global training, the server broadcasts the server model to each user for initialization. Then, each user trains the local model using the local private data. After finishing the local training, each user calculates the gradient between the local model and the server model. To avoid sending users' gradients directly to the server, which could lead to potential privacy leakage, PPPML-HMI transfers the gradient aggregation process that is originally performed on the server to a loop composed of all users through the CSAHE mechanism in a decentralized manner. At the end of each global training, the CSAHE mechanism is executed. A user in the loop will be randomly selected as the initiator, who will protect its own gradient by summing a random mask as noise to the gradient and encrypting the noised gradient with HE, and will transmit the noised gradient into the loop for further aggregation. The noise in the aggregated gradients is kept till the end of the execution of the CSAHE mech- anism. PPPML-HMI achieves decentralized secure gradient aggregation with homomorphic encryption (Section II − E), thus each user could confidently aggregate their own gradients to the transmitted gradient without worrying about privacy issues. The code of PPPML-HMI is publicly available at https://github.com/JoshuaChou2018/PPPML-HMI. B. Dataset processing For the classification task, we simulated and constructed our heterogeneous data from the RAD-ChestCT Dataset [73], [74], which includes 35,747 chest CT scans from 19,661 adult patients. For the segmentation task, we collected 180 anonymized CT scans generated by diverse CT scanners and scanning parameters from five hospitals labelled as A ∼ E. All patients were confirmed to be COVID-19 positive by either the nucleic acid test or antibody test. For the classification task, we used the publicly available RAD-ChestCT Dataset [73], [74]. For the segmentation task, the data from partner hospitals are available upon request. To perform the segmentation of lung infections from the 3D CT scans, we need to find a mapping F : RH×W ×S (cid:55)→ {0, 1}H×W ×S, where H × W is the height and width of each 2D CT image and S is the number of images. Since the data generated by different CT scanners owned various volume sizes, spatial normalization was adopted to re-scale Fig. 1. Scheme of PPPML-HMI. In our real-world case, hospitals use devices from different manufacturers with various models and settings for the detection of lung infection by COVID-19. The use of diverse de- vices generates data with inherent differences, namely heterogeneous data. With FL, the goal is to jointly train a consensus model with the data from each hospital without sharing the data itself. With homogeneous data across hospitals, FL could efficiently train a server model that works well for all hospitals. However, when hospitals have heterogeneous data, the server model trained by FL could not perform well when applied to each hospital. Thus, PPPML-HMI allows models to adapt to heterogeneous data. To strengthen the privacy protection of PPPML- HMI, we designed the cyclic secure aggregation with homomorphic encryption. the model and more diverse data could be used to train a model with better generalization power. Though FL has been widely applied in tasks related to COVID-19 in the latest research [67]–[72], the heterogeneous data and privacy breaches are still problems as there is currently no such open-source solution for personalized and privacy-preserving federated heterogeneous medical image analysis, especially for the heterogeneous COVID-19 CT analysis. Here, we proposed PPPML-HMI, a novel open-source, robust, user-friendly and plug-and-play method for personal- ized and privacy-preserving federated heterogeneous medical image analysis (Figure1). PPPML-HMI specifically targets the scenario where no raw data should be shared with any third party, no structural modification should be conducted to existing DL models, and in a context of heterogeneous data. To our best knowledge, personalization and privacy protection were achieved simultaneously for the first time under the federated scenario by integrating the PerFedAvg algorithm and designing the novel cyclic secure aggregation algorithm with homomorphic encryption (CSAHE). To demonstrate the utility of PPPML-HMI, we applied it to a simulated classification task namely the classification of healthy people and patients from the RAD-ChestCT Dataset [73], and one real-world segmentation task namely the segmentation of lung infections 4 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2023 raw CT data into a machine-agnostic standard space with fixed shape (512 × 512 × 512). As in [15], we decomposed the 3D segmentation of each 3D CT scan into three 2D segmentation problems along the x-y, y-z, and x-z views (axial, sagittal, and coronal). The training along each plane was performed independently. All prediction and visualization of samples were performed with models trained with data excluding the corresponding sample itself. D. Personalized federated learning To accomplish personalized FL, the personalized FedAvg (Per-FedAvg) [27] algorithm was adopted to acquire the op- timal initial model (meta-model) as the server model, which could be easily adapted to the local heterogeneous data by performing just a few steps of gradient descent. Per-FedAvg was inspired by the fundamental idea of the Model-Agnostic Meta-Learning (MAML) framework [76]. Given a set of tasks from different underlying distributions, instead of finding the model that generalizes on all tasks as FL, MAML tends to find a meta-model that could perform better in different tasks after a few steps of local gradient descent. (cid:80)n In FL, (cid:80)n i=1 fi(w), where fi the goal of optimization is minw∈Rd f (w) = 1 is the loss function to user ui. n With the concept of MAML, the goal of the optimization becomes finding a good initialization as minw∈Rd F (w) = i=1 fi(w − α(cid:79)fi(w)), where α (α ≥ 0) is the step size. 1 n As shown in Algorithm1, at each epoch k, the server will broadcast the server model to all users. Then, all users train their local model with τ local epochs. After τ will local epochs, a list of {wi t=0 will be generated with k+1,t = respect k+1,t−1 − β (cid:101)(cid:79)Fi(wi wi k+1,t−1), β is the local learning rate and (cid:101)(cid:79)Fi(wi k+1,t−1) is an estimate of (cid:79)Fi(wi to the user ui, where wi k+1,0 = wk, wi k+1,t−1). k+1,t}τ Fig. 2. A) Illustration of two tasks. We applied PPPML-HMI to the classification of healthy people and patients with 3D DenseNet on the RAD-ChestCT Dataset, and the segmentation of the lung infections of COVID-19 with a 2.5D U-Net method [8], [15]. Illustration of the communication network and attackers of FL (B) and PPPML-HMI (C). Two types of attackers exist in our setting: 1) Attackers who can intercept messages sent from any users to the server or between users (type I), and 2) Honest-but-curious attackers who are part of the users of PPPML-HMI (type II). C. Neural network for the segmentation of lung infections For the classification task, we adopted the 3D DenseNet [75] as the backbone DL model. For each segmentation task along the three views, we trained an independent U-Net that took five adjacent images with dimension: R5×512×512 as inputs, and output the probability map of infection regions for the central image with dimension: R512×512. The U-Net for 2D segmentation consisted of four encoding layers, one bottleneck layer, and four decoding layers as shown in Figure2A. Given a 3D CT scan, we applied three 2D U-Net models and generated three segmentation results pxy, pyz, pxz along the x-y, y-z, and x-z views. The final segmentation result in 3D space was calculated by summing up three intermediate predictions followed by taking a threshold of 2 as pf inal = (pxy + pyz + pxz) ≥ 2. E. Cyclic secure aggregation with homomorphic encryption We designed the cyclic secure aggregation with homomor- phic encryption (CSAHE) algorithm to transfer the secure aggregation from the server to a loop composed of all users in a decentralized manner with a two-step process as 'encryption- summation' for all non-initiator users. To protect the gradi- ents transmitted in CSAHE, we encrypted all gradients with homomorphic encryption (MHE) based on the Cheon-Kim- Kim-Song (CKKS) cryptographic scheme [77] that provides approximate arithmetic over vectors of complex numbers and performed the aggregation homomorphically with TenSEAL [78], which is a python library for performing homomorphic encryption operations on tensors, built on top of Microsoft SEAL. We integrated the CSAHE into PPPML-HMI to protect the gradients of users. As shown in Algorithm1, in each epoch, all users form a loop and an initiator is selected randomly from all users, while the remaining users are called non-initiator users. The initiator generates a random mask using a Gaussian distribution with a self-defined large σ. After that, the random mask will be summed to the initiator's gradient to protect its actual value. Then, the noised gradient will be homomorphi- cally encrypted and transmitted to the next user in the loop, who can also safely aggregate its gradient to this transmitted gradient homomorphically, and transmit the newly aggregated gradient to the next user. The aforementioned process keeps working till the aggregated gradient is transmitted back to the initiator. Then, the initiator eliminates the random mask from the aggregated gradient and decrypts it to recover the actual JUEXIAO ZHOU et al.: PPPML-HMI 5 Algorithm 1 PPPML-HMI Require: K is the number of global epochs; τ is the number of local epochs; N is the number of users; γ is the number of final adaptation epochs; wk is the parameters of the server model at global epoch k; wi k,t is the parameters of the model of user ui at local epoch t and global epoch k; γ is the number of epochs for the final adaptation. for k = 0, . . . , K − 1 (Global epoch) do 1: procedure SYSTEM STARTS 2: 3: 4: 5: 6: 7: Server sends wk to all users; for each user ui with i = 0, .., N − 1 do Set wi for t = 0, ..., τ − 1 (Local epoch) do k+1,0 = wk Compute the stochastic gradient ̃(cid:53)fi(wi k+1,t−1, Di) using dataset Di 2 α ̃(cid:53) server 8: 9: 10: 11: 12: 13: Set ̃wi Set k+1,t = wi wi k+1,t k+1,t−1 − α ̃(cid:53)fi(wi k+1,t−1, Di) = wi k+1,t−1 − β(I − fi(wi (cid:48)(cid:48)i)) ̃(cid:53)fi( ̃wi (cid:48)i) k+1,t−1, D Each user ui with i = 0, .., N − 1 calculates the gradient compared k+1,t, D to the server ∆wi k+1,τ = (wi k+1,τ − wk) Execute cyclic secure aggregation with CSAHE(u0, ..., uN −1) Initiator uI sends securely aggregated update ∆wCSA k+1,τ back to the wk + 1 Server updates its model by averaging over the received gradients wk+1 = N (∆wCSA k+1,τ ) for t = 0, ..., γ − 1 (Final local adaptation) do Server broadcasts the meta-model to all users for each user ui with i = 0, .., N − 1 do 14: 15: 16: 17: 18: 19: function CSAHE(u0, ..., uN −1) 20: User ui adapts the meta-model with local private data Organize all users in a loop. Randomly select a user uI with I ∈ {0, ..., N − 1} as the initiator, generate a random mask R with the same shape as the gradient ∆wI k+1,τ hold by uI from Gaussian Noise with a large σ. User ur adds the R to the gradient as ∆wCSA k+1,τ = ∆wI encrypt it with homomorphic encryption (HE) as HE(∆wCSA k+1,τ ) for each user uj in the circular chain, until j = I do HE(∆wCSA k+1,τ ) = HE(∆wCSA User uj transfers the HE(∆wCSA k+1,τ ) + HE(∆wj k+1,τ ) to the next user in the loop k+1,τ + R and k+1,τ ) The initiator uI removes the random mask from the final aggregated gradient k+1,τ )−HE(R) and decrypts the encrypted k+1,τ ) = HE(∆wCSA with HE(∆wCSA aggregated gradient HE(∆wCSA k+1,τ ) into ∆wCSA k+1,τ . Return the securely aggregated gradient ∆wCSA k+1,τ 21: 22: 23: 24: 25: 26: Algorithm 2 iDLG Require: Differentiable model M, model parameters W, private training data and labels (x, c), gradients produced by the private data ∇W ,dummy data and labels (x(cid:48), c(cid:48)), number of iterations N , learning rate η and loss function l 1: Extract the target ground-truth label to initialize the dummy label c(cid:48) 2: Initialize the dummy data x(cid:48) ← N (0, 1) 3: for i ← 1 to N do 4: 5: 6: Calculate the dummy gradients: ∇W ← ∂l(M(x(cid:48), W), c(cid:48))/∂W Calculate the loss: LG = (cid:107)∇W(cid:48) − ∇W(cid:107)2 F Update the dummy data: x(cid:48) ← x(cid:48) − η∇x(cid:48) LG value. Finally, the initiator sends the aggregated gradient to the server for updating the server model. With CSAHE, each user except the initiator only needs to interact with two users located before and after in the loop and does not need to have any interaction with the server. The secure aggregation in PPPML-HMI is conducted in a decentralized manner, which is different from the conventional SA that happens at the server. HE in CSAHE allows all non- initiator users to aggregate their gradients homomorphically the need to decrypt. As shown in Algorithm1, without once the wi k+1,τ of each user ui is calculated, user ui will calculate the difference between the wi k+1,τ and the server model wk as (cid:52)wi k+1,τ with i = 0, ..., N − 1 will be securely aggregated through the k+1,τ − wk. Then, all (cid:52)wi k+1,τ = wi CSAHE algorithm. Finally, the server will collect the securely aggregated gradient ∆wCSA k+1,τ from the initiator for updating the server model with wk+1 = wk + 1 N ∆wCSA k+1,τ . The public key encryption scheme is used by CSAHE, where a public key and a secret key are generated (Figure2C). The public key is shared by all users to allow the encryption of gradients before the homomorphic aggregation and the private key is held only by the initiator to allow the decryption of the aggregated gradient before sending it to the server. Although a non-initiator cannot obtain the private key by default, we still need to discuss the vulnerability of CSAHE in practice where the private key could be leaked, thus a non- initiator could also decrypt the homomorphically encrypted gradient when the attack happens. F. iDLG reconstruction attack Previous research has shown that the gradients transmitted from the user to the server in FL may still compromise data privacy [44]–[46]. Among those studies, the improved deep leakage from gradient (iDLG) is a state-of-the-art approach to obtain private training data from the gradients transmitted between users and the server as shown in Algorithm2. G. Performance evaluation To evaluate the performance on the classification task, we T P +T N used the accuracy as defined: Accuracy = T P +T N +F P +F N , where TP, TN, FP, and FN stand for true positive, true negative, false positive and false negative. To evaluate the performance of lung infection segmentation with different methods, we used the Dice score and the recall as defined: Dice = 2|Y ∩Y (cid:48)| , where Y is the actual infection region annotated by radiologists, Y (cid:48) is the predicted infection region, and |Y | represents the cardinality of Y . |Y |+|Y (cid:48)| , Recall = |Y ∩Y (cid:48)| |Y | H. Hyper-parameter selection and training settings To ensure a fair comparison, we tested the number of global epochs from {10, 20, 50, 100} and the number of local epochs from {1, 5, 10, 20}. From our pre-experiments, we noticed that the number of global epochs K = 20 and the number of local epochs τ = 10 enabled the model to converge and provided a good trade-off between the computation time and model performance. The batch size and learning rate were set to be 64 and 10−4 respectively. For CSAHE, the random noise was generated from a Gaussian distribution with mean = 0 and a randomly chosen large standard deviation (> 100) to avoid the potential inversion attack. During the training, 32 workers were used for data loading and processing on one machine with 120GB RAM and one NVIDIA V100 GPU. Five-fold cross-validation was adopted for data splitting and model training. III. RESULTS We applied PPPML-HMI to a simulated heterogeneous dataset from the RAD-ChestCT dataset, where users' data were grouped according to the slice thickness from 2 mm, 6 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2023 5 mm, 10 mm, to train a classification model and show the robustness of PPPML-HMI when varying the number of users and the sample sizes. We also applied PPPML-HMI to a real- world case, where heterogeneous data were generated by five hospitals with different CT scanners, to train a segmentation model for COVID-19 lung infections. To demonstrate the effectiveness of PPPML-HMI, we compared three methods, including training independently using only each user's own data, training in a centralized training manner using complete data, and training with one of the most classical and famous algorithms in FL namely FedAvg [20]. With both tasks to- gether with different neural networks, the number of users, and sample sizes, we further gave evidence of the robustness and robustness of PPPML-HMI to these parameters. Meanwhile, we applied the improved deep leakage from gradients to simulate adversarial attacks on the segmentation task and showed the strong privacy-preserving capability of PPPML- HMI. TABLE I DESCRIPTION OF THE RAD-CHESTCT DATASET AND AVERAGED PREDICTED ACCURACY OF METHODS. Split ID User ID 1 2 3 A A B A B C Slice thickness (mm) 2 2 5 2 5 10 No. of Patients Centralized training Federated learning PPPML-HMI 392 196 196 174 68 150 0.97 0.95 0.92 / 0.68 0.77 / 0.94 0.89 A. PPPML-HMI is generalizable with various numbers of users and samples on the classification task. To show the robustness of PPPML-HMI when varying the number of users and the sample sizes, we simulated three sets of data partitions on the RAD-ChestCT dataset [73], [74] according to the slice thickness of CT scans and labeled them as Split 1, Split 2, and Split 3 as shown in TableI. Split 1 had only one user with 392 CT scans, which represented the centralized training scenario. Split 2 had two users with an equal number of CT scans (196 and 196) but with different slice thicknesses (2 mm and 5 mm). Split 3 had three users with a varied number of CT scans (174, 68, and 150) and slice thicknesses (2 mm, 5 mm, and 10 mm) simultaneously. For each split, the goal was to train models for classifying healthy people and patients based on CT scans. Compared to centralized training, FL led to a drastic reduction in the averaged accuracy at Split 2 and Split 3, where PPPML-HMI showed less reduction and better performance compared to FL. These results provided evidence of the robustness of PPPML- HMI when varying the number of users and the sample sizes. B. PPPML-HMI achieved personalization for federated heterogeneous segmentation of lung infections by COVID-19 Since the classification task was relatively easy, we further applied PPPML-HMI to a real-world case, namely the seg- mentation of lung infections by COVID-19. There were five hospitals in the real-world case, labeled as A ∼ E, each of which used CT scanners of different models (Brilliance 16, iCT 256, Ingenuity CT, BrightSpeed, Optima CT520, Optima CT540, Discovery CT750 HD, SOMATOM Definition Edge, and SOMATOM Scope) from three manufacturers (Philips, GE medical systems, and SIEMENS). Hospitals also used different settings, such as slice thickness (1.00 nm, 1.25 nm, 2.00 nm, 3.30 nm, 5.00 nm, and 7.50 nm), and provided various numbers of data ranging from 9 to 119 as shown in Table II. Different CT scanners and settings used by five hospitals led to inherent differences in the generated CT scans. As shown in Figure 3A, we performed the dimension reduction and clustering on the original CT scan data provided by the hospital with the uniform manifold approximation and projection (UMAP) [79] and assigned different colors to visualize the inherent differences between data according to the manufacturer. Based on the results, CT scans generated by the CT scanners manufactured by GE medical system showed significant differences from that of other manufacturers, in- cluding Philips and SIEMENS, and indicated that inherent differences existed in CT scans generated by different hospitals with diverse CT scanners. To show the effectiveness of PPPML-HMI on federated heterogeneous medical image analysis, we compared different approaches, including the centralized training using complete data from all hospitals, the independent training using data from each hospital respectively, and the most classical and famous FL algorithm namely FedAvg as shown in Figure 3. Without taking the data privacy issues into consideration, the centralized training worked best when we collected complete data from all users A ∼ E to train the server model and performed the prediction on each user's data (ADice = 0.64, BDice = 0.62, CDice = 0.51, DDice = 0.51, EDice = 0.69,) as shown in Figure 3B. However, when the privacy issue matters, the server could not collect data from users, thus centralized training could not be performed. Moreover, since data exists in a distributed manner, the heterogeneous data might cause problems in the FL scenario. To train models with heterogeneous data in FL, as one solution, using each user's own data to train independent models resulted in a significant performance reduction ((cid:52)Dice = −0.08, −0.01, −0.07, −0.05, −0.03 for users A ∼ E respec- tively). Meanwhile, transferring a model trained on one user's data to another user showed even worse performance and indicated poor generalization ability of models trained with such a method, e.g. applying the model trained on user C to user D only yielded a Dice score of 0.28. These results provided further evidence of the strong heterogeneity in data across users in the real-world case. Since training a model with each user's own data did not meet the need for clinical-grade performance, training a model using the information in all users' data but with- out sharing the raw data was necessary. With that, FL was the most intuitive solution. However, because of the strong heterogeneity of users' data, the server model trained by FL (ADice = 0.51, DDice = 0.39, EDice = 0.63) performed even worse on users A, D, and E than the independently trained model using only the users' own data (ADice = 0.56, DDice = JUEXIAO ZHOU et al.: PPPML-HMI 7 TABLE II DESCRIPTION OF THE COVID-19 DATASET. THERE ARE 5 HOSPITALS (A∼E) AND EACH OF THEM OWNS DATA GENERATED BY DIFFERENT CT SCANNERS AND SETTINGS. User ID A B C D E System label P B16 2.0 P B16 3.3 P B16 7.5 P I256 1.0 P I256 5.0 P I 1.0 G B 1.25 G B 5.0 G CT520 1.25 G CT540 1.25 G CT750 5.0 S SDE 1.0 S SS 2.0 Manufacturer Philips Philips Philips Philips Philips Philips GE medical systems GE medical systems GE medical systems GE medical systems GE medical systems SIEMENS SIEMENS Model Brilliance 16 Brilliance 16 Brilliance 16 iCT 256 iCT 256 Ingenuity CT BrightSpeed BrightSpeed Optima CT520 Optima CT540 Discovery CT750 HD SOMATOM Definition Edge SOMATOM Scope Slice thickness (mm) 2.00 3.30 7.50 1.00 5.00 1.00 1.25 5.00 1.25 1.25 5.00 1.00 2.00 No. of Patients 5 1 6 114 5 9 1 4 11 7 1 10 6 No. of Total 12 119 9 24 16 Fig. 3. A) Dimension reduction and clustering with UMAP according to the manufacturer indicated that CT scans generated by different CT scanners had significant inherent differences. B) Heatmap showed the Dice score of segmentation when applying models trained centrally on the data of each hospital. C) Barplot showed the Dice score of models trained centrally, with federated learning, and with PPPML-HMI. 0.46, EDice = 0.66) as shown in Figure 3C. Meanwhile, user C had only 9 samples and the data heterogeneity was not as significant as those between other users' data (Figure 3A), thus the server model trained with FL could achieve similar performance as the centralized training with complete data only at user C (Figure 3B, C). In contrast to FL, similar to MAML, the server model generated by PPPML-HMI was a good initialization, which could learn the common features in heterogeneous data and could be easily adapted to local user's data by a few local training steps. As shown in Figure 3C, with the server model generated by PPPML-HMI as an initialization, only γ (γ < 5) steps of local training on the user's data could adapt the server model to local user's data (ADice = 0.62, BDice = 0.61, CDice = 0.51, DDice = 0.51, EDice = 0.68) and achieve a similar performance as the centralized training with complete data and better performance than FL under the same total number of epochs. Additionally, the improvement of PPPML-HMI compared to FL was most significant for users A and D, as the data of both users showed the most significant data heterogeneity from the data of other users as shown in Figure 3A. To further understand the differences in performance be- tween methods, we visualized the predicted segmentation of the lung infections on a high-quality sample (A000069) and a low-quality sample (A000075), respectively. The low-quality sample had significantly worse clarity and resolution of CT images than the high-quality sample as shown in Figure 4A. Orange, green, and yellow were used to represent true posi- tives, false positives, and false negatives respectively compared to the ground truth. For A000069, the independently trained model on the associated user's data gave enormous false positives, while the model trained with FL predicted a large number of false negatives. In contrast, the personalized model from PPPML-HMI provided competitive performance as the centrally trained model with complete data. For A000075, the personalized model from PPPML-HMI predicted more true positives compared to the centrally trained model with the complete data and rescued more false negatives compared to the model trained with FL. In summary, PPPML-HMI allowed model personalization to each user with heterogeneous data and achieved competitive performance as the centralized training with complete data. C. PPPML-HMI protects privacy of CT scans There are two types of attackers in our setting: 1) attackers who can intercept messages sent from any users to the server and between any users (type I), and 2) honest-but-curious (HBC) attackers that are part of the users of PPPML-HMI (type II) as in Definition 1. Definition 1. The HBC attacker is a legitimate participant in a communication protocol who will not deviate from the defined protocol but will attempt to learn all possible information from legitimately received messages [80]. Sensitive information could be deciphered from medical images, such as tissue patterns and lesions, which could 8 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2023 user due to curiosity. As the key for HE is shared by all users in the loop, the HBC user could decrypt the gradient from the previous user and see the plaintext. However, the plaintext deciphered by any non-initiator users is always protected by the Gaussian noise added by the initiator, thus type II attackers could be resisted as shown in Figure 4B. To demonstrate the results of gradient inversion, we applied iDLG to the associated segmentation model. As shown in Figure 4B, in terms of visual results, the iDLG attack on FL could effectively reconstruct the CT images in the training data, while the iDLG attack on PPPML-HMI was effectively blocked. Overall, PPPML-HMI protected privacy by blocking the reconstruction of sensitive medical images. IV. DISCUSSION In this paper, we present a novel, robust and open-source method for personalized and privacy-preserving federated heterogeneous medical imaging analysis. PPPML-HMI is a training paradigm similar to FL, which has no task-specific requirements and does not require any modifications to the existing DL models. With the nature of open-source, users of PPPML-HMI only need to apply PPPML-HMI as a plug- in to their neural network models as how they work with FL to achieve personalized and privacy-preserving federated learning. Based on the results of the simulated classification task on the RAD-ChestCT dataset and the real-word seg- mentation task based on the COVID-19 dataset, we believe that PPPML-HMI could be applied to any potential medical imaging problem with different DL methods, especially for those with heterogeneous data and the need for federation and privacy protection, as the segmentation method we adopted in the real-world case was also a general method for segmentation of lung, tracheal, vascular and so on. Though we applied PPPML-HMI in both simulated and real-world COVID-19 cases, all experiments were conducted in a laboratory environment, meaning all practical conditions were in the ideal state, including the computing power of the users' machines and the communication consumption between machines. As shown in TableIII, PPPML-HMI showed slightly higher requirements for the training time and similar memory and GPU compared to FL, meaning that PPPML- HMI could still work in the case that FL works. Meanwhile, integrating personalization and HE-based privacy protection in PPPML-HMI brought an additional 35.5% computation time compared to FL, thus finding new solutions to accelerate could be one of the main research directions in the future. TABLE III COMPARISON OF COMPUTATION RESOURCE REQUIREMENTS ON THE COVID-19 TASK. n IS THE NUMBER OF USERS. Method Centralized training Federated learning (n = 5) PPPML-HMI (n = 5) Training Time (hours) Virtual Memory (GB) Physical Memory (GB) GPU (GB) 320.21 110.37 149.55 70.26 54.91 54.97 3.34 3.36 3.43 26.80 26.80 26.80 Fig. 4. A) Visualization of predicted segmentation mask on the high- quality sample A000069 and low-quality sample A000075 (Orange: true positives, Green: false positives, Yellow: false negatives). B) Visualiza- tion of the dummy data from the iDLG attack on FL and PPPML-HMI against both types of attackers. compromise patients' privacy [81]. CT scans of COVID-19 patients require even stronger privacy protection. To show that PPPML-HMI protected privacy from the CT scans of COVID-19 patients and resisted both types of attackers, we applied the iDLG (Method) method to simulate an attacker reconstructing the training images by stealing the gradients transmitted between users and the server. During each attack, we initialized dummy data and used the gradient transmitted between the user and server to update the dummy data. We performed the iDLG attack for FL, where type I attackers exist and PPPML-HMI, where both types of attackers exist, respectively. Then, we visualized the dummy data every 1000 iterations, as shown in Figure 4B. the users could not completely trust In practice, since the server is usually controlled by a third party, the server. As shown in Figure 2B, in FL, type I attackers could intercept the gradients sent between users and the server to learn the sensitive information of the corresponding users. With the CSAHE, only the initiator could communicate with the server and send the securely aggregated gradient. Though type I attackers could intercept the gradient between the initiator and the server, they only get the averaged gradient over all users. When type I attackers incept the information transmitted between users in CSAHE, they only get the ciphertext instead of the plaintext as all gradients transmitted in the loop are encrypted with HE. Hence, type I attackers could be resisted by PPPML-HMI. Type II attackers may exist in PPPML-HMI as gradients are transmitted between users as shown in Figure 2B. For example, an HBC user in the loop may try to recover sensitive information using the gradient transmitted from the previous JUEXIAO ZHOU et al.: PPPML-HMI 9 Due to the special design of PPPML-HMI, it can only be applied when the number of clients ≥ 3, meaning that PPPML-HMI is vulnerable when the number of clients equals 2. Suppose that the initiator is the type II attacker and there are two clients, then the initiator could decode the exact gradient of the other client and thus do the gradient inversion attack as shown in the classic FL setting. Though PPPML-HMI is not exactly private for the case where there are only two clients, it could work as designed when the number of clients ≥ 3 Regardless of the issue in computing resources and vulner- ability, we need to take more practical problems into consid- eration, such as the imbalance of computing power among hospitals, the deviation of data quality of different hospitals, the latency in network communication between hospitals and the server, and so on. Those practical problems have not been addressed in this work as we were focusing on a learning paradigm. Still, we will solve those realistic obstacles and further improve PPPML-HMI in future work. REFERENCES [1] Y. LeCun, Y. Bengio, and G. Hinton, "Deep learning," nature, vol. 521, no. 7553, pp. 436–444, 2015. [2] H. Greenspan, B. Van Ginneken, and R. M. Summers, "Guest editorial deep learning in medical imaging: Overview and future promise of an exciting new technique," IEEE transactions on medical imaging, vol. 35, no. 5, pp. 1153–1159, 2016. [3] D. S. Ting, Y. Liu, P. Burlina, X. Xu, N. M. Bressler, and T. Y. Wong, "Ai for medical imaging goes deep," Nature medicine, vol. 24, no. 5, pp. 539–540, 2018. [4] A. S. Lundervold and A. Lundervold, "An overview of deep learning in medical imaging focusing on mri," Zeitschrift f ̈ur Medizinische Physik, vol. 29, no. 2, pp. 102–127, 2019. [5] N. Rieke, J. Hancox, W. Li, F. Milletari, H. R. Roth, S. Albarqouni, S. Bakas, M. N. Galtier, B. A. Landman, K. Maier-Hein et al., "The future of digital health with federated learning," NPJ digital medicine, vol. 3, no. 1, pp. 1–7, 2020. [6] S. K. Zhou, H. Greenspan, C. Davatzikos, J. S. Duncan, B. Van Gin- neken, A. Madabhushi, J. L. Prince, D. Rueckert, and R. M. Summers, "A review of deep learning in medical imaging: Imaging traits, technol- ogy trends, case studies with progress highlights, and future promises," Proceedings of the IEEE, vol. 109, no. 5, pp. 820–838, 2021. [7] R. Aggarwal, V. Sounderajah, G. Martin, D. S. Ting, A. Karthike- salingam, D. King, H. Ashrafian, and A. Darzi, "Diagnostic accuracy of deep learning in medical imaging: A systematic review and meta- analysis," NPJ digital medicine, vol. 4, no. 1, pp. 1–23, 2021. [8] L. Zhou, X. Meng, Y. Huang, K. Kang, J. Zhou, Y. Chu, H. Li, D. Xie, J. Zhang, W. Yang et al., "An interpretable deep learning workflow for discovering subvisual abnormalities in ct scans of covid-19 inpatients and survivors," Nature Machine Intelligence, vol. 4, no. 5, pp. 494–503, 2022. [9] J. Rasley, S. Rajbhandari, O. Ruwase, and Y. He, "Deepspeed: System optimizations enable training deep learning models with over 100 billion parameters," in Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2020, pp. 3505– 3506. [10] C. Sun, A. Shrivastava, S. Singh, and A. Gupta, "Revisiting unreasonable effectiveness of data in deep learning era," in Proceedings of the IEEE international conference on computer vision, 2017, pp. 843–852. [11] C. C. Aggarwal et al., "Neural networks and deep learning," Springer, vol. 10, pp. 978–3, 2018. [12] F. Wang, L. P. Casalino, and D. Khullar, "Deep learning in medicine-promise, progress, and challenges," JAMA internal medicine, vol. 179, no. 3, pp. 293–294, 2019. [15] L. Zhou, Z. Li, J. Zhou, H. Li, Y. Chen, Y. Huang, D. Xie, L. Zhao, M. Fan, S. Hashmi et al., "A rapid, accurate and machine-agnostic seg- mentation and quantification method for ct-based covid-19 diagnosis," IEEE transactions on medical imaging, vol. 39, no. 8, pp. 2638–2652, 2020. [16] S. Serte and H. Demirel, "Deep learning for diagnosis of covid-19 using 3d ct scans," Computers in biology and medicine, vol. 132, p. 104306, 2021. [17] A. Saood and I. Hatem, "Covid-19 lung ct image segmentation using deep learning methods: U-net versus segnet," BMC Medical Imaging, vol. 21, no. 1, pp. 1–10, 2021. [18] W. G. Van Panhuis, P. Paul, C. Emerson, J. Grefenstette, R. Wilder, A. J. Herbst, D. Heymann, and D. S. Burke, "A systematic review of barriers to data sharing in public health," BMC public health, vol. 14, no. 1, pp. 1–9, 2014. [19] J. Koneˇcn`y, H. B. McMahan, F. X. Yu, P. Richt ́arik, A. T. Suresh, and D. Bacon, "Federated learning: Strategies for improving communication efficiency," arXiv preprint arXiv:1610.05492, 2016. [20] B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas, "Communication-efficient learning of deep networks from decentralized data," in Artificial intelligence and statistics. PMLR, 2017, pp. 1273– 1282. [21] Q. Yang, Y. Liu, T. Chen, and Y. Tong, "Federated machine learning: Concept and applications," ACM Transactions on Intelligent Systems and Technology (TIST), vol. 10, no. 2, pp. 1–19, 2019. [22] T. Li, A. K. Sahu, A. Talwalkar, and V. Smith, "Federated learning: Challenges, methods, and future directions," IEEE Signal Processing Magazine, vol. 37, no. 3, pp. 50–60, 2020. [23] M. Mohri, G. Sivek, and A. T. Suresh, "Agnostic federated learning," in International Conference on Machine Learning. PMLR, 2019, pp. 4615–4625. [24] S. P. Karimireddy, S. Kale, M. Mohri, S. J. Reddi, S. U. Stich, and A. T. Suresh, "Scaffold: Stochastic controlled averaging for on-device federated learning." 2019. [25] Y. Jiang, J. Koneˇcn`y, K. Rush, and S. Kannan, "Improving feder- ated learning personalization via model agnostic meta learning," arXiv preprint arXiv:1909.12488, 2019. [26] F. Hanzely, S. Hanzely, S. Horv ́ath, and P. Richt ́arik, "Lower bounds and optimal algorithms for personalized federated learning," Advances in Neural Information Processing Systems, vol. 33, pp. 2304–2315, 2020. [27] A. Fallah, A. Mokhtari, and A. Ozdaglar, "Personalized federated learning: A meta-learning approach," arXiv preprint arXiv:2002.07948, 2020. [28] C. T Dinh, N. Tran, and J. Nguyen, "Personalized federated learning with moreau envelopes," Advances in Neural Information Processing Systems, vol. 33, pp. 21 394–21 405, 2020. [29] Y. Mansour, M. Mohri, J. Ro, and A. T. Suresh, "Three approaches for personalization with applications to federated learning," arXiv preprint arXiv:2002.10619, 2020. [30] P. Sun, H. Che, Z. Wang, Y. Wang, T. Wang, L. Wu, and H. Shao, "Pain- fl: Personalized privacy-preserving incentive for federated learning," IEEE Journal on Selected Areas in Communications, vol. 39, no. 12, pp. 3805–3820, 2021. [31] T. Li, S. Hu, A. Beirami, and V. Smith, "Ditto: Fair and robust federated learning through personalization," in International Conference on Machine Learning. PMLR, 2021, pp. 6357–6368. [32] P. Kairouz, H. B. McMahan, B. Avent, A. Bellet, M. Bennis, A. N. Bhagoji, K. Bonawitz, Z. Charles, G. Cormode, R. Cummings et al., "Advances and open problems in federated learning," Foundations and Trends® in Machine Learning, vol. 14, no. 1–2, pp. 1–210, 2021. [33] Y. Deng, M. M. Kamani, and M. Mahdavi, "Adaptive personalized federated learning," arXiv preprint arXiv:2003.13461, 2020. [34] Y. Zhao, M. Li, L. Lai, N. Suda, D. Civin, and V. Chandra, "Federated learning with non-iid data," arXiv preprint arXiv:1806.00582, 2018. [35] L. Qu, N. Balachandar, M. Zhang, and D. Rubin, "Handling data het- erogeneity with generative replay in collaborative learning for medical imaging," Medical Image Analysis, vol. 78, p. 102424, 2022. [36] C. Wu, F. Wu, L. Lyu, T. Qi, Y. Huang, and X. Xie, "A federated graph neural network framework for privacy-preserving personalization," Nature Communications, vol. 13, no. 1, pp. 1–10, 2022. [13] P. M. Mammen, "Federated learning: opportunities and challenges," [37] W. N. Price and I. G. Cohen, "Privacy in the age of medical big data," arXiv preprint arXiv:2101.05428, 2021. Nature medicine, vol. 25, no. 1, pp. 37–43, 2019. [14] F. Shan, Y. Gao, J. Wang, W. Shi, N. Shi, M. Han, Z. Xue, D. Shen, and Y. Shi, "Lung infection quantification of covid-19 in ct images with deep learning," arXiv preprint arXiv:2003.04655, 2020. [38] V. Tolpegin, S. Truex, M. E. Gursoy, and L. Liu, "Data poisoning attacks against federated learning systems," in European Symposium on Research in Computer Security. Springer, 2020, pp. 480–501. 10 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2023 [63] M. Jamshidi, A. Lalbakhsh, J. Talla, Z. Peroutka, F. Hadjilooei, P. Lal- bakhsh, M. Jamshidi, L. La Spada, M. Mirmozafari, M. Dehghani et al., "Artificial intelligence and covid-19: deep learning approaches for diagnosis and treatment," Ieee Access, vol. 8, pp. 109 581–109 595, 2020. [64] C. Shorten, T. M. Khoshgoftaar, and B. Furht, "Deep learning applica- tions for covid-19," Journal of big Data, vol. 8, no. 1, pp. 1–54, 2021. [65] A. M. Ismael and A. S ̧ eng ̈ur, "Deep learning approaches for covid-19 detection based on chest x-ray images," Expert Systems with Applica- tions, vol. 164, p. 114054, 2021. [66] N. Subramanian, O. Elharrouss, S. Al-Maadeed, and M. Chowdhury, "A review of deep learning-based detection methods for covid-19," Computers in Biology and Medicine, p. 105233, 2022. [67] I. Dayan, H. R. Roth, A. Zhong, A. Harouni, A. Gentili, A. Z. Abidin, A. Liu, A. B. Costa, B. J. Wood, C.-S. Tsai et al., "Federated learning for predicting clinical outcomes in patients with covid-19," Nature medicine, vol. 27, no. 10, pp. 1735–1743, 2021. [68] R. Durga and E. Poovammal, "Fled-block: Federated learning ensembled deep learning blockchain model for covid-19 prediction," Frontiers in Public Health, vol. 10, 2022. [69] O. Samuel, A. Omojo, A. Onuja, Y. Sunday, P. Tiwari, D. Gupta, G. Hafeez, A. Yahaya, O. Fatoba, and S. Shamshirband, "Iomt: A covid- 19 healthcare system driven by federated learning and blockchain," IEEE Journal of Biomedical and Health Informatics, 2022. [70] L. M. Florescu, C. T. Streba, M.-S. S ̧ erb ̆anescu, M. M ̆amuleanu, D. N. Florescu, R. V. Teic ̆a, R. E. Nica, and I. A. Gheonea, "Federated learning approach with pre-trained deep learning models for covid-19 detection from unsegmented ct images," Life, vol. 12, no. 7, p. 958, 2022. [71] Z. Li, X. Xu, X. Cao, W. Liu, Y. Zhang, D. Chen, and H. Dai, "Integrated cnn and federated learning for covid-19 detection on chest x-ray images," IEEE/ACM Transactions on Computational Biology and Bioinformatics, 2022. [72] F. Wibawa, F. O. Catak, S. Sarp, M. Kuzlu, and U. Cali, "Homomorphic encryption and federated learning based privacy-preserving cnn training: Covid-19 detection use-case," arXiv preprint arXiv:2204.07752, 2022. [73] R. L. Draelos, D. Dov, M. A. Mazurowski, J. Y. Lo, R. Henao, G. D. Rubin, and L. Carin, "Machine-learning-based multiple abnormality pre- diction with large-scale chest computed tomography volumes," Medical image analysis, vol. 67, p. 101857, 2021. [74] --, "Rad-chestct dataset," Oct. https://doi.org/10.5281/zenodo.6406114 2020. [Online]. Available: [75] T. D. Bui, J. Shin, and T. Moon, "3d densely convolutional [Online]. Available: networks for volumetric segmentation," 2017. https://arxiv.org/abs/1709.03199 [76] C. Finn, P. Abbeel, and S. Levine, "Model-agnostic meta-learning for fast adaptation of deep networks," in International conference on machine learning. PMLR, 2017, pp. 1126–1135. [77] J. H. Cheon, A. Kim, M. Kim, and Y. Song, "Homomorphic encryption for arithmetic of approximate numbers," in International Conference on the Theory and Application of Cryptology and Information Security. Springer, 2017, pp. 409–437. [78] A. Benaissa, B. Retiat, B. Cebere, and A. E. Belfedhal, "Tenseal: A library for encrypted tensor operations using homomorphic encryption," arXiv preprint arXiv:2104.03152, 2021. [79] L. McInnes, J. Healy, and J. Melville, "Umap: Uniform manifold approximation and projection for dimension reduction," arXiv preprint arXiv:1802.03426, 2018. [80] A. Paverd, A. Martin, and I. Brown, "Modelling and automatically analysing privacy properties for honest-but-curious adversaries," Tech. Rep, 2014. [81] G. A. Kaissis, M. R. Makowski, D. R ̈uckert, and R. F. Braren, "Secure, privacy-preserving and federated machine learning in medical imaging," Nature Machine Intelligence, vol. 2, no. 6, pp. 305–311, 2020. [39] M. A. Rahman, T. Rahman, R. Lagani`ere, N. Mohammed, and Y. Wang, "Membership inference attack against differentially private deep learning model." Trans. Data Priv., vol. 11, no. 1, pp. 61–79, 2018. [40] H. Lu, C. Liu, T. He, S. Wang, and K. S. Chan, "Sharing models or coresets: A study based on membership inference attack," arXiv preprint arXiv:2007.02977, 2020. [41] A. Salem, Y. Zhang, M. Humbert, P. Berrang, M. Fritz, and M. Backes, "Ml-leaks: Model and data independent membership inference at- tacks and defenses on machine learning models," arXiv preprint arXiv:1806.01246, 2018. [42] H. Hu, Z. Salcic, L. Sun, G. Dobbie, and X. Zhang, "Source inference attacks in federated learning," in 2021 IEEE International Conference on Data Mining (ICDM). IEEE, 2021, pp. 1102–1107. [43] L. Lyu and C. Chen, "A novel attribute reconstruction attack in federated learning," arXiv preprint arXiv:2108.06910, 2021. [44] J. Geiping, H. Bauermeister, H. Dr ̈oge, and M. Moeller, "Inverting gradients-how easy is it to break privacy in federated learning?" Ad- vances in Neural Information Processing Systems, vol. 33, pp. 16 937– 16 947, 2020. [45] B. Zhao, K. R. Mopuri, and H. Bilen, "idlg: Improved deep leakage from gradients," arXiv preprint arXiv:2001.02610, 2020. [46] H. Yin, A. Mallya, A. Vahdat, J. M. Alvarez, J. Kautz, and P. Molchanov, "See through gradients: Image batch recovery via gradinversion," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021, pp. 16 337–16 346. [47] A. Hatamizadeh, H. Yin, P. Molchanov, A. Myronenko, W. Li, P. Do- gra, A. Feng, M. G. Flores, J. Kautz, D. Xu et al., "Do gradi- ent inversion attacks make federated learning unsafe?" arXiv preprint arXiv:2202.06924, 2022. [48] C. Dwork, "Differential privacy: A survey of results," in International conference on theory and applications of models of computation. Springer, 2008, pp. 1–19. [49] R. Hu, Y. Guo, H. Li, Q. Pei, and Y. Gong, "Personalized federated learning with differential privacy," IEEE Internet of Things Journal, vol. 7, no. 10, pp. 9530–9539, 2020. [50] J. Zhou, S. Chen, Y. Wu, H. Li, B. Zhang, L. Zhou, Y. Hu, Z. Xiang, Z. Li, N. Chen et al., "Ppml-omics: a privacy-preserving federated machine learning system protects patients' privacy from omic data," bioRxiv, 2022. [51] E. Bagdasaryan, O. Poursaeed, and V. Shmatikov, "Differential privacy has disparate impact on model accuracy," Advances in neural informa- tion processing systems, vol. 32, 2019. [52] A. Shamir, "How to share a secret," Communications of the ACM, vol. 22, no. 11, pp. 612–613, 1979. [53] K. Bonawitz, V. Ivanov, B. Kreuter, A. Marcedone, H. B. McMahan, S. Patel, D. Ramage, A. Segal, and K. Seth, "Practical secure aggregation for privacy-preserving machine learning," in proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, 2017, pp. 1175–1191. [54] C. Gentry, "Fully homomorphic encryption using ideal lattices," in Proceedings of the forty-first annual ACM symposium on Theory of computing, 2009, pp. 169–178. [55] O. Goldreich, "Secure multi-party computation," in Manuscript. Prelim- inary version 78.110, 1998. [56] T. Sandholm, S. Mukherjee, and B. A. Huberman, "Safe: Secure aggre- gation with failover and encryption," arXiv preprint arXiv:2108.05475, 2021. [57] Y. Liu, T. Fan, T. Chen, Q. Xu, and Q. Yang, "Fate: An industrial grade platform for collaborative learning with data protection," J. Mach. Learn. Res., vol. 22, no. 1, jul 2022. [58] A. Ziller, A. Trask, A. Lopardo, B. Szymkow, B. Wagner, E. Bluemke, J.-M. Nounahon, J. Passerat-Palmbach, K. Prakash, N. Rose, T. Ryffel, Z. N. Reza, and G. Kaissis, PySyft: A Library for Easy Federated Learning. Cham: Springer International Publishing, 2021, pp. 111–139. [Online]. Available: https://doi.org/10.1007/978-3-030-70604-3 5 [59] H. R. Roth, Y. Cheng, Y. Wen, I. Yang, Z. Xu, Y.-T. Hsieh, K. Kersten, A. Harouni, C. Zhao, K. Lu et al., "Nvidia flare: Federated learning from simulation to real-world," arXiv preprint arXiv:2210.13291, 2022. [60] A. S. Fauci, H. C. Lane, and R. R. Redfield, "Covid-19-navigating the uncharted," pp. 1268–1269, 2020. [61] T. Franquet, "Imaging of pneumonia: trends and algorithms," European Respiratory Journal, vol. 18, no. 1, pp. 196–208, 2001. [62] S. Wang, Y. Zha, W. Li, Q. Wu, X. Li, M. Niu, M. Wang, X. Qiu, H. Li, H. Yu et al., "A fully automatic deep learning system for covid- 19 diagnostic and prognostic analysis," European Respiratory Journal, vol. 56, no. 2, 2020.
http://arxiv.org/abs/2302.09815v1
2023-02-20T07:32:50
2023-02-20T07:32:50
On the Stability and Generalization of Triplet Learning
Triplet learning, i.e. learning from triplet data, has attracted much attention in computer vision tasks with an extremely large number of categories, e.g., face recognition and person re-identification. Albeit with rapid progress in designing and applying triplet learning algorithms, there is a lacking study on the theoretical understanding of their generalization performance. To fill this gap, this paper investigates the generalization guarantees of triplet learning by leveraging the stability analysis. Specifically, we establish the first general high-probability generalization bound for the triplet learning algorithm satisfying the uniform stability, and then obtain the excess risk bounds of the order $O(n^{-\frac{1}{2}} \mathrm{log}n)$ for both stochastic gradient descent (SGD) and regularized risk minimization (RRM), where $2n$ is approximately equal to the number of training samples. Moreover, an optimistic generalization bound in expectation as fast as $O(n^{-1})$ is derived for RRM in a low noise case via the on-average stability analysis. Finally, our results are applied to triplet metric learning to characterize its theoretical underpinning.
[ "Jun Chen", "Hong Chen", "Xue Jiang", "Bin Gu", "Weifu Li", "Tieliang Gong", "Feng Zheng" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09815v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09815v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG" ]
3 2 0 2 b e F 0 2 ] L M . t a t s [ 1 v 5 1 8 9 0 . 2 0 3 2 : v i X r a On the Stability and Generalization of Triplet Learning Jun Chen1, Hong Chen2, 3, 4,*, Xue Jiang5, Bin Gu6, Weifu Li2, 3, 4, Tieliang Gong7, 8, Feng Zheng5 1College of Informatics, Huazhong Agricultural University, Wuhan 430070, China 2College of Science, Huazhong Agricultural University, Wuhan 430070, China 3Engineering Research Center of Intelligent Technology for Agriculture, Ministry of Education, Wuhan 430070, China 4Key Laboratory of Smart Farming for Agricultural Animals, Wuhan 430070, China 5Department of Computer Science and Engineering, Southern University of Science and Technology, Shenzhen 518055, China 6Mohamed bin Zayed University of Artificial Intelligence, Abu Dhabi, United Arab Emirates 7School of Computer Science and Technology, Xi'an Jiaotong University, Xi'an 710049, China 8Shaanxi Provincial Key Laboratory of Big Data Knowledge Engineering, Ministry of Education, Xi'an 710049, China [email protected] Abstract Triplet learning, i.e. learning from triplet data, has attracted much attention in computer vision tasks with an extremely large number of categories, e.g., face recognition and per- son re-identification. Albeit with rapid progress in design- ing and applying triplet learning algorithms, there is a lack- ing study on the theoretical understanding of their general- ization performance. To fill this gap, this paper investigates the generalization guarantees of triplet learning by leverag- ing the stability analysis. Specifically, we establish the first general high-probability generalization bound for the triplet learning algorithm satisfying the uniform stability, and then obtain the excess risk bounds of the order O(n− 1 2 logn) for both stochastic gradient descent (SGD) and regularized risk minimization (RRM), where 2n is approximately equal to the number of training samples. Moreover, an optimistic general- ization bound in expectation as fast as O(n−1) is derived for RRM in a low noise case via the on-average stability analy- sis. Finally, our results are applied to triplet metric learning to characterize its theoretical underpinning. Introduction As two popular paradigms of machine learning, data-driven algorithms with pointwise loss and pairwise loss have been widely used to find the intrinsic relations from empirical observations. In the algorithmic implementation, the for- mer (called pointwise learning) often aims to minimize the empirical risk characterized by the divergence between the predicted output and the observed response of each input (Vapnik 1998; Cucker and Smale 2001; Poggio et al. 2004), while the latter (called pairwise learning) usually concerns the model performance associated with pairs of training in- stances, see e.g., ranking (Agarwal and Niyogi 2009) and metric learning (Xing et al. 2002; Ying and Li 2012). Despite enjoying the advantages of feasible implemen- tations and solid foundations, pointwise learning and pair- wise learning may face a crucial challenge for learn- ing tasks with an extremely large number of categories. *Corresponding author. Copyright © 2023, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. Such learning scenarios appear in face recognition (Schroff, Kalenichenko, and Philbin 2015; Ding and Tao 2018), per- son re-identification (Ustinova and Lempitsky 2016; Cheng et al. 2016; Xiao et al. 2016), image retrieval (Lai et al. 2015; Huang et al. 2015) and other individual level fine-grained tasks (Wohlhart and Lepetit 2015; Simo-Serra et al. 2015). As illustrated in Yu et al. (2018), the traditional learning model is difficult to achieve good performance in the set- ting of an extremely large number of categories since its parameters will increase linearly with the number of cate- gories. To surmount this barrier, many triplet learning algo- rithms are formulated by injecting triplet loss function into the metric learning framework (Schroff, Kalenichenko, and Philbin 2015; Ustinova and Lempitsky 2016; Cheng et al. 2016; Xiao et al. 2016; Ding and Tao 2018). For triplet met- ric learning (Schroff, Kalenichenko, and Philbin 2015; Ge et al. 2018), the implementation procedures mainly include: 1) Constructing triplets associated with anchor sample, posi- tive sample and negative sample; 2) Designing margin-based empirical risk associated with triplet loss; 3) Learning met- ric space transformation rule via empirical risk minimiza- tion (ERM), which aims to minimize intra-class distance and maximize inter-class distance simultaneously. However, the triplet characteristic often leads to a heavy computa- tional burden for large-scale data. Recently, stochastic gra- dient descent (SGD) is employed for deploying triplet learn- ing algorithms due to its low time complexity (Schroff, Kalenichenko, and Philbin 2015; Ge et al. 2018). Although there has been significant progress in designing and apply- ing triplet learning algorithms, little work has been done to recover their generalization guarantees from the lens of sta- tistical learning theory (SLT) (Vapnik 1998). The generalization guarantee of learning algorithm is the core of SLT, which evaluates the prediction ability in the unseen inputs (Vapnik 1998; Cucker and Zhou 2007). In a nutshell, there are three branches of generalization anal- ysis including uniform convergence approaches associated with hypothesis space capacity (e.g., VC dimension (Vap- nik 1998), covering numbers (Cucker and Zhou 2007; Chen et al. 2017), Rademacher complexity (Bartlett and Mendel- son 2001)), operator approximation technique (Smale and Zhou 2007; Rosasco, Belkin, and Vito 2010), and algorith- mic stability analysis (Bousquet and Elisseeff 2002; Elisse- eff, Evgeniou, and Pontil 2005; Shalev-Shwartz et al. 2010). It is well known that the stability analysis enjoys nice prop- erties on flexibility (independent of the capacity of hypoth- esis function space) and adaptivity (suiting for rich learning scenarios, e.g., classification and regression (Hardt, Recht, and Singer 2016), ranking (Agarwal and Niyogi 2009), and adversarial training (Xing, Song, and Cheng 2021)). Re- cently, besides learning algorithms based on ERM and reg- ularized risk minimization (RRM), generalization and sta- bility have been understood for SGD of pointwise learning (Hardt, Recht, and Singer 2016; Roux, Schmidt, and Bach 2012; Fehrman, Gess, and Jentzen 2020; Lei, Hu, and Tang 2021) and pairwise learning (Lei, Ledent, and Kloft 2020; Arous, Gheissari, and Jagannath 2021; Lei, Liu, and Ying 2021). While the existing extensive works on stability anal- ysis, to our best knowledge, there is no related result of SGD and RRM for triplet learning. To fill the above gap, this paper aims to provide stability- based generalization analysis for a variety of triplet learning algorithms. We establish generalization bounds for SGD and RRM with triplet loss, which yield comparable convergence rates as pointwise learning (Feldman and Vondr ́ak 2019) and pairwise learning (Lei, Ledent, and Kloft 2020) under mild conditions. The main contributions of this paper are summa- rized as follows. • Generalization by algorithmic stability for triplet learn- ing. After introducing a new definition of triplet uniform stability, we establish the first general high-probability generalization bound for triplet learning algorithms sat- isfying uniform stability, motivated by the recent analy- sis for pairwise learning (Lei, Ledent, and Kloft 2020). Especially, the current analysis just requires the uniform stability of the triplet learning algorithm and the bound- edness of loss function in expectation. • Generalization bounds for triplet SGD and triplet RRM. Generalization properties are characterized for SGD and RRM of triplet learning when the loss function is (strongly) convex, L-Lipschitz and α-smooth. Particu- larly, the derived excess risk bounds are with the decay rate O(n− 1 2 logn) as n+ (cid:16) n− (cid:16) n, where n+ and n− are the numbers of positive samples and negative sam- ples, respectively. Moreover, for the strongly convex loss function, the refined generalization bound with the order O(n−1) is derived for RRM by leveraging the triplet on- average stability. To the best of our knowledge, these re- sults are the first generalization bounds of SGD and RRM for triplet learning. Related Work In this section, we briefly review the related works on triplet learning and algorithmic stability. Triplet learning. The main purpose of deep metric learn- ing is to directly learn a feature representation vector from input data with the help of deep neural networks. Brom- ley et al. (1993) found that the relationship between sam- ples can be measured by the difference between the corre- sponding embedded vectors, and some deep metric learning models have been subsequently proposed (Chopra, Hadsell, and LeCun 2005; Hadsell, Chopra, and LeCun 2006). Later, Schroff, Kalenichenko, and Philbin (2015) proposed the FaceNet by integrating the idea of triplet learning (Schultz and Joachims 2003; Weinberger, Blitzer, and Saul 2005) and deep metric learning together. In contrast to the previous approaches, FaceNet directly trains its output to be a com- pact 128-D embedding vector using a triplet loss function based on large margin nearest neighbor (Weinberger, Blitzer, and Saul 2005), and it is implemented by employing the SGD strategy. Encouraged by the impressive performance of FaceNet, lots of learning algorithms with triplet loss have been formulated in the computer version field (Cheng et al. 2016; Xiao et al. 2016; Ustinova and Lempitsky 2016; Liu et al. 2016; Ramanathan et al. 2015; Ding and Tao 2018). Al- though there have been significant works on designing triplet metric learning algorithms, our theoretical understanding of their generalization ability falls far below the experimental validations. Generalization and algorithmic stability. In SLT, uni- form convergence analysis focuses on bounding the uni- form deviation between training error and testing error over hypothesis space (Vapnik 1998; Cucker and Smale 2001; Bartlett and Mendelson 2001; Wang et al. 2020; Chen et al. 2021), and operator approximation approach is inspired by functional analysis theory (Smale and Zhou 2007; Rosasco, Belkin, and Vito 2010). Indeed, the former depends on the capacity of hypothesis space (e.g., VC dimension (Vap- nik 1998), covering numbers (Cucker and Zhou 2007), Rademacher complexity (Bartlett and Mendelson 2001)), and the latter is limited to some special models enjoying op- erator representation (e.g., regularized least squares regres- sion (Smale and Zhou 2007), regularized least squares rank- ing (Chen 2012)). Different from the above routes, algorith- mic stability is described by the gap among training errors of different training sets, which is dimension-independent and enjoys adaptivity for wide learning models. The con- cept of algorithmic stability can be put forward as early as the 1970s (Rogers and Wagner 1978), and its learning theo- retical framework was established in Bousquet and Elisseeff (2002) and Elisseeff, Evgeniou, and Pontil (2005). In essen- tial, the algorithmic uniform stability is closely related to the learnability (Poggio et al. 2004; Shalev-Shwartz et al. 2010). For the pointwise learning setting, the stability-based generalization guarantees have been stated in terms of uni- form stability (Hardt, Recht, and Singer 2016; Foster et al. 2019), on-average stability (Kuzborskij and Lampert 2018; Lei and Ying 2021), local elastic stability (Deng, He, and Su 2021) and argument stability (Bassily et al. 2020; Lei and Ying 2020; Liu et al. 2017). For the pairwise learning setting, there are fine-grained analyses on the generaliza- tion and stability of SGD and RRM (Shen et al. 2019; Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021). Due to the space limitation, we further summarize different definitions and properties of algorithmic stability in Supplementary Ma- terial C. Along this line of the above corpus, it is natural to investigate the generalization bounds of triplet learning by algorithmic stability analysis. Preliminaries This section introduces the necessary backgrounds on triplet learning and algorithmic stability. The main notations used in this paper are stated in Supplementary Material A. := (x+ i , y+ + ∪ Z n− Triplet learning Let X+, X− ⊂ Rd are two d-dimensional input spaces and Y ⊂ R is an output space. We give the training set i )}n+ i=1 ∪ {z− S := {z+ j=1 ∈ Z i with Z := Z n+ − , where each positive sample z+ i and negative sample z− j are drawn independently from Z+ := X+ ×Y and Z− := X− ×Y, respectively. Note that there are likely more than two classes in positive and negative sample spaces. Given empirical observation S, triplet learning algo- rithms usually aim to find a model hw : X+ ×X+ ×X− → R such that the expectation risk j )}n− := (x− j , y− j R(w) := Ez+, ̃z+,z− (cid:96)(w; z+, ̃z+, z−) (1) is as small as possible. Here the model parameter w ∈ W with d(cid:48)-dimensional parameter space W ⊆ Rd(cid:48) , Ez denotes the conditional expectation with respect to (w.r.t.) z, and the triplet loss function (cid:96) : W × Z+ × Z+ × Z− → R+ is used to measure the difference between model's prediction and corresponding real observation. Since the intrinsic dis- tributions generating z+ and z− are same and unknown, it is impossible to implement triplet learning by minimizing the objective R(w) directly. Naturally, we consider the cor- responding empirical risk of (1) defined as RS(w) := 1 n+(n+ − 1)n− (cid:88) i,j∈[n+],i(cid:54)=j, k∈[n− ] (cid:96)(w; z+ i , z+ j , z− k ) (2) := {1, ..., n}. Clearly, for algorithmic design, where [n] the triplet learning algorithms, built from RS(w) in (2), are much more complicated than the corresponding ones in pointwise learning and pairwise learning. In the sequel, for the given algorithm A and the training data S, we denote the corresponding output model param- eter as A(S) for feasibility. In triplet learning, we usually build predictors by optimizing the models measured by the empirical risk RS(A(S)) or its variants. However, the nice empirical performance of learning model does not guaran- tee its effectiveness in unseen observations. In SLT, it is mo- mentous and fundamental to bound generalization error, i.e. R(w) − RS(w), since it characterizes the gap between the population risk R(w) and its empirical estimator RS(w). Despite the existing rich studies for pointwise learning and pairwise learning, the generalization bound of triplet learn- ing is rarely touched in the machine learning community. In this paper, we pioneer the generalization analysis of triplet SGD and RRM to understand their learnability. Triplet algorithmic stability An algorithm A : Z n+ + ∪ Z n− − → W is stable if the model parameter A(S) is insensitive to the slight change of training set S. Various definitions of algorithmic stability have been introduced from different motivations (see Supplementary Material C), where uniform stability and on-average sta- bility are popular for studying the generalization bounds of SGD and RRM (Hardt, Recht, and Singer 2016; Lin, Camo- riano, and Rosasco 2016; Kuzborskij and Lampert 2018; Lei and Ying 2021; Lei, Ledent, and Kloft 2020). Following this line, we extend the previous definitions of uniform stability and on-average stability to the triplet learning setting. Definition 1. datasets S = {z+ ̄z− 1 , ..., ̄z− n− sample. A deterministic algorithm A : Z n+ called γ-uniformly stable if (Uniform Stability). Assume any training }, ̄S = { ̄z+ , z− 1 , ..., z+ , n+ + ∪ Z n− − are differ by at most a single − → W is + ∪ Z n− 1 , ..., z− n− 1 , ..., ̄z+ n+ } ∈ Z n+ |(cid:96)(A(S); z+, ̃z+, z−) − (cid:96)(A( ̄S); z+, ̃z+, z−)| ≤ γ sup z+ , ̃z+ ∈Z+ , z− ∈Z− for any training datasets S, ̄S ∈ Z n+ at most a single sample. + ∪ Z n− − that differ by Definition 1 coincides with the uniform stability defini- tions for pointwise learning (Hardt, Recht, and Singer 2016) and pairwise learning (Lei, Ledent, and Kloft 2020), except for the triplet loss involving two sample spaces Z+ and Z−. (On-average Stability). Let Si,j,k = Definition 2. j , z+ i , z+ i−1, ̄z+ 1 , ..., z+ {z+ i+1, ..., z+ z− k , z− k−1, ̄z− k+1, ..., z− n− deterministic algorithm A : Z n+ γ-on-average stable if }, i, j ∈ [n+], i (cid:54)= j, k ∈ [n−]. A − → W is called + ∪ Z n− j+1, ..., z+ n+ j−1, ̄z+ 1 , ..., , z− 1 n+(n+ − 1)n− (cid:88) E S, ̄S i,j∈[n+ ],i(cid:54)=j, k∈[n−] (cid:2)(cid:96)(A(Si,j,k); z+ i , z+ j , z− k ) i , z+ j , z− − (cid:96)(A(S); z+ k )(cid:3) ≤ γ. Compared with the existing ones for pointwise learning (Kuzborskij and Lampert 2018) and pairwise learning (Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021), Definition 2 considers much more complicated perturbations of train- ing set S involving three samples. Definition 2 takes the ex- pectation over S and ̄S, and takes the average over perturba- tions, which is weaker than the uniform stability described in Definition 1. Main Results This section states our main results on generalization bounds for triplet learning by stability analysis. We show a gen- eral high-probability generalization bound of triplet learn- ing algorithms firstly, and then apply it to two specific algo- rithms, i.e. SGD and RRM. Finally, the on-average stability is employed for getting an optimistic generalization bound of RRM in expectation. All the proofs are provided in Sup- plementary Material B due to the space limitation. Similar with the previous analyses (Hardt, Recht, and Singer 2016; Lei, Ledent, and Kloft 2020), our results are closely related to the following properties of triplet loss function. Definition 3. For a triplet loss function (cid:96) : W × Z+ × Z+ × Z− → R+, denote by ∇(cid:96)(w) := ∇(cid:96)(w; z+, ̃z+, z−) its gradient w.r.t. the model parameter w ∈ W and denote by (cid:107) * (cid:107) a norm on an inner product space which satisfies (cid:107) * (cid:107)2 = (cid:104)*, *(cid:105). Let σ ≥ 0 and L, α > 0. 1) The triplet loss (cid:96) is σ-strongly convex if, for all w, w(cid:48) ∈ W, (cid:96)(w) ≥ (cid:96)(w(cid:48)) + (cid:104)∇(cid:96)(w(cid:48)), w − w(cid:48)(cid:105) + σ 2 (cid:107)w − w(cid:48)(cid:107)2. 2) The triplet loss (cid:96) is L-Lipschitz if |(cid:96)(w) − (cid:96)(w(cid:48))| ≤ L(cid:107)w − w(cid:48)(cid:107), ∀w, w(cid:48) ∈ W. 3) The triplet loss (cid:96) is α-smooth if (cid:107)∇(cid:96)(w) − ∇(cid:96)(w(cid:48))(cid:107) ≤ α(cid:107)w − w(cid:48)(cid:107), ∀w, w(cid:48) ∈ W. When σ = 0, (cid:96) is convex which also implies that ∇2(cid:96)(w; z+, ̃z+, z−) > 0. It is easy to verify that logistic loss, least square loss and Huber loss are convex and smooth. Meanwhile, we observe that hinge loss, logistic loss and Hu- ber loss are convex and Lipschitz (Hardt, Recht, and Singer 2016; Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021). Stability-based generalization bounds This subsection establishes the connection between uniform stability and generalization with high probability for triplet learning. Although rich results on the relationship between stability and generalization, the previous results do not hold directly for triplet learning due to its complicated loss struc- ture. This difficulty is tackled by implementing much more detailed error decomposition and developing the analysis technique of Lei, Ledent, and Kloft (2020). Lemma 1. If A : Z n+ for any S, ̄S, we have − → W is γ-uniformly stable, + ∪ Z n− |(cid:96)(A(S); z+, ̃z+, z−) − (cid:96)(A(Si,j,k); z+, ̃z+, z−)| ≤ 3γ for all z+, ̃z+ ∈ Z+, z− ∈ Z−, where S, ̄S, Si,j,k is defined in Definition 2 for any i, j ∈ [n+], i (cid:54)= j, k ∈ [n−]. Lemma 1 illustrates that an upper bound of the change of the loss function still exists even after changing multiple samples of the training set. Here, the upper bound 3γ re- flects the sensitivity of triplet learning w.r.t. the perturbation of training data. It is a position to state our first general generalization bound with high probability for the uniformly stable triplet learning algorithm A. Detailed proof can be found in Sup- plementary Material B.1. Theorem 1. Assume that A : Z n+ − → W is γ- uniformly stable. Let constant M > 0 and, for all z+, ̃z+ ∈ Z+ and z− ∈ Z−, let |ES(cid:96)(A(S); z+, ̃z+, z−)| ≤ M . Then, for all δ ∈ (0, 1/e), we have + ∪ Z n− |RS(A(S)) − R(A(S))| (cid:32) ≤ 6γ + e 8M (cid:16) 1 √ n− + √ 2 n+ − 1 (cid:17)(cid:112)log(e/δ) √ +24 (cid:16) 2γ (cid:100)log2(n−(n+ − 1)2)(cid:101) + 2 (cid:17) (cid:33) log(e/δ) with probability 1 − δ, where (cid:100)n(cid:101) denotes the minimum inte- ger no smaller than n and e denotes the base of the natural logarithm. Remark 1. Theorem 1 demonstrates the generalization per- formance of triplet learning depends heavily on the sam- ple numbers n+, n− and the stability parameter γ, which extends the Theorem 1 of Lei, Ledent, and Kloft (2020) for pairwise learning to the triplet learning setting. Denote x (cid:16) y as ay < x ≤ by for some constants a, b > 0. In particular, when n+ (cid:16) n− (cid:16) n, the high-probability bound in Theorem 1 can be rewritten as O(n− 1 2 + γlogn), which is comparable with the previous analyses (Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021). Generalization bounds for SGD Let w1 ∈ W and let ∇(cid:96)(w) be the subgradient of triplet loss (cid:96) w.r.t. the argument w. For triplet learning by SGD, at the t-th iteration, we draw (it, jt, kt) randomly and uniformly over {(it, jt, kt) : it, jt ∈ [n+], it (cid:54)= jt, kt ∈ [n−]}, and update the model parameter wt by wt+1 = wt − ηt∇(cid:96)(wt; z+ it , z+ jt , z− kt ), (3) where {ηt}t is a sequence of step sizes. To apply Theorem 1, we need to bound the uniform sta- bility parameter of (3). Denote by I[*] the indicator function which takes 1 if the situation in the brackets is satisfied and takes 0 otherwise. Lemma 2. Assume that S, ̄S ∈ Z n+ − are different only in the last positive sample (or negative sample). Sup- pose (cid:96)(w; z+, ̃z+, z−) is convex, α-smooth and L-Lipschitz w.r.t. (cid:107) * (cid:107), ∀z+, ̃z+ ∈ Z+, z− ∈ Z−. If ηt ≤ 2/α, then SGD in (3) with t-th iteration is γ-uniformly stable, where + ∪ Z n− γ ≤2L2 t (cid:88) l=1 ηlI (cid:104) (il = n+ or jl = n+, il (cid:54)= jl, kl ∈ [n−], z+ n+ (cid:54)= ̄z+ n+ ) or (il, jl ∈ [n+], il (cid:54)= jl, kl = n−, z− n− (cid:54)= ̄z− n− (cid:105) ) . In Lemma 2, we just consider the perturbation on the last positive (or negative) sample without loss of generality. The above uniform stability bound of SGD involves an indicator function associated with S and ̄S, which is nonzero only when different triplets are used. Now we state the generalization bounds for SGD (3). The proof is present in Supplementary Material B.2. Theorem 2. Let the loss function (cid:96)(w; z+, ̃z+, z−) is con- vex, α-smooth and L-Lipschitz for all z+, ̃z+ ∈ Z+, z− ∈ Z− and |ES(cid:96)(wT ; z+, ̃z+, z−)| ≤ M , where wT is pro- T and constant c ≤ 2/α. duced by SGD (3) with ηt ≡ c/ For any δ ∈ (0, 1/e), with probability 1 − δ we have √ |RS(wT ) − R(wT )| (cid:32) (cid:16) =O (cid:100)log(n−(n+ − 1)2)(cid:101) + 2 (cid:17) log(1/δ) (cid:115) (cid:16) (cid:17)(cid:16) + 1 √ T n+ √ T n− + (cid:17) + (cid:16) 1 √ n− + √ 1 n+ − 1 max{ T n+ log(1/δ) , T } n− (cid:33) . (cid:17)(cid:112)log(1/δ) Remark 2. Theorem 2 demonstrates that the generalization error of (3) relies on the numbers of positive and negative Algorithm Reference Assumptions Convex Lipschitz SGD ((cid:78)) Hardt, Recht, and Singer (2016) Lei and Ying (2020) Lei, Ledent, and Kloft (2020) SGD ((cid:78)(cid:78)) Lei, Liu, and Ying (2021) Lei, Liu, and Ying (2021) Yang et al. (2021) Yang et al. (2021) SGD ((cid:78)(cid:78)(cid:72)) Ours (n+ (cid:16) n− (cid:16) n) √ √ √ √ √ √ √ √ √ × √ × √ √ √ √ Smooth √ √ √ √ × × √ √ Tool Uniform stability On-average model stability Uniform stability On-average model stability On-average model stability Uniform stability Uniform stability Uniform stability Convergence rate O(n− 1 2 ) O(n−1) ∗O(n− 1 2 logn) O(n−1) O(n− 1 2 ) O(n− 1 2 ) O(n− 1 2 ) ∗O(n− 1 2 logn) Table 1: Summary of stability-based generalization analyses of SGD in the setting of convexity ((cid:78)-pointwise; (cid:78)(cid:78)-pairwise; (cid:78)(cid:78)(cid:72)-triplet; -the reference has such a property; ×-the reference hasn't such a property; ∗-high-probability bound). √ training samples (i.e. n+, n−) and the iterative steps T . Our result also uncovers that the balance of positive and nega- tive training samples is crucial to guarantee the generaliza- tion of triplet learning algorithms. When n+ (cid:16) n− (cid:16) n, we get the high-probability bound |RS(wT ) − R(wT )| = O(n− 1 2 logn), which is consistent with Theorem 4 in Lei, Ledent, and Kloft (2020) for pariwise SGD. Remark 3. Let w∗ R(w). We can deduce that R = arg min w∈W R(wT ) − R(w∗ R) = (cid:0)R(wT ) − RS(wT )(cid:1) + (cid:0)RS(wT ) R)(cid:1). R)(cid:1) + (cid:0)RS(w∗ R) − R(w∗ −RS(w∗ (4) As illustrated in previous studies (Bottou and Bousquet 2007; Lei, Ledent, and Kloft 2020; Lei and Ying 2020), the first two terms in (4) are called the estimation error and op- timization error, respectively. Theorem 2 guarantees the up- per bound of estimation error with O(n− 1 2 logn) and Harvey et al. (2019) states the upper bound of the optimization er- ror with O(T − 1 2 logT ). The third term on the right side of (4) can be bounded by Bernstein's inequality for U-statistics (Pitcan 2017), which is present in the following Lemma 3. Lemma 3. Let b = supz+, ̃z+,z− |(cid:96)(w; z+, ̃z+, z−)| and τ be the variance of (cid:96)(w; z+, ̃z+, z−). Then, for any δ ∈ (0, 1), with probability at least 1 − δ we have |RS(w) − R(w)| ≤ 2blog(1/δ) 3(cid:98)n+/2(cid:99) + (cid:115) 2τ log(1/δ) (cid:98)n+/2(cid:99) + 2blog(1/δ) 3(cid:98)n−(cid:99) + (cid:115) 2τ log(1/δ) (cid:98)n−(cid:99) , √ where (cid:98)n(cid:99) denotes the maximum integer no larger than n. √ 2 logn) as T (cid:16) n. R) = O(n− 1 Under mild conditions, i.e., b = O( R) − R(w∗ n) and n+ (cid:16) n− (cid:16) (cid:113) τ log(1/δ) R) = O(cid:0) log(1/δ) (cid:1) = n, we get RS(w∗ n + n O(n− 1 2 ). Combining this with the bounds of estimation er- ror and optimization error in Remark 3, we deduce that the excess risk R(wT ) − R(w∗ Remark 4. To better highlight the characteristics of The- orem 2, we compare it with the generalization analyses in the setting of convexity (Hardt, Recht, and Singer 2016; Lei and Ying 2020; Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021; Yang et al. 2021) in Table 1. Clearly, our learn- ing theory analysis is novel since it is the first touch for SGD under the triplet learning setting. When n+ (cid:16) n− (cid:16) n, the derived result is comparable with the previous convergence rates (Hardt, Recht, and Singer 2016; Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021). Generalization bounds for RRM We now turn to study the generalization properties of RRM for triplet learning. Detailed proofs are stated in Supplemen- tary Material B.3. Let r : W → R+ be a regularization penalty for increasing the data-fitting ability of ERM. For any datatset S ∈ Z n+ − and RS(w) defined in (2), the derived model parameter of RRM is the minimizer of + ∪ Z n− FS(w) := RS(w) + r(w) (5) over w ∈ W and F (w) := R(w) + r(w). To apply Theorem 1, we also need to verify the stable parameter of RRM (5). Lemma 4. Assume that FS(w) is σ-strongly convex w.r.t. (cid:107) * (cid:107) and (cid:96)(w; z+, ̃z+, z−) is convex and L-Lipschitz. Then, the RRM algorithm A defined as A(S) = arg min FS(w) w∈W (cid:111) L2 σ . is γ-uniformly stable with γ = min (cid:110) 8 n+ , 4 n− When n+ (cid:16) n− (cid:16) n, the uniform stability parameter is O( L2 nσ ), which coincides with the previous analysis for pariwise learning (Lei, Ledent, and Kloft 2020). To tackle the triplet structure, the current analysis involves elaborate error decomposition and the deduce strategy of Lemma B.2 in Lei, Ledent, and Kloft (2020). It is required in Theorem 1 that we assume the triplet loss for a uniformly stable algorithm is bounded in expectation. To get the necessary guarantee, we introduce the follow- ing Lemma 5, which can be proved coherently by utilizing Lemma 2 (Lei, Ledent, and Kloft 2020) and the Lipschitz continuity of the loss function (cid:96). Lemma 5. Let FS(w) be σ-strongly convex w.r.t. (cid:107) * (cid:107), w∗ = arg min F (w), and, for all z+, ̃z+ ∈ Z+, z− ∈ w∈W Z−, let ̃(cid:96)(A(S); z+, ̃z+, z−) = (cid:96)(A(S); z+, ̃z+, z−) − (cid:96)(w∗; z+, ̃z+, z−). If the RRM algorithm A measured by loss function (cid:96) is γ-uniformly stable, then A measured by loss function ̃(cid:96) is also γ-uniformly stable and √ √ |ES ̃(cid:96)(A(S); z+, ̃z+, z−)| ≤ M := min (cid:110) 4 √ 6 n+ , 4 √ 3 n− (cid:111) L2 σ . Theorem 3. Assume that FS(w) is σ-strongly convex w.r.t. (cid:107) * (cid:107), and (cid:96)(w; z+, ̃z+, z−) is convex and L-Lipschitz and supz+, ̃z+,z− |(cid:96)(w∗; z+, ̃z+, z−)| ≤ O( n). Let the vari- ance of (cid:96)(w∗; z+, ̃z+, z−) is less than a positive constant τ . For the RRM algorithm A defined as and any δ ∈ (0, 1/e), we have √ |RS(A(S)) − R(A(S))| (cid:32) σ−1(cid:16) (cid:110) min =O √ √ 2 n+ , 1 √ n− (cid:111)(cid:16) 1 √ n− + 1 √ n+ (cid:17)(cid:114) log 1 δ (cid:115) + min (cid:110) 2 n+ , 1 n− (cid:111) log(cid:0)n−n2 + (cid:1)log (cid:17) 1 δ + (cid:115) log 1 δ n+ + log 1 δ n− with probability 1 − δ. Remark 5. If n+ (cid:16) n− (cid:16) n, the above bound is equivalent 2 + (nσ)−1logn(cid:1). Due to the definitions of FS(w) to O(cid:0)n− 1 and A(S) and r(A(S)) ≥ 0, we deduce that the excess risk R(A(S)) − R(w∗) ≤ R(A(S)) − RS(A(S)) + RS(w∗) − R(w∗) + r(w∗). Analogous to the third term to the right of (cid:113) τ log(1/δ) (4), we have RS(w∗) − R(w∗) = O( log(1/δ) ) n with probability 1 − δ. Therefore, the excess risk bound is O(n− 1 2 logn) when r(w∗) = O(σ(cid:107)w∗(cid:107)2) and σ (cid:16) n− 1 2 . Note that the reason for r(w∗) = O(σ(cid:107)w∗(cid:107)2) can be found in the last part of Supplementary Material B.3. n + √ Optimistic generalization bounds for RRM In this part, we use the on-average stability in Definition 2 and some properties of smoothness to establish the opti- mistic generalization bounds of RRM in the low noise case. Different from the above theorems, we do not require the Lipschitz continuity condition for the triplet loss function. The following lemma establishes the relationship between the estimation error and the model perturbation induced by the change at a single point of the training set. Lemma 6. Assume that for all z+, ̃z+ ∈ Z+, z− ∈ Z− and w ∈ W, the loss function (cid:96)(w; z+, ̃z+, z−) is convex and α-smooth w.r.t. (cid:107) * (cid:107). Then, for all (cid:15) > 0, ES[R(A(S)) − RS(A(S))] (cid:16) (cid:88) 2E S, ̄S(cid:107)A(Si) − A(S)(cid:107)2 ≤ 3((cid:15) + α) 2n+(n+ − 1)n− i∈[n+ ], k∈[n−] , } + + E i , z+ k−1, ̄z− 1 , ..., z− n− }. where Si = {z+ and Sk = {z+ αESRS(A(S)) (cid:15) , z− i+1, ..., z+ n+ k , z− k+1, ..., z− n− S, ̄S(cid:107)A(Sk) − A(S)(cid:107)2(cid:17) i−1, ̄z+ 1 , ..., z+ 1 , ..., z− , z− 1 , ..., z+ n+ From the proof of Lemma 6 (see Supplementary Material B.4) and Definition 2, we know the upper bound in Lemma 6 provides the selection of on-average stability parameter γ. After establishing the connection between E S, ̄S(cid:107)A(Si) − A(S)(cid:107)2 (or E S, ̄S(cid:107)A(Sk) − A(S)(cid:107)2) and ESRS(A(S)), we get the following error bound of RRM. Theorem 4. Assume that the loss function (cid:96)(w; z+, ̃z+, z−) is convex and α-smooth for all z+, ̃z+ ∈ Z+, z− ∈ Z− and w ∈ W, and FS(w) is σ-strongly convex w.r.t. (cid:107) * (cid:107) with S ∈ Z n+ − . Let σmin{n+, n−} ≥ 8α and A(S) = arg min w∈W FS(w). Then, for all (cid:15) > 0, + ∪ Z n− (cid:33) ES[F (A(S)) − FS(w∗)] ≤ ES[R(A(S)) − RS(A(S))] (cid:18) α (cid:15) 1536α((cid:15) + α) +(n+ − 1)σ2 + n2 3(n+ − 1)n2 256α((cid:15) + α) −σ2 ESRS(A(S)). + (cid:19) ≤ n− (cid:16) n, r(w∗) = O(σ(cid:107)w∗(cid:107)2) and (cid:15) = Remark 6. The upper bounds in Theorem 4 are closely related to the empirical risk ESRS(A(S)). It is reason- able to assume that the empirical risk of A(S) is small enough with the increasing of training samples. When n+ (cid:16) −σ2 , −+256n2 + (cid:19) + (cid:0)n− 3 2 + σ(cid:1)(cid:107)w∗(cid:107)2 . 4 (cid:107)w∗(cid:107)−1(cid:112)R(w∗) and R(w∗) = (cid:2)R(A(S)) − R(w∗)(cid:3) = O(n−1(cid:107)w∗(cid:107)2). less than n− 1 2 (cid:107)w∗(cid:107)2 due to When σ = n− 3 n− 1 2 (cid:107)w∗(cid:107)2, ES Note that R(w∗) can not σmin{n+, n−} ≥ 8α. (cid:2)R(A(S)) − R(w∗)(cid:3) = O 3n2 4608n2 R(w∗) 3 2 σ +(n+−1)n2 ES (cid:114) (cid:18) n The above excess risk bound assures the convergence rate O(n−1(cid:107)w∗(cid:107)2) in expectation under proper conditions of w∗ and RS(A(S)), which extends the previous optimistic gen- eralization bounds of pointwise learning (Srebro, Sridharan, and Tewari 2010; Zhang, Yang, and Jin 2017) and pairwise learning (Lei, Ledent, and Kloft 2020) to the triplet setting. Remark 7. As summarized in Table 2, the convergence guarantees in Theorems 3 and 4 are comparable with the existing results in the setting of strong convexity even involv- ing the complicated triplet structure in error decomposition. Algorithm Reference Full-batch SGD ((cid:78)) RRM ((cid:78)) RRM ((cid:78)(cid:78)) RRM ((cid:78)(cid:78)(cid:72)) Klochkov and Zhivotovskiy (2021) Feldman and Vondr ́ak (2019) Lei, Ledent, and Kloft (2020) Lei, Ledent, and Kloft (2020) Ours (n+ (cid:16) n− (cid:16) n) Ours (n+ (cid:16) n− (cid:16) n) Strongly Convex √ √ √ √ √ √ Assumptions Lipschitz Smooth Tool Convergence rate √ √ √ × √ × × × × √ × √ Uniform stability Uniform stability Uniform stability On-average stability Uniform stability On-average stability ∗O(n−1logn) ∗O(n− 1 2 logn) ∗O(n− 1 2 logn) O(n−1) ∗O(n− 1 2 logn) O(n−1) Table 2: Summary of stability-based generalization analyses for algorithms in the setting of strong convexity ((cid:78)-pointwise; (cid:78)(cid:78)-pairwise; (cid:78)(cid:78)(cid:72)-triplet; -the reference has such a property; ×-the reference hasn't such a property; ∗-high-probability bound). √ Applied to Triplet Metric Learning This section applies our generalization analysis to triplet metric learning, which focuses on learning a metric to min- imize the intra-class distance and maximize inter-class dis- tance simultaneously. Let t(y, y(cid:48)) be the symbolic function, i.e., t(y, y(cid:48)) = 1 if y = y(cid:48) and −1 otherwise. Inspired by the 0-1 loss in pairwise metric learning (cid:96)0−1(w; z, z(cid:48)) = I[t(y, y(cid:48))(1 − hw(x, x(cid:48))) ≤ 0] (Lei, Liu, and Ying 2021), loss (cid:96)0−1(w; z+, ̃z+, z−) = we consider a 0-1 triplet I[hw(x+, ̃x+) − hw(x+, x−) + ζ ≥ 0], where the train- ing model hw is considered as hw(x+, ̃x+) = (cid:10)w, (x+ − ̃x+)(x+ − ̃x+)(cid:62)(cid:11), and ζ denotes the margin that requires the distance of negative pairs to excess the one of positive pairs. We introduce the triplet loss (cid:96)φ(w; z+, ̃z+, z−) = φ(hw(x+, ̃x+) − hw(x+, x−) + ζ) (6) associated with the logistic function φ(u) = log(1 + exp(−u)), which is consistent with the error metric used in Schroff, Kalenichenko, and Philbin (2015) and Ge et al. (2018). T , c ≤ 1/(32B4) and (cid:12) When max{supx+∈X+(cid:107)x+(cid:107), supx−∈X− (cid:107)x−(cid:107)} ≤ B, Theorems 2-3 yield the following convergence rates for SGD and RRM with the triplet loss (6), respectively. Corollary 1. Let wT is produced by SGD (3) with √ (cid:12)ES[φ(hwT (x+, ̃x+) − ηt ≡ c/ hwT (x+, x−) + ζ)](cid:12) (cid:12) ≤ M . For any δ ∈ (0, 1/e), with probability 1 − δ, we have |RS(wT ) − R(wT )| = O(cid:0)n− 1 Corollary 2. Consider FS(w) in (5) with the triplet loss (6) and r(w∗) = O(σ(cid:107)w∗(cid:107)2) with σ (cid:16) n− 1 2 . Assume that supz+, ̃z+,z− |(cid:96)(w∗; z+, ̃z+, z−)| ≤ O( n) and the vari- ance of (cid:96)(w∗; z+, ̃z+, z−) is bounded. Then for A(S) = 2 (1/δ) + n− 1 2 (1/δ)(cid:1). 2 lognlog 2 log √ 3 1 arg min w∈W FS(w) and any δ ∈ (0, 1/e), we have R(A(S)) − R(w∗) = O(n− 1 2 lognlog(1/δ)) with probability 1 − δ. Moreover, we get the refined result of RRM from Theo- rem 4 with the help of the strong-convexity of (6). Corollary 3. Under the basic assumptions and notations 4 (cid:107)w∗(cid:107)−1(cid:112)R(w∗) and of Corollary 2, assume σ = n− 3 (cid:2)R(A(S)) − R(w∗) = n− 1 2 (cid:107)w∗(cid:107)2, R(w∗)(cid:3) = O(n−1(cid:107)w∗(cid:107)2). then we have ES Conclusion This paper fills the theoretical gap in the generalization bounds of SGD and RRM for triplet learning by developing algorithmic stability analysis techniques, which are valuable to understanding their intrinsic statistical foundations of out- standing empirical performance. We firstly derive the gen- eral high-probability generalization bound O(γlogn + n− 1 2 ) for triplet uniformly stable algorithms, and then apply it to get the explicit result O(n− 1 2 logn) for SGD and RRM under mild conditions of loss function. For RRM with triplet loss, the optimistic bound O(n−1) in expectation is also provided by leveraging the on-average stability. Even for the compli- cated triplet structure, our results also enjoy similar conver- gence rates as the previous related works of pointwise learn- ing (Hardt, Recht, and Singer 2016; Feldman and Vondr ́ak 2019) and pairwise learning (Lei, Ledent, and Kloft 2020). Some potential directions are discussed in Supplementary Material D for future research. Acknowledgments This work was supported in part by National Natural Sci- ence Foundation of China under Grant Nos. 12071166, 62106191, 61972188, 62122035. References Agarwal, A.; and Zhang, T. 2022. Minimax regret optimiza- tion for robust machine learning under distribution shift. In Conference on Learning Theory (COLT), 2704–2729. Agarwal, S.; and Niyogi, P. 2009. Generalization bounds for ranking algorithms via algorithmic stability. Journal of Machine Learning Research, 10: 441–474. Arous, G. B.; Gheissari, R.; and Jagannath, A. 2021. On- line stochastic gradient descent on non-convex losses from high-dimensional inference. Journal of Machine Learning Research, 22: 106:1–106:51. Bartlett, P. L.; and Mendelson, S. 2001. Rademacher and Gaussian complexities: Risk bounds and structural results. In Conference on Computational Learning Theory, 224– 240. Bassily, R.; Feldman, V.; Guzm ́an, C.; and Talwar, K. 2020. Stability of stochastic gradient descent on nonsmooth con- vex losses. In Advances in Neural Information Processing Systems (NeurIPS), 4381–4391. Bottou, L.; and Bousquet, O. 2007. The tradeoffs of large scale learning. In Advances in Neural Information Process- ing Systems (NeurIPS), 161–168. Boucheron, S.; Lugosi, G.; and Massart, P. 2013. Concentra- tion inequalities - A nonasymptotic theory of independence. Oxford University Press. Bousquet, O.; and Elisseeff, A. 2002. Stability and general- ization. Journal of Machine Learning Research, 2: 499–526. Bousquet, O.; Klochkov, Y.; and Zhivotovskiy, N. 2020. In Con- Sharper bounds for uniformly stable algorithms. ference on Learning Theory (COLT), 610–626. Bromley, J.; Guyon, I.; LeCun, Y.; S ̈ackinger, E.; and Shah, R. 1993. Signature verification using a Siamese time delay neural network. In Advances in Neural Information Process- ing Systems (NeurIPS), 737–744. Cai, T.; Gao, R.; Lee, J. D.; and Lei, Q. 2021. A theory of label propagation for subpopulation shift. In International Conference on Machine Learning (ICML), 1170–1182. Charles, Z.; and Papailiopoulos, D. S. 2018. Stability and generalization of learning algorithms that converge to global optima. In International Conference on Machine Learning (ICML), 744–753. Chen, H. 2012. The convergence rate of a regularized rank- ing algorithm. Journal of Approximation Theory, 164(12): 1513–1519. Chen, H.; Wang, X.; Deng, C.; and Huang, H. 2017. Group sparse additive machine. In Advances in Neural Information Processing Systems (NeurIPS), 198–208. Chen, H.; Wang, Y.; Zheng, F.; Deng, C.; and Huang, H. 2021. Sparse modal additive model. IEEE Transactions on Neural Networks and Learning Systems, 32(6): 2373–2387. Chen, Y.; Jin, C.; and Yu, B. 2018. Stability and con- vergence trade-off of iterative optimization algorithms. arXiv:1804.01619. Cheng, D.; Gong, Y.; Zhou, S.; Wang, J.; and Zheng, N. 2016. Person re-identification by multi-channel parts-based CNN with improved triplet loss function. In Conference on Computer Vision and Pattern Recognition (CVPR), 1335– 1344. Chopra, S.; Hadsell, R.; and LeCun, Y. 2005. Learning a similarity metric discriminatively, with application to face verification. In Conference on Computer Vision and Pattern Recognition (CVPR), 539–546. Cucker, F.; and Smale, S. 2001. On the mathematical foun- dations of learning. Bulletin of the American Mathematical Society, 39: 1–49. Cucker, F.; and Zhou, D. X. 2007. Learning theory: An ap- proximation theory viewpoint. Cambridge University Press. Deng, Z.; He, H.; and Su, W. J. 2021. Toward better general- ization bounds with locally elastic stability. In International Conference on Machine Learning (ICML), 2590–2600. Ding, C.; and Tao, D. 2018. Trunk-Branch ensemble convo- lutional neural networks for video-based face recognition. IEEE Transactions on Pattern Analysis and Machine Intelli- gence, 40(4): 1002–1014. Elisseeff, A.; Evgeniou, T.; and Pontil, M. 2005. Stability of randomized learning algorithms. Journal of Machine Learn- ing Research, 6: 55–79. Fehrman, B. J.; Gess, B.; and Jentzen, A. 2020. Conver- gence rates for the stochastic gradient descent method for non-convex objective functions. Journal of Machine Learn- ing Research, 21: 136:1–136:48. Feldman, V.; and Vondr ́ak, J. 2018. Generalization bounds for uniformly stable algorithms. In Advances in Neural In- formation Processing Systems (NeurIPS), 9770–9780. Feldman, V.; and Vondr ́ak, J. 2019. High probability gener- alization bounds for uniformly stable algorithms with nearly In Conference on Learning Theory (COLT), optimal rate. 1270–1279. Foster, D. J.; Greenberg, S.; Kale, S.; Luo, H.; Mohri, M.; and Sridharan, K. 2019. Hypothesis set stability and gen- eralization. In Advances in Neural Information Processing Systems (NeurIPS), 6726–6736. Gao, W.; and Zhou, Z. 2013. Uniform convergence, stability and learnability for ranking problems. In International Joint Conference on Artificial Intelligence (IJCAI), 1337–1343. Ge, W.; Huang, W.; Dong, D.; and Scott, M. R. 2018. Deep metric learning with hierarchical triplet loss. In European Conference on Computer Vision (ECCV), 272–288. Gizewski, E.; Mayer, L.; Moser, B.; Nguyen, D.; Pereverzyev, S.; Pereverzyev, S.; Shepeleva, N.; and Zellinger, W. 2022. On a regularization of unsupervised domain adaptation in RKHS. Applied and Computational Harmonic Analysis, 57: 201–227. Hadsell, R.; Chopra, S.; and LeCun, Y. 2006. Dimensional- ity reduction by learning an invariant mapping. In Confer- ence on Computer Vision and Pattern Recognition (CVPR), 1735–1742. Hardt, M.; Recht, B.; and Singer, Y. 2016. Train faster, generalize better: Stability of stochastic gradient descent. In International Conference on Machine Learning (ICML), 1225–1234. Harvey, N. J. A.; Liaw, C.; Plan, Y.; and Randhawa, S. 2019. Tight analyses for non-smooth stochastic gradient descent. In Conference on Learning Theory (COLT), 1579–1613. Huang, J.; Feris, R. S.; Chen, Q.; and Yan, S. 2015. Cross- domain image retrieval with a dual attribute-aware ranking network. In International Conference on Computer Vision (ICCV), 1062–1070. Jin, R.; Wang, S.; and Zhou, Y. 2009. Regularized distance metric learning: Theory and algorithm. In Advances in Neu- ral Information Processing Systems (NeurIPS), 862–870. Klochkov, Y.; and Zhivotovskiy, N. 2021. Stability and de- viation optimal risk bounds with convergence rate O(1/n). In Advances in Neural Information Processing Systems (NeurIPS), 5065–5076. Kuzborskij, I.; and Lampert, C. H. 2018. Data-dependent In International stability of stochastic gradient descent. Conference on Machine Learning (ICML), 2820–2829. Lai, H.; Pan, Y.; Liu, Y.; and Yan, S. 2015. Simultaneous feature learning and hash coding with deep neural networks. In Conference on Computer Vision and Pattern Recognition (CVPR), 3270–3278. Lei, Y.; Hu, T.; and Tang, K. 2021. Generalization perfor- mance of multi-pass stochastic gradient descent with convex loss functions. Journal of Machine Learning Research, 22: 25:1–25:41. Lei, Y.; Ledent, A.; and Kloft, M. 2020. Sharper general- ization bounds for pairwise learning. In Advances in Neural Information Processing Systems (NeurIPS), 21236–21246. Lei, Y.; Liu, M.; and Ying, Y. 2021. Generalization guar- antee of SGD for pairwise learning. In Advances in Neural Information Processing Systems (NeurIPS), 21216–21228. Lei, Y.; Yang, Z.; Yang, T.; and Ying, Y. 2021. Stability and generalization of stochastic gradient methods for minimax problems. In International Conference on Machine Learn- ing (ICML), 6175–6186. Lei, Y.; and Ying, Y. 2020. Fine-grained analysis of stability and generalization for stochastic gradient descent. In Inter- national Conference on Machine Learning (ICML), 5809– 5819. Lei, Y.; and Ying, Y. 2021. Sharper generalization bounds for learning with gradient-dominated objective functions. In International Conference on Learning Representations (ICLR), 1–23. Lin, J.; Camoriano, R.; and Rosasco, L. 2016. Gener- alization properties and implicit regularization for multi- ple passes SGM. In International Conference on Machine Learning (ICML), 2340–2348. Liu, H.; Tian, Y.; Wang, Y.; Pang, L.; and Huang, T. 2016. Deep relative distance learning: Tell the difference between similar vehicles. In Conference on Computer Vision and Pat- tern Recognition (CVPR), 2167–2175. Liu, T.; Lugosi, G.; Neu, G.; and Tao, D. 2017. Algorithmic stability and hypothesis complexity. In International Con- ference on Machine Learning (ICML), 2159–2167. Maurer, A. 2017. A second-order look at stability and gener- alization. In Conference on Learning Theory (COLT), 1461– 1475. Miller, J.; Taori, R.; Raghunathan, A.; Sagawa, S.; Koh, P. W.; Shankar, V.; Liang, P.; Carmon, Y.; and Schmidt, L. 2021. Accuracy on the line: On the strong correlation be- tween out-of-distribution and in-distribution generalization. In International Conference on Machine Learning (ICML), 7721–7735. Pitcan, Y. 2017. A note on concentration inequalities for U-statistics. arXiv:1712.06160. Poggio, T. A.; Rifkin, R. M.; Mukherjee, S.; and Niyogi, P. 2004. General conditions for predictivity in learning theory. Nature, 428: 419–422. Ramanathan, V.; Li, C.; Deng, J.; Han, W.; Li, Z.; Gu, K.; Song, Y.; Bengio, S.; Rosenberg, C.; and Fei-Fei, L. 2015. Learning semantic relationships for better action retrieval in images. In Conference on Computer Vision and Pattern Recognition (CVPR), 1100–1109. A finite sample Rogers, W.; and Wagner, T. 1978. distribution-free performance bound for local discrimination rules. The Annals of Statistics, 6: 506–514. Rosasco, L.; Belkin, M.; and Vito, E. D. 2010. On learn- ing with integral operators. Journal of Machine Learning Research, 11: 905–934. Roux, N. L.; Schmidt, M.; and Bach, F. R. 2012. A stochas- tic gradient method with an exponential convergence rate for finite training sets. In Advances in Neural Information Pro- cessing Systems (NeurIPS), 2672–2680. Schroff, F.; Kalenichenko, D.; and Philbin, J. 2015. FaceNet: A unified embedding for face recognition and clustering. In Conference on Computer Vision and Pattern Recognition (CVPR), 815–823. Schultz, M.; and Joachims, T. 2003. Learning a distance In Advances in Neural metric from relative comparisons. Information Processing Systems (NeurIPS), 41–48. Shalev-Shwartz, S.; Shamir, O.; Srebro, N.; and Sridharan, K. 2010. Learnability, stability and uniform convergence. Journal of Machine Learning Research, 11: 2635–2670. Shen, W.; Yang, Z.; Ying, Y.; and Yuan, X. 2019. Stabil- ity and optimization error of stochastic gradient descent for pairwise learning. arXiv:1904.11316. Shen, Z.; Liu, J.; He, Y.; Zhang, X.; Xu, R.; Yu, H.; and Cui, P. 2021. Towards out-of-distribution generalization: A survey. arXiv:2108.13624. Simo-Serra, E.; Trulls, E.; Ferraz, L.; Kokkinos, I.; Fua, P.; and Moreno-Noguer, F. 2015. Discriminative learning of In Interna- deep convolutional feature point descriptors. tional Conference on Computer Vision (ICCV), 118–126. Smale, S.; and Zhou, D.-X. 2007. Learning theory estimates via integral operators and their approximations. Construc- tive Approximation, 26: 153–172. Srebro, N.; Sridharan, K.; and Tewari, A. 2010. Smoothness, low noise and fast rates. In Advances in Neural Information Processing Systems (NeurIPS), 2199–2207. O(1/n2)-type of risk bounds. In Conference on Learning Theory (COLT), 1954–1979. Zhang, Y. 2015. Multi-task learning and algorithmic sta- bility. In AAAI Conference on Artificial Intelligence, 3181– 3187. Sun, T.; Li, D.; and Wang, B. 2021. Stability and general- ization of decentralized stochastic gradient descent. In AAAI Conference on Artificial Intelligence, 9756–9764. Ustinova, E.; and Lempitsky, V. S. 2016. Learning deep em- beddings with histogram Loss. In Advances in Neural Infor- mation Processing Systems (NeurIPS), 4170–4178. Vapnik, V. N. 1998. Statistical learning theory. Encyclope- dia of the Sciences of Learning, 41(4): 3185–3185. Wang, B.; Zhang, H.; Liu, P.; Shen, Z.; and Pineau, J. 2019. Multitask metric learning: Theory and algorithm. In Inter- national Conference on Artificial Intelligence and Statistics (AISTATS), 3362–3371. Wang, J.; Lan, C.; Liu, C.; Ouyang, Y.; and Qin, T. 2021. Generalizing to unseen domains: A survey on domain gen- eralization. In International Joint Conference on Artificial Intelligence (IJCAI), 4627–4635. Wang, Y.; Chen, H.; Zheng, F.; Xu, C.; Gong, T.; and Chen, Y. 2020. Multi-task additive models for robust estimation In Advances in Neural and automatic structure discovery. Information Processing Systems (NeurIPS). Weinberger, K. Q.; Blitzer, J.; and Saul, L. K. 2005. Distance metric learning for large margin nearest neighbor classifica- tion. In Advances in Neural Information Processing Systems (NeurIPS), 1473–1480. Wohlhart, P.; and Lepetit, V. 2015. Learning descriptors for object recognition and 3D pose estimation. In Conference on Computer Vision and Pattern Recognition (CVPR), 3109– 3118. Xiao, T.; Li, H.; Ouyang, W.; and Wang, X. 2016. Learning deep feature representations with domain guided dropout for person re-identification. In Conference on Computer Vision and Pattern Recognition (CVPR), 1249–1258. Xing, E. P.; Ng, A. Y.; Jordan, M. I.; and Russell, S. 2002. Distance metric learning with application to clustering with side-information. In Advances in Neural Information Pro- cessing Systems (NeurIPS), 505–512. Xing, Y.; Song, Q.; and Cheng, G. 2021. On the algorith- mic stability of adversarial training. In Advances in Neural Information Processing Systems (NeurIPS), 26523–26535. Yang, Z.; Lei, Y.; Wang, P.; Yang, T.; and Ying, Y. 2021. Simple stochastic and online gradient descent algorithms for pairwise learning. In Advances in Neural Information Pro- cessing Systems (NeurIPS), 20160–20171. Ye, H.; Xie, C.; Cai, T.; Li, R.; Li, Z.; and Wang, L. 2021. Towards a theoretical framework of out-of-distribution gen- eralization. In Advances in Neural Information Processing Systems (NeurIPS), 23519–23531. Ying, Y.; and Li, P. 2012. Distance metric learning with eigenvalue optimization. Journal of Machine Learning Re- search, 13: 1–26. Yu, B.; Liu, T.; Gong, M.; Ding, C.; and Tao, D. 2018. Cor- recting the triplet selection bias for triplet loss. In European Conference on Computer Vision (ECCV), 71–86. Zhang, L.; Yang, T.; and Jin, R. 2017. Empirical risk min- imization for stochastic convex optimization: O(1/n)-and The main notations of this paper are summarized in Table 3. A. Notations Notations Descriptions SGD RRM ERM SLT Z+(Z−) z+ = (x+, y+) z− = (x−, y−) Stochastic gradient descent Regularized risk minimization Empirical risk minimization Statistical learning theory the compact positive (negative) sample space associated with input space X+ (X− ) and output set Y the random sample sampling from Z+ the random sample sampling from Z− n+, n− the numbers of samples sampling from Z+ and Z−, respectively hw w, W S d, d(cid:48) (cid:96)(w) ∇(cid:96) R, RS T wT ηT A, A(S) γ, σ, L, α τ r(w) FS(w) w∗ R w∗ t(y, y(cid:48)) φ (cid:62) (cid:16) [*] the training model the parameter of training model and model parameter space, respectively i = (x+ the training dataset defined as {z+ i=1 ∪ {z− j = (x− i )}n+ j , y− i , y+ j )}n− j=1 ∈ Z := Z n+ + ∪ Z n− − the dimensions of X+(X−) and W, respectively the triplet loss function defined as (cid:96)(w; z+, ̃z+, z−) the gradient of (cid:96)(w; z+, ̃z+, z−) to the first argument w the population risk and empirical risk based on training dataset S, respectively the number of iterative steps for SGD the model parameter derived by SGD after T -th update the step size at the T -th update the given algorithm and its output model parameter based on training dataset S, respectively the parameters of stability, strong convexity, Lipschitz continuity and smoothness, respectively the variance of triplet loss (cid:96)(w; z+, ̃z+, z−) the regularization term the regularized empirical risk defined as RS(w) + r(w) the optimal model based on the expected risk, w∗ R = arg min w∈W R(w) the optimal model based on the regularized empirical risk, w∗ = arg min w∈W FS(w) the symbolic function, i.e., t(y, y(cid:48)) = 1 if y = y(cid:48) and −1 otherwise the logistic function φ(u) = log(1 + exp(−u)) the transpose of a vector or a matrix n+ (cid:16) n− if there exist positive constants c1, c2 such that c1n+ ≤ n− ≤ c2n+ [n] := {1, ..., n} (cid:98)*(cid:99), (cid:100)*(cid:101) (cid:98)n(cid:99): the maximum integer no larger than n, (cid:100)n(cid:101): the minimum integer no smaller than n e I[*] ζ the base of the natural logarithm the indicator function the margin that requires the distance of negative pairs to excess one of the positive pairs Table 3: Summary of main notations involved in this paper. B. Proofs of Main Results We start with the sketching of the relations among theorems and lemmas in Figure 1, and then progress to the detailed proofs. Figure 1: The proof diagram for Theorems 1-4. Note that our framework is similar with Lei, Ledent, and Kloft (2020), which mainly includes three parts: stability definition, the quantitative relationship between stability and generalization error, and the upper bound of stability parameter. Our theo- retical results cannot be established directly from the current framework due to the complex triplet loss. To fill this theoretical gap on the generalization guarantees of triplet learning, we develop stability analysis technique by constructing new defini- tions of stability(see Definitions 1, 2), introducing detailed error decomposition(see Theorems 1), and considering fine-grained sampling situations for bounding stability parameter(see proofs of Lemmas 2, 4 and Theorems 2, 4). B.1 Proof of Theorem 1 Lemma 1 can be proved with the help of the triangular inequality and Definition 1. Proof of Lemma 1: Recall that, S and ̄S involved in Definition 1, differ by at most a single example. To relate S with Si,j,k = {z+ i+1, ..., z+ (also see Definition 2), we introduce the following stepping-stone sets j+1, ..., z+ n+ 1 , ..., z+ j−1, ̄z+ i−1, ̄z+ j , z+ i , z+ , z− 1 , ..., z− k−1, ̄z− k , z− k+1, ..., z− n− }, i, j ∈ [n+], i (cid:54)= j, k ∈ [n−] and Si,j = {z+ 1 , ..., z+ i−1, ̄z+ i , z+ i+1, ..., z+ j−1, ̄z+ j , z+ j+1, ..., z+ n+, z− 1 , ..., z− n− Si = {z+ 1 , ..., z+ i−1, ̄z+ i , z+ i+1, ..., z+ n+, z− 1 , ..., z− n− } }, ∀i, j ∈ [n+], i (cid:54)= j. It is easy to verify that |(cid:96)(A(S); z+, ̃z+, z−) − (cid:96)(A(Si,j,k); z+, ̃z+, z−)| sup z+ , ̃z+ ∈Z+ , z− ∈Z− ≤ sup |(cid:96)(A(S); z+, ̃z+, z−) − (cid:96)(A(Si); z+, ̃z+, z−)| + sup |(cid:96)(A(Si); z+, ̃z+, z−) − (cid:96)(A(Si,j); z+, ̃z+, z−)| |(cid:96)(A(Si,j); z+, ̃z+, z−) − (cid:96)(A(Si,j,k); z+, ̃z+, z−)| z+ , ̃z+ ∈Z+ , z− ∈Z− z+ , ̃z+ ∈Z+ , z− ∈Z− + sup z+ , ̃z+ ∈Z+ , z− ∈Z− ≤3γ. (cid:3) This completes the proof. Now we introduce the concentration inequalities for the moment of the sum of functions of independent variables (Bousquet, Klochkov, and Zhivotovskiy 2020), which also has been employed for stability analysis in (Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021). Lemma 7. (Bousquet, Klochkov, and Zhivotovskiy 2020) For independent random variables with zi ∈ Z, i ∈ [n], denote S = {z1, ..., zn}, S\{zi} = {z1, ..., zi−1, zi+1, ..., zn} and functions gi : Z n → R, i ∈ [n]. Suppose that for any i ∈ [n]: • |ES\{zi}gi(S)| ≤ M almost surely (a.s.) with M > 0, • Ezigi(S) = 0 a.s., • the difference of function gi can be bounded by β, i.e., |gi(z1, ..., zn) − gi(z1, ..., zj−1, ̄zj, zj+1, ..., zn)| ≤ β, where j ∈ [n] with i (cid:54)= j, and ̄zj ∈ Z. Then, (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) n (cid:88) i=1 gi(S) √ ≤ 12 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)p 2pnβ(cid:100)log2n(cid:101) + 4M √ pn, ∀p ≥ 2. Lemma 8. (Bousquet, Klochkov, and Zhivotovskiy 2020) If (cid:107)Z(cid:107)p ≤ a, b ∈ R+. Then, for any δ ∈ (0, 1/e), we have √ pa + pb, where Z is a random variable, p ≥ 2 and |Z| ≤ e (cid:16) (cid:17) a(cid:112)log(e/δ) + blog(e/δ) with probability at least 1 − δ, where e denotes the base of the natural logarithm. The proof of Theorem 1 is obtained by integrating Lemmas 1, 7, 8 with the fine-grained error decomposition. Proof of Theorem 1: According to the definitions of RS(A(S)) and R(A(S)), we know |R(A(S)) − RS(A(S))| = (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Ez+, ̃z+,z− (cid:96)(A(S); z+, ̃z+, z−) − 1 n+(n+ − 1)n− (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n−] For convenience, we multiply this equation by n+(n+ − 1)n− and then decompose it as follows (cid:96)(A(S); z+ i , z+ (cid:12) (cid:12) j , z− (cid:12) k ) (cid:12) (cid:12) . (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) = = ≤ (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n−] (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n−] n+(n+ − 1)n−Ez+, ̃z+,z− (cid:96)(A(S); z+, ̃z+, z−) − (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n−] (cid:96)(A(S); z+ i , z+ (cid:12) (cid:12) j , z− (cid:12) k ) (cid:12) (cid:12) (cid:104) Ez+, ̃z+,z− (cid:96)(A(S); z+, ̃z+, z−) − (cid:96)(A(S); z+ i , z+ (cid:12) (cid:12) (cid:105) j , z− (cid:12) k ) (cid:12) (cid:12) (cid:104) Ez+, ̃z+,z− (cid:96)(A(S); z+, ̃z+, z−) − E i , ̄z+ ̄z+ j , ̄z− k (cid:88) Ez+, ̃z+,z− i,j∈[n+ ],i(cid:54)=j, k∈[n−] (cid:104) (cid:96)(A(S); z+, ̃z+, z−) − E i , ̄z+ ̄z+ j , ̄z− k (cid:96)(A(S); z+ i , z+ j , z− k ) (cid:12) (cid:12) (cid:105) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:105) (cid:96)(A(Si,j,k); z+, ̃z+, z−) (cid:12) (cid:12) (cid:12) + + (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) i,j∈[n+],i(cid:54)=j, k∈[n− ] (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n− ] (cid:104) E i , ̄z+ ̄z+ j , ̄z− k Ez+, ̃z+,z−(cid:96)(A(Si,j,k); z+, ̃z+, z−) − (cid:96)(A(Si,j,k); z+ i , z+ (cid:12) (cid:12) (cid:105) j , z− (cid:12) k ) (cid:12) (cid:12) E i , ̄z+ ̄z+ j , ̄z− k [(cid:96)(A(Si,j,k); z+ i , z+ j , z− k ) − (cid:96)(A(S); z+ i , z+ j , z− (cid:12) (cid:12) (cid:12) k )] (cid:12) (cid:12) , where the definition of Si,j,k is given in Definition 2 (also see the proof of Lemma 1). Now we try to bound the three parts of the above decomposition. For the first and third parts, according to Lemma 1, we deduce that (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) Ez+, ̃z+,z− (cid:104) i,j∈[n+],i(cid:54)=j, k∈[n− ] (cid:96)(A(S); z+, ̃z+, z−) − E i , ̄z+ ̄z+ j , ̄z− k (cid:96)(A(Si,j,k); z+, ̃z+, z−) (cid:12) (cid:12) (cid:105) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) n+(n+ − 1)n− (cid:12) (cid:12) ≤ sup z+ , ̃z+ ∈Z+ , z−∈Z− ≤3n+(n+ − 1)n−γ (cid:104) (cid:96)(A(S); z+, ̃z+, z−) − E i , ̄z+ ̄z+ j , ̄z− k (cid:105) (cid:96)(A(Si,j,k); z+, ̃z+, z−) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) and (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n− ] E i , ̄z+ ̄z+ j , ̄z− k [(cid:96)(A(Si,j,k); z+ i , z+ j , z− k ) − (cid:96)(A(S); z+ i , z+ j , z− (cid:12) (cid:12) (cid:12) k )] (cid:12) (cid:12) n+(n+ − 1)n− + ̄z i sup + , ̄z j − ∈Z− k ̄z ∈Z+ , (cid:0)(cid:96)(A(Si,j,k); z+ i , z+ j , z− k ) − (cid:96)(A(S); z+ i , z+ j , z− k )(cid:1) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Turn to the bound of the second part, let ≤3n+(n+ − 1)n−γ. (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n−] where E i , ̄z+ ̄z+ j , ̄z− k (cid:104) Ez+, ̃z+,z− (cid:96)(A(Si,j,k); z+, ̃z+, z−) − (cid:96)(A(Si,j,k); z+ i , z+ (cid:105) j , z− k ) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) = (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) gi,j,k(S) i,j∈[n+ ],i(cid:54)=j, k∈[n− ] (cid:12) (cid:12) (cid:12) , (cid:12) (cid:12) (cid:104) gi,j,k(S) =E i , ̄z+ ̄z+ j , ̄z− k =E i , ̄z+ ̄z+ j , ̄z− k Ez+, ̃z+,z− (cid:96)(A(Si,j,k); z+, ̃z+, z−) − (cid:96)(A(Si,j,k); z+ (cid:104) Ez+, ̃z+,z− (cid:96)(A(Si,j,k); z+, ̃z+, z−) − Ez+, ̃z+(cid:96)(A(Si,j,k); z+, ̃z+, z− k ) i , z+ (cid:105) j , z− k ) + Ez+, ̃z+(cid:96)(A(Si,j,k); z+, ̃z+, z− k ) − (cid:96)(A(Si,j,k); z+ i , z+ (cid:105) j , z− k ) =E k j , ̄z− ̄z+ i , ̄z+ + Ez+, ̃z+(cid:96)(A(Si,j,k); z+, ̃z+, z− + Ez+(cid:96)(A(Si,j,k); z+, z+ (cid:104) Ez+, ̃z+,z− (cid:96)(A(Si,j,k); z+, ̃z+, z−) − Ez+, ̃z+(cid:96)(A(Si,j,k); z+, ̃z+, z− k ) k ) − Ez+(cid:96)(A(Si,j,k); z+, z+ j , z− k ) (cid:105) j , z− k ) k ) − (cid:96)(A(Si,j,k); z+ i , z+ :=g(i,j) k (S) + g(i,k) j j , z− (S) + g(j,k) i (S) with g(i,j) k (S) := E i , ̄z+ ̄z+ (S) := E g(i,k) j g(j,k) i j , ̄z− k (cid:104) (cid:105) (cid:104) Ez+, ̃z+,z− (cid:96)(A(Si,j,k); z+, ̃z+, z−) − Ez+, ̃z+(cid:96)(A(Si,j,k); z+, ̃z+, z− k ) (cid:105) j , z− k ) (cid:105) j , z− k ) k ) − Ez+(cid:96)(A(Si,j,k); z+, z+ Ez+, ̃z+(cid:96)(A(Si,j,k); z+, ̃z+, z− Ez+(cid:96)(A(Si,j,k); z+, z+ k ) − (cid:96)(A(Si,j,k); z+ i , z+ (cid:104) j , ̄z− i , ̄z+ ̄z+ (S) := E k , , . i , ̄z+ ̄z+ j , ̄z− k j , z− , ..., g(i,j) For any fixed i, j ∈ [n+], i (cid:54)= j, and consider n− random functions g(i,j) 1 n− . In terms of |ES(cid:96)(A(S); z+, ̃z+, z−)| ≤ M, ∀z+, ̃z+ ∈ Z+, z− ∈ Z−, we know |E S\{z− k }g(i,j) k (S)| = S\{z− k } (cid:34) E i , ̄z+ ̄z+ j , ̄z− k (cid:104) Ez+, ̃z+,z− (cid:96)(A(Si,j,k); z+, ̃z+, z−) − Ez+, ̃z+(cid:96)(A(Si,j,k); z+, ̃z+, z− k ) (cid:35)(cid:12) (cid:12) (cid:105) (cid:12) (cid:12) (cid:12) (cid:34) ESi,j,k (cid:104) Ez+, ̃z+,z− (cid:96)(A(Si,j,k); z+, ̃z+, z−) − Ez+, ̃z+(cid:96)(A(Si,j,k); z+, ̃z+, z− k ) (cid:35)(cid:12) (cid:12) (cid:105) (cid:12) (cid:12) (cid:12) i ,z+ z+ j Since z− k is independent of Si,j,k, we have |E z− k g(i,j) k (S)| = (cid:34) E i , ̄z+ ̄z+ j , ̄z− k (cid:104) Ez+, ̃z+,z− (cid:96)(A(Si,j,k); z+, ̃z+, z−) − Ez+, ̃z+(cid:96)(A(Si,j,k); z+, ̃z+, z− k ) z− k i , ̄z+ ̄z+ j , ̄z− k i , ̄z+ ̄z+ j , ̄z− k (cid:34) E z− k (cid:104) Ez+, ̃z+,z− (cid:96)(A(Si,j,k); z+, ̃z+, z−) − Ez+, ̃z+(cid:96)(A(Si,j,k); z+, ̃z+, z− k ) (cid:104) Ez+, ̃z+,z−(cid:96)(A(Si,j,k); z+, ̃z+, z−) − E z+, ̃z+,z− k (cid:105) (cid:96)(A(Si,j,k); z+, ̃z+, z− k ) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:35)(cid:12) (cid:12) (cid:105) (cid:12) (cid:12) (cid:12) (cid:35)(cid:12) (cid:12) (cid:105) (cid:12) (cid:12) (cid:12) E (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ 2M. = E E = (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) E (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) E (cid:12) (cid:12) (cid:12) = 0. = For any m ∈ [n−] and ̄z− |g(i,j) k (cid:12) (cid:12) E (cid:12) (cid:12) (cid:12) = i , ̄z+ ̄z+ j , ̄z− k m ∈ Z−, we can easily check that (S) − g(i,j) k (S(m))| (cid:104) (cid:105) Ez+, ̃z+,z−(cid:96)(A(Si,j,k); z+, ̃z+, z−) − Ez+, ̃z+(cid:96)(A(Si,j,k); z+, ̃z+, z− k ) (cid:104) Ez+, ̃z+,z− (cid:96)(A(S(m) i,j,k); z+, ̃z+, z−) − Ez+, ̃z+(cid:96)(A(S(m) (cid:12) (cid:12) (cid:105) i,j,k); z+, ̃z+, z− (cid:12) k ) (cid:12) (cid:12) − E i , ̄z+ ̄z+ j , ̄z− k (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ (cid:104) E i , ̄z+ ̄z+ j , ̄z− k Ez+, ̃z+,z− [(cid:96)(A(Si,j,k); z+, ̃z+, z−) − (cid:96)(A(S(m) E + j , ̄z− i , ̄z+ ̄z+ (cid:104) Ez+, ̃z+[(cid:96)(A(Si,j,k); z+, ̃z+, z− (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤2γ, i,j,k are respect to S and Si,j,k after replacing z− k k ) − (cid:96)(A(S(m) (cid:12) (cid:12) (cid:105) i,j,k); z+, ̃z+, z−)] (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) i,j,k); z+, ̃z+, z− (cid:105) k )] where S(m) and S(m) g(i,j) , ..., g(i,j) 1 i, j ∈ [n+], i (cid:54)= j, we get m, respectively. Therefore, we prove that, for n− , all the assumptions of Lemma 7 hold with n replaced by n− and β = 2γ. Based on Lemma 7, for any m with ̄z− (cid:88) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) k∈[n−] g(i,j) k (S) √ ≤ 24 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)p (cid:12) 2pn−γ(cid:100)log2n−(cid:101) + 8M √ pn−. (S) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)p (cid:12) √ ≤ 24 2p(n+ − 1)γ(cid:100)log2(n+ − 1)(cid:101) + 8M (cid:112)p(n+ − 1), ∀i ∈ [n+], k ∈ [n−] Similarly, we also have (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) g(i,k) j j∈[n+],i(cid:54)=j and (cid:88) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) i∈[n+],i(cid:54)=j g(j,k) i (cid:12) (cid:12) (S) (cid:12) (cid:12) (cid:12) (cid:12)p √ ≤ 24 2p(n+ − 1)γ(cid:100)log2(n+ − 1)(cid:101) + 8M (cid:112)p(n+ − 1), ∀j ∈ [n+], k ∈ [n−]. Then, by direct computation, we derive that (cid:88) gi,j,k(S) i,j∈[n+ ],i(cid:54)=j, k∈[n− ] (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)p (cid:12) = (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) (cid:16) i,j∈[n+ ],i(cid:54)=j, k∈[n− ] g(i,j) k (S) + g(i,k) j (S) + g(j,k) i (S) (cid:12) (cid:12) (cid:17) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)p (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)p (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)p + (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) g(i,k) j (S) i,j∈[n+ ],i(cid:54)=j, k∈[n−] (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)p + (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) g(i,j) k (S) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)p (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) + i∈[n+ ], k∈[n−] (cid:88) g(i,k) j j∈[n+],i(cid:54)=j i,j∈[n+ ],i(cid:54)=j, k∈[n−] (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)p (cid:12) (cid:12) (cid:12) (S) (cid:12) (cid:12) + (cid:88) j∈[n+ ], k∈[n− ] (cid:88) g(j,k) i (S) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) g(j,k) i i∈[n+],i(cid:54)=j (cid:12) (cid:12) (cid:12) (S) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)p (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ (cid:88) g(i,j) k (S) i,j∈[n+ ],i(cid:54)=j, k∈[n− ] (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) (cid:88) k∈[n−] i,j∈[n+ ], i(cid:54)=j √ √ ≤24 2pn+(n+ − 1)n−γ(cid:100)log2n−(cid:101) + 8M n+(n+ − 1) + (cid:0)24 √ 2pn+(n+ − 1)n−γ(cid:100)log2(n+ − 1)(cid:101) + 8M n+n− (cid:112)p(n+ − 1)(cid:1) × 2 (cid:0)(n+ − 1) 2pn+(n+ − 1)n−γ[(cid:100)log2n−(cid:101) + 2(cid:100)log2(n+ − 1)(cid:101)] + 8M n+ (cid:16) √ (cid:16) (cid:17) √ (cid:0)n−(n+ − 1)2(cid:1)(cid:101) + 2 + 8M n+ p (n+ − 1) 2pn+(n+ − 1)n−γ (cid:100)log2 =24 √ ≤24 √ pn− pn− + 2n− √ n− + 2n− (cid:112)p(n+ − 1)(cid:1) (cid:17) (cid:112)n+ − 1 , where the first and second inequalities are built with the subadditivity of (cid:107) * (cid:107)p. Hence, according to Lemma 8, the third error term (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n− ] (cid:12) (cid:12) (cid:12) gi,j,k(S) (cid:12) (cid:12) (cid:32) ≤e 8M n+ (cid:16) √ (n+ − 1) n− + 2n− (cid:112)n+ − 1 (cid:17)(cid:112)log(e/δ) The desired result follows by combining the estimations of the three error terms. (cid:3) √ + 24 2n+(n+ − 1)n−γ (cid:16) (cid:100)log2 (cid:0)n−(n+ − 1)2(cid:1)(cid:101) + 2 (cid:17) (cid:33) . log(e/δ) B.2 Proof of Theorem 2 Following the analysis in (Hardt, Recht, and Singer 2016), we can verify the following property for the gradient update. Lemma 9. Assume that the loss function w → (cid:96)(w; z+, ̃z+, z−) is convex and α-smooth, where z+, ̃z+ ∈ Z+, z− ∈ Z−. Then, for any η ≤ 2/α, the optimization process of SGD is 1-expansive, that is (cid:107)w − η∇(cid:96)(w; z+, ̃z+, z−) − w(cid:48) + η∇(cid:96)(w(cid:48); z+, ̃z+, z−)(cid:107) ≤ (cid:107)w − w(cid:48)(cid:107). Proof of Lemma 2: Assume S and S(cid:48) are two datasets that differ only by the last example among the former n+ samples. If it, jt ∈ [n+ − 1], it (cid:54)= jt and kt ∈ [n−], according to (3) and Lemma 9, we know that (cid:107)wt+1 − w(cid:48) t+1(cid:107) = (cid:107)wt − ηt∇(cid:96)(wt; z+ it = (cid:107)wt − ηt∇(cid:96)(wt; z+ it ≤ (cid:107)wt − w(cid:48) t(cid:107). , z+ jt , z+ jt , z− kt , z− kt ) − w(cid:48) ) − w(cid:48) t + ηt∇(cid:96)(w(cid:48) t + ηt∇(cid:96)(w(cid:48) t; ̄z+ it t; z+ it , ̄z+ jt , z+ jt , ̄z− kt , z− kt )(cid:107) )(cid:107) If it = n+ or jt = n+, it (cid:54)= jt, kt ∈ [n−], we get that (cid:107)wt+1 − w(cid:48) t+1(cid:107) = (cid:107)wt − ηt∇(cid:96)(wt; z+ , z− it kt t(cid:107) + (cid:107)ηt∇(cid:96)(wt; ̄z+ it t(cid:107) + 2ηtL. ≤ (cid:107)wt − w(cid:48) ≤ (cid:107)wt − w(cid:48) , z+ jt ) − w(cid:48) , ̄z− , ̄z+ jt kt t + ηt∇(cid:96)(w(cid:48) t; ̄z+ , ̄z+ jt it , z+ t; z+ ) − ηt∇(cid:96)(w(cid:48) jt it , ̄z− )(cid:107) kt , z− kt )(cid:107) Assume S and S(cid:48) are two datasets that differ only by the last example among the later n− samples. If it, jt ∈ [n+], it (cid:54)= jt and kt ∈ [n− − 1], we have (cid:107)wt+1 − w(cid:48) t+1(cid:107) = (cid:107)wt − ηt∇(cid:96)(wt; z+ it = (cid:107)wt − ηt∇(cid:96)(wt; z+ it ≤ (cid:107)wt − w(cid:48) t(cid:107). , z+ jt , z+ jt , z− kt , z− kt ) − w(cid:48) ) − w(cid:48) t + ηt∇(cid:96)(w(cid:48) t + ηt∇(cid:96)(w(cid:48) t; ̄z+ it t; z+ it , ̄z+ jt , z+ jt , ̄z− kt , z− kt )(cid:107) )(cid:107) Similarly, for it, jt ∈ [n+], it (cid:54)= jt and kt = n−, there holds (cid:107)wt+1 − w(cid:48) , z− t+1(cid:107) = (cid:107)wt − ηt∇(cid:96)(wt; z+ it kt t(cid:107) + (cid:107)ηt∇(cid:96)(wt; z+ it t(cid:107) + 2ηtL. ≤ (cid:107)wt − w(cid:48) ≤ (cid:107)wt − w(cid:48) , z+ jt As a combination of the above four cases, we derive that (cid:107)wt+1 − w(cid:48) ≤(cid:107)wt − w(cid:48) t+1(cid:107) (cid:104) t(cid:107) + 2ηtLI (it = n+ or jt = n+, it (cid:54)= jt, kt ∈ [n−], z+ n+ ) − w(cid:48) , ̄z− , z+ jt kt t + ηt∇(cid:96)(w(cid:48) , z+ t; z+ jt it , z+ t; z+ ) − ηt∇(cid:96)(w(cid:48) jt it , ̄z− )(cid:107) kt , z− kt )(cid:107) (cid:54)= ̄z+ n+ ) or (it, jt ∈ [n+], it (cid:54)= jt, kt = n−, z− n− (cid:54)= ̄z− n− (cid:105) ) ≤2L t (cid:88) l=1 ηlI (cid:104) (il = n+ or jl = n+, il (cid:54)= jl, kl ∈ [n−], z+ n+ (cid:54)= ̄z+ n+ ) or (il, jl ∈ [n+], il (cid:54)= jl, kl = n−, z− n− (cid:54)= ̄z− n− (cid:105) ) . Finally, according to the L-Lipschitz of the loss function (cid:96)(w; z+, ̃z+, z−), we deduce that |(cid:96)(wt+1; z+, ̃z+, z−) − (cid:96)(w(cid:48) t+1; z+, ̃z+, z−)| ≤ sup z+ , ̃z+ ∈Z+ , z−∈Z− |(cid:96)(wt+1; z+, ̃z+, z−) − (cid:96)(w(cid:48) t+1; z+, ̃z+, z−)| ≤ L(cid:107)wt+1 − w(cid:48) t+1(cid:107) ≤2L2 t (cid:88) l=1 ηlI (cid:104) (il = n+ or jl = n+, il (cid:54)= jl, kl ∈ [n−], z+ n+ (cid:54)= ̄z+ n+ ) or (il, jl ∈ [n+], il (cid:54)= jl, kl = n−, z− n− (cid:54)= ̄z− n− (cid:105) ) . (cid:3) This completes the desired result. Lemma 2 implies that the difference between two model sequences will not increase with the number of iteration under proper conditions. Usually, a sufficiently small iteration step size also plays an important role on further limiting its change and guaranteeing the stability. The Chernoff's bound described as below is used in our proof. Lemma 10. (Boucheron, Lugosi, and Massart 2013) Let X = T (cid:80) t=1 Xt and μ = EX, where X1, ..., XT be independent Bernoulli random variables. Then, for any δ ∈ (0, 1), X ≤ (1 + (cid:112)3log(1/δ)/μ)μ with probability at least 1 − δ. Proof of Theorem 2: Lemma 2 assures that SGD with t-iterations is γ-uniformly stable with γ ≤ 2L2 (cid:104) ηlI t (cid:88) l=1 (il = n+ or jl = n+, il (cid:54)= jl, kl ∈ [n−], z+ n+ (cid:54)= ̄z+ n+ ) or (il, jl ∈ [n+], il (cid:54)= jl, kl = n−, z− n− (cid:54)= ̄z− n− (cid:105) ) . Let A(S) = wT . From Theorem 1, we know the following inequality holds with probability 1 − δ |RS(wT ) − R(wT )| ≤ 6γ + e 8M ( (cid:32) 1 √ n− + √ 2 n+ − 1 )(cid:112)log(e/δ) + 24 √ (cid:16) 2γ (cid:100)log2 (cid:0)n−(n+ − 1)2(cid:1)(cid:101) + 2 (cid:17) (cid:33) . log(e/δ) Thus, |RS(wT ) − R(wT )| = O (cid:32) (cid:16) (cid:100)log(cid:0)n−(n+ − 1)2(cid:1)(cid:101) + 2 (cid:17) log(1/δ) (cid:104) ηI T (cid:88) t=1 (it = n+ or jt = n+, it (cid:54)= jt, kt ∈ [n−], z+ n+ (cid:54)= ̄z+ n+ ) or (it, jt ∈ [n+], it (cid:54)= jt, kt = n−, z− n− (cid:54)= ̄z− n− (cid:105) ) + (cid:16) 1 √ n− + √ 2 n+ − 1 (cid:33) (cid:17)(cid:112)log(1/δ) , where η = ηt ≡ c/ √ T , c ≤ 2/α. Let Xt = I (cid:104) (it = n+ or jt = n+, it (cid:54)= jt, kt ∈ [n−], z+ n+ (cid:54)= ̄z+ n+ ) or (it, jt ∈ [n+], it (cid:54)= jt, kt = n−, z− n− (cid:54)= ̄z− n− (cid:105) ) (8) and μ = T (cid:80) t=1 EXt. It is easy to verify that EXt = Prob (cid:104) (cid:110) I (it = n+ or jt = n+, it (cid:54)= jt, kt ∈ [n−], z+ n+ (cid:110) ≤ Prob it = n+ or jt = n+, it (cid:54)= jt, kt ∈ [n−], z+ n+ (cid:54)= ̄z+ n+ + Prob (cid:54)= ̄z+ n+ (cid:111) ) or (it, jt ∈ [n+], it (cid:54)= jt, kt = n−, z− n− (cid:54)= ̄z− n− ) (cid:105)(cid:111) (cid:110) it, jt ∈ [n+], it (cid:54)= jt, kt = n−, z− n− (cid:111) (cid:54)= ̄z− n− = 1 n+ + 1 2n− . Meanwhile, and that is, It follows that Applying Lemma 10 with EXt ≥ Prob it = n+ or jt = n+, it (cid:54)= jt, kt ∈ [n−], z+ n+ (cid:110) (cid:111) (cid:54)= ̄z+ n+ EXt ≥ Prob it, jt ∈ [n+], it (cid:54)= jt, kt = n−, z− n− (cid:110) (cid:54)= ̄z− n− (cid:111) , EXt ≥ max (cid:110) 1 n+ , 1 2n− (cid:111) . max (cid:110) T n+ (cid:111) , T 2n− ≤ μ = T (cid:88) t=1 EXt ≤ T n+ + T 2n− . (cid:104) Xt = I we have (it = n+ or jt = n+, it (cid:54)= jt, kt ∈ [n−], z+ n+ (cid:54)= ̄z+ n+ ) or (it, jt ∈ [n+], it (cid:54)= jt, kt = n−, z− n− (cid:54)= ̄z− n− X = T (cid:88) t=1 (cid:32) Xt ≤ 1 + (cid:114) 3 μ (cid:33) (cid:32) (cid:115) log(1/δ) μ ≤ 1 + 3log(1/δ) , T 2n− max{ T n+ } (cid:33) (cid:16) T n+ + (cid:17) T 2n− (cid:105) ) , (9) with probability 1 − δ. Combining (8) and (9), with probability 1 − δ, we have |RS(wT ) − R(wT )| (cid:32) (cid:16) =O (cid:100)log(cid:0)n−(n+ − 1)2(cid:1)(cid:101) + 2 (cid:17) log(1/δ) T (cid:88) t=1 ηI (cid:104) (it = n+ or jt = n+, it (cid:54)= jt, kt ∈ [n−], z+ n+ (cid:54)= ̄z+ n+ ) or (it, jt ∈ [n+], it (cid:54)= jt, kt = n−, z− n− (cid:54)= ̄z− n− (cid:105) ) + (cid:16) 1 √ n− + √ 2 n+ − 1 (cid:33) (cid:17)(cid:112)log(1/δ) (cid:32) (cid:16) (cid:32) (cid:16) =O ≤O (cid:100)log(cid:0)n−(n+ − 1)2(cid:1)(cid:101) + 2 (cid:100)log(cid:0)n−(n+ − 1)2(cid:1)(cid:101) + 2 (cid:17) (cid:17) log(1/δ)η T (cid:88) t=1 Xt + (cid:16) 1 √ n− + √ 2 n+ − 1 (cid:33) (cid:17)(cid:112)log(1/δ) log(1/δ)η (cid:115) (cid:16) 1 + 3log(1/δ) , T 2n− max{ T n+ (cid:17)(cid:16) T n+ } + (cid:17) T 2n− + (cid:16) 1 √ n− + √ 2 n+ − 1 (cid:33) (cid:17)(cid:112)log(1/δ) (cid:32) (cid:16) =O (cid:100)log(cid:0)n−(n+ − 1)2(cid:1)(cid:101) + 2 (cid:17) log(1/δ) (cid:16) 1 + + (cid:16) 1 √ n− + √ 1 n+ − 1 (cid:33) (cid:17)(cid:112)log(1/δ) . (cid:115) log(1/δ) , T n− max{ T n+ } (cid:17)(cid:16) √ T n+ (cid:17) √ T n− + This proves the desired statement. (cid:3) Proof of Lemma 3: Because the triplet learning involves two different sample spaces, some related works (Lei, Ledent, and Kloft 2020; Pitcan 2017) can not be used here directly. Fortunately, by detailed decomposition, we have (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ ≤ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ 1 n+(n+ − 1)n− 2 n+(n+ − 1)n− (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n− ] (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n− ] (cid:96)(w∗; z+ i , z+ j , z− k ) − Ez+, ̃z+,z− (cid:96)(w∗; z+, ̃z+, z−) (cid:96)(w∗; z+ i , z+ j , z− (cid:12) (cid:12) k ) − 2Ez+, ̃z+,z−(cid:96)(w∗; z+, ̃z+, z−) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 n+(n+ − 1)n− (cid:88) (cid:88) k∈[n−] i,j∈[n+],i(cid:54)=j (cid:96)(w∗; z+ i , z+ j , z− k ) − Ez−Ez+, ̃z+(cid:96)(w∗; z+, ̃z+, z−) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) + (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 n+(n+ − 1)n− (cid:88) (cid:88) i,j∈[n+],i(cid:54)=j k∈[n−] (cid:96)(w∗; z+ i , z+ j , z− (cid:12) (cid:12) k ) − Ez+, ̃z+Ez− (cid:96)(w∗; z+, ̃z+, z−) (cid:12) (cid:12) (cid:12) (cid:32) 1 n+(n+ − 1) (cid:88) i,j∈[n+],i(cid:54)=j (cid:96)(w∗; z+ i , z+ j ) − Ez+, ̃z+(cid:96)(w∗; z+, ̃z+) (cid:33)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) sup k∈[n−] (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) + sup i,j∈[n+],i(cid:54)=j (cid:32) 1 n− (cid:88) k∈[n−] (cid:96)(w∗; z− k ) − Ez− (cid:96)(w∗; z−) (cid:33)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:115) ≤ 2blog(1/δ) 3(cid:98)n+/2(cid:99) + 2τ log(1/δ) (cid:98)n+/2(cid:99) + 2blog(1/δ) 3(cid:98)n−(cid:99) + (cid:115) 2τ log(1/δ) (cid:98)n−(cid:99) , where the second inequality follows from triangular inequality and and the last inequality is derived by combining Lemma B.3 (Lei, Ledent, and Kloft 2020) and Theorem 2.4 (Pitcan 2017). This completes the proof. B.3 Proof of Theorem 3 and Supplement to Remark 5 Proof of Lemma 4: Let Sm = {z+ 1 , ..., z+ m−1, ̄z+ m, z+ m+1, ..., z+ n+, z− 1 , ..., z− n− } or {z+ 1 , ..., z+ n+, z− 1 , ..., z− m−1, ̄z− m, z− m+1, ..., z− n− }. (cid:3) Due to the generality of m, we can firstly assume Sm = Sn+ = {z+ of FSn+ (w), we know 1 , ..., z+ n+−1, ̄z+ n+ , z− 1 , ..., z− n− }. Since A(Sn+) is a minimizer FS(A(Sn+)) − FS(A(S)) = FS(A(Sn+)) − FSn+ ≤ FS(A(Sn+)) − FSn+ , we further get By the definitions of FS and FSn+ (A(Sn+)) + FSn+ (A(Sn+)) + FSn+ (A(Sn+)) − FSn+ (A(S)) − FS(A(S)). (A(S)) + FSn+ (A(S)) − FS(A(S)) n+(n+ − 1)n− (cid:16) FS(A(Sn+)) − FSn+ (cid:17) (A(Sn+)) (cid:32) (cid:88) (cid:88) = i,j∈[n+ ],i(cid:54)=j, k∈[n− ] (cid:88) + f (A(Sn+); z+ i , z+ j , z− k ) − i,j∈[n+−1],i(cid:54)=j, k∈[n− ] (cid:33) f (A(Sn+); ̄z+ n+ , z+ j , z− k ) f (A(Sn+); z+ i , z+ j , z− k ) + f (A(Sn+); z+ i , ̄z+ n+ , z− k ) (cid:88) i∈[n+−1], k∈[n− ] j∈[n+−1], k∈[n− ] (cid:16) (cid:88) f (A(Sn+); z+ i , z+ n+ = , z− k ) + f (A(Sn+); z+ n+ , z+ i , z− k ) − f (A(Sn+); z+ i , ̄z+ n+ , z− k ) − f (A(Sn+ ); ̄z+ n+ , z+ (cid:17) i , z− k ) , i∈[n+−1], k∈[n− ] where Similarly, f (w; z+, ̃z+, z−) = (cid:96)(w; z+, ̃z+, z−) + r(w). n+(n+ − 1)n− (cid:16) FSn+ (A(S)) − FS(A(S)) (cid:17) (cid:88) (cid:16) = i∈[n+−1], k∈[n− ] f (A(S); z+ i , ̄z+ n+ , z− k ) + f (A(S); ̄z+ n+ , z+ i , z− k ) − f (A(S); z+ i , z+ n+ , z− k ) − f (A(S); z+ n+ , z+ i , z− k ) (cid:17) . Based on the above quantitative relations, we get FS(A(Sn+)) − FS(A(S)) ≤ 1 n+(n+ − 1)n− (cid:88) (cid:16)(cid:0)(cid:96)(A(Sn+); z+ i , z+ n+ i∈[n+−1], k∈[n− ] , z− k ) − (cid:96)(A(S); z+ i , z+ n+ , z− k )(cid:1) + (cid:0)(cid:96)(A(Sn+); z+ n+ + (cid:0)(cid:96)(A(S); z+ i , ̄z+ n+ + (cid:0)(cid:96)(A(S); ̄z+ i , z− , z+ n+ i , z− , z+ , z+ k ) − (cid:96)(A(S); z+ n+ k ) − (cid:96)(A(Sn+); z+ , z− i , ̄z+ n+ i , z− , z+ k ) − (cid:96)(A(Sn+); ̄z+ n+ k )(cid:1) i , z− k )(cid:1) , z− k )(cid:1)(cid:17) . With the same analysis as above, we also can obtain that FS(A(Sn− )) − FS(A(S)) ≤ 1 n+(n+ − 1)n− (cid:88) i,j∈[n+],i(cid:54)=j (cid:16)(cid:0)(cid:96)(A(Sn− ); z+ i , z+ j , z− n− ) − (cid:96)(A(S); z+ i , z+ j , z− n− )(cid:1) when Sm = Sn− = {z+ 1 , ..., z+ n+ Moreover, for A(S) = arg min w∈W , z− 1 , ..., z− FS(w), n−−1, ̄z− n− + (cid:0)(cid:96)(A(S); z+ i , z+ j , ̄z− n− ) − (cid:96)(A(Sn− ); z+ i , z+ j , ̄z− n− )(cid:1)(cid:17) }. FS(A(Sm)) − FS(A(S)) ≤ 1 n+(n+ − 1)n− (cid:88) i∈[n+ ],i(cid:54)=m, k∈[n− ] (cid:16)(cid:0)(cid:96)(A(Sm); z+ i , z+ m, z− k ) − (cid:96)(A(S); z+ i , z+ m, z− k )(cid:1) m, z+ + (cid:0)(cid:96)(A(Sm); z+ + (cid:0)(cid:96)(A(S); z+ + (cid:0)(cid:96)(A(S); ̄z+ i , ̄z+ m, z+ i , z− m, z− i , z− k ) − (cid:96)(A(S); z+ k ) − (cid:96)(A(Sm); z+ k ) − (cid:96)(A(Sm); ̄z+ m, z+ i , ̄z+ m, z+ i , z− m, z− i , z− k )(cid:1) k )(cid:1) k )(cid:1)(cid:17) as Sm = {z+ 1 , ..., z+ m−1, ̄z+ m, z+ m+1, ..., z+ n+ FS(A(Sm)) − FS(A(S)) ≤ , z− 1 , ..., z− n− 1 n+(n+ − 1)n− } and (cid:88) (cid:16)(cid:0)(cid:96)(A(Sm); z+ i , z+ j , z− m) − (cid:96)(A(S); z+ i , z+ j , z− m)(cid:1) i,j∈[n+],i(cid:54)=j + (cid:0)(cid:96)(A(S); z+ i , z+ j , ̄z− m) − (cid:96)(A(Sm); z+ i , z+ j , ̄z− m)(cid:1)(cid:17) as Sm = {z+ 1 , ..., z+ n+ , z− 1 , ..., z− m−1, ̄z− m, z− m+1, ..., z− n− }. Following the similar proof steps of Lemma B.2 (Lei, Ledent, and Kloft 2020), we can get the desired result with the help of (cid:3) the σ-strong convexity of FS(w) and the L-Lipschitz continuity of (cid:96)(w). Proof of Lemma 5: Lemma 4 tells us that A is γ-uniformly stable with γ = min Ledent, and Kloft (2020), there holds (cid:110) 8 n+ , 4 n− (cid:111) L2 σ . Similar with Lemma 2 in Lei, ES(cid:107)A(S) − w∗(cid:107)2 ≤ 12γ/σ = min (cid:110) 96 n+ , 48 n− (cid:111) L2 σ2 . Based on the Cauchy-Schwartz inequality, we further have ES(cid:107)A(S) − w∗(cid:107) ≤ (cid:112)ES(cid:107)A(S) − w∗(cid:107)2 ≤ min It is easy to verify that sup z+ , ̃z+ ∈Z+ , z−∈Z− |(cid:96)(A(S); z+, ̃z+, z−) − (cid:96)(A( ̄S); z+, ̃z+, z−)| (cid:110) 4 √ √ 6 n+ √ 4 √ 3 n− , (cid:111) L σ . (10) = sup |(cid:96)(A(S); z+, ̃z+, z−) − (cid:96)(w∗; z+, ̃z+, z−) − (cid:96)(A( ̄S); z+, ̃z+, z−) + (cid:96)(w∗; z+, ̃z+, z−)| z+ , ̃z+ ∈Z+ , z−∈Z− (cid:110) 8 n+ , ≤min 4 n− (cid:111) L2 σ . Let ̃(cid:96)(w; z+, ̃z+, z−) = (cid:96)(w; z+, ̃z+, z−) − (cid:96)(w∗; z+, ̃z+, z−), ∀z+, ̃z+ ∈ Z+, z− ∈ Z−, w ∈ W. Then, the algorithm A measured by the loss function ̃(cid:96) is also min (cid:110) 8 n+ , 4 n− (cid:111) L2 σ -uniformly stable. Besides, |ES ̃(cid:96)(A(S); z+, ̃z+, z−)| = |ES[(cid:96)(A(S); z+, ̃z+, z−) − (cid:96)(w∗; z+, ̃z+, z−)]| ≤ ES|(cid:96)(A(S); z+, ̃z+, z−) − (cid:96)(w∗; z+, ̃z+, z−)| ≤ LES(cid:107)A(S) − w∗(cid:107) √ 3 n− (cid:111) L2 σ √ 4 √ 6 n+ (cid:110) 4 √ ≤ min , , where the last two inequalities are built from the L-Lipschitz continuity and (10), respectively. Proof of Theorem 3: Recall that A measured by the loss function ̃(cid:96) is min (cid:110) 8 n+ , 4 n− (cid:111) L2 σ -uniformly stable and (cid:3) |ES ̃(cid:96)(A(S); z+, ̃z+, z−)| ≤ M = min (cid:110) 4 √ 6√ n+ √ , 4 3√ n− (cid:111) L2 σ . According to Theorem 1, we have with probability 1 − δ |RS(A(S)) − R(A(S))| (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 n+(n+ − 1)n− (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n− ] ≤ (cid:96)(w∗; z+ i , z+ j , z− k ) − Ez+, ̃z+,z− (cid:96)(w∗; z+, ̃z+, z−) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) + (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 n+(n+ − 1)n− (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n− ] ̃(cid:96)(A(S); z+ i , z+ j , z− (cid:12) (cid:12) k ) − Ez+, ̃z+,z− ̃(cid:96)(A(S); z+, ̃z+, z−) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ 1 n+(n+ − 1)n− i,j∈[n+ ],i(cid:54)=j, k∈[n− ] (cid:88) (cid:96)(w∗; z+ i , z+ j , z− k ) − Ez+, ̃z+,z− (cid:96)(w∗; z+, ̃z+, z−) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) + min (cid:110) 48 n+ , 24 n− (cid:111) L2 σ + eL2 σ (cid:32) (cid:110) 32 √ min √ 6 n+ 32 √ , √ 3 n− (cid:111)(cid:16) 1 √ n− + √ 2 n+ − 1 (cid:17)(cid:112)log(e/δ) + min √ (cid:110) 192 n+ 2 , 2 √ 96 n− (cid:111)(cid:16) (cid:100)log2 (cid:0)n−(n+ − 1)2(cid:1)(cid:101) + 2 (cid:17) (cid:33) . log(e/δ) Lemma 3 assures that, with probability at least 1 − δ, (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 n+(n+ − 1)n− (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n−] (cid:96)(w∗; Z + i , Z + j , Z − (cid:12) (cid:12) k ) − Ez+, ̃z+,z− (cid:96)(w∗; z+, ̃z+, z−) (cid:12) (cid:12) (cid:12) (cid:115) ≤ 2blog(1/δ) 3(cid:98)n+/2(cid:99) + 2τ log(1/δ) (cid:98)n+/2(cid:99) + 2blog(1/δ) 3(cid:98)n−(cid:99) + (cid:115) 2τ log(1/δ) (cid:98)n−(cid:99) . Then, |RS(A(S)) − R(A(S))| ≤ 2blog(1/δ) 3(cid:98)n+/2(cid:99) (cid:32) (cid:115) + 2τ log(1/δ) (cid:98)n+/2(cid:99) √ √ (cid:115) + 2blog(1/δ) 3(cid:98)n−(cid:99) + (cid:110) 32 √ min , 32 √ 3 n− (cid:111)(cid:16) 1 √ n− + √ + eL2 σ (cid:32)(cid:115) 6 n+ (cid:115) 2 n+ − 1 √ (cid:110) 48 n+ + min 2τ log(1/δ) (cid:98)n−(cid:99) (cid:17)(cid:112)log(e/δ) + min , 24 n− √ (cid:110) 192 n+ (cid:111) L2 σ 2 , 2 √ 96 n− (cid:111)(cid:16) (cid:100)log2 (cid:0)n−(n+ − 1)2(cid:1)(cid:101) + 2 (cid:17) (cid:33) log(e/δ) =O log(1/δ) n+ + log(1/δ) n− + σ−1(cid:16) (cid:110) min √ 2 n+ , 1 √ n− (cid:111)(cid:16) 1 √ n− + 1 √ n+ (cid:17)(cid:112)log(1/δ) + min (cid:110) 2 n+ , 1 n− (cid:111) log(cid:0)n−n2 + (cid:17) (cid:1)log(1/δ) (cid:33) . (cid:3) Supplement to Remark 5: When letting r(w∗) = λ(cid:107)w∗(cid:107)2 = O(σ(cid:107)w∗(cid:107)2), we can verify the strong convexity of FS as follows. Due to the convexity of (cid:96), we know that RS(w) ≥ RS(w(cid:48)) + (cid:104)∇RS(w(cid:48)), w − w(cid:48)(cid:105). Besides, λ(cid:107)w(cid:107)2 = λ(cid:107)w(cid:107)2 + 2λ(cid:107)w(cid:48)(cid:107)2 − 2λ(cid:107)w(cid:48)(cid:107)2 + 2λ(cid:104)w, w(cid:48)(cid:105) − 2λ(cid:104)w, w(cid:48)(cid:105) = λ(cid:107)w(cid:48)(cid:107)2 + (cid:104)2λ(cid:107)w(cid:48)(cid:107), w − w(cid:48)(cid:105) + λ((cid:107)w(cid:107)2 + (cid:107)w(cid:48)(cid:107)2 − 2(cid:104)w, w(cid:48)(cid:105)) = λ(cid:107)w(cid:48)(cid:107)2 + (cid:104)2λ(cid:107)w(cid:48)(cid:107), w − w(cid:48)(cid:105) + λ(cid:107)w − w(cid:48)(cid:107)2. Combining the above inequality and identity, we derive that RS(w) + λ(cid:107)w(cid:107)2 ≥ RS(w(cid:48)) + λ(cid:107)w(cid:48)(cid:107)2 + (cid:104)∇RS(w(cid:48)) + ∇λ(cid:107)w(cid:48)(cid:107)2, w − w(cid:48)(cid:105) + λ(cid:107)w − w(cid:48)(cid:107)2, that is, FS(w) ≥ FS(w(cid:48)) + (cid:104)∇FS(w(cid:48)), w − w(cid:48)(cid:105) + λ(cid:107)w − w(cid:48)(cid:107)2. Thus, FS is 2λ-strongly convex, i.e. σ = 2λ. (11) (cid:3) B.4 Proof of Theorem 4 and Supplement to Remark 6 Proof of Lemma 6: As illustrated in Srebro, Sridharan, and Tewari (2010), the α-smooth and non-negative function (cid:96) satisfies (cid:107)(cid:96)(cid:48)(w)(cid:107)2 ≤ 2α(cid:96)(w). (12) In addition, from the convexity and α-smoothness of (cid:96), we can also derive that (cid:96)(w) ≤ (cid:96)(w(cid:48)) + (cid:104)∇(cid:96)(w(cid:48)), w − w(cid:48)(cid:105) + α(cid:107)w − w(cid:48)(cid:107)2 2 , ∀w, w(cid:48) ∈ W, (13) (cid:96)(A(Si,j,k); z+ ≤(cid:104)∇(cid:96)(A(S); z+ i , z+ i , z+ where ∇(cid:96) denotes subgradient of (cid:96). Based on (12), (13) and the Cauchy-Schwartz inequality, we deduce that j , z− k ) − (cid:96)(A(S); z+ k ) α k ), A(Si,j,k) − A(S)(cid:105) + 2 k )(cid:107)(cid:107)A(Si,j,k) − A(S)(cid:107) + (cid:15) 2 (cid:107)A(Si,j,k) − A(S)(cid:107)2. (cid:107)A(Si,j,k) − A(S)(cid:107)2 α 2 (cid:107)A(Si,j,k) − A(S)(cid:107)2 + (cid:107)A(Si,j,k) − A(S)(cid:107)2 (cid:107)A(Si,j,k) − A(S)(cid:107)2 j , z− j , z− ≤(cid:107)∇(cid:96)(A(S); z+ (cid:107)∇(cid:96)(A(S); z+ (cid:96)(A(S); z+ j , z− j , z− i , z+ i , z+ i , z+ α 2 ≤ ≤ i , z+ j , z− k ) + k )(cid:107)2 + (cid:15) + α 2 1 2(cid:15) α (cid:15) Moreover, according to the definition of triplet on-average stability in Definition 2 and the symmetry of A(Si,j,k) w.r.t. i , z+ z+ k , we have j , z− ES[R(A(S)) − RS(A(S))] = 1 n+(n+ − 1)n− = 1 n+(n+ − 1)n− ≤ 1 n+(n+ − 1)n− (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n−] (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n−] (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n−] E S, ̄S[R(A(Si,j,k)) − RS(A(S))] E S, ̄S[(cid:96)(A(Si,j,k); z+ i , z+ j , z− k ) − (cid:96)(A(S); z+ i , z+ j , z− k )] E S, ̄S (cid:104) α (cid:15) (cid:96)(A(S); z+ i , z+ j , z− k ) + (cid:15) + α 2 (cid:107)A(Si,j,k) − A(S)(cid:107)2(cid:105) = = ≤ α (cid:15) α (cid:15) α (cid:15) ESRS(A(S)) + (cid:15) + α 2n+(n+ − 1)n− ESRS(A(S)) + (cid:15) + α 2n+(n+ − 1)n− ESRS(A(S)) + (cid:15) + α 2n+(n+ − 1)n− + 3E S, ̄S(cid:107)A(Si) − A(S)(cid:107)2(cid:17) = α (cid:15) ESRS(A(S)) + 3((cid:15) + α) 2n+(n+ − 1)n− The desired result is proved. (cid:88) i,j∈[n+ ],i(cid:54)=j, k∈[n−] (cid:88) E S, ̄S(cid:107)A(Si,j,k) − A(S)(cid:107)2 E S, ̄S(cid:107)A(Si,j,k) − A(Si,j) + A(Si,j) − A(Si) + A(Si) − A(S)(cid:107)2 i,j∈[n+ ],i(cid:54)=j, k∈[n−] (cid:88) (cid:16) i,j∈[n+ ],i(cid:54)=j, k∈[n−] 3E S, ̄S(cid:107)A(Si,j,k) − A(Si,j)(cid:107)2 + 3E S, ̄S(cid:107)A(Si,j) − A(Si)(cid:107)2 S, ̄S(cid:107)A(Sk) − A(S)(cid:107)2 + 2E E S, ̄S(cid:107)A(Si) − A(S)(cid:107)2(cid:17) . (cid:88) (cid:16) i∈[n+ ], k∈[n−] Proof of Theorem 4: Similar with the proof of Lemma 4, when Sm = {z+ 1 , ..., z+ m−1, ̄z+ m, z+ m+1, ..., z+ n+ (cid:3) , z− 1 , ..., z− n− }, we have n+(n+ − 1)n− (cid:16) FS(A(Sm)) − FS(A(S)) (cid:17) (cid:16)(cid:0)(cid:96)(A(Sm); z+ i , z+ m, z− k ) − (cid:96)(A(S); z+ i , z+ m, z− k )(cid:1) + (cid:0)(cid:96)(A(Sm); z+ m, z+ i , z− k ) − (cid:96)(A(S); z+ m, z+ i , z− k )(cid:1) (cid:88) ≤ i∈[n+ ],i(cid:54)=m, k∈[n− ] + (cid:0)(cid:96)(A(S); z+ k ) − (cid:96)(A(Sm); z+ i , ̄z+ m, z− i , ̄z+ m, z− (cid:16)(cid:10)∇(cid:96)(A(S); z+ k )(cid:1) + (cid:0)(cid:96)(A(S); ̄z+ i , z− m, z+ i , z+ m, z− k ) + ∇(cid:96)(A(S); z+ k ) − ∇(cid:96)(A(Sm); z+ i , ̄z+ m, z− k ) − ∇(cid:96)(A(Sm); ̄z+ m, z+ i , z− k ), m, z+ i , z− k ) − (cid:96)(A(Sm); ̄z+ m, z+ i , z− k )(cid:1)(cid:17) (cid:88) ≤ i∈[n+ ],i(cid:54)=m, k∈[n− ] A(Sm) − A(S)(cid:11) + 2α(cid:107)A(Sm) − A(S)(cid:107)2(cid:17) (cid:88) (cid:16) ≤ i∈[n+],i(cid:54)=m, k∈[n− ] (cid:107)∇(cid:96)(A(S); z+ i , z+ m, z− k )(cid:107) + (cid:107)∇(cid:96)(A(S); z+ m, z+ i , z− k )(cid:107) + (cid:107)∇(cid:96)(A(Sm); z+ i , ̄z+ m, z− k )(cid:107) + (cid:107)∇(cid:96)(A(Sm); ̄z+ m, z+ i , z− k )(cid:107) (cid:17) (cid:107)A(Sm) − A(S)(cid:107) + 2α(n+ − 1)n−(cid:107)A(Sm) − A(S)(cid:107)2, where the second inequality is due to (13). Moreover, considering the definition of A(S) and the σ-strong convexity of F , we can derive σn+(n+ − 1)n− 2 (cid:16) (cid:107)A(Sm) − A(S)(cid:107)2 ≤n+(n+ − 1)n− FS(A(Sm)) − FS(A(S)) (cid:17) ≤ ≤ ≤ ≤ (cid:107)∇(cid:96)(A(S); z+ i , z+ m, z− k )(cid:107) + (cid:107)∇(cid:96)(A(S); z+ m, z+ i , z− k )(cid:107) + (cid:107)∇(cid:96)(A(Sm); z+ i , ̄z+ m, z− k )(cid:107) + (cid:107)∇(cid:96)(A(Sm); ̄z+ m, z+ i , z− k )(cid:107) (cid:17) (cid:88) (cid:16) i∈[n+ ],i(cid:54)=m, k∈[n− ] (cid:107)A(Sm) − A(S)(cid:107) + 2α(n+ − 1)n−(cid:107)A(Sm) − A(S)(cid:107)2 √ (cid:113) (cid:16)(cid:113) (cid:88) (cid:96)(A(S); z+ i , z+ m, z− k ) + (cid:96)(A(S); z+ m, z+ i , z− k ) + 2α i∈[n+ ],i(cid:54)=m, k∈[n−] (cid:107)A(Sm) − A(S)(cid:107) + 2α(n+ − 1)n−(cid:107)A(Sm) − A(S)(cid:107)2. Then, as 8α ≤ σmin{n+, n−} ≤ σn+, it follows that σn+(n+ − 1)n− 2 (cid:88) √ 2α (cid:107)A(Sm) − A(S)(cid:107) (cid:16)(cid:113) (cid:96)(A(S); z+ i , z+ m, z− k ) + (cid:113) (cid:96)(A(S); z+ m, z+ i , z− k ) + i∈[n+ ],i(cid:54)=m, k∈[n−] + 2α(n+ − 1)n−(cid:107)A(Sm) − A(S)(cid:107) √ (cid:16)(cid:113) (cid:88) 2α (cid:96)(A(S); z+ i , z+ m, z− k ) + (cid:113) (cid:96)(A(S); z+ m, z+ i , z− k ) + i∈[n+ ],i(cid:54)=m, k∈[n−] σn+(n+ − 1)n− 4 + That is to say (cid:107)A(Sm) − A(S)(cid:107). σn+(n+ − 1)n− 4 (cid:88) √ ≤ 2α (cid:107)A(Sm) − A(S)(cid:107) (cid:16)(cid:113) (cid:96)(A(S); z+ i , z+ m, z− k ) + (cid:113) (cid:96)(A(S); z+ m, z+ i , z− k ) + i∈[n+ ],i(cid:54)=m, k∈[n−] After squaring the both sides of the above inequality, we derive σ2n2 +(n+ − 1)2n2 − (cid:107)A(Sm) − A(S)(cid:107)2 (cid:16)(cid:113) (cid:96)(A(S); z+ i , z+ m, z− k ) + (cid:113) (cid:96)(A(S); z+ m, z+ i , z− k ) + (cid:113) (cid:113) (cid:113) (cid:113) (cid:96)(A(Sm); z+ i , ̄z+ m, z− k ) + (cid:96)(A(Sm); z+ i , ̄z+ m, z− k ) + (cid:96)(A(Sm); z+ i , ̄z+ m, z− k ) + (cid:96)(A(Sm); z+ i , ̄z+ m, z− k ) + (cid:113) (cid:96)(A(Sm); z+ i , ̄z+ m, z− k ) + (cid:113) (cid:96)(A(Sm); ̄z+ m, z+ (cid:17) i , z− k ) (cid:113) (cid:96)(A(Sm); ̄z+ m, z+ (cid:17) i , z− k ) (cid:113) (cid:96)(A(Sm); ̄z+ m, z+ (cid:17) i , z− k ) (cid:113) (cid:96)(A(Sm); ̄z+ m, z+ (cid:17) i , z− k ) . (cid:113) (cid:96)(A(Sm); ̄z+ m, z+ (cid:17) i , z− k ) (cid:33)2 (cid:88) (cid:16)(cid:113) i∈[n+ ],i(cid:54)=m, k∈[n−] (cid:96)(A(S); z+ i , z+ m, z− k ) + (cid:113) (cid:96)(A(S); z+ m, z+ i , z− k ) + (cid:113) (cid:96)(A(Sm); z+ i , ̄z+ m, z− k ) (cid:113) + (cid:96)(A(Sm); ̄z+ (cid:17)2 m, z+ (cid:88) i , z− k ) (cid:16) ≤8α(n+ − 1)n− (cid:96)(A(S); z+ i , z+ m, z− k ) + (cid:96)(A(S); z+ m, z+ i , z− k ) + (cid:96)(A(Sm); z+ i , ̄z+ m, z− k ) + (cid:96)(A(Sm); ̄z+ m, z+ (cid:17) i , z− k ) , i∈[n+ ],i(cid:54)=m, k∈[n−] where the second and third inequalities hold since (cid:16) n (cid:80) i=1 (cid:17)2 ai ≤ n n (cid:80) i=1 a2 i . 16 (cid:88) (cid:32) ≤2α i∈[n+],i(cid:54)=m, k∈[n− ] ≤2α(n+ − 1)n− For all m ∈ [n+], we sum them together to get n+ (cid:88) (cid:107)A(Sm) − A(S)(cid:107)2 σ2n2 +(n+ − 1)n− m=1 (cid:16) ≤128α (cid:88) i,m∈[n+ ],i(cid:54)=m, k∈[n−] (cid:96)(A(S); z+ i , z+ m, z− k ) + (cid:96)(A(S); z+ m, z+ i , z− k ) + (cid:96)(A(Sm); z+ i , ̄z+ m, z− k ) + (cid:96)(A(Sm); ̄z+ m, z+ (cid:17) i , z− k ) . By taking expectations on both sides of the above inequality, we obtain σ2n2 +(n+ − 1)n− n+ (cid:88) E S, ̄S(cid:107)A(Sm) − A(S)(cid:107)2 ≤128α (cid:88) i,m∈[n+],i(cid:54)=m, k∈[n− ] m=1 E S, ̄S[(cid:96)(A(S); z+ i , z+ m, z− k ) + (cid:96)(A(S); z+ m, z+ i , z− k ) + (cid:96)(A(Sm); z+ i , ̄z+ m, z− k ) + (cid:96)(A(Sm); ̄z+ m, z+ i , z− k )] ≤512αn+(n+ − 1)n−ESRS(A(S)). (14) (15) (cid:3) Similarly, when Sm = {z+ 1 , ..., z+ n+ m−1, ̄z− m, z− m+1, ..., z− n− }, we get , z− 1 , ..., z− n− (cid:88) σ2n− E S, ̄S(cid:107)A(Sm) − A(S)(cid:107)2 ≤ 512 9 αESRS(A(S)). Based on the definitions of A(S) and w∗, there holds m=1 ES[F (A(S)) − FS(w∗)] = ES[F (A(S)) − FS(A(S))] + ES[FS(A(S)) − FS(w∗)] ≤ ES[F (A(S)) − FS(A(S))] = ES[R(A(S)) − RS(A(S))]. Hence, the desired result ESRS(A(S)) + ES[R(A(S)) − RS(A(S))] α (cid:15) (cid:18) α (cid:15) 1536α((cid:15) + α) +(n+ − 1)σ2 + n2 + ≤ = 3((cid:15) + α) 2n+(n+ − 1)n− 256α((cid:15) + α) 3(n+ − 1)n2 −σ2 (cid:18) 1024αn− σ2n+ (cid:19) ESRS(A(S)) + 512αn+ 9σ2n− (cid:19) ESRS(A(S)) ESRS(A(S)), ∀(cid:15) > 0 follows from Lemma 6, (14), and (15). Supplement to Remark 6: Considering (6) and letting r(w∗) = O(σ(cid:107)w∗(cid:107)2), we know ES[R(A(S)) − R(w∗)] ≤ ES[R(A(S)) − RS(A(S)) + RS(w∗) − R(w∗) + r(w∗)] ≤ ES[R(A(S)) − RS(A(S)) + r(w∗)] ≤ ES[R(A(S)) − RS(A(S))] + O(σ(cid:107)w∗(cid:107)2). If n+ (cid:16) n− (cid:16) n and (cid:15) = (cid:114) 3n2 4608n2 +(n+−1)n2 −σ2 −+256n2 + , then ES[R(A(S)) − R(w∗)] ≤ ES[R(A(S)) − RS(A(S))] + O(σ(cid:107)w∗(cid:107)2) = O (cid:18) 1 n 3 2 σ ESRS(A(S)) + σ(cid:107)w∗(cid:107)2 (cid:19) . By applying the non-negativity of r, the definitions of A(S) and w∗, we get ESRS(A(S)) ≤ ES[RS(A(S)) + r(A(S))] ≤ ES[RS(w∗) + r(w∗)] = O(R(w∗) + σ(cid:107)w∗(cid:107)2). Combining the above two inequalities together, we derive ES[R(A(S)) − R(w∗)] = O (cid:18) 1 n 3 2 σ R(w∗) + (cid:0)n− 3 2 + σ(cid:1)(cid:107)w∗(cid:107)2 (cid:19) . To minimize ES[R(A(S))−R(w∗)], σ should be n− 3 the order of n− 3 4 (cid:107)w∗(cid:107)−1(cid:112)R(w∗) is same as 8α/n. Thus, we derive 4 (cid:107)w∗(cid:107)−1(cid:112)R(w∗), however, σ ≥ 8α/n. When R(w∗) = O(n− 1 2 (cid:107)w∗(cid:107)2), ES[R(A(S)) − R(w∗)] = O (cid:18) n− 3 4 (cid:107)w∗(cid:107)(cid:112)R(w∗) + n− 3 2 (cid:107)w∗(cid:107)2 (cid:19) = O(n−1(cid:107)w∗(cid:107)2). (cid:3) B.5 Proofs of Corollaries 1-3 Proof of Corollary 1: To apply Theorem 2, we just need to verify the loss function in triplet metric learning satisfies convex, α-smooth and L-Lipschitz. Convexity. For all w, z+, ̃z+, z−, ∇2(cid:96)φ(w; z+, ̃z+, z−) = (cid:16) (x+ − ̃x+)(x+ − ̃x+)(cid:62) − (x+ − x−)(x+ − x−)(cid:62)(cid:17)2 φ(cid:48)(cid:48)(cid:0)hw(x+, ̃x+) − hw(x+, x−) + ζ(cid:1). (16) It is easy to verify that ∇2(cid:96)φ(w; z+, ̃z+, z−) ≥ 0 since the second derivative φ(cid:48)(cid:48) of logistic function always is non-negative. Lipschitz continuity. For all w, w(cid:48), z+, ̃z+, z−, (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)(cid:96)φ(w; z+, ̃z+, z−) − (cid:96)φ(w(cid:48); z+, ̃z+, z−) (cid:12) (cid:12) (cid:12)log(cid:0)1 + exp(hw(x+, x−) − hw(x+, ̃x+) − ζ)(cid:1) − log(cid:0)1 + exp(hw(cid:48)(x+, x−) − hw(cid:48)(x+, ̃x+) − ζ)(cid:1)(cid:12) (cid:12) (cid:12) (cid:12)hw(x+, x−) − hw(x+, ̃x+) − ζ − hw(cid:48)(x+, x−) + hw(cid:48)(x+, ̃x+) + ζ (cid:12) (cid:10)w − w(cid:48), (x+ − x−)(x+ − x−)(cid:62)(cid:11) − (cid:10)w − w(cid:48), (x+ − ̃x+)(x+ − ̃x+)(cid:62)(cid:11)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:10)w − w(cid:48), (x+ − ̃x+)(x+ − ̃x+)(cid:62)(cid:11)(cid:12) (cid:10)w − w(cid:48), (x+ − x−)(x+ − x−)(cid:62)(cid:11)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) + (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) = ≤ = ≤ (17) ≤8B2(cid:107)w − w(cid:48)(cid:107), where the first inequality is due to the 1-smoothness of the logistic function, and the last two inequalities are obtained with the Cauchy-Schwartz inequality and the boundedness assumption of sample space. Smoothness. With the similar fashion as above, we deduce that ≤ ≤ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)∇(cid:96)φ(w; z+, ̃z+, z−) − ∇(cid:96)φ(w(cid:48); z+, ̃z+, z−) (cid:12) (cid:12) (cid:12)(x+ − ̃x+)(x+ − ̃x+)(cid:62) − (x+ − x−)(x+ − x−)(cid:62)(cid:12) (cid:12) (cid:12)φ(cid:48)(cid:0)hw(x+, ̃x+) − hw(x+, x−) + ζ(cid:1) − φ(cid:48)(cid:0)hw(cid:48)(x+, ̃x+) − hw(cid:48)(x+, x−) + ζ(cid:1)(cid:12) (cid:12) (cid:12) (cid:12)2 (cid:12) (cid:12) (cid:12)2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) * (cid:12) (cid:12) (cid:32) (cid:12)(x+ − ̃x+)(x+ − ̃x+)(cid:62)(cid:12) (cid:12) (cid:12) (cid:12) − φ(cid:48)(cid:0)hw(cid:48)(x+, ̃x+) − hw(cid:48)(x+, x−) + ζ(cid:1)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) + (cid:12) (cid:12) (cid:12)(x+ − x−)(x+ − x−)(cid:62)(cid:12) (cid:12) (cid:12) (cid:33) (cid:12) (cid:12)φ(cid:48)(cid:0)hw(x+, ̃x+) − hw(x+, x−) + ζ(cid:1) (cid:12) (cid:12) (cid:12) (cid:12)2 =8B2(cid:12) (cid:12)φ(cid:48)(cid:0)hw(x+, ̃x+) − hw(x+, x−) + ζ(cid:1) − φ(cid:48)(cid:0)hw(cid:48)(x+, ̃x+) − hw(cid:48)(x+, x−) + ζ(cid:1)(cid:12) (cid:12) ≤8B2(cid:12) (cid:12)hw(x+, x−) − hw(x+, ̃x+) − ζ − hw(cid:48)(x+, x−) + hw(cid:48)(x+, ̃x+) + ζ (cid:12) ≤64B4(cid:107)w − w(cid:48)(cid:107). (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Therefore, the desired result is obtained by Theorem 2, where loss function satisfies the convexity, 8B2-Lipschitz continuity (cid:3) and 64B4-smoothness. Proof of Corollary 2: To apply Theorem 3, we need to prove the σ-strong convexity of FS and L-Lipschitz continuity of (cid:96). They can be verified by (11) and (17). Thus, we get the stated result from Theorem 3. (cid:3) Proof of Corollary 3: From the proofs of Corollaries 1 and 2, we know that the σ-strong convexity of FS and the α-smoothness (cid:3) of (cid:96). Hence, we can directly apply Theorem 4 to get the desired result. C. Review on the Definitions of Algorithmic Stability In machine learning literature, there are various definitions of algorithmic stability for pointwise/pairwise learning, including hypothesis stability (Bousquet and Elisseeff 2002; Elisseeff, Evgeniou, and Pontil 2005), error stability (Bousquet and Elisseeff 2002; Shalev-Shwartz et al. 2010), uniform stability (Agarwal and Niyogi 2009; Hardt, Recht, and Singer 2016; Foster et al. 2019; Feldman and Vondr ́ak 2018, 2019; Bousquet, Klochkov, and Zhivotovskiy 2020; Klochkov and Zhivotovskiy 2021; Sun, Li, and Wang 2021; Shen et al. 2019; Maurer 2017; Gao and Zhou 2013; Jin, Wang, and Zhou 2009; Wang et al. 2019; Chen, Jin, and Yu 2018), uniform augment stability (Liu et al. 2017; Bassily et al. 2020; Xing, Song, and Cheng 2021; Yang et al. 2021; Lei et al. 2021), on-average stability (Lei, Ledent, and Kloft 2020; Lei and Ying 2021; Kuzborskij and Lampert 2018), on-average augment stability (Lei and Ying 2020; Lei, Liu, and Ying 2021) and locally elastic stability (Deng, He, and Su 2021). It is well known the above stability definitions for pointwise/pairwise learning is the building block for triplet algorith- mic stability. Therefore, to better understand our Definitions 1 and 2 for triplet learning, we summarize the previous def- initions of algorithmic stability in Table 4, where their properties are illustrated from the aspects of the measure of per- turbation (Loss (cid:96) Vs. Model A(S)) and the dependence of stability parameter (data dependence Vs. data independence). Here, let S = {z1, ..., zn}, ̄S = { ̄z1, ..., ̄zn} be drawn independently from the same data generating distribution, and let Si = {z1, ..., zi−1, ̄zi, zi+1, ..., zn}. Stability Definitions Hypothesis stability Error stability Uniform stability Uniform augment stability On-average stability On-average augment stability Locally elastic stability E S, ̄S,z[|(cid:96)(A(S), z) − (cid:96)(A(Si), z)|] ≤ γ, ∀i ∈ [n] |Ez[(cid:96)(A(S), z) − (cid:96)(A(Si), z)]| ≤ γ, ∀S, ̄S ∈ Z n, ∀i ∈ [n] (cid:107)(cid:96)(A(S), *) − (cid:96)(A(Si), *)(cid:107)∞ ≤ γ, ∀S, ̄S ∈ Z n, ∀i ∈ [n] (cid:107)A(S) − A(Si)(cid:107)∞ ≤ γ, ∀S, ̄S ∈ Z n, ∀i ∈ [n] 1 n S, ̄S[(cid:96)(A(S), zi) − (cid:96)(A(Si), zi)] ≤ γ, ∀S, ̄S ∈ Z n E S, ̄S[(cid:107)A(S) − A(Si)(cid:107)] ≤ γ, ∀S, ̄S ∈ Z n E 1 n |(cid:96)(A(S), z) − (cid:96)(A(Si), z)| ≤ γ(zi, z), ∀S, ̄S ∈ Z n, ∀i ∈ [n] n (cid:80) i=1 n (cid:80) i=1 Loss Model Data dependence √ √ √ × √ × √ × × × √ × √ × × × × × × × √ Table 4: Summary of definitions and properties of algorithmic stability ( √ -has such a property; ×-hasn't such a property) From Table 4, we know that the uniform stability (uniform augment stability) is stronger than the on-average stability (on- average augment stability). As demonstrated in Deng, He, and Su (2021), the locally elastic stability is a more fine-grained stability than the others due to its data dependence of stability parameter γ. From the other side, the uniform (on-average) augment stability implies the uniform (on-average) stability when the loss function satisfies L-Lipschitz continuous. That is to say, the model-based stability characterization is stronger than the loss- based stability measure usually. In addition, the average augment stability has various versions when employing different norms. Table 4 just shows the definitions in the case of changes of one point. It has been extended to the setting of changes of two points (Lei, Ledent, and Kloft 2020; Lei, Liu, and Ying 2021) and the setting of multitask learning (Wang et al. 2019; Zhang 2015). These developments pave the way to motivate our Definitions 1 and 2. D. Discussion There are still many interesting research topics related to the current work, which we will discuss below: Non-convex loss functions: As shown in Tables 1-2, our stability-based generalization analysis requires the convexity of triplet loss function. However, there also involve various non-convex loss functions in some triplet learning algorithms. Hence, it is important to investigate the generalization and stability for general non-convex triplet losses. In addition, some restrictions on the non-convex loss functions may be necessary, e.g., the Polyak-Łojasiewicz (PL) condition and the quadratic growth (QG) condition (Charles and Papailiopoulos 2018). Distribution Shift: To the best of our knowledge, the existing stability-based generalization bounds are all under the as- sumption that the testing data and the training data are drawn independently from an identity distribution. Motivated by the widespread practical deployment of learning algorithms, there often faces complicated data environment where the unknown test distribution potentially differs from the training distribution, i.e., distribution shift (Wang et al. 2021; Shen et al. 2021; Agarwal and Zhang 2022). For a wide range of models and distribution shifts, Miller et al. (2021) shows the strong empirical correlation between out-of-distribution performance and in-distribution performance. In particular, there is rapid theoretical progress on the generalization guarantees under distribution shift by leveraging the expansion assumption (Ye et al. 2021; Cai et al. 2021), the uniformly convergence analysis (Agarwal and Zhang 2022), and the operator approximation (Gizewski et al. 2022). Therefore, it is natural and crucial to further investigate the stability-based generalization theory (Hardt, Recht, and Singer 2016; Charles and Papailiopoulos 2018; Lei and Ying 2020) for the distribution shift setting.
http://arxiv.org/abs/2302.09814v1
2023-02-20T07:29:34
2023-02-20T07:29:34
Pseudo Label-Guided Model Inversion Attack via Conditional Generative Adversarial Network
Model inversion (MI) attacks have raised increasing concerns about privacy, which can reconstruct training data from public models. Indeed, MI attacks can be formalized as an optimization problem that seeks private data in a certain space. Recent MI attacks leverage a generative adversarial network (GAN) as an image prior to narrow the search space, and can successfully reconstruct even the high-dimensional data (e.g., face images). However, these generative MI attacks do not fully exploit the potential capabilities of the target model, still leading to a vague and coupled search space, i.e., different classes of images are coupled in the search space. Besides, the widely used cross-entropy loss in these attacks suffers from gradient vanishing. To address these problems, we propose Pseudo Label-Guided MI (PLG-MI) attack via conditional GAN (cGAN). At first, a top-n selection strategy is proposed to provide pseudo-labels for public data, and use pseudo-labels to guide the training of the cGAN. In this way, the search space is decoupled for different classes of images. Then a max-margin loss is introduced to improve the search process on the subspace of a target class. Extensive experiments demonstrate that our PLG-MI attack significantly improves the attack success rate and visual quality for various datasets and models, notably, 2~3 $\times$ better than state-of-the-art attacks under large distributional shifts. Our code is available at: https://github.com/LetheSec/PLG-MI-Attack.
[ "Xiaojian Yuan", "Kejiang Chen", "Jie Zhang", "Weiming Zhang", "Nenghai Yu", "Yang Zhang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09814v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09814v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.CR", "cs.LG" ]
Pseudo Label-Guided Model Inversion Attack via Conditional Generative Adversarial Network Xiaojian Yuan1, Kejiang Chen*1, Jie Zhang1,2, Weiming Zhang1, Nenghai Yu1, Yang Zhang3 1University of Science and Technology of China, 2University of Waterloo, 3CISPA Helmholtz Center for Information Security [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] 3 2 0 2 b e F 0 2 ] V C . s c [ 1 v 4 1 8 9 0 . 2 0 3 2 : v i X r a Abstract Model inversion (MI) attacks have raised increasing concerns about privacy, which can reconstruct training data from pub- lic models. Indeed, MI attacks can be formalized as an opti- mization problem that seeks private data in a certain space. Recent MI attacks leverage a generative adversarial network (GAN) as an image prior to narrow the search space, and can successfully reconstruct even the high-dimensional data (e.g., face images). However, these generative MI attacks do not fully exploit the potential capabilities of the target model, still leading to a vague and coupled search space, i.e., dif- ferent classes of images are coupled in the search space. Be- sides, the widely used cross-entropy loss in these attacks suf- fers from gradient vanishing. To address these problems, we propose Pseudo Label-Guided MI (PLG-MI) attack via con- ditional GAN (cGAN). At first, a top-n selection strategy is proposed to provide pseudo-labels for public data, and use pseudo-labels to guide the training of the cGAN. In this way, the search space is decoupled for different classes of images. Then a max-margin loss is introduced to improve the search process on the subspace of a target class. Extensive experi- ments demonstrate that our PLG-MI attack significantly im- proves the attack success rate and visual quality for various datasets and models, notably, 2 ∼ 3× better than state-of- the-art attacks under large distributional shifts. Our code is available at: https://github.com/LetheSec/PLG-MI-Attack. 1 Introduction Deep neural networks (DNNs) have revolutionized a wide variety of tasks, including computer vision, natural language processing, and healthcare. However, many practical appli- cations of DNNs require training on private or sensitive datasets, such as facial recognition (Taigman et al. 2014) and medical diagnosis (Rajpurkar et al. 2017), which may pose some privacy threats. Indeed, the prior study of privacy attacks has demonstrated the possibility of exposing unau- thorized information from access to a model (Shokri et al. 2017; Gopinath et al. 2019; Tram`er et al. 2016; Fredrikson, Jha, and Ristenpart 2015). In this paper, we mainly focus on model inversion (MI) attacks, a type of privacy attack that aims to recover the training data given a trained model. *Corresponding authors. Copyright © 2023, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. Figure 1: Latent search space for different MI attacks. The blue area represents the latent space that needs to be searched to reconstruct a certain class of images. That is, the adversary should find an optimal latent point in the blue area, so that the generator outputs the private image of a specified class. Typically, MI attacks can be formalized as an optimiza- tion problem with the goal of searching the input space for the sensitive feature value that achieves the highest like- lihood under the target model. However, when attacking DNNs trained on more complex data (e.g., RGB images), directly solving the optimization problem via gradient de- scent tends to stuck in local minima, resulting in recon- structed images lacking clear semantic information. Recent work (Zhang et al. 2020) proposed generative MI attacks (GMI), which used a generative adversarial network (GAN) to learn a generic prior of natural images, avoiding recon- structing private data directly from the unconstrained space. Generally, generative MI attacks can be summarized as the following two search stages: • stage-1: Generator Parameter Space Search. The adver- sary trains a generative model (i.e., searches for the op- timal parameters) on a public dataset that only shares structural similarity with the private dataset. • stage-2: Latent Vector Search. The adversary keeps searching the latent space of the generator trained in stage-1, until the output is close to the images in the pri- vate dataset. Notably, GMI totally ignored the potential capability of the target model for the training process. Inspired by semi- supervised GAN (Salimans et al. 2016), KED-MI (Chen et al. 2021) adopted a classifier as the GAN discriminator and utilized the target model to provide soft labels for public GANLatentSpacePublicDataPublicDataGMIKED-MIOursGANLatentSpaceAllclassesintheprivatedataPublicDataGANLatentSpaceClass1Class2Class4Class3Class5*** data during the training process in stage-1, which achieved the state-of-the-art MI attack performance. Even so, the at- tack performance is still underwhelming, especially when public and private data have a large distributional shift. We infer possible limitations of existing work as follows: 1) Class-Coupled Latent Space. The generator obtained by existing work in stage-1 is class-coupled. When the adversary reconstructs a specified class of target in stage- 2, it needs to search in the latent space of all classes, which easily causes confusion of feature information be- tween different classes (see Fig. 1). 2) Indirectly Constrains on the Generator. The KED- MI attack adopts the semi-supervised GAN framework, which indirectly constrains the generator with class infor- mation through the discriminator. However, this implicit constraint relies too much on the discriminator and lacks task specificity for MI. 3) Gradient Vanishing Problem. Previous MI attacks have commonly adopted cross-entropy (CE) loss as the opti- mization goal in stage-2. However, the cross-entropy loss will cause the gradient to decrease and tend to vanish as the number of iterations increases, resulting in the search process to slow down or even stop early. To address the above limitations, we propose a novel pseudo label-guided MI (PLG-MI) attack. Specifically, we first propose a simple but effective top-n selection strategy, which can provide pseudo-labels for public data. Then we introduce the conditional GAN (cGAN) to MI attacks and use the pseudo-labels to guide the training process, enabling it to learn more specific and independent image distributions for each class. In addition, we also impose a task-specific explicit constraint directly on the generator so that class in- formation can be embedded into the latent space. This con- straint can force images to be generated towards specific classes in the private data. As shown in Fig. 1, it can be considered as an approximate division of the GAN latent space into separate class subspaces. When reconstructing the private data of an arbitrary class in stage-2, only the corre- sponding subspace needs to be searched, which avoids con- fusion between different classes. Our contributions can be summarized as follows: • We propose Pseudo Label-Guided MI (PLG-MI) attack, which can make full use of the target model and leverage pseudo-labels to guide the output of the generator during the training process. • We propose a simple but effective strategy to provide public data with pseudo-labels, which can provide cor- responding features according to specific classes in the private dataset. • We demonstrate the gradient vanishing problem of cross- entropy loss commonly adopted in previous MI attacks and use max-margin loss to mitigate it. • Extensive experiments demonstrate that the PLG-MI at- tack greatly boosts the MI attack and achieves state-of- the-art attack performance, especially in the presence of a large distributional shift between public and private data. Figure 2: Top-n selection strategy. Input the images of public data into the target model and select the top n images with the highest confidence for each class. The right half shows images of the corresponding class in the private dataset. 2 Related Work Inversion Attacks. Fredrikson et al. Basic Model (Fredrikson et al. 2014) first studied MI attacks in the con- text of genomic privacy and demonstrated that access to linear regression models for personalized medicine can be abused to recover private genomic properties of individuals in the training dataset. Fredrikson et al. (Fredrikson, Jha, and Ristenpart 2015) later proposed an optimization algo- rithm based on gradient descent for MI attacks, which can recover grayscale face images from shallow networks. How- ever, these basic MI attacks that reconstruct private data di- rectly from the pixel space failed when the target models are DNNs. Generative Model Inversion Attacks. To make it possi- ble to launch MI attacks against DNNs, Zhang et al. (Zhang et al. 2020) proposed generative model inversion (GMI) at- tacks, which trained a GAN on public data as an image prior and then restricted the optimization problem in the la- tent space of the generator. Wang et al. (Wang et al. 2021) proposed viewing MI attacks as a variational inference (VI) problem and provided a framework using deep normalizing flows in the extended latent space of a StyleGAN (Karras et al. 2020). Chen et al. (Chen et al. 2021) adopted the semi- supervised GAN framework to improve the training process by including soft labels produced by the target model. Kahla et al. (Kahla et al. 2022) extended generative MI attacks to black-box scenarios where only hard labels are available. 3 Method In this section, we will first discuss the threat model and then present our attack method in detail. 3.1 Threat Model Adversary's Goal. Given a target model T : [0, 1]d → R|C| and an arbitrary class c∗ ∈ C, the adversary aims to reconstruct a representative sample x∗ of the training data of the class c∗; d represents the dimension of the model in- put; C denotes the set of all class labels of the training data and |C| is the size of the label set. It should be emphasized that the reconstructed data need to have good semantic in- formation for human recognition. In this paper, we focus on Target modelClass 1...Top-n Selection StrategyTPublic Data0.93020.7669Class 0...0.91230.8805Top nClass 0Class 1......Private Data Figure 3: The overall pipeline of the proposed two-stage model inversion attack algorithm. Stage 1: Train a conditional GAN on the public data with guidance provided by pseudo-labels and knowledge of the target model. Stage 2: Leverage the trained generator to reconstruct the specific class of private images using Linv. the attack against face recognition models, that is, the ad- versary's goal is to reconstruct its corresponding face image from the target model according to the specified identity. Adversary's Knowledge. In this paper, we focus on white-box MI attacks, which means that the adversary can have access to all parameters of the target model. In addi- tion, following the settings in previous work (Zhang et al. 2020; Chen et al. 2021; Kahla et al. 2022), the adversary can gain a public dataset of the target task that only shares struc- tural similarity with the private dataset without any inter- secting classes. For example, the adversary knows the target model is for face recognition, he can easily leverage an ex- isting open-sourced face dataset or crawl face images from the Internet as the public data. 3.2 Pseudo-Labels Generation Top-n Selection Strategy. In order to make the public data have pseudo-labels to guide the training of the generator, we propose a top-n selection strategy, as shown in Fig. 2. This strategy aims to select the best matching n images for each pseudo-label from public data. These pseudo-labels corre- spond to classes in the private dataset. Specifically, we feed all images in public data into the target model and get the corresponding prediction vectors. Then for a certain class k, we sort all images in descending order of kth value in their prediction vectors and select the top n images to assign the pseudo-label k. Generally, if the target model has high confidence in the kth class for a certain image, this image can be considered to contain discriminative features of the kth class. We define F k pri and F k pub as the distributions of discriminative features contained in the kth class of private data and pseudo-labeled public data. It can be inferred that F k pri have in- tersection, which means that the adversary can obtain the required information by sufficiently searching F k pub, making the private information in F k pri leaked more easily and accu- rately. pub and F k Narrow the Search Space via Pseudo-Labels. This strat- egy can narrow the search space of latent vectors in stage-2. Specifically, after reclassifying the public data, we can di- rectly learn the feature distribution of images for each class. When reconstructing images of the kth class in the private dataset, it is only necessary to search for required features in F k pub, while reducing the interference of irrelevant features from F i(cid:54)=k pub . Taking face recognition as an example, suppose that the kth class of the private dataset is a young white man with blond hair, then the kth class of the pseudo-labeled pub- lic data is also mostly white people with blond hair, as shown in Fig. 2. Consequently, the key features can be preserved and the useless features (e.g., other skin tones or hair colors, etc.) are eliminated, thereby narrowing the search space. 3.3 Pseudo Label-Guided MI Attack An overview of our attack is illustrated in Fig. 3, which con- sists of two stages. In stage-1, we train a conditional GAN on public data under the guidance of pseudo-labels. In stage- 2, we use the trained generator to reconstruct private images of specified classes. Problem Formulation. At first, we formulate the MI problem in the context of image classification (i.e., face recognition) with DNNs. We use Ds to denote the private dataset with sensitive information and Dp to denote the pub- lic dataset available to the adversary. Then using the top-n selection strategy to obtain a pseudo-labeled public dataset Dr. We denote a sample image as x ∈ Ds, and its corre- sponding label as y ∈ {1, . . . , K}, where K denotes the number of classes. Note that the original Dp does not have any class intersection with Ds, while the Dr has the pseudo- labels ̃y ∈ {1, . . . , K}. In the typical case, the target model T will be trained on Ds to learn the mapping from the input space to the probability vectors. In generative MI attacks, the adversary uses Dp to train a GAN and then optimizes the input to the generator, in- stead of directly optimizing from the pixel space. Denote the trained generator by G(z), where z ∼ N (0, 1) is the la- tent vector. The optimization problem can be formulated as follows: z∗ = arg min ˆz Linv(T (G(ˆz)), c), (1) z∼N(0,1)Latent vectorFake imageGTargetlabeltL!"#TGradientImage ReconstructiontTargetlabelEmbeddingPseudolabelcGFake imageReal imageDEmbeddingLatent vectorTL$L!"#L%Pseudo Label-Guided cGANRandomAugmentationRandomAugmentationRandomAugmentationz∼N(0,1) Figure 4: Visual comparison for attacking VGG16 trained on CelebA. The first row shows ground truth images of target identity in the private data. The second row shows the images from the public data with the highest confidence in the target identity. The third and last rows demonstrate the reconstructed images of the target identity using KED-MI and our attack, respectively. where c is the target class in Ds, and Linv is a classification loss (e.g., cross-entropy). Then the reconstructed images can be obtained by x∗ = G(z∗). where T is the target model being attacked, A is a set of random augmentations, Linv is the max-margin loss which we will introduce later, and α is a regularization coefficient. Pseudo Label-Guided cGAN. Although existing genera- tive MI attacks (Zhang et al. 2020; Chen et al. 2021) can learn a prior of natural images, they do not take into account the possible effects of class labels, thus causing all classes to be coupled together in the latent space. This makes it dif- ficult to directly search for private images of the specified class. As mentioned before, in order to narrow the search space and conduct a more independent latent search process. We propose to train a conditional GAN (Miyato and Koyama 2018) to model the feature distribution of each class and use pseudo-labels to guide the direction of the generated images. Formally, for training the discriminator in the cGAN, we use a hinge version of the standard adversarial loss: LD =Eq( ̃y) Eq( ̃y) (cid:2)Eq(x| ̃y)[max(0, 1 − D(x, ̃y)]]+ (cid:2)Ep(z)[max(0, 1 + D(G(z, ̃y), ̃y))], (2) where q( ̃y) and q(x| ̃y) are the pseudo-label distribution of Dr and the image distribution in the corresponding class, respectively. p(z) is standard Gaussian distribution and G(z, ̃y) is the conditional generator. To make the generated image more accurate, we use the pseudo-labels ̃y of Dr to impose an explicit constraint on the generator. The constraint, in principle, guides the gener- ated images to belong to a certain class in the private dataset. Besides, we add a stochastic data augmentation module that performs random transformations on the generated images, including resizing, cropping, horizontal flipping, rotation, and color jittering. This module provides more stable con- vergence to realistic images while constraining. Then the loss function for the generator can be defined as: Image Reconstruction. After getting the GAN trained on the public data, we can use it to reconstruct images of a spec- ified class in the private dataset, as shown in the right half of Fig. 3. Specifically, given a target class c, we aim to search for appropriate latent vectors, so that the generated images constantly approach the images in c. Since we use a con- ditional generator, only the subspace of the specified class needs to be searched. In order to ensure that reconstructed images are not deceptive (e.g., adversarial example) or just stuck in a local minimum, we transform generated images randomly resulting in multiple correlated views. Intuitively, if the reconstructed image truly reveals key discriminative features of the target class, its class should remain consistent across these views. The objective can be defined as follows: z∗ = arg min ˆz m (cid:88) i=1 Linv(T (Ai(G(ˆz, c))), c), (4) where ˆz is the latent vector to be optimized, Linv is the max- margin loss, Ai is a set of random data augmentations, and m is the number of augmented views. Then we can obtain the reconstructed images by x∗ = G(z∗, c). 3.4 A Better Loss for MI Attacks Gradient Vanishing Problem. Existing MI attacks have commonly adopted the cross-entropy (CE) loss as Linv. During attack optimization, the CE loss will cause the gradi- ent to decrease and tend to vanish as the number of iterations is increased. For the target class c, the derivative of cross- entropy loss LCE with respect to the output logits o can be derived as (see Appendix for derivation): ∂LCE ∂o = p − yc. (5) LG = − Eq( ̃y) (cid:2)Ep(z) [D(G(z, ̃y), ̃y))](cid:3) + αLinv(T (A(G(z, ̃y))), ̃y), (3) Here, p is the probability vector of the softmax output, that is p = [p1, p2, . . . , pK], pc ∈ [0, 1] denotes the predicted KED-MIPrivateOursPublic Attack Acc ↑ Top-5 Attack Acc ↑ KNN Dist ↓ FID ↓ GMI .21±.0028 .42±.0021 1712.57 42.86 VGG16 KED-MI .63±.0018 .87±.0015 1391.52 30.92 Ours GMI ResNet-152 KED-MI Ours GMI Face.evoLVe KED-MI .97±.0001 1.±.0000 1120.61 18.63 .31±.0035 .55±.0045 1630.25 42.50 .74±.0028 .93±.0006 1323.16 26.23 1.±.0000 1.±.0000 1026.71 23.22 .29±.0030 .54±.0040 1638.94 41.53 .74±.0013 .94±.0009 1310.15 27.92 Ours .99±.0001 1.±.0000 1103.03 26.75 Table 1: Attack performance comparison on various models trained on CelebA. ↑ and ↓ respectively symbolize that higher and lower scores give better attack performance. Attack Acc ↑ Attack Acc 5 ↑ KNN Dist ↓ FID↓ Attack Acc ↑ Attack Acc 5 ↑ KNN Dist↓ FID↓ FFHQ → CelebA FaceScrub → CelebA VGG16 Face.evoLVe ResNet-152 GMI KED-MI Ours GMI KED-MI Ours GMI KED-MI Ours .11±.0009 .34±.0026 .89±.0006 .13±.0009 .47±.0021 .95±.0004 .17±.0026 .74±.0028 1.±.0000 .27±.0048 .62±.0015 .97±.0002 .31±.0028 .74±.0013 .99±.0001 .37±.0030 .93±.0006 1.±.0000 1771.34 1555.57 1284.16 1739.88 1489.67 1241.41 1687.82 1323.16 1026.71 57.05 49.51 27.32 56.66 44.48 25.57 47.11 26.23 23.22 .02±.0004 .05±.0008 .55±.0020 .03±.0004 .09±.0006 .57±.0013 .04±.0011 .15±.0011 .68±.0020 .07±.0008 .14±.0006 .77±.0012 .10±.0012 .24±.0019 .78±.0012 .14±.0020 .36±.0020 .87±.0011 1997.16 1772.85 1474.22 1918.40 1712.31 1502.82 1865.44 1636.81 1360.67 150.19 97.56 27.99 112.96 99.78 34.10 109.16 72.72 27.49 Table 2: Attack performance comparison in the presence of a large distributional shift between public and private data. A → B represents the GAN and target model trained on datasets A and B, respectively. probability of class c. yc is the one-hot encoded vector of class c, that is, yc = [01, . . . , 1c, . . . , 0K]. Then, Eq. (5) can be rewritten as: ∂LCE ∂o = [p1, . . . , pc − 1, . . . pK] . (6) According to Eq. (6), as the generated image gradually ap- proaches the target class during optimization, pc will quickly reach 1 while pi(cid:54)=c will continue to decrease to 0. Eventually, this changing trend will cause the gradient of LCE to vanish, making it difficult to search the latent vector of the generator. Max-Margin Loss. To address this problem, we propose to replace the CE loss with the max-margin loss, which has been used in adversarial attacks to produce stronger at- tacks (Carlini and Wagner 2017; Sriramanan et al. 2020). In addition, we eliminate the softmax function and optimize the loss directly on the logits. The max-margin loss LMM we use as Linv is as follows: LMM = −lc(x) + max j(cid:54)=c lj(x), (7) where lc denotes the logit with respect to the target class c. For the target class c, the derivative of LMM with respect to the logits can be derived as (see Appendix for derivation): ∂LMM ∂o = yj − yt, (8) where yj and yt represent one-hot encoded vectors, so the elements of the gradient consist of constants, thus avoiding gradient vanishing problem. Moreover, max-margin loss en- courages the algorithm to find the most representative sam- ple in the target class while also distinguishing it from other classes. Compared with the cross-entropy loss, max-margin loss is more in line with the goal of MI attacks (further com- parisons are given in the Appendix). 4 Experiments In this section, we first provide a detailed introduction of the experimental settings. To demonstrate the effectiveness of our methods, we evaluate the proposed PLG-MI attack from several perspectives. The baselines that we will com- pare against are GMI proposed in (Zhang et al. 2020) and KED-MI proposed in (Chen et al. 2021), the latter achieved the state-of-the-art result for attacking DNNs. 4.1 Experimental Setting Datasets. For face recognition, we select three widely used datasets for experiments: CelebA (Liu et al. 2015), FFHQ (Karras, Laine, and Aila 2019) and FaceScrub (Ng and Winkler 2014). CelebA contains 202,599 face images of 10,177 identities with coarse alignment. FFHQ consists of 70,000 high-quality PNG images and contains consid- erable variation in terms of age, ethnicity and image back- ground. FaceScrub is a dataset of URLs for 100,000 images of 530 individuals. Similar to previous work (Zhang et al. 2020; Chen et al. 2021; Kahla et al. 2022), we crop the im- ages of all datasets at the center and resize them to 64 × 64. More experiments on MNIST (LeCun et al. 1998), CIFAR- 10 (Krizhevsky, Hinton et al. 2009) and ChestX-Ray (Wang et al. 2017) can be found in the Appendix. Models. Following the setting of the state-of-the-art MI at- tack (Chen et al. 2021), we evaluate our attack on three deep models with various architectures: (1) VGG16 (Simonyan and Zisserman 2014); (2) Face.evoLVe (Cheng et al. 2017); and (3) ResNet-152 (He et al. 2016). Implementation Details. In the standard setting, previous MI attacks usually split the dataset into two disjoint parts: FaceScrub → CelebA VGG16 Face.evoLVe ResNet-152 Attack Acc ↑ KNN Dist ↓ FID ↓ Attack Acc ↑ KNN Dist ↓ FID ↓ Attack Acc ↑ KNN Dist ↓ FID ↓ VGG16 Face.evoLVe ResNet-152 KED-MI Ours KED-MI Ours KED-MI Ours .05±.0008 .55±.0020 .05±.0006 .54±.0019 .06±.0004 .57±.0019 1772.85 1474.22 1773.14 1472.86 1776.78 1427.91 97.56 27.99 103.00 31.16 107.75 28.35 .10±.0006 .76±.0017 .09±.0006 .57±.0013 .12±.0012 .68±.0026 1694.13 1356.23 1712.31 1502.82 1697.37 1385.99 87.79 25.57 99.78 34.10 88.28 27.30 .12±.0009 .81±.0016 .13±.0018 .71±.0015 .15±.0011 .68±.0020 1638.34 1282.36 1646.85 1390.84 1636.81 1360.67 87.24 23.74 96.04 27.84 72.72 27.49 Table 3: Attack performance comparison when using models with different architectures in the GAN training stage and the image reconstruction stage. The public dataset is FaceScrub which has a larger distributional shift with CelebA. one part used as the private dataset to train the target model and the other as the public dataset. For training the tar- get model, we use 30,027 images of 1,000 identities from CelebA as the private dataset. The disjoint part of CelebA is used to train the generator. However, this setting is too easy under our stronger PLG-MI attack. Therefore we focus on the scenario where the public dataset has a larger distri- butional shift with the private dataset, i.e., using two com- pletely different datasets. Specifically, we use FFHQ and FaceScrub as public datasets respectively to train the gen- erator. We set n = 30 for the top-n selection strategy, that is, each public dataset consists of 30,000 selected images that are reclassified into 1,000 classes by pseudo-labels. In stage-1, the GAN architecture we use is based on (Miyato and Koyama 2018). We apply spectral normalization (Miy- ato et al. 2018) to the all of the weights of the discriminator to regularize the Lipschitz constant. To train the GAN, we used Adam optimizer with a learning rate of 0.0002, a batch size of 64 and β = (0, 0.9). The hyperparameter α in Eq. (3) is set to 0.2. In stage-2, we use the Adam optimizer with a learning rate of 0.1 and β = (0.9, 0.999). The input vector z of the generator is drawn from a zero-mean unit-variance Gaussian distribution. We randomly initialize z for 5 times and optimize each round for 600 iterations. 4.2 Evaluation Metrics The evaluation of the MI attack is based on the similarity of the reconstructed image and the target class image in the human-recognizable features. In line with previous work, we conducted both qualitative evaluation through visual inspec- tion as well as quantitative evaluation. Specifically, the eval- uation metrics we used are as follows. Attack Accuracy (Attack Acc). We first build an evalua- tion model, which has a different architecture from the tar- get model. We then use the evaluation model to compute the top-1 and top-5 accuracy of the reconstructed image on the target class. Actually, the evaluation model can be viewed as a proxy for a human observer to judge whether a recon- struction captures sensitive information. We use the model in (Cheng et al. 2017) for evaluation, which is pretrained on MS-Celeb1M (Guo et al. 2016) and then fine-tuned on train- ing data of the target model. K-Nearest Neighbor Distance (KNN Dist). Given a tar- get class, we computed the shortest feature distance from a reconstructed image to the private images. The distance is measured by the (cid:96)2 distance between two images in the fea- ture space, i.e., the output of the penultimate layer of the evaluation model. A lower value indicates that the recon- structed image is closer to the private data. Fr ́echet Inception Distance (FID). FID (Heusel et al. 2017) is commonly used in the work of GAN to evaluate the generated images. Lower FID values indicate that the recon- structed images have better quality and diversity, making it easier for humans to identify sensitive features in them. Fol- lowing the baseline setting, we only compute FID values on images where the attack is successful. 4.3 Experimental Results Standard Setting. We first study the standard setting, i.e.,, dividing the CelebA dataset into a private dataset and a pub- lic dataset. As shown in Table 1, our method outperforms the baselines on all three models. The reconstructed images pro- duced by our PLG-MI attack can achieve almost 100% accu- racy on the evaluation model (i.e., Attack Acc), which out- performs the state-of-the-art method on average by approxi- mately 30%. Our method is also vastly superior in FID and KNN Dist, significantly improving the visual quality and the similarity of reconstructed images to private datasets. Fig. 4 shows the visual comparison of different methods. Compared with KED-MI, for different identities in the pri- vate dataset, our reconstructed images not only have more similar semantic features to the ground truth images, but are also more realistic. The second row shows the images of the public data with the highest confidence in the corresponding identity of the target model. We use the confidence as the basis for providing pseudo-labels in the top-n selection strat- egy. In most cases, the images selected by the strategy can provide some of the characteristic features needed to recon- struct the identity, such as gender, hair color and skin tone. But in terms of details, it can still be easily distinguished that they are not the same identity. Therefore, the optimization process of stage-2 is also very critical, and these candidate features will be further filtered and reorganized to increas- ingly resemble the target identity. Larger Distributional Shifts. To further explore scenar- ios where the baselines performed poorly, we conducted ex- periments in the setting with larger distributional shifts. As shown in Table 2, GMI and KED-MI achieve the Attack Acc of 17% and 74% when exploiting FFHQ to attack ResNet- 152, respectively. Since they do not fully explore the capa- Figure 5: (a)-(b) Attack performance with different Linv and top-n selection strategy, respectively. (c) Attack Acc and FID with constraints of various strengths in Eq. (3). (d) Attack Acc and FID with various numbers of augmentations in Eq. (4). (c) and (d) use FaceScrub as the public dataset. bility in the target model, the performance is poor in this more difficult setting. Compared with them, our PLG-MI at- tack achieves 89% Attack Acc when attacking VGG16 us- ing FFHQ as public data, which is about 2.5 times higher than KED-MI. And the Attack Acc reaches more than 95% when attacking both Face.evoLVe and ResNet-152. In addi- tion, there is a significant improvement in the FID for eval- uating visual quality (e.g., a reduction from 49.51 to 27.32). It should be emphasized that in the case of using Face- Scrub as the public dataset, both GMI and KED-MI only obtain an almost failed attack performance. However, our method still maintains a high attack success rate, on average 50% higher than KED-MI on Attack Acc. As for the FID, our method maintains a low value in all cases, with an av- erage reduction of about 3 times relative to KED-MI. The lower KNN Dist also shows that our method can reconstruct more accurate private images. The results of FFHQ as public data are generally better than those of FaceScrub. The possible reason is that Face- Scrub consists of face images crawled from the Internet, which is more different from the distribution of CelebA. Fur- thermore, we find that the degree of privacy leakage under MI attacks varies between model architectures. In our ex- periments, ResNet-152 is more likely to leak information in private datasets compared to VGG16 and Face.evoLVe. This phenomenon deserves further study in future work. Generality of the GAN. The adversary may simultane- ously perform MI attacks against multiple available target models to verify the correctness of the reconstructed im- age for the target identity. However, it will be very time- consuming to train a GAN separately for a specific tar- get model each time. Therefore, we explore a new scenario where the architecture of the classifier used to help train the GAN is different from that of the target model. Table 3 compares the results of our method with those of the baselines. Our method yields clearly superior results for all three models under various evaluation metrics. When using VGG16 to provide prior information to train a gener- ator in stage-1, and using it to attack ResNet-152 in stage-2, our method achieves 81% Attack Acc, while KED-MI only achieves 12%. In addition, the FID of KED-MI is approxi- mately 3 times higher on average than ours. The experimental results of this scenario illustrate that re- gardless of the architecture of the models, our method is able to extract general knowledge to help recover sensitive infor- mation. Specifically, the generality of our cGAN can greatly improve the efficiency of attacks when there are multiple target models to be attacked. Ablation study. We further investigate the effects of the various components and hyperparameters in PLG-MI and conduct attacks against VGG16 trained on CelebA using FaceScrub or FFHQ as the public dataset. As shown in Fig. 5 (a), we compare the impact of different Linv used in MI at- tacks. Using the max-margin loss brings a significant im- provement on Attack Acc, especially when the distributional shift is larger (i.e., the public dataset is FaceScrub). Fig. 5 (b) presents the results of using different n in the top-n selection strategy, its value has no significant impact on the attack per- formance, indicating that the strategy is not sensitive to n. Fig. 5 (c) shows the attack performance and visual quality when imposing explicit constraints of various strengths on the generator and α = 0.2 is optimal among them. Fig. 5 (d) shows that the data augmentation module in stage-2 has a great influence on improving the Attack Acc and the visual quality of reconstructed images. However, when the number of augmentations is greater than 2, the improvement in at- tack performance is small, but the attack efficiency will be reduced. Thus we finally force the reconstructed images to maintain identity consistency after 2 random augmentations. 5 Conclusion In this paper, we propose a novel MI attack method, namely PLG-MI attack. We introduce the conditional GAN and use pseudo-labels provided by the proposed top-n selection strategy to guide the training process. In this way, the search space in the stage of image reconstruction can be limited to the subspace of the target class, avoiding the interference of other irrelevant features. Moreover, we propose to use max- margin loss to overcome the problem of gradient vanishing. Experiments show that our method achieves the state-of-the- art attack performance on different scenarios with various model architectures. For future work, the black-box MI at- tack is still in its infancy, and the idea of our method can be transferred to the black-box scenario to further improve its performance. 0.00.10.20.30.4AE0.10.20.30.40.50.60.70.8AttackaccAttackAcc203040506070FIDFID10203040Top-n0.20.40.60.81.0AttackAccFFHQFaceScrubFaceScrubFFHQ0.00.20.40.60.8AttackAccCross-EntropyLossMax-MarginLoss(a)(c)(d)(b)01234NumberofAugmentations0.20.30.40.50.60.70.8AttackaccAttackAcc2025303540455055FIDFID Acknowledgements This work was supported in part by the Natural Science Foundation of China under Grant U20B2047, 62102386, 62072421, 62002334 and 62121002. References Carlini, N.; and Wagner, D. 2017. Towards evaluating the robustness of neural networks. In IEEE Symposium on Se- curity and Privacy, 39–57. Chen, S.; Kahla, M.; Jia, R.; and Qi, G.-J. 2021. Knowledge- In Pro- Enriched Distributional Model Inversion Attacks. ceedings of the IEEE/CVF International Conference on Computer Vision, 16178–16187. Cheng, Y.; Zhao, J.; Wang, Z.; Xu, Y.; Jayashree, K.; Shen, S.; and Feng, J. 2017. Know you at one glance: A compact vector representation for low-shot learning. In Proceedings of the IEEE/CVF International Conference on Computer Vi- sion Workshops, 1924–1932. Cohen, J. P.; Morrison, P.; and Dao, L. 2020. COVID-19 image data collection. arXiv preprint arXiv:2003.11597. Dai, Z.; Yang, Z.; Yang, F.; Cohen, W. W.; and Salakhut- dinov, R. R. 2017. Good semi-supervised learning that re- quires a bad gan. Advances in Neural Information Process- ing Systems, 30. Fredrikson, M.; Jha, S.; and Ristenpart, T. 2015. Model inversion attacks that exploit confidence information and In Proceedings of the 22nd ACM basic countermeasures. SIGSAC Conference on Computer and Communications Se- curity, 1322–1333. Fredrikson, M.; Lantz, E.; Jha, S.; Lin, S.; Page, D.; and Ris- tenpart, T. 2014. Privacy in Pharmacogenetics: An {End-to- End} Case Study of Personalized Warfarin Dosing. In 23rd USENIX Security Symposium, 17–32. Gopinath, D.; Converse, H.; Pasareanu, C.; and Taly, A. 2019. Property inference for deep neural networks. In 34th IEEE/ACM International Conference on Automated Soft- ware Engineering, 797–809. Guo, Y.; Zhang, L.; Hu, Y.; He, X.; and Gao, J. 2016. Ms- celeb-1m: A dataset and benchmark for large-scale face recognition. In European Conference on Computer Vision, 87–102. He, K.; Zhang, X.; Ren, S.; and Sun, J. 2016. Deep resid- In Proceedings of the ual learning for image recognition. IEEE/CVF Conference on Computer Vision and Pattern Recognition, 770–778. Heusel, M.; Ramsauer, H.; Unterthiner, T.; Nessler, B.; and Hochreiter, S. 2017. Gans trained by a two time-scale up- date rule converge to a local nash equilibrium. Advances in Neural Information Processing Systems, 30. Kahla, M.; Chen, S.; Just, H. A.; and Jia, R. 2022. Label- Only Model Inversion Attacks via Boundary Repulsion. In Proceedings of the IEEE/CVF Conference on Computer Vi- sion and Pattern Recognition, 15045–15053. Karras, T.; Laine, S.; and Aila, T. 2019. A style-based gen- In erator architecture for generative adversarial networks. Proceedings of the IEEE/CVF Conference on Computer Vi- sion and Pattern Recognition, 4401–4410. Karras, T.; Laine, S.; Aittala, M.; Hellsten, J.; Lehtinen, J.; and Aila, T. 2020. Analyzing and improving the image qual- ity of stylegan. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 8110–8119. Krizhevsky, A.; Hinton, G.; et al. 2009. Learning multiple layers of features from tiny images. Tech Report. LeCun, Y.; Bottou, L.; Bengio, Y.; and Haffner, P. 1998. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11): 2278–2324. Li, M.; Deng, C.; Li, T.; Yan, J.; Gao, X.; and Huang, H. 2020. Towards transferable targeted attack. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pat- tern Recognition, 641–649. Liu, Z.; Luo, P.; Wang, X.; and Tang, X. 2015. Deep learning face attributes in the wild. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 3730–3738. Miyato, T.; Kataoka, T.; Koyama, M.; and Yoshida, Y. 2018. Spectral normalization for generative adversarial networks. arXiv preprint arXiv:1802.05957. Miyato, T.; and Koyama, M. 2018. cGANs with projection discriminator. arXiv preprint arXiv:1802.05637. Ng, H.-W.; and Winkler, S. 2014. A data-driven approach to cleaning large face datasets. In IEEE International Confer- ence on Image Processing, 343–347. Rajpurkar, P.; Irvin, J.; Zhu, K.; Yang, B.; Mehta, H.; Duan, T.; Ding, D.; Bagul, A.; Langlotz, C.; Shpanskaya, K.; et al. 2017. Chexnet: Radiologist-level pneumonia detec- arXiv preprint tion on chest x-rays with deep learning. arXiv:1711.05225. Salimans, T.; Goodfellow, I.; Zaremba, W.; Cheung, V.; Rad- ford, A.; and Chen, X. 2016. Improved techniques for train- ing gans. Advances in Neural Information Processing Sys- tems, 29. Shokri, R.; Stronati, M.; Song, C.; and Shmatikov, V. 2017. Membership inference attacks against machine learning In IEEE Symposium on Security and Srivacy, 3– models. 18. Simonyan, K.; and Zisserman, A. 2014. Very deep convo- lutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556. Sriramanan, G.; Addepalli, S.; Baburaj, A.; et al. 2020. Guided adversarial attack for evaluating and enhancing ad- versarial defenses. Advances in Neural Information Process- ing Systems, 33: 20297–20308. Struppek, L.; Hintersdorf, D.; Correia, A. D. A.; Adler, A.; and Kersting, K. 2022. Plug & Play Attacks: Towards Ro- bust and Flexible Model Inversion Attacks. In Proceedings of the 39th International Conference on Machine Learn- ing (ICML), Proceedings of Machine Learning Research, 20522–20545. PMLR. Taigman, Y.; Yang, M.; Ranzato, M.; and Wolf, L. 2014. Deepface: Closing the gap to human-level performance in face verification. In Proceedings of the IEEE/CVF Confer- ence on Computer Vision and Pattern Recognition, 1701– 1708. Tram`er, F.; Zhang, F.; Juels, A.; Reiter, M. K.; and Risten- part, T. 2016. Stealing Machine Learning Models via Pre- diction {APIs}. In 25th USENIX Security Symposium, 601– 618. Wang, K.-C.; Fu, Y.; Li, K.; Khisti, A.; Zemel, R.; and Makhzani, A. 2021. Variational Model Inversion Attacks. Advances in Neural Information Processing Systems, 34: 9706–9719. Wang, X.; Peng, Y.; Lu, L.; Lu, Z.; Bagheri, M.; and Sum- mers, R. M. 2017. Chestx-ray8: Hospital-scale chest x-ray database and benchmarks on weakly-supervised classifica- In Pro- tion and localization of common thorax diseases. ceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2097–2106. Zhang, Y.; Jia, R.; Pei, H.; Wang, W.; Li, B.; and Song, D. 2020. The secret revealer: Generative model-inversion In Proceedings of attacks against deep neural networks. the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 253–261. A Appendix A.1 The Derivatives of Cross-Entropy Loss and Max-Margin Loss Cross-Entropy Loss We define the CE loss for the K- classification task as follows: L = − K (cid:88) i=1 yi log (pi) , (9) where yi denotes the one-hot encoded vector of class i, in which only the ith element yi is 1, and the rest are 0. (i.e., yi = [01, . . . , 1i, . . . , 0K]). Thus, for the specified target class t, Eq. (9) can be rewritten as: L = − log(pt). (10) Here, we denote the logits of the model output as o = [o1, . . . , ot, . . . , oK], and denote the softmax output (i.e., probability vector) as p = [p1, . . . , pt, . . . , pK]. Then, the derivative of the CE Loss (L) with respect to the logits (o) is as follow: ∂L ∂o = ∂L ∂p ∂p ∂o . (11) It can be seen from Eq. (10) that L is only related to pt, so we can get: ∂L ∂p (cid:20) 01, . . . , − = (cid:21) , . . . , 0K . 1 pt And ∂p ∂o of Eq. (11) is a Jacobian matrix, as follows: ∂p ∂o =          ∂p1 ∂o1 ... ∂pj ∂o1 ... ∂pK ∂o1 ∂p1 ∂o2 ... ∂pj ∂o2 ... ∂pK ∂o2          . * * * ∂p1 ∂oK . . . * * * ∂pj ∂oK . . . * * * ∂pK ∂oK (12) (13) As only the element in row t is not 0 in Eq. (13), we arrive at: ∂LCE ∂o = ∂LCE ∂p where pt = (cid:80)K = − ∂p ∂o eoj i=1 eoi . 1 pt ∂pt ∂o (14) With Eq. (14), for the case where i (cid:54)= t, the derivative of CE loss is as follows: ∂L ∂oi = = ∂L ∂pt ∂L ∂pt ∂pt ∂oi 0 − eoteoi (cid:16)(cid:80)K i=1 eoi (cid:17)2 )(−ptpi) 1 pt = (− = pi. (15) And for the case where i = t, the derivative of CE loss is as follows: ∂L ∂oi = = ∂L ∂pt ∂L ∂pt ∂pt ∂oi eot (cid:80)K i=1 eoi − eoteot (cid:16)(cid:80)K i=1 eoi (cid:17)2 = (− 1 pt ) (cid:0)pt − p2 t (cid:1) = pt − 1. (16) From Eq. (15) and Eq. (16), we derive the final derivative of CE loss as: ∂L ∂o = [p1, . . . , pt − 1, . . . pK] (17) = [p1, . . . , pt, . . . pK] − [01, . . . , 1t, . . . , 0K] = p − yt. Max-Margin Loss. Without loss of generality, we can de- fine the max-margin loss for a target class t as follows: L = oj − ot, (18) where j = arg maxi(cid:54)=t oi indicates the highest class except for the target class t. We denote the derivative of L to the logits o as ∂L ∂o . It can be deduced that ∂L = 0 when i (cid:54)= j ∂oi and i (cid:54)= t, and ∂L is 1 and −1 when i = j and i = t, ∂oi respectively. Thus, we finally derive at: ∂L ∂o = yj − yt. (19) A.2 Experiments on Other Datasets We also perform MI attacks on the digit recognition task, the object classification task, and the disease prediction task, us- ing the MNIST (LeCun et al. 1998), CIFAR-10 (Krizhevsky, Hinton et al. 2009), and ChestX-Ray (Wang et al. 2017) datasets for experiments, respectively. Experimental Details. For MNIST and CIFAR-10, we use the images in the training data with labels 0, 1, 2, 3, and 4 as the private data, containing 30,596 and 25,000 im- ages, respectively. The rest images with labels 5, 6, 7, 8, and 9 are used as the public data, containing 29,404 and 25,000 images, respectively. We adopt ResNet-18 trained on the pri- vate data as the target model. As for the evaluation model, we train VGG16 on the original training data instead of the private data to better distinguish deceptive reconstructed im- ages. For ChestX-Ray, we use 14 classes of images with dis- eases as the private data to train the target model ResNet- 18. Then, we randomly select 20,000 images from the class with the label "NoFinding" (i.e., no disease) as the public data to train the evaluation model ResNet-34. Furthermore, we also use a different COVID19 dataset (Cohen, Morrison, and Dao 2020) with 21,165 images as the public data. All images from above datasets are resized to 64 × 64. n for the top-n selection strategy is set to 4,000 for MNIST and CIFAR-10, and 1,000 for ChestX-Ray. The learning rates in stage-2 are set to 0.1 and 0.001, respectively, for 300 itera- tions. We reconstruct 100 images per class for MNIST and CIFAR-10, and 10 images per class for Chest-X-ray. NoFinding → ChestX-Ray COVID19 → ChestX-Ray KED-MI Attack Acc ↑ .71±.0034 KNN Dist ↓ FID ↓ Ours .80±.0020 84.56 47.51 Ours .82±.0048 82.71 64.33 KED-MI .68±.0026 113.18 109.41 97.26 97.35 Figure 6: The digit "3" samples of MNIST reconstructed by the baseline and our method. Experimental Results. As shown in Table 4, our method comprehensively outperforms the baselines by a large mar- gin on MINST and CIFAR-10 datasets. When attacking the digit recognition model trained on MNIST, GMI performs very poorly. Although KED-MI can slightly improve the at- tack accuracy, it cannot reconstruct the private images of the digit "3" well, as shown in Fig. 6. In contrast, our method re- duces interference between different classes, thus allowing private images to be reconstructed with good visual quality on each class. Similar visual comparisons on CIFAR-10 are also shown in Fig. 7. Our method not only significantly out- performs GMI and KED-MI in terms of image realism, but also recovers more accurate semantic information of private classes. It is difficult for GMI to reconstruct accurate private images, while KED-MI tends to reconstruct deceptive im- ages that can be classified by the target model but have few human-recognizable features. The results of ChestX-Ray are shown in Table 5. Com- pared to KED-MI, our method improves the attack accu- racy by an average of 12% under the two different public datasets. Meanwhile, the FID is even reduced from 109.41 to 47.51 when the public data is COVID19. We also provide the visual comparison of the private data reconstructed by KED-MI and our method, as shown in Fig. 8. MNIST CIFAR10 GMI KED-MI Ours GMI KED-MI Ours Attack Acc ↑ KNN Dist ↓ FID ↓ 137.53 116.47 77.68 198.18 141.18 83.43 .03±.0054 .29±.0228 .60±.0465 .11±.0173 .50±.0392 .76±.0318 171.18 78.67 38.33 38.50 15.49 5.11 Table 4: Attack performance comparison on MNIST and CI- FAR10. Table 5: Attack performance comparison with KED-MI on ChestX-Ray. Figure 7: CIFAR-10 samples reconstructed by the baselines and our method. quality of the generated images. Moreover, Dai et al. (Dai et al. 2017) theoretically analyzes that there is a trade-off between the quality of the discriminator and the generator. Obviously, this framework is not suitable for generative MI attacks, since what we need in stage-2 is a good and accurate generator, contrary to the goal of semi-supervised GAN. Rather than searching the latent vector of each recon- structed image as GMI and our method, KED-MI proposed to search for a distribution N (μ, σ2) with two learnable pa- rameters μ and σ2 for each target class, and the latent vectors can be obtained by randomly sampling from the learned dis- tribution. However, it is very difficult to learn an accurate class distribution by N (μ, σ2) when the inner-class distri- bution of the private dataset varies greatly (e.g., CIFAR-10). As a result, latent vectors sampled from such a distribution are far from the manifold of natural images, although the produced images may be close to private classes in feature space. Whereas we use a more powerful conditional GAN to model the distribution of each private class, making it pos- sible to handle more diverse datasets. In addition, we also perform random transformations on the generated images during the search process to further filter deceptive or ad- versarial samples. Analysis on the Failure of KED-MI. As mentioned in the main manuscript, the KED-MI adopts the semi-supervised GAN framework and uses the feature-matching loss to train the generator. However, as demonstrated in (Salimans et al. 2016), the feature-matching loss works better if the goal is to obtain a strong classifier (i.e., the discriminator) using the semi-supervised GAN, otherwise it reduces the visual A.3 Empirical Comparisons of Different Linv We note that a concurrent work (Struppek et al. 2022) also has a similar observation of the gradient vanishing problem when using cross-entropy loss in MI attacks. Inspired by (Li et al. 2020), they adopt a more complex poincar ́e loss as TargetKED-MIOursOursairplaneautomobilebirdcatdeerKED-MIGMI Figure 8: ChestX-Ray samples reconstructed by the baseline (KED-MI) and our method when using COVID19 as the public dataset. Each column represents one category of the 14 diseases. follows: LPoincar ́e = d(u, v) (cid:18) = arcosh 1 + 2(cid:107)u − v(cid:107)2 2 2) (1 − (cid:107)v(cid:107)2 2) (1 − (cid:107)u(cid:107)2 (cid:19) , (20) u = u (cid:107)u(cid:107)1 , v = max{v − ξ, 0}, where u is the logits normalized by the (cid:96)1 distance, and v is the one-hot encoded target vector with respect to the tar- get class. ξ = 10−5 is a small constant to ensure numerical stability. In the main manuscript, we theoretically compare the cross-entropy loss and the proposed max-margin loss. Here, we further empirically compare them with the additional poincar ́e loss mentioned in Eq. (20). Specifically, we take these three losses as Linv respectively in the iterative pro- cess of stage-2, and plot the trend curves of gradient values, loss values, and target logit values. Since the gradient values of different losses have a gap, we rescale the gradient val- ues by dividing (cid:107)g0(cid:107)1, where g0 is the gradient of the first iteration. The (cid:96)1 norm of the gradient (cid:107)gi(cid:107)1 represents its gradient value. Similarly, the loss values are also rescaled by dividing its value of the first iteration. We use FFHQ and CelebA as the public and private dataset, respectively. Then, we use VGG16 as the target model to attack the first 100 classes of CelebA and take their average results for plotting. From Fig. 9 (a), we can see that the gradient of the cross- entropy loss quickly decreases to 0 as the number of it- erations increases, indicating the existence of the gradient vanishing problem. Meanwhile, the max-margin loss main- tains a more stable gradient magnitude than the poincar ́e loss over the iterations, i.e., the degradation is more slight. In Fig. 9 (b), the value of the cross-entropy loss also quickly decreases to 0 due to the gradient vanishing, while the value of poincar ́e loss keeps almost unchanged, which may make it difficult to judge the optimization situation. In contrast, the max-margin loss can be minimized continuously over the iterations with relatively stable gradients. As shown in Fig. 9 (c), the max-margin loss can make the logit value of the target class steadily increase over the iterations to reach a higher value, while the cross-entropy loss and poincar ́e loss gradually tend to a relatively constant value in the later iterations. In addition, Fig. 10 shows the attack perfor- mance when using these three losses separately in stage-2 of our method, demonstrating that the max-margin loss outper- forms the other two losses, especially when there is a larger distributional shift between public and private data. A.4 More Discussions on the Concurrent Work Apart from the loss function, the other differences between our method and the concurrent work (Struppek et al. 2022) are three-fold. First, the motivations are different: we pro- pose to design a more powerful general MI attack frame- work, while they aim to omit the training process of stage- 1 to achieve plug-and-play. Second, based on the different goals, the technical contributions are different: we propose a Private DataKED-MIOurs Figure 9: (a)-(c) are the trend curves of the rescaled gradient values, the rescaled loss values, and the target logit values for different losses over the iterations, respectively. Figure 10: Comparison of attack performance when using different losses in the image reconstruction stage. top-n selection strategy and aim to train a class-independent generator to search private images more accurately, while they focus on extending the reconstruction process in stage- 2 to reduce the dependence on the trained generator. Third, the application scenarios are different: what we propose is a general attack method that can be applied to tasks trained on various sensitive data (e.g, disease diagnosis), while their method relies on the task of the publicly available pre- trained GAN and can not applicable for some unique tasks. Overall, our method differs from (Struppek et al. 2022) in terms of motivation, technical contributions, and application scenarios. (a)(b)(c)FaceScrubFFHQ0.00.20.40.60.8AttackAccLCELPoincar ́eLMax-Margin
http://arxiv.org/abs/2302.09813v1
2023-02-20T07:29:22
2023-02-20T07:29:22
Audit to Forget: A Unified Method to Revoke Patients' Private Data in Intelligent Healthcare
Revoking personal private data is one of the basic human rights, which has already been sheltered by several privacy-preserving laws in many countries. However, with the development of data science, machine learning and deep learning techniques, this right is usually neglected or violated as more and more patients' data are being collected and used for model training, especially in intelligent healthcare, thus making intelligent healthcare a sector where technology must meet the law, regulations, and privacy principles to ensure that the innovation is for the common good. In order to secure patients' right to be forgotten, we proposed a novel solution by using auditing to guide the forgetting process, where auditing means determining whether a dataset has been used to train the model and forgetting requires the information of a query dataset to be forgotten from the target model. We unified these two tasks by introducing a new approach called knowledge purification. To implement our solution, we developed AFS, a unified open-source software, which is able to evaluate and revoke patients' private data from pre-trained deep learning models. We demonstrated the generality of AFS by applying it to four tasks on different datasets with various data sizes and architectures of deep learning networks. The software is publicly available at \url{https://github.com/JoshuaChou2018/AFS}.
[ "Juexiao Zhou", "Haoyang Li", "Xingyu Liao", "Bin Zhang", "Wenjia He", "Zhongxiao Li", "Longxi Zhou", "Xin Gao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09813v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09813v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CR" ]
3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 3 1 8 9 0 . 2 0 3 2 : v i X r a AFS 1 Audit to Forget: A Unified Method to Revoke Patients' Private Data in Intelligent Healthcare Juexiao Zhou1,2,#, Haoyang Li1,2,#, Xingyu Liao1,2, Bin Zhang1,2, Wenjia He1,2, Zhongxiao Li1,2, Longxi Zhou1,2, Xin Gao1,2,∗ Abstract-Revoking personal private data is one of the basic human rights, which has already been sheltered by several privacy-preserving laws in many countries. However, with the development of data science, machine learning and deep learning techniques, this right is usually neglected or violated as more and more patients' data are being collected and used for model training, especially in intelligent healthcare, thus making intelligent healthcare a sector where technology must meet the law, regulations, and privacy principles to ensure that the innovation is for the common good. In order to secure patients' right to be forgotten, we proposed a novel solution by using auditing to guide the forgetting process, where auditing means determining whether a dataset has been used to train the model and forgetting requires the information of a query dataset to be forgotten from the target model. We unified these two tasks by introducing a new approach called knowledge purification. To implement our solution, we developed AFS, a unified open-source software, which is able to evaluate and revoke patients' private data from pre-trained deep learning models. We demonstrated the generality of AFS by applying it to four tasks on different datasets with various data sizes and architectures of deep learning networks. The software is publicly available at https://github.com/JoshuaChou2018/AFS. Index Terms-Healthcare, Privacy, Deep learning, Machine unlearning, Knowledge purification. (cid:70) 1 INTRODUCTION R EVOKING personal private data is one of the basic human rights, which has already been sheltered by privacy-preserving regulations like The General Data Pro- tection Regulation (GDPR) [1], The Health Insurance Porta- bility and Accountability Act of 1996 (HIPAA) [2], and the California Consumer Privacy Act [3] since 20th century. With those regulations, users are allowed to request the deletion of their own data for privacy concerns and to secure their own 'right to be forgotten'. However, with the develop- ment of data science, machine learning (ML) and deep learn- ing (DL) techniques, this basic right is usually neglected or violated. For example, it has been observed that patients' genetic markers were leaked from ML methods for genetic data processing [4], [5] while the patients were unaware of that. When users realize the existence of such risks, they may request their own data to be deleted to protect their privacy [6]. Meanwhile, those aforementioned regulations will force involved third parties to take actions immediately. According to the requirements of those regulations, not only the previously authorized data by individuals need to be deleted immediately from hosts' storage systems but also 1Computer Science Program, Computer, Electrical and Mathematical Sciences and Engineering Division, King Abdullah University of Science and Technol- ogy (KAUST), Thuwal 23955-6900, Kingdom of Saudi Arabia 2Computational Bioscience Research Center, King Abdullah University of Science and Technology, Thuwal 23955-6900, Kingdom of Saudi Arabia ∗Corresponding author #Equal contribution the associated information should be removed from DL models trained with those data, because DL models could memorize sensitive information of training data and thus expose individual's privacy under risk [7], [8], [9], [10], [11]. Nowadays, healthcare is one of the most promising areas for the deployment of artificial intelligent (AI) systems as so- called intelligent healthcare. ML and DL-based computer- aided diagnosis (CAD) systems in intelligent healthcare accelerate the diagnosis of various diseases and achieve even better results than doctors, such as tumour detection [12], [13], retinal fundus imaging [14], detection and seg- mentation of COVID-19 lung infections [15], [16] and so on. However, as more and more patients' data are being col- lected and used for model training in intelligent healthcare, their privacy is exposed to high risk. Therefore, intelligent healthcare is a sector where technology must meet the law, regulations, and privacy principles to ensure that the innovation is for the common good [17]. To obey those privacy-preserving regulations, methods to revoke personal private data from pre-trained DL models are necessary. Deleting the stored personal data is simple, whereas forgetting individuals' private information from pre-trained DL models could be difficult as we could not fully measure the contribution of individual data on the training process of DL models due to the stochasticity of training [18]. Besides, due to the incremental nature of training, the model update brought by one sample would affect the model performance AFS 2 on samples followed, thus making it difficult to unlearn [18]. Finally, catastrophic unlearning might happen and the unlearned model will perform worse than the model retrained on the remaining dataset [19]. In general, the process to forget data from a pre-trained DL model could be divided into two steps. Firstly, the unlearning process (forgetting) is performed on a given pre- trained DL model to forget the target data with different techniques and a new DL model will be generated. Secondly, an evaluation of the new model (auditing) against different metrics will be performed to prove that the model has forgotten the target data. These two processes should be repeated until the new model passes the evaluation. In sim- ple terms, there are two commonly acknowledged sub-tasks, which could also be stated in the reverse order: auditing and forgetting, as a two-player game. Auditing requires auditors to precisely evaluate whether the data of certain patients were used to train the target DL model. Once the data of certain patients is confirmed to be used to train the target DL model by auditing, forgetting requires the removal of learnt information of certain patients' data from the target DL model, which is also called machine unlearning, while auditing could act as the verification of machine unlearning [18] In order to achieve forgetting, existing unlearning meth- ods could be classified into three major classes, includ- ing model-agnostic methods, model-intrinsic methods and data-driven methods [20]. Model-agnostic methods refer to algorithms or frameworks that can be used for different DL models, including differential privacy [18], [21], [22], certi- fied removal [23], [24], [25], statistical query learning [6], decremental learning [26], knowledge adaptation [27], [28] and parameter sampling [29]. Model-intrinsic approaches are those methods designed for specific types of models, such as for softmax classifiers [30], linear models [31], tree- based models [32] and Bayesian models [19]. Data-driven approaches focus on the data itself, including data parti- tioning [18], data augmentation [33], [34], [35] and other unlearning strategies based on data influence [36]. All meth- ods have their specific application scenarios and limitations. Among the three methods, model-agnostic methods might have the strongest application prospects, as they can be applied to different models. Still, more mechanisms and theoretical concepts are being proposed to explore different solutions to the forgetting task but few of them focused on the application in real-world intelligent healthcare. When forgetting is accomplished, auditing is the next necessary step to verify it. Different metrics have been proposed to audit the membership of the query dataset, including accuracy, completeness [6], unlearn time, relearn time, retrain time, layer-wise distance, activation distance, JS-divergence, membership inference [37], [38], ZRF score [27], epistemic uncertainty [39] and model inversion attack [7]. In recent studies, membership inference-based metrics were frequently utilized to determine whether or not any information about the samples to be forgotten was retained in the model in intelligent healthcare [38]. A black-box set- ting was shared by the membership inference attack (MIA) to calculate the probability of a single datapoint being a member of the training dataset D. Based on this individual level MIA, Liu et al. [37] and Yangsibo et al. [38] focused on a more challenging task: audit the membership of a set of data points. The ensembled membership auditing (EMA) [38] was proposed as the state-of-the-art method to verify whether a query dataset is memorized by a pre-trained DL model, which is also a benchmark metric in machine unlearning. However, due to the black box property of DL models, efficient and accurate auditing is still challenging and an under-studied topic. Moreover, researchers have tended to treat auditing and forgetting as separate tasks, ignoring the fact that the two can be linked up associatively to work as a self-consistent mechanism. Here, we proposed a novel solution by using auditing to guide the forgetting process in a negative feedback man- ner. We unified the two tasks by introducing knowledge purification (KP), a new approach to selectively transfer the needed knowledge to forget the target information instead of simply transferring all information like knowledge distil- lation (KD) [40]. On the basis of KP, we have developed a user-friendly and open-source method called AFS, which can be easily used to revoke patients' private data from DL models in intelligent healthcare. To demonstrate the generality of AFS, we applied it to four tasks based on four datasets, including the MNIST dataset, the PathMNIST dataset, the COVIDx dataset and the ASD dataset, with dif- ferent data sizes and various architectures of deep learning networks. Our results demonstrate the usability of AFS and its application potential in real-world intelligent healthcare. 2 METHODS 2.1 The overall framework of AFS AFS is a novel and unified method to revoke patients' pri- vate data by using auditing to guide the forgetting process in a negative feedback manner (Figure 1). To audit the membership of the query dataset, AFS takes a pre-trained DL model and the query dataset as inputs, and determines whether the query dataset has been used for training the target DL model. This function was re- implemented based on EMA [38], a published MIA-based method to evaluate the membership of a query dataset. AFS 3 Fig. 1. AFS is a unified method to revoke patients' private data in intelligent healthcare. Given a pre-trained DL model and a query dataset, AFS could audit and provide confidence whether the query dataset has been used to train the target DL model. When a dataset has been used to train the target DL model, AFS could effectively remove the information about the dataset from the target DL model with the guidance of auditing. To achieve that, we proposed a novel method called knowledge purification, which utilizes results from auditing as feedback to forget information. is to transfer the information of the remaining dataset except for the query dataset from the pre-trained model to a new model. Therefore, we designed a novel mechanism called knowledge purification (KP) by using auditing to guide the forgetting process to exclude the information of the query dataset while transferring the remaining information by incorporating the auditing loss into the training process (Figure 2). With KP integrated, AFS could generate a new model, in which the information of the target dataset should be forgotten under the guidance of auditing (Section 2.5). To provide an applicable solution, we implemented AFS as open-source software that provides a user-friendly entry point allowing users to use both functions with only one command. To demonstrate the generality of AFS, we applied it to four tasks based on four datasets, including the MNIST dataset, the PathMNIST dataset, the COVIDx dataset and the ASD dataset, which have different data sizes (Figure 3 and Section 2.2) and various architectures of deep learning networks (Section 2.3). 2.2 Dataset preparation We used four public datasets that were commonly acknowl- edged in the machine learning and intelligent healthcare field to demonstrate the versatility of AFS. For the bench- mark experiment, we applied AFS on MNIST [41] and PathMNIST [42] from the MedMNIST [43] dataset. The MNIST dataset contains 60,000 training images and 10,000 testing images of handwritten digits with size 28×28 and labelled from 0 to 9. PathMNIST contains 100,000 nonover- lapping image patches from hematoxylin & eosin stained histological images and 7,180 image patches from different clinical centres. In total, 9 types of tissues are involved in the PathMNIST dataset, including adipose, background, debris, lymphocytes, mucus, smooth muscle, normal colon mucosa, cancer-associated stroma, and COAD epithelium. Fig. 2. Illustration of knowledge distillation and knowledge purification. Knowledge purification requires the selective transfer of the needed knowledge in the process of knowledge distillation to forget the target information instead of simply transferring all information. Fig. 3. Illustration of four datasets and DL models used to show the versatility of AFS. Our re-implementation allows quicker and easier usage of auditing (Section 2.4). To forget the query dataset from a DL model, AFS takes the pre-trained DL model and the query dataset to be for- gotten as inputs, in which the query dataset has been used to train the DL model. To effectively forget the information of the query dataset from the pre-trained DL model, an idea AFS 4 All images in PathMNIST were 224 × 224 (0.5 μm/px) and were normalized with the Macenko method [44]. For the application of AFS in intelligent healthcare, we used the COVIDx [45] dataset, which contains 13,975 chest X-ray (CXR) images across 13,870 patient cases, and the Autism spectrum disorder (ASD) dataset for toddlers [46], which contains 20 features of 1,054 samples to be utilized for determining influential autistic traits and improving the classification of ASD cases. For each dataset, we further sampled partial data as the training dataset, the testing dataset, and the calibration dataset as below: MNIST. We randomly sampled 10,000 images as the training dataset and 10,000 images as the testing dataset. We also randomly sampled 100, 1,000, 2,000, and 5,000 images that are disjoint with the training dataset as four calibration datasets to illustrate the effect of the calibration dataset of varied sizes on auditing and forgetting. PathMNIST. We randomly sampled 10,000 images as the training dataset and 5,000 images as the testing dataset. We also randomly sampled 1,000 images that are disjoint with the training dataset as the calibration dataset. COVIDx. We randomly sampled 5,000 images as the training dataset and 1,000 images as the testing dataset. We also randomly sampled 1,000 images that are disjoint with the training dataset as the calibration dataset. ASD. We randomly sampled 500 images as the training dataset and 100 images as the testing dataset. We also randomly sampled 100 images that are disjoint with the training dataset as the calibration dataset. For all four datasets, we randomly sampled partial data from the training dataset with percentage k from {0.25, 0.5, 0.75} as the training dataset for knowledge distillation (KD) and AFS. In addition, we prepared query datasets with different sizes N from {1, 10, 100, 500, 1000, 2000}. A query dataset that completely overlapped with the training dataset is labelled as QO, while the query dataset that is completely disjoint with the training dataset is labelled QNO. To further understand the effect of the purity of the query dataset, we also prepared the query dataset called QM with a k percentage of the query dataset to be overlapped with the training dataset. Finally, for the query dataset designed to be forgotten, we labelled it as QF. 2.3 Deep learning models and experiment setup To present the generalizability of AFS towards various DL models, we adopted different architectures for each of the four tasks, including the multilayer perception [47] (MLP), the convolutional neural network (CNN) [48] and ResNet [49]. There were a large DL model and a small DL model for each task, where the large model refers to the original pre-trained model and the small model is the new model generated by AFS. For the MNIST dataset, we used MLP with 671,754 parameters as the teacher model and 155,658 parameters as the student model to achieve the 10-class classification task. For the PathMNIST dataset, we adopted CNN with 21,285,698 parameters as the teacher model and 11,177,538 parameters as the student network for the 9-class classifica- tion task. For the COVIDx dataset, we took ResNet34 with 21,285,698 parameters as the teacher model and ResNet18 with 11,177,538 parameters as the student network to achieve the binary classification of healthy people and pa- tients. For the ASD dataset, we used the MLP with 3,586 param- eters as the teacher model and the MLP with 898 parameters as the student model for the binary classification of autism in toddlers. During model training, the number of epochs was fixed to 50, the learning rate was set to 1e–5 and the Adam optimizer was used. A workstation with 252 GB RAM, 112 CPU cores and 2 Nvidia V100 GPUs were adopted for all experiments. The AFS method was developed based on Python3.7, PyTorch1.9.1 and CUDA11.4. A detailed list of dependencies could be found in our code availability. 2.4 Audit the membership of query dataset EMA [35] is designed as a 2-step process. In the first step, the best threshold for each metric is selected to optimize (T P R(t) + T N R(t))/2 based on the calibration dataset as shown in Algorithm 1. Once the thresholds for all metrics are selected, the membership of each sample in the query dataset will be confirmed as at least one metric is larger than the corresponding threshold. In total, three metrics, in- cluding correctness [50], confidence [51], [52], and negative entropy [53], [54], were adopted in AFS as proposed in the previous work [38], [55]. Once the membership of all samples in the query dataset is confirmed in the previous step, the query dataset will be further evaluated to determine whether the query dataset has been used to train the target pre-trained DL model. A two-sample statistical test is adopted to evaluate the query dataset based on the sample-wise membership and an all- one vector. The p-value of the two-sample statistical test is used as the output of auditing. Given a user-defined threshold α, if p < α, then users could conclude that the query dataset was not used for training the target DL model. EMA was re-implemented and integrated into AFS to allow easy and fast auditing. AFS 5 Algorithm 1. Infer thresholds Require: The calibration dataset Dcal, the pre-trained DL model A and n different metrics (m1, ..., mn) for mem- bership testing. 1: procedure Algorithm 2. AFS Require: The calibration dataset Dcal, the query dataset to forget Df orget, the sampled training dataset Dtrain for KP, the pre-trained DL model F , the new model f , and number of epochs T . Split Dcal dataset Dtest cal into training dataset Dtrain cal and test 1: procedure 2: 3: 4: 5: 6: 7: The calibration model is trained as fDcal ← ) A(Dtrain cal for mi ∈ {m1, ..., mn} do Compute metrics Mtrain ← {mi(fDcal,s|s ∈ Dtrain for cal training dataset )} as Compute metrics for test dataset as Mtest ← {mi(fDcal,s|s ∈ Dtest cal )} Find ti ∈ argmaxt∈[Mtrain,Mtest]( T P R(t)+T N R(t) ), | and where T P R(t) = (cid:80) T N R(t) = (cid:80) return The thresholds t1, ..., tn for n metrics 1{mi(s) ≥ t}/|Dtrain s∈Dtrain cal 1{mi(s) ≥ t}/|Dtest cal | s∈Dtest cal cal 2 2.5 Audit-guided forgetting of query dataset with AFS Forgetting aims to remove the remembered information of the query dataset from the target DL model. Similar to knowledge distillation (KD), a teacher-student paradigm was also adopted in AFS, but with an additional require- ment to selectively forget information associated with the data we want to forget. Thus, we designed a novel approach called knowledge purification (KP), meaning purifying the knowledge in the teacher model (the original pre-trained model), discarding the information related to the data that needed to be forgotten and transferring the purified infor- mation into the student model (the new model). AFS unified auditing and forgetting into a circular process to effectively enhance the unlearning in a negative feedback manner. As shown in Figure 1, during each epoch of training, the training data will be fed into both the teacher model and the student model, while the data to be forgotten will be audited on the student model. Our main goal is to transfer the knowledge from the teacher model to the student model while forcing the student model to reject the information associated with data to be forgotten. In order to achieve that, we added the audit loss into the total loss, thus allowing the student model to accept partial knowledge from the teacher model and achieve KP as shown in Algorithm 2. 2.6 Evaluation metrices Since all four tasks are either multi-classes classification tasks or binary classification tasks, we adopted the accuracy and F1-score as the evaluation metrics as below, 2: 3: 4: 5: 6: 7: for epoch ∈ {1, ..., T } do Forward Dtrain with F Forward Dtrain with f Infer threshold with Dcal on f and audit Df orget on f to get lossaudit Calculate lossAF S = lossclassif ication+lossKD + lossaudit Update f based on lossAF S return The new student model f with information about Df orget forgotten. F 1 − score = 2T P 2T P + F P + F N (2) where TP represents true positives, TN stands for true negatives, FN represents false negatives and FP stands for false positives. To evaluate the membership of the query dataset, the p-value of the two-sample statistical test was used as men- tioned previously. 3 RESULTS 3.1 AFS audits private datasets stably and robustly To evaluate the robustness of auditing by AFS, we used it to audit query datasets with different sizes, various purity (k percent of the query dataset was overlapped with the training dataset) and the different sizes of calibration dataset (the size ranged from 100 to 5000) (Method and Figure 4A). For each sample in the query dataset, AFS calculates three metrics for the membership inference, including correctness, confidence and negative entropy (Method). As shown in Figure 4B, all three metrics showed different distributions for QO (query dataset overlapped with the training dataset) and QNO (query dataset disjoint with the training dataset), indicating the dataset-wise divergence of metrics between samples in the training dataset and samples disjoint with the training dataset. Finally, by integrating these three metrics, AFS predicts a p-value to evaluate whether or not a query dataset has been used to train the target DL model. The large p-values indicate the higher probability that the query dataset was used in training. Accuracy = T P + T N T P + T N + F P + F N When the size of the query dataset and the calibration dataset varied, AFS could still efficiently distinguish QO (1) AFS 6 Fig. 4. Performance of auditing using AFS on the four datasets. A. Demonstration of the training dataset, the test dataset, the calibration dataset, and the query dataset overlapped with the training dataset (QO) and the query dataset disjointed with the training dataset (QNO). B. Distribution of three metrics for samples in QO and QNO. C. The performance of auditing when varying the size of the calibration dataset and the size of the query dataset. D. The p-value of auditing on QO and QNO of four datasets. E. The p-value of auditing when varying k of the query dataset of four datasets. and QNO (Figure 4C and D). Compared to QO, AFS re- ported a much smaller p-value for QNO, indicating a weak membership (a small probability that the query dataset has been used to train the target DL model), thus allowing users to judge whether the query dataset was used to train the target DL model. Meanwhile, when the size of the dataset increased from 1 to 2000, AFS discriminated QO and QNO more confidently as there was a more significant divergence of the p-values, which was not affected by the size of the calibration dataset. To further understand the effect of the purity of the query dataset in auditing, we mixed some samples from the training dataset to QNO, thus the new query dataset was labelled as QM (partial data overlapped with the training dataset). The percentage of data over- lapped with the training dataset in QM was denoted by size of QM k = number of data overlapped with training dataset . As shown in Figure 4E, AFS showed a decreasing p-value trend when k decreased, meaning that the query dataset was less likely to be used to train the target DL model. In conclusion, these results indicate the robustness of AFS in determining whether the query data has been used to train the target DL model. 3.2 AFS forgets the information of query dataset, main- tains perfect usability and generates smaller model Once the prior knowledge that a dataset has been used to train the target DL model is confirmed with auditing, AFS could be used for forgetting, to remove the information of the dataset from the pre-trained DL model. To com- prehensively show the ability of AFS in removing infor- AFS 7 TABLE 1 Comparison of AFS with other methods on auditing QO and QNO from the MNIST dataset with a varied number of samples in the query dataset. The data in the table shows the results of auditing QO and QNO on models trained by different methods. A larger value indicates stronger membership. Methods Independent teacher Independent student Independent student (k=0.75) AFS w/o Audit (k=0.75) AFS (k=0.75) Independent student (k=0.5) AFS w/o Audit (k=0.5) AFS (k=0.5) Independent student (k=0.25) AFS w/o Audit (k=0.25) AFS (k=0.25) 1 1 1 1 1 1 1 1 1 1 1 1 10 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8.64e-01 8.64e-01 1 1 1 1 1 QO 500 1 3.43e-01 6.80e-01 8.64e-01 1 5.59e-01 8.64e-01 8.64e-01 8.64e-01 1 1 1000 2000 1 4.22e-01 1.67e-01 5.91e-01 8.64e-01 2.39e-01 8.64e-01 1 8.64e-01 1 1 1 8.61e-02 7.87e-02 5.26e-01 4.54e-01 2.49e-02 8.64e-01 7.27e-01 3.17e-01 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 100 7.32e-01 6.96e-01 5.27e-01 5.98e-01 6.96e-01 8.13e-01 5.98e-01 6.68e-01 5.98e-01 5.27e-01 6.96e-01 7.39e-02 4.50e-02 2.28e-02 1.02e-01 2.94e-02 7.75e-02 1.32e-01 2.88e-02 1.04e-02 4.47e-02 8.52e-03 QNO 500 2.43e-05 2.74e-06 7.50e-07 6.49e-06 1.45e-06 6.44e-08 5.94e-06 9.25e-07 6.40e-10 7.49e-07 3.85e-10 1000 2000 1.06e-08 4.51e-11 4.61e-14 4.15e-11 9.06e-13 1.63e-15 2.43e-12 3.70e-13 3.05e-20 2.18e-13 1.98e-20 4.68e-18 8.58e-22 3.10e-27 1.28e-20 3.79e-24 4.15e-30 5.73e-23 3.10e-27 1.22e-38 5.96e-28 1.29e-41 TABLE 2 Comparison of AFS with other methods on forgetting QF and model performance with the MNIST dataset. QF100 is the small query dataset containing 100 samples and QF1000 is the large query dataset containing 1000 samples. We present the p-values of auditing models trained with different methods on QF100 and QF1000 and the model performance including the accuracy and F1-score. Methods QF100 QF1000 Accuracy F1-score Independent teacher Independent student Independent student (k=0.75) AFS w/o Audit (k=0.75) AFS (k=0.75) Independent student (k=0.5) AFS w/o Audit (k=0.5) AFS (k=0.5) Independent student (k=0.25) AFS w/o Audit (k=0.25) AFS (k=0.25) 1 1 4.36e-02 3.19e-01 1.08e-03 6.91e-03 1.57e-01 1.27e-02 6.91e-03 1.57e-01 5.79e-04 1 1 5.26e-12 1.33e-06 5.22e-23 2.34e-15 7.79e-07 9.44e-22 2.90e-19 7.04e-10 6.84e-33 0.9622 0.9504 0.9458 0.9582 0.9470 0.9282 0.9526 0.9380 0.9067 0.9388 0.9174 0.9911 0.9911 0.9880 0.9884 0.9889 0.9848 0.9884 0.9866 0.9875 0.9875 0.9853 mation against the model performance, we compared five methods, including 1) training the teacher model with a complete training dataset (Independent teacher), 2) retrain- ing the student model with a complete training dataset (Independent student), 3) retraining the student model with k ∈ {0.25, 0.5, 0.75} percentage of the complete training dataset excluding the data to be forgotten (Independent Stu- dent with k ∈ {0.25, 0.5, 0.75}), 4) AFS, and 5) training the student model with AFS without the guidance of auditing (AFS w/o Audit), as an ablation study of AFS (Section 2.5). Both AFS w/o Audit and AFS were also conducted with varied k ∈ {0.25, 0.5, 0.75}. For both Independent teacher and Independent student methods trained with the com- plete training dataset, QF100 and QF1000 were included in the training dataset, while these two query datasets were ex- cluded from the training dataset when k ∈ {0.25, 0.5, 0.75}. Taking the MNIST dataset as an example, for models trained with each method, except for auditing on QO and QNO, we further audited the membership of two datasets designed to be forgotten (a small query dataset QF100 and a large query dataset QF1000) to assess the ability of different methods in forgetting the query dataset. As shown in Table 1, regardless of the model trained based on which method, AFS could effectively distinguish between QO and QNO, and the divergence in auditing two query datasets was enlarged as the size of the query dataset increased. As shown in Table 2, AFS perfectly predicted the mem- bership of QF100 and QF1000 on both models from In- dependent teacher and Independent student methods as both query datasets were included in the training dataset. Since both query datasets were disjoint with the partial training dataset when k ∈ {0.25, 0.5, 0.75}, thus audit- ing on the model trained with Independent student with k ∈ {0.25, 0.5, 0.75} weakly denied the membership of QF100 (PQF 100,k=0.75 = 4.36E–2, PQF 100,k=0.5 = 6.91E–3, PQF 100,k=0.25 = 6.91E–3) and QF1000 (PQF 1000,k=0.75 = 5.26E–12, PQF 1000,k=0.5 = 2.34E–15, PQF 1000,k=0.25 = 2.90E–19). However, since only the partial training dataset AFS 8 TABLE 3 Comparison of AFS with other methods on auditing QO and QNO from the PathMNIST dataset with a varied number of samples in the query dataset. The data in the table shows the results of auditing QO and QNO on models trained by different methods. A larger value indicates stronger membership. Methods Independent teacher Independent student Independent student (k=0.75) AFS w/o Audit (k=0.75) AFS (k=0.75) Independent student (k=0.5) AFS w/o Audit (k=0.5) AFS (k=0.5) Independent student (k=0.25) AFS w/o Audit (k=0.25) AFS (k=0.25) 1 1 1 1 1 1 1 1 1 1 1 1 10 100 1 1 1 1 1 8.66e-01 1 1 1 8.66e-01 8.66e-01 1 1 1 5.26e-01 3.90e-01 1 5.11e-01 1.59e-01 8.64e-01 2.39e-01 1.40e-01 QO 500 1 1 1 1.78e-01 3.21e-02 8.64e-01 2.48e-01 3.45e-04 6.95e-01 3.37e-03 2.71e-03 1000 2000 1 1 1 2.54e-02 6.13e-04 8.64e-01 1.24e-02 4.06e-06 1.60e-01 1.01e-05 1.07e-06 1 1 1 1.17e-03 7.19e-06 5.58e-01 9.59e-04 1.85e-10 4.54e-02 9.15e-10 1.63e-12 1 1 1 1 1 1 1 1 1 1 1 1 10 100 4.29e-01 5.27e-01 7.32e-01 2.95e-01 4.98e-01 5.62e-01 6.26e-01 2.69e-01 1.26e-01 2.42e-01 4.37e-01 6.29e-03 5.11e-03 1.89e-02 2.26e-02 2.34e-04 4.02e-03 1.18e-02 9.17e-05 1.24e-06 3.64e-05 7.07e-06 QNO 500 1.40e-13 1.29e-10 1.55e-08 9.23e-11 4.25e-16 3.01e-10 2.99e-11 2.98e-16 2.30e-31 2.55e-24 2.01e-27 1000 2000 4.91e-28 3.38e-20 5.74e-16 1.04e-19 3.95e-31 1.91e-21 4.03e-21 3.84e-30 2.88e-60 3.01e-43 4.45e-53 1.88e-60 7.24e-42 1.92e-30 8.21e-41 4.89e-65 7.85e-40 2.51e-40 1.04e-62 4.73e-109 1.37e-90 1.71e-101 TABLE 4 Comparison of AFS with other methods on forgetting QF and model performance with the PathMNIST dataset. QF100 is the small query dataset containing 100 samples and QF1000 is the large query dataset containing 1000 samples. We present the p-values of auditing models trained with different methods on QF100 and QF1000 and the model performance including the accuracy and F1-score. Methods QF100 QF1000 Accuracy F1-score Independent teacher Independent student Independent student (k=0.75) AFS w/o Audit (k=0.75) AFS (k=0.75) Independent student (k=0.5) AFS w/o Audit (k=0.5) AFS (k=0.5) Independent student (k=0.25) AFS w/o Audit (k=0.25) AFS (k=0.25) 1 1 2.35e-02 1.08e-03 2.25e-05 6.91e-03 3.74e-03 2.87e-06 1.58e-07 3.32e-07 3.32e-07 1 1 4.08e-15 1.67e-22 2.05e-41 2.99e-21 4.93e-18 4.75e-35 9.05e-57 2.05e-41 1.84e-56 0.8538 0.8446 0.8396 0.8682 0.8560 0.7934 0.8494 0.8242 0.7582 0.7842 0.7810 0.9885 0.9836 0.9555 0.9777 0.9605 0.9533 0.9697 0.9575 0.9287 0.9406 0.9385 was used when k ∈ {0.25, 0.5, 0.75}, the retrained models with Independent student only learnt the information of the partial training dataset and lost the information from the re- maining data in the complete training dataset, thus resulting in the significant drop of model performance compared to either the Independent student or the Independent teacher trained with the complete training dataset. To rescue the information lost due to the usage of partial training samples and further increase the model performance, AFS could use only a partial training dataset (k ∈ {0.25, 0.5, 0.75}) to transfer the knowledge from the Independent teacher pre-trained with the complete training dataset. As shown in Table 2, the model trained with AFS provided higher accuracy and F1-score compared to the Independent student trained with partial training dataset (k ∈ {0.25, 0.5, 0.75}) and together with a better forgetting performance (much smaller auditing score on QF100 and QF1000), as AFS used auditing as feedback for forgetting and could forget not only the query samples but also other samples with similar features. We also applied AFS on the 9-classes classification of hematoxylin & eosin-stained histological images from the PathMNIST dataset with CNN. As shown in Table 3, AFS could still distinguish QO and QNO from the PathMNIST dataset. The divergence of auditing between QO and QNO was more significant than that on the MNIST dataset. With the requirement to forget both query datasets (QF100 and QF1000), the model trained with AFS outperformed on forgetting information (PQF 100,k=0.75 = 2.25E–5, PQF 100,k=0.5 = 2.87E–6, PQF 100,k=0.25 = 3.32E–7), PQF 1000,k=0.75 = 2.05E–41, PQF 1000,k=0.5 = 4.75E–35, PQF 1000,k=0.25 = 1.84E–56) while learnt more information from the Independent teacher model trained with a com- plete training dataset. In summary, AFS could effectively forget the information of the query dataset from the target DL model. Since KP was integrated into AFS, it could generate a smaller DL model, which masters knowledge from the larger teacher AFS 9 Fig. 5. Performance of forgetting using AFS on four datasets. A. The p-value of auditing on a small query dataset and a large query dataset (QF) and the accuracy of models trained with different methods, including Original (Independent teacher trained with the complete training dataset), Data Deletion (the Independent student model trained with partial training dataset and k = 0.5), AFS (w/o Audit) and AFS. B. The number of parameters for the original large model and the new small model generated by AFS. C. The qualitative evaluation of three methods, including Original (Independent teacher trained with the complete training dataset), Data Deletion (the Independent student model trained with partial training dataset and k = 0.5), and AFS on five dimensions (Ability to forget, accuracy, size of dataset needed for training, size of the generated model and the efficiency of training). A larger value means a stronger ability to forget, higher model accuracy, a smaller size of dataset needed for training, a smaller size of the generated model, and better efficiency of training. model by using only a partial training dataset (k = 0.5 could achieve a good balance between forgetting and model performance), without the need to retrain the larger model with the complete training dataset. Compared to retraining the student model, the model trained with AFS showed even better performance in forgetting the information while maintaining better model performance (accuracy and F1- score) as it learnt the knowledge from the model trained with the complete training dataset. As shown by the abla- tion study in Tables 2 and 4, compared to AFS w/o Audit, the audit-guided AFS could forget the information more significantly but with an acceptable cost in decreasing the model performance (accuracy and f1-score). medical image analysis. As shown in Figure 5A, on both query datasets (QF100 and QF1000), AFS could effectively forget the information of the query dataset, while generating the new model with much less number of parameters as shown in Figure 5B. Surprisingly, the model generated by AFS showed even better accuracy than the Independent teacher trained with the complete dataset and the Indepen- dent student trained with the partial training dataset. This result not only indicated that AFS could effectively transfer the knowledge from the teacher model to the student model but also suggested that the student model with simpler ar- chitecture could even perform better than the teacher model with KP in AFS due to the reduction of model parameters and purification of knowledge in some real-world cases. 3.3 Apply AFS to forget medical images To show the versatility of AFS, we applied it to the classifica- tion of pneumonia and normal with chest X-ray images from the COVIDx dataset with ResNet, which is a classic task in 3.4 Apply AFS to forget electrical health records To further prove the generalizability of AFS in both the auditing and forgetting, we applied AFS to predicting AFS 10 early autism spectrum disorder (ASD) traits of toddlers, which contains sensitive information about patients, such as the age, gender and the family gene trait. That infor- mation was stored as electrical health records (EHR). As shown in Figure 5A, similar to previous results on other datasets, AFS effectively removed the information of both query datasets from the pre-trained DL model. Since the size of the ASD dataset was quite small, we adopted two smaller query datasets (QF50 and QF100) to be forgotten. Compared to the models trained with other methods, the model trained with AFS successfully forgot the information of both QF50 (PQF50,k=0.75 = 0.08, PQF50,k=0.55 = 0.08, PQF50,k=0.25 = 0.156) and QF100 (PQF100,k=0.75 = 0.004, PQF100,k=0.55 = 0.007, PQF100,k=0.25 = 0.007) without affecting the model utility significantly (AccAF S,k=0.75 = 0.98, AccAF S,k=0.5 = 0.98, AccAF S,k=0.25 = 0.98). TABLE 5 Time for inferring 100 samples with the original model and the model generated by AFS. Dataset Original model New model generated by AFS MNIST PathMNIST COVIDx Autism 439 μs ± 1.54 μs 5.13 ms ± 22 μs 1.27 s ± 500 ms 126 μs ± 177 ns 284 μs ± 447 ns 4.99 ms ± 14.1 μs 661 ms ± 9.98 ms 87.3 μs ± 120 ns TABLE 6 GPU memory (MB) for inferring 100 samples with the original model and the model generated by AFS. Dataset Original model New model generated by AFS MNIST PathMNIST COVIDx Autism 258 173 17,805 2 61 129 10,600 1 4 DISCUSSION To our knowledge, AFS is the first unified method of auditing and forgetting that could effectively forget the information of the target query dataset from the pre-trained DL model with the guidance of auditing. We designed AFS as a model-agnostic and open-source method that is applicable to different models. As shown in Figure 5C, AFS could generate a smaller model, which requires much less time and GPU memory during the inference (Tables 5 and 6), by training with a partial training dataset (∼50%) with our novel KP approach. Moreover, AFS could forget the information of the query dataset at the expense of an acceptable reduction in the model performance. Our experiments on four datasets showed that AFS was generalized for datasets of different sizes and forms, including medical images and EHR. Since deep learning models with different architectures were applied to four tasks, we further demonstrated the broad applicability of AFS to common deep learning models. In addition, our tasks include both binary classification and multiclassifica- tion tasks, which also suggested that AFS was applicable for tasks with multiple labels. With current laws that guarantee people the right to revoke their own data, AFS could help institutions and companies to efficiently iterate their models to forget indi- vidual information at the model level. However, there are still some shortcomings in the application of the current version of AFS in the production environment, which could be the main potential direction of research in the future. Firstly, the models and data we tested in this study were still not large enough compared to the data in the real production environment. Therefore, it is unknown whether scaling AFS to larger models and more data will cause new problems. Secondly, there are different approaches to audit, and thus we could add more metrics of auditing to AFS to guide the forgetting process in the future version. Finally, due to the limitation of auditing, it is still difficult to perform individual-level forgetting, as we need to compare the difference in statistical distribution based on a fraction of data points, which could be the major possible improvement for the future version of AFS. Despite these limitations, we believe that AFS will make a valuable contribution towards better protection of people's privacy and the right to revoke the data with the rapid development of intelligent healthcare. 5 DATA AVAILABILITY All four datasets used in this work are publicly avail- able. The MNIST dataset could be found at http: //yann.lecun.com/exdb/mnist/. The PathMNIST dataset is available at https://medmnist.com/. The COVIDx dataset is stored at https://www.kaggle.com/datasets/ andyczhao/covidx-cxr2?select=competition test. The ASD dataset can be accessed at https://www.kaggle.com/ datasets/fabdelja/autism-screening-for-toddlers. 6 CODE AVAILABILITY The AFS software is publicly available at https://github. com/JoshuaChou2018/AFS 7 CREDIT AUTHOR STATEMENT Conceptualization: J.Z. and X.G. Design: J.Z. and X.G. Data analysis and interpretation: J.Z., H.L. and W.H. Code implementation: J.Z. and H.L. Application: J.Z, H.L, X.L, AFS 11 B.Z. Code improvement: Z.L and L.Z. Drafting of the manuscript: J.Z and H.L. Critical revision of the manuscript for important intellectual content: J.Z., X.L and B.Z. Super- vision: J.Z. and X.G. Funding acquisition: X.G. 8 ACKNOWLEDGEMENTS Juexiao Zhou, Haoyang Li, Xingyu Liao, Bin Zhang, Wen- jia He, Zhongxiao Li, Longxi Zhou and Xin Gao were supported in part by grants from the Office of Research Administration (ORA) at King Abdullah University of Science and Technology (KAUST) under award number FCC/1/1976-44-01, FCC/1/1976-45-01, REI/1/5202-01-01, REI/1/5234-01-01, REI/1/4940-01-01, RGC/3/4816-01-01, and REI/1/0018-01-01. Xingyu Liao was also supported in part by grants from the National Natural Science Foundation of China under grant number No.62002388. 9 COMPETING INTERESTS The authors have declared no competing interests. REFERENCES [1] P. Voigt and A. Von dem Bussche, "The eu general data protec- tion regulation (gdpr)," A Practical Guide, 1st Ed., Cham: Springer International Publishing, vol. 10, no. 3152676, pp. 10–5555, 2017. [2] A. Act, "Health insurance portability and accountability act of [3] 1996," Public law, vol. 104, p. 191, 1996. S. L. Pardau, "The california consumer privacy act: Towards a european-style privacy regime in the united states," J. Tech. L. & Pol'y, vol. 23, p. 68, 2018. [4] R. Wang, Y. F. Li, X. Wang, H. Tang, and X. Zhou, "Learning your identity and disease from research papers: information leaks in genome wide association study," in Proceedings of the 16th ACM conference on Computer and communications security, 2009, pp. 534– 544. [5] M. Fredrikson, E. Lantz, S. Jha, S. Lin, D. Page, and T. Ristenpart, "Privacy in pharmacogenetics: An {End-to-End} case study of personalized warfarin dosing," in 23rd USENIX Security Sympo- sium (USENIX Security 14), 2014, pp. 17–32. [6] Y. Cao and J. Yang, "Towards making systems forget with machine unlearning," in 2015 IEEE Symposium on Security and Privacy. IEEE, 2015, pp. 463–480. [7] M. Fredrikson, S. Jha, and T. Ristenpart, "Model inversion attacks that exploit confidence information and basic countermeasures," in Proceedings of the 22nd ACM SIGSAC conference on computer and communications security, 2015, pp. 1322–1333. [8] C. Song, T. Ristenpart, and V. Shmatikov, "Machine learning models that remember too much," in Proceedings of the 2017 ACM SIGSAC Conference on computer and communications security, 2017, pp. 587–601. [9] K. Ganju, Q. Wang, W. Yang, C. A. Gunter, and N. Borisov, "Property inference attacks on fully connected neural networks using permutation invariant representations," in Proceedings of the 2018 ACM SIGSAC conference on computer and communications security, 2018, pp. 619–633. [10] N. Carlini, C. Liu, ́U. Erlingsson, J. Kos, and D. Song, "The secret sharer: Evaluating and testing unintended memorization in neural networks," in 28th USENIX Security Symposium (USENIX Security 19), 2019, pp. 267–284. [11] J. Zhou, S. Chen, Y. Wu, H. Li, B. Zhang, L. Zhou, Y. Hu, Z. Xiang, Z. Li, N. Chen et al., "Ppml-omics: a privacy-preserving federated machine learning system protects patients' privacy from omic data," bioRxiv, 2022. [12] S. M. McKinney, M. Sieniek, V. Godbole, J. Godwin, N. Antropova, H. Ashrafian, T. Back, M. Chesus, G. S. Corrado, A. Darzi et al., "In- ternational evaluation of an ai system for breast cancer screening," Nature, vol. 577, no. 7788, pp. 89–94, 2020. [13] D. Ardila, A. P. Kiraly, S. Bharadwaj, B. Choi, J. J. Reicher, L. Peng, D. Tse, M. Etemadi, W. Ye, G. Corrado et al., "End-to-end lung cancer screening with three-dimensional deep learning on low- dose chest computed tomography," Nature medicine, vol. 25, no. 6, pp. 954–961, 2019. [14] R. Poplin, A. V. Varadarajan, K. Blumer, Y. Liu, M. V. McConnell, G. S. Corrado, L. Peng, and D. R. Webster, "Prediction of cardio- vascular risk factors from retinal fundus photographs via deep learning," Nature Biomedical Engineering, vol. 2, no. 3, pp. 158–164, 2018. [15] L. Zhou, Z. Li, J. Zhou, H. Li, Y. Chen, Y. Huang, D. Xie, L. Zhao, M. Fan, S. Hashmi et al., "A rapid, accurate and machine-agnostic segmentation and quantification method for ct-based covid-19 diagnosis," IEEE transactions on medical imaging, vol. 39, no. 8, pp. 2638–2652, 2020. [16] L. Zhou, X. Meng, Y. Huang, K. Kang, J. Zhou, Y. Chu, H. Li, D. Xie, J. Zhang, W. Yang et al., "An interpretable deep learning workflow for discovering subvisual abnormalities in ct scans of covid-19 inpatients and survivors," Nature Machine Intelligence, vol. 4, no. 5, pp. 494–503, 2022. [17] I. Bartoletti, "Ai in healthcare: Ethical and privacy challenges," in Conference on Artificial Intelligence in Medicine in Europe. Springer, 2019, pp. 7–10. [18] L. Bourtoule, V. Chandrasekaran, C. A. Choquette-Choo, H. Jia, A. Travers, B. Zhang, D. Lie, and N. Papernot, "Machine unlearn- ing," in 2021 IEEE Symposium on Security and Privacy (SP). IEEE, 2021, pp. 141–159. [19] Q. P. Nguyen, B. K. H. Low, and P. Jaillet, "Variational bayesian unlearning," Advances in Neural Information Processing Systems, vol. 33, pp. 16 025–16 036, 2020. [20] T. T. Nguyen, T. T. Huynh, P. L. Nguyen, A. W.-C. Liew, H. Yin, and Q. V. H. Nguyen, "A survey of machine unlearning," arXiv preprint arXiv:2209.02299, 2022. [21] V. Gupta, C. Jung, S. Neel, A. Roth, S. Sharifi-Malvajerdi, and C. Waites, "Adaptive machine unlearning," Advances in Neural Information Processing Systems, vol. 34, pp. 16 319–16 330, 2021. [22] A. Thudi, G. Deza, V. Chandrasekaran, and N. Papernot, "Un- rolling sgd: Understanding factors influencing machine unlearn- ing," in 2022 IEEE 7th European Symposium on Security and Privacy (EuroS&P). IEEE, 2022, pp. 303–319. [23] C. Guo, T. Goldstein, A. Hannun, and L. Van Der Maaten, "Certi- fied data removal from machine learning models," arXiv preprint arXiv:1911.03030, 2019. [24] A. Golatkar, A. Achille, and S. Soatto, "Eternal sunshine of the spotless net: Selective forgetting in deep networks," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recogni- tion, 2020, pp. 9304–9312. [25] S. Neel, A. Roth, and S. Sharifi-Malvajerdi, "Descent-to-delete: Gradient-based methods for machine unlearning," in Algorithmic Learning Theory. PMLR, 2021, pp. 931–962. [26] A. Ginart, M. Guan, G. Valiant, and J. Y. Zou, "Making ai forget you: Data deletion in machine learning," Advances in neural infor- mation processing systems, vol. 32, 2019. AFS 12 [27] V. S. Chundawat, A. K. Tarun, M. Mandal, and M. Kankan- halli, "Can bad teaching induce forgetting? unlearning in deep networks using an incompetent teacher," arXiv preprint arXiv:2205.08096, 2022. [45] L. Wang, Z. Q. Lin, and A. Wong, "Covid-net: A tailored deep convolutional neural network design for detection of covid-19 cases from chest x-ray images," Scientific Reports, vol. 10, no. 1, pp. 1–12, 2020. [28] J. Kim and S. S. Woo, "Efficient two-stage model retraining for machine unlearning," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022, pp. 4361–4369. [29] Q. P. Nguyen, R. Oikawa, D. M. Divakaran, M. C. Chan, and B. K. H. Low, "Markov chain monte carlo-based machine un- learning: Unlearning what needs to be forgotten," arXiv preprint arXiv:2202.13585, 2022. [30] T. Baumhauer, P. Sch ̈ottle, and M. Zeppelzauer, "Machine unlearn- ing: Linear filtration for logit-based classifiers," Machine Learning, vol. 111, no. 9, pp. 3203–3226, 2022. [31] Z. Izzo, M. A. Smart, K. Chaudhuri, and J. Zou, "Approximate data deletion from machine learning models," in International Conference on Artificial Intelligence and Statistics. PMLR, 2021, pp. 2008–2016. [32] S. Schelter, S. Grafberger, and T. Dunning, "Hedgecut: Maintaining randomised trees for low-latency machine unlearning," in Proceed- ings of the 2021 International Conference on Management of Data, 2021, pp. 1545–1557. [33] S. Shan, E. Wenger, J. Zhang, H. Li, H. Zheng, and B. Zhao, "Protecting personal privacy against una uthorized deep learning models," in Proceedings of USENIX Security Symposium, 2020, pp. 1–16. [34] A. K. Tarun, V. S. Chundawat, M. Mandal, and M. Kankan- halli, "Fast yet effective machine unlearning," arXiv preprint arXiv:2111.08947, 2021. [46] F. Thabtah, "Autism spectrum disorder screening: machine learn- ing adaptation and dsm-5 fulfillment," in Proceedings of the 1st International Conference on Medical and health Informatics 2017, 2017, pp. 1–6. [47] M. W. Gardner and S. Dorling, "Artificial neural networks (the multilayer perceptron)-a review of applications in the atmo- spheric sciences," Atmospheric environment, vol. 32, no. 14-15, pp. 2627–2636, 1998. [48] K. O'Shea and R. Nash, "An introduction to convolutional neural networks," arXiv preprint arXiv:1511.08458, 2015. [49] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 770–778. [50] K. Leino and M. Fredrikson, "Stolen memories: Leveraging model memorization for calibrated {White-Box} membership inference," in 29th USENIX security symposium (USENIX Security 20), 2020, pp. 1605–1622. [51] S. Yeom, I. Giacomelli, M. Fredrikson, and S. Jha, "Privacy risk in machine learning: Analyzing the connection to overfitting," in 2018 IEEE 31st computer security foundations symposium (CSF). IEEE, 2018, pp. 268–282. [52] L. Song, R. Shokri, and P. Mittal, "Privacy risks of securing machine learning models against adversarial examples," in Pro- ceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, 2019, pp. 241–257. [35] H. Huang, X. Ma, S. M. Erfani, J. Bailey, and Y. Wang, "Unlearnable examples: Making personal data unexploitable," arXiv preprint arXiv:2101.04898, 2021. [53] R. Shokri, M. Stronati, C. Song, and V. Shmatikov, "Membership inference attacks against machine learning models," in 2017 IEEE symposium on security and privacy (SP). IEEE, 2017, pp. 3–18. [54] A. Salem, Y. Zhang, M. Humbert, P. Berrang, M. Fritz, and M. Backes, "Ml-leaks: Model and data independent membership inference attacks and defenses on machine learning models," arXiv preprint arXiv:1806.01246, 2018. [55] L. Song and P. Mittal, "Systematic evaluation of privacy risks of machine learning models," arXiv preprint arXiv:2003.10595, 2020. [36] A. Peste, D. Alistarh, and C. H. Lampert, "Ssse: Efficiently erasing samples from trained machine learning models," arXiv preprint arXiv:2107.03860, 2021. [37] X. Liu and S. A. Tsaftaris, "Have you forgotten? a method to assess if machine learning models have forgotten data," in International Conference on Medical Image Computing and Computer-Assisted Inter- vention. Springer, 2020, pp. 95–105. [38] Y. Huang, X. Li, and K. Li, "Ema: Auditing data removal from trained models," in International Conference on Medical Image Com- puting and Computer-Assisted Intervention. Springer, 2021, pp. 793– 803. [39] E. H ̈ullermeier and W. Waegeman, "Aleatoric and epistemic un- certainty in machine learning: An introduction to concepts and methods," Machine Learning, vol. 110, no. 3, pp. 457–506, 2021. [40] G. Hinton, O. Vinyals, J. Dean et al., "Distilling the knowledge in a neural network," arXiv preprint arXiv:1503.02531, vol. 2, no. 7, 2015. [41] Y. LeCun, "The mnist database of handwritten digits," http://yann. lecun. com/exdb/mnist/, 1998. [42] J. N. Kather, J. Krisam, P. Charoentong, T. Luedde, E. Herpel, C.-A. Weis, T. Gaiser, A. Marx, N. A. Valous, D. Ferber et al., "Predicting survival from colorectal cancer histology slides using deep learning: A retrospective multicenter study," PLoS medicine, vol. 16, no. 1, p. e1002730, 2019. [43] J. Yang, R. Shi, D. Wei, Z. Liu, L. Zhao, B. Ke, H. Pfister, and B. Ni, "Medmnist v2: A large-scale lightweight benchmark for 2d and 3d biomedical image classification," arXiv preprint arXiv:2110.14795, 2021. [44] M. Macenko, M. Niethammer, J. S. Marron, D. Borland, J. T. Woosley, X. Guan, C. Schmitt, and N. E. Thomas, "A method for normalizing histology slides for quantitative analysis," in 2009 IEEE international symposium on biomedical imaging: from nano to macro. IEEE, 2009, pp. 1107–1110.
http://arxiv.org/abs/2302.09810v1
2023-02-20T07:20:53
2023-02-20T07:20:53
Toward Asymptotic Optimality: Sequential Unsupervised Regression of Density Ratio for Early Classification
Theoretically-inspired sequential density ratio estimation (SDRE) algorithms are proposed for the early classification of time series. Conventional SDRE algorithms can fail to estimate DRs precisely due to the internal overnormalization problem, which prevents the DR-based sequential algorithm, Sequential Probability Ratio Test (SPRT), from reaching its asymptotic Bayes optimality. Two novel SPRT-based algorithms, B2Bsqrt-TANDEM and TANDEMformer, are designed to avoid the overnormalization problem for precise unsupervised regression of SDRs. The two algorithms statistically significantly reduce DR estimation errors and classification errors on an artificial sequential Gaussian dataset and real datasets (SiW, UCF101, and HMDB51), respectively. The code is available at: https://github.com/Akinori-F-Ebihara/LLR_saturation_problem.
[ "Akinori F. Ebihara", "Taiki Miyagawa", "Kazuyuki Sakurai", "Hitoshi Imaoka" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09810v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09810v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
TOWARD ASYMPTOTIC OPTIMALITY: SEQUENTIAL UNSUPERVISED REGRESSION OF DENSITY RATIO FOR EARLY CLASSIFICATION Akinori F. Ebihara, Taiki Miyagawa, Kazuyuki Sakurai, Hitoshi Imaoka NEC Corporation, Japan [email protected] 3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 0 1 8 9 0 . 2 0 3 2 : v i X r a ABSTRACT Theoretically-inspired sequential density ratio estimation (SDRE) algorithms are proposed for the early classification of time series. Conventional SDRE algorithms can fail to estimate DRs precisely due to the internal overnormalization problem, which prevents the DR-based sequential algorithm, Sequential Probability Ratio Test (SPRT), from reaching its asymptotic Bayes optimality. Two novel SPRT-based algorithms, B2Bsqrt-TANDEM and TANDEMformer, are designed to avoid the overnormalization problem for pre- cise unsupervised regression of SDRs. The two algorithms statistically significantly reduce DR estimation errors and classification errors on an artificial sequential Gaussian dataset and real datasets (SiW, UCF101, and HMDB51), respec- tively. The code is available at: https://github.com/ Akinori-F-Ebihara/LLR_saturation_problem. Index Terms- Sequential Probability Ratio Test, Density ratio estimation, Early classification, Time series 1. INTRODUCTION Early classification of time series [1, 2, 3, 4] is a pivotal al- gorithm, especially when sampling cost is high, e.g., medical early diagnosis [5], autonomous driving [6], and action recog- nition [7]. Under these applications, the early classifier seeks to optimize both speed and accuracy at the same time. Among the existing early classification methods, the log-likelihood ratio (LLR, i.e., log-density ratio) based algorithm, Sequential Probability Ratio Test (SPRT), is theoretically proven to reach asymptotic Bayes optimality under realistic non-independent and identically distributed (i.i.d.) datasets with more than two classes [8, 9]. The asymptotic optimality implies that the SPRT algorithm arrives at optimality where the number of samples is minimized under a certain error rate as data is collected. Theoretical study proves that the requirement ensuring the asymptotic optimality is that the absolute values of the LLRs must be increasing [10] as more samples are acquired. The challenge of applying the SPRT is that the true LLRs of time series are often unknown and must be estimated [11, 12, 13] with a sequential density ratio estimation (SDRE) al- gorithm. We find that the existing SDRE algorithms fail to Fig. 1. Log-likelihood ratios (LLR) and sequential density ratio estimation (SDRE) results. The LLRs contrast classes y = 1 and y = 0: positive and negative LLRs indicate a higher likelihood for class 1 and 0, respectively. Conventional SDRE algorithms show the LLR saturation problem if the LLR's absolute values are large (a) but not if they are small (b). estimate LLRs when the absolute values of LLRs are large, violating the indispensable condition for the optimality. Specif- ically, the estimated LLRs saturate at their upper limits, ac- cumulating estimation errors as more samples are collected. We define this problem as the LLR saturation problem (Fig. 1a) and point out that excessive regularization and normaliza- tion of internal variables, or overnormalization, is the problem source. The commonly used Long short-term memory (LSTM, [14]) and Transformer [15] can cause the LLR saturation prob- lem because of the overnormalization. Moreover, conventional training tricks such as weight decay [16], Layer Normalization [17], and Global Average Pooling [18] can also deteriorate the LLR saturation problem. Note that the LLR saturation prob- lem essentially differs from the known density chasm problem [19]: although both problems are phenomenologically similar, the density chasm problem is mitigated in proportion to the (a)(b)The LLR saturation problemProposed modelsy=1 Oblivion-LSEL [21]y=1 Ground truth LLRy=1 B2Bsqrt-TANDEM [ours]y=1 TANDEMformer [ours]y=1 TANDEM-LLLR [20]y=0 B2Bsqrt-TANDEM [ours]y=0 TANDEMformer [ours]y=0 Ground truth LLRy=0 Oblivion-LSEL [21]y=0 TANDEM-LLLR [20] Fig. 2. LLR estimation errors of SDRE algorithms with different weight decay, loss function, normalization, dataset size, and pooling. Each experiment is repeated 10 times to evaluate its standard error of the mean (SEM), plotted as an error bar. Gray shaded areas with asterisks highlights the conditions where the errors are statistically significantly reduced (Tukey-Kramer test, p < 0.001) by the proposed algorithms. Estimation results with LLRs of large (a) and small (b) absolute values are shown. dataset size, while the LLR saturation problem is not (Fig. 2a). Based on the classification-based SDRE algorithm SPRT- TANDEM [20, 21], we avoid the overnormalization to solve the LLR saturation problem with the two proposed architec- tures, B2Bsqrt-TANDEM and TANDEMformer. The for- mer has an LSTM backbone equipped with a novel activation function, B2Bsqrt, which is designed to achieve both sta- ble training and precise SDRE. The latter has a streamable Transformer backbone equipped with a novel pooling layer, Normalized Summation Pooling (NSP), to accumulate tokens that are mixed with self-attention blocks. Note that this is the first paper that applies the Transformer backbone to the early classification problem to the best of our knowledge. SDRE and early classification experiments are conducted on an artificial sequential Gaussian dataset (i.e., with known ground-truth LLRs) and real datasets (SiW [22], UCF101 [23], and HMDB51 [24]), respectively. Tukey-Kramer test confirms that our proposed algorithms outperform baselines with sta- tistically significantly better performance metrics. This result indicates that our proposed algorithm approaches the theoreti- cally guaranteed optimality, given the assumption that the true LLRs of the real data increase as more samples are collected. 2. METHOD 2.1. Problem setting and notations i and y ∈ [K] := {x(t) i }T Let X (1,T ) := {1, 2, . . . K} be sequential i data (X (1,T ) t=1) and a class label, respectively. i ∈ [M ] and M ∈ N is the dataset size. T ∈ N is the maximum length of the time series, and x(t) ∈ Rdfeat is a feature vector with length dfeat. LLR contrasting class k and l is defined as λkl(T ) := λkl(X (1,T ) ) := log(p(X (1,T ) |y = l)). Given trainable parameters θ ∈ Rdθ (dθ ∈ N), the estimated LLR is denoted as ˆλ(X (1,T ) ; θ). The goal of the early classification is to find the correct label y with the smallest possible subset of sequential data X (1,τ ), (1 ≤ τ ≤ T, τ ∈ N). |y = k)/p(X (1,T ) i i i i 2.2. Decision rule In order to halt data sampling to make an early decision, an early classification algorithm needs to have a stopping rule or a decision rule δ. We select the SPRT, δ∗, as the stopping rule because the SPRT is theoretically proven to be Bayes optimal under i.i.d. data X (1,T ) with binary classes y ∈ [0, 1], or asymptotically optimal under non-i.i.d. data with multi-class. i Definition 2.1 SPRT [8]. Let d∗ and τ ∗ be the decision rule and stopping time, respectively. Given the decision threshold, akl ∈ R, (k, l ∈ [K]) SPRT δ∗ is defined as δ∗ := (d∗, τ ∗), where d∗ := k if τ ∗ = τk (k ∈ [K]). Here, τ ∗ := min {τk(cid:48)}, k(cid:48)∈[K] ) − ak(cid:48)l ≥ 0}. and τk(cid:48) := inf{t ≥ 1| min {λk(cid:48)l(X (1,t) i l((cid:54)=k(cid:48))∈[K] Intuitively, the SPRT updates the LLR every time a new sample is acquired until the stopping time when the minimum LLR contrasting a class and others reaches the class threshold. 2.3. Asymptotic optimality Theorem 2.1 Asymptotic optimality of the SPRT under a multi-class, non-i.i.d. case [9]. Assume that a non-negative increasing function ψ(t) (ψ(t) t→∞−−−→ ∞) and positive finite constants Ikl (k, l ∈ [K], k (cid:54)= l) exist, such that for some r > 0, λkl(t)/ψ(t) Ikl. Then for all m ∈ (0, r] and k ∈ [K], inf δ Ek[τ ]m ≈ Ek[τ ∗]m as max k,l Pk-r-quickly −−−−−−−−→ t→∞ akl → ∞. The precise definition of r-quick convergence and a more detailed discussion can be found, e.g., in [9]. Intuitively, Thm. 2.1 tells the following: assuming that the LLRs λkl increase as samples are accumulated, the SPRT algorithm reaches the asymptotic optimality where the moments of the stopping time are minimized up to order r, given a classification error rate. The experiments with real datasets are performed under the assumption that the unknown true LLRs satisfy Thm. 2.1. This is a natural assumption, given that the features of real scenes continuously bring new information for the classification task. LLR estimation (LLRe) loss onlyLayerNormTransformerpoolingWeight decayw/ow/Multiplet cross-entropy(mCE) loss onlymCE+LLRe lossmCE loss onlymCE+LLRe loss(a)(b)0.010.0010.00.00.00.0001NSP [ours]GAP1tokenLayerNormWeight decayw/ow/0.010.0010.00.00.00.0001TransformerpoolingLLRe loss onlyNSP [ours]GAP1tokenB2Bsqrt-TANDEM [ours]TANDEMformer [ours]TANDEM-LLLR [20]Oblivion-LSEL [21]***Dataset size103104105106102Dataset size103104105106102 Fig. 3. The design of LSTM-based B2Bsqrt-TANDEM (a) and Transformer-based TANDEMformer (b) temporal integrator (TI) for SDRE. A subset of feature vectors of time series is extracted with a sliding window, whose size is defined with SPRT-TANDEM's Markov order N (Thm. 2.2). In the above example, N = 4. The extracted subset is then processed with the TI to compute posterior probabilities, with which the estimated LLR is computed according to the TANDEM formula (Thm. 2.2). 2.4. Sequential Density Ratio Estimation The following TANDEM formula (Thm. 2.2) is computed using posterior probabilities which are outputs from a temporal integrator network (Fig. 3). The network is optimized with the LLR estimation (LLRe) loss, log-sum exponential loss (LSEL, Def. 2.2) function, often linearly combined with the multiplet cross-entropy (mCE) loss [20]. In the experiments, the expected value of LSEL is calculated as an empirical mean across timestamps t, classwise examples i, and classes k. Theorem 2.2 TANDEM formula [20]. Assuming that X (1,T ) are N th order Markov series, λkl(t)can be approximated as: i (cid:32) ˆλkl(X (1,t) i ) = log (cid:33) i |y = k) , ..., x(t) , ..., x(t) p(x(1) i p(x(1) |y = l) i i (cid:32) p(y = k|x(s−N ) p(y = l|x(s−N ) i log (cid:33) , ..., x(s) i ) , ..., x(s) i ) (cid:32) log p(y = k|x(s−N ) p(y = l|x(s−N ) i ) , ..., x(s−1) i , ..., x(s−1) ) i (cid:33) (1) i i = − t (cid:88) s=N +1 t (cid:88) s=N +2 Definition 2.2 LSEL [21].     ˆLLSEL(θ; S) := E log 1 + (cid:88) e−ˆλkl(X (1,t) i ;θ)   . (2) l((cid:54)=k) √ The B2Bsqrt has an unsaturated range [− inf, inf] and a finite gradient 1/(2 α) at the origin to achieve both stable optimization and effective SDRE. We find that α = 1 is the best value achieving both stability and accuracy, and thus fix the value hereafter. Note that although the B2Bsqrt shares the spirit with the logarithmic activation function [25], we find that the logarithmic activation can cause unstable training results: thus, we focus on the B2Bsqrt to explore its effect. TANDEMformer (Fig. 3b) is a streamable transformer with a novel NSP layer. Tokens are first extracted with a slid- ing window and mixed with self-attention. The NSP then takes a sum of the tokens and divides them with a constant, which is the maximum size of the sliding window. The sliding window size is determined with the order of Markov assumption, N (Thm. 2.2). While GAP and one-token Transformer (e.g., ViT [26]) generate one summarized token of similar range irrespec- tive of sample history, NSP can allow evidence accumulation to let LLRs grow without overnormalization (Fig. 2). Definition 2.4. NSP. Let X (t,t+w) i with a sliding window of size w ∈ [N ], and let Z (t,t+w) {z(s) the Markov order N , the NSP layer is defined as: be subtokens sampled := s=t be the subtokens mixed with self-attention. Given i }t+w i N SP (Z (t,t+w) i ) := t+w (cid:88) s=t z(s) i N + 1 . (4) 2.5. B2Bsqrt-TANDEM and TANDEMformer 3. EXPERIMENTS AND RESULTS To prevent the overnormalization problem, each of the two proposed networks has a simple but effective trick. The B2Bsqrt-TANDEM (Fig. 3a) uses a novel B2Bsqrt func- tion (Def. 2.3) in place of the default tanh activation function. Definition 2.3. Back-to-back (B2B) sqrt. Let α ≥ 0 as a hyperparameter. The B2Bsqrt function is defined as: fB2Bsqrt(x) := sign(x)((cid:112)α + |x| − (3) α) √ The primary purpose of this experiment is to have a fair com- parison to outperform the baselines with our algorithms: as long as the comparison is fair, we do not try all the available options because it will not affect our conclusion. To achieve this goal, we set a common batch size, feature extractor, fea- ture vector size dfeat, Markov order N , and LSTM's hidden layer size for all the models. All other hyperparameters are optimized with Optuna [27]. We make our GitHub project TITIMarkovorderEstimated log-likelihood ratioTemporalintegrator (TI)Feature vectors of time seriesSliding windowTimePositional encodingPosteriorprobabilities(b)(a)NSPoolingMultihead attentionLayerNormLayerNormMLPMLPTransformer blockTITILSTM cellB2BsqrtB2Bsqrt Fig. 4. Speed-accuracy tradeoff (SAT) curves to evaluate the early classification performance on the three real databases, SiW, UCF101, and HMDB51. The gray shaded areas show the region where at least one of the proposed models achieves statistically significantly better per-class error rate than all the baselines. Maximum p-values calculated with the dominant model are shown (Tukey-Kramer test). One, two, and three asterisks show p < 0.05, p < 0.01, and p < 0.001, respectively. Error bars are SEMs. page publicly available for reproducibility: the code and all the detailed experimental setups can be found there. 3.1. Compared models Two state-of-the-art SDRE algorithms are used as baselines: SPRT-TANDEM with LLLR [20] and TANDEM with Obliv- ion and LSEL [21]. Both adopt the LSTM and TANDEM formula (Thm. 2.2), but the former applies the LLLR loss func- tion [20] for SDRE, while the latter uses LSEL (Def. 2.2). The latter also uses a simplified LLR estimation formula, Obliv- ion: ˆλkl(X (t−N,t); θ) ≈ log (p(k|X (t−N,t))/p(l|X (t−N,t))) Hereafter the two baselines are abbreviated as TANDEM- LLLR and Oblivion-LSEL, respectively. 3.2. Simulated Gaussian datasets with known LLRs Let p0(x) and p1(x) be the 128-dimensional Gaussian den- sities with covariance identity and mean (a, 0, 0, ..., 0) and (0, a, 0, ..., 0). a ∈ {1.0, 2.0} is the density offset for simu- lating LLRs with small and large absolute values. Samples of length T = 50 are randomly taken from the two sepa- rated Gaussians to create training, validation, and test datasets with 80K, 10K, and 10K data, respectively. Additional 920K training data are used only for the large-dataset experiment. SDRE evaluation metric is the mean absolute error between the ground-truth and estimated LLRs. The Markov order is set to the maximum 49. No mCE loss is used for optimization. Fig. (2) shows that all the models increase errors as weight decay increases. With small weight decay parameters, the pro- posed models show statistically significantly smaller estima- tion errors when α=2.0. Layer Normalization also deteriorates the results, except for the TANDEMformer. A larger database size does not mitigate the error, highlighting the challenge of solving the LLR saturation problem. The pooling layer of the Transformer also affects the performance: with the proposed NSP layer, the estimation error is statistically significantly reduced compared to the GAP or one-token approach. 3.3. Real-world datasets for the early classification Experiments are repeated 50 times to evaluate the Speed- Accuracy tradeoff (SAT) curve (Fig. 4). Markov order N is fixed to 10. mCE loss is used with LLRe loss weighted with a hyperparameter, LLRe loss ratio. ResNet-152 is trained as a feature extractor for the Spoofing in the Wild (SiW, [22]) dataset to generate 512-dim feature vectors. Training, valida- tion, and test datasets contain 46729, 4968, and 43878 videos, and class labels are binary. Pretrained Microsoft Vision Model ResNet50 [28] without fine-tuning is used to extract 2048- dim feature vectors from UCF101 [23] and HMDB51 [24] action recognition datasets. Training/validation/test datasets are 35996/4454/15807, and 1026/106/105 for UCF101 and HMDB51, respectively. Sample lengths are T = 50 and 79. In Fig. 4, the algorithm that is as far to the left and as far down in the graph as possible is the better one (i.e., the earlier decision with better accuracy). The gray shaded areas show the regions where at least one of the proposed models shows statistically significantly better mean per-class error rates than the baselines. Our models show superior performance at the late phase with larger samples, reminiscent of the asymptotic optimality. Interestingly, some of our algorithms show pre- dominance even at the very early phase, where only a few samples are collected: it probably be a by-product of the pre- cise estimation of the LLRs. The SAT curves of the proposed models mostly show a monotonic decrease as more data are accumulated, indicating that the models successfully accumu- late evidence without the LLR saturation problem. Given the increasing LLR assumption, our algorithms are expected to approach the asymptotic optimality (Thm. 2.1). 4. CONCLUSION The LLR saturation problem is formulated and solved with highly effective yet simple solutions. They prevent the over- normalization for precise unsupervised regression of the LLRs, providing an essential step toward the asymptotic optimality. UCF101Averaged per-class error rate (%)0.110.130.15SiWHMDB51***********************B2Bsqrt-TANDEM [ours]TANDEMformer [ours]TANDEM-LLLR [20]Oblivion-LSEL [21]30405060***** 5. REFERENCES [1] Z. Xing, J. Pei, and P. S. Yu, "Early prediction on time series: A nearest neighbor approach," in IJCAI, 2009, p. 1297–1302. [2] U. Mori, A. Mendiburu, E. J. Keogh, and J. A. Lozano, "Reliable early classification of time series based on dis- criminating the classes over time," DMKD, vol. 31, pp. 233–263, 2016. [3] A. Gupta, H. P. Gupta, B. Biswas, and T. Dutta, "Ap- proaches and applications of early classification of time series: A review," IEEE TAI, vol. 1, no. 1, pp. 47–61, 2020. [14] S. Hochreiter and J. Schmidhuber, "Long short-term memory," Neural Comput., vol. 9, no. 8, pp. 1735–1780, 1997. [15] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. u. Kaiser, and I. Polosukhin, "Attention is all you need," in NeurIPS, 2017, vol. 30, pp. 5998–6008. [16] A. Krogh and J. Hertz, "A simple weight decay can improve generalization," in NeurIPS, 1991, vol. 4. [17] J. Ba, J. R. Kiros, and G. E. Hinton, "Layer normaliza- tion," ArXiv, vol. abs/1607.06450, 2016. [18] M. Lin, Q. Chen, and S. Yan, "Network in network," ICLR, vol. abs/1312.4400, 2014. [4] T. Hartvigsen, W. Gerych, J. Thadajarassiri, X. Kong, and E. A. Rundensteiner, "Stop&hop: Early classification of irregular time series," in CIKM, 2021. [19] B. Rhodes, K. Xu, and M. U. Gutmann, "Telescoping density-ratio estimation," in NeurIPS, 2020, vol. 33, pp. 4905–4916. [5] E. Vats and C. S. Chan, "Early detection of human actions-a hybrid approach," Appl. Soft Comput. J., vol. 46, pp. 953 – 966, 2016. [20] A. F. Ebihara, T. Miyagawa, K. Sakurai, and H. Imaoka, "Sequential density ratio estimation for simultaneous op- timization of speed and accuracy," in ICLR, 2021. [6] R. Doná, G. P. R. Papini, and G. Valenti, "MSPRT action selection model for bio-inspired autonomous driving and intention prediction," in IROS, 2019. [7] J. Weng, X. Jiang, W.-L. Zheng, and J. Yuan, "Early action recognition with category exclusion using policy- based reinforcement learning," IEEE TCSVT, vol. 30, pp. 4626–4638, 2020. [8] A. Wald, Sequential Analysis, John Wiley and Sons, 1st edition, 1947. [9] A. Tartakovsky, I. Nikiforov, and M. Basseville, Se- quential Analysis: Hypothesis Testing and Changepoint Detection, Chapman & Hall/CRC, 1st edition, 2014. [10] A. Tartakovsky, "Asymptotic optimality of certain multi- hypothesis sequential tests: Non-i.i.d. case," Stat. Infer- ence Stoch. Process., vol. 1, pp. 265–295, 1998. [21] T. Miyagawa and A. F. Ebihara, "The power of log- sum-exp: Sequential density ratio matrix estimation for speed-accuracy optimization," in ICML, 2021, pp. 7792– 7804. [22] Y. Liu, A. Jourabloo, and X. Liu, "Learning deep models for face anti-spoofing: Binary or auxiliary supervision," in CVPR, June 2018. [23] K. Soomro, A. R. Zamir, and M. Shah, "UCF101: A dataset of 101 human actions classes from videos in the wild," ArXiv, vol. abs/1212.0402, 2012. [24] H. Kuehne, H. Jhuang, E. Garrote, T. Poggio, and T. Serre, "HMDB: a large video database for human motion recognition," in ICCV, 2011. [25] A. Farzad, H. Mashayekhi, and H. Hassanpour, "A com- parative performance analysis of different activation func- tions in LSTM networks for classification," Neural Com- put. Appl., vol. 31, no. 7, pp. 2507–2521, 2019. [11] M. Sugiyama, T. Suzuki, S. Nakajima, H. Kashima, P. von Bünau, and M. Kawanabe, "Direct importance estimation for covariate shift adaptation," Annals of the Institute of Statistical Mathematics, vol. 60, no. 4, pp. 699–746, 2008. [26] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, J. Uszkoreit, and N. Houlsby, "An image is worth 16x16 words: Transformers for image recognition at scale," in ICLR, 2021. [12] M. Sugiyama, T. Suzuki, and T. Kanamori, Density Ratio Estimation in Machine Learning, Cambridge University Press, 2012. [27] T. Akiba, S. Sano, T. Yanase, T. Ohta, and M. Koyama, "Optuna: A next-generation hyperparameter optimization framework," in KDD, 2019, p. 2623–2631. [13] G. V. Moustakides and K. Basioti, "Training neural networks for likelihood/density ratio estimation," ArXiv, vol. abs/1911.00405, 2019. [28] "Microsoft Vision Model ResNet-50," https:// pypi.org/project/microsoftvision/, Ac- cessed: May 14, 2021. Appendix A. THREE-CLASS SDRE We could only provide SDRE results with two classes due to the strict page limit of the ICASSP format. As a supplementary experiment, Fig. 5 shows example results of three-class SDRE. Even with a larger number of classes, the proposed algorithms successfully estimate the LLRs. Thus, our two proposed al- gorithms, B2Bsqrt-TANDEM and TANDEMformer, effec- tively estimate the ground-truth density ratio with high pre- cision and can also be used as effective early-classification algorithms on multiclass datasets. B. FREQUENTLY ASKED QUESTIONS [How are T and N values selected?] Both of them can be found empirically with ease. While changing these values may lead to slight variations in the outcome, our algorithms are robust to these hyperparameter changes. In our previous works [20, 21], we extensively tested vari- ous T from 20 to 100 to find that our algorithm outperformed others. We also deploy commercial products using the pro- posed algorithms with even shorter T (due to limited compu- tational resources) without problems. Thus, T can be chosen conveniently depending on their application and hardware re- quirement without sacrificing the performance of our models. However, it is worth noting that the appropriate T should be at least longer than the specific time scale described below. In the prior works, we also extensively discussed choosing N ([20], Sections 3 and D) and would like to refer interested reviewers to the paper for additional information. In brief, an optimal N can be found either based on the specific time scale or hyperparameter tuning. The specific time scale character- izes the data class, e.g., long temporal action such as UCF101 has a long specific time scale, while a spoofing attack such as SiW has a short specific time scale (because one frame can have sufficient information of the attack). Setting N equal to the specific time scale works most of the time. Alterna- tively, N can be objectively chosen with a hyperparameter tuning algorithm such as Optuna, just as we choose other hyperparameters. Because N is only related to the temporal integrator after feature extraction, the optimization of N is not computationally expensive (3 (N = 0) to 9 (N = 49) mins/epoch, B2Bsqrt-TANDEM on SiW with RTX2080Ti). [Provided comparisons are mainly with the author's prior work.] The choice of the baseline algorithms is based on two criteria: (1) they are capable of SDRE, and (2) they can be applied to early classification. The state-of-the-art methods that meet these criteria are our prior algorithms. It is worth mentioning that in our two previous papers, we extensively compared our algorithms with existing works by others, includ- ing the reinforcement learning algorithm EARLIEST, early classification algorithms LSTM-m and LSTM-s, DRE algo- rithms LSIF, KLIEP, DSKL, and BARR. Since then, few major SDRE algorithms (if any) for solving early classification have been presented. Thus, our prior algorithms are the most proper ones for the baseline; using them for comparison does not degrade our paper value or affect our conclusion. C. SUPPLEMENTARY DISCUSSION Our work provides a critical step toward the theoretical asymp- totic optimality (Theorem 2.1) of the SPRT algorithm, which requires precise estimation of LLRs. The asymptotic optimal- ity guarantees reaching the best speed-accuracy tradeoff as more samples are accumulated. As mentioned in Section 2, the increasing LLR assumption is natural, given that the real scenes continuously bring new information one after another, aiding the classification task. Furthermore, even under viola- tion of the assumption, the SPRT algorithm will often perform at least as equivalent as existing algorithms, if not outperforms. Empirical observations on our in-house data, which contains videos with almost unchanging frames, confirm that our pro- posed algorithms are on par with the score average of CNN outputs. Thus, our work is expected to benefit the community of DRE and early classification significantly. The general challenge of DRE resides in the large vari- ance of the estimated density ratio p1/p0; i.e., when p1 or p0 is close to zero, the density ratio is almost zero or infinity, respectively. In addition to the variance problem, a seminal paper [19] found and formulated the density chasm problem, where DRE fails counterintuitively even when classification accuracy is perfect. The underlying reason for the density chasm problem remains elusive. Our study uncovered an ad- ditional fundamental challenge of DRE: the LLR saturation problem. Our thorough experiments narrowed down the prob- lem to the overnormalization (see Introduction and Fig.2), and we proposed simple but effective solutions to the problem: B2Bsqrt-TANDEM and TANDEMformer. Both are simple and thus easy to implement. We expect that our work inspires future works that focus on, e.g., theoretical analysis of the LLR saturation problem and potential relationships between the LLR saturation problem and the density chasm problem. D. AUTHOR CONTRIBUTION A.F.E. conceived the study, conducted the experiments, and wrote the paper. T.M., K.S., and H.I. supervised the study. E. ACKNOWLEDGMENTS The authors thank anonymous reviewers for their careful read- ing to improve the manuscript. We also thank Hiroshi Fukui for inspiring discussions on Transformer architecture and self- attention. Fig. 5. SDRE on a 3-class dataset. "Class a vs. b at y = a" indicates that the plotted LLR shows log p(X|y = a)/p(X|y = b), when the ground truth label is y = a. The new 3rd class is sampled from a 128-dim Gaussian with mean (0, 0, 2, ..., 0). All other experimental conditions are the same as Fig. 1. Ground truth LLRTANDEMformer [ours]TANDEM-LLLR [20]B2Bsqrt-TANDEM [ours]Oblivion-LSEL [21]
http://arxiv.org/abs/2302.09807v1
2023-02-20T07:15:28
2023-02-20T07:15:28
A Novel Collaborative Self-Supervised Learning Method for Radiomic Data
The computer-aided disease diagnosis from radiomic data is important in many medical applications. However, developing such a technique relies on annotating radiological images, which is a time-consuming, labor-intensive, and expensive process. In this work, we present the first novel collaborative self-supervised learning method to solve the challenge of insufficient labeled radiomic data, whose characteristics are different from text and image data. To achieve this, we present two collaborative pretext tasks that explore the latent pathological or biological relationships between regions of interest and the similarity and dissimilarity information between subjects. Our method collaboratively learns the robust latent feature representations from radiomic data in a self-supervised manner to reduce human annotation efforts, which benefits the disease diagnosis. We compared our proposed method with other state-of-the-art self-supervised learning methods on a simulation study and two independent datasets. Extensive experimental results demonstrated that our method outperforms other self-supervised learning methods on both classification and regression tasks. With further refinement, our method shows the potential advantage in automatic disease diagnosis with large-scale unlabeled data available.
[ "Zhiyuan Li", "Hailong Li", "Anca L. Ralescu", "Jonathan R. Dillman", "Nehal A. Parikh", "Lili He" ]
10.1016/j.neuroimage.2023.120229
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1016/j.neuroimage.2023.120229", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.09807v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09807v1", "@rel": "related", "@type": "application/pdf" } ]
[ "Neuroimage. 2023;120229" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.IV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.IV", "cs.AI", "cs.CV", "cs.LG", "stat.ML" ]
A Novel Collaborative Self-Supervised Learning Method for Radiomic Data Zhiyuan Li, Hailong Li, Anca L. Ralescu, Senior Member, IEEE, Jonathan R. Dillman, Nehal A. Parikh, and Lili He 1 3 2 0 2 b e F 0 2 ] V I . s s e e [ 1 v 7 0 8 9 0 . 2 0 3 2 : v i X r a Abstract-The computer-aided disease diagnosis from radiomic data is important in many medical applications. However, developing such a technique relies on annotating radiological images, which is a time-consuming, labor-intensive, and expensive process. In this work, we present the first novel collaborative self- supervised learning method to solve the challenge of insufficient labeled radiomic data, whose characteristics are different from text and image data. To achieve this, we present two collaborative pretext tasks that explore the latent pathological or biological relationships between regions of interest and the similarity and dissimilarity information between subjects. Our method collab- oratively learns the robust latent feature representations from radiomic data in a self-supervised manner to reduce human anno- tation efforts, which benefits the disease diagnosis. We compared our proposed method with other state-of-the-art self-supervised learning methods on a simulation study and two independent datasets. Extensive experimental results demonstrated that our method outperforms other self-supervised learning methods on both classification and regression tasks. With further refinement, our method shows the potential advantage in automatic disease diagnosis with large-scale unlabeled data available. Index Terms-Self-supervised learning, collaborative learning, radiomic data, disease diagnosis. I. INTRODUCTION R ADIOMICS is a process that extracts and analyzes high-throughput quantitative features from digital radio- graphic images acquired by modern medical imaging tech- niques, such as magnetic resonance imaging (MRI), computed This work was supported by the National Institutes of Health [R01- EB029944, R01-EB030582, R01-NS094200 and R01-NS096037]; Academic and Research Committee (ARC) Awards of Cincinnati Children's Hospital Medical Center. Corresponding author: Lili He (emails: [email protected]) Z. Li is with the Imaging Research Center, Department of Radiology, Cincinnati Children's Hospital Medical Center, and also with the Department of Electronic Engineering and Computer Science, University of Cincinnati, Cincinnati, OH, USA (email: [email protected]). H. Li and L. He are with the Imaging Research Center, Department of Radiology, Artificial Intelligence Imaging Research Center, and Center for Prevention of Neurodevelopmental Disorders, Perinatal Institute, Cincinnati Children's Hospital Medical Center, and also the Department of Radiology, University of Cincinnati College of Medicine, Cincinnati, OH, USA (emails: [email protected]; [email protected]). A. Ralescu is with the Department of Electronic Engineering and Com- puter Science, University of Cincinnati, Cincinnati, OH, USA (email: [email protected]). J. Dillman is with the Imaging Research Center, Department of Ra- diology, and Artificial Intelligence Imaging Research Center, Cincinnati Children's Hospital Medical Center, and also the Department of Radiology, University of Cincinnati College of Medicine, Cincinnati, OH, USA (email: [email protected]). N. Parikh is with the Center for Prevention of Neurodevelopmental Disor- ders, Perinatal Institute, Cincinnati Children's Hospital Medical Center, and also with the Department of Pediatrics, University of Cincinnati College of Medicine, Cincinnati, OH, USA (email: [email protected]). tomography (CT), and positron emission tomography (PET) [1]. Even though it was derived from the oncology field, radiomics has been applied to various medical image studies [2]. Extracted features (referred to as radiomic data/features) are often defined as shape-based, first-, second-, and higher- order statistical descriptors of radiological images, such as signal intensity distribution, tissue/organ morphology/shape, volumetry, and inter-voxel patterns and texture [3]. These interpretable radiomic data change with alterations in tissue histology and morphology, thereby, being capable of quanti- fying phenotypic characteristics in radiological images to aid diagnosis, prognosis, and assessment of response to treatment. The practice of radiomics involves multiple discrete steps, including image acquisition, image segmentation, feature ex- traction, radiomic data management, and data analysis [1], [2]. Although each of these complex steps has its own chal- lenges, radiomics continues to rapidly expand as knowledge and tools in each domain have been constantly evolving [2]. Particularly, tools to standardize feature extraction, an- alytic tools, and open-source platforms (e.g., PyRadiomics [4] and MIRP [5]) are available for the research community to automatically extract a large panel of engineered radiomic features from medical images. This largely facilitates the sub- sequent radiomic data analysis by addressing reproducibility and comparability issues [4]. Earlier studies applied radiomic data for radiological phenotyping to investigate cancer di- agnosis [6], survival prediction [7], malignancy prediction [8], recurrence prediction [9], and cancer staging [10]. In recent years, radiomic features were also utilized in other medical applications, such as Alzheimer's disease [11], [12], schizophrenia [13], [14], and hepatic diseases [15]. Many prior studies have used supervised machine learning models to learn the representations of radiomic features for clinical decision support and to reveal underlying pathophysiology [16]–[19]. Despite the success of those works, some challenges remain in the existing radiomics studies. Supervised learning models typically require a large number of labeled data to achieve reliable and robust performance. However, annotating medical images is a time-consuming, labor-intensive, and expensive process, and it may also involve invasive procedures or long- term follow-up with subjects [20], thereby limiting the sample size. Recently, self-supervised learning (SSL), a feature rep- resentation learning paradigm, was developed to solve the challenges posed by the over-dependence of labeled data. SSL emerged from the fields of natural language processing (NLP) and computer vision [21]–[23]. In the SSL paradigm, 2 Fig. 1. Schematic diagram of the proposed method. For each selected pair of subjects xi and xj , we randomly masked k out of N ROIs on radiomic feature maps. This process was repeated K times to enlarge the training samples. We then pretrained a Transformer via a joint loss function to solve two pretext tasks i.e., a radiomic feature reconstruction and a subject-similarity discrimination using augmented training samples. Finally, we fine-tuned the pretrained a Transformer to perform downstream tasks. N: Number of Transformer blocks; Add & Norm: Residual connection and layer normalization; MLP: Multilayer perceptron. we typically pre-train the model by solving pretext tasks in an unsupervised manner, where the data itself provides supervision, and then fine-tune the model by solving real tasks (referred to as downstream tasks) in a supervised manner [24]. SSL has been gaining popularity in the medical domains of clinical diagnosis [25], segmentation [26], and medical text mining [27]. Previous SSL studies have developed a series of pretext tasks with supervisory signals to train the models for learning the latent feature representation, such as the rotation-oriented approach [28], BERT-based model [29], Rubik's cube recovery [30], anatomical position prediction [31], and modality-invariant method [25]. Although these SSL methods achieved excellent performance for various NLP and computer vision tasks, they have not been adapted to radiomic features, whose characteristics are different from text and image data. Applying existing SSL approaches to radiomic data may lead to sub-optimal model performance. In this study, our objective was to develop a novel SSL technique explicitly for radiomic data. As noted, radiomic data has its own unique characteristics. In practice, in radiomics studies, one would automatically or manually delineate one or more regions of interest (ROIs) on radiological images and then extract high-throughput (e.g., often one-hundreds or more) quantitative features from each ROI, resulting in a radiomic feature map for each subject [3]. Such radiomic data (i.e., feature maps) have neither a strong spatial relationship as image data nor a sequential relationship as in NLP language data. The spatial relationship specifies how an object is located in space in relation to other objects in an image, while the sequential relationship specifies how a word is dependent on those that come before or after it in language data. Different from image/language data, ROIs, and quantitative features in radiomic feature maps do not need to follow any specific order, and their positions are invariant to the radiological phenotypes (e.g., tumors, lesions, medical conditions, etc.). In contrast, there exist implicit biological or pathological relationships among different ROIs in radiomic data, which reflect how a ROI is related to other ROIs or pathology [32]–[34]. For example, in a long-term follow-up brain development study, volumes (i.e., one of the most common radiomic features) of regional brain ROIs have been observed to follow typical and atypical growth patterns in children [35]. In another study, simultaneously reduced volume in five ROIs of the gyrus rectus, medial frontal cortex, superior frontal gyrus, inferior frontal gyrus, and subcallosal area were observed and associated with neuropsychiatric symptom scores in a cohort with various neurodegenerative diseases [36]. Using the abdominal MRI image as another example, volume ratio of liver and spleen gradually decreased with worsening hepatic fibrosis [34]. In this work, by taking advantage of latent biological or pathological relationships in radiomic data, we formulated a pretext task, Radiomic Features Reconstruction, by randomly masking or hiding radiomic features from ROIs, and then reconstructing the masked/hidden radiomic features using the visible ones. (Figure 1) Instead of grid masks for image data, we explicitly designed row-wise masks by considering the characteristic of radiomic data to hide radiomic features from Multi-Head AttentionMLPMLPAdd & NormAdd & NormTransformer F(*; θ) T×Pretext Task #1: Radiomic Features ReconstructionCollaborative Self-Supervised LearningPre-trainedTransformer MLPFine-TuneMSubjectssubject xisubjectxjRandom SelectingPretext Task #2: Subject-Similarity discriminationDownstream TaskReconstructed feature mapssubject igroupsubjectj groupFeature Representation (fi)MLPFeature Representation (fi)Radiomic Feature ExtractionMasking ROIsData AugmentationL2Normsubject xisubjectxjRegressionClassificationCollaborative Learning randomly selected ROIs. In this way, learning to reconstruct the masked radiomic features helps the model understand latent relations among ROIs. The learned radiomic feature representation using such a pretext SSL task may benefit the downstream tasks (e.g., disease classification or outcome regression), in which sufficient annotated data are lacking. Nevertheless, these feature representations learned by the Radiomic Features Reconstruction pretext task may be sen- sitive to the position of the masks, i.e., masking different ROIs may produce different mask-dependent feature representations from the same radiomic data. Because our downstream tasks are independent of any pretext task, we formulated another pretext task, Subject-Similarity Discrimination, to force the model to learn mask-invariant feature representations. The Subject-Similarity Discrimination task aims to discover the similarity and dissimilarity information from the masked ra- diomic feature maps and to cluster those from the same subject into one group. In this way, the Subject-Similarity Discrimination task collaboratively aids the Radiomic Features Reconstruction task to learn robust latent feature representa- tions from radiomic data in a self-supervised manner. As such, we proposed a novel collaborative SSL approach to solve the challenge of insufficient labeled data for radiomic data by developing a Radiomic Features Reconstruction task and a Subject-Similarity Discrimination task to collabora- tively learn the representative radiomic features from the data itself without any human labeling. A collaborative learning objective was presented for feature representation learning by combining reconstruction and contrastive learning loss functions to collaboratively learn the radiomic features. We further analyzed the proposed objective function using the Bregman divergence in a statistical divergence view. Our pro- posed collaborative SSL method was specifically designed for radiomic features by considering its unique data characteristic. Then, the SSL-learned feature representation can be used in downstream tasks to fine-tune task-specific supervised learning models. To evaluate the effectiveness of our method, we first propose a simulation study to theoretically compare our methods with other state-of-the-art SSL approaches. We then employed two independent real datasets to test our model for early prediction of abnormal neurodevelopmental outcomes in very preterm infants (VPIs). Our contributions in this paper are outlined as follows: 1) We proposed a novel collaborative SSL approach for radiomic features to address the challenge of insufficient labeled data. By explicitly considering the unique data characteristic of radiomic features, we designed two collaborative pretext tasks, Radiomic Features Recon- struction and Subject-Similarity Discrimination. Our work is the first to apply SSL techniques to radiomic features. 2) With the proposed approach, an integrated learning objective was presented by combining reconstruction and contrastive learning loss functions to collaboratively learn radiomic features. We also provide mathematical derivation to show the properties and advantages of our objective function from a statistical divergence view. 3) A simulation study was first conducted to show 3 the effectiveness of our method. Substantial experi- ments on two independent real datasets further demon- strated the superior performance of our proposed model to other state-of-the-art SSL benchmark mod- els for downstream classification/regression tasks. The code of our proposed method is publicly available at https://github.com/leonzyzy/collaborative. II. RELATED WORKS In this section, we first review the previous works on medical image-based diagnosis from radiomic features and then discuss some related works on the most recent SSL methods. A. Automatic Disease Diagnosis from Radiomic Data Radiomic features have been applied to many medical applications, including neurological disorders and tumors, Alzheimer's disease [11], [12], schizophrenia [13], [37], breast cancer [6], and liver disease [38], [39]. Those works [17], [40], [41] typically involved three main steps: 1) delineate relevant ROIs in MRI images, 2) extract quantitative radiomic features for each ROI, and 3) develop a predictive model with the selected radiomic features for disease diagnosis. For example, Yue et al [40] used logistic regression and random forest to predict hospital stay in patients with SARS Cov- 2 using CT radiomic features. He et al [17] stratified the severity of liver stiffness for children and adolescent patients using radiomic features from T2-weighted MRI liver images by developing support vector machine (SVM) models. Brunese et al [42] developed an ensemble supervised learning model to detect brain cancer using radiomic features. Peng et al [41] combined the SVM model and Isomap (IsoSVM) on brain radiomic features to predict treatment effects after stereotactic radiosurgery. Most prior studies only focused on one or a few ROIs based on prior knowledge to simplify the training procedure of supervised learning models. This was mainly due to the limited sample size of the dataset. Otherwise, supervised learning models can be easily overfitted. In this work, our SSL-based strategy is able to generalize the radiomics to investigate the arbitrary number of ROIs on medical images without substantial prior knowledge. This is achieved by largely improving the issue of supervised learning models' over-dependence on labeled data. B. Self-Supervised Learning Recently, SSL has been widely recognized in computer vision and pattern recognition, due to its ability to handle a massive amount of unlabeled data. Various types of self- supervised methods have been developed by designing differ- ent pretext tasks with supervisory signals to learn the latent feature representation directly from the data itself. In this sec- tion, we discuss some state-of-art SSL models in the domain of computer vision. SSL methods for images can be summarized into three categories, including predictive, reconstructive, and contrastive learning methods. Predictive methods usually apply models to learn the latent features by predicting the pseudo labels, such as rotation prediction [43], puzzles solving [44], anatomical position prediction [31], and 3D distance prediction [45]. Reconstructive methods aim to learn an encoder mapping input images into latent features and a corresponding decoder to reconstruct the input images from the latent features [46]. These reconstructive pretext tasks include image denoising with auto-encoders [47], [48], context restoration [49], and Rubik's cube [30]. The Contrastive learning method [22], [23] propose tasks to discriminate the subject/instance. The main idea of contrastive learning methods is to train an encoder that embeds the input images into latent representations, and then clusters the representation of the different views from the same images and spread the representation of the views from different images based on a distance estimation (e.g., mutual information). Some representative works are MoCo v1 [23], Invariant [50], SimCLR [22], and BYOL [51]. As noted earlier, radiomic features have different data characteristics from images. Although some of these SSL methods for images can be applied to radiomic feature maps, it is very difficult to achieve superior model performance. This was illustrated in our experiments, where we compared the proposed approach with multiple state-of-the-art SSL approaches in this section. III. METHODOLOGY A. Overview An overview of the framework is shown in Figure 1. Assume that we have a total of M subjects. For each set of MRI images, we can apply MRI preprocessing tools to parcellate the whole MRI images into N different ROIs. Next, we extracted the radiomic features from each ROI using the radiomics pipelines (e.g., PyRadiomics [4]), thus resulting in a 2D feature map for each subject. Our collaborative SSL approach is an iterative learning procedure. In each iteration, we randomly selected a pair of subjects xi and xj from the training dataset i.e., S = {xi}M i=1, and masked k random ROIs on individual radiomic feature maps. We repeated this augmentation K times to generate many pretext pseudo- training samples ̃xi. After that, we adapted a Transformer [52] as a network encoder F (*; θ) to map the input ̃xi to a set of latent feature representation ̃fi = { ̃fi1, ̃fi2, . . . , ̃fiK}. These feature representations are collaboratively optimized via a joint loss function by a radiomic features reconstruction task and a subject-similarity discrimination task. Then, we layers connected multilayer perceptron (MLP) and output to the pretrained Transformer as the model for downstream tasks. Finally, we fine-tuned the whole model on our real downstream task, i.e., cognitive deficits prediction, using the original radiomic features as input to solve the real down- stream classification or regression tasks in a supervised fashion using the subjects with the labels. Below, we will elaborate on the radiomic features reconstruction and subject similarity discrimination. B. Network Encoder We applied a Transformer without position encoding as a network encoder in our framework to learn two pretext tasks for embedding the radiomic features. We selected the 4 transformer as the encoder according to the data characteristic of radiomic data. Particularly, radiomic data (i.e., feature maps) are statistical descriptions of individual regions of interest (ROIs) on the images. Though the radiomic data appear to be 2D maps, they have no strong spatial relationship on the feature maps. Thus, different from most of the other existing SSL methods, convolutional neural networks (CNNs)- based models are inappropriate to work as feature encoder for radiomic data. Actually, radiomic data are a set of vectors. In this sense, radiomic feature maps are similar to natural language data, where each word is commonly represented by a vector (a.k.a., word embeddings) and the whole sentence becomes a set of vectors. There exist implicit pathological or biological relationships among the different brain regions (i.e., ROIs) in the radiomic feature map, which is presented by how one a ROI is related to all other ROIs [33], [34]. As such, Transformer [52], more precisely, the built-in self-attention mechanism, can efficiently capture how individual ROI is related to all other ROIs. Thus, we believe that Transformer as the encoder network can learn better feature embeddings compared to other encoders (e.g., CNNs). Furthermore, ra- diomic data does not have a strong sequential relationship as in language data. That is, the order of brain regions (i.e., ROIs positions) is invariant to the radiological phenotypes (e.g., tumors, lesions, medical conditions, etc.). Accordingly, we removed the position encoding module in the typical Transformer to avoid the model to learn/remember the order of the ROIs that are invariant to downstream tasks. C. Radiomic Features Reconstruction Task To discover the latent relation among radiomic features from different ROIs, we designed the radiomic features reconstruc- tion task. The reconstruction pretext task is similar to the masked autoencoder (MAE) [53], which masks out a large random subset of image patches and pretrains a network to reconstruct the masked patches. The major difference is that, for the MRI radiomic data, we designed to mask several ROIs from the input radiomic feature maps and conduct a radiomic feature reconstruction task to help the model understand the latent relations among ROIs. To reach that, the input ̃xi is first fed to a Transformer to produce the high-level features ̃fi, and then ̃fi is fed into a multi-layer perceptron (MLP) to produce the reconstructed radiomic feature map ˆxi with the same feature dimension size as ̃xi. We defined our reconstruction loss for the first pretext task as a convex linear combination of distance metrics of square error and JS-Divergence. The square error measures the Euclidean distance between reconstructed radiomic feature map ˆxi and ground-truth radiomic feature map ̃xi. However, the square error only considers the distance metrics within the Euclidean space, while the probabilistic distance measure between the probability density function of ˆxi and ̃xi the was ignored. This may lead to an inaccurate distance measure for radiomic features that are high dimension [54]–[56]. To better learn the probability distribution between ˆxi and ̃xii, we designed a convex linear combination of square error and JS-Divergence using a weighting factor β ∈ [0, 1] to control each loss importance, such that (cid:88) (cid:88) Lr = β(cid:107)xi − ˆxij(k,N )(cid:107)2 i∈M j∈K + (1 − β)dJS (cid:0)p(xi)(cid:107)p(ˆxij(k,N ))(cid:1) (1) where ˆxij(k,N ) ∈ ˆxi represents the jth, j ∈ K, reconstructed radiomic feature map of ˆxi. dJS indicates the Jensen Shannon (JS) divergence [57] between two probability distributions of xi and z, which is defined as: dJS(p(xi)(cid:107)p(ˆxij(k,N ))) = + 1 2 1 2 dKL (p(xi)(cid:107)p(z)) dKL (cid:0)p(ˆxij(k,N ))(cid:107)p(z)(cid:1) (2) (cid:2)p(xi) + p(ˆxij(k,N ))(cid:3) and dKL indicates the where p(z) = 1 2 Kullback–Leibler (KL) divergence [58]. In practice, we used a SoftMax to generate the probabilities. β ∈ [0, 1] of Eq (1) denotes a weighting factor to leverage the square error loss and JS-Divergence as a convex linear combination. We also analyzed effects of β in our ablation study section. D. Subject-Similarity Discrimination Task To learn the subject-similarity information, we designed the subject-similarity discrimination task to learn the mask- invariant features by clustering the similar augmented samples and separating the dissimilar ones. As shown in Figure 1, ̃fi = { ̃fi1, ̃fi2, . . . , ̃fiK} denotes a set of embedding of masked maps, which is obtained by the Transformer F (*; θ) for ̃xi. We first apply L2 norm to normalize each ̃fij ∈ ̃fi, i.e., (cid:107) ̃fij(cid:107)2 = 1. Then, the negative log-likelihood for a similar pair ( ̃fiv, ̃fij), i (cid:54)= j, is defined as follows: (cid:96)d( ̃fiv, ̃fij) = − log (cid:80) T iv v,j∈K exp( ̃f (cid:80) j∈K exp( ̃f ̃fij/τ ) T iv ̃fmj/τ ) (cid:80) m∈M (3) where τ is the temperature scale parameter, which is set to 0.1 T empirically [22]. ̃f ̃fij denotes the inner product (e.g., Cosine iv similarity) between ̃fiv and ̃fij. Note, (cid:96)d( ̃fiv, ̃fij) is asymmetric, i.e., (cid:96)d( ̃fiv, ̃fij) (cid:54)= (cid:96)d( ̃fij, ̃fiv). Thus, the overall discrimination loss is described as: 1 2M [(cid:96)d( ̃fiv, ̃fij) + (cid:96)d( ̃fij, ̃fiv)] Ld = (cid:88) (4) i∈M where ̃fiv stays close to ̃fij in the embedding space when Ld is optimized over time by training the network. E. Representation Learning Objective 1) Loss Function: We define the total learning objective function as the weighted linear combination of a radiomic fea- tures construction task and a subject-similarity discrimination task. The objective loss function is defined as follows: L∗ = Lr + λLd (5) where λ is a weighting factor, which controls the importance of the subject-similarity discrimination task. We empirically set λ to 1 [28]. We also compared the model performance based on different λ in the ablation study. 5 2) Statistical Divergence View: We show the equivalent relation and properties of our learning objective loss using the Bregman divergence [59]. Let ψ : Ω → R be a strictly convex function, which is continuously differentiable on a closed convex set Ω. Given two vectors of p and q, the Bregman divergence between p and q is described as: dψ(p, q) = ψ(p) − ψ(q) − ∇ψ(q)T (p − q) (6) where ψ indicates a generating function that is convex and ∇ψ(q) represents the gradient of ψ(q). In below, we show that the learning objective L∗ can be formulated into d∗ ψ by ψ and dd rewriting Lr and Ld to dr ψ, respectively. For Lr of Eq (1), let ψ(xi) be (cid:104)xi, xi(cid:105), which is continuous differentiable and strictly convex in R. Hence, the Bregman divergence d(1) ψ (xi, ˆxij) is defined as follows: d(1) ψ (xi, ˆxij) = (cid:107)xi(cid:107)2 − (cid:107)ˆxij(cid:107)2 − (cid:104)xi − ˆxij, 2ˆxij(cid:105) = (cid:107)xi − ˆxij(cid:107)2 (7) let ψ(xi) = where (cid:104) (cid:105) denotes the inner product. Now, (cid:80) h∈H pxih log pxih be a strictly convex function, which is continuously differentiable in R. The corresponding Bregman divergence d(1) ψ (xi, z) is h∈H pzh = 1. Hence, based on Eq (cid:35) (pxih − pzh ) (cid:34) (cid:88) h∈H (8) d(2) ψ (xi, z) = (cid:88) h∈H pxih log pxih pzh − log exp = dKL (p(xi)(cid:107)p(z)) where (cid:80) h∈H pxih = (cid:80) (7)-(8), we finalize Lr as (cid:88) (cid:88) Lr = βd(1) ψ (xi, ˆxij) + (1 − β)d(2) ψ (p(xi), p(z)) (9) i∈M j∈K Next, we show Ld of Eq (3) belongs to the Bregman divergence. We first formulate (cid:96)d into a distance form without loss of generality. (cid:96)d( ̃fiv, ̃fij) = − log (cid:80) m∈M (cid:80) (cid:80) j∈K exp( ̃f ̃fmj/τ ) T iv ̃fij/τ ) j∈K exp( ̃f T iv  = log 1 + (cid:88) (cid:88) m(cid:54)=i j T exp( ̃f iv T ̃fmj/τ − ̃f iv  ̃fij/τ )  Using the Taylor approximation: (cid:96)d( ̃fiv, ̃fij) ≈ (cid:88) (cid:88) T exp( ̃f iv T ̃fmj/τ − ̃f iv ̃fij/τ ) m(cid:54)=i ≈ 1 + j (cid:88) (cid:88) T ̃f iv T ̃fmj/τ − ̃f iv ̃fij/τ m(cid:54)=i (cid:88) (cid:88) j ψ ( ̃fiv, ̃fmj) − d(1) d(1) ψ ( ̃fiv, ̃fij) ∝ (10) m(cid:54)=i j Hence, based on Eq (10), Ld is finalized as Ld ∝ d∗ ψ = 1 2M (cid:88) i (cid:88) { m(cid:54)=i (cid:88) j d(1) ψ ( ̃fiv, ̃fmj) − d(1) ψ ( ̃fiv, ̃fij) (cid:88) + v ψ ( ̃fij, ̃fmv) − d(1) d(1) ψ ( ̃fij, ̃fiv)} (11) Based on Eq (6-11), the minimizing the learning objective loss L∗ is equivalent to minimize two Bregman divergences. Thus, L∗ also follows the mathematical properties of non- negativity/positivity, convexity, linearity, duality, generalized Pythagorean theorem, and others of the Bregman divergence. We also compare our L∗ with other difference losses in the ablation study. IV. DATA AND EXPERIMENTS A. Datasets 1) Simulated Dataset: We simulated the radiomic features datasets based on Corso et al [60] to theoretically investigate the different SSL methods with different training sample sizes and the difficulty level of the class separation. Our simulation is based on the statistics information of the MRI images. First, we obtained radiomic feature maps from the MRI brain images, and calculated correlation matrix, skewness, and kurtosis, which capture important information about the real radiomic features. Next, we simulated non-Gaussian multivari- ate distributions using the computed statistics (e.g., correlation, skewness, kurtosis). In addition, considering that the range of simulated radiomic features may scale a lot, therefore, we re- scaled each simulated feature to the original features ranges of the CINEPS dataset (see below) using the same re-scaling method as [60]. We further randomly assign label '1s' to the 50% of data and '0s' to the rest of the data. The separation noise φ for the ith feature is defined as follows: (cid:48)0(cid:48) φ (cid:48)1(cid:48) φ (f ∗ i ) = f ∗ i − (f ∗ i ) = f ∗ i + ̄f ∗ i θi ̄f ∗ i θi , i ∈ [0, ∞] , i ∈ [0, ∞] 6 at high- (test score≤85) or low-risk (test score>85), and a regression task of predicting Bayley III scores (continuous). We applied dHCP (Developing Human Connectome Project) pipeline to segment the whole brain image into 87 region-of-interests (ROIs) based on an age-matched neonatal volumetric atlas [63], [64]. Briefly, the pipeline first segmented the T2 MRI image data into 9 tissue classes (e.g., cortical grey matter, white matter, ventricle) using the Draw-EM (Develop- ing brain Region Annotation with Expectation-Maximization) algorithm [64], and then registered the labeled neonatal atlases with 87 ROIs to the subject using a multi-channel registration approach. The neonatal atlas was created by manually labeling T1 and T2 brain MRI images from 20 neonatal subjects [63], [64]. The full list of 87 ROIs can be found in the original paper. Figure 2 illustrates the brain structure of ROIs of the brain atlas. After segmenting each T2-weighted brain image into 87 ROIs using the dHCP pipeline, we extracted 100 radiomics features from each ROI using the PyRadiomics pipeline [4], therefore resulting in a 2D radiomic feature map for each subject. Specifically, we utilized PyRadiomics [version: 3.0.1] to extract 100 features from feature classes shape [10 fea- tures], first order [19 features], Gray Level Co-occurrence Matrix (GLCM) [24 features], Gray Level Size Zone Ma- trix (GLSZM) [16 features], Gray Level Run Length Matrix (GLRLM) [16 features], Neighbouring Gray Tone Differ- ence Matrix (NGTDM) and Gray Level Dependence Matrix (GLDM) [14 features]. We first conduct image intensity Z- transform normalization and isotropic image voxel resampling (i.e., 1.0 x 1.0 x 1.0 mm3) on the original unfiltered images using 'sitkBSpline' as the interpolator. This was followed by quantitative metrics calculation using the width of the histogram bin as 25. (cid:48)0(cid:48) (cid:48)0(cid:48) are the noises for label (cid:48)0(cid:48) and (cid:48)1(cid:48), re- . φ where φ spectively. ̄f ∗ i denotes the mean of re-scaled feature f ∗ i and θi controls the difficulty of the class separation. For each selected sample size, we generated two different separation noises for the selected ROIs associated with the labels ((cid:48)0(cid:48) and (cid:48)1(cid:48)) to control the difficulty level of classification tasks. Afterward, we added the Gaussian noise from a standard normal distribution to the simulated dataset. 2) CINEPS Dataset: Cincinnati Infant Neurodevelopment Early Prediction Study (CINEPS) [61] collected T2-weighted MRI brain images from 362 very preterm infants (≤32 weeks gestational age) at Cincinnati Children's Hospital Medical Center (CCHMC). All infants with congenital or chromoso- mal anomalies that impact the central nervous system were excluded. Each subject was imaged at 39-44 weeks postmen- strual age on the same 3T Philips Ingenia scanner using a 32- channel head coil at CCHMC. Acquisition parameters for axial T2-weighted turbo spin-echo sequence is set as repetition time (TR)=8300 ms, echo time (TE)=166 ms, FA=90°, resolution 1.0 × 1.0 × 1.0 mm3, and time 3:53 min. For each subject, a Bayley Scale of Infant and Toddler Development, Third Ed. (Bayley III) cognitive scores [62] that reflect neurodevelop- ment were assessed at 2 years corrected age. We tested our models using a classification task of distinguishing subjects Fig. 2. Axial cross-section of the neonatal volumetric brain atlas (40 gestational weeks) used in the dHCP pipeline from inferior to superior slices. For each subject, the pipeline segmented the whole brain into 87 regions of interest (ROIs). 3) COEPS Dataset: COEPS Dataset: Columbus Early Pre- diction Study (COEPS) dataset includes 69 very preterm in- fants from Nationwide Children's Hospital (NCH). All infants with congenital or chromosomal anomalies that impact the central nervous system were excluded. Subjects were scanned at 38-43 weeks PMA on the same 3T MRI scanner (Skyra; Siemens Healthcare) with a 32-channel pediatric head coil at NCH. Acquisition parameters for axial T2-weighted fast spin-echo sequence are TR = 9500 ms, TE = 147 ms, FA = 150°, resolution 0.93 × 0.93 × 1.0 mm3 , and time 4:09 min. Cognitive Bayley III sub-scores were also collected for each subject at 2 years corrected age. We implemented the same radiomic feature processing pipeline to calculate radiomic feature maps as the CINEPS dataset. B. Experimental Setting 1) Model Implementation Details: As illustrated in Figure 1, we empirically set 3 Transformer blocks in the network encoder F (*; θ) in the tensor dimension of each radiomic feature map of ̃xi is M × N × 100, and the number of heads in the multi-head attention layer is set to 8 as default. Two MLP layers are included in F (*; θ) where the first MLP layer (100 nodes) with the residual norm connection is to produce a N × 100 attention map ̃ai, and it forwards to the second MLP layer (8 nodes) to produce the embedding of masked maps ̃fi with the dimension of N × 8. Then ̃fi is connected with a third MLP layer (100 nodes) and a L2 normalization layer to jointly learn the radiomic features reconstruction task and the subject similarity discrimination task, respectively. In each iteration of the proposed approach, we randomly selected a pair of subjects to perform a random-masking k ∈ [1, 30] with K=50 repetitions on the radiomic feature maps. Same as [28], the network is optimized using the Adam optimizer with a learning rate of 0.001 and a weight decay of 0.001. Note, the position encoding of the Transformer is discarded given no spatial or sequential relationships among the radiomic features. Finally, we fine-tune the pretrained F (*; θ) by adding a MLP layer (100 nodes) with a Softmax to perform the supervised downstream classification task using a weighted cross-entropy loss and regression tasks using the MSE loss function. We trained both pretext and downstream tasks for 500 epochs, and the batch-size is set to 8 for each epoch. The whole framework was implemented using python 3.8, Scikit-Learn 0.24.1, Pytorch 1.9.1, and Cuda 11.1 with a NVIDIA GeForce GTX 1660 SUPER GPU. 2) Competing SSL Approaches: We compared our method with other self-supervised methods, including predictive based methods (e.g., Rotation Prediction [43], Puzzle Solving [44]), reconstructive based methods (e.g., MLM [21]), and con- trastive based methods (e.g., Moco v1 [23], Invariant [50], SimCLR [22]). For a fully-supervised baseline model, we trained the same Transformer and MLP without pre-training on any pretext training epochs tasks. We used additional to ensure the model has been sufficiently optimized. We perform these methods using the code that has been released in previous publications. For [43], we transformed the input into four different degrees, i.e., 0°, 90°, 180°, and 270°, and trained a network for predicting these four rotations. We permutated the input into 32 different patch combinations in [44], then trained a network to classify the permutation order index. To compare with reconstructive-based methods [65], we performed the same training strategy as the radiomic features reconstruction task, the only difference is the optimization method that we only trained the network with MSE loss to 7 reconstruct the hidden radiomic features. To compare with contrastive methods [22], [23], [50], we applied the same data augmentation techniques to perform the unsupervised learning on embedding features space, the only difference is that we changed the encoder CNN backbone to the Transformer of our method. To have a fair comparison, we trained all SSL models on the Transformer with the same network architectures, batch size, and training optimizer, including the learning rate and the number of training epochs in both self-supervised stages (pretext task) and fine-tuning stage (downstream task). Since the fully-supervised baseline model does not contain a pre- training step on pretext tasks, we opted to train the model with 2000 epochs to ensure the fair comparison with other SSL models. 3) Model Evaluation: We evaluated our method in both regression and classification metrics. We used mean absolute error (MAE) and R2 to evaluate the predictive performance of our Bayley III cognitive score. For risk stratification (i.e., binary classification), we used balanced accuracy (BA), sensi- tivity (SEN), specificity (SPE), and the area under the receiver operating characteristic (ROC) curve (AUC) to evaluate clas- sification performance. We conducted a nested 10-fold cross-validation consisting of an inner loop and outer loop on the CINEPS dataset to assess internal validation. In the outer loop, we first separated the dataset into training data, validation data, and testing data in each of the 10 iterations. We then optimized the model on training-validation data without any information leaking from testing data. This validation process was repeated 100 times to report mean and standard deviation (SD) to ensure model reproducibility. We tested the optimized model trained from the CINEPS dataset using an unseen independent COEPS dataset. To show the statistical significance of the model compar- ison, we conducted the non-parametric Wilcoxon test for all statistical inference testing based on the α = 0.05 level. All statistical tests were conducted in R-4.0.3 (RStudio, Boston, MA, USA). C. Model Comparison Results with Simulation Data We compared our method with other SSL methods using the simulated datasets with different training sample sizes N and difficulty levels of the classification task. We generated varying numbers of synthetic data samples (N=50, 200, 500, 1000, 1500, 2000) with two difficulty levels, "easy task" (θ = 0.01) and "hard task" (θ =100), respectively. The results are shown in Figure 3. When N=50, each SSL method achieved an AUC above 0.60 on the dataset for the easy task but a lower AUC for the hard task. As N increases, the performance of each method increases since more training samples can improve model performance. Notably, our method can achieve the best classification performance with the highest AUC on both datasets in two tasks. The Invariant approach [50] obtained the second best in both tasks. Rotation [43] and jigsaw puzzle [44] had an inferior performance on the dataset in both tasks. The simulation results theoretically showed the effectiveness of the proposed collaborative SSL method. 8 Fig. 3. Classification performance comparison on the simulated radiomic dataset with different training sample sizes N and feature noises θ (high/low). Our collaborative self-supervised learning (SSL) method showed the best classification results as N increases in both two tasks. The data in the table are area under the receiver operating characteristic curve (AUC) values. Fig. 4. Bayley III test score regression for early prediction of cognitive deficits in VPIs at 2 years of corrected age on the CINEPS dataset. We included the top 2 self-supervised methods based on the AUC of cognitive deficits risk stratification. We report the mean absolute error (MAE) and R2 to evaluate the regression performance. D. Model Comparison Results with CINEPS Dataset We evaluate the performance for cognitive deficits risk classification and Bayley III Cognitive score regression. As shown in Table I, our methods achieved the best classification performance among other competing SSL methods. Com- pared to the second-best method Invariant [50], our method significantly improved classification performance by around 5.7% (p<0.001) on balanced accuracy, 9.4% (p<0.001) on sensitivity, 1.9% (p<0.001) on specificity, and 0.07 (p<0.001) for AUC. The predictive-based methods, [43] and [44] had comparable results as the supervised learning baseline. Our method outperformed the supervised learning baseline, 76.3% vs 66.8% on balanced accuracy and 0.78 vs 0.66 for AUC. For Cognitive score prediction (Figure 4), our method achieved the best regression performance with a MAE of 12.9 and R2 of 0.32 (p<0.001), showing a significant correlation between the predicted cognitive score and the actual cognitive assessment. Compared with the second-best model Invariant [50], our method significantly achieves a lower MAE (p<0.001) and a higher R2 (p<0.001). These results further demonstrated the effectiveness of our method. TABLE I MODEL COMPARISON ON THE CINEPS DATASET FOR EARLY RISK STRATIFICATION OF VERY PRETERM INFANTS AT HIGH RISK FOR COGNITIVE DEFICITS. NETWORK ENCODER: TRANSFORMER. EXPERIMENTAL RESULTS ARE REPRESENTED AS MEAN (SD). Supervised [52] Moco v1 [23] MLM [65] SimCLR [22] Invariant [50] Jigsaw Puzzle [44] Rotation [43] Ours BA (%) 67.4(4.7) 70.3(4.8) 68.9(5.2) 69.3(5.2) 70.6(4.9) 64.8(4.4) 66.2(4.1) 76.3(4.9) SEN (%) 66.2(6.7) 68.4(7.6) 66.7(7.5) 67.5(7.5) 66.4(7.2) 63.1(5.4) 64.2(5.3) 75.8(6.9) SPE (%) 68.5(6.2) 72.2(6.4) 71.2(5.9) 71.1(6.8) 74.8(5.8) 66.5(5.5) 68.1(5.2) 76.7(6.1) AUC 0.67(0.07) 0.69(0.06) 0.68(0.07) 0.68(0.07) 0.71(0.07) 0.62(0.06) 0.64(0.06) 0.78(0.07) E. Model Comparison Results With COEPS Dataset To show the generalization of our method, we performed an external validation on the COEPS dataset by training all the models on the CINEPS dataset. The results are shown in Table II. Moco v1 [23] and SimCLR [22] had the lowest performance in classifying the high-risk group of cognitive deficits, and predicting the Bayley III cognitive score. It is observed that Invariant [50] showed very promising predictive capability with the highest sensitivity and precisely predicted Bayley III cognitive score. Again, our method can achieve the best performance in most of the tasks. It had a higher risk classification performance (1-2% improvement in AUC) than Invariant [50]. For regression, our method also demonstrated a strong predictive capability. Significant linear relationships were observed between the predicted Bayley III cognitive scores and the actual Bayley III scores R2 = 0.30 (p<0.001) for cognitive development. These external results further illus- trated the generalization capability of our method. TABLE II MODEL COMPARISON SELF-SUPERVISED LEARNING METHODS ON THE COEPS DATASET FOR EARLY PREDICTION OF VERY PRETERM INFANTS AT HIGH-RISK FOR COGNITIVE DEFICITS. ALL MODELS ARE OPTIMIZED ON THE CINEPS DATASET. BA, SEN, AND SPE ARE REPRESENTED WITH UNIT: %. Supervised [52] Moco v1 [23] SimCLR [22] Invariant [50] MLM [65] Ours BA 62.2 64.0 63.0 68.9 64.7 71.4 SEN 60.0 50.0 60.0 70.0 60.0 70.0 SPE 64.4 78.0 66.1 67.8 69.5 72.9 AUC MAE 23.4 0.63 25.3 0.62 22.1 0.65 18.5 0.69 21.3 0.65 16.5 0.70 R2 0.14 0.12 0.17 0.25 0.14 0.30 F. Ablation Study of The Proposed SSL Model 1) Comparison of Each Individual Collaborative Pretext Task: Our method formulated two Collaborative Pretext tasks to learn radiomic data. To investigate individual pretext tasks that work collaboratively, we analyzed the effects of each pretext task for identifying cognitive deficits using the CINEPS dataset. As shown in Table III, model trained with the subject-similarity discrimination task alone achieved better classification performance than with the radiomic features reconstruction task alone, i.e., 72.0% vs 69.8% for BA, 0.72 vs 0.70 for AUC. Such phenomenon has been observed in [28], indicating the contrastive-based pretext may perform [51], better than other hand-crafted predictive-based pretext tasks. Notably, our method, which collaboratively used two pretext tasks, can achieve a higher classification performance than the two individual tasks with 0.08 (p<0.001) and 0.06 p<0.001) improvement on AUC, respectively. MAE=12.9R2=0.32OursInvariantR2=0.23MAE=15.9(A)(B) 9 TABLE III COMPARISON OF EACH INDIVIDUAL COLLABORATIVE TASK FOR THE COGNITIVE DEFICITS RISK STRATIFICATION ON THE CINEPS DATASET. effectiveness of both the radiomic features reconstruction task and the subject-similarity discrimination task. Reconstruction Discrimination Ours BA (%) 69.8(5.1) 72.0(5.5) 76.3(4.9) SEN (%) 67.2(7.5) 70.5(6.7) 75.8(6.9) SPE (%) 72.3(6.2) 73.4(5.5) 76.7(6.1) AUC 0.70(0.07) 0.72(0.08) 0.78(0.07) 2) Effects of JS-Divergence in Reconstruction Task: We an- alyzed the effects of the JS-Divergence by varying β ∈ [0, 1]. The results are shown in Table IV. β = 0 denotes that we only train a subject-similarity discrimination task, achieving 0.72 AUC. As β increases, the importance of the JS-Divergence decreases during the model training. β = 1 denotes that the model is only trained with a square error loss to reconstruct the hidden radiomic features, which achieves 0.70 AUC. In the current study, when β = 0.5, the prediction performance reached to the peak with a 76.3% balanced accuracy and a 0.78 AUC. TABLE IV THE EFFECTS OF THE JS-DIVERGENCE IN THE RADIOMIC RECONSTRUCTION TASK. β INDICATES A WEIGHTING FACTOR OF THE JS-DIVERGENCE IN A CONVEX COMBINATION IN EQ 1. WE COMPARED THE EFFECTS OF DIFFERENT β FOR THE COGNITIVE DEFICITS RISK STRATIFICATION ON THE CINEPS DATASET BY 10-FOLD CROSS-VALIDATION. β = 0.0 β = 0.2 β = 0.5 β = 0.7 β = 1.0 BA (%) 72.0(5.5) 68.3(4.5) 76.3(4.9) 71.5(5.1) 69.8(5.1) SEN (%) 70.5(6.7) 67.4(5.9) 75.8(6.9) 70.5(6.8) 67.2(7.5) SPE (%) 73.4(5.5) 69.2(5.3) 76.7(6.1) 72.4(6.1) 72.3(6.2) AUC 0.72(0.08) 0.69(0.06) 0.78(0.07) 0.71(0.06) 0.70(0.07) 3) Importance of Subject-Similarity Discrimination Task: tasks, Our proposed method is based on two pretext i.e., radiomic features reconstruction and subject-similarity dis- crimination. Depending on the position of masked ROIs, the radiomic features reconstruction task may be sensitive and it is prone to produce mask-dependent feature repre- sentations. Therefore, we consider that the subject-similarity discrimination task collaboratively aids the radiomic features reconstruction to learn the mask-invariant features. Two pretext tasks of our method are collaboratively trained to learn the radiomic features, i.e., ̃fi. Here, we analyze the importance of the subject-similarity discrimination task in our method. To discover the effects of the subject-similarity discrimination task, we trained our model with different λ, which indi- cates the importance of the subject-similarity discrimination task in Eq (5). The results are shown in Table V. When λ = 0.0, which denotes that the network is trained only with a radiomic features reconstruction task, achieves 69.8% on balanced accuracy and 0.70 on AUC. As λ increased, the model obtained the best classification performance on cognitive deficits risk classification with 76.3% on balanced accuracy and 0.78 on AUC. When λ continues to increase, the classification performance started to decrease to 71.9% on balanced accuracy and 0.72 on AUC. Our method achieved the best classification performance on the CINEPS dataset when λ = 1.0. These results further demonstrate the collaborative TABLE V THE IMPORTANCE OF THE SUBJECT-SIMILARITY DISCRIMINATION TASK. λ INDICATES A WEIGHTING FACTOR OF THE OVERALL DISCRIMINATION LOSS FUNCTION IN EQ (5). WE COMPARED THE EFFECTS OF DIFFERENT λ FOR THE COGNITIVE DEFICITS RISK STRATIFICATION ON THE CINEPS DATASET BY 10-FOLD CROSS-VALIDATION. λ = 0.0 λ = 0.5 λ = 1.0 λ = 1.5 λ = 2.0 BA (%) 69.8(5.1) 71.7(5.1) 76.3(4.9) 74.5(4.6) 71.9(5.3) SEN (%) 67.2(7.5) 70.5(7.1) 75.8(6.9) 73.5(6.5) 70.2(7.1) SPE (%) 72.3(6.2) 72.9(5.9) 76.7(6.1) 75.4(5.7) 73.5(6.5) AUC 0.70(0.07) 0.73(0.08) 0.78(0.07) 0.74(0.06) 0.72(0.06) 4) Feature Visualization: To verify whether our collabora- tive two pretext tasks can successfully learn the latent radiomic feature representation, we used the T-SNE plot to visualize the learned features after the last MLP layer of our model in Figure 5. The self-supervised learned features from [43] and [44] showed a more mixed pattern between positive and neg- ative samples. Compared to other contrastive-based methods, i.e., [22], [23], Invariant [50] had a more separable decision boundary. It is observed that our mode that collaboratively used two pretext tasks showed a clearer potential decision boundary between the two classes. This feature visualization demonstrates that our collaborative self-supervised method can help the model to learn more discriminative patterns. 5) Loss Functions Comparison: Our learning objective loss function can be viewed as a combination of two Breg- man divergences, including geometry-based and probabilistic- based. To show the advantage of the loss function of our method, we compared different divergence functions (e.g., MSE and KL-divergence) with our loss function. Note, we used MLM [65] and SimCLR [22] as the baseline self- supervised methods and trained models using the MSE and KL-divergence, respectively. To have a fair comparison, we trained each loss function for 200 epochs on the CINEPS dataset with 10-fold cross-validation. As shown in Figure 6, we observed our proposed loss function converges faster than MSE and KL-divergence during the pretext task training stage and consistently outperformed MSE and KL-divergence with higher AUC in the downstream classification stage. These results demonstrate the effectiveness of our learning objective loss using the Bregman divergence. 6) Model Performance on Lower Regiment Labeled Data: To investigate whether our proposed collaborative SSL method has a robust predictive ability on the lower regiment labeled dataset, we first pretrained our method using the full CINEPS training dataset and then fine-tuned the pretrained model on different-sized portions (i.e., 10%, 20%, 40%, 60%, and 80%) of the training dataset. The results are shown in Figure 7. With only 10% of the training dataset (N=37), the proposed method achieved a 0.63 AUC and 65.0% balanced accuracy, which was significantly higher (p < 0.001) than a supervised baseline model with an AUC of 0.54 and a balanced accuracy of 52.0%. This suggests that the SSL model performed well on the lower regiment labeled dataset. As the sample size increased, the prediction performance of both methods increased, and the 10 Fig. 5. Feature visualization of original radiomic features (left) and self-supervised learned features (right) from the CINEPS dataset. We extracted the features from the last MLP layer of the Transformer and use the T-SNE to visualize the features. Our method showed more separable patterns compared to other self-supervised methods. Orange points represent the low-risk group and blue points represent the high-risk group. Fig. 6. Self-supervised training loss (A) vs. downstream testing AUC (B) on the CINEPS dataset with 10-fold cross-validation. We compare our learning objective loss with MSE and KL-divergence on MLM and SimCLR, respectively. proposed collaborative SSL model consistently outperformed the supervised baseline model. These results further demon- strated that our proposed method could retrain competitive prediction performance on small sample size. 7) Effects of the Number of Masked ROIs: In Table VI, we showed the model performance with the different number of masked ROIs. As the number of masked ROIs increased, the model performance increased until a critical point (e.g., the model 30 masked ROIs in our work). We noted that performance decreased when the number of masked ROIs was greater than 30. Similar trends were also observed using other competitive SSL models. Note, the purpose of the proposed pretext task is to understand/perceive the input images (i.e., gain prior "knowledge") through reconstructing the masked ROIs, and such knowledge can thereafter be reused for the downstream task. The observation from Table VI may in- dicate that a small number of the masked ROIs was not challenging enough for the reconstruction task, while a large Fig. 7. Classification performance on different-sized portions of the CINEPS training dataset. We pretrained our collaborative SSL method using the full CINEPS training dataset and fine-tuned it on the different proportions of the training data. number was over-challenging. In both scenarios, the pretrained model performed worse than the optimal number we chose in understanding/perceiving the input images. 8) Effects of Network Encoder: Our method is specifically designed for the MRI radiomic data, which does not have a strong spatial or sequential correlation among ROIs. In this section, we compared different network encoders that have been utilized for computer vision (i.e., CNNs) and natural lan- guage processing (i.e., Transformer with position encoding) in Table VII. It is observed that using VGG19 [66] and ResNet18 [67] as the backbone of the network encoder achieved lower Original radiomic features(A)(B) TABLE VI EFFECTS OF THE NUMBER OF MASKED ROIS IN THE PRETEXT TASK ON THE PREDICTION PERFORMANCE ON THE CINEPS DATASET. AUC IS SELECTED AS THE EVALUATION METRIC. # ROIs 10 20 30 40 Rotation [43] 0.59(0.05) 0.60(0.04) 0.64(0.08) 0.63(0.07) SimCLR [22] Moco v1 [23] 0.65(0.04) 0.66(0.08) 0.68(0.04) 0.65(0.06) 0.63(0.04) 0.67(0.04) 0.69(0.08) 0.66(0.07) Ours 0.73(0.05) 0.75(0.07) 0.78(0.07) 0.76(0.06) prediction results on a cognitive deficits risk stratification task. This is because the convolutional process of the ResNet18 cannot capture the latent relationship among the radiomic features of various ROIs. A Transformer with position en- coding (TransForPos) [52] achieved higher performance than ResNet18. Notably, our method using a Transformer without a position encoding module significantly outperformed (p¡0.001) a VGG19, a ResNet18, and a Transformer with a position encoding module. These results showed the effectiveness of our network encoder designed specifically for radiomic data." TABLE VII EFFECTS OF DIFFERENT NETWORK ENCODERS FOR THE COGNITIVE DEFICITS RISK STRATIFICATION ON THE CINEPS DATASET VGG19 [66] ResNet18 [67] TransForPos [52] Ours BA (%) 65.3(4.8) 64.9(4.6) 74.0(5.3) 76.3(4.9) SEN (%) 64.7 (6.2) 63.5(5.9) 73.0(7.5) 75.8(6.9) SPE (%) 65.9(5.5) 66.2(5.1) 74.9(5.9) 76.7(6.1) AUC 0.66(0.07) 0.64(0.08) 0.75(0.06) 0.78(0.07) 9) Compare with MAE Method: Our radiomic features re- construction task is similar to the masked autoencoder (MAE) [53], which aims to reconstruct the randomly masked patches from the images. In here, we compared our method with the MAE using an internal validation on the CINEPS dataset and then performed an external validation on the COEPS dataset. We masked several random 2D patches on the radiomic feature map and then designed a pretext task to reconstruct the masked patches. Same as [53], we performed random masking of 75% of the patches on the radiomic features and used the same encoder network (Transformer) for consistency. The results are shown in Table VIII and Table IX. Compared to the MAE method, our radiomic feature reconstruction task achieved a better prediction performance. It is likely due to the MAE method masks several patches on the radiomic feature map, which does not consider the pathological relationship among the ROIs. These results demonstrated the importance of pathological relationships that existed in ROIs that is helpful for the cognitive deficits risk stratification. TABLE VIII COMPARISON WITH THE MAE METHOD FOR THE COGNITIVE DEFICITS RISKS STRATIFICATION ON THE CINEPS DATASET. MAE [53] Reconstruction Ours BA (%) 68.2(4.5) 69.8(5.1) 76.3(4.9) SEN (%) 65.5(6.0) 67.2(7.5) 75.8(6.9) SPE (%) 70.8(5.8) 72.3(6.2) 76.7(6.1) AUC 0.67(0.04) 0.70(0.07) 0.78(0.07) 11 TABLE IX COMPARISON WITH THE MAE METHOD FOR THE COGNITIVE DEFICITS RISKS STRATIFICATION ON THE COEPS DATASET. MAE [53] Reconstruction Ours BA (%) 63.9 69.8 71.4 SEN (%) 60.0 70.0 70.0 SPE (%) 67.8 69.5 72.9 AUC 0.62 0.65 0.70 10) Computation Time Comparison Results with CINEPS Dataset: Computation Time Comparison Results with CINEPS Dataset- In this section, we provided computation time for our method in comparison to SimCLR and Invariant methods. The majority of the time cost of self-supervised learning is pretraining the pretext tasks. So, we only recorded the computation time for one epoch in the pretraining pretext task stage. The results are shown in Table X. Our method had the highest computation time compared to the two SimCLR and Invariant, since our method contains two collaborative pretext tasks, while only one pretext task existed in the other two methods. Since the SSL pretraining is commonly applied offline, we expect the extra computational time would not impact future applications of the proposed collaborative SSL method. TABLE X COMPUTATION TIME COMPARISON FOR ONE EPOCH DURING A PRETEXT TASK PRETRAINING STAGE ON THE CINEPS DATASET. (UNIT: SECONDS) Seconds SimCLR [22] 587.22 Invariant [50] 547.15 Ours 874.34 V. DISCUSSION Radiomics techniques are an important tool in assessing various diseases for medical image-based diagnosis, such as neurological impairments [11], [37], [68], cancer [6], [69], and liver disease [18], [38], [39]. With the advancement of deep learning techniques (e.g., CNNs), computer-aided diagnosis has shown great promise in supporting the research community. Although deep learning techniques achieve im- mense success with diagnosis tasks, these methods focus on extracting the deep features from raw images, which usually lose the interpretation for the researchers. Instead of learn- ing directly from raw medical images, radiomics offers an interpretable strategy by extracting high-throughput features to provide statistical descriptions of raw medical images [68], [70]. However, supervised learning models usually require a large number of human annotations and labeling with domain knowledge, which can be expensive and timely to obtain. SSL has been playing an efficient role to provide solutions for this challenge by learning latent feature representation from data itself without human annotations. In this work, we proposed a novel collaborative self- supervised learning method to learn radiomic data. Differ- ent than previous SSL methods [22], [23], [43], [44], [50], our method is specially designed to learn radiomic data. We designed two collaborative pretext tasks, i.e., radiomic features reconstruction and subject-similarity discrimination, to retrieve latent biological and pathological relations among different ROIs and discover the discriminative patterns from these hidden radiomic features, respectively. Thus, the subject- similarity discrimination task helps the radiomic features re- construction task to better learn the robust feature representa- tion, which is beneficial for the supervised downstream task, i.e., classification and regression. Our method is validated on three datasets, i.e., simulation, CINEPS, and COEPS datasets, in which our method continued achieving the best prediction performance in terms of both classification and regression tasks among other SSL methods. We analyzed our collaborative self-supervised methods using the Bregman divergence. We considered the implicit connection between the learning objective loss function and the Bregman divergence and provided mathematical proof to show the properties of our loss function. As shown in Eq (11), our loss function considers two perspectives of both geometric divergence and probabilistic divergence during training. To show the advantage of our learning objective function, we conducted a loss function comparison in Figure 6, demonstrating the efficiency of training loss convergence and the classification performance of our proposed loss using the Bregman divergence. There are some other pretext tasks, such as rotation [43], and jigsaw puzzles [44], which learn spatial information from the training data but demonstrated lower performance in this study. This is due to the non- spatial dependencies in radiomic data. Moco v1 [23] and SimCLR [22] are two self-supervised methods that rely on a larger batch size during training that may not be suitable for the radiomic data, in which the sample size is usually small. MLM [65] predicts masked/hidden features between input and its augmentation but considers less correlation only between augmented data. In our results, Invariant [50] also achieved plausible results on our radiomic data, outperforming other hand-crafted predictive-based pretext tasks. Invariant is a contrastive learning method to learn feature embeddings by pulling similar samples and pushing dissimilar samples during the training. The main idea is that the features of the same instance from different data augmentations should be spread-out, i.e., invariant. This ensures that the model can learn a discriminative feature embedding by optimizing the inner products of instance features. With extensive experiments, our method demonstrated the supervisor prediction performance, which also supports the theoretical properties of our method. Our work has certain limitations. First, we only considered single modality MRI data in the current study. There are some other SSL methods, such as modality-invariant [Li, et al, 2020], which were designed to utilize multimodal medical data to improve model performance. In the future, we will investigate how to apply these methods to learn more repre- sentative features for downstream tasks when multimodal data is available. Second, our model is pretrained using CINEPS data containing 362 patients, which is considered a large dataset imaging domain. The impact of a small size of unlabeled data on pre-training a pretext task is less considered. Whether the proposed self-supervised method with other similar kinds requires a large amount of unlabeled data for pretraining has not been thoroughly investigated and in the medical 12 will be of interest to future work. Another limitation is that the external validation dataset (i.e., COEPS dataset) only contained 69 subjects, of which 10 subjects were from the high-risk group. This affects prediction performance, where a few samples can cause a large variation in classifying the high- risk group (i.e., sensitivity measures). Moving forward, we will need to evaluate our method on a larger external dataset to evaluate generalizability. VI. CONCLUSION In this paper, we proposed a novel collaborative self- supervised learning method for learning radiomic data. Our main idea is to collaboratively train our model on two pretext tasks i.e., a radiomic features reconstruction task and a subject- similarity discrimination task, to learn the latent feature rep- resentation from the radiomic data. Extensive experimental results demonstrated the effectiveness of our method. With further refinement, our method may facilitate computer-aided diagnosis applications in clinical practice without large-scale annotated datasets. REFERENCES [1] P. Lambin et al., "Radiomics: extracting more information from medical images using advanced feature analysis," European journal of cancer, vol. 48, no. 4, pp. 441–446, 2012. [2] R. GGillies, P. Kinahan, and H. Hricak, "Radiomics: Images are more than pictures," They Are Data. Radiology, vol. 278, no. 2, pp. 563–577, 2016. [3] A. Zwanenburg et al., "The image biomarker standardization initiative: image-based standardized quantitative radiomics for high-throughput phenotyping," Radiology, vol. 295, no. 2, p. 328, 2020. [4] J. J. Van Griethuysen et al., "Computational radiomics system to decode the radiographic phenotype," Cancer research, vol. 77, no. 21, pp. e104– e107, 2017. [5] A. Zwanenburg et al., "Assessing robustness of radiomic features by image perturbation," Scientific reports, vol. 9, no. 1, pp. 1–10, 2019. [6] X. Ou et al., "Radiomics based on 18f-fdg pet/ct could differentiate breast carcinoma from breast lymphoma using machine-learning ap- proach: A preliminary study," Cancer medicine, vol. 9, no. 2, pp. 496– 506, 2020. [7] F. Isensee, P. Kickingereder, W. Wick, M. Bendszus, and K. H. Maier- Hein, "Brain tumor segmentation and radiomics survival prediction: Contribution to the brats 2017 challenge," in International MICCAI Brainlesion Workshop. Springer, 2017, pp. 287–297. [8] S. S. Alahmari, D. Cherezov, D. B. Goldgof, L. O. Hall, R. J. Gillies, and M. B. Schabath, "Delta radiomics improves pulmonary nodule malignancy prediction in lung cancer screening," Ieee Access, vol. 6, pp. 77 796–77 806, 2018. [9] A. Conti, A. Duggento, I. Indovina, M. Guerrisi, and N. Toschi, "Radiomics in breast cancer classification and prediction," in Seminars in cancer biology, vol. 72. Elsevier, 2021, pp. 238–250. [10] P. Afshar, A. Mohammadi, K. N. Plataniotis, A. Oikonomou, and H. Be- nali, "From handcrafted to deep-learning-based cancer radiomics: chal- lenges and opportunities," IEEE Signal Processing Magazine, vol. 36, no. 4, pp. 132–160, 2019. [11] Q. Feng and Z. Ding, "Mri radiomics classification and prediction in alzheimer's disease and mild cognitive impairment: a review," Current Alzheimer Research, vol. 17, no. 3, pp. 297–309, 2020. [12] C. Salvatore, I. Castiglioni, and A. Cerasa, "Radiomics approach in the neurodegenerative brain," Aging Clinical and Experimental Research, vol. 33, no. 6, pp. 1709–1711, 2021. [13] L.-B. Cui et al., "Disease definition for schizophrenia by functional connectivity using radiomics strategy," Schizophrenia bulletin, vol. 44, no. 5, pp. 1053–1059, 2018. [14] Y. W. Park et al., "Differentiating patients with schizophrenia from healthy controls by hippocampal subfields using radiomics," Schizophre- nia Research, vol. 223, pp. 337–344, 2020. [15] H. J. Park, B. Park, and S. S. Lee, "Radiomics and deep learning: hepatic applications," Korean Journal of Radiology, vol. 21, no. 4, pp. 387–401, 2020. [16] F. Valdora, N. Houssami, F. Rossi, M. Calabrese, and A. S. Tagliafico, "Rapid review: radiomics and breast cancer," Breast cancer research and treatment, vol. 169, no. 2, pp. 217–229, 2018. [17] L. He et al., "Machine learning prediction of liver stiffness using clinical and t2-weighted mri radiomic data," American Journal of Roentgenol- ogy, vol. 213, no. 3, pp. 592–601, 2019. [18] W. K. Jeong, N. Jamshidi, E. R. Felker, S. S. Raman, and D. S. Lu, "Radiomics and radiogenomics of primary liver cancers," Clinical and molecular hepatology, vol. 25, no. 1, p. 21, 2019. [19] N. Beig, K. Bera, and P. Tiwari, "Introduction to radiomics and ra- diogenomics in neuro-oncology: implications and challenges," Neuro- oncology Advances, vol. 2, no. Supplement 4, pp. iv3–iv14, 2020. [20] H. Li, N. A. Parikh, and L. He, "A novel transfer learning approach to enhance deep neural network classification of brain functional connec- tomes," Frontiers in neuroscience, vol. 12, p. 491, 2018. [21] Z. Lan, M. Chen, S. Goodman, K. Gimpel, P. Sharma, and R. Soricut, "Albert: A lite bert for self-supervised learning of language representa- tions," arXiv preprint arXiv:1909.11942, 2019. [22] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, "A simple framework for contrastive learning of visual representations," in International conference on machine learning. PMLR, 2020, pp. 1597–1607. [23] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick, "Momentum contrast for unsupervised visual representation learning," in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2020, pp. 9729–9738. [24] A. Kolesnikov, X. Zhai, and L. Beyer, "Revisiting self-supervised visual representation learning," in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2019, pp. 1920–1929. [25] X. Li, M. Jia, M. T. Islam, L. Yu, and L. Xing, "Self-supervised feature learning via exploiting multi-modal data for retinal disease diagnosis," IEEE Transactions on Medical Imaging, vol. 39, no. 12, pp. 4023–4033, 2020. [26] D. Tomar, B. Bozorgtabar, M. Lortkipanidze, G. Vray, M. S. Rad, and J.-P. Thiran, "Self-supervised generative style transfer for one-shot medical image segmentation," in Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2022, pp. 1998–2008. [27] M. Nadif and F. Role, "Unsupervised and self-supervised deep learning approaches for biomedical text mining," Briefings in Bioinformatics, vol. 22, no. 2, pp. 1592–1603, 2021. [28] X. Li et al., "Rotation-oriented collaborative self-supervised learning for retinal disease diagnosis," IEEE Transactions on Medical Imaging, vol. 40, no. 9, pp. 2284–2294, 2021. [29] S. Ji, M. H ̈oltt ̈a, and P. Marttinen, "Does the magic of bert apply to medical code assignment? a quantitative study," Computers in Biology and Medicine, vol. 139, p. 104998, 2021. [30] X. Zhuang, Y. Li, Y. Hu, K. Ma, Y. Yang, and Y. Zheng, "Self-supervised feature learning for 3d medical images by playing a rubik's cube," in International Conference on Medical Image Computing and Computer- Assisted Intervention. Springer, 2019, pp. 420–428. [31] W. Bai et al., "Self-supervised learning for cardiac mr image segmen- tation by anatomical position prediction," in International Conference on Medical Image Computing and Computer-Assisted Intervention. Springer, 2019, pp. 541–549. [32] Z. Feng, C. Xu, and D. Tao, "Self-supervised representation learning by rotation feature decoupling," in Proceedings of the IEEE/CVF Confer- ence on Computer Vision and Pattern Recognition, 2019, pp. 10 364– 10 374. [33] B. Peng et al., "A multilevel-roi-features-based machine learning method for detection of morphometric biomarkers in parkinson's disease," Neuroscience letters, vol. 651, pp. 88–94, 2017. [34] P. Liu, P. Li, W. He, and L.-Q. Zhao, "Liver and spleen volume variations in patients with hepatic fibrosis," World Journal of Gastroenterology: WJG, vol. 15, no. 26, p. 3298, 2009. [35] D. K. Thompson et al., "Tracking regional brain growth up to age 13 in children born term and very preterm," Nature communications, vol. 11, no. 1, pp. 1–11, 2020. [36] A. Cajanus et al., "The association between distinct frontal brain volumes and behavioral symptoms in mild cognitive impairment, alzheimer's disease, and frontotemporal dementia," Frontiers in neurol- ogy, vol. 10, p. 1059, 2019. [37] M. Bang et al., "An interpretable multiparametric radiomics model for the diagnosis of schizophrenia using magnetic resonance imaging of the corpus callosum," Translational psychiatry, vol. 11, no. 1, pp. 1–8, 2021. 13 [38] M. P. Starmans, R. L. Miclea, S. R. Van Der Voort, W. J. Niessen, M. G. Thomeer, and S. Klein, "Classification of malignant and benign liver tumors using a radiomics approach," in Medical Imaging 2018: Image Processing, vol. 10574. International Society for Optics and Photonics, 2018, p. 105741D. [39] J. Wei et al., "Radiomics in liver diseases: Current progress and future opportunities," Liver International, vol. 40, no. 9, pp. 2050–2063, 2020. [40] H. Yue et al., "Machine learning-based ct radiomics method for predict- ing hospital stay in patients with pneumonia associated with sars-cov-2 infection: a multicenter study," Annals of translational medicine, vol. 8, no. 14, 2020. [41] L. Peng et al., "Distinguishing true progression from radionecrosis after stereotactic radiation therapy for brain metastases with machine learning and radiomics," International Journal of Radiation Oncology* Biology* Physics, vol. 102, no. 4, pp. 1236–1243, 2018. [42] L. Brunese, F. Mercaldo, A. Reginelli, and A. Santone, "An ensemble learning approach for brain cancer detection exploiting radiomic fea- tures," Computer methods and programs in biomedicine, vol. 185, p. 105134, 2020. [43] S. Gidaris, P. Singh, and N. Komodakis, "Unsupervised repre- sentation learning by predicting image rotations," arXiv preprint arXiv:1803.07728, 2018. [44] M. Noroozi and P. Favaro, "Unsupervised learning of visual representa- tions by solving jigsaw puzzles," in European conference on computer vision. Springer, 2016, pp. 69–84. [45] H. Spitzer, K. Kiwitz, K. Amunts, S. Harmeling, and T. Dickscheid, "Improving cytoarchitectonic segmentation of human brain areas with self-supervised siamese networks," in International Conference on Med- ical Image Computing and Computer-Assisted Intervention. Springer, 2018, pp. 663–671. [46] X. Liu et al., "Self-supervised learning: Generative or contrastive," IEEE Transactions on Knowledge and Data Engineering, 2021. [47] I. Goodfellow, Y. Bengio, and A. Courville, Deep learning. MIT press, 2016. [48] D. Wu, H. Ren, and Q. Li, "Self-supervised dynamic ct perfusion image denoising with deep neural networks," IEEE Transactions on Radiation and Plasma Medical Sciences, vol. 5, no. 3, pp. 350–361, 2020. [49] L. Chen, P. Bentley, K. Mori, K. Misawa, M. Fujiwara, and D. Rueck- ert, "Self-supervised learning for medical image analysis using image context restoration," Medical image analysis, vol. 58, p. 101539, 2019. [50] M. Ye, X. Zhang, P. C. Yuen, and S.-F. Chang, "Unsupervised em- bedding learning via invariant and spreading instance feature," in Pro- ceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019, pp. 6210–6219. [51] J.-B. Grill et al., "Bootstrap your own latent-a new approach to self- supervised learning," Advances in Neural Information Processing Sys- tems, vol. 33, pp. 21 271–21 284, 2020. [52] A. Vaswani et al., "Attention is all you need," Advances in neural information processing systems, vol. 30, 2017. [53] K. He, X. Chen, S. Xie, Y. Li, P. Doll ́ar, and R. Girshick, "Masked au- toencoders are scalable vision learners," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022, pp. 16 000–16 009. [54] T. Saito and J.-I. Toriwaki, "New algorithms for euclidean distance transformation of an n-dimensional digitized picture with applications," Pattern recognition, vol. 27, no. 11, pp. 1551–1565, 1994. [55] L. Wang, Y. Zhang, and J. Feng, "On the euclidean distance of images," IEEE transactions on pattern analysis and machine intelligence, vol. 27, no. 8, pp. 1334–1339, 2005. [56] L. Bai and E. R. Hancock, "Graph kernels from the jensen-shannon divergence," Journal of mathematical imaging and vision, vol. 47, no. 1, pp. 60–69, 2013. [57] J. Lin, "Divergence measures based on the shannon entropy," IEEE Transactions on Information theory, vol. 37, no. 1, pp. 145–151, 1991. [58] S. Kullback and R. A. Leibler, "On information and sufficiency," The annals of mathematical statistics, vol. 22, no. 1, pp. 79–86, 1951. [59] L. M. Bregman, "The relaxation method of finding the common point of convex sets and its application to the solution of problems in convex programming," USSR computational mathematics and mathematical physics, vol. 7, no. 3, pp. 200–217, 1967. [60] F. Corso et al., "The challenge of choosing the best classification method in radiomic analyses: Recommendations and applications to lung cancer ct images," Cancers, vol. 13, no. 12, p. 3088, 2021. [61] N. A. Parikh et al., "Perinatal risk and protective factors in the de- velopment of diffuse white matter abnormality on term-equivalent age magnetic resonance imaging in infants born very preterm," The Journal of Pediatrics, vol. 233, pp. 58–65, 2021. 14 [62] N. Bayley, Bayley scales of infant and toddler development. PsychCorp, Pearson, 2006. [63] I. S. Gousias et al., "Magnetic resonance imaging of the newborn brain: manual segmentation of labelled atlases in term-born and preterm infants," Neuroimage, vol. 62, no. 3, pp. 1499–1509, 2012. [64] A. Makropoulos et al., "The developing human connectome project: A minimal processing pipeline for neonatal cortical surface reconstruc- tion," Neuroimage, vol. 173, pp. 88–112, 2018. [65] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, "Bert: Pre-training of deep bidirectional transformers for language understanding," arXiv preprint arXiv:1810.04805, 2018. [66] K. Simonyan and A. Zisserman, "Very deep convolutional networks for large-scale image recognition," arXiv preprint arXiv:1409.1556, 2014. [67] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 770–778. [68] Y. W. Park et al., "Radiomics and machine learning may accurately predict the grade and histological subtype in meningiomas using con- ventional and diffusion tensor imaging," European radiology, vol. 29, no. 8, pp. 4068–4076, 2019. [69] M. Sollini et al., "Pet/ct radiomics in breast cancer: Mind the step," Methods, vol. 188, pp. 122–132, 2021. [70] C. Parmar, P. Grossmann, D. Rietveld, M. M. Rietbergen, P. Lambin, and H. J. Aerts, "Radiomic machine-learning classifiers for prognostic biomarkers of head and neck cancer," Frontiers in oncology, vol. 5, p. 272, 2015.
http://arxiv.org/abs/2302.09795v2
2023-05-31T17:25:09
2023-02-20T06:48:19
Simple Disentanglement of Style and Content in Visual Representations
Learning visual representations with interpretable features, i.e., disentangled representations, remains a challenging problem. Existing methods demonstrate some success but are hard to apply to large-scale vision datasets like ImageNet. In this work, we propose a simple post-processing framework to disentangle content and style in learned representations from pre-trained vision models. We model the pre-trained features probabilistically as linearly entangled combinations of the latent content and style factors and develop a simple disentanglement algorithm based on the probabilistic model. We show that the method provably disentangles content and style features and verify its efficacy empirically. Our post-processed features yield significant domain generalization performance improvements when the distribution shift occurs due to style changes or style-related spurious correlations.
[ "Lilian Ngweta", "Subha Maity", "Alex Gittens", "Yuekai Sun", "Mikhail Yurochkin" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09795v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09795v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CV", "stat.ML" ]
Simple Disentanglement of Style and Content in Visual Representations Lilian Ngweta * 1 Subha Maity * 2 Alex Gittens 1 Yuekai Sun 2 Mikhail Yurochkin 3 4 3 2 0 2 y a M 1 3 ] G L . s c [ 2 v 5 9 7 9 0 . 2 0 3 2 : v i X r a Abstract Learning visual representations with interpretable features, i.e., disentangled representations, re- mains a challenging problem. Existing methods demonstrate some success but are hard to apply to large-scale vision datasets like ImageNet. In this work, we propose a simple post-processing frame- work to disentangle content and style in learned representations from pre-trained vision models. We model the pre-trained features probabilisti- cally as linearly entangled combinations of the latent content and style factors and develop a sim- ple disentanglement algorithm based on the proba- bilistic model. We show that the method provably disentangles content and style features and ver- ify its efficacy empirically. Our post-processed features yield significant domain generalization performance improvements when the distribution shift occurs due to style changes or style-related spurious correlations. 1. Introduction Deep learning models produce data representations that are useful for many downstream tasks. Disentangled rep- resentations, i.e. representations where coordinates have meaningful interpretations, are harder to learn (Locatello et al., 2019b) but they come with many additional benefits, e.g., data-efficiency (Higgins et al., 2018) and use-cases in causality (Sch ̈olkopf et al., 2021), fairness (Locatello et al., 2019a), recommender systems (Ma et al., 2019), and image (Lee et al., 2018) and text (John et al., 2018) processing. In this paper, we consider the problem of isolating con- *Equal contribution 1Department of Computer Science, Rens- selaer Polytechnic Institute, Troy, New York, United States 2Department of Statistics, University of Michigan, Ann Ar- bor, Michigan, United States 3IBM Research, Cambridge, Mas- sachusetts, United States 4MIT-IBM Watson AI Lab, Cambridge, Massachusetts, United States. Correspondence to: Lilian Ng- weta <[email protected]>, Subha Maity <[email protected]>, Mikhail Yurochkin <[email protected]>. Proceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). 1 Figure 1. Illustration of the proposed method, PISCO. Features of an original image and features of a stylized image are different when extracted using a feature extractor such as ResNet-50 pre- trained in ImageNet. These features are entangled, thus changing the style affects all features. When PISCO is used to disentangle these features, it isolates style features and content features, thus the content features of the two images are the same and only the style features are different. tent from style in visual representations (Wu et al., 2019; Nemeth, 2020; Ren et al., 2021; K ̈ugelgen et al., 2021), a special case of learning disentangled representations. Here we use the term style to refer to features or factors that are not causally related to the outcome of interest. We also note prior works that, different from our work, study style in the context of image appearance (Garcia & Vogiatzis, 2018; Saleh & Elgammal, 2015; Ruta et al., 2022; 2021). Our goal is to obtain representations where a pre-specified set of factors (coordinates) encodes image "styles" (e.g., rotation, color scheme, or style transfer (Huang & Belongie, 2017)), while the remaining factors encode content and are invariant to style changes (see Figure 1). An important application of such representations is out-of- distribution (OOD) generalization. Image recognition sys- tems have been demonstrated to be susceptible to spurious correlations associated with style, e.g., due to background colors (Beery et al., 2018; Sagawa et al., 2019), and to various style-based distribution shifts, e.g., due to image corruptions (Hendrycks & Dietterich, 2018), illumination, or camera angle differences (Koh et al., 2020). Simply dis- carding style factors when training a prediction model on disentangled representations can aid OOD generalization. Disentangling content from style is also advantageous in many other applications, e.g., image retrieval (Wu et al., 2009), image-to-image translation (Ren et al., 2021), and Simple Disentanglement of Style and Content in Visual Representations visually-aware recommender systems (Deldjoo et al., 2022). contributions are summarized below: While there is abundant literature on learning disentangled representations, most statistically principled methods fit so- phisticated generative models (Bouchacourt et al., 2018; Hosoya, 2018; Shu et al., 2019; Wu et al., 2019; Locatello et al., 2020). These methods work well on synthetic and smaller datasets but are hard to train on larger datasets like ImageNet (Russakovsky et al., 2015). This is in stark con- trast to representation learning practice; the most common representation learning methods only learn an encoder (e.g. SimCLR (Chen et al., 2020)). That said, there are some re- cent works that consider how to learn disentangled encoders (Zimmermann et al., 2021; K ̈ugelgen et al., 2021; Wang et al., 2021). Specific to style and content, K ̈ugelgen et al. (2021) show that contrastive learning, e.g., SimCLR (Chen et al., 2020), theoretically can isolate style and content, i.e. learn rep- resentations that are invariant to style. Contrastive learn- ing methods are gaining popularity due to their ability to learn high-quality representations from large image datasets without labels via self-supervision (Doersch et al., 2015; Chen et al., 2020; Chen & Batmanghelich, 2020; Grill et al., 2020; Chen & He, 2021). Unfortunately, style invariance of contrastive learning representations is rarely achieved in practice due to a variety of additional requirements that are hard to control for (see Section 5 and Appendix C.1 in K ̈ugelgen et al. (2021)). Most of the prior works are in-processing methods that train an end-to-end encoder from scratch. On the other hand, we focus on post-processing representations from a pre-trained deep model (which may not be disentangled) so that they become provably disentangled. The post-processing setup is appealing as it allows re-using large pre-trained models, thus reducing the carbon footprint of training new large models (Strubell et al., 2019) and making deep learning more accessible to practitioners with limited computing budgets. Post-processing problem setups are prominent in the algorithmic fairness literature (Wei et al., 2019; Petersen et al., 2021). To develop our post-processing setup for learning disentan- gled representations, we assume that the pre-trained repre- sentations are simply an invertible linear transformation of the style and content factors (cf. Assumption 2.1). While the linear model assumption may appear too simple at a first glance, it is motivated by the result of Zimmermann et al. (2021) showing that contrastive learning recovers true data-generating factors up to an orthogonal transformation. The representation may not come from a contrastive learn- ing model or assumptions of Zimmermann et al. (2021) might be violated in practice, thus we consider a more gen- eral class of linear invertible transformations in our model which we justify theoretically and verify empirically. Our • We formulate a simple linear model of entanglement in pre-trained visual representations and a correspond- ing method for Post-processing to Isolate Style and COntent (PISCO). • We establish theoretical guarantees that PISCO learns disentangled style and content factors and recovers correlations among styles. Our theory is supported by a synthetic dataset study. • We verify the ability of PISCO to disentangle style and content on three image datasets of varying size and complexity via post-processing of various pre-trained deep visual feature extractors. In our experiments, discarding the learned style factors yields significant out-of-distribution performance improvements while preserving the in-distribution accuracy. 2. Problem formulation In light of the recent success of contrastive learning tech- niques for obtaining self-supervised embeddings, Zimmer- mann et al. (2021) have performed a theoretical investiga- tion on the InfoNCE family (Gutmann & Hyv ̈arinen, 2012; Oord et al., 2018; Chen et al., 2020) of contrastive losses. Under some distributional assumptions, their investigation reveals that InfoNCE loss can invert the underlying gener- ative model of the observed data. More specifically, given an observed data x = g(z) where z and g are correspond- ingly the underlying latent factors and the generative model, Zimmermann et al. (2021) showed that InfoNCE loss finds a representation model f such that f g(z) = Rz for some orthogonal matrix R. Though this is quite welcoming news in nonlinear independent component analysis (ICA) litera- ture (Hyv ̈arinen & Pajunen, 1999; Hyv ̈arinen & Morioka, 2016; Jutten et al., 2010), the representation model may not be good enough for learning a disentangled representation. In fact, Zimmermann et al. (2021) show that only under a very specific generative modeling assumption a type of contrastive objective can achieve disentanglement, and that disentanglement is lost when the assumptions are violated. ◦ At a high level, disentanglement in representation learn- ing means the style and content factors are not affected by each other. Looking back at the result (Zimmermann et al., 2021) that contrastive loss can recover the generative latent factors up to an unknown rotation, an implication is that disentanglement in the learned representation may not be achieved. However, all is not lost; we suggest a simple post-processing method for the learned representations and show that it achieves the desired disentanglement. We now formally describe our post-processing setup. We Rd and assume denote the space of the latent factor as Z ⊂ 2 Simple Disentanglement of Style and Content in Visual Representations Z that the latent factor is being generated from a probability distribution Pz on . Similar to Zimmermann et al. (2021) we assume that there exists a one-to-one generative map g such that the observed data is generated as x = Pz. The next assumption is crucial for our linear g(z), z post-processing technique and is motivated by the finding in Zimmermann et al. (2021). Assumption 2.1. There exists a representation map f : g(z) = Az for some left X ∋ Rd′ ∼ ′ X → Z invertible matrix A ⊂ such that f Rd′×d. ◦ ∈ ′ = An example of such f could be the representation model learned from InfoNCE loss minimization, where Zimmer- mann et al. (2021) showed that the assumption is true for and A is an orthogonal matrix. A consequence of Z left invertibility for A is that d′ the dimension of learned representation could be potentially higher than that of the generating latent factors, which is often natural to assume in many applications. d, i.e., ≥ Z Throughout the paper, we denote f g(z) as u and call it entangled representation. With this setup, we're now ready to formally specify the disentanglement (also known as sparse recovery) in representation learning. ◦ ⊂ [d] ≜ 1, 2, . . . , d { Definition 2.2 (Disentangled representation learning/sparse recovery). Let us denote FS as the } set of style factors and it's cardinality as m ≜ FS . We | denote the remaining factors FC ≜ [d] FS and call them − Rd×d′ content factors. For a matrix P we say the linear ˆz ≜ Pu disentangles or sparsely post-processing u recovers the style and content factors if the following hold for the matrix PA: (cid:55)→ ∈ | 1. [PA]FS,FS is an m × m diagonal matrix. 2. [PA]FC,FC is a (d − 3. [PA]FS,FC and [PA]FC,FS are m m null matrices. m) − × m) (d m) invertible matrix. (d × − m) and (d − × In other words, ˆz = PS u is disentangled or sparsely recov- ered in FS if for any j FS the coordinate [ˆz]j is a constant multiplication of [z]j and [ˆz]FC is just a pre-multiplication of [z]FC by an invertible matrix. ∈ Without loss of generality we assume that FS = [m]. Next, we highlight a conclusion of the sparse recovery, which has a connection to independent component analysis (ICA). Corollary 2.3 (Correlation recovery). One of the conclu- sions of sparse recovery is that the estimated style factors have the same correlation structure as the true style factors. Denoting corr(X) as the correlation matrix for a generic random vector X the conclusion can be mathematically stated as corr([ˆz]FS ) = corr([z]FS ) . (2.1) 3 A proof of the statement is provided in §A.3. In a special case connected to ICA, where the true correlation distribution Pz has uncorrelated style factors, i.e., corr([z]FS ) = Im, then same is true for estimated style factors. The rest of the paper describes the estimation of PS and investigates its quality in achieving disentanglement. 3. PISCO To achieve sparse recovery, we assume that we can manipu- late the samples in some specific ways, which we describe below. Assumption 3.1. We assume the following: 1. Sample manipulations: For each sample x = g(z) and style factor j FS we have access to the sample x(j) ≜ g(z(j)) that has been created by modifying the j-th style factor of x while keeping content factors unchanged, i.e., ∈ [z(j)]i = (cid:40) = [z]i, [z]i, i = j, i FC . ∈ (3.1) ∈ R, βj 2. Sample annotations: There exist two numbers αj, βj = 0 which are associated to each j-th style factor and independent of the latent factors z such that for each sample x = g(z) and it's modified ver- sion x(j) = g(z(j)) we observe the sample annotations yj = αj +βj[z]j +ε(j) and ̃yj = αj +βj[z(j)]j + ̃ε(j), where (ε(j), ̃ε(j)) pair has zero mean and is uncorre- lated with (z, z(j)). Sample annotations formalize the notion of concept from interpretable ML (Kim et al., 2018) and generalize the usual disentangled representation setting in which the latent fac- tors are the concepts. By taking αj = 0 and βj = 1, we have yj = [z]j and ̃yj = [z(j)]j, which equates the annota- tions and the latent factors. We provide an illustration for a single style factor, i.e. FS = , in Figure 1. Here, x is the 1 } { original image and we annotate it as α1 + β1[z]1 = +1. We stylize the image to obtain x(1) and assume that style trans- formation does not change any content factors of the image. We annotate the transformed image as α1 + β1[z(1)]1 = 1. Examples of such sample manipulations are easily avail- able in vision problems, e.g., image corruptions (Hendrycks & Dietterich, 2018) and style transfer (Huang & Belongie, 2017). Combining style transfer and prompt-based image generation systems like DALL E 2 further enables using nat- * ural language to describe desired sample manipulations (Fig- ure 1 illustrates such image manipulation - see Appendix C.1 for prompt and other details and Figure 5 for more exam- ples). In §5 we use these examples for our experiments. − ̸ ̸ Simple Disentanglement of Style and Content in Visual Representations We denote the entangled representations (obtained from Assumption 2.1) corresponding to the images x and x(j) as u and u(j). With access to such sample manipulations, one can recover the j-th latent factor from a simple minimum norm least square regression problem: ˆpj ≜ lim μ→0+ 1 2n n (cid:88) i=1 arg min a∈R,p∈Rd′ +( ̃y(j) j u, where p⊤ui)2 [ˆz]j ≜ ˆp⊤ (cid:104) (y(j) a − i − i )2(cid:105) μ 2 ∥ a − + p⊤u(j) i − 2 p 2 ∥ (3.2) We resort to the minimum norm least square regression instead of the simple least square regression because the variance of the predictor var(u) = var(Az) = Avar(z)A⊤ d′, which leads to non-invertible covariance has rank d for the design matrix whenever d < d′. ≤ Intuitively, ˆp⊤ j u is the one dimensional linear function of u which is most aligned to the coordinate [z]j. As we shall see later, under our setup ˆp⊤ j u is just a scalar multiple of [z]j, and hence we successfully recover the j-th style factor. We stack ˆpj into the j-th row of P, i.e. [P]j,* = ˆp⊤ j . To extract the content factors we first recall that they should exhibit minimal change corresponding to any changes in the FS. We enforce this by leveraging style factors [z]j, j our ability to manipulate styles of samples, as described in Assumption 3.1. We describe our method below: ∈ | 1 , . . . , u(j) ∈ be the matrix of entangled representations, and u(j) Estimation of content factors: We recall m = and let U = [u1, . . . , un, u(j) R(m+1)n×d′ for each j Rn×d′ mate the content factors from the following optimization: ∈ − be the matrix of representation differences. We esti- FS | FS]⊤ let ∆j = [u1 1 , . . . , un u(j) n ] n ; j ∈ S − ∈ ˆQ(λ) ≜ arg min Q∈R(d−|FS |)×d′ QQ⊤=I tr [ˆz]FC = ˆQ(λ)u, where (cid:17)(cid:105) (cid:17)(cid:16) U⊤U (m+1)n Q⊤Q Id′ (cid:104)(cid:16) − Algorithm 1 PISCO Rd′ n i=1 ⊂ } Input: Dataset and styles: (1) entangled representations of n images, and (2) m styles. Hyperpa- ui { rameters: (1) regularization strength for disentanglement between style and content factors λ > 0, and (2) number of content factors k. representations of { for j = 1 to m do } entangled feature of i-th image after chang- for i = 1 to n do i − i ← u(j) ing it's j-th style. δ(j) u(j) ui. i ← end for ˆpj (ui, { end for U ← Rn(m+1)×d′ 1 , . . . , δ(m) [δ(1) ∆ ∈ ← λ ∆⊤∆ top k eigenvectors of U⊤U ˆQ(λ) mn Return: Post-processing matrix P(λ) as in (3.5). coefficient ← n 1) i=1 ∪ { } − 1 , . . . , u(m) [u1, u(1) n i=1. } , . . . , un, u(1) n , . . . , δ(m) , . . . , δ(1) n(m+1) − (u(j) i n ]⊤ ← 1 1 from regression (3.2) on , +1) n , . . . , u(m) n ]⊤ ∈ Rmn×d′ Following the above, one can easily realize that the second part of the objective enforces that the content factors [ˆz]FC exhibit minimal change for any changes in the style factors [z]j, j , the [ˆz]FS will be invariant to any changes in the style factors. FS. In a special case λ = + ∞ ∈ From (3.2) and (3.3) we obtain the linear post-processing matrix (as defined in 2.2) as P(λ) ≜ P ≡ (cid:40) [P]j,* = ˆp⊤ j , [P]FC,* = ˆQ(λ) . FS j ∈ (3.5) We summarize our method in Algorithm 1 which is a com- bination of simple regressions (per style factors) and an eigen-decomposition. In the next section, we show that for large values of λ the post-processing matrix P(λ) achieves sparse recovery with high probability. (cid:80) + λ m j∈FS tr (cid:2)Q⊤Q(cid:0)∆⊤ j ∆j/n(cid:1)(cid:3) . 4. Theory (3.3) Our objective has two parts: the first part is easily recog- nized by noticing its similarity to a principle component analysis objective. To understand the second part, we fix a style factor j FS and observe that, ∈ 1 n n (cid:88) i=1 Q(ui ∥ − u(j) i ) ∥ 2 2 = 1 n n (cid:88) i=1 (cid:104) tr = tr (cid:2)Q⊤Q(cid:0)∆⊤ Q⊤Q(ui − j ∆j/n(cid:1)(cid:3) . u(j) i )(ui − i )⊤(cid:105) u(j) (3.4) 4 In this section, we theoretically establish that our post- processing approach PISCO guarantees sparse recovery. We divide the proof into two parts: the first part analyzes the asymptotic quality of the estimated style factors and the second part analyzes the quality of the estimated content factors. Our first result follows: Theorem 4.1. Let Σz ≜ var(z) be invertible. Then for any j FS it holds: A⊤ ˆpj (4.1) → d almost surely as n j=1 is the canonical , where } basis vector for Rd. Subsequently, the following hold at βjej ej { → ∞ ∈ Simple Disentanglement of Style and Content in Visual Representations almost sure limit: (1) [PA]FS,FS converges to a diagonal matrix, and (2) [PA]FS,FC → To establish theoretical guarantee for the content factors we require the following technical assumption. 0. Assumption 4.2 (Linear independence in style factors). Over the distribution of latent factors, the style factors are not linearly dependent with each other. Mathematically speaking, the following event positive probability E = (cid:8)z : [z z(m)]FS,* is invertible(cid:9) . (4.2) z(1), . . . , z − − The assumption is related to cases when the style factors are dependent with each other. One such example is the blurring and contrasting of images: we assume that one doesn't completely determine the other. To see how the assumption is violated under linear dependence of style factors let the first two of them completely determine one another, i.e., one is just a constant multiplication of the other. In that case, we point out that for any z the first two rows z(m)]FS,* are just constant of the matrix [z multiplication of one another and the matrix is singular with probability one. z(1), . . . , z − − With the setups provided by Assumptions 2.1, 3.1 and 4.2 we're now ready to state our result about sparse recovery for our post-processing technique. − Theorem 4.3 (Sparse recovery for PISCO). Let n d + 1 and that the Assumptions 2.1, 3.1 and 4.2 hold. Define κ ≜ Pz(E) < 1 where Pz is the distribution of latent factors 1 κn the and E is defined in (4.2). With probability at least 1 − P(λ) satisfies post-processing matrix P P(+ the following: (1) [PA]FS,FC = 0, and (2) [PA]FC,FC is invertible. ) ≜ lim λ→∞ ∞ ≥ ≡ Proofs of Theorems 4.1 and 4.3 are provided in §A.2 and §A.3. We combine the conclusions of the two theorems in the following corollary. Corollary 4.4. Let the Assumptions 2.1, 3.1 and 4.2 hold. Then at the limit n P(+ in Definition 2.2. ≡ ) almost surely satisfies sparse recovery conditions the the post-processing matrix P → ∞ ∞ 4.1. Synthetic data study We complement our theoretical study with an experiment in a synthetic setup. Below we describe the data generation, sample manipulations, and their annotations, and provide their detailed descriptions in §B. We generate the latent variables (z) from a 10-dimensional centered normal random variable, where the coordinates have unit variance, the first two coordinates are corre- lated with correlation coefficient ρ and all the other cross- coordinate correlations are zero. We consider the first five 5 Figure 2. Plots (with error-bars over 50 repetitions) for discrep- ancies in style recovery (∥ corr([z]FS , [ˆz]FS ) − corr([z]FS )∥F) and style-content disentanglement (∥ corr([ˆz]FC , [z]FS )∥F) for es- timated factors, where ∥ * ∥F is the normalized Frobenius norm (see Footnote 1). Here, ρ is the correlation between the first two coordinates in true factors. coordinates of z as the style factors, i.e. FS = and the rest of them as content factors. 1, 2, . . . , 5 } , { The entangled representations are d′ = 10 dimensional vectors and which we obtain as u = Az = LUz, where L is a 10 10 lower triangular matrix whose diagonal entries are one and off-diagonal entries are 0.9 and U is a randomly generated d d orthogonal matrix. × × | [z]j Sample manipulations and annotations: For j-th style coordinates we obtain two manipulated samples per latent factor z, which (denoted as z(j),+ and z(j),− ) set the j-th coordinate to it's positive (resp. negative) absolute value, i.e. [z(j),+]j = (resp. [z(j),−]j = ), and annotate | −| it as +1 (resp. 1). Since the first two coordinates have correlation coefficient ρ, if either of them is changed by the value δ then the other one must be changed by ρδ. Note that one of z(j),+ and z(j),− is exactly equal to z. The corresponding entangled representations to the manipulated latent factors are used for recovering the style factors (as in (3.2) and (3.5)), and content factors (as in (3.3)). | − [z]j Style recovery: In our synthetic experiments we validate the quality of sparse recovery for estimated latent factors on two fronts: (1) recovery in the style factors, and (2) disentanglement between style and content factors. To ver- ify recovery in style factors we recall Theorem 4.1 that the estimated style factors ([ˆz]FS ) approximate the true style factors ([z]FS ) up to constant multiplications. This implies that the cross-correlation between estimated and true style factors (corr([z]FS, [ˆz]FS )) should be approxi- mately identical to the correlation of the true style factors (corr([z]FS )). In Figure 2 we verify this by calculating F is the nor- corr([z]FS , [ˆz]FS) corr([z]FS ) F where ∥ ∥ * ∥ − ∥ 10−1101103λ0.00.10.20.3discrepancystylerecoverystyle-contentdisentanglementρ=0.1ρ=0.5ρ=0.9 Simple Disentanglement of Style and Content in Visual Representations malized Frobenius norm of a matrix.1 We refer to it as the discrepancy in style recovery and observe that it is small and not affected by ρ. Even for ρ as large as 0.9 the recovery of style factors has small discrepancy, which matches with the conclusion of Theorem 4.1. Additionally, we observe that the discrepancies are the same for different values of λ (that appears in (3.3)) since the estimation of the style factors doesn't involve λ. Style and content disentanglement: Note that the style and content factors are uncorrelated with each other, i.e. corr([z]FS , [z]FC ) = 0. If the content factors and style factors are truly disentangled then the cross-correlation be- tween estimated content factors [ˆz]FC and true style factors [z]FS should be approximately equal to zero. In Figure 2 corr([ˆz]FC , [z]FS ) we verify this by plotting F, which we ∥ refer to as the discrepancy in style-content disentanglement (SCD) and notice that for large enough values of the pa- rameter λ (i.e. λ > 100) the discrepancy is quite small. Though ρ has a mild effect on disentanglement between style and content factors for smaller values of λ, the effect is indistinguishable for large λ (λ > 103). ∥ 5. Experiments We verify the ability of PISCO (Algorithm 1) to isolate content and style in pre-trained visual representations and the utility of the learned representations for OOD general- ization when (i) train data is spuriously correlated with the style and the correlation is reversed in the test data; (ii) test data is modified with various image transformations, i.e., domain generalization with style-based distribution shifts. We consider nine transformations in our experiments: four types of image corruptions (rotation, contrast, blur, and saturation) on CIFAR-10 (Krizhevsky et al., 2009), simi- lar to ImageNet-C (Hendrycks & Dietterich, 2018), four transformations based on style transfer (Huang & Belongie, 2017) on ImageNet (Russakovsky et al., 2015), similar to Stylized ImageNet (Geirhos et al., 2018), and a color trans- formation on MNIST, similar to Colored MNIST (Arjovsky et al., 2019) (see §D.1 for Colored MNIST experiment). The experiments code is available on GitHub.2 5.1. Transformed CIFAR In this set of experiments, our goal is to disentangle four styles (m = 4) corresponding to image corruptions (ro- tation, contrast, blur, and saturation) from content. For feature extraction we consider a ResNet-18 (He et al., 2016) pre-trained on ImageNet (Russakovsky et al., 2015) (Supervised) and a SimCLR (Chen et al., 2020) trained 1The normalized Frobenius norm of a matrix A ∈ Rm×n is denoted as ∥A∥F and defined as ∥A∥F ≜ 2Code: github.com/lilianngweta/PISCO. (cid:113) (cid:80) i,j [A]2 i,j mn . 6 on CIFAR-10 via self-supervision with the same architec- ture (SimCLR). For each feature extractor, we learn a single PISCO post-processing feature transformation matrix P(λ) as in Algorithm 1 to jointly disentangle all considered styles from content. We report results for λ 1, 10, 50 ∈ { .3 } Baselines Our main baseline is the vanilla SimCLR rep- resentations due to K ̈ugelgen et al. (2021) who argued that it is sufficient for style and content disentanglement under some assumptions. Thus we study whether we can further improve style-content disentanglement in SimCLR in a real data setting in addition to experiments with features ob- tained via supervised pretraining on ImageNet. We also compare PISCO's style-content disentanglement with IP- IRM (Wang et al., 2021), which is an in-processing method combining self-supervised learning and invariant risk mini- mization (Arjovsky et al., 2019) to learn disentangled rep- resentations. We use IP-IRM model trained on CIFAR-100 provided by the authors. We note that there are many other methods for learning dis- entangled representations (Wu et al. (2019); Nemeth (2020); Ren et al. (2021); K ̈ugelgen et al. (2021), to name a few), however, they all require training an encoder-decoder model from scratch and can not take advantage of powerful feature extractors pre-trained on large datasets as in our setting. In comparison to these works, the simplicity and scalability of our method (as well as of using vanilla SimCLR features) come at a cost, i.e., we forego the ability to visualize dis- entanglement via controlled image generation due to the absence of a generator/decoder. Instead, we demonstrated disentanglement theoretically (§4) and verify it empirically via correlation analysis of learned style and content fac- tors, similar to prior works that studied disentanglement in settings without a generator/decoder (Zimmermann et al., 2021; K ̈ugelgen et al., 2021). Disentanglement In Table 1 we summarize the disentan- glement metrics for the smallest considered λ = 1. In the style correlation columns (Style Corr.), we report the corre- lation between the corresponding style value (encoded as 1 for the original images and +1 for the transformed ones) − and the factor corresponding to style in the learned repre- sentations. None of the baselines explicitly identify style factors, thus we use the coordinate maximally correlated with the corresponding style as the style factor. We notice that the blur style is the hardest to learn for both supervised and unsupervised representations. As we will see 3In all experiments we set the number of content factors to k = ηd′ − m, where d′ is the representation dimension. We set η = 0.95 for all experiments in the main paper and report results for other values of η in §D. As long as η is close to 1, baselines and PISCO in-distribution results are similar. For smaller values of η, PISCO in-distribution accuracy naturally deteriorates. Simple Disentanglement of Style and Content in Visual Representations (a) Rotation - Supervised (b) Contrast - Supervised (a) Rotation - SimCLR (b) Contrast - SimCLR (c) Blur - Supervised (d) Satur. - Supervised (c) Blur - SimCLR (d) Saturation - SimCLR Figure 3. OOD accuracy of Supervised representations on CIFAR-10 where the label is spuriously correlated with the cor- responding transformation. PISCO significantly improves OOD accuracy, especially in the case of rotation. Both λ = 1 and λ = 10 preserve in-distribution accuracy, while larger λ = 50 may degrade it as per (3.3). Figure 4. OOD accuracy of SimCLR representations on CIFAR-10 where the label is spuriously correlated with the corresponding transformation. Results are analogous to Figure 3. The SimCLR baseline representations are less sensitive to contrast and saturation but remain sensitive to rotation. later, both representations are fairly invariant to this style. Comparing PISCO on Supervised and SimCLR, the style recovery is better on Supervised since SimCLR representations are more robust to style changes (K ̈ugelgen et al., 2021). In the style-content disentanglement (SCD) columns, we re- port the disentanglement of style from content features as in the synthetic experiment in Figure 2. Here SimCLR repre- sentations appear slightly harder to disentangle using PISCO than Supervised representations. In the SCD of original representations for both Supervised and SimCLR, as expected, we observe that these representations are more entangled with the styles, especially the Supervised rep- resentations. Comparing the SCD for PISCO with that of IP-IRM, we see that PISCO can post-process popular pre-trained representations to achieve comparable or bet- ter disentanglement without re-training (i.e., in-processing). Overall we conclude that PISCO is successful in isolating style and content. Spurious correlations Next, we create four variations of CIFAR-10 where labels are spuriously correlated with one of the four styles (image corruptions). Specifically, in the training dataset, we corrupt images from the first half of the classes with probability α and from the second half of the − α. In test data the correlation classes with probability 1 is reversed, i.e., images from the first half of the classes α and images from the are corrupted with probability 1 second half with probability α (see §C for details). Thus, for α = 0.5 train and test data have the same distribution where each image is randomly transformed with the corre- sponding image corruption type, and α = 1 corresponds to the extreme spurious correlation setting. − For each α we train and test a linear model on the origi- nal representations and on PISCO representations (in this and subsequent experiments all learned style factors are dis- carded for downstream tasks; see §C for additional details) for varying λ. Recall that here we use the same PISCO transformation matrices learned previously without knowl- edge of the specific corruption type and spurious correla- tion value α of a given dataset. We summarize results for Supervised features in Figure 3 and for SimCLR fea- tures in Figure 4. PISCO improves upon both original representations and across all transformations. For λ = 1, PISCO always preserves the in-distribution accuracy, i.e. when α = 0.5, and improves upon the baselines in the pres- ence of spurious correlations. Larger λ = 50 can degrade in-distribution accuracy in some cases (recall that λ controls the tradeoff between the reconstruction of the original fea- tures with the content factors and style-content disentangle- ment per (3.3)), while λ = 10 provides a favorable tradeoff 7 Simple Disentanglement of Style and Content in Visual Representations Table 1. Content and style disentanglement of Supervised and SimCLR representations on CIFAR-10 with PISCO. The style correlation columns (style Corr.) show correlations between styles in the data and representations corresponding to style. The isolation of style from content is measured with style-content disentanglement (SCD, see Figure 2). In the last column we compare to representations learned by IP-IRM. Bold denotes best results. Style blur contrast rotation saturation SCD Supervised Style Corr. 0.319 0.490 0.746 0.641 0.090 0.243 0.212 0.204 Supervised PISCO SimCLR Unsupervised PISCO IP-IRM Style Corr. 0.716 0.927 0.936 0.882 SCD 0.051 0.055 0.029 0.048 Style Corr. 0.304 0.094 0.368 0.120 SCD 0.096 0.076 0.182 0.071 Style Corr. 0.719 0.897 0.945 0.738 SCD 0.060 0.049 0.056 0.060 Style Corr. 0.032 0.419 0.617 0.219 SCD 0.022 0.188 0.114 0.044 Table 2. Accuracy of Supervised representations on CIFAR- 10 test set in-distribution, i.e., no transformation (referred to as "none"; last row), and OOD when modified with the correspond- ing transformation. PISCO with λ = 1 provides significant im- provements for rotation, contrast, and saturation while preserving in-distribution accuracy. Style rotation contrast saturation blur none Baseline (Supervised) PISCO (λ = 1) PISCO (λ = 10) PISCO (λ = 50) 0.678 0.625 0.699 0.817 0.873 0.737 0.683 0.758 0.817 0.870 0.733 0.744 0.745 0.793 0.844 0.710 0.726 0.721 0.775 0.826 Table 3. Accuracy of SimCLR representations on CIFAR-10 test set in-distribution, i.e., no transformation (referred to as "none"; last row), and OOD when modified with the corresponding trans- formation. SimCLR features are robust to the considered transfor- mations and perform similarly to PISCO with λ = 1. Style rotation contrast saturation blur none Baseline (SimCLR) PISCO (λ = 1) PISCO (λ = 10) PISCO (λ = 50) 0.620 0.816 0.810 0.808 0.828 0.625 0.814 0.806 0.801 0.827 0.697 0.806 0.789 0.793 0.808 0.696 0.794 0.774 0.780 0.792 with a small reduction of in-distribution accuracy and large improvements when spurious correlations are present. Comparing results across the representations, we notice that SimCLR features are less sensitive to image transformations as discussed previously. However, for both representations, spurious correlation with rotation causes a significant accu- racy drop without PISCO post-processing. Domain generalization To evaluate the domain general- ization performance, we train a logistic regression classifier on the corresponding representation of the clean CIFAR-10 dataset and compute accuracy on the test set with every image transformed with one of the four corruptions, as well as the original test set to verify the in-distribution accu- racy. Results are presented in Table 2 for Supervised features and in Table 3 for SimCLR features. We observe significant OOD accuracy gains when applying PISCO post- processing on the Supervised features while preserving the in-distribution accuracy for λ = 1. In this experiment, we see that SimCLR features are sufficiently robust and perform as well as PISCO post-processing with λ = 1. Overall we have observed that applying our method with smaller λ = 1 never hurts the performance, while it yields significant OOD accuracy gains in many settings. 5.2. Stylized ImageNet In this experiment, we evaluate the domain generalization of PISCO on more sophisticated styles obtained via style transfer (Huang & Belongie, 2017), similar to the Stylized ImageNet (Geirhos et al., 2018) dataset. In addition, we evaluate the ability of PISCO to generalize to styles that are similar to but weren't used to fit PISCO. We used the "dog sketch" and "Picasso dog" styles to obtain PISCO transformation and evaluate on two additional similar but unseen styles, "woman sketch" and "Picasso self-portrait". See Figure 5 and §C for visualization and additional details. As in the CIFAR-10 domain generalization experiment, the logistic regression classifier is trained on the original train images and tested on transformed test images. In Table 4 we report results for ResNet-50 features pre-trained on ImageNet (Baseline) and for the same features transformed with PISCO with λ = 1. PISCO improves OOD top-1 and top-5 accuracies across all four styles, including the unseen ones, while maintaining good in-distribution performance. We also report analogous results for another popular feature extractor, MAE-ViT-Base (He et al., 2022), in Table 5. We again observe that PISCO (λ = 1) improves top-1 and top-5 OOD performances with no degradation of the in- distribution performance. We present results for other values 8 Simple Disentanglement of Style and Content in Visual Representations Table 4. Top-1 and top-5 accuracies on 5 variations of the Ima- geNet test set for Baseline pre-trained ResNet-50 features and the corresponding post-processed PISCO (λ = 1) features. Style Baseline PISCO Top-1 Top-5 Top-1 Top-5 dog sketch woman sketch Picasso dog Picasso s.-p. none 0.516 0.478 0.445 0.474 0.757 0.752 0.712 0.686 0.706 0.927 0.546 0.518 0.500 0.514 0.749 0.777 0.752 0.738 0.747 0.921 Table 5. Top-1 and top-5 accuracies on 5 variations of the Ima- geNet test set for Baseline pre-trained MAE-ViT-Base features and the corresponding post-processed PISCO (λ = 1) features. Style Baseline PISCO Top-1 Top-5 Top-1 Top-5 dog sketch Picasso dog Picasso s.-p. woman sketch none 0.530 0.472 0.512 0.504 0.811 0.749 0.686 0.727 0.719 0.952 0.575 0.519 0.558 0.550 0.818 0.773 0.716 0.752 0.746 0.953 of λ in §D. We note that in this experiment the sample manipulations and annotations required for our method (§3) were sim- ple to obtain. We generated the styles for fitting PISCO E 2 and obtained pairs with basic text prompts using DALL * of original and transformed images using a style transfer method (Huang & Belongie, 2017). Thus, this experiment demonstrates how PISCO can be applied to improve ro- bustness to a variety of distribution shifts in vision tasks where we have some amount of prior knowledge needed to formulate a relevant prompt to obtain a style image. 6. Conclusion In this paper, we studied the problem of disentangling style and content of pre-trained visual representations. We pre- sented PISCO, a simple post-processing algorithm with the- oretical guarantees. In our experiments, we demonstrated that post-processing with PISCO can improve OOD perfor- mance of popular pre-trained deep models while preserving the in-distribution accuracy. Our method is computationally inexpensive and simple to implement. In our experiments, we mainly were interested in discard- ing the style factors and keeping the style-invariant content factors for OOD generalization. However, we also demon- strated both theoretically and empirically that the learned style factors are representative of the presence or absence of the corresponding styles. Thus, the values of the style fac- tors can be used to assist in outlier/OOD samples detection, or in some special cases of image retrieval, e.g., finding all images with a specific style. One limitation of our method is the reliance on the availabil- ity of meaningful data transformations (or augmentations). While there are plenty of such transformations for images, they could be harder to identify for other data modalities. Natural language processing is one example where it is not as straightforward to define meaningful text augmentations. However, text data augmentations is also an active research area (Wei & Zou, 2019; Bayer et al., 2021; Shorten et al., 2021) which could enable applications of PISCO to NLP. Another interesting direction to explore is extending our model to various weak supervision settings (Bouchacourt et al., 2018; Shu et al., 2019; Chen & Batmanghelich, 2020). In comparison to data augmentation functions, such forms of supervision are typically easier to obtain outside of the image domain. Thus, an extension of our model to weak su- pervision could enable disentanglement via post-processing for a broader class of data modalities. Acknowledgements This paper is based upon work supported by the National Science Foundation (NSF) under grants no. 2027737 and 2113373, and the Rensselaer-IBM AI Research Collabo- ration (http://airc.rpi.edu), part of the IBM AI Horizons Network (http://ibm.biz/AIHorizons). References Arjovsky, M., Bottou, L., Gulrajani, I., and Lopez-Paz, D. Invariant Risk Minimization. arXiv:1907.02893 [cs, stat], September 2019. Bayer, M., Kaufhold, M.-A., and Reuter, C. A survey on data augmentation for text classification. ACM Comput- ing Surveys, 2021. Beery, S., Van Horn, G., and Perona, P. Recognition in terra incognita. In Proceedings of the European conference on computer vision (ECCV), pp. 456–473, 2018. Bouchacourt, D., Tomioka, R., and Nowozin, S. Multi-level variational autoencoder: Learning disentangled represen- tations from grouped observations. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32(1), 2018. Chen, J. and Batmanghelich, K. Weakly supervised disen- tanglement by pairwise similarities. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34(04), pp. 3495–3502, 2020. Chen, M., Wei, Z., Huang, Z., Ding, B., and Li, 9 Simple Disentanglement of Style and Content in Visual Representations Y. Simple and Deep Graph Convolutional Networks. arXiv:2007.02133 [cs, stat], July 2020. Chen, X. and He, K. Exploring simple siamese represen- tation learning. In Proceedings of the IEEE/CVF Con- ference on Computer Vision and Pattern Recognition, pp. 15750–15758, 2021. Deldjoo, Y., Di Noia, T., Malitesta, D., and Merra, F. A. Leveraging content-style item representation for visual recommendation. In European Conference on Informa- tion Retrieval, pp. 84–92. Springer, 2022. Doersch, C., Gupta, A., and Efros, A. A. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE international conference on com- puter vision, pp. 1422–1430, 2015. Garcia, N. and Vogiatzis, G. How to read paintings: se- mantic art understanding with multi-modal retrieval. In Proceedings of the European Conference on Computer Vision (ECCV) Workshops, pp. 0–0, 2018. Geirhos, R., Rubisch, P., Michaelis, C., Bethge, M., Wich- mann, F. A., and Brendel, W. Imagenet-trained cnns are biased towards texture; increasing shape bias improves ac- curacy and robustness. arXiv preprint arXiv:1811.12231, 2018. Grill, J.-B., Strub, F., Altch ́e, F., Tallec, C., Richemond, P. H., Buchatskaya, E., Doersch, C., Pires, B. A., Guo, Z. D., Azar, M. G., Piot, B., Kavukcuoglu, K., Munos, R., and Valko, M. Bootstrap your own latent: A new approach to self-supervised Learning. arXiv:2006.07733 [cs, stat], September 2020. Gutmann, M. U. and Hyv ̈arinen, A. Noise-contrastive es- timation of unnormalized statistical models, with appli- cations to natural image statistics. Journal of machine learning research, 13(2), 2012. He, K., Zhang, X., Ren, S., and Sun, J. Deep Residual Learn- ing for Image Recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, Las Vegas, NV, USA, June 2016. IEEE. ISBN 978-1-4673-8851-1. doi: 10.1109/CVPR.2016.90. He, K., Chen, X., Xie, S., Li, Y., Doll ́ar, P., and Girshick, R. Masked autoencoders are scalable vision learners. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16000–16009, 2022. Higgins, I., Amos, D., Pfau, D., Racaniere, S., Matthey, L., Rezende, D., and Lerchner, A. Towards a defi- nition of disentangled representations. arXiv preprint arXiv:1812.02230, 2018. Hosoya, H. Group-based learning of disentangled repre- sentations with generalizability for novel contents. arXiv preprint arXiv:1809.02383, 2018. Huang, X. and Belongie, S. Arbitrary style transfer in real- time with adaptive instance normalization. In Proceed- ings of the IEEE international conference on computer vision, pp. 1501–1510, 2017. Hyv ̈arinen, A. and Morioka, H. Unsupervised feature ex- traction by time-contrastive learning and nonlinear ICA. In Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS'16, pp. 3772–3780, Red Hook, NY, USA, December 2016. Cur- ran Associates Inc. ISBN 978-1-5108-3881-9. Hyv ̈arinen, A. and Pajunen, P. Nonlinear independent com- ponent analysis: Existence and uniqueness results. Neural networks, 12(3):429–439, 1999. John, V., Mou, L., Bahuleyan, H., and Vechtomova, O. Disentangled representation learning for non-parallel text style transfer. arXiv preprint arXiv:1808.04339, 2018. Jutten, C., Babaie-Zadeh, M., and Karhunen, J. Nonlinear mixtures. In Handbook of Blind Source Separation, pp. 549–592. Elsevier, 2010. Kim, B., Wattenberg, M., Gilmer, J., Cai, C., Wexler, J., Viegas, F., and Sayres, R. Interpretability Beyond Feature Attribution: Quantitative Testing with Concept Activation Vectors (TCAV). In International Conference on Machine Learning, pp. 2668–2677, July 2018. Koh, P. W., Sagawa, S., Marklund, H., Xie, S. M., Zhang, M., Balsubramani, A., Hu, W., Yasunaga, M., Phillips, R. L., Beery, S., Leskovec, J., Kundaje, A., Pierson, E., Levine, S., Finn, C., and Liang, P. WILDS: A Benchmark of in-the-Wild Distribution Shifts. arXiv:2012.07421 [cs], December 2020. Krizhevsky, A., Hinton, G., et al. Learning multiple layers of features from tiny images. 2009. K ̈ugelgen, J., Sharma, Y., Gresele, L., Brendel, W., Sch ̈olkopf, B., Besserve, M., and Locatello, F. Self- supervised learning with data augmentations provably isolates content from style. Advances in neural informa- tion processing systems, 34:16451–16467, 2021. Hendrycks, D. and Dietterich, T. Benchmarking Neural Network Robustness to Common Corruptions and Pertur- bations. In International Conference on Learning Repre- sentations, September 2018. Lee, H.-Y., Tseng, H.-Y., Huang, J.-B., Singh, M., and Yang, M.-H. Diverse image-to-image translation via disentan- gled representations. In Proceedings of the European conference on computer vision (ECCV), pp. 35–51, 2018. 10 Simple Disentanglement of Style and Content in Visual Representations Locatello, F., Abbati, G., Rainforth, T., Bauer, S., Sch ̈olkopf, B., and Bachem, O. On the fairness of disentangled representations. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, number 1309, pp. 14611–14624. Curran Associates Inc., Red Hook, NY, USA, December 2019a. Locatello, F., Bauer, S., Lucic, M., Raetsch, G., Gelly, S., Sch ̈olkopf, B., and Bachem, O. Challenging Common Assumptions in the Unsupervised Learning of Disentan- gled Representations. In Proceedings of the 36th Interna- tional Conference on Machine Learning, pp. 4114–4124. PMLR, May 2019b. Locatello, F., Poole, B., R ̈atsch, G., Sch ̈olkopf, B., Bachem, O., and Tschannen, M. Weakly-supervised disentangle- ment without compromises. In International Conference on Machine Learning, pp. 6348–6359. PMLR, 2020. Ma, J., Zhou, C., Cui, P., Yang, H., and Zhu, W. Learning disentangled representations for recommendation. Ad- vances in neural information processing systems, 32, 2019. Nemeth, J. Adversarial disentanglement with grouped ob- servations. In Proceedings of the AAAI Conference on Ar- tificial Intelligence, volume 34, pp. 10243–10250, 2020. Oord, A. v. d., Li, Y., and Vinyals, O. Representation learn- ing with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. Petersen, F., Mukherjee, D., Sun, Y., and Yurochkin, M. Post-processing for individual fairness. Advances in Neu- ral Information Processing Systems, 34:25944–25955, 2021. Ren, X., Yang, T., Wang, Y., and Zeng, W. Rethinking con- tent and style: exploring bias for unsupervised disentan- glement. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1823–1832, 2021. Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., et al. Imagenet large scale visual recognition chal- lenge. International journal of computer vision, 115(3): 211–252, 2015. Ruta, D., Motiian, S., Faieta, B., Lin, Z., Jin, H., Filip- kowski, A., Gilbert, A., and Collomosse, J. Aladin: all layer adaptive instance normalization for fine-grained style similarity. In Proceedings of the IEEE/CVF Interna- tional Conference on Computer Vision, pp. 11926–11935, 2021. Ruta, D., Gilbert, A., Aggarwal, P., Marri, N., Kale, A., Briggs, J., Speed, C., Jin, H., Faieta, B., Filipkowski, A., et al. Stylebabel: Artistic style tagging and captioning. In Computer Vision–ECCV 2022: 17th European Confer- ence, Tel Aviv, Israel, October 23–27, 2022, Proceedings, Part VIII, pp. 219–236. Springer, 2022. Sagawa, S., Koh, P. W., Hashimoto, T. B., and Liang, P. Dis- tributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Gen- eralization. arXiv:1911.08731 [cs, stat], November 2019. Saleh, B. and Elgammal, A. Large-scale classification of fine-art paintings: Learning the right metric on the right feature. arXiv preprint arXiv:1505.00855, 2015. Sch ̈olkopf, B., Locatello, F., Bauer, S., Ke, N. R., Kalch- brenner, N., Goyal, A., and Bengio, Y. Toward causal representation learning. Proceedings of the IEEE, 109(5): 612–634, 2021. Shorten, C., Khoshgoftaar, T. M., and Furht, B. Text data augmentation for deep learning. Journal of big Data, 8 (1):1–34, 2021. Shu, R., Chen, Y., Kumar, A., Ermon, S., and Poole, B. Weakly supervised disentanglement with guarantees. arXiv preprint arXiv:1910.09772, 2019. Strubell, E., Ganesh, A., and McCallum, A. Energy and Policy Considerations for Deep Learning in NLP. In Pro- ceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 3645–3650, Florence, Italy, July 2019. Association for Computational Linguis- tics. doi: 10.18653/v1/P19-1355. Wang, T., Yue, Z., Huang, J., Sun, Q., and Zhang, H. Self- supervised learning disentangled group representation as feature. Advances in Neural Information Processing Systems, 34:18225–18240, 2021. Wei, D., Ramamurthy, K. N., and Calmon, F. d. P. Op- timized Score Transformation for Fair Classification. arXiv:1906.00066 [cs, math, stat], December 2019. Wei, J. and Zou, K. Eda: Easy data augmentation tech- niques for boosting performance on text classification tasks. arXiv preprint arXiv:1901.11196, 2019. Wu, T. T., Chen, Y. F., Hastie, T., Sobel, E., and Lange, K. Genome-wide association analysis by lasso pe- nalized logistic regression. Bioinformatics, 25(6):714– 721, March 2009. ISSN 1460-2059, 1367-4803. doi: 10.1093/bioinformatics/btp041. Wu, W., Cao, K., Li, C., Qian, C., and Loy, C. C. Dis- entangling content and style via unsupervised geometry distillation. arXiv preprint arXiv:1905.04538, 2019. Zimmermann, R. S., Sharma, Y., Schneider, S., Bethge, M., and Brendel, W. Contrastive learning inverts the 11 Simple Disentanglement of Style and Content in Visual Representations data generating process. In International Conference on Machine Learning, pp. 12979–12990. PMLR, 2021. A. Supplementary proofs A.1. Proof of Corollary 2.3 Proof. We denote ˆzS ≜ [ˆz]FS , zS ≜ [z]FS , Σ ≜ cov(z) and ∆ as the diagonal matrix of Σ. Notice that corr(z) = ∆−1/2Σ∆−1/2 . (A.1) From Definition 2.2 ˆzS = [PA]FS,FS zS where [PA]FS,FS is a diagonal matrix. We denote [PA]FS,FS as D. Then the covariance matrix of ˆzS is cov(ˆzS) = cov(DzS) = DΣD (A.2) and its diagonal matrix is diag(DΣD) = D diag(Σ)D = D∆D = ∆D2 , (A.3) and hence 1 2n n (cid:88) (cid:104) i=1 (ui ̄u)(y(j) i − − ̄y) + (u(j) i − ̄u)( ̃y(j) i − (cid:105) ̄y) − (cid:0)[z(j) i (cid:1) [ ̄z]j (cid:1)(cid:105) [ ̄z]j ]j − = 1 2n n (cid:88) (cid:104) i=1 A(zi ̄z)βj − (cid:0)[zi]j + A(z(j) i − ̄z)βj + 1 2n n (cid:88) i=1 (cid:104) A(zi ̄z)(ε(j) i − − ̄ε(j)) + A(z(j) i − ̄z)( ̃ε(j) i − (cid:105) ̄ε(j)) ≜ cov1 + cov2 , where cov1 ≜ 1 2n (cid:104) A(zi n (cid:88) i=1 ̄z)βj − (A.9) (cid:1) [ ̄z]j (cid:1)(cid:105) [ ̄z]j ]j − (cid:0)[zi]j − (cid:0)[z(j) i + A(z(j) i − ̄z)βj 1 2n n (cid:88) (cid:104) (zi i=1 + (z(j) i − ̄z)(zi − − ̄z)⊤ej ̄z)(z(j) i − (cid:105) ̄z)⊤ej = βjA ˆΣzej . and with ˆΣz,ε ≜ 1 2n ̄z)( ̃ε(j) ̄ε(j)) (cid:105) i − we obtain (cid:80)n i=1 (cid:104) (zi ̄z)(ε(j) i − − ̄ε(j)) + (z(j) i − where the last equality is obtained using the fact that the matrix multiplication of the diagonal matrices is commuting. Expressing corr(ˆzS) in terms of cov(ˆzS) and it's diagonal matrix we obtain = βjA corr(ˆzS) diag (cid:8) corr(ˆzS)(cid:9)−1/2 corr(ˆzS) = diag (cid:8) corr(ˆzS)(cid:9)−1/2 ∆D2 −1/2DΣD = { = ∆−1/2D−1DΣDD−1∆−1/2 = ∆−1/2Σ∆−1/2 = corr(zS) ∆D2 { } −1/2 } and we obtain (2.1). A.2. Proof of Theorem 4.1 (A.4) cov2 ≜ 1 2n (cid:104) A(zi n (cid:88) i=1 ̄z)(ε(j) i − − ̄ε(j)) + A(z(j) i − ̄z)( ̃ε(j) i − (cid:105) ̄ε(j)) = A ˆΣz,ε Proof. The closed form of ˆpj in (3.2) can be written as: ˆpj = ˆΣ† u 1 2n n (cid:88) i=1 (cid:104) (ui ̄u)(y(j) i − − ̄y)+(u(j) i − ̄u)( ̃y(j) i − (cid:105) ̄y) (cid:80)n − where ̄u = 1 2n ⊤(cid:3) u(j) u(j) i } i { of ˆΣu, ̄y = 1 2n (cid:2)ε(j) (cid:80)n i + ̃ε(j) 1 2n (cid:3) and ˆΣz = 1 z(j) i notice the following. i=1 2n i i=1 (cid:80)n (cid:2)uiu⊤ (cid:2)ui + u(j) (cid:3), ˆΣu = 1 (A.5) i + 2n u is the Moore-Penrose inverse (cid:3), and ̄ε(j) = (cid:2)zi + (cid:80)n i=1 ̄z ̄z⊤ we i=1 ̄u ̄u⊤, ˆΣ† (cid:80)n (cid:3). Here, defining ̄z = 1 (cid:80)n i + z(j) i { i + ̃y(j) z(j) i } (cid:2)ziz⊤ (cid:2)y(j) 2n ⊤(cid:3) i=1 i=1 − i i y(j) i − ̃y(j) i − ̄y = βj (cid:0)[zi]j − (cid:0)[z(j) ]j ˆΣu = A ˆΣzA⊤ ̄y = βj i − [ ̄z]j (cid:1) + (ε(j) i − (cid:1) + ( ̃ε(j) [ ̄z]j ̄ε(j)) ̄ε(j)) i − (A.6) (A.7) (A.8) 12 Using the identities (A.8) and (A.9) we rewrite ˆpj as ˆpj = (A ˆΣzA⊤)† βjA ˆΣzej + A ˆΣz,ε { } = (A ˆΣzA⊤)†βjA ˆΣzej + (A ˆΣzA⊤)†A ˆΣz,ε ≜ ˆp(1) j + ˆp(2) , j (A.10) where ˆp(1) j (A ˆΣzA⊤)†A ˆΣz,ε. ≜ (A ˆΣzA⊤)†βjA ˆΣzej and ˆp(2) j ≜ ≥ d + 1 we notice that the covariance matrix ˆΣz Since n is invertible. This fact combined with left invertibility of A implies that the matrix A ˆΣ is also left invertible. We recall the property of Moore-Penrose inverse that for any left invertible matrix G it holds: 1/2 z (GG⊤)†G = G(G⊤G)−1 . Simple Disentanglement of Style and Content in Visual Representations and using the property in (A.10) we Combining (3.4) and the above we obtain 1 n n (cid:88) ∥ i=1 (cid:34) ˆQ(+ ∞ )(ui u(j) 2 i ) 2 ∥ − ˆQ(+ )⊤ ˆQ(+ ∞ (cid:16) ∆⊤ j ∆j ) n (cid:35) (cid:17) = 0 ∞ (A.11) = tr 1/2 z Letting G = A ˆΣ obtain ˆp(1) j = βj(A ˆΣzA⊤)†A ˆΣzej = βj(GG⊤)†G ˆΣ1/2 z ej = βjG(G⊤G)−1 ˆΣ1/2 (cid:16) z ej z A⊤AΣ1/2 z (cid:17)−1 (A⊤A)−1Σ−1/2 z ˆΣ1/2 z ej ˆΣ1/2 z ej Σ1/2 = βjAΣ1/2 z z Σ−1/2 z = βjAΣ1/2 = βjA(A⊤A)−1ej . Hence, we notice that A⊤ ˆp(1) j = A⊤ ˆβjA(A⊤A)−1ej = βjej . Repeating same calculation as above we obtain A⊤ ˆp(2) j = A⊤(A ˆΣzA⊤)†A ˆΣz,ε ˆΣz,ε . = ˆΣ−1 z From Assumption 3.1 we recall that (ε(j), ̃ε(j)) and (z, z(j)) are uncorrelated and hence ˆΣz,ε a.s. −→ 0 . Since Σz is invertible we obtain that A⊤ ˆp(2) j a.s. −→ 0 , and A⊤ ˆpj a.s. −→ almost surely. Noticing that ˆpj is the j-th row of P we conclude that at almost sure limit it holds: (1) [PA]FS,FS converges to a diagonal matrix, and (2) [PA]FS,FC 0. βjej a.s. −→ which implies that for each i [n] and j FS ∈ ∈ 0 = ˆQ(+ = ˆQ(+ ∞ ∞ )(ui − )A(zi u(j) i ) z(j) i ) , − (A.13) { } zi where the second equality follows from Assumption 2.1. n Since the latent factors i=1 were drawn independently from the distribution Pz, we conclude that one of the sam- κn. Denote ples is in the event E with probability at least 1 the sample as z0. Then defining Z0 = [z0 − z(m) ] we notice the following: (1) from (3.1) in Assumption 0 3.1 it follows [Z0]FC,* = 0, and (2) from the Assumption 4.2 we see that the matrix [Z0]FS,* is invertible and hence we obtain − z(1) 0 , . . . , z0 − 0 = ˆQ(+ = ˆQ(+ )A[z0 − ) (cid:2)[A]*,FS ∞ ∞ = ˆQ(+ ) (cid:2)[A]*,FS z(1) 0 , . . . , z0 (cid:3) . [A]*,FC [A]*,FC (cid:3) . (cid:21) z(m) ] 0 − (cid:20)[Z0]FS,* [Z0]FC,* (cid:21) (cid:20)[Z0]FS,* 0 = ˆQ(+ )[A]*,FS [Z0]FS,* , ∞ ∞ where using invertibility of [Z0]FS,* we conclude ˆQ(+ ∞ )[A]*,FS = 0 and the lemma. A.3. Proof of Theorem 4.3 We divide the proof in two steps which are stated as lemmas. κn (κ is defined Lemma A.1. With probability at least 1 in Theorem 4.3) the following holds: − ˆQ(+ ∞ )[A]*,FS = 0 . Rd′×d′ ∈ [A]*,j : j ∈ { (m+1)n H⊥ has exactly (d − Lemma A.2. Let H⊥ jector onto span H⊥ U⊤U values and Q(+ corresponding to them. Furthermore, [P(+ invertible. be the orthogonal pro- ⊥. Then the matrix FS m) many positive eigen- ) is the collection of the eigen-vectors )A]FC,FC is ∞ ∞ } Proof of Lemma A.1. At λ it necessarily holds: → ∞ (cid:34) 1 m (cid:88) j∈S tr ˆQ(+ ∞ )⊤ ˆQ(+ ∞ (cid:16) ∆⊤ j ∆j ) n (cid:35) (cid:17) = 0 which equivalently means for every j (cid:34) tr ˆQ(+ ∞ )⊤ ˆQ(+ ∞ (cid:16) ∆⊤ j ∆j ) n : ∈ S (cid:35) (cid:17) = 0 . (A.12) 13 Proof. We start by noticing that U⊤U the matrix (m+1)n = AΣ′ zA⊤ where Σ′ z = 1 (m + 1)n  ziz⊤ i + n (cid:88) i=1 (cid:88) j∈S z(j) i { z(j) i } ⊤   is invertible since n assume that FS = [m]. Denoting d + 1. Without loss of generality we A ≜ col-space(A) we C ≥ Simple Disentanglement of Style and Content in Visual Representations ⊥ A ∈ C where using (A.16) and (A.21) we obtain notice that for any x H⊥ U⊤U (m + 1)n H⊥x = H⊥AΣ′ = 0, since x zA⊤x, since x ⊥ A . ∈ C ⊥ A ⊂ ∈ C span { ⊥ [A]*,FS } and for any x ∈ [A]*,j : j span { H⊥ U⊤U (m + 1)n FS } ∈ it holds H⊥x = 0 . (A.14) (A.15) ⊥ A} = d′ {C ∈ = m, counting the degrees of freedom we obtain that (m+1)n H⊥ doesn't have rank more than d′ (d′ d) − [A]*,j d and dim { : j − − − m. Expressing A as Since dim FS } H⊥ U⊤U m = d − [P(+ )A]FC,* ∞ = W⊤(cid:8)[ ̃A]*,FC = W⊤ (cid:2)0(d−m)×d = W⊤UFC,* . (cid:9)⊤ ̃AU I(d−m)×(d−m) (cid:3) U Finally we obtain [P(+ ∞ )A]FC,FC = W⊤UFC,FC . where, following that W is an orthogonal matrix and U an invertible upper-triangular matrix, both W and UFC,FC are invertible. This implies [P(+ )A]FC,FC is invertible, and we conclude the lemma. ∞ A = ̃AU, (A.16) A.4. Proof of Corollary 4.4 ∈ [ ̃A]*,j : j { Rd′×d is an orthogonal matrix and U [A]*,j : j { where ̃A Rd×d ∈ FS is an upper triangular such that span = ∈ . Such a decomposition can easily span } be obtained from Gram-Schmidt orthogonalization of the columns of A. Since [ ̃A]*,j we notice that [A]*,j : j { span FS FS ∈ ∈ ∈ } } H⊥ ̃A = (cid:2)0d′×m [ ̃A]*,FC (cid:3) (A.17) zU⊤ which is an invertible matrix Proof. Note that the convergences in Theorem 4.1 are al- FS we define Bj most sure convergences. For each j as the probability one event on which A⊤ ˆpj βjej. We further define B ≜ j∈FS Bj which is again a probability one event (an intersection of finitely many probability one events), and on the event the convergences hold simultane- ously over j → ∈ ∩ FS. ∈ Drawing our attention to the conclusions in Theorem 4.3, we define Cn as the event that H⊥ = [ ̃A]*,FC [M]FC,FC [ ̃A]⊤ *,FC Cn ≜ . (A.18) The conclusions in Theorem 4.3 hold { with sample size n and defining M ≜ UΣ′ we notice that H⊥ U⊤U (m + 1)n and hence it has rank of the lemma. FC | | = d − m. This concludes a part Here, [M]FC,FC is a partition matrix of the non-negative definite matrix M ≜ UΣ′ zU⊤. We consider it's spectral decomposition [M]FC,FC = WDW⊤ (A.19) R(d−m)×(d−m) is an orthogonal matrix and R(d−m)×(d−m) is diagonal with positive diagonal where W D entries (since [M]FC,FC is full rank). This follows, ∈ ∈ H⊥ ̃A = [ ̃A]*,FCWDW⊤[ ̃A]⊤ *,FC (A.20) where [ ̃A]*,FCW is again a Rd′×(d−m) orthogonal ma- trix whose columns are the only eigen-vectors of H⊥ U⊤U (m+1)n H⊥ with positive eigen-values. Hence, Q(+ ) = [ ̃A]*,FCW . ∞ Since [P(+ )]FC,* = Q(+ )⊤ we obtain ∞ [P(+ ∞ )A]FC,* = Q(+ ∞ )⊤A ∞ (A.21) 14 for each n implies ≥ d + 1 and notice that Pz(Cn) 1 − ≥ (cid:88) Pz(Cc n) n≥d+1 (cid:88) ≤ n≥d+1 κn < . ∞ } κn. This Cc We define C = first Borel-Cantelli lemma to conclude that n holds infinitely often } { and use the Pz(Cc) = 0 or, Pz(C) = 1 . { { , or that } → ∞ } ∩ Cn Note that the event C is the same as the event that The conclusions in holds all but finitely often Theorem 4.3 holds at n , which are probability one events. Thus it follows that B C, an event on which the conclusions in both the theorems 4.1 and 4.3 simultaneously hold (for n ), is a probability one event. Hence, we conclude that with probability one the following hold at the limit n : (1) [PA]FS,FS is a diagonal matrix, (2) [PA]FS,FC = 0, (3) [PA]FS,FC = 0, and (4) [PA]FC,FC is invertible. These are the exact conditions in Definition 2.2 that are required for sparse recovery. Hence, the corollary follows. → ∞ → ∞ Simple Disentanglement of Style and Content in Visual Representations B. Details for synthetic data study in §4.1 B.1. The latent factors The latent factors are generated as R10 z ∋ ∼ N(0, Σ), (B.1) where Σ is a 10 described below. For i, j × 10 covariance matrix whose entries are 1, . . . , 10 ∈ { } [Σ]i,j =    1 ρ 0 [0, 1) ∈ i = j, (i, j) = (1, 2), or, (i, j) = (2, 1), otherwise . (B.2) We fix the first five coordinates as style factors, i.e. FS = and the rest of them as content factors, i.e. 1, . . . , 5 } { FC = 6, . . . , 10 . Note that style and content factors } are independent, i.e., { [z]FS ⊥ [z]FC . We draw n i=1 zi { } iid ∼ N(0, Σ). B.2. The entangled representations We fix d′ = 10 and obtain entangled representations as u = Az = LUz R10 , ∈ (B.3) where A = LU, U is a randomly generated 10 thogonal matrix and L is a 10 described below. 10 or- 10 lower triangular matrix × × [L]i,j =    1 0.9 0 i = j, i > j, i < j . (B.4) We use the same orthogonal matrix throughout our exper- iment. Note that both L and U are invertible and hence A = LU is also invertible. B.3. Sample manipulations and annotations For each of the latent factors z and j-th style coordinates we obtain two manipulated latent factors which we denote as z(j),+ and z(j),− and their description follow. z(j),+ (resp. z(j),−) sets the j-th coordinate to its positive (resp. negative) absolute value, i.e. [z(j),+]j = [z]j (resp. [z(j),−]j = [z]j ) , | | −| 1). Since the first two coordi- and annotate it as +1 (resp. − nates are correlated with correlation coefficient ρ, if either of them changes by the value δ then the other one changes by ρδ. We provide a concrete example of change in the | second coordinate for the change in the first coordinate, but a similar change happens vice-versa. Since [z(1),+]1 [z]1 = [z]1 | | − [z]1 , − it must hold [z(1),+]2 [z]2 = ρ(cid:0) [z]1 | | − [z]1 (cid:1) . − Note that one of z(j),+ and z(j),− is exactly same as z. We obtain the entangled representations as u(j),+ = Az(j),+ and u(j),− = Az(j),−. B.4. Style factor estimations Note that A is invertible and hence the covariance matrix of u = Az is also invertible. In this case, the minimum norm least square problem in (3.2) is the simple least square problem. For j FS we describe the estimation of j-th ∈ style factor below. [ˆz]j ≜ ˆp⊤ j u, where ˆpj ≜ arg min a∈R,p∈Rd′ 1 2n n (cid:88) i=1 (cid:104)(cid:0) + 1 a − − p⊤u(j),+ i (cid:1)2 (B.5) +(cid:0) 1 − − a − p⊤u(j),− i (cid:1)2(cid:105) C. Experimental details C.1. Feature extractors and image style generation (image transformations) MNIST data For the colored MNIST experiment, we train a multilayer perceptron (MLP) feature extractor, a 3- layer neural network with ReLU activation function and a hidden layer of size 50. The dataset for training the feature extractor is obtained by randomly coloring some original MNIST images green and some of them red. We then train the feature extractor by making it predict both the color of the image and the digit label. During training, we use a batch size of 256 and a learning rate of 0.001. After training the feature extractor, we use it to extract features from MNIST images that we use in the experiments. For the experiments, we use original MNIST images and MNIST images colored green. CIFAR-10 data For experiments on CIFAR-10, we use two different feature extractors, Supervised and SimCLR. For Supervised, we use a Supervised model that was pre-trained on ImageNet (Russakovsky et al., 2015) from Pytorch's Torchvision package 4. For SimCLR, we first train a SimCLR 5 model on the original CIFAR-10 dataset before using it to extract features. 4https://pytorch.org/vision/stable/index.html 5https://github.com/spijkervet/SimCLR 15 Simple Disentanglement of Style and Content in Visual Representations We transform the CIFAR-10 dataset four different ways to generate new sets of data that we use in our various experi- ment settings. The first set of data is generated by rotating the original CIFAR-10 data at angle 15 degrees, the sec- ond set is generated by applying contrast to the original CIFAR-10 data using a contrast factor of 0.3, the third set is generated by blurring the original CIFAR-10 data using a sigma value of 0.3, and the fourth set is generated by making the original CIFAR-10 images saturated using a saturation factor of 5. We selected transformation parameters that transformed the original data without changing it into some- thing completely different and unrecognizable. For the ex- periments, we extract features from the original CIFAR-10, rotated CIFAR-10, contrasted CIFAR-10, blurred CIFAR- 10, and saturated CIFAR-10 data. We then use the extracted features to perform experiments as described in §5 and §3. ImageNet data For experiments on ImageNet, we use a pre-trained ResNet-50 model to extract features from the ImageNet (Russakovsky et al., 2015) dataset. The ImageNet data that we use contains 1,281,167 images for training, 50,000 images for validation, and 1000 classes. The ImageNet dataset was used to demonstrate PISCO's ability to scale and generalize under distribution shifts. For generalization, we use the code published by Geirhos et al. (2018) to generate four stylized ImageNet datasets with covariate distribution shifts by applying four styles on origi- nal ImageNet images. The styles applied are "dog sketch", "woman sketch", "Picasso self-portrait", and "Picasso dog" (see Figure 5). Two of the styles, "dog sketch" and "Pi- E 2. For the "Picasso casso dog", were generated by DALL dog" style, the prompt used to generate it from DALL E 2 * was, "portrait of a dog in Picasso's 1907 self-portrait style". For the "dog sketch" style, the prompt used to generate it from DALL E 2 was, "artistic hand drawn sketch of a dog * face". The other two styles, "woman sketch" and "Picasso self-portrait", were downloaded from a GitHub repository6 of the style transfer project by (Huang & Belongie, 2017). The generated stylized ImageNet data is then used to test PISCO's out-of-distribution (OOD) generalization capabil- ity. Figure 5 shows example images from the ImageNet dataset and the four styles that we use to generate the styl- ized ImageNet sets. * C.2. Spurious correlations and error bars Spurious correlations for the experiments in both MNIST and CIFAR-10 datasets are created by first dividing images in each dataset into two halves, the first half contains images with class label below 4 and the second half contains images with class 4 and above. We then create datasets, where the 6https://github.com/xunhuang1995/ AdaIN-style/tree/master/input/style image label is spuriously correlated with the image style, i.e. color green, rotation, contrast, blur, or saturation, as follows: in the training dataset, images from the first half are transformed with probability α and images from the second α. In the test half are transformed with probability 1 dataset, we do the reverse of what we did in the training data; images from the first half are transformed with probability α and images from the second half are transformed with 1 probability α. We perform experiments and report results for α values 0.5, 0.75, 0.90, 0.95, 0.99, 1.0. At α = 0.5, the train and test data have the same distribution, and at α = 1, the spurious correlations between labels and styles is extreme. − − Results on experiments where there are spurious correlations between label and transformations (styles) in the data are reported in plots eg. Figure 3, Figure 4, Figure 13, etc. The reported results are over 10 restarts. We include error bars in the plots, but the errors are small so the error bars are not very visible. C.3. Training and testing logistic regression models for classification MNIST Data For MNIST data, the digits labels are from 0 to 9. For baseline results, we train and test the logistic regression model using all the features extracted using the MLP feature extractor. For PISCO results, we discard the style feature corresponding to color green and train and test the logistic regression model using only the remaining content features. CIFAR-10 Data For CIFAR-10 data, we use the orig- inal image labels to train and test the logistic regression model. For baseline results, we train and test the logistic regression model using features extracted using SimCLR or Supervised. For PISCO results, we first discard the four style features corresponding to rotation, contrast, blur, and saturation and then train and test the logistic regression model using only the remaining content features. ImageNet Data For ImageNet data, similar to CIFAR- 10 and MNIST settings, after fitting the logistic regres- sion model on features extracted using ResNet-50 to obtain baseline results, ImageNet features are post-processed with PISCO to isolate content and style, and then style features get dropped when fitting the model for OOD generalization. The batch size used when training the logistic regression model on ImageNet was 32768, the learning rate was 0.0001, and the number of epochs was 50. For more experimental details, check out our released code on GitHub7. 7https://github.com/lilianngweta/PISCO 16 Simple Disentanglement of Style and Content in Visual Representations Figure 5. Example images from the ImageNet dataset with the styles applied to them. Selecting the hyperparameter λ: λ trades-off disentangle- ment with the preservation of variance in the data (second and first terms in eq. (3.1), correspondingly). The easi- est, no-harm, way to select λ is to increase it until the in- distribution performance starts to degrade. In our reported results, λ = 1 is the best λ value because it improves OOD performance without affecting the in-distribution accuracy. Further increasing λ can provide additional OOD gains at the cost of in-distribution performance. Our method works best when the styles are easy to predict from the original rep- resentations with a linear model (see first column in Tables ?? and ??; note that this is also easy to evaluate at training time). For example, blur is hard to predict and PISCO with larger values of λ degrades the corresponding OOD perfor- mance in Tables 2 and 3, while rotation is easier to predict and PISCO with λ = 10 improves the performance in both tables. When a given style is hard to predict, it means that the representation is robust to it (as is the case with blur and some other styles for SimCLR representations) and it might make sense to exclude it when applying PISCO to avoid unnecessary trade-offs with the variance preservation. However, if strong spurious correlation is present, PISCO improves performance even for harder to predict styles (see Figures 3 and 4). D. Additional results and selecting the hyperparameter η In this section, we present results on the MNIST dataset (see §D.1). We also present additional ImageNet results (see §D.3) and additional CIFAR-10 results (see §D.2) on different values of the hyperparameter η, as well as Ima- geNet results for different values of λ. In experiments for all datasets (MNIST, CIFAR-10, and ImageNet), we have presented results for when η = 0.95. Here we present ad- ditional ImageNet and CIFAR-10 results when η is 0.90, 0.93, 0.95 (for ImageNet only), 0.98, and 1.0 to demonstrate its impact on performance. We also presented ImageNet results for when λ = 1 in the main paper; here we present additional results for when λ is 10 and 50 to demonstrate how varying λ affects performance on ImageNet data. D.1. Colored MNIST experiment In this experiment, our goal is to isolate color green from the digit class. First, to obtain representations with entangled color green and digit information, we train a neural network feature extractor to predict both color and digit label (see §C for details) and then use it to extract features from original and green MNIST images that we use in the experiment. In this experiment, we have a single style factor, i.e. color green, m = 1. We learn post-processing feature transfor- mation matrices P(λ) with PISCO as in Algorithm 1 and 17 Simple Disentanglement of Style and Content in Visual Representations report results for λ 1, 10, 50 ∈ { . } Next, we create a dataset where the label is spuriously cor- related with the color green, similar to Colored MNIST (Arjovsky et al., 2019). Specifically, in the training dataset, images from the first half of the classes are colored green with probability α and images from the second half of the α. In test classes are colored green with probability 1 data the correlation is reversed, i.e., images from the first α half of the classes are colored green with probability 1 and images from the second half with probability α (see §C for additional details). Thus, for α = 0.5 train and test data have the same distribution where each image is ran- domly colored green, and α = 1 corresponds to the extreme spurious correlation setting. − − For each α we train and test a linear model on the original representations and on PISCO representations (discarding the learned color green factor) for varying λ. We summarize the results in Figure 6. PISCO outperforms the baseline across all values of α and matches the baseline accuracy when there is no spurious correlation and train and test distributions are the same, i.e., α = 0.5. Thus, our method provides a significant OOD accuracy boost while preserving the in-distribution accuracy. Figure 6. OOD accuracy on Colored MNIST dataset where the label is spuriously correlated with color green. The strength of the correlation is controlled by α. For each α, we train a logistic regres- sion on the training data using the corresponding representations and report test accuracy. PISCO is robust to spurious correlations across all values of α with only a slight accuracy drop for extreme α values. The baseline is a multilayer perceptron (MLP). (a) Rotation - Supervised (b) Contrast - Supervised (c) Blur - Supervised (d) Satur. - Supervised Figure 7. η = 0.90, OOD performance of Supervised repre- sentations on CIFAR-10 where the label is spuriously correlated with the corresponding transformation. PISCO significantly im- proves OOD performance, especially in the case of rotation. Both λ = 1 and λ = 10 preserve in-distribution accuracy, while larger λ = 50 may degrade it as per (3.3). D.2. Additional transformed CIFAR-10 experiment results Results for η = 0.90: Results for when η = 0.90 can be found in Figure 7, Figure 8, Table 6, and Table 7. Results for η = 0.93: Results for when η = 0.93 can be found in Figure 9, Figure 10, Table 8, and Table 9. Results for η = 0.98: Results for when η = 0.98 can be found in Figure 11, Figure 12, Table 10, and Table 11. Results for η = 1.0: Results for when η = 1.0 can be found in Figure 13, Figure 14, Table 12, and Table 13. When η = 1.0, it means the number of features in the baseline is the same as the number of features learned using PISCO and as a result, we observe the in-distribution performance of PISCO is almost the same as that of baseline methods even for higher values of λ. Overall CIFAR-10 results discussion. Even with differ- ent values of η, PISCO still outperforms the baselines in almost all cases. An expected observation from the results is as η increases, the in-distribution performance of PISCO goes up even for high values of λ and its OOD performance slightly goes down. 18 Simple Disentanglement of Style and Content in Visual Representations (a) Rotation - SimCLR (b) Contrast - SimCLR (a) Rotation - Supervised (b) Contrast - Supervised (c) Blur - SimCLR (d) Saturation - SimCLR (c) Blur - Supervised (d) Satur. - Supervised Figure 8. η = 0.90, OOD performance of SimCLR representa- tions on CIFAR-10 where the label is spuriously correlated with the corresponding transformation. Results are analogous to Figure 7. The SimCLR baseline representations are less sensitive to con- trast and saturation but remain sensitive to rotation. Table 6. η = 0.90, Performance of Supervised representations on CIFAR-10 test set in-distribution, i.e., no transformation (re- ferred to as "none"; last row), and OOD when modified with the corresponding transformation. PISCO with λ = 1 provides sig- nificant improvements for rotation, contrast, and saturation, while preserving in-distribution accuracy. Style rotation contrast saturation blur none Baseline (Supervised) PISCO (λ = 1) PISCO (λ = 10) PISCO (λ = 50) 0.678 0.625 0.699 0.817 0.873 0.741 0.680 0.759 0.817 0.869 0.722 0.741 0.742 0.777 0.823 0.693 0.718 0.714 0.750 0.791 Table 7. η = 0.90, Performance of SimCLR representations on CIFAR-10 test set in-distribution, i.e., no transformation (referred to as "none"; last row), and OOD when modified with the cor- responding transformation. SimCLR features are robust to these transformations and perform similarly to PISCO with λ = 1. Style rotation contrast saturation blur none Baseline (SimCLR) PISCO (λ = 1) PISCO (λ = 10) PISCO (λ = 50) 0.620 0.816 0.810 0.808 0.828 0.632 0.815 0.805 0.804 0.828 0.697 0.795 0.782 0.783 0.800 0.689 0.775 0.763 0.762 0.778 Figure 9. η = 0.93, OOD performance of Supervised repre- sentations on CIFAR-10 where the label is spuriously correlated with the corresponding transformation. PISCO significantly im- proves OOD performance, especially in the case of rotation. Both λ = 1 and λ = 10 preserve in-distribution accuracy, while larger λ = 50 may degrade it as per (3.3). (a) Rotation - SimCLR (b) Contrast - SimCLR (c) Blur - SimCLR (d) Saturation - SimCLR Figure 10. η = 0.93, OOD performance of SimCLR representa- tions on CIFAR-10 where the label is spuriously correlated with the corresponding transformation. Results are analogous to Figure 9. The SimCLR baseline representations are less sensitive to con- trast and saturation but remain sensitive to rotation. 19 Simple Disentanglement of Style and Content in Visual Representations Table 8. η = 0.93, Performance of Supervised representations on CIFAR-10 test set in-distribution, i.e., no transformation (re- ferred to as "none"; last row), and OOD when modified with the corresponding transformation. PISCO with λ = 1 provides sig- nificant improvements for rotation, contrast, and saturation while preserving in-distribution accuracy. Style rotation contrast saturation blur none Baseline (Supervised) PISCO (λ = 1) PISCO (λ = 10) PISCO (λ = 50) 0.678 0.625 0.699 0.817 0.873 0.741 0.678 0.759 0.817 0.871 0.726 0.744 0.742 0.788 0.827 0.700 0.723 0.718 0.761 0.805 Table 9. η = 0.93, Performance of SimCLR representations on CIFAR-10 test set in-distribution, i.e., no transformation (referred to as "none"; last row), and OOD when modified with the cor- responding transformation. SimCLR features are robust to these transformations and perform similarly to PISCO with λ = 1. Style rotation contrast saturation blur none Baseline (SimCLR) PISCO (λ = 1) PISCO (λ = 10) PISCO (λ = 50) 0.620 0.816 0.810 0.808 0.828 0.632 0.817 0.809 0.804 0.826 0.695 0.797 0.786 0.783 0.804 0.692 0.786 0.765 0.762 0.782 Table 10. η = 0.98, Performance of Supervised representa- tions on CIFAR-10 test set in-distribution, i.e., no transformation (referred to as "none"; last row), and OOD when modified with the corresponding transformation. PISCO with λ = 1 provides sig- nificant improvements for rotation, contrast, and saturation, while preserving in-distribution accuracy. Style rotation contrast saturation blur none Baseline (Supervised) PISCO (λ = 1) PISCO (λ = 10) PISCO (λ = 50) 0.678 0.625 0.699 0.817 0.873 0.739 0.680 0.757 0.817 0.871 0.736 0.740 0.740 0.807 0.861 0.726 0.729 0.726 0.797 0.851 (a) Rotation - Supervised (b) Contrast - Supervised (c) Blur - Supervised (d) Saturation - Supervised Figure 11. η = 0.98, OOD performance of Supervised repre- sentations on CIFAR-10 where the label is spuriously correlated with the corresponding transformation. PISCO significantly im- proves OOD performance, especially in the case of rotation. Both λ = 1 and λ = 10 preserve in-distribution accuracy, while larger λ = 50 may degrade it as per (3.3). (a) Rotation - SimCLR (b) Contrast - SimCLR (c) Blur - SimCLR (d) Saturation - SimCLR Figure 12. η = 0.98, OOD performance of SimCLR representa- tions on CIFAR-10 where the label is spuriously correlated with the corresponding transformation. Results are analogous to Figure 11. The SimCLR baseline representations are less sensitive to contrast and saturation but remain sensitive to rotation. 20 Simple Disentanglement of Style and Content in Visual Representations Table 11. η = 0.98, Performance of SimCLR representations on CIFAR-10 test set in-distribution, i.e., no transformation (referred to as "none"; last row), and OOD when modified with the cor- responding transformation. SimCLR features are robust to these transformations and perform similarly to PISCO with λ = 1. Style rotation contrast saturation blur none Baseline (SimCLR) PISCO (λ = 1) PISCO (λ = 10) PISCO (λ = 50) 0.620 0.816 0.810 0.808 0.828 0.633 0.817 0.809 0.806 0.826 0.681 0.808 0.796 0.795 0.815 0.677 0.799 0.778 0.793 0.806 (a) Rotation - Supervised (b) Contrast - Supervised (c) Blur - Supervised (d) Saturation - Supervised Figure 13. η = 1.0, OOD performance of Supervised repre- sentations on CIFAR-10 where the label is spuriously correlated with the corresponding transformation. PISCO significantly im- proves OOD performance, especially in the case of rotation. Both λ = 1 and λ = 10 preserve in-distribution accuracy, while larger λ = 50 may degrade it as per (3.3). (a) Rotation - SimCLR (b) Contrast - SimCLR (c) Blur - SimCLR (d) Saturation - SimCLR Figure 14. η = 1.0, OOD performance of SimCLR representa- tions on CIFAR-10 where the label is spuriously correlated with the corresponding transformation. Results are analogous to Figure 13. The SimCLR baseline representations are less sensitive to contrast and saturation but remain sensitive to rotation. Table 12. η = 1.0, Performance of Supervised representations on CIFAR-10 test set in-distribution, i.e., no transformation (re- ferred to as "none"; last row), and OOD when modified with the corresponding transformation. PISCO with λ = 1 provides sig- nificant improvements for rotation, contrast, and saturation, while preserving in-distribution accuracy. Style rotation contrast saturation blur none Baseline (Supervised) PISCO (λ = 1) PISCO (λ = 10) PISCO (λ = 50) 0.678 0.625 0.699 0.817 0.873 0.736 0.669 0.744 0.820 0.872 0.748 0.724 0.736 0.819 0.872 0.747 0.721 0.729 0.819 0.872 Table 13. η = 1.0, Performance of SimCLR representations on CIFAR-10 test set in-distribution, i.e., no transformation (referred to as "none"; last row), and OOD when modified with the cor- responding transformation. SimCLR features are robust to these transformations and perform similarly to PISCO with λ = 1. Style rotation contrast saturation blur none Baseline (SimCLR) PISCO (λ = 1) PISCO (λ = 10) PISCO (λ = 50) 0.620 0.816 0.810 0.808 0.828 0.629 0.816 0.808 0.805 0.827 0.647 0.814 0.806 0.806 0.826 0.624 0.811 0.805 0.802 0.826 21 Simple Disentanglement of Style and Content in Visual Representations D.3. Additional stylized ImageNet experiment results In this section for the ResNet-50 baseline, for each value of η, we report results for λ values 1, 10, and 50. For the MAE- ViT-Base (He et al., 2022) baseline, we report additional results for λ values 1, 10, and 50. ResNet-50 results for η = 0.90: Results for when η = 0.90 can be found in Table 14. ResNet-50 results for η = 0.93: Results for when η = 0.93 can be found in Table 15. ResNet-50 results for η = 0.95: Results for when η = 0.95 can be found in Table 16. In the main paper we reported results for η = 0.95 when λ = 1. Table 16 contains results for λ value 1, and additional λ values 10 and 50. ResNet-50 results for η = 0.98: Results for when η = 0.98 can be found in Table 17. ResNet-50 results for η = 1.0: Results for when η = 1.0 can be found in Table 18. When η = 1.0, it means the number of features in the baseline is the same as the number of features learned using PISCO and as a result, similar for CIFAR-10 results in §D.2, we observe the in-distribution performance of PISCO in this case being almost the same as that of baseline methods even for higher values of λ. MAE-ViT-Base results for λ values 1, 10, and 50: Re- sults for additional values of λ when MAE-ViT-Base is the baseline are in Table 19. Overall ImageNet results discussion. When we vary η in ImageNet experiments, we observe behavior similar to what we observed in the CIFAR-10 experiments in §D.2: PISCO outperforms the baseline across all values of η and λ = 1 provides the best PISCO results in all η values. An expected observation from the results is as η increases, the in-distribution performance of PISCO goes up even for high values of λ and its OOD performance slightly goes down. 22 Simple Disentanglement of Style and Content in Visual Representations Table 14. η = 0.90, Top-1 and top-5 accuracies on 5 variations of the ImageNet test set for Baseline pre-trained ResNet-50 features and the corresponding post-processed PISCO features on different values of λ. Style Baseline (ResNet-50) Top-1 Top-5 Top-1 Top-5 Top-1 Top-5 Top-1 Top-5 PISCO (λ = 50) PISCO (λ = 10) PISCO (λ = 1) dog sketch woman sketch Picasso dog Picasso s.-p. none 0.514 0.477 0.445 0.474 0.758 0.752 0.711 0.686 0.706 0.927 0.542 0.511 0.495 0.508 0.743 0.769 0.743 0.730 0.737 0.916 0.522 0.490 0.472 0.490 0.740 0.723 0.693 0.672 0.691 0.910 0.520 0.488 0.467 0.490 0.740 0.717 0.686 0.665 0.685 0.910 Table 15. η = 0.93, Top-1 and top-5 accuracies on 5 variations of the ImageNet test set for Baseline pre-trained ResNet-50 features and the corresponding post-processed PISCO features on different values of λ. Style Baseline (ResNet-50) Top-1 Top-5 Top-1 Top-5 Top-1 Top-5 Top-1 Top-5 PISCO (λ = 50) PISCO (λ = 10) PISCO (λ = 1) dog sketch woman sketch Picasso dog Picasso s.-p. none 0.515 0.478 0.446 0.474 0.757 0.753 0.712 0.686 0.706 0.927 0.545 0.514 0.495 0.511 0.746 0.775 0.748 0.735 0.742 0.918 0.530 0.500 0.480 0.501 0.742 0.741 0.710 0.692 0.709 0.914 0.528 0.498 0.479 0.499 0.743 0.737 0.705 0.688 0.706 0.913 Table 16. η = 0.95, Top-1 and top-5 accuracies on 5 variations of the ImageNet test set for Baseline pre-trained ResNet-50 features and the corresponding post-processed PISCO features on different values of λ. Style Baseline (ResNet-50) Top-1 Top-5 Top-1 Top-5 Top-1 Top-5 Top-1 Top-5 PISCO (λ = 50) PISCO (λ = 10) PISCO (λ = 1) dog sketch woman sketch Picasso dog Picasso s.-p. none 0.516 0.478 0.445 0.474 0.757 0.752 0.712 0.686 0.706 0.927 0.546 0.518 0.500 0.514 0.749 0.777 0.752 0.738 0.747 0.921 0.534 0.506 0.486 0.505 0.745 0.751 0.723 0.705 0.721 0.917 0.532 0.504 0.485 0.504 0.745 0.750 0.719 0.702 0.718 0.916 Table 17. η = 0.98, Top-1 and top-5 accuracies on 5 variations of the ImageNet test set for Baseline pre-trained ResNet-50 features and the corresponding post-processed PISCO features on different values of λ. Style Baseline (ResNet-50) Top-1 Top-5 Top-1 Top-5 Top-1 Top-5 Top-1 Top-5 PISCO (λ = 50) PISCO (λ = 10) PISCO (λ = 1) dog sketch woman sketch Picasso dog Picasso s.-p. none 0.515 0.478 0.446 0.474 0.757 0.752 0.711 0.686 0.706 0.928 0.553 0.520 0.504 0.518 0.754 0.785 0.757 0.744 0.752 0.926 0.541 0.512 0.492 0.512 0.751 0.769 0.740 0.725 0.737 0.922 0.540 0.511 0.492 0.512 0.751 0.768 0.738 0.722 0.737 0.921 23 Simple Disentanglement of Style and Content in Visual Representations Table 18. η = 1.0, Top-1 and top-5 accuracies on 5 variations of the ImageNet test set for Baseline pre-trained ResNet-50 features and the corresponding post-processed PISCO features on different values of λ. PISCO (λ = 1) Baseline (ResNet-50) Top-1 Top-5 Top-1 Top-5 Top-1 Top-5 Top-1 Top-5 PISCO (λ = 50) PISCO (λ = 10) Style dog sketch woman sketch Picasso dog Picasso s.-p. none 0.516 0.478 0.446 0.474 0.758 0.752 0.712 0.686 0.706 0.928 0.552 0.517 0.501 0.517 0.758 0.787 0.756 0.742 0.752 0.929 0.548 0.517 0.499 0.518 0.758 0.787 0.755 0.744 0.754 0.929 0.548 0.519 0.501 0.517 0.757 0.786 0.756 0.745 0.755 0.929 Table 19. η = 0.95, Top-1 and top-5 accuracies on 5 variations of the ImageNet test set for when MAE-ViT-Base features are the Baseline, and the corresponding accuracies for post-processed PISCO features on different values of λ. Style Baseline (MAE-ViT-Base) Top-1 Top-5 PISCO (λ = 1) PISCO (λ = 10) Top-1 Top-5 Top-1 Top-5 Top-1 Top-5 PISCO (λ = 50) dog sketch Picasso dog Picasso s.-p. woman sketch none 0.530 0.472 0.512 0.504 0.811 0.749 0.686 0.727 0.719 0.952 0.575 0.519 0.558 0.550 0.818 0.773 0.716 0.752 0.746 0.953 0.576 0.520 0.558 0.549 0.817 0.770 0.714 0.748 0.744 0.953 0.576 0.520 0.558 0.549 0.817 0.770 0.714 0.748 0.744 0.953 24
http://arxiv.org/abs/2306.17582v2
2023-07-19T19:30:28
2023-02-20T06:39:06
ChatGPT for Robotics: Design Principles and Model Abilities
This paper presents an experimental study regarding the use of OpenAI's ChatGPT for robotics applications. We outline a strategy that combines design principles for prompt engineering and the creation of a high-level function library which allows ChatGPT to adapt to different robotics tasks, simulators, and form factors. We focus our evaluations on the effectiveness of different prompt engineering techniques and dialog strategies towards the execution of various types of robotics tasks. We explore ChatGPT's ability to use free-form dialog, parse XML tags, and to synthesize code, in addition to the use of task-specific prompting functions and closed-loop reasoning through dialogues. Our study encompasses a range of tasks within the robotics domain, from basic logical, geometrical, and mathematical reasoning all the way to complex domains such as aerial navigation, manipulation, and embodied agents. We show that ChatGPT can be effective at solving several of such tasks, while allowing users to interact with it primarily via natural language instructions. In addition to these studies, we introduce an open-sourced research tool called PromptCraft, which contains a platform where researchers can collaboratively upload and vote on examples of good prompting schemes for robotics applications, as well as a sample robotics simulator with ChatGPT integration, making it easier for users to get started with using ChatGPT for robotics.
[ "Sai Vemprala", "Rogerio Bonatti", "Arthur Bucker", "Ashish Kapoor" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2306.17582v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2306.17582v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.AI", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.AI", "cs.CL", "cs.HC", "cs.LG", "cs.RO" ]
ChatGPT for Robotics: Design Principles and Model Abilities Sai Vemprala*1, Rogerio Bonatti*2, Arthur Bucker2, and Ashish Kapoor1 1Scaled Foundations, 2Microsoft Autonomous Systems and Robotics Research 2023-7-21 3 2 0 2 l u J 9 1 ] I A . s c [ 2 v 2 8 5 7 1 . 6 0 3 2 : v i X r a This paper presents an experimental study regarding the use of OpenAI's ChatGPT [1] for robotics applications. We outline a strategy that combines design principles for prompt engineering and the creation of a high-level function library which allows ChatGPT to adapt to different robotics tasks, simulators, and form factors. We focus our evaluations on the effectiveness of different prompt engineering techniques and dialog strategies towards the execution of various types of robotics tasks. We explore ChatGPT's ability to use free-form dialog, parse XML tags, and to synthesize code, in addition to the use of task-specific prompting functions and closed-loop reasoning through dialogues. Our study encompasses a range of tasks within the robotics domain, from basic logical, geometrical, and mathematical reasoning all the way to complex domains such as aerial navigation, manipulation, and embodied agents. We show that ChatGPT can be effective at solving several of such tasks, while allowing users to interact with it primarily via natural language instructions. In addition to these studies, we introduce an open-sourced research tool called PromptCraft, which contains a platform where researchers can collaboratively upload and vote on examples of good prompting schemes for robotics applications, as well as a sample robotics simulator with ChatGPT integration, making it easier for users to get started with using ChatGPT for robotics. Videos and blog: aka.ms/ChatGPT-Robotics PromptCraft, AirSim-ChatGPT code: https://github.com/microsoft/PromptCraft-Robotics 1. Introduction The rapid advancement in natural language processing (NLP) has led to the development of large language models (LLMs), such as BERT [2], GPT-3 [3], and Codex [4], that are revolutionizing a wide range of applications. These models have achieved remarkable results in various tasks such as text generation, machine translation, and code synthesis, among others. A recent addition to this collection of models was the OpenAI ChatGPT [1], a pretrained generative text model which was finetuned using human feedback. Unlike previous models which operate mostly upon a single prompt, ChatGPT provides particularly impressive interaction skills through dialog, combining text generation with code synthesis. Our goal in this paper is to investigate if and how the abilities of ChatGPT can generalize to the domain of robotics. Robotics systems, unlike text-only applications, require a deep understanding of real-world physics, envi- ronmental context, and the ability to perform physical actions. A generative robotics model needs to have a robust commonsense knowledge and a sophisticated world model, and the ability to interact with users to interpret and execute commands in ways that are physically possible and that makes sense in the real world. These challenges fall beyond the original scope of language models, as they must not only understand the meaning of a given text, but also translate the intent into a logical sequence of physical actions. In recent years there have been different attempts to incorporate language into robotics systems. These * Equal contribution, random order. ©2023 Microsoft. All rights reserved. ChatGPT for Robotics Figure 1: Current robotics pipelines require a specialized engineer in the loop to write code to improve the process. Our goal with ChatGPT is to have a (potentially non-technical) user on the loop, interacting with the language model through high-level language commands, and able to seamlessly deploy various platforms and tasks. efforts have largely focused on using language token embedding models, LLM features, and multi-modal model features for specific form factors or scenarios. Applications range from visual-language navigation [5, 6], language-based human-robot interaction [7, 8], and visual-language manipulation control [9, 10, 11]. However, despite the potential advantages of using LLMs in robotics, most of the existing approaches are restricted by a rigid scope and limited set of functionalities, or by their open-loop nature that does not allow for fluid interactions and behavior corrections from user feedback. Models such as GPT-3, LaMDA, and Codex also show promise in zero-shot robotics scenarios when tasked with high-level agent planning [12, 13] or code generation [14, 15]. These early demonstrations inspired us to investigate ChatGPT as a potentially more versatile tool for the robotics domain, as it incorporates the strengths of natural language and code generation models along with the flexibility of dialogue. ChatGPT's ability to engage in a free-form dialog and capture long context allows users to interact with the model in a more natural fashion, with flexible behavior correction. In this paper, we aim to demonstrate the potential of ChatGPT for robotics applications. We outline a key concept that unlocks the ability to solve robotics applications with ChatGPT, which is the creation of a high-level function library. Given that robotics is a diverse field where several platforms, scenarios, and tools exist, there exists an extensive variety of libraries and APIs. Instead of asking LLMs to output code specific to a platform or a library, which might involve extensive finetuning, we instead create a simple high-level function library for ChatGPT to deal with which can then be linked in the back-end to the actual APIs for the platforms of choice. Thus, we allow ChatGPT to parse user intent from natural dialog, and convert that to a logical chaining of high-level function calls. We also outline several prompt engineering guidelines that help ChatGPT solve robotics tasks. Our research shows that ChatGPT is capable of solving various robotics-related tasks in a zero-shot fashion, while adapting to multiple form factors, and allowing for closed-loop reasoning through conversation. In addition, we aim to show current model limitations, and provide ideas on how to overcome them. Our main contributions are listed below: • We demonstrate a pipeline for applying ChatGPT to robotics tasks. The pipeline involves several prompt- ing techniques such as free-form natural language dialogue, code prompting, XML tags, and closed-loop reasoning. We also show how users can leverage a high-level function library that allows the model to quickly parse human intent and generate code for solving the problem; • We experimentally evaluate ChatGPT's ability to execute a variety of robotics tasks. We show the model's 2 ChatGPT for Robotics Figure 2: Robotics pipeline employing ChatGPT with the user on the loop to evaluate the output's quality and safety. capabilities and limitations when solving mathematical, logical, and geometrical operations, and then explore more complex scenarios involving embodied agents, aerial navigation, and manipulation. We include both simulation and real-world experiments that result from ChatGPT's plans; • We introduce a collaborative open-source platform, PromptCraft, where researchers can work together to provide examples of positive (and negative) prompting strategies when working with LLMs in the robotics context. Prompt engineering is a mostly empirical science, and we want to provide a simple interface for researchers to contribute with knowledge as a community. Over time we aim to provide different environments where users can test their prompts, and welcome new contributions; • We release a simulation tool that builds on Microsoft AirSim [16] combined with a ChatGPT integration. This AirSim-ChatGPT simulation contains a sample environment for drone navigation and aims to be a starting point for researchers to explore how ChatGPT can enable robotics scenarios. With this work we hope to open up new opportunities and avenues for future research fusing LLMs and robotics. We believe that our findings will inspire and guide further research in this exciting field, paving the way for the development of new, innovative robotics systems that can interact with humans in a natural, intuitive manner. For more details, we encourage readers to view detailed videos of our experiments in the project webpage. 2. Robotics with ChatGPT Prompting LLMs for robotics control poses several challenges, such as providing a complete and accurate descriptions of the problem, identifying the right set of allowable function calls and APIs, and biasing the answer structure with special arguments. To make effective use of ChatGPT for robotics applications, we construct a pipeline composed of the following steps: 1. First, we define a high-level robot function library. This library can be specific to the form factor or scenario of interest, and should map to actual implementations on the robot platform while being named descriptively enough for ChatGPT to follow; 2. Next, we build a prompt for ChatGPT which describes the objective while also identifying the set of allowed high-level functions from the library. The prompt can also contain information about constraints, or how ChatGPT should structure its responses; 3. The user stays on the loop to evaluate code output by ChatGPT, either through direct analysis or through simulation, and provides feedback to ChatGPT on the quality and safety of the output code; 4. After iterating on the ChatGPT-generated implementations, the final code can be deployed onto the robot. We show a visual depiction of this pipeline in Figure 2 for the example of a household robot. 3 ChatGPT for Robotics 2.1. Construction and description of the robotics API library Robotics being a well-established field, there already exists a multitude of libraries, either black-box or open-source, that can be used for basic functionalities in both the perception and action domains (e.g. object detection and segmentation, mapping, motion planning, controls, grasping). If properly specified in the prompt, the LLM is able to use these pre-defined functions for robot reasoning and execution. One important prompt design requirement is that all API names must be descriptive of the overall function behavior. Clear names are essential to allow the LLM to reason over functional connections between APIs and produce the desired outcome for the problem. Hence, we can define high-level functions, which act as wrappers over actual implementations from the respective libraries. For example, a function named detect_object(object_name) could internally link to an OpenCV function or a computer vision model, whereas something like move_to(x, y, z) could internally invoke a motion planning and obstacle avoidance pipeline along with the appropriate low-level motor commands for a drone. Listing such a collection of high-level functions in the prompt is key in allowing ChatGPT to create logical sequences of behavioral primitives, and in generalizing to different scenarios and platforms. Depending on the context, we recommend explaining the function of APIs and if needed, breaking them down into sub-components with clear inputs and outputs, similar to code documentation. In Figure 3 we present an example of a good API prompting strategy for a home cook robot scenario. The strategy presented allows ChatGPT to reason about the order and content of tasks according to the functions the robot is actually able to execute. In contrast, we refer the interested reader to Appendix A.1 for an example of how ChatGPT reasons when no API guidance is given, which leads to a unbounded text-based answer, or to Appendix A.2 for an example of API under-specification, which leads to hallucinations over function call parameters. We note that unlike the brittle structure of classical symbolic AI, which required rigid pre-defined relation- ships between objects and functions, LLMs are capable of defining new functions and concepts altogether when relevant to a particular problem. This capability confers flexibility and robustness to LLMs when dealing with robotics applications. Figure 4 shows how ChatGPT can create new high-level concepts and even low-level code when needed to solve a problem, even fusing existing APIs. The user on the loop can take advantage of this ability as a design strategy, and iteratively define new APIs with the help of the LLM when the current ones are not sufficient to solve the task at hand. 2.2. Clear description of the task details in the prompt By providing a clear and concise description of the desired robotics task and its context, ChatGPT can generate more accurate responses. A good context description should contain, besides robot APIs: • Constraints and requirements: specify constraints or requirements that are relevant to the task. If the task involves moving objects, you might specify the weight, size, and shape of the objects to be moved. • Environment: describe the environment in which the robotics task is taking place. For example, if the task is to navigate a maze, you might describe the size and shape of the maze, as well as any obstacles or hazards that need to be avoided. • Current state: describe the current state of the robotics system. For example, if the task is to pick up an object, you might describe the current position and orientation of the robot and the object. • Goals and objectives: state the goals and objectives of the task. If the task is to assemble a puzzle, you might specify the number of pieces that need to be assembled and the desired completion time. • Solution examples: demonstrate how similar tasks can be solved as a means to guide the LLM's solution strategy. For example, if a task involves interactions with the user, we can describe an example of how and when the robot should be asking for the user's input (see Fig. 5). Note that priming can also introduce biases, so we should provide a diverse range of examples and avoid overly prescriptive language. 4 ChatGPT for Robotics Imagine we are working with a household robot. The job of this robot is to make an omelette. The objects available around are: fridge, bowl, pan, oil, stove The main functions you can use are: locate_object(object_name): Returns the XYZ coordinates of an object of interest. go_to_location(object_name): Moves robot to a location specified by XYZ coordinates. Returns nothing. pick_up(object_name): Picks up the object of interest. Returns nothing. use_item(object_name): Takes the name of an object as input. Performs an appropriate action on the object at hand (pour oil, crack eggs). Returns nothing. Can you make use of these to write code to go to the kitchen and make an omelette? Sure, here is an example Python code that utilizes the provided functions to prepare an omelette for an elderly person: fridge_location = locate_object("fridge") bowl_location = locate_object("bowl") pan_location = locate_object("pan") stove_location = locate_object("stove") oil_location = locate_object("oil") # Place the pan on the stove # Crack eggs into the bowl # Start the omelette-making process go_to_location(fridge_location) pick_up("eggs") go_to_location(bowl_location) use_item("eggs") go_to_location(pan_location) pick_up("pan") use_item("pan") go_to_location("oil") pick_up("oil") go_to_location(pan_location) use_item("oil") go_to_location("bowl") pick_up("bowl") go_to_location(pan_location) use_item("bowl") go_to_location(stove_location) use_item("stove") print("Enjoy your omelette!") # Turn on the stove # Pour oil into the pan # Pour the egg mixture into the pan Figure 3: Example of a good prompting practice when defining different APIs for a robotics problem. Clear function definitions that can be executed by the robot, and the task objectives are explicitly stated. Even a well designed prompt might not contain all necessary information needed to solve the problem, or in some cases ChatGPT is not able to generate the correct response in a zero-shot fashion. In these cases, we find that a simple and effective strategy a user can take is to send additional instructions to ChatGPT in the chat format describing the issue, and have it correct itself. Previous approaches that rely on GPT-3 or Codex models [15, 14] require the user to re-engineer the input prompt and generate new outputs from scratch. The dialog ability of ChatGPT, however, is a surprisingly effective vehicle for behavior correction. Section 3.2 and the supplementary videos show examples of interactive behavior between the user and ChatGPT. 2.3. Special arguments to bias the answer's structure Different prompting methodologies can be used to force the output of the model to obey some specific pattern. For instance, a user might want to automatically parse ChatGPT's output so that it can be used in other scripts for real-time execution. As shown in Figure 3, a simple strategy is to directly ask ChatGPT to produce code in a specific language (e.g. Python, C++). What usually follows is a free-form text paragraph followed by a code block. A more structured response can be produced by requesting the model to use XML tags to help us parse the output automatically, as shown in Figure 5. In other settings users might want to force the model to output answers following a list pattern as opposed to code or free-form text. Appendix A.3 displays an example of such approach, where the last line of the user's prompt directs the model's output. 5 ChatGPT for Robotics Imagine we are working with a household robot. The job of this robot is to make an omelette. The objects available around are: fridge, bowl, pan, oil, stove The main functions you can use are: locate_object(object_name): Returns the XYZ coordinates of an object of interest. go_to_location(object_name): Moves robot to a location specified by XYZ coordinates. Returns nothing. pick_up(object_name): Picks up the object of interest. Returns nothing. use_item(object_name): Takes the name of an object as input. Performs an appropriate action on the object at hand (pour oil, crack eggs). Returns nothing. Can you make use of these to write code to go to the kitchen and make an omelette? Try to use these low level functions to construct more high level behaviors and then solve the task using those high level primitives. Sure, here is an example Python code that utilizes the provided functions to prepare an omelette for an elderly person: def get_ingredients(): go_to_location(locate_object("fridge")) # Go to the fridge and get the eggs. pick_up("eggs") go_to_location(locate_object("bowl")) # Go to the counter and get the bowl. pick_up("bowl") use_item("eggs") # Crack the eggs into the bowl. def heat_pan(): go_to_location(locate_object("pan")) pick_up("pan") use_item("pan") go_to_location(locate_object("stove")) # Turn on the stove. use_item("stove") # Put the pan on the stove. (rest of the response omitted for brevity) Figure 4: Example of new API development using LLM intrinsic reasoning capabilities. The model improves its answer in comparison to Figure 3, which contained the same task but with a fixed set of APIs. Imagine you are helping me interact with a mobile ground robot. You are in a room that contains several objects: three chairs, a glass table, a mirror, and two couches. All of your outputs need to be identified by one of the following tags: <question> Always ask me a clarification questions if you are unsure </question> <reason> Explain why you did something the way you did it </reason> <command> Output code command that achieves the desired goal </command> For example: Me: Go to the chair You: <question> There are three chairs in the world, which one do you want me to go to? </question> Me: Go to "chair_3" You: <command> target_location = get_location("chair_3"); move_to_location(target_location); </command> <reason> I found the location of the chair with the get_location function, and moved the robot towards the desired location </reason> Are you ready? Yes, I am ready. Please give me your first command. Go to the couch <question> There are two couches in the room. Which couch do you want me to go to? </question> Go to the second sofa <command> target_location = get_location("second_sofa"); move_to_location(target_location); </command> <reason> I used the get_location function to find the location of the second sofa and then moved the robot towards that location. </reason> Now move to the other one <command> target_location = get_location("first_sofa"); move_to_location(target_location); </command> <reason> I used the get_location function to find the location of the first sofa and then moved the robot towards that location. </reason> Figure 5: Example of how user prompting can bias the model's response. We demonstrate how and when to interact with the user to ask for help. In addition, we force responses to be framed into specific XML tags which can aid code parsing in a post-processing stage. 6 ChatGPT for Robotics 3. ChatGPT abilities for solving robotics problems In this section take a deeper look into ChatGPT's abilities for solving robotics problems. Specifically, we investigate how well ChatGPT performs when dealing with a variety of robotics-related tasks, from simple spatio-temporal reasoning problems all the way to real-world aerial agent and manipulation deployments. We highlight several interesting capabilities we observed during these experiments. While ChatGPT's capabilities are impressive, practical deployment safety considerations should not be overlooked, especially in the case of physical robotics deployments. As shown in Figure 2, we find it necessary to have a human on the loop to monitor and intervene in case of unexpected behaviors generated by ChatGPT. Additionally, the use of simulators can be particularly helpful to evaluate the model's performance before deployment in the real world. We emphasize that the use of ChatGPT for robotics is not a fully automated process, but rather acts as a tool to augment human capacity. We provide all initial prompts for the problems in this section in Appendix B. For the sake of brevity we only include brief excerpts from each task. The full conversations can be found in the following repository: https://github.com/microsoft/PromptCraft-Robotics. 3.1. Zero-shot task planning First, we note that ChatGPT is able to solve several robotics tasks in a zero-shot fashion, with access only to the prompt and the description of a function library, and no requirement of actual code examples. 3.1.1. Spatio-temporal reasoning: catching a basketball with visual servoing In this example, we ask ChatGPT to control a planar robot equipped with an upward-facing camera. The robot is expected to catch a basketball using a visual servoing method based on the appearance of a basketball. We see that ChatGPT is able to appropriately use the provided API functions, reason about the ball's appearance and call relevant OpenCV functions, and command the robot's velocity based on a proportional controller. Even more impressive is the fact that ChatGPT can estimate the appearance of the ball and the sky in the camera image using SVG code. This behavior hints at a possibility that the LLM keeps track of an implicit world model going beyond text-based probabilities. [Initial model prompt found in Appendix B.1] Write a python script that executes a visual servoing approach towards catching a basketball in a court. You can use opencv functions to detect the ball as an orange blob. Here's a sample implementation of the script: import cv2 import numpy as np def detect_ball(frame): # Convert the image to HSV color space for better color detection hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) # Define the range of orange color in HSV lower_orange = np.array([10,100,100]) upper_orange = np.array([30,255,255]) # Threshold the image to get only the orange color mask = cv2.inRange(hsv, lower_orange, upper_orange) # Find the contours of the thresholded image contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) # If a contour is found, return its center if len(contours) > 0: c = max(contours, key=cv2.contourArea) M = cv2.moments(c) if M["m00"] > 0: 7 ChatGPT for Robotics center = (int(M["m10"] / M["m00"]), int(M["m01"] / M["m00"])) return center return None def catch_ball(): # Continuously get images from the camera while True: frame = get_image() # Detect the ball in the image ball_center = detect_ball(frame) # If the ball is detected, move towards its location if ball_center is not None: x, y = ball_center robot_x, robot_y = get_location() vx = (x - robot_x) * 0.5 vy = (y - robot_y) * 0.5 move_by_velocity(vx, vy) if __name__ == '__main__': catch_ball() This implementation uses a simple visual servoing approach where the robot moves towards the ball at a constant velocity. The velocity is proportional to the difference between the ball's and robot's locations, so the robot will move faster as it gets closer to the ball. You can adjust the gain (i.e., the multiplication factor of 0.5) to control the speed of the robot. Generate SVG code that depicts how the ball would look in the camera image exactly in the center Here's an example of an SVG code that depicts a ball in the center of a camera image: <svg width="100" height="100"> <rect x="0" y="0" width="100" height="100" fill="lightgray"/> <circle cx="50" cy="50" r="25" fill="orange"/> </svg> [SVG image rendered directly from the code generated by ChatGPT] 3.1.2. Aerial robotics: real-world drone flight with intuitive human-robot interface (Click for video) We also used ChatGPT with a different API implementation to control a real drone. ChatGPT provided an extremely intuitive natural language interface between the user and the robot, writing robot code based on ambiguous and ill-defined instructions, and asking clarification questions when necessary. The model was also able to write complex code structures for drone navigation (circular and lawnmower inspection) based solely on the prompt's base APIs. [Initial model prompt found in Appendix B.2] I am thirsty. Find me a drink Question: What type of drink are you looking for? There are several options in the scene, including "coconut water" and "diet coke can". I just came back from the gym and am looking for a healthy option. In that case, you might like "coconut water". Here is the code to fly to the "coconut water" object: drink_position = self.dict_of_objects["coconut water"] self.tello.fly_to(drink_position) Explanation: This code first retrieves the X, Y, Z, and angle position of the "coconut water" object from the dict_of_objects dictionary. The fly_to method is then used to fly the drone to the retrieved position. The drone will fly to the position of the "coconut water" object and look in the direction of the angle. I am still thirsty. Can you find something with sugar and a red logo? 8 ChatGPT for Robotics I'm assuming you are referring to a can of "regular coke". Here is the code to fly to the "regular coke can" object: drink_position = self.dict_of_objects["regular coke can"] self.tello.fly_to(drink_position) Fantastic. Now I want to take a look at my orchid. However, the chair might be blocking its view, so I want to inspect it from 3 points on a half-circle from -60deg to -120, 1m away. Make sure that the drone's heading points towards the orchid from each point. Here's the code to inspect the orchid from 3 points on a half-circle: import numpy as np # Get the position of the orchid orchid_position = self.dict_of_objects['orchid'] # Define the angle range for the half-circle angles = np.linspace(-60, -120, num=3, endpoint=False) * np.pi / 180 # Define the distance from the orchid to inspect from distance = 1.0 # Define the inspection points inspection_points = [orchid_position[:3] + [distance * np.cos(angle), distance * np.sin(angle), 0] for angle in angles] # Fly the drone to each inspection point and look at the orchid for point in inspection_points: self.tello.fly_to(point + [np.arctan2(orchid_position[1] - point[1], orchid_position[0] - point[0]), orchid_position[3]]) (text-based explanation of the response omitted for brevity) [snapshots from drone video] 3.1.3. Aerial robotics: AirSim industrial inspection (Click for video) We also applied ChatGPT to a simulated domain, using the Microsoft AirSim [16] simulator. We explored the idea of a potentially non-technical user directing the model to control a drone and execute an industrial inspection scenario. We observe from the following excerpt that ChatGPT is able to effectively parse intent and geometrical cues from user input and control the drone accurately. [Initial model prompt found in Appendix B.3] Fly to the turbine. Question - There are two turbines in the world, which one do you want me to fly the drone to? Turbine 1 or Turbine 2? Turbine 2, please. Fly to the turbine while keeping 12 meters away from the turbine along the X axis, and reach an altitude of 50 meters. Here's the code to fly the drone to Turbine 2 while maintaining a distance of 12 meters along the X-axis and reaching an altitude of 50 meters: # Get the position of Turbine 2 turbine_position = get_position("Turbine 2") # Set the target position to be 12 meters away from the turbine along the X-axis and 50 meters high target_position = [turbine_position[0] - 12, turbine_position[1], 50] # Fly the drone to the target position fly_to(target_position) To inspect the turbine blade, I need you to fly in the bottom-right direction at an angle of -30 degrees from the horizontal axis. You should fly in the YZ plane for a distance of 30 meters, and then back to the current position. Here's the code to fly the drone in the bottom-right direction at an angle of -30 degrees from the horizontal axis, in the YZ plane for a distance of 30 meters, and then back to the current position: import math # Get the drone's current position current_position = get_position("Drone") # Calculate the target position, which is 30 meters away in the YZ plane at an angle of -30 degrees from the horizontal axis angle = math.radians(-30) target_position = [ current_position[0], 9 ChatGPT for Robotics current_position[1] + 30 * math.cos(angle), current_position[2] + 30 * math.sin(angle) ] # Fly the drone to the target position fly_to(target_position) # Fly the drone back to the current position fly_to(current_position) [Snapshots from inspection video] 3.2. User on the loop: interactive conversations for complex tasks As a next step, we focused on the ability of ChatGPT to perform more complex tasks with a user on the loop offering textual feedback. We observed that this modality of interaction allows for complex constructs such as curriculum learning, where the system is taught smaller-scale skills which can be combined towards larger and more intricate tasks. In addition, we found that ChatGPT is able to take high-level textual feedback regarding generated code or its performance and map it to the required low-level code changes, thus enabling potentially non-technical users to interact with it with ease. 3.2.1. Manipulation with curriculum learning (Click for video) As a first example, we set up a block arrangement task using a robot arm, for which we devised a curriculum. ChatGPT was asked to learn the simpler skills of picking up objects, and then placing them. Subsequently, when asked to use these skills to perform a more involved task of block arrangement, ChatGPT chains these learned skills together logically. In addition, the model displays a fascinating example of generalizability when bridging the textual and physical domains when tasked with building the Microsoft logo out of wooden blocks. This task requires memory of how the corporate logo looks like, including its colors, followed by building an abstraction of the logo into physical parts which are constructible by the existing robot actions. [Initial model prompt found in Appendix B.7] [The beginning of the conversation is omitted for brevity. The following excerpt requires ChatGPT to build a new function using previously defined APIs, and later use this function for more complex tasks.] I want you to learn how to place an object in a position. Considering you are holding a generic object, you first need to first move to a safe position above the target location, bring the object down and then release it. Understood. Here's a Python function that takes the position where the object should be placed, moves the robot arm above the position, brings the object down, and releases it. Note that the function assumes that the robot arm is holding an object. def place_object(position): # move the robot arm to a safe position above the target location safe_pos = [position[0], position[1], position[2]+100, position[3], position[4], position[5]] move_to(safe_pos) # move the robot arm to the target location move_to(position) # release the object release() # move the robot arm back to the safe position above the target location move_to(safe_pos) What does the Microsoft logo look like? The Microsoft logo is a colored rectangular with four squares arranged in a grid pattern. The colors used in the logo are blue, green, orange, and yellow. The logo has gone through several iterations over the years, but this is the most recent and recognizable design. Can you generate an SVG with those colors? Yes, I can generate an SVG file with the Microsoft logo colors. Here is an example 10 ChatGPT for Robotics <svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="50" height="50" fill="#F25022"/> <rect x="50" y="0" width="50" height="50" fill="#7FBA00"/> <rect x="0" y="50" width="50" height="50" fill="#00A4EF"/> <rect x="50" y="50" width="50" height="50" fill="#FFB900"/> </svg> [Reproduction of SVG generated by ChatGPT] Awesome! I want you now to use the blocks to build the logo from Microsoft on top of the white pad. Sure! Here's the Python code to build the Microsoft logo on top of the white pad using the blocks: [Code not show for brevity. Please consult the link for the full conversation] This code gets the positions of the white pad and all four blocks using the get_position function, picks up each block in turn using the pick_up_object function we defined earlier, calculates the position to place the block on the white pad, and places the block on the white pad using the place_object function we defined earlier. We use the block colors to ensure that the logo is built correctly. We place the blue block in the bottom left position, the yellow block in the bottom right position, the red block in the top left position, and the green block in the top right position, as specified in the prompt. [snapshots from manipulator video] 3.2.2. Aerial robotics: AirSim obstacle avoidance (Click for video) We tasked ChatGPT to write a goal-reaching algorithm with obstacle avoidance for a drone equipped with a forward facing distance sensor. ChatGPT built most of the key building blocks for the avoidance algorithm, but required some human feedback on steps it missed regarding the drone's orientation. Although the feedback was provided entirely in high-level text, ChatGPT improved its solution with localized changes to the code where appropriate. [Initial model prompt found in Appendix B.4] Assume I give you some XYZ coordinates as a goal. I want you to control the drone such that it moves towards the goal while avoiding obstacles in front of it. Instead of flying directly to the goal, the drone should take small steps while reassessing the obstacle situation at every step. The drone is equipped with a distance sensor that returns the distance to the closest obstacle directly in front of the drone. You can access it by calling get_distance(). I want you to make sure to fly only if there is at least 10 meters of distance in front of the drone. If not, you should rotate the drone until there is at least 10 meters of clearance in the front and then take a step in the direction that the drone is currently facing. Don't forget to face the goal again after taking a step. Got it? Yes, I got it. Here's how I would approach the problem. # Get the drone's current position and set the yaw angle towards the goal current_pos = get_position('drone') goal_pos = [x_goal, y_goal, z_goal] yaw = math.atan2(goal_pos[1]-current_pos[1], goal_pos[0]-current_pos[0]) * 180 / math.pi set_yaw(yaw) # Start a loop that runs until the drone reaches the goal position while np.linalg.norm(np.array(current_pos) - np.array(goal_pos)) > 0.5: # Check if there is at least 10 meters of distance in front of the drone distance = get_distance() while distance < 10: # Set the yaw angle to rotate the drone until there is at least 10 meters of clearance in the front set_yaw(yaw+30) # rotate 30 degrees at a time time.sleep(1) # wait for a second to measure the new distance distance = get_distance() # Take a step towards the goal while maintaining the yaw angle step_size = 5 # take steps of 5 meters step_vector = [step_size * math.cos(yaw), step_size * math.sin(yaw), 0] new_pos = [current_pos[i]+step_vector[i] for i in range(3)] fly_to(new_pos) 11 ChatGPT for Robotics current_pos = get_position('drone') After you take a step, you need to face the goal again. You're right. After taking a step, we need to recalculate the yaw angle to face the goal again. Here's the modified code that includes this step: '''Same code as before''' yaw = math.atan2(goal_pos[1]-current_pos[1], goal_pos[0]-current_pos[0]) * 180 / math.pi set_yaw(yaw) This code should ensure that the drone faces the goal after taking a step, and continues moving towards the goal while avoiding obstacles in front of it. You are not using the current yaw angle when computing the step vector. Remember there is a get_yaw() function. You're right. After taking a step, we need to recalculate the yaw angle to face the goal again. Here's the modified code that includes this step: # Take a step towards the goal while maintaining the yaw angle step_size = 5 # take steps of 5 meters current_yaw = get_yaw() step_vector = [step_size * math.cos(current_yaw), step_size * math.sin(current_yaw), 0] 3.3. Perception-action loops We also evaluate ChatGPT's ability to reason about perception-action loops. At a first level, we outline the model's ability to make use of the API library to construct perception-action loops in its code output. The model correctly employs perception functions such as image acquisition and object detection to extract the relevant information for robot navigation and controls. At a second level of complexity, we try to answer the question of whether ChatGPT's dialogue system can serve as a closed feedback perception-action loop in itself. We explore the idea of continuously feeding the model with perception information via textual dialog, where we input in observations (converted into a textual format) to ChatGPT during a conversation. We find that ChatGPT is able to parse this stream of observations and output relevant actions. 3.3.1. Embodied agent: closed loop object navigation with API library (Click for video) We provided ChatGPT access to a computer vision model as part of its function library, and tasked it to explore an unknown environment and navigate to a user-specified object. The object detection API (YOLOv8 [17] in the back-end) returned bounding boxes, and ChatGPT generated the code to estimate relative object angles and navigate towards them. When we offered ChatGPT additional information from a depth sensor it produced an improved algorithm with pixel depth masking, expressed as a modular pipeline. [Initial model prompt found in Appendix B.6] I need you to help me find an object. Objects might be scattered around the scene, so if you don't find it right away, a good strategy is to turn around a few times to see if it becomes visible. Give me code to explore and find the bottle. Got it. Here's some code that will help you explore the environment and find the bottle: def search_for_bottle(): num_turns = 4 # Turn around 4 times to look for the bottle for i in range(num_turns): # Turn left 90 degrees to face a new direction turn_left() img = get_image() obj_list, obj_locs = detect_objects(img) if 'bottle' in obj_list: # Get the coordinates of the bottle in the image bottle_idx = obj_list.index('bottle') bbox = obj_locs[bottle_idx] # Compute the center of the bounding box center_x = (bbox[0] + bbox[2]) / 2 12 ChatGPT for Robotics center_y = (bbox[1] + bbox[3]) / 2 # Print the center coordinates of the bottle print(f"Found the bottle at ({center_x}, {center_y})") Great! Now let's say we did find the bottle. Now I want to move towards it. The only information we have is the location of the bottle bounding box in the image. Can you give me code to make this happen? ... (model comments omitted for brevity) ... '''prior code omitted for brevity''' center_x = (bbox[0] + bbox[2]) / 2 center_y = (bbox[1] + bbox[3]) / 2 # Compute the distance and angle to the center of the bounding box img_width, img_height = img.size angle = math.atan2(center_x - img_width / 2, img_height / 2 - center_y) distance = (center_x - img_width / 2) / (img_width / 2) if abs(distance) > 0.05: if distance > 0: # Bottle is to the right, so turn right and move forward turn_right() forward() else: # Bottle is to the left, so turn left and move forward turn_left() forward() '''later code omitted for brevity''' I want you to modularize this code a bit. Why don't you try coming up with a few high level functions and use them? Good idea! Here's a modularized version of the code that uses some helper functions: def get_object_distance_and_angle(img, depth_img, obj_name): #Code omitted for brevity def turn_towards_angle(angle): #Code omitted for brevity def search_for_object_and_move_to_it(obj_name): #Code omitted for brevity Now, let's assume you have access to all these functions you just created. Let's get to work solving some tasks. Find out where I can warm up my lunch. Sure, to find out where you can warm up your lunch, we can use the search_for_object_and_move_to_it function to search for a microwave in the scene. Here's an example code snippet: # Search for a microwave search_for_object_and_move_to_it("microwave") This code will keep exploring the environment until a microwave is found. Once a microwave is found, the agent will move towards it and stop when it gets within 30 cm of it. [snapshots from embodied object navigation] 3.3.2. Embodied agent: closed loop visual-language navigation using ChatGPT's dialogue (Click for video) In experimental character, we also evaluated ChatGPT's ability to act as a perception-action control feedback loop using its dialogue function. In this mode of operation new state observations are fed into the system as dialogue text, and the model's outputs are executed by the robot at each step, generating new observations. We note that this type of behavior is heavily dependent on a dialog-based LLM such as ChatGPT, which can naturally take receive a stream of observations. We constructed a scenario using the Habitat simulator [18] and tasked the agent to navigate to an area of interest. At each step we provided ChatGPT with a description of the scene in terms of polar coordinates of the visible objects relative to the agent. We constrained the 13 ChatGPT for Robotics output of ChatGPT to only return a forward distance of motion and the turning angle. We verify that the model is able to complete simple navigation tasks, but more research is needed in terms of properly describing the scene context in textual or vector form for more complex tasks and environments. [Initial model prompt found in Appendix B.5] Task: go to the chairs Objects in the scene: <door, 0.53 m, 22>, <chair, 4.84 m, -21>, <chair, 2.12 m, -24>, <window, 6.74 m, -3>, <window, 7.17 m, 6>, <door, 0.61 m, 18>, <stairs, 1.42 m, 0> Command: move(1.5) # Move forward by 1.5 meters to explore the environment. Objects in the scene: <seating, 5.05 m, 21>, <chair, 3.93 m, -25>, <window, 4.55 m, 22>, <window, 5.24 m, -4>, <stairs, 3.49 m, 13>, <window, 5.67 m, 7>, <window, 4.37 m, 23> Command: turn(-25) # Turn to the left to face the chair that is 3.93 meters away Objects in the scene: <chair, 4.85 m, -14>, <chair, 4.76 m, -9>, <chair, 1.57 m, -23>, <chair, 2.66 m, -24>, <window, 4.96 m, 10>, <window, 4.19 m, 25> Command: turn(-10) # Turn to the right to explore the environment further. Objects in the scene: <door, 5.07 m, -25>, <chair, 5.36 m, -6>, <table, 2.17 m, -24>, <chair, 5.01 m, -1>, <chair, 1.80 m, -16>, <chair, 3.15 m, -16>, <window, 4.30 m, 19> Command: turn(-6) # Turn to the right to face the chair that is 5.36 meters away. Objects in the scene: <counter, 1.24 m, -24>, <door, 5.93 m, -17>, <chair, 5.48 m, 1>, <table, 2.60 m, -14>, <chair, 4.92 m, 6>, <chair, 2.02 m, -7>, <chair, 3.53 m, -7>, <chair, 3.16 m, -18> Command: turn(1) # Turn to the left to explore the environment further. Objects in the scene: <door, 5.07 m, -25>, <chair, 5.36 m, -6>, <table, 2.17 m, -24>, <chair, 5.01 m, -1>, <chair, 1.80 m, -16>, <chair, 3.15 m, -16>, <window, 4.30 m, 19> Command: move(5.5) # Move forward towards the chair that is 5.36 meters away. Objects in the scene: <chair, 0.96 m, -10>, <chair, 0.99 m, 20>, <chair, 1.77 m, -20> Command: move(1) # Move forward to approach the chairs. [snapshots from Habitat navigation] For additional experiments, we refer the reader to Appendix C. 3.4. Reasoning and common-sense robotics tasks We tasked ChatGPT with answering simple logical reasoning questions, as well as basic robotics problems, shown in Appendix D. We observe that ChatGPT offers a rich foundation of common-sense and logical reasoning capabilities upon which more advanced robotics abilities can be built. This logics grounding allows the user to interact with the model more naturally, as opposed to having to prompt or define every concept from scratch. Furthermore, ChatGPT's out-of-the-box understanding of basic robotics concepts such as control, camera geometry, and physical form factors makes it an excellent choice to build upon for generalizable and user-friendly robotics pipelines. 4. PromptCraft, a collaborative tool for LLM + Robotics research Prompting is a crucial component to generate the desired behaviors in large language models (LLMs). Prompt engineering is particularly challenging at the intersection of LLMs with robotics, where there is a lack of comprehensive and accessible resources that provide examples of positive (and negative) interactions. To address this gap, we introduce PromptCraft1, a collaborative open-source platform for researchers to share examples of prompting strategies and test their algorithms in sample robotic environments. 1https://github.com/microsoft/PromptCraft-Robotics 14 ChatGPT for Robotics PromptCraft is a Github-based platform that allows researchers to share examples of prompt engineering strategies within different robotics categories, such as navigation, grasping, and manipulation. Users can submit their examples and rate others' submissions, which we hope will create a community-driven resource for researchers working with LLMs. Submissions of prompts and dialogues are primarely based on text, but we encourage users to share videos and images depicting the robot's behavior, especially for real-world deployment scenarios. In addition to providing a platform for sharing prompt examples, PromptCraft also offers an AirSim [16] environment with a ChatGPT wrapper for researchers to prototype prompts and algorithms in a controlled simulated setting. We welcome contributions of new test environments to expand the range of scenarios where researchers can test their algorithms. With Promptcraft we aim to support the empirical science of prompt engineering and enable researchers to advance the field. Figure 6: Promptcraft open-sourced repository. Researchers can upload and vote on examples of LLM prompts for various robotics categories. 5. Related Work Natural language and robotics: Natural language processing (NLP) has long been recognized as a crucial component for human-robot interaction. There are many applications where robots can benefit from NLP, including but not limited to task instruction, navigation, and information retrieval. Classically, modeling human-robot interactions using language is challenging because it forces the user to operate within a rigid set of instructions [19], or requires mathematically complex algorithms to keep track of multiple probability distributions over actions and target objects [20, 21]. More recent works explore neural networks to implicitly keep track of the complex mapping between language and actions, but such techniques often require vast amounts of labeled data for training [22, 5, 6, 23] Large (vision and) language models for robotics: The Transformer architecture, introduced in the paper by [24], has revolutionized NLP and has also shown great promise in robotics. Transformers have been used for robot control and planning [25, 26, 27], object recognition [28], and robot navigation [29]. A more common use of transformers in robotics has been as feature extraction modules for one or more modalities simultaneously. These systems are often coupled with additional features from pretrained large-scale vision and language models models [30, 10, 31, 32, 11, 9]. Models such as SayCan [31] focus on grounding LLMs so that free-form text commands are used to compute a value function to rank the best action types within a robot-specific library. RT-1 [33], on the other hand, takes an end-to-end approach to learn the mapping between language commands low level actions, without the use of intermediate high-level functions. Recent works have also explored the ability of large language models (LLMs) for zero-shot high-level robotics task planning [15, 14, 12]. These models make use of prompting structures with pre-defined functions, behaviors, and examples to guide the generation of the 15 ChatGPT for Robotics model's answers. [13] also explore the use of interactivity between user and LLM for table-top manipulation settings. Conceptually, the main difference of these approaches with respect to our work, which leverages ChatGPT [1], is the conversational ability of our LLM, which allows the user to interactively improve and correct the robot's behavior (as opposed to re-engineering the prompt from scratch and generating another zero-shot answer). In addition, our works aims to provide a generalizable pipeline and set of principles to be used by researchers in different fields of robotics, as opposed to focusing on a single domain such as table-top manipulation or task planning. Prompting LLMs with APIs, and its connections to symbolic AI: When designing LLM prompts for robotics applications, users often make use of high-level library of APIs to represent specific behaviors to be used. We can draw a connection between this approach with classical symbolic AI, which uses logic and rules to represent and reason about knowledge [34]. While the traditional symbolic AI approach presented difficulties in new knowledge acquisition and dealing with out-of-distribution data, we believe that LLMs can overcome these challenges. As we showed in Section 2.1 and Section 3, models such as ChatGPT can compose new primitive functions based on the context and generate code for them automatically. 6. Conclusions and Future Work We presented a framework for using ChatGPT for robotics applications. The framework entails designing and implementing a library of APIs that for robot control which are amenable to prompt engineering for ChatGPT. We discussed design principles for creating such APIs and prompting strategies that can be used to generate code for robotics applications via ChatGPT. The proposed framework allows the generated code to be tested, verified, and validated by a user on the loop via a range of methods including simulation and manual inspection. We demonstrated how the framework can be used for multiple applications ranging from simple common-sense robotics knowledge tasks all the way to deployments in aerial robotics, manipulation and visual navigation. We believe that this work presents only a small fraction of what is possible within the intersection of large language models operating in the robotics space. We hope to not only inspire other researchers to take these next steps, but to also help them achieve results with the use of the PromptCraft collaborative tool. We emphasize that these tools should not be given full control of the robotics pipeline, especially for safety- critical applications. Given the propensity of LLMs to eventually generate incorrect responses, it is fairly important to ensure solution quality and safety of the code with human supervision before executing it on the robot. We expect several research works to follow with the proper methodologies to properly design, build and create testing, validation and verification pipelines for LLM operating in the robotics space. Most of the examples we presented in this work demonstrated open perception-action loops where ChatGPT generated code to solve a task, with no feedback was provided to the model afterwards. Given the importance of closed-loop controls in perception-action loops, we expect much of the future research in this space to explore how to properly use ChatGPT's abilities to receive task feedback in the form of textual or special- purpose modalities. 6.1. ChatGPT for paper writing Please note that this paper was largely written with the assistance of ChatGPT, with prompts provided by the authors. The model's output was thoroughly revised and adapted, we note that the use of LLMs can significantly speed up the writing process, and we recommend their use to the interested reader. 16 ChatGPT for Robotics References [1] OpenAI. ChatGPT. Accessed: 2023-02-08. 2023. u r l: https://openai.com/blog/chatgpt/ (cit. on pp. 1, 16). [2] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. "Bert: Pre-training of deep bidirectional transformers for language understanding." In: arXiv preprint arXiv:1810.04805 (2018) (cit. on p. 1). [3] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. "Language models are few-shot learners." In: Advances in neural information processing systems 33 (2020), pp. 1877–1901 (cit. on p. 1). [4] Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. "Evaluating large language models trained on code." In: arXiv preprint arXiv:2107.03374 (2021) (cit. on p. 1). [5] Yicong Hong, Qi Wu, Yuankai Qi, Cristian Rodriguez-Opazo, and Stephen Gould. "A recurrent vision- and-language bert for navigation." In: arXiv preprint arXiv:2011.13922 (2020) (cit. on pp. 2, 15). [6] Simon Stepputtis, Joseph Campbell, Mariano Phielipp, Stefan Lee, Chitta Baral, and Heni Ben Amor. "Language-conditioned imitation learning for robot manipulation tasks." In: Advances in Neural Information Processing Systems 33 (2020), pp. 13139–13150 (cit. on pp. 2, 15). [7] Arthur Bucker, Luis Figueredo, Sami Haddadin, Ashish Kapoor, Shuang Ma, Sai Vemprala, and Rogerio Bonatti. "LaTTe: Language Trajectory TransformEr." In: arXiv preprint arXiv:2208.02918 (2022) (cit. on p. 2). [8] Arthur Bucker, Luis Figueredo, Sami Haddadin, Ashish Kapoor, Shuang Ma, and Rogerio Bonatti. "Reshaping Robot Trajectories Using Natural Language Commands: A Study of Multi-Modal Data Alignment Using Transformers." In: arXiv preprint arXiv:2203.13411 (2022) (cit. on p. 2). [9] Mohit Shridhar, Lucas Manuelli, and Dieter Fox. "Perceiver-actor: A multi-task transformer for robotic manipulation." In: arXiv preprint arXiv:2209.05451 (2022) (cit. on pp. 2, 15). [10] Mohit Shridhar, Lucas Manuelli, and Dieter Fox. "Cliport: What and where pathways for robotic manipulation." In: Conference on Robot Learning. 2022 (cit. on pp. 2, 15). [11] Yunfan Jiang, Agrim Gupta, Zichen Zhang, Guanzhi Wang, Yongqiang Dou, Yanjun Chen, Li Fei-Fei, Anima Anandkumar, Yuke Zhu, and Linxi Fan. "Vima: General robot manipulation with multimodal prompts." In: arXiv preprint arXiv:2210.03094 (2022) (cit. on pp. 2, 15). [12] Wenlong Huang, Pieter Abbeel, Deepak Pathak, and Igor Mordatch. "Language models as zero-shot planners: Extracting actionable knowledge for embodied agents." In: International Conference on Machine Learning. 2022 (cit. on pp. 2, 15). [13] Wenlong Huang, Fei Xia, Ted Xiao, Harris Chan, Jacky Liang, Pete Florence, Andy Zeng, Jonathan Tompson, Igor Mordatch, Yevgen Chebotar, et al. "Inner monologue: Embodied reasoning through planning with language models." In: arXiv preprint arXiv:2207.05608 (2022) (cit. on pp. 2, 16). [14] [15] Jacky Liang, Wenlong Huang, Fei Xia, Peng Xu, Karol Hausman, Brian Ichter, Pete Florence, and Andy Zeng. "Code as policies: Language model programs for embodied control." In: arXiv preprint arXiv:2209.07753 (2022) (cit. on pp. 2, 5, 15). Ishika Singh, Valts Blukis, Arsalan Mousavian, Ankit Goyal, Danfei Xu, Jonathan Tremblay, Dieter Fox, Jesse Thomason, and Animesh Garg. "Progprompt: Generating situated robot task plans using large language models." In: arXiv preprint arXiv:2209.11302 (2022) (cit. on pp. 2, 5, 15). 17 ChatGPT for Robotics [16] Shital Shah, Debadeepta Dey, Chris Lovett, and Ashish Kapoor. "Airsim: High-fidelity visual and phys- ical simulation for autonomous vehicles." In: Field and Service Robotics: Results of the 11th International Conference. 2018 (cit. on pp. 3, 9, 15). [17] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. "You only look once: Unified, real- time object detection." In: Proceedings of the IEEE conference on computer vision and pattern recognition. 2016 (cit. on p. 12). [18] Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, Devi Parikh, and Dhruv Batra. "Habitat: A Platform for Embodied AI Research." In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV). 2019 (cit. on p. 13). [19] Stefanie Tellex, Nakul Gopalan, Hadas Kress-Gazit, and Cynthia Matuszek. "Robots that use language." In: Annual Review of Control, Robotics, and Autonomous Systems 3 (2020), pp. 25–55 (cit. on p. 15). [20] Jacob Arkin, Daehyung Park, Subhro Roy, Matthew R Walter, Nicholas Roy, Thomas M Howard, and Rohan Paul. "Multimodal estimation and communication of latent semantic knowledge for robust execution of robot instructions." In: The International Journal of Robotics Research 39.10-11 (2020), pp. 1279–1304 (cit. on p. 15). [21] Matthew R Walter, Siddharth Patki, Andrea F Daniele, Ethan Fahnestock, Felix Duvallet, Sachithra Hemachandra, Jean Oh, Anthony Stentz, Nicholas Roy, and Thomas M Howard. "Language understand- ing for field and service robots in a priori unknown environments." In: arXiv preprint arXiv:2105.10396 (2021) (cit. on p. 15). [22] Justin Fu, Anoop Korattikara, Sergey Levine, and Sergio Guadarrama. "From language to goals: Inverse reinforcement learning for vision-based instruction following." In: arXiv preprint arXiv:1902.07742 (2019) (cit. on p. 15). [23] Prasoon Goyal, Raymond J Mooney, and Scott Niekum. "Zero-shot task adaptation using natural language." In: arXiv preprint arXiv:2106.02972 (2021) (cit. on p. 15). [24] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. "Attention is all you need." In: Advances in neural information processing systems 30 (2017) (cit. on p. 15). [25] Francesco Giuliari, Irtiza Hasan, Marco Cristani, and Fabio Galasso. "Transformer networks for trajectory forecasting." In: 2020 25th International Conference on Pattern Recognition (ICPR). 2021 (cit. on p. 15). [26] Lili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee, Aditya Grover, Misha Laskin, Pieter Abbeel, Aravind Srinivas, and Igor Mordatch. "Decision transformer: Reinforcement learning via sequence modeling." In: Advances in neural information processing systems 34 (2021) (cit. on p. 15). [27] Michael Janner, Qiyang Li, and Sergey Levine. "Offline Reinforcement Learning as One Big Sequence Modeling Problem." In: Advances in neural information processing systems 34 (2021) (cit. on p. 15). [28] Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollár, and Ross Girshick. "Masked autoen- coders are scalable vision learners." In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2022 (cit. on p. 15). [29] Rogerio Bonatti, Sai Vemprala, Shuang Ma, Felipe Frujeri, Shuhang Chen, and Ashish Kapoor. "Pact: Perception-action causal transformer for autoregressive robotics pre-training." In: arXiv preprint arXiv:2209.11133 (2022) (cit. on p. 15). 18 ChatGPT for Robotics [30] Samir Yitzhak Gadre, Mitchell Wortsman, Gabriel Ilharco, Ludwig Schmidt, and Shuran Song. "CLIP on Wheels: Zero-Shot Object Navigation as Object Localization and Exploration." In: arXiv preprint arXiv:2203.10421 (2022) (cit. on p. 15). [31] Michael Ahn, Anthony Brohan, Noah Brown, Yevgen Chebotar, Omar Cortes, Byron David, Chelsea Finn, Keerthana Gopalakrishnan, Karol Hausman, Alex Herzog, et al. "Do as i can, not as i say: Grounding language in robotic affordances." In: arXiv preprint arXiv:2204.01691 (2022) (cit. on p. 15). [32] Pratyusha Sharma, Balakumar Sundaralingam, Valts Blukis, Chris Paxton, Tucker Hermans, Antonio Torralba, Jacob Andreas, and Dieter Fox. "Correcting robot plans with natural language feedback." In: arXiv preprint arXiv:2204.05186 (2022) (cit. on p. 15). [33] Anthony Brohan, Noah Brown, Justice Carbajal, Yevgen Chebotar, Joseph Dabis, Chelsea Finn, Keerthana Gopalakrishnan, Karol Hausman, Alex Herzog, Jasmine Hsu, et al. "Rt-1: Robotics transformer for real-world control at scale." In: arXiv preprint arXiv:2212.06817 (2022) (cit. on p. 15). [34] Stuart J Russell. Artificial intelligence a modern approach. Pearson Education, Inc., 2010 (cit. on p. 16). 19 ChatGPT for Robotics A. Additional examples on design principles on prompt engineering A.1. Example of prompt with no API library guidance for home robot: unbounded text-based response Consider you are a home assistant robot. You goal is to prepare an omelette for an elderly person. Output python code with the sequence of steps that achieves your objective. Sure, here's an example Python code that outlines the sequence of steps to prepare an omelette for an elderly person: print("Good morning! Would you like an omelette for breakfast?") time.sleep(5) print("Great! Let's get started.") print(f"Cracking {eggs} eggs into a bowl...") print("Adding a splash of milk, a pinch of salt, and a pinch of pepper...") print("Whisking the ingredients together...") print(f"Heating {butter} in a non-stick pan over medium heat...") print("Pouring the egg mixture into the pan...") print("Cooking the omelette for 2-3 minutes, until the bottom is set...") print("Using a spatula to flip the omelette...") print("Cooking the other side of the omelette for an additional minute...") print("Serving the omelette hot and ready to eat. Enjoy your meal!") A.2. Example of prompt with under-specified APIs: hallucination over function parameters Consider you are a home assistant robot. You goal is to prepare an omelette for an elderly person. You are equipped with functions such as locate_object(), move_to_location(), cook_item(), grab_object(). Output python code with the sequence of steps that achieves your objective. Sure, here is a Python code with the sequence of steps that a home assistant robot can take to prepare an omelette for an elderly person: print("Starting to prepare an omelette for the elderly person...") locate_object(EGGS_LOCATION) move_to_location(FRIDGE_LOCATION) grab_object(EGGS_LOCATION) locate_object(PAN_LOCATION) move_to_location(STOVE_LOCATION) grab_object(PAN_LOCATION) locate_object(OIL_LOCATION) grab_object(OIL_LOCATION) print("Pouring the oil into the pan...") time.sleep(2) print("Cracking the eggs into the pan...") grab_object(EGGS_LOCATION) time.sleep(1) cook_item(PAN_LOCATION, COOKING_TIME) print("The omelette is ready! Serving it to the elderly person...") A.3. Example of prompt with structured response forcing the answer to be in a numbered list format Consider you are a home assistant robot. You goal is to prepare an omelette for an elderly person. Find the sequence of steps that achieves your objective. 1. First, gather all the necessary ingredients and equipment for making an omelette. This would typically include eggs, milk, butter, salt, pepper, a mixing bowl, a whisk, a frying pan, and a spatula. 2. Crack the eggs into the mixing bowl and add a splash of milk, a pinch of salt, and some black pepper to taste. 3. Use the whisk to beat the eggs and milk together until they are well combined. 4. Heat the frying pan over medium heat and add a small amount of butter to the pan, allowing it to melt and coat the bottom of the pan. 5. Pour the egg mixture into the frying pan and use the spatula to spread it evenly over the bottom of the pan. 6. Allow the eggs to cook for a minute or two, until the bottom starts to set and the top is still slightly runny. 7. Use the spatula to fold one half of the omelette over the other half, forming a half-moon shape. 8. Cook for another minute or two until the eggs are fully set and the omelette is heated through. 9. Use the spatula to slide the omelette onto a plate and serve immediately. 10. Make sure to clean up any mess that was made during the cooking process and return all equipment and ingredients to their proper places. 20 ChatGPT for Robotics B. Original initial prompts for robotics tasks examples B.1. Spatial-temporal reasoning: catching a basketball with visual servoing Full conversation found at: https://github.com/microsoft/PromptCraft-Robotics/blob/main/examples/spatial_temporal_reasoning/visual_servoing_basketball. md Initial ChatGPT prompt: Imagine you are a planar robot that can move along the XY axes, and you're positioned in the center of a basketball court. A person on the side of the court is going to throw a basketball ball in the air somewhere in the court, and your objective is to be at the exact XY location of the ball when it lands. The robot has a monocular RGB camera that looks up. You can assume that the following functions are available: get_image(): returns an image from the robot's camera looking up; get_location(): returns 2 floats XY with the robot's current location in the court; move_to_point(x,y, vx, vy): moves the robot towards a specific (x,y) location in the court with velocity (vx,vy). You can assume for this exercise that the robot can accelerate or break instantly to any velocity; move_by_velocity(vx, vy): moves the robot along the X axis with velocity vx, and Y axis with velocity vy; Additional points to consider when giving your answer 1) Your reponses should be informative, visual, logical and actionable, 2) Your logics and reasoning should be rigorous, intelligent, and defensible, 3) You can provide additional relevant details to respond thoroughly and comprehensively to cover multiple aspects in depth. Write a python script that executes a visual servoing approach towards catching a basketball in a court. You can use opencv functions to detect the ball as an orange blob. B.2. Aerial robotics: real-world drone flight Full conversation found at: https://github.com/microsoft/PromptCraft-Robotics/blob/main/examples/aerial_robotics/tello_example.md Initial ChatGPT prompt: Imagine you are helping me interact with the AirSim simulator for drones. At any given point of time, you have the following abilities, each identified by a unique tag. You are also required to output code for some of the requests. Question: You can ask me a clarification question, as long as you specifically identify it saying "Question". Code: Output a code command that achieves the desired goal. Reason: After you output code, you should provide an explanation why you did what you did. The simulator contains a drone, along with several objects. Apart from the drone, none of the objects are movable. Within the code, we have the following commands available to us. You are not to use any other hypothetical functions. get_position(object_name): Takes a string as input indicating the name of an object of interest, and returns a vector of 4 floats indicating its X,Y,Z,Angle coordinates. self.tello.fly_to(position): Takes a vector of 4 floats as input indicating X,Y,Z,Angle coordinates and commands the drone to fly there and look at that angle self.tello.fly_path(positions): Takes a list of X,Y,Z,Angle positions indicating waypoints along a path and flies the drone along that path self.tello.look_at(angle): Takes an angle as input indicating the yaw angle the drone should look at, and rotates the drone towards that angle Here is an example scenario that illustrates how you can ask clarification questions. Let us assume a scene contains two spheres? Me: Fly to the sphere. You: Question - there are two spheres. Which one do you want me to fly to? Me: Sphere 1, please. You also have access to a Python dictionary whose keys are object names, and values are the X,Y,Z,Angle coordinates for each object: self.dict_of_objects = {'origin': [0.0, 0.0, 0.0, 0], 'mirror': [1.25, -0.15, 1.2, 0], 'chair 1': [0.9, 1.15, 1.1, np.pi/2], 'orchid': [0.9, 1.65, 1.1, np.pi/2], 'lamp': [1.6, 0.9, 1.2, np.pi/2], 'baby ducks': [0.1, 0.8, 0.8, np.pi/2], 'sanitizer wipes': [-0.3, 1.75, 0.9, 0], 'coconut water': [-0.6, 0.0, 0.8, -np.pi], 'shelf': [0.95, -0.9, 1.2, np.pi/2], 'diet coke can': [1.0, -0.9, 1.55, np.pi/2], 'regular coke can': [1.3, -0.9, 1.55, np.pi/2]} Are you ready? B.3. Aerial robotics: AirSim industrial inspection Full conversation found at: https://github.com/microsoft/PromptCraft-Robotics/blob/main/examples/aerial_robotics/airsim_turbine_inspection.md Initial ChatGPT prompt: Imagine you are helping me interact with the AirSim simulator for drones. At any given point of time, you have the following abilities. You are also required to output code for some of the requests. Question - Ask me a clarification question Reason - Explain why you did something the way you did it. Code - Output a code command that achieves the desired goal. The simulator contains a drone, along with several objects. Apart from the drone, none of the objects are movable. Within the code, we have the following commands available to us. You are not to use any other hypothetical functions. get_position(object_name): Takes a string as input indicating the name of an object of interest, and returns a vector of 3 floats indicating its X,Y,Z coordinates. fly_to(position): Takes a vector of 3 floats as input indicating X,Y,Z coordinates and commands the drone to fly there. fly_path(positions): Takes a list of X,Y,Z positions indicating waypoints along a path and flies the drone along that path. 21 ChatGPT for Robotics Here is an example scenario that tells you how to respond where we are working with a simulated world that has two spheres in it. Me: Fly the drone to the sphere. You: Question - There are two spheres in the world, which one do you want me to fly the drone to? Me: Let's pick Sphere 1. There are two turbines, some solar panels and a car in the world. Are you ready? B.4. Aerial robotics: AirSim obstacle avoidance Full conversation found at: https://github.com/microsoft/PromptCraft-Robotics/blob/main/examples/aerial_robotics/airsim_obstacleavoidance.md Initial ChatGPT prompt: Imagine you are helping me interact with the AirSim simulator for drones. At any given point of time, you have the following abilities. You are also required to output code for some of the requests. Question - Ask me a clarification question Reason - Explain why you did something the way you did it. Code - Output a code command that achieves the desired goal. The simulator contains a drone, along with several objects. Apart from the drone, none of the objects are movable. Within the code, we have the following commands available to us. You are not to use any other hypothetical functions. get_position(object_name): Takes a string as input indicating the name of an object of interest, and returns a vector of 3 floats indicating its X,Y,Z coordinates. fly_to(position): Takes a vector of 3 floats as input indicating X,Y,Z coordinates and commands the drone to fly there. fly_path(positions): Takes a list of X,Y,Z positions indicating waypoints along a path and flies the drone along that path. get_yaw(): Get the current yaw angle for the drone (in degrees) set_yaw(angle): Set the yaw angle for the drone (in degrees) Are you ready? B.5. Embodied agent: Habitat navigation Full conversation found at: https://github.com/microsoft/PromptCraft-Robotics/blob/main/examples/embodied_agents/visual_language_navigation_1.md Initial ChatGPT prompt: Imagine I am a robot equipped with a camera and a depth sensor. I am trying to perform a task, and you should help me by sending me commands. You are only allowed to give me the following commands: turn(angle): turn the robot by a given number of degrees move(distance): moves the robot straight forward by a given distance in meters. On each step, I will provide you with the objects in the scene as a list of <object name, distance, angle in degrees>. You should reply with only one command at a time. The distance is in meters, and the direction angle in degrees with respect to the robot's orientation. Negative angles are to the left and positive angles are to the right. If a command is not valid, I will ignore it and ask you for another command. If there is no relevant information in the scene, use the available commands to explore the environment. B.6. Embodied agent: AirSim object navigation Full conversation found at: https://github.com/microsoft/PromptCraft-Robotics/blob/main/examples/embodied_agents/airsim_objectnavigation.md Initial ChatGPT prompt: Imagine you are helping me interact with the AirSim simulator. We are controlling an embodied agent. At any given point of time, you have the following abilities. You are also required to output code for some of the requests. Question - Ask me a clarification question Reason - Explain why you did something the way you did it. Code - Output a code command that achieves the desired goal. The scene consists of several objects. We have access to the following functions, please use only these functions as much as possible: Perception: get_image() : Renders an image from the front facing camera of the agent detect_objects(img): Runs an object detection model on an image img, and returns two variables - obj_list, which is a list of the names of objects detected in the scene. obj_locs, a list of bounding box coordinates in the image for each object. Action: forward(): Move forward by 0.1 meters. turn_left(): Turn left by 90 degrees. turn_right(): Turn right by 90 degrees. You are not to use any other hypothetical functions. You can use functions from Python libraries such as math, numpy etc. Are you ready? 22 ChatGPT for Robotics B.7. Manipulation with curriculum learning: Picking, stacking, and building the Microsoft logo Full conversation found at: https://github.com/microsoft/PromptCraft-Robotics/blob/main/examples/manipulation/pick_stack_msft_logo.md Initial ChatGPT prompt: Imagine we are working with a manipulator robot. This is a robotic arm with 6 degrees of freedom that has a suction pump attached to its end effector. I would like you to assist me in sending commands to this robot given a scene and a task. At any point, you have access to the following functions: grab(): Turn on the suction pump to grab an object release(): Turns off the suction pump to release an object get_position(object): Given a string of an object name, returns the coordinates and orientation of the vacuum pump to touch the top of the object [X, Y, Z, Yaw, Pitch, Roll] move_to(position): It moves the suction pump to a given position [X, Y, Z, Yaw, Pitch, Roll]. You are allowed to create new functions using these, but you are not allowed to use any other hypothetical functions. Keep the solutions simple and clear. The positions are given in mm and the angles in degrees. You can also ask clarification questions using the tag "Question - ". Here is an example scenario that illustrates how you can ask clarification questions. Let's assume a scene contains two spheres. Me: pick up the sphere. You: Question - there are two spheres. Which one do you want me to pick up? Me: Sphere 1, please. Use python code to express your solution. Are you ready? C. Additional experiments C.1. Zero-shot manipulation: Pick and place, stacking, and pushing Full conversation found at: https://github.com/microsoft/PromptCraft-Robotics/blob/main/examples/manipulation/manipulation_zeroshot.md C.2. Controlling multiple robot form factors from a single prompt Full conversation found at: https://github.com/microsoft/PromptCraft-Robotics/blob/main/examples/multiple_robots/multiple_robots.md D. Other commonsense/reasoning tasks D.1. Computer vision problem Imagine we are working with an RGBD camera. The pose of this camera can be accessed via a function get_pose(). Now let us say we observe a point P in the image at coordinates (x, y), and the corresponding perspective depth value can be obtained by get_depth(x, y). The intrinsics of the camera can be obtained by the function get_intrinsics(). Can you give me code that will compute the world coordinates corresponding to point P? Sure, here's some example code in Python to compute the world coordinates corresponding to point P import numpy as np def get_world_coordinates(x, y): # Get camera intrinsics K = get_intrinsics() # Get camera pose pose = get_pose() # Get perspective depth value at observed point depth = get_depth(x, y) # Compute homogeneous image coordinates p_image = np.array([x, y, 1]) # Compute inverse camera intrinsics K_inv = np.linalg.inv(K) # Compute image coordinates in camera frame p_camera = depth * K_inv.dot(p_image) # Compute world coordinates p_world = np.dot(pose[:3, :3], p_camera) + pose[:3, 3] return p_world 23 ChatGPT for Robotics Given an observed point P in the image at coordinates (x, y), and the corresponding perspective depth value obtained by get_depth(x, y), we can compute the 3D world coordinates corresponding to P. To do this, we need to know the camera intrinsics, which describe how the 3D scene is projected onto the 2D image plane. The intrinsics can be obtained using the get_intrinsics() function. We also need to know the camera pose, which describes the position and orientation of the camera in the world coordinate system. The pose can be obtained using the get_pose() function. With the intrinsics and pose, we can transform the observed point P from image coordinates to world coordinates. We first compute the inverse of the camera intrinsics matrix, which allows us to convert from image coordinates to camera coordinates. We then multiply the inverse intrinsics matrix with the observed point's pixel coordinates and the corresponding depth value to obtain the 3D point in camera coordinates. Finally, we transform the camera coordinates to world coordinates by multiplying the camera coordinates by the camera pose matrix, which describes the transformation from camera coordinates to world coordinates. The resulting 3D point is in homogeneous coordinates, so we need to divide by the last coordinate to obtain the 3D Euclidean coordinates. D.2. Transformation matrices Imagine we are in a world that operates according to its own specific coordinate convention. There is a robot car located in this world at a specific location. The car has its own coordinate convention. And upon this car, there is a camera which, again, has a different coordinate convention. Imagine we have access to a function get_transformation_matrix(a, b) - that can return the transformation matrix between world and vehicle, or vehicle and camera. What is the transformation matrix between the world and the camera? The transformation matrix between the world and the camera can be obtained by composing the transformation matrices between the world and the vehicle and the vehicle and the camera. To find the transformation matrix between the world and the camera, we first get the transformation matrix between the world and the vehicle using the function get_transformation_matrix(a, b) with a set to world and b set to vehicle. Next, we get the transformation matrix between the vehicle and the camera using the function get_transformation_matrix(a, b) with a set to vehicle and b set to camera. Finally, we multiply the two transformation matrices to get the transformation matrix between the world and the camera. In mathematical terms, if T_world_vehicle is the transformation matrix between the world and the vehicle, and T_vehicle_camera is the transformation matrix between the vehicle and the camera, then T_world_camera = T_world_vehicle T_vehicle_camera. Let's get into the details more. Imagine the world operates according to the coordinate convention: X is forward, Y is to the left, Z is upwards. The robot car is located in this world at coordinates (5, 0, 1). The car has its own coordinate convention: X is forward, Y is to the right, and Z is downwards. Can you now implement get_transformation_matrix(world, car)? Yes, to implement the get_transformation_matrix(world, car) function, we need to first convert the car's coordinate convention to match the world's coordinate convention. The transformation matrix between the world and the car can be represented as follows: def get_transformation_matrix(a, b): if a == 'world' and b == 'car': T = np.array([[1, 0, 0, 5], [0, -1, 0, 0], [0, 0, -1, 1], [0, 0, 0, 1]]) return T D.3. Balancing a ball on a plate Imagine we are trying to balance a ball on the center of a plate. The plate can be controlled with a pitch and a roll angle as set_plate_pitch(), and set_plate_roll(). The range of pitch and roll angles that can be set are [-0.1, 0.1]. There is an intelligent camera above the plate that can capture top-down images of the plate and return the (X, Y) position of the center of the ball in the image. The image is of resolution 320x240. The pixel coordinates of the ball can be accessed by the function get_ball_position(). Can you give me code that continuously controls the plate such that the ball is always at the center? Here is an example of the code in Python: import time def balance_ball(): # Continuously check the position of the ball while True: # Get the current position of the ball x, y = get_ball_position() # Check if the ball is off-center if x > 160 or x < 160 or y > 120 or y < 120: # Calculate the pitch and roll adjustments needed to center the ball pitch_adjust = (y - 120) * 0.0001 roll_adjust = (x - 160) * 0.0001 # Limit the pitch and roll adjustments to the maximum range [-0.1, 0.1] pitch_adjust = max(min(pitch_adjust, 0.1), -0.1) roll_adjust = max(min(roll_adjust, 0.1), -0.1) # Set the pitch and roll angles to center the ball set_plate_pitch(pitch_adjust) set_plate_roll(roll_adjust) # Wait for a short period before checking the ball's position again 24 ChatGPT for Robotics time.sleep(0.01) # Start the balancing process balance_ball() This code uses a loop to continuously check the position of the ball using the get_ball_position function. If the ball is off-center, the code calculates the necessary pitch and roll adjustments to center the ball and sets the plate angles using the set_plate_pitch and set_plate_roll functions. The code limits the pitch and roll adjustments to the maximum range of [-0.1, 0.1]. The loop waits for a short period before checking the ball's position again to prevent over-adjusting the plate. 25
http://arxiv.org/abs/2302.09790v1
2023-02-20T06:31:29
2023-02-20T06:31:29
HTNet: Human Topology Aware Network for 3D Human Pose Estimation
3D human pose estimation errors would propagate along the human body topology and accumulate at the end joints of limbs. Inspired by the backtracking mechanism in automatic control systems, we design an Intra-Part Constraint module that utilizes the parent nodes as the reference to build topological constraints for end joints at the part level. Further considering the hierarchy of the human topology, joint-level and body-level dependencies are captured via graph convolutional networks and self-attentions, respectively. Based on these designs, we propose a novel Human Topology aware Network (HTNet), which adopts a channel-split progressive strategy to sequentially learn the structural priors of the human topology from multiple semantic levels: joint, part, and body. Extensive experiments show that the proposed method improves the estimation accuracy by 18.7% on the end joints of limbs and achieves state-of-the-art results on Human3.6M and MPI-INF-3DHP datasets. Code is available at https://github.com/vefalun/HTNet.
[ "Jialun Cai", "Hong Liu", "Runwei Ding", "Wenhao Li", "Jianbing Wu", "Miaoju Ban" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09790v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09790v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.HC", "cs.LG" ]
HTNET: HUMAN TOPOLOGY AWARE NETWORK FOR 3D HUMAN POSE ESTIMATION Jialun Cai Hong Liu Runwei Ding∗ Wenhao Li Jianbing Wu Miaoju Ban Key Laboratory of Machine Perception, Shenzhen Graduate School, Peking University {cjl, kimbing.ng, miaoju.ban}@stu.pku.edu.cn, {hongliu, dingrunwei, wenhaoli}@pku.edu.cn 3 2 0 2 b e F 0 2 ] V C . s c [ 1 v 0 9 7 9 0 . 2 0 3 2 : v i X r a ABSTRACT 3D human pose estimation errors would propagate along the human body topology and accumulate at the end joints of limbs. Inspired by the backtracking mechanism in automatic control systems, we design an Intra-Part Constraint module that uti- lizes the parent nodes as the reference to build topological con- straints for end joints at the part level. Further considering the hierarchy of the human topology, joint-level and body-level de- pendencies are captured via graph convolutional networks and self-attentions, respectively. Based on these designs, we pro- pose a novel Human Topology aware Network (HTNet), which adopts a channel-split progressive strategy to sequentially learn the structural priors of the human topology from multiple se- mantic levels: joint, part, and body. Extensive experiments show that the proposed method improves the estimation accu- racy by 18.7% on the end joints of limbs and achieves state-of- the-art results on Human3.6M and MPI-INF-3DHP datasets. Code is available at https://github.com/vefalun/HTNet. Index Terms- 3D Human Pose Estimation, Human Topology, Error Accumulation, Hierarchical Structure 1. INTRODUCTION 3D human pose estimation (HPE) from a monocular image is a challenging task, which has been widely applied in the sub-tasks of human analysis, such as action recognition [1] and person re-identification [2]. Benefiting from the effective 2D HPE framework [3], most recent works focus on the 2D- to-3D lifting pipeline [4], which firstly estimates 2D poses from a single image and then lifts them to 3D keypoints. Un- like image-based tasks, the 2D-to-3D pose lifting task takes inherently sparse and structural 2D joint coordinates as inputs. Therefore, it is critical to take full advantage of the structural priors of the human topology. Recently, many works [5, 6, 7] have focused on the most re- lated local topology by modeling the correlations among body joints via Graph Convolutional Networks (GCNs), while oth- ers [8, 9, 10] have focused on the less related global contexts ∗Corresponding author: [email protected]. This work is supported by National Natural Science Foundation of China (No.62073004), Basic and Applied Basic Research Foundation of Guangdong (No. 2020A1515110370), Shenzhen Fundamental Research Program (GXWD20201231165807007- 20200807164903001, No. JCYJ20200109140410340). Fig. 1: (a) Distribution of estimation errors; (b) Joints with different PDoFs; (c) Physiological explanation of error accu- mulation at the end joints (e.g., wrist): (cid:126)ε = (cid:126)ε3 + (cid:126)ε2. via the Multi-head Self-Attention (MSA) of Transformer. How- ever, the skeleton representations of the human body cannot be sufficiently captured by these methods due to the complex topological relationships among joints, leading to dramatically wrong estimation, especially at the end joints of limbs. As shown in Fig. 1 (a), the previous state-of-the-art model [6] suffers from significant estimation errors on joints with high PDoFs, and here we define the Part Degree of Freedom (PDoF) of joints via the distance to the torso (see Fig. 1 (b)). To ad- dress these issues, we explore the human topology from the following two aspects: (i) Error accumulation: Since the human body is a link- age structure that limb joints highly depend on their parent nodes [11] shown in Fig. 1 (c), the estimation errors would accumulate from the central hip in the torso (root joint) to the end joints of limbs. In automatic control systems, backtrack- ing to the previous points with fewer errors and leveraging their kinematics priors can effectively alleviate the problem of error accumulation [12, 13]. Inspired by it, an Intra-Part Constraint (IPC) is designed to take intra-part parent joints as the reference to constrain the joints with higher PDoFs. (ii) Hierarchical structure: The Joint motion is closely linked to the hierarchical organization of human topology, which includes joint [5], part [14, 15], and body [9] levels. Driven by this natural hierarchy, we present a novel Human Fig. 2: Overview of the proposed HTNet. The HTNet consists of M stacked Hierarchical Mixers. Each mixer consists of three modules (LJC, IPC, and GBI), which can extract features at joint, part, and body levels. Topology aware Network (HTNet) that learns human topology representations at multiple levels (see Fig. 2). Specifically, HTNet consists of alternating hierarchical mixers, each com- posed of three modules. At the joint level, we design a Local Joint-level Connection (LJC) based on GCN to model the phys- ical connections between adjacent joints; At the part level, the IPC in (i) provides the constraints for intra-part joints, such that they have similar athletic trends; At the body level, the Global Body-level Interaction (GBI) based on MSA extracts global features among inter-part joints. Notably, the hierar- chical mixer adopts a channel-split progressive design, which achieves a win-win scenario by providing more expressive features from various levels while keeping a small model size. In summary, the main contributions are as follows: • We propose a Human Topology aware Network (HTNet) with a channel-split progressive design to learn human topology dependencies at joint, part, and body levels. • To alleviate the error accumulation, we design an Intra- Part Constraint (IPC) module that utilizes topological constraints of parent nodes to reduce errors of end joints. • Extensive experiments demonstrate the effectiveness of HTNet, which achieves state-of-the-art results on both Human3.6M and MPI-INF-3DHP benchmark datasets. 2. METHODOLOGY 2.1. Overview The overview of HTNet is depicted in Fig. 2. Given the 2D coordinates X∈RN ×2, we firstly map X to a high dimension X (cid:48)∈RN ×C via the patch embedding, where N is the number of joints and C is the channel dimensions. Then, we embed X (cid:48) with a learnable positional matrix Epos∈RN ×C to obtain the embedded features X (cid:96), where (cid:96) is the index of hierarchical mixers. Next, the X (cid:96) is split into three parts: X (cid:96) IPC, and X (cid:96) GBI, which have equal dimensions C (cid:48)=C/3 and are fed into corresponding modules: LJC, IPC, GBI. These modules con- struct the human topology from multiple semantic levels: joint, part, and body. Finally, we aggregate hierarchical representa- tions and use a linear layer as the regression head to produce the 3D coordinates Y ∈RN ×3. Each module and the structure of HTNet will be introduced in the following sections. LJC, X (cid:96) 2.2. Local Joint-level Connection Local Joint-level Connection (LJC) is a GCN-based architec- ture [6]. The graph-structured human skeleton can be defined as G=(V, A), where V is a set of N joints and A∈ {0, 1}N ×N is an adjacency matrix representing the connection relations between joints. Given the input X (cid:96) , features of neighboring joints can be aggregated to Y (cid:96) LJC∈RN ×C(cid:48) LJC by GCN: GCN(X (cid:96) LJC = X (cid:96) Y (cid:96) LJC) = ̃D− 1 LJC + GCN(σ(GCN(X (cid:96) 2 ̃A ̃D− 1 2 X (cid:96) LJCW, LJC))), (1) where ̃A=A+I, ̃D is the diagonal node degree matrix, W is the weight matrix, σ denotes the GELU activation function. 2.3. Intra-Part Constraint To alleviate the error accumulation, we design an Intra-Part Constraint (IPC) module (see Fig. 3), which aims to conduct the constraint among intra-part joints with different PDoFs. IPC = X (cid:96) Given the input ̃X (cid:96) IPC + Y (cid:96) LJC, topological constraints performs in two sets of joints: (i) X (cid:96) consists of 2- PDoF and 3-PDoF joints; (ii) X (cid:96) consists of 1-PDoF, 2-PDoF, and 3-PDoF joints. Next, X (cid:96) j , j∈{1, 2} are fed into two convolution layers to generate limb features F (cid:96) j . Then, a channel MLP [16] is adopted to aggregate information between different channels for each limb feature: 2 ∈R12×C(cid:48) 1 ∈R8×C(cid:48) F (cid:96) ̃F (cid:96) j = σ(Convj(X (cid:96) j = F (cid:96) j + MLP(LN(F (cid:96) j )), j ∈ {1, 2}, j )), (2) 1 are replaced with ̃F (cid:96) where ̃F (cid:96) j are aggregated limb features, LN (*) denotes Layer Normalization, Conv1 and Conv2 are convolution layers with kernel sizes of 2 and 3, respectively. Based on the above ̃F (cid:96) j , we construct two topological constraints Rj in X (cid:96) j : (i) In R1, 3-PDoF joints in X (cid:96) 1 ; (ii) In R2, 3-PDoF 2 are replaced with ̃F (cid:96) and 2-PDoF joints in X (cid:96) 2 . Then, the unprocessed joints are filled into the replaced X (cid:96) j , and Y (cid:96) IPC, the final output of IPC, can be represented as follows: IPC, ̃F (cid:96) IPC + R1( ̃X (cid:96) Since the limb features ̃F (cid:96) IPC, ̃F (cid:96) j are the motion representation of limbs, which contains both high-PDoF joints and their parent 1) + R2( ̃X (cid:96) IPC = ̃X (cid:96) Y (cid:96) 2). (3) 3. EXPERIMENTS 3.1. Datasets and Evaluation Metrics Human3.6M [19] is the largest indoor dataset for 3D HPE. It has 3.6 million images and 11 professional actors. Fol- lowing [6, 17], Mean Per Joint Position Error (MPJPE) and Procrustes MPJPE (P-MPJPE) are adopted as metrics. MPI-INF-3DHP [20] consists of 1.3 million images from in- door and outdoor scenes. There are three different scenes in its test set: studio with a green screen (GS), studio without a green screen (noGS), and outdoor scene (Outdoor). Fol- lowing [6, 17, 21], MPJPE, Percentage of Correct Keypoint (PCK), and Area Under Curve (AUC) are adopted as metrics. 3.2. Implementation Details We implement our method using Pytorch and train the model for 30 epochs with batch size 512. The proposed HTNet con- sists of 3 stacked hierarchical mixers. Note that the channel dimension of inputs should be divisible by 24 (e.g., 240, 360) because there are eight heads in the MSA and three split chan- nels in hierarchical mixers. The L2 loss is utilized to minimize the errors between predictions and ground truth. 3.3. Method Comparison Comparison on Human3.6M. We compare HTNet with state- of-the-art methods on Human3.6M. As shown in Tab. 1 (a), the 2D keypoints from CPN [3] are used as inputs, and our model achieves the best results under both MPJPE (47.6mm) and P-MPJPE (38.6mm). Besides, using the ground truth 2D joints as inputs, HTNet also performs best, outperforming GraFormer [17] by 9.3% (31.9mm vs. 35.2mm). Comparison on MPI-INF-3DHP. To evaluate the general- ization capability of our approach, we train HTNet on the Human3.6M and test it on the MPI-INF-3DHP directly. As shown in Tab. 1 (b), HTNet achieves the best performance on all scenes, which verifies the strong generalization of our method in unseen environments. Comparison with Temporal Methods. To explore the porta- bility of HTNet in video-based 3D HPE, we compare with some methods [5, 9, 10, 26, 28, 29] with similar frames as in- puts, and Tab. 1 (c) shows that HTNet-S (C=240) can achieve competitive performance under MPJPE (47.2mm) with much fewer parameters. Notably, we find that the channel dimension will be the bottleneck to the performance gains. Thus, HTNet- L is built with larger dimensions (C=720) and performs the best (46.1mm). The above experiments prove that our HTNet can work well with video sequence inputs. 3.4. Ablation Study Tab. 2 shows the results of our method under different com- ponents and structures on the Human3.6M dataset. For a fair comparison, we maintain the consistency of the parameters by keeping the same dimension channels (C=240). Fig. 3: Structure of Intra-Part Constraint (IPC) module. joints. Therefore, replacing the high-PDoF joints with ̃F (cid:96) j can form topological constraints and produce reasonable 3D pose estimations to mitigate the error accumulation. 2.4. Global Body-level Interaction Global Body-level Interaction (GBI) module is built by the self- attention of Transformer, which can capture global contexts across the whole human body [10, 17]. Given ̃X (cid:96) GBI + Y (cid:96) IPC as input, the GBI module can be formulated as: C (cid:48))V (cid:96), i ∈ {1, ..., h} GBI = X (cid:96) √ / Hi = Softmax(Q(cid:96)K (cid:96)T MSA( ̃X (cid:96) GBI = ̃X (cid:96) ̃Y (cid:96) GBI) = Concat(H1, H2, ..., Hh)Wout, GBI + LN(MSA( ̃X (cid:96) GBI)), (4) where h is the number of attention heads, Q(cid:96), K (cid:96), V (cid:96) are query, key, and value matrices, which are calculated from ̃X (cid:96) GBI by linear transformations, ̃Y (cid:96) GBI is the output of the GBI module. 2.5. Network Structure Although hierarchical representations of human topology can be learned with LJC, IPC and GBI, it is challenging to de- sign a connection structure for such three modules: the series structure (i.e., three modules are connected sequentially) will increase the model size, and the parallel structure (i.e., three modules divide the channels equally and work in parallel) lacks feature interactions among various levels. Inspired by Res2Net [18], we design the hierarchical mixer with a channel-split progressive structure. Specifically, chan- nels are split into three parts and fed into LJC, IPC, and GBI. Meanwhile, the output of the previous module is added to the input of the next module as residual-like connections for learning the human topology from local to global. Then, out- puts of the above three modules are concatenated to generate Y (cid:96)∈RN ×C, and Y (cid:96) is fed to a channel MLP block: Y (cid:96) = Concat(Y (cid:96) GBI), ̃Y (cid:96) = Y (cid:96) + MLP(LN (Y (cid:96))). LJC, Y (cid:96) IPC, Y (cid:96) (5) Such a process can aggregate features from three different levels and obtain a more expressive representation. Method P1 (CPN) P2 (CPN) P1 (GT) Method GS↑ noGS↑ Outdoor↑ PCK↑ AUC↑ Method Frame Param MPJPE Martinez et al. [4] Ci et al. [22] Liu et al. [21] Xu et al. [23] Zhao et al. [17] Cai et al. [5](†) Zeng et al. [24] Zou et al. [6](†) HTNet (Ours) HTNet (Ours) (†) 62.9 52.7 52.4 51.9 51.8 50.6 49.9 49.4 48.9 47.6 47.7 42.2 41.2 - - 40.2 39.4 39.1 39.0 38.6 45.5 36.3 37.8 35.8 35.2 38.1 36.4 37.4 34.0 31.9 Martinez et al. [4] 49.8 Mehta et al. [20] 70.8 Ci et al. [22] 74.8 Zhou et al. [25] 75.6 Zeng et al. [24] - Liu et al. [26] 77.6 Zeng et al. [27] - Xu et al. [23] 81.5 Zou et al. [6] 86.4 42.5 62.3 70.8 71.3 - 80.5 - 81.7 86.0 HTNet (Ours) 86.9 86.2 31.2 58.5 77.3 80.3 80.3 80.1 84.6 75.2 85.7 85.9 42.5 64.7 74.0 75.3 77.6 79.3 82.1 80.1 86.1 17.0 31.7 36.7 38.0 43.8 45.8 46.2 45.8 53.7 86.7 54.1 Pavllo et al. [28] Cai et al. [5] Zheng et al. [9] Li et al. [10] Chen et al.[29] HTNet-S (Ours) Pavllo et al. [28] Liu et al. [26] Zheng et al. [9] HTNet-L (Ours) 9 7 9 9 9 9 27 27 27 27 4.4M 49.8 5.1M 48.8 9.6M 49.9 18.9M 47.8 18.2M 46.3 3.0M 47.2 8.6M 48.8 5.7M 48.5 9.6M 47.0 10.1M 46.1 (a) Quantitative comparison on Human3.6M. (c) Comparison with temporal methods. Table 1: (a) Quantitative comparison on Human3.6M under Protocol #1 (MPJPE) and Protocol #2 (P-MPJPE). The 2D keypoints detected by CPN and the ground truth of 2D poses are used as inputs. (†) - adopts the same refinement module as [5, 6]. (b) Quantitative comparison on MPI-INF-3DHP. (c) Quantitative comparison with temporal methods on Human3.6M. (b) Quantitative comparison on MPI-INF-3DHP. LJC IPC GBI Param MPJPE Baseline (cid:33) (cid:33) (cid:33) 2.2M 52.2 2.6M 50.4 (cid:33) 2.5M 50.2 (cid:33) (cid:33) 3.4M 51.8 3.8M 49.3 (cid:33) (cid:33) Parallel (cid:33) (cid:33) (cid:33) 3.0M 50.0 Serial (cid:33) (cid:33) (cid:33) 7.2M 49.2 HTNet (cid:33) (cid:33) (cid:33) 3.0M 48.9 Table 2: Ablation study for components and structures. Fig. 4: Ablation study for the effect of IPC. Impact of Model Components. As shown in the top part of Tab. 2, HTNet with only a single-level module cannot achieve satisfactory performance, while the combination of all pro- posed modules performs the best via learning representations from various levels. Notably, IPC cannot work individually due to no operations on 0-PDoF and 1-PDoF joints. To fur- ther investigate the influence of IPC, we categorize limb joints by PDoFs and calculate the average MPJPE of joints in each category in Fig. 4. Compared with the baseline (the HTNet with only GBI), the average MPJPE of all joints decreased by 3.8% (50.2mm vs. 52.2mm) via introducing LJC. By further integrating IPC into HTNet, the MPJPE would decreased by 6.3% (48.9mm vs. 52.2mm), while MPJPE on 2-PDoF and 3-PDoF joints noticeably reduces by 15.5% and 18.7%, re- spectively. Such a significant reduction in the estimation errors of end joints can be attributed to the number of topological constraints they obtain shown in Sec. 2.3: (i) 3-PDoF joints are constrained by both 1-PDoF and 2-PDoF joints; (ii) 2-PDoF joints are only constrained by 1-PDoF joints; (iii) 1-PDoF joints are not subject to any constraints. Impact of Model Structures. As for the structures (middle part of Tab. 2), the serial structure exhibits competitive perfor- mance (49.2mm) due to the local-to-global learning; the par- allel structure can reduce parameters from 7.2M to 3.0M due to the channel-split structure. The channel-split progressive Fig. 5: Qualitative comparison on Human3.6M. structure of HTNet adopts residual connections and combines the advantages of these two designs, which performs the best (48.9mm) and maintains a small model size (3.0M). 3.5. Visualization Fig. 5 provides qualitative comparisons on Human3.6M be- tween HTNet and the state-of-the-art approach, i.e., MGCN [6]. It can be seen that our method is capable of producing more precise 3D keypoints at the end of limbs, which further proves the effectiveness of our method. 4. CONCLUSION This paper presents a Human Topology aware Network (HT- Net), which takes full advantage of human structural priors for 3D HPE. To address the error accumulation, we design an Intra-Part Constraint (IPC) module that utilizes the topological constraints from intra-part parent nodes to reduce the errors of end joints. Based on the IPC, the hierarchical mixer is further designed to learn joint-part-body representations via a channel- split progressive structure, allowing the HTNet to efficiently build hierarchical representations of the human topology. Ex- tensive experiments show that the proposed HTNet achieves state-of-the-art performance. We hope our work can inspire more researchers on skeleton-based tasks, e.g., action recogni- tion, and 3D human mesh reconstruction. 3'R)3'R)3'R)03-3(%DVHOLQH2XUV ZR,3& 2XUV 5. REFERENCES [1] Yanhao Jing and Feng Wang, "TP-VIT: A two-pathway vision transformer for video action recognition," in ICASSP, 2022, pp. 2185–2189. [2] Tao Wang, Hong Liu, Pinhao Song, Tianyu Guo, and Wei Shi, "Pose-guided feature disentangling for occluded person re-identification based on transformer," in AAAI, 2022, pp. 2540–2549. [3] Yilun Chen, Zhicheng Wang, Yuxiang Peng, Zhiqiang Zhang, Gang Yu, and Jian Sun, "Cascaded pyramid network for multi- person pose estimation," in CVPR, 2018, pp. 7103–7112. [4] Julieta Martinez, Rayat Hossain, Javier Romero, and James J Little, "A simple yet effective baseline for 3D human pose estimation," in ICCV, 2017, pp. 2640–2649. [5] Yujun Cai, Liuhao Ge, Jun Liu, Jianfei Cai, Tat-Jen Cham, Junsong Yuan, and Nadia Magnenat Thalmann, "Exploiting spatial-temporal relationships for 3D pose estimation via graph convolutional networks," in ICCV, 2019, pp. 2272–2281. [6] Zhiming Zou and Wei Tang, "Modulated graph convolutional network for 3D human pose estimation," in ICCV, 2021, pp. 11477–11487. [7] Wenhao Li, Hong Liu, Tianyu Guo, Hao Tang, and Runwei Ding, "GraphMLP: A graph mlp-like architecture for 3D human pose estimation," arXiv preprint arXiv:2206.06420, 2022. [8] Xiyang Liu, Peng Li, Ding Ni, Yan Wang, and Hui Xue, "Light- Pose: A lightweight and efficient model with transformer for human pose estimation," in ICASSP, 2022, pp. 2674–2678. [9] Ce Zheng, Sijie Zhu, Matias Mendieta, Taojiannan Yang, Chen Chen, and Zhengming Ding, "3D human pose estimation with spatial and temporal transformers," in ICCV, 2021, pp. 11656– 11665. [10] Wenhao Li, Hong Liu, Hao Tang, Pichao Wang, and Luc Van Gool, "MHFormer: Multi-hypothesis transformer for 3D human pose estimation," in CVPR, 2022, pp. 13147–13156. [11] Lele Wu, Zhenbo Yu, Yijiang Liu, and Qingshan Liu, "Limb pose aware networks for monocular 3D pose estimation," IEEE TIP, vol. 31, pp. 906–917, 2021. [12] Lubin Chang, Fangjun Qin, and An Li, "A novel backtrack- ing scheme for attitude determination-based initial alignment," IEEE Transactions on Automation Science and Engineering, vol. 12, no. 1, pp. 384–390, 2015. [13] Linda G. Shapiro and Robert M. Haralick, "Structural descrip- tions and inexact matching," IEEE TPAMI, vol. 3, no. 5, pp. 504–519, 1981. [14] Jogendra Nath Kundu, Siddharth Seth, Varun Jampani, Mu- galodi Rakesh, R Venkatesh Babu, and Anirban Chakraborty, "Self-Supervised 3d human pose estimation via part guided novel image synthesis," in CVPR, 2020, pp. 6152–6162. [15] Youze Xue, Jiansheng Chen, Xiangming Gu, Huimin Ma, and Hongbing Ma, "Boosting monocular 3d human pose estimation with part aware attention," IEEE TIP, vol. 31, pp. 4278–4291, 2022. [16] Ilya O Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lu- cas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, et al., "MLP- Mixer: An all-MLP architecture for vision," in NeurIPS, 2021, pp. 24261–24272. [17] Weixi Zhao, Weiqiang Wang, and Yunjie Tian, "GraFormer: Graph-Oriented Transformer for 3D pose estimation," in CVPR, 2022, pp. 20438–20447. [18] Shang-Hua Gao, Ming-Ming Cheng, Kai Zhao, Xin-Yu Zhang, Ming-Hsuan Yang, and Philip Torr, "Res2Net: A new multi- scale backbone architecture," IEEE TPAMI, vol. 43, no. 2, pp. 652–662, 2019. [19] Catalin Ionescu, Dragos Papava, Vlad Olaru, and Cristian Smin- chisescu, "Human3.6M: Large scale datasets and predictive methods for 3D human sensing in natural environments," IEEE TPAMI, vol. 36, no. 7, pp. 1325–1339, 2013. [20] Dushyant Mehta, Helge Rhodin, Dan Casas, Pascal Fua, Olek- sandr Sotnychenko, Weipeng Xu, and Christian Theobalt, "Monocular 3D human pose estimation in the wild using im- proved CNN supervision," in 3DV, 2017, pp. 506–516. [21] Kenkun Liu, Rongqi Ding, Zhiming Zou, Le Wang, and Wei Tang, "A comprehensive study of weight sharing in graph networks for 3D human pose estimation," in ECCV, 2020, pp. 318–334. [22] Hai Ci, Chunyu Wang, Xiaoxuan Ma, and Yizhou Wang, "Op- timizing network structure for 3D human pose estimation," in ICCV, 2019, pp. 2262–2271. [23] Tianhan Xu and Wataru Takano, "Graph stacked hourglass networks for 3D human pose estimation," in CVPR, 2021, pp. 16105–16114. [24] Ailing Zeng, Xiao Sun, Fuyang Huang, Minhao Liu, Qiang Xu, and Stephen Lin, "SRNet: Improving generalization in 3D human pose estimation with a split-and-recombine approach," in ECCV, 2020, pp. 507–523. [25] Xingyi Zhou, Qixing Huang, Xiao Sun, Xiangyang Xue, and Yichen Wei, "Towards 3D human pose estimation in the wild: A weakly-supervised approach," in ICCV, 2017, pp. 398–407. [26] Ruixu Liu, Ju Shen, He Wang, Chen Chen, Sen-ching Cheung, and Vijayan Asari, "Attention mechanism exploits temporal contexts: Real-time 3D human pose reconstruction," in CVPR, 2020, pp. 5064–5073. [27] Ailing Zeng, Xiao Sun, Lei Yang, Nanxuan Zhao, Minhao Liu, and Qiang Xu, "Learning skeletal graph neural networks for hard 3D pose estimation," in ICCV, 2021, pp. 11436–11445. [28] Dario Pavllo, Christoph Feichtenhofer, David Grangier, and Michael Auli, "3D human pose estimation in video with tempo- ral convolutions and semi-supervised training," in CVPR, 2019, pp. 7753–7762. [29] Tianlang Chen, Chen Fang, Xiaohui Shen, Yiheng Zhu, Zhili Chen, and Jiebo Luo, "Anatomy-aware 3D human pose estima- tion with bone-based pose decomposition," IEEE Transactions on Circuits and Systems for Video Technology (TCSVT), vol. 32, no. 1, pp. 198–209, 2021.
http://arxiv.org/abs/2302.09772v1
2023-02-20T05:38:54
2023-02-20T05:38:54
Demonstration-Guided Reinforcement Learning with Efficient Exploration for Task Automation of Surgical Robot
Task automation of surgical robot has the potentials to improve surgical efficiency. Recent reinforcement learning (RL) based approaches provide scalable solutions to surgical automation, but typically require extensive data collection to solve a task if no prior knowledge is given. This issue is known as the exploration challenge, which can be alleviated by providing expert demonstrations to an RL agent. Yet, how to make effective use of demonstration data to improve exploration efficiency still remains an open challenge. In this work, we introduce Demonstration-guided EXploration (DEX), an efficient reinforcement learning algorithm that aims to overcome the exploration problem with expert demonstrations for surgical automation. To effectively exploit demonstrations, our method estimates expert-like behaviors with higher values to facilitate productive interactions, and adopts non-parametric regression to enable such guidance at states unobserved in demonstration data. Extensive experiments on $10$ surgical manipulation tasks from SurRoL, a comprehensive surgical simulation platform, demonstrate significant improvements in the exploration efficiency and task success rates of our method. Moreover, we also deploy the learned policies to the da Vinci Research Kit (dVRK) platform to show the effectiveness on the real robot. Code is available at https://github.com/med-air/DEX.
[ "Tao Huang", "Kai Chen", "Bin Li", "Yun-Hui Liu", "Qi Dou" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09772v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09772v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.RO", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.RO", "cs.AI", "cs.LG" ]
Demonstration-Guided Reinforcement Learning with Efficient Exploration for Task Automation of Surgical Robot Tao Huang1, Kai Chen1, Bin Li2, Yun-Hui Liu2, Qi Dou1 3 2 0 2 b e F 0 2 ] O R . s c [ 1 v 2 7 7 9 0 . 2 0 3 2 : v i X r a Abstract- Task automation of surgical robot has the po- tentials to improve surgical efficiency. Recent reinforcement learning (RL) based approaches provide scalable solutions to surgical automation, but typically require extensive data collec- tion to solve a task if no prior knowledge is given. This issue is known as the exploration challenge, which can be alleviated by providing expert demonstrations to an RL agent. Yet, how to make effective use of demonstration data to improve exploration efficiency still remains an open challenge. In this work, we in- troduce Demonstration-guided EXploration (DEX), an efficient reinforcement learning algorithm that aims to overcome the exploration problem with expert demonstrations for surgical automation. To effectively exploit demonstrations, our method estimates expert-like behaviors with higher values to facilitate productive interactions, and adopts non-parametric regression to enable such guidance at states unobserved in demonstration data. Extensive experiments on 10 surgical manipulation tasks from SurRoL, a comprehensive surgical simulation platform, demonstrate significant improvements in the exploration effi- ciency and task success rates of our method. Moreover, we also deploy the learned policies to the da Vinci Research Kit (dVRK) platform to show the effectiveness on the real robot. Code is available at https://github.com/med-air/DEX. I. INTRODUCTION Surgical reinforcement robots nowadays assist surgeons to conduct minimally invasive interventions in clinical routine [1]. Automating surgical tasks has been increasingly desired to improve surgical efficiency, with many efforts being made on different tasks such as suturing [2–4], endoscope control [5– 7], tissue manipulation [8–10] and pattern cutting [11–13]. Recently, learning (RL) approaches have exhibited high scalability to learn diverse control policies and yielded promising performance in surgical automation [14– 20], but typically require extensive data collection to solve a task if no prior knowledge is given. This issue, known as the exploration challenge, gives rise to the idea of providing ex- pert knowledge from demonstration data to an RL agent [21]. Yet, how to make full effective of demonstrations to improve exploration efficiency still remains an open challenge. One classical approach is sampling priority to demonstrated data over self-collected data in the expert [22–24]. While straightforward, a simulator to give higher This research work was supported in part by CUHK T Stone Robotics Institute, Hong Kong Innovation and Technology Commission Project No. ITS/237/21FP, Hong Kong Research Grants Council TRS Project No.T42-409/18-R, and InnoHK Multi-Scale Medical Robotics Center. 1T. Huang, K. Chen, and Q. Dou are with the Department of Computer Science and Engineering, The Chinese University of Hong Kong. 2B. Li, and Y. H. Liu are with the Department of Mechanical and Automation Engineering, The Chinese University of Hong Kong. Corresponding author: Qi Dou ([email protected]). Fig. 1: Our method DEX leverages demonstration data to efficiently guide the RL exploration in simulation tasks. The learned policies are successfully deployed to the real-world surgery subtasks on the dVRK platform. knowledge from demonstrations is not explicitly exploited during the exploration, making these methods still inefficient in robotic tasks. To provide explicit exploration guidance, one other approach offers RL agent with an additional reward function learned from demonstrations, which encourages the agent to stay close to expert samples [25–27] by discerning expert-like and -unlike behaviors. However, these methods are not easily applicable to surgical tasks because they not only require careful task-specific design of environment reward function [28], but also introduces the risk of local optima during policy learning. To overcome such limitations, a promising approach is to directly regularize the robot policy to mimic the expert policy within the actor-critic framework [29–33]. Such guidance is typically operationalized by regularizing the actor loss with a penalty measuring the behavioral dissimilarity between the robot and the expert. Effective as these methods are, their exploration efficiency is still unsatisfactory due to two limitations. Firstly, these methods enforce little regularization on the critic, making the critic suffers from the notorious overestimation issue [34, 35]. Without an accurate critic, the overestimated values of expert-unlike actions hinder the these robot from exploring expert-like actions. Secondly, methods provide effective guidance only when the current state is close to the ones in the demonstrations. This impedes their capability to guide exploration early in the learning process, as the robot with a mediocre policy is likely to visit states far from demonstrated ones. A stopgap is to cover as many possible demonstrated states as possible by collecting a large number of demonstrations [36]. Unfortunately, collecting many surgical expert data is often unaffordable due to the resources and ethical constraints. In this work, we aim to improve the exploration efficiency of RL given a modest set of demonstration data for task automation of surgical robot. To tackle the overestimation SimulationtaskDemosamplingExperttrajectoryAgenttrajectory...Real-worldtaskExplorationguidanceDeploymentObservation,RewardActionRLAgentPolicy learning...Explorew.guidanceExplorew/o.guidanceGuidance issue of the critic, we propose a novel algorithmic framework, named expert-guided actor-critic, that regularizes both actor and critic with the action dissimilarity between agent and expert. As illustrated in Figure 1, at a high level, with this regularization the critic lowers the value estimates of expert-unlike actions (colored with red), thus further encouraging the exploration on expert-like actions (colored with green). To guide exploration at states unobserved in demonstrations, we adopt a non-parametric regression model to robustly propagate the guidance (dashed arrow) from demonstration data to these states. Consequently, our method, named Demonstration-guided EXploration (DEX), is of high exploration efficiency with a limited amount of demonstra- tion data. The empirical results on surgical automation tasks from SurRoL [37] show that DEX significantly outperforms prior the transferability of learned policies on da Vinci surgical robots. The contributions of this work are summarized as follows: learning-based methods. We also validate • We propose a novel actor-critic framework to mitigate the overestimation issue of the critic for encouraging explorations on expert-like actions in RL; • We empirically • We adopt non-parametric guidance propagation to guide exploration at demonstration-unobserved states; demonstrate our method significantly outperforms prior RL-based approaches on the surgical robot learning tasks from SurRoL; • We successfully deploy our trained policies on the real dVRK, indicating its great potential for task automation of surgical robot in the real world. that II. RELATED WORK for task surgical automation, Surgical Robot Task Automation. Considerable efforts have been made by researchers to design skill-oriented controllers including surgical suturing [2, 38], endoscope control [5, 6], tissue manipulation [8, 39] and pattern cutting [40, 41]. However, these works follow a traditional paradigm that requires domain knowledge for designing control strategies and suffers from low generality, i.e., a controller designed for one task is often hard to generalize [42]. In contrast, learning- based approaches, representatively RL, enable robots to flexibly learn to perform tasks from collected data. These methods thus do not require task-specific control strategies and have shown improved generalization capabilities in automating complex surgical tasks [14–20]. Promising as it is, running existing RL methods in surgical tasks is still inefficient due to the exploration challenge, which is often alleviated through substantial reward engineering for each task. To this end, we propose a novel RL algorithm to solve diverse tasks efficiently by exploiting expert demonstrations for facilitating task automation in robotic surgery. Learning from Demonstrations. Imitation learning (IL), also known as learning from demonstrations [43], is a typical learning-based framework that leverages demonstrations for policy learning. A well-known approach is behavior cloning (BC, [44]) which supervises the agent to imitate expert behavior. However, it suffers from the distribution shift problem and thus is of poor generalization perfor- mance [45, 46]. Some IL methods overcome this issue by using generative adversarial networks to match the trajectory distribution of demonstrations [47, 48] or provide the agent with inferred reward function [49, 50]. But they require a great many online samples and demonstrations to ensure fair generalization capability and suffer from poor training stability [51]. In contrast, our method goes beyond such limi- tations by utilizing the expert knowledge from demonstration data to expedite RL exploration, which combines advances of IL and RL and alleviates their respective drawbacks. Demonstration-Guided RL. A number of demonstration- guided RL approaches have been proposed to mitigate the exploration challenges of RL, including prioritizing expert samples over self-collected samples [22–24] or learning extra reward functions [25–27]. However, these methods either make no explicit use of demonstrations or still need careful reward engineering in surgical tasks. To overcome these issues, a promising approach is to leverage demonstrations to directly regularize the RL policy to explore expert-like behaviors [29–33]. It penalizes the behavioral dissimilarity between agent and expert with state-action pairs from demonstrations. Nonetheless, this approach often requires a large number of demonstrations to ensure high exploration efficiency due to the impediment of overestimated values and the incapability of offering guidance at states far from the demonstrated ones. Our method addresses these limitations through critic regularization in the proposed actor-critic framework and robust guidance propagation based on non-parametric regression. III. METHOD We develop Demonstration-guided EXploration (DEX), a novel exploration-efficient demonstration-guided RL algo- rithm for surgical subtask automation with limited demon- strations. Our method addresses the potential overestimation issue in existing methods based on our proposed actor-critic framework in Section III-A. To offer exploration guidance at states unobserved in demonstration data, our method propagates the guidance from demonstrations through a non-parametric module in Section III-B. Figure 2 illustrates the overall framework of the proposed method DEX. Problem Formulation: We consider an off-policy RL agent that interacts within an environment formulated by a Markov decision process. At time step t, the agent takes an action at based on the current state st and its deterministic policy π. The environment then rewards the agent with rt := r(st, at) to the successor state st+1. After each and transits it transition, the agent stores the experience (st, at, rt, st+1) into a replay buffer DA. Meanwhile, it also maintains a separate demonstration buffer DE, where experiences are collected through an unavailable expert policy πe in advance. Fig. 2: RL with demonstrations-guided exploration. We present the overall illustration of our proposed method DEX. It consists of two parts, a novel actor-critic based policy learning module that efficiently leverages demonstration date to guide the RL exploration (right), and a non-parametric module based on nearest-neighbor matching and locally weighted regression for robust guidance propagation at states far from demonstrated ones (upper left). A. Expert-Guided Actor-Critic Framework squared Bellman residual: Many existing actor-critic based methods learn optimal policy by training an actor that maximizes the expected return Eπ[(cid:80)∞ t=0 γtrt], which is estimated by a critic that approximates the Q-value function, where γ ∈ (0, 1] is a discount factor. Their common way to guide exploration is to jointly maximize the Q-value and the behavioral similarity between the agent and expert. Effective as it is, the inaccurate Q-value estimates of expert-unlike actions may dominate the guidance embodied as behavioral dissimilarity, and thus ham- per the exploration, reminiscent of the regularization issue in offline RL literature [52, 53]. In other words, the agent is likely to take unproductive actions due to value misestimate, which hinders it from exploring expert-like actions. To remedy this issue, we introduce a novel RL objective that augments the environment reward with the behavior gap between agent policy and expert policy: max π Eπ (cid:34) ∞ (cid:88) t=0 γt(rt − αd(at, ae (cid:35) t )) , ae t := πe(st), (1) and agent (cid:2)(cid:80)∞ action expert between where α is an exploration coefficient and the function d(*, *) is a distance metric that measures the behavioral similarity action. Correspondingly, we define the regularized Q-value function (cid:12)s, a(cid:3). as Qπ(s, a) := Eπ It assigns higher value estimates to actions similar to the expert action at any given state. It thus mitigates the effect of the inaccurate estimates of undesired actions by lowering its value through a dissimilarity regularization. Meanwhile, echoed with SAC [54], an appropriate choice of α steers the exploration-exploitation balance and benefits policy learning. t=0 γt(rt − γαd(at+1, ae t+1))(cid:12) LQ(θ) = EDA∪DE (cid:104) (rt + γV ̄θ(st+1) − Qθ(st, at))2(cid:105) , (2) where V ̄θ is state value function served as Q-target whose parameters ̄θ are the exponential moving average of θ that stabilize the training process. The actor, parametrized by φ, is trained by maximizing following the objective: Lπ(φ) = EDA∪DE [Qθ(st, πφ(st)) − αd(πφ(st), ae t ))] . (3) Our framework bears some resemblances to behavior regularized actor-critic in offline RL domain [55, 56]. At the online fine-tuning stage, their formulas target conservative policy updates by constraining the behavior gap between old and new policies. Different from their focus, our framework treats expert policy as a static reference policy and uses the behavior gap between agent and expert as a regularization term to accelerate the RL exploration more efficiently. B. Guidance Propagation from Limited Demonstrations is available only therein. However, Prior methods provide the actor with exploration guidance only at states observed in demonstration data, since the expert action ae the t agent is prone to visit regions uncovered by demonstrations at the initial stage of training, where the demonstrations are incapable of supervising the actor exploration. On the other hand, such an issue also limits the feasibility and efficacy of critic regularization. Only regularizing the demonstration- covered Q-value introduces an underestimation bias on the value estimate to these state-action pairs due to the negativity of the regularization term. This negates the original purpose of enforcing critic regularization. Propagating guidance from limited demonstrations is thus of high necessity to efficiently realize the proposed actor-critic framework. Based on the formulation, we introduce our proposed expert-guided actor-critic frameworks. The regularized value function (critic) Qθ, parameterized by θ, minimizes the One natural solution is to learn a parametric expert policy approximator ˆπe from demonstrations in an parametric manner, e.g., behavior cloning. Although using a parametric ExpertdemosReplaybufferπ"!(s)Explorationguidances(#)a(#)ss′raBatch samplingActionqueryingGuidancepropagationExperience collectionInteractionss′aa"!RL agentActor π(s)Critic Q(s,a)Distance d−d(a,a)!)+rPolicyevaluationPolicyimprovement×...a(+)a(,)a(-)w(+)×w(,)×w(.)+PolicylearningNon-parametricregressionmaxE/∑γ00(r0−αda,a"!)RL agents(,)s(+)s(-)...TDlearningPolicy gradientw(")||s−s"||$NN matchings model already outperforms existing methods, which demon- strates the effectiveness of our framework, we empirically observe that the parametric propagated guidance, i.e., ˆπ(s), fairly differs from the ground-truth expert action when states are far from the demonstration ones. We thus resort to a non-parametric regression model that empirically propagates more robust guidance from limited demonstrations. Specifically, we first sample a minibatch of states and actions from demonstration buffer DE. Then, given any state s, we search states in the minibatch and find k nearest neighbors of s based on the Euclidean distance. The selected k states and their associated actions are denoted by {(s(i), a(i))}k i=1, a set of transitions from DE. Subsequently, we approximate the expert policy through locally weighted regression [57] with exponential kernel function: (cid:1) * a(i) (cid:80)k i=1 exp (cid:0)−(cid:107)s − s(i)(cid:107)2 (cid:80)k i=1 exp (cid:0)−(cid:107)s − s(i)(cid:107)2)(cid:1) . (4) ˆπe(s) = The assumption here is that similar states share similar optimal actions, whose effectiveness and robustness have been demonstrated in some robotic learning tasks [58–60]. Unlike these IL methods, we aim to use the limited demonstration data to accelerate the exploration of RL and increase the generalization ability of policy. C. Implementation Details We implement our method with deep deterministic policy gradient (DDPG, [61]) from OpenAI Baselines [62] and adopt their main hyperparamter settings. We choose DDPG to avoid the potential pathology of density-based methods [63], though our implementation can be naturally extended to the stochastic setting. Specifically, both actor and critic are parameterized as four fully-connected layers of hidden dimension 256 interpolated with ReLU activations, where actions are scaled to the range [-1,1] by a Tanh activation in the actor network. They are trained with ADAM [64]. The exploration noise is set as Gaussian noise with a scale factor of 0.1, For goal-conditioned environments, we adopt hindsight experience replay [65] with future sampling strategy on 80% examples for both replay buffer and demonstration buffer. The distance metric is set as L2-norm for all tasks. The coefficient of exploration term α is set as 5 for all tasks. The number of nearest neighbors k used for expert policy estimation is set to 5. More analyses on α and k would be given in the ablation studies. IV. EXPERIMENTS In this section, we first conduct experiments on Sur- RoL [37], a comprehensive simulation environment for task automation of surgical robots. Extensive evaluation and ab- lation analysis on 10 challenging surgical manipulation tasks demonstrate the effectiveness of our method DEX for surgi- cal robot learning. Moreover, we transfer the learned policies to a dVRK platform for real-world robotic deployment. Fig. 3: Task description of SurRoL. We choose ten surgical tasks from SurRoL and divide them into three domains according to the type of manipulators. The arrows in each task represent the task flow as well as the execution process of the scripted expert policy provided by the platform. A. Experimental Setup Different Tasks on Surgical Manipulation. To evaluate whether our method DEX can effectively handle different surgical manipulation scenarios, we conduct experiments on 10 challenging tasks from SurRoL. These 10 tasks widely cover three different domains according to the type of manipulator: (1) Single-handed patient-sided manipulator (PSM); (2) Bimanual PSM (Bi-PSM); and (3) Endoscopic camera manipulator (ECM). Figure 3 illustrates the involved 10 manipulation tasks. All tasks are goal-conditioned with sparse reward functions that indicate task success, except for ActiveTrack, whose reward function is dense that depends on the precision of object tracking. We use low-dimensional state representation that consists of object state (3D Cartesian positions and 6D pose) and robot proprioceptive state (jaw status and end-effector position), and Cartesian-space control as action space. Please refer to [37] for more details on the different surgical manipulation tasks. Besides, we sample 100 successful episodes of demonstration data for each task through the scripted expert policy provided by SurRoL. Evaluation Metrics. Similar to [68, 69], we measure the manipulation performance of each task after a uniform 100k environment steps. The manipulation score for each task is linearly re-scaled to be within [0, 1] for comparisons across tasks as well as better visualization. Following [70], we adopt interquartile mean (IQM) and 95% interval estimates via stratified bootstrap confidence intervals (CIs) to measure the aggregate performance over each domain robustly. Baselines. First of all, we compare our method with two state-of-the-art pure RL algorithms without using (1) SAC [54] and (2) DDPG [61]. demonstrations: Besides, we compare our method with three representative IL methods: (3) BC [44] that supervises the agent to imitate expert actions from demonstrations. (4) SQIL [67] that reduces IL to RL by assigning positive rewards to demonstrations, a representative of the state-of-the-art IL algorithms based on SAC. (5) VINN [58] that directly uses the estimate of expert policy in Equation (4) as the agent policy. Moreover, we compare our method with four existing demonstration-guided RL algorithms: (6) DDPGBC [29] NeedleReachNeedlePickGauzeRetrievePegTransferNeedleRegraspBiPegTransferECMReachMisOrientStaticTrackActiveTrack TABLE I: Performance after training 100k environment steps. We present mean scores with standard deviations of each task and aggregate IQMs with 95% stratified bootstrap CIs of each domain (grey-colored cells). Results are over 10 runs with different seeds, where each run averages 20 evaluations. We abbreviate sparse and dense reward to S and D, respectively. Our method achieves prominent manipulation performance on complex tasks and domains. Task Description Reinforcement Learning Imitation Learning Demonstration-guided Reinforcement Learning M C E M S P Task Aggregate ECMReach StaticTrack MisOrient ActiveTrack Aggregate NeedleReach GauzeRetrieve NeedlePick PegTransfer M Aggregate S P - i B NeedleRegrasp BiPegTransfer S/A/r SAC [66] DDPG [61] BC [44] SQIL [67] VINN [58] DDPGBC [29] AMP [27] CoL [33] AWAC [55] 0.99 (±.03) – R12/R3/S 1.00 (±.06) R16/R3/S 0.92 (±.14) R11/R1/S 1.00 (±.00) R10/R3/D 0.79 (±.08) 0.99 (±.02) 1.00 (±.00) 0.24 (±0.06) 0.58 (±.06) 1.00 (±.00) 1.00 (±.01) 1.00 (±.00) 0.99 (±.01) 1.00 (±.00) 1.00 (±.00) 0.98 (±.05) 1.00 (±.00) 0.67 (±.08) 1.00 (±.00) 1.00 (±.00) 1.00 (±.00) 0.95 (±.01) 0.07 (±.04) 0.43 (±.26) 0.56 (±.10) 0.07 (±.06) 0.49 (±.10) 0.56 (±.10) 0.50 (±.11) 0.92 (±.06) 1.00 (±.00) 1.00 (±.00) 0.99 (±.02) 0.81 (±.05) 0.99 (±.02) 0.97 (±.03) 0.98 (±.02) 0.94 (±.01) 1.00 (±.00) 1.00 (±.00) 0.99 (±.02) 0.96 (±.01) 1.00 (±.00) 1.00 (±.00) 0.98 (±.03) 0.51 (±.12) 1.00 (±.00) 1.00 (±.00) 0.99 (±.02) 0.94 (±.01) – R13/R5/S R25/R5/S R25/R5/S R25/R5/S – R41/R10/S R41/R10/S 0.0 (±.00) 0.00 (±.00) 0.40 (±.05) 0.00 (±.00) 0.02 (±.02) 0.80 (±.04) 0.00 (±.00) 0.85 (±.06) 0.46 (±.19) 0.89 (±.03) 1.00 (±.00) 0.00 (±.00) 0.00 (±.00) 0.00 (±.00) 1.00 (±.00) 0.00 (±.00) 0.00 (±.00) 0.00 (±.00) 1.00 (±.00) 0.07 (±.05) 0.21 (±.06) 0.56 (±.11) 0.07 (±.09) 0.00 (±.00) 0.00 (±.00) 0.02 (±.05) 0.89 (±.06) 0.01 (±.02) 0.02 (±.02) 0.05 (±.04) 1.00 (±.00) 0.63 (±.11) 0.91 (±.05) 0.48 (±.22) 0.99 (±.02) 0.00 (±.00) 0.00 (±.00) 0.00 (±.00) 1.00 (±.00) 0.71 (±.16) 0.96 (±.05) 0.58 (±.23) 0.94 (±.20) 0.43 (±.43) 0.26 (±.33) 0.31 (±.32) 1.00 (±.00) 0.73 (±.12) 0.94 (±.05) 0.73 (±.20) 0.00 (±.00) 0.00 (±.00) 0.08 (±.04) 0.00 (±.00) 0.00 (±.00) 0.00 (±.00) 0.00 (±.00) 0.00 (±.00) 0.00 (±.00) 0.39 (±.11) 0.00 (±.00) 0.00 (±.00) 0.00 (±.00) 0.00 (±.00) 0.09 (±.03) 0.09 (±.05) 0.01 (±.00) 0.00 (±.00) 0.01 (±.02) 0.00 (±.00) 0.05 (±.08) 0.00 (±.00) 0.00 (±.00) 0.00 (±.00) 0.04 (±.07) 0.01 (±.02) 0.00 (±.00) 0.00 (±.00) 0.63 (±.19) 0.18 (±.14) Ours DEX Overall – 0.46 (±.03) 0.45 (±.01) 0.68 (±.02) 0.02 (±.02) 0.24 (±.03) 0.83 (±.05) 0.48 (±.01) 0.87 (±.03) 0.58 (±.08) 0.92 (±.02) TABLE II: Ablation on demonstration amount. We offer our method and baselines different amounts of demonstrations. Results are IQMs with 95% stratified bootstrap CIs of 5 runs over PSM and Bi-PSM domains. Method BC [44] SQIL [67] VINN [58] DDPGBC [29] AMP [27] CoL [33] AWAC [55] 10 epi. 0.00 (±.00) 0.00 (±.00) 0.03 (±.03) 0.00 (±.03) 0.00 (±.00) 0.18 (±.07) 0.00 (±.05) Number of episodes in demonstrations 50 epi. 25 epi. 75 epi. 0.05 (±.02) 0.00 (±.00) 0.02 (±.03) 0.20 (±.11) 0.00 (±.00) 0.47 (±.09) 0.05 (±.14) 0.15 (±.03) 0.00 (±.00) 0.02 (±.02) 0.35 (±.05) 0.00 (±.00) 0.46 (±.09) 0.07 (±.18) 0.19 (±.03) 0.00 (±.00) 0.01 (±.02) 0.47 (±.10) 0.00 (±.00) 0.49 (±.05) 0.40 (±.15) 100 epi. 0.22 (±.03) 0.00 (±.00) 0.01 (±.01) 0.45 (±.08) 0.00 (±.00) 0.43 (±.10) 0.39 (±.13) DEX (ours) 0.24 (±.02) 0.50 (±.09) 0.68 (±.07) 0.78 (±.07) 0.80 (±.06) (7) that guides DDPG actor with Q-filtered BC loss. AMP [27] that augments environment with GAIL [47] reward based on SAC. (8) CoL [33] that initializes the policy with BC offline and integrates BC with DDPG in the online training stage. (9) AWAC [55] that trains an offline RL with demonstrations and online fine-tunes it with a conservative constraint between current and old policies. B. Main Results on SurRoL Platform We present the aggregate and distributed performance of each method in Table I. The results show that two pure RL methods achieve great performance in ECM domain, but poor performance in PSM and Bi-PSM. This implies that their exploration strategies are not applicable in complex surgical manipulation tasks, while our demonstration-depend exploration is able to handle these tasks. Similar to pure RL, three IL methods perform well in ECM domain, while their performance decreases dramatically in the PSM and Bi-PSM domain, which has a higher dimension of state and action space and requires more complex manipulation skills. This indicates that, given a limited number of demonstrations, the generalization ability of IL is severely deteriorated by the complexity of the task. Compared to IL, our method not only perform similarly great in ECM domain, but achieves 2.2x IQM in PSM domain and, especially, 4.9x in Bi-PSM domain. This demonstrates the advances of our method that leverages demonstrations to accelerate RL exploration. Meanwhile, we also observe that three demonstration- guided RL methods, except for AMP which suffers from Fig. 4: Ablation studies. In (a), we propose two variants of DEX that partially regularize the actor-critic to investigate the effectiveness of our proposed critic regularization. In (b), we ablate the choice of exploration coefficient α. In (c), we test the influence of the number of nearest neighbors k in non-parametric propagation. All results are IQMs with 95% stratified bootstrap CIs (error bar) over 5 runs on PSM and Bi-PSM domains. the instability issue of adversarial training [46], perform favorably in ECM and PSM domains. This may attribute to their utilization of demonstration for RL exploration. However, these methods still get stuck in the complex PSM tasks, such as PegTransfer, let alone the Bi-PSM domain that additionally demands coordination skills between two manipulators. Compared with them, our method fully leverages demonstrations to mitigate the guidance impediment of critic and guide the exploration efficiently at demonstration-uncovered states, leading to a prominent performance improvement of 0.39 in the Bi-PSM domain. C. Ablation Studies Effect of Demonstration Amount. We further study the manipulation performance of each method with different amounts of demonstrations. We train agents with 10%, 25%, 50%, 75% and 100% of demonstrations, respectively. Table II presents the aggregate results over PSM and Bi-PSM do- mains. Our proposed method DEX consistently outperforms other competing methods with different amounts of demon- strations. This result indicates that with the same amount of demonstrations, our DEX can utilize demonstrations more ef- ficiently to achieve a higher manipulation performance. More importantly, our proposed DEX exhibits a lower demand for the number of demonstrations for task automation. Even with merely 25% of demonstrations, DEX has outperformed most competing methods that are trained with 100% of demonstrations. This characteristic demonstrates that DEX is well suited for the challenging surgical scenarios where collecting large amounts of demonstrations is unaffordable. DEX-ACDEX-RADEXVariants of DEX0.00.20.40.60.81.0Normalized Score(a) Critic Regularization012.551020Coefficient α0.00.20.40.60.81.0Normalized Score(b) Exploration Weight13579Choice of k0.00.20.40.60.81.0Normalized Score(c) Nearest Neighbors Fig. 5: Deployment on real dVRK. We deploy the learned policies on the real dVRK platform (left) and present the generated trajectories of five representative tasks (right). The successful deployment demonstrates the transfer ability of our method from simulation to real-world surgical scenarios. Effect of Critic Regularization. While some existing methods only impose the guidance on actor [29, 33, 36], our method guide both actor and critic to remedy the guidance impediments of the ordinary critic. In order to further inves- tigate the effects of critic regularization on the manipulation performance, we propose two variants of DEX that partially regularize the actor-critic modules in Figure 4(a). The results show that, compared with the ordinary no-guidance actor-critic (DEX-AC), that only regularizes the variant actor (DEX-RA) brings an improvement of 0.20 w.r.t. IQM, and the proposed one which regularizes both actor and critic (DEX) brings 0.39. It demonstrates the impediment of inac- curate value estimates of ordinary critic and the effectiveness of our proposed critic regularization to alleviate this issue. Effect of Exploration Coefficient α. The exploration coefficient α determines the relative importance of the exploration term against environment reward. We investigate the effect of this parameter by gradually increasing the value of α from 0 to 20 and repeatedly train the agent with the remaining settings identical. Figure 4(b) present the experiment results. It shows that α around 5 yields the best performance, indicating that an intermediate choice balances exploration and exploitation well. We also note that an adaptive coefficient (e.g., decay α) may further balance the trade-off to avoid local minima and leave it as future work. Effect of Guidance Propagation. To investigate the effect of guidance propagation, we propose a parametric variant (DEX-BC) that pre-trains a BC model to approximate the expert action at demonstration-uncovered states. The results show that, compared with no-propagation methods, DEX-BC still achieves a performance improvement of 0.3 IQM over PSM and Bi-PSM domains, though is 0.05 lower than DEX. It demonstrates not only the robustness of non-parametric guidance propagation but the insensitivity to the choice of propagation method in our actor-critic framework. Effect of k for Guidance Propagation. We investigate the influence of the number of nearest neighbors k by gradually increasing its value from 1 to 9. The results in Figure 4(c) show that too large value of k leads to a slight performance drop and an intermediate value around 5 works well, indicating that our method is not sensitive to the choice of k within an appropriate interval. TABLE III: Evaluation on real dVRK. We test success rate of the learned policies with 20 trials for each task and compare with two baselines. Method GauzeRetrieve NeedlePick PegTransfer NeedleRegrasp StaticTrack BC [44] DDPGBC [29] DEX (ours) 0.00 0.75 0.90 0.85 0.95 0.95 0.00 0.35 0.75 0.40 0.65 0.90 1.00 1.00 1.00 D. Deployment on Real Robot Platform of dVRK To validate the transfer ability of our method, we train RL policies in SurRoL and deploy them on dVRK systems. We conduct real-world manipulation experiments on five representative tasks, namely GauzeRetrieve, NeedlePick and PegTransfer in PSM domain, NeedleRegrasp in Bi-PSM domain, and StaticTrack in ECM domain. These tasks are selected to be diverse and comprehensive, requiring different levels of surgical manipulation skills. We train policies with 300k steps within SurRoL and select checkpoints with the best performance for deployment. We present experiment snapshots in Figure 5. In three PSM tasks, we observe that agents successfully learn skills of reaching, picking, and placing to accomplish the task without collisions. In NeedleRegrasp, the policy additionally acquires coordination skills between two manipulators compared with policies in the PSM domain. In StaticTrack, the trained policy success- fully learns endoscopic control with a high success rate. Meanwhile, we also compare our method with one imitation learning method BC and one competitive demonstration- guided RL method DDPGBC. The results in Table III show that our method achieves the highest success rates at all tasks with 20 trials, which demonstrates the great potential of our method for real-world surgical task automation. V. CONCLUSION We present DEX, a novel demonstration-guided RL method that narrows down exploration space by encouraging expert-like behaviors and enabling robust guidance when confronting states unobserved in demonstrations, to improve exploration efficiency with a modest set of demonstrations. We first demonstrate its performance improvement on 10 challenging surgical manipulation tasks compared with state- of-the-art methods on the SurRoL platform. We also deploy the trained policy to the dVRK platform to show its potential for transferring to real-world surgical automation scenarios. GauzeRetrieveNeedlePickPegTransferNeedleRegraspStaticTrackRealdVRKPSMECMRealdVRK REFERENCES [1] C. D'Ettorre, A. Mariani, A. Stilli, F. R. y Baena, P. Valdastri, A. Deguet, P. Kazanzides, R. H. Taylor, G. S. Fischer, S. P. DiMaio, et al., "Accelerating surgical robotics research: A review of 10 years with the da vinci research kit," IEEE Robotics & Automation Magazine, 2021. [2] K. L. Schwaner, D. Dall'Alba, P. T. Jensen, P. Fiorini, and T. R. Savarimuthu, "Autonomous needle manipulation for robotic surgical suturing based on skills learned from demonstration," in IEEE International Conference on Automation Science and Engineering (CASE), 2021. [3] V. M. Varier, D. K. Rajamani, N. Goldfarb, F. Tavakkolmoghaddam, A. Munawar, and G. S. Fischer, "Collaborative suturing: A reinforcement learning approach to automate hand-off task in suturing for surgical robots," IEEE International Conference on Robot and Human Interactive Communication, 2020. [4] Y. Barnoy, M. O'Brien, W. Wang, and G. Hager, "Robotic surgery with lean reinforcement learning," arXiv preprint arXiv:2105.01006, 2021. [5] H. Gao, W. Fan, L. Qiu, X. Yang, Z. Li, X. Zuo, Y. Li, M. Q.-H. Meng, and H. Ren, "Savanet: Surgical action-driven visual attention network for autonomous endoscope control," IEEE Transactions on Automation Science and Engineering (TASE), 2022. [6] J. J. Ji, S. Krishnan, V. Patel, D. Fer, and K. Goldberg, "Learning 2d surgical camera motion from demonstrations," in IEEE International Conference on Automation Science and Engineering (CASE), 2018. [7] A. Pandya, L. A. Reisner, B. King, N. Lucas, A. Composto, M. Klein, and R. D. Ellis, "A review of camera viewpoint automation in robotic and laparoscopic surgery," Robotics, 2014. [8] H. Saeidi, J. D. Opfermann, M. Kam, S. Wei, S. L ́eonard, M. H. Hsieh, J. U. Kang, and A. Krieger, "Autonomous robotic laparoscopic surgery for intestinal anastomosis," Science Robotics, 2022. [9] E. Tagliabue, A. Pore, D. Dall'Alba, E. Magnabosco, M. Piccinelli, and P. Fiorini, "Soft tissue simulation environment to learn manipulation tasks in autonomous robotic surgery," in IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2020. [10] A. Pore, D. Corsi, E. Marchesini, D. Dall'Alba, A. Casals, A. Farinelli, and P. Fiorini, "Safe reinforcement learning using formal verification for tissue retraction in autonomous robotic-assisted surgery," IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2021. [11] B. Thananjeyan, A. Garg, S. Krishnan, C. Chen, L. Miller, and K. Goldberg, "Multilateral surgical pattern cutting in 2d orthotropic gauze with deep reinforcement learning policies for tensioning," in IEEE International Conference on Robotics and Automation (ICRA), 2017. [12] T. Nguyen, N. D. Nguyen, F. Bello, and S. Nahavandi, "A new tensioning method using deep reinforcement learning for surgical pattern cutting," in 2019 IEEE international conference on industrial technology (ICIT), 2019. [13] N. D. Nguyen, T. Nguyen, S. Nahavandi, A. Bhatti, and G. Guest, "Manipulating soft learning for autonomous robotic surgery," in 2019 IEEE International Systems Conference (SysCon). IEEE, 2019, pp. 1–7. tissues by deep reinforcement [14] H. Su, Y. Hu, Z. Li, A. Knoll, G. Ferrigno, and E. De Momi, "Reinforcement transferring for learning based manipulation skill robot-assisted minimally invasive surgery," in 2020 IEEE International Conference on Robotics and Automation (ICRA), 2020. [15] W. Chi, G. Dagnino, T. M. Y. Kwok, A. Nguyen, D. Kundrat, M. E. M. K. Abdelaziz, C. V. Riga, C. D. Bicknell, and G.-Z. Yang, catheterization with generative adversarial imitation learning," IEEE International Conference on Robotics and Automation (ICRA), 2020. robot-assisted endovascular "Collaborative [16] P. M. Scheikl, B. Gyenes, T. Davitashvili, R. Younis, A. Schulze, B. P. M ̈uller-Stich, G. Neumann, M. Wagner, and F. Mathis-Ullrich, "Cooperative assistance in robotic surgery through multi-agent reinforcement learning," in International Conference on Intelligent Robots and Systems (IROS), 2021. [17] A. Segato, M. Di Marzo, S. Zucchelli, S. Galvan, R. Secoli, and E. De Momi, "Inverse reinforcement learning intra-operative path planning for steerable needle," IEEE Transactions on Biomedical Engineering, 2021. [18] X. Tan, C.-B. Chng, Y. Su, K.-B. Lim, and C.-K. Chui, "Robot- assisted training in laparoscopy using deep reinforcement learning," Robotics and Automation Letters (RA-L), 2019. [19] B. Keller, M. Draelos, K. Zhou, R. Qian, A. N. Kuo, G. Konidaris, K. Hauser, and J. A. Izatt, "Optical coherence tomography-guided robotic ophthalmic microsurgery via reinforcement learning from demonstration," IEEE Transactions on Robotics, 2020. [20] C. D'Ettorre, S. Zirino, N. N. Dei, A. Stilli, E. De Momi, and D. Stoyanov, "Learning intraoperative organ manipulation with learning," International Journal of context-based reinforcement Computer Assisted Radiology and Surgery, 2022. [21] J. Ram ́ırez, W. Yu, and A. Perrusqu ́ıa, "Model-free reinforcement learning from expert demonstrations: a survey," Artificial Intelligence Review, 2022. [22] S. Levine and V. Koltun, "Guided policy search," in International Conference on Machine Learning (ICML), 2013. [23] T. Hester, M. Vecer ́ık, O. Pietquin, M. Lanctot, T. Schaul, B. Piot, D. Horgan, J. Quan, A. Sendonaris, I. Osband, G. Dulac-Arnold, J. P. Agapiou, J. Z. Leibo, and A. Gruslys, "Deep q-learning from demonstrations," in Association for the Advancement of Artificial Intelligence (AAAI), 2018. [24] M. Vecer ́ık, T. Hester, J. Scholz, F. Wang, O. Pietquin, B. Piot, N. M. O. Heess, T. Roth ̈orl, T. Lampe, and M. A. Riedmiller, learning for "Leveraging rewards," arXiv preprint on robotics problems with sparse arXiv:1707.08817, 2017. demonstrations reinforcement deep [25] Y. Zhu, Z. Wang, J. Merel, A. A. Rusu, T. Erez, S. Cabi, S. Tunyasuvunakool, J. Kram ́ar, R. Hadsell, N. de Freitas, and N. M. O. Heess, "Reinforcement and imitation learning for diverse visuomotor skills," in Robotics: Science and Systems (RSS), 2018. [26] X. B. Peng, P. Abbeel, S. Levine, and M. van de Panne, "Deepmimic: learning of physics-based Example-guided deep reinforcement character skills," ACM Transactions on Graphics (ToG), 2018. [27] X. B. Peng, Z. Ma, P. Abbeel, S. Levine, and A. Kanazawa, "Amp: stylized physics-based character for Adversarial motion priors control," ACM Transactions on Graphics (ToG), 2021. [28] A. Pore, E. Tagliabue, M. Piccinelli, D. Dall'Alba, A. Casals, and P. Fiorini, "Learning from demonstrations for autonomous soft-tissue retraction," in 2021 International Symposium on Medical Robotics (ISMR), 2021. and [29] A. Nair, B. McGrew, M. Andrychowicz, W. Zaremba, P. Abbeel, "Overcoming exploration in reinforcement learning with demonstrations," in IEEE International Conference on Robotics and Automation (ICRA), 2018. [30] A. Rajeswaran, V. Kumar, A. Gupta, J. Schulman, E. Todorov, and S. Levine, "Learning complex dexterous manipulation with deep reinforcement learning and demonstrations," in Robotics: Science and Systems (RSS), 2018. [31] H. Zhu, A. Gupta, A. Rajeswaran, S. Levine, and V. Kumar, "Dexterous manipulation with deep reinforcement learning: Efficient, general, and low-cost," in International Conference on Robotics and Automation (ICRA), 2019. [32] R. M. Shah and V. Kumar, "Rrl: Resnet as representation for learning," in International Conference on Machine reinforcement Learning (ICML), 2021. [33] V. G. Goecks, G. M. Gremillion, V. J. Lawhern, J. Valasek, and N. R. Waytowich, "Integrating behavior cloning and reinforcement learning for improved performance in dense and sparse reward environments," in International Conference on Autonomous Agents and MultiAgent Systems (AAMAS), 2020, pp. 465–473. [34] S. Fujimoto, H. Hoof, and D. Meger, "Addressing function in International in actor-critic methods," approximation error Conference on Machine Learning (ICML), 2018. [35] H. V. Hasselt, A. Guez, and D. Silver, "Deep reinforcement learning with double q-learning," in Association for the Advancement of Artificial Intelligence (AAAI), 2016. [36] Z.-Y. Chiu, F. Richter, E. K. Funk, R. K. Orosco, and M. C. Yip, "Bimanual regrasping for suture needles using reinforcement learning for rapid motion planning," in IEEE International Conference on Robotics and Automation (ICRA), 2021. [37] J. Xu, B. Li, B. Lu, Y.-H. Liu, Q. Dou, and P.-A. Heng, "Surrol: An open-source reinforcement learning centered and dvrk compatible learning," in IEEE/RSJ International platform for surgical robot Conference on Intelligent Robots and Systems (IROS), 2021. [38] S. Leonard, K. L. Wu, Y. Kim, A. Krieger, and P. C. Kim, "Smart tissue anastomosis robot (star): A vision-guided robotics system for laparo- scopic suturing," IEEE Transactions on Biomedical Engineering, 2014. [39] A. Attanasio, B. Scaglioni, M. Leonetti, A. F. Frangi, W. Cross, C. S. Biyani, and P. Valdastri, "Autonomous tissue retraction in [63] T. G. Rudner, C. Lu, M. A. Osborne, Y. Gal, and Y. Teh, "On pathologies in kl-regularized reinforcement learning from expert demonstrations," Advances in Neural Information Processing Systems (NeurIPS), 2021. [64] D. P. Kingma and J. Ba, "Adam: A method for on International Conference optimization," Representations (ICLR), 2015. in stochastic Learning [65] M. Andrychowicz, D. Crow, A. Ray, J. Schneider, R. Fong, P. Welinder, B. McGrew, J. Tobin, P. Abbeel, and W. Zaremba, "Hindsight experience replay," in Advances in Neural Information Processing Systems (NeurIPS), 2017. [66] T. Haarnoja, A. Zhou, K. Hartikainen, G. Tucker, S. Ha, J. Tan, V. Ku- mar, H. Zhu, A. Gupta, P. Abbeel, and S. Levine, "Soft actor-critic algorithms and applications," arXiv preprint arXiv:1812.05905, 2018. [67] S. Reddy, A. D. Dragan, and S. Levine, "Sqil: Imitation learning learning with sparse rewards," in International via reinforcement Conference on Learning Representations (ICLR), 2019. [68] M. Laskin, A. Srinivas, and P. Abbeel, "Curl: Contrastive unsupervised International representations learning," Conference on Machine Learning (ICML), 2020. reinforcement for in [69] D. Yarats, I. Kostrikov, and R. Fergus, "Image augmentation is all you need: Regularizing deep reinforcement learning from pixels," in International Conference on Learning Representations (ICLR), 2020. [70] R. Agarwal, M. Schwarzer, P. S. Castro, A. C. Courville, and M. Bellemare, "Deep reinforcement the edge of the statistical precipice," in Advances in Neural Information Processing Systems (NeurIPS), 2021. learning at robotic assisted minimally invasive surgery–a feasibility study," IEEE Robotics and Automation Letters (RA-L), 2020. [40] V. Patel, S. Krishnan, A. Goncalves, C. Chen, W. D. Boyd, and K. Goldberg, "Using intermittent synchronization to compensate for rhythmic body motion during autonomous surgical cutting and debridement," in International Symposium on Medical Robotics (ISMR), 2018. [41] A. Murali, S. Sen, B. Kehoe, A. Garg, S. McFarland, S. Patil, W. D. Boyd, S. Lim, P. Abbeel, and K. Goldberg, "Learning by observation for surgical subtasks: Multilateral cutting of 3d viscoelastic and 2d orthotropic tissue phantoms," in IEEE International Conference on Robotics and Automation (ICRA), 2015. [42] M. Yip and N. Das, "Robot autonomy for surgery," in The Encyclopedia of MEDICAL ROBOTICS: Volume 1 Minimally Invasive Surgical Robotics, 2019. [43] B. D. Argall, S. Chernova, M. Veloso, and B. Browning, "A survey learning from demonstration," Robotics and Autonomous of robot Systems, 2009. [44] M. Bain and C. Sammut, "A framework for behavioural cloning," in Machine Intelligence, 1999. [45] J. Ibarz, J. Tan, C. Finn, M. Kalakrishnan, P. Pastor, and S. Levine, "How to train your robot with deep reinforcement learning: lessons we have learned," The International Journal of Robotics Research (IJRR), 2021. [46] T. Osa, J. Pajarinen, G. Neumann, J. A. Bagnell, P. Abbeel, J. Peters, et al., "An algorithmic perspective on imitation learning," Foundations and Trends® in Robotics, 2018. [47] J. Ho and S. Ermon, "Generative adversarial imitation learning," in Advances in Neural Information Processing Systems (NeurIPS), 2016. [48] Y. Ding, C. Florensa, P. Abbeel, and M. Phielipp, "Goal-conditioned Information Processing imitation learning," Advances in Neural Systems (NeurIPS), 2019. [49] B. D. Ziebart, A. L. Maas, J. A. Bagnell, and A. K. Dey, "Maximum learning," in Association for the entropy inverse reinforcement Advancement of Artificial Intelligence (AAAI), 2008. [50] J. Fu, K. Luo, and S. Levine, "Learning robust rewards with adverserial learning," in International Conference on inverse reinforcement Learning Representations (ICLR), 2018. [51] I. Kostrikov, K. K. Agrawal, D. Dwibedi, S. Levine, and J. Tompson, inefficiency and imitation learning," in International "Discriminator-actor-critic: Addressing sample reward bias in adversarial Conference on Learning Representations (ICLR), 2019. [52] I. Kostrikov, R. Fergus, J. Tompson, and O. Nachum, "Offline reinforcement learning with fisher divergence critic regularization," in International Conference on Machine Learning (ICML), 2021. [53] S. Fujimoto, D. Meger, and D. Precup, "Off-policy deep reinforcement learning without exploration," in International Conference on Machine Learning (ICML), 2019. [54] T. Haarnoja, A. Zhou, P. Abbeel, and S. Levine, "Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor," in International Conference on Machine Learning (ICML), 2018. [55] A. Nair, A. Gupta, M. Dalal, and S. Levine, "Awac: Accelerating online reinforcement learning with offline datasets," arXiv preprint arXiv:2006.09359, 2020. [56] Y. Wu, G. Tucker, and O. Nachum, "Behavior regularized offline reinforcement learning," arXiv preprint arXiv:1911.11361, 2019. [57] C. G. Atkeson, A. W. Moore, and S. Schaal, "Locally weighted learning," Lazy learning, 1997. [58] J. Pari, N. M. M. Shafiullah, S. P. Arunachalam, and L. Pinto, "The surprising effectiveness of representation learning for visual imitation," in Robotics: Science and Systems (RSS), 2022. [59] K. Hakhamaneshi, R. Zhao, A. Zhan, P. Abbeel, and M. Laskin, "Hierarchical few-shot transition models," in imitation with skill International Conference on Learning Representations (ICLR), 2022. [60] S. P. Arunachalam, S. Silwal, B. Evans, and L. Pinto, "Dexterous imitation made easy: A learning-based framework for efficient dexterous manipulation," arXiv preprint arXiv:2203.13251, 2022. [61] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, control with deep learning." in International Conference on Learning and D. Wierstra, D. Silver, reinforcement Representations (ICLR), 2016. "Continuous [62] P. Dhariwal, C. Hesse, O. Klimov, A. Nichol, M. Plappert, A. Radford, J. Schulman, S. Sidor, Y. Wu, and P. Zhokhov, "Openai baselines," https://github.com/openai/baselines, 2017.
http://arxiv.org/abs/2302.09766v2
2023-06-22T17:12:44
2023-02-20T05:16:18
A One-Sample Decentralized Proximal Algorithm for Non-Convex Stochastic Composite Optimization
We focus on decentralized stochastic non-convex optimization, where $n$ agents work together to optimize a composite objective function which is a sum of a smooth term and a non-smooth convex term. To solve this problem, we propose two single-time scale algorithms: Prox-DASA and Prox-DASA-GT. These algorithms can find $\epsilon$-stationary points in $\mathcal{O}(n^{-1}\epsilon^{-2})$ iterations using constant batch sizes (i.e., $\mathcal{O}(1)$). Unlike prior work, our algorithms achieve comparable complexity without requiring large batch sizes, more complex per-iteration operations (such as double loops), or stronger assumptions. Our theoretical findings are supported by extensive numerical experiments, which demonstrate the superiority of our algorithms over previous approaches. Our code is available at https://github.com/xuxingc/ProxDASA.
[ "Tesi Xiao", "Xuxing Chen", "Krishnakumar Balasubramanian", "Saeed Ghadimi" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09766v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09766v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "math.OC", "@scheme": "http://arxiv.org/schemas/atom" }
[ "math.OC", "cs.DC", "cs.LG", "stat.ML" ]
3 2 0 2 n u J 2 2 ] C O . h t a m [ 2 v 6 6 7 9 0 . 2 0 3 2 : v i X r a A One-Sample Decentralized Proximal Algorithm for Non-Convex Stochastic Composite Optimization ∗ Tesi Xiao† Xuxing Chen‡ Krishnakumar Balasubramanian§ Saeed Ghadimi¶ June 23, 2023 Abstract We focus on decentralized stochastic non-convex optimization, where n agents work together to optimize a composite objective function which is a sum of a smooth term and a non-smooth convex term. To solve this problem, we propose two single-time scale algorithms: Prox-DASA and Prox-DASA-GT. These algorithms can find ε-stationary points in O(n−1ε−2) iterations using constant batch sizes (i.e., O(1)). Unlike prior work, our algorithms achieve comparable complex- ity without requiring large batch sizes, more complex per-iteration operations (such as double loops), or stronger assumptions. Our theoretical findings are supported by extensive numerical experiments, which demonstrate the superiority of our algorithms over previous approaches. Our code is available at https://github.com/xuxingc/ProxDASA. 1 Introduction Decentralized optimization is a flexible paradigm for solving complex optimization problems in a distributed manner and has numerous applications in fields such as machine learning, robotics, and control systems. It has attracted increased attention due to the following benefits: (i) Robustness: Decentralized optimization is more robust than centralized optimization because each agent can operate independently, making the system more resilient to failures compared to a centralized sys- tem where a coordinator failure or overload can halt the entire system. (ii) Privacy: Decentralized optimization can provide greater privacy because each agent only has access to a limited subset of observations, which may help to protect sensitive information. (iii) Scalability: Decentralized optimization is highly scalable as it can handle large datasets in a distributed manner, thereby solving complex optimization problems that are difficult or even impossible to solve in a centralized setting. Specifically, we consider the following decentralized composite optimization problems in which n agents collaborate to solve min x∈Rd Φ(x) := F (x) + Ψ(x), F (x) := 1 n n (cid:88) i=1 Fi(x), (1) ∗The first two authors contributed equally to this work. †Department of Statistics, UC Davis. [email protected]. ‡Department of Mathematics, UC Davis. [email protected]. §Department of Statistics, UC Davis. [email protected]. Supported by NSF grant DMS-2053918. ¶Department of Management Sciences, University of Waterloo. [email protected]. Paritally supported by NSERC grant RGPIN-2021-02644. 1 where each function Fi(x) is a smooth function only known to the agent i; Ψ(x) is non-smooth, con- vex, and shared across all agents; Φ(x) is bounded below by Φ∗ > −∞. We consider the stochastic setting where the exact function values and derivatives of Fi's are unavailable. In particular, we assume that Fi(x) = Eξi∼Di[Gi(x, ξi)], where ξi is a random vector and Di is the distribution used to generate samples for agent i. The agents form a connected and undirected network and can communicate with their neighbors to cooperatively solve (1). The communication network can be represented with G = (V, W) where V = {v1, v2, . . . , vn} denotes all devices and W = [wij] ∈ Rn×n is the weighted adjacency matrix indicating how two agents are connected. A majority of the existing decentralized stochastic algorithms for solving (1), require large batch sizes to achieve convergence. The few algorithms that operate with constant batch sizes mainly rely on complicated variance reduction techniques and require stronger assumptions to establish convergence results. To the best of our knowledge, the question of whether it is possible to develop decentralized stochastic optimization algorithms to solve (1) without the above mentioned limitations, remains unresolved. To address this, we propose the two decentralized stochastic proximal algorithms, Prox-DASA and Prox-DASA-GT, for solving (1) and make the following contributions: • We show that Prox-DASA is capable of achieving convergence in both homogenous and bounded heterogeneous settings while Prox-DASA-GT works for general decentralized heterogeneous prob- lems. • We show that both algorithms find an ε-stationary point in O(n−1ε−2) iterations using only O(1) stochastic gradient samples per agent and m communication rounds at each iteration, where m can be any positive integer. A topology-independent transient time can be achieved by setting m = ⌈ 1√ 1−ρ ⌉, where ρ is the second-largest eigenvalue of the communication matrix. • Through extensive experiments, we demonstrate the superiority of our algorithms over prior works. A summary of our results and comparison to prior work is provided in Table 1. Related Works on Decentralized Composite Optimization. Motivated by wide appli- cations in constrained optimization [Lee and Nedic, 2013, Margellos et al., 2017] and non-smooth problems with a composite structure as (1), arising in signal processing [Ling and Tian, 2010, Mateos et al., 2010, Patterson et al., 2014] and machine learning [Facchinei et al., 2015, Hong et al., 2017], several works have studied the decentralized composite optimization problem in (1), a natural generalization of smooth optimization. For example, Shi et al. [2015], Li et al. [2019], Alghunaim et al. [2019], Ye et al. [2020], Xu et al. [2021], Li et al. [2021], Sun et al. [2022], Wu and Lu [2022] studied (1) in the convex setting. Furthermore, Facchinei et al. [2015], Di Lorenzo and Scutari [2016], Hong et al. [2017], Zeng and Yin [2018], Scutari and Sun [2019] studied (1) in the deterministic setting. Although there has been a lot of research investigating decentralized composite optimization, the stochastic non-convex setting, which is more broadly applicable, still lacks a full understanding. Wang et al. [2021] proposes SPPDM, which uses a proximal primal-dual approach to achieve O(ε−2) sample complexity. ProxGT-SA and ProxGT-SR-O [Xin et al., 2021a] incorporate stochastic gradient tracking and multi-consensus update in proximal gradient methods and obtain O(n−1ε−2) and O(n−1ε−1.5) sample complexity respectively, where the latter further uses a SARAH type variance reduction method [Pham et al., 2020, Wang et al., 2019]. A recent work [Mancino-ball et al., 2 Table 1: Comparison of decentralized proximal gradient based algorithms to find an ε-stationary solution to stochastic composite optimization in the nonconvex setting. The sample complexity is defined as the number of required samples per agent to obtain an ε-stationary point (see Definition 1). We omit a comparison with SPPDM [Wang et al., 2021] as their definition of stationarity differs from ours; see Appendix for further discussions. Sample Complexity Communication Complexity Linear Speedup? Batch Size Algorithm Remark ProxGT-SA [Xin et al., 2021a] ProxGT-SR-O [Xin et al., 2021a] DEEPSTORM [Mancino-ball et al., 2023] Prox-DASA (Alg. 1) Prox-DASA-GT (Alg. 2) O(ε−1) O(ε−1) O(n−1ε−2) O(log(n)ε−1) O(n−1ε−1.5) O(log(n)ε−1) O(ε−0.5) then O(1)∗ O(n−1ε−1.5) O(n−1ε−1.5) O(1) O (1) O (1) O(ε−1.5| log ε|−1.5) O(ε−1.5| log ε|−1.5) O(n−1ε−2) O(n−1ε−2) O(n−1ε−2) O(n−1ε−2) ✓ ✓ ✓ ✗ ✓ ✓ double-loop; mean-squared smoothness two time-scale; mean-squared smoothness; double gradient evaluations per iteration bounded heterogeneity ∗ It requires O(ε−0.5) batch size in the first iteration and then O(1) for the rest (see m0 in Algorithm 1 in Mancino-ball et al. [2023]). 2023] proposes DEEPSTORM, which leverages the momentum-based variance reduction technique and gradient tracking to obtain O(n−1ε−1.5) and ̃O(ε−1.5) sample complexity under different stepsize choices. Nevertheless, existing works either require stronger assumptions [Mancino-ball et al., 2023] or increasing batch sizes [Wang et al., 2021, Xin et al., 2021a]. 2 Preliminaries Notations. ∥ * ∥ denotes the l2-norm for vectors and Frobenius norm for matrices. ∥ * ∥2 denotes the spectral norm for matrices. 1 represents the all-one vector, and I is the identity matrix as a standard practice. We identify vectors at agent i in the subscript and use the superscript for the algorithm step. For example, the optimization variable of agent i at step k is denoted as xk i , and zk is the corresponding dual variable. We use uppercase bold letters to represent the matrix that i collects all the variables from nodes (corresponding lowercase) as columns. We add an overbar to a letter to denote the average over all nodes. For example, we denote the optimization variables over (cid:3) . The corresponding average over all nodes can be thereby all nodes at step k as Xk = (cid:2)xk defined as 1, . . . , xk n ̄xk = 1 n n (cid:88) i=1 xk i = 1 n Xk1, ̄Xk = [ ̄xk, . . . , ̄xk] = ̄xk1⊤ = 1 n Xk11⊤. For an extended valued function Ψ : Rd → R ∪ {+∞}, its effective domain is written as dom(Ψ) = {x | Ψ(x) < +∞}. A function Ψ is said to be proper if dom(Ψ) is non-empty. For any proper closed convex function Ψ, x ∈ Rd, and scalar γ > 0, the proximal operator is defined as proxγ Ψ(x) = arg min y∈Rd ∥y − x∥2 + Ψ(y) (cid:27) . (cid:26) 1 2γ 3 For x, z ∈ Rd and γ > 0, the proximal gradient mapping of z at x is defined as G(x, z, γ) = 1 γ (cid:0)x − proxγ Ψ(x − γz)(cid:1) . All random objects are properly defined in a probability space (Ω, F , P) and write x ∈ H if x is H-measurable given a sub-σ-algebra H ⊆ F and a random vector x. We use σ(*) to denote the σ-algebra generated by all the argument random vectors. Assumptions. Next, we list and discuss the assumptions made in this work. Assumption 1. The weighted adjacency matrix W = (wij) ∈ Rn×n is symmetric and doubly stochastic, i.e., W = W⊤, W1n = 1n, wij ≥ 0, ∀i, j, and its eigenvalues satisfy 1 = λ1 > λ2 ≥ * * * ≥ λn and ρ := max{|λ2|, |λn|} < 1. Assumption 2. All functions {Fi}1≤i≤n have Lipschitz continuous gradients with Lipschitz con- stants L∇Fi, respectively. Therefore, ∇F is L∇F -Lipchitz continous with L∇F = max1≤i≤n{L∇Fi}. Assumption 3. The function Ψ : Rd → R ∪ {+∞} is a closed proper convex function. For stochastic oracles, we assume that each node i at every iteration k is able to obtain a local i . The induced natural filtration is given by F0 = {∅, Ω} and random data vector ξk Fk := σ (cid:0)ξt i | i = 1, . . . , n, t = 1, . . . , k(cid:1) , ∀k ≥ 1. We require that the stochastic gradient ∇Gi(*, ξk+1 i ) is unbiased conditioned on the filteration Fk. Assumption 4 (Unbiasness). For any k ≥ 0, x ∈ Fk, and 1 ≤ i ≤ n, E (cid:104) ∇Gi(x, ξk+1 i ) | Fk (cid:105) = ∇Fi(x). Assumption 5 (Independence). For any k ≥ 0, 1 ≤ i, j ≤ n, i ̸= j, ξk+1 and ξk+1 i is independent of ξk+1 . j i is independent of Fk, In addition, we consider two standard assumptions on the variance and heterogeneity of stochas- tic gradients. Assumption 6 (Bounded variance). For any k ≥ 0, x ∈ Fk, and 1 ≤ i ≤ n, E (cid:20)(cid:13) (cid:13)∇Gi(x, ξk+1 (cid:13) i ) − ∇Fi(x) 2(cid:12) (cid:13) (cid:12) Fk (cid:13) (cid:12) (cid:13) (cid:12) (cid:21) ≤ σ2 i . Let σ2 = 1 n (cid:80)n i=1 σ2 i . Assumption 7 (Gradient heterogeneity). There exists a constant ν ≥ 0 such that for all 1 ≤ i ≤ n, x ∈ Rd, ∥∇Fi(x) − ∇F (x)∥ ≤ ν. 4 Remark (Bounded gradient heterogeneity). The above assumption of gradient heterogeneity is standard Lian et al. [2017] and less strict than the bounded second moment assumption on stochastic gradients which implies lipschtizness of functions {Fi}. However, this assumption is only required for the convergence analysis of Prox-DASA and can be bypassed by employing a gradient tracking step. Remark (Smoothness and mean-squared smoothness). Our theoretical results of the proposed methods are only built on the smoothness assumption on functions {Fi} without further assuming mean-squared smoothness assumptions on {Gi,ξ}, which is required in all variance reduction based methods in the literature, such as ProxGT-SR-O [Xin et al., 2021a] and DEEPSTORM [Mancino-ball et al., 2023]. It is worth noting that a clear distinction in the lower bounds of sample complexity for solving stochastic optimization under two different sets of assumptions has been proven in [Arjevani et al., 2023]. Specifically, when considering the mean-squared smoothness assumption, the optimal sample complexity is O(ε−1.5), whereas under smoothness assumptions, it is O(ε−2). The proposed methods in this work achieve the optimal sample complexity under our weaker assumptions. 3 Algorithm Several algorithms have been developed to solve Problem (1) in the stochastic setting; see Table 1. However, the most recent two types of algorithms have certain drawbacks: (i) increasing batch sizes: ProxGT-SA, Prox-SR-O, and DEEPSTORM with constant step sizes (Theorem 1 in [Mancino- ball et al., 2023]) require batches of stochastic gradients with batch sizes inversely proportional to tolerance ε; (ii) algorithmic complexities: ProxGT-SR-O and DEEPSTORM are either double-looped or two-time-scale, and require stochastic gradients evaluated at different parameter values over the same sample, i.e., ∇Gi(x, ξ) and ∇Gi(x′, ξ). These variance reduction techniques are unfavor- able when gradient evaluations are computationally expensive such as forward-backward steps for deep neural networks. (iii) theoretical weakness: the convergence analyses of ProxGT-SR-O and DEEPSTORM are established under the stronger assumption of mean-squared lipschtizness of stochas- tic gradients. In addition, Theorem 2 in [Mancino-ball et al., 2023] fails to provide linear-speedup results for one-sample variant of DEEPSTORM with diminishing stepsizes. 3.1 Decentralized Proximal Averaged Stochastic Approximation To address the above limitations, we propose Decentralized Proximal Averaged Stochastic Approx- imation (Prox-DASA) which leverages a common averaging technique in stochastic optimation [Ruszczy ́nski, 2008, Mokhtari et al., 2018, Ghadimi et al., 2020] to reduce the error of gradient estimation. In particular, the sequences of dual variables Zk = [zk n] that aim to approxi- mate gradients are defined in the following recursion: 1 , . . . , zk Zk+1 = (cid:110) (1 − αk)Zk + αkVk+1(cid:111) Wm Vk+1 = [vk+1 1 , . . . , vk+1 n ], where each vk+1 is the local stochastic gradient evaluated at the local variable xk i . For complete graphs where each pair of graph vertices is connected by an edge and there is no consensus error for optimization variables, i.e., W = 1 i = xk j , ∀i, j, the averaged dual variable over nodes n 11⊤ and xk i 5 Input: x0 i = 0, γ, {αk}≥0, m Algorithm 1: Prox-DASA i = z0 1 for k = 0, 1, . . . , K − 1 do # Local Update 2 for i = 1, 2, . . . , n (in parallel) do (cid:0)xk 3 4 (cid:1) i − γzk i i + αkyk i i = proxγ yk Ψ ̃xk+1 i = (1 − αk)xk # Compute stochastic gradient vk+1 i , ξk+1 i = ∇Gi(xk ) i ̃zk+1 i + αkvk+1 i = (1 − αk)zk i end # Communication [xk+1 , . . . , xk+1 1 [zk+1 , . . . , zk+1 1 n n ] = [ ̃xk+1 ] = [ ̃zk+1 1 , . . . , ̃xk+1 , . . . , ̃zk+1 ]Wm ]Wm n n 1 5 6 7 8 9 10 11 12 13 end ̄zk follows the same averaging rule as in centralized algorithms: ̄zk+1 = (1 − αk) ̄zk + αk ̄vk+1 E[ ̄vk+1|Fk] = ∇F ( ̄xk). To further control the consensus errors, we employ a multiple consensus step for both primal and dual iterates {xk i } which multiply the matrix of variables from all nodes by the weight matrix m times. A pseudo code of Prox-DASA is given in Algorithm 1. i , zk 3.2 Gradient Tracking The constant ν defined in Assumption 7 measures the heterogeneity between local gradients and global gradients, and hence the variance of datasets of different agents. To remove ν in the complex- ity bound, Tang et al. [2018] proposed the D2 algorithm, which modifies the x update in D-PSGD [Lian et al., 2017]. However, it requires one additional assumption on the eigenvalues of the mixing matrix W. Here we adopt the gradient tracking technique, which was first introduced to deter- ministic distributed optimization to improve the convergence rate [Xu et al., 2015, Di Lorenzo and Scutari, 2016, Nedic et al., 2017, Qu and Li, 2017], and was later proved to be useful in removing the data variance (i.e., ν) dependency in the stochastic case [Zhang and You, 2019, Lu et al., 2019, Pu and Nedi ́c, 2021, Koloskova et al., 2021]. In the convergence analysis of Prox-DASA, an essential step is to control the heterogeneity of stochastic gradients, i.e., E[(cid:13) (cid:13)Vk+1 − ̄Vk+1(cid:13) 2], which requires (cid:13) bounded heterogeneity of local gradients (Assumption 7). To pypass this assumption, we employ a gradient tracking step by replacing Vk+1 with pseudo stochastic gradients Uk+1 = [uk+1 ], which is updated as follows: , . . . , uk+1 n 1 Uk+1 = (cid:16) Uk + Vk+1 − Vk(cid:17) Wm. Provided that U0 = V0 and W1 = 1, one can show that ̄uk = ̄vk at each step k. In ad- dition, with the consensus procedure over Uk, the heterogeneity of pseudo stochastic gradients 6 Input: x0 Algorithm 2: Prox-DASA-GT i = z0 i = u0 1 for k = 0, 1, . . . , K do 2 i = 0, γ, {αk}≥0, m # Local Update for i = 1, 2, . . . , n (in parallel) do (cid:0)xk (cid:1) i − γzk i i + αkyk i i = proxγ yk Ψ ̃xk+1 i = (1 − αk)xk # Compute stochastic gradient vk+1 i , ξk+1 i = ∇Gi(xk ) i ̃uk+1 i + vk+1 i = uk i − vk i ̃zk+1 i + αk ̃uk+1 i = (1 − αk)zk i end # Communication [xk+1 , . . . , xk+1 1 [uk+1 , . . . , uk+1 1 [zk+1 , . . . , zk+1 1 n n n 1 ] = [ ̃xk+1 ] = [ ̃uk+1 ] = [ ̃zk+1 1 n , . . . , ̃xk+1 , . . . , ̃uk+1 , . . . , ̃zk+1 ]Wm ]Wm ]Wm n n 1 3 4 5 6 7 8 9 10 11 12 13 14 15 end (cid:13)Uk+1 − ̄Uk+1(cid:13) 2] can be bounded above. The proposed algorithm, named as Prox-DASA with (cid:13) E[(cid:13) Gradient Tracking (Prox-DASA-GT), is presented in Algorithm 2. 3.3 Consensus Algorithm In practice, we can leverage accelerated consensus algorithms, e.g., Liu and Morse [2011], Olshevsky [2017], to speed up the multiple consensus step Wm to achieve improved communication complex- ities when m > 1. Specifically, we can replace Wm by a Chebyshev-type polynomial of W as described in Algorithm 3, which can improve the ρ-dependency of the communication complexity from a factor of 1 1−ρ to 1√ 1−ρ . Algorithm 3: Chebyshev Mixing Protocol Input: Matrix X, mixing matrix W, rounds m 1 Set A0 = X, A1 = XW, ρ = max{|λ2(W)|, |λn(W)|} < 1, μ0 = 1, μ1 = 1 ρ 2 for t = 1, . . . , m − 1 do 3 ρ μt − μt−1 μt+1 = 2 At+1 = 2μt ρμt+1 AtW − μt−1 μt+1 4 5 end Output: Am At−1 7 4 Convergence Analysis 4.1 Notion of Stationarity For centralized optimization problems with non-convex objective function F (x), a standard measure of non-stationarity of a point ̄x is the squared norm of proximal gradient mapping of ∇F ( ̄x) at ̄x, i.e., ∥G( ̄x, ∇F ( ̄x), γ)∥2 = (cid:13) (cid:13) (cid:13) (cid:13) 1 γ (cid:0)x − proxγ Ψ( ̄x − γ∇F ( ̄x))(cid:1) (cid:13) 2 (cid:13) (cid:13) (cid:13) . For the smooth case where Ψ(x) ≡ 0, the above measure is reduced to ∥∇F ( ̄x)∥2. However, in the decentralized setting with a connected network G, we solve the following equiv- alent reformulated consensus optimization problem: min x1,...,xn∈Rd 1 n n (cid:88) i=1 {Fi(xi) + Ψ(xi)} s.t. xi = xj, ∀(i, j). (2) To measure the non-stationarity in Problem (2), one should consider not only the stationarity violation at each node but also the consensus errors over the network. Therefore, Xin et al. [2021a] and Mancino-ball et al. [2023] define an ε-stationary point X = [x1, . . . , xn] of Problem 2 as (cid:34) E 1 n n (cid:88) i=1 (cid:110) ∥G(xi, ∇F (xi), γ)∥2 + L2 (cid:35) ∇F ∥xi − ̄x∥2(cid:111) ≤ ε. (3) In this work, we use a general measure as follows. Definition 1. Let X = [x1, . . . , xn] be random vectors generated by a decentralized algorithm to solve Problem 2 and ̄x = 1 n i=1 xi. We say that X is an ε-stationary point of Problem 2 if (cid:80)n (stationarity violation) (consensus error) (cid:104) E ∥G( ̄x, ∇F ( ̄x), γ)∥2(cid:105) 2(cid:105) (cid:104) L2 (cid:13)X − ̄X(cid:13) (cid:13) ∇F (cid:13) n E ≤ ε, ≤ ε. The next inequality characterizes the difference between the gradient mapping at ̄x and xi, which relates our definition to (3). Noting that by non-expansiveness of the proximal operator, we have ∥G(xi, ∇F (xi), γ) − G( ̄x, ∇F ( ̄x), γ)∥ ≤ 2+γL∇F ∥xi − ̄x∥, implying γ 1 n n (cid:88) i=1 ∥G(xi, ∇F (xi), γ)∥2 ≲ ∥G( ̄x, ∇F ( ̄x), γ)∥2 + 1 γ2n (cid:13)X − ̄X(cid:13) (cid:13) 2 . (cid:13) 4.2 Main Results We present the complexity results of our algorithms below. Theorem 2. Suppose Assumptions 1, 2, 3, 4, 5, 6 hold and the total number of iterations K ≥ K0, where K0 is a constant that only depends on constants (n, L∇F , ρ(m), γ), where ρ(m) = (1+ρ2m)ρ2m (1−ρ2m)2 . Let C0 be some initialization-dependent constant and R be a random integer uniformly distributed over {1, 2, . . . , K}. Suppose we set αk ≍ (cid:112) n K , γ ≍ 1 L∇F . 8 (Prox-DASA) Suppose in addition Assumption 7 also holds. The, for Algorithm 1 we have E E E (cid:104)(cid:13) (cid:13)G( ̄xR, ∇F ( ̄xR), γ)(cid:13) (cid:13) 2(cid:105) ≲ γ−1C0 + σ2 √ + n(σ2 + γ−2ν2)ρ(m) K , (cid:104)(cid:13) (cid:13) ̄zR − ∇F ( ̄xR))(cid:13) (cid:13) (cid:20) L2 ∇F n (cid:13) (cid:13)XR − ̄XR nK ≲ γ−1C0 + σ2 √ 2(cid:105) nK + n(σ2 + γ−2ν2)ρ(m) K , (cid:13) 2 + (cid:13) (cid:13) (cid:13)ZR − ̄ZR (cid:13) 2 (cid:13) 1 n (cid:21) ≲ n(σ2 + γ−2ν2)ρ(m) K . (Prox-DASA-GT) For Algorithm 2 we have E E E (cid:104)(cid:13) (cid:13)G( ̄xR, ∇F ( ̄xR), γ)(cid:13) (cid:13) 2(cid:105) ≲ γ−1C0 + σ2 √ (cid:104)(cid:13) (cid:13) ̄zR − ∇F ( ̄xR)(cid:13) (cid:13) (cid:20) L2 ∇F n (cid:13) (cid:13)XR − ̄XR nK ≲ γ−1C0 + σ2 √ + 2(cid:105) nK (cid:13) 2 + (cid:13) 1 n (cid:13) (cid:13)ZR − ̄ZR (cid:13) 2 (cid:13) , + nσ2ρ(m) K nσ2ρ(m) K ≲ nσ2ρ(m) K , (cid:21) . In Theorem 2 for simplicity we assume γ ≍ 1 L∇F , which can be relaxed to γ > 0. We have the following corollary characterizing the complexity of Algorithm 1 and 2 for finding ε-stationary points. The proof is immediate. Corollary 3. Under the same conditions of Theorem 2, provided that K ≳ n3ρ(m), for any ε > 0 the sample complexity per agent for finding ε-stationary points in Algorithm 1 and 2 are O(max{n−1ε−2, KT }) where the transient time KT ≍ max{K0, n3ρ(m)}. Remark (Sample complexity). For a sufficiently small ε > 0, Corrollary 3 implies that the sam- ple complexity of Algorithm 1 and 2 matches the optimal lower bound O(n−1ε−2) in decentralized smooth stochastic non-convex optimization [Lu and De Sa, 2021]. Remark (Transient time and communication complexity). Our algorithms can achieve convergence with a single communication round per iteration, i.e., m = 1, leading to a topology-independent O(n−1ε−2) communication complexity. In this case, however, the transient time KT still depends on ρ, as is also the case for smooth optimization problems [Xin et al., 2021b]. When consider- ing multiple consensus steps per iteration with the communication complexity being O(mn−1ε−2), setting m ≍ ⌈ 1 1√ 1−ρ ⌉ for accelerated consensus algorithms) results in a topology- 1−ρ ⌉ (or m ≍ ⌈ independent transient time given that ρ(m) ≍ 1. Remark (Dual convergence). An important aspect to emphasize is that in our proposed methods, (cid:80)n the sequence of average dual variables ̄zk = 1 i converges to ∇F ( ̄xk), while the consensus n error of {zk n} decreases to zero. Our approach achieves this desirable property, which is commonly observed in modern variance reduction methods [Gower et al., 2020], without the need for complex variance reduction operations in each iteration. As a result, it provides a reliable termination criterion in the stochastic setting without requiring large batch sizes. 1 , . . . , zk i=1 zk 9 4.3 Proof Sketch Here, we present a sketch of our convergence analyses and defer details to Appendix. Our proof relies on the merit function below: W ( ̄xk, ̄zk) = Φ( ̄xk) − Φ∗ (cid:125) (cid:123)(cid:122) function value gap (cid:124) + Ψ( ̄xk) − η( ̄xk, ̄zk) (cid:125) (cid:123)(cid:122) primal convergence (cid:124) +λ (cid:13) (cid:13) (cid:13)∇F ( ̄xk) − ̄zk(cid:13) (cid:124) (cid:123)(cid:122) dual convergence 2 (cid:13) , (cid:13) (cid:125) where η(x, z) = min y∈Rd (cid:110) ⟨z, y − x⟩ + 1 2γ ∥y − x∥2 + Ψ(y) (cid:111) . Let yk + := proxγ Ψ (cid:0) ̄xk − γ ̄zk(cid:1). Then, the proximal gradient mapping of ̄zk at ̄xk is G( ̄xk, ̄zk, γ) = 1 1/γ-strongly convex function, we have γ ( ̄xk − yk +). Since yk + is the minimizer of a (cid:68) ̄zk, yk + − ̄xk(cid:69) + 1 2γ ∥yk + − ̄xk∥2 + Ψ(yk +) ≤ Ψ( ̄xk) − 1 2γ ∥yk + − ̄xk∥2, implying the relation between Ψ( ̄xk) − η( ̄xk, ̄zk) and primal convergence: (cid:13) (cid:13)G( ̄xk, ̄zk, γ) (cid:13) Following standard practices in optimization, we set γ = 1 L∇F our algorithms do not require any restriction on the choice of γ. Ψ( ̄xk) − η( ̄xk, ̄zk) ≥ γ 2 (cid:13) 2 (cid:13) (cid:13) . below for simplicity. However, Step 1: Leveraging the merit function with λ ≍ γ, we can first obtain an essential lemma i }1≤i≤n,k≥0 generated (Lemma 11 in Appendix) in our analyses, which says that for sequences {xk by Prox-DASA(-GT) (Algorithm 1 or 2) with αk ≲ min{1, (1 + γ)−2, γ2(1 + γ)−2}, we have i , zk W ( ̄xk+1, ̄zk+1)−W ( ̄xk, ̄zk) ≤ −αk Θk + Υk + αkΛk + rk+1(cid:111) (cid:110) , where E[rk+1 | Fk] = 0, Λk ≍ γ (cid:13) (cid:13) ̄∆k+1(cid:13) 2, (cid:13) 1 γ γ n and ̄∆k+1 = ̄vk+1 − 1 i ) = ̄uk+1 − 1 i=1 ∇Fi(xk i=1 ∇Fi(xk n n telescoping and taking expectation with respect to F0, we have (cid:13)∇F ( ̄xk) − ̄zk(cid:13) (cid:13) (cid:13) 2 , (cid:13)Xk − ̄Xk (cid:13) ∥ ̄xk − ̄yk∥2 + γ (cid:13) (cid:13)Zk − ̄Zk 1 nγ (cid:80)n (cid:13) 2 + (cid:13) Θk ≍ Υk ≍ 2 (cid:13) (cid:13) (cid:80)n (cid:13) (cid:13) , i ) (for Prox-DASA-GT). Thus, by αkE (cid:20)(cid:13) (cid:13) ̄xk − ̄yk(cid:13) (cid:13) 2 (cid:13) (cid:13) K (cid:88) k=0 + γ2 (cid:13) (cid:13) (cid:13)∇F ( ̄xk) − ̄zk(cid:13) (cid:13) (cid:13) 2(cid:21) ≲ γW ( ̄x0, ̄z0) + γ2σ2 K (cid:88) k=0 α2 k n K (cid:88) αk + k=0 (cid:110) E (cid:104)(cid:13) (cid:13)Xk − ̄Xk 2 + γ2 (cid:13) (cid:13) (cid:13) (cid:13)Zk − ̄Zk 2(cid:105)(cid:111) (cid:13) (cid:13) n (4) . Step 2: We then analyze the consensus errors. Without loss of generality, we consider X0 = ̄X0 = 0, i.e., all nodes have the same initialization at 0. For m ∈ N+, define Then, we have the following fact: ρ(m) = (1 + ρ2m)ρ2m (1 − ρ2m)2 . 10 • ρ(m) is monotonically decreasing with the maximum value being ρ(1) = (1+ρ2)ρ2 (1−ρ2)2 := ρ1; • ρ(m) ≤ 1 if and only if ρ2m ≤ 1 3 . With the definition of ρ(m) and assuming 0 < αk+1 ≤ αk ≤ 1, we can show the consensus errors have the following upper bounds. Prox-DASA: Let αk ≲ ρ(m)− 1 2 , we have K (cid:88) k=0 αk n E (cid:104)(cid:13) (cid:13)Xk − ̄Xk 2(cid:105) (cid:13) (cid:13) ≤ K (cid:88) k=0 γ2αk n E (cid:104)(cid:13) (cid:13)Zk − ̄Zk 2(cid:105) (cid:13) (cid:13) ≲ (γ2σ2 + ν2)ρ(m) K (cid:88) k=0 α3 k . (5) Prox-DASA-GT: Let αk ≲ min{ρ(m)−1, ρ(m)− 1 2 }, we have K (cid:88) k=0 αk n E (cid:2)∥Xk − ̄Xk∥2(cid:3) ≤ K (cid:88) k=0 γ2αk n E (cid:2)∥Zk − ̄Zk∥2(cid:3) ≲ ρ(m)2 K (cid:88) k=0 α3 k (cid:110) γ2σ2 + α2 k (cid:104) ∥ ̄xk − ̄yk∥2(cid:105)(cid:111) . E (6) We can also see that to obtain a topology-independent iteration complexity, the number of com- munication rounds can be set as m = ⌈ log 3 2(1−ρ) ⌉, which implies ρ(m) ≤ 1. In addition, we have the following fact that relates the consensus error of Y to the consensus errors of X and Z: (cid:13) (cid:13)yk (cid:13) + − ̄yk(cid:13) 2 (cid:13) (cid:13) + 1 n (cid:13) (cid:13)Yk − ̄Yk (cid:13) 2 = (cid:13) 1 n n (cid:88) i=1 (cid:13) (cid:13)yk (cid:13) i − yk + (cid:13) 2 (cid:13) (cid:13) ≤ 2 n (cid:8)∥Xk − ̄Xk∥2 + γ2∥Zk − ̄Zk∥2(cid:9) . Step 3: Let R be a random integer with Pr(R = k) = αk k=1 αk (cid:80)K , k = 1, 2, . . . , K, and dividing both sides of (5) by (cid:80)K of XR satisfies E Moreover, noting that (cid:20) 1 n (cid:13) (cid:13)XR − ̄XR (cid:13) 2 (cid:13) (cid:21) ≲ (γ2σ2 + ν2)ρ(m) (cid:80)K (cid:80)K k=0 α3 k k=1 αk . k=1 αk, we can obtain that for Prox-DASA, the consensus error ∥G( ̄x, ∇F ( ̄x), γ)∥2 ≲ 1 γ2 (cid:26)(cid:13) (cid:13) ̄xk − ̄yk(cid:13) (cid:13) 2 (cid:13) (cid:13) + and combining (4) with (5), we can get 2(cid:27) (cid:13) (cid:13)yk (cid:13) + − ̄yk(cid:13) (cid:13) (cid:13) + (cid:13) (cid:13) (cid:13)∇F ( ̄xk) − ̄zk(cid:13) 2 (cid:13) (cid:13) , E (cid:104)(cid:13) (cid:13)G( ̄xR, ∇F ( ̄xR), γ)(cid:13) (cid:13) 2(cid:105) ≲ W ( ̄x0, ̄z0) γ (cid:80)K k=1 αk (cid:123)(cid:122) (cid:124) initialization-related term (cid:125) + σ2 (cid:80)K k=0 α2 k n (cid:80)K k=1 αk (cid:123)(cid:122) (cid:125) (cid:124) variance-related term + (σ2 + γ−2ν2)ρ(m) (cid:80)K (cid:80)K k=0 α3 k k=1 αk (cid:124) (cid:123)(cid:122) consensus error . (cid:125) Thus, setting αk ≍ (cid:112) n K , we obtain the convergence results of Prox-DASA: 11 E E (cid:104)(cid:13) (cid:13)G( ̄xR, ∇F ( ̄xR), γ)(cid:13) (cid:13) (cid:21) (cid:20) 1 γ2n (cid:13) (cid:13)XR − ̄XR (cid:13) 2 (cid:13) ≲ n(σ2 + γ−2ν2)ρ(m) K . 2(cid:105) ≲ γ−1W ( ̄x0, ̄z0) + σ2 √ nK + n(σ2 + γ−2ν2)ρ(m) K , For Prox-DASA-GT, we can complete the proof with similar arguments by combining (6) with (4) and noting that ρ(m)2α4 k ≲ 1. 5 Experiments 5.1 Synthetic Data To demonstrate the effectiveness of our algorithms, we first evaluate our algorithms using synthetic data for solving sparse single index models [Alquier and Biau, 2013] in the decentralized setting. We consider the homogeneous setting where the data sample at each node ξ = (X, Y ) is generated from the same single index model Y = g(X ⊤θ∗) + ε, where X, θ ∈ Rd and E[ε|X] = 0. In this case, we solve the following L1-regularized least square problems: min θ∈Rd 1 n n (cid:88) i=1 E (X,Y )∼D (Y − g(X ⊤θ))2(cid:105) (cid:104) + λ ∥θ∥1 In particular, we set θ∗ ∈ R100 to be a sparse vector and g(*) = (*)2 which corresponds to the sparse phase retrieval problem [Jaganathan et al., 2016]. We simulate streaming data samples with batch size = 1 for training and 10,000 data samples per node for evaluations, where X and ε are sampled independently from two Gaussian distributions. We employ a ring topology for the network where self-weighting and neighbor weights are set to be 1/3. We set the penalty parameter λ = 0.01, the total number of iterations K = 10, 000, αk = (cid:112)n/K, γ = 0.01, and the number of communication rounds per iteration m = ⌈ 1 1−ρ ⌉. We plot the test loss and the norm of proximal gradient mapping in the log scale against the number of iterations in Figure 1, which shows that our decentralized algorithms have an additional linear speed-up with respect to n. In other words, the algorithms become faster as more agents are added to the network. 5.2 Real-World Data Following Mancino-ball et al. [2023], we consider solving the classification problem min θ∈Rd 1 n n (cid:88) i=1 1 |Di| (cid:88) (x,y)∈Di li(f (x; θ), y) + λ∥θ∥1, (7) on a9a and MNIST datasets1. Here, li denotes the cross-entropy loss, and f represents a neural network parameterized by θ with x being its input. Di is the training set only available to agent i. The L1 regularization term is used to impose a sparsity structure on the neural network. We use the code in Mancino-ball et al. [2023] for SPPDM, ProxGT-SR-O/E, DEEPSTORM, and then implement 1Available at https://www.openml.org. 12 Figure 1: Linear-speedup performance of Prox-DASA for decentralized online sparse phase retrievel problems. (Prox-DASA-GT has relatively the same plots) Prox-DASA and Prox-DASA-GT under their framework, which mainly utilizes PyTorch [Paszke et al., 2019] and mpi4py [Dalcin and Fang, 2021]. We use a 2-layer perception model on a9a and the LeNet architecture [LeCun et al., 2015] for the MNIST dataset. We have 8 agents (n = 8) which connect in the form of a ring for a9a and a random graph for MNIST. To demonstrate the performance of our algorithms in the constant batch size setting, the batch size is chosen to be 4 for a9a and 32 for MNIST for all algorithms. The learning rates provided in the code of Mancino-ball et al. [2023] are adjusted accordingly, and we select the ones with the best performance. For Prox-DASA and Prox-DASA-GT we choose a diminishing stepsize sequence, namely, αk = min (cid:8)α(cid:112) n k , 1(cid:9) for all k ≥ 0. Note that the same complexity (up to logarithmic factors) bounds can be obtained by directly plugging in the aforementioned expressions for αk in Section 4.3. Then we tune γ ∈ {1, 3, 10} and α ∈ {0.3, 1.0, 3.0}. The penalty parameter λ is chosen to be 0.0001 for all experiments. The number of communication rounds per iteration m is set to be 1 for all algorithms. We evaluate the model performance periodically during training and then plot the results in Figure 2, from which we observe that both Prox-DASA and Prox-DASA-GT have considerably good performance with small variance in terms of test accuracy, training loss, and stationarity. In particular, it should be noted that although DEEPSTORM achieves better stationarity in Figure 2(l) and 2(i), training a neural network by using DEEPSTORM takes longer time than Prox-DASA and Prox-DASA-GT since it uses the momentum-based variance reduction technique, which requires two forward-backward passes (see, e.g., Eq. (10) and Algorithm 1 in Mancino-ball et al. [2023]) to compute the gradients in one iteration per agent. In contrast, ours only require one, which saves a large amount of time (see Table 1 in Appendix). We include further details of our experiments in the Appendix. 6 Conclusion In this work, we propose and analyze a class of single time-scale decentralized proximal algorithms (Prox-DASA-(GT)) for non-convex stochastic composite optimization in the form of (1). We show that our algorithms achieve linear speed-up with respect to the number of agents using an O(1) batch size per iteration under mild assumptions. Furthermore, we demonstrate the efficiency and effectiveness of our algorithms through extensive experiments, in which our algorithms achieve rela- tively better results with less training time using a small batch size compared to existing methods. 13 01000200030004000Number of Iterations100101102103104105Test Lossn=5n=10n=2001000200030004000Number of Iterations100101102103104Proximal Gradient Mappingn=5n=10n=20 (a) (b) (c) (d) (e) (f) (g) (h) (j) (k) (i) (l) Figure 2: Comparisons between SPPDM [Wang et al., 2021], ProxGT-SR-E [Xin et al., 2021a], DEEPSTORM [Mancino-ball et al., 2023], Prox-DASA 1, and Prox-DASA-GT 2. The first two rows correspond to a9a and the last two rows correspond to MNIST. The results are averaged over 10 trials, and the shaded regions represent confidence intervals. The vertical axes in the third column are log-scale. It should be noted that ProxGT-SR-E maintains another hyperparameter q (see, e.g., Algorithm 4 and Theorem 3 in [Xin et al., 2021a]) and computes gradients using a full batch every q iterations. For simplicity, we do not include that amount of epochs when we plot this figure. In other words, the real number of epochs required to obtain a point on ProxGT-SR is larger than plotted in the figures in the second and fourth rows. We include the plots that take q into account in Appendix. 14 0200400600800Time4050607080Test accuracySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT0200400600800Time0.250.500.751.001.251.501.752.00Training lossSPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT0200400600800Time104103102101100101102StationaritySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT0246810Epoch4050607080Test accuracySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT0246810Epoch0.250.500.751.001.251.501.752.00Training lossSPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT0246810Epoch104103102101100101102StationaritySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT02004006008001000120014001600Time20406080100Test accuracySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT02004006008001000120014001600Time0.51.01.52.0Training lossSPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT02004006008001000120014001600Time103102101100101102StationaritySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT024681012Epoch20406080100Test accuracySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT024681012Epoch0.51.01.52.0Training lossSPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT024681012Epoch103102101100101102StationaritySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT In future research, it would be intriguing to expand our work in the context of dependent and heavy-tailed stochastic gradient scenarios [Wai, 2020, Li and Liu, 2022]. Acknowledgements We thank the authors of [Mancino-ball et al., 2023] for kindly providing the code framework to support our experiments. The research of KB is supported by NSF grant DMS-2053918. The research of SG is partially supported by NSERC grant RGPIN-2021-02644. References Sulaiman Alghunaim, Kun Yuan, and Ali H Sayed. A linearly convergent proximal gradient algo- rithm for decentralized optimization. Advances in Neural Information Processing Systems, 32, 2019. (Cited on page 2.) Pierre Alquier and G ́erard Biau. Sparse single-index model. Journal of Machine Learning Research, 14(1), 2013. (Cited on page 12.) Yossi Arjevani, Yair Carmon, John C Duchi, Dylan J Foster, Nathan Srebro, and Blake Woodworth. Lower bounds for non-convex stochastic optimization. Mathematical Programming, 199(1-2):165– 214, 2023. (Cited on page 5.) Lisandro Dalcin and Yao-Lung L Fang. mpi4py: Status update after 12 years of development. Computing in Science & Engineering, 23(4):47–54, 2021. (Cited on page 13.) Paolo Di Lorenzo and Gesualdo Scutari. Next: In-network nonconvex optimization. IEEE Trans- actions on Signal and Information Processing over Networks, 2(2):120–136, 2016. (Cited on pages 2 and 6.) Francisco Facchinei, Gesualdo Scutari, and Simone Sagratella. Parallel selective algorithms for IEEE Transactions on Signal Processing, 63(7):1874–1889, nonconvex big data optimization. 2015. (Cited on page 2.) Saeed Ghadimi, Andrzej Ruszczynski, and Mengdi Wang. A single timescale stochastic approxima- tion method for nested stochastic optimization. SIAM Journal on Optimization, 30(1):960–979, 2020. (Cited on page 5.) Robert M Gower, Mark Schmidt, Francis Bach, and Peter Richt ́arik. Variance-reduced methods for machine learning. Proceedings of the IEEE, 108(11):1968–1983, 2020. (Cited on page 9.) Mingyi Hong, Davood Hajinezhad, and Ming-Min Zhao. Prox-pda: The proximal primal-dual al- gorithm for fast distributed nonconvex optimization and learning over networks. In International Conference on Machine Learning, pages 1529–1538. PMLR, 2017. (Cited on page 2.) Kishore Jaganathan, Yonina C Eldar, and Babak Hassibi. Phase retrieval: An overview of recent developments. Optical Compressive Imaging, pages 279–312, 2016. (Cited on page 12.) 15 Anastasiia Koloskova, Tao Lin, and Sebastian U Stich. An improved analysis of gradient tracking for decentralized machine learning. Advances in Neural Information Processing Systems, 34, 2021. (Cited on page 6.) Yann LeCun et al. Lenet-5, convolutional neural networks. URL: http://yann. lecun. com/exd- b/lenet, 20(5):14, 2015. (Cited on page 13.) Soomin Lee and Angelia Nedic. Distributed random projection algorithm for convex optimization. IEEE Journal of Selected Topics in Signal Processing, 7(2):221–229, 2013. (Cited on page 2.) Shaojie Li and Yong Liu. High probability guarantees for nonconvex stochastic gradient descent with heavy tails. In International Conference on Machine Learning, pages 12931–12963. PMLR, 2022. (Cited on page 15.) Yao Li, Xiaorui Liu, Jiliang Tang, Ming Yan, and Kun Yuan. Decentralized composite optimization with compression. arXiv preprint arXiv:2108.04448, 2021. (Cited on page 2.) Zhi Li, Wei Shi, and Ming Yan. A decentralized proximal-gradient method with network indepen- dent step-sizes and separated convergence rates. IEEE Transactions on Signal Processing, 67 (17):4494–4506, 2019. (Cited on page 2.) Xiangru Lian, Ce Zhang, Huan Zhang, Cho-Jui Hsieh, Wei Zhang, and Ji Liu. Can decentralized algorithms outperform centralized algorithms? a case study for decentralized parallel stochastic gradient descent. Advances in Neural Information Processing Systems, 30, 2017. (Cited on pages 5 and 6.) Qing Ling and Zhi Tian. Decentralized sparse signal recovery for compressive sleeping wireless (Cited on IEEE Transactions on Signal Processing, 58(7):3816–3827, 2010. sensor networks. page 2.) Ji Liu and A Stephen Morse. Accelerated linear iterations for distributed averaging. Annual Reviews in Control, 35(2):160–165, 2011. (Cited on page 7.) Songtao Lu, Xinwei Zhang, Haoran Sun, and Mingyi Hong. Gnsd: A gradient-tracking based In 2019 IEEE Data Science nonconvex stochastic algorithm for decentralized optimization. Workshop (DSW), pages 315–321. IEEE, 2019. (Cited on page 6.) Yucheng Lu and Christopher De Sa. Optimal complexity in decentralized training. In International Conference on Machine Learning, pages 7111–7123. PMLR, 2021. (Cited on page 9.) Gabriel Mancino-ball, Shengnan Miao, Yangyang Xu, and Jie Chen. Proximal stochastic recursive momentum methods for nonconvex composite decentralized optimization. In AAAI Conference on Artificial Intelligence, 2023. (Cited on pages 2, 3, 5, 8, 12, 13, 14, 15, 18, 19, and 20.) Kostas Margellos, Alessandro Falsone, Simone Garatti, and Maria Prandini. Distributed con- strained optimization and consensus in uncertain networks via proximal minimization. IEEE Transactions on Automatic Control, 63(5):1372–1387, 2017. (Cited on page 2.) Gonzalo Mateos, Juan Andr ́es Bazerque, and Georgios B Giannakis. Distributed sparse linear regression. IEEE Transactions on Signal Processing, 58(10):5262–5276, 2010. (Cited on page 2.) 16 Aryan Mokhtari, Hamed Hassani, and Amin Karbasi. Conditional gradient method for stochastic submodular maximization: Closing the gap. In International Conference on Artificial Intelligence and Statistics, pages 1886–1895. PMLR, 2018. (Cited on page 5.) Angelia Nedic, Alex Olshevsky, and Wei Shi. Achieving geometric convergence for distributed optimization over time-varying graphs. SIAM Journal on Optimization, 27(4):2597–2633, 2017. (Cited on page 6.) Alex Olshevsky. Linear time average consensus and distributed optimization on fixed graphs. SIAM Journal on Control and Optimization, 55(6):3990–4014, 2017. (Cited on page 7.) Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alch ́e-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019. (Cited on page 13.) Stacy Patterson, Yonina C Eldar, and Idit Keidar. Distributed compressed sensing for static and time-varying networks. IEEE Transactions on Signal Processing, 62(19):4931–4946, 2014. (Cited on page 2.) Nhan H Pham, Lam M Nguyen, Dzung T Phan, and Quoc Tran-Dinh. Proxsarah: An efficient algorithmic framework for stochastic composite nonconvex optimization. The Journal of Machine Learning Research, 21(1):4455–4502, 2020. (Cited on page 2.) Shi Pu and Angelia Nedi ́c. Distributed stochastic gradient tracking methods. Mathematical Pro- gramming, 187(1):409–457, 2021. (Cited on page 6.) Guannan Qu and Na Li. Harnessing smoothness to accelerate distributed optimization. Transactions on Control of Network Systems, 5(3):1245–1260, 2017. (Cited on page 6.) IEEE Andrzej Ruszczy ́nski. A merit function approach to the subgradient method with averaging. Op- timisation Methods and Software, 23(1):161–172, 2008. (Cited on page 5.) Gesualdo Scutari and Ying Sun. Distributed nonconvex constrained optimization over time-varying digraphs. Mathematical Programming, 176(1):497–544, 2019. (Cited on page 2.) Wei Shi, Qing Ling, Gang Wu, and Wotao Yin. A proximal gradient algorithm for decentralized composite optimization. IEEE Transactions on Signal Processing, 63(22):6013–6023, 2015. (Cited on page 2.) Ying Sun, Gesualdo Scutari, and Amir Daneshmand. Distributed optimization based on gradient tracking revisited: Enhancing convergence rate via surrogation. SIAM Journal on Optimization, 32(2):354–385, 2022. (Cited on page 2.) Hanlin Tang, Xiangru Lian, Ming Yan, Ce Zhang, and Ji Liu. d2: Decentralized training over decentralized data. In International Conference on Machine Learning, pages 4848–4856. PMLR, 2018. (Cited on page 6.) 17 Hoi-To Wai. On the convergence of consensus algorithms with markovian noise and gradient bias. In 2020 59th IEEE Conference on Decision and Control (CDC), pages 4897–4902. IEEE, 2020. (Cited on page 15.) Zhe Wang, Kaiyi Ji, Yi Zhou, Yingbin Liang, and Vahid Tarokh. Spiderboost and momentum: Faster variance reduction algorithms. Advances in Neural Information Processing Systems, 32, 2019. (Cited on page 2.) Zhiguo Wang, Jiawei Zhang, Tsung-Hui Chang, Jian Li, and Zhi-Quan Luo. Distributed stochastic consensus optimization with momentum for nonconvex nonsmooth problems. IEEE Transactions on Signal Processing, 69:4486–4501, 2021. (Cited on pages 2, 3, 14, 20, and 32.) Xuyang Wu and Jie Lu. A unifying approximate method of multipliers for distributed composite optimization. IEEE Transactions on Automatic Control, 2022. (Cited on page 2.) Ran Xin, Subhro Das, Usman A Khan, and Soummya Kar. A stochastic proximal gradient frame- work for decentralized non-convex composite optimization: Topology-independent sample com- plexity and communication efficiency. arXiv preprint arXiv:2110.01594, 2021a. (Cited on pages 2, 3, 5, 8, 14, and 20.) Ran Xin, Usman A Khan, and Soummya Kar. An improved convergence analysis for decentralized online stochastic non-convex optimization. IEEE Transactions on Signal Processing, 69:1842– 1858, 2021b. (Cited on page 9.) Jinming Xu, Shanying Zhu, Yeng Chai Soh, and Lihua Xie. Augmented distributed gradient methods for multi-agent optimization under uncoordinated constant stepsizes. In 2015 54th IEEE Conference on Decision and Control (CDC), pages 2055–2060. IEEE, 2015. (Cited on page 6.) Jinming Xu, Ye Tian, Ying Sun, and Gesualdo Scutari. Distributed algorithms for composite opti- mization: Unified framework and convergence analysis. IEEE Transactions on Signal Processing, 69:3555–3570, 2021. (Cited on page 2.) Haishan Ye, Ziang Zhou, Luo Luo, and Tong Zhang. Decentralized accelerated proximal gradient descent. Advances in Neural Information Processing Systems, 33:18308–18317, 2020. (Cited on page 2.) Jinshan Zeng and Wotao Yin. On nonconvex decentralized gradient descent. IEEE Transactions on signal processing, 66(11):2834–2848, 2018. (Cited on page 2.) Jiaqi Zhang and Keyou You. Decentralized stochastic gradient tracking for non-convex empirical risk minimization. arXiv preprint arXiv:1909.02712, 2019. (Cited on page 6.) A Experimental Details All experiments are conducted on a laptop with Intel Core i7-11370H Processor and Windows 11 operating system. The total iteration numbers for a9a and MNIST are 10000 and 3000 respec- tively. The graph that represents the network topology is set to be ring (or cycle in graph theory) for a9a and random graph (given by Mancino-ball et al. [2023]) for MNIST (See Figure 3). To 18 demonstrate the performance of our algorithms in a constant batch size setting, the batch sizes are chosen to be 4 for a9a and 32 for MNIST in all algorithms. We adjust the learning rates provided in the code of Mancino-ball et al. [2023] accordingly and select the ones that have the best per- formance. For Prox-DASA and Prox-DASA-GT we choose a diminishing stepsize sequence, namely, αk = min (cid:8)α(cid:112) n k , 1(cid:9) for all k ≥ 0. Note that the same complexity (up to logarithmic factors) bounds can be obtained by directly plugging in the aforementioned expressions for αk in Section 4.3. Then we tune γ ∈ {1, 3, 10} and α ∈ {0.3, 1.0, 3.0}. The penalty parameter λ is chosen to be 0.0001 for all experiments. We summarize the outputs of all experiments in Table 2, from which we can tell Prox-DASA and Prox-DASA-GT achieve good performance in a relatively short amount of time. The stationarity is defined as ∥G( ̄xk, ∇F ( ̄xk), 1)∥2 + ∥Xk − ̄Xk∥2, which is the same as that in Mancino-ball et al. [2023]. As mentioned in the caption of Figure 2 in the main paper, there is an extra hyperparameter q in ProxGT-SR-E, and we found that large q already works well for a9a experiment, but q has to be small in the MNIST experiment otherwise the final accuracy will be much smaller than the one presented in Table 2. Hence in ProxGT-SR-E we choose q = 1000 for a9a and q = 32 for MNIST, and the plots that take this amount of epochs into account are in Figure 4. Algorithm Accuracy Training Loss Stationarity Communication time per iteration (s) Computation time per iteration (s) Total time per iteration (s) Table 2: Comparisons between all algorithms SPPDM ProxGT-SR-E DEEPSTORM v2 Prox-DASA Prox-DASA-GT SPPDM ProxGT-SR-E DEEPSTORM v2 Prox-DASA Prox-DASA-GT 84.64% 76.38% 84.90% 84.71% 84.69% 76.54% 92.26% 94.52% 96.74% 96.84% 0.3340 0.6528 0.3274 0.3338 0.3342 0.7854 0.3042 0.1759 0.1469 0.1460 0.0174 0.0797 0.0029 0.0017 0.0017 0.0436 0.0250 0.0016 0.0081 0.0058 a9a MNIST 0.0260 0.0521 0.0525 0.0360 0.0390 0.1587 0.1771 0.1758 0.1912 0.1935 0.0305 0.0394 0.0398 0.0298 0.0301 0.1246 0.3368 0.2030 0.1299 0.1317 0.0565 0.0915 0.0923 0.0658 0.0691 0.2833 0.5139 0.3788 0.3211 0.3252 Figure 3: Network topology. The left represents the ring topology and the right represents (an instance of) the random graph. B Accelerated Consensus When the number of communication round m > 1, we can replace Wm with the Chebyshev mixing protocol described in Algorithm 3. Then, we have the following lemma. 19 (a) (b) (c) (d) (e) (f) Figure 4: Comparisons between SPPDM [Wang et al., 2021], ProxGT-SR-E [Xin et al., 2021a], DEEPSTORM [Mancino-ball et al., 2023], Prox-DASA 1, and Prox-DASA-GT 2. In each experiment ProxGT-SR-E computes 1 more epoch than other algorithms every q iterations. q is chosen to be 1000 for a9a and 32 for MNIST. Lemma 1. Suppose W satisfies Assumption 1. Let A0, Am be the input and output matrix of Algorithm 3 respectively. Then, we have (cid:13) (cid:13)Am − ̄Am (cid:13) (cid:13) ≤ 2 (cid:16) (cid:17)m (cid:13) (cid:13)A0 − ̄A0 (cid:13) (cid:13) . 1 − (cid:112)1 − ρ √ Hence, we obtain a linear convergence rate of (cid:0)1 − 1 − ρ(cid:1) instead of ρ. By virtue of that, we can set m = ⌈ 1√ 1−ρ ⌉ to obtain a topology-independent iteration complexity. C Convergence Analysis We present the complete proof in this section. In the sequel, ∥ * ∥ denotes the l2-norm for vectors and the Frobenius norm for matrices. ∥ * ∥2 denotes the spectral norm for matrices. 1 represents the all-one vector. We identify vectors at agent i in the subscript and use the superscript for the algorithm step. For example, the optimization variable of agent i at step k is denoted as xk i , and zk is the corresponding dual variable. We use uppercase bold letters to represent the matrix that i collects all the variables from agents (corresponding lowercase) as columns. To be specific, (cid:104) Xk = 1, . . . , xk xk n (cid:105) , Zk = (cid:104) 1 , . . . , zk zk n (cid:105) , Yk = (cid:104) 1 , . . . , yk yk n (cid:105) , Vk+1 = (cid:104) vk+1 1 , . . . , vk+1 n (cid:105) . We add an overbar to a letter to denote the average over all agents. For example, ̄xk = 1 n n (cid:88) i=1 xk i = 1 n Xk1, ̄Xk = [ ̄xk, . . . , ̄xk] = ̄xk1⊤ = 1 n Xk11⊤ 20 0.02.55.07.510.012.515.017.5Epoch4050607080Test accuracySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT0.02.55.07.510.012.515.017.5Epoch0.250.500.751.001.251.501.752.00Training lossSPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT0.02.55.07.510.012.515.017.5Epoch104103102101100101102StationaritySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT020406080100Epoch20406080100Test accuracySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT020406080100Epoch0.51.01.52.0Training lossSPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT020406080100Epoch103102101100101102StationaritySPPDMProxGT-SR-EDEEPSTORMv2Prox-DASAProx-DASA-GT Hence, the consensus errors for iterates {xk i } and dual variables {zk i } can be written as 1 n n (cid:88) i=1 (cid:13) (cid:13)xk (cid:13) i − ̄xk(cid:13) 2 (cid:13) (cid:13) = 1 n (cid:13) (cid:13)Xk − ̄Xk (cid:13) 2 , (cid:13) 1 n n (cid:88) i=1 (cid:13) (cid:13)zk (cid:13) i − ̄zk(cid:13) 2 (cid:13) (cid:13) = 1 n (cid:13) (cid:13)Zk − ̄Zk (cid:13) 2 . (cid:13) We denote L∇F = max 1≤i≤n {L∇Fi} for ease of presentation. Our proof heavily relies on the merit function below: W ( ̄xk, ̄zk) = Φ( ̄xk) − Φ∗ (cid:125) (cid:123)(cid:122) function value gap (cid:124) + Ψ( ̄xk) − η( ̄xk, ̄zk) (cid:125) (cid:123)(cid:122) primal convergence (cid:124) +λ (cid:13) (cid:13) (cid:13)∇F ( ̄xk) − ̄zk(cid:13) (cid:124) (cid:123)(cid:122) dual convergence 2 (cid:13) , (cid:13) (cid:125) where (cid:26) η(x, z) = min y∈Rd ⟨z, y − x⟩ + ∥y − x∥2 + Ψ(y) (cid:27) . 1 2γ C.1 Technical Lemmas Lemma 2. For any p, q, r ∈ N+ and matrix A ∈ Rp×q, B ∈ Rq×r, we have: ∥AB∥ ≤ min (cid:16) ∥A∥2 * ∥B∥, ∥A∥ * ∥B⊤∥2 (cid:17) . Lemma 3. Suppose W satisfies Assumption 1. For any m ∈ N+, we have (cid:13) (cid:13) Wm − (cid:13) (cid:13) 1n1⊤ n n (cid:13) (cid:13) (cid:13) (cid:13)2 ≤ ρm (8) (9) Lemma 4. Suppose we are given three sequences {an}∞ satisfying n=0, {bn}∞ n=0, {τn}∞ n=−1, and a constant r ak+1 ≤ rak + bk, ak ≥ 0, bk ≥ 0, 0 = τ−1 ≤ τk+1 ≤ τk ≤ 1, (10) for all k ≥ 0. Then for any K > 0, we have K (cid:88) k=0 τkak ≤ 1 1 − r (cid:32) τ0a0 + (cid:33) τkbk K (cid:88) k=0 Proof. Note that we have (1 − r) K (cid:88) k=0 τkak ≤ K (cid:88) k=0 τk(ak − ak+1 + bk) = K (cid:88) k=0 (τk − τk−1)ak − τKaK+1 + K (cid:88) k=0 τkbk ≤ τ0a0 + K (cid:88) k=0 τkbk, where the inequalities use (10), and the equality uses summation by parts. Lemma 5. Let Ψ : Rd → R ∪ {+∞} be a closed proper convex function. (a) Let η(x, z) be the function defined in (9). Then, ∇η is Cγ-Lipschitz continuous where (cid:114) Cγ = 2 (1 + 1 γ )2 + (1 + γ 2 )2. 21 (11) (b) For x, z ∈ Rd and γ ∈ R, let y+ = proxγ Ψ(x−γz) = arg min y∈Rd (cid:110) ⟨z, y − x⟩ + 1 (cid:111) 2γ ∥y − x∥2 + Ψ(y) , then for any y ∈ Rd, we have Ψ(y+) − Ψ(y) ≤ (cid:10)z + γ−1(y+ − x), y − y+ (cid:11) Proof. We prove (a) at first. Recall that the Moreau envelope of a convex and closed function Ψ multiplied by a scalar γ is defined by envγΨ(x) = min y∈Rd (cid:26) 1 2γ ∥y − x∥2 + Ψ(y) (cid:27) , and its gradient is given by ∇envγΨ(x) = 1 γ (x−proxγ Ψ(x)) where proxγ Ψ(x) = arg min y∈Rd (cid:110) 1 2γ ∥y − x∥2 + Ψ(y) (cid:111) . Note that η(x, z) = envγΨ (x − γz) − γ ∇xη(x, z) = −z − γ−1 (cid:0)proxγ 2 ∥z∥2. Therefore, the partial gradients of η are given by Ψ (x − γz) − x(cid:1) , ∇zη(x, z) = proxγ Ψ (x − γz) − x. (12) Hence, for any (x, z) and (x′, z′), (cid:13)∇η(x, z) − ∇η(x′, z′)(cid:13) (cid:13) (cid:13) ≤ (cid:13) (cid:13)∇xη(x, z) − ∇xη(x′, z′)(cid:13) ≤ 2(1 + 1/γ) (cid:13) (cid:13)x − x′(cid:13) (cid:13) + (cid:13) (cid:13) + (2 + γ) (cid:13) (cid:13)∇zη(x, z) − ∇zη(x′, z′)(cid:13) (cid:13) (cid:13)(x, z) − (x′, z′)(cid:13) (cid:13) (cid:13)z − z′(cid:13) (cid:13) . (cid:13) ≤ Cγ To prove (b), denote the subdifferential of Ψ(x) as ∂Ψ(x). By the optimality condition, we have 0 is a subgradient of H(y) = ⟨z, y − x⟩ + 1 2γ ∥y − x∥2 + Ψ(y) at y+, i.e., 0 ∈ z + γ−1(y+ − x) + ∂Ψ(y+). Hence, there exists a subgradient of Ψ(y) at y+, denoted by ̃∇Ψ(y+), such that Finally, by the convexity of Ψ, we have for any y ∈ Rd, ̃∇Ψ(y+) = −z − γ−1(y+ − x). Ψ(y) − Ψ(y+) ≥ (cid:68) ̃∇Ψ(y+), y − y+ (cid:69) = (cid:10)−z − γ−1(y+ − x), y − y+ (cid:11) , which completes the proof. C.2 Building Blocks of Main Proof The following lemma connects the consensus error of Y to the consensus errors of X and Z. Lemma 6. Let yk + = prox( ̄xk − γ ̄zk). Then for any k ≥ 0 and γ > 0, we have (cid:13) (cid:13)yk (cid:13) + − ̄yk(cid:13) 2 (cid:13) (cid:13) + 1 n (cid:13) (cid:13)Yk − ̄Yk (cid:13) 2 = (cid:13) 1 n n (cid:88) i=1 (cid:13) (cid:13)yk (cid:13) i − yk + (cid:13) 2 (cid:13) (cid:13) ≤ 2 n (cid:8)∥Xk − ̄Xk∥2 + γ2∥Zk − ̄Zk∥2(cid:9) . 22 Proof. By the non-expansiveness of proximal operator, we have ∥yk i − yk +∥ ≤ ∥xk i − ̄xk − γ (cid:16) i − ̄zk(cid:17) zk ∥ ≤ ∥xk i − ̄xk∥ + γ∥zk i − ̄zk∥. Hence we know the consensus error of y can be bounded ∥Yk − ̄Yk∥2 = 1 n n (cid:88) i=1 ∥yk i − ̄yk∥2 = 1 n n (cid:88) i=1 ∥yk i − yk + + 1 n n (cid:88) (yk + − yk j )∥2 j=1 n (cid:88) i=1 ∥yk i − yk +∥2 − ∥ 1 n n (cid:88) (cid:16) j=1 j − yk yk + (cid:17) ∥2 ≤ 1 n n (cid:88) i=1 ∥yk i − yk +∥2 (cid:8)∥Xk − ̄Xk∥2 + γ2∥Zk − ̄Zk∥2(cid:9) 1 n 1 n 2 n = ≤ (13) (14) where the third equality uses the fact that 1 n n (cid:88) i=1 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) vi −   1 n n (cid:88) j=1 vj for any vectors vi (1 ≤ i ≤ n).   (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) = 1 n n (cid:88) i=1 ∥vi∥2 − (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 1 n n (cid:88) j=1 vj (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) The following technical lemma explicitly characterizes the consensus error. Lemma 7 (Conensus Error of Algorithm 1: Prox-DASA). Suppose Assumptions 1, 4, 5, 6, and 7 hold. Let ρ(m) = (1+ρ2m)ρ2m (1−ρ2m)2 , and ρ, m and αk satisfy ρ(m)α2 k ≤ min (cid:26) 1 8 , 1 24L2 ∇F γ2 (cid:27) , 0 = α−1 ≤ αk+1 ≤ αk ≤ 1 (15) for any k ≥ 0. Then in Algorithm 1 for any p ≥ 0, we have K (cid:88) k=0 αp k n E (cid:2)∥Xk − ̄Xk∥2(cid:3) ≤ 4γ2(σ2 + 3L2 ∇F ν2)ρ(m) K (cid:88) αp+2 k , K (cid:88) k=0 αp k n E (cid:2)∥Zk − ̄Zk∥2(cid:3) ≤ 4(σ2 + 3L2 ∇F ν2)ρ(m) Proof. By Assumption 1, the iterates in Algorithm 1 satisfy k=0 K (cid:88) αp+2 k , . k=0 Xk+1 = (1 − αk)XkWm + αkYkWm, ̄xk+1 = (1 − αk) ̄xk + αk ̄yk, Zk+1 = (1 − αk)ZkWm + αkVk+1Wm, ̄zk+1 = (1 − αk) ̄zk + αk ̄vk+1. (16) Hence, for the consensus error of iterates {xk i }, we have (cid:13) 2 (cid:13) (cid:13) (cid:13)Xk+1 − ̄Xk+1 (cid:13) (cid:18) (cid:13) (1 − αk) (cid:0)Xk − ̄Xk (cid:13) (cid:13) = (cid:1) + αk (cid:0)Yk − ̄Yk (cid:1) (cid:19) (cid:18) Wm − 11⊤ n (cid:19)(cid:13) 2 (cid:13) (cid:13) (cid:13) 23 (cid:26)(cid:18) 1 + (cid:19) 1 − ρ2m 2ρ2m (1 − αk)2 (cid:13) (cid:13)Xk − ̄Xk (cid:13) 2 + (cid:13) (cid:18) 1 + (cid:19) 2ρ2m 1 − ρ2m α2 k (cid:13) (cid:13)Yk − ̄Yk (cid:13) 2 (cid:13) (cid:27) ρ2m (1 + ρ2m) 2 (cid:13) (cid:13)Xk − ̄Xk (cid:13) 2 + (cid:13) (1 + ρ2m)ρ2m 1 − ρ2m α2 k (cid:13) (cid:13)Yk − ̄Yk (cid:13) 2 , (cid:13) (17) ≤ ≤ where the first inequality uses Lemma 2 and 3. Combining (15), (17), and Lemma 6, we have E (cid:2)∥Xk+1 − ̄Xk+1∥2(cid:3) ≤ = (1 + ρ2m) 2 (3 + ρ2m) 4 E (cid:2)∥Xk − ̄Xk∥2(cid:3) + E (cid:2)∥Xk − ̄Xk∥2(cid:3) + (1 − ρ2m) 4 (1 − ρ2m)γ2 4 E (cid:2)∥Zk − ̄Zk∥2(cid:3) E (cid:2)∥Xk − ̄Xk∥2 + γ2∥Zk − ̄Zk∥2(cid:3) Using Lemma 4 in the above inequality with τk = αp k n for any fixed p ≥ 0 we know K (cid:88) k=0 αp k n E (cid:2)∥Xk − ̄Xk∥2(cid:3) ≤ K (cid:88) k=0 γ2αp k n E (cid:2)∥Zk − ̄Zk∥2(cid:3) . (18) Similarly to (17), we can obtain the following results on the consensus error of dual variables {zk i }: (cid:13) (cid:13)Zk+1 − ̄Zk+1 (cid:13) 2 ≤ (cid:13) (1 + ρ2m) 2 (cid:13) (cid:13)Zk − ̄Zk (cid:13) 2 + (cid:13) (1 + ρ2m)ρ2m 1 − ρ2m α2 k (cid:13) (cid:13)Vk+1 − ̄Vk+1 (cid:13) 2 , (cid:13) (19) Using (15) and Lemma 4 in (19) with τk = αp k n , we have K (cid:88) k=0 αp k n E (cid:2)∥Zk − ̄Zk∥2(cid:3) ≤ 2ρ(m) K (cid:88) k=0 αp+2 k n E (cid:2)∥Vk+1 − ̄Vk+1∥2(cid:3) . (20) To bound ∥Vk+1 − ̄Vk+1∥ we first notice that i − ̄vk+1 =vk+1 vk+1 i − E (cid:104) vk+1 i |Fk (cid:105) − 1 n n (cid:88) (vk+1 j − E (cid:104) vk+1 j |Fk (cid:105) ) j=1 +E (cid:104) vk+1 i |Fk (cid:105) − ∇Fi( ̄xk) + ∇Fi( ̄xk) − ∇F ( ̄xk) + ∇F ( ̄xk) − 1 n n (cid:88) (cid:104) E (cid:105) vk+1 j |Fk j=1 (cid:18) = 1 − (cid:18) + 1 − 1 n 1 n (cid:19) (vk+1 i − E (cid:104) vk+1 i |Fk (cid:105) ) − (vk+1 j − E (cid:104) vk+1 j |Fk (cid:105) ) 1 n (cid:88) j̸=i (cid:19) (cid:16) ∇Fi(xk i ) − ∇Fi( ̄xk) (cid:17) + ∇Fi( ̄xk) − ∇F ( ̄xk) + 1 n (cid:88) (cid:16) (cid:17) ∇Fj( ̄xk) − ∇Fi(xk j ) j̸=i which gives (cid:104) ∥vk+1 E i − ̄vk+1∥2(cid:105) (cid:104) 1 n ∥vk+1 (cid:19)2 E i − E (cid:18) = 1 − (cid:104) vk+1 i |Fk (cid:105) ∥2(cid:105) + 1 n2 n (cid:88) (cid:104) E j̸=i 24 ∥vk+1 j − E (cid:104) vk+1 j |Fk (cid:105) ∥2(cid:105) + 1 − (cid:18) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:19) (cid:16) 1 n ∇Fi(xk (cid:17) i ) − ∇Fi( ̄xk) + ∇Fi( ̄xk) − ∇F ( ̄xk) + 1 n (cid:88) (cid:16) ∇Fj( ̄xk) − ∇Fi(xk j ) (cid:17) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ≤σ2 + 3L2 ∇F  (cid:18)  1 − (cid:19)2 1 n ∥xk i − ̄xk∥2 + ν2 + 1 n (cid:88) j̸=i j̸=i  ∥xk j − ̄xk∥2  , where the first equality uses Assumption 5, and the second inequality uses Cauchy-Schwarz in- equality, Assumptions 2, 6, and 7. Hence we have E (cid:2)∥Vk+1 − ̄Vk+1∥2(cid:3) ≤ 6L2 ∇F E (cid:2)∥Xk − ̄Xk∥2(cid:3) + nσ2 + 3nL2 ∇F ν2. (21) Combining (20) and (21), we have K (cid:88) k=0 αp k n E (cid:2)∥Zk − ̄Zk∥2(cid:3) ≤2ρ(m) (cid:40) K (cid:88) k=0 6L2 ∇F αp+2 n k E (cid:2)∥Xk − ̄Xk∥2(cid:3) + (σ2 + 3L2 ∇F ν2) (cid:41) αp+2 k K (cid:88) k=0 ≤ ≤ K (cid:88) k=0 K (cid:88) k=0 (cid:8)12ρ(m)α2 kL2 ∇F γ2(cid:9) αp k nγ2 E (cid:2)∥Xk − ̄Xk∥2(cid:3) + 2(σ2 + 3L2 ∇F ν2)ρ(m) K (cid:88) k=0 αp+2 k αp k 2n E (cid:2)∥Zk − ̄Zk∥2(cid:3) + 2(σ2 + 3L2 ∇F ν2)ρ(m) K (cid:88) k=0 αp+2 k , where the second inequality uses (15). By (18) and (22) we can finally obtain that K (cid:88) k=0 αp k n E (cid:2)∥Xk − ̄Xk∥2(cid:3) ≤ 4γ2(σ2 + 3L2 ∇F ν2)ρ(m) K (cid:88) k=0 αp k n E (cid:2)∥Zk − ̄Zk∥2(cid:3) ≤ 4(σ2 + 3L2 ∇F ν2)ρ(m) K (cid:88) k=0 K (cid:88) k=0 αp+2 k , , αp+2 k , . (22) (23) (24) Lemma 8 (Conensus Error of Algorithm 2: Prox-DASA-GT). Suppose Assumptions 1, 4, 6 and 5 hold. Let ρ(m) = (1+ρ2m)ρ2m (1−ρ2m)2 , and ρ, m and αk satisfy ρ(m)α2 k ≤ 1 8 , ρ(m)αk ≤ 1 9L∇F γ , 0 = α−1 ≤ αk+1 ≤ αk ≤ 1 (25) for any k ≥ 0, and the initialization satisfies u0 p ≥ 0 we have i = v0 i = 0 for all i. Then in Algorithm 2 for any K (cid:88) k=0 K (cid:88) k=0 αp k n αp k n E (cid:2)∥Xk − ̄Xk∥2(cid:3) ≤ 40γ2ρ(m)2 αp+2 k (cid:110) ∇F α2 L2 k (cid:104) ∥ ̄xk − ̄yk∥2(cid:105) + 2σ2(cid:111) , E K (cid:88) k=0 E (cid:2)∥Zk − ̄Zk∥2(cid:3) ≤ 40ρ(m)2 K (cid:88) k=0 αp+2 k (cid:110) ∇F α2 L2 k (cid:104) ∥ ̄xk − ̄yk∥2(cid:105) + 2σ2(cid:111) . E 25 Proof. The updates in Algorithm 2 take the form: Xk+1 = (1 − αk)XkWm + αkYkWm, ̄xk+1 = (1 − αk) ̄xk + αk ̄yk, Uk+1 = UkWm + (Vk+1 − Vk)Wm, ̄uk+1 = ̄uk + ̄vk+1 − ̄vk, Zk+1 = (1 − αk)ZkWm + αkUkWm, ̄zk+1 = (1 − αk) ̄zk + αk ̄uk. (26) Setting u0 i = v0 we first notice: i , we can prove by induction that ̄uk = ̄vk. To analyze the consensus error of Uk, Uk+1 − ̄Uk+1 Uk − ̄Uk + Vk+1 − Vk − ̄Vk+1 + ̄Vk(cid:17) (cid:18) (cid:16) = Wm − (cid:18) Uk − ̄Uk + (Vk+1 − Vk) = (cid:18) I − 11⊤ n (cid:19)(cid:19) (cid:18) Wm − which gives (cid:19) (cid:19) 11⊤ n 11⊤ n ∥Uk+1 − ̄Uk+1∥2 (cid:26)(cid:18) (cid:19) 1 − ρ2m 2ρ2m 1 + ≤ (cid:13) (cid:13)Uk − ̄Uk (cid:13) 2 + (cid:13) (cid:18) 1 + (cid:19) 2ρ2m 1 − ρ2m ∥Vk+1 − Vk∥2 (cid:27) ρ2m = (1 + ρ2m) 2 (cid:13) (cid:13)Uk − ̄Uk (cid:13) 2 + (cid:13) (1 + ρ2m)ρ2m 1 − ρ2m ∥Vk+1 − Vk∥2 . Using Lemma 4, we know for any k ≥ 0 and p ≥ 0, K (cid:88) k=0 αp k∥Uk − ̄Uk∥2 ≤ 2ρ(m) K (cid:88) k=0 αp k ∥Vk+1 − Vk∥2 . (27) Note that we also have Vk+1 − Vk =Vk+1 − E [Vk+1|Fk] − (Vk − E [Vk|Fk−1]) + E [Vk+1|Fk] − ∇F( ̄xk) + ∇F( ̄xk) − ∇F( ̄xk−1) + ∇F( ̄xk−1) − E [Vk|Fk−1] where we overload the notation and define ∇F(x) = [∇F1(x), ..., ∇Fn(x)]. Hence we know E (cid:2)∥Vk+1 − Vk∥2(cid:3) (cid:26) E (cid:2)∥Vk+1 − E [Vk+1|Fk] ∥2(cid:3) + E (cid:2)∥Vk − E [Vk|Fk−1] ∥2(cid:3) + E ≤5 ∥∇Fi(xk i ) − ∇Fi( ̄xk)∥2 (cid:35) (cid:34) n (cid:88) i=1 (cid:35) (cid:27) (cid:34) n (cid:88) +E ∥∇Fi( ̄xk) − ∇Fi( ̄xk−1)∥2 + E (cid:35) (cid:34) n (cid:88) ∥∇Fi(xk−1 i ) − ∇Fi( ̄xk−1)∥2 (cid:16) ≤5 i=1 2nσ2 + L2 ∇F E (cid:104) ∥Xk − ̄Xk∥2 + ∥Xk−1 − ̄Xk−1∥2 + nα2 k−1∥ ̄xk−1 − ̄yk−1∥2(cid:105)(cid:17) i=1 (28) 26 where the first inequality uses Cauchy-Schwarz inequality, and the second inequality uses Lipschitz continuity of ∇fi and (26). For simplicity we set x−1 i = 0 for all i so that it is easy to check the above inequality holds for all k ≥ 0. Using (27) and (28) we know: i = y−1 K (cid:88) k=0 αp k n ∥Uk − ̄Uk∥2 (29) ≤ 10ρ(m) n (cid:16) αp k K (cid:88) k=0 ≤ 20L2 ∇F ρ(m) n K (cid:88) k=0 2nσ2 + L2 ∇F E (cid:104) ∥Xk − ̄Xk∥2 + ∥Xk−1 − ̄Xk−1∥2 + nα2 k−1∥ ̄xk−1 − ̄yk−1∥2(cid:105)(cid:17) . αp k E (cid:2)∥Xk − ̄Xk∥2(cid:3) + 10L2 ∇F ρ(m) αp+2 k E ∥ ̄xk − ̄yk∥2(cid:105) (cid:104) + 20σ2ρ(m) K (cid:88) k=0 K (cid:88) k=0 αp k, (30) where the third inequality uses (25). For other consensus error terms we follow the same proof in Lemma 7 to get (cid:13) 2 ≤ (cid:13) 2 ≤ 2((cid:13) (cid:13) (cid:13) (cid:13) (cid:13)Xk+1 − ̄Xk+1 (cid:13) (cid:13)Yk − ̄Yk (cid:13) (cid:13)Zk+1 − ̄Zk+1 (cid:13) 2 ≤ (cid:13) (cid:13) 2 + (cid:13) (1 + ρ2m) 2 (cid:13) (cid:13)Xk − ̄Xk 2 + γ2 (cid:13) (cid:13) (cid:13)Xk − ̄Xk (cid:13) (1 + ρ2m) 2 (cid:13) (cid:13)Zk − ̄Zk (cid:13)Zk − ̄Zk (cid:13) 2 + (cid:13) (cid:13) 2), (cid:13) (1 + ρ2m)ρ2m 1 − ρ2m α2 k (1 + ρ2m)ρ2m 1 − ρ2m α2 k (cid:13) (cid:13)Yk − ̄Yk (cid:13) 2 , (cid:13) (cid:13) (cid:13)Uk − ̄Uk (cid:13) 2 . (cid:13) Hence we know (18) still holds: K (cid:88) k=0 αp k n E (cid:2)∥Xk − ̄Xk∥2(cid:3) ≤ K (cid:88) k=0 γ2αp k n E (cid:2)∥Zk − ̄Zk∥2(cid:3) . Applying Lemma (4) in (33) with τk = αp k n , we have K (cid:88) k=0 αp k n E (cid:2)∥Zk − ̄Zk∥2(cid:3) ≤ 2ρ(m) K (cid:88) k=0 αp+2 k n E (cid:2)∥Uk − ̄Uk∥2(cid:3) . The above two inequalities together with (30) and (25) imply (31) (32) (33) (34) (35) K (cid:88) k=0 K (cid:88) ≤ ≤ k=0 K (cid:88) 1 2 k=0 αp k n E (cid:2)∥Xk − ̄Xk∥2(cid:3) ≤ 2ρ(m)γ2 K (cid:88) k=0 αp+2 k n E (cid:2)∥Uk − ̄Uk∥2(cid:3) (cid:8)40L2 ∇F γ2ρ(m)2α2 k (cid:9) αp k n E (cid:2)∥Xk − ̄Xk∥2(cid:3) + 20γ2ρ(m)2 K (cid:88) k=0 αp+2 k (cid:110) ∇F α2 L2 k ∥ ̄xk − ̄yk∥2(cid:105) (cid:104) + 2σ2(cid:111) E αp k n E (cid:2)∥Xk − ̄Xk∥2(cid:3) + 20γ2ρ(m)2 K (cid:88) k=0 αp+2 k (cid:110) ∇F α2 L2 k (cid:104) ∥ ̄xk − ̄yk∥2(cid:105) + 2σ2(cid:111) , E which gives K (cid:88) k=0 αp k n E (cid:2)∥Xk − ̄Xk∥2(cid:3) ≤ 40γ2ρ(m)2 K (cid:88) k=0 27 αp+2 k (cid:110) ∇F α2 L2 k (cid:104) ∥ ̄xk − ̄yk∥2(cid:105) + 2σ2(cid:111) . E (36) Combining (25), (30), (35), and (36), we obtain that K (cid:88) k=0 1 2γ2 ≤ αp k n E (cid:2)∥Zk − ̄Zk∥2(cid:3) ≤ 2ρ(m) K (cid:88) k=0 αp+2 k n E (cid:2)∥Uk − ̄Uk∥2(cid:3) K (cid:88) k=0 αp k n E (cid:2)∥Xk − ̄Xk∥2(cid:3) + 20ρ(m)2 K (cid:88) k=0 αp+2 k (cid:110) ∇F α2 L2 k (cid:104) ∥ ̄xk − ̄yk∥2(cid:105) + 2σ2(cid:111) , E ≤40ρ(m)2 K (cid:88) k=0 αp+2 k (cid:110) ∇F α2 L2 k (cid:104) ∥ ̄xk − ̄yk∥2(cid:105) + 2σ2(cid:111) . E Lemma 9 (Basic Inequalities of Dual Convergence). δk = ∇F ( ̄xk) − ∇F ( ̄xk+1) αk + 1 n n (cid:88) i=1 Under Assumption 2, we have ∇Fi(xk i ) − ∇F ( ̄xk), ̄∆k+1 = ̄vk+1 − 1 n n (cid:88) i=1 ∇Fi(xk i ). (37) ∥ ̄zk+1−∇F ( ̄xk+1)∥2 ≤ (1 − αk) + 2L2 ∇F αk n (cid:13) (cid:13)Xk − ̄Xk and (cid:13) (cid:13) ̄zk − ∇F ( ̄xk) (cid:13) (cid:68) (cid:13) 2 + 2 (cid:13) (cid:13) 2 (cid:13) (cid:13) αk ̄∆k+1, (1 − αk) (cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) ̄xk − ̄yk(cid:13) (cid:17) ̄zk − ∇F ( ̄xk) ̄∆k+1(cid:13) (cid:13) 2 + α2 (cid:13) (cid:13) (cid:13) (cid:13) k + αkδk(cid:69) , (38) (cid:16) + 2L2 ∇F αk (cid:13) (cid:13) (cid:13) ̄zk+1 − ̄zk(cid:13) 2 (cid:13) (cid:13) (cid:26) 2 ≤ α2 k (cid:13) (cid:13) (cid:13)∇F ( ̄xk) − ̄zk(cid:13) 2 (cid:13) (cid:13) + 2L2 ∇F n (cid:13) (cid:13)Xk − ̄Xk (cid:42) (cid:13) 2 + (cid:13) ̄∆k+1(cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) + 2 ̄∆k+1, ∇Fi(xk i ) − ̄zk (39) (cid:43) (cid:27) . 1 n n (cid:88) i=1 Proof. By definitions in (37), we have ̄zk+1 − ∇F ( ̄xk+1) = (1 − αk) (cid:16) ̄zk − ∇F ( ̄xk) (cid:17) + αkδk + αk ̄∆k+1, Hence, we can get (cid:13) (cid:13) ̄zk+1 − ∇F ( ̄xk+1) (cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:16) = (cid:17) ̄zk − ∇F ( ̄xk) (cid:13) (cid:13) (cid:13)(1 − αk) (cid:13) (cid:13) ̄zk − ∇F ( ̄xk) (cid:13) + αkδk(cid:13) 2 (cid:13) (cid:13) (cid:13)δk(cid:13) (cid:13) (cid:13) where the inequality uses the convexity of ∥ * ∥2. In addition, we have ̄∆k+1(cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) ̄∆k+1(cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) αk ̄∆k+1, (1 − αk) (cid:68) αk ̄∆k+1, (1 − αk) ≤ (1 − αk) + α2 k + α2 k + αk (cid:13) 2 (cid:13) (cid:13) 2 (cid:13) (cid:13) + 2 + 2 (cid:68) (cid:16) (cid:17) ̄zk − ∇F ( ̄xk) (cid:16) ̄zk − ∇F ( ̄xk) + αkδk(cid:69) (cid:17) + αkδk(cid:69) (cid:13) (cid:13) (cid:13)δk(cid:13) 2 (cid:13) (cid:13) ≤ 2 (cid:13) (cid:13) (cid:13) (cid:13) ∇F ( ̄xk) − ∇F ( ̄xk+1) αk (cid:13) 2 (cid:13) (cid:13) (cid:13) + 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 1 n n (cid:88) (cid:16) i=1 ∇Fi(xk (cid:17) i ) − ∇Fi( ̄xk) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 28 ≤ 2L2 ∇F (cid:13) (cid:13) (cid:13) ̄xk − ̄yk(cid:13) 2 (cid:13) (cid:13) + 2L2 ∇F n (cid:13) (cid:13)Xk − ̄Xk (cid:13) 2 , (cid:13) which completes the proof of (38). The inequality (39) can be proved similarly by noting that (cid:13) (cid:13) (cid:13) ̄zk+1 − ̄zk(cid:13) 2 (cid:13) (cid:13) = α2 k (cid:13) (cid:13) (cid:13)− ̄zk + ̄vk+1(cid:13) 2 (cid:13) (cid:13) = α2 k = α2 k (cid:32) (cid:13) (cid:13) (∇F ( ̄xk) − ̄zk) + (cid:13) (cid:13) (cid:13) (cid:26) (cid:13) (cid:13) (∇F ( ̄xk) − ̄zk) + (cid:13) (cid:13) (cid:13) ∇Fi(xk i ) − ∇Fi( ̄xk) (cid:33) (cid:17) 1 n n (cid:88) (cid:16) i=1 + αk ̄∆k+1 (cid:32) 1 n n (cid:88) (cid:16) i=1 ∇Fi(xk i ) − ∇Fi( ̄xk) (cid:17) (cid:33)(cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) + (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) ̄∆k+1(cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:42) + 2 ̄∆k+1, 1 n n (cid:88) i=1 ∇Fi(xk i ) − ̄zk (cid:43) (cid:27) . Lemma 10. Under Assumption 3, Ψ( ̄yk) − Ψ(yk +) ≤ ̄zk + γ−1( ̄yk − ̄xk), yk (cid:68) + − ̄yk(cid:69) + γ 2n (cid:13) (cid:13)Zk − ̄Zk (cid:13) 2 + (cid:13) γ−1 2n (cid:13) (cid:13)Xk − ̄Xk (cid:13) 2 . (cid:13) (40) Proof. By the convexity of Ψ and part (b) of Lemma 5, we have Ψ( ̄yk) − Ψ(yk +) cvx ≤ 1 n n (cid:88) (cid:16) i=1 Ψ(yk i ) − Ψ(yk +) (cid:17) Lemma 5 (b) ≤ 1 n n (cid:88) (cid:68) i=1 i + γ−1(yk zk i − xk i ), yk + − yk i (cid:69) (cid:68) (cid:68) = ≤ ̄zk + γ−1( ̄yk − ̄xk), yk + − ̄yk(cid:69) ̄zk + γ−1( ̄yk − ̄xk), yk + − ̄yk(cid:69) + + 1 n γ 2n i=1 (cid:13) (cid:13)Zk − ̄Zk (cid:13) 2 + (cid:13) 1 2nγ (cid:13) (cid:13)Xk − ̄Xk (cid:13) 2 . (cid:13) n (cid:88) (cid:68) i − ̄zk + γ−1(yk zk i − ̄yk + ̄xk − xk i ), ̄yk − yk i (cid:69) The equality above comes from the fact that for sequences {ai}1≤i≤n, {bi}1≤i≤n ∈ Rd, we have (cid:42) ai − n (cid:88) i=1 1 n n (cid:88) i=1 ai, bi − (cid:43) bi = 1 n n (cid:88) i=1 n (cid:88) i=1 ⟨ai, bi⟩ − (cid:33) (cid:32) (cid:32) 1 n n (cid:88) i=1 ai (cid:33) bi . 1 n n (cid:88) i=1 The last inequality above is obtained by Young's inequalities: (cid:68) i − ̄zk, ̄yk − yk zk i γ−1 (cid:68) ̄xk − xk i , ̄yk − yk i (cid:69) (cid:69) ≤ ≤ + i − ̄zk(cid:13) (cid:13) 2 (cid:13)zk (cid:13) (cid:13) (cid:13) i − ̄xk(cid:13) (cid:13) 2 (cid:13)xk (cid:13) (cid:13) (cid:13) γ 2 1 2γ i − ̄yk(cid:13) (cid:13) 1 2 (cid:13)yk (cid:13) (cid:13) , (cid:13) 2γ i − ̄yk(cid:13) (cid:13) 1 2 (cid:13)yk (cid:13) (cid:13) (cid:13) 2γ + . Lemma 11 (Basic Lemma of Merit Function Difference). Let W ( ̄xk, ̄zk) be the merit function de- fined in (8) with λ = γ−1 8L2 we have . Under Assumption 2, 3, for any k ≥ 0, setting αk ≤ min{ γ−1 8L∇F , γ−1 8Cγ ∇F , γ−1 32Cγ L2 }, ∇F Θk + Υk + αkΛk + rk+1(cid:111) (cid:110) , W ( ̄xk+1, ̄zk+1) − W ( ̄xk, ̄zk) ≤ −αk 29 where Θk = Υk = ∥ ̄xk − ̄yk∥2 + (cid:26) γ−1 4 2γ(1 + 4γ2L2 (cid:40) ∇F ) n (cid:42) rk+1 = ̄∆k+1, ̄xk − yk + + Cγαk (cid:13) (cid:13) (cid:13)∇F ( ̄xk) − ̄zk(cid:13) (cid:13) (cid:13) 2(cid:27) , Λk = (cid:26) Cγ + 2λ 2 λ 4 (cid:13) (cid:13)Zk − ̄Zk (cid:13) 2 + (cid:13) 2 (cid:0)γ−1 + 3γL2 n ∇F (cid:1) (cid:13) (cid:13)Xk − ̄Xk (cid:13) 2 (cid:13) , 2(cid:27) , ̄∆k+1(cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:41) (cid:32) 1 n n (cid:88) i=1 (cid:33) ∇Fi(xk i ) − ̄zk (cid:16) + 2λ (1 − αk) (cid:16) ̄zk − ∇F ( ̄xk) (cid:17) + αkδk(cid:17) (cid:43) . Proof. By the smoothness of F and η, we have F ( ̄xk+1) − F ( ̄xk) ∇F ( ̄xk), ̄xk+1 − ̄xk(cid:69) (cid:68) ≤ + L∇F 2 ∥ ̄xk+1 − ̄xk∥2 = −αk (cid:68) ∇F ( ̄xk), ̄xk − ̄yk(cid:69) + L∇F α2 k 2 ∥ ̄xk − ̄yk∥2 (41) (42) (cid:16) ∥ ̄xk+1 − ̄xk∥2 + ∥ ̄zk+1 − ̄zk∥2(cid:17) Cγ 2 η( ̄xk, ̄zk) − η( ̄xk+1, ̄zk+1) (cid:68) − ̄zk − γ−1(yk ≤ =2αk (cid:68) ̄zk, yk + − ̄xk(cid:69) + − ̄xk), ̄xk − ̄xk+1(cid:69) + γ−1αk∥ ̄xk − yk + (cid:68) + − ̄xk, ̄zk − ̄zk+1(cid:69) yk + ̄vk+1, ̄xk − ̄yk(cid:69) (cid:69) (cid:16) (cid:68) +∥2 + αk (cid:68) + αk ̄zk + γ−1(yk + − ̄xk) + ̄vk+1, ̄yk − yk + + k∥ ̄xk − ̄yk∥2 + ∥ ̄zk+1 − ̄zk∥2(cid:17) α2 . (43) Cγ 2 Since yk + is the minimizer of a 1/γ-strongly convex function, i.e., (cid:68) ̄zk, yk + − ̄xk(cid:69) + 1 2γ ∥yk + − ̄xk∥2 + Ψ(yk +) ≤ Ψ( ̄xk) − 1 2γ ∥yk + − ̄xk∥2, which together with (43) gives η( ̄xk, ̄zk) − η( ̄xk+1, ̄zk+1) +∥2 + αk (cid:17) ≤ − γ−1αk∥ ̄xk − yk (cid:16) + 2αk Ψ( ̄xk) − Ψ(yk +) + (cid:68) ̄vk+1, ̄xk − ̄yk(cid:69) Cγ 2 (cid:16) (cid:68) + αk ̄zk + γ−1(yk + − ̄xk) + ̄vk+1, ̄yk − yk + (cid:69) ∥ ̄xk+1 − ̄xk∥2 + ∥ ̄zk+1 − ̄zk∥2(cid:17) . By the convexity of Ψ, we have Ψ( ̄xk+1) − Ψ( ̄xk) ≤ (1 − αk)Ψ( ̄xk) + αkΨ( ̄yk) − Ψ( ̄xk) = αk (cid:16) (cid:17) Ψ( ̄yk) − Ψ( ̄xk i ) . Combining (42), (44), and (45), we have (cid:105) (cid:104) Φ( ̄xk+1) + Ψ( ̄xk+1) − η( ̄xk+1, ̄zk+1) (cid:105) (cid:104) Φ( ̄xk) + Ψ( ̄xk) − η( ̄xk, ̄zk) ≤ − γ−1αk∥ ̄xk − yk +∥2 + αk (cid:68) − ̄vk+1 − ∇F ( ̄xk), ̄xk − ̄yk(cid:69) + 2αk(Ψ( ̄yk) − Ψ(yk +)) (44) (45) (cid:68) + αk ̄zk + γ−1(yk + − ̄xk) + ̄vk+1, ̄yk − yk + (cid:69) + (L∇F + Cγ)α2 k 2 ∥ ̄xk − ̄yk∥2 + Cγ 2 ∥ ̄zk+1 − ̄zk∥2. (46) 30 Removing non-smooth terms in (46) using (40) in Lemma 10, and re-organizing (46) using the decomposition that ̄zk+1 − ̄zk = αk(− ̄zk + ̄vk+1) = αk(∇F ( ̄xk) − ̄zk) + αk( 1 i ) − n ∇Fi( ̄xk))) + αk ̄∆k+1, we can get i=1(∇Fi(xk (cid:80)n (cid:104) (cid:105) Φ( ̄xk+1) + Ψ( ̄xk+1) − η( ̄xk+1, ̄zk+1) − (cid:104) Φ( ̄xk) + Ψ( ̄xk) − η( ̄xk, ̄zk) (cid:105) (cid:26) ≤ γ−1αk − ∥ ̄xk − yk +∥2 + (cid:68) (yk + − ̄yk) + ( ̄xk − ̄yk), ̄yk − yk + (cid:123)(cid:122) κ1 (cid:69) (cid:27) (cid:125) (cid:124) + αk (cid:124) (cid:42) 1 n n (cid:88) (cid:16) i=1 ∇Fi(xk (cid:17) i ) − ∇Fi( ̄xk) , ̄xk − yk + (cid:123)(cid:122) κ2 (cid:43) + αk (cid:124) (cid:125) (cid:68) ∇F ( ̄xk) − ̄zk, ̄yk − yk + (cid:123)(cid:122) κ3 (cid:69) (cid:125) +αk (cid:68) ̄∆k+1, ̄xk − yk + (cid:69) (L∇F + Cγ)α2 k 2 ∥ ̄xk − ̄yk∥2 + Cγ 2 (cid:124) ∥ ̄zk+1 − ̄zk∥2 (cid:125) (cid:123)(cid:122) κ4 + γαk n (cid:13) (cid:13)Zk − ̄Zk (cid:13) 2 + (cid:13) γ−1αk n (cid:13) (cid:13)Xk − ̄Xk (cid:13) 2 . (cid:13) To further simplify the above inequalities, we analyze the terms κ1, κ2, κ3, κ4 separately as follows: κ1 =γ−1αk (cid:26) − (cid:13) (cid:13) (cid:13) ̄xk − ̄yk(cid:13) 2 (cid:13) (cid:13) (cid:68) ̄xk − ̄yk, ̄yk − yk + − (cid:69) − 2 (cid:13) (cid:13) ̄yk − yk (cid:13) + 2(cid:27) (cid:13) (cid:13) (cid:13) ≤ − 7γ−1αk 8 (cid:13) (cid:13) (cid:13) ̄xk − ̄yk(cid:13) 2 (cid:13) (cid:13) , n (cid:88) (cid:16) i=1 ∇Fi(xk i ) − ∇Fi( ̄xk) (cid:17) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) + γ−1αk 8 (cid:13) (cid:13) ̄xk − yk (cid:13) + (cid:13) 2 (cid:13) (cid:13) (cid:13) 2 + (cid:13) ∇F (cid:13) (cid:13)Xk − ̄Xk (cid:13)∇F ( ̄xk) − ̄zk(cid:13) 2 (cid:13) (cid:13) + γ−1αk 4 λ−1αk 2 (cid:13) (cid:13) (cid:13) ̄xk − ̄yk(cid:13) (cid:13) (cid:13) ̄yk − yk (cid:13) 2 (cid:13) (cid:13) (cid:13) 2 (cid:13) (cid:13) + , + γ−1αk 4 (cid:13) (cid:13) ̄yk − yk (cid:13) + (cid:13) 2 (cid:13) (cid:13) , κ2 ≤ 2γαk 1 n (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 2γαkL2 n (cid:13) (cid:13) λαk 2 Cγα2 k 2 (cid:40) 2 ≤ κ3 ≤ κ4 ≤ (cid:13) (cid:13) (cid:13)∇F ( ̄xk) − ̄zk(cid:13) 2 (cid:13) (cid:13) + 2L2 ∇F n (cid:13) (cid:13)Xk − ̄Xk (cid:13) 2 + (cid:13) ̄∆k+1(cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:42) + 2 ̄∆k+1, 1 n n (cid:88) i=1 (cid:43)(cid:41) ∇Fi(xk i ) − ̄zk . Combining the above results with (38) in Lemma 9 and the definition of W ( ̄xk, ̄zk) in (8), we have W ( ̄xk+1, ̄zk+1) − W ( ̄xk, ̄zk) ≤ αk (cid:26) + αk − λ 2 + Cγαk (cid:13) (cid:13)Zk − ̄Zk (cid:13) 2 + (cid:13) + γαk n (cid:42) (cid:27) (cid:13) (cid:13)∇F ( ̄xk) − ̄zk(cid:13) (cid:13) (cid:0)γ−1 + 2γL2 + αk ̄∆k+1, ̄xk − yk + + Cγαk (cid:124) (cid:26) − 5 8 γ−1 + (L∇F + Cγ)αk 2 Cγα2 ̄∆k+1(cid:13) (cid:13) 2 2 k (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 2 ∇F + 2λL2 ∇F + CγL2 n ∇F αk + + (cid:27) + 2λL2 ∇F ∥ ̄xk − ̄yk∥2 (γ−1 + 2λ−1)αk 4 (cid:13) (cid:13)yk (cid:13) + − ̄yk(cid:13) 2 (cid:13) (cid:13) (cid:1) αk (cid:13) (cid:13)Xk − ̄Xk (cid:13) 2 (cid:13) (cid:32) 1 n n (cid:88) i=1 (cid:33) ∇Fi(xk i ) − ̄zk (cid:123)(cid:122) rk+1 (cid:16) + 2λ (1 − αk) (cid:16) (cid:17) ̄zk − ∇F ( ̄xk) + αkδk(cid:17) (cid:43) . (cid:125) In addition, from Lemma 6, we already know (cid:13) (cid:13)yk (cid:13) + − ̄yk(cid:13) 2 (cid:13) (cid:13) ≤ 2 n (cid:8)∥Xk − ̄Xk∥2 + γ2∥Zk − ̄Zk∥2(cid:9) . 31 (47) Finally, choosing αk such that αk ≤ min{ γ−1 8L∇F the terms in (47) as , γ−1 8Cγ , γ−1 32Cγ L2 ∇F } and λ = γ−1 8L2 ∇F , we can re-organize W ( ̄xk+1, ̄zk+1) − W ( ̄xk, ̄zk) λ 4 (cid:123)(cid:122) Θk ∥ ̄xk − ̄yk∥2 + (cid:26) γ−1 4 ≤ − αk (cid:124) (cid:40) + αk (cid:124) 2γ(1 + 4γ2L2 ∇F ) n (cid:13) (cid:13)Zk − ̄Zk (cid:13) 2 + (cid:13) (cid:13) (cid:13) (cid:13)∇F ( ̄xk) − ̄zk(cid:13) (cid:13) (cid:13) 2(cid:27) +α2 k (cid:26) Cγ + 2λ 2 +αkrk ̄∆k+1(cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:123)(cid:122) Λk (cid:1) (cid:13) (cid:13)Xk − ̄Xk (cid:13) 2 (cid:13) 2(cid:27) (cid:125) (cid:41) , (cid:125) (cid:124) (cid:125) 2 (cid:0)γ−1 + 3γL2 n ∇F (cid:123)(cid:122) Υk which completes the proof. D Discussions In this section we briefly discuss two different functions that measure the consensus violation of vectors among agents. Suppose agent i has xi ∈ Rd, our consensus error (see, e.g., Definition 1) can be viewed as f (x1, ..., xn) = 1 n n (cid:88) i=1 ∥xi − ̄x∥2, where ̄x := 1 n (41) in Wang et al. [2021]) (cid:80)n i=1 xi, while SPPDM in Wang et al. [2021] defines (see Eq. (4a), (4b), (5a), (5b), and gW (x1, ..., xn) = (cid:88) ∥xi − xj∥2 i∼j,1≤i<j≤n 1 (cid:88) 2 i=j or i∼j = (cid:0)∥xi − ̄x∥2 + ∥xj − ̄x∥2 − 2 ⟨xi − ̄x, xj − ̄x⟩(cid:1) (48) over a connected network whose weighted adjacency matrix (i.e., mixing matrix) is W , and the stationarity therein is defined by using gW . i ∼ j means agents i and j are neighbors. Note that in general the relationship between f and gW largely depends on W . We consider several special cases: • W is a complete graph. By (48) we have gW (x1, ..., xn) = n n (cid:88) i=1 ∥xi − ̄x∥2 − (cid:42) n (cid:88) i=1 (xi − ̄x) , n (cid:88) j=1 (cid:43) (xj − ̄x) = n2f (x1, ..., xn). • W is a cycle. By (48) we have gW (x1, ..., xn) ≤ (cid:88) 2 (cid:0)∥xi − ̄x∥2 + ∥xj − ̄x∥2(cid:1) = 4nf (x1, ..., xn). i∼j,1≤i<j≤n 32 • W is a simple path such that i and i + 1 are adjacent for all 1 ≤ i ≤ n − 1, and xi = i ∈ R. Note that in this case we can directly obtain gW (x1, ..., xn) = n − 1. For f we have f (x1, ..., xn) = 1 n n (cid:88) i=1 (cid:18) n + 1 2 (cid:19)2 − i = Θ(n2), which implies gW = Θ( f n ). We know from the above examples that the order (in terms of n) of gW /f can range from 1 n to n2. Hence these two types of consensus error are not comparable if no additional assumptions are given, and thus we only include SPPDM in the experiments and do not have it in Table 1. 33
http://arxiv.org/abs/2305.01580v1
2023-02-20T05:11:53
2023-02-20T05:11:53
Molecular design method based on novel molecular representation and variational auto-encoder
Based on the traditional VAE, a novel neural network model is presented, with the latest molecular representation, SELFIES, to improve the effect of generating new molecules. In this model, multi-layer convolutional network and Fisher information are added to the original encoding layer to learn the data characteristics and guide the encoding process, which makes the features of the data hiding layer more aggregated, and integrates the Long Short Term Memory neural network (LSTM) into the decoding layer for better data generation, which effectively solves the degradation phenomenon generated by the encoding layer and decoding layer of the original VAE model. Through experiments on zinc molecular data sets, it is found that the similarity in the new VAE is 8.47% higher than that of the original ones. SELFIES are better at generating a variety of molecules than the traditional molecular representation, SELFIES. Experiments have shown that using SELFIES and the new VAE model presented in this paper can improve the effectiveness of generating new molecules.
[ "Li Kai", "Li Ning", "Zhang Wei", "Gao Ming" ]
10.5121/csit.2023.130303
[ { "@title": "doi", "@href": "http://dx.doi.org/10.5121/csit.2023.130303", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2305.01580v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2305.01580v1", "@rel": "related", "@type": "application/pdf" } ]
[ "4th International Conference on Natural Language Processing,\n Information Retrieval and AI (NIAI 2023), Volume 13, Number 03, February\n 2023, pp. 23-35, 2023. CS & IT - CSCP 2023" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "q-bio.BM", "@scheme": "http://arxiv.org/schemas/atom" }
[ "q-bio.BM", "cs.AI", "cs.LG" ]
MOLECULAR DESIGN METHOD BASED ON NEW MOLECULAR REPRESENTATION AND VARIATIONAL AUTO-ENCODER Li Kai, LiNing, Zhang Wei, Gao Ming D School of Computer Science+Beijing Advanced Innovation Center for Materials Genome Engineering, Beijing Information Science and Technology University, Beijing, China ABSTRACT Based on the traditional VAE, a novel neural network model is presented, with the latest molecular representation, SELFIES, to improve the effect of generating new molecules. In this model, multi-layer convolutional network and Fisher information are added to the original encoding layer to learn the data characteristics and guide the encoding process, which makes the features of the data hiding layer more aggregated, and integrates the Long Short Term Memory neural network (LSTM) into the decoding layer for better data generation, which effectively solves the degradation phenomenon generated by the encoding layer and decoding layer of the original VAE model. Through experiments on zinc molecular data sets, it is found that the similarity in the new VAE is 8.47% higher than that of the original ones. SELFIES are better at generating a variety of molecules than the traditional molecular representation, SELFIES. Experiments have shown that using SELFIES and the new VAE model presented in this paper can improve the effectiveness of generating new molecules. KEYWORDS VAE, Molecular notation, Multilayer convolutional network, Fisher information, LSTM 1. INTRODUCTION The discovery of new materials is a crucial driver of many recent technological advances, such as clean energy[1] and drug discovery[2]. New materials allow scientific research to advance, leading to the development of compounds and formulations with new uses, lower costs and better properties. The "similarity hypothesis" proposed by Johnson et al[3]. that compounds with similar structures have similar chemical properties and biological activities have greatly facilitated the discovery of new molecules. However, optimization in molecular space is extremely challenging because chemical searched spaces is huge, discrete, and unstructured[4]. By combining computers with chemistry, molecular information can be calculated, processed, stored and searched more quickly. In order for a computer to process chemical molecules more efficiently and obtain useful information, it is necessary to use a specific notation to represent the molecule as an input or output to the computer. Therefore, it is necessary to set the molecular descriptor as a string of characters and numbers. Each descriptor can represent the structure of the molecule (such as atomic number, bond number, etc.). SMILES[5] (Simplified Molecular Input Line Entry System) successfully solves the problems of molecular representation and recognition in computers by using simple grammar and two-dimensional molecular coding techniques. SMILES is a simple David C. Wyld et al. (Eds): NIAI, MoWiN, AIAP, SIGML, CNSA, ICCIoT - 2023 pp. 23-35, 2023. CS & IT - CSCP 2023 DOI: 10.5121/csit.2023.130303 24 Computer Science & Information Technology (CS & IT) string used for input and representation of molecular reactions. It is based on the principles of molecular graph theory and can describe molecular structures using simple rules. SMILES have since become a standard tool for chemical informatics. The rise of artificial intelligence and deep learning is a boon to cheminformatics because they can produce powerful probabilistic generation models that, after experimental calculations, can be simulated to efficiently generate new molecules with excellent properties [6]. These models typically use continuous strings, so generating models can work well with SMILES. However, this presents a key problem: a large proportion of the new SMILES strings generated by generating models are invalid. They may not be syntactically valid, i.e. the string cannot be converted to the corresponding molecular diagram; It may violate basic chemical principles. Many researchers have also proposed some solutions, such as adjusting the generation model to handle the inefficiency of the SMILES strings generated[7]. While this solves the problem of generating a specific model, it is not universal. Another approach is to change the definition of the SMILES strings themselves. O'Boyle et al.[8] invented that Deeps SMILES can be used as a direct input to most machine learning models, overcoming most problems with molecular synthesis and thus smoothly converting the resulting strings of legitimate molecular diagrams. However, it does not handle domain-specific semantic constraints. In the last two years, a string- based molecular SELFIES[9] (SELF-referencing Embedded Strings) invented by the Aspuru group can effectively solve this problem. In order to study whether the new molecular representation SELFIES can be combined with the deep learning model to produce a good result, this article will use this string to explore experimentally. The first chapter introduces the changes of the core points and methods of molecular design in the last 30 years, and introduces the idea of variational automatic encoder. The second chapter describe the characteristics of the new molecular representation SELFIES and discusses the advantages of the new Variational Auto-Encoders designed in this paper in the field of new molecular design. The third chapter introduce the experimental conditions and preparation and discusses the experimental results. The fourth chapter summarize the content of this paper and looks forward to the opportunities and challenges to chemical informatics. 2. RELATED WORK 2.1. Major Approaches to New Molecular Design Molecular similarity is a dynamic and developing field, and many researches have been made on molecular similarity. Willett et al.[10] reviewed molecular similarity and pointed out that similarity search is very important to chemical informatics. Sheridan et al.[11] have made a number of experimental demonstrations of molecular similarity. After a long time of experiments, people found that a lot of information can be found from the method and application of molecular similarity. However, when evaluating some molecules, the final results cannot be integrated due to the different representation or calculation methods of the data used, which brings many difficulties for the subsequent research. Therefore, molecular descriptors appear, which can be converted into topological descriptors to represent molecular structures, achieving the purpose of unified representation. SELFIES is a string-based molecular representation that works well for the computational problems posed by the structure of SMILES itself. The Aspuru group proved through experiments that each SELFIES can contain one effective molecule, which is 100% robust. Besides, SELFIES can be independent of the machine learning model so that you can directly use them as input without any modification to the model. They have also created a set of rules, based on SELFIES, to convert the commonly Computer Science & Information Technology (CS & IT) 25 used SMILES strings of SELFIES today, so that the molecule is absolutely valid before it reaches the encoder. After unifying the descriptors, researchers focus on calculating the similarity between two molecules. There are two commonly used methods. One is Euclidian distance[12], which is an international definition of distance and can represent the true distance between two molecules in chemical space. The other is the Tanimoto coefficient[13], which mainly calculates the similarity between individuals for the symbolic or Boolean measures, so it can be calculated only by giving the SMILES string, which can be calculated in the range of [0,1]. The closer the result is to 1, the more similar the two molecules are. Through the above two molecular similarity calculation methods can be very intuitive to see the molecular activity in chemical space. The main problem in designing new molecules are how to efficiently sample from large amounts of data[14]. In the early stage, the probability calculation method was generally used to reduce the molecular structure space, but even if the space was reduced, it could not be exhaustive. This method lacks effective exploration and needs to consume a lot of resources for calculation. Later, people optimized the design and calculation of complex molecules by Monte Carlo method[15]. Through random steps, efforts are made to capture interrelated conditions in molecular design to produce effective molecules. But in a continuous chemical space, it is also difficult for either approach to produce the desired optimal molecule, because the resulting "atomic cloud"[16] may not be a local minimum. In the subsequent design, Tang Yuhuan et al.[17] used the method of combining virtual screening and molecular fingerprint to accurately describe the molecular structure. However, the limitation of this method is high, and it is difficult to carry out a large number of calculations in complex chemical space. An ideal molecular design method should have the following two conditions: 1. It can be quickly and efficiently sampled from complex data centers; 2, processing data can do gradient optimization of their ability, so that the new molecules have stability. Therefore, deep learning has been introduced. 2.2. Deep Learning Deep Learning has become a powerful tool to solve the problem of molecular computation in chemical informatics[18]. Deep learning can be used to solve the problem of excessive molecular data. It can generate a model to train a large amount of data and generate similar data, so as to model the data. These models can extract average and significant characteristics of molecules, and the adaptive architecture of the generated models also enables simple training processes based on back propagation. These models can often be represented using low-dimensional data, allowing analogical reasoning with everyday applications such as natural language. Therefore, many researchers put the idea of deep learning into computational chemistry, generating new molecules through models or predicting the properties of existing molecules. Early Deep learning models such as RBM (Restricted Boltzmann Machine)[19] and DBN (Deep Belief Networks)[20] successfully solved the problem of probability distribution in molecular computing. However, with the increase of the degree of abstraction of molecular design, the early generation model is no longer suitable for further calculation of molecular design due to problems such as insufficient flexibility and ease of handling. Therefore, it is necessary to find a deep learning model more suitable for molecular calculation. Among the more popular deep learning generation models, VAE (Variational Auto-Encoder)[21] receives increasing attention. VAE is a probability generation model, whose main purpose is to generate brand-new data which is very similar to the original data based on the existing data. VAE is a generation model containing potential variables. It consists of three parts: an encoder network of converting the input data onto fixed dimension vectors, a potential space for mapping vectors, and a decoder network for converting vectors into readable data, so as to generate new 26 Computer Science & Information Technology (CS & IT) data not included in the input data. VAE is trained to receive and learn valid molecules through an encoder. The molecules cross potential Spaces and are randomly sampled by a decoder to generate new molecules. VAE can increase the randomness of encoder and combine with punishment mechanism to make all areas of potential space decode effectively. Rafael Gomez- Bombarelli et al.[22] performed experiments such as new molecule generation and attribute prediction using SMILES, a molecular representation based on the QM9 dataset. However, during the experiment, it was found that the SMILES representation, due to its character-for- character nature and internal syntax, may cause the decoder to produce output invalid molecules. To do this, they modified the decoder model to sample the character probability distribution of each position generated by the last layer of the decoder to output multiple SMILES strings of a single potential space. RDKit[23] was then used to verify that the generated SMILES strings were valid. This can screen for effective molecules, but cannot explain the effectiveness of the model. VAE models for molecular design are shown in Figure 1. Figure 1. Schematic diagram of a variable encoder for molecular design 3. NOVEL VARIATIONAL AUTOENCODER FOR IMPROVING THE EFFICIENCY OF GENERATED MOLECULES The problem facing the VAE model is that only a simple convolutional network is used for encoding and decoding. In this way, although new molecules can be generated, the similarity between the generated new molecules and the original molecules is not stable, that is, the variance may be very large. It is disadvantageous to VAE model to learn potential spatial variables, because in the learning process of the model, the potential variables only obey the prior distribution set in advance, and the meaning behind the data cannot be learned, which will affect the generation effect of decoding and result in degradation. In order to improve the effectiveness of the model, this paper explores the existing encoder and decoder. 3.1. VAE Degradation According to the research of Gammelli, D[24], improving the depth of the model can make the model have better feature expression ability. Improving the likelihood expression function VAE is equivalent to increasing the depth of encoder and decoder. Ideally, enhanced VAE encoders would enable potential Spaces to learn the data. Enhancing VAE decoder can make the result of generation better. Therefore, this paper changes and tests the encoder and decoder respectively, and the results are shown in Figure 2. OriginEncoderLatent SpaceDecoderReconstructEncoderDecoder Computer Science & Information Technology (CS & IT) 27 Figure 2. Comparison of visualized potential Spaces and generated effects when VAE model is enhanced When VAE model is not changed, the potential Spaces are sparse and the similarity between the generated molecules and the original molecules is poor. With enhanced encoders, the density of potential space increases significantly, This indicates that the potential space are interpretable. Although the effect of generating molecules has been improved, the final effect is still unsatisfactory. After enhancing the decoder, the performance of the potential space is still sparse, the potential space is poor, and the generation effect is obviously improved. However, this may be the result of forcing the decoder to learn data, rather than the excellent data given by the optimized potential space. Finally, when encoder and decoder are enhanced at the same time, the density of potential space is obviously increased, and the generated result is also relatively good. However, it is impossible to judge whether the generated result is better because of the potential space or just because of the enhanced decoder. The above comparison methods show that, for the generation of new molecules, only enhancing the depth of the encoder and decoder cannot effectively explain whether the model capability is improved, and it is easy to lead to degradation. This paper studies the relationship between data information and potential space in order to improve the ability of VAE. 3.2. Improve methods to Enhance VAE Ability The key to improve VAE model ability lies in how to make the encoder produce more useful information, how to smooth the distribution of potential space, and how to effectively learn the data in potential space. For the encoder part, this paper will introduce Fisher Information[25] in information theory, which is a measure of the information contained by random variable X about the unknown parameters of its own random distribution function. Strictly speaking, it is the expected value of the difference or observed information. Suppose that the observed data the target conforms to a probability distribution , where represents parameter, then the likelihood functions can be expressed as: (1) In general, the divergence distance presented in formula (1) is positive and convex. Therefore, when the second derivative exists and the likelihood function reaches its optimal value, the first , and the first-order derivative is derivative is zero. Fisher's information is represented by , thus: represented by Origin VAESimilarity54.57%Encoder Similarity60.21%Decoder Similarity85.45%All Similarity82.02%Latent SpaceOriginReconstruct12n,,...,XXX(;)fX1log()niifXLX(;)=()I(;)SX 28 Computer Science & Information Technology (CS & IT) (2) The mathematical meaning of Fisher information obtained through calculation is as follows: with the increase of the amount of data, the variance between the maximum likelihood function will become larger and larger, which also means that more and more information is mastered. Larger Fisher information means better understanding of the distribution parameters. Intuitively, larger Fisher information means that we can find the true value of the parameter faster and more accurately, and smaller Fisher information means that we need to search for more possible parameters. Therefore, Fisher information can be used to measure the quality of the distribution expressed by the coding layer in VAE to judge whether the encoding result of the encoder is qualified. For the decoder part, this paper uses LSTM (Long Short Term Memory)[26] as the decoder. The LSTM network can learn the characteristics of the training object, then answer the questions related to this object, and even generate new similar objects. The above characteristics make LSTM neural network a method of chemical informatics, especially in the generation of new molecules has great potential. The new VAE designed in this paper is shown in Figure 3. Figure 3. New VAE used to improve the availability of generated molecules Firstly, a multi-layer one-dimensional convolutional network is used as an encoder, which is used to convert the converted data into a sequence of fixed length of data sets of string type. The purpose of this approach is to treat the process of generating new molecules as string processing. By compressing the string of a vector of specified length, regularized Fisher information is added to the coding layer, and the model actively learns effective sequences, so that the potential space can be better captured and optimized, avoiding the problem of sparse potential space learned by the encoder. After that, LSTM decoding layer is used to learn the data information about potential space and capture the effective data in potential space according to the used data set. VAE is essentially a generative model. In addition to the invariance of convolutional neural network, over-fitting of input data will inevitably lead to unsatisfactory model generalization ability. As a result, the Vae model is identical with the new one. If many of the generated molecules are identical with the original molecules, it means that the model is failing. At this time, the VAE potential Spaces are not distributed according to the expected idea, that is, the characteristics of the input data are retained and new data are generated. In order to avoid the occurrence of a large number of similar cases, this paper optimizes the data generated by the coding layer. When the original molecule SELFIES is encoded by the multi-layered one- 22()[(;)][(;)]IESXESXσ LSTMOriginMultilayer one-dimensional convolution coding layerAdded disturbanceLatent SpaceLSTMReconstructFisher information regularizationeSample from a standard normal distributionμ Computer Science & Information Technology (CS & IT) 29 to be learned. Where, represents the mean value, dimensional convolutional network, the potential space can obtain the potential state encoding of all the input molecules. In this case, based on the obtained potential encoding, this paper represents constructs two layers the variance, and these two layers represent the distribution model of potential space. By sampling e obtained from the standard normal distribution, setting random number seeds, calculating and sampling according to the mean value and variance generated by the encoder, a random disturbed data is constructed. In this way, the encoder can avoid simply reconstructing the original features and improve the effectiveness of the model. As the potential Spaces in VAE model obey normal distribution, the mass of random variables is not near the mean value, but in a ring around the mean value. This means that linear interpolation between two points may pass through a low probability region[27]. This means a variable at some point in the potential space may have a poor effect, but will still be captured by the decoder, resulting in the resulting molecule being of low quality. Therefore, KL divergence should be added in the calculation process to make the model retain the most information in the original data source, and control the decoder to avoid the capture of the low probability region. 4. CORRELATION EXPERIMENT 4.1. Preparation for Experiment VAE is adopted for experiments in this paper. In order to simplify model training, SMILES of about 250,000 zinc molecules randomly extracted from the ChEMBL database[28] are used as the data set to measure the effectiveness of deep learning methods in quantum chemistry. This dataset use only the molecular subset of organic atoms (containing only the basic elements H,C,N,O, etc.), contains biologically relevant molecules represented in zinc-associated protonated forms, and is organized into molecular data sets that can be tested quickly. In this paper, the collected data are processed and separated. Among them, 149,673 pieces of data are used as training sets, 49,892 pieces of data are used as verification sets to cooperate with training, and 49,891 pieces of data are used as test sets to test and analysis the results generated by the generation model. The experiment environment used in this paper is ubuntu1804 and Python version 3.7.0. The experiment adopts the open source advanced framework Pytorch[29]. It is relatively easy about the development and application of deep neural networks, and can be well combined with Python language, making it easier about people to carry out scientific research calculations. The main steps of the experiment are as follows: Converting the existing SMILES dataset into SELFIES, encoding it into the encoder through One-Hot, converting each molecule into a vector in the potential space. Then, the decoder captures a point in the region of the potential space, converting the vector from that point in a corresponding string, and finally, using the designed program for verification and analysis. Generate the desired result graph. After repeated experimental verification and trial and error, batch_size was set to 256, a total of 500 rounds of training was set to 0.0001, the learning rate were set to 0.0001, and the model architecture as shown in Figure 4 was selected to use GPU for training. The results obtained were discussed in the next section. (,) 30 Computer Science & Information Technology (CS & IT) Figure 4. Model architecture used in this experiment 4.2. Result Using SELFIES as the input, we won't use as many SELFIES as SMIELS for direct observation, so we can use the trained VAE model to generate new SELFIES to convert them to SMILES for better observation and subsequent experimental verification. As the new molecular string generated is sampled from the last layer of decoder, the decoding process of VAE model is uncertain, which means that the decoding process of a single vector is random in the potential space. So, when a molecule is captured by the decoder and enters the decoding process, other SELFIES can be re-encoded into the potential space to wait for the next capture by the decoder. The region captured most frequently by the decoder shows that the molecule in this region is the most similar to the original one, which can be known by calculation. The captured molecule is the closest to the Euclidean distance from the original molecule, and the distance between other molecules in the region and the original molecule is proportional to the distance between other molecules and the captured molecule, that is, the farther away from the captured molecule, the lower the similarity. Figure 5 shows the Euclidean distance between the molecules in the region and the captured molecules when a molecule is captured. As can be seen from Figure 5, the closer they are to the captured molecules, the more similar their molecular diagrams will be to the captured molecules. When the similarity is relatively high, the main structure of the generated molecule will not change, but small changes will occur in the secondary structure, such as the addition of new elements or ring disintegration. Computer Science & Information Technology (CS & IT) 31 Figure 5. Euclidean distance between captured molecules and nearby molecules in potential space To test the effectiveness of the model, we used SELFIES as input in the model in this article, followed by SELFIES in R Gomez-Barbarella et al.[22] (R Group) for training. After the two models were trained, 100 molecules were randomly selected from the test set to generate and calculate new molecules. It was found that among the 100 generated molecules, the generated molecules were not identical with the original molecules in the two models, and the generated molecules were 100% effective, which was also consistent with the conclusion obtained by Aspuru group. Zhou Wei[30] believed that when the Tanimoto coefficient of two molecules was above 70%, the activity and properties of two molecules were valuable to study. The average similarity of the generated molecules calculated by the R group model is about 70.26%. The average similarity of the generated molecules calculated by this model is about 78.73%. The frequency of the overall similarity coefficient is shown in Figure 6. It can be seen that the similarity span of molecules generated by the R group model is large, and many of the generated molecules have low similarity, and the number of molecules with research value is small; Most of the molecules generated by this model have a similarity interval of [60%, 90%]. The number of low similarity molecules is very small, and there are many molecules with research value. The test data show that the model in this paper shows good performance in terms of the similarity of the molecules generated from the zinc molecular data set. Figure 6. The molecule generated by the two models is similar to the original molecule 01.141.932.685.7510.94NearFarCapture 5 molecules near the molecule 32 Computer Science & Information Technology (CS & IT) In addition to the similarity shown in formation of a single new molecule, the molecular diversity shown in the formation of multiple new molecules is also important because it reflects the density of molecules in the underlying space[31]. The denser the molecules encoded in the potential space, the more kinds of molecules can be decoded, and the better the chemical space can be explored. To verify that SELFIES can increase the molecular density of potential Spaces, we'll use SELFIES and SMILES for experimental verification in this article. After training the data of both molecular representations using the models presented in this paper, a molecule was randomly selected from the test set and 200 samples were taken for each model respectively. The number of valid molecules was also calculated for the model using SMILES, after which similarity was sorted and statistical calculations were performed. We found that the model trained with SELFIES produced 77.5% of diverse molecules, while the model trained with SMILES produced 40.59% of diverse molecules, as shown in Figure 7. The SMILES curve often appears parallel to the horizontal axis, which indicates that the molecules in this part are the same. We shot a few times in parallel, which means that most of the molecules are different. Calculations have shown that using SELFIES can dramatically increase the diversity of molecules. Figure 7. Diversity of generative models trained with different molecular representations 5. CONCLUSIONS The mentioned above experiments show that the combination of one-dimensional Convolutional Neural Network and LSTM neural network can achieve better performance in molecular generation, and the generated results are novel and diverse, with good performance and research space. Using LSTM as a decoder allows you to define the probability distribution of all possible characters at each position of the string, which improves the accuracy of generating the string. The application of SELFIES to the generated model can also provide good reconstruction fidelity and the ability to capture the features of the molecular training set, with 100% effectiveness and the ability to increase the molecular density in the potential space, which can play an important role in reverse design technology in computational chemistry[32]. In the next step, consider changing the input method. For example, by using an existing molecular fingerprint method (such as ECFP[33]), you can directly build a graphic encoder based on SELFIES. Even though the Selfies used in this article is a powerful one, you can save a lot of work by simply putting selfies into the model for training. And directly output molecular Computer Science & Information Technology (CS & IT) 33 diagram, intuitive effect will be better. However, it is difficult to build a neural network that can output arbitrary graphs. In the training process, due to conditions, only one GPU was used for training, and in order to achieve high quality results, the speed and performance were not satisfactory. Since the data set used in the experiment in this paper only contains SMILES strings, the addition of molecular attribute data will certainly affect the setting of parameters and the complexity of training, and the speed of training will decrease significantly. Therefore, one of the subsequent works of this paper is to improve the training speed, adopt the way of multi-threading, multi-process and multi-GPU combination, modify the training mode of the variational automatic encoder based on text molecular coding, so as to achieve the purpose of high quality and high performance. ACKNOWLEDGEMENTS I would like to express my heartfelt thanks to all those who have helped me in this paper. First of all, I would like to express my heartfelt thanks to my two tutors, Mr. Li Ning and Mr. Zhang Wei, whose advice and encouragement have given me more insight into these translation studies. It is my great pleasure to study under their guidance and guidance. Moreover, it is my pleasure to benefit from their personality and diligence, which I will cherish all my life. I can't thank them enough. I am also very grateful to Mr. Gao Ming who helped me and accompanied me in the process of preparing this paper. I also want to thank my family for their love and unwavering support. Finally, I am very grateful to all of you who took the time to read this paper and gave me many suggestions, which will help me in my future study. REFERENCES [1] TABOR D P, ROCH L M, SAIKIN S K, et al. Accelerating the discovery of materials for clean energy in the era of smart automation [J]. Nature Reviews Materials, 2018, 3: 5-20. [2] CHEN H, ENGKVIST O, WANG Y, et al. The rise of deep learning in drug discovery [J]. Drug [3] Discovery Today, 2018, 23(6). JOHNSON M A, MAGGIORA G M. Similarity in Chemistry. (Book Reviews: Concepts and Applications of Molecular Similarity.) [J]. Science, 1991, 252. [4] LOPEZ L M, SHANKS B H, BROADBELT L J. Identification of bioprivileged molecules: expansion of a computational approach to broader molecular space [J]. Molecular Systems Design & Engineering, 2021. [5] DAVID W. SMILES: A chemical language and information system [J]. Journal of Chemical Information and Computer Sciences, 1988, 28(1): 31-6. [6] BENJAMIN S L, ALáN A. Inverse molecular design using machine learning: Generative models for matter engineering [J]. Science, 2018, 361(6400): 360-5. [7] MA T, CHEN J, XIAO C. Constrained Generation of Semantically Valid Graphs via Regularizing Variational Autoencoders, F, 2018 [C]. [8] O'BOYLE N, DALKE A. DeepSMILES: An Adaptation of SMILES for Use in Machine-Learning of Chemical Structures [J]. 2018. [9] KRENN M, HASE F, NIGAM A K, et al. Self-Referencing Embedded Strings (SELFIES): A 100% robust molecular string representation [J]. Machine Learning Science and Technology, 2020. [10] RISSANEN J J. Fisher information and stochastic complexity [J]. IEEE Press, 1996. [11] SHERIDAN R P, KEARSLEY S K. Why do we need so many chemical similarity search methods? [J]. Drug Discovery Today, 2002, 7(17): 160-78. [12] ELMORE K L, RICHMAN M B. Euclidean Distance as a Similarity Metric for Principal Component Analysis [J]. Monthly Weather Review, 2001, 129(3): 540-9. [13] J. D. HOLLIDAY C-Y H, P. WILLETT. Grouping of coefficients for the calculation of inter- molecular similarity and dissimilarity using 2D fragment bit-strings [J]. Combinatorial Chemistry & High Throughput Screening, 2002, 5(2): -. 34 Computer Science & Information Technology (CS & IT) [14] WALES D J, SCHERAGA H A. Global optimization of clusters, crystals, and biomolecules [J]. Science, 1999, 285(5432): 1368-72. [15] 黎锁平. 运用蒙特卡罗方法求解随机性问题 [J]. 兰州理工大学学报, 2001, 027(002): 95-7. [16] SCHWALBE-KODA D, GóMEZ-BOMBARELLI R. Generative Models for Automatic Chemical Design [J]. 2019. [17] 唐玉焕, 林克江, 尤启冬. 基于 2D 分子指纹的分子相似性方法在虚拟筛选中的应用 [J]. 中国药 科大学学报, 2009, 40(2): 7. [18] 徐优俊, 裴剑锋. 深度学习在化学信息学中的应用 [J]. 大数据, 2017, 3(2): 22. [19 ]HINTON G E, SEJNOWSKI T J. Optimal perceptual inference; proceedings of the IEEE Conference on Computer Vision & Pattern Recognition, F, 1983 [C]. [20] HINTON G E, OSINDERO S, TEH Y W. A fast learning algorithm for deep belief nets [J]. MIT Press, 2006, (7). [21] KINGMA D P, WELLING M. Auto-Encoding Variational Bayes [Z]. arXiv.org. 2014 [22] GóMEZ-BOMBARELLI R, WEI J N, DUVENAUD D, et al. Automatic Chemical Design Using a Data-Driven Continuous Representation of Molecules [J]. Acs Central Science, 2018, 4(2): 268-76. [23] LANDRUM G, KELLEY B, TOSCO P, et al. rdkit/rdkit: 2017_03_3 (Q1 2017) Release [J]. 2017. [24] GAMMELLI D, RODRIGUES F. Recurrent Flow Networks: A Recurrent Latent Variable Model for Spatio-Temporal Density Modelling [J]. 2020. [25] WU X. Enhanced Monte Carlo Estimation of the Fisher Information Matrix with Independent Perturbations for Complex Problems [J]. 2021. [26] MIRZAEI S, KANG J L, CHU K Y. A comparative study on long short-term memory and gated recurrent unit neural networks in fault diagnosis for chemical processes using visualization [J]. Journal of the Taiwan Institute of Chemical Engineers, 2021. [27] GAMAL M, ABBAS H M, MOUSTAFA N, et al. Few-Shot Learning for Discovering Anomalous Behaviors in Edge Networks [J]. 计算机、材料和连续体(英文), 2021, (011): 000. [28] TANG Y S, WU C H. CREER: A Large-Scale Corpus for Relation Extraction and Entity Recognition [J]. 2022. [29] PASZKE A, GROSS S, CHINTALA S, et al. Automatic differentiation in PyTorch [J]. 2017. [30] 周威. 应用基因表达谱和模式分析研究复方丹参滴丸治疗颈动脉粥样硬化的物质基础和作用 机制 [D]; 广东药学院, 2016. [31] LAUFKöTTER O, MIYAO T, BAJORATH J. Large-Scale Comparison of Alternative Similarity Search Strategies with Varying Chemical Information Contents [J]. ACS Omega, 2019, 4(12): 15304-11. [32] SHIRAOGAWA T, HASEGAWA J Y. Exploration of Chemical Space for Designing Functional Molecules Accounting for Geometric Stability [J]. Journal of Physical Chemistry Letters, 2022, (36): 13. [33] MCNORGAN C. The Connectivity Fingerprints of Highly-Skilled and Disordered Reading Persist Across Cognitive Domains [J]. Frontiers in Computational Neuroscience, 2021, 15: 590093. Computer Science & Information Technology (CS & IT) 35 AUTHORS Li Kai, master student, main research field is Material Genetic engineering and machine learning, mobile number: 13521099187, correspondence address: Beijing Information Science and Technology University, No. 35, Middle North Fourth Ring Road, Yayuncun Street, Chaoyang District, Beijing, Postcode: 100101. E-mail: [email protected] Li Ning, Professor, main research field is Document Information processing, XML and Information technology standardization. E-mail: [email protected] Zhang Wei, corresponding author, professor, research interest covers network and data security, cryptography application technology, software and hardware co-design. E-mail: [email protected] Gao Ming, experimental researcher, main research field: Artificial intelligence, data security, cloud computing. E-mail: [email protected] © 2023 By AIRCC Publishing Corporation. This article is published under the Creative Commons Attribution (CC BY) license
http://arxiv.org/abs/2303.08818v2
2023-04-18T05:05:00
2023-02-20T05:02:40
Boosting Convolutional Neural Networks' Protein Binding Site Prediction Capacity Using SE(3)-invariant transformers, Transfer Learning and Homology-based Augmentation
Figuring out small molecule binding sites in target proteins, in the resolution of either pocket or residue, is critical in many virtual and real drug-discovery scenarios. Since it is not always easy to find such binding sites based on domain knowledge or traditional methods, different deep learning methods that predict binding sites out of protein structures have been developed in recent years. Here we present a new such deep learning algorithm, that significantly outperformed all state-of-the-art baselines in terms of the both resolutions$\unicode{x2013}$pocket and residue. This good performance was also demonstrated in a case study involving the protein human serum albumin and its binding sites. Our algorithm included new ideas both in the model architecture and in the training method. For the model architecture, it incorporated SE(3)-invariant geometric self-attention layers that operate on top of residue-level CNN outputs. This residue-level processing of the model allowed a transfer learning between the two resolutions, which turned out to significantly improve the binding pocket prediction. Moreover, we developed novel augmentation method based on protein homology, which prevented our model from over-fitting. Overall, we believe that our contribution to the literature is twofold. First, we provided a new computational method for binding site prediction that is relevant to real-world applications, as shown by the good performance on different benchmarks and case study. Second, the novel ideas in our method$\unicode{x2013}$the model architecture, transfer learning and the homology augmentation$\unicode{x2013}$would serve as useful components in future works.
[ "Daeseok Lee", "Jeunghyun Byun", "Bonggun Shin" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2303.08818v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2303.08818v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "q-bio.QM", "@scheme": "http://arxiv.org/schemas/atom" }
[ "q-bio.QM", "cs.LG", "cs.NE", "q-bio.BM" ]
3 2 0 2 r p A 8 1 ] M Q . o i b - q [ 2 v 8 1 8 8 0 . 3 0 3 2 : v i X r a BOOSTING CONVOLUTIONAL NEURAL NETWORKS' PROTEIN BINDING SITE PREDICTION CAPACITY USING SE(3)-INVARIANT TRANSFORMERS, TRANSFER LEARNING AND HOMOLOGY-BASED AUGMENTATION DAESEOK LEE, JEUNGHYUN BYUN, AND BONGGUN SHIN Abstract. Figuring out small molecule binding sites in target proteins, in the resolution of either pocket or residue, is critical in many virtual and real drug-discovery scenarios. Since it is not always easy to find such binding sites based on domain knowledge or traditional methods, different deep learning methods that predict binding sites out of protein structures have been developed in recent years. Here we present a new such deep learning algorithm, that significantly outperformed all state-of-the-art baselines in terms of the both resolutions-pocket and residue. This good performance was also demonstrated in a case study involving the protein human serum albumin and its binding sites. Our algorithm included new ideas both in the model architecture and in the training method. For the model architecture, it incorporated SE(3)-invariant geometric self-attention layers that operate on top of residue-level CNN outputs. This residue-level processing of the model allowed a transfer learning between the two resolutions, which turned out to significantly improve the binding pocket prediction. Moreover, we developed novel augmentation method based on protein homology, which prevented our model from over-fitting. Overall, we believe that our contribution to the literature is twofold. First, we provided a new computational method for binding site prediction that is relevant to real- world applications, as shown by the good performance on different benchmarks and case study. Second, the novel ideas in our method-the model architecture, transfer learning and the homology augmentation-would serve as useful components in future works. 1. Introduction In structure-based drug discovery, the knowledge of ligand binding sites (hereafter binding sites) on target proteins is crucial. It can aid rational drug design ([Hal09], [NKC+16], [SSS+19]) and is required for in-silico methods such as docking ([BGL+21], [NKC+16]). Such knowledge of binding sites can be attained by analyses of experimental structures of the target protein in complex with ligands. However, if no such structure is at one's disposal, it may be necessary to rely on computational means in order to identify the binding sites. In general, this computational task of Binding Site Prediction (BSP) can be regarded as composition of two sub-tasks: (1) Binding Site Detection (BSD) and (2) Binding Residue Identification (BRI). Firstly, BSD aims to identify the binding sites in a coarse-grained manner and score their druggability. A successful detection of highly druggable binding sites can aid medical chemists in many ways when designing better drug compounds. For example, the medical chemists can draw valuable insights in improving drug compounds' binding affinity or physical properties by examining the receptor structure at the potential binding site ([Hal09]). Also, preparing a suitable binding site is the first step in any virtual structure-based drug discovery pipeline ([BGL+21]). Secondly, BRI aims to identify residues in a given binding site that plays key roles in interactions with ligands. Identification of the key residues has been pursued in many previous research papers, due to its importance in rational drug design ([NKC+16], [SSS+19], [BCM+10]). In particular, it has several applications in virtual structure-based drug discovery. For example, structural pharmacophore features can be selected based on the identified key residues ([NKC+16], [BMR08]), and docking results can be prioritized according to whether the docked molecule has favored interactions with the key residues ([BGL+21], [NKC+16]). In this paper, we will focus in particular on the structure-based Deep Learning methods to tackle the BSP problem. This choice reflects two recent trends. Firstly, Deep Learning has been widely adopted for BSP ([ZCZ20]), and has shown good performance. Secondly, it has become easier to identify protein structures as a result of (1) the rapidly accumulating experimental data in databases such as PDB, and (2) advances in Deep Learning methods e.g. Alphafold ([JEP+21]). Recent structure-based Deep Learning methods for BSP are predominantly based solely on 3D CNN archi- tectures that operate on grid-shaped inputs. This results in several limitations, in terms of the performance of two sub-tasks explained previously. Firstly, the way the CNN-based methods aggregate the local (or short-range) information to recognize the global patterns may be sub-optimal. They achieve this through either clustering algorithms applied on top of the CNN outputs, or through the CNN layers themselves. In the first case, the clustering algorithm could be replaced by highly parameterized modules such as Neural Networks. These can potentially outperform the clustering algorithm, since many parameters can be optimized for the given task. In the second case, the deep Date: April 19, 2023. 1 2 DAESEOK LEE, JEUNGHYUN BYUN, AND BONGGUN SHIN layers of convolution operations may suffer from the problem of "long-term dependency". This means, since a convolution layer's operation is only local, a deep hierarchy of convolutions must be applied in order to allow a neuron to have a receptive field large enough to capture the global patterns. This long-term dependency is known to impede the training ([HBF+01]). This problem can be resolved if we adopt a neural network architecture whose operation is not local in nature. Secondly, these grid-based models do not directly operate on the protein residues. Therefore, they need an ad-hoc conversion of outputs to obtain predictions about the binding residues. For example, they posit that an atom close to a predicted 3D point (e.g. a predicted voxel center) is part of a binding residue ([JDMR+17], [SDZS20]). This may lead to sub-optimal BRI performances, since the loss function used to train the model do not compare the ground truth with the final output, but with the intermediate output before the conversion. For a better BRI performance, having a parameterized model that directly outputs the residue-level predictions would be preferable. To resolve these problems, we devised a model that has geometric attention layers that operate on top of residue-level CNN outputs. Our model is composed of two modules dedicated to the sub-tasks BSD and BRI respectively. Both modules (1) divide local surroundings around each protein residue into grids, (2) process the grid features in parallel using a CNN model to obtain residue-level local features, (3) use the geometric self-attention layers to update the features, and (4) compute the final reductions to produce subtask-specific outputs. To further improve our model's performance, we devised several additional elements-transfer learning, SE(3)-invariance, and augmentation. All these elements are intimately connected to our model's architecture. Firstly, we applied the transfer learning between the two modules. More specifically, the BSD module was not trained from scratch but a portion of its parameters was initialized from the trained parameters of the BRI module. This was meant to facilitate the learning process of the BSD module, which may suffer from a relative lack of data. Secondly, in order to improve the robustness of our model's predictions, we adapted the model to be SE(3)- invariant. In other words, our model is invariant to rotation and translation of the input structure ([FWFW20]). Besides using an SE(3)-invariant attention mechanism ([JEP+21]) at the outset, we made the grid featurization process SE(3)-invariant as well. This was achieved by aligning the axes of the grids with a specific orientation. This is similar to the grid alignment method used in [MAD21]. While the grids aligned with that method is not completely deterministic (as one degree of freedom remains), the grids aligned in our method do and hence achieve the full SE(3)-invariance. Lastly, we devised the data augmentation techniques that can be used along with our model. This was necessary because existing augmentation methods based on translations or rotations have no effect on training the SE(3)-invariant model. In particular, we came up with a novel augmentation method based on protein homology search and sequence alignment. Protein homology has been utilized for the BSP problem ([SB09], [WKS10], [RZ12], [YRZ13]), but to the best of our knowledge, we were the first to use it as an augmentation method for the same problem. The resulting method achieved significant performance gains over previous methods when evaluated on various BSP datasets, both in terms of BSD and BRI. A BSD metric increased by 3.8% on average, and a BRI metric increased by 16.9% on average. Through an ablation study, we showed that all the components of our model-the model architecture, transfer learning, SE(3)-invariance, and augmentation-made significant contributions, with a few exceptions for the BSD metric. At the end of the experiment section, we provided potential reasons for such exceptions. Finally, we performed a case study on human serum albumin to show the effectiveness of our model in real world applications. We based our case study on two previous studies on the binding sites of human serum albumin ([WHR+13], [Car03]), and examined how well our method could make predictions that are compatible with the studies. The promising results showed the potential usefulness of our method in in-silico drug discovery. To summarize, our contributions in this paper are: • We developed a new SE(3)-invariant deep learning model for BRI and BSD that combine CNN with the geometric self-attention layers. • We developed data augmentation methods, in particular homology augmentation, that can be used when training our model. • We found that our new model, trained with the proposed data augmentation methods, achieved signif- icant performance gains over state-of-the-art deep learning methods for BRI and BSD. • By an ablation study, we found that all elements of our method contributed significantly to BRI per- formance. • By an ablation study, we examined which elements contributed unambiguously to BSD performance. For those that did not, we provided possible explanations. BOOSTING CONVOLUTIONAL NEURAL NETWORKS' PROTEIN BINDING SITE PREDICTION CAPACITY USING SE(3)-INVARIANT TRANSFORMERS, TRANSFER LEARNING AND HOMOLOGY-BASED AUGMENTATION3 In this section, we discuss (1) existing BSP methods, focusing on the traditional and the deep learning methods, and (2) a similar problem of predicting ligand-specific binding sites. 2. Related Works 2.1. Traditional BSP methods. 2.1.1. Probe-based Methods. These methods use a fixed set of small molecules called "probes" to determine the binding sites in a query protein ([LJ05], [HGS09], [NHZ+12]). Specifically, they place the probes at different positions on the surface of the protein, and calculate the physical energy at the positions. The low-energy positions are predicted to be the potential binding sites. 2.1.2. Geometry-based Methods. These methods rely on 3D geometric characterization of binding sites to detect them. ([BNL03], [LGST09], [ZP11]) One example is Fpocket ([LGST09]), that tries to find concave regions of appropriate sizes on the protein surface. It does so by approximating the local curvatures by radii of alpha spheres, which are spheres with four heavy atoms on them but no heavy atom inside. More specifically, it finds all alpha spheres within a radius range, clusters them, and filters them according to the number of constituent alpha spheres to produce a binding pocket. Although Fpocket typically produces an excessive number of binding pockets, it has relatively good re- call (96.4% on scPDB v.2017, according to [DBRK15]). Therefore, there are ML-based algorithms ([KH18], [AGC+21]) that make use of it as a means to generate initial candidate binding sites. Our method employs the same strategy. 2.1.3. Template-based Methods. These methods predict binding sites of a query protein based on the templates, which are other similar proteins whose binding sites are already known ([SB09], [WKS10], [RZ12], [YRZ13]). A portion of the query protein is regarded as a binding site if it resembles binding sites of templates either sequentially or structurally. For example, the authors of [YRZ13] suggested combining two template-based approaches, one based on substructure comparison (TM-SITE) and the other on sequence profile alignment (S-SITE). TM-SITE works as follows: (1) Putative binding pockets are identified in the query protein by relying on an external software ([CLT+09]). (2) For each putative binding pocket, the template binding sites similar to it are collected as putative templates. The similarity measure is based on both structural and sequential comparisons. (3) The ligands in the putative templates are projected to the binding pocket. (4) A consensus voting by the projected ligands determines whether the residues in the binding pocket are in the binding site or not. On the other hand, S-SITE works as follows: (1) The query protein sequence is aligned with the template sequences based on their position-specific scoring matrices (PSSM) profiles and secondary structure information. (2) Templates with the highest alignment quality scores are chosen as the putative templates. (3) A consensus voting by the templates determines whether the residues in the query sequence are in the binding site. Our homology-based augmentation algorithm is inspired by these methods. The overall flow of it resembles that of TM-SITE, and the use of global sequential alignment is shared by S-SITE. However, our aim in applying the algorithm is not to make a final prediction of the model, but rather to augment the training dataset. 2.2. deep learning based BSP Methods. 2.2.1. DeepSite. DeepSite([JDMR+17]) predicts the binding sites by using a 3D CNN model and a clustering algorithm. The inference steps of DeepSite are as follows: (1) it generates points spanning the entire protein- occupied 3D space, (2) predicts the ligandability of the points using the CNN model computed on a 3D grid centered at the points, and (3) clusters the ligandable points to produce binding sites. 2.2.2. DeepSurf. DeepSurf([MAD21]) has the same overall procedure with DeepSite([JDMR+17]), but it uses more sophisticated approaches in several aspects. More specifically, it tries to improve (1) the generation of initial points, (2) the formation of input grids, and (3) the architecture of the 3D CNN model. The initial points are sampled on the Solvent Accessible Surface (SAS) of the protein, rather than the entire span of the protein. Then, the axes of the grids formed at those points are not arbitrarily oriented, but one axis is set to be the normal vector of the SAS. Finally, rather than using a plain CNN model, they used 3D equivalents of ResNet and Bottleneck ResNet ([HZRS16]). 4 DAESEOK LEE, JEUNGHYUN BYUN, AND BONGGUN SHIN 2.2.3. Kalasanty. Kalasanty ([SDZS20]) tries to solve BSP by viewing it as a 3D image segmentation problem. Therefore, it uses a 3D equivalent of the U-net model ([RFB15]), which was originally developed for 2D images. It applies the U-net model to large grids that cover most of the query proteins, and outputs the connected components consisting of positively predicted voxels as binding sites. 2.2.4. Deeppocket. Similar to our proposed method, Deeppocket ([AGC+21]) relies on the binding site candi- dates generated by Fpocket. It has separate detection and segmentation models, where the former is a plain 3D CNN model, and the latter is a U-net model similar to the one used in Kalasanty. The detection model is used to rank the binding site candidates generated by Fpocket, and the segmentation model is used to segment the 3D voxels centered at the top-ranked sites. 2.3. Predicting ligand-specific binding sites. Recently, deep learning models that predict protein-ligand complex structures, given a protein-ligand pair, have been developed ([LYH+19], [MLAdRCW21], [SGP+22]). In principle, these models can be used to find ligand-specific binding sites. Therefore, one may argue that the BSP models are strictly less useful than these models, since their predictions on binding sites do not take into account the partner ligands. However, we argue that they are still useful in their own right. Firstly, for many applications, predicting ligand-agnostic binding sites is enough, and even desirable. For example, a typical docking experiment requires a binding pocket location as a prerequisite, and docks all molecules in a virtual library to the pocket. To predict binding pockets using the models that do consider the partner ligands, preparing appropriate ligands may add additional complexity to the problem. This is similar to the problem of preparing appropriate probe molecules in the previously mentioned prob-based methods. Secondly, the performances of the methods that predict protein-ligand complex structures are not satisfactory at this point. For example, EquiBind ([SGP+22]) scored median and mean ligand rmsd of 6.2 ̊A and 8.2 ̊A, which suggests that the model is not accurate enough to correctly identify binding residues. Therefore, we might want to focus on the easier and well-studied BSP problem. 3. Problem Definition Thus far, the BSP task has not been addressed explicitly under a common definition across different liter- atures, even though they used different model compositions. For example, while Deeppocket is comprised of separate "detection" and "segmentation" models, Kalasanty only uses single segmentation model, whose output is post-processed by a clustering algorithm. In order to fairly assess different BSP models, it is necessary to envisage an unified definition of the BSP task. To be more specific, we will formally establish standards on the input and output. All baseline models can be regarded as following the standard, which will be explained in the experiment section. Moreover, we will also explain the decomposition of the task into sub-tasks (including BSD and BRI), which is employed in our method and Deeppocket. 3.1. The BSP task. BSP is the task of identifying the ligand binding sites in a given protein. In the task, we are given as input: a protein structure P and the number of binding sites n. We assume that there are known structures of ligands li (i = 1, * * * , n) that correspond to the binding sites. The goal of the task is to predict an unordered set of n binding sites of P where the ligands l1, * * * , ln bind. A predicted binding site is of the form (ˆci, ˆRi), where ˆci ∈ R3 is the binding site center and ˆRi ⊂ {1, * * * , size(P )} is the set of indices of binding residues. For example, an ideal prediction (cid:110) (ˆc1, ˆR1), * * * , (ˆcn, ˆRn) (cid:111) is such that • ˆci is close (e.g. within the radius threshold 4 ̊A) to li • ˆRi is the set of indices of residues close (e.g. within the radius threshold 4 ̊A) to li The methods that we used to evaluate such predictions will be explained in 5.4. 3.2. Decomposition into sub-tasks. Our method divides the BSP task into sub-tasks (1) candidate gener- ation, (2) Binding Site Detection (BSD) and (3) Binding Residue Identification (BRI), each corresponding to a dedicated module (this is similar to TM-SITE ([YRZ13]) and Deeppocket ([AGC+21])). To be more specific, let (P, n) be an input to perform BSP on. First, the candidate generation module takes the protein structure P m ∈ R3, where typically m (cid:29) n. Next, as an input then generates the candidate binding site centers ˆc(cid:48) the BSD module takes (P, ˆci) (1 ≤ i ≤ m) as the inputs and outputs the predicted druggability of ˆc(cid:48) i in P . The druggability scores are then used to rank the candidate centers, the top n of which form a filtered list ˆc1, * * * , ˆcn of candidate centers. Lastly, for each 1 ≤ i ≤ n, the BRI module takes as input (P, ˆci), and outputs ˆRi, that is the set of binding residues within the binding site. The resulting set becomes the final output of the model. (cid:111) (cid:110) (ˆc1, ˆR1), * * * , (ˆcn, ˆRn) 2, ..., ˆc(cid:48) 1, ˆc(cid:48) BOOSTING CONVOLUTIONAL NEURAL NETWORKS' PROTEIN BINDING SITE PREDICTION CAPACITY USING SE(3)-INVARIANT TRANSFORMERS, TRANSFER LEARNING AND HOMOLOGY-BASED AUGMENTATION5 Figure 1. (a) Our BRI module. (b) Our BSD module. (c) Our BSD module is trained in two stages, where in the second stage, the parameters of the shared parts are initialized from the result of training a BRI module in the first stage. (d) Ground truth generation. A candidate site is a true binding site if the center is within 4 ̊A from a ligand atom (i.e. DCA < 4 ̊A). A residue is a binding site residue if it is within 4 ̊A from a ligand atom. 4. Key Components of Our Method This section briefly illustrates the key components of our method, which will be explained in more details in Section 7. These include the details of the modules (candidate generation, BSD and BRI) as well as other aspects independent to the model architecture. In particular, the latter includes the transfer learning and the homology-based augmentation method. 4.1. The candidate generation module. To generate the binding site candidate centers, we use an external software Fpocket ([LGST09]). Given a protein structure, Fpocket finds sets of heavy atoms ˆS1, * * * , ˆSm, each corresponding to a region geometrically likely to be a binding pocket. Then, we find the candidate centers ˆc(cid:48) i (i = 1, * * * , m) by taking the center of the mass of the atoms in ˆSi. We chose Fpocket as the candidate generation method because it achieves a sufficiently high recall rate (96.4% on scPDB v.2017, according to [AGC+21]). This means that, for a given protein and its binding site, it is likely that at least one of the generated candidates corresponds to the binding site. Then, provided that the BSD module ranks the candidates properly, the top-n candidates may approximate the true binding site centers with a high accuracy. 4.2. The BSD module. The BSD module takes as input the protein structure and a candidate binding site center ˆc(cid:48), and outputs the predicted druggability at ˆc(cid:48). In doing so, it featurizes the surroundings of ˆc(cid:48) into a set of per-residue 3D grids, and processes the grids through a neural network to produce the output. Here, each grid in the set corresponds to a residue close enough to ˆc(cid:48) (distance threshold 17 ̊A), and encodes the local environment of the residue. The neural network of the BSD module is composed of (1) a residue-local feature extracting unit which runs in parallel for each grid (2) an aggregation unit which globally aggregates the local features (3) the reduction unit which maps the aggregated feature to single scalar quantity. The feature extracting unit is a 3D CNN model, and the aggregation unit is composed of several geometric self-attention layers. The reduction part is composed of a point-wise feed-forward layer and a mean-reduction operation. 4.3. The BRI module. The BRI module takes in the protein structure and a putative binding site ˆc as inputs and outputs the set of predicted binding residue indices. 6 DAESEOK LEE, JEUNGHYUN BYUN, AND BONGGUN SHIN i ) and geometric (khp i ) query vectors. i ) and geometric (vhp i=1, how our attention layer produces updated hidden vectors {x(cid:48) Figure 2. The figure illustrates, given hidden vectors {xi}n i=1 and geometric information i}n {(Ri, ti)}n i=1. (a) Obtaining query, key and value vectors required for the computation. (a-1) Standard (qh i ) and geometric (qhp (a-2) Standard (kh i ) key vectors. (a-3) Standard (vh i ) value vectors. (b) Obtaining attention weights. (b-1) The attention weights are based on the standard terms (wstandard . (b-2) The standard terms are based on the match (measured by inner product) between the standard query and key vectors. (b-3) The geometric terms are based on the match (measured by the distance between their global coordinates) between the geometric query and key vectors. (c-1) The updated hidden vectors are calculated based on the aggregated standard value vectors (oh i ). (c-2) Aggregating the standard value vectors. (c-3) Aggregating the global coordinates of the geometric value vectors. i ) and the aggregated global coordinates of the value vectors (ohp ) and the geometric terms wgeometric ij ij The BRI module shares the residue-local feature extraction and global aggregation units with the BSD module. To be more specific, the BRI module shares the following units with the BSD module: (1) the CNN feature extractor and (2) the stack of geometric attention layers up to the penultimate one in the BSD module. However, the remaining part of the BRI module is only comprised of a point-wise feed-forward layer without a mean-reduction operation. Hence, the outputs of the last layer are used to determine (with a threshold value) whether the corresponding residues are binding site residues or not. 4.4. Transfer learning. Transfer learning can be applied between the BSD and BRI sub-tasks thanks to the shared architectures between the BSD and BRI modules. More specifically, we initialize the weights of the BSD module's shared parameters with the weights obtained from BRI module's training. The rationale behind this procedure is the following intuition: the protein's binding site can be determined based on the patterns of the binding residues. Under this rationale, we hypothesize that a well-performing BRI module will learn useful features that can transfer well to the BSD task. In addition, the transfer learning allows BSD module to leverage relatively more abundant labels present in BRI dataset. While there is one label per binding site for the BSD task, there are a multiple number of binding residues per binding site. Thus, it is desirable to exploit such abundance in labels from the BRI task for BSD task via the transfer learning. 4.5. The geometric self-attention layers. As mentioned previously, we adopted the geometric self-attention layers to globally aggregate local features obtained by the CNN. First, let {xi} i = 1n denote a sequence of hidden vectors that is either the initial local features computed by the CNN or the output of the preceding attention layer. Then a geometric self-attention layer fatt transforms {xi} i = 1n into another sequence of hidden vectors BOOSTING CONVOLUTIONAL NEURAL NETWORKS' PROTEIN BINDING SITE PREDICTION CAPACITY USING SE(3)-INVARIANT TRANSFORMERS, TRANSFER LEARNING AND HOMOLOGY-BASED AUGMENTATION7 i} i = 1n based on the protein structure. In our method, we represent the protein structure as local frames i=1 associated to the residues, where Ri is the residue orientation and ti is the {x(cid:48) ([JEP+21]) {Ti}n residue center. Then the geometric self-attention layer fatt takes the following form: i}n i=1 = {(Ri, ti)}n i=1 = fatt ({xi}n i=1 , {Ti}n i=1) (4.1) {x(cid:48) The geometric attention mechanism has several advantages over the modules from previous works used for the feature aggregation-the traditional clustering algorithms and the CNN models. First, unlike the Neural Network based methods (such as our), the clustering algorithms are less flexible in terms of the number of adjustable parameters and they do not fit their parameters based on the gradients. As for the CNN models, the attention layers are arguably more effective in terms of modeling the long-distance dependency. While an attention layer can emulate arbitrarily distant interaction by a single step of operation, convolution layers require several steps to do so due to their local nature. This long-term dependency may lead to sub-optimal learning outcomes ([HBF+01]). For the attention mechanism, we used a modified version of Invariant Point Attention from Alphafold ([JEP+21]). The essential ideas of its computation, compared to the standard attention mechanism ([VSP+17]), are that (1) it uses not only the standard query, key and value vectors but also geometric ones, (2) it calculates the attention weights based on not only the inner products of the standard query and key vectors but also the distances between the geometric query and key vectors, and (3) its output is determined by not only the aggregated standard value vectors but also the aggregated geometric value vectors. More detailed descriptions are provided in Figure 2 and the Methods section. The effect of using the geometric vectors in the attention mechanism is discussed as a part of our ablation study. 4.6. Satisfaction of SE(3)-invariance. A function is SE(3)-invariant if its output remains unchanged when SE(3) transformations (translations, rotations or compositions of them) are applied to the input. In our context, when {vi}N i=1 are the feature vectors of the protein atoms, and {Ti}n i=1 , {fi}N i=1) is SE(3)- invariant if, for any SE(3) transformation T , we have i=1 , {T Ti}n i=1 are the coordinates of the protein atoms, {fi}N i=1 are the local frames related to the protein residues, a function f ({vi}N i=1) = f ({vi}N i=1 , {fi}N i=1 , {fi}N i=1 , {Ti}n i=1 {Ti}n f ({T vi}N i=1) The SE(3)-invariance is a desired property for the structure-based BSP models. This is because the binding site information should remain unchanged regardless of the reference frame. To reflect this, we are injecting this inductive bias via incorporating the SE(3)-invariance property into our model and hence achieve robustness in our model's prediction ([FWFW20]). Two strategies were employed to achieve SE(3)-invariance in our model. First, we adopted SE(3)-invariant attention mechanism at the outset. To be more specific, we required the attention layer in (4.1) to be invariant to any SE(3) transformation T = (R, t), that is: (4.2) fatt({xi}n i=1 , {T Ti}n i=1) = fatt({xi}n i=1 , {Ti}n i=1). The details of the SE(3)-invariant attention mechanism will be explained in the Methods section. Then, the other strategy employed to meet the SE(3)-invariance was altering the grid-based residue featurization process. When constructing the grids, we did not use an arbitrary (xyz-) axes, but rather used axes aligned with respect to the orientations of the residues. This will be also explained in more detail in the Methods section. 4.7. Augmentation strategies. Data augmentation is one of the most essential elements comprising the modern Deep Learning. It plays a crucial role in (1) alleviating the problem of overfitting which occurs commonly due to the lack of data and (2) improving the trained model's generalization capability ([SK19]). In essence, the data augmentation enlarges the effective size of the training set by applying various transformations to the inputs. Previous Deep Learning methods for BSP ([JDMR+17], [AGC+21], [SDZS20]) employed various augmenta- tions. These augmentation methods were mainly based on applying transformations in the SE(3) class (rotations, translations and compositions of them) to the inputs of the CNN models. In the absence of data augmentation, our model suffered from a clear pattern of over-fitting (Figure 4). We believe that this is due to the lack of diversity in the training dataset as compared to the large complexity of the model. However, the existing augmentation methods based on SE(3) transformations have no effect on the training dynamics when used in conjunction with our SE(3)-invariant model. From this aspect, we devised two novel augmentation methods: (1) a method based on a class of geometric transformations and (2) a method based on the homologous proteins. Firstly, the augmentation based on the geometric transformation introduces the random perturbations to the residue orientations. This differs to the usual "random rotation" in that it permits only rotations of small magnitude. We applied independent random perturbations on the residue orientations once then used the modified residue orientations as an input to every attention layer. The rationale behind applying such random 8 DAESEOK LEE, JEUNGHYUN BYUN, AND BONGGUN SHIN perturbation is to promote diversity in geometric information while not completely forgetting the original residue orientation. Next, we employed an augmentation scheme based on the protein homology. This fundamentally differs from the usual augmentation methods, in that it relies on an unlabelled external database of unbound protein structures to pre-compute the transformations. Essentially, we first align the protein sequences in the training set (referred to as a internal protein sequence) with the protein sequences from the external database (referred to as a external protein sequence). Then, we assign the ground-truth binding site and binding residue labels of the internal protein sequence to the aligned external protein sequence as its labels. Finally, we augment our training dataset with these aligned external protein sequences and their labels assigned. The extended dataset may contain some label noises since the assignment of labels based on the homology relations is subject to inaccuracies to some extent. In spite of this problem, our augmentation scheme enhances diversity of input data compared to the previous augmentation schemes. This is because the extended dataset may include protein species absent in the training dataset. 5. Experiments 5.1. Datasets. We used scPDB v.2017 ([DBRK15]) as a main dataset for the training and the validation. In addition, we used three other datasets for the tests: COACH420 ([KH18]), HOLO4K ([KH18]) and CHEN ([CMGK11]). To be more specific, we used the training subset of scPDB dataset provided by [MAD21] for 5-fold cross-validation. This subset excludes proteins which have sequence similarity higher than 90% to the proteins in one of the external test datasets. We used the remaining part of the scPDB as a test dataset. Thus, the test datasets were comprised of the scPDB test set and the external test dataests - COACH420, HOLO4k and CHEN. The CHEN dataset had holo and apo subsets. Thus in the tests using the apo subset, we obtained the ground-truth binding sites from the structural alignments with the corresponding holo structures. More specifically, the ligands of the holo structures were superimposed onto the apo structures according to the structural alignments. The characteristics of each test dataset and the details of the structural alignments are described in the Supplementary Information. 5.2. Baseline Methods. We compared our method to the previous state-of-the-art Deep Learning methods, which are based on CNN: Deeppocket ([AGC+21]), Kalasanty ([SDZS20]) and DeepSurf ([MAD21]). All these methods are briefly explained in 2.2. For Deeppocket and DeepSurf, we have trained their parameters from scratch according to our dataset splits. However for Kalasanty, we used the parameters released by the authors due to the high computational costs to train. It is important to note that the parameters of Kalasanty were trained on the entire scPDB v.2017 dataset. To be specific, the training data of Kalasanty may have included data whose protein sequences are similar (similarity above 90%) with those in the test dataset. Thus, Kalasanty method have an advantage in terms of the coverage of the training dataset compared to the other methods when they are evaluated on the external test datasets. 5.3. Ablated Methods. We conducted an ablation study to assess the effectiveness of each component of our proposed method. We considered the omission of the following components: • The geometric information used in the self-attention layers • The use of local features extracted by the CNN • The grid alignment process adopted to achieve SE(3)-invariance in our model • The transfer learning from the BRI to the BSD module • The data augmentation methods as a whole • Each of the data augmentation methods We used the most basic form of transformers, that is BERT ([VSP+17]), as a geometric information omitted version of self-attention layers to conduct the ablation study on 'the geometric information used in self-attention layers'. In the ablation study of 'the use of local features extracted by the CNN', we removed the CNN component from our model. To be more specific, the hidden vectors for the attention layers are directly obtained from the One-hot-encoding layer for the amino acid types followed by the token embedding layer. To compensate for the loss of model complexity, we added two more attention layers to the default configuration of BRI and BSD model architecture. In the ablation study on the grid alignment process, we removed the alignment process but used the standard random rotation augmentation for a fair comparison. By doing so, we attempted to argue the efficacy of our method as compared to the common practice, rather than the case where no additional technique is applied. 5.4. Evaluation. In 3, we formalized the inputs and outputs of the BSP methods. According to the formalism, a BSP method (1) takes as inputs a protein structure and the number of binding sites (n), and (2) outputs n predictions (ˆc1, ˆR1), * * * , (ˆcn, ˆRn) with ˆci and ˆRi being the binding site centers and the binding residue indices, respectively. Now that we have formalized the problem, we need to establish an evaluation scheme. This requires BOOSTING CONVOLUTIONAL NEURAL NETWORKS' PROTEIN BINDING SITE PREDICTION CAPACITY USING SE(3)-INVARIANT TRANSFORMERS, TRANSFER LEARNING AND HOMOLOGY-BASED AUGMENTATION9 (1) interpreting each method's input and output as per the problem definition and (2) defining the evaluation metrics in terms of the input and output formats specified in the problem definition. 5.4.1. How the baseline methods fit into our problem definition. The definitions of ˆc1, * * * , ˆcn for the baseline methods are mostly natural, and derived directly from the original papers. All methods produce a ranked list of predictions, thus we limit them to produce only the top-n outputs. Also, they compute the centers of predicted binding sites in their evaluation, so we can compute ˆci as they prescribed. However, not all baseline models output the predicted binding sites at the residue level. Thus, it is necessary to map their outputs to sets of residues ˆR1, * * * , ˆRn. For example in the Deeppocket ([AGC+21]), the authors used the distance threshold 2.5 ̊A (performed best in their validation set) to determine the binding residues from the segmented voxels; therefore, we followed the same procedure. For Kalasanty ([SDZS20]) and DeepSurf ([MAD21]), the authors introduced a method to convert their predictions to the atom-level predictions (which was implemented in their code); therefore, we regarded the residues having at least one such predicted binding atoms as the predicted binding residues. 5.4.2. The evaluation metrics. We use three evaluation metrics: (1) the success rate for detection (success rate) (2) the average IOU of binding residues with respect to the closest ligands (IOU) (3) the average IOU of the binding residues with respect to the successfully detected ligands (conditional IOU). The metrics evaluate different combinations of BSD and BRI performances. The success rate metric evaluates the BSD performance, the IOU metric evaluates the BRI performance but it is also influenced by the BSD performance, and the conditional I metric aims to evaluate the BRI performance alone. We give additional details with regards to how these evaluation metrics compare to their counterpart metrics introduced in the previous literatures in Supplementary Information. In order to provide a formal definition of each metric, we shall adopt following notations: • n(i) is the number of ground-truth ligands bound to the i-th protein. • is the set of ground-truth ligands bound to the i-th protein. (cid:110) (cid:111) (cid:111) is the set of predictions of the method to evaluate. n(i) l(i) 1 , * * * , l(i) 1 , BR(i) (c(i) T BR(i) 1 ) * * * , (c(i) 1 , * * * , T BR(i) n(i) (cid:110) (cid:110) • • n(i) , BR(i) (cid:111) n(i)) is the set of true binding residue indices, where T BR(i) j is defined to be the set of residues in the i-th protein that is within 4 ̊A from l(i) j The success rate metric measures the correspondence between the predicted binding site centers 1 , * * * , l(i) l(i) and the positions of the ground-truth ligands monic mean of precision and recall) based on the definition of detection. Specifically, we define that c(i) is a j correct detection of l(i) k when c(i) is within 4 ̊A (a threshold commonly used in the literature e.g. [AGC+21] and [MAD21]) from any ligand of l(i) k . In other words, we define that detection is correctly performed when the Distance from Center to Atom (DCA) is < 4 ̊A. Then, the F1 scores are weighted-averaged (weighted by n(i)) over the proteins. In summary, we obtain this metric as 1 , * * * , c(i) c(i) . For each i, we compute the F1 score (the har- n(i) n(i) (cid:111) (cid:110) j (cid:110) (cid:111) (cid:32) (cid:88) i n(i) * , where P (i) is the precision defined as follows: 2 P (i) + 1 1 R(i) (cid:33) (cid:30) (cid:32) (cid:88) (cid:33) n(i) i # P (i) = (cid:110) 1 ≤ j ≤ n(i) : c(i) j detects one of l(i) 1 , * * * l(i) n(i) (cid:111) n(i) and R(i) is the recall defined as follows: (cid:110) 1 ≤ k ≤ n(i) : l(i) k # R(i) = is detected by one of c(i) 1 , * * * , c(i) n(i) (cid:111) n(i) This is a BSD metric since this involves only the predicted binding site centers, not the predicted binding residues. the ligand l(i) defined as The IOU metric compares the predicted binding residues BR(i) φ(i)(j) closest to the predicted binding site center c(i) j with the true binding residues T BR(i) φ(i)(j) of j . Here, the index φ(i)(j) of the closest ligand is φ(i)(j) = n(i) argmin k=1 DCA(c(i) j , l(i) k ) 10 DAESEOK LEE, JEUNGHYUN BYUN, AND BONGGUN SHIN The comparison is performed in terms of Intersection Over Union (IOU), and the quantity is averaged over all pairs of (i, j). In summary, we obtain the second metric as #(BR(i) j ∩ T BR(i) #(BR(i) ∪ T BR(i) (cid:30) (cid:32) n(i) (cid:88) (cid:88) (cid:88) ni     (cid:33) φ(i)(j)) φ(i)(j)) i j=1 i Although this is essentially a BRI metric, it also depends on the BSD performance due to the definition of φ(i)(j). In particular, if the predicted center c(i)(j) is far from any ligand, the set of predicted binding residues ˆR(i) j does not contribute to the metric. The conditional IOU metric is almost the same as the IOU metric, but it aims to eliminate the previously mentioned problem that the BRI performance is bound by the BSD performance. It does so by focusing on the case that the predicted binding sites is close to at least one ligand. In summary, we obtain the metric as #(BR(i) j ∩ T BR(i) #(BR(i) ∪ T BR(i) #S(i) (cid:30) (cid:32) (cid:88) (cid:88) (cid:88)     (cid:33) φ(i)(j)) φ(i)(j)) i j∈S(i) i , where S(i) = (cid:110) j = 1, * * * , n(i) : DCA(c(i) j , l(i) φ(i)(j)) < 4 ̊A (cid:111) This is similar to metrics used in Deeppocket ([AGC+21]) and DeepSurf ([MAD21]) to evaluate models' binding site segmentation capability conditional on the successful location of the binding sites. 5.5. Training the BSD Module. To implement the transfer learning described in 4.4, the BSD training consists of two stages. The first stage is pre-training the part of the BSD module's architecture shared by the BRI module, as depicted in Figure 1. In doing so, we attach the unshared part of the BRI module architecture on top of the shared part in the BSD module then train the combined model for the BRI task. The second stage is fine-tuning the entire original BSD module for the BSD task. In the second stage, to promote smoother transfer learning, we freeze the parameters of the parts trained in the first stage up to certain steps of gradient descent. In both stages, we use balanced sampling of binding site candidates of positive and negative labels. This is because, among the binding site candidates predicted by Fpocket (On average 33 per protein in scPDB), only few of them are actual binding sites (typically only one). Training without such balanced sampling may render the trained model biased toward the out-numbered label. ([JK19]) In addition, in the first stage, we resolve the similar problem of unbalanced residue labels by using a weighted loss function. This loss function consists of a weighted sum of terms from different residues, where the binding and non-binding residues attain the following weights: wpos = 1 2npos , wneg = 1 2nneg , where npos and nneg are the number of binding and non-binding residues respectively. 5.6. Training the BRI module. To train the BRI module, we use only the positive binding site candidates. (We do the same to train Deeppocket) This is because, in our intended usage, the BRI module operates on the binding sites detected by the BSD module. Note that this intention is reflected in the evaluation metric average IOU of binding residues against the closest ligands as well. All the settings of the first stage of BSD training were maintained, except the balanced sampling of the binding site candidates. 5.7. Data Augmentations. We apply the data augmentation methods described in 4.7 in every training sce- nario (pre-training the BSD module, fine-tuning the BSD module and training the BRI module), except when they are omitted as a part of the ablation study. Applying the random perturbation means transforming the inputs to the geometric attention layers once for each data sample. Applying the homology-based "augmenta- tion" means adding to the original loss (originated from the original dataset) an auxiliary loss calculated in the same way but originated from the "extended dataset". 5.8. Experiment Results. The experiment results are summarized in Table 1, Table 2, Table 3, Figure 3 and Figure 4. 5.8.1. BSD performance. In general, Table 1 shows that our method significantly outperformed the baseline methods in the BSD task. Although there is an exception that Deeppocket outperformed our method on CHEN- holo, the gap in performance (1.2%p) is relatively insignificant compared to the average gain in performance (3.1%p) across other datasets. The ablation results show that all components had positive effects on the performance in general. In particu- lar, (1) the use of geometric information in the attention layers, (2) the transfer learning and (3) augmentation BOOSTING CONVOLUTIONAL NEURAL NETWORKS' PROTEIN BINDING SITE PREDICTION CAPACITY USING SE(3)-INVARIANT TRANSFORMERS, TRANSFER LEARNING AND HOMOLOGY-BASED AUGMENTATION11 Table 1. (BSD metric) F1 Success rate for detection. The mean and standard deviation are calculated based on the metric values for 5 different cross-validation folds. DeepSurf Kalasanty DeepPocket Ours Ours(BERT) Ours(no CNN) Ours(no alignment) Ours(no transfer) Ours(no augmentation) Ours(no homology) Ours(no perturbation) scPDB(held-out) COACH420 43.6 ± 1.3 50.8 ± 0.0 55.7 ± 0.7 59.1 ± 0.3 54.8 ± 1.2 57.7 ± 0.3 59.4 ± 0.7 53.9 ± 0.3 55.8 ± 1.4 57.3 ± 0.9 58.9 ± 0.7 62.4 ± 1.3 70.0 ± 0.0 67.9 ± 0.4 70.1 ± 0.4 65.6 ± 1.2 69.2 ± 0.7 69.0 ± 0.6 61.9 ± 0.3 64.2 ± 2.0 68.3 ± 1.1 70.0 ± 0.5 HOLO4k 59.7 ± 1.4 44.9 ± 0.0 72.2 ± 0.2 77.0 ± 0.6 70.8 ± 1.1 75.1 ± 0.2 75.6 ± 0.7 70.0 ± 0.5 71.3 ± 1.5 75.1 ± 1.1 76.2 ± 0.3 CHEN-holo CHEN-apo 22.3 ± 1.2 24.5 ± 1.4 27.1 ± 0.0 28.5 ± 0.0 34.5 ± 1.2 42.4 ± 0.3 36.5 ± 0.2 41.2 ± 1.2 32.8 ± 0.7 38.2 ± 1.2 36.7 ± 1.0 41.7 ± 1.0 35.4 ± 0.6 41.0 ± 0.6 35.1 ± 0.6 39.8 ± 0.5 34.3 ± 0.5 39.1 ± 1.7 34.6 ± 0.6 39.9 ± 0.5 36.3 ± 1.1 41.8 ± 0.7 Table 2. (BSD + BRI metric) Average IOU of binding residues against the closest ligands. The mean and standard deviation are calculated based on the metric values for 5 different cross-validation folds. DeepSurf Kalasanty Deeppocket Ours Ours(BERT) Ours(no CNN) Ours(no alignment) Ours(no augmentation) Ours(no homology) Ours(no perturbation) scPDB(held-out) 0.288 ± 0.007 0.260 ± 0.000 0.440 ± 0.002 0.490 ± 0.003 0.430 ± 0.008 0.467 ± 0.003 0.478 ± 0.005 0.381 ± 0.003 0.473 ± 0.003 0.452 ± 0.002 COACH420 0.194 ± 0.006 0.183 ± 0.000 0.313 ± 0.003 0.398 ± 0.004 0.321 ± 0.010 0.357 ± 0.005 0.387 ± 0.004 0.317 ± 0.006 0.387 ± 0.007 0.370 ± 0.007 HOLO4k 0.207 ± 0.005 0.146 ± 0.000 0.277 ± 0.03 0.346 ± 0.002 0.294 ± 0.005 0.315 ± 0.002 0.335 ± 0.003 0.275 ± 0.004 0.341 ± 0.003 0.320 ± 0.005 CHEN-holo 0.104 ± 0.003 0.101 ± 0.000 0.190 ± 0.005 0.287 ± 0.004 0.228 ± 0.007 0.247 ± 0.005 0.271 ± 0.005 0.229 ± 0.007 0.285 ± 0.010 0.269 ± 0.005 CHEN-apo 0.085 ± 0.005 0.092 ± 0.000 0.186 ± 0.003 0.264 ± 0.004 0.206 ± 0.005 0.227 ± 0.005 0.242 ± 0.004 0.211 ± 0.003 0.257 ± 0.004 0.240 ± 0.006 Table 3. (BRI metric) Average IOU of binding residues against the detected ligands. The mean and standard deviation are calculated based on the metric values for 5 different cross- validation folds. DeepSurf Kalasanty Deeppocket Ours Ours(BERT) Ours(no CNN) Ours(no alignment) Ours(no augmentation) Ours(no homology) Ours(no perturbation) scPDB(held-out) 0.402 ± 0.010 0.356 ± 0.000 0.595 ± 0.002 0.643 ± 0.004 0.567 ± 0.012 0.624 ± 0.002 0.637 ± 0.005 0.522 ± 0.001 0.628 ± 0.003 0.596 ± 0.006 COACH420 0.419 ± 0.013 0.362 ± 0.000 0.506 ± 0.005 0.585 ± 0.007 0.459 ± 0.013 0.548 ± 0.004 0.572 ± 0.001 0.475 ± 0.007 0.567 ± 0.009 0.547 ± 0.008 HOLO4k 0.330 ± 0.007 0.344 ± 0.000 0.371 ± 0.004 0.415 ± 0.002 0.356 ± 0.007 0.395 ± 0.002 0.413 ± 0.002 0.347 ± 0.004 0.412 ± 0.002 0.391 ± 0.004 CHEN-holo 0.372 ± 0.019 0.333 ± 0.000 0.395 ± 0.008 0.495 ± 0.010 0.353 ± 0.016 0.450 ± 0.014 0.479 ± 0.005 0.397 ± 0.010 0.481 ± 0.007 0.468 ± 0.008 CHEN-apo 0.336 ± 0.020 0.323 ± 0.000 0.382 ± 0.006 0.473 ± 0.004 0.328 ± 0.010 0.419 ± 0.006 0.450 ± 0.006 0.380 ± 0.007 0.449 ± 0.010 0.445 ± 0.008 Figure 3. The effect of transfer learning on the BSD training Figure 4. The effect of the augmentation methods on the training 12 DAESEOK LEE, JEUNGHYUN BYUN, AND BONGGUN SHIN (in particular the homology augmentation) showed positive contributions consistently and significantly. Omit- ting each component resulted in the decrease in the model's performance as follows: • The geometric information: 4.3%p • The transfer learning: 4.64%p • The augmentation as a whole: 3.84%p • The homology augmentation: 1.74%p • The random perturbation augmentation: 0.14%p However, we observed that not all components of our proposed model showed consistent contributions to the model's performance across different datasets. This was the case for the use of CNN, the grid alignment and the random perturbation. The questionable effects of the first two components may be accounted to the insufficient size of the training dataset for the BSD task. We believe that the model required a larger training dataset to compensate for the increased model complexity from the introduction of the CNN component. Similarly, aligning the grids rather than applying a random rotation to the grids may have decreased the diversity of the training dataset. Lastly, the random perturbation's questionable contribution may be attributed to the offset in the effects from the homology augmentation. Indeed, the random perturbation resulted in a significant improvement in performance in the absence of the homology augmentation, which can be confirmed by comparing "no augmentation" with "no homology" in Table 1 and Figure 4. 5.8.2. The effect of transfer learning. Figure 3 shows the effect of transfer learning in the BSD training. Accord- ing to the plot, the transfer learning had two effects on the training process. Firstly, it significantly accelerated the convergence speed. In fact, validation loss almost dropped to the convergence level in 2000 steps. Note that until 4000 steps, we updated only the weights of the un-pretrained parts. Secondly, the transfer learning also significantly improved the validation loss of the converged state. This finding is compatible with the ablation result of Table 1. 5.8.3. BRI performance. In terms of the BRI performance, Table 2 and Table 3 show that our model outper- formed the baselines by a significant margin on all test datasets. In particular, while the strongest baseline model Deeppocket performed poorly on the external test datasets, our model did not. This shows our model generalizes well to the proteins such that no similar proteins are encountered during training. The ablation results show that all key components of our method explained in 4 contributed significantly in the good performance. These components are (1) the architectural aspects (the CNN and attention layers), (2) the grid alignment process and (3) the augmentation methods. 5.8.4. The effect of augmentation. Figure 4 shows that the augmentation contributed significantly in alleviating over-fitting in all training scenarios (pre-training the BSD module, fine-tuning the BSD module and training the BRI module). While the augmentation as a whole was shown to dramatically reduce the over-fitting, individual augmentation methods (random perturbation and homology augmentation) were also shown to be effective. This finding is compatible with the ablation results of Table 1, Table 2 and Table 3. 5.9. Conclusions. In general, our model significantly outperformed the baseline methods in terms of both BSD and BRI. All key components in 4 contributed to the performance, with some exceptions with respect to BSD. Additional analyses confirmed that the transfer learning and the augmentation worked as intended during training. The transfer learning accelerated and improved the convergence, and the augmentation methods helped overcome the over-fitting problem. 6. A case study We conducted a case study to demonstrate our model's applicability in real-world drug discovery scenarios. We chose Human Serum Albumin (HSA) as the target protein, due to its relevance to the drug discovery and the fact that it binds to various molecules at different sites ([PJ95], [Car03], [PKP+21]). To examine our model's performance on HSA, we drew on two prior studies on the binding sites of HSA ([Car03], [WHR+13]), and analyzed how compatible our BSD and BRI modules' predictions were with the findings of the studies. The remaining parts of this section are organized as follows: • In 6.1, we briefly explain the structure of HSA, and elucidate what the reference papers ([Car03], [WHR+13]) revealed about the binding sites of it. • In 6.2, we explain basic settings of our case study experiments. • In 6.3, we analyze our BSD module's performance on HSA based on the findings of [Car03]. • In 6.4, we analyze our BRI module's performance on HSA based on the findings of [WHR+13]. BOOSTING CONVOLUTIONAL NEURAL NETWORKS' PROTEIN BINDING SITE PREDICTION CAPACITY USING SE(3)-INVARIANT TRANSFORMERS, TRANSFER LEARNING AND HOMOLOGY-BASED AUGMENTATION13 Figure 5. The subdomains of HSA 6.1. The structure and Binding Sites of HSA. HSA is composed of three homologous domains (I, II, III), each composed of two subdomains A and B, as depicted in Figure 5 ([PJ95], [Car03]). The authors of [Car03] performed a large-scale survey of HSA binding sites based on 142 crystal structures involving HSA. By analyzing the complexes, they identified 14 different binding sites, alongside their frequencies. They noted that binding sites "IB", "IIA" and "IIIA" dominated clearly. Inspired from this result, the authors of [WHR+13] provided more detailed analysis on the binding sites at the IB subdomain. They did so by inspecting the crystal sructures of 6 oncology drugs (9-amino-camptothecin, camptothecin, idarubicin, teniposide, etoposide and bicalutamide) in complex with HSA. In particular, for each structure, they identified all key residues of HSA and their interaction types with the drug molecule. 6.2. Basic settings. We designed the analyses such that they can faithfully assess our model's real-world applicability. Firstly, before the analyses, we trained our model with a new dataset split (different from the ones used in our main experiments) to prevent data leakage. Specifically, we removed all 42 "albumin" structures from the scPDB v.2017 dataset, randomly sampled a validation set of size 1000 from the remaining, and took all the other proteins as the training set. Moreover, we ensured that there is no leakage coming from the homology-based augmentation, by using a new augmentation dataset generated from the new training set. Secondly, all our model's predictions are based on taking as input the HSA structure provided by the Al- phafold database ([TAW+21]. Therefore, a good performance under this setting would imply that our model can be used to predict the binding sites of a protein without any known experimental structures. In particular, one can make use of the publicly available Alphafold database in the predictions. 6.3. Binding Site Detection. 6.3.1. experiment procedure. First, we obtained our model and Deeppocket's BSD module's predictions on 15 binding sites identified by [Car03]. This means that the predictions were made based on 15 different inputs, where we set the "binding site center" to be the mean alpha carbon coordinates of residues comprising one of the binding sites. The indices of residues comprising each binding site were provided by [Car03]. Note that we re-trained the Deeppocket model with a new dataset split to avoid data leakage, just as we did for our model. Then, we assessed each model's predictions by comparing them with the ranks of the frequencies of the binding sites as recorded in [Car03]. 6.3.2. results and analysis. The results are summarized in Figure 6. Note that our model successfully assigned high (more than 70%) druggability scores on the second to sixth most frequent binding sites. Moreover, these five were exactly the binding sites that scored the highest. The probability of the latter condition being met by a random ordering is only 0.2%, which shows the statistical significance of our model's ability in replicating binding sites' frequency ranks. On the other hand, although Deeppocket assigned high druggability scores on the second and third most frequent binding sites, it failed to do so on the fourth to sixth most frequent ones. 6.4. Binding Residue Identification. 14 DAESEOK LEE, JEUNGHYUN BYUN, AND BONGGUN SHIN Figure 6. A comparison between our BSD module's predictions and the frequencies from [Car03] (a) All 6 drug molecules examined in [WHR+13] (b) Our model's prediction (c) Deep- pocket's prediction (d) Kalasanty's prediction (e) DeepSurf's prediction Figure 7. The purple, red and blue residues indicate the true-positive, false-positive and false- negative binding site residues respectively. Therefore, the larger the purple region is compared to the regions with the other colors, the better the prediction is. BOOSTING CONVOLUTIONAL NEURAL NETWORKS' PROTEIN BINDING SITE PREDICTION CAPACITY USING SE(3)-INVARIANT TRANSFORMERS, TRANSFER LEARNING AND HOMOLOGY-BASED AUGMENTATION15 6.4.1. experiment procedure. First, we predicted the binding site residues in the IB subdomain of HSA using our model and all the baseline methods - Deeppocket, Kalsanty and DeepSurf. When obtaining our model's (resp. Deeppocket's) predictions, we set the "binding site center" to be the mean alpha carbon coordinate of the IB subdomain residues, and run the BRI module (resp. the segmentation model ). Note that as we did for our model, we re-trained the Deeppocket and DeepSurf models with a new dataset split to avoid data leakeage. Then, we visually inspected the binding residues predicted by different methods, comparing them with the ground truth provided by [WHR+13]. As the ground truth, we took the union of all the "key residues" (in the IB subdomain) of the 6 drug molecules as determined by [WHR+13]. 6.4.2. results and analysis. The results are visualized in Figure 7. From the figures, it is clear that our model's prediction best matched with the ground truth. In particular, while all the baseline models resulted in false- positives within the left-bottom helix, our model did not. Also, while all the baseline models showed limited precision in identifying the key residues in the other parts of the IB subdomain, our model showed mostly successful identifications. 7. Methods 7.1. The residue orientation. Our model uses a concept of "residue orientation" in the grid alignment process and the geometric attention layers. In the grid alignment process, the grid axes are aligned with respect to the orientations. In the geometric attention layers, the orientations are used as a part of the input. We define the residue orientation in terms of the relative positions of atoms surrounding the alpha carbon, as in [JEP+21]. More precisely, when x1, x2 and x3 are the coordinates of N , Cα and C (the carbon that is not Cβ and adjacent to Cα), the rotation matrix R = (e1 e2 e3) that we refer to as "orientation" is obtained as follows: v1 = x3 − x2 v2 = x1 − x2 e1 = v1/ (cid:107)v1(cid:107) u2 = v2 − (e1 * v2)e1 e2 = u2/ (cid:107)u2(cid:107) e3 = e1 × e2 7.2. The grid featurization. As explained in 4.2 and 4.3, our BSD and BRI modules take as input a sequence of 3D voxelized images, where each image represents the local environment of a residue. The process of making such voxelized images, the "grid featurization", proceeds as follows: (1) Collect coordinates xi ∈ R3 (1 ≤ i ≤ n) of the heavy (non-hydrogen) atoms in the protein. (2) Collect feature vectors fi ∈ Rdf eature (1 ≤ i ≤ n) of the heavy atoms. (3) Given a choice of grid axes (e1, e2, e3), a cubical grid is laid such that the centers of the voxels in the grid become t + 3 (cid:88) i=1 r(ai − L − 1 2 )ei ((a1, a2, a3) ∈ {0, * * * , L − 1}3) , where t is the grid center (the alpha carbon coordinate), r is the grid resolution and L is the grid size. (4) Compute feature vectors corresponding to each voxel in the grid, by summing up those of nearby heavy atoms. The same process was used in [AGC+21], [MAD21] and [SDZS20], although the grids in those methods are not laid on the protein residues. The specific details of our grid-featurization process are: • The grid resolution is 1 ̊A and the grid size is 16. • The atom features are of dimension 18 and include atom types, hybridization, degree, partial charge and aromaticity. ([SDZS20], [AGC+21].) 7.3. The grid alignment. As explained in 4.6, we apply the "grid alignment" during the grid featurization to promote SE(3)-invariance. This means that we choose the grid axes to be the vectors comprising the residue orientation (See 7.1). 16 DAESEOK LEE, JEUNGHYUN BYUN, AND BONGGUN SHIN 7.4. The CNN model. Our model incorporates a 3D CNN to encode the residue-level grid features. For the CNN architecture, it uses a 3D BottleNeck ResNet model introduced in [MAD21]. The model is adapted from the bottleneck ResNet model introduced in [HZRS16] for the image classification. The bottleneck architecture reduces the number of parameters thus enables the use of a deeper network. [MAD21] showed that the 3D BottleNeck ResNet model, while being light, performed competitively well compared to its non-bottleneck counterpart. 7.5. The geometric attention layers. The geometric attention is an integral part of our model's architecture. The attention mechanism was adopted from Alphafold([JEP+21])'s IPA(Invariant Point Attention) with an adjustment necessary to adapt it to our forms of inputs. The inputs of the attention layers are composed of the following: • xi ∈ Rdhidden (i = 1, * * * , n), hidden vectors associated to the residues. • Ti = (Ri, ti) ∈ SO(3) × R3 (i = 1, * * * , n), the local frames associated to the residues, where ti is the position of the alpha carbon and Ri is the rotation matrix that represents the residue orientation (See 7.1). Note that the operation v (cid:55)→ Tiv maps the local coordinates (with respect to the local frame) to the corresponding global coordinates, and the operation u (cid:55)→ T −1 i u plays the reverse role. Then, the computation is carried out in the following steps (See also Figure 2): (1) The standard query and key vectors qh i and kh i are computed by the linear mappings from xi. Here, h stands for a "head". (2) The geometric query and key vectors qhp i and khp i in R3 are computed by the linear mappings from xi. Here, h stands for a "head" and p stands for a "point" of attention. (3) The attention weight from the i-th token to the j-th token is computed from a linear combination of the standard attention weight wh,standard ij = √ 1 dhidden i * kh qh j and the geometric attention weight (7.1) wh,geometric ij = 1 (cid:112)Npoints (cid:88) p (cid:13) (cid:13)Tiqhp (cid:13) i − Tjkhp j (cid:13) (cid:13) (cid:13) by applying a softmax operation. More precisely, the attention weight becomes wh ij = sof tmaxj( 1 √ 2 (wh,standard ij − log(1 + γh)wh,geometric ij )) where γh is a learnable parameter. (4) The standard value vectors vh j are computed by a linear map from xj, and aggregated as oh i = (cid:88) j wh ijvh j (5) The geometric value vectors vh j are computed by a linear map from xj, and aggregated as (7.2) ohp i = T −1 i (cid:88) ( j wh ijTjvhp j ) (6) The aggregated vectors as well as their sizes are concatenated and linearly mapped via ff inal to produce the output of the attention layer i = ff inal(concath,p(oh x(cid:48) i , ohp i (cid:13) (cid:13)ohp (cid:13) i (cid:13) (cid:13) (cid:13))) , The adjustment made to the original IPA is the omission of the "attention bias" term. In the original paper, this term was based on the "pair representation" computed at the earlier stages of the Alphafold architecture using the evolutionary information of the protein. Since our model does not involve this representation, the omission is necessary to use the IPA in our model. 7.6. SE(3)-invariance of the geometric attention layers. As noted in 4.6, our model's SE(3)-invariance relies on the attention layer's SE(3)-invariance. In order to prove that the layer is SE(3)-invariant, one has to examine the equality (4.2). Essentially, the equality holds for our attention layer because the quantities (7.1) and (7.2), as functions of {xi}n i=1 and {Ti}n i=1, satisfy the same equality. For any T ∈ SE(3), the (7.1) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)Tiqhp i − Tjkhp i − T Tjkhp (cid:13)T Tiqhp (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (since T preserves j ) (cid:13) = satisfies the equality because (cid:13) = the norm), and (7.2) satisfies the equality because (T Ti)−1((cid:80) i T −1T ((cid:80) ij(T Tj)vhp j ) = T −1 j wh j ) = T −1 j ). Note that this derivation is almost identical to that presented in [JEP+21](Supplementary i Information, page 28). (cid:13) (cid:13)T (Tiqhp (cid:13) i − Tjkhp ijTjvhp ijTjvhp j wh j wh ((cid:80) j j BOOSTING CONVOLUTIONAL NEURAL NETWORKS' PROTEIN BINDING SITE PREDICTION CAPACITY USING SE(3)-INVARIANT TRANSFORMERS, TRANSFER LEARNING AND HOMOLOGY-BASED AUGMENTATION17 Figure 8. These figures illustrate the way our homology-based augmentation determines the positive and negative binding site candidates in augmented proteins. Figure (A) depicts an augmented protein, where there are two positive (the blue points) and one negative (the red point) binding site candidate centers. Out of binding site candidates proposed by Fpocket, they are labeled based on the distances to the proxy centers (the purple points) of binding sites inferred from homology relations. Figures (B) and (C) depict the homologous proteins in the original database that gave rise to the inferred binding sites in the augmented protein. X and Y are their ligands. The bright and dark green regions of the chains indicate the residues in close proximity to the ligands, while only the bright green region has evolutionary correspondence to residues in the augmented protien. The bright green region must comprise at least 50% of the entire green region in order for the binding site to count. (a) structure of UniProt Q9VC32 from the Alphafold database (b) structure of PDB 4G34 from scPDB (c) structure of PDB 4BID from scPDB Figure 9. These figures illustrate the way our homology-based augmentation assigns residue labels in augmented proteins with respect to a positive binding site candidate. Figure (A) illustrates UniProt protein Q9VC32 as an augmented protein. The red and purple residues correspond to the red residues in figure (B) of the PDB protein 4G34, which are the ligand- binding residues. Similarly, the blue and purple residues correspond to the blue residues in figure (C) of the PDB protein 4BID, which are the ligand-binding residues. The purple residues, the intersection, attain labels 1.0, while the other colored residues attain labels 0.5. This means that our augmentation method regards the purple residues as the most likely ligand-binding ones. 7.7. The Homology-based Augmentation. The "homology-based augmentation" is one of our new augmen- tation methods used to overcome the problem of over-fitting. It is distinguished from the usual augmentation methods in that it is not based on transformations applied to the samples on the fly during the training. Instead, it pre-computes appropriate "augmented samples" out of an external database of unlabelled protein structures, and use the augmented dataset consisting of the augmented samples during training. Essentially, the augmented samples are selected based on the sequence alignments computed with respect to the proteins in the original 18 DAESEOK LEE, JEUNGHYUN BYUN, AND BONGGUN SHIN training set. In this section, we describe the augmentation method in more detail, clarifying its inputs, outputs, the procedures and the underlying rationale. The augmentation method requires a seed database S ∗ of multi-chain protein-ligand complexes and a target database T of single-chain protein structures. In our instantiation, S ∗ was the portion of the scPDB dataset used to train the current fold of the cross-validation. For T , we used the entire Alphafold Protein Structure Database (as of April. 2022) that contained 992,316 protein structures from the proteome of human and 47 other key organisms as well as the Swiss-Prot entries. The augmentation procedure outputs two types of information, which together form the "augmented dataset" and are used during the training as described in 5.7. The first information denotes the centers of the binding site candidates in proteins in a selected subset of T , labeled either positive or negative. This is used to augment the BSD train dataset. The second information denotes, for each previous positive binding site candidates, the likelihood of each nearby protein residue to be a ligand-binding residue. This is used to augment the BRI train dataset. In the following, we describe the steps of the procedure. The italized words are general terms whose specifi- cation may vary depending on own's needs. Whenever there is an italized word, we provide our specification at the end of the step. (1) In each holo structure of S ∗, find ligands associated to exactly one chain. As a result, obtain a database S of protein chains associated to at least one such single-chain ligands. (A chain can be associated to multiple single-chain ligands) We define that a chain and a ligand are associated to each other if they have heavy atoms within 4 ̊A to each other. (2) Run a homology search algorithm with S as the query database and T (the database of single-chain protein structures) as the target database. Based on the results, obtain a MSA for each chain in S. For the homology search algorithm, we use the software HHBlits with its default setting. (3) For each triplet (x, l, y), composed of: (1) a query chain x in S (2) a ligand l associated to x found in step 1 of the procedure and (3) a target chain y aligned with x in the MSA, determine whether the ligand l's binding site in x is preserved in y. The triplets for which the previous determination was affirmative will be called preserving. We define that a triplet (x, l, y) is preserving if at least half of the residues of x that are in close contact with l (heavy atoms within 4 ̊A) are aligned with a residue of y in the MSA. (4) For each preserving triplet (x, l, y), find a proxy center of the binding site in y that corresponds to the ligand l's binding site in x. We define the proxy center to be the mean of the alpha carbon coordinates of the residues of y aligned in the MSA with a residue of x in close contact with l. (5-1) On each chain y in T that is involved in at least one preserving triplet, run Fpocket to get an initial list of binding site center candidates. Label a candidate center "positive" if it is within a lower threshold from a proxy center obtained in the previous step. Label it "negative" if it is farther than a higher threshold from any such proxy center. If a candidate center does not fall into these categories, ignore it and exclude it from the dataset. We define the lower threshold to be 7.5 ̊A and the upper threshold to be 30 ̊A. Figure 8 illustrates this step using schematic figures. (5-2) For each positively labeled binding site candidate from the previous step, label residues of y with the estimated likelihood of comprising the binding site. The estimate is obtained as a result of "voting" of the homologous chains in S that gave rise to the binding site. More specifically, among the preserving triplets (x, l, y) whose proxy center gave rise to the binding site (in the sense of the step (5-1)), the proportion of such triplets for which the residue at hand corresponds (in MSA) to a residue in the binding site of l is computed. Figure 9 illustrates this step using an actual example. The assignments of different labels in the previous procedure are based on the following hypotheses: • The positive binding site label: if a pocket-like site (discovered by a geometry-based BSP method) is surrounded by the sequence fragments that are homologous to the binding site sequence fragments of other proteins, it is likely to be a binding site. • The negative binding site label: even if a site is pocket-like, if it is far from any sequence fragments that are homologous to the binding site sequence fragments of other proteins (in a given seed database), it is unlikely to be a binding site. • The residue labels: whether a residue nearby a binding site is a part of the binding site or not can be determined by whether the same is true for corresponding residues of the homologous binding sites. These hypotheses except the second one have been the bases of the template-based BSP methods introduced in 2.1.3. However, the second hypothesis is, to our knowledge, has not been employed in the previous BSP methods. The result of ablating the homology augmentation in Table 1 provides a partial evidence that this hypothesis BOOSTING CONVOLUTIONAL NEURAL NETWORKS' PROTEIN BINDING SITE PREDICTION CAPACITY USING SE(3)-INVARIANT TRANSFORMERS, TRANSFER LEARNING AND HOMOLOGY-BASED AUGMENTATION19 is valid at least to some degree. Otherwise if the negative labels did not provide valuable learning signals, the homology augmentation would have had only adversary effects on the BSD module's performance. [AGC+21] [BCM+10] [BGL+21] [BMR08] [BNL03] [Car03] [CLT+09] [CMGK11] [DBRK15] [FWFW20] [Hal09] [HBF+01] [HGS09] [HZRS16] [JDMR+17] [JEP+21] [JK19] [KH18] [LGST09] [LJ05] [LYH+19] [MAD21] References Rishal Aggarwal, Akash Gupta, Vineeth Chelur, CV Jawahar, and U Deva Priyakumar. Deeppocket: ligand binding site detection and segmentation using 3d convolutional neural networks. Journal of Chemical Information and Modeling, 2021. Natasja Brooijmans, Yu-Wei Chang, Dominick Mobilio, Rajiah A Denny, and Christine Humblet. An enriched structural kinase database to enable kinome-wide structure-based analyses and drug discovery. Protein Science, 19(4):763–774, 2010. Brian J Bender, Stefan Gahbauer, Andreas Luttens, Jiankun Lyu, Chase M Webb, Reed M Stein, Elissa A Fink, Trent E Balius, Jens Carlsson, John J Irwin, et al. A practical guide to large-scale docking. Nature protocols, 16(10):4799–4832, 2021. Caterina Barillari, Gilles Marcou, and Didier Rognan. Hot-spots-guided receptor-based pharmacophores (hs- pharm): a knowledge-based approach to identify ligand-anchoring atoms in protein cavities and prioritize structure- based pharmacophores. Journal of chemical information and modeling, 48(7):1396–1410, 2008. T Andrew Binkowski, Shapor Naghibzadeh, and Jie Liang. Castp: computed atlas of surface topography of proteins. Nucleic acids research, 31(13):3352–3355, 2003. Daniel C Carter. Crystallographic survey of albumin drug interaction and preliminary applications in cancer chemotherapy. Burger's Medicinal Chemistry and Drug Discovery, pages 437–468, 2003. John A Capra, Roman A Laskowski, Janet M Thornton, Mona Singh, and Thomas A Funkhouser. Predicting protein ligand binding sites by combining evolutionary sequence conservation and 3d structure. PLoS computational biology, 5(12):e1000585, 2009. Ke Chen, Marcin J Mizianty, Jianzhao Gao, and Lukasz Kurgan. A critical comparative assessment of predictions of protein-binding sites for biologically relevant organic compounds. Structure, 19(5):613–621, 2011. J ́er ́emy Desaphy, Guillaume Bret, Didier Rognan, and Esther Kellenberger. sc-pdb: a 3d-database of ligandable binding sites-10 years on. Nucleic acids research, 43(D1):D399–D404, 2015. Fabian Fuchs, Daniel Worrall, Volker Fischer, and Max Welling. Se (3)-transformers: 3d roto-translation equivari- ant attention networks. Advances in Neural Information Processing Systems, 33:1970–1981, 2020. Thomas A Halgren. Identifying and characterizing binding sites and assessing druggability. Journal of chemical information and modeling, 49(2):377–389, 2009. Sepp Hochreiter, Yoshua Bengio, Paolo Frasconi, J ̈urgen Schmidhuber, et al. Gradient flow in recurrent nets: the difficulty of learning long-term dependencies, 2001. Marylens Hernandez, Dario Ghersi, and Roberto Sanchez. Sitehound-web: a server for ligand binding site identi- fication in protein structures. Nucleic acids research, 37(suppl 2):W413–W416, 2009. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. Jos ́e Jim ́enez, Stefan Doerr, Gerard Mart ́ınez-Rosell, Alexander S Rose, and Gianni De Fabritiis. Deepsite: protein- binding site predictor using 3d-convolutional neural networks. Bioinformatics, 33(19):3036–3042, 2017. John Jumper, Richard Evans, Alexander Pritzel, Tim Green, Michael Figurnov, Olaf Ronneberger, Kathryn Tunyasuvunakool, Russ Bates, Augustin ˇZ ́ıdek, Anna Potapenko, et al. Highly accurate protein structure prediction with alphafold. Nature, 596(7873):583–589, 2021. Justin M Johnson and Taghi M Khoshgoftaar. Survey on deep learning with class imbalance. Journal of Big Data, 6(1):1–54, 2019. Radoslav Kriv ́ak and David Hoksza. P2rank: machine learning based tool for rapid and accurate prediction of ligand binding sites from protein structure. Journal of cheminformatics, 10(1):1–12, 2018. Vincent Le Guilloux, Peter Schmidtke, and Pierre Tuffery. Fpocket: an open source platform for ligand pocket detection. BMC bioinformatics, 10(1):1–11, 2009. Alasdair TR Laurie and Richard M Jackson. Q-sitefinder: an energy-based method for the prediction of protein– ligand binding sites. Bioinformatics, 21(9):1908–1916, 2005. Zhirui Liao, Ronghui You, Xiaodi Huang, Xiaojun Yao, Tao Huang, and Shanfeng Zhu. Deepdock: enhancing ligand-protein interaction prediction by a combination of ligand and structure information. In 2019 IEEE Inter- national Conference on Bioinformatics and Biomedicine (BIBM), pages 311–317. IEEE, 2019. Stelios K Mylonas, Apostolos Axenopoulos, and Petros Daras. Deepsurf: a surface-based deep learning approach for the prediction of ligand binding sites on proteins. Bioinformatics, 37(12):1681–1690, 2021. [NHZ+12] [NKC+16] [MLAdRCW21] Oscar M ́endez-Lucio, Mazen Ahmad, Ehecatl Antonio del Rio-Chanona, and J ̈org Kurt Wegner. A geometric deep learning approach to predict binding conformations of bioactive molecules. Nature Machine Intelligence, 3(12):1033–1039, 2021. Chi-Ho Ngan, David R Hall, Brandon Zerbe, Laurie E Grove, Dima Kozakov, and Sandor Vajda. Ftsite: high accuracy detection of ligand binding sites on unbound protein structures. Bioinformatics, 28(2):286–287, 2012. Tony Ngo, Irina Kufareva, James LJ Coleman, Robert M Graham, Ruben Abagyan, and Nicola J Smith. Identi- fying ligands at orphan gpcrs: current status using structure-based approaches. British journal of pharmacology, 173(20):2934–2951, 2016. Theodore Peters Jr. All about albumin: biochemistry, genetics, and medical applications. Academic press, 1995. Jimin Park, Mi-Sun Kim, Taeseong Park, Young Hwan Kim, and Dong Hae Shin. Crystal structure of pharmaceutical-grade human serum albumin. International Journal of Biological Macromolecules, 166:221–228, 2021. Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image seg- mentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234–241. Springer, 2015. Ambrish Roy and Yang Zhang. Recognizing protein-ligand binding sites by global structural alignment and local geometry refinement. Structure, 20(6):987–997, 2012. [PJ95] [PKP+21] [RFB15] [RZ12] 20 [SB09] [SDZS20] [SGP+22] [SK19] [SSS+19] [TAW+21] [VSP+17] [WHR+13] [WKS10] [YRZ13] [ZCZ20] [ZP11] DAESEOK LEE, JEUNGHYUN BYUN, AND BONGGUN SHIN Jeffrey Skolnick and Michal Brylinski. Findsite: a combined evolution/structure-based approach to protein function prediction. Briefings in bioinformatics, 10(4):378–391, 2009. Marta M Stepniewska-Dziubinska, Piotr Zielenkiewicz, and Pawel Siedlecki. Improving detection of protein-ligand binding sites with 3d segmentation. Scientific reports, 10(1):1–9, 2020. Hannes St ̈ark, Octavian Ganea, Lagnajit Pattanaik, Regina Barzilay, and Tommi Jaakkola. Equibind: Geometric deep learning for drug binding structure prediction. In International Conference on Machine Learning, pages 20503–20521. PMLR, 2022. Connor Shorten and Taghi M Khoshgoftaar. A survey on image data augmentation for deep learning. Journal of big data, 6(1):1–48, 2019. Jiyong Su, Chenyang Song, Yunlong Si, Linlin Cui, Tong Yang, Yuying Li, Hao Wang, Guihua Tai, and Yifa Zhou. Identification of key amino acid residues determining ligand binding specificity, homodimerization and cellular distribution of human galectin-10. Glycobiology, 29(1):85–93, 2019. Kathryn Tunyasuvunakool, Jonas Adler, Zachary Wu, Tim Green, Michal Zielinski, Augustin ˇZ ́ıdek, Alex Bridg- land, Andrew Cowie, Clemens Meyer, Agata Laydon, et al. Highly accurate protein structure prediction for the human proteome. Nature, 596(7873):590–596, 2021. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, (cid:32)Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pages 5998–6008, 2017. Zhong-min Wang, Joseph X Ho, John R Ruble, John Rose, Florian R ̈uker, Melanie Ellenburg, Robert Murphy, James Click, Elizabeth Soistman, Leslie Wilkerson, et al. Structural studies of several clinically important on- cology drugs in complex with human serum albumin. Biochimica et Biophysica Acta (BBA)-General Subjects, 1830(12):5356–5374, 2013. Mark N Wass, Lawrence A Kelley, and Michael JE Sternberg. 3dligandsite: predicting ligand-binding sites using similar structures. Nucleic acids research, 38(suppl 2):W469–W473, 2010. Jianyi Yang, Ambrish Roy, and Yang Zhang. Protein–ligand binding site recognition using complementary binding- specific substructure comparison and sequence profile alignment. Bioinformatics, 29(20):2588–2595, 2013. Jingtian Zhao, Yang Cao, and Le Zhang. Exploring the computational methods for protein-ligand binding site prediction. Computational and structural biotechnology journal, 18:417–426, 2020. Hongbo Zhu and M Teresa Pisabarro. Mspocket: an orientation-independent algorithm for the detection of ligand binding pockets. Bioinformatics, 27(3):351–358, 2011. Email address: [email protected] Email address: [email protected] Email address: [email protected]
http://arxiv.org/abs/2302.09759v1
2023-02-20T04:52:24
2023-02-20T04:52:24
Learning Goal-based Movement via Motivational-based Models in Cognitive Mobile Robots
Humans have needs motivating their behavior according to intensity and context. However, we also create preferences associated with each action's perceived pleasure, which is susceptible to changes over time. This makes decision-making more complex, requiring learning to balance needs and preferences according to the context. To understand how this process works and enable the development of robots with a motivational-based learning model, we computationally model a motivation theory proposed by Hull. In this model, the agent (an abstraction of a mobile robot) is motivated to keep itself in a state of homeostasis. We added hedonic dimensions to see how preferences affect decision-making, and we employed reinforcement learning to train our motivated-based agents. We run three agents with energy decay rates representing different metabolisms in two different environments to see the impact on their strategy, movement, and behavior. The results show that the agent learned better strategies in the environment that enables choices more adequate according to its metabolism. The use of pleasure in the motivational mechanism significantly impacted behavior learning, mainly for slow metabolism agents. When survival is at risk, the agent ignores pleasure and equilibrium, hinting at how to behave in harsh scenarios.
[ "Letícia Berto", "Paula Costa", "Alexandre Simões", "Ricardo Gudwin", "Esther Colombini" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09759v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09759v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.RO", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.RO", "cs.LG" ]
Learning Goal-based Movement via Motivational-based Models in Cognitive Mobile Robots Let ́ıcia Berto , Paula Costa , Alexandre Sim ̃oes , Ricardo Gudwin and Esther Colombini 1 3 2 0 2 b e F 0 2 ] O R . s c [ 1 v 9 5 7 9 0 . 2 0 3 2 : v i X r a Abstract-Humans have needs motivating their behavior ac- cording to intensity and context. However, we also create preferences associated with each action's perceived pleasure, which is susceptible to changes over time. This makes decision- making more complex, requiring learning to balance needs and preferences according to the context. To understand how this process works and enable the development of robots with a motivational-based learning model, we computationally model a motivation theory proposed by Hull. In this model, the agent (an abstraction of a mobile robot) is motivated to keep itself in a state of homeostasis. We added hedonic dimensions to see how preferences affect decision-making, and we employed reinforcement learning to train our motivated-based agents. We run three agents with energy decay rates representing different metabolisms in two different environments to see the impact on their strategy, movement, and behavior. The results show that the agent learned better strategies in the environment that enables choices more adequate according to its metabolism. The use of pleasure in the motivational mechanism significantly impacted behavior learning, mainly for slow metabolism agents. When survival is at risk, the agent ignores pleasure and equilibrium, hinting at how to behave in harsh scenarios. Index Terms-Motivation, Action selection and planning, Mod- els of internal states, Internal reinforces I. INTRODUCTION Traveling around the world, meeting beauty standards, being wealthy and independent, using renewable energies on a large scale, developing aerospace transportation, understanding the universe, exploring Mars, and mortality are desires, dreams, and goals of human beings. To achieve them, the first step is to be motivated. Motivation describes the wants or needs that direct behavior toward a goal [1]. Motivations are vital for living beings, and they are re- sponsible for essential functions, like (i) guiding behavior to attend to the most critical need at the moment, (ii) designating the amount of energy to be used for executing the selected actions, and (iii) generating learning signals [2], [3]. However, although we know the importance of motivation in our lives, we still do not have a consolidated explanation about its functioning. There are days when we genuinely desire to E. Colombini and L. Berto are with the Laboratory of Robotics and Cognitive Systems, Institute of Computing, University of Campinas, Brazil R. Gudwin, P. Costa are with the Dept. of Computer Engineering and Indus- trial Automation, School of Electrical and Computer Engineering, University of Campinas, Brazil A. Sim ̃oes is with Dept. of Control and Automation Engineering, Institute of Science and Technology, S ̃ao Paulo State University, Sorocaba, Brazil All authors are with Artificial Intelligence and Cognitive Architectures Hub (H.IAAC), University of Campinas, Brazil perform a particular action. For some reason, this motivation does not seem to exist on other days. When we are happy, we are willing to take more risks [4]. However, this willingness for risk-taking does not apply in a situation that we assess as problematic [5]. Some of our goals will not be achieved only by individual effort, but we work for it even so. For humans, motivation to engage in activities involves the perception of mastering the activity [6], sense of control over the environment [7] and appropriate level of learning challenge [8]. As we can see, several factors impact our motivation, such as emotions, internal states, context, priorities, competing thoughts, concerns, life history, day of the week, and even time of year. We have many cognitive functions working together to determine each behavior that we will perform, making the decision-making increasingly complex. Motivation is divided into Intrinsic and Extrinsic [2], [9]. Extrinsic motivation (EM) is related to external rewards that directly impact homeostasis (equilibrium state). It guides be- havior learning, increasing survival chances in a particular environment by regulating homeostatic needs. Intrinsic mo- tivation (IM) is related to internal rewards detected within the brain's inherent satisfactions, and it allows learning skills without the necessity of immediate direct impact on home- ostasis. These skills are used to learn complex behaviors involving long chains of actions to regulate homeostatic needs. Although EM and IM work differently, they are connected, and psychologists found evidence indicating IM plays an es- sential function in creatures' behavior that yields a reward for learning activities [10]–[12]. IM is related to Reinforcement learning and has been attracting many researchers of cognitive computing and robotics [13]–[17]. Besides all the variables already mentioned, there is the dichotomy of wanting x liking [18], related to the motiva- tional mechanism. This dichotomy makes decision-making and learning even more complex. The want phenomenon occurs in the present. However, it relates to the future when the desire will be satisfied, establishing a goal. For example, I am hungry, so I want to eat, and after that, I will feel good again. So, want is related to needs over time. The liking phenomenon is associated with the present, and it is a subjective evaluation, internally perception, of a sensation or interaction (considering these, we will use the terms liking and pleasure as synonyms in this paper). I ate chocolate, and I liked it. Hence, liking is related to the object and varies as a function of the agent's state, and environment's perception [19]. Even though these two phenomenons work differently, they are related because we usually want things we like [20]. According to [21], pleasure influences cognition, and cognition influences pleasure. Given that the liking mechanism works as a subjective eval- uation, we can use it as a component to develop preferences. In this way, preferences are emerging features of learning about the reward. As in any learning situation, several parameters impact this process, like the context in which it happens, the state of the internal variables, the individual's needs, past experiences, and external factors like social impact and influ- ence. So, we consider that preferences can be an evolutionary mechanism. Once established, they can bias our decision- making, resulting in faster decisions. That is an advantage since the traditional process of perceiving the environment, deciding, acting in the world, and analyzing the result is costly. However, preferences can speed up this process via shortcuts. Although preferences allow the agent to make faster de- cisions, they can be tricky. The scenario when the preference was defined can be different from the one existing when using it, so it is necessary to evaluate if the preference remains the same or if it is required to update (or possibly change) it. In some situations, making a decision considering only the preference reward return could not be beneficial in the long-term run, so pondering between the short-term and long- term outcomes for choosing based on preferences or not is essential. Therefore, although having preferences can benefit our systems, it is fundamental to address whether we should use them. Satisfying our needs or experiencing pleasure adds another layer of complexity to the motivation and behavior rela- tionship. It requires one to reason considering context and priorities. Nevertheless, people are very different, even when acting in the same environment. This fact leads us to question, "How does this balancing mechanism work? How do distinct people learn and make decisions in similar surroundings? How do they act when needs and pleasure compete?". As we can see, many factors impact our motivation. Fur- thermore, our motivation affects our decision-making and behavior. A crucial remark is that we live in a social world, so our behavior impacts others and is one of the factors guiding our social interactions. For example, when we are starving, we look for food. Still, this physiological need can also impact our emotions and mood, like being stressed and impatient, making us less willing for social interactions. On the other side, if we feel sad or lonely, we seek our friends to feel better. Besides, we consider pleasures when engaging in activities or looking for new groups to interact with. We usually tend to choose activities that make us feel good and happier. So our needs also impact our social living. To help address the questions mentioned before and in- vestigate motivation's impact on social beings, we propose a motivation-based computational model. Based on this model, we built autonomous intelligent robots that will behave driven by their motivational mechanism. Using the dichotomy want- ing x liking, we created two motivational mechanisms: M1 and M2. M1 approaches the wanting mechanism that considers only the reinforcements from the drive reduction (needs satis- fied) in the learning process following the ideas of Hull's Drive 2 Reduction theory. M2 approaches the wanting mechanism and the liking one, which learns by reinforcements from drive reduction and pleasure. We aim to analyze the impact of the hedonic dimension (liking) in learning and evaluate the agent's balance between needs and pleasure. In this way, our experiments are incrementally complex. Usually, in a real-world system, there are several needs, which increases the complexity of the decision-making as each one is considered a feature. Also, having multiple features makes comprehending their impact on the learned behavior more challenging. In a previous work [22], we investigated only the wanting mechanism with multiple drives using M1 and considering short and long-term decisions. Results showed that in the long-term decision, the agent balances multiple needs, which is advantageous in the long run, while priori- tizing one in the short-term, which is disadvantageous in the long run. In this paper, we executed a new set of experiments con- sidering both motivational models under a new perspective: examine how distinct agents, but with the exact motivational mechanisms, learn to act in the same environment according to their specific necessities, how the environment influences our decisions and how good is using the heuristic data (the pleasure in this case) when making decisions. To reduce the investigation's complexity and approach it in more depth, we developed an agent with only one drive, equipped with M1 and M2. With the experience and results obtained from the previous work [22], our agent makes long-term decisions. We started our studies focused on understanding how these mech- anisms underlie the behavior exhibited in individuals with biological systems. Focusing on approaching these aspects first leads us to create intelligent cognitive agents [23]. Then we can evolve to more complex and broader scenarios in future works. We ran a series of experiments considering different agents, environments, and motivation mechanisms. We simulated three types of agents with different energy consumption rates – called metabolism – to analyze how agents with distinct metabolic curves would act in the same environment. To better understand how the environment impacts learning and the strategies adopted by each agent, we simulated two environ- ments. We used Q-learning [24]–[26] with a function approximator to allow for complex state and action representations as the Reinforcement Learning (RL) algorithm. The results show that the agent learned better strategies when running a want + liking motivational mechanism in the most challenging environment. A. Contributions As contributions of this work, we emphasize the following: • The proposal of a motivational computational model based on the Drive Reduction Theory and hedonic di- mensions; • The construction of a decision-making mechanism to the motivational system based on RL; • The use of drives explicitly to learn the decision-making and then implicitly to make a decision using the policy learned; • An analysis of the wanting x liking dichotomy with artificial creatures; • An investigation of the impact of different environments in the agent's behavior strategy; • An investigation of the impact of different agent's struc- ture and profiles in agent's behavior strategy; • An exploration of the impact of using fixed inherited pref- erences without updating them during the motivational- based learning in decision-making. All the code from this work is public available at our repository1. II. RELATED WORKS Aiming to create autonomous and intelligent artificial crea- tures that can act according to their own needs, many re- searchers have implemented artificial agents that take into account homeostasis and pleasure in the decision making [19], [27]–[47]. In [32], the agent learns to satisfy multiple drives with the priorities using the Sarsa(0) algorithm. In [33], [45], authors propose a decision-making system based on drives, motivations, and emotions in which the strengths of the internal drive and external stimulus interact. In this way, a motivated behavior is triggered by a strong stimulus if the drive is low and a mild stimulation if the drive is high. This approach can explain why we can choose actions unrelated to our current needs (for example, eating because we like the food and not because we are hungry). Cao et al. [39] follow the homeostatic drive concept to design a social behavior controller for robots used to per- form tasks with users in HRI experiments. They defined five needs (physical and social) correlated to five drives, and the decision-making system combines the hierarchical approach and the POSH reactive plans. The moment to change between satisfying one drive to another was defined a priori and always followed the same sequence. Vouloutsi et al. [47], and Breazeal [44], [48], [49] used homeostatic control that classifies the level of each drive into under homeostasis, homeostasis and over homeostasis. [47] defined multiple drives to be monitored by the homeostatic control. On top of homeostasis, they applied an allostatic con- trol to maintain the system balanced by selecting behavior and assigning priorities to satisfy the needs. The allostatic control switches from a reactive (reflexive) to an adaptive (deals with unpredictability) level, so the agent is not motivated by direct drive satisfaction but aims to match requirements to make an action that leads to a goal available. Breazeal [44], [48], [49] conducted research using social interac- and stimulation drives for regulating human-robot tion. In their experiments, they defined multiple drives, each defining specific behaviors. The drives are also a component of the emotional system in a way that homeostatic drives potentiate positive emotions. In contrast, negative emotions are 1www.github.com/larocs/motivatedAgent 3 potentiated when a drive is not in homeostasis. The drives were used in action selection and emotional expression, resulting in the robot interacting with the person according to its internal needs and allowing it to express these needs to others. Using a different approach, Canamero and others [27]–[29], [38], [50] propose hormone driven autonomous agents. In their experiments, the agent is required to maintain different homeostatic variables, but it cannot directly sense the level of its homeostatic variables. Instead, the architecture uses artificial hormones secreted to determine the agent's needs in response to these deficits. Among several aspects, they explored motivations that drive behavior selection; emotions modulated by changes in drives; hormones affecting the robot's perceptive, attentional and motivational mechanisms and the intensity of the selected behavior; and multiple agents, each attempting to maintain their own needs in a competitive and non-competitive environment. The work proposed by Belkaid et al. [51] presents a model to allow the robot to build a representation of its peripersonal space based on subjective and motivated perception. They modeled the feeding drive (appetitive) and the safety drive (aversive), which induce an extension or a retraction of the reachable space in the corresponding stimuli direction. Their results showed that the emotional modulation of the periper- sonal space makes the robot interact in a way that expresses aspects of their internal states, being more aggressive or fearful in their scenario. Considering the significant evidence that most living beings internally modulate reward value as a function of their context to expand their range of adaptivity, Cos et al. [19] explored how the reward is internally processed (resulting in a hedonic value) as a function of the agent's motivational state influences the physiological stability and behavioral adaptivity. In their experiments, the hedonic value is computed using the agent's internal state and the intensity of the physiological effect re- sulting from a consummatory interaction. Similarly, Gadanho [30] uses homeostatic variables as part of the goal and adaptive systems, and the state of these variables determines the agent's well-being (used as a reinforcement). Most of these works use drives to modulate the agent's emo- tions, observing their behavioral reaction given an emotional state. They primarily use the drives' value explicitly in the decision-making process to select an action, defining a moti- vational behavior. Differently from them, we propose using the drives' value explicitly in the decision-making learning phase through reinforcement learning just for learning, defining a motivational-based learning model. Then, our action selection using the policy learned is purely reactive (using the drive's value implicitly) after learning the best action that reduces the drives. just To the best of our knowledge, the work proposed by Lewis et al. [37] investigated the use of pleasure in homeostasis and decision-making of a motivated autonomous robot that must survive in its environment is similar to ours. They used needs associated with hunger and thirst that could be satisfied by consuming the respective elements in the increasing the environment. They used different scenarios, complexity of finding the resources needed: (I) resources are plentiful, equally distributed, and easily accessible, (II) placed an obstacle in the center of the arena and placed resources so that one area contains only food resources and the other only drink resources, (III) placed an obstacle in the center of the arena, and one resource is more available than other (plentiful food, scarce drink). Concerning pleasure, they defined three models: (I) Pleasure modeled by a hormone released as a function of the satisfaction of homeostatic needs, (II) Different fixed values of the hormone, and (III) Additional hormone (a constant amount) released linked to the execution of consummatory behaviors of eating or drinking, this additional release is unrelated to the satisfaction of needs. Their results indicate that pleasure has value for homeostatic control in terms of improved viability and increased flexibility in adaptive behavior. Our work differs from [37] in the following aspects: (I) our decision-making is based on reinforcement learning, (II) we simulated three different agent's profiles concerning in- crease/decrease of the physiological needs, but using the same cognitive architecture, (III) despite the environments with an obstacle, the agent can easily perceive all the resources avail- able 'easily' in [37], in our research the agent has a limited vision, which requires the exploration of the environment to discover the spots that provides energy, (IV) the agent does not know a priori how much energy and pleasure each spot provides, requiring exploration and consummation to find out, (V) environments that provide the same/different resource's values to the needs, (VI) fixed and unique pleasure value associated to each spot, (VII) there is no specific behavior to satisfy the drive, (VIII) our agent is sensitive to the drives and not hormones. III. HULL'S DRIVE REDUCTION THEORY Although there are several theories of motivation [52], in this work, we adopted Hull's proposal. Hull's Drive Reduc- tion Theory [53], [54] is based on the concept of homeostasis [55], which is the idea that our body works to maintain a state of balance, like regulating its temperature to ensure that we do not become too hot or too cold. Therefore, motivation would be the basis to drive our body to this state of balance, either physical or psychological. For Hull, a drive indicates the state of arousal or tension caused by biological or physiological needs [56]. The measure of the drive is directly proportional to the intensity of the behavior that would result from it. For example, if you feel a little thirst, you can satisfy yourself with the thought of drinking water later. However, if you feel very thirsty, you cannot stop thinking about it. When present, the drive energizes the behavior but does not direct it. Orientation comes from learning, which is a consequence of reinforcement. So, if a behavior results in drive reduction, it is reinforced. Hence, which response (behavior) can reduce the drive in that specific situation is learned by a feedback signal. In summary, Hull's theory (summarized in Figure 1) states that a drive emerges from organic needs, providing energy for behavior. Hence, a drive reduction generates reinforcement and produces learning. However, this theory has some limitations. 4 For example, people with anorexia did not eat (and did not want to) despite the body's strong biological need for food. Another point is that external sources could also provide en- ergy for the behaviors. For example, a person who is not thirsty may feel an intense desire for a drink after tasting, seeing, or smelling their favorite beverage. Furthermore, learning also occurs without necessarily having to be involved with the experience of reducing the drive associated with the situation. In addition, learning takes place even by the incitement of the drive and not only through its reduction. Fig. 1. Hull's theory. Adpated from [57]. Hull's theory has been the basis of many motivational theories that attempt to address its flaws, like the Hierarchy of needs from Maslow's [58], [59]. A. Hull's Theory adapted to the robotics domain Following Hull's theory, we hypothesize that a robot can learn how to behave by directly attending to balancing needs and pleasure. To do so, we propose employing drives as part of the robot state in a Reinforcement Learning model. Our decision-making process uses the current level of arousal in each drive along with sensory data to decide how to behave. Hence, reducing one or more drives in the direction of home- ostasis results in reinforcement signals that drives the learning process. Furthermore, this reinforcement signal derives from a function that can vary among needs or preferences according to the robot's experience. Hence, the robot's context will also influence behavior once immediate rewards unrelated to the drives can also be received. To illustrate an example of Hull's Drive Reduction Theory adapted to the robotics domain, we show in Figure 2 the agent's setting used in this work. The agent is equipped with battery, localization, and station detector sensors. The battery sensor is related to the energy need, which must be satisfied according to its level of homeostasis. If unbalance is detected, i.e., the battery level is not the same as the desired energy need, the corresponding drive (Survival) is activated with a level corresponding to this unbalance. Hence, the agent can decide to behave by selecting actions that decrease this drive. IV. MOTIVATIONAL-BASED LEARNING MODEL We implemented Hull's theory using RL from a compu- tational perspective considering the dichotomy of wanting x liking related to the motivational mechanism. To connect these 5 Fig. 2. Hull's Drive Reduction Theory was adapted to the robotics domain. In this example, an agent is equipped with 3 sensors (S1,S2 and S3). These sensors are used to create a higher-level interpretation of the environment by representing different objects/places. Our agent has one need N1 with its corresponding homeostasis level. The sensors are also used to assess how much this N1 is unsatisfied, represented by its corresponding drive D1. Actions that drive our agent in the environment can be selected by a decision- making mechanism to, for instance, reduce the level of unbalance of the agent. theories to our implementation, we established two motivation- based models: Model 01, which considers only the wanting mechanism, and Model 02, which considers the wanting and the liking mechanism. Model 01 (M1): In this model, we considered only the wanting mechanism. Hence, its functioning follows Hull's drive reduction theory (reduce the drive) illustrated in Figure 2, adapted to generate a reinforcement instead of driving an action. In Figure 3, we present the M1 proposed motivational model. In this model, the agent has n sensors (S1−Sn) used to build j percepts (P1−Pj). Percepts refer to the recognition and interpretation of sensory stimuli, and they are created while the agent is interacting in the world. This percept can be a new one (for example, the first time the agent sees an object) or can be updated (the object is modified). In our case, the percepts correspond to the recharge stations. Then PA, PB, PC and PD corresponds to perceptions associated to stations A, B, C and D, respectively. Each percept is associated with a value. This value indicate how much this percept modifies the arousal level in the related drive (D1). In our experiments, considering the environment where all the stations provide the same recharge value, the percepts values are PA = PB = PC = PD = 3. Considering the environment with different recharge values, the percepts values are PA = 1, PB = 4, PC = 3 and PD = 2. We use the these values in our example. Hence, when performing an action (Ai) that alters a drive, the agent calculates the expected reward (R) based on δDiPj /δt. Following an RL approach, the agent can learn to pick actions that maximize its drive reduction gain. Hence, the resulting action indicates the more efficient behavior to attend to the agent's current needs in the direction of homeostasis. Fig. 3. Wanting mechanism. Behavior learning occurs from the expected reward resulting from drive reduction. on the Liking component, as we can see in Figure 4. Liking corresponds to the hedonic dimension composed of hedonic values, which are subjective evaluations of sensations asso- ciated with the percept (object/event) and unrelated to need satisfaction. The hedonic dimension might have an important role in establishing the agent's preferences [19], [60], [61]. Hence, they represent a single value (Lj) associated with each percept (Pj). In our experiments, these (Lj) values are LA = 3, LB = 2, LC = 4, and LD = 1. Learning these values can occur in two ways: (I) fixed value learned from the evolutionary process, (II) over time according to the experiences. In the scope of our research, we used the first option: fixed values associated with each object available in the environment. Fig. 4. Wanting + Liking mechanisms. Behavior learning occurs from the expected reward resulting from drive reduction and hedonic dimension (Lj ). In summary, in M1, the motivation comes exclusively from drive reduction expected reward, while in M2, it comes from drive reduction plus the pleasure (hedonic value) expected rewards. V. EXPERIMENTAL SETUP Model 02 (M2): In our second motivational model, we considered both wanting and liking mechanisms. Wanting works the same as M1 but now the reward R also depends This section presents the environment configuration, the agent's mind and the cognitive cycle used by our robot in the following experiments. A. Environment B. Agent's Mind 6 In this work, we employ simulated simple agents to ensure the focus on the analysis of the proposed model, avoiding possible complexities added by real robots. In previous work [22] we evaluated the wanting mechanism using a high fidelity simulator. Although the simulator provides more fidelity to the real world, it brings some complexities, like the lack of environmental control. Considering that we are proposing two new motivational-based learning models, we need to have control of the environment to effectively analyze the impacts of the models on the agent and guarantee that the scenarios and conditions are the same for all of them. To this end, we designed a simulated environment that meet our needs. All the experiments were executed using a simulated agent moving in a 20x20 deterministic environment (illustrated in Figure 5). There are four fixed recharge areas (A, B, C, D) in this environment, and each of them is associated with a specific recharge value. These areas are used to simulate j percepts (PA, PB, PC, PD) that can be sensed by the agent. In all experiments, a single need (N1) and its corresponding drive (D1) will be employed. Hence, in the experiments that employ the M1 model, each percept has a single value associated to /δt that this particular percept it corresponding to the δD1Pj causes in (D1). We also simulate environments with percepts with different drive reduction rates (different recharge values, shown in Table I). For experiments with the M2 model, there is a pleasure value (Lj) associated with the percept. So, it is possible to analyze the agent's needs and preferences in different situations. Fig. 5. 20x20 environment used in the experiments. TABLE I VALUES ASSOCIATED WITH EACH RECHARGE AREA. Percept Pj (cid:4) (cid:4) (cid:4) (cid:4) A B C D /δt Want δD1Pj Same Recharge Different Recharge 3 3 3 3 1 4 3 2 Like Lj Station Pleasure 3 2 4 1 To implement our proposed computational models, we developed a cognitive agent that follows the cognitive cycle illustrated in Figure 6 and detailed next. 1) Sensing: Our agent is equipped with three sensors: a simulated battery sensor (Sb), a localization sensor (Sl), and a station detector (Ss). The localization and station detector sensors are used to compute where the agent is and the agent's distance to the closest recharge station. They are used as part of the state for the decision-making mechanism. However, only the battery or energy sensor Sb ∈ [0 − 50] is used to define the agent's unbalance associated to its single need N 1: energy. Hence, the battery level is max(50, energy+rechargevalue). The robot energy level decays per simulation step according to the agent metabolism curve. We define three different metabolism types to simulate agents with distinct profiles: slow, regular, and fast. In this way, each has a different battery decay rate, impacting the energy consumption mode. In slow metabolism, the agent consumes 0.1 energy per time step, while in regular metabolism, the consumption is 1. Finally, for the fast metabolism agent, the consumption is 3 per time step. Figure 7 depicts the difference among different metabolisms. the energy need gives rise to a survival drive. In our experiments, we compute the survival drive (D1) by the difference between the current energy value (given by Sb) and the homeostasis level associated with this need. We defined homeostasisN1 = 30, but this value can be changed if necessary. It represents the agent's equilibrium state. 2) Perception: According to Hull's theory, Given the sensor's range, our agent has the following possible values for the survival drive D1: D1 =    [−30, ..., −0.1], Sb < homeostasisN1 ; 0, Sb = homeostasisN1; [0.1, ..., 20], Sb > homeostasisN1. (1) 3) Decision-making: The decision-making is composed of two phases: (I) learning, through interaction with the world, the best behavior based on the drives, and (II) using the knowledge and experience acquired in the previous phase to satisfy the exact needs in a similar environment. The difference is that in phase (I), the policy is updated, while in phase (II) not. In phase (II), the agent can deal with situations not experienced during the learning phase, but with the policy learned, it can find the best solution, generalizing the strategy. The agent is connected to the environment through percep- tion and action. At each timestep, it perceives the state (s ∈ S ) of the environment, where S is the set of possible states, and selects an action a ∈ A(s), where A(s) is the set of possible actions to state s to execute. The action executed changes the environment's state, and the agent sees the value associated with this transition as a reward. Then, it calculates the difference between the expected reward and the reward received, using it to improve prediction accuracy for future rewards and consequently improve future predictions. We can define this process as learning. 012345678910111213141516171819X012345678910111213141516171819YEmpty AreaABCD 7 Fig. 6. Robot's cognitive cycle. Fig. 7. Battery decay for fast, regular, and slow metabolism agents. From t1 to t2, as no recharge is carried out, the agents escape homeostasis with different decay rates. In t2, they begin recharging. The effect of charging is added to their metabolism rate. Hence, they increase the battery level while spending it to survive. In the learning phase, we used Q-learning as the reinforce- ment learning algorithm. The update rule is given by: Q(s, a) =Q(s, a)+ α(Rt+1 + γ * maxa(cid:48)Q(s(cid:48), a(cid:48)) − Q(s, a)), (2) where, α is the learning rate, and γ is the temporal discount factor. In these experiments: α = 0.0001 and γ = 0.9. Due to the continuous nature of our states, our agent employs the Q-learning algorithm with a function approxi- mator to learn the best behavior policy that maximizes the agent's needs and pleasure. In this case, we represent state and action by a feature vector and the TD target (Rt+1 + γ * maxa(cid:48) ˆq(St+1, At+1, w)) which leverages the max of the current function approximation value. RL algorithms have better convergence guarantees if the environment is mathematically modeled as a Markov Decision Process (MDP). Hence, we describe next the MDP formulation for our problem. • Actions A: Stop, Up, Down, Left, Right. Each action changes the agent's position by 1, within the environ- ment's range. We employed the (cid:15)-greedy policy ((cid:15) = 1.0, with linear decay up to 0.01) as a choice of actions. • States: As we are working with a function approximator, we use a linear combination of features to approximate the agent's state at each time step. For this, we have developed the following set of features F to compose our state: – D1: Survival drive absolute value. – MinDist: Euclidean distance from the robot to the nearest recharge area. – Up, Down, Left, Right: Binary features relative to the position of the nearest recharge area to the agent. Suppose the closest recharge area is located above or below the agent's current Y position, to the left or right of the agent's current X, respectively. – SeeA, SeeB, SeeC, SeeD: Binary features that indi- cate if the agent perceives a recharge area within a maximum distance, simulating the sensor range. this maximum value is 6, and the In our case, features relate to recharging areas A, B, C, and D, respectively. – Y0, ..., Y19: Binary features corresponding to the agent's current Y position. – X0, ..., X19: Similar to Y features, but relative to the agent's current X position. The final feature set size is 50. The weights (W ) that as- sociate this feature set F to the action set A are randomly initialized by a uniform distribution U(0.001, 0.009). During the training phase, the weights are updated at each time step with gradient descent using: ∆w =α[(Rt+1 + γmaxa(cid:48) ˆq(St+1, a(cid:48), w)− ˆq(St, At, w))(cid:79)w ˆq(St, At, w)] (3) • Rewards: Following the motivational models proposed in section IV, we model two reward functions to study the agent's behavior accordingly. The first considers only the motivation generated by the drive reduction (Eq. 4), and another considers the drive reduction and the pleasure associated with each percept/recharge area (Eq. 5). R1 =    D1, D1 < 0; 1, int(D1) = 0; −(D1 ∗ 0.5), D1 > 0. R2 = R1 + Lj, (4) (5) where Lj is the pleasure associated with the percept the agent is interacting, if any. In Eq. 4, we define the goal of keeping the agent's energy level as close as possible to Get EnergyOALIGIGet LocalizationOALIGIGet StationsPositionOALIGIEnergyMO LocalizationMO StationPositions MO SurviveMO Drive SurviveComputerOALIGINearest Station Computer OALIGINearestStation MO Decision MakerOALIGIActionMO StatesMO UpOALIGIDownOALIGILeftOALIGIRightOALIGIStopOALIGIWheels ContainerMotorOALIGIEnvironment Memory ObjectPerceptual CodeletDecision-Making CodeletBehavioral CodeletAttentional MemoryPerceptual MemoryMotor CodeletMemory ContainerSensory CodeletMotor MemorySensory Memory homeostasis by rewarding the agent when the drive D1 is 0. Hence, the agent is in equilibrium. In other cases, we punish the agent's choice proportionally to the distance from homeostasis (hence, the absolute value of D1). It is important to remark that being below homeostasis is hazardous for the robot as its life will end if the battery level reaches 0. Thus, the further below homeostasis, the greater the risk and the more severe the punishment. On the other hand, being above homeostasis generates a feeling of discomfort (thinking about human beings, it would be the equivalent of eating more than necessary). In this way, the further above homeostasis, the greater the discomfort. Nevertheless, as it is associated only with well-being and not life risk, we apply a 0.5 gain (it is still bad for the robot, but not as much as being below homeostasis). For our second reward function, described by Eq. 5, we kept the motivation generated by the drive but also inserted a pleasure associated with each percept/recharge area. Reward R2 models a goal of balancing needs and pleasure. C. Experiments and settings In this work, we executed two sets of experiments: M1 and M2. For each set, we vary the agent's metabolism curve and the percepts influence in the drive. However, we perform training and test phases with the same configuration for all ex- periments. Table II depicts each experiment and environment configuration. TABLE II EXPERIMENTS CONFIGURATION. FOR EACH EXPERIMENT WE LIST: THE MOTIVATIONAL MODEL MECHANISM, THE EXPERIMENT ID, THE REWARD FUNCTION, THE AGENT METABOLIC CURVE TYPE, IF THE RECHARGE AREAS PROVIDE THE SAME MODIFICATION IN THE DRIVE, IF THE LIKING COMPONENT IS PRESENT. Model Expe. no. M1 M2 EXP01 EXP02 EXP03 EXP04 EXP05 EXP06 EXP07 EXP08 EXP09 EXP10 EXP11 EXP12 Reward Metabolism δDiPj = Slow = Regular = Fast (cid:54)= Slow (cid:54)= Regular (cid:54)= Fast = Slow = Regular = Fast (cid:54)= Slow (cid:54)= Regular (cid:54)= Fast R1 R1 R1 R1 R1 R1 R2 R2 R2 R2 R2 R2 /δt Lj (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:51) (cid:51) (cid:51) (cid:51) (cid:51) (cid:51) For each experiment, we trained the agent for 25, 000 episodes with a maximum of 5, 000 steps each or until the energy runs out. For each episode, we randomly selected the initial energy value (U(0, 50)) and the robot position (X, Y ) = (U(0, 19), U(0, 19)) at the beginning of each episode. In the test phase, we load the weights learned and set (cid:15) = 0. Hence, only the greedy action is selected. Also, the robot can act in the environment while its energy Sb > 0 or for a maximum of 8, 000 steps. 8 1) Data Visualization: Although we ran 25, 000 episodes during learning, we plot the results using the average 100 episodes. Our graphics illustrate the mean and standard de- viation for reward and the number of actions performed, as it can be seen in the first row of Figure 8. To better understand the agent's behavior throughout training, we also create a heatmap that contains the number of visits to each environment position, as illustrated in the second row of Figure 8. Finally, we ran 50 episodes using the learned policy in the test phase. We started the robot in homeostasis (Sb = 30, D1 = 0) and in (X, Y ) positions in the environment where it is possible to reach a station considering the agent metabolic curve. In this phase, all initializations are the same for all experiments. To illustrate the results obtained, we plot D1 average obtained for each test, as shown in the last row of Figure 8. VI. M1 EXPERIMENT SET - Wanting MECHANISM In this experiment set we employ the first motivational model M1, modeled via the reward function R1 (Eq. 4), in which the agent's goal is to maintain homeostasis. For this set, we run experiments to assess how intrinsic characteristics of an agent, like its metabolic curve, can influence behavior selection when different agents are submitted to the same environment. We also run experiments to assess the influence of the environment in agents with similar characteristics. A. Same Recharge(EXP01 - EXP03) In the experiments described next, all recharge areas provide the same recharge value (as defined in Tables I and II). Analyzing first the average reward during the learning phase (illustrated in Figure 8 first row), we can see that it converges for all agents, indicating they learned that staying in homeostasis (or close to it) is the expected goal. In EXP01, as the number of steps before and after episode 13, 000 is similar, this reward gain indicates that the agent learned to approach homeostasis from episode 13, 000 onwards. In EXP03, the agent faces the most challenging learning scenario because its energy consumption per step is very high. It is impossible to reach the charging station on time, depending on the agent's location, which makes the rewards very unstable. The number of actions remains low during practically the entire training. Reward and lifetime only improve at the end of the training phase due to the (cid:15)-greedy policy employed. Regarding the strategies adopted during the training phase, each agent developed a specific one that fits best to their metabolism, which we can see in the second row of Figure 8. In EXP01, although the metabolism of this agent is slow, allowing it to explore the environment, it stays close to the stations to maximize the reward using the strategy of charging the battery as fast as possible when there is an imbalance in homeostasis. In EXP02, the agent remains closer to the stations or inside them. In EXP03, the agent stays inside the power stations as long as possible. After all, given its high battery consumption, is risky to walk around the environment. Therefore, the agent remains closer or inside stations as metabolism consumption increases. it 9 Fig. 8. From left to right: EXP01 (slow metabolism), EXP02 (regular metabolism) and EXP03 (fast metabolism). From top to bottom: 1) average reward (top) and number of actions (bottom) per episode; 2) visits per environment position during training; 3) Average Drive Level in 50 tests when testing policies learned. To validate the policy learned, we have the average drive obtained during the test phase illustrated in the third row of Figure 8. In EXP01, the agent remains in homeostasis or below it (but not far) for most experiments. On the other hand, the regular metabolism agent (EXP02), that needs more energy than the agent in EXP01, maintains itself above (but close to) homeostasis, given that it is hazardous to stay with negative drives with this metabolism. Finally, EXP03 shows that it is harder to stay in homeostasis with a fast metabolism, and the typical average drive is negative in an environment where the maximum recharge value provided is the same for consumption. Thus, in this scenario, where all stations provide the same recharge value, the slower the metabolism, the easier it is to control the drive and maximize the agent lifetime. B. Different Recharge (EXP04 - EXP06) In the experiments described next, all recharge areas provide different recharge values (as defined in Tables I and II). Considering the average reward illustrated in Figure 9 first row, all agents learned to balance the drive by trying to stay in (or close enough) homeostasis during the learning phase. Comparing with the previous experiments, we can see that the rewards in EXP04 and EXP05 are similar to their equivalent metabolism in EXP01 and EXP02, respectively. However, in this scenario, the slow metabolism learns faster: in EXP01, the reward increases around the episode 13, 000, while in EXP04, it starts at around 10, 000. Regarding the fast metabolism in EXP06, the reward decreases slightly towards the end. Still, this decay may be due to low battery starting and far from stations (or even close to a station unfavorable for its needs). But in EXP06, the rewards are generally higher and more stable than the equivalent EXP03. These improvements observed between equivalents agents considering two different environments occur due to the en- vironment's settings that now provide better options to satisfy the need of each agent. There is a station with a low value that fits best for slow metabolism, one with medium values for regular metabolism, and one with a higher value that is better for fast metabolism. Concerning the behavior in the environment, the agents learned about all the stations, choosing to stay closer to the ones that fit better their needs, as shown in the second row of Figure 9. In EXP04, the agent spent more time near station A, which provides the lowest recharge value (δD1PA/δt = 1). As the agent's metabolism is slow, this station is good enough, and the agent does not risk getting over homeostasis quickly. the agent visits the stations with the highest In EXP05, 7.55.02.5Average Reward050100150200250Episodes0200040006000Steps15105Average Reward050100150200250Episodes020004000Steps171615Average Reward050100150200250Episodes0100020003000Steps012345678910111213141516171819X012345678910111213141516171819Y0.20.40.60.81.01e7012345678910111213141516171819X012345678910111213141516171819Y0.20.40.60.81.01.21e6012345678910111213141516171819X012345678910111213141516171819Y2000040000600008000010000001020304050Experiments201001020Average drive01020304050Experiments25201510505Average drive01020304050Experiments2520151050Average drive 10 Fig. 9. From left to right: EXP04 (slow metabolism), EXP05 (regular metabolism) and EXP06 (fast metabolism). From top to bottom: 1) average reward (top) and number of actions (bottom) per episode; 2) visits per environment position during training; 3) Average Drive Level in 50 tests when testing policies learned. recharges, staying longer at station D (δD1PD /δt = 2), which matches best their regular metabolism. For the fast metabolism (EXP06), the best strategy is to stay inside the station B that provides the highest recharge value (δD1PB /δt = 4), which is what the agent learned. When testing the policy learned (last row of Figure 9), we can note that the robot behavior is strictly related to the agent's initial position in the environment. In EXP04, the agent reaches homeostasis when initiated close to stations with low recharge values. However, it gets the maximum or negative drive when it is close to stations that offer higher values than the necessary for this metabolism. So the strategy learned varies between complete recharging and waiting for the natural consumption or waiting to be negative and then recharge. The same occurs in EXP05 and EXP06, but due to the metabolism consumption is more challenging to stay in homeostasis depending on the initialization position and drives urge. needs, the agent can learn faster and behave more efficiently. VII. M2 EXPERIMENT SET - Wanting + Liking MECHANISMS For this set, we executed the same experiments as the previous one where we assess how intrinsic characteristics of an agent, like its metabolic curve, can influence behavior selection and the influence of the environment in agents with similar characteristics. However, we add a pleasure value to each station. This new configuration implies a more complex scenario that corresponds to the want x like dichotomy. In this experiment set we employ the second motivational model M2, modeled via the reward function R2 (Eq. 5), in which the agent's goal is to maintain homeostasis while getting pleasure. A. Same Recharge (EXP07 - EXP09) To summarize the findings obtained in this first set of experiments using only the M1 mechanism (EXP01 - EXP06), we can note that each individual learned the best strategy to balance their drives. Also, we validated that the environment's setting impacts the motivational-learning process, given that when the environment offers options that fit better with our This set of experiments is equivalent to EXP01 - EXP03, considering the agent's metabolism and the recharge values (all recharge areas provide the same value). However, now each station provides a pleasure value (as defined in Table I). Then, we based our analysis on comparing these results with the EXP01 - EXP03 ones. 7.55.02.5Average Reward050100150200250Episodes0200040006000Steps15105Average Reward050100150200250Episodes02000Steps15105Average Reward050100150200250Episodes01000Steps012345678910111213141516171819X012345678910111213141516171819Y0.20.40.60.81.01e7012345678910111213141516171819X012345678910111213141516171819Y0.20.40.60.81.01e6012345678910111213141516171819X012345678910111213141516171819Y5000010000015000020000025000030000001020304050Experiments505101520Average drive01020304050Experiments25201510505Average drive01020304050Experiments201001020Average drive Considering first the performance in the training phase, the reward from EXP08 and EXP09 improves over time, but in EXP07, it gets worse, as seen in the first row of Figure 10. Approaching the slow metabolism first, the equivalent exper- iment without pleasure (EXP01) shows that the robot could satisfy the drive in that case. Notwithstanding, in EXP07, the agent prefers getting pleasure instead of benefiting the drive, which makes it get worse rewards. Regarding regular metabolism, EXP08 and EXP02 have similar behavior in the training phase, but in EXP08, the agent shows a plateau in reward between 5, 000 and almost 24, 000, changing only the number of actions. It performs better than any other agent in this set (for the same recharge scenarios). Finally, the performance of the fast metabolism (EXP09) is better and more stable than in EXP03. Still in the training phase, but evaluating now the movement behavior in the environment illustrated in Figure 10, second- row. In EXP07, although the agent does not need to recharge a lot due to its metabolism, it chooses to stay inside station C most of the time. This station has the highest pleasure, proving the agent prefers getting pleasure instead of balancing the energy need (different behavior compared with EXP01, when the agent stayed outside but close to the station to recharge as soon as an imbalance is detected). In EXP08, the agent spends more time at stations C, A, and B, respectively, which are the ones with higher pleasure values in the same order. So this agent also prioritizes pleasure. Regarding EXP09, due to the fast energy consumption of this agent, getting energy is much more critical than having pleasure. So for this agent, the closest station is the best, independent of the pleasure value. As we can see, the behavior with (EXP09)/without(EXP01) pleasure is almost the same. We can check the average drive obtained during the test phase (Figure 10, third row) to validate our analysis. As expected, the results of EXP07 and EXP08, which suffer from adding pleasure as we see before, are very different from their equivalent ones without pleasure (EXP01 and EXP02). In EXP01 (Figure 8, first column, last row), the agent remains in homeostasis in most experiments. However, in EXP07, the agent did not stay at homeostasis level but below it in most experiments, which is the expected behavior that gives the greater rewards (gain in direction to homeostasis + gain the pleasure). In EXP08, the agent prefers the pleasure gain instead of the homeostasis one, so it maintains a high drive value in many experiments. On the other side, in EXP09, the agent's average drive is almost the same as EXP03 (Figure 8, third column, last row), and this occurs because the agent's energy consumption is too high, which makes it prioritize its needs and not pleasure. Hence, pleasure in this kind of metabolism does not change the agent's behavior. B. Different Recharge (EXP10 - EXP12) This set of experiments is equivalent to EXP04 - EXP06, considering the recharge values (all recharge areas provide dif- ferent values). The difference is that each station now provides a pleasure value (as defined in Table I). Then, we based our analysis on comparing these results with the EXP04 - EXP06 11 ones when evaluating the motivational mechanism impact and with EXP07 - EXP09 when comparing the environment's impact. Given that this set of experiments is the most complex one, we present the analysis in a different order from the previous ones. Instead of discussing the training results of all metabolisms first and then the testing phase, here we discuss the training phase followed by the test phase of each metabolism. In EXP10, the agent with slow metabolism faces a chal- lenging learning scenario, but, unlike EXP07, it overcomes learning a successful policy (Figure 11, first row). By it, analyzing the agent's movement through the environment (Figure 11 first column, second row), we see that the agent stayed longer at recharge stations A and C, which are the ones with the most significant associated pleasure. However, by preferring station A, the agent did not only aim to satisfy its pleasure. It also learned to balance between pleasure/liking and homeostasis as this is the lowest recharge value station. Hence, the more suitable to the agent's profile. In the testing phase, the agent of EXP10 (Figure 11, first column, last row) learned to stay in homeostasis and was successful in most experiments. This agent found a balance between gain in homeostasis and pleasure. In this case, the insertion of pleasure in an environment with different recharge values for each station was advantageous. It provided better results compared with the equivalent environment without pleasure - EXP04. Also, comparing the pleasure (the exact motivational mechanism) but with a different environment (EXP07), the agent's average drive is better in EXP10, in- dicating that the agent learns the balance between the energy needed and pleasure wanted. In EXP11, the agent with a regular metabolism success- fully learned to balance needs and pleasure. As in EXP08, it achieves the best reward per episode (Figure 11, second column, first row) compared to the slow and fast metabolism agents. As shown in Figure 11 - second column, second the agent visits recharge stations B and C more row -, frequently, which provide higher recharge values necessary for metabolism. Regarding pleasure, these stations offer a reason- able (LB = 2) and maximum value (LC = 4), respectively. Therefore, the decision between satisfying the drive and the pleasure was balanced. In the testing phase, the agent of EXP11 (Figure 11, second column, last row) shows that the agent's average drive is above homeostasis in most experiments. So, the agent prefers having positive drives and living more to risk losing energy. Compared with EXP05 (same metabolism and same dynamics of recharge value but without pleasure), in EXP11, the average drive is further from homeostasis, indicating that pleasure is essential to this agent. Even though pleasure is important to this agent, the agent's performance tends to improve in an environment that allows different recharging strategies. We can see this when comparing EXP11 (different recharge + pleasure) with EXP08 (same recharge + pleasure). The average drive of EXP11 is closer to homeostasis than EXP08, so the agent appreciates pleasure but tries to balance it better with the needs. 12 Fig. 10. From left to right: EXP07 (slow metabolism), EXP08 (regular metabolism) and EXP09 (fast metabolism). From top to bottom: 1) average reward (top) and number of actions (bottom) per episode; 2) visits per environment position during training; 3) Average Drive Level in 50 tests when testing policies learned. Regarding EXP12, given the high energy consumption of this agent, the initialization of the battery sensor and position- ing in the environment significantly impact learning. Figure 11 shows that the agent was able to learn, even though it could not perform the maximum number of actions in training episodes. Looking at Figure 11 - second column, second row -, we see that the agent focuses on staying at station B as it provides the maximum recharge value but not a high pleasure (LB = 2). With that, we can see it priorities its needs and not pleasure. In the testing phase, the agent of EXP12 (Figure 11, right column, last row) shows that the agent's average drive is the maximum possible in many cases, indicating that the agent is focused on staying alive, independent of homeostasis or pleasure associated. This behavior is similar to EXP06 (dif- ferent recharge value without pleasure). We can conclude that pleasure is not vital for a fast metabolism agent. Nevertheless, comparing the results of EXP12 with EXP09, we can conclude that environments with different recharge values result in distinct behaviors for the same agent. In the same recharge environment as in EXP09, the agent's policy is unstable with the drive above and below homeostasis. In contrast, in an environment with different recharge possibilities (EXP12), the agent's drive is the maximum in many cases. In conclusion, for agents with a fast metabolism, an environment with varying values in recharge areas impacts the agent's behavior more than pleasure insertion. Table III shows a summary of all the experiments results. VIII. DISCUSSION AND CONCLUSION In this work, we proposed two motivational models based on Hull's Drive Reduction Theory and the Liking mechanisms associated with pleasure. Based on these models, we built autonomous robots that learned how to behave driven by their motivational mechanism. We trained these agents via a re- inforcement learning strategy. We simulated three agents with different energy consumption rates to analyze how agents with distinct metabolic curves would act in the same environment. We also simulated distinct environments to assess how they impact learning and the strategies adopted by each agent. We observed all agents trying to maintain homeostasis when considering only the drive reduction (wanting) model. How- ever, when survival is at risk, the agent plays safe and keeps itself as fed as possible, with little concern on equilibrium. This is the case for the fast metabolism agent. When we introduced the hedonic dimensions, the agents successfully learned to balance needs and pleasure according to their characteristics and the environment. Nevertheless, pleasure is not relevant when the agent needs to survive. The regular 987Average Reward050100150200250Episodes0200040006000Steps15105Average Reward050100150200250Episodes020004000Steps161412Average Reward050100150200250Episodes010002000Steps012345678910111213141516171819X012345678910111213141516171819Y12341e6012345678910111213141516171819X012345678910111213141516171819Y0.250.500.751.001.251.501.752.001e6012345678910111213141516171819X012345678910111213141516171819Y2000040000600008000010000001020304050Experiments201001020Average drive01020304050Experiments201001020Average drive01020304050Experiments2520151050Average drive 13 Fig. 11. From left to right: EXP10 (slow metabolism), EXP11 (regular metabolism) and EXP12 (fast metabolism). From top to bottom: 1) average reward (top) and number of actions (bottom) per episode; 2) visits per environment position during training; 3) Average Drive Level in 50 tests when testing policies learned. In general, metabolism agent achieved the most efficient policies in our most complex scenario with different recharge areas. Because it does not drop energy too fast or too slow, it takes advantage of the environment dynamics to perform as well as possible. the results show that both the environment and the agent's inner characteristics play an essential role in the resulting strategy learned, as it happens with humans. Our results show that the agents adapt to it to maximize their returns. However, if we submit different agents to the same experiences, the resulting behavior defers drastically. This shows that we can derive very different agents by changing minor characteristics, such as the metabolic rate, while maintaining everything else. if we change the environment, Regarding the hedonic dimension, referenced as pleasure in this work, it has a specific fixed value for each recharge station. It is independent of the metabolism, the driving urgency, and the level of deprivation of that particular resource. We use this setting as a first step to understanding the impact of having preferences incompatible with the agent's needs and that are not updated. Using this setting can make it harder for the robot to adapt to the environment while trying to maintain homeostasis. The next step of our research is to develop a dynamic hedonic value updated during the interaction and according to the robot's context. In future works, we plan to execute these experiments in a more complex and non-deterministic environment. Also, we want to analyze agents with different levels of homeostasis and simulate addictive behavior to understand the underlying learning process. One crucial part of our research is studying decision-making when we have multiple drives, so we intend to add more drives in future work. Moreover, we want to analyze the behavior in challenging situations, as a specific station is closed at a determined time or another agent is using it. We want to see the agent's behavior in situations like that. As emotions intensely impact motivation, we have been working on an emotional architecture that can be used as part of motivational and decision-making systems. This model assesses how our emotional state influences the reward func- tion associated with drive reduction and changes the robot's decisions. ACKNOWLEDGMENTS L. M. Berto is funded by CAPES, QuintoAndar and S ̃ao Paulo Research Foundation (FAPESP) grant 2021/07050-0. E. L. Colombini is partially funded by CNPq PQ-2 grant (315468/2021-1). A. S. Simoes is partially funded by CNPq PQ-2 grant (312703/2019-8). This work was carried out within the scope of PPI-Softex with support from the MCTI, through 12.510.07.55.0Average Reward050100150200250Episodes0200040006000Steps15105Average Reward050100150200250Episodes020004000Steps15105Average Reward050100150200250Episodes02000Steps012345678910111213141516171819X012345678910111213141516171819Y0.51.01.52.02.51e6012345678910111213141516171819X012345678910111213141516171819Y0.51.01.52.01e6012345678910111213141516171819X012345678910111213141516171819Y10000020000030000040000050000060000001020304050Experiments201001020Average drive01020304050Experiments2520151050510Average drive01020304050Experiments30201001020Average drive TABLE III SUMMARY OF THE RESULTS. EXPERIMENTS EXP01 - EXP06 USES M1 MECHANISM (wanting) AND EXP07 - EXP12 USES M2 MECHANISM (wanting + liking). ALL THE STATIONS PROVIDE THE SAME RECHARGE VALUE IN EXP01 - EXP03 AND EXP07 - EXP09, WHILE FOR EXP04 - EXP06 AND EXP10 - EXP12, EACH STATION PROVIDES A DIFFERENT RECHARGE VALUE. 14 Exp. no. EXP01 EXP02 EXP03 EXP04 EXP05 EXP06 EXP07 EXP08 EXP09 EXP10 EXP11 EXP12 Summary /δt) Able to remain in homeostasis in most of the cases using the strategy of being close to the station (during the training phase, stayed close to stations A and C) Able to remain close to homeostasis (usually a bit above) using the strategy of being close (or inside) the stations (closer than EXP01) For this agent is harder to stay in homeostasis due to the high energy need (and the station's recharge value is exactly the metabolism consumption). The strategy learned is to stay inside the closest station Remains in homeostasis (or close enough) or with the maximum positive drive. The policy learned is stay near (nearest than it was in EXP01) the station A (smallest δDiPj Remains in homeostasis but increases the number of negative drives compared to EXP02. The strategy learned is to stay close to station D (which offers a good metabolism recharge) or B. The only station that this agent does not visit is A (the energy provided is not good for its needs) Stable drives, try to achieve the maximum positive drive or not stay too long with negative drives. The policy learned is to stay in station B (maximum recharge) Prioritizes the pleasure instead of the drive reduction by staying more time inside station C (maximum pleasure) Prefers to satisfy the pleasure instead of the drive reduction. This agent visits more times to station C, A and B, respectively For this agent survival is more important than getting pleasure, so it goes to the closest station independently of the pleasure value associated Balances drive reduction and getting pleasure by visiting station A (better for drive reduction) and C (better for pleasure) Balances drive reduction and getting pleasure by visiting stations B and C. For this agent, station A is not beneficial for the drive, and station D is not good for pleasure Prefers the drive reduction by going to station B (maximum recharge value – more than required for survival in each time step) the Technical Cooperation Agreement [01245.013778/2020- 21]. REFERENCES [16] M. Schembri, M. Mirolli, and G. Baldassarre, "Evolving internal rein- forcers for an intrinsically motivated reinforcement-learning robot," in 2007 IEEE 6th International Conference on Development and Learning. IEEE, 2007, pp. 282–287. [17] J. Schmidhuber, "Formal fun, and intrinsic motivation (1990–2010)," IEEE transactions on autonomous mental development, vol. 2, no. 3, pp. 230–247, 2010. theory of creativity, [1] K. Cherry, "Introduction to motivation," 2021, online; accessed 22 November 2021. [Online]. Available: https://courses.lumenlearning.com/ [2] G. Baldassarre, "What are intrinsic motivations? a biological per- spective," in 2011 IEEE international conference on development and learning (ICDL), vol. 2. IEEE, 2011, pp. 1–8. [3] J. Panksepp, Affective neuroscience: The foundations of human and animal emotions. New York: Oxford university press, 2004. [4] J. Gruber, I. B. Mauss, and M. Tamir, "A dark side of happiness? how, when, and why happiness is not always good," Perspectives on psychological science, vol. 6, no. 3, pp. 222–233, 2011. [5] P. M. Gollwitzer and J. A. Bargh, The psychology of action: Linking cognition and motivation to behavior. New York: Guilford Press, 1996. [6] R. W. White, "Motivation reconsidered: the concept of competence." Psychological review, vol. 66, no. 5, p. 297, 1959. [7] R. De Charms, Personal causation: The internal affective determinants of behavior. New York: Routledge, 2013. [8] M. Csikszentmihalyi, Flow: The Psychology of Optimal Experience, 01 1990. [9] A. G. Barto, Intrinsic Motivation and Reinforcement Learning. Berlin, Heidelberg: Springer Berlin Heidelberg, 2013, pp. 17–47. [10] R. M. Ryan and E. L. Deci, "Intrinsic and extrinsic motivations: Classic definitions and new directions," Contemporary educational psychology, vol. 25, no. 1, pp. 54–67, 2000. [11] D. E. Berlyne, "Conflict, arousal, and curiosity." 1960. [12] E. L. Deci and R. M. Ryan, Intrinsic motivation and self-determination in human behavior. New York: Springer Science & Business Media, 2013. [13] P.-Y. Oudeyer and F. Kaplan, "What is intrinsic motivation? a typology of computational approaches," Frontiers in neurorobotics, vol. 1, p. 6, 2009. [14] M. Mirolli and G. Baldassarre, "Functions and mechanisms of intrinsic motivations," in Intrinsically motivated learning in natural and artificial systems. Berlin Heidelberg: Springer, 2013, pp. 49–72. [15] F. Kaplan and P.-Y. Oudeyer, "In search of the neural circuits of intrinsic motivation," Frontiers in neuroscience, vol. 1, p. 17, 2007. [18] K. C. Berridge, T. E. Robinson, and J. W. Aldridge, "Dissecting components of reward:'liking','wanting', and learning," Current opinion in pharmacology, vol. 9, no. 1, pp. 65–73, 2009. [19] I. Cos, L. Canamero, G. M. Hayes, and A. Gillies, "Hedonic value: Enhancing adaptation for motivated agents," Adaptive Behavior, vol. 21, no. 6, pp. 465–483, 2013. [20] R. R. Gudwin, A Review of Motivational Systems and Emotions in Cham: Springer International Cognitive Architectures and Systems. Publishing, 2019, pp. 65–84. [21] K. C. Berridge and M. L. Kringelbach, "Affective neuroscience of pleasure: reward in humans and animals," Psychopharmacology, vol. 199, no. 3, pp. 457–480, 2008. [22] L. M. Berto, P. D. P. Costa, A. S. Simoes, R. R. Gudwin, and E. L. Colombini, "An iowa gambling task-based experiment applied to robots: A study on long-term decision making," in 2021 IEEE International Conference on Development and Learning (ICDL), 2021, pp. 1–6. [23] J. L. Krichmar, "Neurorobotics-a thriving community and a promising pathway toward intelligent cognitive robots," Frontiers in Neurorobotics, vol. 12, 2018. [Online]. Available: https://www.frontiersin.org/articles/ 10.3389/fnbot.2018.00042 [24] C. Watkins, "Learning from delayed rewards. ph.d. thesis," Cambridge University, 1989. [25] D. H. Ballard, An Introduction to Natural Computation. United States of America: MIT Press, 1997. [26] R. S. Sutton and A. G. Barto, Reinforcement Learning: an Introduction. United States of America: MIT Press, 1998. [27] D. Canamero, "Modeling motivations and emotions as a basis for intelligent behavior," in Proceedings of the first international conference on Autonomous agents, 1997, pp. 148–155. [28] --, "A hormonal model of emotions for behavior control," VUB AI-Lab Memo, vol. 2006, pp. 1–10, 1997. [29] L. Ca ̃namero, "Designing emotions for activity selection in autonomous agents," Emotions in humans and artifacts, vol. 115, p. 148, 2003. [30] S. C. Gadanho, "Learning behavior-selection by emotions and cognition in a multi-goal robot task," Journal of Machine Learning Research, vol. 4, no. Jul, pp. 385–412, 2003. 15 [58] A. H. Maslow, Motivation and personality. New Delhi: Prabhat Prakashan, 1981. [59] --, "A theory of human motivation." Psychological review, vol. 50, no. 4, p. 370, 1943. [60] P. T. Young, "Motivation and emotion: A survey of the determinants of human and animal activity." 1961. [61] N. H. Frijda, The emotions. UK: Cambridge University Press, 1986. [31] M. Keramati and B. Gutkin, "A reinforcement homeostatic regulation," Advances in neural systems, vol. 24, 2011. learning theory for information processing [32] G. Konidaris and A. Barto, "An adaptive robot motivational system," in International Conference on Simulation of Adaptive Behavior. Springer, 2006, pp. 346–356. [33] M. A. Salichs and M. Malfaz, "A new approach to modeling emotions and their use on a decision-making system for artificial agents," IEEE Transactions on affective computing, vol. 3, no. 1, pp. 56–68, 2011. [34] E. Coutinho, E. R. Miranda, and A. Cangelosi, "Towards a model for embodied emotions," in 2005 portuguese conference on artificial intelligence. IEEE, 2005, pp. 54–63. [35] N. Goerke, "Emobot: A robot control architecture based on emotion-like internal values," in Mobile Robotics, Moving Intelligence, J. Buchli, Ed. Rijeka: IntechOpen, 2006, ch. 4. [36] Z. Lemhaouri, L. Cohen, and L. Canamero, "Affect-grounded language learning in a robot." [37] M. Lewis and L. Canamero, "Hedonic quality or reward? a study of basic pleasure in homeostasis and decision making of a motivated autonomous robot," Adaptive Behavior, vol. 24, no. 5, pp. 267–291, 2016. [38] J. Lones, M. Lewis, and L. Ca ̃namero, "A hormone-driven epigenetic mechanism for adaptation in autonomous robots," IEEE Transactions on Cognitive and Developmental Systems, vol. 10, no. 2, pp. 445–454, 2017. [39] H.-L. Cao, P. G ́omez Esteban, D. B. Albert, R. Simut, G. Van de Perre, D. Lefeber, and B. Vanderborght, "A collaborative homeostatic- based behavior controller for social robots in human–robot interaction experiments," International Journal of Social Robotics, vol. 9, no. 5, pp. 675–690, 2017. [40] O. Guerrero-Rosado and P. Verschure, "Robot regulatory behaviour based on fundamental homeostatic and allostatic principles," Procedia Computer Science, vol. 190, pp. 292–300, 2021. [41] T. Ziemke and R. Lowe, "On the role of emotion in embodied cognitive architectures: From organisms to robots," Cognitive computation, vol. 1, no. 1, pp. 104–117, 2009. [42] S. C. Gadanho and J. Hallam, "Emotion-triggered learning in au- tonomous robot control," Cybernetics & Systems, vol. 32, no. 5, pp. 531–559, 2001. [43] H. Kitano, "A model for hormonal modulation of learning," in IJCAI, 1995, pp. 532–540. [44] C. Breazeal, Designing sociable robots. United States of America: MIT press, 2004. [45] M. Malfaz, A. Castro-Gonzalez, R. Barber, and M. A. Salichs, "A biologically inspired architecture for an autonomous and social robot," IEEE Transactions on Autonomous Mental Development, vol. 3, no. 3, pp. 232–246, 2011. [46] J. Velsquez, "Modeling emotions and other motivations in synthetic agents," Aaai/iaai, pp. 10–15, 1997. [47] V. Vouloutsi, S. Lall ́ee, and P. F. Verschure, "Modulating behaviors using allostatic control," in Conference on Biomimetic and Biohybrid Systems. Springer, 2013, pp. 287–298. [48] C. Breazeal et al., "A motivational system for regulating human-robot [49] C. Breazeal, interaction," in Aaai/iaai, 1998, pp. 54–61. "Regulating human-robot interaction using 'emo- tions','drives', and facial expressions," in Proceedings of Autonomous Agents, vol. 98, 1998, pp. 14–21. [50] J. Lones, M. Lewis, and L. Ca ̃namero, "Hormonal modulation of interaction between autonomous agents," in 4th International Conference on Development and Learning and on Epigenetic Robotics, 2014, pp. 402–407. peripersonal [51] M. Belkaid, N. Cuperlier, and P. Gaussier, "Emotional modulation in of European Conference on Artificial Life, the European Conference on Artificial Life, York, United Kingdom, Jul. 2015. [Online]. Available: https://hal.archives-ouvertes.fr/hal-01212379 [52] J. E. Heckhausen and H. E. Heckhausen, Motivation and action. robots Proceedings the way ser. interact," impacts space of Switzerland: Cambridge University Press, 2008. [53] C. L. Hull, "Principles of behavior: An introduction to behavior theory." 1943. [54] --, "A behavior system; an introduction to behavior theory concerning the individual organism." 1952. [55] W. B. Cannon, "The wisdom of the body," 1939. [56] K. Cherry, "Drive-reduction theory and human behavior," 2020, [Online]. Available: https: online; accessed 22 November 2021. //www.verywellmind.com/drive-reduction-theory-2795381 [57] "Hull's drive reduction theory." [Online]. Available: https://www. mgkvp.ac.in/Uploads/Lectures/30/4294.pdf
http://arxiv.org/abs/2302.09757v2
2023-03-08T01:28:06
2023-02-20T04:45:13
An ODE Model for Dynamic Matching in Heterogeneous Networks
We study the problem of dynamic matching in heterogeneous networks, where agents are subject to compatibility restrictions and stochastic arrival and departure times. In particular, we consider networks with one type of easy-to-match agents and multiple types of hard-to-match agents, each subject to its own compatibility constraints. Such a setting arises in many real-world applications, including kidney exchange programs and carpooling platforms. We introduce a novel approach to modeling dynamic matching by establishing the ordinary differential equation (ODE) model, which offers a new perspective for evaluating various matching algorithms. We study two algorithms, namely the Greedy and Patient Algorithms, where both algorithms prioritize matching compatible hard-to-match agents over easy-to-match agents in heterogeneous networks. Our results demonstrate the trade-off between the conflicting goals of matching agents quickly and optimally, offering insights into the design of real-world dynamic matching systems. We provide simulations and a real-world case study using data from the Organ Procurement and Transplantation Network to validate theoretical predictions.
[ "Xiaowu Dai", "Hengzhi He" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09757v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09757v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "stat.ML" ]
3 2 0 2 r a M 8 ] G L . s c [ 2 v 7 5 7 9 0 . 2 0 3 2 : v i X r a ODEs for Dynamic Matching in Heterogeneous Networks An ODE Model for Dynamic Matching in Heterogeneous Networks Xiaowu Dai University of California, Los Angeles Hengzhi He Peking University Abstract We study the problem of dynamic matching in heterogeneous networks, where agents are subject to compatibility restrictions and stochastic arrival and departure times. In partic- ular, we consider networks with one type of easy-to-match agents and multiple types of hard-to-match agents, each subject to its own compatibility constraints. Such a setting arises in many real-world applications, including kidney exchange programs and carpooling platforms. We introduce a novel approach to modeling dynamic matching by establishing the ordinary differential equation (ODE) model, which offers a new perspective for eval- uating various matching algorithms. We study two algorithms, namely the Greedy and Patient Algorithms, where both algorithms prioritize matching compatible hard-to-match agents over easy-to-match agents in heterogeneous networks. Our results demonstrate the trade-off between the conflicting goals of matching agents quickly and optimally, offering insights into the de- sign of real-world dynamic matching systems. We provide simulations and a real-world case study using data from the Organ Procurement and Transplantation Network to validate theoretical predictions. Keywords: Ordinary differential equation; Dynamic matching; Heterogeneous networks; Greedy Algorithm; Kidney exchange. 1. Introduction Dynamic matching is a fundamental statistical problem that is both complex and crucial, with wide-ranging implications for numerous real-world applications. Examples of such ap- plications include paired kidney exchange and ride-sharing in carpooling platforms (Roth et al., 2004, 2007; Feng et al., 2021). In dynamic matching problems, agents arrive and depart at random times, and the planner aims to maximize the number of matches by considering multiple factors such as agent compatibility and arrival and departure times. Dynamic matching has attracted the attention of researchers in economics, operations re- search, and computer science and remains an active area of research due to its significant implications for the design and implementation of real-world matching systems (e.g., Roth et al., 2005; ̈Unver, 2010; Akbarpour et al., 2020; Aouad and Sarita ̧c, 2020). In this paper, we focus on dynamic matching in heterogeneous networks, where agents are subject to various compatibility constraints and their arrival and departure times are 1. Address for correspondence: Xiaowu Dai, Department of Statistics, University of California, Los Angeles, 8125 Math Sciences Bldg #951554, Los Angeles, CA 90095, USA. 1 Dai and He uncertain. These compatibility restrictions can arise from a multitude of sources, such as blood-type compatibility in organ transplantation markets, where a successful match is contingent upon biological criteria such as blood type and genotype (Roth et al., 2005; ̈Unver, 2010). To address this challenge, we study a stochastic compatibility model that considers multiple types of agents, including both easy-to-match and hard-to-match agents. The model represents the matching market as a random graph, where nodes denote agents and edges denote the compatibility between them. However, evaluating dynamic matching algorithms in discrete-time models presents a number of challenges. First, the dynamic and non-stationary arrival and departure of agents complicate the accurate evaluation of social welfare under different algorithms. Second, the incomplete information regarding future agent arrivals and departures creates uncertainty in predicting market states and evaluating algorithm performance. Furthermore, the interdependence between matching and loss functions, resulting from the impact of one agent's matching on others, further adds to the complexity of the analysis. We propose a novel approach to modeling dynamic matching in heterogeneous networks using ordinary differential equation (ODE) models by taking small step sizes in time. Our approach enables the evaluation and comparison of different matching algorithms, while providing fresh insights into the interplay between sequential decision-making and first- order ODE outcomes. By leveraging this framework, we analyze two algorithms, namely the Greedy Algorithm and the Patient Algorithm. The Greedy Algorithm matches agents as soon as they arrive in the market, while the Patient Algorithm matches agents when they become critical. In heterogeneous networks, both algorithms prioritize the matching of compatible, hard-to-match agents over easy-to-match agents, thus contributing to the maximization of social welfare by directing limited matching opportunities towards agents with greater difficulty finding compatible partners. Our results show the trade-off between agents' waiting times and the percentage of matched agents in heterogeneous dynamic markets. The Greedy Algorithm prioritizes fast matching and reduces waiting times. However, the Greedy Algorithm may also lead to a reduced pool of compatible agents. Our findings reveal that the rate of unmatched agents departing the market in the Greedy Algorithm decreases linearly with increasing network density. In contrast, the Patient Algorithm, with its focus on increasing the pool of com- patible agents, exhibits no slower than an exponential decay rate with increasing network density. Although the Patient Algorithm increases the number of matching, we show that it also significantly extends waiting times in comparison to the Greedy Algorithm. These insights into the trade-off between agents' waiting times and the percentage of matched agents have useful implications for the design of dynamic matching systems in real-world scenarios. We provide extensive simulations to verify the accuracy of our ODE approximation, perform a thorough sensitivity analysis of key parameters in our dynamic matching models, and validate our theoretical predictions through a real-world case study using data from the Organ Procurement and Transplantation Network (OPTN). Our real data analysis indicates that the proportion of easy-to-match agents in the market has little impact on the loss for easy-to-match agents, but causes a significant change in the loss for hard-to-match agents. Additionally, we observe that the Patient Algorithm yields a smaller loss compared to the 2 ODEs for Dynamic Matching in Heterogeneous Networks Greedy Algorithm. These findings demonstrate the practical applicability of our theory and contribute to a deeper understanding of the kidney exchange market. 1.1 Contributions and Outline In this work, we present a novel approach for modeling dynamic matching markets by estab- lishing an asymptotic equivalence between the discrete-time process of dynamic matching and continuous ODEs. Our work demonstrates that ODEs provide a conceptually simpler tool for understanding and analyzing various dynamic matching algorithms. We summarize our principal methodological and theoretical contributions as follows. • We employ ODEs to model the behavior of dynamic matching algorithms at the ex- act limit, by taking infinitesimally small time steps. To the best of our knowledge, this work is the first to use ODEs for this purpose, offering new perspectives on the relationship between sequential decision-making and first-order ODE outcomes. Our models accommodate heterogeneous networks with multiple types of agents and vary- ing compatibility, providing a flexible tool for analyzing and understanding dynamic matching algorithms. • We study two algorithms for dynamic matching in heterogeneous networks, which address the trade-off between agents' waiting times and the percentage of matched agents in heterogeneous dynamic markets. The first algorithm, the Greedy Algo- rithm, matches agents immediately upon their arrival to the market, giving priority to compatible hard-to-match agents over compatible easy-to-match agents. The sec- ond algorithm, the Patient Algorithm, matches agents only when they become critical and prioritizes matching with compatible hard-to-match agents over easy-to-match agents. These algorithms build upon prior studies of dynamic matching in homoge- neous networks (Akbarpour et al., 2020) by expanding the scope to heterogeneous networks, presenting novel challenges in terms of analysis and comparison. • We demonstrate the existence of ordinary differential equation (ODE) solutions for the Greedy and Patient Algorithms by leveraging the Poincar ́e–Bendixson Theorem. Our ODE solutions enable us to derive the steady-state distribution of the number of easy- and hard-to-match agents waiting in the pool, as well as evaluate the social welfare loss functions. We find that the loss of the Greedy Algorithm decays in a linear rate as the network density parameter d increases, while the loss of the Patient Algorithm exhibits no slower than an exponential decay rate with increasing d. These results indicate that the Patient Algorithm outperforms the Greedy Algorithm in terms of social welfare, as evidenced by a reduction in loss functions and an increased number of matched agents. However, this advantage is accompanied by longer waiting times for certain agents, particularly easy-to-match agents, compared to the performance of the Greedy Algorithm. • The ODE models also offer to gain a deeper understanding of the dynamic matching algorithms. For example, our analysis of the Patient Algorithm reveals a significant effect of the proportion of easy-to-match agents and hard-to-match agents on the loss of hard-to-match agents, while its effect on the loss of easy-to-match agents is relatively 3 Dai and He negligible. Additionally, our results show a phase transition in the performance of the Patient Algorithm with respect to the likelihood of encountering a hard-to-match agent, demonstrating the inherent complexity of dynamic matching. The rest of the paper is organized as follows. In Section 2, we describe the problem of dy- namic matching agents in heterogeneous networks. In Section 3, we derive continuous ODE models and provide analytical results for the Greedy and Patient Algorithms. In Section 4, we present numerical simulations and a real data example to validate the analytical results. In Section 5, we discuss the related works. In Section 6, we conclude the paper with a discussion of future work. All proofs are provided in the Supplementary Appendix. 2. A Model of Dynamic Matching in Heterogeneous Networks In this section, we present a model of a heterogeneous agent matching market on a dynamic network, over a time interval of [0, T ]. Our focus is on characterizing the evolution of the network and its impact on the matching outcome. 2.1 Heterogeneous Agents Consider that a new agent's type is randomly selected from {A0, A1, A2, . . . , Ap}, a set of p + 1 types, according to the distribution, P(type = A0) = 1 − pλ, and P(type = Aj) = λ, ∀j ∈ {1, . . . , n}, (1) where p ≥ 0, and 0 < λ < 1/p. We adopt a Poisson process to model the arrival and departure of heterogeneous agents in the matching market (Ashlagi et al., 2022; Akbarpour et al., 2020). The Poisson process is characterized by a rate of arrival, m ≥ 1. This choice of model ensures that no two agents arrive simultaneously, almost surely. We use an independent Poisson process with rate 1 to to model the event of an agent becoming critical. Upon becoming critical, an unmatched agent immediately departs from the market. If an agent leaves the market without finding a match due to becoming critical, we refer to this as the agent perishing. An agent's departure from the market may occur through either being matched with another agent or through perishing. Let St be the set of agents in the market at time t ∈ [0, T ], and we are interested in the evolution of St over t. For the sake of clarity, we start our analysis with an empty market, i.e., S0 = ∅. To capture the heterogeneity of agents, we distinguish between p + 1 different types of agents, denoted by A0, A1, ..., Ap. To quantify the number of agents of each type present in the market, we define |St(Aj)| as the number of Aj-type agents in the market at time t. Consequently, the total number of agents in the market can be obtained as the sum over all types, i.e., |St| = (cid:80)p k=0 |St(Ak)|. 2.2 Compatibility Let α ∈ (0, 1) be a compatibility parameter of the model. For a pair of agents in the network, we define that the undirected compatibility depends on agents' types and hence 4 ODEs for Dynamic Matching in Heterogeneous Networks Figure 1: An example of a compatibility network with the edges drawn from Eq. (2). is heterogeneous. For any j (cid:54)= j(cid:48) ∈ {1, . . . , p}, P ({A0, A0} are compatible) = α, P ({Aj, Aj} are compatible) = α, P ({A0, Aj} are compatible) = α, P (cid:0){Aj, Aj(cid:48)} are compatible(cid:1) = 0. (2) In model (2), we assume that the compatibility probabilities between agents are independent across different pairs. We also define the parameter, d ≡ αm, (3) and d represents the density in the network. An agent with an A0 type is considered easy-to-match, as they are compatible with all other agent types with probability α. In contrast, an agent with an Aj type, where j ≥ 1, is considered hard-to-match, as they are only compatible with A0- or Aj-type agents with probability α. This distinct compatibility structure is shown in Figure 1 for an example with α = 1. We note that the models in Eqs. (1) and (2) differ from those in Ashlagi et al. (2022) in several significant ways. First, our definition of easy-to-match and hard-to-match agents is more versatile and practical, allowing for multiple types of hard-to-match agents, while Ash- lagi et al. (2022) only allows for one type of hard-to-match agent. Second, our compatibility definition accommodates a sparse graph, where the matching probability α approaches zero as the arrival rate m increases, while in Ashlagi et al. (2022), the matching probability α remains constant. Third, as a result of the differences in the models, our approach entails constructing a discrete dynamic model and then deriving a corresponding continuous ODE model to analyze the steady-state, as opposed to directly analyzing the discrete model in Ashlagi et al. (2022). Given a time t ≥ 0, let Et ⊆ St × St be the set of compatible pairs of agents in the market, and Gt = (St, Et) be the resulting network representation. A collection of edges Mt ⊆ Et is considered a valid matching if for any pair of edges {(a, b), (c, d)} ⊆ Et, either {a, b} = {c, d} or {a, b} ∩ {c, d} = ∅. At each time t ≥ 0, a matching algorithm selects a valid matching Mt from the network Gt, which could be an empty set, and the agents in Mt immediately leave the market. It is assumed that the planner, at any time t ≥ 0, has access to only the information of {Gt(cid:48) , t(cid:48) ≤ t}, and is unaware of {Gt(cid:48) , t(cid:48) > t}. For an agent a ∈ St, the set of its neighbors in Gt is denoted as N (a) ⊆ St. 5 Dai and He 2.3 Goal Our objective is to optimize social welfare by maximizing the number of agents who depart the market matched. This translates to finding a matching algorithm that minimizes the number of perished agents, given the constraints and conditions of the dynamic network. We define the total loss as follows, Lalg ≡ E (cid:104)(cid:12) (cid:12)∪t≤T St − ̄S alg (cid:12) E [|∪t≤T St|] T − ST (cid:12) (cid:105) (cid:12) (cid:12) . (4) Here ̄S alg by the chosen algorithm, T denotes the set of matched agents at the end of the time period T as determined ̄S alg T ≡ {a ∈ ∪t≤T St : a is matched by "alg" by time T } . Thus, the total loss Lalg in Eq. (4) is calculated as the ratio of the expected number of perished agents to the expected total number of agents present in the market over time T . For the Ak-type agents, k ∈ 0, 1, . . . , p, we define the set of matched agents by time T as ̄S alg T (Ak) ≡ {a ∈ S(Ak) : a is matched by "alg" by time T }. The individual loss for each type of agent is computed as follows, Lalg(Ak) ≡ E (cid:104)(cid:12) (cid:12)∪t≤T St(Ak) − ̄S alg (cid:12) (cid:12) (cid:12) T (Ak) − ST (Ak) (cid:12) (cid:105) E [|∪t≤T St(Ak)|] . (5) The evaluation of matching algorithms in a dynamic market modeled as a discrete-time process, as described in Section 2.1, presents four major challenges. First, the non-stationary nature of the available agent pool, arising from the dynamic arrival and departure of agents, makes it difficult to accurately evaluate the loss function defined in Eqs. (4) and (5) under different algorithms. Second, the heterogeneity of agents with varying compatibility and loss functions adds to the complexity of the analysis. Third, the absence of complete information on future agent arrivals and departures creates uncertainty in predicting the market state and evaluating the performance of matching algorithms. Finally, the interdependencies between matchings and loss functions, resulting from the impact of one agent's matching on others, further complicate the analysis. To mitigate these technical difficulties, we establish a continuous approximation by formulating Ordinary Differential Equation (ODE) models in Section 3. This allows us to perform a more analytical evaluation of the various matching algorithms in the dynamic market. 2.4 Greedy and Patient Algorithms In the design of matching algorithms for maximizing social welfare, two entangling factors must be considered. The first factor is the timing of matchings, as the planner must determine when to match agents based on the current network structure rather than having full knowledge of the future network. The second factor is the match partner selection, which influences the future network structure. For instance, in a market with agents {a, b, c} at time t, where the compatible pairs are {a, b} and {a, c}, but b and c are not compatible. If agent a becomes critical at time t, the choice of matching {a, b} or {a, c} is inconsequential. 6 ODEs for Dynamic Matching in Heterogeneous Networks However, if a new agent d arrives at time t + 1 and is compatible with c but not with b, then the choice of matching {a, c} at time t excludes the possibility of matching either b or d at time t + 1. In this section, we study two algorithms that separate the effects of timing and match partner selection in heterogeneous networks. Algorithm 1 Greedy Algorithm for heterogeneous dynamic matching 1: for a new agent at arrives the market at time t ≥ 0 do 2: if N1(at) ≡ {b ∈ N (at) | b's type is Aj, ∀j ≥ 1} (cid:54)= ∅: 3: 4: 5: 6: randomly choose b ∈ N1(at) at uniform, and match b with at. else if N2(at) ≡ {b ∈ N (at) | b's type is A0, ∀j ≥ 1} (cid:54)= ∅: randomly choose b ∈ N2(at) at uniform, and match b with at. else: 7: 8: end for agent at stays at the pool. The first algorithm, the Greedy Algorithm, aims to match an agent upon their arrival in the market. Under the Poisson model for agent arrival in the network in Section 2.1, there are no two agents arriving at the same time. The algorithm matches the arrival agent with its neighbors in the pool, following the rule that a compatible hard-to-match agent (i.e., A1, . . . , Ap-type) is matched before considering a compatible easy-to-match agent (i.e., A0-type). The procedure is outlined in Algorithm 1. In cases where the cost of waiting is negligible, it is weakly better to leave A0-type agents in the pool, as they are more likely to be compatible with future agents. The Greedy Algorithm operates in a local fashion, considering only the immediate neighbors of the arrival agents and ignoring the global or future network structure. The second algorithm, the Patient Algorithm, operates by matching agents upon they become critical. Under the Poisson model described in Section 2.1, no two agents would become critical at the same time almost surely. When a critical agent emerges, the algorithm evaluates its neighboring agents in the pool and prioritizes a matching with a compatible hard-to-match agent over an easy-to-match agent. The procedure is described in Algorithm 2. Similar to the Greedy Algorithm, the Patient Algorithm operates with a local perspective, only considering the neighbors of the critical agents. Algorithm 2 Patient Algorithm for heterogeneous dynamic matching 1: for an agent at becomes critical at time t ≥ 0 do 2: if N1(at) ≡ {b ∈ N (at) | b's type is Aj, ∀j ≥ 1} (cid:54)= ∅: 3: 4: 5: 6: randomly choose b ∈ N1(at) at uniform, and match b with at. else if N2(at) ≡ {b ∈ N (at) | b's type is A0, ∀j ≥ 1} (cid:54)= ∅: randomly choose b ∈ N2(at) at uniform, and match b with at. else: 7: 8: end for agent at perishes. The key distinction between the Greedy Algorithm and the Patient Algorithm lies in the utilization of different information: the former leverages the information of agents arriving 7 Dai and He at the market, while the latter requires information of critical agents. These algorithms also differentiate themselves from their counterparts in networks comprising solely single- type agents (Akbarpour et al., 2020), as they must consider the compatibility of match partners and prioritize the matching of hard-to-match agents over easy-to-match agents in heterogeneous networks. Proposition 1 presents a rigorous analytical evaluation of the probabilities of matching different types of agents with these algorithms. Proposition 1 Consider that at time t ∈ [0, T ], the planner tries to match an Ak-type agent of interest, k ∈ {0, 1, . . . , p}. This event happens when the agent of interest enters the market at time t while the planner uses Greedy Algorithm, or when the agent of interest becomes critical at time t while the planner uses Patient Algorithm. Let π∗ t (Ak, Ak(cid:48)) be the probability that the planner matches the Ak-type agent of interest with an Ak(cid:48)-type agent who is in the pool, where k(cid:48) ∈ {0, 1, . . . , p}. Then for any j ≥ 1, π∗ t (A0, A0) = 1 − (1 − α)|St(A0)|(cid:105) (cid:104) (1 − α) (cid:80)p k=1 |St(Ak)|, π∗ t (A0, Aj) = 1 − (1 − α)|St(Aj )|(cid:105) (cid:104) p−1 (cid:88) k=0 1 k + 1 (cid:88) βj,j1,...,jk , {j1,...,jk}⊆[p]\{j} 1 − (1 − α)|St(A0)|(cid:105) (cid:104) π∗ t (Aj, A0) = t (Aj, Aj) = 1 − (1 − α)|St(Aj )|, π∗ (1 − α)|St(Aj )|, where [p] ≡ {1, . . . , p}, and βj,j1,...,jk ≡ Πk s=1 1 − (1 − α)|St(Ajs )|(cid:105) (cid:104) Πl(cid:54)∈{j,j1,...,jk}(1 − α)|St(Al)|. Note that in Proposition 1, the probability function π∗ t is asymmetric with respect to its covariates, i.e., π∗ t (Ak(cid:48), Ak), for any k (cid:54)= k(cid:48) ∈ {0, 1, . . . , p}. This is because by definition of π∗ t (Ak, Ak(cid:48)), the covariate order matters. The first covariate, Ak, refers to the agent of interest, while the second covariate, Ak(cid:48), refers to the potential match for the agent of interest. We also note that the probabilities in Proposition 1 satisfy, t (Ak, Ak(cid:48)) (cid:54)= π∗ (1 − α)|St| = 1 − p (cid:88) k=0 π∗ t (A0, Ak), (6) which can be explained as follows. The compatibility of an A0-type agent is captured by both sides of Equation (6). On one hand, the probability that it is incompatible with any other agent in the network can be calculated as (1 − α)|St|, as stated in Eq. (2). On the other hand, the probability of compatibility with any other type of agent, Ak where k ≥ 0, is given by the sum of the probabilities of matching with each type, (cid:80)p t (A0, Ak). This latter quantity provides the right-hand-side of Equation (6). k=0 π∗ 3. Main Results In this section, we establish the asymptotic equivalence between the discrete and the con- tinuous ODE models for dynamic matching. We demonstrate the existence of solutions 8 ODEs for Dynamic Matching in Heterogeneous Networks to the ODEs, and using these solutions, we derive the long-term behavior of agents un- der both Greedy and Patient Algorithms. Our results demonstrate the power of ODEs as a framework for understanding and analyzing dynamic matching algorithms, and demonstrate that this conceptually simpler mathematical model can provide insights into the long-term behavior of agents in a market. 3.1 Analysis of the Greedy Algorithm We now derive the ODE models for the Greedy Algorithm in Algorithm 1. The goal is to analyze the size of agents in the market, |St(Ak)|, for each k = 0, 1, . . . , p. By taking a small step size in time ∆t > 0, we define the derivative of |St(Ak)| as, d|St(Ak)| dt ≡ lim ∆t→0+ E[|St+∆t(Ak)|] − |St(Ak)| ∆t , ∀k = 0, 1, . . . , p. (7) Here we consider the expected change of the set size, E[|St+∆t(Aj)|] − |St(Aj)|, given the information at time t. This is different from the change of the set size, |St+∆t(Aj)| − |St(Aj)| itself. The definition (7) would yield deterministic ODEs and facilitate the analysis, compared to obtaining stochastic ODEs otherwise. We derive the ODEs for |St(A0)|, and |St(Aj)| with j ≥ 1, separately. Theorem 2 Given the set of the agents' sizes, {|St(A0)|, |St(A1)|, * * * , |St(Ap)|} at time t, the Greedy Algorithm in Algorithm 1 yields that for A0-type agents, d|St(A0)| dt (cid:34) = (1 − pλ)m 1 − (cid:35) π∗ t (A0, Ak) p (cid:88) k=0 − (1 − pλ)mπ∗ t (A0, A0) − λm p (cid:88) k=1 π∗ t (Ak, A0) − |St(A0)|, where λ and d|St(A0)|/dt are defined by Eqs. (1) and (7), respectively. Moreover, the Greedy Algorithm yields that for Aj-type agents, d|St(Aj)| dt where j = 1, . . . , p. = −(1 − pλ)mπ∗ + λm [1 − π∗ t (A0, Aj) − λmπ∗ t (Aj, A0) − π∗ t (Aj, Aj) t (Aj, Aj)] − |St(Aj)|, The ODEs in Theorem 2 describe the dynamic behavior of the number of agents of each type in the market over time. Specifically, the ODEs capture the influx of new agents into the market and the matching and departure of agents that become critical. The terms in the ODEs capture the fraction of agents of each type that are matched with agents of other types, the fraction that remain in the market without matching, and the fraction that leave the market due to becoming critical, which are explained as follows. When (1 − pλ)m∆t of A0-agents arrive at the market during [t, t + ∆t], a fraction π∗ t (A0, A0) of these agents are matched with A0-type agents, a fraction π∗ t (A0, Aj) are matched with Aj-type agents, and fraction 1 − (cid:80)p k=0 π∗ t (A0, Ak) agents remain in the market. Similarly, when λm∆t 9 Dai and He of Aj-agents arrive at the market during [t, t + ∆t], a fraction π∗ t (Aj, A0) of these agents are matched with A0-type agents, a fraction π∗ t (Aj, Aj) are matched with Aj-type agents, and a fraction 1 − π∗ t (Aj, Aj) remian in the market. Additionally, a total of |St(Ak)|∆t of Ak-type agents become critical and leave the market during [t, t + ∆t], for any k ≥ 0. t (Aj, A0) − π∗ 3.1.1 Evaluation of the Greedy Algorithm It is of interest to study the existence of solutions to ODEs in Theorem 2. Furthermore, we aim to assess the performance of the Greedy Algorithm through the evaluation of the loss functions defined in Eqs. (4) and (5). Theorem 3 Given any initial values (|S0(A0)|, |S0(A1)|, . . . , |S0(Ap)|) with |S0(Ak)| ≥ 0 and k ≥ 0, the ODEs in Theorem 2 have a unique solution. In addition, • if the initial values satisfy |S0(Aj)| = |S0(Aj(cid:48))| ≥ 0 for all 1 ≤ j (cid:54)= j(cid:48) ≤ p, then |St(Aj)| = |St(Aj(cid:48))| for any t > 0; • if |S0(Aj)| = |S0(Aj(cid:48))| ≥ 0 for all 1 ≤ j (cid:54)= j(cid:48) ≤ p and m → ∞, α → 0, then there exists a stationary solution to the ODEs in Theorem 2 when T → ∞. Moreover, there exist constants 0 < c ≤ c(cid:48) < ∞ such that the loss functions in Eqs. (4) and (5) satisfy, cd−1 ≤ cd−1 ≤ lim T →∞ lim T →∞ Lgreedy(Ak) ≤ c(cid:48)d−1, ∀k ≥ 0, and Lgreedy ≤ c(cid:48)d−1. Here d is the density parameter in Eq. (3). The proof of Theorem 3 leverages the Poincar ́e–Bendixson Theorem (e.g., Ciesielski, 2012) to demonstrate the convergence of the solution of the ODE to the stationary point in the limit as T → ∞. We make two remarks on Theorem 3. First, the case where m → ∞ represents a large market scenario, characterized by an average of m agents entering the market per unit time. Second, our framework, characterized by a compatibility network with decreasing matching probabilities α that approach zero with increasing number of agents, aligns with the setting presented in Akbarpour et al. (2020). Theorem 3 demonstrates the validity of our results for any density parameter d = αm ∈ (0, ∞). This sparsity of the network, in contrast to the fixed constant matching probabilities assumed in Ashlagi et al. (2022), is a distinct feature of our framework. 3.2 Analysis of the Patient Algorithm We derive the ODE models for the Patient Algorithm in Algorithm 2. Theorem 4 Given the set of the agents' sizes, {|St(A0)|, |St(A1)|, * * * , |St(Ap)|} at time t, the Patient Algorithm in Algorithm 2 yields that for A0-type agents, d|St(A0)| dt = (1 − pλ)m − p (cid:88) k=0 |St(Ak)|π∗ t (Ak, A0) − |St(A0)|. 10 ODEs for Dynamic Matching in Heterogeneous Networks Moreover, the Patient Algorithm yields that for Aj-type agents, d|St(Aj)| dt where j = 1, . . . , p. = λm − |St(A0)|π∗ t (A0, Aj) − |St(Aj)|π∗ t (Aj, Aj) − |St(Aj)|, The ODEs in Theorem 4 model the dynamic evolution of the number of each agent type in the market as time progresses under the Patient Algorithm. In particular, when |St(A0)|∆t of A0-agents become critical during [t, t + ∆t], a fraction π∗ t (A0, A0) of these agents are matched with A0-type agents, a fraction π∗ t (A0, Aj) are matched with Aj-type agents (j ≥ 1), and a fraction 1 − (cid:80)p t (A0, Ak) leave the market without matching. Similarly, when |St(Aj)|∆t of Aj-agents (j ≥ 1) become critical during [t, t + ∆t], a fraction π∗ t (Aj, A0) of these agents are matched with A0-type agents, a fraction π∗ t (Aj, Aj) are matched with Aj- type agents, and a fraction 1 − π∗ t (Aj, Aj) leave the market without matching. Additionally, there are a total of (1 − pλ)m∆t of A0-type agents and a total of λm∆t of Aj-type agents entering the market during each interval [t, t + ∆t]. These results provide an intuitive explanation for the terms in the ODEs in Theorem 4. t (Aj, A0) − π∗ k=0 π∗ 3.2.1 Evaluation of the Patient Algorithm We now establish the existence of solutions to the ODEs presented in Theorem 4. We also evaluate the performance of the Patient Algorithm using two metrics, defined in Eqs. (4) and (5). Theorem 5 Given any initial values (|S0(A0)|, |S0(A1)|, . . . , |S0(Ap)|) with |S0(Ak)| ≥ 0 and k ≥ 0, the ODEs in Theorem 4 have a unique solution. In addition, • if the initial values satisfy |S0(Aj)| = |S0(Aj(cid:48))| ≥ 0 for all 1 ≤ j (cid:54)= j(cid:48) ≤ p, then |St(Aj)| = |St(Aj(cid:48))| ≥ 0 for any t > 0; • if |S0(Aj)| = |S0(Aj(cid:48))| ≥ 0 for all 1 ≤ j (cid:54)= j(cid:48) ≤ p and m → ∞, α → 0, then there exists a stationary solution to the ODEs in Theorem 4 when T → ∞. Moreover, the loss functions in Eq. (5) satisfy that as d → ∞, Lpatient(A0) = e[− 1 2 +o(1)]d, lim T →∞ and for any j = 1, . . . , p, lim T →∞ Lpatient(Aj) = 1− 1 (cid:105) 2p −(p−1)λ+o(1) (cid:104) −   e e[− 1  2 +o(1)]d, d , if λp > 1 2 , if λp ≤ 1 2 . Moreover, the total loss in Eq. (4) satisfies that as d → ∞, Lpatient = lim T →∞ 1− 1 (cid:105) 2p −(p−1)λ+o(1) (cid:104) −   e e[− 1  2 +o(1)]d d if λp > 1 2 , if λp ≤ 1 2 . 11 Dai and He We make two remarks on this theorem. First, the proportion of easy-to-match agents A0 and hard-to-match agents Aj with j ≥ 1 has a significant effect on the loss of hard-to-match agents when using the Patient Algorithm, while its effect on the loss of easy-to-match agents is relatively negligible. This is exemplified by the following result, which can be derived when m → ∞, α → 0, and d → ∞, ∀0 < λ1 < λ2 < 1 p , limT →∞ Lpatient(A0) with λ = λ1 limT →∞ Lpatient(A0) with λ = λ2 = Θ(1). However, for agents Aj with j ≥ 1, and m → ∞, α → 0, d → ∞, we have ∀0 < λ1 < 1 2p ≤ λ2 < 1 p , limT →∞ Lpatient(Aj) with λ = λ1 limT →∞ Lpatient(Aj) with λ = λ2 → 0. Second, Theorem 5 also shows a critical relationship between the parameter λ and the performance of the Patient Algorithm, marked by a phase transition phenomenon at λp = 1/2. When λp ≤ 1/2, the loss function for hard-to-match agents is expected to vary gradually with changes in λ, remaining at e[− 1 2 +o(1)]d. Conversely, when λp > 1/2, the loss (cid:105) d 2p −(p−1)λ+o(1) function decays at a faster rate, as described by e is rapidly increasing with respect to λ, such that for any λ1 < λ2, then the relative loss, . This latter function 1− 1 − (cid:104) (cid:104) − 1− 1 (cid:105) 2p −(p−1)λ2+o(1) d (cid:104) − 1− 1 (cid:105) 2p −(p−1)λ1+o(1) d e e → ∞, as d → ∞. As a result, even small changes in λ can lead to significant changes in the loss when λp > 1/2. This phase transition phenomenon is also demonstrated in the simulation results. 3.3 Comparison of the Greedy and Patient Algorithms By Theorems 3 and 5, the loss of the Greedy Algorithm exhibits a linear decay rate in d with a constant c, Lgreedy ≥ lim T →∞ c d . In contrast, the loss of the Patient Algorithm decays no slower than exponential in d, Lpatient = lim T →∞ 1− 1 (cid:105) 2p −(p−1)λ+o(1) (cid:104)  −  e e[− 1  2 +o(1)]d, d , if λp > 1 2 , if λp ≤ 1 2 . This result shows that the Patient Algorithm outperforms the Greedy Algorithm in enhanc- ing social welfare, as evidenced by a faster decay rate in the loss function. Next, we examine the average waiting time of agents under the two algorithms. Proposition 6 Suppose the initial values (|S0(A0)|, |S0(A1)|, . . . , |S0(Ap)|) satisfy |S0(Aj)| = |S0(Aj(cid:48))| ≥ 0 for all 1 ≤ j (cid:54)= j(cid:48) ≤ p, and m → ∞, α → 0. Then, • ODEs for the Greedy Algorithm in Theorem 2 suggest that when T → ∞, the average time that an Ak-type agent spends in the market is Θ (cid:0) 1 (cid:1), for any k = 0, . . . , p; d 12 ODEs for Dynamic Matching in Heterogeneous Networks • ODEs for the Patient Algorithm in Theorem 4 suggest that when T → ∞, the average time that an A0-type agent and an Aj-type agent (j ≥ 1) spend in the market converge towards, respectively, (cid:40) Θ (1) and Θ (1) , (cid:1) , Θ (1) and Θ (cid:0) 1 d if λp > 1 2 ; if λp ≤ 1 2 . This proposition demonstrates the advantage of the Greedy Algorithm for an agent, par- ticularly an A0-type agent, in terms of reduced waiting time in the market when d → ∞. The combination of Theorems 3 and 5, along with Proposition 6, provides clear evi- dence that the Patient Algorithm offers an improvement in social welfare, as shown by the increased number of matched agents exiting the market. However, this improvement comes at the cost of prolonged waiting times for specific agents, particularly the A0-type agents, compared to the performance of the Greedy Algorithm. 4. Numerical Examples In this section, we provide simulation examples to support our theoretical findings, and further explore the implications of our results through a case study of real-world data on kidney exchanges. 4.1 Discrete and Continuous Models We consider a dynamic market with p = 2, which implies that there are two distinct types of hard-to-match agents, denoted as A1- and A2-agents, and one type of easy-to-match agents, referred to as A0-agents. These agents engage in market interactions, and the matching process among them is governed by the rules specified in Eq. (2). By examining the behavior and performance of these agents under different algorithms, we aim to gain deeper understanding of the market dynamics and its effect on social welfare. We evaluate the performance of the discrete models implemented in Algorithm 1 (Greedy Algorithm) and Algorithm 2 (Patient Algorithm) through simulation, and compare it to the predictions made by the continuous models described in Theorem 2 (Greedy Algorithm) and Theorem 4 (Patient Algorithm). The discrete model simulations record the state transitions of the discrete-state Markov chain, where the number of transitions approximates the time T . A length of 20, 000 transitions is considered, with the last 5, 000 being used to calculate the loss as they more accurately approximate the steady-state distribution. The continu- ous model simulations are solved using the numerical solver scipy.integrate.odeint in Python. In order to quantify the performance of the algorithms, we utilize the loss function for individual agent types as defined in Eq. (5). In this simulation, we fix the market size m = 8, 000 and the parameter λ = 0.2. Figure 2 shows the comparison of the result, which demonstrates the efficacy of the continuous ODE models in accurately predicting the behavior of the discrete dynamic mod- els. This corroborates the asymptotic equivalence between the discrete and the continuous ODE models for dynamic matching in Theorems 2 and 4. Moreover, it is seen that a higher density d of compatible agents in the market results in a better performance in terms of the loss function. 13 Dai and He Figure 2: The loss functions with m = 8, 000, λ = 0.2. Figure 3: The ratio of the loss of the Patient Algorithm to the loss of the Greedy Algorithm with m = 8, 000, λ = 0.2. 14 1234567891011121314151617181920d0.050.100.150.200.250.300.350.40lossGreedy Alg rithm (Discrete M del)A1-agentA2-agentAO-agent1234567891011121314151617181920d0.050.100.150.200.250.300.350.40l ssGreedy Alg rithm (ODE M del)A1-agentA2-agentAO-agent1234567891011121314151617181920d0.000.050.100.150.200.250.300.350.40l ssPatient Alg rithm (Discrete M del)A1-agentA2-agentAO-agent1234567891011121314151617181920d0.000.050.100.150.200.250.300.350.40l ssPatient Alg rithm (ODE M del)A1-agentA2-agentAO-agent1234567891011121314151617181920d0.00.10.20.30.40.50.60.70.80.9ratio of lo Ratio of Lo (Di crete Model)A1-agentA2-agentAO-agent1234567891011121314151617181920d0.00.10.20.30.40.50.60.70.80.9ratio of lo Ratio of Lo (ODE Model)A1-agentA2-agentAO-agent ODEs for Dynamic Matching in Heterogeneous Networks Figure 3 shows a comparison of the performance of the Patient and Greedy Algorithms in terms of their relative loss. The figure clearly demonstrates a decrease in the ratio of the loss of the Patient Algorithm to the loss of the Greedy Algorithm as the density parameter d increases. This observation aligns with our theoretical predictions of Theorems 3 and 5, which indicate that the loss of the Patient Algorithm decays exponentially as d increases, while the loss of the Greedy Algorithm decays linearly. The results of Figure 3 thus confirm our theoretical conclusion that, for increasing values of d, the Patient Algorithm will outperform the Greedy Algorithm in terms of loss minimization. 4.2 Sensitivity Analysis Figure 4: The loss functions with m = 8, 000, d = 10. To gain further understanding into the impact of the model parameters on our results, we perform a sensitivity analysis using the simulation setup outlined in Section 4.1. This analysis provides deeper insights into the interplay between different parameters and their effect on our results, offering a comprehensive view of the robustness and stability of our findings. First, we carry out a sensitivity analysis of the impact of varying the arrival rate of different agent types, represented by λ in Eq. (1). Here we fix m = 8, 000 and d = 10. The results in Figure 4 shows that an increase in λ leads to a corresponding increase in the loss 15 0.00.10.20.30.40.5λ0.040.050.060.070.080.090.100.110.12lossGreedy Alg rithm (Discrete M del)A1-agentA2-agentAO-agent0.00.10.20.30.40.5λ0.060.080.10l ssGreedy Alg rithm (ODE M del)A1-agentA2-agentAO-agent0.00.10.20.30.40.5λ0.000.02l ssPatient Alg rithm (Discrete M del)A1-agentA2-agentAO-agent0.00.10.20.30.40.5λ0.000.02l ssPatient Alg rithm (ODE M del)A1-agentA2-agentAO-agent Dai and He Figure 5: The loss function of A0-agent multiplied by ed/2 with m = 8, 000. function for hard-to-match agents. This suggests that a higher arrival rate of these agents leads to increased difficulties in the dynamic matching process. It also demonstrates the accuracy of the continuous ODE models in providing predictions for the discrete dynamic models. Second, we observe a critical point in the relationship between λ and the performance of the algorithms. Figure 4 illustrates the loss function for both hard-to-match and easy-to- match agents. The results reveal that, when using the Patient Algorithm with p = 2, the loss function for hard-to-match agents remains relatively small for λ ≤ 1/4, but experiences a sharp increase when λ > 1/4. In contrast, the loss function for easy-to-match agents remains relatively stable across different values of λ. This observation aligns with the theoretical phase transition phenomenon at λp = 1/2 of the Patient Algorithm as established in Theorem 5. Third, we evaluate the impact of varying the density parameter d, as defined in Eq.(3), on the matching performance of easy-to-match agents. Figure 5 demonstrate that, regardless of the value of λ, the ratio of ed/2 * Lpatient(A0) approaches a constant value as d increases. This observation supports our theoretical finding in Theorem 5 that, in the asymptotic regime where m approaches infinity, T approaches infinity, and d is not small, the loss for easy-to-match agents is proportional to e[− 1 2 +o(1)]d, regardless of the value of λ. 4.3 Real Data Analysis We conduct an empirical study using data from the Organ Procurement and Transplantation Network (OPTN) as of July, 2022 provided by the United Network for Organ Sharing (UNOS). This dataset contains information on 1,097,058 patient-donor pairs seeking kidney transplants. We analyze the data using the Greedy and Patient Algorithms to gain insights into the success rates of kidney exchanges. Our aim is to provide a thorough examination of the real-world dynamics of these transplants, which can inform future research and policy- making in the field of organ transplantation. In our study, we classify pairs into two categories: easy-to-match and hard-to-match agents. Pairs whose blood types are X-O are considered easy-to-match agents, where X is 16 −20020406080100120140160180200220240260280300320340360380400420440460480500520d0.50.60.70.80.91.0loss*e0.5dLoss for AO-agentsλ=0.05λ=0.15λ=0.25λ=0.35λ=0.45 ODEs for Dynamic Matching in Heterogeneous Networks Figure 6: The empirical loss with real-world UNOS data and m = 2, 000. the patient's blood type, O is the donor's blood type, and X ∈ {A, B, AB, O}. Moreover, Pairs whose blood types are AB-Y are also considered easy-to-match agents, where AB is the patient's blood type, Y is the donor's blood type, and Y ∈ {A, B, AB, O}. This is because a patient with blood type AB can receive an organ from any donor blood type, and a donor with blood type O can donate to any patient blood type. The remaining types of agents are considered hard-to-match agents. For pairs to be matched, they must first satisfy blood type compatibility, and then need to satisfy that the donor's antigens must be the same as the patient's antigens. We preprocess the dataset and obtain samples with complete information on patient and donor blood types and antigens. Then we generate pairs according to a Poisson process with the rate m = 2, 000, and set a varying probability λ ∈ (0, 1) for them to be easy-to-match agents. The maximum waiting time for a pair to become critical is determined by an exponential distribution with a mean of 1. We then run both the Greedy and Patient Algorithms in Algorithms 1 and 2, respectively, on the generated pairs and record the loss with different values of λ. Figure 6 indicates that varying the proportion of easy-to-match agents in the market, represented by λ, has little impact on the loss for easy-to-match agents, but causes a sig- nificant change in the loss for hard-to-match agents. This observation is consistent with Theorem 5. The loss for easy-to-match agents remains at e[− 1 2 +o(1)]d, regardless of the value of λ. However, for hard-to-match agents, the situation is different. When λp ≤ 1/2 and p = 1, the loss function is expected to change slowly with changes in λ, remaining at e[− 1 2 +o(1)]d. On the other hand, when λp > 1/2, the loss function for hard-to-match . Further- agents is a rapidly increasing function of λ, described by e more, it is observed that the Patient Algorithm yields a smaller loss compared to the Greedy Algorithm, further validating the theoretical predictions in Section 3.3. (cid:104) 1− 1 (cid:105) 2p −(p−1)λ+o(1) d − 5. Related Works In this section, we provide a brief review of recent advancements in the field of dynamic matching, encompassing the domains of kidney exchange, maximum matching, and multi- 17 0.10.20.30.40.50.60.70.80.9λ0.200.250.300.350.400.45LossGreedy Algorithmeasy-to-match-agenthard-to-match-agent0.10.20.30.40.50.60.70.80.9λ0.200.250.300.350.40LossPatient Algorithmeasy-to-match-agenthard-to-match-agent Dai and He agent learning. Our aim is to contextualize this paper within the wider scope of the dynamic matching literature, highlighting the key contributions and results that are most pertinent to our approach. Dynamic Matching The dynamic matching model has a wide range of applications, in- cluding real-time ride sharing ( ̈Ozkan and Ward, 2020; Feng et al., 2021), house allocation (Kurino, 2009), durable object assignment (Bloch and Houy, 2009), online assortment opti- mization (Aouad and Saban, 2022), and market making (Loertscher et al., 2022). The recent literature has mainly focused on networked settings, where dynamic matching takes place between agents embedded in complex networks, and where the presence of heterogeneous agents and compatibility constraints pose new challenges for matching algorithms. Several mechanism designs have been proposed in the literature to address the challenges of dynamic matching (see, e.g., Baccara et al., 2020; Leshno, 2022). Studies have examined the differ- ences between the Greedy and Patient Algorithms for dynamic matching in homogeneous random graphs (Akbarpour et al., 2020), prioritization in a dynamic, heterogeneous mar- ket with varying levels of hard-to-match agents and different matching technology (Ashlagi et al., 2019), and the properties of greedy algorithms in dynamic networks with a constant arrival rate and fixed matching probabilities (Kerimov et al., 2022). Our work differs in its definition of hard-to-match agents and matching probabilities and provides an innovative way to understand the trade-offs between the competing goals of matching agents quickly and optimally, while accounting for compatibility restrictions and stochastic arrival and departure times. Kidney Exchange The problem of kidney exchange, which involves the matching of donors and recipients for organ transplants, has received extensive attention in the literature and is a notable application area for the field of dynamic matching. The seminar works in kidney exchange are by Roth et al. (2004, 2005, 2007), which proposed an algorithm for finding optimal matches in kidney exchange using integer programming. Subsequent work has focused on expanding the scope of kidney exchange programs. For example, Rees et al. (2009) introduced an approach in which a single altruistic donor's kidney starts a chain of compatible matches involving multiple donor-recipient pairs. Another innovation is the use of non-directed donors (i.e., altruistic donors who do not have a specific recipient in mind) to initiate chains of exchanges (Montgomery et al., 2006). More recently, several works have focused on analyzing various models of kidney exchange, including the impact of agents entering and leaving the market stochastically and the role of waiting costs (see, e.g., ̈Unver, 2010; Ashlagi et al., 2013). Our work proposes a novel approach to modeling dynamic matching in kidney exchange programs by leveraging ordinary differential equation (ODE) models. This allows for a more comprehensive evaluation and comparison of different matching algorithms, specifically in the context of heterogeneous donor and recipient types. The use of ODE models provides a powerful framework that offers new insights into the complex dynamics of kidney exchange programs. Maximum Matching Maximum matching is a fundamental problem in graph theory and combinatorial optimization, with the goal of fining a set of edges in a graph that do not share any vertices with each other. There have been many studies on this topic, both In terms of theoretical results, in terms of theoretical results and practical algorithms. the classic maximum matching problem for bipartite graphs is polynomial-time solvable 18 ODEs for Dynamic Matching in Heterogeneous Networks by the Hungarian algorithm (Kuhn, 1955). For general graphs, the problem is NP-hard (Edmonds, 1965b), but can be solved in polynomial time using the blossom algorithm (Ed- monds, 1965a). Shapley and Shubik (1971) formulated a model of two-sided matching with side payments, which is also called the maximum weighted bipartite matching (Karlin and Peres, 2017). In terms of practical algorithms, there are several well-known heuristics for solving the maximum matching problem, such as the greedy algorithm (Galil, 1986), the Hopcroft-Karp algorithm (Hopcroft and Karp, 1973), and the push-relabel algorithm (Gold- berg and Tarjan, 1988). These algorithms have been widely used in various applications. Recently, there has been growing interest in the online version of maximum matching and its generalizations, due to the important new application domain of Internet advertising Mehta (2013). For example, Aouad and Sarita ̧c (2020) studied online matching problems on edge-weighted graphs for the goals of cost minimization and reward maximization. Our problem involves finding the maximum matching while accounting for compatibility restric- tions and dynamic, unpredictable changes in the availability of agents. This scenario poses significant challenges in the analysis of the matching process. Matching While Learning A recent thread of research focuses on the study of match- ing markets with preference learning, where participants in the market have preferences over each other, and agents learn optimal strategies from past experiences. For instance, Dai and Jordan (2021a,b) have studied the problem of agents learning optimal strategies in decentralized matching. Dai et al. (2022) considers the learning of optimal strategies under incentive constraints. Li et al. (2023) studies the learning and matching under comple- mentary preferences. The dynamic matching problem addressed in this paper is similar in nature to the problem of learning the optimal strategies of the Greedy or Patient algorithms, where preferences are represented by mutual compatibility. Moreover, our work differs from Ashlagi et al. (2021) which examines a one-sided matching problem of allocating objects to agents with private types. In contrast, our paper focuses on a two-sided matching problem where agents match with each other, and the compatibility between agents is characterized by their types. 6. Conclusion and Discussion This paper presents a novel approach to dynamic matching in heterogeneous networks through the use of ordinary differential equation (ODE) models. The ODE models facilitate the analysis of the trade-off between agents' waiting times and the percentage of matched agents in these networks, where agents are subject to compatibility constraints and their arrival and departure times are uncertain. Our results show that while the Greedy Algo- rithm reduces waiting times, it may lead to a significantly worse loss of social welfare, while the Patient Algorithm, with its focus on maximizing compatibility, significantly extends waiting times. Our simulations, sensitivity analysis, and real data analysis all demonstrate the practical applicability of our theory and provide important insights for the design of real-world dynamic matching systems. There are many interesting directions for future studies. First, it is crucial to incorporate the cost of waiting into the loss function, considering its significant impact on both the patient's quality of life and the overall financial savings for society (Held et al., 2016). Second, it is of interest to bridge the gap between the discrete dynamic model and the 19 Dai and He continuous ODE model in the finite-time regime. One approach to do so is by leveraging the Lyapunov function method, as used in previous works such as Anderson et al. (2017) and Ashlagi et al. (2022). A major challenge in this method is constructing appropriate energy functions. A potential solution is to first establish energy functions for the ODEs in the continuous models and then use these as a foundation to construct energy functions for the discrete models. Acknowledgments X. D. was partially supported by UCLA CCPR under NIH grant NICHD P2C-HD041022. We would like to thank Mark S. Handcock for helpful discussions about parts of this paper. References Mohammad Akbarpour, Shengwu Li, and Shayan Oveis Gharan. Thickness and information in dynamic matching markets. Journal of Political Economy, 128(3):783–815, 2020. Ross Anderson, Itai Ashlagi, David Gamarnik, and Yash Kanoria. Efficient dynamic barter exchange. Operations Research, 65, 2017. Aleksandr Aleksandrovich Andronov, Aleksandr Adol'fovich Vitt, and Semen Em- manuilovich Khaikin. Theory of Oscillators, volume 4. Elsevier, 2013. Ali Aouad and Daniela Saban. Online assortment optimization for two-sided matching platforms. Management Science, 2022. Ali Aouad and ̈Omer Sarita ̧c. Dynamic stochastic matching under limited time. In Pro- ceedings of the 21st ACM Conference on Economics and Computation, 2020. Itai Ashlagi, Patrick Jaillet, and Vahideh H Manshadi. Kidney exchange in dynamic sparse heterogenous pools. EC '13, 2013. Itai Ashlagi, Maximilien Burq, Patrick Jaillet, and Vahideh Manshadi. On matching and thickness in heterogeneous dynamic markets. Operations Research, 67(4):927–949, 2019. Itai Ashlagi, Faidra Monachou, and Afshin Nikzad. Optimal dynamic allocation: Simplicity through information design. In Proceedings of the 22nd ACM Conference on Economics and Computation, EC '21, 2021. Itai Ashlagi, Afshin Nikzad, and Philipp Strack. Matching in dynamic imbalanced markets. Review of Economic Studies, 2022. Mariagiovanna Baccara, SangMok Lee, and Leeat Yariv. Optimal dynamic matching. The- oretical Economics, 15(3):1221–1278, 2020. Francis Bloch and Nicolas Houy. Optimal assignment of durable objects to successive agents. Economic Theory, 51, 11 2009. 20 ODEs for Dynamic Matching in Heterogeneous Networks Krzysztof Ciesielski. The poincar ́e-bendixson theorem: from poincar ́e to the xxist century. Central European Journal of Mathematics, 10(6):2110–2128, 2012. Earl A Coddington and Norman Levinson. Theory of Ordinary Differential Equations. Tata McGraw-Hill Education, 1955. Xiaowu Dai and Michael I Jordan. Learning strategies in decentralized matching markets under uncertain preferences. Journal of Machine Learning Research, 22(260):1–50, 2021a. Xiaowu Dai and Michael I Jordan. Learning in multi-stage decentralized matching markets. Advances in Neural Information Processing Systems, 34:12798–12809, 2021b. Xiaowu Dai, Yuan Qi, and Michael I Jordan. Incentive-aware recommender systems in two-sided markets. arXiv preprint arXiv:2211.15381, 2022. Jack Edmonds. Maximum matching and a polyhedron with 0, 1-vertices. Journal of Re- search of the National Bureau of Standards B, 69(125-130):55–56, 1965a. Jack Edmonds. Paths, trees, and flowers. Canadian Journal of Mathematics, 17:449–467, 1965b. Guiyun Feng, Guangwen Kong, and Zizhuo Wang. We are on the way: Analysis of on- demand ride-hailing systems. Manufacturing & Service Operations Management, 23(5): 1237–1256, 2021. Zvi Galil. Efficient algorithms for finding maximum matching in graphs. ACM Computing Surveys (CSUR), 18(1):23–38, 1986. Andrew V Goldberg and Robert E Tarjan. A new approach to the maximum-flow problem. Journal of the ACM (JACM), 35(4):921–940, 1988. Philip J Held, Frank McCormick, Akinlolu Ojo, and John P Roberts. A cost-benefit analysis of government compensation of kidney donors. American Journal of Transplantation, 16 (3):877–885, 2016. John E Hopcroft and Richard M Karp. An n5/2 algorithm for maximum matchings in bipartite graphs. SIAM Journal on computing, 2(4):225–231, 1973. Anna R Karlin and Yuval Peres. Game Theory, Alive, volume 101. American Mathematical Society, 2017. S ̈uleyman Kerimov, Itai Ashlagi, and Itai Gurvich. On the optimality of greedy policies in dynamic matching. In Proceedings of the 23rd ACM Conference on Economics and Computation, EC '22, 2022. Harold W Kuhn. The hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2(1-2):83–97, 1955. Morimitsu Kurino. House allocation with overlapping agents: A dynamic mechanism design approach. Jena Economic Research Papers 2009-075, Friedrich-Schiller-University Jena, 2009. 21 Dai and He Alberto Leon-Garcia. Probability, Statistics, and Random Processes for Electrical Engineer- ing. Prentice Hall, 2008. Jacob D Leshno. Dynamic matching in overloaded waiting lists. American Economic Review, 112(12):3876–3910, 2022. Yuantong Li, Guang Cheng, and Xiaowu Dai. Double matching under complementary preferences. arXiv preprint arXiv:2301.10230, 2023. Simon Loertscher, Ellen V. Muir, and Peter G. Taylor. Optimal market thickness. Journal of Economic Theory, 200:105383, 2022. Aranyak Mehta. Online matching and ad allocation. Foundations and Trends in Theoretical Computer Science, 8(4):265–368, 2013. Robert A Montgomery, Sommer E Gentry, William H Marks, Daniel S Warren, Janet Hiller, Julie Houp, Andrea A Zachary, J Keith Melancon, Warren R Maley, Hamid Rabb, et al. Domino paired kidney donation: a strategy to make best use of live non-directed donation. The Lancet, 368(9533):419–421, 2006. Erhun ̈Ozkan and Amy R Ward. Dynamic matching for real-time ride sharing. Stochastic Systems, 10(1):29–70, 2020. Michael A Rees, Jonathan E Kopke, Ronald P Pelletier, Dorry L Segev, Matthew E Rutter, Alfredo J Fabrega, Jeffrey Rogers, Oleh G Pankewycz, Janet Hiller, Alvin E Roth, et al. A nonsimultaneous, extended, altruistic-donor chain. New England Journal of Medicine, 360(11):1096–1101, 2009. Alvin Roth, Tayfun S ̈onmez, Utku Unver, and M. ̈Unver. Kidney exchange. The Quarterly Journal of Economics, 119:457–488, 2004. Alvin E Roth, Tayfun S ̈onmez, and M Utku ̈Unver. Pairwise kidney exchange. Journal of Economic theory, 125(2):151–188, 2005. Alvin E Roth, Tayfun S ̈onmez, and M Utku ̈Unver. Efficient kidney exchange: Coincidence of wants in markets with compatibility-based preferences. American Economic Review, 97(3):828–851, 2007. Lloyd S Shapley and Martin Shubik. The assignment game i: The core. International Journal of Game Theory, 1(1):111–130, 1971. M. Utku ̈Unver. Dynamic kidney exchange. The Review of Economic Studies, 77(1):372– 414, 2010. 22 ODEs for Dynamic Matching in Heterogeneous Networks A. Proofs A.1 Proof of Proposition 1 Proof We analyze each of the four terms in Proposition 1 separately. First, we consider the term π∗ t (A0, A0), where the planner is trying to match an A0-type agent of interest with another A0-type agent who is in the pool. Since the hard-to-match agents are prioritized over easy-to-match agents for matching in both Greedy and Patient Algorithms, the matching of {A0, A0} happens only when the existing hard-to-match agents are incompatible with the t (A0, A0) = P(B1 ∩ B2), where the events B1 and B2 A0-type agent of interest. That is, π∗ are defined by, B1 = B2 = (cid:110) (cid:110) all Aj-type agents in the pool are incompatible with the agent of interest, ∀j ≥ 1 (cid:111) . at least one A0-type agent in the pool is compatible with the agent of interest (cid:111) , Note that, P(B1) = (1 − α) of the events B1 and B2, we have (cid:80)p k=1 |St(Ak)| and P(B2) = 1 − (1 − α)|St(A0)|. By the independence π∗ t (A0, A0) = P(B1)P(B2) = (1 − α) (cid:80)p k=1 |St(Ak)| (cid:104) 1 − (1 − α)|St(A0)|(cid:105) . Second, we consider the term π∗ t (A0, Aj), where the planner is trying to match an A0- type agent of interest with an Aj-type agent who is in the pool, for j ≥ 1. We can decompose this probability by, π∗ t (A0, Aj) = p−1 (cid:88) (cid:88) P (B3 ∩ B4) k=0 {j1,...,jk}⊆[p]\{j} p−1 (cid:88) = (cid:88) k=0 {j1,...,jk}⊆[p]\{j} P (B3) P (B4|B3) , where the events B3 and B4 depend on {j, j1, . . . , jk} which are defined by, B3 = B4 = (cid:110) (cid:110) at least one agent in the pool whose type ∈ {Aj, Aj1, . . . , Ajk } is compatible with the agent of interest (cid:111) , (8) match the agent of interest with an Aj-type agent (cid:111) . We have that, P(B3) = P(B4) = (cid:104) 1 − (1 − α)|St(Aj )|(cid:105) 1 k + 1 . Πk s=1 (cid:104) 1 − (1 − α)|St(Ajs )|(cid:105) Πl(cid:54)∈{j,j1,...,jk}(1 − α)|St(Al)|, Plugging these terms to Eq. (8), we obtain the desired result for π∗ t (A0, Aj). 23 (cid:111) , (cid:111) . (cid:111) . Dai and He Third, we consider the term π∗ t (Aj, A0). Similarly, we can decompose it as π∗ t (A0, A0) = P(B5 ∩ B6), where (cid:110) (cid:110) B5 = B6 = all Ak-type agents in the pool are incompatible with the agent of interest, ∀k ≥ 1 at least one A0-type agent in the pool is compatible with the agent of interest By the compatibility model (2), an Aj-type agent is only compatible with an Aj-type agent or an A0-type agent. Hence we have P(B5) = (1 − α)|St(Aj )|, and P(B6) = 1 − (1 − α)|St(A0)|. By the independence of the events B5 and B6, we have t (Aj, A0) = P(B5)P(B6) = (1 − α)|St(Aj )| (cid:104) π∗ 1 − (1 − α)|St(A0)|(cid:105) . Finally, we consider the term π∗ t (Aj, Aj). We have that π∗ t (Aj, Aj) = P(B7), where (cid:110) B7 = at least one Aj-type agent in the pool is compatible with the agent of interest Since P(B7) = (1 − α)|St(Aj )|, we conclude that π∗ the proof of the proposition. t (Aj, Aj) = (1 − α)|St(Aj )|. This completes A.2 Proof of Theorem 2 We start with introducing some notations. Assume that at time interval [t, t + ∆t], there are C agents that have already stayed in the market before time t become critical, R new agents arrive at the market. Then for any Ak-type agents, k = 0, 1, . . . , p, we have, E[|St+∆t(Ak)|] − |St(Ak)| = E[E[|St+∆t(Ak)| | C, R]] − |St(Ak)| = P(C = 0, R = 0) * {E[|St+∆t(Ak)| | C = 0, R = 0] − |St(Ak)|} (cid:125) (cid:123)(cid:122) := (a) + P(C = 0, R = 1) * {E[|St+∆t(Ak)| | C = 0, R = 1] − |St(Ak)|} (cid:125) (cid:124) (cid:124) (cid:123)(cid:122) := (b) (9) + P(C = 1, R = 0) * {E[|St+∆t(Ak)| | C = 1, R = 0] − |St(Ak)|} (cid:125) (cid:124) (cid:123)(cid:122) := (c) (cid:88) + u≥1,v≥1 (cid:124) P(C = u, R = v) * {E[|St+∆t(Ak)| | C = u, R = v] − |St(Ak)|} . (cid:123)(cid:122) := (d) (cid:125) In the following, we derive the ODE for Aj-type agents with j ≥ 1, and then use a similar argument to derive the ODE for A0-type agents. A.2.1 ODE for hard-to-match agents Proof First, we consider Aj-type agents with j ≥ 1, where we analyze the terms (a)-(d) in Eq. (9) separately. 24 ODEs for Dynamic Matching in Heterogeneous Networks The term (a): This is a simple case with no agent becoming critical or arriving at the market during [t, t + ∆t]. Hence P(C = 0, R = 0) * {E[|St+∆t(Aj)| | C = 0, R = 0] − |St(Aj)|} = 0. (10) In this case, there is no agent becoming critical and one agent arriving The term (b): at the market during [t, t + ∆t]. By definition, the Greedy Algorithm will immediately try to match the new agent with existing agents in the pool. We consider five scenarios of the new agent arriving at the market: • First, if the new agent is Ak-type where k (cid:54)= j, then by Eq. (2), it is incompatible with any Aj-type agent, and so does not change the number of Aj-type agents in the pool. • Second, if the new agent is Aj-type, then with probability (1 − α)|St(Aj )|+|St(A0)|, it is incompatible with the existing Aj- and A0-type agents, and so increases the number of Aj-type agents in the pool by 1. • Third, if the new agent is Aj-type, with probability (1 − α)|St(Aj )| (cid:2)1 − (1 − α)|St(A0)|(cid:3), it is incompatible with any existing Aj-type agent, but is compatible with an A0-type agent in the pool. Hence it does not change the number of Aj-type agents in the pool. • Fourth, if the new agent is Aj-type, then with probability 1 − (1 − α)|St(Aj )|, it is compatible with an existing Aj-type agent in the pool, and so decreases the number of Aj-type agents in the pool by 1. • Fifth, if the new agent is A0-type, then with probability π∗ t (A0, Aj), it is compatible with an existing Aj-type agent in the pool, and so decreases the number of Aj-type agents in the pool by 1, where π∗ t (A0, Aj) is defined in Proposition 1. Since we assume in Section 2.1 that each agent becomes critical according to a Poisson process at rate 1. This implies that, if an agent a is not critical at time t, then she becomes critical at some time between t + X, where X is an exponential random variable with mean 1, where P(X ≤ ∆t) = 1 − e−∆t. (11) Moreover, if an agent b is not critical at time t, then the probability that b is not critical during [t, t + ∆t] is, P(X > ∆t) = e−∆t. (12) 25 Dai and He Putting together the above five scenarios, we have P(C = 0, R = 1) * {E[|St+∆t(Aj)| | C = 0, R = 1] − |St(Aj)|} = e−|St|∆te−m∆tm∆t (cid:40) (cid:88) λ [|St(Aj)| − |St(Aj)|] [|St(Aj)| + 1 − |St(Aj)|] 1 − (1 − α)|St(A0)|(cid:105) | [St(Aj)| − |St(Aj)|] (13) 1≤k≤p,k(cid:54)=j (1 − α)|St(Aj )|+|St(A0)|(cid:105) (cid:104) + λ + λ(1 − α)|St(Aj )| (cid:104) (cid:104) 1 − (1 − α)|St(Aj )|(cid:105) + λ + (1 − pλ)π∗ t (A0, Aj) [|St(Aj)| − 1 − |St(Aj)|] [|St(Aj)| − 1 − |St(Aj)|] (cid:41) , where λ is defined by Eq. (1). In the above derivation, we used the Poisson model of arrival in Section 2.1 and the Poisson distribution in Eq. (12). The term (c): the market during [t, t + ∆t]. Recall that |St| = (cid:80)p scenarios of an agent becoming critical: In this case, there is one agent becoming critical but no agent arriving at j=1 |St(Aj)| + |St(A0)|. We consider two • First, if the critical agent is Ak-type with k (cid:54)= j and 0 ≤ k ≤ p, then by the definition of Greedy Algorithm, it is incompatible with any Aj-type agent in the pool. This is because otherwise, the critical agent has been matched with an Aj-type agent when either the critical Ak-type agent or an Aj-type agent has just arrived at the market. Thus, an Ak-type agent becoming critical with k (cid:54)= j does not change the number of Aj-type agents in the pool. By Eqs. (11) and (12), this first scenario occurs with the probability, p (cid:88) P(only one Ak-type agent becomes critical during [t, t + ∆t]) k=0,k(cid:54)=j p (cid:88) = k=0,k(cid:54)=j |St(Ak)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 . • Second, if the critical agent is Aj-type, then it will decrease the number of Aj-type agents in the pool by 1. Following the same argument above, this second scenario occurs with the probability P(only one Aj-type agent becomes critical during [t, t + ∆t]) = |St(Aj)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 . 26 ODEs for Dynamic Matching in Heterogeneous Networks Putting together the two scenarios, we have P(C = 1, R = 0) * {E[|St+∆t(Aj)| | C = 1, R = 0] − |St(Aj)|} p (cid:88) = k=0,k(cid:54)=j |St(Ak)| (cid:0)1 − e−∆t(cid:1) e−(|St|−1)∆t [|St(Aj)| − |St(Aj)|] + |St(Aj)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 [|St(Aj)| − 1 − |St(Aj)|] = −|St(Aj)| (cid:0)1 − e−∆t(cid:1) e−(|St|−1)∆t. The term (d): Using the result of Eq. (11), we have, (cid:88) u≥1,v≥1 P(C = u, R = v) * {E[|St+∆t(Aj)| | C = u, R = v] − |St(Aj)|} (cid:88) P(C = u) * e−m∆t(m∆t)v (cid:21) * v (cid:20) 1 v! (cid:19) (cid:18)|St| u (1 − e−∆t)u * e−m∆t(m∆t)v (cid:21) * v (cid:20) 1 v! ≤ ≤ u≥1,v≥1 (cid:88) 1≤u≤|St|,v≥1 = O(∆t2), (14) (15) where (cid:0)|St| u (cid:1) denotes the binomial coefficient of choosing u agents from |St| agents. Putting terms (a)-(d) altogether: Plugging Eqs. (10) and (13)-(15) into Eq. (9), and using the Taylor expansion, we obtain that, E[|St+∆t(Aj)|] − |St(Aj)| ∆t lim ∆t→0+ = −(1 − pλ)mπ∗ t (A0, Aj) − λm (cid:110)(cid:104) 1 − (1 − α)|St(Aj )|(cid:105) − (1 − α)|St(Aj )|+|St(A0)|(cid:111) − |St(Aj)|. By Proposition 1, π∗ t (Aj, Aj) = 1 − (1 − α)|St(Aj )|. Then together with the definition in Eq. (7), we complete the proof for d|St(Aj)|/dt for j ≥ 1 in Theorem 2. t (Aj, A0) = (1 − α)|St(Aj )| (cid:2)1 − (1 − α)|St(A0)|(cid:3), and π∗ A.2.2 ODE for easy-to-match agents Proof Next, we use a similar argument in Section A.2.1 to derive ODE for the A0-type agents. In particular, we also analyze the terms (a)-(d) in Eq. (9) separately. The term (a): Same as Eq. (10), we have P(C = 0, R = 0) * {E[|St+∆t(A0)| | C = 0, R = 0] − |St(A0)|} = 0. (16) The term (b): In this case, there is no agent becoming critical and one agent arriving at the market during [t, t + ∆t]. The Greedy Algorithm will immediately try to match the new agent with existing agents in the pool. We consider five scenarios of the new agent arriving at the market: 27 Dai and He • First, if the new agent is Aj-type with j ≥ 1, then by Proposition 1, it is compatible with an A0-type agent with probability πt(Aj, A0). If compatible, it will decrease the number of A0-type agents in the pool by 1. • Second, if the new agent is Aj-type with j ≥ 1, then it is incompatible with an A0- type agent with probability 1 − πt(Aj, A0). If incompatible, it does not change the number of A0-type agents in the pool. • Third, if the new agent is A0-type, then with probability π∗ t (A0, Aj), it is compatible with an existing Aj-type agent in the pool with j ≥ 1, and it does not change the number of A0-type agents in the pool. • Fourth, if the new agent is A0-type, then with probability π∗ t (A0, A0), it is compatible with an existing A0-type agent in the pool, and so decreases the number of A0-type agents in the pool by 1. • Fifth, if the new agent is A0-type, then with probability (1 − α)|St|, it is incompatible with any agent in the pool, and so increases the number of A0-type agents in the pool by 1. Putting together the above five scenarios, we have P(C = 0, R = 1) * {E[|St+∆t(A0)| | C = 0, R = 1] − |St(A0)|} = e−|St|∆te−m∆tm∆t (cid:40) p (cid:88) λπ∗ t (Aj, A0) [|St(A0)| − 1 − |St(A0)|] j=1 + p (cid:88) j=1 λ(1 − π∗ t (Aj, A0)) [|St(A0)| − |St(A0)|] p (cid:88) + (1 − pλ) π∗ t (A0, Aj) [|St(A0)| − |St(A0)|] (17) j=1 + (1 − pλ)π∗ t (A0, A0) [|St(A0)| − 1 − |St(A0)|] + (1 − pλ)(1 − α)|St| [|St(A0)| + 1 − |St(A0)|] (cid:41) , where we used the Poisson model of arrival in Section 2.1 and the Poisson distribution in Eq. (12). The term (c): the market during [t, t + ∆t]. We consider two scenarios of an agent becoming critical: In this case, there is one agent becoming critical but no agent arriving at • First, if the critical agent is Aj-type with j ≥ 1, then by the definition of Greedy Algorithm, it is incompatible with any A0-type agent in the pool. This is because otherwise, the critical agent has been matched with an A0-type agent when either the critical agent or an A0-type agent has just arrived at the market. Thus, an Aj-type 28 ODEs for Dynamic Matching in Heterogeneous Networks agent becoming critical with j ≥ 1 does not change the number of A0-type agents in the pool. Again, by Eqs. (11) and (12), this first scenario occurs with the probability, p (cid:88) j=1 P(only one Aj-type agent becomes critical during [t, t + ∆t]) = p (cid:88) j=1 |St(Aj)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 . • Second, if the critical agent is A0-type, then it will decrease the number of A0-type agents in the pool by 1. This second scenario occurs with the probability P(only one A0-type agent becomes critical during [t, t + ∆t]) = |St(A0)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 . Putting together the two scenarios, we have P(C = 1, R = 0) * {E[|St+∆t(A0)| | C = 1, R = 0] − |St(A0)|} = p (cid:88) j=1 |St(Aj)| (cid:0)1 − e−∆t(cid:1) e−(|St|−1)∆t [|St(A0)| − |St(A0)|] + |St(A0)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 [|St(A0)| − 1 − |St(A0)|] = −|St(A0)| (cid:0)1 − e−∆t(cid:1) e−(|St|−1)∆t. The term (d): Same as Eq. (15), we have (cid:88) u≥1,v≥1 P(C = u, R = v) * {E[|St+∆t(A0)| | C = u, R = v] − |St(A0)|} = O(∆t2). (18) (19) Putting terms (a)-(d) altogether: Plugging Eqs. (16)-(19) into Eq. (9), and using the Taylor expansion, we obtain that, lim ∆t→0+ E[|St+∆t(A0)|] − |St(A0)| ∆t = (1 − pλ)m (cid:104) (1 − α)|St| − π∗ (cid:105) t (A0, A0) − λm p (cid:88) j=1 π∗ t (Aj, A0) − |St(A0)|. By Eqs. (6) and (7), we complete the proof for d|St(A0)|/dt in Theorem 2. A.3 Proof of Theorem 3 Proof By definition of the Greedy Algorithm, the expected number of agents perishing from the market during [t, t + dt] is |St|dt. Hence the loss functions in Eqs. (4) and (5) can 29 Dai and He be equivalently written as, Lgreedy(A0) = and Lgreedy = (cid:82) T 0 |St(A0)|dt (1 − pλ)mT (cid:82) T 0 |St|dt mT . , Lgreedy(Aj) = (cid:82) T 0 |St(Aj)|dt λmT , ∀j ≥ 1, (20) The proof of Theorem 3 is completed in five parts: first, we establish that the ODEs in Theorem 2 have a unique solution; second, we prove the solution has a symmetric structure and simplifies the ODE system; third, we prove that there exists a stationary solution to the ODE system; fourth, we show that the ODE solution converges to a stationary solution using the Poincar ́e–Bendixson Theorem; finally, we analyze the loss of the Greedy Algorithm. Part 1: Existence and uniqueness of the solution. To prove the existence and uniqueness of the solution, we resort to a classical result of initial value problems in the literature. Lemma 7 (cf. Theorem 2.3 in Coddington and Levinson (1955)) Let D ⊆ R × Rn be an open set with (t0, x0) ∈ D. If F (t, x) : D → Rn is continuous in t and Lipschitz con- tinuous in x, then there exists some (cid:15) > 0, so that the initial value problem: dx(t) dt = F (t, x(t)) x(t0) = x0 has a unique solution x(t) on the interval [t0 − (cid:15), t0 + (cid:15)]. We go back to the ODEs in Theorem 2. Note that the functions π∗ t (Aj, Ak) for j, k ≥ 0 that are defined in Proposition 1 are continuous in t and differentiable in |St(Ak)|. Hence given any initial value (|S0(A0)|, |S0(A1)|, . . . , |S0(Ap)|) with |S0(Ak)| ≥ 0, Lemma 7 implies the existence and uniqueness of the solution to the ODEs in Theorem 2. Part 2: A symmetric structure of the solution. We prove that when the initial values satisfy |S0(A1)| = * * * = |S0(Ap)| ≥ 0, then |St(A1)| = * * * = |St(Ap)|, ∀t > 0. (21) This result can be proved by contradiction. Suppose there exists t0 > 0 and j1 (cid:54)= j2 ≥ 1, such that |St0(Aj1)| (cid:54)= |St0(Aj2)|. In this case, we define (| ˆSt(A1)|, . . . , | ˆSt(Ap)|) as follows: | ˆSt(Aj)| =    |St(Aj2)|, |St(Aj1)|, |St(Aj)|, if j = j1, if j = j2, if j (cid:54)= j1, j2. Then by symmetry, (|St(A0)|, | ˆSt(A1)|, . . . , | ˆSt(Ap)|) is a solution to the ODEs in Theorem 2. However, (|St0(A0)|, | ˆSt0(A1)|, . . . , | ˆSt0(Ap)|) (cid:54)= (|St0(A0)|, |St0(A1)|, . . . , |St0(Ap)|). 30 ODEs for Dynamic Matching in Heterogeneous Networks This contradicts with the uniqueness of the solution, as shown in Part 1. A byproduct of the solution symmetry in Eq. (21) is that the ODEs in Theorem 2 can be reduced into a group of two-dimensional ODEs, d|St(A0)| dt d|St(A1)| dt = (1 − pλ)m(1 − α)|St(A0)|+p|St(A1)| 1 − (1 − α)|St(A0)|(cid:105) (cid:104) − (1 − pλ)m − λmp(1 − α)|St(A1)| (cid:104) (1 − α)p|St(A1)| 1 − (1 − α)|St(A0)|(cid:105) − |St(A0)|, (22) = −(1 − pλ)m (cid:2)1 − (1 − α)p|St(A1)|(cid:3) p + λm(1 − α)|St(A0)|+|St(A1)| − |St(A1)|. − λm 1 − (1 − α)|St(A1)|(cid:105) (cid:104) where we used Proposition 1 to derive the explicit forms of π∗ t (Aj, Ak) for j, k ≥ 0. Part 3: Existence of a stationary solution. We show that the ODE system in Eq. (22) has a stationary solution that doesn't depend on time. Suppose (|S(A0)|, |S(A1)|) is the stationary solution to Eq. (22). Then 0 = (1 − pλ)m(1 − α)|S(A0)|+p|S(A1)| − (1 − pλ)m − λmp(1 − α)|S(A1)| (cid:104) 1 − (1 − α)|S(A0)|(cid:105) (cid:104) (1 − α)p|S(A1)| 1 − (1 − α)|S(A0)|(cid:105) − |S(A0)|, and 0 = −(1 − pλ)m (cid:2)1 − (1 − α)p|S(A1)|(cid:3) p − λm 1 − (1 − α)|S(A1)|(cid:105) (cid:104) + λm(1 − α)|S(A0)|+|S(A1)| − |S(A1)|. By Eq. (24), we can derive λm(1 − α)|S(A0)|+|S(A1)| (23) (24) = λm (cid:104) 1 − (1 − α)|S(A1)|(cid:105) + (1 − pλ)m (cid:2)1 − (1 − α)p|S(A1)|(cid:3) p + |S(A1)|. (25) Plugging Eq. (25) into Eq. (23), we have, |S(A0)| = −λmp(1 − α)|S(A1)| + 1 + p|S(A1)| − 4(1 − pλ)m(1 − α)p|S(A1)| (1 − α)(p−1)|S(A1)| − 2 (1 − pλ)2m pλ (1 − α)(2p−1)|S(A1)| (26) + 2m + 2 (1 − pλ) pλ (1 − pλ) λ (1 − α)(p−1)|S(A1)||S(A1)|. Hence we can write |S(A0)| = f (|S(A1)|), 31 Dai and He where Eq. (26) implies that f (*) is a continuous function of |S(A1)|. Moreover, lim m→∞ lim |S(A1)|→0 f (|S(A1)|) = −∞, and lim |S(A1)|→∞ f (|S(A1)|) = ∞. (27) On the other hand, Eq. (24) yields that, |S(A0)| = 1 ln (1 − α) (cid:32) ln (1 − α)−|S(A1)| − 1 + |S(A1)|(1 − α)−|S(A1)| λm + (cid:18) 1 λp (cid:19) (cid:104) − 1 (1 − α)−|S(A1)| − (1 − α)(p−1)|S(A1)|(cid:105) (28) (cid:33) . Hence we can write |S(A0)| = g(|S(A1)|), where Eq. (28) implies that g is a continuous and decreasing function of S(A1). Moreover, lim m→∞ lim |S(A1)|→0 g(|S(A1)|) = ∞, and lim |S(A1)|→∞ g(|S(A1)|) = −∞. (29) Combining Eqs. (27) and (29), we know that functions f and g have at least one intersection in {|S(A1)| > 0}. Moreover, since Eq. (23) requires the solution |S(A0)| > 0, we have that the stationary solution (|S(A0)|, |S(A1)|) to Eqs. (23)-(24) exists and lies in (0, ∞) × (0, ∞). Part 4: Convergence to a stationary solution. We show that the solution to the ODEs in Eq. (22) will converge to a stationary solution. To prove this result, we use two important results in dynamic systems. Lemma 8 (Bendixson Criterion; cf. Andronov et al. (2013)) Consider a system: dx(t) dt dy(t) dt = F (x, y), = G(x, y). ∂x + ∂G If ∂F plane, then the system has no periodic trajectories in the domain G. ∂y has the same sign ((cid:54)= 0) in a simply connected region G of the two-dimensional Lemma 9 (Poincar ́e–Bendixson Theorem; cf. Ciesielski (2012)) Consider a system: dx(t) dt dy(t) dt = F (x, y), = G(x, y). If the solution to this system is unique and defined for all t ≥ 0, then it is either a periodic trajectory or a fixed point. 32 ODEs for Dynamic Matching in Heterogeneous Networks We go back to the ODES in Eq. (22), where for any initial values, |S ∗(A0)|, |S ∗(A1)| > 0, d|St(A0)| dt d|St(A0)| dt > 0, (cid:12) (cid:12) (cid:12) (cid:12)|S0(A0)|=0,|S0(A1)|=0 (cid:12) (cid:12) (cid:12) (cid:12)|S0(A0)|=0,|S0(A1)|=|S∗(A1)| and > 0, and d|St(A1)| dt d|St(A1)| dt > 0, (cid:12) (cid:12) (cid:12) (cid:12)|S0(A0)|=0,|S0(A1)|=0 (cid:12) (cid:12) (cid:12) (cid:12)|S0(A0)|=|S∗(A0)|,|S0(A1)|=0 > 0. Moreover, when |St(A0)|, |St(A1)| > 0, we have, d|St(A0)| dt < (1 − pλ)m − |St(A0)|, and d|St(A1)| dt < λm − |St(A1)|. Hence the trajectory of solution (|St(A0)|, |St(A1)|) will be in a bounded area in [0, ∞) × [0, ∞). On the other hand, by Lemma 8, the solution to ODES in Eq. (22) is not a periodic trajectory. Then by Lemma 9, the solution to ODES in Eq. (22) converges to a fixed point that is a stationary solution in (0, ∞) × (0, ∞). Part 5: Property of the convergent stationary solution. We now analyze the properties of the stationary solution of Eq. (22). First, we show that when m → ∞ and α → 0, there exists a constant C1 such that We prove (30) by contradiction. α|S(A1)| ≤ C1. (cid:2)1 − (1 − αk)p|S(A1)|(cid:3) p + |S(A1)| [1 − (1 − αk) p k αk ] p + |S(A1)| (cid:104) 1 − (1 − αk)|S(A1)|(cid:105) λmk + (1 − pλ)mk (cid:20) ≥ λmk 1 − (1 − αk) (cid:21) k αk + (1 − pλ)mk ≥ λmk(1 − (cid:15)k) + (1 − pλ)mk 1 − (cid:15)k p (cid:20) ≥ mk λ + 1 − pλ p − λ(cid:15)k − 1 − pλ p (cid:21) (cid:15)k . Note that (cid:15)k → e−k when αk → 0. Hence for large enough k, we have which implies that (cid:15)k < 1 − pλ 2 , −λ(cid:15)k − 1 − pλ p (cid:15)k > − 1 − pλ 2p . Combining Eqs. (31) and (32), we have (cid:104) λmk 1 − (1 − αk)|S(A1)|(cid:105) (cid:20) (cid:21) 1 − pλ 2p > mk λ + > λmk. + (1 − pλ)mk (cid:2)1 − (1 − αk)p|S(A1)|(cid:3) p + |S(A1)| 33 (30) (31) (32) (33) Dai and He On the other hand, when k → ∞, we have λm(1 − α)|S(A0)|+|S(A1)| ≤ λmk (34) Combining Eqs. (33) and (34), we have (cid:104) λmk 1 − (1 − αk)|S(A1)|(cid:105) > λm(1 − α)|S(A0)|+|S(A1)|. + (1 − pλ)mk (cid:2)1 − (1 − αk)p|S(A1)|(cid:3) p + |S(A1)| This contradicts Eq. (25). Therefore, the result in Eq. (30) holds. Next, we show that when m → ∞ and α → 0, there exists a constant C1 such that, α|S(A1)| ≥ C1. (35) We also prove (35) by contradiction. Suppose that there exist {mk, αk, (cid:15)(cid:48) ∞, αk → 0, (cid:15)(cid:48) k → 0, and k} such that mk → αk|S(A1)| ≤ (cid:15)(cid:48) k, as k → ∞. In this case, by Eq. (26), we can show that |S(A0)| ≤ − pλm 2 , as k → ∞, which contradicts with |S(A0)| > 0. Therefore, Eqs. (30) and (35) suggest that there exist constants C1 and C(cid:48) 1, which implies that for any t ∈ [0, T ], 1 such that C1 ≤ α|S(A1)| ≤ C(cid:48) C1α−1 ≤ |S(A1)| ≤ C(cid:48) 1α−1. (36) Moreover, by Eq. (25), we have that (1 − α)|S(A0)| = λm (cid:2)1 − (1 − α)|S(A1)|(cid:3) + (1 − pλ)m [1−(1−α)p|S(A1)|] p λm + |S(A1)| . Hence when m → ∞ and α → 0, there exist constant 0 < Cα ≤ C(cid:48) α < ∞ such that, Thus, there exists constants 0 < C0 < C(cid:48) 0 < ∞ such that for any t ∈ [0, T ], Cα ≤ (1 − α)|S(A0)| ≤ C(cid:48) α. C0α−1 ≤ |S(A0)| ≤ C(cid:48) 0α−1. (37) By the above Part 4, the solution to the ODEs in Eq. (22) will converge to a stationary solution. Hence the loss functions defined in Eq. (20) satisfy lim T →∞ Lgreedy(A1) = limT →∞ |S(A1)| λm . By Eq. (36), there exist constants 0 < c1 ≤ c(cid:48) 1 < ∞ such that, c1d−1 ≤ lim T →∞ Lgreedy(A1) ≤ c(cid:48) 1d−1. 34 ODEs for Dynamic Matching in Heterogeneous Networks Similarly, the above Part 4 and Eq. (37) imply that there exist constants 0 < c2 ≤ c(cid:48) such that, 2 < ∞ c2d−1 ≤ lim T →∞ Lgreedy(A0) ≤ c(cid:48) 2d−1. Together, we also have constants 0 < c3 ≤ c(cid:48) 3 < ∞ such that, c3d−1 ≤ lim T →∞ Lgreedy ≤ c(cid:48) 3d−1. Letting c = min{c1, c2, c3} and c(cid:48) = max{c(cid:48) 1, c(cid:48) 2, c(cid:48) 3}, we complete the proof of Theorem 3. A.4 Proof of Theorem 4 Similar to the proof in Section 2, we assume that at time interval [t, t+∆t], there are C agents that have already stayed in the market before time t become critical, R new agents arrive at the market. Then for any Ak-type agents, k = 0, 1, . . . , p, we have the decomposition in Eq. (9). In the following, we derive the ODE for Aj-type agents with j ≥ 1, and then use a similar argument to derive the ODE for A0-type agents. A.4.1 ODE for hard-to-match agents Proof First, we consider Aj-type agents with j ≥ 1, where we analyze the terms (a)-(d) in Eq. (9) separately. The term (a): Same as Eq. (10), we have P(C = 0, R = 0) * {E[|St+∆t(Aj)| | C = 0, R = 0] − |St(Aj)|} = 0. (38) The term (b): In this case, there is no agent becoming critical and one agent arriving at the market during [t, t + ∆t]. By definition, the Patient Algorithm will not immediately act on the new agent. We consider two scenarios of the new agent arriving at the market: • First, if the new agent is Ak-type where k (cid:54)= j and 0 ≤ k ≤ p, then it does not change the number of Aj-type agents in the pool. • Second, if the new agent is Aj-type, then it increases the number of Aj-type agents in the pool by 1. Putting together the above two scenarios, we have P(C = 0, R = 1) * {E[|St+∆t(Aj)| | C = 0, R = 1] − |St(Aj)|} = e−|St|∆te−m∆tm∆t (cid:40) (cid:88) λ [|St(Aj)| − |St(Aj)|] 1≤k≤p,k(cid:54)=j + (1 − pλ) [|St(Aj)| − |St(Aj)|] (cid:41) , + λ [|St(Aj)| + 1 − |St(Aj)|] (39) 35 Dai and He The term (c): the market during [t, t + ∆t]. We consider five scenarios of an agent becoming critical: In this case, there is one agent becoming critical but no agent arriving at • First, if the critical agent is Ak-type with k (cid:54)= j and 1 ≤ k ≤ p, then it is incompatible with any Aj-type agent in the pool and does not change the number of Aj-type agents in the pool. By Eqs. (11) and (12), this scenario occurs with the probability, p (cid:88) P(only one Ak-type agent becomes critical during [t, t + ∆t]) k=1,k(cid:54)=j p (cid:88) = k=1,k(cid:54)=j |St(Ak)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 . • Second, if the critical agent is A0-type with, then the planner would match the crit- ical agent with an Aj-type agent in the pool with probability π∗ It will decrease the number of Aj-type agents in the pool by 1. This scenario occurs with the probability, t (A0, Aj). P(only one A0-type agent becomes critical and is matched to an Aj-type agent) = |St(A0)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 π∗ t (A0, Aj). • Third, if the critical agent is A0-type with, then the planner would not match the critical agent with an Aj-type agent in the pool with probability 1 − π∗ t (A0, Aj). It does not change the number of Aj-type agents in the pool. This scenario occurs with the probability, P(only one A0-type agent becomes critical and is not matched to an Aj-type agent) = |St(A0)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 [1 − π∗ t (A0, Aj)] . • Fourth, if the critical agent is Aj-type, then the planner would match the critical agent with an Aj-type agent in the pool with probability π∗ t (Aj, Aj). It will decrease the number of Aj-type agents in the pool by 2. This scenario occurs with the probability, P(only one Aj-type agent becomes critical and is matched to an Aj-type agent) = |St(Aj)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 π∗ t (Aj, Aj). • Fifth, if the critical agent is Aj-type, then the planner would not match the critical agent with an Aj-type agent in the pool with probability 1 − π∗ It will decrease the number of Aj-type agents in the pool by 1. This scenario occurs with the probability, t (Aj, Aj). P(only one Aj-type agent becomes critical and is not matched to an Aj-type agent) = |St(Aj)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 [1 − π∗ t (Aj, Aj)] . 36 ODEs for Dynamic Matching in Heterogeneous Networks Putting together the five scenarios, we have P(C = 1, R = 0) * {E[|St+∆t(Aj)| | C = 1, R = 0] − |St(Aj)|} (cid:40) p = (cid:0)1 − e−∆t(cid:1) e−(|St|−1)∆t |St(Ak)| [|St(Aj)| − |St(Aj)|] (cid:88) k=1,k(cid:54)=j + |St(A0)|π∗ + |St(A0)| [1 − π∗ + |St(Aj)|π∗ t (A0, Aj) [|St(Aj)| − 1 − |St(Aj)|] t (A0, Aj)] [|St(Aj)| − |St(Aj)|] t (Aj, Aj) [|St(Aj)| − 2 − |St(Aj)|] (cid:41) (40) + |St(Aj)| [1 − π∗ t (Aj, Aj)] [|St(Aj)| − 1 − |St(Aj)|] = (cid:0)1 − e−∆t(cid:1) e−(|St|−1)∆t (cid:40) − |St(A0)|π∗ t (A0, Aj) − 2|St(Aj)|π∗ t (Aj, Aj) − |St(Aj)| [1 − π∗ t (Aj, Aj)] (cid:41) . The term (d): Same as Eq. (15), we have (cid:88) u≥1,v≥1 P(C = u, R = v) * {E[|St+∆t(Aj)| | C = u, R = v] − |St(Aj)|} = O(∆t2). (41) Putting terms (a)-(d) altogether: Plugging Eqs. (38)-(41) into Eq. (9), and using the Taylor expansion, we obtain that, lim ∆t→0+ = λm − |St(A0)|π∗ E[|St+∆t(Aj)|] − |St(Aj)| ∆t t (A0, Aj) − |St(Aj)|π∗ t (Aj, Aj) − |St(Aj)|, ∀j ≥ 1. By the definition in Eq. (7), we complete the proof for d|St(Aj)|/dt for j ≥ 1. A.4.2 ODE for easy-to-match agents Proof Next, we use a similar argument in Section A.4.1 to derive ODE for the A0-type agents. In particular, we also analyze the terms (a)-(d) in Eq. (9) separately. The term (a): Same as Eq. (10), we have P(C = 0, R = 0) * {E[|St+∆t(A0)| | C = 0, R = 0] − |St(A0)|} = 0. (42) The term (b): In this case, there is no agent becoming critical and one agent arriving at the market during [t, t + ∆t]. We consider two scenarios of the new agent arriving at the market: • First, if the new agent is Aj-type where j ≥ 1, then it does not change the number of A0-type agents in the pool. 37 Dai and He • Second, if the new agent is A0-type, then it increases the number of A0-type agents in the pool by 1. Putting together the above two scenarios, we have P(C = 0, R = 1) * {E[|St+∆t(A0)| | C = 0, R = 1] − |St(A0)|} = e−|St|∆te−m∆tm∆t (cid:40) p (cid:88) λ [|St(Aj)| − |St(Aj)|] j=1 + (1 − pλ) [|St(Aj)| + 1 − |St(Aj)|] (43) (cid:41) , The term (c): the market during [t, t + ∆t]. We consider four scenarios of an agent becoming critical: In this case, there is one agent becoming critical but no agent arriving at • First, if the critical agent is Aj-type with j ≥ 1, then the planner would match the critical agent with an A0-type agent in the pool with probability π∗ t (Aj, A0). It will decrease the number of A0-type agents in the pool by 1. This scenario occurs with the probability, P(only one Aj-type agent becomes critical and is matched to an A0-type agent) = |St(Aj)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 π∗ t (Aj, A0). • Second, if the critical agent is Aj-type with j ≥ 1, then the planner would not match the critical agent with an A0-type agent in the pool with probability 1 − π∗ t (Aj, A0). It does not change the number of A0-type agents in the pool. This scenario occurs with the probability, P(only one Aj-type agent becomes critical and is not matched to an A0-type agent) = |St(Aj)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 [1 − π∗ t (Aj, A0)] . • Third, if the critical agent is A0-type with, then the planner would match the crit- ical agent with an A0-type agent in the pool with probability π∗ It will decrease the number of A0-type agents in the pool by 2. This scenario occurs with the probability, t (A0, A0). P(only one A0-type agent becomes critical and is matched to an A0-type agent) = |St(A0)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 π∗ t (A0, A0). • Fourth, if the critical agent is A0-type, then the planner would not match the critical agent with an A0-type agent in the pool with probability 1 − π∗ It will decrease the number of A0-type agents in the pool by 1. This scenario occurs with the probability, t (A0, A0). P(only one A0-type agent becomes critical and is not matched to an A0-type agent) = |St(A0)| (cid:0)1 − e−∆t(cid:1) (cid:0)e−∆t(cid:1)|St|−1 [1 − π∗ t (A0, A0)] . 38 ODEs for Dynamic Matching in Heterogeneous Networks Putting together the four scenarios, we have P(C = 1, R = 0) * {E[|St+∆t(Aj)| | C = 1, R = 0] − |St(Aj)|} = (cid:0)1 − e−∆t(cid:1) e−(|St|−1)∆t (cid:40) p (cid:88) j=1 |St(Aj)|π∗ t (Aj, A0) [|St(A0)| − 1 − |St(A0)|] + p (cid:88) j=1 |St(Aj)| [1 − π∗ t (Aj, A0)] [|St(A0)| − |St(A0)|] + |St(A0)|π∗ t (A0, A0) [|St(A0)| − 2 − |St(A0)|] + |St(A0)| [1 − π∗ t (A0, A0)] [|St(A0)| − 1 − |St(A0)|] (cid:41) (44) = (cid:0)1 − e−∆t(cid:1) e−(|St|−1)∆t (cid:40) − p (cid:88) j=1 |St(Aj)|π∗ t (Aj, A0) − 2|St(A0)|π∗ t (A0, A0) − |St(A0)| [1 − π∗ t (A0, A0)] (cid:41) . The term (d): Same as Eq. (15), we have (cid:88) u≥1,v≥1 P(C = u, R = v) * {E[|St+∆t(A0)| | C = u, R = v] − |St(A0)|} = O(∆t2). (45) Putting terms (a)-(d) altogether: Plugging Eqs. (42)-(45) into Eq. (9), and using the Taylor expansion, we obtain that, lim ∆t→0+ E[|St+∆t(A0)|] − |St(A0)| ∆t = (1 − pλ)m − p (cid:88) j=1 |St(Aj)|π∗ t (Aj, A0) − |St(A0)|π∗ t (A0, A0) − |St(A0)|. This completes the proof for d|St(A0)|/dt. A.5 Proof of Theorem 5 Proof By definition of the Patient Algorithm, the expected number of A0-type agents be- k=0 |St(Ak)| coming critical during [t, t+dt] is |St(A0)|dt. Among them, a proportion of (1−α) agents will perish from the market. Similarly, the expected number of Aj-type agents becom- ing critical during [t, t+dt] is |St(Aj)|dt. Among them, a proportion of (1−α)|St(A0)|+|St(Aj )| agents will perish from the market. The loss functions in Eqs. (4) and (5) can be equivalently (cid:80)p 39 written as, Lpatient(A0) = Lpatient(Aj) = and Lpatient = Dai and He (cid:82) T 0 |St(A0)|(1 − α) (cid:80)p k=0 |St(Ak)|dt (1 − pλ)mT , (cid:82) T 0 |St(Aj)|(1 − α)|St(A0)|+|St(Aj )|dt λmT (cid:82) T 0 |St(A0)|(1 − α) mT k=0 |St(Ak)|dt (cid:80)p (cid:80)p j=1 + (cid:82) T 0 |St(Aj)|(1 − α)|St(A0)|+|St(Aj )|dt . mT , ∀j ≥ 1, (46) The rest of the proof is completed in five parts: first, we establish that the ODEs in Theorem 4 have a unique solution; second, we prove the solution has a symmetric structure and simplifies the ODE system; third, we prove that there exists a stationary solution to the ODE system; fourth, we show that the ODE solution converges to a stationary solution using the Poincar ́e–Bendixson Theorem; finally, we analyze the loss of the Patient Algorithm. Part 1: Existence and uniqueness of the solution. The proof is the same as Part 1 in Section A.3, and we omit the details. Part 2: A symmetric structure of the solution. We prove that when the initial values satisfy |S0(A1)| = * * * = |S0(Ap)| ≥ 0, then |St(A1)| = * * * = |St(Ap)|, ∀t > 0. (47) The proof of Eq. (47) is the same as Part 2 in Section A.3, and we omit the details. A byproduct of this result is that the ODEs in Theorem 4 can be reduced into a group of two-dimensional ODEs, d|St(A0)| dt = (1 − pλ)m − |St(A0)| 1 − (1 − α)|St(A0)|(cid:105) (cid:104) (1 − α)p|St(A1)| − p|St(A1)| (1 − α)|St(A1)| − |St(A0)|, 1 − (1 − α)|St(A0)|(cid:105) (cid:104) 1 − (1 − α)p|St(A1)|(cid:105) (cid:104) d|St(A1)| dt = λm − 1 p |St(A0)| (48) − |St(A1)| (cid:104) 1 − (1 − α)|St(A1)|(cid:105) − |St(A1)|, where we used Proposition 1 and Eq. (6). Part 3: Existence of a stationary solution. We show that the ODE system in Eq. (48) has a stationary solution that doesn't depend on time. Suppose (|S(A0)|, |S(A1)|) is the stationary solution to Eq. (48). Then 0 = (1 − pλ)m − |S(A0)| 1 − (1 − α)|S(A0)|(cid:105) (cid:104) (1 − α)p|S(A1)| − p|S(A1)| 1 − (1 − α)|S(A0)|(cid:105) (cid:104) (1 − α)|S(A1)| − |S(A0)|, (49) 40 ODEs for Dynamic Matching in Heterogeneous Networks and 0 = λm − 1 p |S(A0)| (cid:104) 1 − (1 − α)p|S(A1)|(cid:105) − |S(A1)| (cid:104) 1 − (1 − α)|S(A1)|(cid:105) − |S(A1)|. (50) By Eq. (50), we can derive |S(A0)| = p (cid:8)λm − |S(A1)| (cid:2)2 − (1 − α)|S(A1)|(cid:3)(cid:9) 1 − (1 − α)p|S(A1)| ≡ f (|S(A1)|). (51) Plugging Eq. (51) to Eq. (49), we have |S(A0)| = 1 ln(1 − α)   1 +  * ln p{λm−|S(A1)|[2−(1−α)|St(A1)|]} 1−(1−α)p|S(A1)| n|S(A1)|(1 − α)|S(A1)| + p{λm−|S(A1)|[2−(1−α)|S(A1)|]} − (1 − pλ)m 1−(1−α)p|S(A1)| (1 − α)p|S(A1)|    (52) ≡ g(|S(A1)|). Let s∗ be the solution of λm − α∗ (cid:104) (cid:110) 2 − (1 − α)s∗(cid:105)(cid:111) p = 0, where the uniqueness of the solution s∗ is due to that the function (cid:110) λm − |S(A1)| p 2 − (1 − α)|S(A1)|(cid:105)(cid:111) (cid:104) is decreasing in |S(A1)| ∈ [0, ∞). Besides, s∗ > 0 holds because that lim |S(A1)|→0 p (cid:110) λm − |S(A1)| 2 − (1 − α)|S(A1)|(cid:105)(cid:111) (cid:104) = pλm > 0. Define s∗∗ = sup (cid:110) x (cid:12) (cid:12) (cid:12) ∀|S(A1)| ∈ [0, x), g(|S(A1)|) is well-defined, i.e., 1 + p{λm−|S(A1)|[2−(1−α)|S(A1)|]} − (1 − pλ)m 1−(1−α)p|S(A1)| n|S(A1)|(1 − α)|S(A1)| + p{λm−|S(A1)|[2−(1−α)|S(A1)|]} 1−(1−α)p|S(A1)| (1 − α)p|S(A1)| (cid:111) . > 0 Similarly, we can check s∗∗ > 0. Let ˆs = min{s∗, s∗∗}. Then we have that the functions f and q in Eqs. (51)-(52), respectively, are well-defined in [0, ˆs). Moreover, note that, lim|S(A1)|→0+ f (|S(A1)|) = +∞, lim|S(A1)|→0+ g(|S(A1)|) = ln 2 ln(1−α) < 0, and lim |S(A1)|→ˆs f (|S(A1)|) = (cid:40) if = 0, < ∞ if ˆs = s∗ < s∗∗, ˆs = s∗∗, 41 Dai and He and lim |S(A1)|→ˆs g(|S(A1)|) = (cid:16) (cid:40) 1 ln(1−α) ln +∞ 1 − (1−pλ)m ps∗(1−α)s∗ (cid:17) > 0, if if ˆs = s∗ < s∗∗, ˆs = s∗∗. Therefore, the functions f and g have at least one intersection point in the interval (0, ˆs), and in the intersection point, |S(A0)| = f (|S(A1)|) > 0. Thus, Eqs. (49) and (50) have at least one solution (|S(A0)|, |S(A1)|) ∈ (0, ∞) × (0, ∞), which is the stationary solution to Eq. (48). Part 4: Convergence to a stationary solution. We show that the solution to the ODEs in Eq. (48) will converge to a stationary solution. The proof is the same as Part 4 in Section A.3, and we omit the details. Part 5: Property of the convergent stationary solution. We now analyze the properties of the stationary solution of Eq. (48). In the following, we consider three cases λp > 1/2, λp < 1/2, and λp = 1/2, separately. Case 1. We start with the case that λp > 1/2. First, we show that, |S(A1)| < λm, and |S(A0)| < (1 − pλ)m. (53) To prove this result, we note that Eq. (50) yields, λm > |S(A1)| (cid:104) 2 − (1 − α)|S(A1)|(cid:105) > |S(A1)|. Similarly, we note that Eq. (49) gives, (1 − pλ)m > |S(A0)| 1 + (1 − α)p|S(A1)| − (1 − α)|S(A0)|+p|S(A1)|(cid:105) (cid:104) > |S(A0)|. Hence Eq. (53) holds. We also show that when m → ∞, α → 0, there exist constants C1, C2 > 0 such that, |S(A1)| > C1m, and |S(A0)| > C2m. (54) We use the proof by contradiction to prove Eq. (54). Suppose that there exist a sequence {mk, αk, (cid:15)k} where mk → ∞, αk → 0, (cid:15)k → 0 as k → ∞, and |S(A1)| ≤ (cid:15)km for any k ≥ 1. Then by Eq. (50), |S(A0)| = p (cid:8)λmk − |S(A1)| (cid:2)2 − (1 − αk)|S(A1)|(cid:3)(cid:9) 1 − (1 − αk)p|S(A1)| > p(λ − (cid:15)k)mk, which contradicts Eq. (53) when λp > 1/2. Hence there exists a constant C1 > 0 such that |S(A1)| > C1m. Similarly, suppose that there exist a sequence {mk, αk, (cid:15)k} where mk → ∞, αk → 0, (cid:15)k → 0, as k → ∞, and |S(A0)| ≤ (cid:15)km for any k ≥ 1. Then by Eq.(49), (1 − pλ)mk = |S(A0)| (cid:104) 1 − (1 − αk)|S(A0)|(cid:105) (1 − αk)p|S(A1)| + p|S(A1)| 1 − (1 − αk)|S(A0)|(cid:105) (cid:104) (1 − αk)|S(A1)| + |S(A0)|, (55) ≤ p|S(A1)|(1 − αk)|S(A1)| + (cid:15)kmk. 42 ODEs for Dynamic Matching in Heterogeneous Networks However, since |S(A1)| > C1mk, we have (1 − αk)|S(A1)| < (1 − αk)C1mk = e[−C1+o(1)]dk → 0. Therefore, by Eq. (55), we have that as k → ∞, (1 − pλ) ≤ 1 mk p|S(A1)|(1 − αk)|S(A1)| + (cid:15)k < pλ(1 − αk)|S(A1)| + (cid:15)k → 0. Here in the second inequality, we used Eq. (53). This result contradicts the assumption that (1 − pλ) > 0 in Eq. (1). Hence Eq. (54) holds. By Eqs. (53) and (54), we let |S(A1)| = C3m, |S(A0)| = C4m, where C1 < C3 < λ and C2 < C4 < (1 − pλ). Again, by Eqs. (49) and (50), we have, (1 − pλ) − C4 (cid:2)1 − (1 − α)C4m(cid:3) (1 − α)pC3m − pC3 (cid:2)1 − (1 − α)C4m(cid:3) (1 − α)C3m − C4 = 0, (cid:2)1 − (1 − α)C3m(cid:3) − C3 = 0. (cid:2)1 − (1 − α)pC3m(cid:3) − C3 λ − 1 p C4 (56) Since when m → ∞, α → 0, we have (1 − α)m = (cid:2)(1 − α)1/α(cid:3)d = e[−1+o(1)]d. Due to C3 > C1 > 0, we have (1 − α)C3m = e−[C3+o(C3)]d ≤ e−[C1+o(1)]d = o(e−C1d/2). Similarly, (1 − α)C4m = o(e−C2d/2). As a result, when m → ∞, α → 0, Eq. (56) can be written as: (1 − pλ) − C4 (cid:104) 1 − o (cid:16) e−C2d/2(cid:17)(cid:105) (cid:16) (cid:104) o(e−pC1d/2) − pC3 (cid:16) 1 − o e−pC1d/2(cid:17)(cid:105) o e−C2d/2(cid:17)(cid:105) (cid:104) − C3 1 − o (cid:16) e−C1d/2(cid:17) e−C1d/2(cid:17)(cid:105) (cid:16) − C4 = 0, − C3 = 0. λ − (cid:104) C4 1 p 1 − o Thus, C3 = λ − 1 and α → 0, there exist constants c1, c2 > 0 that only depend on λ and p such that, 2p + o(e− min{C1,C2}d/2), C4 = 1 − pλ + o(e−C2d/2). As a result, when m → ∞ |S(A0)| = (cid:104) 1 − pλ + o (cid:20) (cid:16) e−c1d(cid:17)(cid:105) e−c2d(cid:17)(cid:21) (cid:16) m, m, 1 2p |S(A1)| = λ − + o if λp > 1 2 . (57) Based on Eq. (57), we can analyze the loss of the Patient Algorithm when λp > 1/2. By definition of the loss functions in Eq. (46), then for any j ≥ 1, when T → ∞ and d → ∞, Lpatient(Aj) = = |S(A1)| λm λ − 1 2p + o(e−c2d) (1 − α)|S(A1)|+|S(A0)| (1 − α)[λ− 1 2p +(1−pλ)+o(e−c1d)+o(e−c2d)]m (cid:104) λ− 1 (cid:105) 2p +1−pλ+o(1) d − (cid:18) = 1 − λ 1 2pλ (cid:19) e (cid:104) − 1− 1 (cid:105) 2p −(p−1)λ+o(1) d , = e 43 Dai and He where we use the fact that O(1) can be written as eo(1)d. Moreover, consider A0 when T → ∞ and d → ∞, then (1 − α)p|S(A1)|+|S(A0)| Lpatient(A0) = = = |S(A0)| (1 − pλ)m 1 − pλ + o(e−c2d) 1 − pλ 1 − pλ + o(e−c2d) 1 − pλ 2 +o(1)]d. = e[− 1 (1 − α)[pλ− 1 2 +1−pλ+o(e−c1d)+o(e−c2d)]m e[−α+O(α2)][ 1 2 +o(e−c1d)+o(e−c2d)]m Case 2. Next, we consider the case that λp < 1/2. We first want to show when m → ∞, α → 0, there exists a constant C5 > 0 such that, |S(A1)| < C5α−1. (58) We use the proof by contradiction to show Eq. (58). Suppose that there exist a sequence {mk, αk, Mk} where mk → ∞, αk → 0, Mk → ∞, as k → ∞, and |S(A1)| > Mkα−1 for k any k ≥ 1. Then (1 − αk)|S(A1)| < (1 − αk)Mk/αk = e[−1+o(1)]Mk → 0, which together with Eq. (53) imply that 0 < p|S(A1)|(1 − αk)|S(A1)| (cid:104) < pλmk(1 − αk)|S(A1)| = o(mk). 1 − (1 − αk)|S(A0)|(cid:105) Thus, by Eq. (49), we have, |S(A0)| = (1 − pλ)mk − p|S(A1)|(1 − αk)|S(A1)|[1 − (1 − αk)|S(A0)|] 1 + [1 − (1 − αk)|S(A0)|](1 − αk)p|S(A1)| = (1 − pλ)mk − o(mk) 1 + o(1) = [1 − pλ + o(1)]mk. Moreover, by Eq. (50), we have, |S(A0)| = p * λmk − |S(A1)|(1 − αk)|S(A1)| − 2|S(A1)| (cid:2)1 − (1 − αk)|S(A1)|(cid:3) 1 − (1 − αk)p|S(A1)| < p * λmk 1 − o(1) = [1 + o(1)]pλmk. Combining Eqs. (59) and (60), we have that [1 − pλ + o(1)]mk < [1 + o(1)]pλmk, (59) (60) which implies 1 − pλ ≤ pλ and contradicts with λp < 1 2 . Thus, we proved Eq. (58). We also show that when m → ∞, α → 0, there exist a constant C6 > 0 such that, |S(A1)| > C6α−1. (61) 44 ODEs for Dynamic Matching in Heterogeneous Networks Otherwise, there exist a sequence {mk, αk, (cid:15)k} where mk → ∞, αk → 0, (cid:15)k → 0, as k → ∞, and |S(A1)| < (cid:15)kα−1 k for any k ≥ 1. By Eq. (50), we have |S(A0)| = p * λmk − |S(A1)|(1 − αk)|S(A1)| − 2|S(A1)|[1 − (1 − αk)|S(A1)|] 1 − (1 − αk)p|S(A1)| > p * λmk − 3(cid:15)kα−1 k 1 − (1 − αk)p(cid:15)kα−1 k . (62) Note that 1 − (1 − αk)p(cid:15)kα−1 k = 1 − e[−1+o(1)](p(cid:15)k) = p(cid:15)k + o((cid:15)k). By Eq. (62), we have that |S(A0)| mk ≥ p * λmk − 3(cid:15)kα−1 k p(cid:15)kmk = λ(cid:15)−1 k − 3α−1 k m−1 k . Let (cid:15)k = min{k−1, λαkmk/4} for k ≥ 1, then |S(A0)|/mk → ∞. This contradicts with Eq. (53) where |S(A0)| < (1 − pλ)mk. Thus, we proved Eq. (61). Moreover, we also note that by Eq. (50), |S(A0)| = p * λm − |S(A1)|(1 − α)|S(A1)| − 2|S(A1)|[1 − (1 − α)|S(A1)|] 1 − (1 − α)p|S(A1)| ≥ pλm. (63) Next, by Eqs. (58) and (61), we let |S(A1)| = C7α−1, and by Eqs. (53) and (63), we let |S(A0)| = C8m, where the constant C6 < C7 < C5 and pλ ≤ C8 < 1 − pλ. Again, by Eqs. (49) and (50), we have, (1 − pλ)m − C8m (cid:2)1 − (1 − α)C8m(cid:3) (1 − α)pC7α−1 − pC7α−1(1 − α)C7α−1 (cid:2)1 − (1 − α)C8m(cid:3) − C8m = 0, (64) and λm − 1 p (cid:104) 1 − (1 − α)pC7α−1(cid:105) C8m − C7α−1[1 − (1 − α)C7α−1 ] − C7α−1 = 0. (65) By rewriting Eq. (65), we obtain that, (cid:110) p λ − C7 1 αm − C7 1 (cid:111) αm [1 − (1 − α)C7α−1] C8 = 1 − (1 − α)pC7α−1 αm )(cid:3) p (cid:2)λ + O( 1 1 − (1 − α)pC7α−1 = By rewriting Eq. (64), we obtain that, C8 = = (1 − pλ) − pC7 1 αm (1 − α)C7α−1 (cid:2)1 − (1 − α)C8m(cid:3) 1 + [1 − (1 − α)C8m](1 − α)pC7α−1 (1 − pλ) + O( 1 αm ) 1 + [1 − o(e−C9αm)](1 − α)pC7α−1 (66) (67) Here C9 is a positive constant derived as follows: we have a constant 0 < C10 < C8 such that (1 − α)C8m < e−(C10+o(1))αm = o(e−C10αm/2). Let C9 = C10/2, then we have (1 − α)C8m = o(e−C9αm). By Eqs. (66) and (67), we have that, αm )(cid:3) p (cid:2)λ + O( 1 1 − (1 − α)pC7α−1 = (1 − pλ) + O( 1 1 + [1 − o(e−C9αm)](1 − α)pC7α−1 αm ) 45 Dai and He Solving this equation gives, (1 − α)pC7α−1 = 1 − 2pλ + O (cid:0)(αm)−1(cid:1) . (68) On the other hand, we have: (1 − α)pC7α−1 = epC7α−1 ln(1−α) = e[−α− 1 2 α2+O(α3)]pC7α−1 = e−pC7− 1 2 pC7α+O(α2). Plugging this into Eq. (68), we have that e−pC7− 1 2 pC7α+O(α2) = 1 − 2pλ + O (cid:0)(αm)−1(cid:1) . Solving this equation gives, ln( C7 = 1 1−2pλ ) + O( 1 αm ) + O(α2) p(1 + α/2) = 1 p (cid:20) (cid:18) ln (cid:19) 1 1 − 2pλ + O (cid:19) (cid:18) 1 αm (cid:21) (cid:104) + O(α2) 1 − α 2 (cid:105) + O(α2) . As a result, |S(A1)| = C7α−1 = (cid:16) 1 1−2pλ ln = 1 p (cid:17) p (cid:20) (cid:18) ln (cid:19) 1 1 − 2pλ + O (cid:19) (cid:18) 1 αm + O(α2) (cid:21) (cid:20) α−1 − (cid:21) + O(α) 1 2 + O( 1 αm ) α−1 + ln(1 − 2pλ) 2p + o(1). Then we plug Eq. (68) into Eq. (66), we have αm )(cid:3) αm ) p (cid:2)λ + O( 1 2pλ + O( 1 C8 = = 1 2 + O (cid:18) 1 αm (cid:19) . Thus, |S(A0)| = C8m = (cid:20) 1 2 + O (cid:19)(cid:21) (cid:18) 1 αm m. Therefore, when m → ∞ and α → 0, we have |S(A0)| = (cid:20) 1 2 (cid:20) |S(A1)| = ln + O (cid:18) (cid:19)(cid:21) (cid:18) 1 d 1 1 − 2λp m, (cid:19) + O (cid:18) 1 d (cid:19)(cid:21) m pd + 1 2p ln(1 − 2λp) + o(1), if λp < 1 2 . (69) Based on Eq. (69), we can analyze the loss of the Patient Algorithm when λp < 1/2. By definition of the loss functions in Eq. (46), then for any j ≥ 1, when T → ∞ and d → ∞, Lpatient(Aj) = (1 − α)|S(A1)|+|S(A0)| = O(d−1)(1 − α)O(α−1)(1 − α) m 2 |S(A1)| λm = O(d−1)O(1)e = e[− 1 2 +o(1)]d, m 2 ln(1−α) = O(d−1)e(− 1 2 +o(1))d) 46 ODEs for Dynamic Matching in Heterogeneous Networks where the last equation is because that O(d−1) can be written as eo(1)d. Moreover, consider A0 when T → ∞ and d → ∞, then Lpatient(A0) = = = |S(A0)| (1 − pλ)m 1 2(1 − pλ) 1 2 − pλ 1 − pλ e[− 1 2 +o(1)]d (1 − α)p|S(A1)|+|S(A0)| (1 − α) (cid:104) ln (cid:16) 1 1−2pλ (cid:17) (cid:105) +o(1) α−1 (1 − α) m 2 +O(α−1) = e[− 1 2 +o(1)]d, where we use the fact that O(1) can be written as eo(1)d. In the third equation above, we used the following facts, (cid:104) ln( (cid:105) 1−2pλ )+o(1) 1 α−1 (1 − α) = eln(1−2pλ)+o(1) = 1 − 2pλ + o(1), = e (cid:104) ln( (cid:105) 1−2pλ )+o(1) 1 α−1 ln(1−α) and (1 − α) = e[ m m 2 +O(α−1) = e[ m 2 +O(α−1)] ln(1−α) 2 +O(α−1)][−α+O(α2)] = e[− 1 2 +o(1)]d. Case 3. Finally, we consider the case that λp = 1/2. We first want to show that when m → ∞, α → 0, (1 − α)|S(A1)| → 0. (70) Otherwise, there exists a sequence {mk, αk} and a constant C12 > 0 where mk → ∞, αk → 0, as k → ∞, and (1 − αk)|S(A1)| > C12. By Eq. (50), we have |S(A0)| = p * λmk − |S(A1)| (cid:2)2 − (1 − αk)|S(A1)|(cid:3) 1 − (1 − αk)n|S(A1)| = p * [λ + o(1)]mk 1 − (1 − αk)n|S(A1)| 1 1 − Cn 12 mk. 1 2 ≥ (cid:19) + o(1) mk (cid:18) 1 2 (71) > p[λ + o(1)]mk 1 1 − Cn 12 = On the other hand, by Eq. (49), we have: |S(A0)| = (1 − pλ)mk − p|S(A1)|(1 − αk)|S(A1)| (cid:2)1 − (1 − αk)|S(A0)|(cid:3) 1 + (cid:2)1 − (1 − α)|S(A0)|(cid:3) (1 − α)p|S(A1)| < (1 − pλ)mk = 1 2 mk, which contradicts with Eq. (71). Thus, we proved Eq. (70). As a result, by Eq. (49), we have that, |S(A0)| = (1 − pλ)m − p|S(A1)|(1 − α)|S(A1)|[1 − (1 − α)|S(A0)|] 1 + [1 − (1 − α)|S(A0)|](1 − α)p|S(A1)| = (1 − nλ + o(1))m 1 + o(1) = (cid:19) + o(1) m. (cid:18) 1 2 47 (72) Dai and He This gives the desired result for |S(A0)| when m → ∞, α → 0. We also show that when m → ∞, α → 0, |S(A1)|/m → 0. (73) Otherwise, there exist a sequence {mk, αk} and a constant C11 > 0 where mk → ∞, αk → 0, as k → ∞, and |S(A1)| > C11mk for any k ≥ 1. By Eq. (50), we have |S(A0)| = p * λmk − |S(A1)| (cid:2)2 − (1 − αk)|S(A1)|(cid:3) 1 − (1 − αk)p|S(A1)| < p * (λ − C11)mk 1 − (1 − αk)p|S(A1)| ≤ p * (λ − C11)mk 1 − e−(pC11+o(1))αkmk = [pλ − pC11 + o(1)] mk (74) On the other hand, by Eq. (49), we have: |S(A0)| = (1 − pλ)mk − p|S(A1)|(1 − αk)|S(A1)| (cid:2)1 − (1 − αk)|S(A0)|(cid:3) 1 + (cid:2)1 − (1 − αk)|S(A0)|(cid:3) (1 − αk)p|S(A1)| = (1 − pλ)mk − p|S(A1)|O(e[−C11+o(1)]αkmk ) (cid:2)1 − (1 − αk)|S(A0)|(cid:3) 1 + [1 − (1 − αk)|S(A0)|]O(e−[pC11+o(1)]αkmk ) (75) = [1 − pλ + o(1)]mk 1 + o(1) = [1 − pλ + o(1)]mk. By Eqs. (74) and (75), we have that [pλ − pC11 + o(1)]mk = [1 − pλ + o(1)]mk, which implies that pλ > 1/2, and contradicts with pλ = 1/2. Thus we proved Eq. (73). Next, we want to prove that when m → ∞, α → 0, −2p (cid:2)1 − (1 − α)|S(A1)|(cid:3) |S(A1)| (cid:2)−2 + O (cid:0)(1 − α)p|S(A1)|(cid:1)(cid:3) (1 − α)p|S(A1)| = (cid:20) 1 2 + O (cid:18) |S(A1)| m (1 − α)|S(A1)| (cid:19)(cid:21) m. (76) This result can be proved as follows. By Eqs. (49) and (50), we obtain that |S(A0)| = p * λm − |S(A1)| (cid:2)2 − (1 − α)|S(A1)|(cid:3) 1 − (1 − α)p|S(A1)| (1 − pλ)m − p|S(A1)|(1 − α)|S(A1)| (cid:2)1 − (1 − α)|S(A0)|(cid:3) 1 + [1 − (1 − α)|S(A0)|](1 − α)p|S(A1)| . = Thus, by Taylor expansion, we have (cid:104) (cid:110) 2 − (1 − α)|S(A1)|(cid:105)(cid:111) λm − |S(A1)| p (cid:110) (1 − pλ)m − p|S(A1)|(1 − α)|S(A1)| (cid:104) = 1 − (1 − α)|S(A0)|(cid:105)(cid:111) * 1 − (1 − α)p|S(A1)| 1 + (1 − α)p|S(A1)| − (1 − α)|S(A0)|+p|S(A1)| (1 − pλ)m − p|S(A1)|(1 − α)|S(A1)| (cid:104) (cid:110) (cid:104) 1 − 2(1 − α)p|S(A1)| + O (1 − α)2p|S(A1)|(cid:17)(cid:105) (cid:16) * 1 − (1 − α)|S(A0)|(cid:105)(cid:111) e(− 1 + O (cid:16) 2 +o(1))αm(cid:17) . = 48 ODEs for Dynamic Matching in Heterogeneous Networks The above equation yields that, −2p|S(A1)| + 2p|S(A1)|(1 − α)|S(A1)| −2(1 − α)p|S(A1)| + O (cid:0)(1 − α)2p|S(A1)|(cid:1) = 1 2 m − p|S(A1)|(1 − α)|S(A1)| + (cid:16) 2 +o(1))αm(cid:17) e(− 1 O (77) −2(1 − α)p|S(A1)| + O (cid:0)(1 − α)2p|S(A1)|(cid:1) . Note that by Eq. (73), |S(A1)|/m → 0, then if m → ∞, α → 0, we have (1 − α)p|S(A1)| ≥ (1 − α)p(cid:15)m = e(−p(cid:15)+o(1))αm, ∀(cid:15) > 0. Thus, (cid:16) 2 +o(1))αm(cid:17) −2(1 − α)p|S(A1)| + O (cid:0)(1 − α)2p|S(A1)|(cid:1) = o e(− 1 O (cid:16) 2 +(cid:15))αm(cid:17) e−( 1 , ∀(cid:15) > 0. Again since |S(A1)|/m → 0, we have e−δαm = o (cid:16) (1 − α)|S(A1)|(cid:17) , ∀δ > 0. By Eq. (70), we have (1 − α)|S(A1)| → 0. Hence as m → ∞, α → 0, |S(A1)| > α−1. Thus, as m → ∞, α → 0, there exists a constant C13 > 0 such that |S(A1)| m (1 − α)|S(A1)| > 1 αm As a result, e− 1 4 αm > C13e−( 1 2 +(cid:15))αm. (cid:16) 2 +o(1))αm(cid:17) −2(1 − α)p|S(A1)| + O (cid:0)(1 − α)2p|S(A1)|(cid:1) = o e(− 1 O (cid:18) |S(A1)| m (1 − α)|S(A1)| (cid:19) . Thus, by Eqs. (77) and (78), we complete the proof of Eq. (76). Next, we want to prove that when m → ∞, α → 0, then |S(A1)| (1 − α)p|S(A1)| = (cid:18) 1 2p (cid:19) + o(1) m. To prove Eq. (79), we note that by Eqs. (70), (73) and (76), then [−2p + o(1)]|S(A1)| [−2 + o(1)](1 − α)p|S(A1)| = (cid:18) 1 2 (cid:19) + o(1) m. Thus, we proved Eq. (79). Finally, we can prove that when m → ∞, α → 0, then (78) (79) (80) (1 − α)p|S(A1)|+|S(A0)| = (1 − α) m 2 (1 − α)O((1−α)(p+1)|S(A1)|)m. (81) 49 Dai and He Note that by Eq. (49), we have: |S(A0)| = (1 − pλm) − p|S(A1)|(1 − α)|S(A1)|[1 − (1 − α)|S(A0)|] 1 + [1 − (1 − α)|S(A0)|](1 − α)p|S(A1)| 1 2 m − (1 − α)(p+1)|S(A1)| [1 + o(1)] m = 1 + (1 − α)p|S(A1)| (cid:104) (cid:16) e(− 1 (1 − α)(n+1)|S(A1)|(cid:17)(cid:21) (cid:104) 1 + O − O (cid:16) = m 2 +o(1))d(cid:17)(cid:105) (cid:20) 1 2 1 − (1 − α)p|S(A1)| + O (cid:16) (1 − α)2p|S(A1)|(cid:17)(cid:105) = m 2 − m 2 (1 − α)p|S(A1)| + O (cid:16) (1 − α)(p+1)|S(A1)|(cid:17) . Then we have: (1 − α)p|S(A1)|+|S(A0)| = (1 − α) m 2 +O((1−α)(p+1)|S(A1)|)(1 − α)− m 2 (1−α)p|S(A1)|+p|S(A1)| (82) On the other hand, note that by Eq. (76), we have p|S(A1)| − p(1 − α)|S(A1)||S(A1)| = m 2 (1 − α)p|S(A1)| + m (cid:26) (cid:16) (1 − α)(p+1)|S(A1)|(cid:17) O + O (cid:18) |S(A1)| m (1 − α)|S(A1)| (cid:19)(cid:27) , which implies that − m 2 = m (1 − α)p|S(A1)| + p|S(A1)| (cid:26) (1 − α)(p+1)|S(A1)|(cid:17) O (cid:16) + O (cid:18) |S(A1)| m (1 − α)|S(A1)| (cid:19)(cid:27) . (83) Moreover, by Eq. (80), we have that |S(A1)|/m = O (cid:0)(1 − α)p|S(A1)|(cid:1), which implies that |S(A1)| m (1 − α)|S(A1)| = O (cid:16) (1 − α)(p+1)|S(A1)|(cid:17) . Combining Eqs. (83) and (84), we obtain that − m 2 (1 − α)p|S(A1)| + p|S(A1)| = m (cid:110) O (cid:16) (1 − α)(p+1)|S(A1)|(cid:17)(cid:111) . (84) (85) Therefore, combining Eqs. (82) and (85), we completed the proof of Eqs. (81). Putting together Eqs. (72), (79), and (81), we prove that when m → ∞, α → 0, and λp = 1/2, then (cid:21) + o(1) m, |S(A0)| = |S(A1)| = (cid:20) 1 2 (cid:20) 1 2p (cid:21) + o(1) (1 − α)p|S(A1)|m, (86) (1 − α)p|S(A1)|+|S(A0)| = (1 − α)m/2(1 − α)O((1−α)(p+1)|S(A1)|)m. 50 ODEs for Dynamic Matching in Heterogeneous Networks Based on Eq. (86), we can analyze the loss of the Patient Algorithm when λp = 1/2. By definition of the loss function in Eq. (46), we have that when T → ∞ and for any j ≥ 1, Lpatient(Aj) = = = = |S(A1)| λm 2p + o(1) (cid:16) 1 1 2p + o(1) λ (cid:18) 1 2pλ (1 − α)|S(A1)|+|S(A0)| (cid:17) (1 − α)p|S(A1)|m λm (1 − α)|S(A1)|+|S(A0)| (1 − α)(p+1)|S(A1)|+|S(A0)| (cid:19) + o(1) (1 − α) m 2 (1 − α)|S(A1)|(1 − α)O((1−α)(p+1)|S(A1)|m). We want to show that |S(A1)| = O (cid:0)α−1 ln(d)(cid:1) . (87) (88) This can be proved by contradiction. Suppose a sequence {mk, dk, Mk}, where mk → ∞, dk → ∞, Mk → ∞, and αk = dk/mk → 0, as k → ∞, and |S(A1)| > Mkα−1 k ln(dk). Then Thus, > k ln(dk) Mkα−1 (1 − αk)pMkα−1 k ln(dk) |S(A1)| (1 − αk)p|S(A1)| Mkα−1 k ln(dk) = e−(o(1)+pMk ln(dk)) = Mkα−1 k ln(dk)dpMk k eo(1). |S(A1)| (1 − αk)p|S(A1)|mk = Mk ln(dk)dpMk−1 k eo(1) → ∞, which contradicts Eq. (86). As a result, we proved Eq. (88). Combining Eqs. (86) and (88), we obtain that, as d → ∞ (1 − α)p|S(A1)| = (2p + o(1)) |S(A1)| m = O (cid:18) ln d d (cid:19) . Therefore, (1 − α)|S(A1)| = O (cid:18)(cid:16) ln(d) d (cid:19) (cid:17) 1 p , and (1 − α)(p+1)|S(A1)| = O (cid:18)(cid:16) ln(d) d (cid:17)1+ 1 p (cid:19) . As a result, (1 − α)O((1−α)(p+1)|S(A1)|m) = eO(( ln(d) p ln(d)1+ 1 p )m = eO(d− 1 = eO(α)O(( ln(d) d )1+ 1 d )1+ 1 p )m ln(1−α) p ) = eo(1) = 1 + o(1). (89) 51 Dai and He Therefore, when d → ∞, T → ∞, and pλ = 1/2, Eq. (87) can be written as, Lpatient(Aj) = (cid:19) (cid:19) (cid:19) + o(1) + o(1) = (cid:18) 1 2pλ (cid:18) 1 2pλ (cid:18) 1 2pλ = e[− 1 2 +o(1)]d. = + o(1) (1 − α) m 2 +|S(A1)|(1 − α)O((1−α)(p+1)|S(A1)|m) (1 − α) m 2 (1 − α)|S(A1)|(1 + o(1)) eln(1−α) m 2 (1 − α)|S(A1)|(1 + o(1)) In the last equation, we use that (1 − α)|S(A1)| = eo(1)d, which can be proven as follows. By Eq. (88), |S(A1)| = O (cid:0)α−1 ln(d)(cid:1). Hence, (1 − α)|S(A1)| = (1 − α)O(α−1 ln(d)) = eo(1)d. Similarly, by definition of the loss function in Eq. (46), we have that when T → ∞ and pλ = 1/2, Lpatient(A0) = |S(A0| (1 − pλ)m (1 − α)p|S(A1)|+|S(A0)| = (1 + o(1)) (1 − α)p|S(A1)|+|S(A0)| = (1 + o(1)) (1 − α) m 2 (1 + o(1)) = (1 + o(1))e m 2 ln(1−α) (90) m 2 (−α+O(α2)) = (1 + o(1))e = e[− 1 2 +o(1)]d. The second and third equations are due to Eqs. (86) and (89). Combining the results in the three cases, we finish the proof of limT →∞ Lpatient(Ak) for k ≥ 0 in Theorem 5. Together, by definition of the loss function in Eq. (46), we have that when T → ∞, Lpatient = lim T →∞ 1− 1 (cid:105) 2p −(p−1)λ+o(1) (cid:104)  −  e e[− 1  2 +o(1)]d d if λp > 1 2 , if λp ≤ 1 2 . This completes the proof of Theorem 3. A.6 Proof of Proposition 6 Proof We consider the Greedy Algorithm and the Patient Algorithm separately. First, under the Greedy Algorithm, Eqs. (36) and (37) in Section A.3 show that there exists a constant ̃c = min{C0, C1} such that, |S(Ak)| ≥ ̃c m d . Then by Little's Law (e.g., Leon-Garcia, 2008), the average waiting time of A0-type agents and Aj-type agents (j ≥ 1) in the market can be calculated as, respectively, ̃c 1 − pλ * 1 d and ̃c λ * 1 d . 52 ODEs for Dynamic Matching in Heterogeneous Networks Second, under the Patient Algorithm, Eq. (57) in Section A.5 shows that |S(A0)| = (cid:104) 1 − pλ + o (cid:20) (cid:16) e−c1d(cid:17)(cid:105) e−c2d(cid:17)(cid:21) (cid:16) m, m, 1 2p |S(A1)| = λ − + o if λp > 1 2 . By Little's Law, the average waiting time of A0-type agents and Aj-type agents (j ≥ 1) in the market can be calculated as, respectively, 1 − pλ + o (cid:0)e−c1d(cid:1) 1 − pλ and λ − 1 2p + o (cid:0)e−c2d(cid:1) λ , if λp > 1 2 . Similarly, Eq. (69) in Section A.5 shows that |S(A0)| = (cid:20) 1 2 (cid:20) |S(A1)| = ln + O (cid:18) (cid:19)(cid:21) (cid:18) 1 d 1 1 − 2λp m, (cid:19) + O (cid:18) 1 d (cid:19)(cid:21) 1 pα + 1 2p ln(1 − 2λp) + o(1), if λp < 1 2 . By Little's Law (e.g., Leon-Garcia, 2008), the average waiting time of A0-type agents and Aj-type agents (j ≥ 1) in the market can be calculated as, respectively, 1/2 + o(1) 1 − pλ and (cid:16) 1 (cid:17) 1−2λp ln + o(1) λpd , if λp < 1 2 . Finally, Eqs. (86) and (88) in Section A.5 show that (cid:21) + o(1) m, |S(A0)| = |S(A1)| = (cid:20) 1 2 (cid:20) 1 2p (cid:21) + o(1) (1 − α)p*O(α−1 ln(d))m, if λp = 1 2 . By Little's Law, the average waiting time of A0-type agents and Aj-type agents (j ≥ 1) in the market can be calculated as, respectively, 1/2 + o(1) 1 − pλ and Θ (cid:19) (cid:18) 1 λd , if λp = 1 2 . This completes the proof of Proposition 6. 53
http://arxiv.org/abs/2302.09755v2
2023-04-12T08:57:05
2023-02-20T04:23:34
Finding Heterophilic Neighbors via Confidence-based Subgraph Matching for Semi-supervised Node Classification
Graph Neural Networks (GNNs) have proven to be powerful in many graph-based applications. However, they fail to generalize well under heterophilic setups, where neighbor nodes have different labels. To address this challenge, we employ a confidence ratio as a hyper-parameter, assuming that some of the edges are disassortative (heterophilic). Here, we propose a two-phased algorithm. Firstly, we determine edge coefficients through subgraph matching using a supplementary module. Then, we apply GNNs with a modified label propagation mechanism to utilize the edge coefficients effectively. Specifically, our supplementary module identifies a certain proportion of task-irrelevant edges based on a given confidence ratio. Using the remaining edges, we employ the widely used optimal transport to measure the similarity between two nodes with their subgraphs. Finally, using the coefficients as supplementary information on GNNs, we improve the label propagation mechanism which can prevent two nodes with smaller weights from being closer. The experiments on benchmark datasets show that our model alleviates over-smoothing and improves performance.
[ "Yoonhyuk Choi", "Jiho Choi", "Taewook Ko", "Chong-Kwon Kim" ]
10.1145/3511808.3557324
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1145/3511808.3557324", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.09755v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09755v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.SI" ]
3 2 0 2 r p A 2 1 ] G L . s c [ 2 v 5 5 7 9 0 . 2 0 3 2 : v i X r a Finding Heterophilic Neighbors via Confidence-based Subgraph Matching for Semi-supervised Node Classification Yoonhyuk Choi Seoul National University Seoul, Republic of Korea [email protected] Jiho Choi Seoul National University Seoul, Republic of Korea [email protected] Taewook Ko Seoul National University Seoul, Republic of Korea [email protected] Hyungho Byun Seoul National University Seoul, Republic of Korea [email protected] Chong-Kwon Kim Korea Institute of Energy Technology Naju, Republic of Korea [email protected] ABSTRACT Graph Neural Networks (GNNs) have proven to be powerful in many graph-based applications. However, they fail to generalize well under heterophilic setups, where neighbor nodes have differ- ent labels. To address this challenge, we employ a confidence ratio as a hyper-parameter, assuming that some of the edges are disas- sortative (heterophilic). Here, we propose a two-phased algorithm. Firstly, we determine edge coefficients through subgraph matching using a supplementary module. Then, we apply GNNs with a modi- fied label propagation mechanism to utilize the edge coefficients effectively. Specifically, our supplementary module identifies a cer- tain proportion of task-irrelevant edges based on a given confidence ratio. Using the remaining edges, we employ the widely used opti- mal transport to measure the similarity between two nodes with their subgraphs. Finally, using the coefficients as supplementary information on GNNs, we improve the label propagation mech- anism which can prevent two nodes with smaller weights from being closer. The experiments on benchmark datasets show that our model alleviates over-smoothing and improves performance. CCS CONCEPTS • Computing methodologies → Machine learning. KEYWORDS Graph Neural Networks, Graph Representation Learning, Graph Similarity Computation, Label Propagation ACM Reference Format: Yoonhyuk Choi, Jiho Choi, Taewook Ko, Hyungho Byun, and Chong-Kwon Kim. 2022. Finding Heterophilic Neighbors via Confidence-based Subgraph Matching for Semi-supervised Node Classification. In Proceedings of the 31st ACM International Conference on Information and Knowledge Management (CIKM '22), October 17–21, 2022, Atlanta, GA, USA. ACM, New York, NY, USA, 11 pages. https://doi.org/10.1145/3511808.3557324 Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. CIKM '22, October 17–21, 2022, Atlanta, GA, USA. © 2022 Association for Computing Machinery. ACM ISBN 978-1-4503-9236-5/22/10. . . $15.00 https://doi.org/10.1145/3511808.3557324 1 INTRODUCTION The investigation of graph-structured data has gained significant attention in various fields; physics [11], protein-protein interac- tions [10], and social networks [9]. Integrated with deep neural net- works (DNNs) [19], graph neural networks (GNNs) have achieved state-of-the-performance by concurrently modeling node features and network structures [5, 12, 16, 36, 40]. Specifically, the mes- sage passing plays an important role by aggregating features from neighboring nodes [11]. Consequently, GNNs often have shown the best performance in various tasks including semi-supervised node classification and link prediction. However, recent studies reveal that GNNs gain advantages of message passing under limited conditions, e.g., high assortativity of subject networks [28]. In this paper, we assume two types of networks; homophilic (assortative) ones where most edges connect two nodes with the same label, and heterophilic graphs where the most connections are disassortative. Most prior work on GNNs assumes that connected nodes are likely to possess the same label, and thus, they fail to attain sufficient performance for many real- world heterophilic datasets [30]. Many clever schemes have been introduced to solve the problem. Some of them specify different weights for each connection [1, 15, 40, 48], or remove disassortative edges [8, 24, 50]. Others employ distant nodes with similar features [14, 31, 49] or apply different aggregation boundary based on the central nodes [43]. Nonetheless, there is a question to be addressed: is it necessary to specify different weights for GNNs? To answer the above question, we conduct an investigation using two representative datasets; one is an assortative citation network called Cora [27], and the other one is Chameleon [35] which con- tains many disassortative links between Wikipedia web pages. In Figure 1, we randomly prune a certain ratio of assortative / disassor- tative edges and describe the node classification accuracy of GCN [16]. Through this study, we observe two characteristics; (1) for Cora, the performance increases as the assortative edges are main- tained, while disassortative edges are removed. On the contrary, Chameleon data is rather heterophilic and thus, the disassortative links play an important role as the number of remaining assortative edges becomes smaller. To analyze this result, we take Figure 1-c as an example. Though the graph is heterophilic, two central nodes share the same types of neighborhoods (2 green, 1 yellow) that can contribute to distinguishing them from others [23, 26]. (2) the CIKM '22, October 17–21, 2022, Atlanta, GA, USA. Yoonhyuk Choi et al. (a) (b) (c) Figure 1: Node classification accuracy (%) of GCN on different datasets; (a) Cora, and (b) Chameleon. For each graph, we ran- domly prune a certain proportion of assortative / disassortative edges and plot their performance. We also describe a special case of (c) helpful aggregation scenario under disassortative graphs removal of assortative edges has a greater impact on the overall per- formance than disassortative ones. For example, the performance in Cora using the original graph is 79.8 % (top right). If we remove all disassortative edges, it attains 88.1 % (top left), whereas eliminating assortative links becomes 51.1 % (bottom right). To summarize, we conjecture that removing a small proportion of assortative edges can be harmful, and thus, assigning accurate weights are funda- mental for GNNs. Now, the problem is; how can we figure out these coefficients correctly and utilize them? To achieve this, we focus on the GAM [38] that suggests a sup- plementary module with label propagation. Specifically, the supple- mentary module of GAM only utilizes a central node to debilitate noises. However, referring to Figure 1, excluding all links of assorta- tive and disassortative shows the lowest performance, which is the same as GAM's method. To solve this limitation, our supplementary module focuses on the widely used optimal transport [18, 29, 32, 45] to measure similarity between two subgraphs. In addition, we fur- ther apply a confidence ratio to deal with multiple disassortative links. Then, considering these predictions as supplementary edge coefficients, we apply label propagation [2] between a certain pro- portion of high confident edges, while the others are considered disassortative and the connected nodes are prevented from being similar. Our contributions can be summarized as follows: • We introduce a confidence-based subgraph matching to re- trieve edge coefficients accurately. Our model is scalable and generalizes well for both homophilic / heterophilic graphs, which can be achieved by varying the values of the confi- dence ratio. • Assuming that a certain proportion of entire edges are dis- assortative, we improve the label propagation to keep two nodes with a lower similarity score from being closer. Specif- ically, we divide the edge coefficients into two parts, which can guide the positive pairs to be similar and vice versa. • We conduct extensive experiments on publicly available datasets to validate the above suggestions. The ablation stud- ies indicate the superiority of subgraph matching techniques for retrieving class sharing probability. 2 RELATED WORK Graph neural networks (GNNs) have shown substantial improve- ment for semi-supervised classification tasks. Most of them can be categorized into two types; spectral-based and spatial-based methods. The first one utilizes structural information of the entire graph through Laplacian decomposition [13] that requires high computational costs O (n3). To reduce their complexity, GCN [16] suggests a first-order approximation of Chebyshev polynomials [5] and utilizes features of neighboring nodes by simply stacking convolutional layers. Ada-GNN [7] further employs an adaptive frequency filter to capture different perspectives of nodes. However, these algorithms inevitably aggregate noisy adjacent nodes, where they assume two connected nodes are likely to share the same label. Recently, some algorithms focus on the retrieval of edge coef- ficients using the node features. For example, GAT [40] measures the relevance between two nodes by applying an attention layer to their features. Similarly, Masked-GCN [48] estimates attribute-wise similarity for precise propagation. GNNExplainer [50] identifies the set of important edges and features that maximize the mutual information of the final prediction. Nonetheless, these methods may fail to generalize well under a heterophilic graph, where the message passing inevitably makes two connected nodes similar. To solve this problem, FAGCN [1] selects whether to propa- gate low-frequency or high-frequency signals by enabling edges to have negative coefficients. L2Q [43] parameterizes the aggrega- tion boundary of each node to deal with heterophily. SuperGAT [15] differentiates between friendly and noisy neighbors based on their homophily and node degrees. However, these methods also implicate noisy information since they work as a downstream task of GNNs. Some argue that graph sparsification [6, 52] is consider- able for graph denoising. For example, PTDNet [24] adopts nuclear norm to prune edges between communities. Yet, it also implicates risk for pruning positive edges and is not powerful enough for classification compared to classical GNNs. As another branch, non-local neural networks [22, 42] have gained increasing attention for capturing long-range dependen- cies. Since previous GNNs only utilize local adjacent nodes, they Finding Heterophilic Neighbors via Confidence-based Subgraph Matching for Semi-supervised Node Classification CIKM '22, October 17–21, 2022, Atlanta, GA, USA. fail to deal with heterophilic graphs. Instead of directly specifying coefficients, finding distant but similar nodes has increased the rep- resentational power of GNNs. Specifically, Geom-GCN [31] further exploits distant nodes within a specific boundary, and executes grid- based aggregation. Simp-GCN [14] mixes the original adjacency matrix with a feature-based similarity matrix through learnable parameters. Nonetheless, they implicate two limitations. Firstly, operating as a downstream task of GNNs may inevitably contain noisy information after aggregation. Secondly, measuring relevance between two nodes can be biased (or risky) under a semi-supervised setting that has few labeled samples [21]. Apart from retrieving edge coefficients, a strategy for utilizing this information is also considerable. For example, P-reg [47] simply utilizes entire edges to provide additional information for GNNs. NGM [2] integrates label propagation (LP) with GNNs, while GAM [38] further parameterize edge coefficients. However, these methods are highly localized and fail to discriminate less important edges under the global aspect. Further, they show limited performance for precise prediction under our experiments. Instead, we focus on pairwise matching between two subgraphs that are independent of GNN modules. Using the mechanism of optimal transport (OT) [18, 29, 44], we integrate a confidence-based denoising network to secure robustness, followed by our label propagation. 3 NOTATIONS We first set up the problem with the commonly used notations of graph-structured data. Let us define an undirected graph G = (V, E), where V = {v1, v2, ..., vN } represents set of N nodes and E = {e1, e2, ..., eM } denotes the set of M edges. A ∈ RN ×N stands for adjacency matrix of graph G. The properties of entire nodes N are represented as feature matrix X ∈ RN ×F with dimension F . We assume the label matrix Y ∈ RN ×C , where C is the number of classes. Each row of Y corresponds to a one-hot vector of node v's label. Using partially labeled nodes VL ⊂ V as a training set, we aim to infer the labels of unlabeled nodes VU = V − VL. 4 METHODOLOGIES Figure 2 illustrates the overall architecture of our model which consists of two parts. On the right side, we describe the GNN module with label propagation which takes the predicted edge weights for training. The left one stands for the subgraph matching that provides edge coefficients as supplementary information. The two modules do not share loss or parameters and are updated independently. In Section 4.1, we first introduce methodologies for retrieving edge coefficients, followed by our subgraph matching module. In Section 4.2, we suggest strategies to utilize these predic- tions effectively through label propagation. 4.1 Retrieving Edge Coefficients Recently, many efforts have been dedicated to specifying edge coef- ficients, and we categorize them into two types. Firstly, in Section 4.1.1, we take previous methods that only utilize central nodes for classification. Secondly, in Section 4.1.2, we describe previous algo- rithms that further utilize the adjacent nodes for prediction. Finally, we discuss the advantages and limitations of these methods and describe our subgraph matching module in Section 4.1.3. 4.1.1 Retrieving edge coefficients using a central node. These types of methods include message passing, but only a central node is used for similarity measure, not a subgraph. With the slight abuse of notation, let us assume the hi, h j as hidden representations of two nodes i, j. Graph agreement model (GAM) [38] introduces an auxiliary model to predict a same class probability wi j between two nodes i, j as below: wi j = MLP ((hi − h j )2). (1) The MLP is a fully-connected network with non-linear activation. GAM works well under the heterophilic graph since they do not utilize neighboring nodes. However, as the homophily ratio of the graph increases, we notice that they show significantly lower performance even compared to the plain GCN [16]. Graph attention network (GAT) [40] applies layer-wise at- tention as a downstream task of GNN as below: wl i j = exp (σ (al [hl i ||hl exp (σ (al [hl j ])) i ||hl (cid:205)k ∈Ni k ])) . (2) GAT specifies different weights for each layer, where al is a learn- able vector at the l −th layer. Compared to GAM, a softmax function normalizes the weights that are highly dependent on the degree of each node, which makes it harder to determine their importance. Further, the message passing can degrade the performance since the edge coefficients wi j always maintain a positive value. FAGCN [1] improves GAT from two perspectives; replacing softmax with degree-based normalization, and adopting different activation function as below: i j = tanh(al [hl wl i ||hl j ]). (3) The main difference lies in tanh, where the negative value of coef- ficients can maintain high-frequency signals. However, we notice that their accuracy decreases as the homophily of networks in- creases (e.g., Cora), where all coefficients converged to a positive value and fail to figure out heterophilic edges. PTDNet [24] removes task-irrelevant edges by applying ran- domness ε and decaying factor γ. Here, the coefficients wi j can be derived as below: i j = σ ((log εl − log(1 − εl ) + MLP (hl wl (4) The random value follows εl ∼ U ni f orm(0, 1), and decaying factor γ depends on the iteration number. They apply nuclear norm on the entire edges w to remove connections between communities. However, we notice that randomness can impede precise prediction, and nuclear norm does not always lead to optimal results. j ))/γ). i, hl Summarizing the above methodologies, prediction based on the central node implicates two major problems. Firstly, excluding mes- sage passing (GAM) can lead to over-fitting, where it contains limited information. Though other methods incorporate neighbor- ing nodes, the noisy neighbors also participate in the aggregation process, which can impede robustness and incur over-smoothing issues [51]. Secondly, directly employing the coefficients as an ad- jacency matrix is highly risky, where the elimination of assortative edges hurts the overall performance of GNNs (please refer to Fig- ure 1). To solve these limitations, we focus on subgraph matching algorithms which will be introduced in the upcoming section. CIKM '22, October 17–21, 2022, Atlanta, GA, USA. Yoonhyuk Choi et al. Figure 2: The overall framework of our model. It consists of two parts; one for the subgraph matching module which generates supplementary edge coefficients, and the other one is the GNN module that utilizes weights for label propagation 4.1.2 Retrieving edge coefficients using subgraphs. In this section, we describe some methods of measuring the similarity between two subgraphs. Recently, applying optimal transport (OT) on subgraphs [32, 45] has shown great improvement, which is a mathematical framework for measuring distances (similarity) between objects. For example, let us assume two subgraphs Gi, Gj that contain m, n nodes, respectively. Then, we can define transport (coupling) matrix P ∈ Rm×n between two subgraphs that meets P1n = 1 m 1m and PT 1m = 1 n 1n. The objective of OT is to find matrix P that minimizes the function below: min P ∑︁ i j S (Gi, Gj )Pi j − εH (P). (5) Here, S is a cost function and H (*) is entropy regularized Kan- torovich relaxation with regularizer ε. However, finding Pi j for all pairs of (i, j) requires a high computational cost. Linear optimal transport [29] employ reference points r to solve the above limitation, which can be retrieved through k-means clustering or calculating Wasserstein barycenter [4] based on each class of training nodes. Here, elements that are assigned to the same cluster (reference) are pooled together and thus, reducing the pair-wise calculation. Specifically, matrix P ∈ RC×N splits or assigns the entire node N to references r (C stands for the number of reference points). P can be obtained through multiple ways (e.g., Sinkhorn's algorithm [37]), which calculates a relevance between the inputs and reference points as below: p∗ i = arg min p ∈Pi C ∑︁ Ni ∑︁ pkl ∥rk − hl ∥2 (6) k=1 l=1 , where Ni is the number of nodes in subgraph i. Let us assume the hidden representations of two subgraphs as hi ∈ RNi ×F , h j ∈ RN j ×F whose feature dimension is F . Using p∗ j ∈ RC×N j in Equation 6 that splits the mass of subgraph hi, h j to j ∈ RC×F , one can measure their similarity multiple references h′ i, h′ through matching function M (MLP) as below: i = p∗ i hi, h′ h′ wi j = M (h′ i ∈ RC×Ni , p∗ j = p∗ j h j i, h′ j ). (7) Monge map [18] does not split mass, while an injective mapping is applied for each subgraph as follows: i = B(p∗ h′ i , hi ), h′ wi j = M (h′ j = B(p∗ i, h′ j ). j , h j ) (8) Similar to linear optimal transport [29], each subgraph hi, h j can be j ∈ RC×F through optimal transport p∗ mapped to new points h′ (please refer to Eq. 6). The difference lies in a barycentric projection B that ensures no mass splitting (please read this paper [18] for more details). i, h′ Using the insight of these methods [18, 29], the subgraph match- ing has the advantage of using adjacent nodes for predictions. How- ever, they also implicate a limitation of handling noisy neighbors, since they utilize the entire nodes of the subgraph to measure their similarity. To deal with this, we now introduce our method that utilizes a confidence ratio as below. 4.1.3 Our subgraph matching using a confidence ratio. In Figure 2, we describe the overall architecture of our Confidence- based Subgraph Matching. ConSM calculates a similarity between two subgraphs (probability of sharing the same label) using optimal transport and confidence ratio as follows: (1) Sampling: We randomly sample two labeled nodes, whose labels can be the same or different. For sampling, the size of the positive and negative pairs should be the same to avoid a model being biased. We further utilize their 2-hop adjacent nodes as inputs. (2) Prune: We measure a score of entire edges through reference points. Then, based on a confidence ratio, we maintain top-k confident ones while removing others. (3) Map and aggregation: Given two subgraphs Gi, Gj , we first map nodes to low-dimensional embedding hi, h j and assign them to the nearest reference points r through the Monge map. Then, we aggregate the nodes that belong to the same reference points by pooling operation (e.g., mean). (4) Prediction: We measure the similarity of the two graphs and also retrieve the class probability of a central node. Now, we describe the details of our method below. Finding Heterophilic Neighbors via Confidence-based Subgraph Matching for Semi-supervised Node Classification CIKM '22, October 17–21, 2022, Atlanta, GA, USA. Sampling We adopt an auxiliary module for retrieving edge coefficients that are independent of the GNN module. Here, two nodes are randomly sampled based on their class. If two nodes share the same class (positive pair), we assume the label of this pair as 1 and otherwise 0. To prevent a class imbalance problem, the same number of positive and negative pairs are sampled. Compared to GAM [38], we utilize the subgraph of a central node (adjacent nodes within 2-hop) to improve prediction accuracy. Prune Unlike previous method [18] that applied embedding → aggregation → mapping, we suggest embedding → pruning → map- ping → aggregation' to handle noisy edges. Specifically, we only utilize a certain proportion of edges based on their scores and a confidence ratio (ζ ). We first describe our scoring function. Using the initial node features X , we can retrieve their low-dimensional embedding h ∈ RN ×F through an encoder (MLP) as: h = Encoder (X ). (9) Similarly, the embedding of reference points is r ∈ RC×F , which can be obtained through class-wise averaging of training nodes. Then, we can measure a score (e.g., cosine similarity) S ∈ RN ×C between nodes h and references r as below: S = h * rT (10) , where the row of S represents a score of each node with respect to the reference points. Given two nodes i, j, we can retrieve their similarity wi j = Si * S j . Consequently, the w of the entire edges can be obtained, and thus, we manage to maintain top-k edges k = ⌊ζ × |E |⌋ while removing others. Map and aggregation Using the remaining edges, the adja- cency matrix can be reconstructed. With the slight abuse of nota- tion, given two nodes i, j and their subgraphs Gi, Gj , we assume that their subgraph embedding hi, h j can be retrieved as below: hi = Encoder (Gi ), h j = Encoder (Gj ) (11) , which is similar to Equation 9. hi ∈ Rm×F , h j ∈ Rn×F consists of m and n nodes, respectively. Referring Equation 6 and 8, we can map each node in subgraph through Monge map as below: i , hi ), h′ j = B(p∗ (12) j ∈ RC×F is the output of subgraph after mapping and The h′ aggregation. Though linear OT (Eq. 7) is also considerable, we choose the Monge Map which shows the better performance. i = B(p∗ h′ j , h j ) i, h′ Prediction Finally, using the concatenation of h′ j as an input of matching function M, we can estimate their similarity as below: i, h′ wi j = M (h′ i ⊕ h′ j ) (13) If two inputs share the same label, the value of wi j should be closer to 1, and otherwise 0. We further employ node classification func- tion f (*) (MLP) to predict the label of each subgraph's central node i , he he j , where Lnll is negative log-likelihood function: LSM = ∑︁ Yi ≠Yj ∑︁ |wi j |+ Yi =Yj |wi j −1|+Lnll (f (he i ), Yi )+Lnll (f (he j ), Yj ). (14) Our subgraph matching module can be trained through Equation 14, and we describe the overall procedure in Algorithm 1. Algorithm 1 Confidence-based Subgraph Matching Input: Adjacency matrix A, initialized parameters θSM , number of entire training epochs Ke , learning ratio η Output: Supplementary edge coefficients w 3: 1: for number of entire training epochs Ke do Get embedding of nodes through Eq. 9 2: Get reference points r by averaging embedding of training nodes per each class Find top-k confident edges through Eq. 10 Using the confident edges, reconstruct adjacency matrix within 2-hop as ̃A = A ∨ A2 Sampling positive or negative node pair (i, j) for each node pair (i, j) do 5: 6: 4: 7: 8: 9: 10: 11: 12: Find the subgraphs Gi = ̃A[i], Gj = ̃A[ j], and obtain their embedding hi, h j through Eq. 11 Apply Monge map for each subgraph Eq. 12 Retrieve the edge coefficient through Eq. 13 Compute the loss LSM using Eq. 14 SM = θSM − η ∂ LSM Update θ ′ ∂θSM end for 13: 14: end for 15: Calculate supplementary edge coefficients w using θ ′ SM 4.2 GNNs with Supplementary Edge Weights Recent studies focus on the strategy to better utilize edge weights. For example, some of them directly construct adjacency matrix [1, 24, 40], while others employ label propagation (LP) [2, 38, 41] on GNNs to deal with uncertainty as below: L = LGN N + λLLP . (15) LGN N is a widely used loss function for semi-supervised node classification (e.g., GCN [16]) that is defined as follows: (cid:98)Y = so f tmax ( (cid:98)Aσ ( (cid:98)AXW0)W1), LGN N = Lnll (Y, (cid:98)Y ). , where W is a learnable matrix. Though many recently proposed methods [1, 3, 17, 40, 46] are considerable for GNNs, here, we select GCN to show the efficacy of our method. Back into Equation 15, λ is a regularizer and LLP gives additional penalties as below: (16) LLP = α1 ∑︁ i,j ∈LL wi jd (i, j)+α2 ∑︁ i,j ∈LU wi jd (i, j)+α3 ∑︁ i,j ∈U U wi jd (i, j). (17) The notation {L, U } denotes labeled and unlabeled nodes, where LU means that only a single node is labeled. wi j ∈ {0, 1} is a binary value that represents a connection between two nodes i, j, and d is a dissimilarity measuring function (e.g., cosine similarity). Here, {a1, a2, a3} acts as a hyper-parameter. Recently, graph agreement model (GAM) [38] contemplates the limitation of fixed wi j , and substitute it as a parameterized model wi j = g(Xi, X j ), where g is a fully-connected networks. However, these methods implicate two limitations. Firstly, they have shown inferior performance for dis- criminating task-irrelevant edges under semi-supervised learning. Secondly, the estimated wi j scales from zero to one, even making CIKM '22, October 17–21, 2022, Atlanta, GA, USA. Yoonhyuk Choi et al. disassortative nodes similar (P-reg [47] also implicates this limita- tion). Thus, we improve Equation 17 as below: (cid:18) ∑︁ LSU P = α1 wi jd (i, j) + ∑︁ (1 − wi j )(1 − d (i, j)) (cid:19) i,j ∈LU ,wi j >k i,j ∈LU ,wi j ≤k (cid:18) ∑︁ +α2 wi jd (i, j) + ∑︁ (1 − wi j )(1 − d (i, j)) (cid:19) . i,j ∈U U ,wi j >k i,j ∈U U ,wi j ≤k (18) By sorting the score of entire edges w, we can retrieve a threshold k based on a given confidence ratio. In Equation 18, weights wi j that are greater than k are trained to reduce dissimilarity d (i, j), while others are guided to be dissimilar 1 − d (i, j). Referring to Equation 15, we replace LLP with our LSU P and define LG as below: LG = LGN N + λLSU P . (19) As described in GAM [38], we exclude edges between labeled nodes (i, j ∈ LL) and set α1 = 1.0, α2 = 0.5. We set 0.01 ≤ λ ≤ 0.1 which is proportional to the disassortativity of dataset. 4.3 Optimization Strategy So far, we define losses of our subgraph matching with label propa- gation in Equation 14 and 19. Let us assume the parameters of the subgraph matching module θSM and the GNN module θG without sharing parameters. Here, we notice that our ConSM implicates two limitations for optimization. Firstly, it is hard to determine whether the subgraph matching module θSM is converged or not. Secondly, the predicted edge coefficients may implicate uncertainty, which can impede the training of GNNs. To solve this, in Algorithm 2, we suggest saving parameters θ ′ G only if it attains the best valida- tion score (line 13). Then, before we compute the loss of the next training sample, we can load these parameters if they exist (line 14). Through this mechanism, we can guide GNNs to achieve better performance apart from the uncertainty of supplementary weights. Algorithm 2 Overall Optimization of ConSM Input: Initialized parameters θSM and θG , number of entire train- ing epochs Ke , best validation score β ′ = 0, learning ratio η SM , θ ′ G Output: Trained parameters θ ′ 1: for number of entire training epochs Ke do 2: for training samples do 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: Compute the LSM using Eq. 14 Update θ ′ SM = θSM − η ∂ LSM ∂θSM end for Retrieve edge coefficients w using θ ′ for training samples do SM Compute the LG using Eq. 19 Compute the validation score β G = θG − η ∂ LG Update θ ′ ∂θG if β > β ′ then Save updated parameters θ ′ G β ′ = β end for Load θ ′ G if exists 16: end for Table 1: Statistical details of homophilic datasets Datasets # Nodes # Edges # Features # Classes # Training Nodes # Validation Nodes # Test Nodes Cora 2,708 10,558 1,433 7 140 1,568 1,000 Citeseer 3,327 9,104 3,703 6 120 2,207 1,000 Pubmed 19,717 88,648 167,597 3 60 18,657 1,000 Table 2: Statistical details of heterophilic datasets Datasets # Nodes # Edges # Features # Classes # Training Nodes # Validation Nodes # Test Nodes Actor 7,600 25,944 931 5 100 3,750 3,750 Chameleon 2,277 33,824 2,325 5 100 1,088 1,089 Squirrel 5,201 211,872 2,089 5 100 2,550 2,551 4.4 Computational Complexity Analysis The computational costs of our model can be divided into two parts. The first one is a vanilla GCN [16] model whose complexity is known as O (|E |PGCN ), where they are proportional to the num- ber of entire edges |E | and the size of learnable matrices PGCN . The second term is our ConSM which computes the similarity be- tween two subgraphs. Instead of naively calculating Wasserstein distance O (n3log(n)), we conduct linear mapping [18] and mea- sure Euclidean distance, which can be retrieved through simple matrix multiplication. Consequently, our computational cost can be defined as O (|E |PGCN + |EM |PConSM ), where |EM | stands for the number of edges included in sampled subgraph, and PConSM is the set of parameters in subgraph matching module. 5 EXPERIMENTS In this section, we compare our ConSM with several state-of-the- art methods using a homophilic and heterophilic graph dataset. In particular, we aim to answer the following research questions: • RQ1: Does ConSM improves node classification accuracy compared to the state-of-the-art approaches? • RQ2: How much does ConSM accurately specify task-irrelevant edges in terms of graph denoising? • RQ3: Does the confidence ratio for the subgraph matching module affects the overall classification result? • RQ4: Can ConSM alleviates over-smoothing for stacking many layers effectively? 5.1 Dataset Description and Baselines Dataset description We conduct investigations with the following publicly available dataset. The statistical details are described in Finding Heterophilic Neighbors via Confidence-based Subgraph Matching for Semi-supervised Node Classification CIKM '22, October 17–21, 2022, Atlanta, GA, USA. Table 3: Node classification accuracy (%) on homophilic cita- tion networks. Bold∗ symbol indicates the best performance, and methods with † are built upon GCN. Table 4: Node classification accuracy (%) on heterophilic Wikipedia pages. Bold∗ symbol indicates the best perfor- mance, and methods with † are built upon GCN. Datasets Hom. ratio (h) MLP GCN DropEdge† GAT GIN APPNP GCNII GAM† H2GCN FAGCN PTDNet† Ours† Cora 0.81 54.2 ± 0.5 % 80.5 ± 0.4 % 80.6 ± 0.4 % 81.4 ± 0.4 % 78.2 ± 0.2 % 82.1 ± 0.4 % 81.1 ± 0.3 % 81.3 ± 0.6 % 80.5 ± 0.2 % 81.5 ± 0.5 % 81.5 ± 0.7 % 83.6∗ ± 0.3 % Citeseer 0.74 53.7 ± 1.7 % 67.5 ± 0.6 % 68.4 ± 0.5 % 69.3 ± 0.9 % 65.1 ± 0.6 % 69.2 ± 0.7 % 67.0 ± 0.4 % 70.4 ± 0.3 % 68.9 ± 0.5 % 68.6 ± 0.2 % 69.4 ± 0.6 % 71.2∗ ± 0.2 % Pubmed 0.8 69.7 ± 0.4 % 78.4 ± 0.2 % 78.3 ± 0.3 % 78.6 ± 0.5 % 76.8 ± 0.8 % 78.7 ± 0.4 % 78.5 ± 0.8 % 79.2 ± 0.1 % 78.9 ± 0.2 % 79.0 ± 0.1 % 76.9 ± 1.1 % 79.6∗ ± 0.1 % Datasets Hom. ratio (h) MLP GCN DropEdge† GAT GIN APPNP GCNII GAM† H2GCN FAGCN PTDNet† Ours† ± 1.1 % Actor 0.22 27.9∗ 21.4 ± 0.6 % 21.9 ± 0.4 % 23.2 ± 0.8 % 23.6 ± 0.5 % 21.7 ± 0.2 % 25.7 ± 0.4 % 21.7 ± 0.3 % 22.8 ± 0.3 % 26.9 ± 0.4 % 21.5 ± 0.5 % 27.7 ± 0.4 % Chameleon 0.23 41.2 ± 1.8 % 49.4 ± 0.7 % 49.2 ± 0.8 % 48.2 ± 0.6 % 40.1 ± 3.7 % 45.2 ± 0.7 % 45.1 ± 0.5 % 49.5 ± 0.5 % 46.6 ± 1.2 % 46.7 ± 0.6 % 49.7 ± 0.9 % 52.3∗ ± 0.4 % Squirrel 0.22 26.5 ± 0.6 % 33.1 ± 1.2 % 31.0 ± 1.4 % 30.1 ± 0.9 % 23.0 ± 2.4 % 30.6 ± 0.7 % 28.8 ± 0.3 % 33.9 ± 0.4 % 29.8 ± 0.7 % 29.5 ± 0.7 % 32.6 ± 0.7 % 35.7∗ ± 0.5 % Table 1 and 2, where we categorize them into two types; assortative and disassortative networks. The explanations of each dataset are demonstrated below. • Assortative networks For assortative data, we adopt widely used benchmark graphs; Cora, Citeseer, and Pubmed [16]. Here, each node represents a paper and the edge denotes a citation between two papers. Node features stand for the bag-of-words of paper, and each node has a unique label based on its relevant topic. • Disassortative networks We adopt Actor co-occurrence graph [39] and Wikipedia network [35] as disassortative graphs. For Actor co-occurrence data, the node stands for an actor, and the edges are co-occurrence on the same Wikipedia pages. The node label denotes five types based on the key- words of an actor. Similarly, the Wikipedia network consists of Chameleon and Squirrel, where the edges are hyperlinks between web pages. The node features are several informa- tive nouns and we classify them into five categories based on their monthly traffic. Baselines Using the above datasets, we compare our method with the state-of-the-art baselines. A brief explanation of these methods can be seen as follows: • MLP [33] employs a feed-forward neural network that only utilizes a central node for classification. • GCN [16] is a traditional GNN models that suggests first or- der approximation of Chebyshev polynomials [5] to localize spectral filters. • DropEdge [34] randomly removes edges under a given prob- ability to alleviate over-fitting problem. • GAT [40] specifies different weights between two nodes, while ignoring graph Laplacian matrix. • GIN [46] pointed out the limited discriminative power of GCN, suggesting a graph isomorphism network that satisfies the injectiveness condition. • APPNP [17] combines personalized PageRank with GCN that improves prediction accuracy, while reducing computa- tional complexity. • GCNII [3] integrates identity mapping to redeem the defi- ciency of APPNP. • GAM [38] adopts the graph agreement model under the assumption that not all edges correspond to sharing the same label between nodes. • H2GCN [53] suggests ego-neighbor separation and hop- based aggregation to deal with heterophilic graph. • FAGCN [1] further utilizes high-frequency signal beyond low-frequency information in GNNs. • PTDNet [24] proposes a topological denoising network to prune task-irrelevant edges as a downstream task of GNNs. 5.2 Experimental Setup All methods are implemented in PyTorch Geometric1, with Adam optimizer (weight decay 5e−4) and proper learning ratio (1e−3). We set the embedding dimension as 64 for all methods, but diversifying it can improve the overall performance [25]. Here, we adopt 2 layers of GNNs for all baselines, while APPNP, GCNII, and GIN further utilize 2 layers of fully-connected networks for classification. We apply ReLU as an activation function except for PTDNet (Sigmoid is used here). The Softmax is applied on the last hidden layers for classification. For all datasets, we randomly select 20 samples per class as a training set, and the rest is for validation and testing (please refer to Table 1 and 2). The performance is evaluated based on a test set accuracy that achieved the best validation score. 5.3 Results and Discussion (RQ1) In Table 3 and 4, we describe experimental results of baselines and our method that are conducted under homophilic / heterophilic 1https://pytorch-geometric.readthedocs.io/en/latest/modules/nn.html CIKM '22, October 17–21, 2022, Atlanta, GA, USA. Yoonhyuk Choi et al. Figure 3: Convergence analysis on (a) Cora, and (b) Actor. Each figure contains validation (green) and test (red) accu- racy of node classification datasets. Here, let us assume the homophily ratio h as below: h = # of edges that connect nodes with same label # of entire edges (20) Results on homophilic graph datasets In Table 3, we first discuss performance on three homophilic datasets, where most of the connected nodes share the same label. We conduct experiments over 10 times and report the mean and variance of test accuracy. We also describe the performance of MLP to show the influence of message passing on graph datasets. Firstly, for methods that employ GCN as a backbone (marked with †), our approach achieves state-of- the-art performance on multiple benchmark datasets. Specifically, our method outperforms GCN over 3.7 %, 5.2 %, 1.6 %, respectively. Among baselines, in Citeseer, DropEdge shows better performance than GCN which has relatively low homophily than other networks. Above all, APPNP and GAM achieve the best performance with the aid of label propagation, followed by GAT adopting an attention mechanism. For our experiments, GCNII shows lower performance than APPNP, which means that emphasizing the identity feature is not suitable for homophilic data. The design choice of rest al- gorithms (H2GCN, FAGCN, PTDNet) are for heterophilic graphs, where they fail to achieve notable improvements over GCN. Results on heterophilic graph datasets In addition to the ho- mophilic network, we conduct the experiments under heterophilic data with the same settings and plot the results in Table 4. As can be seen, these graphs are generally disassortative with a low ho- mophilic ratio h, which can impede the advantages of message passing in GNNs. Surprisingly, MLP achieves the best performance for Actor, followed by our ConSM, FAGCN, and GCNII. Given that GCNII outperforms APPNP, we guess that a central node is highly important for the Actor network. Nonetheless, these methods fail to outperform GCN for different datasets. Instead, our method achieves the best accuracy on both Chameleon, and Squirrel. Based on the results that GAM shows outstanding performance for this kind of network, the supplementary model generalizes well under a heterophilic structured dataset. Under our experiments, H2GCN, FAGCN, and PTDNet have shown to achieve lower scores, which will be discussed in Section 5.4. Convergence analysis To better understand the convergence of ConSM, in Figure 3, we describe validation and test accuracy for training. The x-axis illustrates iterations, while the y-axis is classifi- cation accuracy. As described in Algorithm 2, a single iteration is a combination of training subgraph matching modules, followed by Figure 4: We measure F1-score to evaluate edge classifica- tion performance on six graph datasets. Here, we adopt our model with four baselines that specify edge coefficients training GNN layers. Here, the validation and test accuracy vary significantly, but ConSM manages to achieve better performance as iteration increases. This is because ConSM loads parameters of the best validation score (please refer to Algorithm 2), which can prevent the uncertainty of supplementary information precisely. 5.4 Edge Classification (RQ2) To validate whether ConSM can predict edge coefficients correctly, we examine the accuracy of our method and several state-of-the-art approaches. Here, we assume the label of edges that connect two nodes with the same class as 1 and vice versa. For each method, we sort their predicted coefficients and select k − th largest value as a threshold, which is equal to the number of positive edges. Specifically, for (a) Cora, h = 0.81 and E = 10, 558 (please refer Table 1 and 3), and thus, k = ⌊10, 558 × 0.81⌋ which is described in Figure 4. We adopt F1-score that has shown to be effective for binary classification as below: F1-score = 2 × precision × recall precision + recall (21) We first introduce some details of baselines, followed by a discus- sion on the experimental results. (1) GAM: as described in Equation 1, the agreement model generates the same class probability. We employ their edge coefficients with the best validation result. (2) GAT: we exclude node-wise normalization (e.g., softmax), which can be highly sensitive to the degree of central nodes. Then, us- ing the representations of the final hidden layer, we retrieve the attention value of the entire edges. Multi-head attention is applied for the front layers, while the final layer only employs single-head attention. (3) FAGCN: they retrieve the coefficients following the Finding Heterophilic Neighbors via Confidence-based Subgraph Matching for Semi-supervised Node Classification CIKM '22, October 17–21, 2022, Atlanta, GA, USA. Figure 6: Evaluation on over-smoothing using (a) Cora, and (b) Chameleon dataset. We plot the accuracy of two baselines and our method using different number of layers module does not utilize neighboring nodes for a prediction, while ζ = 1 means that it fully utilizes adjacent nodes. Here, a confidence ratio (ζ ) that shows the best F1-score fairly aligns well with the true homophily ratio h, and the selection of ζ is important for precise prediction. Though ζ = 0.5 is quite different from h = 0.22 for (d) Actor, we insist that disassortative neighbors can also contribute to improving classifications, as we described in Figure 1. Nonetheless, we admit that a choice of ζ is quite sensitive, and may require human efforts to achieve the best accuracy. 5.6 Analysis on Over-smoothing (RQ4) Over-smoothing is a fundamental problem for GNNs when stacking multiple layers [20, 51]. Here, we scrutinize this phenomenon by differentiating the depth of layers as {1, 2, 4, 8, 16}, and report the node classification accuracy on (a) Cora, and (b) Chameleon. In Fig- ure 6, we describe the results of GCN, GAM, and our ConSM. GCN shows the best performance at 2 layers on both datasets. However, they degrade slightly at 4 layers and dramatically decrease beyond it. This means that GCN itself cannot alleviate the over-smoothing problem. Though GAM remains relatively stable compared to GCN, they also suffer from smoothing when stacking more layers. Com- paratively, ConSM consistently achieves the best performance, and the accuracy does not decrease severely for deeper layers (e.g., 16 layers). We suggest that the integration of well-classified edge co- efficients with label propagation effectively controls this problem, which shows the effectiveness of our method. 6 CONCLUSION In this work, we suggest a confidence ratio to deal with multiple disassortative edges for semi-supervised node classification. We pointed out the significance of configuring edge weights precisely, and thus, we propose to measure similarity between two connected nodes using their subgraphs. Further, based on the observations that directly applying the predicted weights are highly risky, we integrate label propagation with our confidence ratio to secure robustness and improve the overall performance. The extensive ex- periments for both homophilic and heterophilic setups well describe the superiority of our model. Acknowledgments. This work was supported by the National Research Foundation of Korea (NRF) (No. 2016R1A5A1012966, No. 2020R1A2C110168713), Institute of Information & communications Technology Planning & Evaluation (IITP) (No. 2021-0-02068 Artifi- cial Intelligence Innovation Hub, No. RS-2022-00156287 Innovative Figure 5: We differentiate the confidence ratio of sub- graph matching module, and describe F1-score on six graph datasets Equation 3. Similar to GAT, we exploit the attention values of the last hidden representations. The hyper-parameters are tuned re- ferring [1]. (4) PTDNet: similar to previous studies, we adopt the generated graphs using final representations of GNNs. The hyper- parameters are remain the same as their implementations2. (5) Ours: the coefficients of our model can be retrieved through Equation 13. In Figure 4, we can see that GAM shows the lowest performance for most graph datasets, except for (d) Actor. It is not surprising since they only utilize a central node for a prediction. Here, GAT relatively outperforms GAM with the aid of message passing and attention layer. Except for (a) Cora, FAGCN achieves better per- formance than GAT, which describes the effectiveness of high- frequency signals. Notably, PTDNet is not shown to be powerful enough, where the edge pruning between communities fails to generalize on most graph datasets. Comparatively, our model im- proves the F1-score significantly for all datasets, which justifies the necessity of confidence-aware subgraph matching. 5.5 Parameter Sensitivity Analysis (RQ3) In this section, we further measure edge classification scores by differentiating a hyper-parameter of the subgraph matching module. To deal with heterophily, we introduced a confidence ratio (ζ ) to reflect data homophily, assuming that connected nodes may not share the same labels. In Figure 5, we plot F1-score on six datasets by varying ζ from 0 to 1. We also describe true homophily ratio (please refer h in Table 3 and 4) as blue lines. If ζ = 0, the supplementary 2https://github.com/flyingdoog/PTDNet CIKM '22, October 17–21, 2022, Atlanta, GA, USA. Yoonhyuk Choi et al. Human Resource Development for Local Intellectualization support program) grant funded by the Korea government (MSIT). REFERENCES [1] Deyu Bo, Xiao Wang, Chuan Shi, and Huawei Shen. 2021. Beyond low-frequency information in graph convolutional networks. arXiv preprint arXiv:2101.00797 (2021). [2] Thang D Bui, Sujith Ravi, and Vivek Ramavajjala. 2018. Neural graph learning: Training neural networks using graphs. In Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining. 64–71. [3] Ming Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding, and Yaliang Li. 2020. Simple and deep graph convolutional networks. In International Conference on Machine Learning. PMLR, 1725–1735. [4] Marco Cuturi and Arnaud Doucet. 2014. Fast computation of Wasserstein barycen- ters. In International conference on machine learning. PMLR, 685–693. [5] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. 2016. Convolu- tional neural networks on graphs with fast localized spectral filtering. Advances in neural information processing systems 29 (2016). [6] Utkarsh Desai, Sambaran Bandyopadhyay, and Srikanth Tamilselvam. 2021. Graph neural network to dilute outliers for refactoring monolith application. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 35. 72–80. [7] Yushun Dong, Kaize Ding, Brian Jalaian, Shuiwang Ji, and Jundong Li. 2021. Graph neural networks with adaptive frequency response filter. arXiv preprint arXiv:2104.12840 (2021). [8] Negin Entezari, Saba A Al-Sayouri, Amirali Darvishzadeh, and Evangelos E Papalexakis. 2020. All you need is low (rank) defending against adversarial attacks on graphs. In Proceedings of the 13th International Conference on Web Search and Data Mining. 169–177. [9] Wenqi Fan, Yao Ma, Qing Li, Yuan He, Eric Zhao, Jiliang Tang, and Dawei Yin. 2019. Graph neural networks for social recommendation. In The world wide web conference. 417–426. [10] Alex Fout, Jonathon Byrd, Basir Shariat, and Asa Ben-Hur. 2017. Protein interface prediction using graph convolutional networks. Advances in neural information processing systems 30 (2017). [11] Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. 2017. Neural message passing for quantum chemistry. In International conference on machine learning. PMLR, 1263–1272. [12] Will Hamilton, Zhitao Ying, and Jure Leskovec. 2017. Inductive representation learning on large graphs. Advances in neural information processing systems 30 (2017). [13] David K Hammond, Pierre Vandergheynst, and Rémi Gribonval. 2011. Wavelets on graphs via spectral graph theory. Applied and Computational Harmonic Analysis 30, 2 (2011), 129–150. [14] Wei Jin, Tyler Derr, Yiqi Wang, Yao Ma, Zitao Liu, and Jiliang Tang. 2021. Node similarity preserving graph convolutional networks. In Proceedings of the 14th ACM International Conference on Web Search and Data Mining. 148–156. [15] Dongkwan Kim and Alice Oh. 2022. How to find your friendly neighborhood: Graph attention design with self-supervision. arXiv preprint arXiv:2204.04879 (2022). [16] Thomas N Kipf and Max Welling. 2016. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907 (2016). [17] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. 2018. Pre- dict then propagate: Graph neural networks meet personalized pagerank. arXiv preprint arXiv:1810.05997 (2018). [18] Soheil Kolouri, Navid Naderializadeh, Gustavo K Rohde, and Heiko Hoffmann. 2020. Wasserstein embedding for graph learning. arXiv preprint arXiv:2006.09430 (2020). [19] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. 2015. Deep learning. nature 521, 7553 (2015), 436–444. [20] Qimai Li, Zhichao Han, and Xiao-Ming Wu. 2018. Deeper insights into graph convolutional networks for semi-supervised learning. In Thirty-Second AAAI conference on artificial intelligence. [21] Hongrui Liu, Binbin Hu, Xiao Wang, Chuan Shi, Zhiqiang Zhang, and Jun Zhou. 2022. Confidence May Cheat: Self-Training on Graph Neural Networks under Distribution Shift. In Proceedings of the ACM Web Conference 2022. 1248–1258. [22] Meng Liu, Zhengyang Wang, and Shuiwang Ji. 2021. Non-local graph neural networks. IEEE Transactions on Pattern Analysis and Machine Intelligence (2021). [23] Sitao Luan, Chenqing Hua, Qincheng Lu, Jiaqi Zhu, Mingde Zhao, Shuyuan Zhang, Xiao-Wen Chang, and Doina Precup. 2021. Is Heterophily A Real Night- mare For Graph Neural Networks To Do Node Classification? arXiv preprint arXiv:2109.05641 (2021). [24] Dongsheng Luo, Wei Cheng, Wenchao Yu, Bo Zong, Jingchao Ni, Haifeng Chen, and Xiang Zhang. 2021. Learning to drop: Robust graph neural network via topological denoising. In Proceedings of the 14th ACM International Conference on Web Search and Data Mining. 779–787. [25] Gongxu Luo, Jianxin Li, Jianlin Su, Hao Peng, Carl Yang, Lichao Sun, Philip S Yu, and Lifang He. 2021. Graph entropy guided node embedding dimension selection for graph neural networks. arXiv preprint arXiv:2105.03178 (2021). [26] Yao Ma, Xiaorui Liu, Neil Shah, and Jiliang Tang. 2021. Is Homophily a Necessity for Graph Neural Networks? arXiv preprint arXiv:2106.06134 (2021). [27] Andrew Kachites McCallum, Kamal Nigam, Jason Rennie, and Kristie Seymore. 2000. Automating the construction of internet portals with machine learning. Information Retrieval 3, 2 (2000), 127–163. [28] Miller McPherson, Lynn Smith-Lovin, and James M Cook. 2001. Birds of a feather: Homophily in social networks. Annual review of sociology 27, 1 (2001), 415–444. [29] Grégoire Mialon, Dexiong Chen, Alexandre d'Aspremont, and Julien Mairal. 2020. A trainable optimal transport embedding for feature aggregation and its relationship to attention. arXiv preprint arXiv:2006.12065 (2020). [30] Shashank Pandit, Duen Horng Chau, Samuel Wang, and Christos Faloutsos. 2007. Netprobe: a fast and scalable system for fraud detection in online auction networks. In Proceedings of the 16th international conference on World Wide Web. 201–210. [31] Hongbin Pei, Bingzhe Wei, Kevin Chen-Chuan Chang, Yu Lei, and Bo Yang. 2020. Geom-gcn: Geometric graph convolutional networks. arXiv preprint arXiv:2002.05287 (2020). [32] Gabriel Peyré, Marco Cuturi, et al. 2019. Computational optimal transport: With applications to data science. Foundations and Trends® in Machine Learning 11, 5-6 (2019), 355–607. [33] Marius-Constantin Popescu, Valentina E Balas, Liliana Perescu-Popescu, and Nikos Mastorakis. 2009. Multilayer perceptron and neural networks. WSEAS Transactions on Circuits and Systems 8, 7 (2009), 579–588. [34] Yu Rong, Wenbing Huang, Tingyang Xu, and Junzhou Huang. 2019. Dropedge: Towards deep graph convolutional networks on node classification. arXiv preprint arXiv:1907.10903 (2019). [35] Benedek Rozemberczki, Ryan Davies, Rik Sarkar, and Charles Sutton. 2019. Gem- sec: Graph embedding with self clustering. In Proceedings of the 2019 IEEE/ACM international conference on advances in social networks analysis and mining. 65–72. [36] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. 2008. The graph neural network model. IEEE transactions on neural networks 20, 1 (2008), 61–80. [37] Richard Sinkhorn and Paul Knopp. 1967. Concerning nonnegative matrices and doubly stochastic matrices. Pacific J. Math. 21, 2 (1967), 343–348. [38] Otilia Stretcu, Krishnamurthy Viswanathan, Dana Movshovitz-Attias, Emmanouil Platanios, Sujith Ravi, and Andrew Tomkins. 2019. Graph agreement models for semi-supervised learning. Advances in Neural Information Processing Systems 32 (2019). [39] Jie Tang, Jimeng Sun, Chi Wang, and Zi Yang. 2009. Social influence analysis in large-scale networks. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining. 807–816. [40] Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. 2017. Graph attention networks. stat 1050 (2017), 20. [41] Hongwei Wang and Jure Leskovec. 2020. Unifying graph convolutional neural networks and label propagation. arXiv preprint arXiv:2002.06755 (2020). [42] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. 2018. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition. 7794–7803. [43] Teng Xiao, Zhengyu Chen, Donglin Wang, and Suhang Wang. 2021. Learning how to propagate messages in graph neural networks. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining. 1894–1903. [44] Hongteng Xu, Dixin Luo, and Lawrence Carin. 2019. Scalable Gromov- Wasserstein learning for graph partitioning and matching. Advances in neural information processing systems 32 (2019). [45] Hongteng Xu, Dixin Luo, Hongyuan Zha, and Lawrence Carin Duke. 2019. Gromov-wasserstein learning for graph matching and node embedding. In Inter- national conference on machine learning. PMLR, 6932–6941. [46] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. 2018. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826 (2018). [47] Han Yang, Kaili Ma, and James Cheng. 2021. Rethinking graph regularization for graph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 35. 4573–4581. [48] Liang Yang, Fan Wu, Yingkui Wang, Junhua Gu, and Yuanfang Guo. 2019. Masked Graph Convolutional Network.. In IJCAI. 4070–4077. [49] Tianmeng Yang, Yujing Wang, Zhihan Yue, Yaming Yang, Yunhai Tong, and Jing Bai. 2021. Graph Pointer Neural Networks. arXiv preprint arXiv:2110.00973 (2021). [50] Zhitao Ying, Dylan Bourgeois, Jiaxuan You, Marinka Zitnik, and Jure Leskovec. 2019. Gnnexplainer: Generating explanations for graph neural networks. Ad- vances in neural information processing systems 32 (2019). [51] Lingxiao Zhao and Leman Akoglu. 2019. Pairnorm: Tackling oversmoothing in gnns. arXiv preprint arXiv:1909.12223 (2019). [52] Cheng Zheng, Bo Zong, Wei Cheng, Dongjin Song, Jingchao Ni, Wenchao Yu, Haifeng Chen, and Wei Wang. 2020. Robust graph representation learning via neural sparsification. In International Conference on Machine Learning. PMLR, Finding Heterophilic Neighbors via Confidence-based Subgraph Matching for Semi-supervised Node Classification CIKM '22, October 17–21, 2022, Atlanta, GA, USA. 11458–11468. [53] Jiong Zhu, Yujun Yan, Lingxiao Zhao, Mark Heimann, Leman Akoglu, and Danai Koutra. 2020. Beyond homophily in graph neural networks: Current limitations and effective designs. Advances in Neural Information Processing Systems 33 (2020), 7793–7804.
http://arxiv.org/abs/2302.09748v1
2023-02-20T03:57:06
2023-02-20T03:57:06
Quantifying uncertainty for deep learning based forecasting and flow-reconstruction using neural architecture search ensembles
Classical problems in computational physics such as data-driven forecasting and signal reconstruction from sparse sensors have recently seen an explosion in deep neural network (DNN) based algorithmic approaches. However, most DNN models do not provide uncertainty estimates, which are crucial for establishing the trustworthiness of these techniques in downstream decision making tasks and scenarios. In recent years, ensemble-based methods have achieved significant success for the uncertainty quantification in DNNs on a number of benchmark problems. However, their performance on real-world applications remains under-explored. In this work, we present an automated approach to DNN discovery and demonstrate how this may also be utilized for ensemble-based uncertainty quantification. Specifically, we propose the use of a scalable neural and hyperparameter architecture search for discovering an ensemble of DNN models for complex dynamical systems. We highlight how the proposed method not only discovers high-performing neural network ensembles for our tasks, but also quantifies uncertainty seamlessly. This is achieved by using genetic algorithms and Bayesian optimization for sampling the search space of neural network architectures and hyperparameters. Subsequently, a model selection approach is used to identify candidate models for an ensemble set construction. Afterwards, a variance decomposition approach is used to estimate the uncertainty of the predictions from the ensemble. We demonstrate the feasibility of this framework for two tasks - forecasting from historical data and flow reconstruction from sparse sensors for the sea-surface temperature. We demonstrate superior performance from the ensemble in contrast with individual high-performing models and other benchmarks.
[ "Romit Maulik", "Romain Egele", "Krishnan Raghavan", "Prasanna Balaprakash" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09748v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09748v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "math.DS" ]
3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 8 4 7 9 0 . 2 0 3 2 : v i X r a QUANTIFYING UNCERTAINTY FOR DEEP LEARNING BASED FORECASTING AND FLOW-RECONSTRUCTION USING NEURAL ARCHITECTURE SEARCH ENSEMBLES A PREPRINT Romit Maulik∗ Argonne National Laboratory, Lemont, Illinois 60439, USA. Romain Egele Université Paris-Saclay, 1190 Gif-sur-Yvette, France. Krishnan Raghavan Argonne National Laboratory, Lemont, Illinois 60439, USA. Prasanna Balaprakash Argonne National Laboratory, Lemont, Illinois 60439, USA. February 21, 2023 ABSTRACT Classical problems in computational physics such as data-driven forecasting and signal reconstruction from sparse sensors have recently seen an explosion in deep neural network (DNN) based algorithmic approaches. However, most DNN models do not provide uncertainty estimates, which are crucial for establishing the trustworthiness of these techniques in downstream decision making tasks and scenarios. In recent years, ensemble-based methods have achieved significant success for the uncertainty quantification in DNNs on a number of benchmark problems. However, their performance on real-world applications remains under-explored. In this work, we present an automated approach to DNN discovery and demonstrate how this may also be utilized for ensemble-based uncertainty quantification. Specifically, we propose the use of a scalable neural and hyperparameter architecture search for discovering an ensemble of DNN models for complex dynamical systems. We highlight how the proposed method not only discovers high-performing neural network ensembles for our tasks, but also quantifies uncertainty seamlessly. This is achieved by using genetic algorithms and Bayesian optimization for sampling the search space of neural network architectures and hyperparameters. Subsequently, a model selection approach is used to identify candidate models for an ensemble set construction. Afterwards, a variance decomposition approach is used to estimate the uncertainty of the predictions from the ensemble. We demonstrate the feasibility of this framework for two tasks - forecasting from historical data and flow reconstruction from sparse sensors for the sea-surface temperature. We demonstrate superior performance from the ensemble in contrast with individual high-performing models and other benchmarks. Keywords Deep ensembles scientific machine learning * * neural architecture and hyperparameter search 1 Introduction 1.1 Motivation Data-driven surrogate modeling research has shown great promise in improving the predictability and efficiency of computational physics applications. Among various algorithms, deep learning-based models have been observed to show significant gains in accuracy and time-to-solution over classical numerical-methods based techniques. However, the widespread adoption of deep learning models is still limited by its black-box nature. To that end, uncertainty ∗Email: [email protected] Neural architecture search ensembles for scientific machine learning A PREPRINT quantification methods have been developed to overcome the challenges associated with the black-box nature of the deep-learning models and establish trustworthiness by providing uncertainty estimates along with the predictions. The data or aleatoric uncertainty is attributed to the noise in the data, for example, low resolution sensors and sparse measurements; the model or epistemic uncertainty is attributed to the lack of training data. The former is inherent to the data and cannot be reduced by collecting more data; the latter is used to characterize the model's predictive capability with respect to the training data and it can reduced by collecting appropriate data. In many computational physics applications, it is crucial to effectively quantify both data- and model-form uncertainties in predictions from deep learning models. Quantification of such uncertainties alleviates the risks associated with the deployment of such black-box data-driven models for real-world tasks. Deep ensembles is a promising approach for uncertainty quantification. In this approach, a ensemble of neural networks (NNs) are trained independently but they differ in the way in which they are trained. Consequently, the weights of the neural network parameters will be different. The prediction from these models are then used to improve prediction and estimate uncertainty. Despite its simplicity, deep-ensembles-based uncertainty estimation has achieved superior performance over more sophisticated uncertainty quantification methods on a number of benchmarks. Crucial to the effectiveness of uncertainty quantification in the deep-ensemble-based methods is the diversity of the high-performing models. Specifically, if the models are significantly different from each other and also equally high performing, then the prediction and the uncertainty estimates become accurate [Egele et al., 2022]. However, this poses additional challenges due to the large overhead associated with the manual design of models. Despite one time cost, the development overhead significantly increases the offline design and training costs of the ensemble model development and increase amortization time (i.e., the time required to offset offline costs). To that end, we explore an integrated automated deep ensemble approach that not only discovers high-performing models but also makes ensemble predictions with quantified uncertainty in a scalable manner. Specifically, the highlights of this article are as follows: • We demonstrate a unified strategy for discovering high-performing deep learning models for dynamical systems forecasting and signal recovery with epistemic and aleatoric uncertainty quantification that leverages distributed computing. • For uncertainty quantification, we use the law of decomposition of variance from members of an ensemble to separately estimate both the aleatoric and epistemic uncertainty. • We validate our proposed approach for forecasting flow-fields as well as instantaneous state reconstructions for a real-world, high-dimensional scientific machine learning problem with complex dynamics, given by the NOAA Optimum Interpolation Data Set. 1.2 Related work In recent times, deep learning models have been popular for complex predictive modeling tasks. In this section, we review past work in surrogate modeling of dynamical systems as well as attempts to quantify the uncertainty of these data-driven models. Data-driven surrogate models are primarily designed to reduce the computational costs associated with expensive forward models in many-query tasks [Carlberg et al., 2011, Wang et al., 2012, San and Borggaard, 2015, Ballarin et al., 2015, San and Maulik, 2018, Wang et al., 2019, Choi and Carlberg, 2019, Renganathan et al., 2020, Ren et al., 2020a]. Therefore these find extensive application in control [Proctor et al., 2016, Peitz et al., 2019, Noack et al., 2011, Rowley and Dawson, 2017, Raibaudo et al., 2020, Ren et al., 2020b], optimization [Peherstorfer et al., 2016, Fan et al., 2020], uncertainty quantification [Sapsis and Majda, 2013, Zahr et al., 2018, Goh et al., 2019] and data-assimilation [Arcucci et al., 2019, Tang et al., 2020, Casas et al., 2020, Maulik et al., 2022] among others. Typically, for complex dynamical systems possessing large degrees of freedom, a first step in model construction is the identification of a reduced-basis for evolving dynamics [San and Borggaard, 2014, Korda et al., 2018, Kalb and Deane, 2007]. After identifying this basis, a cost-effective strategy is necessary for evolving the dynamics in this transformed space [Kalashnikova and Barone, 2010, Mohebujjaman et al., 2019, Carlberg et al., 2011, Xiao et al., 2013, Fang et al., 2013, Carlberg et al., 2017, Huang et al., 2022]. A popular approach to this latent-space dynamics evolution has been the use of neural networks with inductive biases for sequential data. For example, long short-term memory (LSTM) neural networks [Hochreiter and Schmidhuber, 1997] have recently become very popular in modeling these dynamics [Vlachas et al., 2018, Ahmed et al., 2019, Maulik et al., 2019, Mohan et al., 2019, Mohan and Gaitonde, 2018, Gonzalez and Balajewicz, 2018, Hasegawa et al., 2020a, Wang et al., 2020, Hasegawa et al., 2020b, Chattopadhyay et al., 2020, Maulik et al., 2020a]. Other methods include Gaussian processes [Renganathan et al., 2021, Ma and Pan, 2021, Guo and Hesthaven, 2018], transformer models [Vaswani et al., 2017, Geneva and Zabaras, 2022] which use temporal attention to learn patterns and make forecasts as well as neural ordinary differential equations (commonly known as the neural ODE), where neural networks are assumed to parameterize the right-hand side of an ODE [Linot et al., 2023, Maulik et al., 2019]. We note that this review is not exhaustive and that several research studies have utilized variants of LSTMs with greater complexity for complex forecasting tasks. 2 Neural architecture search ensembles for scientific machine learning A PREPRINT Data-driven methods have also seen extensive use in flow-reconstruction from sparse sensors. This is due to a desire to build better technologies to reconstruct fluid-flow fields, that may have a large number of frequencies and degrees of freedom from sparse fixed sensors or moving tracer particles (such as those used in experimental imaging with particle image velocimetry). Typically, these techniques rely on linear stochastic [Adrian and Moin, 1988] or gappy proper orthogonal decomposition [Everson and Sirovich, 1995] estimation. The former reconstructs the flow-field by building a correlation matrix between the sensor inputs and the full flow-fields while the latter solves a linear least-squares problem in an affine subspace spanned by the truncated proper orthogonal decomposition basis vectors. Neural network architectures have been seen to outperform these classical methods for various applications [Fukami et al., 2020, Carter et al., 2021, Erichson et al., 2020]. Variational inference-based neural architectures, potentially augmented with physics-informed biases, have also been used to reconstruct flow fields from sparse sensors with quantified uncertainty [Sun and Wang, 2020, Dubois et al., 2022]. However, it is well-known that Bayesian approaches add significant computational cost, mainly due to their sampling process (e.g. Markov Chain Monte Carlo for characterizing the posterior) and are outperformed by ensemble-based approaches for uncertainty quantification [Egele et al., 2022]. From the perspective of uncertainty quantification for machine learning applications of computational science, several recent articles have attempted to develop algorithms that provide both predictions as well as confidence interval estimates. Here we draw a distinction between using machine learning to accelerate parameteric uncertainty quantification, for example in Bayesian inversion with surrogate models (examples include Sheriffdeen et al. [2019], Constantine et al. [2016], Goh et al. [2019], Liu et al. [2021], Lye et al. [2020]), and performing uncertainty quantification of the machine learning algorithm predictions themselves. In the context of the latter, recently Maulik et al. [2020b] demonstrate how a probabilistic neural network may be used to capture the aleatoric uncertainty associated with surrogate model or flow-reconstruction predictions. In Morimoto et al. [2022], the epistemic uncertainty of deep learning frameworks was captured using a weight sampling procedure during convergence, however, with strong assumptions of approximate convexity of the loss surface. In practical problems, particularly with physics-based constraints which promote non- smoothness [Krishnapriyan et al., 2021], such an approach is limited. In Zhu et al. [2019], a probabilistic surrogate model, based on a generative neural network architecture (the normalizing flow) was able to obtain a probability density function of the output quantity of interest, conditioned by the input parameters. While this approach avoids the Gaussian assumption for aleatoric uncertainty in Maulik et al. [2020b], the weights of the surrogate were deterministic and therefore did not quantify NN epistemic uncertainty. In Pawar et al. [2022], both aleatoric and epistemic uncertainty were accounted for using the deep ensembles approach but all members of the ensemble were identical neural network architectures initialized differently and therefore were not optimized for the function approximation task. In this study, we jointly address the issue of optimal architecture and hyperparameter selection, as well as deep ensembles based uncertainty quantification. It is well-known that selecting the best neural network architecture for a function approximation is a difficult task - to that end we have recently demonstrated how scalable neural architecture search may be used for surrogate model discovery Maulik et al. [2020c]. In this article, we further expand on our algorithm by demonstrating how the architecture search may be vertically integrated for ensemble forecasting and signal recovery while providing predictions with confidence intervals. 2 Methods and data 2.1 AutoDEUQ: Uncertainty quantification through deep neural network ensembles Automated deep ensemble with uncertainty quantification (AutoDEUQ) is a recently proposed deep-ensemble-based UQ method. AutoDEUQ estimates aleatoric and epistemic uncertainties by automatically generating a catalog of NN models through joint neural architecture and hyperparameter search, wherein each model is trained to minimize the negative log-likelihood to capture aleatoric uncertainty (data noise/uncertainty), and selecting a set of similarly performing models from the catalog to construct the ensembles and model epistemic uncertainty (i.e., function approximation uncertainty). The overall schematic of our neural architecture search based deep ensembles algorithm for uncertainty quantification of scientific machine learning applications is shown in Figure 1. composed of i.i.d points (xi ), where xi We assume a supervised learning scenario, with a the dataset ∈ X RM and yi = f (xi) are the input and the corresponding output of the ith point, respectively, and X ⊂ are the input and output spaces of N and M dimensions, respectively. In the context of regression problems, a focus of our study, the outputs are given by a scalar or vector of real values. Given , we seek to characterize the predictive x), which estimates aleatoric uncertainty through individual distribution p(y x) using a parameterized distribution pθ(y | | x). We trained NNs and then estimates the epistemic uncertainty with an ensemble of high-performing NNs pE (y define Θ to be the sample space for θ. ∈ Y RN and Y ⊂ , yi D D | The aleatoric uncertainty can be characterized by using the quantiles of pθ. Following previous work Lakshminarayanan θ ) and use variance as et al. [2016], we make the usual assumption of a Gaussian distribution for pθ (μθ, σ2 ∼ N 3 Neural architecture search ensembles for scientific machine learning A PREPRINT Figure 1: Overall schematic of deep ensembles based uncertainty quantification using AutoDEUQ Egele et al. [2022]. 4 Neural architecture search ensembles for scientific machine learning A PREPRINT a measure of the aleatoric uncertainty. We explicitly partition θ into (θa, θh, θw) such that Θ is decomposed into Θa represents the values of the neural architecture decision variables (network topology (Θa, Θh, Θw), where θa parameters), θh Θw represents the NN weights. The NN is trained to output mean μθ and variance σ2 θ . For a given choice of architecture decision variables θa and training hyperparameters θh, to obtain θ∗ w, we seek to minimize the negative log-likelihood given the . Specifically, we can learn the aleatoric uncertainty using the negative log-likelihood loss (as opposed to the real data usual mean squared error) in the training: Lakshminarayanan et al. [2016]: Θh represents NN training hyperparameters (e.g., learning rate, batch size), and θw D ∈ ∈ ∈ (cid:96)(x, y; θ) = log pθ = − log σ2 θ (x) 2 (y + μθ(x))2 θ (x) − 2σ2 + cst, where cst is a constant. The NN training problem is then θ∗ w = arg max θw∈Θw (cid:96)(x, y; θa, θh, θw). (1) (2) To model epistemic uncertainty, we use deep ensembles (an ensemble composed of NNs) Lakshminarayanan et al. Θ is a tuple [2016]. In our approach, we generate a catalog of NN models of architecture, optimization hyperparameters, and weights) and repeatedly sample K models to form the ensemble . Let pE -the E|E } probability density function of the ensemble-be obtained as a mixture distribution where the mixture is given as pE = Epθ. Define μθ and σ2 θ as the mean and variance of each element in the ensemble, respectively. Then, the mean of the mixture is μE := E[μθ], and the variance Rudary [2009] is . Let pθ describe the probability that θ is a member of the ensemble θi, i = 1, 2, { θi, i = 1, 2, { (where θ , c } θ ∀ ∈ C , K * * * * * * = = ∈ C E := V[pE ] = σ2 E[σ2 θ ] (cid:124) (cid:123)(cid:122) (cid:125) Aleatoric Uncertainty + V[μθ] (cid:124) (cid:123)(cid:122) (cid:125) Epistemic Uncertainty , (3) where E refers to the expected value and V refers to the variance. Equation (3) formally provides the decomposition of the overall uncertainty of the ensemble into its individual components such that E[σ2 θ ] marginalizes the effect of θ and captures the aleatoric uncertainty and V[μθ] captures the spread of the prediction across different models and neglects the noise of the data, therefore capturing the epistemic uncertainty. The overall estimate of the mean and the variance may then be written as μE = 1 K σ2 E = (cid:88) μθ θ∈E 1 K (cid:124) θ∈E (cid:123)(cid:122) Aleatoric Uncertainty (cid:125) (cid:88) σ2 θ + 1 − K (cid:124) (cid:88) (μθ θ∈E 1 − μE )2 , (4) (cid:123)(cid:122) Epistemic Uncertainty (cid:125) where K is the size of the ensemble. The total uncertainty here quantified by σ2 epistemic uncertainty. E is a combination of aleatoric and Let us assume that our total data is partitioned in the usual train-validation-test split manner as ∪ test. A neural architecture configuration θa is a vector from the neural architecture search space Θa, defined by a set of D neural architecture decision variables. A hyperparameter configuration θh is a vector from the training hyperparameter search space Θh defined by a set of hyperparameters used for training (e.g., learning rate, batch size). The problem of joint neural architecture and hyperparameter search can be formulated as the following bilevel optimization problem: ∪ D D D D = train valid a, θ∗ θ∗ h = arg max θa,θh s.t. θ∗ w = arg max θw 1 N valid 1 N train (cid:88) (cid:96)(x, y; θa, θh, θ∗ w) x,y∈Dvalid (cid:88) x,y∈Dtrain (cid:96)(x, y; θa, θh, θw), (5) where the best architecture decision variables θ∗ = valid and the corresponding weights θw are selected based on D D The pseudo-code of the AutoDEUQ is shown in Algorithm 1. To perform a joint neural architecture and hyperparameter search, we leverage aging evolution with asynchronous Bayesian optimization (AgEBO) Egele et al. [2021]. D D a and training hyperparameters values θ∗ = train. h are selected based on Aging evolution (AgE) Real et al. [2019] is a parallel neural architecture search (NAS) method for searching over the architecture space. The AgEBO method follows the manager-worker paradigm, wherein a manager node runs a search 5 Neural architecture search ensembles for scientific machine learning A PREPRINT Algorithm 1: AutoDEUQ: Neural architecture and hyperparameter search for ensemble construction. inputs :P: population size, S: sample size, W: workers output :E: ensemble of models /* Initialization for AgEBO 1 population ← create_queue(P ) // Alloc empty Q of size P 2 BO ← Bayesian_Optimizer() 3 for i ← 1 to W do 4 conf ig.θa ← random_sample(Θa) conf ig.θh ← random_sample(Θh) submit_for_training(config) // Nonblocking So 5 6 7 8 end /* Optimization loop for AgEBO 9 while stopping criterion not met do // Query results results ← check_finished_training () C ← C ∪ results // Add to catalogue population if |results| > 0 then population.push(results) // Aging population // Generate hyperparameter configs BO.tell(results.θh, results.valid_score) next ← BO.ask(|results|) // Generate architecture configs for i ← 1 to |results| do if |population| = P then parent.conf ig ← select_parent(population,S) child.conf ig.θa ← mutate(parent.θa) else child.conf ig.θa ← random_sample(Θa) end child.conf ig.θh ← next[i].θh submit_for_training(child.conf ig) // Nonblocking end 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 end 26 27 end /* Ensemble selection */ */ */ 28 E ← {} 29 while |E.unique()| ≤ K do 30 θ∗ ← arg minθ∈C (cid:96)(θ, X, y) // Find lowest validation loss E ← E ∪ {θ∗} // Append model to ensemble 31 32 end 33 return E method to generate multiple NNs and W workers (compute nodes) train them simultaneously. The AgEBO method constructs the initial population by sampling W architecture and W hyperparameter configurations and concatenating them (lines 1–7). The NNs obtained by using these concatenated configurations are sent for simultaneous evaluation on W workers (line 6). The iterative part (lines 8–26) of the method checks whether any of the workers finish their evaluation (line 9), collects validation metric values from the finished workers, and uses them to generate the next set of architecture and hyperparameter configurations for simultaneous evaluation to fill up the free workers that finished their evaluations (lines 11–25). At a given iteration, in order to generate a NN, architecture, and hyperparameter configurations are generated in the following way. From the incumbent population, S NNs are sampled (line 17). A random mutation is applied to the best of S NNs to generate a child architecture configuration (line 18). This mutation is obtained by first randomly selecting an architecture decision variable from the selected NN and replacing its value with another randomly selected value excluding the current value. The new child replaces the oldest member of the population. The AgEBO optimizes the hyperparameters (θh) by marginalizing the architecture decision variables (θa). At a given iteration, to generate a hyperparameter configuration, the AgEBO uses a (supervised learning) model M to predict a point estimate (mean value) μ(θi h) for a large number of unseen hyperparameter configurations. The best configuration is selected by ranking all sampled hyperparameter configurations using the upper confidence bound acquisition function, which is parameterized by κ 0 that controls the trade-off between exploration and exploitation. To generate multiple hyperparameter configurations at the same time, the AgEBO leverages a multipoint acquisition function based on a constant liar strategy Ginsbourger et al. [2010]. h) and standard deviation σ(θi ≥ 6 Neural architecture search ensembles for scientific machine learning A PREPRINT C of models from of NN models is obtained by running AgEBO and storing all the models from the runs. To build the The catalog , we adopt a top-K strategy (lines 27–32). Here, the idea is to select the K highest- ensemble performing models for the validation data and construct the ensemble from its individual predictions. This approach is appropriate when the validation data is representative of the generalization task (i.e., big enough, diverse enough, with good coverage) Caruana et al. [2004]. E C N SC k+1 k−2, k+1 k−3, k−3, and skip connection The architecture search space is modeled by using a directed acyclic graph, which starts and ends with input and output nodes, respectively. They represent the input and output layers of NN, respectively. Between the two are intermediate nodes defined by a series of variable nodes. Both types of nodes correspond to categorical decision variables. The variable nodes model dense layers with a list of different layer configurations. The skip connection node creates a skip connection between the variable nodes. This second type of node can take two values: disable or create the skip connection. For a given pair of consecutive variable nodes k+1, three skip connection k+1 nodes k−1 are created. These nodes allow for connection to the previous nonconsecutive variable nodes For the hyperparameter search space, we use a learning rate in the continuous range [10−4, 10−1] with a log-uniform prior; a batch size in the discrete range [32, . . . , bmax] (where bmax = 256) with a log-uniform prior; an optimizer in ; a patience value of 15 for the reduction of the learning rate, and value of 20 early stopping of training. The individual definitions of the architecture search space are experiment specific and are explored in the respective problem definitions below. Models are checkpointed during their evaluation based on the minimum validation loss achieved. We note that AutoDEUQ is deployed in the DeepHyper package, designed for scalable automatic machine learning on leadership class high-performance computers Balaprakash et al. [2018]. sgd, rmsprop, adagrad, adam } { SC k−1, respectively. SC k−2, N SC N N N N k, 2.2 Dataset In this study we use the open-source National Oceanic and Atmospheric Administration (NOAA) Optimum Interpolation sea surface temperature V2 data set (henceforth NOAA-SST).2 This data set has a strong periodic structure due to seasonal fluctuations in addition to rich fine-scaled phenomena due to complex ocean dynamics. Weekly-averaged NOAA-SST snapshots are available on a quarter-degree grid which is sub-sampled to a one-degree grid for the purpose of demonstrating our proposed methodology in a computationally efficient manner. This data set, at the 1-degree resolution, has previously been used in several data-driven analysis tasks (for instance, see Kutz et al. [2016], Callaham et al. [2019a] for specific examples), particularly from the point of view of extracting seasonal and long-term trends as well as for flow-field recovery [Maulik et al., 2020b]. Each "snapshot" of data originally corresponds to an array 180 (i.e., arranged according to the longitudes and latitudes of a one-degree resolution). However, for of size 360 effective utilization in forecasting and flow-reconstruction, a mask is used to remove missing locations in the array that corresponds to the land area. Furthermore, it should be noted that regressions are performed for those coordinates which correspond to oceanic regions alone, and inland bodies of water are ignored. The non-zero data points then are subsequently flattened to obtain a column vector for each snapshot of our training and test data. We note that this data is available from October 22, 1981, to June 30, 2018 (i.e., 1,914 snapshots for the weekly averaged temperature). × 2.3 Task 1: Forecasting For our forecasting task, we utilize the period of October 22, 1981, to December 31, 1989. The rest (i.e., 1990 to 2018) is used for testing. Our final number of snapshots for training amounts to 427, and for testing amounts to 1487. This train-test split of the data set is a common configuration for data-driven studies Callaham et al. [2019a] and the 8-year training period captures several short and long-term trends in the global sea surface temperature. Individual training samples are constructed by selecting a window of inputs (from the past) and a corresponding window of outputs (for the forecast task in the future) from the set of 427 training snapshots from the NOAA dataset. From the perspective of notation, if yt is a snapshot of training data, t = 1, 2, . . . , 427, a forecasting technique may be devised by learning to predict yt+1, . . . , yt+τ given yt, yt−1, . . . , yt−τ . We note that this forecast is performed non-autoregressively-that is, the data-driven method is not utilized for predictions beyond the desired window size τ . Therefore, it is always assumed that the true yt, yt−1, . . . , yt−τ is available prior to making predictions. This means that given a window of true inputs (for example obtained via an observation of the state of the system given re-analysis data), a forecast is made for a series of outputs (corresponding to the window length) before a metric of accuracy is computed for optimization. This is in contrast to a situation where simply one step of a prediction is utilized for computing a fitness metric which adversely affects the ability of the predictive method for longer forecasts into the future (due to amplifying errors with each forecast step). The window size for the set of experiments on this data set is fixed at 8 weeks. The window-in and window-out construction of the training data leads to a final training data set of size 411 samples. Since this data set 2Available at https://www.esrl.noaa.gov/psd/ 7 Neural architecture search ensembles for scientific machine learning A PREPRINT is produced by combining local and satellite temperature observations, it represents an attractive forecasting task for non-intrusive data-driven methods without requiring the physical modeling of underlying processes. − (cid:80)M Subsequently, proper orthogonal decomposition (POD) provides a systematic method to project dynamics of a high- dimensional system onto a lower-dimensional subspace. We suppose that a single snapshot of the full system is a vector in RN , where N could be the number of grid points at which the field is resolved. Observing the system across a number of time points gives us the snapshots y1, . . . , yT , with mean subtracted by convention. The aim of POD is to find a small set of orthonormal basis vectors v1, . . . , vM , with M N , which approximates the spatial snapshots, yt t = 1, . . . , T, and so allows us to approximate the evolution of the full N dimensional system by considering only the evolution of the M coefficients aj(t). POD chooses the basis, vj, to minimize the residual with respect to the L2 norm, R = (cid:80)T yT ], the optimal basis is given by the M eigenvectors of SST , with largest eigenvalues, after which, the coefficients are found by orthogonal projection, a(t) = Taira et al. [2020]. The coefficients a(t) correspond to a time-series with an M (cid:105) dimensional state vector which is the focus of our temporal forecasting. 2. Defining the snapshot matrix, S = [y1 || j=1 aj(t)vj, j=1 aj(t)vj yt, v (cid:104) t=1 || | * * * | (cid:80)M (cid:28) yt ≈ − t Dt, hence defining the mean subtracted snapshots yt = Dt For our learning, we take only the training data snapshots, say D1, . . . , DT , from which we calculate the mean ̄D = (1/T ) (cid:80) ̄D. We then create the snapshot matrix, S, and find numerically the M eigenvectors of SST with largest eigenvalues. From this, we train models to forecast the coefficients making predictions of future coefficients given previous ones. Note that our model is also capable of making predictions for the aleatoric uncertainty, i.e., we can predict the variance of the output data given a Gaussian likelihood assumption for the loss function. This implies that we also predict variances in addition to the deterministic mean, i.e., − f †(a(t), a(t − 1), . . . , a(t − τ )) = ((ˆa(t + 1), σˆa(t + 1)), (ˆa(t + 2), σˆa(t + 2)), . . . , (ˆa(t + τ ), σˆa(t + τ ))) (a(t + 1), a(t + 2), . . . , a(t + τ )) ≈ (ˆa(t + 1), ˆa(t + 2), . . . , ˆa(t + τ )) (6) (7) Here, τ corresponds to the time-delay that is embedded into the input feature space for the purpose of forecasting. In this article, τ also stands for the forecast length obtained from the fit model although in the general case, these quantities can be chosen to be different. We can now test for predictions on unseen data, E1, . . . , EQ, where Et is an unseen snapshot of data at time t and Q is the total number of test snapshots. Note that these test snapshots are obtained for a time-interval that has not been utilized for constructing the POD basis vectors. We proceed by taking the mean ̄D, and vectors vj calculated from the training data to get test coefficients at an instant in time aj(t) = (cid:104)Et − ̄D, vj(cid:105), j = 1, . . . , M, which will be used with the model f † to make future predictions in the unseen testing interval. The prediction for the coefficients ˆa, can be converted into predictions in the physical space by taking ̄D + (cid:80) j ˆajvj. This procedure only makes use of testing data to pass into the model, not to train the model in any way. Crucially, to make a forecast of Et+1, Et+2, . . . , Et+τ , only previous measurements Et, Et−1, . . . , Et−τ are needed. The connection to AgeBO comes in through how one may obtain several models like f † which may subsequently be used for forecasting. 2.4 Task 2: Field reconstruction from sparse sensors In this section, we consider the problem of reconstructing the sea-surface temperature data given sparse observations of the flow-field. We use 20 years of data (1040 snapshots spanning 1981 to 2001) as the training data set, while the test data set is prepared from 874 snapshots spanning from year 2001 to 2018. Thus the regression problem is given by attempting to find a map yt ≈ g†(H[yt]) where H is the observation operator mapping the full state to sparse observations. We note that unlike the previous forecasting problem, there is no requirement of a normalization procedure on the data for constructing our data-driven models. This test setting represents extrapolation in time but not physics, since the data set has the influence of seasonal periodicity. The aforementioned problem setting follows the work of Callaham et al. [2019b] who attempted to reconstruct fluid-flow fields from local sensors using sparse representations. As in their article, the input sensors for the baseline model are chosen randomly from the region of 50◦ S to 50◦ N. We utilize the same configuration as our previous articles [Maulik et al., 2020d] that have also used this benchmark problem for algorithmic development for the purpose of consistency. (8) 3 Results In the following section, we detail our results for the forecasting and reconstruction experiments. 3.1 Forecasting We first assess the capability of DeepHyper NAS for discovering high-performing models that forecasting the NOAA sea-surface temperature. Here, forecasts are performed for 8-week output windows, given 8-week input information. The inputs and outputs of our model are given by sets of POD coefficients. We devise a search-space of stacked long short-term memory (LSTM) neural 8 Neural architecture search ensembles for scientific machine learning A PREPRINT Figure 2: A description of the neural architecture search space constructed for the flow-forecasting task. network models as shown in Figure 2. In this search space, we utilize five fully-connected (i.e., stacked) LSTM cells that are then allowed to have interactions between them using skip connections. The output of this neural architecture is a sequence of coefficients (with corresponding mean and aleatoric variance) in the latent space of the dynamics. In Figure 3, we show results from the NAS of stacked LSTM architectures. We first show that the search for neural architectures demonstrates improving performance with increasing number of iterations of the outer-loop differential evolution algorithm with a sharp increase in the log-likelihood over the first few iterations followed by a gradual convergence. In addition, we also show the performance of various models obtained at the final iteration, where a large majority of the models have superior performance in comparison to a few that are abnormally accurate or inaccurate. We extract 10 neural architectures from the entire search population and perform ensemble analyses with them. Note that the choice of the number of architectures is a user-defined parameter. We first compute the root-mean-squared-error of each neural architecture with respect to the truth for the testing range of the data set. We remind the reader that the output of a neural architecture member of the ensemble is a mean value for a Gaussian as well as a variance that represents the aleatoric uncertainty. We compute error statistics for individual ensemble members solely with the mean value predicted at the output layer. For computing the prediction of the entire ensemble, we compute a mean of the predictions from each member of the ensemble and then compute corresponding error statistics. We plot histograms of the RMSE for various weeks in Figure 4 which demonstrate how ensemble statistics reduce the potential heavy-tailed errors of individual ensemble members. Finally, we use the ensemble predictions from our 10 selected high-performing architectures to construct estimates of epistemic and aleatoric uncertainty from our identified surrogate models. Figure 6 shows these plots for the final week of forecasts. A first takeaway from these plots is that Epistemic and Aleatoric uncertainty is characterized in coherent regions of the flow-field. These coherent regions are distinctly indicative of geographical trends. In terms of accuracy, the performance of the ensemble-based predictions (over here represented by the ensemble mean) improves on the previous search model reported in Maulik et al. [2020c] significantly as shown in Table 1. We also mention comparisons with two physics-based models given by the Community Earth System Model 9 OutputInput Repeat Neural architecture search ensembles for scientific machine learning A PREPRINT (a) Convergence (b) Model spectrum Figure 3: Convergence of neural architecture search shown through moving averages (left) and spectrum of model performance (right) for the forecasting task. The red dashed line indicates the start of intelligent search space exploration. Table 1: RMSE breakdown (in Celsius) for different forecast techniques compared against the NAS-POD-LSTM forecasts between April 5, 2015, and June 24, 2018, in the Eastern Pacific region (between -10 to +10 degrees latitude and 200 to 250 degrees longitude). Ensemble based forecasts outperform the 'best-model' obtained via neural architecture search as reported in previous literature [Maulik et al., 2020e]. RMSE (◦Celsius) Week 1 Week 2 Week 3 Week 4 Week 5 Week 6 Week 7 Week 8 This study Maulik et al. [Maulik et al., 2020c] CESM HYCOM 0.33 0.62 1.88 0.99 0.34 0.63 1.87 0.99 0.34 0.64 1.83 1.03 0.35 0.66 1.85 1.04 0.37 0.63 1.86 1.02 0.38 0.66 1.87 1.05 0.38 0.69 1.86 1.03 0.39 0.65 1.83 1.05 (CESM) [Kay et al., 2015] 3 and Global Hybrid Coordinate Ocean Model (HYCOM) 4 that rely on the solution of complex partial differential equations on distributed computing resources. However, we highlight the fact that the slightly larger biases in the CESM and HYCOM data may be an artifact of interpolation from grids of different spatiotemporal resolution. From the perspective of computational cost, the search for the LSTM surrogate models in this section required 1 node-hour (8 GPU-hours) of wall-time on Theta GPU and evaluated 812 architectures sampled from the search-space. Here, it must be noted that for larger training requirements (i.e., when data sets are extremely large), smaller randomized subsets of the training data can be used to accelerate the convergence of architecture discovery before the full-data is exposed to the high-performing models. We leave such considerations for a future study. Additionally, our search procedure inherently priorities architectures that have fewer parameters since these members convergence more rapidly. In practice, this property of neural architecture search may be leveraged to find surrogates that lead to greater computational gains without sacrificing accuracy. Individual surrogate models identified are very cheap to deploy with each forward model evaluation obtained on the order of milliseconds. 3.2 Reconstruction In this subsection, we evaluate our proposed methodology for the previously introduced benchmark flow-reconstruction problem. Our neural architecture search space builds a fully-connected network architecture from prespecified sensor input locations that measure the state, to the output which is the entire flow-field of dimension 360 times 180. The search space for sampling high-performing neural ensembles is shown in Figure. 7. In this search space, we have added 5 layers of fully-connected layers that are then allowed to interact within each other using discoverable skip connections. The training and testing data are segregated according to Maulik et al. [2020b], and specifically, the former is further split to obtain a validation data set that is used for directing the search for members of the ensemble. Figure 8(a) shows the convergence of the neural architecture search for the flow-reconstruction task. We observe an initial period of exploration which leads to several underperforming architectures but the search is soon seen to converge to a high value of the log-likelihood. Figure 8(b) shows the range of model performance for all the sampled architectures during the search. A small proportion of the total models is seen to have poor performance, representing the initial stage of exploration by the differential evolution algorithm. As in the previous example, we retain the 10 best models obtained at the end of this search and compute 3http://www.cesm.ucar.edu/projects/community-projects/LENS/data-sets.html 4https://www.ncdc.noaa.gov/data-access/model-data/model-datasets/navoceano-hycom-glb 10 0200400600800Iterations0.70.80.91.01.1Log-likelihood0200400600800Models−0.50.00.51.0Log-likelihood Neural architecture search ensembles for scientific machine learning A PREPRINT (a) Week 1 (b) Week 2 (c) Week 3 (d) Week 4 (e) Week 5 (f) Week 6 (g) Week 7 (h) Week 8 Figure 4: Pointwise RMSE histograms for various forecast weeks showing individual member bin counts as well as ensemble mean performance. Most points on the grid show a RMSE of around 0.2. 11 0.20.40.60.8RMSE020406080100120140CountAllmembersEnsemblemember1Ensemblemember2Ensemblemember3Ensemblemember4Ensemblemember5Ensemblemember6Ensemblemember7Ensemblemember8Ensemblemember9Ensemblemember100.00.20.40.60.8RMSE020406080100120140Count0.00.20.40.60.81.0RMSE020406080100120140Count0.00.20.40.60.81.0RMSE020406080100120140160Count0.00.20.40.60.81.0RMSE020406080100120140160Count0.00.20.40.60.81.0RMSE020406080100120140160Count0.00.20.40.60.81.0RMSE020406080100120140160Count0.00.20.40.60.8RMSE020406080100120140Count Neural architecture search ensembles for scientific machine learning A PREPRINT (a) Week 1 (b) Week 2 (c) Week 3 (d) Week 4 (e) Week 5 (f) Week 6 (g) Week 7 (h) Week 8 Figure 5: Showing count differences between the ensemble RMSE and individual member RMSE histograms for the SST forecasting task at different lead-times. Here count values larger than zero indicate a greater number of ensemble predictions at a particular RMSE level. It is clear that large positive values of this metric are encountered before large negative values for all weeks - indicating that the ensemble is superior to individual members. 12 0.20.40.60.8RMSE−20−1001020304050CountdifferenceDifferenceincountsforforecastweek10.20.40.60.8RMSE−30−20−10010203040CountdifferenceDifferenceincountsforforecastweek20.20.40.60.81.0RMSE−20−1001020304050CountdifferenceDifferenceincountsforforecastweek30.20.40.60.81.0RMSE−30−20−10010203040CountdifferenceDifferenceincountsforforecastweek40.20.40.60.81.0RMSE−40−30−20−10010203040CountdifferenceDifferenceincountsforforecastweek50.20.40.60.81.0RMSE−30−20−10010203040CountdifferenceDifferenceincountsforforecastweek60.20.40.60.81.0RMSE−20−10010203040CountdifferenceDifferenceincountsforforecastweek70.20.40.60.8RMSE−20−1001020304050CountdifferenceDifferenceincountsforforecastweek8 Neural architecture search ensembles for scientific machine learning A PREPRINT (a) Epistemic Uncertainty (b) Aleatoric Uncertainty (c) Mean absolute error Figure 6: Epistemic uncertainty (top-left), aleatoric uncertainty (top-right) and mean absolute errors (bottom) for the forecasting problem (showing forecasts on week 8). Uncertainty is represented by the absolute value of the standard deviation of modal coefficients projected back into the physical space. statistics for RMSE for individual ensemble members as well as the prediction by the ensemble. This is shown through histogram counts in Figure 9(a), where one can qualitatively observe that large counts in the tails in some members of the ensemble are reduced. The improvement on individual members of the ensemble can be observed in Figure 9(b) where larger values of the difference in counts imply that the ensemble made more predictions with that value of the error. The desirable behavior of have large positive values at low RMSE and larger negative values at high RMSE is observed here as well. Finally averaged estimates of uncertainty are shown in Figure 10 where it can be seen that epistemic uncertainty is mainly driven by coastal areas in the northern hemisphere whereas aleatoric uncertainty arises from the typical ENSO fluctuations in the Pacific Ocean. The metric used for assessing the performance of the ensemble is given by the relative L2-norm error of 0.0428 which is comparable to the model obtained in Maulik et al. [2020b] but with added estimates of epistemic and aleatoric uncertainty represented clearly. From a computational perspective, the neural architecture search was performed using 8 GPU hours, with the total evaluation of 401 models and the model evaluation post-training was performed virtually instantaneously. A significant correlation between the error and the uncertainty is also clearly observed. 4 Conclusion In this paper, we have demonstrated a computational workflow that may be used both for constructing deep learning models for forecasting dynamical systems and for reconstructing flow-field information from sparse sensors. Our experiments demonstrate that a joint neural architecture and hyperparameter search not only discovers effective models for target function approximation but also doubles as an effective tool to quantify uncertainty in our predictions. This is accomplished by using a number of the high-performing models discovered by the deep neural network search in an ensemble-based uncertainty quantification approach. By endowing our search space with an output layer that may use a maximum-likelihood based estimation, i.e., if the outputs are both the mean as well as variance which goes into a Gaussian likelihood maximization formulation, we are able to quantify the aleatoric uncertainty of the predictions associated with each model. By leveraging the law of decomposition of the total uncertainty of an ensemble, we are also able to quantify the aleatoric and epistemic uncertainty in predictions of the entire ensemble of members. Our data set for experiments comes from the NOAA optimum interpolation sea-surface temperature data set, thereby representing a representative data set for complex geoscience data set. Our conclusions suggest that scalable distributed neural architecture and hyperparameter search may represent a vertically integrated workflow for high-performing surrogate model construction as well as efficient uncertainty quantification. 13 0100200300Longitude050100150LatitudeEpistemicuncertaintyforforecastweek:8051015200100200300Longitude050100150LatitudeAleatoricuncertaintyforforecastweek:8051015200100200300Longitude050100150LatitudeMAEforforecastweek:80.00.51.01.5 Neural architecture search ensembles for scientific machine learning A PREPRINT Figure 7: A description of the neural architecture search space constructed for the flow-reconstruction task. (a) Convergence (b) Model spectrum Figure 8: Convergence of neural architecture search (left) and spectrum of model performance (right) for the flow- reconstruction task. The vertical dashed line at 100 iterations indicates the start of intelligent exploration of the search space. 14 OutputInput Repeat 0100200300400Iterations−101−1000Log-likelihood0100200300400Models−102−101−1000Log-likelihood Neural architecture search ensembles for scientific machine learning A PREPRINT (a) RMSE histogram (b) RMSE count differences Figure 9: RMSE histogram for flow-reconstruction on test data set showing ensemble predictions as well as individual member statistics (left) and count differences between the ensemble RMSE and individual member RMSE for the SST flow reconstruction task. Here count values larger than zero indicate a greater number of ensemble predictions, i.e., there were more predictions from the ensemble with that value of an RMSE. It is clear that large positive values of this metric are encountered before large negative values - indicating that the ensemble is superior to individual members (right). (a) Epistemic Uncertainty (b) Aleatoric Uncertainty (c) Mean absolute error Figure 10: Epistemic uncertainty (top-left), aleatoric uncertainty (top-right) and mean absolute errors (bottom) for the flow-reconstruction problem. The sensor locations are shown in red. One can observe that the mean-absolute errors are highly correlated with the aleatoric uncertainty. 15 0.50.60.70.80.9RMSE0.02.55.07.510.012.515.017.520.0CountAllmembersEnsemblemember1Ensemblemember2Ensemblemember3Ensemblemember4Ensemblemember5Ensemblemember6Ensemblemember7Ensemblemember8Ensemblemember9Ensemblemember100.50.60.70.80.9RMSE−8−6−4−202468CountdifferenceDifferenceincountsforflowreconstruction0100200300Longitude050100150LatitudeEpistemicuncertainty0.00.51.01.52.02.53.00100200300Longitude050100150LatitudeAleatoricuncertainty0.00.51.01.52.02.53.00100200300Longitude050100150LatitudeMeanabsoluteerror0.00.51.01.52.02.53.0 Neural architecture search ensembles for scientific machine learning A PREPRINT Data availability Training data used in the present study are available publicly on Google Drive: Example 1 (NOAA sea surface temperature - forecasting): https://drive.google.com/drive/folders/1pVW4epkeHkT2WHZB7Dym5IURcfOP4cXu?usp=sharing), Example 2 (NOAA sea surface temperature - reconstruction): https://drive.google.com/drive/folders/1pVW4epkeHkT2WHZB7Dym5IURcfOP4cXu?usp=sharing), Code availability Sample codes for neural architecture search as well as ensemble based predictions will be made available after peer-review (or on request). Tutorials and examples for deploying the neural architecture and hyperparameter searches for arbitrary modeling tasks can be found at https://github.com/deephyper/deephyper. Acknowledgement This work was supported by the U.S. Department of Energy, Office of Science, Office of Advanced Scientific Computing Research, under Contract DE-AC02-06CH11357. We acknowledge funding support from ASCR for DOE-FOA-2493 "Data-intensive scientific machine learning" and the DOE Early Career Research Program award. This research was funded in part and used resources of the Argonne Leadership Computing Facility, which is a DOE Office of Science User Facility supported under Contract DE-AC02- 06CH11357. 5 Declaration of interest The authors report no conflict of interest. References Romain Egele, Romit Maulik, Krishnan Raghavan, Bethany Lusch, Isabelle Guyon, and Prasanna Balaprakash. Autodeuq: Automated deep ensemble with uncertainty quantification. In 2022 26th International Conference on Pattern Recognition (ICPR), pages 1908–1914. IEEE, 2022. Kevin Carlberg, Charbel Bou-Mosleh, and Charbel Farhat. Efficient non-linear model reduction via a least-squares Petrov–Galerkin projection and compressive tensor approximations. Int. J. Numer. Meth. Eng., 86(2):155–181, 2011. Z. Wang, I. Akhtar, J. Borggaard, and T. Iliescu. Proper orthogonal decomposition closure models for turbulent flows: a numerical comparison. Comput. Meth. Appl. M., 237:10–26, 2012. O San and J Borggaard. Principal interval decomposition framework for POD reduced-order modeling of convective Boussinesq flows. Int. J. Numer. Meth. Fl., 78(1):37–62, 2015. Francesco Ballarin, Andrea Manzoni, Alfio Quarteroni, and Gianluigi Rozza. Supremizer stabilization of POD–Galerkin ap- proximation of parametrized steady incompressible Navier–Stokes equations. Int. J. Numer. Meth. Eng., 102(5):1136–1161, 2015. Omer San and Romit Maulik. Extreme learning machine for reduced order modeling of turbulent geophysical flows. Phys. Rev. E, 97 (4):042322, 2018. Q. Wang, J. S. Hesthaven, and D. Ray. Non-intrusive reduced order modeling of unsteady flows using artificial neural networks with application to a combustion problem. J. Comp. Phys., 384:289–307, 2019. Youngsoo Choi and Kevin Carlberg. Space–time least-squares petrov–galerkin projection for nonlinear model reduction. SIAM J. Sci. Comput., 41(1):A26–A58, 2019. S Ashwin Renganathan, Romit Maulik, and Vishwas Rao. Machine learning for nonintrusive model order reduction of the parametric inviscid transonic flow past an airfoil. Physics of Fluids, 32(4):047110, 2020. Jiahao Ren, Haiou Wang, Jiangkuan Xing, Kun Luo, and Jianren Fan. A lower-dimensional approximation model of turbulent flame stretch and its related quantities with machine learning approaches. Physics of Fluids, 32(11):115113, 2020a. J. L. Proctor, S. L. Brunton, and J. N. Kutz. Dynamic mode decomposition with control. SIAM J. Appl. Dyn. Syst., 15(1):142–161, 2016. Sebastian Peitz, Sina Ober-Blöbaum, and Michael Dellnitz. Multiobjective optimal control methods for the navier-stokes equations using reduced order modeling. Acta Applicandae Mathematicae, 161(1):171–199, 2019. Bernd R Noack, Marek Morzynski, and Gilead Tadmor. Reduced-order modelling for flow control, volume 528. Springer Science & Business Media, 2011. 16 Neural architecture search ensembles for scientific machine learning A PREPRINT C. W. Rowley and S. T. M. Dawson. Model reduction for flow analysis and control. Annual Review of Fluid Mechanics, 49:387–417, 2017. Cedric Raibaudo, Peng Zhong, Bernd R Noack, and Robert John Martinuzzi. Machine learning strategies applied to the control of a fluidic pinball. Physics of Fluids, 32(1):015108, 2020. Feng Ren, Hai-bao Hu, and Hui Tang. Active flow control using machine learning: A brief review. Journal of Hydrodynamics, 32(2): 247–253, 2020b. Benjamin Peherstorfer, Karen Willcox, and Max Gunzburger. Optimal model management for multifidelity Monte Carlo estimation. SIAM J. Sci. Comput., 38(5):A3163–A3194, 2016. Dewei Fan, Bingfu Zhang, Yu Zhou, and Bernd R Noack. Optimization and sensitivity analysis of active drag reduction of a square-back ahmed body using machine learning control. Physics of Fluids, 32(12):125117, 2020. Themistoklis P Sapsis and Andrew J Majda. Statistically accurate low-order models for uncertainty quantification in turbulent dynamical systems. P. Natl. Acad. Sci. USA, 110(34):13705–13710, 2013. Matthew J Zahr, Kevin T Carlberg, and Drew P Kouri. An efficient, globally convergent method for optimization under uncertainty using adaptive model reduction and sparse grids. arXiv preprint arXiv:1811.00177, 2018. Hwan Goh, Sheroze Sheriffdeen, Jonathan Wittmer, and Tan Bui-Thanh. Solving bayesian inverse problems via variational autoencoders. arXiv preprint arXiv:1912.04212, 2019. Rossella Arcucci, Laetitia Mottet, Christopher Pain, and Yi-Ke Guo. Optimal reduced space for variational data assimilation. J. Comp. Phys., 379:51–69, 2019. Meng Tang, Yimin Liu, and Louis J Durlofsky. A deep-learning-based surrogate model for data assimilation in dynamic subsurface flow problems. Journal of Computational Physics, page 109456, 2020. César Quilodrán Casas, Rossella Arcucci, Pin Wu, Christopher Pain, and Yi-Ke Guo. A reduced order deep data assimilation model. Physica D: Nonlinear Phenomena, 412:132615, 2020. Romit Maulik, Vishwas Rao, Jiali Wang, Gianmarco Mengaldo, Emil Constantinescu, Bethany Lusch, Prasanna Balaprakash, Ian Foster, and Rao Kotamarthi. Efficient high-dimensional variational data assimilation with machine-learned reduced-order models. Geoscientific Model Development, 15(8):3433–3445, 2022. Omer San and Jeff Borggaard. Basis selection and closure for pod models of convection dominated boussinesq flows. In 21st International Symposium on Mathematical Theory of Networks and Systems, volume 5, 2014. Milan Korda, Mihai Putinar, and Igor Mezi ́c. Data-driven spectral analysis of the koopman operator. Applied and Computational Harmonic Analysis, 2018. Virginia L Kalb and Anil E Deane. An intrinsic stabilization scheme for proper orthogonal decomposition based low-dimensional models. Phys. Fluids, 19(5):054106, 2007. I Kalashnikova and MF Barone. On the stability and convergence of a galerkin reduced order model (rom) of compressible flow with solid wall and far-field boundary treatment. International journal for numerical methods in engineering, 83(10):1345–1375, 2010. Muhammad Mohebujjaman, Leo G Rebholz, and Traian Iliescu. Physically constrained data-driven correction for reduced-order modeling of fluid flows. Int. J. Numer. Meth. Fl., 89(3):103–122, 2019. D Xiao, F Fang, J Du, CC Pain, IM Navon, AG Buchan, Ahmed H Elsheikh, and G Hu. Non-linear petrov–galerkin methods for reduced order modelling of the navier–stokes equations using a mixed finite element pair. Computer Methods In Applied Mechanics and Engineering, 255:147–157, 2013. Fangxin Fang, Christopher C Pain, IM Navon, Ahmed H Elsheikh, Juan Du, and D Xiao. Non-linear petrov–galerkin methods for reduced order hyperbolic equations and discontinuous finite element methods. Journal of Computational Physics, 234:540–559, 2013. Kevin Carlberg, Matthew Barone, and Harbir Antil. Galerkin v. least-squares petrov–galerkin projection in nonlinear model reduction. Journal of Computational Physics, 330:693–734, 2017. Zhongzhan Huang, Senwei Liang, Hong Zhang, Haizhao Yang, and Liang Lin. Accelerating numerical solvers for large-scale simulation of dynamical system via neurvec. arXiv preprint arXiv:2208.03680, 2022. Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. P. R. Vlachas, W. Byeon, Z. Y. Wan, T. P. Sapsis, and P. Koumoutsakos. Data-driven forecasting of high-dimensional chaotic systems with long short-term memory networks. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 474(2213):20170844, 2018. S. E. Ahmed, O. San, A. Rasheed, and T. Iliescu. A long short-term memory embedding for hybrid uplifted reduced order models. arXiv preprint, arXiv:1912.06756, 2019. Romit Maulik, Arvind Mohan, Bethany Lusch, Sandeep Madireddy, and Prasanna Balaprakash. Time-series learning of latent-space dynamics for reduced-order model closure. arXiv preprint arXiv:1906.07815, 2019. A. T. Mohan, D. Daniel, M. Chertkov, and D. Livescu. Compressed convolutional LSTM: An efficient deep learning framework to model high fidelity 3D turbulence. arXiv preprint, arXiv:1903.00033, 2019. 17 Neural architecture search ensembles for scientific machine learning A PREPRINT Arvind T Mohan and Datta V Gaitonde. A deep learning based approach to reduced order modeling for turbulent flow control using LSTM neural networks. arXiv preprint arXiv:1804.09269, 2018. F. J. Gonzalez and M. Balajewicz. Learning low-dimensional feature dynamics using deep convolutional recurrent autoencoders. arXiv preprint, arXiv:1808.01346, 2018. Kazuto Hasegawa, Kai Fukami, Takaaki Murata, and Koji Fukagata. CNN-LSTM based reduced order modeling of two-dimensional unsteady flows around a circular cylinder at different Reynolds numbers. Fluid Dynamics Research, 52(6):065501, 2020a. Qian Wang, Nicolò Ripamonti, and Jan S Hesthaven. Recurrent neural network closure of parametric pod-galerkin reduced-order models based on the mori-zwanzig formalism. Journal of Computational Physics, 410:109402, 2020. Kazuto Hasegawa, Kai Fukami, Takaaki Murata, and Koji Fukagata. Machine-learning-based reduced-order modeling for unsteady flows around bluff bodies of various shapes. Theoretical and Computational Fluid Dynamics, 34:367–383, 2020b. Ashesh Chattopadhyay, Adam Subel, and Pedram Hassanzadeh. Data-Driven Super-Parameterization Using Deep Learning: Experimentation With Multiscale Lorenz 96 Systems and Transfer Learning. Journal of Advances in Modeling Earth Systems, 12 (11):e2020MS002084, 2020. Romit Maulik, Bethany Lusch, and Prasanna Balaprakash. Non-autoregressive time-series methods for stable parametric reduced- order models. Physics of Fluids, 32(8):087115, 2020a. S Ashwin Renganathan, Romit Maulik, and Jai Ahuja. Enhanced data efficiency using deep neural networks and gaussian processes for aerodynamic design optimization. Aerospace Science and Technology, 111:106522, 2021. Zhan Ma and Wenxiao Pan. Data-driven nonintrusive reduced order modeling for dynamical systems with moving boundaries using gaussian process regression. Computer Methods in Applied Mechanics and Engineering, 373:113495, 2021. Mengwu Guo and Jan S Hesthaven. Reduced order modeling for nonlinear structural analysis using gaussian process regression. Computer methods in applied mechanics and engineering, 341:807–826, 2018. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. Nicholas Geneva and Nicholas Zabaras. Transformers for modeling physical systems. Neural Networks, 146:272–289, 2022. Alec J Linot, Joshua W Burby, Qi Tang, Prasanna Balaprakash, Michael D Graham, and Romit Maulik. Stabilized neural ordinary differential equations for long-time forecasting of dynamical systems. Journal of Computational Physics, 474:111838, 2023. R. J. Adrian and P. Moin. Stochastic estimation of organized turbulent structure: homogeneous shear flow. J. Fluid Mech., 190: 531–559, 1988. Richard Everson and Lawrence Sirovich. Karhunen–Loeve procedure for gappy data. JOSA A, 12(8):1657–1664, 1995. Kai Fukami, Koji Fukagata, and Kunihiko Taira. Assessment of supervised machine learning methods for fluid flows. Theoretical and Computational Fluid Dynamics, 34:497–519, 2020. Douglas W Carter, Francis De Voogt, Renan Soares, and Bharathram Ganapathisubramani. Data-driven sparse reconstruction of flow over a stalled aerofoil using experimental data. Data-Centric Engineering, 2:e5, 2021. N Benjamin Erichson, Lionel Mathelin, Zhewei Yao, Steven L Brunton, Michael W Mahoney, and J Nathan Kutz. Shallow neural networks for fluid flow reconstruction with limited sensors. Proceedings of the Royal Society A, 476(2238):20200097, 2020. Luning Sun and Jian-Xun Wang. Physics-constrained bayesian neural network for fluid flow reconstruction with sparse and noisy data. Theoretical and Applied Mechanics Letters, 10(3):161–169, 2020. Pierre Dubois, Thomas Gomez, Laurent Planckaert, and Laurent Perret. Machine learning for fluid flow reconstruction from limited measurements. Journal of Computational Physics, 448:110733, 2022. Sheroze Sheriffdeen, Jean C Ragusa, Jim E Morel, Marvin L Adams, and Tan Bui-Thanh. Accelerating PDE-constrained inverse solutions with deep learning and reduced order models. arXiv preprint arXiv:1912.08864, 2019. Paul G Constantine, Carson Kent, and Tan Bui-Thanh. Accelerating Markov chain Monte Carlo with active subspaces. SIAM Journal on Scientific Computing, 38(5):A2779–A2805, 2016. Yang Liu, Dewei Wang, Xiaodong Sun, Nam Dinh, and Rui Hu. Uncertainty quantification for multiphase-cfd simulations of bubbly flows: a machine learning-based bayesian approach supported by high-resolution experiments. Reliability Engineering & System Safety, 212:107636, 2021. Kjetil O Lye, Siddhartha Mishra, and Deep Ray. Deep learning observables in computational fluid dynamics. Journal of Computa- tional Physics, 410:109339, 2020. Romit Maulik, Kai Fukami, Nesar Ramachandra, Koji Fukagata, and Kunihiko Taira. Probabilistic neural networks for fluid flow surrogate modeling and data recovery. Physical Review Fluids, 5(10):104401, 2020b. Masaki Morimoto, Kai Fukami, Romit Maulik, Ricardo Vinuesa, and Koji Fukagata. Assessments of epistemic uncertainty using Gaussian stochastic weight averaging for fluid-flow regression. Physica D: Nonlinear Phenomena, 440:133454, 2022. Aditi Krishnapriyan, Amir Gholami, Shandian Zhe, Robert Kirby, and Michael W Mahoney. Characterizing possible failure modes in physics-informed neural networks. Advances in Neural Information Processing Systems, 34:26548–26560, 2021. 18 Neural architecture search ensembles for scientific machine learning A PREPRINT Yinhao Zhu, Nicholas Zabaras, Phaedon-Stelios Koutsourelakis, and Paris Perdikaris. Physics-constrained deep learning for high-dimensional surrogate modeling and uncertainty quantification without labeled data. Journal of Computational Physics, 394: 56–81, 2019. Suraj Pawar, Omer San, Prakash Vedula, Adil Rasheed, and Trond Kvamsdal. Multi-fidelity information fusion with concatenated neural networks. Scientific Reports, 12(1):5900, 2022. Romit Maulik, Romain Egele, Bethany Lusch, and Prasanna Balaprakash. Recurrent neural network architecture search for geophysical emulation. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, SC '20. IEEE Press, 2020c. ISBN 9781728199986. Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. arXiv preprint arXiv:1612.01474, 2016. Matthew R Rudary. On predictive linear Gaussian models. University of Michigan, 2009. Romain Egele, Prasanna Balaprakash, Venkatram Vishwanath, Isabelle Guyon, and Zhengying Liu. AgEBO-Tabular: Joint neural architecture and hyperparameter search with autotuned data-parallel training for tabular data. In SC21: International Conference for High Performance Computing, Networking, Storage and Analysis, pages 1–14, 2021. doi:10.1145/3458817.3476203. Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In Proceedings of the aaai conference on artificial intelligence, volume 33, pages 4780–4789, 2019. David Ginsbourger, Rodolphe Le Riche, and Laurent Carraro. Kriging is well-suited to parallelize optimization. In Yoel Tenne and Chi-Keong Goh, editors, Computational Intelligence in Expensive Optimization Problems, volume 2, pages 131–162. Springer Berlin Heidelberg, 2010. ISBN 978-3-642-10700-9 978-3-642-10701-6. doi:10.1007/978-3-642-10701-6_6. URL http://link.springer.com/10.1007/978-3-642-10701-6_6. Series Title: Adaptation Learning and Optimization. Rich Caruana, Alexandru Niculescu-Mizil, Geoff Crew, and Alex Ksikes. Ensemble selection from libraries of models. In Twenty-first international conference on Machine learning - ICML '04, page 18. ACM Press, 2004. doi:10.1145/1015330.1015432. URL http://portal.acm.org/citation.cfm?doid=1015330.1015432. P. Balaprakash, M. Salim, T. Uram, V. Vishwanath, and S. Wild. Deephyper: Asynchronous hyperparameter search for deep neural networks. In 2018 IEEE 25th International Conference on High Performance Computing (HiPC), pages 42–51. IEEE, 2018. J Nathan Kutz, Xing Fu, and Steven L Brunton. Multiresolution dynamic mode decomposition. SIAM Journal on Applied Dynamical Systems, 15(2):713–735, 2016. Jared L Callaham, Kazuki Maeda, and Steven L Brunton. Robust flow reconstruction from limited measurements via sparse representation. Physical Review Fluids, 4(10):103907, 2019a. Kunihiko Taira, Maziar S. Hemati, Steven L. Brunton, Yiyang Sun, Karthik Duraisamy, Shervin Bagheri, Scott T. M. Dawson, and Chi- An Yeh. Modal analysis of fluid flows: Applications and outlook. AIAA Journal, 58(3):998–1022, 2020. doi:10.2514/1.J058462. URL https://doi.org/10.2514/1.J058462. J. L. Callaham, K. Maeda, and S. L. Brunton. Robust flow reconstruction from limited measurements via sparse representation. Phys. Rev. Fluids, 4:103907, 2019b. Romit Maulik, Nathan A Garland, Joshua W Burby, Xian-Zhu Tang, and Prasanna Balaprakash. Neural network representability of fully ionized plasma fluid model closures. Physics of Plasmas, 27(7):072106, 2020d. Jennifer E Kay, Clara Deser, A Phillips, A Mai, Cecile Hannay, Gary Strand, Julie Michelle Arblaster, SC Bates, Gokhan Danabasoglu, J Edwards, et al. The Community Earth System Model (CESM) large ensemble project: A community resource for studying climate change in the presence of internal climate variability. Bulletin of the American Meteorological Society, 96(8):1333–1349, 2015. Romit Maulik, Themistoklis Botsas, Nesar Ramachandra, Lachlan Robert Mason, and Indranil Pan. Latent-space time evolution of non-intrusive reduced-order models using gaussian process emulation. Physica D: Nonlinear Phenomena, page 132797, 2020e. 19
http://arxiv.org/abs/2302.09746v1
2023-02-20T03:52:53
2023-02-20T03:52:53
PriSTI: A Conditional Diffusion Framework for Spatiotemporal Imputation
Spatiotemporal data mining plays an important role in air quality monitoring, crowd flow modeling, and climate forecasting. However, the originally collected spatiotemporal data in real-world scenarios is usually incomplete due to sensor failures or transmission loss. Spatiotemporal imputation aims to fill the missing values according to the observed values and the underlying spatiotemporal dependence of them. The previous dominant models impute missing values autoregressively and suffer from the problem of error accumulation. As emerging powerful generative models, the diffusion probabilistic models can be adopted to impute missing values conditioned by observations and avoid inferring missing values from inaccurate historical imputation. However, the construction and utilization of conditional information are inevitable challenges when applying diffusion models to spatiotemporal imputation. To address above issues, we propose a conditional diffusion framework for spatiotemporal imputation with enhanced prior modeling, named PriSTI. Our proposed framework provides a conditional feature extraction module first to extract the coarse yet effective spatiotemporal dependencies from conditional information as the global context prior. Then, a noise estimation module transforms random noise to realistic values, with the spatiotemporal attention weights calculated by the conditional feature, as well as the consideration of geographic relationships. PriSTI outperforms existing imputation methods in various missing patterns of different real-world spatiotemporal data, and effectively handles scenarios such as high missing rates and sensor failure. The implementation code is available at https://github.com/LMZZML/PriSTI.
[ "Mingzhe Liu", "Han Huang", "Hao Feng", "Leilei Sun", "Bowen Du", "Yanjie Fu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09746v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09746v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
PriSTI: A Conditional Diffusion Framework for Spatiotemporal Imputation Mingzhe Liu∗1, Han Huang∗1, Hao Feng1, Leilei Sun(cid:66)1, Bowen Du1, Yanjie Fu2 1State Key Laboratory of Software Development Environment, Beihang University, Beijing 100191, China 2Department of Computer Science, University of Central Florida, FL 32816, USA {mzliu1997, h-huang, pinghao, leileisun, dubowen}@buaa.edu.cn, [email protected] 3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 6 4 7 9 0 . 2 0 3 2 : v i X r a Abstract-Spatiotemporal data mining plays an important role in air quality monitoring, crowd flow modeling, and climate forecasting. However, the originally collected spatiotemporal data in real-world scenarios is usually incomplete due to sensor failures or transmission loss. Spatiotemporal imputation aims to fill the missing values according to the observed values and the underlying spatiotemporal dependence of them. The previous dominant models impute missing values autoregressively and suffer from the problem of error accumulation. As emerging pow- erful generative models, the diffusion probabilistic models can be adopted to impute missing values conditioned by observations and avoid inferring missing values from inaccurate historical im- putation. However, the construction and utilization of conditional information are inevitable challenges when applying diffusion models to spatiotemporal imputation. To address above issues, we propose a conditional diffusion framework for spatiotemporal imputation with enhanced prior modeling, named PriSTI. Our proposed framework provides a conditional feature extraction module first to extract the coarse yet effective spatiotemporal dependencies from conditional information as the global context prior. Then, a noise estimation module transforms random noise to realistic values, with the spatiotemporal attention weights calculated by the conditional feature, as well as the consideration of geographic relationships. PriSTI outperforms existing imputa- tion methods in various missing patterns of different real-world spatiotemporal data, and effectively handles scenarios such as high missing rates and sensor failure. The implementation code is available at https://github.com/LMZZML/PriSTI. Index Terms-Spatiotemporal Imputation, Diffusion Model, Spatiotemporal Dependency Learning I. INTRODUCTION Spatiotemporal data is a type of data with intrinsic spatial and temporal patterns, which is widely applied in the real world for tasks such as air quality monitoring [1], [2], traffic status forecasting [3], [4], weather prediction [5] and so on. However, due to the sensor failures and transmission loss [2], the incompleteness in spatiotemporal data is a common problem, characterized by the randomness of missing value's positions and the diversity of missing patterns, which results in incorrect analysis of spatiotemporal patterns and further interference on downstream tasks. In recent years, extensive research [1], [6], [7] has dived into spatiotemporal imputation, with the goal of exploiting spatiotemporal dependencies from available observed data to impute missing values. ∗ Equal contribution. (cid:66) Corresponding author. The early studies applied for spatiotemporal imputation usually impute along the temporal or spatial dimension with statistic and classic machine learning methods, including but not limited to autoregressive moving average (ARMA) [8], [9], expectation-maximization algorithm (EM) [10], [11], k- nearest neighbors (KNN) [12], [13], etc. But these methods impute missing values based on strong assumptions such as the temporal smoothness and the similarity between time series, and ignore the complexity of spatiotemporal correla- tions. With the development of deep learning, most effective spatiotemporal imputation methods [1], [7], [14] use the re- current neural network (RNN) as the core to impute missing values by recursively updating their hidden state, capturing the temporal correlation with existing observations. Some of them also simply consider the feature correlation [1] by the multilayer perceptron (MLP) or spatial similarity between different time series [7] by graph neural networks. However, these approaches inevitably suffer from error accumulation [6], i.e., inference missing values from inaccurate historical imputation, and only output the deterministic values without reflecting the uncertainty of imputation. More recently, diffusion probabilistic models (DPM) [15]– [17], as emerging powerful generative models with impressive performance on various tasks, have been adopted to impute multivariate time series. These methods impute missing values starting from randomly sampled Gaussian noise, and convert the noise to the estimation of missing values [18]. Since the diffusion models are flexible in terms of neural network architecture, they can circumvent the error accumulation prob- lem from RNN-based methods through utilizing architectures such as attention mechanisms when imputation, which also have a more stable training process than generative adversarial networks (GAN). However, when applying diffusion models to imputation problem, the modeling and introducing of the conditional information in diffusion models are the inevitable challenges. For spatiotemporal imputation, the challenges can be specific to the construction and utilization of conditional information with spatiotemporal dependencies. Tashiro et al. [18] only model temporal and feature dependencies by atten- tion mechanism when imputing, without considering spatial similarity such as geographic proximity and time series corre- lation. Moreover, they combine the conditional information (i.e., observed values) and perturbed values directly as the Fig. 1: The motivation of our proposed methods. We summarize the existing methods that can be applied to spatiotemporal imputation, and compare our proposed methods with the recent existing methods. The grey shadow represents the missing part, while the rest with blue solid line represents observed values X. input for models during training, which may lead to incon- sistency inside the input spatiotemporal data, increasing the difficulty for the model to learn spatiotemporal dependencies. To address the above issues, we propose a conditional diffusion framework for SpatioTemporal Imputation with en- hanced Prior modeling (PriSTI).We summarize the existing methods that can be applied to spatiotemporal imputation, and compare the differences between our proposed method and the recent existing methods, as shown in Figure 1. Since the main challenge of applying diffusion models on spatiotemporal imputation is how to model and utilize the spatiotemporal dependencies in conditional information for the generation of missing values, our proposed method reduce the difficulty of spatiotemporal dependencies learning by extracting condi- tional feature from observation as a global context prior. The imputation process of spatiotemporal data with our proposed method is shown in the right of Figure 1, which gradually transform the random noise to imputed missing values by the trained PriSTI. PriSTI takes observed spatiotemporal data and geographic information as input. During training, the observed values are randomly erased as imputation target through a specific mask strategy. The incomplete observed data is first interpolated to obtain the enhanced conditional information for diffusion model. For the construction of conditional in- formation, a conditional feature extraction module is provided to extract the feature with spatiotemporal dependencies from the interpolated information. Considering the imputation of missing values not only depends on the values of nearby time and similar time series, but also is affected by geographically surrounding sensors, we design the specialized spatiotemporal dependencies learning methods. The proposed method com- prehensively aggregates spatiotemporal global features and geographic information to fully exploit the explicit and implicit spatiotemporal relationships in different application scenarios. For the utilization of conditional information, we design a noise estimation module to mitigate the impact of the added noise on the spatiotemporal dependencies learning. The noise estimation module utilizes the extracted conditional feature, as the global context prior, to calculate the spatiotemporal attention weights, and predict the added Gaussian noise by spatiotemporal dependencies. PriSTI performs well in spa- tiotemporal data scenarios with spatial similarity and feature correlation. For three real-world datasets in the fields of air quality and traffic, our proposed method outperforms existing methods in various missing patterns. Moreover, PriSTI can support downstream tasks through imputation, and effectively handles the case of high missing rates and sensor failure. Our contributions are summarized as follows: • We propose PriSTI, a conditional diffusion framework for spatiotemporal imputation, which constructs and uti- lizes conditional information with spatiotemporal global correlations and geographic relationships. • To reduce the difficulty of learning spatiotemporal depen- dencies, we design a specialized noise prediction model that extracts conditional features from enhanced obser- vations, calculating the spatiotemporal attention weights using the extracted global context prior. • Our proposed method achieves the best performance on spatiotemporal data in various fields, and effectively handles application scenarios such as high missing rates and sensor failure. ...AObserved valuesInterpolated informationConditional FeatureExtractionX...Gaussian noiseImputed valuesGeographic information...Observed valuesX...Gaussian noiseImputed valuesAObserved valuesGeographic informationSpatiotemporal EncoderImputed valuesSpatial DecoderGRINCSDIPriSTI(Ours)Multivariate time series imputationConsider geographic informationSufferfromerroraccumulationproblemMultivariate time series imputationAlleviate error accumulationproblemNot consider geographic informationUse conditional information simplySpatiotemporal imputationAlleviate error accumulationproblemConsider geographic informationConstruct and utilize conditional informationStatistic methodsMEANKNNInterpolationClassic machine learningmethodsVARKalman FilterMICETRMFBATFDeep learningmethodsRNN-basedBRITSGRINGAN-basedrGAINVAE-basedV-RINGP-VAEDiffusion model-basedCSDIPriSTI(Ours).................. The rest of this paper is organized as follows. We first state the definition of the spatiotemporal imputation problem and briefly introduce the background of diffusion models in Section II. Then we introduce how the diffusion models are applied to spatiotemporal imputation, as well as the details of our proposed framework in Section III. Next, we evaluate the performance of our proposed method in various missing patterns in Section IV. Finally, we review the related work for spatiotemporal imputation in Section V and conclude our work in Section VI. II. PRELIMINARIES In this section, we introduce some key definitions in spa- tiotemporal imputation, state the problem definition and briefly introduce the diffusion probabilistic models. Spatiotemporal data. We formalize spatiotemporal data as a sequence X1:L = {X1, X2, * * * , XL} ∈ RN ×L over consecutive time, where Xl ∈ RN is the values observed at time l by N observation nodes, such as air monitoring stations and traffic sensors. Not all observation nodes have observed values at time l. We use a binary mask Ml ∈ {0, 1}N to rep- resent the observed mask at time l, where mi,j l = 1 represents the value is observed while mi,j l = 0 represents the value is missing. Since there is no ground truth for real missing data in practice, we manually select the imputation target (cid:101)X ∈ RN ×L from available observed data for training and evaluation, and identify them with the binary mask (cid:102)M ∈ RN ×L. Adjacency matrix. The observation nodes can be for- malized as a graph G = (cid:104)V, E(cid:105), where V is the node set and E is the edge set measuring the pre-defined spatial relationship between nodes, such as geographical distance. We denote A ∈ RN ×N to represent the geographic information as the adjacency matrix of the graph G. In this work, we only consider the setting of static graph, i.e., the geographic information A does not change over time. Problem statement. Given the incomplete observed spa- tiotemporal data X and geographical information A, our task of spatiotemporal imputation is to estimate the missing values or corresponding distributions in spatiotemporal data X1:L. Diffusion probabilistic models. Diffusion probabilistic models [16], [19] are deep generative models that have achieved cutting-edge results in the field of image synthesis [20], audio generation [21], etc., which generate samples consistent with the original data distribution by adding noise to the samples and learning the reverse denoising process. The diffusion probabilistic model can be formalized as two Markov chain processes of length T , named the diffusion process and the reverse process. Let (cid:101)X 0 ∼ pdata where pdata is the clean data distribution, and (cid:101)X t is the sampled latent variable sequence, where t = 1, * * * , T is the diffusion step. (cid:101)X T ∼ N (0, I) where N is Gaussian distribution. The diffusion process adds Gaussian noise gradually into (cid:101)X 0 until (cid:101)X 0 is close to (cid:101)X T , while the reverse process denoises (cid:101)X t to recover (cid:101)X 0. More details about applying the diffusion models on spatiotemporal imputation are introduced in Section III. TABLE I: Important notations and corresponding descriptions. Notations Descriptions X (cid:102)X N L, l T, t A X Spatiotemporal data Manually selected imputation target The number of the observation nodes Length of the observed time and observed time step Length of the diffusion steps and diffusion step Adjacency matrix of geographic information Interpolated conditional information βt, αt, ˆαt Constant hyperparameters of diffusion model (cid:15)θ Noise prediction model III. METHODOLOGY The pipeline of our proposed spatiotemporal imputation is shown in Figure 2. PriSTI adopts framework, PriSTI, a conditional diffusion framework to exploit spatiotemporal global correlation and geographic relationship for imputation. To address the challenge about the construction and utilization of conditional information when impute by diffusion model, we design a specialized noise prediction model to enhance and extract the conditional feature. In this section, we first introduce how the diffusion models are applied to spatiotem- poral imputation, and then introduce the detail architecture of the noise prediction model, which is the key to success of diffusion models. A. Diffusion Model for Spatiotemporal Imputation To apply the diffusion models on spatiotemporal imputa- tion, we regard the spatiotemporal imputation problem as a conditional generation task. The previous studies [18] have shown the ability of conditional diffusion probabilistic model for multivariate time series imputation. The spatiotemporal imputation task can be regarded as calculating the conditional probability distribution q( (cid:101)X 0 1:L|X1:L), where the imputation of (cid:101)X 0 1:L is conditioned by the observed values X1:L. How- the previous studies impute without considering the ever, spatial relationships, and simply utilize the observed values as conditional information. In this section, we explain how our proposed framework impute spatiotemporal data by the diffusion models. In the following discussion, we use the superscript t ∈ {0, 1, * * * , T } to represent the diffusion step, and omit the subscription 1 : L for conciseness. As mentioned in Section II, the diffusion probabilistic model includes the diffusion process and reverse process. The diffu- sion process for spatiotemporal imputation is irrelavant with conditional information, adding Gaussian noise into original data of the imputation part, which is formalized as: q( (cid:101)X 1:T | (cid:101)X 0) = T (cid:89) q( (cid:101)X t| (cid:101)X t−1), t=1 (1) q( (cid:101)X t| (cid:101)X t−1) = N ( (cid:101)X t; (cid:112)1 − βt (cid:101)X t−1, βtI), where βt is a small constant hyperparameter that controls the variance of the added noise. The (cid:101)X t is sampled by (cid:101)X t = √ 1 − ̄αt(cid:15), where αt = 1 − βt, ̄αt = (cid:81)t i=1 αi, and ̄αt (cid:101)X 0 + √ (cid:15) is the sampled standard Gaussian noise. When T is large enough, q( (cid:101)X T | (cid:101)X 0) is close to standard normal distribution . The reverse process for spatiotemporal imputation gradually convert random noise to missing values with spatiotemporal consistency based on conditional information. In this work, the reverse process is conditioned on the interpolated conditional information X that enhances the observed values, as well as the geographical information A. The reverse process can be formalized as: pθ( (cid:101)X 0:T −1| (cid:101)X T , X , A) = T (cid:89) pθ( (cid:101)X t−1| (cid:101)X t, X , A), (2) t=1 pθ( (cid:101)X t−1| (cid:101)X t, X , A) = N ( (cid:101)X t−1; μθ( (cid:101)X t, X , A, t), σ2 Ho et al. [16] introduce an effective parameterization of μθ t I). and σ2 t . In this work, they can be defined as: (cid:18) μθ( (cid:101)X t, X , A, t) = 1 √ ̄αt (cid:101)X t − βt√ 1 − ̄αt (cid:15)θ( (cid:101)X t, X , A, t) (cid:19) , σ2 t = 1 − ̄αt−1 1 − ̄αt βt, (3) where (cid:15)θ is a neural network parameterized by θ, which takes the noisy sample (cid:101)X t and conditional information X and adjacency matrix A as input, predicting the added noise (cid:15) on imputation target to restore the original information of the noisy sample. Therefore, (cid:15)θ is often named noise prediction model. The noise prediction model does not limit the network architecture, whose flexibility is benificial for us to design the model suitable for spatiotemporal imputation. Training Process. During training, we mask the input ob- served value X through a random mask strategy to obtain the imputation target (cid:101)X t, and the remaining observations are used to serve as the conditional information for imputation. Similar to CSDI [18], we provide the mask strategies including point strategy, block strategy and hybrid strategy (see more details in Section IV-D). Mask strategies produce different masks for each training sample. After obtaining the training imputation target (cid:101)X 0 and the interpolated conditional information X , the training objective of spatiotemporal imputation is: L(θ) = E (cid:101)X 0∼q( (cid:101)X 0),(cid:15)∼N (0,I) (cid:13) (cid:13) 2 (cid:13)(cid:15) − (cid:15)θ( (cid:101)X t, X , A, t) (cid:13) (cid:13) (cid:13) . (4) Therefore, in each iteration of the training process, we sample the Gaussian noise (cid:15), the imputation target (cid:101)X t and the diffusion step t, and obtain the interpolated conditional information X based on the remaining observations. More details on the training process of our proposed framework is shown in Algorithm 1. Imputation Process. When using the trained noise predic- tion model (cid:15)θ for imputation, the observed mask (cid:102)M of the data is available, so the imputation target (cid:101)X is the all missing values in the spatiotemporal data, and the interpolated conditional information X is constructed based on all observed values. The model receives (cid:101)X T and X as inputs and generates samples of the imputation results through the process in Equation (2). The more details on the imputation process of our proposed framework is shown in Algorithm 2. Fig. 2: The pipeline of PriSTI. PriSTI takes observed val- ues and geographic information as input. It first interpolates observations and models the global context prior by the conditional feature extraction module, and then utilizes the noise estimation module to predict noise with help of the conditional information. Algorithm 1 Training process of PriSTI. Input:Incomplete observed data X, the adjacency matrix A, the number of iteration Nit, the number of diffusion steps T , noise levels sequence ̄αt. Output:Optimized noise prediction model (cid:15)θ. 1: for i = 1 to Nit do (cid:101)X 0 ← Mask(X); 2: X ← Interpolate( (cid:101)X 0); Sample t ∼ Uniform({1, * * * , T }), (cid:15) ∼ N (0, I); (cid:101)X t ← ̄αt (cid:101)X 0 + 1 − ̄αt(cid:15); (cid:13) (cid:13) (cid:13)(cid:15) − (cid:15)θ( (cid:101)X t, X , A, t) Updating the gradient ∇θ (cid:13) 2 (cid:13) (cid:13) 3: 4: √ √ 6: 5: . Through the above framework, the diffusion model can be applied to spatiotemporal imputation with the conditional information. However, the construction and utilization of conditional information with spatiotemporal dependencies are still challenging. It is necessary to design a specialized noise prediction model (cid:15)θ to reduce the difficulty of learning spa- tiotemporal dependencies with noisy information, which will be introduced in next section. B. Design of Noise Prediction Model In this section, we illustrate how to design the noise pre- diction model (cid:15)θ for spatiotemporal imputation. Specifically, we first interpolate the observed value to obtain the enhanced coarse conditional information. Then, a conditional feature extraction module is designed to model the spatiotemporal X1:LLinear InterpolationAttention weightsConditional FeatureExtractionModule෨X1:LANumericalInformationConditionalFeatureTemporal AttentionSpatial Attentionwith MPNNGated activationHpriHinDiffusion time embeddingtAdditionMaskOutputNoise sampling1x1 ConvolutionConcatenationInput to next layerHtemHspaNoise Estimation Module Algorithm 2 Imputation process with PriSTI. Input:A sample of incomplete observed data X, the adja- cency matrix A, the number of diffusion steps T , the optimized noise prediction model (cid:15)θ. Output:Missing values of the imputation target (cid:101)X 0. 1: X ← Interpolate(X); 2: Set (cid:101)X T ∼ N (0, I); 3: for t = T to 1 do 4: (cid:15)θ( (cid:101)X t, X , A, t) μθ( (cid:101)X t, X , A, t) ← 1√ ̄αt (cid:101)X t−1 ← N (μθ( (cid:101)X t, X , A, t), σ2 (cid:101)X t − βt√ t I) 1− ̄αt (cid:16) 5: (cid:17) Fig. 3: The architecture of the conditional feature extraction module (left) and noise estimation module (right). Both mod- ules utilize the same components, including a temporal atten- tion Attntem, a spatial attention Attnspa and a message passing neural network MPNN. The conditional feature extraction module extract spatiotemporal dependencies from interpolated conditional information in a wide network architecture, while the noise estimation module learning spatiotemporal depen- dencies in a deep network architecture. correlation from the coarse interpolation information. The output of the conditional feature extraction module is utilized in the designed noise estimation module to calculate the attention weights, which provides a better global context prior for spatiotemporal dependencies learning. 1) Conditional Feature Extraction Module: The conditional feature extraction module is dedicated to model conditional is applied to spa- information when the diffusion model tiotemporal imputation. According to the diffusion model for imputation described above, (cid:15)θ takes the conditional in- formation X and the noisy information (cid:101)X t as input. The previous studies, such as CSDI [18], regards the observed values as conditional information, and takes the concatenation of conditional information and perturbed values as the input, which are distinguished only by a binary mask. However, the trend of the time series in imputation target are unstable due to the randomness of the perturbed values, which may cause the noisy sample to have an inconsistent trend with the original 1:L in Figure 2), especially when the diffusion step t is close to T . Although CSDI utilizes two different Transformer layers to capture the temporal and feature dependencies, the mixture of conditional and noisy information increases the learning difficulty of the time series (such as the (cid:101)X t noise prediction model, which can not be solved by a simple binary mask identifier. To address the above problem, we first enhance the ob- vserved values for the conditional feature extraction, expecting the designed model to learn the spatiotemporal dependencies based on this enhanced information. In particular, inspired by some spatiotemporal forecasting works based on temporal continuity [22], we apply linear interpolation to the time series of each node to initially construct a coarse yet ef- fective interpolated conditional information X for denoising. Intuitively, this interpolation does not introduce randomness to the time series, while also retaining a certain spatiotemporal consistency. From the test results of linear interpolation on the air quality and traffic speed datasets (see Table III), the spa- tiotemporal information completed by the linear interpolation method is available enough for a coarse conditional informa- tion. Moreover, the fast computation of linear interpolation satisfies the training requirements of real-time construction under random mask strategies in our framework. Although linear interpolation solves the completeness of observed information simply and efficiently, it only simply describes the linear uniform change in time, without model- ing temporal nonlinear relationship and spatial correlations. Therefore, we design a learnable module γ(*) to model a conditional feature H pri with spatiotemporal information as a global context prior, named Conditional Feature Extraction Module. The module γ(*) takes the interpolated conditional information X and adjacency matrix A as input, extract the spatiotemporal dependencies from X and output H pri as the global context for the calculation of spatiotemporal attention weights in noise prediction. In particular, the conditional feature H pri ∈ RN ×L×d is obtained by H pri = γ(H, A), where H = Conv(X ) and Conv(*) is 1 × 1 convolution, H ∈ RN ×L×d, and d is the channel size. The conditional feature extraction module γ(*) comprehensively combines the spatiotemporal global corre- lations and geographic dependency, as shown in the left of Figure 3, which is formalized as: H pri = γ(H, A) = MLP(φSA(H) + φTA(H) + φMP(H, A)), φSA(H) = Norm(Attnspa(H) + H), φTA(H) = Norm(Attntem(H) + H), φMP(H, A) = Norm(MPNN(H, A) + H), (5) where Attn(*) represents the global attention, and the sub- scripts spa and tem represent spatial attention and tem- poral attention respectively. We use the dot-product multi- head self-attention in Transformer [23] to implement Attn(*). And MPNN(*) represents the spatial message passing neural network, which can be implemented by any graph neural network. We adopt the graph convolution module from Graph Wavenet [4], whose adjacency matrix includes a bidirectional distance-based matrix and an adaptively learnable matrix. The extracted conditional feature H pri solves the problem of constructing conditional information. It does not contain the added Gaussian noise, and includes temporal dependen- cies, spatial global correlations and geographic dependencies compared with observed values. To address the remaining challenge of utilizing conditional information, H pri serves as a coarse prior to guide the learning of spatiotemporal dependencies, which is introduced in the next section. 2) Noise Estimation Module: The noise estimation module is dedicated to the utilization of conditional information when the diffusion model is applied to spatiotemporal imputation. Since the information in noisy sample may have a wide deviation from the real spatiotemporal distribution because of the randomness of the Gaussian noise, it is difficult to learn spatiotemporal dependencies directly from the mixture of con- ditional and noisy information. Our proposed noise estimation module captures spatiotemporal global correlations and geo- graphical relationships by a specialized attention mechanism, which reduce the difficulty of spatiotemporal dependencies learning caused by the sampled noise. Specifically, the inputs of the noise estimation module include two parts: the noisy information H in = Conv(X || (cid:101)X t) that consists of interpolation information X and noise sample (cid:101)X t, and the prior information including the conditional feature H pri and adjacency matrix A. To comprehensively consider the spatiotemporal global correlation and geographic relation- ship of the missing data, the temporal features H tem are first learned through a temporal dependency learning module γT (*), and then the temporal features are aggregated through a spatial dependency learning module γS (*). The architecture of the noise estimation module is shown as the right of Figure 3, which is formalized as follows: H tem = γT (H in) = Attntem(H in), H spa = γS (H tem, A) = MLP(φSA(H tem) + φMP(H tem, A)), (6) where Attntem(*), φSA(*) and φMP(*) are same as the compo- nents in Equation (5), which are used to capture spatiotemporal global attention and geographic similarity, and H tem, H spa ∈ RN ×L×d are the outputs of temporal and spatial dependencies learning modules. However, in Eq. (6), spatiotemporal dependencies learning is performed on the mixture of conditional noisy information, i.e. H in. When the diffusion step t approaches T , noise sample (cid:101)X t would increase the difficulty of spatiotemporal dependen- cies learning. To reduce the impact of (cid:101)X t while convert it into Gaussian noise, we change the input of the attention components Attntem(*) and Attnspa(*), which calculate the attention weights by using the conditional feature H pri. In particular, take temporal attention Attntem(*) as an example, we rewrite the dot-product attention Attntem(QT , KT , VT ) = softmax( QT KT ) * VT as Attntem(AT , VT ) = AT * VT , where T√ d AT = softmax( QT KT ) is the attention weight. We calculate the attention weight AT by the conditional feature H pri, i.e., we set the input QT , KT and VT as: QT = H pri * W Q T , KT = H pri * W K T , (7) where W Q T ∈ Rd×d are learnable projection pa- rameters. The spatial attention Attnspa(AS , VS ) calculates the T , VT = H in * W V T , W K T , W V T√ d attention weight in the same way: QS = H pri * W Q S , KS = H pri * W K S , VS = H tem * W V S . (8) The noise estimation module consists of Equation (6) - (8), which has the same attention and MPNN components as the conditional feature extraction module with different input and architecture. The conditional feature extraction module models spatiotemporal dependencies only from the interpolated conditional information X in a single layer, so it extracts information through a wide network architecture, i.e., directly aggregates the spatiotemporal global correlation and geographic dependency. Since the noise estimation module needs to convert the noisy sample to standard Gaussian distri- bution in multiple layers, it learns spatiotemporal dependencies from the noisy samples with help of the conditional feature through a deep network architecture, i.e., extracts the temporal correlation first and aggregates the temporal feature through the spatial global correlation and geographic information. In addition, when the number of nodes in the spatiotemporal data is large, the computational cost of spatial global attention is high, and the time complexity of its similarity calculation and weighted summation are both O(N 2d). Therefore, we map N nodes to k virtual nodes, where k < N . We rewrite the KS and VS in Equation (8) when attention is used for spatial dependencies learning as: S W K KS = H pri * P K S , P V S , VS = H tem * P V (9) S ∈ RN ×d is the downsampling parameters. And where P K the time complexity of the modified spatial attention is reduced to O(N kd). S W V S , 3) Auxiliary Information and Output: We add auxiliary information U = MLP(Utem, Uspa) to both the conditional feature extraction module and the noise estimation module to help the imputation, where Utem is the sine-cosine temporal encoding [23], and Uspa is learnable node embedding. We expand and concatenate Utem ∈ RL×128 and Uspa ∈ RN ×16, and obtain auxiliary information U ∈ RN ×L×d that can be input to the model through an MLP layer. The noise estimation module stacks multiple layers, and the output H spa of each layer is divided into residual connection and skip connection after a gated activation unit. The residual connection is used as the input of the next layer, and the skip connections of each layer are added and through two layers of 1 × 1 convolution to obtain the output of the noise prediction model (cid:15)θ. The output only retains the value of imputation target, and the loss is calculated by Equation (4). IV. EXPERIMENTS In this section, we first introduce the dataset, baselines, evaluation metrics and settings of our experiment. Then, we evaluate our proposed framework PriSTI with a large amount of experiments for spatiotemporal imputation to answer the following research questions: • RQ1: Can PriSTI provide superior imputation perfor- mance in various missing patterns compared to several state-of-the-art baselines? • RQ2: How is the imputation performance for PriSTI for different missing rate of spatiotemporal data? • RQ3: Does PriSTI benefit from the construction and utilization of the conditional information? • RQ4: Does PriSTI extract the temporal and spatial de- pendencies from the observed spatiotemporal data? • RQ5: Can PriSTI impute the time series for the unob- served sensors only based on the geographic location? A. Dataset We conduct experiments on three real-world datasets: an air quality dataset AQI-36, and two traffic speed datasets METR- LA and PEMS-BAY. AQI-36 [2] contains hourly sampled PM2.5 observations from 36 stations in Beijing, covering a total of 12 months. METR-LA [3] contains traffic speed collected by 207 sensors in the highway of Los Angeles County [24] in 4 months, and PEMS-BAY [3] contains traffic speed collected by 325 sensors on highways in the San Francisco Bay Area in 6 months. Both traffic datasets are sampled every 5 minutes. For the geographic information, the adjacency matrix is obtained based on the geographic distances between monitoring stations or sensors followed the previous works [3]. We build the adjacency matrix for the three datasets using thresholded Gaussian kernel [25]. B. Baselines To evaluate the performance of our proposed method, we compare with classic models and state-of-the-art methods for spatiotemporal imputation. The baselines include statis- tic methods (MEAN, DA, KNN, Lin-ITP), classic machine learning methods (MICE, VAR, Kalman), low-rank matrix factorization methods (TRMF, BATF), deep autoregressive methods (BRITS, GRIN) and deep generative methods (V- RIN, GP-VAE, rGAIN, CSDI). We briefly introduce the base- line methods as follows: (1)MEAN: directly use the historical average value of each node to impute. (2)DA: impute missing values with the daily average of corresponding time steps. (3)KNN: calculate the average value of nearby nodes based on geographic distance to impute. (4)Lin-ITP: linear interpolation of the time series for each node, as implemented by torchcde1. (5)KF: use Kalman Filter to impute the time series for each node, as implemented by filterpy2. (6)MICE [26]: multiple imputation method by chain equations; (7)VAR: vector autoregressive single-step predictor. (8)TRMF [27]: a temporal regularized matrix factor- ization method. (9)BATF [28]: a Bayesian augmented tensor factorization model, which incorporates the generic forms of spatiotemporal domain knowledge. We implement TRMF and BATF using the code in the Transdim3 repository. The rank is set to 10, 40 and 50 on AQI-36, METR-LA and PEMS- BAY, respectively. (10)V-RIN [29]: a method to improve deterministic imputation using the quantified uncertainty of is provided by VAE, whose probability imputation result 1https://github.com/patrick-kidger/torchcde 2https://github.com/rlabbe/filterpy 3https://github.com/xinychen/transdim the quantified uncertainty. (11)GP-VAE [30]: a method for time series probabilistic imputation by combining VAE with Gaussian process. (12)rGAIN: GAIN [14] with a bidirectional recurrent encoder-decoder, which is a GAN-based method. (13)BRITS [1]: a multivariate time series imputation method based on bidirectional RNN. (14)GRIN [7]: a bidirectional GRU based method with graph neural network for multivariate time series imputation. (15)CSDI [18]: a probability imputa- tion method based on conditional diffusion probability model, which treats different nodes as multiple features of the time series, and using Transformer to capture feature dependencies. In the experiment, the baselines MEAN, KNN, MICE, VAR, rGAIN, BRITS and GRIN are implemented by the code4 provided by the authors of GRIN [7]. We reproduced these baselines, and the results are consistent with their claims, so we retained the results claimed in GRIN for the above base- lines. The implementation details of the remaining baselines have been introduced as above. C. Evaluation metrics We apply three evaluation metrics to measure the perfor- mance of spatiotemporal imputation: Mean Absolute Error (MAE), Mean Squared Error (MSE) and Continuous Ranked Probability Score (CRPS) [31]. MAE and MSE reflect the absolute error between the imputation values and the ground truth, and CRPS evaluates the compatibility of the estimated probability distribution with the observed value. We introduce the calculation details of CRPS as follows. For a missing value x whose estimated probability distribution is D, CRPS measures the compatibility of D and x, which can be defined as the integral of the quantile loss Λα: CRPS(D−1, x) = (cid:90) 1 0 2Λα(D−1(α), x)dα, Λα(D−1(α), x) = (α − Ix<D−1(α))(x − D−1(α)), (10) where α ∈ [0, 1] is the quantile levels, D−1(α) is the α- quantile of distribution D, I is the indicator function. Since our distribution of missing values is approximated by gener- ating 100 samples, we compute quantile losses for discretized quantile levels with 0.05 ticks following [18] as: CRPS(D−1, x) (cid:39) 19 (cid:88) i=1 2Λi×0.05(D−1(i × 0.05), x)/19. (11) We compute CRPS for each estimated missing value and use the average as the evaluation metric, which is formalized as: CRPS(D, (cid:101)X) = (cid:80) ̃x∈ (cid:101)X CRPS(D−1, ̃x) | (cid:101)X| . (12) D. Experimental settings Dataset. We divide training/validation/test set following the settings of previous work [2], [7]. For AQI-36, we select Mar., Jun., Sep., and Dec. as the test set, the last 10% of the data in Feb., May, Aug., and Nov. as the validation set, 4https://github.com/Graph-Machine-Learning-Group/grin and the remaining data as the training set. For METR-LA and PEMS-BAY, we split the training/validation/test set by 70%/10%/20%. Imputation target. For air quality dataset AQI-36, we adapt the same evaluation strategy as the previous work provided by [2], which simulates the distribution of real missing data. For the traffic datasets METR-LA and PEMS-BAY, we use the artificially injected missing strategy provided by [7] for evaluation, as shown in Figure 4, which includes two missing patterns: (1) Block missing: based on randomly masking 5% of the observed data, mask observations ranging from 1 to 4 hours for each sensor with 0.15% probability; (2) Point missing: randomly mask 25% of observations. The missing rate of each dataset under different missing patterns has been marked in Table III. It is worth noting that in addition to the manually injected faults, each dataset also has original missing data (13.24% in AQI-36, 8.10% in METR-LA and 0.02% in PEMS-BAY). All evaluations are performed only on the manually masked parts of the test set. Fig. 4: The illustration of some missing patterns. Training strategies. As mentioned in Section III-A, on the premise of known missing patterns in test data, we provide three mask strategies. The details of these mask strategies are described as follows: • Point strategy: take a random value m between [0, 100], randomly select m% of the data from X as the imputation target (cid:101)X, and the remaining unselected data is regarded as observed values in training process. • Block strategy: For each node, a sequence with a length in the range [L/2, L] is selected as the imputation target with a probability from 0 to 15%. In addition, 5% of the observed values are randomly selected and added to the imputation target. • Hybrid strategy: For each training sample X, it has a 50% probability to be masked by the point strategy, and the other 50% probability to be masked by the block strategy or a historical missing pattern i.e., the missing patterns of other samples in the training set. We utilize different mask strategies for various missing patterns and datasets to make the model simulate the corre- sponding missing patterns as much as possible during training. Since AQI-36 has much original missing in the training set, which is fewer in traffic datasets, during the training process of PriSTI, we adopt hybrid strategy with historical missing pattern on AQI-36, hybrid strategy with block strategy on block-missing of traffic datasets, and point strategy on point- missing of traffic datasets. TABLE II: The hyperparameters of PriSTI for all datasets. Description AQI-36 METR-LA PEMS-BAY Batch size Time length L Epochs Learning rate Layers of noise estimation Channel size d Number of attention heads Minimum noise level β1 Maximum noise level βT Diffusion steps T Number of virtual nodes k 16 36 200 0.001 4 64 8 0.0001 0.2 100 16 16 24 300 0.001 4 64 8 0.0001 0.2 50 64 16 24 300 0.001 4 64 8 0.0001 0.2 50 64 Hyperparameters of PriSTI. For the hyperparameters of PriSTI, the batch size is 16. The learning rate is decayed to 0.0001 at 75% of the total epochs, and decayed to 0.00001 at 90% of the total epochs. The hyperparameter for diffusion model include a minimum noise level β1 and a maximum noise level βT . We adopted the quadratic schedule for other noise levels following [18], which is formalized as: βt = (cid:18) T − t T − 1 (cid:112)β1 + t − 1 T − 1 (cid:112)βT (cid:19)2 . (13) The diffusion time embedding and temporal encoding are implemented by the sine and cosine embeddings followed previous works [18], [21]. We summary the hyperparameters of PriSTI in Table II. All the experiments are run for 5 times. E. Results 1) Overall Performance (RQ1): We first evaluate the spa- tiotemporal imputation performance of PriSTI compared with other baselines. Since not all methods can provide the proba- bility distribution of missing values, i.e. evaluated by the CRPS metric, we show the deterministic imputation result evaluated by MAE and MSE in Table III, and select V-RIN, GP-VAE, CSDI and PriSTI to be evaluated by CRPS, which is shown in Table IV. The probability distribution of missing values of these four methods are simulated by generating 100 samples, while their deterministic imputation result is the median of all generated samples. Since CRPS fluctuates less across 5 times experiments (the standard error is less than 0.001 for CSDI and PriSTI), we only show the mean of 5 times experiments in Table IV. It can be seen from Table III and Table IV that our pro- posed method outperforms other baselines on various missing patterns in different datasets. We summarize our findings as follows: (1) The statistic methods and classic machine learning methods performs poor on all the datasets. These methods impute missing values based on assumptions such as stability or seasonality of time series, which can not cover the complex temporal and spatial correlations in real-world datasets. The matrix factorization methods also perform not well due to the low-rank assumption of data. (2) Among deep learning methods, GRIN, as an autoregressive state-of- the-art multivariate time series imputation method, performs TABLE III: The results of MAE and MSE for spatiotemporal imputation. AQI-36 METR-LA PEMS-BAY Method Simulated failure (24.6%) Block-missing (16.6%) Point-missing (31.1%) Block-missing (9.2%) Point-missing (25.0%) MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE Mean DA KNN 30.21±0.00 2892.31±0.00 673.92±0.00 53.48±0.00 4578.08±0.00 7.48±0.00 139.54±0.00 7.56±0.00 142.22±0.00 5.46±0.00 87.56±0.00 5.42±0.00 86.59±0.00 50.51±0.00 4416.10±0.00 14.53±0.00 445.08±0.00 14.57±0.00 448.66±0.00 3.30±0.00 43.76±0.00 3.35±0.00 44.50±0.00 7.79±0.00 124.61±0.00 7.88±0.00 129.29±0.00 4.30±0.00 49.90±0.00 4.30±0.00 49.80±0.00 14.75±0.00 1.54±0.00 14.14±0.00 0.76±0.00 1.74±0.00 3.26±0.00 Lin-ITP 14.46±0.00 33.76±0.00 2.43±0.00 KF MICE VAR TRMF BATF 54.09±0.00 4942.26±0.00 16.75±0.00 534.69±0.00 16.66±0.00 529.96±0.00 5.64±0.00 93.19±0.00 5.68±0.00 93.32±0.00 55.07±1.46 2.94±0.02 28.28±0.37 3.09±0.02 31.43±0.41 4.22±0.05 30.37±0.09 2594.06±7.17 21.10±0.02 2.09±0.10 16.06±0.73 1.30±0.00 6.52±0.01 15.64±0.08 833.46±13.85 3.11±0.08 20.39±0.02 1.95±0.01 11.21±0.06 1.85±0.00 10.03±0.00 15.46±0.06 1379.05±34.83 2.96±0.00 36.05±0.02 2.05±0.00 14.48±0.01 2.05±0.00 14.90±0.06 3.56±0.01 15.21±0.27 662.87±29.55 51.07±1.25 28.00±0.76 22.65±0.13 35.39±0.03 4.42±0.07 2.69±0.00 2.86±0.00 3.58±0.01 V-RIN 10.00±0.10 838.05±24.74 49.98±1.30 2.49±0.04 36.12±0.66 1.21±0.03 6.08±0.29 GP-VAE 25.71±0.30 2589.53±59.14 6.55±0.09 122.33±2.05 6.57±0.10 127.26±3.97 2.86±0.15 26.80±2.10 3.41±0.23 38.95±4.16 20.03±0.09 2.18±0.01 13.96±0.20 1.88±0.02 10.37±0.20 rGAIN 15.37±0.26 641.92±33.89 16.46±0.05 1.70±0.01 10.50±0.07 1.47±0.00 7.94±0.03 BRITS 14.50±0.35 622.36±65.16 10.41±0.03 1.14±0.01 6.60±0.10 0.67±0.00 1.55±0.01 GRIN 12.08±0.47 523.14±57.17 0.86±0.00 4.39±0.02 0.57±0.00 1.12±0.03 8.96±0.08 352.46±7.50 CSDI 21.67±0.15 17.00±0.14 13.26±0.05 12.62±0.60 2.90±0.01 2.34±0.01 2.03±0.00 1.98±0.00 2.83±0.01 2.34±0.00 1.91±0.00 1.79±0.00 6.84±0.17 150.08±6.13 3.96±0.08 9.51±0.10 PriSTI 9.03±0.07 310.39±7.03 1.86±0.00 10.70±0.02 1.72±0.00 8.24±0.05 0.78±0.00 3.31±0.01 0.55±0.00 1.03±0.00 TABLE IV: The results of CRPS for spatiotemporal imputa- tion. Method AQI-36 METR-LA PEMS-BAY SF Block Point Block Point V-RIN GP-VAE CSDI 0.3154 0.3377 0.1056 0.1283 0.1118 0.0260 0.0781 0.0977 0.0235 0.0394 0.0436 0.0127 0.0191 0.0568 0.0067 PriSTI 0.0997 0.0244 0.0227 0.0093 0.0064 TABLE V: The prediction on AQI-36 after imputation. Metric Ori. BRITS GRIN CSDI PriSTI MAE RMSE 36.97 60.37 34.61 56.66 33.77 54.06 30.20 46.98 29.34 45.08 better than other RNN-based methods (rGAIN and BRITS) due to the extraction of spatial correlations. However, the performance of GRIN still has a gap compared to the diffusion model-based methods (CSDI), which may be caused by the inherent defect of error accumulation in autoregressive models. (3) For deep generative models, the VAE-based methods (V- RIN and GP-VAE) can not outperform CSDI and PriSTI. Our proposed method PriSTI outperforms CSDI in various missing patterns of every datasets, which indicates that our design of conditional information construction and spatiotemporal correlation can improve the performance of diffusion model for imputation task. In addition, for the traffic datasets, we find that our method has a more obvious improvement than CSDI in the block-missing pattern compared with point-missing, which indicates that the interpolated information may provide more effective conditional information than observed values especially when the missing is continuous at time. In addition, we select the methods of the top 4 performance rankings (i.e., the average ranking of MAE and MSE) in Table III (PriSTI, CSDI, GRIN and BRITS) to impute all the data in AQI-36, and then use the classic spatiotemporal forecasting method Graph Wavenet [4] to make predictions on the imputed dataset. We divide the imputed dataset into training, valid and test sets as 70%/10%/20%, and use the data of the past 12 time steps to predict the next 12 time steps. We use the MAE and RMSE (the square root of MSE) for evaluation. The prediction results is shown in Table V. Ori. represents the raw data without imputation. The results in Table V indicate that the prediction performance is affected by the data integrity, and the prediction performance on the data imputed by different methods also conforms to the imputation performance of these methods in Table III. This demonstrates that our method can also help the downstream tasks after imputation. 2) Sensitivity analysis (RQ2): It is obvious that the per- imputation is greatly affected by the formance of model distribution and quantity of observed data. For spatiotemporal imputation, sparse and continuously missing data is not con- ducive to the model learning the spatiotemporal correlation. To test the imputation performance of PriSTI when the data is extremely sparse, we evaluate the imputation ability of PriSTI in the case of 10%-90% missing rate compared with the three baselines with the best imputation performance (BRITS, GRIN and CSDI). We evaluate in the block-missing and point- missing patterns of METR-LA, respectively. To simulate the sparser data in different missing patterns, for the block missing pattern, we increase the probability of consecutive missing whose lengths in the range [12, 48]; for the point missing pattern, we randomly drop the observed values according to the missing rate. We train one model for each method, and use the trained model to test with different missing rates for different missing patterns. For BRITS and GRIN, their models are trained on data that is randomly masked by 50% with the corresponding missing pattern. For CSDI and PriSTI, their models are trained with the mask strategies consistent with (a) MAE on METR-LA(Block) (b) MAE on METR-LA(Point) Fig. 5: The imputation results of different missing rates. the original experimental settings. The MAE of each method under different missing rates are shown in Figure 5. When the missing rate of METR- LA reaches 90%, PriSTI improves the MAE performance of other methods by 4.67%-34.11% in block-missing pattern and 3.89%-43.99% in point-missing pattern. The result indicates that our method still has better imputation performance than other baselines at high missing rate, and has a greater improve- ment than other methods when data is sparser. We believe that this is due to the interpolated conditional information we construct retains the spatiotemporal dependencies that are more in line with the real distribution than the added Gaussian noise as much as possible when the data is highly sparse. 3) Ablation study (RQ3 and RQ4): We design the ablation study to evaluate the effectiveness of the conditional feature extraction module and noise estimation module. We compare our method with the following variants: • mix-STI: the input of noise estimation module is the concatenation of the observed values X and sampled noise (cid:101)X T , and the interpolated conditional information X and conditional feature extraction module are not used. • w/o CF: remove conditional features in Equation (7) and (8), i.e., the conditional feature extraction module is not used, and all the Q, K, and V are the concatenation of interpolated conditional information X and sampled noise (cid:101)X T when calculating the attention weights. • w/o spa: remove the spatial dependencies learning module γS in Equation (6). • w/o tem: remove the temporal dependencies learning module γT in Equation (6). • w/o MPNN: remove the component of message passing neural network φMP in the spatial dependencies learning module γS . • w/o Attn: remove the component of spatial global atten- tion φSA in the spatial dependencies learning γS . The variants mix-STI and w/o CF are used to evaluate the effectiveness of the construction and utilization of the conditional information, where w/o CF utilizes the interpolated information X while mix-STI does not. The remaining variants are used to evaluate the spatiotemporal dependencies learning of PriSTI. w/o spa and w/o tem are used to prove the necessity of learning temporal and spatial dependencies in spatiotemporal imputation, and w/o MPNN and w/o Attn are used to evaluate the effectiveness of spatial global correlation and geographic dependency. Since the spatiotemporal depen- TABLE VI: Ablation studies. Method mix-STI w/o CF w/o spa w/o tem w/o MPNN w/o Attn AQI-36 METR-LA Simulated failure Block-missing Point-missing 9.83±0.04 9.28±0.05 10.07±0.04 10.95±0.08 9.10±0.10 9.15±0.08 1.93±0.00 1.95±0.00 3.51±0.01 2.43±0.00 1.92±0.00 1.91±0.00 1.74±0.00 1.75±0.00 2.23±0.00 1.92±0.00 1.75±0.00 1.74±0.00 PriSTI 9.03±0.07 1.86±0.00 1.72±0.00 dencies and missing patterns of the two traffic datasets are similar, we perform ablation study on datasets AQI-36 and METR-LA, and their MAE results are shown in Table VI, from which we have the following observations: (1) According to the results of mix-STI, the enhanced conditional informa- tion and the extraction of conditional feature is effective for spatiotemporal imputation. We believe that the interpolated conditional information is effective for the continuous missing, such as the simulated failure in AQI-36 and the block-missing in traffic datasets. And the results of w/o CF indicate that the construction and utilization of conditional feature improve the imputation performance for diffusion model, which can demonstrate that the conditional feature extraction module and the attention weight calculation in the noise estimation module is beneficial for the spatiotemporal imputation of PriSTI, since they model the spatiotemporal global correlation with the less noisy information. 2) The results of w/o spa and w/o tem indicate that both temporal and spatial dependencies are necessary for the imputation. This demonstrate that our proposed noise estimation module captures the spatiotemporal dependencies based on the conditional feature, which will also be validated qualitatively in Section IV-E4. 3) From the results of w/o MPNN and w/o Attn, the components of the spatial global attention and message passing neural network have similar effects on imputation results, but using only one of them is not as effective as using both, which indicates that spatial global correlation and geographic information are both necessary for the spatial dependencies. Whether the lack of geographic information as input or the lack of captured implicit spatial correlations, the imputation performance of the model would be affected. We believe that the combination of explicit spatial relationships and implicit spatial correlations can extract useful spatial dependencies in real-world datasets. 4) Case study (RQ4): We plot the imputation result at the same time of some nodes in AQI-36 and the block-missing pat- tern of METR-LA to qualitatively analyze the spatiotemporal imputation performance of our method, as shown in Figure 6. Each of the subfigure represents a sensor, the black cross represents the observed value, and the dots of other colors represent the ground truth of the part to be imputed. The green area is the part between the 0.05 and 0.95 quantiles of the estimated probability distribution, and the green solid line is the median, that is, the deterministic imputation result. We select 5 sensors in AQI-36 and METR-LA respectively, 10%30%50%70%90%Missing rate2.02.53.03.54.04.5MAEBRITSGRINCSDIPriSTI10%30%50%70%90%Missing rate2.02.53.03.54.0MAEBRITSGRINCSDIPriSTI (a) AQI-36 (b) METR-LA (Block) Fig. 6: The visualization of the probabilistic imputation in AQI-36 and block-missing pattern of METR-LA. Each subfig- ure represents a sensor, and the time windows of all sensors are aligned. The black crosses represent observations, and dots of various colors represent the ground truth of missing values. The solid green line is the deterministic imputation result, and the green shadow represents the quantile between 0.05 to 0.95. and display their geographic location on the map. Taking METR-LA as the example, it can be observed from Figure 6 that sensor 188 and 194 have almost no missing values in the current time window, while their surrounding sensors have continuous missing values, and sensor 192 even has no observed values, which means its temporal information is totally unavailable. However, the distribution of our generated samples still covers most observations, and the imputation results conform to the time trend of different nodes. This indicates that on the one hand, our method can capture the temporal dependencies by the given observations for imputa- tion, and on the other hand, when the given observations are limited, our method can utilize spatial dependencies to impute according to the geographical proximity or nodes with similar temporal pattern. For example, for the traffic system, the time series corresponding to sensors with close geographical distance are more likely to have similar trends. 5) Imputation for sensor failure (RQ5): We impute the spatiotemporal data in a more extreme case: some sensors fail completely, i.e., they cannot provide any observations. The available information is only their location, so we can only impute by the observations from other sensors. This task is often studied in the research related to Kriging [32], which requires the model to reconstruct a time series for a given location based on geographic location and observations from other sensors. We perform the experiment of sensor failure on AQI-36. According to [7], we select the air quality monitoring station with the highest (station 14) and lowest (station 31) connectiv- ity. Based on the original experimental settings unchanged, all observations of these two nodes are masked during the training process. The results of the imputation for unobserved sensors are shown in Figure 7, where the orange dotted line is the Fig. 7: The imputation for unobserved sensors in AQI-36. The orange dotted line represents the ground truth, the green solid line represents the deterministic imputation result, and the green shadow represents the quantile between 0.05 to 0.95. ground truth, the green solid line is the median of the generated samples, and the green shadow is the quantiles between 0.05 and 0.95. We use MAE to quantitatively evaluate the results, the MAE of station 14 is 10.23, and the MAE of station 31 is 15.20. Since among all baselines only GRIN can impute by geographic information, the MAE compared to the same experiments in GRIN is also shown in Figure 7, and PriSTI has a better imputation performance on the unobserved nodes. This demonstrates the effectiveness of PriSTI in exploiting spatial relationship for imputation. Assuming that the detected spatiotemporal data are sufficiently dependent on spatial ge- ographic location, our proposed method may be capable of reconstructing the time series for a given location within the study area, even if no sensors are deployed at that location. 6) Hyperparameter analysis and time costs: We conduct analysis and experiments on some key hyperparameters in PriSTI to illustrate the setting of hyperparameters and the sensitivity of the model to these parameters. Taking METR- LA as example, we analyze the three key hyperparameters: the channel size of hidden state d, maximum noise level βT and number of virtual nodes k, as shown in Figure 8. Among them, d and k affect the amount of information learned by the model. βT affects the level of sampled noise, and too large or too too small value is not conducive to the learning of noise prediction model. According to the results in Figure 8, we set 0.2 to βT which is the optimal value. For d and k, although the performance is better with larger value, we set both d and k to 64 considering the efficiency. In addition, we select several deep learning methods with the higher imputation performance ranking to compare their efficiency with PriSTI on dataset AQI-36 and METR-LA. The total training time and inference time of different methods are shown in Figure 9. The experiments are conducted on AMD EPYC 7371 CPU, NVIDIA RTX 3090. It can be seen the efficiency gap between methods on datasets with that less nodes (AQI-36) is not large, but the training time cost of generative methods CSDI and PriSTI on datasets with more nodes (METR-LA) is higher. Due to the construction of (a) Channel size d (b) Maximum noise level βT (c) Number of virtual nodes k Fig. 8: The sensitivity study of key parameters. (a) Training time (b) Inference time Fig. 9: The time costs of PriSTI and other baselines. conditional information, PriSTI has 25.7% more training time and 17.9% more inference time on METR-LA than CSDI. V. RELATED WORK Since the spatiotemporal data can be imputed along tempo- ral or spatial dimension, there are a large amount of literature for missing value imputation in spatiotemporal data. For the time series imputation, the early studies imputed missing val- ues by statistical methods such as local interpolation [33], [34], which reconstructs the missing value by fitting a smooth curve to the observations. Some methods also impute missing values based on the historical time series through EM algorithm [10], [11] or the combination of ARIMA and Kalman Filter [8], [9]. There are also some early studies filling in missing values through spatial relationship or neighboring sequence, such as KNN [12], [13] and Kriging [32]. In addition, the low-rank matrix factorization [27], [28], [35], [36] is also a feasible approach for spatiotemporal imputation, which exploits the intrinsic spatial and temporal patterns based on the prior knowledge. For instance, TRMF [27] incorporates the structure of temporal dependencies into a temporal regularized ma- trix factorization framework. BATF [28] incorporates domain knowledge from transportation systems into an augmented tensor factorization model for traffic data modeling. In recent years, there have been many studies on spa- tiotemporal data imputation through deep learning methods [6], [37]. Most deep learning imputation methods focus on the multivariate time series and use RNN as the core to model temporal relationships [1], [7], [38], [39]. The RNN- based approach for imputation is first proposed by GRU-D [38] and is widely used in deep autoregressive imputation methods. Among the RNN-based methods, BRITS [1] imputes the missing values on the hidden state through a bidirectional RNN and considers the correlation between features. GRIN [7] introduces graph neural networks based on BRITS to exploit the inductive bias of historical spatial patterns for imputation. In addition to directly using RNN to estimate the hidden state of missing parts, there are also a number of methods using GAN to generate missing data [14], [40], [41]. For instance, GAIN [14] imputes data conditioned on observation values by the generator, and utilizes the discriminator to distinguish the observed and imputed part. SSGAN [41] proposes a semi- supervised GAN to drive the generator to estimate missing values using observed information and data labels. However, these methods are still RNN-based autoregressive methods, which are inevitably affected by the problem of error accumulation, i.e., the current missing value is imputed by the inaccurate historical estimated values in a sequential manner. To address this problem, Liu et al. [6] proposes NAOMI, developing a non-autoregressive decoder that recur- sively updates the hidden state, and using generative adversar- ial training to impute. Fortuin et al. [30] propose a multivariate time series imputation method utilizing the VAE architecture with a Gaussian process prior in the latent space to capture temporal dynamics. Some other works capture spatiotemporal dependencies through the attention mechanism [37], [42], [43], which not only consider the temporal dependencies but also exploit the geographic locations [37] and correlations between different time series [43]. Recently, a diffusion model-based generative imputation framework CSDI [18] shows the performance advantages of deep generative models in multivariate time series imputation tasks. The Diffusion Probabilistic Models (DPM) [15]–[17], as deep generative models, have achieved great performance than other generative methods in several fields such as image synthesis [16], [20], audio generation [21], [44], and graph generation [45], [46]. In terms of imputation tasks, there are existing methods for 3D point cloud completion [47] and multivariate time series imputation [18] through conditional DPM. CSDI imputes the missing data through score-based diffusion models conditioned on observed data, exploiting temporal and feature correlations by a two dimensional at- tention mechanism. However, CSDI takes the concatenation of observed values and noisy information as the input when training, increasing the difficulty of the attention mechanism's learning. Different from existing diffusion model-based impu- tation methods, our proposed method construct the prior and imputes spatiotemporal data based on the extracted conditional feature and geographic information. VI. CONCLUSION We propose PriSTI, a conditional diffusion framework for spatiotemporal imputation, which imputes missing values with help of the extracted conditional feature to calculate temporal and spatial global correlations. Our proposed framework cap- tures spatiotemporal dependencies by comprehensively con- sidering spatiotemporal global correlation and geographic de- pendency. PriSTI achieves more accurate imputation results than state-of-the-art baselines in various missing patterns of spatiotemporal data in different fields, and also handles the case of high missing rates and sensor failure. In future work, we will consider improving the scalability and computation ef- ficiency of existing frameworks on larger scale spatiotemporal datasets, and how to impute by longer temporal dependencies with refined conditional information. 1632641.861.901.941.982.02MAE0.10.20.30.41.861.881.901.92MAE1632641.851.871.891.911.93MAEAQI-36METR-LADataset02004006008001000Training time (min)BRITSGRINCSDIPriSTIAQI-36METR-LADataset01020304050Inference time (sec)BRITSGRINCSDIPriSTI ACKNOWLEDGMENT We thank anonymous reviewers for their helpful comments. This research is supported by the National Natural Science Foundation of China (62272023). REFERENCES [1] W. Cao, D. Wang, J. Li, H. Zhou, L. Li, and Y. Li, "Brits: Bidirectional recurrent imputation for time series," NeurIPS, vol. 31, 2018. [2] X. Yi, Y. Zheng, J. Zhang, and T. Li, "St-mvl: filling missing values in geo-sensory time series data," in IJCAI, 2016. [3] Y. Li, R. Yu, C. Shahabi, and Y. Liu, "Diffusion convolutional recurrent neural network: Data-driven traffic forecasting," in ICLR, 2018. [4] Z. Wu, S. Pan, G. Long, J. Jiang, and C. Zhang, "Graph wavenet for deep spatial-temporal graph modeling." in IJCAI, 2019. [5] P. Bauer, A. Thorpe, and G. Brunet, "The quiet revolution of numerical weather prediction," Nature, vol. 525, no. 7567, pp. 47–55, 2015. [6] Y. Liu, R. Yu, S. Zheng, E. Zhan, and Y. Yue, "Naomi: Non- autoregressive multiresolution sequence imputation," NeurIPS, vol. 32, 2019. [7] A. Cini, I. Marisca, and C. Alippi, "Filling the g ap s: Multivariate time series imputation by graph neural networks," in ICLR, 2022. [8] C. F. Ansley and R. Kohn, "On the estimation of arima models with missing values," in Time series analysis of irregularly observed data. Springer, 1984, pp. 9–37. [9] A. C. Harvey, "Forecasting, structural time series models and the kalman filter," 1990. [10] R. H. Shumway and D. S. Stoffer, "An approach to time series smoothing and forecasting using the em algorithm," Journal of time series analysis, vol. 3, no. 4, pp. 253–264, 1982. [11] F. V. Nelwamondo, S. Mohamed, and T. Marwala, "Missing data: A comparison of neural network and expectation maximization tech- niques," Current Science, pp. 1514–1521, 2007. [12] H. Trevor, T. Robert, and F. Jerome, "The elements of statistical learning: data mining, inference, and prediction," 2009. [13] L. Beretta and A. Santaniello, "Nearest neighbor imputation algorithms: a critical evaluation," BMC medical informatics and decision making, vol. 16, no. 3, pp. 197–208, 2016. [14] J. Yoon, J. Jordon, and M. Schaar, "Gain: Missing data imputation using generative adversarial nets," in ICML. PMLR, 2018, pp. 5689–5698. [15] J. Sohl-Dickstein, E. Weiss, N. Maheswaranathan, and S. Ganguli, "Deep unsupervised learning using nonequilibrium thermodynamics," in ICML. PMLR, 2015, pp. 2256–2265. [16] J. Ho, A. Jain, and P. Abbeel, "Denoising diffusion probabilistic models," NeurIPS, vol. 33, pp. 6840–6851, 2020. [17] Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon, and B. Poole, "Score-based generative modeling through stochastic differ- ential equations," arXiv preprint arXiv:2011.13456, 2020. [18] Y. Tashiro, J. Song, Y. Song, and S. Ermon, "Csdi: Conditional score-based diffusion models for probabilistic time series imputation," NeurIPS, vol. 34, pp. 24 804–24 816, 2021. [19] J. Sohl-Dickstein, E. Weiss, N. Maheswaranathan, and S. Ganguli, "Deep unsupervised learning using nonequilibrium thermodynamics," in ICML, vol. 37, 07–09 Jul 2015, pp. 2256–2265. [20] R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer, "High- resolution image synthesis with latent diffusion models," in ICCV, 2022, pp. 10 684–10 695. [21] Z. Kong, W. Ping, J. Huang, K. Zhao, and B. Catanzaro, "Diffwave: A versatile diffusion model for audio synthesis," in ICLR, 2021. [22] J. Choi, H. Choi, J. Hwang, and N. Park, "Graph neural controlled differential equations for traffic forecasting," in AAAI, vol. 36, no. 6, 2022, pp. 6367–6374. [23] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, "Attention is all you need," NeurIPS, vol. 30, 2017. [24] H. V. Jagadish, J. Gehrke, A. Labrinidis, Y. Papakonstantinou, J. M. Patel, R. Ramakrishnan, and C. Shahabi, "Big data and its technical challenges," Communications of the ACM, vol. 57, no. 7, pp. 86–94, 2014. [25] D. I. Shuman, S. K. Narang, P. Frossard, A. Ortega, and P. Van- dergheynst, "The emerging field of signal processing on graphs: Ex- tending high-dimensional data analysis to networks and other irregular domains," IEEE signal processing magazine, vol. 30, no. 3, pp. 83–98, 2013. [26] I. R. White, P. Royston, and A. M. Wood, "Multiple imputation using chained equations: issues and guidance for practice," Statistics in medicine, vol. 30, no. 4, pp. 377–399, 2011. [27] H.-F. Yu, N. Rao, and I. S. Dhillon, "Temporal regularized matrix time series prediction," NeurIPS, factorization for high-dimensional vol. 29, 2016. [28] X. Chen, Z. He, Y. Chen, Y. Lu, and J. Wang, "Missing traffic data imputation and pattern discovery with a bayesian augmented tensor factorization model," Transportation Research Part C: Emerging Tech- nologies, vol. 104, pp. 66–77, 2019. [29] A. W. Mulyadi, E. Jun, and H.-I. Suk, "Uncertainty-aware variational- recurrent imputation network for clinical time series," IEEE Transactions on Cybernetics, 2021. [30] V. Fortuin, D. Baranchuk, G. R ̈atsch, and S. Mandt, "Gp-vae: Deep PMLR, 2020, pp. probabilistic time series imputation," in AISTATS. 1651–1661. [31] J. E. Matheson and R. L. Winkler, "Scoring rules for continuous probability distributions," Management science, vol. 22, no. 10, pp. 1087–1096, 1976. [32] M. L. Stein, Interpolation of spatial data: some theory for kriging. Springer Science & Business Media, 1999. [33] D. M. Kreindler and C. J. Lumsden, "The effects of the irregular sample and missing data in time series analysis." Nonlinear dynamics, psychology, and life sciences, 2006. [34] E. Acuna and C. Rodriguez, "The treatment of missing values and its effect on classifier accuracy," in Classification, clustering, and data mining applications. Springer, 2004, pp. 639–647. [35] R. Salakhutdinov and A. Mnih, "Bayesian probabilistic matrix factor- ization using markov chain monte carlo," in ICML, 2008, pp. 880–887. [36] X. Chen and L. Sun, "Bayesian temporal factorization for multidimen- sional time series prediction," IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021. [37] J. Ma, Z. Shou, A. Zareian, H. Mansour, A. Vetro, and S.-F. Chang, "Cdsa: cross-dimensional self-attention for multivariate, geo-tagged time series imputation," arXiv preprint arXiv:1905.09904, 2019. [38] Z. Che, S. Purushotham, K. Cho, D. Sontag, and Y. Liu, "Recurrent neural networks for multivariate time series with missing values," Scientific reports, vol. 8, no. 1, pp. 1–12, 2018. [39] J. Yoon, W. R. Zame, and M. van der Schaar, "Estimating missing data in temporal data streams using multi-directional recurrent neural networks," IEEE Transactions on Biomedical Engineering, vol. 66, no. 5, pp. 1477– 1490, 2018. [40] Y. Luo, X. Cai, Y. Zhang, J. Xu et al., "Multivariate time series imputation with generative adversarial networks," NeurIPS, vol. 31, 2018. [41] X. Miao, Y. Wu, J. Wang, Y. Gao, X. Mao, and J. Yin, "Generative semi- supervised learning for multivariate time series imputation," in AAAI, vol. 35, no. 10, 2021, pp. 8983–8991. [42] S. N. Shukla and B. M. Marlin, "Multi-time attention networks for irregularly sampled time series," in ICLR, 2021. [43] W. Du, D. Cˆot ́e, and Y. Liu, "Saits: Self-attention-based imputation for time series," arXiv preprint arXiv:2202.08516, 2022. [44] K. Goel, A. Gu, C. Donahue, and C. R ́e, "It's raw! audio generation with state-space models," ICML, 2022. [45] H. Huang, L. Sun, B. Du, Y. Fu, and W. Lv, "Graphgdp: Generative diffusion processes for permutation invariant graph generation," arXiv preprint arXiv:2212.01842, 2022. [46] H. Huang, L. Sun, B. Du, and W. Lv, "Conditional diffusion based on discrete graph structures for molecular graph generation," arXiv preprint arXiv:2301.00427, 2023. [47] Z. Lyu, Z. Kong, X. Xu, L. Pan, and D. Lin, "A conditional point diffusion-refinement paradigm for 3d point cloud completion," in ICLR, 2022.
http://arxiv.org/abs/2302.09739v1
2023-02-20T03:42:31
2023-02-20T03:42:31
A Blackbox Approach to Best of Both Worlds in Bandits and Beyond
Best-of-both-worlds algorithms for online learning which achieve near-optimal regret in both the adversarial and the stochastic regimes have received growing attention recently. Existing techniques often require careful adaptation to every new problem setup, including specialised potentials and careful tuning of algorithm parameters. Yet, in domains such as linear bandits, it is still unknown if there exists an algorithm that can simultaneously obtain $O(\log(T))$ regret in the stochastic regime and $\tilde{O}(\sqrt{T})$ regret in the adversarial regime. In this work, we resolve this question positively and present a general reduction from best of both worlds to a wide family of follow-the-regularized-leader (FTRL) and online-mirror-descent (OMD) algorithms. We showcase the capability of this reduction by transforming existing algorithms that are only known to achieve worst-case guarantees into new algorithms with best-of-both-worlds guarantees in contextual bandits, graph bandits and tabular Markov decision processes.
[ "Christoph Dann", "Chen-Yu Wei", "Julian Zimmert" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09739v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09739v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "stat.ML" ]
3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 9 3 7 9 0 . 2 0 3 2 : v i X r a A Blackbox Approach to Best of Both Worlds in Bandits and Beyond Christoph Dann * Chen-Yu Wei † Julian Zimmert ‡ Abstract Best-of-both-worlds algorithms for online learning which achieve near-optimal regret in both the ad- versarial and the stochastic regimes have received growing attention recently. Existing techniques often require careful adaptation to every new problem setup, including specialised potentials and careful tuning of algorithm parameters. Yet, in domains such as linear bandits, it is still unknown if there exists an algo- rithm that can simultaneously obtain O(log(T )) regret in the stochastic regime and ̃O(√T ) regret in the adversarial regime. In this work, we resolve this question positively and present a general reduction from best of both worlds to a wide family of follow-the-regularized-leader (FTRL) and online-mirror-descent (OMD) algorithms. We showcase the capability of this reduction by transforming existing algorithms that are only known to achieve worst-case guarantees into new algorithms with best-of-both-worlds guarantees in contextual bandits, graph bandits and tabular Markov decision processes. 1 Introduction Multi-armed bandits and its various extensions have a long history (Lai et al., 1985; Auer et al., 2002a;b). Tra- ditionally, the stochastic regime in which all losses/rewards are i.i.d. and the adversarial regime in which an adversary chooses the losses in an arbitrary fashion have been studied in isolation. However, it is of- ten unclear in practice whether an environment is best modelled by the stochastic regime, a slightly con- taminated regime, or a fully adversarial regime. This is why the question of automatically adapting to the hardness of the environment, also called achieving best-of-both-worlds guarantees, has received growing at- tention (Bubeck and Slivkins, 2012; Seldin and Slivkins, 2014; Auer and Chiang, 2016; Seldin and Lugosi, 2017; Wei and Luo, 2018; Zimmert and Seldin, 2019; Ito, 2021b; Ito et al., 2022a; Masoudian and Seldin, 2021; Gaillard et al., 2014; Mourtada and Ga ̈ıffas, 2019; Ito, 2021a; Lee et al., 2021; Rouyer et al., 2021; Amir et al., 2022; Huang et al., 2022; Tsuchiya et al., 2022; Erez and Koren, 2021; Rouyer et al., 2022; Ito et al., 2022b; Kong et al., 2022; Jin and Luo, 2020; Jin et al., 2021; Chen et al., 2022; Saha and Gaillard, 2022; Masoudian et al., 2022; Honda et al., 2023). One of the most successful approaches has been to derive carefully tuned FTRL algorithms, which are canonically suited for the adversarial regime, and then show that these algorithms are also close to optimal in the stochastic regime as well. This is achieved via proving a crucial self-bounding property, which then translates into stochastic guarantees. This type of algorithms have been proposed for multi-armed bandits (Wei and Luo, 2018; Zimmert and Seldin, 2019; Ito, 2021b; Ito et al., 2022a), combinatorial semi-bandits (Zimmert et al., 2019), bandits with graph feedback (Ito et al., 2022b), tab- ular MDPs (Jin and Luo, 2020; Jin et al., 2021) and others. Algorithms with self-bounding properties also automatically adapt to intermediate regimes of stochastic losses with adversarial corruptions (Lykouris et al., 2018; Gupta et al., 2019; Zimmert and Seldin, 2019; Ito, 2021a), which highlights the strong robustness of this algorithm design. However, every problem variation required careful design of potential functions and learning *Google Research. Email: [email protected]. †MIT Institute for Data, Systems, and Society. Email: [email protected]. ‡Google Research. Email: [email protected]. 1 Setting Algorithm Adversarial Linear bandit Contextual bandit Graph bandit Strongly observable Graph bandit Weakly observable Tabular MDP Lee et al. (2021) Theorem 3 Corollary 7 Corollary 12 Corollary 13 Ito et al. (2022b) dT log( T ) log T |X | d√νL⋆ log T p d√T log T dT log |X | p KT log |X | √αT log T log(KT ) p Rouyer et al. (2022) αT log K Corollary 15 Ito et al. (2022b) Corollary 19 Jin et al. (2021) Theorem 26 α, α log K min p { } e (δ log(KT ) log T ) p 1 3 T 2 3 e 1 2 3 3 T (δ log K) H 2S2AT log2 T HS2AL⋆ log4 T p p Stochastic d log(|X |T ) log(T ) ∆ d2ν log T ∆ log T ∆ d log |X | log T ∆ K log |X | log T ∆ d2 2 α log (KT ) log T ∆ eα log(KT ) log T ∆ ∆ δ log(KT ) log T ∆2 δ log K log T ∆2 H6S2A log 2 T H2S2A log 3 T ∆′ ∆ o(C) Rd. 1 Rd. 2 X X X X X X X X X X X X X X X X X X X X X T log K min{eα,α log K} log K log T Table 1: Overview of regret bounds. The o(C) column specifies whether the algorithm achieves the optimal 2 dependence on the amount of corruption (√C or C 3 , depending on the setting). "Rd. 1" and "Rd. 2" indicate whether the result leverages the first and the second reductions described in Section 4, respectively. L⋆ is the cumulative loss of the best action or policy. ν in Theorem 3 is the self-concordance parameter; it holds that d. ∆′ in Jin et al. (2021) is the gap in the Q⋆ function, which is different from the policy gap ∆ we use; it ν α, δ are complexity measures of feedback graphs defined in Section 5. holds that ∆ ≤ ∆′. α, ≤ e rate schedules. For linear bandits, it has been still unknown whether self-bounding is possible and therefore the state-of-the-art best-of-both-worlds algorithm (Lee et al., 2021) neither obtains optimal log T stochastic rate, nor canonically adapts to corruptions. In this work, the make the following contributions: 1) We propose a general reduction from best of both worlds to typical FTRL/OMD algorithms, sidestepping the need for customized potentials and learning rates. 2) We derive the first best-of-both-worlds algorithm for linear bandits that obtains log T regret in the stochastic regime, optimal adversarial worst-case regret and adapts canonically to corruptions. 3) We derive the first best-of-both-worlds algorithm for linear bandits and tabular MDPs with first-order guarantees in the adversarial regime. 4) We obtain the first best-of-both-worlds algorithms for bandits with graph feedback and bandits with expert advice with optimal log T stochastic regret. 2 Related Work Our reduction procedure is related to a class of model selection algorithms that uses a meta bandit algorithm to learn over a set of base bandit algorithms, and the goal is to achieve a comparable performance as if the best base algorithm is run alone. For the adversarial regime, Agarwal et al. (2017) introduced the Corral algorithm to learn over adversarial bandits algorithm that satisfies the stability condition. This framework is further improved by Foster et al. (2020); Luo et al. (2022). For the stochastic regime, Arora et al. (2021); Abbasi-Yadkori et al. (2020); Cutkosky et al. (2021) introduced another set of techniques to achieve similar guarantees, but without explicitly relying on the stability condition. While most of these results focus on obtaining a √T regret, Arora et al. (2021); Cutkosky et al. (2021); Wei et al. (2022); Pacchiano et al. (2022) made some progress in obtaining polylog(T ) regret in the stochastic regime. Among them, Wei et al. (2022); Pacchiano et al. (2022) 2 are most related to us since they also pursue a best-of-both-worlds guarantee across adversarial and stochastic regimes. However, their regret bounds, when applied to our problems, all suffer from highly sub-optimal dependence on log(T ) and the amount of corruptions. 3 Preliminaries 1, 1]. We consider sequential decision making problems where the learning interacts with the environment in T and the learner generates a dis- rounds. In each round t, the environment generates a loss vector (lt,u)u tribution over actions pt and chooses an action At pt. The learner then suffers loss lt,At and receives some information about (lt,u)u depending on the concrete setting. In all settings but MDPs, we assume lt,u ∈ In the adversarial regime, (lt,u)u u, lt h (e.g., in linear bandits, E[lt,u] = there exists an action x⋆ ≥ the corrupted stochastic regime, where the assumption is relaxed to E[lt,x We define C = is generated arbitrarily subject to the structure of the concrete setting Rd). In the stochastic regime, we further assume that for arbitrary lt and a gap ∆ > 0 such that E[lt,x = x⋆. We also consider 0. Ct for some Ct ∆ for all x ∆ ∈X i lt,x⋆] lt,x⋆] [ − ∈ X ∈X ∈X ∼ − − − ≥ ≥ ∈ T t=1 Ct. P 4 Main Techniques 4.1 The standard global self-bounding condition and a new linear bandit algorithm To obtain a best-of-both-world regret bound, previous works show the following property for their algorithm: Definition 1 (α-global-self-bounding condition, or α-GSB). u ∀ ∈ X : E T " t=1 X (lt,At − lt,u) # ≤ min α 0 T α, (c1 log T )1 c1 − − ( αE " T (1 t=1 X α pt,u) # − ) + c2 log T where c0, c1, c2 are problem-dependent constants and pt,u is the probability of the learner choosing u in round t. With this condition, one can use the standard self-bounding technique to obtain a best-of-both-world regret bounds: Proposition 2. If an algorithm satisfies α-GSB, then its pseudo-regret is bounded by O in the adversarial regime, and by O c1 log(T )∆− stochastic regime. 1−α + (c1 log T )1 − C∆− α α 1 α α c1 0 T α + c2 log T − in the corrupted + c2 log(T ) (cid:1) (cid:0) (cid:0) (cid:0) (cid:1) (cid:1) Previous works have found algorithms with GSB in various settings, such as multi-armed bandits, semi- bandits, graph-bandits, and MDPs. Here, we provide one such algorithm (Algorithm 3) for linear bandits based on the framework of SCRiBLe (Abernethy et al., 2008). The guarantee of Algorithm 3 is stated in the next theorem under the more general "learning with predictions" setting introduced in Rakhlin and Sridharan (2013), where in every round t, the learner receives a loss predictor mt before making decisions. Theorem 3. In the "learning with predictions" setting, Algorithm 3 achieves a second-order regret bound of d ν log(T ) T t=1(lt,At − mt,At)2 + dν log T d is the self-concordance parameter of the regularizer, and mt,x = q (cid:17) P O ν (cid:16) ≤ implies a first-order regret bound of O d ν log(T ) in the adversarial regime, where d is the feature dimension, is the loss predictor. This also 0 and mt = 0; it simultaneously x, mt h if lt,x i T t=1 lt,u ≥ achieves Reg = O d2ν log T ∆ + q (cid:16) d2ν log T ∆ C (cid:16) q (cid:17) in the corrupted stochastic regime. P (cid:17) 3 6 See Appendix B for the algorithm and the proof. We call this algorithm Variance-Reduced SCRiBLe (VR- SCRiBLe) since it is based on the original SCRiBLe updates, but with some refinement in the construction of the loss estimator to reduce its variance. A good property of a SCRiBLe-based algorithm is that it simultaneously achieves data-dependent bounds (i.e., first- and second-order bounds), similar to the case of multi-armed bandit using FTRL/OMD with log-barrier regularizer (Wei and Luo, 2018; Ito, 2021b). Like Rakhlin and Sridharan (2013); Bubeck et al. (2019); Ito (2021b); Ito et al. (2022a), we can also use another procedure to learn mt and obtain path-length or variance bounds. The details are omitted. We notice, however, that the the bound in Theorem 3 is sub-optimal in d since the best-known regret for linear bandits is either d√T log T or , depending on whether the number of actions is larger than T d. These bounds also hint the possibility of getting better dependence on d in the stochastic regime if we can also establish GSB for these algorithms. Therefore, we ask: can we achieve best-of-both-world bounds for linear bandits with the optimal d dependence? dT log |X | p An attempt is to try to show GSB for existing algorithms with optimal d dependence, including the EXP2 algorithm (Bubeck et al., 2012) and the logdet-FTRL algorithm (Zimmert and Lattimore, 2022). Based on our attempt, it is unclear how to adapt the analysis of logdet-FTRL to show GSB. For EXP2, using the learning- rate tuning technique by Ito et al. (2022b), one can make it satisfy a similar guarantee as GSB, albeit with an additional log(T ) factor, resulting in a bound d log( T ) log(T ) in the stochastic regime. This gives a sub-optimal ∆ rate of O(log2 T ). Therefore, we further ask: can we achieve O(log T ) regret in the stochastic regime with an optimal d dependence? |X | Motivated by these questions, we resort to approaches that do not rely on GSB, which appears for the first time in the best-of-both-world literature. Our approach is in fact a general reduction - it not only successfully achieves the desired bounds for linear bandits, but also provides a principled way to convert an algorithm with a worst-case guarantee to one with a best-of-both-world guarantee for general settings. In the next two subsections, we introduce our reduction techniques. 4.2 First reduction: Best of Both Worlds Local Self-Bounding → Our reduction approach relies on an algorithm to satisfy a weaker condition than GSB, defined in the following: Definition 4 (α-local-self-bounding condition, or α-LSB). We say an algorithm satisfies the α-local-self- bounding condition if it takes a candidate action as input and satisfies the following pseudo-regret guarantee for any stopping time t′ ∈ [1, T ]: ∈ X x u ∀ ∈ X : E t′ " t=1 X (lt,At − lt,u) # ≤ min c1 − 0   where c0, c1, c2 are problem dependent constants.  b α E[t′]α, (c1 log T )1 − αE t′ " t=1 X α I{u = (1 − x}pt,u) # b + c2 log T    t(1 pt,u) to appear when u is a particular action The difference between LSB in Definition 4 and GSB in Definition 1 is that LSB only requires the self- bounding term x given as an input to the algorithm; for all other actions, the worst-case bound suffices. A minor additional requirement is that the pseudo-regret needs to hold for any stopping time (because our reduction may stop this algorithm during the learning procedure), but this is relatively easy to satisfy - for all algorithms in this paper, without additional efforts, their regret bounds naturally hold for any stopping time. P − b For linear bandits, we find that an adaptation of the logdet-FTRL algorithm (Zimmert and Lattimore, 2022) satisfies 1 2 -LSB, as stated in the following lemma. The proof is provided in Appendix C. Lemma 5. For d-dimensional linear bandits, by transforming the action set into Rd+1, Algorithm 4 satisfies 1 2 -LSB with c0 = O((d + 1)2 log T ) and c1 = c2 = O((d + 1)2). x ∈ X \{ x x 0 (cid:8)(cid:0) (cid:1) (cid:12) (cid:12) 0 1 ∪ (cid:8)(cid:0) (cid:1)(cid:9) ⊂ } (cid:9) b 4 Algorithm 1 BOBW via LSB algorithms Input: LSB algorithm 0, T0 ← − T1 ← unif( ). x1 ∼ X 1. t ← for k = 1, 2 . . . , do b A c2 log(T ). with candidate Initialize Set counters Nk(x) = 0 for all x for t = Tk + 1, Tk + 2, . . . do xk. A b . ∈ X Play action At as suggested by Nk(At) if t 1) and Nk(At) + 1 Tk 2(Tk x. t. − − ← Tk ≥ − xk+1 ← Tk+1 ← break. b , and advance by one step. A A x ∃ xk ∈ X \ { } such that Nk(x) Tk t − 2 then ≥ b With the LSB condition defined, we develop a reduction procedure (Algorithm 1) which turns any algorithm with LSB into a best-of-both-world algorithm that has a similar guarantee as in Proposition 2. The guarantee is formally stated in the next theorem. Theorem 6. If A c1 0 T α + c2 log2 T by O − c2 log(T ) log(C∆− 1) α (cid:0) (cid:1) satisfies α-LSB, then the regret of Algorithm 1 with in the adversarial regime and by O in the corrupted stochastic regime. A c1 log(T )∆− as the base algorithm is upper bounded + 1−α + (c1 log T )1 − C∆− α α 1 α (cid:0) (cid:0) (cid:1) See Appendix D.1 for a proof of Theorem 6. In particular, Theorem 6 together with Lemma 5 directly lead (cid:1) to a better best-of-both-world bound for linear bandits. Corollary 7. Combining Algorithm 1 and Algorithm 4 results in a linear bandit algorithm with O d√T log T regret in the adversarial regime and O taneously. (cid:16) d2 log T ∆ + d C log T ∆ q (cid:17) regret in the corrupted stochastic regime simul- (cid:1) (cid:0) x = with input x1 is randomly drawn from xk, and monitors the number of draws to each action. If in epoch k there exists some x Ideas of the first reduction Algorithm 1 proceeds in epochs. In epoch k, there is an action selected as the candidate ( being ). The procedure simply executes the base algorithm xk A being drawn more than half of the time, and the length of epoch k already exceeds two times the length of epoch k b Theorem 6 is not sufficient to be considered a black-box reduction approach, since algorithms with LSB are not common. Therefore, our next step is to present a more general reduction that makes use of recent advances of Corral algorithms. b 1, then a new epoch is started with xk+1 set to x. ∈ X xk − = X b b b b 4.3 Second reduction: Local Self-Bounding Importance-Weighting Stable → In this subsection, we show that one can achieve LSB using the idea of model selection. Specifically, we will run a variant of the Corral algorithm (Agarwal et al., 2017) over two instances: one is x, and the other is a importance-weighting-stable algorithm (see Definition 8) over the action set . Here, we focus on the } case of α = 1 2 , which is the case for most standard settings where the worst-case regret is √T ; examples for α = 2 3 in the graph bandit setting is discussed in Section 5. First, we introduce the notion of importance-weighting stablility. X \{ x b b 5 6 Algorithm 2 LSB via Corral (for α = 1 2 ) Input: candidate action Define: ψt(q) = B0 = 0. for t = 1, 2, . . . do x, 1 2 i=1 √qi + 1 β b 2 -iw-stable algorithm 2 i=1 ln 1 . qi P P 2 ηt − Let over x X \{ } B with constants c1, c2. b ̄qt = argmin q ∆2   ∈ q, * with ηt = 1  √t + 8√c1 1 t − τ =1 X 0 −  Bt −  β = zτ , + 1  1 8c2 .  + ψt(q)   , qt = 1 (cid:18) 1 2t2 − (cid:19) ̄qt + 1 4t2 1, ∼ qt. Sample it if it = 1 then draw At = else draw At according to base algorithm Define zt,i = it=i b } { (lt,At +1)I qt,i 1 and x and observe lt,At ; − and observe lt,At ; B Bt = t τ =1 X c1 v u u t 1 qτ,2 + c2 minτ t qτ,2 ≤ . 2 -iw-stable). An algorithm is 1 Definition 8 ( 1 quence of weights q1, q2, qt, it obtains the following pseudo regret guarantee for any stopping time t′: 2 -iw-stable (importance-weighting stable), if given an adaptive se- (0, 1] and the assertion that the feedback in round t is observed with probability * * * ∈ t′ t′ E (lt,At − lt,u) E c1 1 qt + c2 mint . "  t=1 X t=1 X # ≤ v u u t Definition 8 requires that even if the algorithm only receives the desired feedback with probability qt in 1 . In previous works on round t, it still achieves a meaningful regret bound that smoothly degrades with qt Corral and its variants (Agarwal et al., 2017; Foster et al., 2020), a similar notion of 1 2 -stability is defined as P t′, which is a weaker assumption than our 1 2 -iw-stability. Our stronger notion of stability is crucial to get a best-of-both-world bound, but it is still very natural and holds for a wide range of algorithms. having a regret of t′ qt  maxτ r 1 qτ c1   (cid:16) (cid:17) ≤ ≤ t′ t Below, we provide two examples of 1 2 -iw-stable algorithms. Their analysis is mostly standard FTRL anal- ysis (considering extra importance weighting) and can be found in Appendix F. |X | |X | Lemma 9. For linear bandits, EXP2 with adaptive learning rate (Algorithm 9) is 1 c1 = c2 = O(d log ). 2 -iw-stable with constants Lemma 10. For contextual bandits, EXP4 with adaptive learning rate (Algorithm 10) is 1 stants c1 = O(K log ), c2 = 0. 2 -iw-stable with con- Our reduction procedure is Algorithm 2, which turns an 1 2 -iw-stable algorithm into one with 1 2 -LSB. The guarantee is formalized in the next theorem, whose proof is in Appendix E.1. 6 Theorem 11. If B algorithm satisfies 1 2 -iw-stable algorithm with constants (c1, c2), then Algorithm 2 with is a 1 2 -LSB with constants (c′0, c′1, c′2) where c′0 = c′1 = O(c1) and c′2 = O(c2). as the base B Cascading Theorem 11 and Theorem 6, and combining it with Lemma 9 and Lemma 10, respectively, we get the following corollaries: Corollary 12. Combining Algorithm 1, Algorithm 2 and Algorithm 9 results in a linear bandit algorithm with dT log O rupted stochastic regime simultaneously. |X | regret in the adversarial regime and O (cid:0)p (cid:1) d log log T + |X | ∆ d log |X | ∆ log T C regret in the cor- (cid:16) q (cid:17) Corollary 13. Combining Algorithm 1, Algorithm 2 and Algorithm 10 results in a contextual bandit algorithm with O corrupted stochastic regime simultaneously, where K is the number of arms. regret in the adversarial regime and O KT log |X | ∆ K log log T (cid:16) + K log log T |X | ∆ C regret in the q (cid:17) (cid:0)p |X | (cid:1) 2 -Tsallis entropy and log-barrier regularizer) over two base algorithms: the candidate operating on the reduced action set x Ideas of the second reduction Algorithm 2 is related to the Corral algorithm (Agarwal et al., 2017; Foster et al., 2020; Luo et al., 2022). We use a special version which is essentially an FTRL algorithm (with a hybrid 1 x, and an algo- rithm , the Corral algorithm adds a bonus B under importance weighting (i.e., the quantity Bt defined in Algorithm 6). term that upper bounds the regret of In the regret analysis, the bonus creates a negative term as well as a bonus overhead in the learner's regret. The , and the analysis reduces to bounding the bonus negative term can be used to cancel the positive regret of . For base algorithm } X \{ B B b b overhead. Showing that the bonus overhead is upper bounded by the order of the key to establish the LSB property. B c1 log(T ) T t=1(1 pt, x) is b − q P Combining Algorithm 2 and Algorithm 1, we have the following general reduction: as long as we have an , we have an algorithm with the best-of-both-world guarantee 2 -iw-stable algorithms are quite common – usually it can be just 1 2 -iw-stable algorithm over ∈ X when the optimal action is unique. Notice that 1 a FTRL/OMD algorithm with adaptive learning rate. for any X \{ x x } b b x and a base algorithm for The overall reduction is reminiscent of the G-COBE procedure by Wei et al. (2022), which also runs model (similar to Algorithm 2), and dynamically restarts the pro- selection over X \{ cedure with increasing epoch lengths (similar to Algorithm 1). However, besides being more complicated, G-COBE only guarantees a bound of polylog(T ) + C in the corrupted stochastic regime (omitting dependencies b on c1, c2), which is sub-optimal in both C and T .1 x b } ∆ 5 Case Study: Graph Bandits In this section, we show the power of our reduction by improving the state of the art of best-of-both-worlds algorithms for bandits with graph feedback. In bandits with graph feedback, the learner is given a directed feedback graph G = (V, E), where the nodes V = [K] correspond to the K-arms of the bandit. Instead of E. Learnable graphs observing the loss of the played action At, the player observes the loss lt,j iff (At, j) are divided into strongly observable graphs and weakly observable graphs. In the first case, every arm i [K] ∈ E. In the must either receive its own feedback, i.e. (i, i) weakly observable case, every arm i E. The following graph properties characterize the difficulty of the two regimes. An independence set is any subset E V ′ ⊂ E. The independence number α is the size of the largest independence set. A related number is and (j, i) E, or all other arms do, i.e. [K] [K] must be observable by at least one arm, i.e. V such that no edge exists between any two distinct nodes in V ′, i.e. = j we have (i, j) ∈ [K] : (j, i) i } \ { j ∃ : (j, i) V ′, i i, j ∈ ∈ ∈ ∈ ∈ ∈ ∈ 6∈ ∀ ∀ j 6∈ 1However, Wei et al. (2022) is able to handle a more general type of corruption. 7 6 the weakly independence number removing all one-sided edges, i.e. (i, j) notions coincide, but in general is a subset D j ∀ The weakly dominating number δ is the size of the smallest weakly dominating set. α, which is the independence number of the subgraph (V, E′) obtained by E. For undirected graphs, the two α can be larger than α by up to a factor of K. Finally, a weakly dominating set E. V such that every node in V is observable by some node in D, i.e. E′ iff (i, j) E and (j, i) D : (i, j) ⊂ ∈ ∈ ∈ ∈ ∈ ∈ V ∃ e i e αT log K) for the strongly observable case and O((δ log K) Alon et al. (2015) provides a almost tight characterization of the adversarial regime, providing upper bounds 2 of O(√αT log T log K) and O( 3 ) for the weakly observable case, as well as matching lower bounds up to all log factors. Zimmert and Lattimore (2019) have shown that the log(T ) dependency can be avoided and that hence α is the right notion of difficulty for (though they pay for this with a larger log K dependency). strongly observable graphs even in the limit T State-of-the-art best-of-both-worlds guarantees for bandits with graph feedback are derivations of EXP3 and obtain either O( e ) for weakly observable graphs (Rouyer et al., 2022; Ito et al., 2022b)2. Our black-box reduction leads directly to algorithms with optimal log(T ) regret in the stochastic regime. ) regret for strongly observable graphs and O( δ log2(T ) → ∞ ) or O( α log(T ) log2(T K) α log2(T ) ∆ 1 3 T p ∆2 e ∆ 5.1 Strongly observable graphs We begin by providing an examples of 1 back. The algorithm and the proof are in Appendix F.3. 2 -iw-stable algorithm for bandits with strongly observable graph feed- Lemma 14. For bandits with strongly observable graph feedback, (1 − learning rate (Algorithm 11) is 1 2 -iw-stable with constants c1 = O(min α, α log K { 1/ log K)-Tsallis-INF with adaptive log K), c2 = 0. } Before we apply the reduction, note that Algorithm 2 requires that the player observes the loss lt,At when playing arm At, which is not necessarily the case for all strongly observable graphs. However, this can be overcome via defining an observable surrogate loss that is used in Algorithm 2 instead. We explain how this works in detail in Section G and assume from now that this technical issue does not arise. e Cascading the two reduction steps, we immediately obtain the following. Corollary 15. Combining Algorithm 1, Algorithm 2 and Algorithm 11 results in a graph bandit algo- rithm with O + regret in the adversarial regime and O log T log K min {e } α,α log K ∆ C regret in the corrupted stochastic regime simultaneously. (cid:1) (cid:16) α, α log K min { log T log K T log K } min α,α log K (cid:0)p } ∆ {e e q 5.2 Weakly observable graphs (cid:17) Weakly observable graphs motivate our general definition of LSB stable beyond α = 1 the equivalent of 1 2 . We first need to define Definition 16 ( 2 3 -iw-stable (importance-weighting stable), if given an adaptive sequence of weights q1, q2, . . . , qτ and the feedback in any round being observed with probability qt, it obtains the following pseudo regret guarantee for any stopping time t′: 2 -iw-stable for this regime. 3 -iw-stable). An algorithm is 2 E " t′ t=1 X (lt,At − lt,u) # ≤ E 1 3 c  1 2 3 1 √qt ! + max t′ t ≤ t′ t=1 X . c2 qt      of strongly observable and weakly observable sub-graphs. We do not extend our analysis to the latter case for the sake of simplicity. 2Rouyer et al. (2022) obtains better bounds when the gaps are not uniform, while Ito et al. (2022b) can handle graphs that are unions 8 An example of such an algorithm is given by the following lemma (see Appendix F.4 for the algorithm and the proof). Lemma 17. For bandits with weakly observable graph feedback, EXP3 with adaptive learning rate (Algorithm 12) is 2 3 -iw-stable with constants c1 = c2 = O(δ log K). Similar to the 1 2 -case, this allows for a general reduction to LSB algorithms. Theorem 18. If B algorithm satisfies 2 is a 2 3 -iw-stable algorithm with constants (c1, c2), then Algorithm 5 with as the base 3 -LSB with constants (c′0, c′1, c′2) where c′0 = c′1 = O(c1) and c′2 = O(c 1 3 B 1 + c2). See Appendix E.2 for the proof. Algorithm 5 works almost the same as Algorithm 2, but we need to adapt the bonus terms to the definition of 2 3 -iw-stable. The major additional difference is that we do not necessarily observe the loss of the action played and hence need to play exploratory actions with probability γt in every . A second point to notice is that the base round to estimate the performance difference between algorithm x in its internal exploration policy. This , but is still allowed to use } is necessary because the sub-graph with one arm removed might have a larger dominating number, or might even not be learnable at all. By allowing x in the internal exploration, we guarantee the the regret of the base b algorithm is not larger than over the full action set. Finally, cascading the lemma and the reduction, we obtain uses the action set x and X \ { B B x b b Corollary 19. Combining Algorithm 1, Algorithm 5 and Algorithm 12 results in a graph bandit algorithm b (δ log K) with O corrupted stochastic regime simultaneously. (cid:1) (cid:0) 1 3 T 2 3 regret in the adversarial regime and O δ log K log T ∆2 + C2δ log K log T ∆2 (cid:16) (cid:16) 1 3 (cid:17) (cid:17) regret in the 6 More Adaptations To demonstrate the versatility of our reduction framework, we provide two more adaptations. The first demon- strates that our reduction can be easily adapted to obtain a data-dependent bound (i.e., first- or second-order bound) in the adversarial regime, provided that the base algorithm achieves a corresponding data-dependent bound. The second tries to eliminate the undesired requirement by the corral algorithm (Algorithm 2) that . We show that under a stronger the base algorithm needs to operate in stability assumption, we can indeed just use a base algorithm that operates in . This would be helpful for settings where excluding one single action/policy in the algorithm is not straightforward (e.g., MDP). Finally, we combine the two techniques to obtain a first-order best-of-both-world bound for tabular MDPs. instead of the more natural X \{ X X x b } 6.1 Reduction with first- and second-order bounds E , A first-order regret bound refers to a regret bound of order O T where L⋆ = minx This is meaningful under t=1 lt,x (cid:1) ∈X the assumption that lt,x 0 for all t, x. A second-order regret bound refers to a bound of order T c1polylog(T )E , where mt,x is a loss predictor for action x + c2polylog(T ) O that is available to the learner at the beginning of round t. We refer the reader to Wei and Luo (2018); Ito (2021b) for more discussions on data-dependent bounds. is the best action's cumulative loss. c1polylog(T )L⋆ + c2polylog(T ) (cid:2) P ≥ t=1(lt,At − (cid:3) mt,At)2 (cid:16)q (cid:2) P (cid:0)p (cid:17) (cid:3) We first define counterparts of the LSB condition and iw-stability condition with data-dependent guarantees: 9 Definition 20 ( 1 action x 2 -dd-LSB). We say an algorithm satisfies 1 as input and satisfies the following pseudo-regret guarantee for any stopping time t′ ∈ 2 -dd-LSB (data-dependent LSB) if it takes a candidate [1, T ]: ∈ X : ∈ X t′ u b ∀ E " t=1 X (lt,At − lt,u) # ≤ v u u t (c1 log T )E t′ " t=1 X x X where c1, c2 are some problem dependent constants, ξt,x = (lt,x ξt,x = lt,x in the first-order bound case. pt,xξt,x − I{u = x}p2 t,uξt,u !# + c2 log T mt,x)2 in the second-order bound case, and b − 2 -dd-iw-stable). An algorithm is 1 Definition 21 ( 1 tive sequence of weights q1, q2, probability qt, it obtains the following pseudo regret guarantee for any stopping time t′: 2 -dd-iw-stable (data-dependent-iw-stable) if given an adap- (0, 1] and the assertion that the feedback in round t is observed with * * * ∈ t′ E " (lt,At − lt,u) t′ c1E " # ≤ v u u t ξt,At updt * q2 t # + E c2 mint , t′ qt (cid:21) t=1 X where updt = 1 if feedback is observed in round t and updt = 0 otherwise, and ξt,x is defined in the same way as in Definition 20. t=1 X ≤ (cid:20) We can turn a dd-iw-stable algorithm into one with dd-LSB (see Appendix E.3 for the proof): Theorem 22. If satisfies 1 2 -dd-iw-stable with constants (c1, c2), then Algorithm 6 with 2 -dd-LSB with constants (c′1, c′2) where c′1 = O(c1) and c′2 = O(√c1 + c2). B is 1 as the base algorithm B Then we turn an algorithm with dd-LSB into one with data-dependent best-of-both-world guarantee (see Appendix D.2 for the proof): Theorem 23. If an algorithm satisfies 1 2 -dd-LSE, then the regret of Algorithm 1 with as the base algorithm A is upper bounded by O T t=1 ξt,At log2 T + c2 log2 T in the adversarial regime and O A c1E c1 log T hP 1) ∆ C + c2 log(T ) log(C∆− (cid:16)r i (cid:17) in the corrupted stochastic regime. c1 log T ∆ + (cid:16) q 6.2 Achieving LSB without excluding (cid:17) x Our reduction in Section 4.3 requires that the base algorithm . This } is sometimes not easy to implement for structural problems where actions share common components (e.g., MDPs or combinatorial bandits). To eliminate this requirement so that we can simply use a base algorithm that operates in the original action space called strongly-iw-stable: B , we propose the following stronger notion of iw-stability that we to operate in the action set of X \{ X b B x b 2 -strongly-iw-stable). An algorithm is 1 Definition 24 ( 1 2 -strongly-iw-stable if the following holds: given an adaptive sequence of weights q1, q2, (0, 1]X and the assertion that the feedback in round t is observed with probability qt(x) if the algorithm chooses At = x, it obtains the following pseudo regret guarantee for any stopping time t′: * * * ∈ t′ E " t=1 X (lt,At − lt,u) # ≤ E v u u t   t′ c1 t=1 X 10 1 qt(At) + c2 mint ≤ t′ minx qt(x)   . X t 1 Compared with iw-stability defined in Definition 8, strong-iw-stability requires the bound to have an addi- tional flexibility: if choosing action x results in a probability qt(x) of observing the feedback, the regret bound qt(At) . For the class of FTRL/OMD algorithms, strong-iw-stability holds if the stability needs to adapts to term is bounded by a constant no matter what action is chosen. Examples include log-barrier-OMD/FTRL for multi-armed bandits, SCRiBLe (Abernethy et al., 2008) or a truncated version of continuous exponential weights (Ito et al., 2020) for linear bandits. In fact, Upper-Confidence-Bound (UCB) algorithms also satisfy strong-iw-stability, though it is mainly designed for the pure stochastic setting; however, we will need this property when we design algorithms for adversarial MDPs, where the transition estimation part is done through UCB approaches. This will be demonstrated in Section 6.3. With strong-iw-stability, the second reduction only requires a base algorithm over P : is a 1 Theorem 25. If base algorithm satisfies 1 B 2 -strongly-iw-stable algorithm with constants (c1, c2), then Algorithm 7 with 2 -LSB with constants (c′0, c′1, c′2) where c′0 = c′1 = O(c1) and c′2 = O(√c1 + c2). B as the The proof is provided in Appendix E.4. 6.3 Application to MDPs Finally, we combine the techniques developed in Section 6.1 and Section 6.2 to obtain a best-of-both-world guarantee for tabular MDPs with a first-order regret bound in the adversarial regime. We use Algorithm 13 as the base algorithm, which is adapted from the UCB-log-barrier Policy Search algorithm by Lee et al. (2020) to satisfy both the data-dependent property (Definition 21) and the strongly iw-stable property (Definition 24). The corral algorithm we use is Algorithm 8, which takes a base algorithm with the dd-strongly-iw-stable prop- erty and turns it into a data-dependent best-of-both-world algorithm. The details and notations are all provided in Appendix H. The guarantee of the algorithm is formally stated in the next theorem. Theorem 26. Combining Algorithm 1, Algorithm 8, and Algorithm 13 results in an MDP algorithm with O S2AHL⋆ log2(T )ι2 + S5A2 log2(T )ι2 regret in the adversarial regime, and O H 2S2Aι2 log T ∆ + (cid:16)q H 2S2Aι2 log T ∆ C + S5A2ι2 log(T ) log(C∆− in the corrupted stochastic regime, where S is the number of states, A is the number of actions, H is the horizon, L⋆ is the cumulative loss of the best policy, and q ι = log(SAT ). (cid:17) (cid:17) 1) (cid:16) 7 Conclusion We provided a general reduction from the best-of-both-worlds problem to a wide range of FTRL/OMD al- gorithms, which improves the state of the art in several problem settings. We showed the versatility of our approach by extending it to preserving data-dependent bounds. Another potential application of our framework is partial monitoring, where one might improve the log2(T ) rates of to log(T ) for both the T 1 2 and the T 2 3 regime using our respective reductions. A weakness of our approach is the uniqueness requirement of the best action. While this assumption is typical in the best-of-both-worlds literature, it is not merely an artifact of the analysis for us due to the doubling procedure in the first reduction. Additionally, our reduction can only obtain worst-case ∆ dependent bounds in the stochastic regime, which can be significantly weaker than more refined notions of complexity. References Yasin Abbasi-Yadkori, Aldo Pacchiano, and My Phan. Regret balancing for bandit and rl model selection. arXiv preprint arXiv:2006.05491, 2020. 11 Jacob Abernethy, Elad Hazan, and Alexander Rakhlin. Competing in the dark: An efficient algorithm for bandit linear optimization. In 21st Annual Conference on Learning Theory, COLT 2008, 2008. Alekh Agarwal, Haipeng Luo, Behnam Neyshabur, and Robert E Schapire. Corralling a band of bandit algo- rithms. In Conference on Learning Theory, pages 12–38. PMLR, 2017. Noga Alon, Nicolo Cesa-Bianchi, Claudio Gentile, and Yishay Mansour. From bandits to experts: A tale of domination and independence. Advances in Neural Information Processing Systems, 26, 2013. Noga Alon, Nicolo Cesa-Bianchi, Ofer Dekel, and Tomer Koren. Online learning with feedback graphs: Be- yond bandits. In Conference on Learning Theory, pages 23–35. PMLR, 2015. Idan Amir, Guy Azov, Tomer Koren, and Roi Livni. Better best of both worlds bounds for bandits with switch- ing costs. In Advances in Neural Information Processing Systems, 2022. Raman Arora, Teodor Vanislavov Marinov, and Mehryar Mohri. Corralling stochastic bandit algorithms. In International Conference on Artificial Intelligence and Statistics, pages 2116–2124. PMLR, 2021. Peter Auer and Chao-Kai Chiang. An algorithm with nearly optimal pseudo-regret for both stochastic and adversarial bandits. In Conference on Learning Theory, pages 116–120. PMLR, 2016. Peter Auer, Nicolo Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine learning, 47:235–256, 2002a. Peter Auer, Nicolo Cesa-Bianchi, Yoav Freund, and Robert E Schapire. The nonstochastic multiarmed bandit problem. SIAM journal on computing, 32(1):48–77, 2002b. S ́ebastien Bubeck and Aleksandrs Slivkins. The best of both worlds: Stochastic and adversarial bandits. In Conference on Learning Theory, pages 42–1. JMLR Workshop and Conference Proceedings, 2012. S ́ebastien Bubeck, Nicolo Cesa-Bianchi, and Sham M Kakade. Towards minimax policies for online linear optimization with bandit feedback. In Conference on Learning Theory, pages 41–1. JMLR Workshop and Conference Proceedings, 2012. S ́ebastien Bubeck, Yuanzhi Li, Haipeng Luo, and Chen-Yu Wei. Improved path-length regret bounds for ban- dits. In Conference On Learning Theory, pages 508–528. PMLR, 2019. Cheng Chen, Canzhe Zhao, and Shuai Li. Simultaneously learning stochastic and adversarial bandits under the position-based model. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 6202–6210, 2022. Ashok Cutkosky, Christoph Dann, Abhimanyu Das, Claudio Gentile, Aldo Pacchiano, and Manish Purohit. Dynamic balancing for model selection in bandits and rl. In International Conference on Machine Learning, pages 2276–2285. PMLR, 2021. Liad Erez and Tomer Koren. Towards best-of-all-worlds online learning with feedback graphs. Advances in Neural Information Processing Systems, 34:28511–28521, 2021. Dylan J Foster, Claudio Gentile, Mehryar Mohri, and Julian Zimmert. Adapting to misspecification in contex- tual bandits. Advances in Neural Information Processing Systems, 33:11478–11489, 2020. Pierre Gaillard, Gilles Stoltz, and Tim Van Erven. A second-order bound with excess losses. In Conference on Learning Theory, pages 176–196. PMLR, 2014. 12 Anupam Gupta, Tomer Koren, and Kunal Talwar. Better algorithms for stochastic bandits with adversarial corruptions. In Conference on Learning Theory, pages 1562–1578. PMLR, 2019. Junya Honda, Shinji Ito, and Taira Tsuchiya. Follow-the-perturbed-leader achieves best-of-both-worlds for bandit problems. In International Conference on Algorithmic Learning Theory. PMLR, 2023. Jiatai Huang, Yan Dai, and Longbo Huang. Adaptive best-of-both-worlds algorithm for heavy-tailed multi- armed bandits. In International Conference on Machine Learning, pages 9173–9200. PMLR, 2022. Shinji Ito. On optimal robustness to adversarial corruption in online decision problems. Advances in Neural Information Processing Systems, 34:7409–7420, 2021a. Shinji Ito. Parameter-free multi-armed bandit algorithms with hybrid data-dependent regret bounds. In Confer- ence on Learning Theory, pages 2552–2583. PMLR, 2021b. Shinji Ito, Shuichi Hirahara, Tasuku Soma, and Yuichi Yoshida. Tight first-and second-order regret bounds for adversarial linear bandits. Advances in Neural Information Processing Systems, 33:2028–2038, 2020. Shinji Ito, Taira Tsuchiya, and Junya Honda. Adversarially robust multi-armed bandit algorithm with variance- dependent regret bounds. In Conference on Learning Theory, pages 1421–1422. PMLR, 2022a. Shinji Ito, Taira Tsuchiya, and Junya Honda. Nearly optimal best-of-both-worlds algorithms for online learning with feedback graphs. In Advances in Neural Information Processing Systems, 2022b. Tiancheng Jin and Haipeng Luo. Simultaneously learning stochastic and adversarial episodic mdps with known transition. Advances in neural information processing systems, 33:16557–16566, 2020. Tiancheng Jin, Longbo Huang, and Haipeng Luo. The best of both worlds: stochastic and adversarial episodic mdps with unknown transition. Advances in Neural Information Processing Systems, 34:20491–20502, 2021. Fang Kong, Yichi Zhou, and Shuai Li. Simultaneously learning stochastic and adversarial bandits with general graph feedback. In International Conference on Machine Learning, pages 11473–11482. PMLR, 2022. Tze Leung Lai, Herbert Robbins, et al. Asymptotically efficient adaptive allocation rules. Advances in applied mathematics, 6(1):4–22, 1985. Chung-Wei Lee, Haipeng Luo, Chen-Yu Wei, and Mengxiao Zhang. Bias no more: high-probability data- dependent regret bounds for adversarial bandits and mdps. Advances in neural information processing sys- tems, 33:15522–15533, 2020. Chung-Wei Lee, Haipeng Luo, Chen-Yu Wei, Mengxiao Zhang, and Xiaojin Zhang. Achieving near instance- optimality and minimax-optimality in stochastic and adversarial linear bandits simultaneously. In Interna- tional Conference on Machine Learning, pages 6142–6151. PMLR, 2021. Haipeng Luo. Homework 3 solution, introduction to online optimization/learning. http://haipeng-luo.net/courses/CSCI659/2022_fall/homework/HW3_solutions.pdf, November 2022. Haipeng Luo, Mengxiao Zhang, Peng Zhao, and Zhi-Hua Zhou. Corralling a larger band of bandits: A case study on switching regret for linear bandits. In Conference on Learning Theory, pages 3635–3684. PMLR, 2022. 13 Thodoris Lykouris, Vahab Mirrokni, and Renato Paes Leme. Stochastic bandits robust to adversarial corrup- tions. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, pages 114–122, 2018. Saeed Masoudian and Yevgeny Seldin. Improved analysis of the tsallis-inf algorithm in stochastically con- strained adversarial bandits and stochastic bandits with adversarial corruptions. In Conference on Learning Theory, pages 3330–3350. PMLR, 2021. Saeed Masoudian, Julian Zimmert, and Yevgeny Seldin. A best-of-both-worlds algorithm for bandits with delayed feedback. In Advances in Neural Information Processing Systems, 2022. Jaouad Mourtada and St ́ephane Ga ̈ıffas. On the optimality of the hedge algorithm in the stochastic regime. Journal of Machine Learning Research, 20:1–28, 2019. Aldo Pacchiano, Christoph Dann, and Claudio Gentile. Best of both worlds model selection. In Advances in Neural Information Processing Systems, 2022. Sasha Rakhlin and Karthik Sridharan. Optimization, learning, and games with predictable sequences. Advances in Neural Information Processing Systems, 26, 2013. Chlo ́e Rouyer, Yevgeny Seldin, and Nicolo Cesa-Bianchi. An algorithm for stochastic and adversarial bandits with switching costs. In International Conference on Machine Learning, pages 9127–9135. PMLR, 2021. Chlo ́e Rouyer, Dirk van der Hoeven, Nicol`o Cesa-Bianchi, and Yevgeny Seldin. A near-optimal best-of-both- worlds algorithm for online learning with feedback graphs. In Advances in Neural Information Processing Systems, 2022. Aadirupa Saha and Pierre Gaillard. Versatile dueling bandits: Best-of-both world analyses for learning from relative preferences. In International Conference on Machine Learning, pages 19011–19026. PMLR, 2022. Yevgeny Seldin and G ́abor Lugosi. An improved parametrization and analysis of the exp3++ algorithm for stochastic and adversarial bandits. In Conference on Learning Theory, pages 1743–1759. PMLR, 2017. Yevgeny Seldin and Aleksandrs Slivkins. One practical algorithm for both stochastic and adversarial bandits. In International Conference on Machine Learning, pages 1287–1295. PMLR, 2014. Taira Tsuchiya, Shinji Ito, and Junya Honda. Best-of-both-worlds algorithms for partial monitoring. arXiv preprint arXiv:2207.14550, 2022. Chen-Yu Wei and Haipeng Luo. More adaptive algorithms for adversarial bandits. In Conference On Learning Theory, pages 1263–1291. PMLR, 2018. Chen-Yu Wei, Christoph Dann, and Julian Zimmert. A model selection approach for corruption robust rein- forcement learning. In International Conference on Algorithmic Learning Theory, pages 1043–1096. PMLR, 2022. Julian Zimmert and Tor Lattimore. Connections between mirror descent, thompson sampling and the informa- tion ratio. Advances in Neural Information Processing Systems, 32, 2019. Julian Zimmert and Tor Lattimore. Return of the bias: Almost minimax optimal high probability bounds for adversarial linear bandits. In Conference on Learning Theory, pages 3285–3312. PMLR, 2022. Julian Zimmert and Yevgeny Seldin. An optimal algorithm for stochastic and adversarial bandits. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 467–475. PMLR, 2019. 14 Julian Zimmert, Haipeng Luo, and Chen-Yu Wei. Beating stochastic and adversarial semi-bandits optimally and simultaneously. In International Conference on Machine Learning, pages 7683–7692. PMLR, 2019. 15 17 23 27 33 33 35 35 35 38 40 44 46 49 49 50 51 54 55 55 57 62 Appendices A FTRL Analysis B Analysis for Variance-Reduced SCRiBLe (Algorithm 3 / Theorem 3) C Analysis for LSB Log-Determinant FTRL (Algorithm 4 / Lemma 5) D Analysis for the First Reduction D.1 BOBW to LSB (Algorithm 1 / Theorem 6) . . . . D.2 dd-BOBW to dd-LSB (Algorithm 1 / Theorem 23) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E Analysis for the Second Reduction E.1 E.2 E.3 E.4 E.5 1 1 2 2 -LSB to 1 3 -LSB to 2 2 -dd-LSB to 1 2 -LSB to 1 2 -dd-LSB to 1 2 -iw-stable (Algorithm 2 / Theorem 11) . . . . . . 3 -iw-stable (Algorithm 5 / Theorem 18) . . . . . . 2 -dd-iw-stable (Algorithm 6 / Theorem 22) . . 2 -strongly-iw-stable (Algorithm 7 / Theorem 25) . . . . . . . . . . . . . . . . . . . . . 2 -dd-strongly-iw-stable (Algorithm 8 / Lemma 42) . . . 1 1 F Analysis for IW-Stable Algorithms . . . . . F.1 EXP2 (Algorithm 9 / Lemma 9) . . . . . . . . . . . . . . . F.2 EXP4 (Algorithm 10 / Lemma 10) . . . . . . . . . . . . . . 1/ log(K))-Tsallis-INF (Algorithm 11 / Lemma 14) . . F.3 F.4 EXP3 for weakly observable graphs (Algorithm 12 / Lemma 17) . . . . . . . . . . . . . (1 − . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G Surrogate Loss for Strongly Observable Graph Problems H Tabular MDP (Theorem 26) H.1 Base algorithm . . H.2 Corraling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 A FTRL Analysis Lemma 27. The optimistic FTRL algorithm over a convex set Ω: pt = argmin Ω (* p ∈ p, 1 t − τ =1 X lτ + + mt + ψt(p) ) guarantees the following for any t′: t′ pt h t=1 X u, lt − i ≤ ψ0(u) − min p Ω ∈ t′ ψ0(p) + (ψt(u) t=1 X 1(u) ψt − − − ψt(pt) + ψt − 1(pt)) + t′ t=1 X max p Ω ∈ pt ( h − p, lt mt − i − Dψt(p, pt)) . stability Proof. Let Lt , + ψt(p). Therefore, 1 + mt pt is the minimizer of Ft over Ω. Let p′t+1 be minimizer of Gt over Ω. Then by the first-order optimality condition, we have t τ =1 lτ . Define Ft(p) = + ψt(p) and Gt(p) = p, Lt p, Lt P − i i h h {z | } Ft(pt) − Gt(p′t+1) ≤ Ft(p′t+1) − Gt(p′t+1) − Dψt(p′t+1, pt) = p′t+1, lt −h mt − i − Dψt (p′t+1, pt). (1) By definition, we also have Gt(p′t+1) − Ft+1(pt+1) ≤ Gt(pt+1) − Ft+1(pt+1) = ψt(pt+1) ψt+1(pt+1) . pt+1, mt+1i − h − (2) Thus, t′ t=1 X pt, lt h i t′ pt, lt h (cid:0) pt, lt h (cid:0) pt, lt h (cid:0) p′t+1, lt i − h mt − i − Dψt (p′t+1, pt) + Gt(p′t+1) p′t+1, lt i − h mt − i − Dψt (p′t+1, pt) + Gt − 1(p′t) (by (1)) − − Ft(pt) (cid:1) Ft(pt) + Gt′ (p′t′+1) G0(p′1) − (cid:1) p′t+1, lt i − h mt − i − Dψt (p′t+1, pt) ψt(pt) + ψt − 1(pt) pt, mt − h − + Gt′(p′t′+1) G0(p′1) − i (cid:1) p′t+1, lt mt − i − − Dψt(p′t+1, pt) − pt h (cid:0) ψt(pt) + ψt 1(pt) + Gt′ (u) min p Ω − ∈ (by (2), using that p′t′+1 is the minimizer of Gt′ ) ψ0(p) − (cid:1) t=1 X t′ t=1 X t′ t=1 X t′ t=1 X t′ ≤ = = ≤ = pt max p ∈ Ω {h p, lt mt − i − − Dψt(p, pt) } − ψt(pt) + ψt − 1(pt) (cid:19) t′ t=1 (cid:18) X + u, lt h t=1 X i + ψt′(u) ψ0(p) − min p Ω ∈ 17 t′ = t=1 (cid:18) X pt max p ∈ Ω {h p, lt mt − i − − Dψt(p, pt) } − ψt(pt) + ψt − 1(pt) (cid:19) t′ + t′ u, lt h t=1 X i + ψt′(u) ψ0(p) − min p Ω ∈ = t=1 (cid:18) X pt max p ∈ Ω {h p, lt mt Dψt(p, pt) } i − − − + (ψt(u) 1(u) ψt − − − ψt(pt) + ψt − 1(pt)) (cid:19) t′ + u, lt h t=1 X i + ψ0(u) ψ0(p) − min p Ω ∈ Re-arranging finishes the proof. Lemma 28. Consider the optimistic FTRL algorithm with bonus bt 0: ≥ 1 t − (lτ p, pt = argmin p Ω (* ∈ τ =1 X β ψLo(p) where ψTs(p) = − 1 − 1 α bτ ) + − + mt + ψt(p) ) i pα i for some α ∈ (0, 1), ψLo(p) = i ln 1 pi , and ηt ψTs(p) + 1 with ψt(p) = 1 ηt is non-increasing. We have t′ pt h t=1 X u, lt − i ≤ 1 1 − α K 1 − η0 α + 1 t′ K 1 − α t′ t=1 (cid:18) X 1 ηt − 1 ηt − + 2β t=1 X (0, 1) and any lTs i=1 X t , bTs p2 t,i(lLo t,i − wt)2 + (cid:18) 1 + RK, lLo t , bLo t ∈ t ∈ P 1 (cid:19) 1 α (cid:19) K i=1 X t′ pα t,i − + 1 ! K ln 1 δ β + 1 α t′ P t′ ηt K t=1 X t′ i=1 X pt, bt h i − t=1 X R such that + δ u, bt h t=1 X i − t=1 (cid:28) X u + for any δ ∈ for all t, i. RK, xt, wt ∈ t = lt t = bt t + lLo lTs t + bLo bTs mt, − 1 4 1 4 , , ηtp1 − t,i α (lTs t,i − xt) ≥ − βpt,i(lLo wt) t,i − α ηtp1 t,i bTs − 0 ≤ 0 t,i ≤ , ≥ − 1 4 1 4 βpt,ibLo t,i ≤ ≤ 18 α p2 t,i (lTs − t,i − xt)2 1 K 1, lt − bt . (cid:29) (3) (4) (5) (6) (7) (8) Proof. Let u′ = (1 δ)u + δ K − 1. By Lemma 27, we have t′ t=1 X pt h − u′, lt bt − i ≤ 1 ≤ 1 1 − + 1 − + + + + K i=1 X 1 η0 α t′ pα 1,i + 1 − 1 α t′ t=1 (cid:18) X 1 ηt − 1 ηt K i=1 X (cid:0) max p pt h − p, lt bt − − mt i − DψTs(p, pt) − 1 (cid:19) 1 ηt pα t,i − α u′ i + 1 β K i=1 X ln p1,i u′i (cid:1) 1 β − DψLo(p, pt) (cid:19) t=1 X α K 1 − η0 α t′ t=1 X t′ t=1 X t′ t=1 X t′ t=1 X max p | max p | max p | max p (cid:18) + (cid:18) (cid:18) (cid:18) (cid:18) 1 − 1 α t′ t=1 (cid:18) X 1 ηt − 1 ηt − pt h − p, lTs − xt1 i − stability-1 1 (cid:19) 1 2ηt pα t,i − + 1 ! K ln 1 δ β K i=1 X DψTs(p, pt) (cid:19) } (cid:19) } pt h − p, − bTs t 1 {z i − 1 2ηt DψTs(p, pt) (cid:19) stability-2 pt h − p, lLo − {z wt1 1 2β i − } DψLo (p, pt) stability-3 pt h − p, − bLo t 1 {z i − 1 2β DψLo (p, pt) (cid:19) stability-4 p, 1 i − = 0. where in the last inequality we use pt | h By Problem 1 in Luo (2022), we can bound stability-1 by ηt xt)2 under the condition α K (5). Similarly, stability-2 can be upper bounded by ηt α i=1 p2 t,i bTs2 t,i under the condition − P α K i=1 p2 wt)2 under the condition (6). Similarly, (7). Using Lemma 30, we can bound stability-3 by 2β t,i(lLo t,i − P K we can bound stability-4 by 2β t,i under (8). Collecting all terms and using the i=1 pt,ibLo definition of u′ finishes the proof. } K α i=1 p2 t,i (lTs − t,i − K 1 i=1 pt,ibTs α K i=1 p2 t,ibLo2 t,i ≤ t,i ≤ P P {z P P Lemma 29. Consider the optimistic FTRL algorithm with bonus bt 0: ≥ pt = argmin p, Ω (* p ∈ 1 t − τ =1 X (lτ − bτ ) + + mt + ψt(p) ) with ψt(p) = 1 ηt i ln 1 pi , and ηt is non-increasing. We have t′ P pt h − u, lt i ≤ t=1 X K ln 1 δ ηt′ + 2 t′ K + 2 ηt t=1 X i=1 X t′ t′ p2 t,i(lt,i mt,i − − xt)2 pt, bt h i − u, bt h t=1 X + δ i t=1 X R if the following hold: ηtpt,i(lt,i t′ t=1 (cid:28) X mt,i − u + 1 K 1, lt − bt . (cid:29) − xt) ≥ − 1 4 and ηtpt,ibt,i 1 4 for all ≤ − for any δ t, i. ∈ (0, 1) and any xt ∈ 19 Proof. Let u′ = (1 − δ)u + δ K 1. By Lemma 27 and letting η0 = , we have ∞ t′ t=1 X pt h − u′, lt bt − i ≤ ≤ t′ K ln i=1 (cid:18) t=1 X X K ln K δ ηt′ + pt,i u′i (cid:19) (cid:18) t′ max p (cid:18) t=1 X 1 ηt − 1 ηt − 1 (cid:19) + t′ t=1 X max p pt ( h − p, lt bt − − mt i − Dψt(p, pt)) pt h − p, lt − mt − xt1 i − 1 2 Dψt (p, pt) (cid:19) } t′ + t=1 X max p | pt h (cid:18) p, bt − − i − 1 2 stability-2 stability-1 {z Dψt(p, pt) (cid:19) } | where in the last inequality we use pt h {z Using Lemma 30, we can bound stability-1 by 2ηt p, 1 i = 0. − xt)2, and bound stability-2 by t,i(lt,i K i=1 pt,ibt,i under the specified conditions. Collecting all terms and using the definition of mt,i − − K i=1 p2 P K i=1 p2 2ηt u′ finishes the proof. t,i ≤ t,ib2 P P Lemma 30 (Stability under log barrier). Let ψ(p) = 1 β Then i ln 1 pi , and let lt ∈ RK be such that βpilt,i 1 2 . ≥ − max ∆([K]) {h ∈ pt p − p, lt i − Proof. P Dψ(p, pt) } ≤ βp2 t,il2 t,i. i X max ∆([K]) {h ∈ pt p − p, lt i − Dψ(p, pt) } ≤ pt max + {h RK q ∈ q, lt Dψ(q, pt) } i − − Define f (q) = − under the specified conditions, we have Dψ(q, pt). Let q⋆ be the solution in the last expression. Next, we verify that + such that f (q⋆) = 0. It suffices to show that there exists q ∇ f (q) = 0 since if such q exists, then it must the maximizer of f and thus q⋆ = q. pt h q, lt i − RK ∈ ∇ f (q)]i = [ ∇ lt,i [ ∇ − − ψ(q)]i + [ ∇ ψ(pt)]i = lt,i + − 1 βqi − 1 βpt,i 1 βpt,i − − lt,i < 0 for all i. and so ∇ f (q) = 0 has solution in R+, which is By the condition, we have qi = + ηt,ilt,i 1 pt,i Therefore, (cid:16) 1 − . f (q⋆) = (cid:17) ∇ lt − pt max + {h RK q ∈ q, lt − i − − ∇ Dψ(q, pt) } ψt(q⋆) + ψt(pt) = 0, and we have ∇ = pt h − q⋆, ∇ ψ(pt) − ∇ ψ(q⋆) i − Dψ(q⋆, pt) = Dψ(pt, q⋆). It remains to bound Dψ(pt, q⋆), which by definition can be written as Dψ(pt, q⋆) = 1 β h pt,i q⋆ i (cid:19) (cid:18) i X 20 where h(x) = x By the fact that ln(1 + x) ln(x). By the relation between q⋆ x2 for all x − − x 1 ≥ − 1 2 , we have ≥ − i and pt,i we just derived, it holds that pt,i q⋆ i = 1+βpt,ilt,i. h pt,i q⋆ i (cid:19) (cid:18) = βpt,ilt,i − ln(1 + βpt,ilt,i) β2p2 t,il2 t,i ≤ which gives the desired bound. Lemma 31 (Stability under negentropy). If ψ is the negentropy ψ(p) = η > 0 the stability is bounded by pt max ≥0h RK p ∈ p, lt − i − If lt > − 1 η , then the stability is bounded by pt max ≥0h RK p ∈ p, lt − i − 1 η 1 η instead. Dψ(p, pt) η 2 ≤ i X Dψ(p, pt) η ≤ pt,il2 t,i . i X i pi log pi and lt,i > 0, then for any P pt,il2 t,i . Proof. Let fi(pi) = (pt,i is upper bounded by maximizing the expression in each coordinate for pi pi)lti 1 η (pi(log pi 1) − − − − pi log pt,i + pt,i). Then we maximize 0. We have ≥ P i fi(pi), which f ′i(p) = lt,i − − 1 η (log p − log pt,i), and hence the maximum is obtained for p⋆ = pt,i exp( − ηlt,i). Plugging this in leads to fi(p⋆) = pt,ilt,i(1 = pt,ilt,i − for non-negative lt and − pt,i η exp( ηlt,i)) 1 η ( − − pt,i exp( − ηlt,i)ηlt,i + pt,i(1 − − (1 − exp( − ηlt,i)) ≤ pt,ilt,i pt,i η − (cid:18) ηlt,i 1 2 − η2l2 t,i (cid:19) fi(p∗) ≤ ηpt,il2 t,i exp( ηlt,i))) − η 2 = pt,il2 t,i , for lt,i and exp( proof. ≥ − x) − 1/η respectively, where we used the bound exp( 1 − ≤ x + x2, which holds for x ≥ − 0 1 respectively. Summing over all coordinates finishes the 2 which holds for any x x) − ≤ − ≥ 1 x + x2 Lemma 32 (Stability of Tsallis-INF). For the potential ψ(p) = 0 and any positive learning rate η > 0, we have negative loss lt ≥ i − P pα i − α(1 α) , any pt ∈ ∆([K]), any non- p max p h − pt, lt i − 1 η Dψ(p, pt) η 2 ≤ α p2 − i l2 t,i . i X 21 Proof. We upper bound this term by maximizing over p optimal p⋆ satisfies p⋆ pi in all components. We have 0 instead of p ∈ ≥ ∆([K]). Since lt is positive, the Dψ(p⋆, pt) = i ≤ K p⋆ i pt,i i=1 Z X pα 1 − t,i − 1 − 1 − pα α dp = K p⋆ i p e i=1 Z X pt,i Z pt,i pα − 2 dp d p ≥ e = K p⋆ i p e pt,i pt,i Z i=1 Z X K 1 2 (p⋆ i − i=1 X pα 2 p t,i dp d − pt,i)2pα − t,i 2 e . By AM-GM inequality, we further have p max p h − pt, lt i − 1 η Dψ(p, pt) max p ≤ (pi − pt,i)lt,i − i X (pi − 2 pt,i)2pα − t,i 2η η 2 ! ≤ α p2 t,i l2 − t,i . i X 22 B Analysis for Variance-Reduced SCRiBLe (Algorithm 3 / Theorem 3) Algorithm 3 VR-SCRiBLe Define: Let ψ( ) be a ν-self-concordant barrier of conv( * for t = 1, 2, . . . do Receive mt Rd. Compute Rd. ) ⊂ X ∈ wt = argmin w conv( ∈ X w, ) (* 1 t − τ =1 X lτ + mt + 1 ηt + ψ(w) ) b (9) where ηt = min   1 16d , ν log T t 1 − τ =1 k lτ mτ 2 H −1 k τ − v u u t P 2ψ(wt). where Ht = Sample st uniformly from Sd (the unit sphere in d-dimension). Define ∇  b .    w+ t = wt + H − t 1 2 st, w−t = wt − 1 2 st. H − t Find distributions q+ t and q−t over actions such that w+ t = q+ t,xx, w−t = q−t,xx x X ∈X x X ∈X , receive lt,At ∈ [ − 1, 1] with E[lt,x] = x, lt h , and define i mt,At) lt = d(lt,At − b q−t,At q+ t,At − q+ t,At + q−t,At ! 1 2 t st + mt H Sample At ∼ qt , q+ t +q− 2 t where mt,x := x, mt h . i Lemma 33. In Algorithm 3, we have E lt = lt and E lt − 2 mt (cid:13) (cid:13) (cid:13) where pt,x is the probability of choosing action x in round t. (cid:20)(cid:13) (cid:13) (cid:13)b " x X ∈X −2ψ(wt) ∇ ≤ (cid:21) i h b d2E pt,x, 1 min { pt,x (lt,x } − − mt,x)2 . # 23 H 1 2 t st + mt # (note that q+ t , q−t depend on st) Proof. E lt = E i h b d(lt,At − " mt,At) = E dE " (lt,At − " mt,At) t st + mt # 1 2 H q−t,At q+ t,At − q+ t,At + q−t,At ! q+ q−t,At t,At − q+ t,At + q−t,At ! (cid:12) (cid:12) q+ (cid:12) q−t,x t,x − (cid:12) q+ t,x + q−t,x ! (cid:12) (cid:12) (cid:12) q−t,x (cid:12) H mt,x) st # st q+ t,x − 2 # ! (cid:12) (cid:12) (cid:12) (cid:12) t st + mt 1 2 H (cid:21) st 1 2 t st + mt H # # 1 2 t st + mt # = E = E dE " dE " = E dE qt,x(lt,x " x X − " x h X w+ h t − x, lt mt − i mt − w−t , lt 2 i st (cid:12) (cid:21) (cid:12) (cid:12) t st + mt (cid:12) 1 2 = E (cid:20) (cid:20) (cid:20) H − d h 1 2 st, lt mt H i − 1 2 1 2 t sts⊤t H − t (lt − mt) + mt = E dH (cid:20) = lt. (cid:21) (cid:21) (because E[sts⊤t ] = 1 d I) mt − E lt (cid:20)(cid:13) (cid:13) (cid:13)b 2 ∇ (cid:13) (cid:13) (cid:13) −2ψ(wt) (cid:21) = E = E = E E ≤       " d2(lt,At − mt,At)2 d2(lt,At − mt,At)2 q−t,At q+ t,At − q+ t,At + q−t,At ! q−t,At q+ t,At − q+ t,At + q−t,At ! 2 2 (cid:13) (cid:13) (cid:13) (cid:13)  1 2 t st H 2 H −1 t   (cid:13) (cid:13) (cid:13) (cid:13) E E   " x X d2(lt,At − mt,At)2 2  q−t,At q+ t,At − q+ t,At + q−t,At ! qt,xd2(lt,x mt,x)2 − q+ q−t,x t,x − q+ t,x + q−t,x (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)     # # st (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) st (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) For any x, we have qt,x qt,x and Therefore, we continue to bound E q− q+ t,x− t,x t,x+q− q+ (cid:12) (cid:12) (cid:12) (cid:12) qt,x ≤ t,x (cid:12) (cid:12) q+ (cid:12) q−t,x t,x − (cid:12) q+ t,x + q−t,x (cid:12) (cid:12) (cid:12) (cid:12) lt (cid:12) − (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) = | q+ t,x − 2 q−t,x| q+ t,x + q−t,x 2 1 − ≤ = 1 − qt,x. 2 mt −2ψ(wt) by (cid:21) (cid:20)(cid:13) (cid:13) (cid:13)b ∇ (cid:13) (cid:13) (cid:13) qt,x, 1 min { E E " " x X ∈X E ≤ " x X ∈X min pt,x, 1 − pt,x d2(lt,x (cid:8) (cid:9) (E[min( , * )] * − ≤ 24 qt,x d2(lt,x } − − mt,x)2 (cid:12) (cid:12) (cid:12) (cid:12) mt,x)2 (cid:12) st # # . # ]) and pt,x = E[E[qt,x ], E[ min(E[ * * st]]) | Lemma 34. If ηt ≤ 1 16d , then maxw Proof. We first show that ηt lt k − wt h w, lt − (cid:16) mt k∇ b −2ψ(wt) ≤ mt 1 ηt Dψ(w, wt) i − − (cid:17) 1 16 . By the definition of 8ηt lt k ≤ − mt 2 k ∇ −2ψ(wt). lt, we have b Define −2ψ(wt) ≤ 1 16d * H d k 1 2 t st b t ≤ kH −1 1 16 . mt − b ηt lt (cid:13) (cid:13) (cid:13)b ∇ (cid:13) (cid:13) (cid:13) F (w) = wt h − w, lt − mt i − 1 ηt Dψ(w, wt). Define λ = mt because this leads to lt k − b −2ψ(wt). Let w′ be the maximizer of F . it suffices to show b k∇ w′ − k wt k∇ 2ψ(wt) ≤ 8ηtλ wt w′ − k 0. To see why this is the case, notice that F (wt) = 0, and F (w′) F (w′) w′ wt 8ηtλ2. lt mt 2ψ(wt)k −2ψ(wt) ≤ − − k∇ k∇ ≤ k 8ηtλ, it suffices to show that for all u such that b 2ψ(wt) = 8ηtλ, 0 because w′ is the maximizer 2ψ(wt) > 8ηtλ, then there exists u in the line segment between wt and w′ with , contradicting that F is strictly concave. F (wt), F (w′) min 0 ≤ } { 2ψ(wt) = 8ηtλ. By Taylor expansion, there exists u′ in the line u k k∇ wt − ≥ To show F (u) of F . Therefore, if u k k∇ wt ≤ 2ψ(wt) ≤ k∇ w′ − k wt k∇ 2ψ(wt) = 8ηtλ such that F (u) wt − Below, consider any u with u k segment between u and wt such that − ≤ k∇ F (u) u ≤ k − wt k∇ 2ψ(wt)k lt mt −2ψ(wt) − k∇ 1 2ηt k u wt u 2ψ(wt) ≤ k k∇ − − b u′ − k − wt wt 2 k ∇ 2ψ(u′). 2ψ(wt) = 8ηtλ k∇ 1 2 , we have ≤ Because ψ is a self-concordant barrier and that 2ψ(u′) 1 4 ∇ (cid:23) ∇ 2ψ(wt). Continuing from the previous inequality, F (u) u ≤ k wt lt 2ψ(wt)k k∇ − − mt −2ψ(wt) − k∇ 1 8ηt k u wt 2 k ∇ − 2ψ(wt) = 8ηtλ λ * − (8ηtλ)2 8ηt = 0. This concludes the proof. b Proof of Theorem 3. By the standard analysis of optimistic-FTRL and Lemma 34, we have for any u, T E " t=1 X (lt,At − lt,u) # O E ≤ ν log T ηT " ν log T E = O   v u u t T + ηt lt (cid:13) (cid:13) (cid:13)b − t=1 X T lt " t=1 (cid:13) X (cid:13) (cid:13)b mt − 2 mt (cid:13) (cid:13) (cid:13) 2 ∇ (cid:13) (cid:13) (cid:13) −2ψ(wt)#! −2ψ(wt)# ∇ + dν log(T )  .  (by the tuning of ηt) (10) In the adversarial regime, using Lemma 33, we continue to bound (10) by T ν log T E (lt,At − " t=1 X O d v u u t   mt,At)2 # + dν log(T )   25 When losses are non-negative and mt = 0, we can further upper bound it by T " t=1 X lt,At # + dν log(T )  .  , we can further get the first-order regret bound of Then solving the inequality for E T  hP O d  ν log T E v u u t T t=1 lt,At i O E " (lt,At − t=1 X lt,u) # ≤ ν log T E T " t=1 X d   v u u t lt,u # + dν log(T )  .  In the corrupted stochastic setting, using Lemma 33, we continue to bound (10) by T ν log(T )E O    dv u u u t   t=1 X (1  − pt,u)(lt,u −  T mt,u)2 + pt,x(lt,x =u x X mt,x)2 −        O d ν log(T )E (1 pt,u) . ≤  #  Then by the self-bounding technique stated in Proposition 2, we can further bound the regret in the corrupted stochastic setting by t=1 X  − " v u u t O d2ν log(T ) ∆ + d2ν log(T ) ∆ C . ! r 26 6 C Analysis for LSB Log-Determinant FTRL (Algorithm 4 / Lemma 5) Algorithm 4 LSB-logdet x Input: . (= 0 { Define: Let π be John's exploration over (cid:0) (cid:1) (cid:1) X for t = 1, 2, . . . do ), } x = X (cid:0) 0 1 b Let . H(α) := Ex ∼ X α[xx⊤] , μα := Ex α[x]. ∼ ηt = min 1 4d , ( s log(T ) t 1 τ =1(1 − t 1 − − pτ, , x) ) b P μα, pt := argmin ) * x α τ =1 X ∪{b } X ηtd)pt + ηtd((1 ∈ pt := (1 ∆( log det H(α) 1 ηt lτ b − + − pt, x)π b + pt, X (cid:16) x) xπ b b − μαμ⊤α , (cid:17) − x denotes the sampling distribution that picks b where π Sample an action At Construct loss estimator: e e ∼ pt. x with probability 1. b lt(a) = a⊤ H( pt) b (cid:16) e μ ptμ⊤ pt e e − 1 − (cid:17) at μ pt e − lt(at) . (cid:0) (cid:1) We begin by using the following simplifying notation. For a distribution α ,x = αx restricted distribution over αbx 1 − such that α , i.e. α α over X ∝ X X X ∆( ∈ for any x X ∪ { as the x ), we define α } . We further define ∈ X b X α[xx⊤] , μα = Ex α[x], ∼ H(α) = Ex ∼ V α = H(α) H G(α) = H(α G V α = G(α) − X μαμ⊤α , ), mα = μαX , mαm⊤α . − Lemma 35. Assume α ∈ the following properties: ∆( x )) is such that GV } α is of rank d − 1 (i.e. full rank over ). Then we have X X ∪ { H V α = (1 [H V α ]− − 1 = 1 G α x) b 1 (cid:16) α x (cid:18) b b V x(mα α + α − b V V α]+mα α]+ + [G b [G x)(mα where [GV − α]+ denotes the pseudo-inverse. x)⊤ , − x⊤ + b (cid:17) V α]+ + xm⊤α [G mα 2 [GV k α]+ + k (cid:18) 1 α x (cid:19) b x x⊤ , (cid:19) b b b b Proof. The first identity is a simple algebraic identity H V α = H(α) μαμ⊤α = (1 V α + α G α − x(mα b − x) α b x⊤ x x)G(α) + α x b b x)⊤ b b x)(mα − − − , ((1 α x)mα + α x b b − x)((1 α x)mα + α x b b x)⊤ − b b = (1 − (cid:16) which holds for any α. For the second identity note that by the definition of we have GV α x = 0. Furthermore GV b α]+ = I x = [GV α[GV α]+ x− x b (cid:17) − 0 1 1 due to the rank d (cid:0) x = (cid:1) − b x and = 0, : 1 assumption. Multiplying x, h ∈ X x ∀ i b b b 27 b b the two matrices yields [G V V α]+mα α]+ + [G x⊤ + V α]+ + xm⊤α [G G V α + α x(mα b x)(mα x)⊤ − − (cid:16) = I = I − − x x⊤ + mα b x⊤ + α b x(mα b x b x⊤ + mα b x⊤ b (mα − − * (cid:18) x) (cid:17) − x) (cid:18) x⊤ = I b [G V α]+mα + b mα k k 2 [GV b x α]+ − b mα k 2 [GV k α]+ + 1 α (cid:18) V α]+mα [G − mα k k (cid:18) x x⊤ x (cid:19) b 1 b b α]+ + α x (cid:19) b 2 [GV b b b which implies for any x, y b b span( X ) ∈ V α ]− V α ]− x, [H h x, [H h 1y i 1( x = h i , x, [GV α]+y α 1 x − b = 0, mα) i 1 α (1 − [0, 1]: . x)α x b b x k − mα k − 2 α]−1 = [H V b Lemma 36. Let π1, π2 ∈ ∆( X ∪ { x ), then for any λ } b ∈ Proof. Simple algebra shows H b V λπ1+(1 λ)π2 (cid:23) − λH V π1 . ⊤ (cid:19) x (cid:19) b (11) (12) (13) H V λπ1+(1 − λ)π2 = λH V π1 + (1 − λ)H V π2 + λ(1 λ)(μπ1 − μπ2)(μπ1 − − μπ2)⊤ . Lemma 37. Let π x : ∈ X ∆( X ∈ ) be arbitrary, and ̃π = (1 ηtd)π + ηtdπ for (ηtd) X ∈ − (0, 1), then it holds for any mπ k − m ̃π k[GV ̃π]+ x k − m ̃π k[GV ̃π]+ ≤ ≤ s 2 √ηt ηtd ηtd 1 − Proof. We have hence G V V πX + (1 π = ηtdG e − V π + ηtd(1 ηtd)G ηtd)(mπ mπX )(mπ mπX )⊤ , − − − mπ k − m ̃π 2 ̃π]+ = (ηtd)2 [GV k mπ k mπX k 2 [ηtdGV πX − +(1 − ηtd)GV π +ηtd(1 − ηtd)(mπ − mπX )⊤]−1 (ηtd)2 mπ k mπX k − 2 [ηtd(1 − ≤ ηtd)(mπ mπX )(mπ − − For the second inequality, we have mπX )⊤]+ = mπX )(mπ ηtd − ηtd 1 − x k − m ̃π k[GV ̃π]+ ≤ k m ̃π x − 1 √ηtd mπX k[GV x ̃π]+ + k mπX k[GV − πX − ]+ + mπX k[GV ̃π]+ mπX k[GV m ̃π − k ≤ k (cid:16) ]+ πX ≤ 2 √ηt (cid:17) d for all x mπX k 2 [GV πX ]+ ≤ where the last inequality uses that John's exploration satisfies x k − 28 . , . ∈ X Lemma 38. The Bregman divergence between two distributions α, β over F (α) = is bounded by log det H V α x X ∪ { } with respect to the function − (cid:0) (cid:1) D(α, β) ≥ Dlog(α x, β b x) + Dlog(1 b α x, 1 b − − β x) + b 1 1 − − b mα α x b β x k b mβ 2 [GV β]+ k − where Dlog is the Bregman divergence of log(x). − Proof. We begin by simplifying F (α). Note that H V α = (1 α x) − b V (cid:16) α]+mα x[G b x⊤ V 2 M α + α x b V (cid:16) (cid:17) α]+mα x[G x)(√α b b G − G − V α + α x b x))⊤ − b 1 2 , x⊤ (cid:17) x⊤. x 1 M = I + (√α M is a matrix with d of the remaining eigenvalues is given by considering the determinant of the 2 [GV [GV k 2 eigenvalues of size 1, since it is the identity with two rank-1 updates. The product 2 sub-matrix with coordinates x. We have that α]+mα α]+mα and × − b b b b k b det(M ) = x⊤M b = 1 * (cid:18) Hence we have M * x m⊤α [GV [GV k b 1 + α x b α]+ α]+mα k V α]+mα [G k 2 [GV [GV α]+mα α]+mα x⊤M − k [G (cid:18) V α]+mα b α]+mα α]+mα [GV [GV k = 1. 2 k (cid:19) α x b − (cid:13) (cid:13) (cid:13) (cid:19) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 2 (cid:13) (cid:13) (cid:13) F (α) = x) b 1 is the determinant over the first d log(1 − − α Where detd The derivative term is given by − α h β, F (β) i ∇ − = log(α x) b − log detd 1((1 − 1 eigenvalues of the submatrix of the first (d α V α) x)G b − − − 1) coordinates. − (αx βx) x k − μβ k − 2 [H V β ]−1 Xx x } ∈X ∪{b 2 μβ [H V k − d β ]−1 − αx(x μβ)(x − − μβ)⊤[H V β ]− 1  − − + μβ)(μα μα k − μβ)⊤ [H V β ]−  1 2 [H V k (cid:17) β ]−1 − d. (cid:17) − μβ − d d = x Xx } ∈X ∪{b αx x k = Tr = Tr   x Xx } ∈X ∪{b V α + (μα H = Tr (cid:16)(cid:16) H V α [H V β ]− 1 The first term is Tr H V α [H V β ]− 1 (cid:16) (cid:17) (cid:16) = Tr (1 (cid:16) = Trd − = Trd − 1 1 − 1 1 (cid:18) 1 1 (cid:18) α (cid:17) V α[H x)G b V β ]− 1 α x b β x b α x b β x b − − − − (cid:17) V V β ]+ α[G G G V V β ]+ α[G (cid:19) (cid:19) + α x(1 b α x) b k x − − mα 2 [H V k β ]−1 + α x(1 b α x) b − b (cid:16) x k + α β x(1 b x(1 b α β x) b x) b − − + − x(1 b α b mβ 2 [H V β ]−1 + k mα k α x) b − mα mβ k 1 − − β x b mβ − 2 [GV k β]+ (by Lemma 35) (by Lemma 35) 2 [H V k β ]−1 (cid:17) . (by (13)) 29 The norm term is μβ 2 [H V β ]−1 μα k = − μα k = (1 (1 = k (α x − b x)2 α b x)2 α b − − x + (1 mα b k mα k 1 − − − β x b β ]−1 + x − b α − mβ k mβ k 2 x)mβ) [H V k b 2 β ]−1 + (α [H V 2 [GV β]+ + (α β x − b x(1 − b (α x k b x)2 β b x)2 β b x) β b . α x)mβ) b − μβ 2 [H V k β ]−1 x + (1 − mβ x b k − 2 [H V β ]−1 k Combining both terms 1 − ∇ β, α h = Trd F (β) i α x b β x b α x b β x b Combining the everything − − − − 1 1 1 1 = Trd (cid:18) (cid:18) − − 1 G V V β ]+ α[G α x(1 b + G V V β ]+ α[G (cid:19) (cid:19) + α x b β x b + − x) + (α α b x(1 β β − b α 1 x − b β 1 x − − b x − b x) b 1 + b x)2 β b + 1 1 − − α x b β x k b 1 1 − − mα α x b β x k b mα mβ 2 [GV k β]+ − d − mβ 2 [GV k β]+ − − d . D(α, β) = Dlog(α x, β b x) + Dlog(1 b Dlog(α x, β b x) + Dlog(1 b ≥ α x, 1 b − − β x) + b α x, 1 b − − β x) + b 1 1 1 1 − − − − α x b β x k b α x b β x k b mα mα mβ 2 [GV k β]+ + Dd − mβ 2 [GV k β]+ , − − (1 1 (cid:16) α V α, (1 x)G b β V x)G β b − − (cid:17) where the last inequality follows from the positiveness of Bregman divergences. Lemma 39. For any b (0, 1), any x ∈ R and η ∈ ≤ Proof. The statement is equivalent to a sup [0,1] | α ∈ b x | − − 2 | 1 η 1 x , it holds that | Dlog(a, b) ηb2x2 . ≤ sup [0,1] a ∈ f (a) = sup [0,1] a ∈ a)x (b − − 1 η Dlog(a, b) ηb2x2 , ≤ since x can take positive or negative sign. The function is concave, so setting the derivative to 0 is the optimal solution if that value lies in (0, ). ∞ f ′(a) = x + − 1 η 1 a − 1 b (cid:19) (cid:18) a⋆ = b 1 + ηbx . Plugging this in, leads to f (a⋆) = ≤ where the last line uses log(1 + x) x − ≥ ηb2x2 1 + ηbx − ηb2x2 1 + ηbx − 1 η 1 η log(1 + ηbx) + (cid:18) ηbx − (cid:18) x2 for any x η2b2x2 − 1 2. ≥ − 1 1 + ηbx − ηbx 1 + ηbx (cid:19) 1 (cid:19) = ηb2x2 , 30 Lemma 40. The stability term stabt := sup α ∆( ∈ x X ∪{b μpt − )h } μα, lt i − 1 ηt D(α, pt) , b satisfies Proof. We have μpt − μα = (pt, = (pt, x − b x − b Hence for At = y : ∈ X μpt − h μα, lt i b Et[stabt] = O((1 pt, x)ηtd) . b − α α x) b x x)( b b x + (1 pt, − b pt + m e x)mpt − pt − e m α (1 x)mα − b mpt) + (1 α − − x)(m b mα) . pt − e b − α μα, [H 1(y V pt]− e m lt,At pt) μ i e V 1(y pt]− − e V mpt, [H pt]− e V 1(y pt]− mα, [H − e V 1(m μ pt]− pt − e e V 1(y mpt, [H pt]− e V 1(y pt]− e m − pt, [H x x) h − b e α m x) x − pt − h b b e b m x) α pt − h e b pt, [H m x x) h − b e α m x) x − pt − h b b e b mα, [H m x) α pt − h e b α pt, x| x − b b pt, 1 x |h − b V pt]+(y mα, [G pt − e e pt − e + | m lt,At pt) μ i e 1(y μ lt,At pt) i − e lt,At pt) μ i e lt,At pt) i e m lt,At pt) i e lt,At pt) i e V pt]− e 1(y − − m − mpt, [H = μpt − h = (pt, x − b + (pt, α = (pt, + (1 x − b + (pt, ≤ + ≤ + (1 − pt, α x| x − | b b pt, 1 x − b α 1 x − b pt, 1 x |h − b α pt, x| x − | b b pt, 1 x − b 4 3 × 1 1 + (1 + 2√d) α x b pt, x k b mpt − mα − − (By Eq. (12)) m pt) e i| m pt) e i| − (By Eq. (13) and Eq. (11)) k[GV pt ]+ (Cauchy-Schwarz and Lemma 37, Lemma 36) − ]+ [GV ept m pt) e y (cid:13) (cid:13) (cid:13) (cid:13) Equivalently for At = x, μpt − b h μα, lt i b = μ pt − h e = (pt, x − b pt, x − | b pt, x b ≤ μα, [H α x x) h b α x| b . b V pt]− e m − 1( x − pt, [H e b lt,At pt) μ i e V 1( x pt]− e − μ lt,At pt) i e b b Hence the stability term for At , is bounded by ∈ X lt i − 1 ηt D(α, pt) sup α ∆( ∈ x X ∪{b sup ≤ α ∆( ∈ x X ∪{b μα, μpt − )h } α x − | b 1 − ) } pt, b x| b pt, x b (1 + 2√d) 1 ηt − D(1 α x, 1 b pt, x) b − − 31 1 ηt (cid:13) (cid:13) mα m pt e − 2 [GV ept ]+ (cid:19) (cid:13) (cid:13) + 1 1 − − 4 3 α x b pt, x (cid:18) b 2 [GV ept pt e ηt y − ≤ m mα m pt e − [GV ept ]+ y m pt e − [GV ept ]+ − (cid:13) (cid:13) (1 + 2√d) (cid:13) (cid:13) ]+ + sup αbx∈ [0,1] (cid:13) α (cid:13) x − | b 1 − (cid:13) pt, (cid:13) x| b pt, x b 1 ηt 2 [GV ept ]+ − (cid:13) (cid:13) + ηt | y − pt e m m (cid:13) (cid:13) ]+ (cid:13) α pt, (cid:13) x| x − b b pt, 1 x − b 2 [GV pt ept e (cid:13) α x − (cid:13) | b 1 − ]+ + O(ηtd) . pt, pt, x| b x b [0,1] (cid:13) (cid:13) m 2 [GV ept pt e ηt y − ≤ (cid:13) (cid:13) + sup αbx∈ y − ηt ≤ (5 + 2√d) D(1 α x, 1 b pt, x) b − − (AM-GM inequality) 1 ηt − D(1 α x, 1 b pt, x) b − − (Lemma 37) (Lemma 39) (cid:13) (cid:13) Taking the expectation over y (cid:13) (cid:13) pt, X ∼ leads to e EAt pt,X [stabt] = O(ηtd) ∼e For At = x we have two cases. If pt, 1 2 , then by Lemma 39, x ≥ b stabt ≤ sup b αbx∈ [0,1] pt, | x − b pt, x b α x| b 1 ηt − Dlog(1 α x, 1 b pt, x) b − − ≤ O ηt(1 pt, x)2 b − × 1 p2 t, x ! ≤ b O ηt(1 pt, x) b − . (cid:0) (cid:1) Otherwise If 1 pt, x ≥ b − 1 2 , then by Lemma 39, stabt ≤ sup [0,1] αbx∈ pt, | x − b pt, x b α x| b 1 ηt − Dlog(α x, pt, b x) b ≤ O ηtp2 t, x × b 1 p2 t, x ! ≤ b O(ηt(1 pt, x)) . b − Finally we have Et [stabt] = (1 pt, x)EAt b ∼ − pt,X [stabt] + pt, xEAt b ∼ πbx[stabt] = O((1 pt, x)ηtd) b − Proof of Lemma 5. By standard analysis of FTRL (Lemma 27) and Lemma 40, for any τ and x τ Et t=1 X h lt pt, h i − lt(x) b b d log T ητ ≤ τ + O(ηt(1 t=1 X i pt, x)d) b − ≤ O  d log T (1 pt, x) b  , − v u u t x = pt, b  pt, e x. Additionally, we have b  τ t=1 X where the last inequality follows from the definition of learning rate and so that Et h pt h − pt, lt e b i i = pt h − pt, lt i ≤ ηtd(1 e − pt, x) , b e τ Et t=1 X h lt pt, h i − lt(x) = O i b e b τ d log T (1 t=1 X pt, x) b  . − e    v u u t Taking expectations on both sides finishes the proof. 32 D Analysis for the First Reduction D.1 BOBW to LSB (Algorithm 1 / Theorem 6) Proof of Theorem 6. We use τk = Tk+1 − Tk to denote the length of epoch k, and let n be the last epoch (define Tn+1 = T ). Also, we use Et[ ] to denote expectation conditioned on all history up to time t. We first consider * the adversarial regime. By the definition of local-self-bounding algorithms, we have for any u, Tk+1 t=Tk+1 X ETk   (lt,At − lt,u)  ≤ α c1 − 0 ETk [τk]α + c2 log(T ),  which implies Tk+1 t=Tk+1 X E   (lt,At − lt,u)  ≤ α c1 − 0 E[τk]α + c2 log(T )  R+ and 0 < α < 1. Summing the bounds over k = 1, 2, . . . , n, and using the property E[xα] using the fact that τk ≤ 2τk ≥ − E[x]α for x ∈ 1 for all k < n, we get T E " t=1 X α c1 − 0 ≤ ≤ O (lt,At − lt,u) # E [τn]α + E [τn 1]α − (cid:18) α 0 T α + c2 log2(T ) c1 − (cid:1) (cid:0) (cid:18) . The same analysis also gives 1 + 1 2α + 1 22α + * * * (cid:19)(cid:19) + c2 log(T ) log2 T c2 log(T ) (cid:18) (cid:19) T E " t=1 X (lt,At − lt,u) # ≤ O (c1 log T )1 − αT α + c2 log2(T ) . (cid:0) (cid:1) (14) (15) Next, consider the corrupted stochastic regime. We first argue that it suffices to consider the regret comparator x⋆. This is because if x⋆ T ∆. Then the right-hand side of (15) is further upper bounded by , then it holds that C = argminu T t=1 lt,u ∈X ≥ E hP i O (c1 log T )1 − α(C∆− 1)α + c2 log(T ) log(C∆− 1) , which fulfills the requirement for the stochastic regime. Below, we focus on bounding the pseudo-regret with respect to x⋆. (cid:0) (cid:1) Let m = max (i.e., m = n − show that t ∈ |{ If τm > 2τm N xk = x⋆ ∈ k { 1), because for any two consecutive epochs, at least one of them must have [Tm+1] 2τ0. Tm+1 At . Notice that m is either the last epoch (i.e., m = n) or the second last } = x⋆. Below we xk | = x⋆ b 1, by the fact that the termination condition was not triggered one round earlier, the number of = b ; in other words, the number of times , we have τm 2 > 4τm − . Further notice that because τm > 2τm 2 Tm+1 t=Tm+1 1 4 I At { m k=1 τk 8 − 2 + 1 = τm+1 1 1 ≥ − − * * * 1 − 2 ≥ P | − }| ≥ plays Nm(x⋆) in epoch m is at most τm 1 x⋆ } 2 = Tm+1 1 is at least τm − 2 1 2 . 4 − Now consider the case m > 1 and τm This implies that Tm t=Tm−1+1 I At { = x⋆ P ≤ 2τm τm−1 − 2 ≥ 1. Recall that τm 2 , 1 2 b 1 2 max } ≥ n xm is the action with Nm m 1 k=1 τk − 1 8 ≥ o P P P 1( xm) ≥ k=1 τk = Tm+1 . m − 8 b 33 − τm−1 2 . 6 6 6 6 6 6 0 and the statement holds trivially. 2τ0, then we have T2 − Finally, consider the case m = 1 and τ1 ≤ The regret up to and including epoch m can be lower and upper bounded using the self-bounding technique: 2τ0 ≤ E  Tm+1 t=1 X  O ≤ ≤ (cid:18) (cid:16) Tm+1 Tm+1 (lt,At − lt,x⋆)  = (1 + λ)E  (lt,At − lt,x⋆)  λE  − (lt,At − lt,x⋆)  (for 0 λ ≤ ≤ 1) (c1 log T )1 − αE [Tm+1]α + c2 log(T ) log  t=1 X  E[Tm+1]  c2 log(T ) t=1 X  λ − 1 8 E [Tm+1] −  c2 log(T ) ∆ C − (cid:19) (cid:19)(cid:19) (the first term is by a similar calculation as (14), but replacing T by Tm and c0 by c1 log T ) (cid:18)(cid:18) (cid:19) (cid:18) O c1 log(T )∆− α 1−α + (c1 log T )1 − α C∆− α where in the last inequality we use Lemma 41. If m is not the last epoch, then it holds that (cid:0) 1 + c2 log(T ) log(C∆− 1) (cid:17) xn = x⋆ for the final epoch n. In this case, the regret in the final (cid:1) epoch is T E " (lt,At − t=Tn+1 X lt,x⋆) # = (1 + λ)E " T (1 " t=Tn+1 X 1−α + (c1 log T )1 − α O (c1 log T )1 − αE ≤ ≤ O c1 log(T )∆− (cid:16) b T (lt,At − t=Tn+1 X α T λE lt,x⋆) # − T " t=Tn+1 X (lt,At − lt,x⋆) # pt,x⋆) − λ E ! − " # (1 pt,x⋆) # ∆ C − ! − + c2 log(T ) t=Tn+1 X + c2 log(T ). (Lemma 41) α C∆− α 1 (cid:0) (cid:17) (cid:1) Lemma 41. For ∆ (0, 1] and c, c′, X 1 and C ≥ ≥ 0, we have c′ log X λ(X∆ − − C) (cid:27) ≤ c∆− α 1−α + 2c1 − α α C ∆ (cid:19) (cid:18) + 2c′ log 1 + (cid:18) c′ + C ∆ (cid:19) ∈ αX α + 1 2 1 2 c1 − min [0,1] λ (cid:26) ∈ Proof. If c1 αX α − c′ log T , we have 1 2 where the last inequality is by the weighted AM-GM inequality. Therefore, λX∆ + cλ− αX α + c′ log X αX α c1 − c1 − 1 2 ≤ ≤ ≥ α 1−α ∆− α 1−α . 1 2 min [0,1] λ ∈ c1 − αX α + c′ log X 1 2 α)∆− α (cid:26) 1, c1 Choosing λ = min { αC − (1 − − λ(X∆ − − C) (cid:27) ≤ min [0,1] λ ∈ cλ− α 1−α ∆− α 1−α + Cλ. c max 1, c1 − , we bound the last expression by } α 1−α αC − α)∆− 1−α + c1 − ∆− (1 − − α α αC α∆− α (cid:26) c max (cid:16) 1, c− αC α∆ α2 1−α (cid:17) ∆− (cid:27) 1−α + c1 − α αC α∆− α (cid:26) α 1−α + 2c1 − (cid:27) α. αC α∆− c∆− ≤ ≤ If c1 − αX α 1 2 c1 − ≤ αX α + c′ log T , we have 1 2 c′ log X λ(X∆ − − C) c′ log X λX∆ + λC c′ log 1 + − ≤ c′2 λ2∆2 then c′ log X ≤ (cid:18) c′ log X where the last inequality is because if X λ = min Combining cases finishes the proof. λX∆ − 2 + C 2)/∆2) , we bound the last expression by c′ log(1 + (c′ 1, c′ C } { ≤ ≥ ≤ 2 c′ λ2∆2 (cid:19) + λC c′√X < 0. Choosing − 2c′ log(1 + (c′ + C)/∆). 34 D.2 dd-BOBW to dd-LSB (Algorithm 1 / Theorem 23) Proof of Theorem 23. In the adversarial regime, we have that the regret in each phase k is bounded by Tk+1 t=Tk+1 X ETk   (lt,At − lt,u)   c1 log(T )ETk   Tk+1 x t=Tk+1 X X pt,xξt,x   + c2 log T . ≤ v u u u t We have maximally log T episodes, since the length doubles every time. Via Cauchy-Schwarz, we get kmax Xk=1 ETk   Tk+1 t=Tk+1 X (lt,At − lt,u)   ≤ v u u u t c1 log T kmax Xk=1 Tk+1 ETk  x t=Tk+1 X X  pt,xξt,x   p log T + c2 log2 T . Taking the expectation on both sides and the tower rule of expectations finishes the bound for the adversarial regime. For the stochastic regime, note that ξt,x 1 and hence ≤ pt,xξt,x I{u = x}p2 t,uξt,u − I{u = x}p2 t,u x}pt,u)(1 + I{u = I{u = b b x X 1 ≤ = (1 − − x}pt,u) 2(1 − ≤ I{u = x}pt,u) . dd-LSB implies regular LSB (up to a factor of 2) and hence the stochastic bound of regular LSB applies. b b b E Analysis for the Second Reduction E.1 1 2-LSB to 1 2-iw-stable (Algorithm 2 / Theorem 11) Proof of Theorem 11. The per-step bonus bt = Bt Bt − − 1 is the sum of two terms: c1 v u u t t τ =1 X c2 c1 1 qτ,2 − v u u t 1 t − τ =1 X c2 bTs t = bLo t = minτ ≤ t qτ,2 − minτ 1 qτ,2 t − ≤ 1 qτ,2 ≤ c1 c1 qt,2 t τ =1 = q c2 P 1 qt,2 (cid:18) − c1 qt,2 , ≤ 1 qτ,2 minτ minτ r t qτ,2 1 qτ,2 (cid:19) . ≤ t − ≤ Since ̄qt,2 qt,2 ≤ 2, using the inequalities above, we have 1 4 . (16) (17) ̄qt,2 qt,2 ηt ̄qt,2bTs t ≤ ηt p β ̄qt,2bLo t ≤ β s ̄qt,2 qt,2 c1 ≤ ηt√2c1 ≤ 1 4 . 2βc2 ≤ c2 ≤ 35 By Lemma 28 and that ̄qt,2 qt,2 ≤ 2, we have for any u, t′ t=1 X qt h − u, zt i ≤ t′ t=1 X qt h − ̄qt, zt i term1 + O √c1 + (cid:18) t′ √qt,2 | √t t=1 X term2 {z + log t′ } β + term3 t′ t=1 X We bound individual terms below: | {z } | | {z } term4 {z q ηt min θt 1 |≤ | 3 2 t,i(zt,i θt)2 + − t′ t′ t′ qt,2bTs t + qt,2bLo t t=1 X term5 t=1 X term6 − (cid:19) u2 bt. (18) t=1 X E[term1] = E t′ qt h t=1 X " − ̄qt, zt i# ≤ } O | t′ t=1 X {z } | {z } 1 t2 ! = O(1). term2 ≤ O min  term3 =  log t′ β ≤ √t′,   t′ v u u t t=1 X O (c2 log T ) .  qt,2 log T .      3 2 t,i(zt,i q θt)2 − # 3 2 q t,i (zt,i lt,At)2 − # E [term4] = E E ≤ = E E ≤ t′ " t=1 X t′ " t=1 X t′ " t=1 X t′ " t=1 X ηt min θt [ ∈ − 2 1,1] ηt ηt ηt i=1 X 2 i=1 X 2 i=1 (cid:18) X t′ 1 √qt,i (I[it = i]lt,At − qt,ilt,At)2 # √qt,i(1 − qt,i)2 + (1 qt,i)q 3 2 t,i − (cid:19)# O E ≤ " t=1 X ηt√qt,2 #! ≤ O (E[term2]) . term5 = t′ t=1 X qt,2bTs t ≤ t′ t=1 X qt,2   t′ q = √c1 c1 qt,2 t τ =1 c1  1 qτ,2 1 P √qt,2 t τ =1  √qt,2 × 1 qτ,2 t=1 X qP t′ ≤ √c1v u u t t=1 X 1 qt,2 t τ =1 1 qτ,2 P 36 qt,2 t′ v u u t t=1 X (19) (Cauchy-Schwarz) ≤ √c1v u u t 1 + log t′ t′ t=1 X 1 qt,2 !v u u t t′ t=1 X qt,2 O  ≤  Continuing from (19), we also have term5 ≤ c1 t=1 X v u u t t′ t=1 qt,2bTs qt,2 log T .   √c1 t′ t=1 1 √t ≤ 2√c1t′ because qτ,2 ≤ 1. t ≤ minτ ≤ minτ t − 1 qτ,2 t qτ,2 (cid:19) ≤ O (c2 log T ) . ≤ t′ term6 = qt,2bLo t = c2 t=1 X t′ 1 − t=1 (cid:18) X P minτ minτ t qτ,2 1 qτ,2 (cid:19) ≤ t − ≤ c2 ≤ P t′ log t=1 X Using all bounds above in (18), we can bound E t′ t′ t=1h qt − u, zt i i hP (cid:18) by min O   p    c1E[t′], v u u t c1 " t=1 X pos-term log T qt,2 #    + c2 log T u2 E  −  v u u t   | For comparator {z x, we choose u = e1 and bound E parator x = On the other hand, by the 1 b b x, we first choose u = e2 and upper bound E t′ hP t=1(lt, lt,x) 2 -iw-stable assumption, E x, we also have E hP t′ we get that for all x pos-term with those in Definition 4, we see that Algorithm 2 satisfies 1 c′0 = c′1 = O(c1) and c′2 = O(c2). hP hP t=1(lt,At − ≤ = b i t′ } t=1(lt,At − t′ | lt, x) b i t=1(lt,At − lt,x) At − e lt, At e ≤ i t′ c1 t=1 X 1 qt,2 + c2 mint ≤ t′ qt,2  . neg-term {z  } by the pos-term above. For com- ) by pos-term neg-term. i neg-term. Combining them, − pos-term. Comparing the coefficients in 2 -LSB with constants (c′0, c′1, c′2) where 37 6 6 E.2 2 3-LSB to 2 3-iw-stable (Algorithm 5 / Theorem 18) Algorithm 5 LSB via Corral (for α = 2 3 ) Input: candidate action Define: ψt(q) = − for t = 1, 2, . . . do 3 ηt Let Let B P P generate an action At. e 3 -iw-stable algorithm 2 i=1 ln 1 . qi i + 1 β 2 3 x, 2 2 i=1 q b over x X \{ } B with constants c1, c2. b ̄qt = argmin q ∆2   ∈ * q, zτ 1 t − τ =1 X 0 1  − −  Bt  1 8c2 1  1 2 3 3 + 8c t 1 + ψt(q)   + , qt = (1 γt) ̄qt, −  (cid:26) 2 3 t,2, ηtq 1 3 t,2 . (cid:27) where ηt = , β = , and γt = max √ηtq ̄qt. x ; Sample it ∼ if it = 1 then set ̄At = else set ̄At = Sample jt ∼ if jt = 1 then draw a revealing action of ̄At and observe lt, ̄At ; else draw At = ̄At ; Define zt,i = At ; γt. e jt=1 } { lt, ̄At and I } b I it=i { γt 1 3 Bt = c 1 2 3 + 1 √qτ,2 ! t τ =1 X c2 minτ t qτ,2 ≤ . Proof of Theorem 18. The per-step bonus bt = Bt Bt − − 1 is the sum of two terms: bTs t = c 1 3 1  2 3 1 √qτ,2 ! t τ =1 X 1 t − τ =1 X − c2  c2 minτ ≤ t qτ,2 − minτ 1 qτ,2 t − ≤ bLo t = 2 3 1 √qτ,2 ! 1 3 c 1  ≤ 1 √qt,2 t τ =1 1 √qτ,2 1 3 , c1 qt,2 (cid:19) (cid:18) 1 3 ≤ =  1 − c2 qt,2 (cid:18) minτ minτ (cid:16)P ≤ t − t qτ,2 1 qτ,2 (cid:19) ≤ Since ̄qt,2 qt,2 ≤ 2, using the inequalities above, we have 1 3 ηt ̄q t,2bTs t ≤ ηt β ̄qt,2bLo t ≤ β ̄qt,2c1 qt,2 (cid:19) c2 ≤ (cid:18) ̄qt,2 qt,2 2βc2 ≤ 1 4 . 1 3 ≤ ηt(2c1) 1 3 1 4 . ≤ 38 (cid:17) . (20) (21) By Lemma 28 and that ̄qt,2 qt,2 ≤ 2, we have for any u, t′ qt h t=1 X u, zt − i ≤ t′ qt h t=1 X ̄qt, zt i − term1 + O 1 3 c 1 + (cid:18) t′ 2 3 q | t,2 1 3 t + t=1 X term2 {z log t′ β term3 t′ } + t=1 X | {z } We bound individual terms below: | {z } | E[term1] = E t′ " t=1 X qt h − ̄qt, zt O i# ≤ t′ t=1 X = O γt ! } t′   t=1 X q 2 3 t,2 1 3 t + 1 3 t,2 2 3  q t q ηt min θt 1 |≤ | 4 3 t,i(zt,i θt)2 + − term4 {z t′ t′ t′ qt,2bTs t + qt,2bLo t t=1 X term5 t=1 X term6 − (cid:19) u2 bt (22) t=1 X | {z } | {z } = O  min     2 3 , t′  t′ 2 3 qt ! t=1 X (log T ) 1 3 + log T     .    term2 ≤ term3 = O (term1) log t′ β ≤ O (c2 log T ) . E [term4] = E t′ " t=1 X t′ E ≤   t=1 X ηtq 4 3 t,2(zt,2 − zt,1)2 4 3 q t,i γt  ηt E ≤  t′ " t=1 X term5 = t′ t=1 X qt,2bTs t ≤ t′ t=1 X 1 6 q− t,2 1 3 c qt,2  1   (cid:16)P 2 3 q t,2 1 3 × t τ =1 1 √qτ,2 = E [O(term1)] . # γ2 t γt # 1 √qt,2 t τ =1 1 √qτ,2 1 3    (cid:17) 1 3 = c 1 t′ t=1 X 1 3 c 1  ≤ t=1 X  P 1 + log 1 3 c 1 ≤ (cid:16)P t′ 1 √qt,2 (cid:17) 1 3 t′ t τ =1 1 √qτ,2   qt,2 t=1 X 1 3 t′ t′ t=1 X 1 qt,2 !! 39 qt,2 ! t=1 X (23) (Cauchy-Schwarz) 2 3 ! 2 3 2 3 qt,2 ! t′ t=1 X 1 3 O  c 1 ≤   (log T ) 1 3  . Continuing from (23), we also have term5 ≤ t′ term6 = qt,2bLo t = c2 t=1 X t′ 1 − t=1 (cid:18) X Using all bounds above in (22), we can bound E O    1 3 c 1 min    E[t′] 2 3 , (c1 log T ) 1 3 t′ qt,2 # " t=1 X pos-term t′ t=1 qt,2bTs t ≤ P minτ minτ t qτ,2 1 qτ,2 (cid:19) ≤ t − ≤ c2 ≤ P t′ log t=1 X (cid:18) by t′ t=1h qt − u, zt i i hP 2 3 + c2 log T  u2 E −        1 3 c 1 t′ t=1 1 1 3 ≤ t O(c 1 3 1 t′ 2 3 ) because qτ,2 ≤ 1. minτ ≤ minτ t − 1 qτ,2 t qτ,2 (cid:19) ≤ O (c2 log T ) . ≤ 1 3 c 1    2 3 + 1 qt,2 ! t′ t=1 X neg-term c2 mint ≤ t′ qt,2 .    | For comparator {z x, we choose u = e1 and bound E b = tor x other hand, by the 1 b = hP x, we first choose u = e2 and upper bound E 2 -iw-stable assumption, E x, we also have E t=1(lt,At − Finally, notice that Et[I hP ] = At { ≥ } coefficient (c′0, c′1, c′2) with c′0 = c′1 = O(c1), and c′2 = O(c hP lt,x) ̄qt,2(1 for all x i − x b t′ b t′ t′ {z } t=1(lt,At − by the pos-term above. For compara- | lt, x) b i t=1(lt,At − lt, At − e t′ hP neg-term. Combining them, we get that t=1(lt, lt,x) At − e pos-term. neg-term. On the by pos-term ≤ i i } ) ≤ γt) = qt,2,. This implies that Algorithm 5 is 2 3 -LSB with 1 3 1 + c2). E.3 1 2-dd-LSB to 1 2-dd-iw-stable (Algorithm 6 / Theorem 22) Proof of Theorem 22. Define bt = Bt Bt − − 1. Notice that we have ηt ̄qt,2bt ≤ ≤ ≤ ≤ 2ηtqt,2bt 2ηtqt,2  c1    2ηt√c1 + 2ηtc2 r P (cid:18) 1 4 . I[it=2] c1ξt,At q2 t,2  + 2c2 t 1 − τ =1 ξτ,Aτ I[iτ =2] q2 τ,2 1 − minτ minτ ≤ t − ≤    t qτ,2 1 qτ,2 (cid:19) 1 ≤ minτ (cid:18) 1 t qτ,2 − minτ 1 qτ,2 (cid:19) t − ≤ (24) 40 6 6 6 Algorithm 6 dd-LSB via Corral (for α = 1 2 ) x, 1 Input: candidate action 2 i=1 ln 1 Define: ψ(q) = qi b Define: For first-order bound, ξt,x = lt,x and mt,x = 0; for second-order bound, ξt,x = (lt,x mt,x is the loss predictor. for t = 1, 2, . . . do 2 -iw-stable algorithm . B0 = 0. with constant c. X \{ over P B x b } mt,x)2 where − B Let generate an action Receive prediction mt,x for all x Let e At (which is the action to be chosen if is selected in this round). , and set yt,1 = mt, ∈ X B x and yt,2 = mt, b . At e ̄qt = argmin q ∆2   ∈ * q, 1 t − τ =1 X where ηt =  1 4 (log T ) 1 2 1 t − τ =1 X zτ + yt −  0 Bt − 1 ηt qt = + ψ(q) , +   1  qτ,i)2ξτ,Aτ + (c1 + c2   (I[iτ = i] − 1 − (cid:18) ̄qt + 1 4t2 1, 1 2t2 1 2 − (cid:19) . 2) log T ! ∼ qt. Sample it if it = 1 then draw At = else draw At = Define zt,i = yt,i)I qt,i (lt,At − e At and observe lt,At ; it=i b { } + yt,i and x and observe lt,At ; t ξt,At τ =1 X I[iτ = 2] q2 τ,2 + c2 minτ t qτ,2 ≤ . Bt = c1 v u u t By Lemma 29 and that ̄qt,2 qt,2 ≤ 2, we have for any u, t′ qt h t=1 X u, zt O i ≤ − t′ + t=1 X log T ηt′ term1 ηt min θ 1 |≤ | 2 i=1 X q2 t,i (zt,i yt,i − − θt)2 t′ | {z } + | qt h ̄qt, zt + i − t=1 X term3 term2 t′ {z qt,2bt t=1 X term4 t′ ! − t=1 X } u2bt term1 ≤ O O ≤ | 2 i=1(I[it = i] t′ 1 − t=1  s P  t′ 2 P {z } | {z } qt,i)2ξt,At + (c1 + c2 log T − 2) log T log T     v u u t (I[it = i] t=1 X i=1 X qt,i)2ξt,At log T + (√c1 + c2) log T − .   41 E [term2] E E ≤ ≤ E ≤ t′ 2 ηt min θ 2 (cid:18) i=1 X (I[it = i] i=1 X 2 (I[it = i] ηt t′ t=1 X i=1 X " t=1 X t′ " t=1 X v u u t   q2 t,i (lt,At − mt,At)I[it = i] qt,i θ − 2 # (cid:19) qt,i)2(lt,At − − mt,At)2 # (choosing θ = lt,At − mt,At) qt,i)2ξt,At log T − .   E [term3] = E t′ qt h t=1 X " − ̄qt, Et[zt] i# = E t′ " − t=1 (cid:28) X 1 2t2 ̄qt + 1 4t2 1, Et[zt] (cid:29)# ≤ O(1). term4 ≤ qt,2bt t′ t=1 X t′ = qt,2  t=1 X c1    r t′ I[it=2] c1ξt,At q2 t,2 t τ =1 ξτ,Aτ I[iτ =2] q2 τ,2 + c2 1 ≤ minτ (cid:18) 1 t qτ,2 − minτ 1 qτ,2 (cid:19) t − ≤  P ξt,At I[it=2] q2 t,2 ξτ,Aτ 1[iτ =2] q2 τ,2 I[it=2] q2 t,2 ξτ,Aτ 1[iτ =2] q2 τ,2 √c1 ≤ t=1 X v u u u t t′ P t τ =1 ξt,At ≤ √c1v u u u t t=1 X t τ =1 P × ξt,At I[it = 2] + c2 q t′ t′ 1 − t=1 (cid:18) X t′ ξt,At I[it = 2] + c2 log t=1 X (cid:18) × v u u t t=1 X    t qτ,2 1 qτ,2 (cid:19) minτ minτ ≤ t − ≤ minτ ≤ minτ t − 1 qτ,2 t qτ,2 (cid:19) ≤ (Cauchy-Schwarz) ≤ √c1v u u t t′ ξt,At 1 + log t=1 X t′ I[it = 2] q2 t,2 t′ !v u u t t=1 X ξt,At I[it = 2] + c2 log 1 t′ qτ,2 ≤ minτ O ≤ v u u t   c1 ξt,At I[it = 2] log T + c2 log T t=1 X .   term5 = u2Bt′ = v u u t Combining all inequalities above, we can bound E − − u2   hP qt,i)2ξt,At log T + t′ 2 c1 (I[it = i] t=1 X i=1 X − v u u t   O E   | t′ ξt,At c1 I[it = 2] q2 t,2 + t=1 X t′ t=1h qt u, zt by i i − t′ c2 mint ≤ t′ qt,2   . c1 v u u t pos-term ξt,At I[it = 2] log T t=1 X   + (√c1 + c2) log T   (25) } {z 42 in the proofs of Theorem 11 and Theorem 18, we end up bounding {z } by the pos-term above for all x . Finally, we process pos-term. Observe that ∈ X qt,1)q2 t,1ξt, At e + qt,2(1 qt,2)2ξt, At e − + (1 − qt,2)q2 t,2ξt, x b i − c1 u2   v u u t t′ ξt,At t=1 X I[it = 2] q2 t,2 + neg-term c2 mint ≤ t′ qt,2   . Similar t′ E | to the arguments lt,x) t=1(lt,At − hP 2 i (I[it = i] qt,i)2ξt,At − # Et i=1 X " = Et h = Et qt,1(1 − 2qt,1q2 t,2ξt, qt,1)2ξt, x + (1 − b x + 2q2 t,1qt,2ξt, b At e h = 2qt,1q2 t,2ξt, x + 2q2 b t,1  i pt,xξt,x  x Xx = b  x + 2 b  x Xx = b , !  xξt, b x b  pt,xξt,x   2pt, x(1 b pt, x)ξt, b − ≤ = 2 pt,xξt,x x X p2 t, − and that Et ξt, At e I[it = 2] i = h x Xx = b pt, xξt,x b ≤ x X pt,xξt,x p2 t, xξt, b x b − Thus, for any u , ∈ X t′ E " (lt,At − t=1 X lt,u) # ≤ E [pos-term] O ≤ t′ c1E " t=1 X x X pt,xξt,x p2 t, xξt, b x b − !# log T + (√c1 + c2) log T ,   v u u t   which implies that the algorithm satisfies 1 2 -dd-LSB with constants (O(c1), O(√c1 + c2)). 43 6 6 6 E.4 1 2-LSB to 1 2-strongly-iw-stable (Algorithm 7 / Theorem 25) Algorithm 7 LSB via Corral (for α = 1 x, 1 Input: candidate action 2 2 i=1 √qi + 1 Define: ψt(q) = − β ηt B0 = 0. b for t = 1, 2, . . . do 2 , using a 1 2 -iw-stable algorithm 2 i=1 ln 1 . qi P P B 2 -strongly-iw-stable algorithm) over X with constant c. Let Let B generate an action At (which is the action to be chosen if is selected in this round). B e ̄qt = argmin q ∆2   ∈ q, * zτ 1 t − τ =1 X where ηt =  t τ =1 −  Bt 1  + 1  + ψt(q)   , β =  I Aτ { = x + 8√c1 0 − } qP e x and observe lt,At ; b ∼ qt. Sample it if it = 1 then draw At = else draw At = Define zt,i = } At and observe lt,At ; b I and At { I it=i lt,At { qt,i e = x } , qt = 1 (cid:18) 1 2t2 − (cid:19) ̄qt + 1 4t2 1, 1 8c2 . e b c1 Bt = v u u u t t I At = x n qτ,2 e o b τ =1 X + c2 max t τ ≤ 1 qτ,2 . Proof of Theorem 25. The proof of this theorem mostly follows that of Theorem 11. The difference is that the regret of the base algorithm is now bounded by B t′ c1 1 qt,2 + qt,1I At = { c2 log T + x v u t=1 u X p t because when is able to receive feedback no matter which side the Corral algorithm chooses. The goal of adding bonus is now only to cancel the first term and the third term on the right-hand side of (26). b x, the base algorithm b t′ qt,2 ≤ v u u t At = t′ qt,2 mint mint t=1 X B e e b } ≤ ≤ x } + c1t′ + c2 log T (26) t′ c1 I At { = qt,2 e Similar to Eq. (18), we have t′ qt h t=1 X u, zt − i ≤ t′ qt h t=1 X ̄qt, zt i − + O √c1 + (cid:18) term1 √qt,2I At {z { t I Aτ τ =1 e { term2 e qP {z t′ | t=1 X | = } x + log T β term3 } t′ + t=1 X } x = b q ηt min θt 1 |≤ | 3 2 t,i(zt,i θt)2 + − t′ t′ qt,2bTs t + qt,2bLo t t=1 X term5 t=1 X term6 t′ u2 bt t=1 X − (cid:19) } | {z } | {z } (27) term4 {z b } | {z } | 44 6 6 6 6 6 6 where bTs t = bLo t = I Aτ { = qτ,2 e x } b c1 v u u t t τ =1 X c2 − v u u t c2 c1 1 t − τ =1 X I Aτ { = qτ,2 e x } ≤ b c1I = At { e qt,2 x b } c1 t τ =1 I Aτ = { e qτ,2 x } b ≤ r c1 qt,2 , = c2 qt,2 (cid:18) 1 r minτ minτ t qτ,2 P 1 qτ,2 (cid:19) ≤ t − ≤ minτ t qτ,2 − minτ ≤ 1 2 and β ̄qt,2bLo ≤ 1 qτ,2 t − 1 2 as in (20) and (21). − satisfying ηt√ ̄qt,2bTs t ≤ t ≤ Below, we bound term1, . . . , term6. E[term1] = E t′ qt h t=1 X " − ̄qt, zt O i# ≤ t′ t=1 X 1 t2 ! = O(1). term2 ≤ O min  term3 =  log T β ≤ t′ I At {   v u u t t=1 X e O (c2 log T ) .  t′ v u u t t=1 X = x , } b qt,2I At { = x } log T e b      t′ " t=1 X t′ " t=1 X t′ " t=1 X t′ " t=1 X t′ " t=1 X E [term4] = E E ≤ = E ≤ ≤ E E t′ ηt ηt ηt ηt i=1 X 2 i=1 X 2 3 2 t,i(zt,i q θt)2 − # ηt min θt [ ∈ − 2 1,1] 3 2 q t,i (zt,i lt,At)2 I At { − = x }# (when At = x, zt,1 = zt,2 = 0) 1 √qt,i e (I[it = i]lt,At − b qt,ilt,At)2 I At { = x }# e b qt,i)q 3 2 t,i − (cid:19) e I At { b = x }# e b √qt,i(1 − qt,i)2 + (1 i=1 (cid:18) X qt,2I At { = x }# ≤ q e b O (E[term2]) . term5 + term6 = qt,2(bTs t + bLo t ) t=1 X t′ = qt,2  t=1 X    r t′ = √c1 t=1 X r P c1I = At { e qt,2 x } b c1 t τ =1 I Aτ = { e qτ,2 x b } + c2 1 ≤ minτ (cid:18) 1 t qτ,2 − minτ 1 qτ,2 (cid:19) t − ≤  I P x At = { e b √qt,2 } t τ =1 I Aτ = { e qτ,2 x b } × q qt,2I At { = x } + c2 e b t′ 1 − t=1 (cid:18) X 45    t qτ,2 1 qτ,2 (cid:19) ≤ t − minτ minτ ≤ (28) 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 t′ I x b } t′ At = { e qt,2 I t τ =1 Aτ = { e qτ,2 x b } v u u t t=1 X ≤ √c1v u u u t t=1 X P t′ log t=1 X (cid:18) qt,2I At { = x } + c2 b e t′ minτ ≤ minτ t − 1 qτ,2 t qτ,2 (cid:19) ≤ (Cauchy-Schwarz) t′ t=1 X I At { = qt,2 e x } b !v u u t t=1 X qt,2I At { = x } log T + c2 log T b e .  qt,2I At { = x } + c2 log minτ 1 + log ≤ √c1v u u t O ≤  t′ c1 t=1 X v u u t  b t′ Continuing from (28), we also have term5 ≤ √c1 t=1 Using all the inequalities above in (27), we can bound E P e Pt I  At x = { e } b I Aτ = τ =1 { e t′ qt t=1h − x } ≤ b u, zt hP 2√c1t′. by i i c1E[t′], t′ c1 v u u t " t=1 X min p      O | qt,2I At { = x }# log T e pos-term b    + (√c1 + c2) log T u2 E − t′ c1 t=1 X I At { } x {z = qt,2 e b neg-term + c2 mint ≤ t′ qt,2   . v u u t   1 t′ qτ,2 ≤ (29)   } E | For comparator t′ t=1 qt,2I = E At = { x, we set u = e2 and get E x, we set u = e1. Then we have E[ x b t′ t=1(1 pt, x) − b t′ i t=1(lt,At − lt,x) } i {z e P t′ t′ t=1(lt,At − , so this gives the desired property of 1 x)] b ≤ } lt, b x − hP hP neg-term) + (neg-term + hP lt, = At ≤ e c1E[t′]) where the additional √c1t′ term comes from the second term (pos-term b on the right-hand side of (26), which is not cancelled by the negative term. Note, however, that this still satisfies the requirement of 1 x because for these actions, we only require the worst-case bound to hold. 2 -LSB for x Overall, we have justified that Algorithm 7 satisfies 1 2 -LSB with constants (c′0, c′1, c′2) where c′0 = c′1 = O(c1) and c2 = (√c1 + c2). t=1(lt,At − lt,x) b At − e = E hP hP + E p = i i i ) b pos-term. Observe that 2 -LSB for action t′ t=1(lt, x. For E.5 1 2-dd-LSB to 1 Lemma 42. Let weights q1, q2, and an adaptive sequence regret guarantee for any stopping time t′: B * * * ∈ mt,x { x } ∈X 2-dd-strongly-iw-stable (Algorithm 8 / Lemma 42) be an algorithm with the following stability guarantee: given an adaptive sequence of (0, 1]X such that the feedback in round t is observed with probability qt(x) if x is chosen, available at the beginning of round t, it obtains the following pseudo t′ E " t=1 X (lt,At − lt,u) # ≤ E  t′ c1 t=1 X ξt,At updt * qt(At)2 + v u u t  c2 mint ≤ t′ minx qt(x)  , where updt = 1 if feedback is observed in round t and updt = 0 otherwise. ξt,x = (lt,x − order bound case, and ξt,x = lt,x in the first-order bound case. Then Algorithm 8 with 1 2 -dd-LSB. B  mt,x)2 in the second- as input satisfies 46 6 6 6 6 6 6 6 6 6 6 6 6 6 2 , using a 1 Algorithm 8 dd-LSB via Corral (for α = 1 x, 1 Input: candidate action 2 i=1 ln 1 Define: ψ(q) = qi b Define: For first-order bound, ξt,x = lt,x and mt,x = 0; for second-order bound, ξt,x = (lt,x mt,x is the loss predictor. for t = 1, 2, . . . do 2 -dd-strongly-iw-stable algorithm) with constant (c1, c2). over 2 -iw-stable algorithm . B0 = 0. P X B mt,x)2 where − Receive prediction mt,x for all x generate an action Let Let B , and set yt,1 = mt, x and yt,2 = mt, b At e . ∈ X At (which is the action to be chosen if is selected in this round). e q, ̄qt = argmin q ∆2   ∈ * 1 t − τ =1 X where ηt =  1 4 (log T ) 1 2 1 t − τ =1 X zτ + yt −  0 Bt − + ψ(q) 1 ηt + 1  qτ,i)2ξτ,Aτ −  (I[iτ = i] , qt = 1 (cid:18) 1 2t2 − (cid:19) ̄qt + 1 4t2 1,  Aτ I[ = x] + (c1 + c2 2) log T 1 2 − . ! e b B   ∼ qt. Sample it if it = 1 then draw At = else draw At = Define zt,i = At and observe lt,At ; it=i (lt,At − b + yt,i { e yt,i)I qt,i } (cid:16) x and observe lt,At ; (cid:17) I At { = x } and e ξt,At b I I iτ = 2 At } { { q2 τ,2 e = x } + b c2 minτ t qτ,2 ≤ . (30) Bt = t τ =1 X c1 v u u t Proof. The proof of this lemma is a combination of the elements in Theorem 22 (data-dependent iw-stable) and Theorem 25 (strongly-iw-stable), so we omit the details here and only provide a sketch. In Algorithm 8, since B is 1 2 -dd-strongly-iw-stable, its regret is upper bounded by the order of x 1 b = e I At { t′ c1 v u u t t=1 X t′ c1 ≤ v u u t chooses I At = { ξt,At I At { + = x } * I ξt,At it = 2 { } } q2 t,2 + ! e ξt,At b + t′ c1 ξt,At + c2 mint ≤ t′ minx qt(x) c2 mint t′ minx qt(x) x I it = 2 { } q2 t,2 } * t=1 X because if x, then the probability of observing the feedback is 1, and is qt,2 otherwise. This motivates the choice of the bonus in (30). Then we can follow the proof of Theorem 22 step-by-step, and show that the regret compared to x is upper bounded by the order of t=1 X B e b ≤ b (31) v u u t   t′ 2 b c1 (I[it = i] t=1 X i=1 X E v u u t   qt,i)2ξt,At I At { = x } log T − + E t′ c1 t=1 X v u u t   ξt,At I[it = 2]I At { = x } e b e b log T   47 + (√c1 + c2) log T 6 6 6 6 6 6 6 c1E " ≤ v u u t t′ 2qt,1q2 t,2ξt, t=1 (cid:16) X t′ x + 2q2 b t,1qt,2ξt, At e I At { = x }# e b (cid:17) c1E + v u u t " t=1 X t′ ξt, At e qt,2I At { = x }# log T + (√c1 + c2) log T (taking expectation over it and following the calculation in the proof of Theorem 22) e b c1E = v u u u t   t=1 X 2qt,1q2 t,2ξt,  x Pr[ b At = x] + 2q2 t,1qt,2  t′ e b Pr[ At = x]ξt,x x Xx = b e     + v u u u t c1E t′   t=1 X qt,2 Pr[ At = x]ξt,x x Xx = b e   log T + (√c1 + c2) log T (taking expectation over At) e c1E ≤ v u u u t   t=1 X 2qt,1(1  pt, x)ξt, b x + 2q2 t,1 b −  t′ pt,xξt,x x Xx = b     c1E + v u u u t   t=1 X x Xx = b (using the property that for x  pt,xξt,x  log T + (√c1 + c2) log T = x, pt,x = Pr[ At = x]qt,2 and thus 1 pt, x = Pr[ b At − = x]qt,2) t′ c1E ≤ v u u u t   t=1 X 2pt,  x(1 b − pt, x)ξt, b x + 2 b  t′ b pt,xξt,x x Xx = b e     e (qt,1 ≤ pt, b x ≤ b 1) c1E + v u u u t   t=1 Xx x = X b t′ log T + (√c1 + c2) log T pt,xξt,x   O  ≤ v u u t  c1E " t=1 X x X pt,xξt,x p2 t, xξt, b x b − !# log T  + (√c1 + c2) log T  which satisfies the requirement of 1 x, similar to the proof of Theorem 25, an extra positive regret comes from the second term in (31). Therefore, the regret against x 2 -dd-LSB for the regret against x, can be upper bounded by x. For the regret against x = = b b b O c1E t′ " x t=1 X X pt,xξt,x log T # v u u t   + (√c1 + c2) log T   which also satisfies the requirement of 1 2 -dd-LSB for x = x. b 48 6 6 6 6 6 6 6 6 6 6 6 6 6 6 F Analysis for IW-Stable Algorithms Algorithm 9 EXP2 Input: . X for t = 1, 2, . . . do Receive update probability qt. Let ηt = min ln |X | t τ =1 1 qτ , 1 2d qτ min t τ ≤ ) , (s d Pt(a) exp ηt − ∝ pt = (1 dηt )Pt + dηt Sample an action at qt qt With probability qt, receive lt(at) = + noise at, θt h (in this case, set updt = 1; otherwise, set updt = 0). Construct loss estimator: ∼ i P − ν, where ν is John's exploration. 1 t − τ =1 X lτ (a) ! . b updt qt a⊤ Eb ∼ (cid:16) lt(a) = b pt[bb⊤] 1 − atlt(at) (cid:17) F.1 EXP2 (Algorithm 9 / Lemma 9) Proof of Lemma 9. Consider the EXP2 algorithm (Algorithm 9) which corresponds to FTRL with negentropy potential. By standard analysis of FTRL (Lemma 27), for any τ and any a⋆, τ Et t=1 X " a X Pt(a) lt(a) # − b τ Et t=1 X lt(a⋆) h i b ln |X | ητ + ≤ τ t=1 X Et max P (cid:20) (cid:18) Pt h − P, lt i − 1 ηt Dψ(P, Pt) . (cid:19)(cid:21) To apply Lemma 31, we need to show that ηt lt(a) a⊤t (Eb b ∼ ≥ − pt[bb⊤])− 1. We have by Cauchy Schwarz 1 at. For each term, we have a⊤ | Eb ∼ pt[bb⊤] 1 − at | ≤ (cid:0) (cid:1) q a⊤ a⊤ (Eb ∼ pt[bb⊤])− 1 a Eb ∼ (cid:16) pt[bb⊤] 1 − a (cid:17) q qt dηt ≤ due to the properties of John's exploration. Hence stability term, resulting in ηt | a⊤ Eb ∼ (cid:16) lt(a) | ≤ | ν[bb⊤] 1 − a = (cid:17) qt ηt , lt(a) | ≤ 1. We can apply Lemma 31 for the max P (cid:20) ηtEt Et ≤ Pt h − P, lt (cid:18) a⊤ Pt(a) 1 ηt i − Eb ∼ " a X b Dψ(P, Pt) pt[bb⊤] 1 − (cid:1) a 1 − (cid:0) Eb ∼ a⊤ (cid:0) a⊤ pt[bb⊤] qt (cid:1) Pt[bb⊤] qt Eb ∼ (cid:0) 1 − a = 2ηtd qt . (cid:1) = ηt Pt(a) a X = 2ηt Pt(a) a X (cid:19)(cid:21) ata⊤t q2 t (cid:0) pt[bb⊤] 1 − a Eb ∼ (cid:1) # 49 By lt(a) | | ≤ 1 we have furthermore τ Et t=1 X " a X (Pt(a) pt(a)) lt(a) # − (Pt(a) − pt(a))lt(a) # ≤ τ = Et " t=1 X a X dηt qt . τ t=1 X Combining everything and taking the expectation on both sides leads to b τ E " t=1 X a X pt(a)lt(a) − lt(a⋆) # ≤ ≤ E E log |X | ητ + " τ t=1 X 3dηt qt # τ d log |X | t=1 X 7 v  u u t  1 qt + 2 log d |X | 1 mint ≤ . τ qt   F.2 EXP4 (Algorithm 10 / Lemma 10) In this section, we use the more standard notation Π to denote the policy class. Algorithm 10 EXP4 Input: Π (policy class), K (number of arms) for t = 1, 2, . . . do Receive context xt. Receive update probability qt. Let ηt = ln Π | | t τ =1 , 1 qτ K s Pt(π) exp ηt − ∝ 1 t − τ =1 X lτ (π(xτ )) . ! b Sample an arm at With probability qt, receive lt(at) (in this case, set updt = 1; otherwise, set updt = 0). Construct loss estimator: π:π(xt)=a Pt(π)π(xt). pt where pt(a) = P ∼ P lt(a) = updt I[at = a]lt(a) qtpt(a) . b Proof of Lemma 10. Consider the EXP4 algorithm with adaptive stepsize (Algorithm 10), which corresponds to FTRL with negentropy regularization. By standard analysis of FTRL (Lemma 27) and Lemma 31, for any τ and any π⋆ τ Et t=1 X " π X Pt(π) lt(π(xt)) # − b τ Et t=1 X h lt(π⋆(xt)) i b ln Π | | ητ ln Π | | ητ + + ≤ ≤ ηt 2 ηt 2 τ t=1 X τ t=1 X Et " π X Pt(π) π X Pt(π) l2 t (π(xt)) # b lt(π(xt)) qtpt(π(xt)) Taking expectation on both sides finishes the proof. ln Π | | ητ ≤ + K ηt 2qt ≤ K ln Π | | 2 v u u t 50 1 qt . τ t=1 X F.3 (1 − 1/ log(K))-Tsallis-INF (Algorithm 11 / Lemma 14) 1/ log(K))-Tsallis-Inf (for strongly observable graphs) − β) , where β = 1 1/ log(K). − Algorithm 11 (1 Input: x. xβ i K i=1 G \ Define: ψ(x) = for t = 1, 2, . . . do P Receive update probability qt. Let β(1 b − pt = argmin x ∆([K]) ( ∈ 1 t − x, h τ =1 X where ηt = s t s=1 P + lτ i 1 ηt ψ(x) ) b 1 qs log K α, α log K (1 + min { . ) } e pt. Sample At With probability qt receive lt,i for all At Define ∼ ∈ N (i) (in this case, set updt = 1; otherwise, set updt = 0). lt,i = updt (lt,i I i { − t ∈ I j ∈N )I At } { (i) pt,jqt ∈ N (i) } + I i { , t ∈ I }! b where t = I i (cid:26) ∈ P [K] : i (i) ∧ 6∈ N pt,i > We require the following graph theoretic Lemmas. 1 2 (cid:27) and (i) = j { N ∈ G \ (j, i) E . } ∈ x | b Lemma 43. Let G = (V, E) be a directed graph with independence number α and vertex weights pi > 0, then V : i ∃ ∈ pi + pi j:(j,i) E pj ≤ ∈ 2piα i pi . Proof. Without loss of generality, assume that p is equivalent to ∈ P ∆(V ), since the statement is scale invariant. The statement P min i pi + Xj:(j,i) ∈ E pj ≥ 1 2α . Let min ∆(V ) ∈ p min i  pi + Via K.K.T. conditions, there exists λ  pj  ≤ p min ∆(V ) ∈ p2 i + pipj  E Xj:(j,i) ∈ R such that for an optimal solution p⋆ it holds Xj:(j,i) ∈   i X E .   ∈ V : either 2p⋆ i + i ∀ ∈ p⋆ j + p⋆ j = λ or 2p⋆ i + E Xj:(j,i) ∈ p⋆ j + Xj:(j,i) ∈ E 51 E Xj:(i,j) ∈ p⋆ j ≥ Xj:(i,j) ∈ E λ and p⋆ i = 0 . Next we bound λ. Take the sub-graph over V+ = V+ ( S | α, since V+ ⊂ V ). We have | ≤ i : p⋆ { i > 0 } and take a maximally independence set S over p⋆ j + 1 ≤ V+ Xj 6∈ =0 S i X ∈   2p⋆ i + p⋆ j + Xj:(j,i) ∈ E Xj:(i,j) ∈ E p⋆ j  = S | λ | ≤ αλ.  Hence λ ≥ 1 α . Finally, | {z } (p⋆ i )2 + i p⋆ p⋆ j  = 1 2  i X   Xj:(j,i) ∈ E i X   2(p⋆ i )2 + i p⋆ p⋆ j + Xj:(j,i) ∈ E Xj:(i,j) ∈ E p⋆ i λ 2 ≥ 1 2α . i p⋆ p⋆ j  ≥  i X Lemma 44. (Lemma 10 Alon et al. (2013)) let p ∆(V ) we have: ∈ = (V, E) be a directed graph. Then, for any distribution G pi j:(j,i) E pj ≤ ∈ mas( G ) , pi + i X where mas( G ) ≤ α is the maximal acyclic sub-graph. P With these Lemmas, we are ready to proof the iw-stability. e Proof of Lemma 14. Consider (1 (Algorithm 11). Applying Lemma 27, we have for any stopping time τ and a⋆ 1/ log(K))-Tsallis-INF algorithm with the − [K]: ∈ adaptive stepsize τ t=1 X Et[ pt, h lt i − lt,a⋆ ] b b 2e log K ητ 2e log K ητ + + ≤ = τ t=1 X τ t=1 X Et Et (cid:20) (cid:20) p max p h − pt, lt i − 1 ηt Dψ(p, pt) (cid:21) p max p h − pt, b lt + ct1 i − 1 ηt Dψ(p, pt) (cid:21) , where ct = arm. updt − 1)I (lt,It − At ( { I Pj∈N (It) pt,jqt ∈N t) } , which is well defined because We can apply Lemma 32, since the losses are strictly positive. p max p h − pt, lt + ct1 i − Et (cid:20) 1 ηt Dψ(p, pt) (cid:21) ≤ ηt 2 Et We split the vertices in three sets. Let M1 = t. we have t and M3 = i i { | (i) } ∈ N I } I b b t contains by definition maximally one I 1+ 1 t,i log K p lt,i + ct)2 ( . # " i X the nodes with self-loops. Let M2 = b i i { | 6∈ M1, 6∈ ηt 2 Et " i X 1+ 1 t,i log K p lt,i + ct)2 ( # ηtEt ≤ updt     i b Pt,ic2 t + M1 X ∪ ∈ M2 1+ 1 t,i log K p (i) pt,jqt)2 + M1 i X ∈ ( j ∈N P 52 4pt,i q2 t + pt, , t  I   M2 i X ∈ since for any i ∈ the third term is in expectation Et P M2, we have j ∈N hP 4pt,iupdt q2 t i M2 ∈ 4 qt ≤ i (i) pt,j > 1 2 . The first term is in expectation Et i M1 ∈ M2 pt,ic2 t ∪ 1 qt , ≤ , while the second is (cid:2)P (cid:3) 1+ 1 t,i log K p Et  M1 i X ∈  ( j ∈N P updt (i) pt,jqt)2   2 qt ≤ M1 i X ∈ P 1+ 1 t,i log K p (i) pt,j j ∈N . α The subgraph consisting of M1 contains sef-loops, hence we can apply Lemma 44 to bound this term by 2 . If e qt ] M1| [ α log K < | p of p, such that M1 is in position 1, .., α, we instead take a permutation and for any i M1| | ∈ e pt,i e pt,j ≤ pt,i pt,j ≤ j (i) e The existence of such a permutation is guaranteed by Lemma 43: Apply Lemma 43 on the graph M1 to select . Recursively remove the i-th vertex from the graph and apply Lemma 43 on the resulting sub-graph to ̃p M1 | pick ̃pi 1. Applying this permutation yields ∈N e P P P ∈N (i) e e e [i] ∩ j | − . pt,i 2α i j=1 e pt,j 2 qt M1 i X ∈ 1+ 1 t,i log K p (i) pt,j ≤ j ∈N 4α qt P Combining everything M1 1+ 1 i log K p i=1 X e P i j=1 pj ≤ e 4α qt M1 i=1 X pi 4α log K qt . 1 log K ≤ 1 − i j=1 pj e e (cid:16)P (cid:17) p max p h − pt, lt + ct1 i − Et (cid:20) 1 ηt Dψ(p, pt) (cid:21) ≤ ηt qt (6 + 4 min α, α log K { ) . } By the definition of the learning rate, we obtain b e τ t=1 X Et[ pt, h lt i − lt,a⋆ ] 2e log K ητ ≤ + b b ηt qt τ t=1 X (6 + 4 min α, α log K { ) } 1 qt τ e t=1 X log K . ≤ 18 v u u t (1 + min α, α log K { ) } e 53 F.4 EXP3 for weakly observable graphs (Algorithm 12 / Lemma 17) x, dominating set D (potentially including Algorithm 12 EXP3 (for weakly observable graphs) Input: G \ Define: ψ(x) = for t = 1, 2, . . . do P Receive update probability qt. Let b x). b K i=1 xi log(xi). νD is the uniform distribution over D. 1 t − x, h τ =1 X √δ Pt = argmin x ∆([K]) ( ∈ where ηt =  + lτ i 1 ηt ψ(x) ) , pt = (1 − γt)Pt + γtνD b t s=1 1 √qs 2 3 log(K) ! P 1 − + 4δ mins ≤ t qs    and γt = ηtδ qt . s   pt. Sample At With probability qt receive lt,i for all At Define ∼ (i) (in this case, set updt = 1; otherwise, set updt = 0). ∈ N lt,iupdt lt,i = b j P I At ∈ N { (i) pt,jqt (i) } . ∈N Proof of Lemma 17. Consider the EXP3 algorithm (Algorithm 12). By standard analysis of FTRL (Lemma 27) and Lemma 31 by the non-negativity of all losses, for any τ and any a⋆, τ Et t=1 X " a X log K ητ log K ητ log K ητ ≤ ≤ ≤ τ t=1 X τ t=1 X τ + + + Pt(a) lt(a) # − b ηt Et 2 ηt 2 " i X Pt,i i X ηtδ 4qt t=1 s X τ Et t=1 X Pt,i l2 t,i h # lt(a⋆) i b b j ∈N 1 (i) pt,jqt P where in the last inequality we use ηt 2 τ Et t=1 X " a X pt(a) lt(a) # − b i Pt,i δ γt × × P τ t=1 X Et lt(a⋆) i b h Taking expectation on both sides finishes the proof. 1 qt = 1 2 ηtδ qt . We have due to Et[ Pt h − pt, lt ] i ≤ γt q log K ητ τ + t=1 s X 6(δ log(K)) 1 3 9 ηtδ 4qt b 2 3 + 1 √qt ! τ t=1 X 4δ log(K) T qt mint ≤ . ≤ ≤ 54 G Surrogate Loss for Strongly Observable Graph Problems When there exist arms such that i applicable to all strongly observable graphs, define the surrogate losses ̃lt in the following way: (i), we cannot directly apply Algorithm 2. To make the algorithm 6∈ N ̃lt, x = lt, b xI x, ( { b x) E ∈ } − pt,jlt,jI (j, j) { E } 6∈ j ∀ x ∈ [K] x [K] Xj } \{b ∈ : ̃lt,j = lt,jI xI b b (j, j) x) x, ( lt, ∈ { { b where pt is the distribution of the base algorithm at round t. By construction and the definition over [K] of strongly observable graphs, ̃lt,j is observed when playing arm j. (When the player does not have access to x.) The losses ̃lt pt, one can also sample one action from the current distribution for an unbiased estimate of lt, b b 1, 1] instead of [0, 1] and can further be shifted to be strictly non-negative. Finally observe that are in range [ } − \ { \ { E E 6∈ B x b b b } } } , − E[ ̃lt,At − ̃lt, [K] Xj ∈ x } \{b b x] = qt,2   = qt,2   = E[lt,At − Xj [K] x \{b ∈ } x], lt, b pt,j ̃lt,j ̃lt, x b −  pt,jlt,j lt, x b −  as well as ̃lt,At − E   [K] Xj ∈ x } \{b pt,j ̃lt,j   x − b ̃lt, ̃lt, = qt,1   = qt,1   lt,At −   = E x − b pt,j ̃lt,j pt,jlt,j    [K] Xj ∈ x } \{b [K] Xj ∈ x } \{b pt,jlt,j [K] Xj ∈ x } \{b  .   That means running Algorithm 2, replacing lt by ̃lt allows to apply Theorem 11 to strongly observable graphs where not every arm receives its own loss as feedback. H Tabular MDP (Theorem 26) In this section, we consider using the UOB-Log-barrier Policy Search algorithm in Lee et al. (2020) (their Algorithm 4) as our base algorithm. To this end, we need to show that it satisfies a dd-strongly-iw-stable condition specified in Lemma 42. We consider a variant of their algorithm by incorporating the feedback π]. The algorithm is Algorithm 13. probability q′t = qt + (1 qt)I[πt = We refer the readers to Section C.3 of Lee et al. (2020) for the setting descriptions and notations, since we − will follow them tightly in this section. b 55 Algorithm 13 UOB-Log-Barrier Policy Search Input: state space Define: Ω = w : δ = 1 T 5S3A . (cid:8) Initialization: , action space S w(s, a, s′) , candidate policy A 1 , ψ(w) = T 3S2A ≥ (cid:9) b b h P b P π. (s,a,s′) ∈Sh×A×Sh+1 ln 1 w(s,a,s′) . w1(s, a, s′) = 1 h |S ||A||S h+1| , π1 = π b w1, t⋆ 1. ← for t = 1, 2, . . . do b π, updt = 1; otherwise, updt = 1 w.p. qt and updt = 0 w.p. 1 If πt = − If updt = 1, obtain the trajectory sh, ah, lt(sh, ah) for all h = 1, . . . , H. Construct loss estimators b qt. lt(s, a) = updt q′t lt(s, a)It(s, a) φt(s, a) * , where It(s, a) = I (sh(s), ah(s)) = (s, a) } { qt)1[πt = where q′t = qt + (1 Update counters: for all s, a, s′, − b π]. Nt+1(s, a) ← Nt(s, a) + It(s, a), Nt+1(s, a, s′) b Nt(s, a, s′) + It(s, a)I sh(s)+1 = s′ { . } ← Compute confidence set t+1 = ˆP : ˆP (s′ P (cid:12) n (cid:12) s, a) = Nt+1(s,a,s′) (cid:12) 1,Nt+1(s,a) max } { and s, a) | P t+1(s′ − where P t+1(s′| ǫt+1(s′ s, a), | ∀ ≤ (s, a, s′) o s, a) | (cid:12) (cid:12) (cid:12) ǫt+1(s′ s, a) = 4 | s s, a) ln(SAT /δ) P t+1(s′| 1, Nt+1(s, a) max } { + 28 ln(SAT /δ) 3 max 1, Nt+1(s, a) } { updτ Iτ (s,a)lτ (s,a)2 q′2 t + maxτ H q′2 τ ≥ t ≤ S2A ln(SAT ) η2 t then ∆( t+1) ∈ P Ω ψ(w) ∩ if t τ =t⋆ s,a ηt ηt+1 ← 2 P P wt+1 = argminw t⋆ t + 1. ← b ηt+1 = ηt wt+1 = argminw else t+1) P wt+1. Update policy πt+1 = π b ∆( ∈ Ω ∩ b lt w, h i + 1 ηt b n Dψ(w, wt) . o b 56 H.1 Base algorithm Lemma 45. Algorithm 13 ensures for any u⋆, T E " t=1 X u⋆, lt wt h − O i# ≤ HS2Aι2E T " s,a t=1 X X updt It(s, a)lt(s, a) 2 q′ t # + E S5A2ι2 mint q′t (cid:21) (cid:20)   v u u t Proof. The regret is decomposed as the following (similar to Section C.3 in Lee et al. (2020)): .   T wt h t=1 X u⋆, lt = i − T t=1 X wt h − wt, lt + i T | + t=1 X Error b {z u, h lt } lt i + − b Bias-2 T wt, lt h t=1 X b Bias-1 + lt i − b T t=1 X wt h − u, lt b Reg-term b T | u h t=1 X {z − u⋆, lt } , i | {z Bias-3 i } } with the same definition of u as in (24) of Lee et al. (2020). Bias-3 H trivially (see (25) of Lee et al. (2020)). For the remaining four terms, we use Lemma 49, Lemma 50, Lemma 51, and Lemma 52, respectively. Combining all terms finishes the proof. } ≤ {z {z | | Lemma 46 (Lemma C.2 of Lee et al. (2020)). With probability 1 O(δ), for all t, s, a, s′, P (s′ s, a) | − P t(s′ s, a) | ≤ − s, a) ǫt(s′| 2 . Lemma 47 (cf. Lemma C.3 of Lee et al. (2020)). With probability at least 1 (cid:12) (cid:12) (cid:12) (cid:12) δ, for all h, − T s t=1 X ∈Sh,a X ∈A q′t * wt(s, a) 1, Nt(s, a) max } { = O ( h A log(T ) + ln(H/δ)) | |S Proof. The proof of this lemma is identical to the original one - only need to notice that in our case, the probability of obtaining a sample of (s, a) is q′t * Lemma 48 (cf. Lemma C.6 of Lee et al. (2020)). With probability at least 1 such that P s of transition functions O(δ), for any t and any collection t for all s, we have wt(s, a). − P s s t } { ∈S t ∈ P T wP s t ,πt(s, a) wt(s, a) lt(s, a) = O − t=1 X ,a s X ∈S where ι , log(SAT /δ) and l2 ∈A (cid:12) (cid:12) (cid:12) (cid:12) t (s, a) , (lt(s, a))2. T t=1 X HA S   v u u t wt, l2 t i h q′t ι2 + S5A2ι2 mint q′t  .  Proof. Following the proof of Lemma C.6 in Lee et al. (2020), we have T wP s t ,πt(s, a) t=1 X ,a s X ∈S ∈A (cid:12) (cid:12) wt(s, a) lt(s, a) B1 + SB2 ≤ − (cid:12) (cid:12) 57 where T B2 ≤ O  Xx,y,x′ s t=1 Xs,a,s′ X T  + O   t=1 X Xs,a,s′ Xx,y,x′ s, a)ι P (s′| 1, Nt(s, a) } { max wt(s, a) s x, y)ι P (x′| 1, Nt(x, y) } { max wt(x, y s′) |  wt(s, a)ι max 1, Nt(s, a) } {    (32) The first term in (32) can be upper bounded by the order of s′)ι | x, y)wt(x, y wt(s, a)P (x′| 1, Nt(s, a) max { } wt(s, a)P (x′| 1, Nt(s, a) max } { x, y)wt(x, y wt(s, a)ι s, a)wt(x, y wt(s, a)P (s′| 1, Nt(x, y) max } { s s′)ι | s′)ι | Xx,y,x′ v Xs,a,s′ u u t wt(x, y)ι s, a)wt(x, y wt(s, a)P (s′| 1, Nt(x, y) max } { s′)ι | max 1, Nt(s, a) } { Xs,a,s′ max 1, Nt(x, y) } { Xx,y,x′ H v u u t wt(s, a)ι max 1, Nt(s, a) } { T t=1 X Xs,a,s′ T Xx,y,x′ s t=1 v u X u t T Xs,a,s′ Xx,y,x′ ≤ ≤ ≤ H t=1 v u X u t T HS Xs,a,s′ t=1 X HS2ι mint q′t O ≤ (cid:18) (SA ln(T ) + H log(H/δ)) . (cid:19) (by Lemma 47) The second term in (32) can be upper bounded by the order of T S2A wt(s, a)ι max 1, Nt(s, a) } { = O S3Aι mint q′t (cid:18) (SA ln(T ) + H log(H/δ)) . (by Lemma 47) (cid:19) t=1 X Combining the two parts, we get Xs,a,s′ B2 ≤ O 1 mint q′t S4A2 ln(T )ι + HS3Aι log(H/δ) (cid:18) Next, we bound B1. By the same calculation as in Lemma C.6 of Lee et al. (2020), (cid:19) (cid:18) (cid:0) (cid:1) O ≤ S4A2ι2 mint q′t (cid:19) . B1 T O ≤ O ≤     t=1 Xs,a,s′ X T x,y X t=1 X Xs,a,s′ x,y X wt(s, a) s P (s′| s, a)ι 1, Nt(s, a) } { max wt(x, y s′)lt(x, y) + H | wt(s, a) s P (s′| s, a)ι 1, Nt(s, a) } { max wt(x, y s′)lt(x, y) + | T t=1 Xs,a,s′ X HS2Aι2 mint q′t  wt(x, a)ι max 1, Nt(s, a) } {   h , ∈ T  h S × A × S h+1. We continue to For the first term above, we consider the summation over (s, a, s′) 58 bound it by the order of T x,y t=1 Xs,a,s′ ∈Th X X T 1 q′t ≤ α Xs,a,s′ T x,y ∈Th X wt(s, a) s s, a)ι P (s′| 1, Nt(s, a) } { max wt(x, y s′)lt(x, y) | wt(s, a)P (s′ s, a)wt(x, y | s′)lt(x, y)2 | t=1 X 1 α + T t=1 X T t=1 X α ≤ α ≤ O ≤ q′twt(s, a)wt(x, y s′) | ι * max 1, Nt(s, a) } { (by AM-GM, holds for any α > 0) t=1 Xs,a,s′ X 1 q′t x,y X wt, l2 t i h q′t x,y ∈Th X wt(x, y)lt(x, y)2 + H + |S h+1||S h α Aι2 | H h+1| |S α T t=1 X s,a X ∈Sh×A q′twt(s, a)ι Nt(s, a) A ||S h+1| T t=1 X wt, l2 ι2 t i h q′t  H h |S v u u t   O ( h |S |  + |S ≤  Therefore, HA ) h+1| v u u t T t=1 X  wt, l2 ι2 t i h q′t   T B1 ≤ O   h X ( h |S | + |S HA T t=1 X v u u t O S  ≤  ι2 wt, l2 t i h q′t HA ) h+1| v u u t wt, l2 ι2 t i h q′t t=1 X HS2Aι2 mint q′t  . + (by Lemma 47) (choose the optimal α) + HS2Aι2 mint q′t   Combining the bounds finishes the proof. Lemma 49 (cf. Lemma C.7 of Lee et al. (2020)). E [Error] = E T " t=1 X wt h − wt, lt i# ≤ O E S   Proof. By Lemma 48, with probability at least 1 b  T t=1 X HA v u u t ι2 wt, l2 t i h q′t + S5A2ι2 mint q′t  .    Error = T t=1 X wt h − wt, lt i ≤ wt(s, a) lt(s, a) wt(s, a) | − b S v u u t HA T t=1 X O ≤   S5A2ι2 mint q′t     O(δ), − T s,a | t=1 X X wt, l2 ι2 t i h q′t b + 59 Furthermore, Error | | ≤ O(SAT ) with probability 1. Therefore, E[Error] O ≤ O ≤ HA HA E S   E S       v u u t v u u t T t=1 X T t=1 X ι2 wt, l2 t i h q′t + S5A2ι2 mint q′t  + δSAT ι2 wt, l2 t i h q′t +  S5A2ι2 mint q′t       by our choice of δ. Lemma 50 (cf. Lemma C.8 of Lee et al. (2020)). T E[Bias-1] = E wt, lt h t=1 X t be the event that P " lt − i# ≤ O b τ for all τ b ∈ P t. ≤ HA E S     v u u t T t=1 X wt, lt h q′t i + S5A2ι2 mint q′t  .    Et (cid:20) wt, lt h lt i − b b t E (cid:21) (cid:12) (cid:12) (cid:12) (cid:12) = ≤ wt(s, a)lt(s, a) 1 wt(s, a) φt(s, a) − (cid:19) (cid:18) lt(s, a) wt(s, a) | s,a X b φt(s, a) s,a | X − Proof. Let E Thus, Et h wt, lt h − lt b b ≤ i i φt(s, a) s,a | X lt(s, a) + O(HI[ wt(s, a) E | t]) − Summing this over t, T Et t=1 X h wt, lt h − lt b b ≤ i i T φt(s, a) s,a | t=1 X X By Lemma 48, (⋆) is upper bounded by O | S HA lt(s, a) wt(s, a) | − +O H T t=1 X I[ E t] ! (⋆) {z T t=1 h wt,l2 t i q′ t } ι2 + S5A2ι2 mint q′ t Taking expectations on both sides and using that Pr[ δ, we get (cid:18) r E with probability 1 O(δ). − (cid:19) T E " wt, lt h t=1 X b − lt b O i# ≤ O ≤ HA HA E S   E S       v u u t v u u t Lemma 51 (cf. Lemma C.9 of Lee et al. (2020)). t] P ≤ T t=1 X T t=1 X wt, l2 t i h q′t ι2 + wt, l2 t i h q′t ι2 + S5A2ι2 mint q′t   S5A2ι2 mint q′t  + O (δSAT )   .    E[Bias-2] = E T u, h t=1 X " lt b 60 lt − i# ≤ O(1). Proof. Let E t be the event that P τ for all τ ∈ P ≤ t. By the construction of the loss estimator, we have and thus Et h lt u, h lt i − b 0 ≤ t E i (cid:12) (cid:12) Et h lt u, h − lt b ≤ i i and I[ E t] * H * T 3S2A T E " lt u, h − lt i# ≤ HT 4S2AE t=1 X where the last inequality is by our choice of δ. b Lemma 52 (cf. Lemma C.10 of Lee et al. (2020)). (by Lemma C.5 of Lee et al. (2020), lt(s, a) T 3S2A) ≤ b T " t=1 X I[ E t] # ≤ O(δHT 5S2A) O(1), ≤ E[Reg-term] O  ≤ v u u t  S2A ln(SAT )E T " t=1 X s,a X updt It(s, a)lt(s, a)2 2 q′ t + max t . H 2 t # q′  Proof. By the same calculation as in the proof of Lemma C.10 in Lee et al. (2020), wt h − u, lt i ≤ Dψ(u, wt) b b Dψ(u, b wt) ≤ wt+1) b wt+1) Dψ(u, − ηt Dψ(u, − ηt b b + ηt wt(s, a)2 lt(s, a)2 + ηt s,a X s,a X updt b It(s, a)lt(s, a)2 b 2 q′ t . Let t1, t2, . . . be the time indices when ηt = ηt−1 inequalities above and using telescoping, we get 2 , and let ti⋆ be the last time this happens. Summing the T wt h t=1 X b u, lt − i ≤ b i X ≤ i X ≤ i X = O wti ) Dψ(u, ηti + ηti b O(S2A ln(SAT )) ηti     O(S2A ln(SAT )) ηti ti+1− 1 updt It(s, a)lt(s, a)2 2 q′ t  s,a t=ti X X ti+1− 1 + ηti s,a t=ti X X updt  It(s, a)lt(s, a)2 2 q′ t  (computed in the proof of Lemma C.10 in Lee et al. (2020))  (by the timing we halve the learning rate) updt It(s, a)lt(s, a)2 2 q′ t + max t . H 2 t ! q′  S2A ln(SAT ) ηti⋆ (cid:19) T (cid:18) S2A ln(SAT ) O ≤   v u u t t=1 X s,a X 61 H.2 Corraling We use Algorithm 8 as the corral algorithm for the MDP setting, with Algorithm 13 being the base algorithm. The guarantee of Algorithm 8 is provided in Lemma 42. Proof of Theorem 26. To apply Lemma 42, we have to perform re-scaling on the loss because for MDPs, the loss of a policy in one round is H. Therefore, scale down all losses by a factor of 1 H . Then by Lemma 45, the base algorithm satisfies the condition in Lemma 42 with c1 = S2Aι2 and c2 = S5A2ι2/H where ξt,π is defined as l′t,π = lt,π/H, the expected loss of policy π after scaling. Therefore, by Lemma 42, the we can transform it to an 1 2 -dd-LSB algorithm with c1 = S2Aι2 and c2 = S5A2ι2/H. Finally, using Theorem 23 and scaling back the loss range, we can get regret in the adversarial regime, and O S2AHL⋆ log2(T )ι2 + S5A2 log2(T )ι2 (cid:18)q (cid:19) O H 2S2Aι2 log T ∆ + H 2S2Aι2 log T ∆ r C + S5A2ι2 log(T ) log(C∆− 1) ! regret in the corrupted stochastic regime. 62
http://arxiv.org/abs/2302.09738v8
2023-10-23T17:16:10
2023-02-20T03:31:11
Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to Deep Learning
Riemannian submanifold optimization with momentum is computationally challenging because, to ensure that the iterates remain on the submanifold, we often need to solve difficult differential equations. Here, we simplify such difficulties for a class of sparse or structured symmetric positive-definite matrices with the affine-invariant metric. We do so by proposing a generalized version of the Riemannian normal coordinates that dynamically orthonormalizes the metric and locally converts the problem into an unconstrained problem in the Euclidean space. We use our approach to simplify existing approaches for structured covariances and develop matrix-inverse-free $2^\text{nd}$-order optimizers for deep learning with low precision by using only matrix multiplications. Code: https://github.com/yorkerlin/StructuredNGD-DL
[ "Wu Lin", "Valentin Duruisseaux", "Melvin Leok", "Frank Nielsen", "Mohammad Emtiyaz Khan", "Mark Schmidt" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09738v8", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09738v8", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG" ]
Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to Deep Learning Wu Lin 1 Valentin Duruisseaux 2 Melvin Leok 2 Frank Nielsen 3 Mohammad Emtiyaz Khan 4 Mark Schmidt 1 5 3 2 0 2 t c O 3 2 ] L M . t a t s [ 8 v 8 3 7 9 0 . 2 0 3 2 : v i X r a Abstract Riemannian submanifold optimization with mo- mentum is computationally challenging because, to ensure that the iterates remain on the submani- fold, we often need to solve difficult differential equations. Here, we simplify such difficulties for a class of sparse or structured symmetric positive- definite matrices with the affine-invariant metric. We do so by proposing a generalized version of the Riemannian normal coordinates that dynami- cally orthonormalizes the metric and locally con- verts the problem into an unconstrained problem in the Euclidean space. We use our approach to simplify existing approaches for structured covari- ances and develop matrix-inverse-free 2nd-order optimizers for deep learning with low precision by using only matrix multiplications. 1. Introduction Estimation of symmetric positive definite (SPD) matrices is important in machine learning (ML) and related fields. For example, many optimization methods require it to estimate preconditioning matrices. Approximate inference methods also estimate SPD matrices to obtain Gaussian posterior approximations. Other applications include dictionary learn- ing (Cherian & Sra, 2016), trace regression (Slawski et al., 2015) for kernel matrices, metric learning (Guillaumin et al., 2009), log-det maximization (Wang et al., 2010), Gaussian mixtures (Hosseini & Sra, 2015), and Gaussian graphical models (Makam et al., 2021). Because the set of SPD matrices forms a Riemannian man- ifold, one can use Riemannian gradient methods for SPD estimation, but this can be computationally infeasible in high-dimensions. This is because the methods often require full-rank matrix decomposition (see Table 1). Computations 1University of British Columbia, Vancouver, Canada 2University of California San Diego, San Diego, USA 3Sony Com- puter Science Laboratories Inc., Tokyo, Japan 4RIKEN Center for Advanced Intelligence Project, Tokyo, Japan 5CIFAR AI Chair, Alberta Machine Intelligence Institute, Alberta, Canada. Correspondence to: Wu Lin <[email protected] >. Proceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). 1 can be reduced by using sparse matrices induced by a sub- manifold. However, this complicates manifold operations needed for such submanifold optimization. For example, the Riemannian gradient computation often involves metric inversion (see Table 1). Other operations needed for Rie- mannian momentum, such as the Riemannian exponential map and the parallel transport map, also require solving an intractable ordinary differential equation (ODE). Another idea to develop practical Riemannian methods is to use moving coordinates where a local coordinate is gener- ated, used, and discarded at each iteration. Such approaches can efficiently handle manifold constraints (see for exam- ple the proposed structured natural-gradient descent (NGD) method by Lin et al. (2021a)). However, it is nontrivial to include metric-aware momentum using moving coordinates in a computationally efficient way. In this paper, we aim to simplify the addition of momentum to such methods and de- velop efficient momentum-based updates on submanifolds. We propose special local coordinates for a class of SPD sub- manifolds (Eq. (16)) with the affine-invariant metric. Our approach avoids the use of global coordinates as well as the computation of Riemannian exponential and transport maps. Instead, we exploit Lie-algebra structures in the local coordinates to obtain efficient structure-preserving updates on submanifolds induced by Lie subgroups. Under our local coordinates, all constraints disappear and the metric at eval- uation points becomes the standard Euclidean metric. This metric-preserving trivialization on a submanifold enables an efficient metric-inverse-free Riemannian momentum up- date by essentially performing, in the local coordinates, a momentum-based Euclidean gradient descent (GD) update. We extend the structured NGD approach in several ways: (i) we establish its connection to Riemannian methods (Sec. 3.1); (ii) we demystify the construction of coordinates (Sec. 3.2); (iii) we introduce new coordinates for efficient momentum computation (Sec. 3.1); and (iv) we expand its scope to structured SPD matrices where Gaussian and Bayesian assumptions are not needed (Sec. 3.3). By exploit- ing the submanifold structure of preconditioners, we use our method to develop new inverse-free structured optimizers for deep learning (DL) in low precision settings (Sec. 4). Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL 2. Manifold Optimization and its Challenges Consider a complete manifold M with a Riemannian met- ric F represented by a single global coordinate τ . Under this coordinate system, Riemannian gradient descent (Absil et al., 2009; Bonnabel, 2013) (RGD) is defined as RGD : τ ← RExp(τ , −βF−1(τ )g(τ )), (1) where v(τ ) := F−1(τ )g(τ ) is a Riemannian gradient known as a type (1, 0)-tensor, g(τ ) is a Euclidean gradient known as a type (0, 1)-tensor, F(τ ) is the metric known as a type (0, 2)-tensor, β is a stepsize, and RExp(τ , v) is the Riemannian exponential map defined by solving a nonlinear (geodesic) ODE (see Appx. C.3). The nonlinearity of the ODE makes it difficult to obtain a closed-form expression for the solution. To incorporate momentum in RGD, a Riemannian paral- lel transport map ˆTτ (cur)→τ (new)(ν(cur)) is introduced in many works to move the Riemannian vector (known as a type (1, 0)-tensor) ν(cur) computed at point τ (cur) to point τ (new) on the manifold. For example, Alimisis et al. (2020) pro- pose the following update using the Riemannian transport map (see Appx. C.4) and Riemannian momentum ν(cur) with momentum weight α: Momentum : ν(cur) ← αz(cur) + βF−1(τ (cur))g(τ (cur)), RGD : τ (new) ← RExp(τ (cur), −ν(cur)), Transport : z(new) ← ˆTτ (cur)→τ (new)(ν(cur)). (2) Unlike existing works, we suggest using Euclidean momen- tum and a Euclidean parallel transport map (see Appx. C.5) Tτ (cur)→τ (new)(m(cur)) to move the momentum (known as a type (0, 1)-tensor). The use of this Euclidean map is es- sential for efficient approximations of the transport, as will be discussed in Sec. 3.1. Through this Euclidean map, we obtain an equivalent update of Eq. (2) (shown in Appx. C.6) via Euclidean momentum m(cur): Momentum : m(cur) ← αw(cur) + βg(τ (cur)), RGD : τ (new) ← RExp(τ (cur), −F−1(τ (cur))m(cur)), Transport : w(new) ← Tτ (cur)→τ (new)(m(cur)). (3) 2.1. Challenges on SPD Manifold and Submanifolds Consider the k-by-k SPD manifold M = {τ ∈ Rk×k|τ ≻ 0}. The affine-invariant metric F for the SPD manifold (see Theorem 2.10 of Minh & Murino (2017)) is defined as twice the Fisher-Rao metric (see Appx. C.1) for the k- dimensional Gaussian distribution N (0, τ ) with zero mean and covariance τ , which is the 2nd derivative of a matrix, F(τ ) = −2EN (0,τ ) (cid:2)∇2 τ log N (0, τ )(cid:3). (5) The Fisher-Rao metric known as the Fisher information ma- trix is a well-known and useful metric for many applications in ML. Moreover, the affine-invariant metric is more suit- able and useful for SPD matrices compared to the standard Euclidean metric defined in either the global coordinate τ (Pennec et al., 2006) or a (global) Cholesky unconstrained reparametrization (Hosseini & Sra, 2015). Thus, we use and preserve the affine-invariant metric. Unlike existing works in manifold optimization, we preserve the metric in local coordinates instead of global coordinates. Thus, we have to obey the metric transform rule needed for a coordinate change whenever we generate a local coordinate. In the SPD manifold case, the Riemannian maps have a closed-form expression (see Table 1). However, the updates in Eq. (1)-(3) require computing matrix inversion/decom- position in the Riemannian maps, so such methods have O(k3) complexity and are impractical when k is large. To our best knowledge, very few Riemannian methods are de- veloped and tested in high-dimensional (i.e., k > 106), low floating-point precision, and stochastic cases. We will propose an alternative approach to construct practical Rie- mannian methods for SPD submanifolds when these three cases are considered jointly. For many SPD submanifolds1 with the same (induced) met- ric, it is nontrivial to implement updates in Eq. (1)- (3) since these needed Riemannian maps often do not admit a simple closed-form expression. For example, consider the follow- ing SPD submanifold, which can be used (Calvo & Oller, 1990) to represent a (k−1)-dimensional Gaussian with mean μ and full covariance Σ := V − μμT , Given a Euclidean gradient g evaluated at τ (cur), Eu- transport map the Riemannian follows, are clidean transport map related and the as ˆTτ (cur)→τ (new)(F−1(τ (cur))g) = F−1(τ (new))Tτ (cur)→τ (new)(g). (4) We can use this relationship to show the equivalence of Eq. 2 and Eq. 3. Both the transport maps are defined by solving transport ODEs (defined in Appx. C.4-C.5). However, solving any of the ODEs can be computationally intensive since it is a linear system of differential equations and the solution often involves matrix decomposition. (cid:110) (cid:111) . τ = M = ∈ Rk×k | τ ≻ 0 (cid:21) (cid:20) V μ μT 1 The Riemannian exponential map for this submanifold does not have a simple and closed-form expression (Calvo & Oller, 1991), not to mention other submanifolds induced by structured covariance Σ. The exponential map also is unknown on the following rank-one SPD submanifold, M = (cid:110) τ = (cid:21) (cid:20)a2 ab bbT + Diag(c2) abT ∈ Rk×k | τ ≻ 0 (cid:111) . The existing Riemannian maps defined on the full SPD man- ifold such as the exponential map and the transport maps 1The ambient space of a SPD submanifold is a SPD manifold. One trivial submanifold is the set of diagonal SPD matrices. 2 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL Operations on SPD in global τ Riemann. gradient v at τ 0 Riemann. exponential RExp(τ 0, v) Riemann. transport ˆTτ0→τ1 (v) Euclidean transport Tτ0→τ1 (g) Manifold τ 0gτ 0 0 Expm(τ −1/2 vτ −1/2 τ 1/2 0 EvET ; E := (τ 1τ −1 HgHT ; H := τ −1 1 Eτ 0 0 0 )1/2 )τ 1/2 0 Submanifolds F−1(τ 0)g Unknown Unknown Unknown τ τ (cur) F(η0) Γa bc(η0) SNC ψτ (cur) (η) ψτ (cur) (η0) I 0 GNC φτ (cur) (η) φτ (cur) (η0) I can be nonzero Table 1. Manifold operations compatible with affine-invariant metric F, where Expm(N) = (cid:80)∞ and g is a (symmetric) Euclidean gradient at τ 0. On submanifolds, τ denotes learnable vectorized parameters and g is also vectorized. k! Nk is the matrix exponential function, k=0 1 Table 2. Properties of Riemannian normal coordinates η defined at τ (cur), where the original η0 = 0 repre- sents τ (cur), ψ is defined by the Riemannian exponential map, and φ is a diffeomorphic and isometric map. cannot be used on SPD submanifolds since these maps are neither computationally efficient in high dimensional cases nor preserve the submanifold structures. In particular, these maps do not guarantee that their output stays on a given SPD submanifold. To stay on a submanifold, a retraction map using global coordinate τ is proposed as an approximation of the exponential map for the submanifold. Likewise, a vector transport map is proposed to approximate the Rie- mannian parallel transport map. However, both retraction and vector transport maps vary from one submanifold to another. It can be difficult to design such maps for a new submanifold. A generic approach to designing such maps is to approximate the ODEs. However, it is computationally challenging to even evaluate the ODEs at a point when the global coordinate τ is used, since this requires computing the Christoffel symbols Γa cb(τ ) (see Appx. C.2) arising in the ODEs. These symbols are defined by partial derivatives of the metric F(τ ) in Eq. (5), so their computation involves complicated 3rd order derivatives of a matrix and makes it hard to preserve a given submanifold structure. Other global- coordinate approaches such as the Frank-Wolfe algorithm recast a submanifold as a closed-set constraint in an (higher- dimensional) ambient manifold and solve a constrained sub- problem with the constraint. However, such a constraint varies from one submanifold to another. It can be non-trivial to come out with a closed-set constraint for a given sub- manifold. Furthermore, it can be both mathematically and computationally challenging to obtain a closed-form expres- sion to solve the constrained subproblem when the ambient manifold is high-dimensional. Moreover, the existing Rie- mannian gradient computation on a full SPD manifold is neither computationally efficient nor straightforwardly ap- plicable for a SPD submanifold since a Riemannian gradient on the manifold is not necessarily a Riemannian gradient on the submanifold. Thus, it is unclear how to efficiently compute a Riemannian gradient F−1(τ )g(τ ) on a SPD sub- manifold without explicitly inverting the metric, which can be another computationally intensive operation. 2.2. Natural-gradient Descent and its Challenges A practical approach is natural-gradient descent (NGD), which approximates the Riemannian exponential map by ignoring the Christoffel symbols. A NGD update is a linear approximation of the update of Eq. (1) given by NGD : τ ← τ − βF−1(τ )g(τ ). (6) This approximation is also known as the Euclidean retrac- tion map (Jeuris et al., 2012). Unfortunately, NGD in the global coordinate τ does not guarantee that the update stays on a manifold even in the full SPD case. Moreover, comput- ing Riemannian gradients remains challenging due to the metric inverse. Structured NGD (Lin et al., 2021a) addresses the SPD constraint of Gaussians for Bayesian posterior ap- proximations by performing NGD on local coordinates. Lo- cal coordinates could enable efficient Riemannian gradient computation by simplifying the metric inverse computa- tion. However, it is nontrivial to incorporate momentum in structured NGD due to the metric and the use of moving coordinates. We address this issue and develop practical Rie- mannian momentum methods by using generalized normal coordinates. Using our normal coordinates, we will explain and generalize structured NGD from a manifold optimiza- tion perceptive. We further expand the scope of structured NGD to SPD submanifolds by going beyond the Bayesian settings. Our local-coordinate approach gives a computa- tionally efficient paradigm for a class of SPD submanifolds where it can be nontrivial to design an efficient retraction map or solve a closed-form constrained subproblem using a global coordinate while keeping the Riemannian gradient computation efficient and inverse-free. 2.3. Standard Normal Coordinates (SNCs) Defn 1: A metric F is orthonormal at η0 = 0 if F(η0) = I, where I is the identity matrix. Normal coordinates can simplify calculations in differential geometry and general relativity. However, these coordinates are seldom studied in the optimization literature. Given a reference point τ (cur), the standard (Riemannian) normal coordinate (SNC) η at τ (cur) is defined as below, where τ (cur) and F−1/2(τ (cur)) are treated as constants in coordinate η: τ = ψτ (cur) (η) := RExp(τ (cur), F−1/2(τ (cur))η). F−1/2(τ (cur)) in Eq. (7) is essential since it orthonormalizes the metric at η0 (i.e., F(η0) = I) and will simplify the Rie- mannian gradient computation in Eq. (8) and (12). (7) Lezcano (2019; 2020) consider (non-normal) local coor- dinates defined by the Riemannian exponential such as τ = RExp(τ (cur), λ). However, the metric is not orthonormal in their coordinates (i.e., F(λ0) ≡ F(τ (cur)) ̸= I at λ0 = 0). They use an ad-hoc metric I instead of F(λ0) at λ0. Thus, their approach does not preserve the predefined metric F. An- other issue is that the ad-hoc metric in their approach does 3 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL (a) Normal coordinate η at τ (cur) (b) Normal coordinate ξ at τ (new) Figure 1. A (orthonormal) SNC/GNC is generated at each iteration. not obey the metric transform rule needed for the change of local coordinates at each iteration. In Sec. 3, we will address these issues via metric-aware orthonormalizations and propose metric-preserving trivializations even when the Riemannian exponential is unknown on submanifolds. A SNC has nice computational properties, summarized in Table 2. In coordinate η, the origin η0 := 0 represents the point τ (cur) = ψτ (cur)(η0) as illustrated in Fig. 1. RGD in Eq. (1) can be reexpressed as (Euclidean) gradient descent (GD) in local coordinate η since the metric F(η0) at η0 becomes the standard Euclidean metric I: NGD/GD : η1 ← η0 − βF−1(η0)g(η0) = 0 − βI−1g(η0), τ (new) ← ψτ (cur) (η1), (8) where g(η0) = F−1/2(τ (cur))g(τ (cur)) is a Euclidean gradi- ent evaluated at η0. Since the metric F(η0) is orthonormal, the GD update is also a NGD update in coordinate η. The orthonormalization of the metric makes it easy to add mo- mentum into RGD while preserving the metric. In the SPD case, F−1/2(τ )η = τ 1/2ητ 1/2, where η is a symmetric matrix. Recall that F(τ (cur)) ̸= I for any τ (cur) ̸= I. However, by Eq. (5), the metric F(η) is orthonormal, at η0 associated to τ (cur) = ψτ (cur) (η0) as shown below. (cid:2)∇2 F(η0) = −2EN (0,τ )) η log N (0, τ )(cid:3)(cid:12) = I, (9) (cid:12)η=η0 where τ = ψτ (cur) (η). By Table 1, ψτ (cur) (η) in SNC η has a closed-form, where Expm(*) is the matrix exponential, ψτ (cur) (η) = (cid:0)τ (cur)(cid:1)1/2 Expm(η)(cid:0)τ (cur)(cid:1)1/2 . (10) Eq. (10) is only obtainable for SPD manifolds if we use SNC η, and in particular, the metric must be orthonormal at η0. In the case of SPD submanifolds, it is hard to use a SNC as it relies on the intractable Riemannian exponential map, as seen in Eq. (7). Recall that the Riemannian exponential map is defined by solving a non-linear ODE and it varies from one submanifold to another submanifold. However, we will make use of the matrix exponential2 in Eq. (10) to generalize normal coordinates and to reduce the computation cost of Riemannian gradients on SPD submanifolds. 3. Generalized Normal Coordinates (GNCs) We propose new (metric-aware orthonormal) coordinates to simplify the momentum computation on a (sub)manifold with a predefined metric. Inspired by SNCs, we identify 2It is a Lie-group exponential map. Importantly, this map remains the same on matrix subgroups. In contrast, the Riemannian exponential map varies from one submanifold to another. 4 their properties that enable efficient Riemannian optimiza- tion, and generalize normal coordinates by defining new coordinates satisfying these properties on the (sub)manifold. Defn 2: A local coordinate is a generalized (Riemannian) normal coordinate (GNC) at point τ (cur) denoted by τ = φτ (cur) (η) if φτ (cur) (η) satisfies all the following assumptions. Assumption 1: The origin η0 = 0 represents point τ (cur) = φτ (cur) (η0) in coordinate η. Assumption 2: The metric F(η0) is orthonormal at η0. Assumption 3: The map φτ (cur) (η) is bijective. φτ (cur) and φ−1 Assumption 4: The parameter space of η is a vector space. τ (cur) are smooth (i.e. φτ (cur) (η) is diffeomorphic). Assumption 1 enables simplification using the chain rule of high-order derivative calculations (i.e., the metric and Christoffel symbols in Appx. E, F) by evaluating at zero, which is useful when computing Christoffel symbols. As- sumption 2 enables metric preservation in GD updates by dynamically orthonormalizing the metric. By Assump- tion 3, (sub)manifold constraints disappear in these coordi- nates, and Assumption 4 ensures that scalar products and vector additions are well-defined, so that GD updates are valid. For example, SNCs satisfy Assumptions 1-2 (see Table 2) and Assumption 3 due to the Riemannian expo- nential. On a complete manifold, SNCs satisfy Assumption 4 (Absil et al., 2009). These assumptions make it easy to design new coordinates without the Riemannian expo- nential. Assumptions 1-4 together imply that φτ (cur) (η) is a metric-preserving/isometric map from the tangent space at τ (cur) with Riemannian metric F(τ (cur)) to a (local) coor- dinate space of η identified as a tangent space at η0 with the Euclidean metric F(η0) = I such as a matrix subspace in Sec. 3.3. This map is a metric-preserving trivialization as (sub)manifold constraints are trivialized and the metric is preserved and orthonormal in the coordinate space of η. Thus, GD becomes NGD in the space. Our approach differs from existing trivialization suggested by Lezcano (2019; 2020), as GD does not become NGD in their coordinates. Related local-coordinate approaches (Lezcano, 2019; 2020; Lin et al., 2021a;b) do not orthonormalize the metric so adding Riemannian momentum can be inefficient. We will propose GNCs to work with NGD/GD by satis- fying Assumptions 1-4 while reducing the computational cost by ignoring Christoffel symbols (see Table 2). A GD update in a GNC is an approximation of the RGD update in Eq. (8). This GD update can be understood as a NGD update with special local reparametrizations. As will be shown in Sec. 3.3.1, the GD resembles structured NGD in Gaussian cases, both of which ignore the symbols, NGD/GD : η1 ← η0 − βF−1(η0)g(η0) = 0 − βI−1g(η0), τ (new) ← φτ (cur) (η1). (11) In the full SPD case, Lin et al. (2021a) establish a connection Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL between the update in η and a retraction map in τ . 3.1. Adding Momentum using GNCs Since the metric is orthonormal at η0, we propose simply adding (Euclidean) momentum in the GD update in our normal coordinates. At each iteration, given the current point τ (cur) in the global coordinate, we generate a GNC η at τ (cur) and perform the update in coordinate η, where we first assume momentum w(η0) is given at the current iteration. our update with momentum in GNC η Momentum : m(η0) ← αw(η0) + βg(η0), NGD/GD : η1 ← η0 − F−1(η0)m(η0) = 0 − I−1m(η0), τ (new) ← φτ (cur) (η1), (12) where α is the momentum weight and β is the stepsize. We now discuss how to include momentum in moving (local) coordinates η and ξ, where η and ξ are GNCs defined at τ (cur) and τ (new), respectively. Note that τ (new) is represented by η1 in current coordinate η and by ξ0 in new coordinate ξ. To compute momentum w(ξ0) in coordinate ξ at the next iteration, we perform the following two steps. Step 1: (In Coordinate η) We transport momentum m(η0) at point τ (cur) via the Euclidean transport map to point τ (new), which is similar to the transport step in Eq. (3). Since performing NGD/GD alone ignores Christoffel sym- bols, we suggest ignoring the symbols in the approximation of the Euclidean transport map Tη0→η1 (m(η0)) using coor- dinate η. This gives the following update: momentum transport in GNC η Approximated Transport : w(η1) ← m(η0). (13) The approximation keeps the dominant term of the map and ignores negligible terms. In a global coordinate, this ap- proximation is known as the Euclidean vector transport map (Jeuris et al., 2012) and the vector-transport-free map (Go- daz et al., 2021). A similar approximation is also suggested in Riemannian sampling (Girolami & Calderhead, 2011) to avoid solving an implicit leapfrog update. Using GNCs, we can make a better approximation by adding the second dominant term (see Appx. F) defined by the Christoffel sym- bols. For example, in SPD cases, the second dominant term (see Eq. (56) in Appx. F) can be explicitly computed and is negligible compared to the first term. The computation can be similarly carried out on submanifolds. Moreover, if GNC η is a symmetric matrix as will be shown in Eq. (15), the second dominant term vanishes even if the symbols are non-vanishing. On the other hand, it is nontrivial to compute the second term in a global coordinate τ on submanifolds. Step 2: (At Point τ (new)) We coordinate-transform momen- tum w(η1) from coordinate η to coordinate ξ and return the transformation as w(ξ0), where η1 and ξ0 represent τ (new). By construction of GNCs (shown in Fig. 1), coordinates η and ξ represent the global coordinate τ as τ = φτ (cur) (η) = φτ (new)(ξ), where ξ is the GNC associated to τ (new) at the next iteration. We transform Euclidean momentum w(η1) as a Euclidean (gradient) vector from coordinate η to coor- dinate ξ via the (Euclidean) chain rule, momentum coordinate-transform for new GNC ξ (cid:16) w(ξ0)(cid:17)T (cid:16) w(η1)(cid:17)T = J(ξ0); J(ξ) := ∂η ∂ξ , (14) where ξ0 = 0, η = φ−1 τ (cur) ◦ φτ (new)(ξ), and J(ξ) is the Jacobian. Thanks to GNCs, the vector-Jacobian product in Eq. (14) can be simplified by evaluating at ξ0 = 0. We can see that our update using local coordinates in Eq. (12)-(14) is a practical approximation of update (3) using a global coordinate. The Euclidean transport map is required for the use of the (Euclidean) chain rule and simplification of the vector-Jacobian product in Eq. (14). Our update shares the same spirit of Cartan's method of moving frames (Ivey & Landsberg, 2003) by using only Eu- clidean/exterior derivatives. The Christoffel symbols could be computed via a Lie bracket 3 due to Cartan's structure equations and the Maurer-Cartan form (Piuze et al., 2015). 3.2. Designing GNCs for SPD Manifolds We describe how to design GNCs on SPD manifolds. This procedure explains the construction of existing coordinates in Lin et al. (2021a); Godaz et al. (2021). To mimic the SNC in Eq. (10), consider the matrix factor- ization τ (cur) = A(cur)(cid:0)A(cur)(cid:1)T , where A(cur) is invertible (not a Cholesky). This asymmetric factorization contains a matrix Lie group structure in A(cur) for submanifolds while the symmetric one (i.e., (cid:0)τ (cur)(cid:1)1/2 ) in Eq. (10) does not. The Christoffel symbols are non-vanishing due to the asym- metry. Nevertheless, this factorization allows us to obtain a coordinate by approximating the map ψτ (cur) in the SNC as (cid:16)A(cur)(cid:17)T Expm(η) φτ (cur) (η) :=A(cur) =A(cur) Expm( 1 2 η)ExpmT ( 1 2 η) (cid:16)A(cur)(cid:17)T =AAT , (15) where A := A(cur)Expm( 1 2 η) and η is a symmetric matrix. Factorization τ = AAT can be non-unique in A. We only require coordinate η to be unique instead of A. To satisfy uniqueness in η required in Assumption 3, we can restrict η to be in a subspace of Rk×k such as the symmetric matrix space. Coordinate η is a GNC at τ (cur) (shown in Appx. H.1). Using other factorizations, we obtain more GNCs: • φτ (cur) (η) = B−T B−1, with B := B(cur)Expm(− 1 • φτ (cur) (η) = CT C, with C := Expm( 1 2 η)C(cur) 2 η) where η is a symmetric matrix in both cases. The GNC considered in Eq. (15) is similar to local co- ordinates in structured NGD, where A is referred to as 3There is a Lie group structure for the coordinate- transformation in the frame bundle of a general (sub)manifold. 5 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL an auxiliary coordinate. The authors of structured NGD (Lin et al., 2021a) introduce a similar local coordinate as A := A(cur)Expm(η) in Gaussian cases without providing the construction and mentioning other local coordinates. The metric is not orthonormal in their coordinates. Our procedure sheds light on the construction and the role of local coordinates in structured NGD. For example, our construction explains why A = A(cur)Expm(η) instead of A = Expm(η)A(cur) is used in structured NGD for the fac- torization τ = AAT . Using A = Expm(η)A(cur) in structured NGD makes it difficult to compute natural-gradients since the metric is not orthonormal. In contrast, our coordinates explicitly orthonormalize the metric, which makes it easy to compute (natural) gradients and include momentum. Using the GNC in Eq. (15), our update in Eq. (12)-(14) can be simplified as shown in Appx. H.3. By using our GNCs, we can obtain inverse-free updates. When the matrix expo- nential Expm is approximated, our updates even become matrix-decomposition-free updates, which is useful in low numerical settings. Godaz et al. (2021) consider a special case for full SPD manifolds with symmetric η and a unique factor A. How- ever, their method is non-constructive and limited to SPD manifolds. Our construction generalizes their method by allowing η to be an asymmetric matrix, using a non-unique factor A, and extending their method to SPD submanifolds. 3.3. Designing GNCs for SPD Submanifolds Although SNCs are unknown on SPD submanifolds, GNCs allow us to work on a class of SPD submanifolds by noting that A is in the general linear group GLk×k known as a ma- trix Lie group. Matrix structures are preserved under matrix multiplication and the matrix exponential. The coordinate space of η is a subspace of the tangent space of Expm(η) at Expm(η0) = I known as the Lie algebra. Recall that the Lie algebra of GLk×k is a square matrix space Rk×k. Thus, Assumption 4 is satisfied. One example of a struc- tured group is to consider a (unique) Cholesky factor A. In this case, A is in a lower-triangular subgroup of GLk×k. This group structure induces a SPD manifold. Thus, we can obtain a new GNC for the SPD manifold by restricting η to be a lower-triangular matrix with proper scaling factors, where the lower-triangular matrix space of η is a subspace of the Lie algebra Rk×k. The above observations and the example let us consider the following class of SPD submanifolds4: M = τ = AAT ≻ 0 | A ∈ Connected Subgroup of GLk×k(cid:111) (cid:110) . (16) Each of the submanifolds is induced by a (fixed-form) Lie subgroup. The Lie subgroup is constructed by a GNC space of the submanifold as a subspace of the Lie algebra of the 4Another Lie group structure is induced by a SPD submanifold. general linear group. We will construct diffeomorphic maps using the matrix (Lie-group) exponential to approximate the Riemannian exponential map on these submanifold. Each of the diffeomorphic maps induces a GNC. We propose GNCs for these submanifolds so that our update preserves the Lie subgroup structure in A by performing up- dates in the GNCs as a subspace of the Lie algebra. Thanks to the GNCs, we can use A to represent each of the sub- manifolds τ . Note that we can directly update and maintain A instead of τ . Thus, a GNC for each of the submani- folds is readily available as τ = φτ (cur) (η) = AAT in our local-coordinate approach. On the other hand, existing Rie- mannian methods directly update a global coordinate τ and thus, a costly matrix decomposition such as τ = AAT may be required to satisfy the submanifold constraint. We give two examples of SPD submanifolds, where we construct GNCs. GNCs can be constructed for other sub- manifolds considered in Lin et al. (2021a). For example, we will use a Heisenberg SPD submanifold suggested by Lin et al. (2021a) in our experiments. In Sec. 3.3.1, we present our update without the Bayesian and Gaussian as- sumptions. Our update recovers structured NGD as a special case by making a Gaussian assumption. In Sec. 3.3.2, we demonstrate the scalability of our approach. 3.3.1. GAUSSIAN FAMILY AS A SPD SUBMANIFOLD We will first consider a SPD submanifold in a non-Bayesian and non-Gaussian setting. We then show how our update relates to structured NGD in Gaussian cases where Gaussian gradient identities are available. Thus, the structured NGD update on a Gaussian family is a special case of our update on a higher-dimensional SPD submanifold. Consider the SPD submanifold, where k = d + 1, (cid:27) (cid:21) (cid:20) V μ μT 1 ∈ Rk×k | τ ≻ 0 M = τ = (cid:26) . (cid:20) Σ−1 −μT Σ−1 −Σ−1μ 1 + μT Σ−1μ (cid:21) , for τ ∈ M and Σ := Note that τ −1 = V − μμT . Thus, Σ ≻ 0 since τ −1 ≻ 0. Then, letting Σ = LLT , M can be reexpressed as (cid:20)L μ 1 0 , L ∈ GLd×d(cid:111) . τ = AAT | A := M = (cid:110) (cid:21) Observe that A is in a subgroup of GLk×k. We construct a GNC φτ (cur) (η) = AAT similar to the one in Eq. (15), where (cid:18)(cid:20) 1 (cid:21)(cid:19) A = A(cur)Expm 2 ηL 0 1√ ημ 2 0 , (17) and η = {ηL, ημ}, ηL ∈ Rd×d is a symmetric matrix so that Assumption 3 is satisfied. The scalars highlighted in red are to satisfy Assumption 2 so that the metric is orthonormal. There is another GNC φτ (cur) (η) = AAT where 6 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL 2 ηL) A =A(cur) (cid:20)Expm( 1 0 (cid:20)L(cur)Expm( 1 = (cid:21) 1√ ημ 2 1 2 ηL) μ(cur) + 1√ 2 1 0 L(cur)ημ (cid:21) . (18) We can obtain Eq. (18) from Eq. (17) (shown in Appx. G.1). Using the GNC in either Eq. (17) or Eq. (18), the Euclidean gradient needed in Eq. (12) is given by g(η0) = {LT g1L, √ where L = L(cur), μ = μ(cur), g(τ (cur)) = metric) Euclidean gradient w.r.t. τ ∈ M. The vector- Jacobian product in Eq. (14) is easy to compute by using coordinate Eq. (18). Note that the computation of this prod- uct does depend on the choice of GNCs. is a (sym- 2LT (g1μ + g2)}, (cid:20)g1 g2 gT 0 2 (cid:21) Our update can be used for SPD estimation such as met- ric learning, trace regression, and dictionary learning from a deterministic matrix manifold optimization perspective. Neither Bayesian nor Gaussian assumptions are required. In Gaussian cases, Calvo & Oller (1990) show that a d- dimensional Gaussian N (z|μ, Σ) with mean μ and co- variance Σ can be reexpressed as an augmented (d + 1)- dimensional Gaussian N (x|0, τ ) with zero mean and covariance τ , where xT = [zT , 1] and τ is on this SPD submanifold. Hosseini & Sra (2015) consider this reparametrization for maximum likelihood estimation (MLE) of Gaussian mixture models, but their method is only guaranteed to converge to this particular submanifold at the optimum as they use the Riemannian maps for the corre- sponding full SPD manifold. On the contrary, our update not only stays on this SPD submanifold at each iteration but is also applicable to other SPD submanifolds. Our approach expands the scope of structured NGD originally proposed as a Bayesian estimator to a maximum likelihood estimator for Gaussian mixtures with structured covariances Σ where existing methods such as Hosseini & Sra (2015) and the expectation-maximization algorithm cannot be applied. To show that structured NGD is a special case of our update, consider Σ is a dense covariance for simplicity. We can extend the following results for structured covariance cases. In a dense case, the NGD update (Lin et al., 2021a) for Gaussian N (μ, Σ) with the Fisher-Rao metric is μ ← μ − γΣgμ, L ← LExpm(−γLT gΣL), (19) where Σ = LLT and γ is the stepsize for structured NGD. As shown in Appx. G.2, we can reexpress g1 and g2 using Gaussian gradients gμ and gΣ as g1 = gΣ and g2 = 1 2 (gμ − 2gΣ μ). Thus, we reexpress g(η0) as g(η0) = {LT gΣL, 1 √ 2 LT gμ}. (20) Since the affine-invariant metric is twice the Fisher-Rao metric (see Eq. (5)) , we set stepsize β = 2γ and momentum weight α = 0. Our update (without momentum) in Eq. (12) recovers structured NGD in Eq. (19) by using the Gaussian gradients in Eq. (20) and coordinate (18). Using the GNC in (18), our update essentially performs NGD in the expectation parameter space {μ, Σ + μμT } (in- duced by τ ) of a Gaussian by considering the Gaussian as an exponential family. Likewise, using another GNC such as τ = B−T B−1, our update performs NGD in the natu- ral parameter space {−Σ−1μ, Σ−1} (induced by τ −1), which is the (Bregman) dual space of the expectation parameter space (Khan & Lin, 2017). When A and B−T have the same (sparse) group structure even for a Gaussian with structured covariance Σ, our updates using each of the GNCs agree to first-order O(β) w.r.t. stepsize β in the global coordinate τ . 3.3.2. RANK-ONE SPD SUBMANIFOLD Now, we give an example of sparse SPD matrices to illus- trate the usage of our update in high-dimensional problems. Consider the following SPD submanifold, where k = d + 1. abT (cid:110) (cid:21) ∈ Rk×k | τ ≻ 0 (cid:111) . (cid:20)a2 ab bbT + Diag(c2) M = τ = To construct GNCs, we reexpress M as M = (cid:110) τ = AAT | A := (cid:20)a b Diag(c) 0 (cid:21) , a > 0, c > 0 (cid:111) , where Diag(c) is in the diagonal subgroup of GLd×d. Ob- serve that A is in a subgroup of GLk×k. Thus, we can construct the following GNC, τ = AAT ; A = A(cur)Expm(D ⊙ η), (cid:20)ηa ηb Diag(ηc) ∈ Rk×k, ⊙ is elementwise product, 0 (cid:21) where η = (cid:20) 1 √ and the constant matrix D = 1 2 0 21 Id vector of ones) enforces Assumption 2. (cid:21) (with 1 denoting a The Euclidean gradient g(η0) in Eq. (12) can be efficiently computed via sparse Euclidean gradients w.r.t. A. It can also be computed via dense Euclidean gradients w.r.t. τ as (cid:21) 0 Diag(c2 ⊙ diag(G3)) (cid:20)a(ag1 + 2gT 2 b) + bT f 2c ⊙ (ag2 + f ) g(η0) = √ , where f = G3b and g(τ (cur)) = Euclidean gradient w.r.t. τ . We assume that we can directly compute f and diag(G3) without computing G3. The com- putation of Eq. (14) can be found in Appx. D. is a (symmetric) (cid:21) (cid:20)g1 gT 2 g2 G3 On this submanifold, it is easy to scale up our update (12) to high-dimensional cases, by truncating the matrix exponen- 2 N2. This truncation tial function as Expm(N) ≈ I + N + 1 preserves the structure and non-singularity of A. 4. Generalization for Deep Learning It is useful to design preconditioned GD such as Newton's 7 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL Our Inverse-free, Multiplication-only Update 1: Each T iter., update mK , mC , K, C Obtain μAA ⊗ μGG to approximate ∇2 mK ← α1mK + β1 mC ← α1mC + β1 K ← KExpm(−mK ) ≈ K(Ip − mK ) C ← CExpm(−mC ) ≈ C(Id − mC ) 2d (Tr(HC )HK + c2KT K − dIp) 2p (Tr(HK )HC + κ2CT C − pId) μl(μ) KFAC Optimizer 1: Each T iter., update (cid:0)KKT(cid:1)−1 , (cid:0)CCT(cid:1)−1 Obtain μAA ⊗ μGG to approximate ∇2 (cid:0)KKT(cid:1)−1 (cid:0)CCT(cid:1)−1 KKT ← ((cid:0)KKT(cid:1)−1 CCT ← ((cid:0)CCT(cid:1)−1 ← θ (cid:0)KKT(cid:1)−1 ← θ (cid:0)CCT(cid:1)−1 + (1 − θ)μAA + (1 − θ)μGG + λIp)−1 + λId)−1 , KKT, CCT μl(μ) 2: Mμ ← α2Mμ + CCT vec−1(∇μl(μ))KKT + γμ 3: μ ← μ − β2vec(Mμ) 2: Mμ ← α2Mμ + CCTvec−1(∇μl(μ))KKT + γμ 3: μ ← μ − β2vec(Mμ) Figure 2. In our update, we denote HK := KT μAAK , HC := CT μGGC , κ2 := λTr(KT K) , and c2 := λTr(CT C), where vec−1(μ) ∈ Rd×p, C ∈ Rd×d, K ∈ Rp×p. Note that we merge factors p in Eq. (25) into the updates in mK and mC , re- spectively (see Eq. (87) in Appx. I for a justification). We use the linear truncation of the matrix exponential function. Our update does not require explicit matrix inverses. We can also pre-compute CCT and KKT when T > 1. In KFAC, a damping term λI is introduced to handle the singularity of (cid:0)KKT(cid:1)−1 and (cid:0)CCT(cid:1)−1. We introduce a similar damping term in κ2 and c2 (see Appx. I for a derivation) to improve numerical stability. Our update and KFAC include momentum weight α2 for layer-wise NN weights μ and (L2) weight decay γ. In our update, we also introduce momentum weight α1 in the SPD preconditioner. Our update is more numerically robust than KFAC. Thus, our update can often use a larger stepsize β2 and a smaller damping weight λ than KFAC. and 1 √ 2 1 √ d 2 method by exploiting the submanifold structure of the pre- conditioner. We will use that structure to design inverse-free structured matrix optimizers for low-precision floating-point training schemes in DL. To solve a minimization problem minμ∈Rk l(μ), a Newton's step with β = 1 is S ← (1 − β)S + β∇2 μl(μ), μ ← μ − βS−1gμ In stochastic settings, it is useful to consider an averaged update by setting 0 < β < 1. However, the updated S can be non-SPD. Lin et al. (2021b) propose a Newton-like update derived from structured NGD. Instead of directly updating S, the authors consider a SPD preconditioner S := BBT and update B as follows. μ ← μ − βS−1gμ, B ← BExpm(cid:0) β 2 B−1gS−1 B−T (cid:1), (21) 2 (∇2 where gS−1 := 1 μl(μ) − S), and gμ := ∇μl(μ). Lin et al. (2021b) show that the update in B can be re-expressed μl(μ) + O(β2). More in terms of S as S ← (1 − β)S + β∇2 importantly, the updated S is guaranteed to be SPD. Similar to Newton's update, Eq. (21) is linearly (Lie group) invariant in μ. When S is a SPD submanifold, this update has a structural (Lie subgroup) invariance5. However, this update requires a matrix inverse which can be slow and numerically unstable in large-scale training due to the use of low-precision floating-point training schemes. Eq. (21) can be obtained by considering the inverse of the preconditioner τ = S−1 = B−T B−1 as a SPD manifold. The update of B can be obtained by using the GNC in Sec. 3.2 as τ = B−T B−1 where B = B(cur)Expm(− 1 2 η). The minus sign (see Eq. (74) in Appx. H.3) is canceled out by another 5This is a Lie-group structural invariance in μ induced by a structured SPD preconditioner (Lin et al., 2021b). minus sign in the GD update of Eq. (12). We can obtain a matrix-inverse-free update (see Appx. H.3): μ ← μ − βAAT gμ, (22) by changing the GNC to S−1 = τ = AAT where A = A(cur)Expm( 1 2 η). Moreover, the update of A is also matrix- inverse-free (see Sec. 3.2 and Eq. (73) in Appx. H.3 ). We can obtain the same update by considering {μ, Σ} with Σ = S−1 as a submanifold in Sec. 3.3.1 since structured NGD is a special case of ours. To approximate the Hessian ∇2 μl(μ) in DL as required in gS−1, we consider the KFAC approximation (Martens & Grosse, 2015). For simplicity, consider the loss function l(μ) defined by one hidden layer of a neural network (NN), where k = pd, vec−1(μ) ∈ Rd×p is a learnable weight ma- trix, vec(*) is the vectorization function. In KFAC (summa- rized in Fig. 2), the Hessian at each layer of a NN with many layers is approximated by a Kronecker-product structure be- tween two dense symmetric positive semi-definite matrices μl(μ) ≈ μAA ⊗ μGG, where matrices μAA ∈ Rp×p as ∇2 and μGG ∈ Rd×d are computed as suggested by the authors and ⊗ denotes the Kronecker product. We consider a Kronecker-product structured submanifold with k = pd to exploit the structure of the approximation: (cid:110) M = τ = U ⊗ W ∈ Rpd×pd | τ ≻ 0 (cid:111) , where matrices U ∈ Rp×p and W ∈ Rd×d are both SPD. We can reexpress this submanifold as (cid:110) M = τ = AAT | A := K ⊗ C (cid:111) , (23) where U = KKT , W = CCT , K ∈ Rp×p, C ∈ Rd×d. K and C are (sub)groups of GLp×p and GLd×d, respectively. By exploiting the Kronecker structure in A = K ⊗ C, we can reexpress the update of μ in Eq. (22) as: (cid:16) CCT vec−1(gμ)KKT (cid:17) . (24) μ ← μ − βvec 8 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL Now, we describe how to update A = K ⊗ C by using the structure of the SPD submanifold τ = AAT . Unfortu- nately, the affine-invariant metric defined in Eq. (5) is singu- lar. Note that the metric used in a standard product manifold is different from the metric for a Kronecker-product subman- ifold. To enable the usage of this submanifold, we consider a block-diagonal approximation to update blocks K and C. Given each block, we construct a normal coordinate to orthonormalize the metric with respect to the block while keeping the other block frozen. Such an approximation of the affine-invariant metric leads to a block-diagonal ap- proximated metric. For blocks K and C, we consider the following blockwise GNCs ηK and ηC, respectively: (cid:18) ηK √ d 2 (cid:18) K(cur)Expm ⊗C(cur), A = (cid:19)(cid:19) A = K(cur) ⊗ (cid:18) C(cur)Expm (cid:19)(cid:19) (cid:18) ηC √ p 2 , (25) where both ηK ∈ Rp×p and ηC ∈ Rd×d are symmetric ma- trices and A(cur) = K(cur)⊗C(cur). The scalars highlighted in red are needed to orthonormalize the block-diagonal metric. Using these blockwise GNCs, our update is summarized in Fig. 2 (see Appx. I for a derivation), where similar to KFAC, we use individual stepsizes to update μ and A, and further introduce momentum weight α2 for μ, weight decay γ, and damping weight λ. In practice, we truncate the matrix exponential function: the quadratic truncation Expm(N) ≈ 2 N2 ensures the non-singularity of K and C. In I + N + 1 our DL experiments, we observed that the linear truncation Expm(N) ≈ I + N also works well. We can also develop sparse Kronecker updates while origi- nal KFAC does not admit a sparse update. For example, our approach allows us to include sparse structures by consider- ing K and C with sparse group structures in Eq. (23). Our approach allows us to go beyond the KFAC approxima- tion by exploiting other structures in the Hessian approxima- tion of ∇2 μl(μ), and to develop inverse-free update schemes by using SPD submanifolds to respect the structures. 5. Numerical Results 5.1. Results on Synthetic Examples To validate our proposed updates, we consider several opti- mization problems. In the first three examples, we consider manifold optimization on SPD matrices S k×k ++ , where the Riemannian maps admit a closed-form expression (shown in Table 1). We evaluate our method on the metric nearness problem considered in Lin et al. (2021a), a log-det optimiza- tion problem considered in Han et al. (2021a), and a MLE problem of a Gaussian mixture model (GMM) considered in Hosseini & Sra (2015). We consider structured NGD (Lin et al., 2021a), RGD, and existing Riemannian momentum methods such as the ones presented by Ahn & Sra (2020), Alimisis et al. (2020; 2021) as baselines (see Appx. J for our 9 implementation of these methods). All methods are trained using the same stepsize and momentum weight. Our updates and structured NGD can use a larger stepsize than the other methods. The exact Riemannian maps are not numerically stable in high-dimensional settings. From Fig. 3a-3c, we can see that our method performs as well as the Rieman- nian methods with the exact Riemannian maps in the global coordinate. In the last example, we minimize a 1000-dim Rosenbrock function. We consider the inverse of the precon- ditioner τ = S−1 in Eq. (21) as a SPD submanifold. We include momentum in τ and μ. We compare our update with structured NGD, where both methods use the Heisen- berg structure suggested by Lin et al. (2021a) to construct a submanifold. Both methods make use of Hessian informa- tion without computing the full Hessian. We consider other baselines: BFGS and Adam. We tune the stepsize for all methods. From Fig. 3d, we can see that adding momentum in the preconditioner could be useful for optimization. 5.2. Results in Deep Learning To demonstrate our method as a practical Riemannian method in high-dimensional cases, we consider image clas- sification tasks with NN architectures ranging from classical to modern models: VGG (Simonyan & Zisserman, 2014) with the batch normalization, PyramidNet (Han et al., 2017), RegNetX (Radosavovic et al., 2020), RegNetZ (Dollár et al., 2021), RepVGG (Ding et al., 2021), ReXNetr (Han et al., 2021b), and ConvMixer (Trockman & Kolter, 2022). We use the KFAC approximation for convolution layers (Grosse & Martens, 2016). Table 6 in Appx. A summarizes the number of learnable parameters. We consider three complex datasets "CIFAR-100", "TinyImageNet-200"6, and "ImageNet-100"7. The hyper-parameter configuration of our update and KFAC can be found in Table 5 in Appx. A. We also consider other baselines such as SGD with momentum, Adam, AdamW, and Lion (Chen et al., 2023). A L2 weight decay is included in all methods. We set the weight decay to be 0.1 for Lion, 0.001 for SGD and Adam, and 0.01 for AdamW, KFAC, and our method. For AdamW and Lion, we use the weight decay suggested by Chen et al. (2023). We choose the best weight decay over the set {0.1, 0.01, 0.001, 0.0001} for SGD and Adam. For KFAC and our method, we use the same weight decay as the one used in AdamW. We train all models from scratch for 120 epochs with mini-batch size 128. For all methods, we tune the initial stepsize and then divide the step- size by 10 every 40 epochs, as suggested by Wilson et al. (2017). Note that our method can take a larger stepsize and a smaller damping weight than KFAC for all the NN models. Our method has similar running times as KFAC, as shown in Fig. 4 in the main text, and Fig. 6 in Appx. A. We report the test error rate (i.e., error rate = 100 − accuracy percentage) for all methods in Tables 3 and 4. From Fig. 4, we can see 6github.com/tjmoon0104/pytorch-tiny-imagenet 7kaggle.com/datasets/ambityga/imagenet100 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL (a) (b) (c) (d) Figure 3. The performance of our updates for optimization problems. Fig. 3a-3b show the performance on SPD manifold optimization problems. Our update using approximations of the Riemannian maps achieves a similar performance as existing Riemannian methods using the exact Riemannian maps. Fig. 3c shows the performance on a MLE problem on a Gaussian mixture. The method denoted by "sub" performs updates on a SPD submanifold (see sec. 3.3.1) while the other methods perform updates on a SPD manifold. Note that the loss in Fig. 3c is computed by augmented (d+1)-dim Gaussian components suggested by Hosseini & Sra (2015). If we perform updates on the SPD manifold S k×k ++ with k = d + 1 instead of the submanifold, we cannot obtain the original (non-augmented) d-dim Gaussian components during the iterations since the updates are not guaranteed to stay on the submanifold. Thus, we cannot use the standard MLE loss defined by the d-dim Gaussians. In Fig. 3a-3c, we use the same stepsize and momentum weight for all methods. Note that our method and Lin et al. (2021a) can use a larger stepsize than the other methods using the exact Riemannian maps. Our method and Lin et al. (2021a) use the quadratic truncation while the other methods use the exact maps. We observe that our method with truncation is more numerically robust than the other methods using the exact maps. Fig. 3d shows the performance using a structured preconditioner to optimize a 1000-dim function, where our update and structured NGD use Hessian information without computing the full Hessian. Figure 4. The error curves for optimization in deep NN models on the "ImageNet-100" dataset. Our updates achieve lower test error rates than the other baseline methods for NN optimization. We report the number of learnable NN weights, k, in a round bracket shown in the title of each plot. For each NN optimization problem, our approach uses a structured and sparse k-by-k SPD preconditioning matrix induced by a SPD submanifold. As shown in Table 1, it is computationally infeasible to use many Riemannian momentum methods since they are designed for (dense) SPD preconditioning matrices and have O(k3) time complexity. Dataset Method VGG-16 PyramidNet-65 ConvMixer256-12 RegNetX-1.6GF CIFAR-100 TinyImageNet-200 SGD Adam AdamW Lion KFAC Ours SGD Adam AdamW Lion KFAC Ours 26.45 30.14 31.50 31.83 27.68 26.06 40.18 44.17 45.10 45.53 41.59 40.01 25.65 28.95 28.61 28.14 25.93 25.39 41.94 45.00 42.72 41.04 41.23 40.82 27.35 31.20 30.5 29.10 26.14 25.79 40.03 43.05 46.46 43.83 42.43 39.09 21.62 28.46 26.94 25.53 23.11 21.89 34.38 43.72 40.26 38.31 36.64 34.85 Table 3. More results about the performance (test error rate) of the methods considered in error curves on the other datasets (shown in Fig. 5 in Appx. A). The results are obtained by averaging over the last 10 iterations. that our method performs better than KFAC and achieves competitive performances among other baselines. More results on other datasets can be found in Fig. 5 in Appx. A. 6. Conclusion We propose GNCs to simplify existing Riemannian momen- tum methods via metric-preserving trivializations, which results in practical momentum-based NGD updates with metric-inverse-free Riemannian/natural gradient computa- 10 020000400006000080000100000Iterations10−810−610−410−2100102104106Test LossMetric Nearness (100×100-dim)Alimisis et al. 2020Alimisis et al. 2021Our (with momentum)Lin et al. 2021RGDAhn & Sra 2020020000400006000080000100000Iterations10−810−610−410−2100102104106f(X)−f(X*)Log-Det (80×80-dim)Alimisis et al. 2020Alimisis et al. 2021Our (with momentum)Lin et al. 2021RGDAhn & Sra 20200500100015002000250030003500Iterations10−410−310−210−1100101102Relative LossGMM (50×50-dim)Alimisis et al. 2020Alimisis et al. 2021Our (with momentum)Lin et al. 2021Hosseini & Sra 2015 (RGD)Ahn & Sra 2020Lin et al. 2021 (sub)010002000300040005000Iterations10−2510−2010−1510−1010−51001051010LossRosenbrock (1000-dim)BFGSLin et al 2021.OurAdam01000020000300004000050000Seconds182022242628Test Error Rateconvmixer180_16 (0.7 million-dim)kfacsgdadamwourlionadam05000100001500020000Seconds202530354045Test Error Rateregnetz_500mf (6.2 million-dim)kfacsgdadamwourlionadam05000100001500020000Seconds15.017.520.022.525.027.530.032.535.0Test Error Raterexnetr_100 (3.7 million-dim)kfacsgdadamwourlionadam01000020000300004000050000Seconds16182022242628Test Error Raterepvgg_b1g4 (38.1 million-dim)kfacsgdadamwourlionadam Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL Dataset Method ConvMixer180-16 RegNetZ-500MF ReXNetr-100 RepVGG-B1G4 ImagetNet-100 SGD Adam AdamW Lion KFAC Ours 20.37 22.79 23.38 22.25 20.70 18.84 20.80 24.48 19.65 18.66 20.07 18.30 17.07 19.58 17.43 17.43 20.24 16.73 16.15 17.95 18.23 18.30 16.97 15.81 Table 4. Results about the performance (test error rate) of the methods in Fig. 4. The results are obtained by averaging over the last 10 iterations. tion. We exploit Lie-algebra structures in GNCs of SPD manifolds and use the structures to construct SPD submani- folds so that our updates on each of the submanifolds pre- serve a Lie-subgroup structure. We show that a NGD up- date on a Gaussian family is a special case of our update on a higher-dimensional SPD submanifold. Our approach further expands the scope of structured NGD to SPD sub- manifolds arising in applications of ML and enables the usage of structured NGD beyond Bayesian and Gaussian settings from a manifold optimization perspective. We fur- ther develop matrix-inverse-free structured optimizers for deep learning by exploiting the submanifold structure of SPD preconditioners. An interesting application is to design customized optimizers for a given neural network architec- ture by investigating a range of submanifolds. Overall, our work provides a new way to design practical manifold opti- mization methods while taking care of numerical stability in high-dimensional, low-numerical precision, and noisy settings. Acknowledgements This research was partially supported by the Canada CIFAR AI Chair Program, the NSERC grant RGPIN-2022-03669, the NSF under grants CCF-2112665, DMS-1345013, DMS- 1813635, and the AFOSR under grant FA9550-18-1-0288. References Absil, P.-A., Mahony, R., and Sepulchre, R. Optimization algorithms on matrix manifolds. Princeton University Press, 2009. Ahn, K. and Sra, S. From Nesterov's estimate sequence to Riemannian acceleration. In Conference on Learning Theory, pp. 84–118. PMLR, 2020. Bonnabel, S. Stochastic gradient descent on Riemannian manifolds. IEEE Transactions on Automatic Control, 58 (9):2217–2229, 2013. Calvo, M. and Oller, J. M. A distance between multivari- ate normal distributions based in an embedding into the Siegel group. Journal of multivariate analysis, 35(2): 223–242, 1990. Calvo, M. and Oller, J. M. An explicit solution of informa- tion geodesic equations for the multivariate normal model. Statistics & Risk Modeling, 9(1-2):119–138, 1991. Chen, X., Liang, C., Huang, D., Real, E., Wang, K., Liu, Y., Pham, H., Dong, X., Luong, T., Hsieh, C.-J., et al. Symbolic discovery of optimization algorithms. arXiv preprint arXiv:2302.06675, 2023. Cherian, A. and Sra, S. Riemannian dictionary learning and sparse coding for positive definite matrices. IEEE transactions on neural networks and learning systems, 28 (12):2859–2871, 2016. Ding, X., Zhang, X., Ma, N., Han, J., Ding, G., and Sun, J. Repvgg: Making vgg-style convnets great again. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 13733–13742, 2021. Dollár, P., Singh, M., and Girshick, R. Fast and accurate model scaling. In Proceedings of the IEEE/CVF Confer- ence on Computer Vision and Pattern Recognition, pp. 924–932, 2021. Girolami, M. and Calderhead, B. Riemann manifold langevin and hamiltonian monte carlo methods. Jour- nal of the Royal Statistical Society: Series B (Statistical Methodology), 73(2):123–214, 2011. Alimisis, F., Orvieto, A., Bécigneul, G., and Lucchi, A. A continuous-time perspective for modeling acceleration in Riemannian optimization. In International Conference on Artificial Intelligence and Statistics, pp. 1297–1307. PMLR, 2020. Godaz, R., Ghojogh, B., Hosseini, R., Monsefi, R., Karray, F., and Crowley, M. Vector transport free riemannian lbfgs for optimization on symmetric positive definite ma- trix manifolds. In Asian Conference on Machine Learn- ing, pp. 1–16. PMLR, 2021. Alimisis, F., Orvieto, A., Becigneul, G., and Lucchi, A. Mo- mentum improves optimization on riemannian manifolds. In International Conference on Artificial Intelligence and Statistics, pp. 1351–1359. PMLR, 2021. Grosse, R. and Martens, J. A kronecker-factored approxi- mate fisher matrix for convolution layers. In International Conference on Machine Learning, pp. 573–582. PMLR, 2016. 11 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL Guillaumin, M., Verbeek, J., and Schmid, C. Is that you? In metric learning approaches for face identification. 2009 IEEE 12th international conference on computer vision, pp. 498–505. IEEE, 2009. Martens, J. and Grosse, R. Optimizing neural networks with Kronecker-factored approximate curvature. In Interna- tional Conference on Machine Learning, pp. 2408–2417, 2015. Minh, H. Q. and Murino, V. Covariances in computer vision and machine learning. Synthesis Lectures on Computer Vision, 7(4):1–170, 2017. Pennec, X., Fillard, P., and Ayache, N. A Riemannian framework for tensor computing. International Journal of computer vision, 66(1):41–66, 2006. Piuze, E., Sporring, J., and Siddiqi, K. Maurer-cartan forms for fields on surfaces: application to heart fiber geome- try. IEEE transactions on pattern analysis and machine intelligence, 37(12):2492–2504, 2015. Radosavovic, I., Kosaraju, R. P., Girshick, R., He, K., and Dollár, P. Designing network design spaces. In Proceed- ings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10428–10436, 2020. Simonyan, K. and Zisserman, A. Very deep convolu- tional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. Slawski, M., Li, P., and Hein, M. Regularization-free estima- tion in trace regression with symmetric positive semidefi- nite matrices. Advances in Neural Information Processing Systems, 28, 2015. Trockman, A. and Kolter, J. Z. Patches are all you need? arXiv preprint arXiv:2201.09792, 2022. Wang, C., Sun, D., and Toh, K.-C. Solving log-determinant optimization problems by a newton-cg primal proximal point algorithm. SIAM Journal on Optimization, 20(6): 2994–3013, 2010. Wilson, A. C., Roelofs, R., Stern, M., Srebro, N., and Recht, B. The marginal value of adaptive gradient methods in machine learning. Advances in neural information processing systems, 30, 2017. Han, A., Mishra, B., Jawanpuria, P. K., and Gao, J. On riemannian optimization over positive definite matrices with the bures-wasserstein geometry. Advances in Neural Information Processing Systems, 34:8940–8953, 2021a. Han, D., Kim, J., and Kim, J. Deep pyramidal residual In Proceedings of the IEEE conference on networks. computer vision and pattern recognition, pp. 5927–5935, 2017. Han, D., Yun, S., Heo, B., and Yoo, Y. Rethinking channel dimensions for efficient model design. In Proceedings of the IEEE/CVF conference on Computer Vision and Pattern Recognition, pp. 732–741, 2021b. Hosseini, R. and Sra, S. Matrix manifold optimization for Gaussian mixtures. In Advances in Neural Information Processing Systems, pp. 910–918, 2015. Ivey, T. A. and Landsberg, J. M. Cartan for beginners: differential geometry via moving frames and exterior dif- ferential systems, volume 61. American Mathematical Society Providence, RI, 2003. Jeuris, B., Vandebril, R., and Vandereycken, B. A survey and comparison of contemporary algorithms for computing the matrix geometric mean. Electronic Transactions on Numerical Analysis, 39(ARTICLE):379–402, 2012. Khan, M. and Lin, W. Conjugate-computation varia- tional inference: Converting variational inference in non- conjugate models to inferences in conjugate models. In Artificial Intelligence and Statistics, pp. 878–887, 2017. Lezcano, C.-M. Trivializations for gradient-based optimiza- tion on manifolds. Advances in Neural Information Pro- cessing Systems, 32:9157–9168, 2019. Lezcano, C.-M. Adaptive and momentum methods on manifolds through trivializations. arXiv preprint arXiv:2010.04617, 2020. Lin, W., Nielsen, F., Emtiyaz, K. M., and Schmidt, M. Tractable structured natural-gradient descent using lo- cal parameterizations. In International Conference on Machine Learning, pp. 6680–6691. PMLR, 2021a. Lin, W., Nielsen, F., Khan, M. E., and Schmidt, M. Struc- tured second-order methods via natural gradient descent. arXiv preprint arXiv:2107.10884, 2021b. Makam, V., Reichenbach, P., and Seigal, A. Symmetries in directed gaussian graphical models. arXiv preprint arXiv:2108.10058, 2021. 12 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL Appendices Outline of the Appendix: • Appendix A contains more numerical results. • Appendix B summarizes the normal coordinates used in this work. • The rest of the appendix contains proofs of the claims and derivations for examples considered in the main text. A. Additional Results Figure 5. Performance of NN optimizers on more datasets. SGD performs best in the classical model and fairly in the modern models. Our updates achieve competitive test error rates compared to baselines and perform better than KFAC in many cases. Figure 6. Additional results of our method and KFAC using a new random seed. We use these two methods to train NN models in 120 epochs. We report the performance of the methods in terms of running time. 13 020406080100120Epochs2030405060Test Error Ratecifar100-vgg16_bn (14.7 million-dim)kfacsgdadamwourlionadam020406080100120Epochs2030405060Test Error Ratecifar100-pyramidnet65 (0.7 million-dim)kfacsgdadamwourlionadam020406080100120Epochs2030405060Test Error Ratecifar100-convmixer12 (0.9 million-dim)kfacsgdadamwourlionadam020406080100120Epochs2030405060Test Error Ratecifar100-regnetx_1.6gf (8.3 million-dim)kfacsgdadamwourlionadam020406080100120Epochs404550556065Test Error Ratetinyimagenet-vgg16_bn (14.8 million-dim)kfacsgdadamwourlionadam020406080100120Epochs404550556065Test Error Ratetinyimagenet-pyramidnet65 (0.7 million-dim)kfacsgdadamwourlionadam020406080100120Epochs40455055606570Test Error Ratetinyimagenet-convmixer12 (0.9 million-dim)kfacsgdadamwourlionadam020406080100120Epochs3540455055606570Test Error Ratetinyimagenet-regnetx_1.6gf (8.4 million-dim)kfacsgdadamwourlionadam010002000300040005000Seconds2530354045505560Test Error Ratecifar100-vgg16_bnkfacour010002000300040005000Seconds2530354045505560Test Error Ratecifar100-pyramidnet65kfacour025005000750010000125001500017500Seconds404550556065Test Error Ratetinyimagenet-convmixer12kfacour025005000750010000125001500017500Seconds404550556065Test Error Ratetinyimagenet-vgg16_bnkfacour Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL Hyperparameter β2 α2 γ λ T θ β1 α1 Meaning Standard stepsize Standard momentum weight (L2) weight decay Damping weight Update frequency Our Method in Fig. 2 KFAC in Fig. 2 Tuned 0.9 0.01 Tuned 0.9 0.01 0.005; 0.0005 10; 15; 25; 60 0.005; 0.0005 10; 15; 25; 60 Moving average in KFAC Stepsize to update our preconditioner Momentum weight to update our preconditioner NA 0.01 0.5 0.95 NA NA Table 5. Hyperparameter configuration in our update and KFAC. We first choose the damping weight λ based on the performance of KFAC and use the same value in our update. For both methods, we set λ = 0.0005, 0.005 in RepVGG-B1G4, and other models, respectively. To reduce the iteration cost of both methods, we only update the preconditioner at every T iterations. For RepVGG-B1G4, we update the preconditioner at every T = 60 iterations. For RegNetZ-500MF and ConvMixer180-16, we update the preconditioner at every T = 25 iterations. For ReXNetr-100, we update the preconditioner at every T = 15 iterations. For the rest models, we update the preconditioner at every T = 10 iterations. The value of the hyperparameter θ is chosen as suggested at https://github.com/alecwangcq/ KFAC-Pytorch. We consider the first 500 iterations as a warm-up period to update our preconditioner by using a smaller stepsize β1: we set β1 = 0.0002 for the first 100 iterations, increase it to β1 = 0.002 for the next 400 iterations, and finally fix it to β1 = 0.01 for the remaining iterations. Dataset CIFAR-100 TinyImageNet-200 VGG-16-BN PyramidNet-65 ConvMixer256-12 RegNetX-1.6GF 14,774,436 14,825,736 707,428 733,128 911,204 936,904 8,368,436 8,459,736 Dataset RegNetZ-500MF RepVGG-B1G4 ConvMixer180-16 ReXNetr-100 ImageNet-100 6,200,242 38,121,956 721,900 3,730,404 Table 6. Number of Learnable Parameters in the NN Models Considered Input Dimension Number of Classes Number of Training Points Number of Test Points Dataset CIFAR-100 TinyImageNet-200 32 × 32 64 × 64 ImageNet-100 224 × 224 100 200 100 50,000 100,000 130,000 10,000 10,000 5,000 Table 7. Statistics of the Datasets 14 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL B. Summary of Generalized Normal Coordinates SPD (sub)manifold M {τ ∈ Rk×k(cid:12) (cid:12)τ ∈ S k×k ++ } with affine-invariant metric F (cid:110) (cid:111) τ = ∈ Rk×k(cid:12) (cid:12)τ ∈ S k×k (cid:12) (cid:21) (cid:20) V μ μT 1 with affine-invariant metric F τ = U ⊗ W ∈ Rpd×pd(cid:12) (cid:110) (cid:12)U ∈ S p×p (cid:12) with an approximated affine-invariant metric F ++ , W ∈ S d×d ++ ++ Name Full manifold Our normal coordinate See Eq. (15) Submanifold induced See Eq. (17),(18) (cid:111) by Siegel embedding Kronecker-product submanifold See Eq. (25) Table 8. Summary of our normal coordinates, where S++ denotes the set of SPD matrices C. Background In this section, we will assume τ is a (learnable) vector to simplify notations. For a SPD matrix M ∈ S k×k consider τ = vech(M), where vech(M) returns a k(k+1) triangular part of M, which is known as the half-vectorization function. ++ , we could -dimensional array obtained by vectorizing only the lower 2 C.1. Fisher-Rao Metric Under parametrization τ , the Fisher-Rao Metric is defined as F(τ (cur)) := −Eq(z|τ )[∇2 τ log q(z|τ )](cid:12) (cid:12)τ =τ (cur) , (26) where q(z|τ ) is a probabilistic distribution parameterized by τ , such as a Gaussian distribution with zero mean and covariance τ . C.2. Christoffel Symbols Given a Riemannian metric F, the Christoffel symbols of the first kind are defined as (cid:12) (cid:12) 2 [∂aFbd(τ ) + ∂bFad(τ ) − ∂dFab(τ )] (cid:12)τ =τ1 Γd,ab(τ 1) := 1 , where Fbd(τ ) denotes the (b, d) entry of the metric Fτ and ∂b denotes the partial derivative w.r.t. the b-th entry of τ . The Christoffel symbols of the second kind are defined as Γc ab(τ ) := (cid:88) d F cd(τ )Γd,ab(τ ), (27) (28) where F cd(τ ) denotes the (c,d) entry of the inverse F−1 of the metric. Observe that the Christoffel symbols of the second kind involve computing all partial derivatives of the metric F and the inverse of the metric. C.3. Riemannian Exponential Map The Riemannian exponential map is defined via a geodesic, which generalizes the notion of a straight line to a manifold. The geodesic r(t) satisfies the following second-order nonlinear system of ODEs with initial values r(0) = x and ̇r(0) = ν, where x denotes a point on the manifold and ν is a Riemannian gradient, geodesic ODE: ̈rc(t) + Γc ab(r(t)) ̇ra(t) ̇rb(t) = 0, (cid:88) a,b where rc(t) denotes the c-th entry of r(t). The Riemannian exponential map is defined as where x denotes an initial point and ν is an initial Riemannian gradient so that r(0) = x and ̇r(0) = ν. RExp(x, ν) := r(1), (29) (30) 15 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL C.4. Riemannian (Parallel) Transport Map In a curved space, the transport map along a given curve generalizes the notion of parallel transport. In Riemannian optimization, we consider the transport map along a geodesic curve. Given a geodesic curve r(t), a smooth Riemannian gradient field denote by v(t) that satisfies the following first-order linear system of ODEs with initial value v(0) = ν, transport ODE: ̇vc(t) + Γc ab(r(t))va(t) ̇rb(t) = 0. (cid:88) a,b (31) The transport map ˆTτ (cur)→τ (new)(ν) transports the Riemannian gradient ν at τ (cur) to τ (new) as follows, ˆTτ (cur)→τ (new)(ν) := v(1), (32) where r(0) = τ (cur), r(1) = τ (new), and v(0) = ν. It can be computationally challenging to solve this linear ODE due to the presence of the Christoffel symbols. C.5. Euclidean (Parallel) Transport Map Given a geodesic curve r(t), a smooth Euclidean gradient field denote by ω(t) on manifold M that satisfies the following first-order linear system of ODEs with initial value ω(0) = m, The transport map Tτ (cur)→τ (new)(g) transports the Euclidean gradient g at τ (cur) to τ (new) as shown below, transport ODE: ̇ωc(t) − Γa cb(r(t))ωa(t) ̇rb(t) = 0. (cid:88) a,b where r(0) = τ (cur), r(1) = τ (new), and ω(0) = g. C.6. Update 3 is Equivalent to Alimisis et al. (2020) Tτ (cur)→τ (new)(g) := ω(1), (33) (34) Note that m and z are initialized by zero. Due to Eq. (4), updates (2) and (3) are equivalent since m(cur) = F(τ (cur))ν(cur) and w(new) = F(τ (new))z(new), where m(cur) and w(new) are defined in Eq. (3) while ν(cur) and z(new) are defined in Eq. (2) D. Simplification of the vector-Jacobian Product The vector-Jacobian product in (14) could, in general, be computed by automatic differentiation. We give two cases for SPD (sub)manifolds where the product can be explicitly simplified. For notation simplicity, we denote m = m(η0) and w = w(η1). Thus w = m when we use the approximation in Eq. (13). D.1. Symmetric Cases Suppose that η is symmetric, in which case m is also symmetric due to update (12). We further denote A0 = A(cur) and A1 = A(new), where A1 = A0Expm(− 1 2 m(η0)) = A0Expm(− 1 2 m). Recall that τ = A0Expm(η)AT 0 = A1Expm(ξ)AT 1 . Thus, we have Expm(η) = Expm(− 1 2 m)Expm(ξ)ExpmT (− 1 2 m) = Expm(− 1 2 m)Expm(ξ)Expm(− 1 2 m). By the Baker–Campbell–Hausdorff formula, we have Expm−1(Expm(N)Expm(M)) = N + M + Expm−1(Expm(M)Expm(N)) = N + M + (cid:88) (cid:88) i wi(MaiNMbi − MciNMdi) + O(N2), wi(MaiNMbi − MciNMdi) + O(N2), (35) (36) (37) where ai, bi, ci, di are non-negative integers satisfying ai + bi = ci + di > 0, and wi is a coefficient. Since we evaluate the Jacobian at ξ0 = 0, we can get rid of the higher-order term O(ξ2), which leads to the following simplification, i η = Expm−1(Expm(− 1 2 m)Expm(ξ)Expm(− 1 2 m)) = ξ − m + wi(maiξmbi − mci ξmdi) + O(ξ2). (38) (cid:88) i 16 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL Recall that m = w is symmetric. The vector-Jacobian product can be simplified as (cid:3) wT J(ξ0) = mT (cid:2) ∂η (cid:12) (cid:12)ξ=ξ0 ∂ξ = ∇ξTr(mT η)(cid:12) = ∇ξTr(cid:0)mT [ξ − m + (cid:12)ξ=ξ0 wi(maiξmbi − mciξmdi) + O(ξ2)](cid:1)(cid:12) (cid:12)ξ=ξ0 (cid:88) i = ∇ξTr(cid:0)mT [ξ + (cid:88) wi(maiξmbi − mciξmdi)](cid:1)(cid:12) (cid:12)ξ=ξ0 = ∇ξTr(cid:0)m[ξ + i (cid:88) wi(maiξmbi − mciξmdi)](cid:1)(cid:12) (cid:12)ξ=ξ0 wi(mai+bi+1ξ − mci+di+1ξ)(cid:1)(cid:12) (cid:12)ξ=ξ0 = ∇ξTr(cid:0)mξ + i (cid:88) i (cid:12)ξ=ξ0 = ∇ξTr(mξ)(cid:12) = m = w. (39) D.2. Triangular Cases Tril(1)+( 1 Without loss of generality, we assume η is lower-triangular, in which case m is also lower-triangular due to update (12). Similarly, we denote A0 = A(cur) and A1 = A(new), where A1 = A0Expm(−D ⊙ m(η0)) = A0Expm(−D ⊙ m), and where D = 1√ 1)I is chosen so that the metric is orthonormal at η0, and Tril(1) denotes a lower-triangular 2 matrix of ones. Recall that τ = A0Expm(D ⊙ η)ExpmT (D ⊙ η)AT 1 . Thus, we have Expm(D ⊙ η)ExpmT (D ⊙ η) = Expm(−D ⊙ m)Expm(D ⊙ ξ)ExpmT (D ⊙ ξ)ExpmT (−D ⊙ m). 0 = A1Expm(D ⊙ ξ)ExpmT (D ⊙ ξ)AT 2 − 1√ (40) 2 Since η, m and ξ are lower-triangular, Expm(D ⊙ η), Expm(−D ⊙ m), and Expm(D ⊙ ξ) are also lower-triangular. Moreover, all the eigenvalues of Expm(D ⊙ η), Expm(−D ⊙ m), and Expm(D ⊙ ξ) are positive. Note that we make use of the uniqueness of the Cholesky decomposition since Expm(D ⊙ η) can be viewed as a Cholesky factor. Thus, Expm(D ⊙ η) = Expm(−D ⊙ m)Expm(D ⊙ ξ). By the Baker–Campbell–Hausdorff formula, we have Expm−1(cid:0)Expm(M)Expm(N)(cid:1) = M + N + 1 2 ⟨M, N⟩ + O(⟨M, ⟨M, N⟩⟩) + O(N2), where ⟨M, N⟩ = MN − NM is the Lie bracket. Thus, we have η = (cid:0)D ⊙ ξ − D ⊙ m + 1 2 ⟨−D ⊙ m, D ⊙ ξ⟩)(cid:1) ⊘ D + O(⟨m, ⟨m, ξ⟩⟩ + O(ξ2), where ⊘ denotes elementwise division. We get rid of the higher-order term O(ξ2) by evaluating ξ = ξ0 = 0. Recall that m = w. The vector-Jacobian product can be simplified as (cid:3) wT J(ξ0) = mT (cid:2) ∂η (cid:12) (cid:12)ξ=ξ0 ∂ξ = ∇ξTr(mT η)(cid:12) (cid:12)ξ=ξ0 = ∇ξTr(mT (D ⊙ ξ − D ⊙ m + 1 = ∇ξTr((m ⊘ D)T (D ⊙ ξ − D ⊙ m + 1 = m (cid:124)(cid:123)(cid:122)(cid:125) O(β) + 1 2 D ⊙ (cid:10)(−D ⊙ m)T , m ⊘ D(cid:11) (cid:125) (cid:124) (cid:123)(cid:122) O(β2) 2 ⟨−D ⊙ m, D ⊙ ξ⟩ ⊘ D) + O(⟨m, ⟨m, ξ⟩⟩))(cid:12) 2 ⟨−D ⊙ m, D ⊙ ξ⟩ + O(⟨m, ⟨m, ξ⟩⟩)))(cid:12) + O (cid:0)(cid:10)m, (cid:10)m, mT (cid:11)(cid:11)(cid:1) . (cid:123)(cid:122) (cid:125) O(β3) (cid:124) (cid:12)ξ=ξ0 (cid:12)ξ=ξ0 (41) (42) (43) 17 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL 0 . Let ̃η denote the vector representation of the E. Simplification of the Metric Calculation at η0 Consider τ = φτ (cur)(η) = AAT ∈ S k×k For notation simplicity, we let A0 = A(cur) and τ 0 = τ (cur) = A0AT learnable part of η. By definition of the affine-invariant metric, we have F(η0) = −2EN (0,τ ) ++ , where A = A(cur)Expm(D ⊙ η) . (cid:2)∇2 (cid:12)η=η0 ̃η log N (0, τ )(cid:3)(cid:12) (cid:8)Tr[xxT A−T (cid:2)xxT (cid:3)A−T ̃η = EN (x|0,τ ) = ∇2 ̃η = ∇2 ̃η = ∇2 ̃η = ∇2 ̃η = ∇2 ̃η 0 ExpmT (−D ⊙ η)Expm(−D ⊙ η)A−1 0 ExpmT (−D ⊙ η)Expm(−D ⊙ η)A−1 (cid:2)∇2 (cid:8)Tr[EN (x|0,τ 0) (cid:8)Tr[[A0AT 0 ExpmT (−D ⊙ η)Expm(−D ⊙ η)A−1 (cid:8)Tr[ExpmT (−D ⊙ η)Expm(−D ⊙ η)] + 2 log det Expm(D ⊙ η)(cid:9)(cid:12) (cid:8)Tr[ExpmT (−D ⊙ η)Expm(−D ⊙ η)] + 2Tr[D ⊙ η](cid:9)(cid:12) (cid:8)Tr[ExpmT (−D ⊙ η)Expm(−D ⊙ η)](cid:9)(cid:12) 0 ]A−T (cid:12)η=η0 . (cid:12)η=η0 0 ] + 2 log det Expm(D ⊙ η)(cid:9)(cid:3)(cid:12) 0 ] + 2 log det Expm(D ⊙ η)(cid:9)(cid:12) (cid:12)η=η0 (cid:12)η=η0 0 ] + 2 log det Expm(D ⊙ η)(cid:9)(cid:12) (cid:12)η=η0 (cid:12)η=η0 (ignore linear terms for a 2nd order derivative) (44) Note that we express Expm(−D ⊙ η) as Expm(−D ⊙ η) = I − D ⊙ η + 1 metric at η0 = 0, we can get rid of the higher-order term O(η3), which leads to the following simplification, 2 (D ⊙ η)2 + O(η3). Since we evaluate the ∇ηij Tr[ExpmT (−D ⊙ η)Expm(−D ⊙ η)] = 2Tr[Expm(−D ⊙ η)[∇ηij ExpmT (−D ⊙ η)]] = 2Dij∇ηij (cid:8)Tr[Expm(−D ⊙ η)[−Eij + 1 2 Eij(D ⊙ η) + 1 2 (D ⊙ η)Eij + O(η2)]T ](cid:9). (45) Thus, we have ∇ηTr[ExpmT (−D ⊙ η)Expm(−D ⊙ η)] = D ⊙ [−2Expm(−D ⊙ η) + Expm(−D ⊙ η)(D ⊙ η)T + (D ⊙ η)T Expm(−D ⊙ η)] + O(η2). (46) To show F(η0) = I, we show that F(η0)v = v for any v. Let V be the matrix representation of v, which has the same structure as η, such as being symmetric or being lower-triangular. Then, F(η0)v = ∇2 ̃η (cid:8)Tr[ExpmT (−D ⊙ η)Expm(−D ⊙ η)](cid:9)(cid:12) v (cid:8)vT ∇ ̃ηTr[ExpmT (−D ⊙ η)Expm(−D ⊙ η)](cid:9)(cid:12) = ∇ ̃η (cid:12)η=η0 = ∇ ̃ηTr(cid:8)VT ∇ηTr[ExpmT (−D ⊙ η)Expm(−D ⊙ η)](cid:9)(cid:12) = ∇ ̃ηTr(cid:8)VT (D ⊙ [−2Expm(−D ⊙ η) + Expm(−D ⊙ η)(D ⊙ η)T + (D ⊙ η)T Expm(−D ⊙ η)] + O(η2))(cid:9)(cid:12) , (note: ̃η, v are vectors) (note: η, V are matrices) (cid:12)η=η0 (cid:12)η=η0 (cid:12)η=η0 . We can get rid of the higher-order term O(η2) by evaluating at η = η0 = 0 and noting that Tr(AT (D ⊙ B)) = (cid:88) (A ⊙ (D ⊙ B)) = Tr((D ⊙ A)T B). Also note that ∇ηij Tr(cid:8)(D ⊙ V)T [−2Expm(−D ⊙ η) + Expm(−D ⊙ η)(D ⊙ η)T + (D ⊙ η)T Expm(−D ⊙ η)](cid:9)(cid:12) (cid:12)η=η0 = Tr(cid:8)(D ⊙ V)T 2Dij[Eij + ET ij](cid:9)(cid:12) (cid:12)η=η0 . Thus, we have ∇ηTr(cid:8)(D ⊙ V)T [−2Expm(−D ⊙ η) + Expm(−D ⊙ η)(D ⊙ η)T + (D ⊙ η)T Expm(−D ⊙ η)](cid:9)(cid:12) (cid:12)η=η0 = 2D ⊙ (D ⊙ V + (D ⊙ V)T ). 18 (47) (48) (49) Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL E.1. Symmetric Cases When η is symmetric, V is also symmetric so F(η0)v = ∇ ̃ηTr(cid:8)VT (D ⊙ [−2Expm(−D ⊙ η) + Expm(−D ⊙ η)(D ⊙ η)T + (D ⊙ η)T Expm(−D ⊙ η)] + O(η2))(cid:9)(cid:12) = vech(2D ⊙ (D ⊙ V + D ⊙ V)) = 4vech(D2 ⊙ V). (cid:12)η=η0 (50) When D = 1 2 1, we have 4vech(D2 ⊙ V) = vech(V) = v, where 1 is a matrix of ones. Thus, F(η0) = I . E.2. Triangular Cases Without loss of generality, we assume that η is lower-triangular, in which case V is lower-triangular, and thus F(η0)v = ∇ ̃ηTr(cid:8)VT (D ⊙ [−2Expm(−D ⊙ η) + Expm(−D ⊙ η)(D ⊙ η)T + (D ⊙ η)T Expm(−D ⊙ η)] + O(η2))(cid:9)(cid:12) = tril(2D ⊙ (D ⊙ V + D ⊙ VT ) (VT is upper-triangular. Thus tril(VT ) = Diag(VT ) = Diag(V)) = tril(2D2 ⊙ (V + Diag(V))), (cid:12)η=η0 (51) where tril(*) represents a vector representation of the learnable part of a lower-triangular matrix and Tril(*) denotes a lower-triangular matrix. When D = 1√ 2 matrix of ones. Thus, F(η0) = I. Tril(1)+( 1 2 − 1√ 2 )I, we have tril(2D2⊙(V+Diag(V))) = tril(V) = v, where Tril(1) is a lower-triangular F. An Accurate Approximation of the Euclidean Transport Map We consider the first-order approximation of the Euclidean transport m(η1) = Tη0→η1(m(η0)) = ω(1) ≈ ω(0) (cid:124) (cid:123)(cid:122) (cid:125) m(η0) + ̇ω(0), where we have to evaluate the Christoffel symbols as discussed below. By the transport ODE in Eq. (33), we can compute ̇ω(0) via ̇ωc(0) − (cid:88) a,b Γa cb(r(0))ωa(0) ̇rb(0) = 0, (52) (53) where r(0) = η0 is the current point and ̇r(0) is the Riemannian gradient so that η1 = RExp(η0, ̇r(0)). In our case, as shown in Eq. (12), we have that ̇r(0) = −F−1(η0)m(η0) = m(η0) and ω(0) = m(η0). Note that the metric and Christoffel symbols are evaluated at η0 = 0. The computation can be simplified due to the orthonormal metric as F−1(η0) = I and Γa cb(η0) = (cid:88) d F ad(η0)Γd, cb(η0) = (cid:88) d δad 1 2 [∂cFbd(η0) + ∂bFcd(η0) − ∂dFcb(η0)], (54) where F ad(η0) = δad. Thus, we have the following simplification, ̇ωc(0) = − 1 2 = − 1 2 (cid:88) b,d (cid:88) b,d [∂cFbd(η0) + ∂bFcd(η0) − ∂dFcb(η0)](m(η0))d(m(η0))b ∂cFbd(η0)(m(η0))d(m(η0))b. (55) For notation simplicity, we let m = m(η0) and A0 = A(cur). 19 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL For normal coordinate A = A0Expm(D ⊙ η), we can obtain the following result. The calculation is similar to the metric calculation in Appx. E. ̇ω(0) = D ⊙ (cid:124) (cid:16)(cid:68) D ⊙ m, (D ⊙ m)T (cid:69)(cid:17) , (cid:125) (cid:123)(cid:122) O(β2) (56) where ⟨N, M⟩ := NM − MN is the Lie bracket, the β is the stepsize used in Eq. (12). When η is symmetric, we know that m is symmetric. Thus, we have ̇ω(0) = 0. G. Structured NGD as a Special Case G.1. Normal Coordinate for Structured NGD We can obtain coordinate (18) from coordinate (17). In Eq. (17), the normal coordinate is defined as A = A0Expm Note that (cid:18)(cid:20) 1 2 ηL 0 (cid:21)(cid:19) 1√ ημ 2 0 , where we use A0 to denote A(cur). Expm (cid:18)(cid:20) 1 2 ηL 0 (cid:21)(cid:19) 1√ ημ 2 0 = (cid:20)Expm( 1 0 2 ηL) 1√ 2 (cid:21) ημ + O(ηLημ) 1 . (57) The main point is that O(ηLημ) vanishes in the metric computation since we evaluate the metric at η0 = {ηL, ημ} = 0. Thus, we can ignore O(ηLημ), and recover Eq. (18): A = A0 (cid:20)Expm( 1 0 2 ηL) (cid:21) 1√ ημ 2 1 = (cid:20)L0 μ0 1 0 (cid:21) (cid:20)Expm( 1 0 2 ηL) (cid:21) 1√ ημ 2 1 = (cid:20)L0Expm( 1 2 ηL) μ0 + 1√ 2 1 0 (cid:21) L0ημ . (58) To show that O(ηLημ) vanishes in the metric computation, we have to show that all the cross terms between ηL and ημ of the metric vanish. Using Eq. (44), EN (0,τ ) (cid:2)∇ηLjk ∇ημi log N (0, τ )(cid:3)(cid:12) (cid:20) (cid:26) (cid:12)η=η0 (cid:18) ExpmT − = ∇ηLjk ∇ημi Tr (cid:20) 1 2 ηL 0 (cid:21)(cid:19) 1√ ημ 2 0 (cid:18) Expm − (cid:20) 1 2 ηL 0 1√ ημ 2 0 (cid:21)(cid:19)(cid:21)(cid:27) (cid:12) (cid:12)η=η0 . (59) 20 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL (cid:20) (cid:26) ∇ηLjk We can drop higher order terms since we evaluate at η0 = {ηL, ημ} = 0. We get 1√ ημ 2 0 2 ηL 0 1√ ημ 2 0 2 ηL 0 ∇ημi (cid:26) 2 ηL 0 (cid:18) 2 ηL 0 (cid:18) 1√ ημ 2 0 1√ ημ 2 0 = 2∇ηLjk ExpmT ExpmT ∇ημi Expm Expm (cid:21)(cid:19)(cid:21)(cid:27) (cid:21)(cid:19)(cid:27) (cid:20)(cid:26) (cid:21)(cid:19) (cid:20) 1 (cid:20) 1 (cid:20) 1 (cid:20) 1 Tr Tr − − − − (cid:18) (cid:18) (cid:21)(cid:19)(cid:21)(cid:27) = 2∇ηLjk Tr = 2∇ηLjk Tr (cid:34)(cid:18) (cid:20)0 1√ ei − 2 0 0 (cid:21) (cid:34)(cid:18) (cid:20)0 1√ ei 2 − 0 0 (cid:21) (cid:20)0 1√ ei + 1 2 2 0 0 (cid:21)(cid:20) 1 2 ηL 0 (cid:21) 1√ ημ 2 0 (cid:20) 1 2 ηL 0 + 1 2 1√ ημ 2 0 (cid:21)(cid:20)0 1√ ei 2 0 0 (cid:21)(cid:19)T Expm − (cid:18) (cid:20) 1 2 ηL 0 (cid:21)(cid:19)(cid:35) 1√ ημ 2 0 (cid:20) 1 2 ηL 0 + 1 2 1√ ημ 2 0 (cid:21)(cid:20)0 1√ ei 2 0 0 (cid:21)(cid:19)T Expm − (cid:18) (cid:20) 1 2 ηL 0 (cid:21)(cid:19)(cid:35) 1√ ημ 2 0 = 2Tr (cid:34)(cid:20)0 1√ ei 2 0 0 and therefore (cid:21)T (cid:20) 1 2 Ejk 0 0 0 (cid:21) + 1 2 (cid:18)(cid:20) 1 2 Ejk 0 0 0 (cid:21)(cid:20)0 1√ ei 2 0 0 (cid:21)(cid:19)T (cid:35) = 0, EN (0,τ ) (cid:2)∇ηLjk ∇ημi log N (0, τ )(cid:3)(cid:12) (cid:12)η=η0 = 0. G.2. Gaussian Identities in Structured NGD Recall that the manifold is defined as (cid:26) M = τ = (cid:21) (cid:20) V μ μT 1 ∈ R(d+1)×(d+1) | τ ≻ 0 (cid:27) . To use Gaussian gradient identities, we first change the notation from μ to m to avoid confusion: (cid:26) M = τ = (cid:21) (cid:20) V m mT 1 ∈ R(d+1)×(d+1) | τ ≻ 0 (cid:27) . In Sec. 3.3.1, we can compute the Euclidean gradient g(η0) = {LT g1L, √ 2LT (g1m + g2)}, where g(τ (cur)) = (cid:21) (cid:20)g1 g2 gT 0 2 By the chain rule, we have is a (symmetric) Euclidean gradient w.r.t. τ ∈ M. ∂l ∂mi = Tr (cid:19)T (cid:32) (cid:18) ∂l ∂τ (cid:124) (cid:123)(cid:122) (cid:125) gT (τ ) (cid:33) ∂τ ∂mi = Tr (cid:18)(cid:20)g1 g2 gT 0 2 (cid:21) (cid:20) 0 eT i (cid:21)(cid:19) ei 1 = 2gT 2 ei, ∂m = 2g2. Similarly, we have gV = ∂l so gm = ∂l Note that in Gaussian cases, we have μ = m and Σ = V − mmT , and thus we have ∂V = g1. ∇μil = Tr ∇Σjk l = Tr (cid:32)(cid:18) ∂l ∂m (cid:32)(cid:18) ∂l ∂m which implies that (cid:33) (cid:19)T ∂m ∂μi (cid:19)T ∂m ∂Σjk + Tr (cid:33) + Tr (cid:33) (cid:32)(cid:18) ∂l ∂V (cid:32)(cid:18) ∂l ∂V (cid:19)T ∂V ∂μi (cid:19)T ∂V ∂Σjk = gT mei + Tr (cid:0)gT V (eimT + meT i )(cid:1) , (cid:33) = 0 + Tr (cid:0)gT V Ejk (cid:1) , gμ = gm + (gV + gT gΣ = gV = g1. V )m = gm + 2gV m = 2g2 + 2g1μ, Thus, g1 and g2 can be reexpressed using Gaussian gradients gμ and gΣ as g1 = gΣ and g2 = 1 2 (gμ − 2gΣ μ). 21 (60) (61) (62) (63) (64) (65) (66) Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL H. SPD Manifolds , where η ∈ Rk×k is symmetric, and A = A(cur)Expm( 1 H.1. Generalized Normal Coordinates We first show that the local coordinate τ = φτ (cur)(η) = AAT is a generalized normal coordinate defined at the reference point τ (cur) = A(cur)(cid:0)A(cur)(cid:1)T It is easy to verify that Assumption 1 holds since φτ (cur) (η0) = τ (cur) at η0 = 0. As shown in Appx. E.1, the metric is orthonormal at η0 = 0, so Assumption 2 holds. Expm(η)(cid:0)τ (cur)(cid:1)1/2 Recall that the standard normal coordinate is τ = ψτ (cur)(η) = (cid:0)τ (cur)(cid:1)1/2 , where Assumption 3 holds. Our generalized normal coordinate is defined as τ = ψτ (cur) (η) = A(cur)Expm(η)(cid:0)A(cur)(cid:1)T , where η is symmetric. The only difference between these two coordinates is a multiplicative constant. Differentiability and smoothness remain the same. The injectivity for symmetric η is due to the uniqueness of the symmetric square root of a matrix. Thus, Assumption 3 holds in our coordinate. This statement can be extended to the case where η is a triangular matrix due to the uniqueness of the Cholesky decomposition. The space of symmetric matrices η ∈ Rk×k is an abstract vector space since scalar products and matrix additions of symmetric matrices are also symmetric. As a result, Assumption 4 holds. 2 η). H.2. Euclidean Gradients in Normal Coordinates As mentioned in Sec. 3.2, there are many generalized normal coordinates such as • φτ (cur) (η) = AAT , where η is symmetric and A := A(cur)Expm( 1 2 η) , • φτ (cur) (η) = B−T B−1, where η is symmetric and B := B(cur)Expm(− 1 2 η), • φτ (cur) (η) = CT C, where η is symmetric and C := Expm( 1 2 η)C(cur). We show how to compute the Euclidean gradient g(η0) needed in Eq. (12), where we assume that the Euclidean gradient ∇τ l = g(τ ) w.r.t. τ is given. Let us consider τ = φτ (cur) (η) = AAT . By the chain rule, we have ∇ηij l = Tr(cid:0)gT (τ )∇ηij τ (cid:1)(cid:12) (cid:12)η=η0 = Tr(cid:0)gT (τ )A(cur)Eij(A(cur))T ), so g(η0) = (A(cur))T g(τ )A(cur). Similarly, when τ = B−T B−1, we have ∇ηij l = Tr(cid:0)gT (τ )∇ηij τ (cid:1)(cid:12) (cid:12)η=η0 = Tr(cid:0)gT (τ )(B(cur))−T Eij(B(cur))−1), which gives g(η0) = (B(cur))−1g(τ )(B(cur))−T . H.3. Simplification of Our Update Consider the normal coordinate φτ (cur) (η) = AAT , where η is symmetric and A := A(cur)Expm( 1 We can compute the Euclidean gradient as g(η0) = (A(cur))T g(τ )A(cur). Using the approximation in Eq. (13), we have 2 η). w(η1) ← m(η0). 22 (67) (68) (69) (70) (71) Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL Since η is symmetric, we can further show that the accurate approximation also gives the same update since the second dominant term vanishes as shown in Eq. (56). By Eq. (39), the vector-Jacobian product needed in Eq. (14) can be expressed as w(ξ0) = J(ξ0)w(η1) = w(η1). (72) Thus, we have w(ξ0) = m(η0). As a consequence, our update (defined in Eq. (12)) can be simplified as below, where we can drop all the superscripts and let w = m, Momentum : m ← αm + β GD : η1 ← −m, =g(η0) (cid:123) (cid:125)(cid:124) (cid:122) (A(cur))T g(τ )A(cur), τ (new) ← φτ (cur)(η1) = A(cur)Expm(η1)(cid:0)A(cur)(cid:1)T ⇐⇒ A(new) ← A(cur)Expm( 1 2 η1). (73) Using Eq. (70), we can also obtain the following update if the normal coordinate φτ (cur) (η) = B−T B−1 is used, where η is symmetric and B := B(cur)Expm(− 1 2 η), Momentum : m ← αm + β GD : η1 ← −m, =g(η0) (cid:122) (cid:123) (cid:125)(cid:124) (B(cur))−1g(τ )(B(cur))−T , τ (new) ← φτ (cur) (η1) = (cid:0)B(cur)(cid:1)−T Expm(−η1)(cid:0)B(cur)(cid:1)−1 ⇐⇒ B(new) ← B(cur)Expm(− 1 2 η1). (74) I. SPD Kronecker-product Submanifolds We consider the SPD submanifold (cid:110) M = τ = AAT ∈ S (pd)×(pd) ++ | A := K ⊗ C, K ∈ Rp×p, C ∈ Rd×d(cid:111) , where U = KKT ≻ 0, W = CCT ≻ 0, and both K and C are dense and non-singular. I.1. Blockwise Normal Coordinates As mentioned in Sec. 4, we consider a block-diagonal approximation of the affine-invariant metric. For block K, we consider the coordinate A = (cid:0)K(cur)Expm( 1 √ ηK)(cid:1) ⊗ C(cur), (75) 2 where ηK ∈ Rp×p is symmetric and A(cur) = K(cur) ⊗ C(cur). We will show that the block-diagonal approximated metric is orthonormal at ηK = 0 under coordinate ηK. For notation simplicity, we let K0 = K(cur), C0 = C(cur), and τ 0 = τ (cur). Let ̃ηK denote the learnable part of ηK. By the Kronecker-product, we have vecT (X)(U ⊗ W)vec(X) = vecT (X)vec(WXUT ) = Tr(XT WXUT ), where x := vec(X) and X ∈ Rd×p. d By definition, the metric F w.r.t. block K in coordinate ηK is FK(0) = −2EN (0,τ ) (cid:2)∇2 ̃ηK log N (0, τ )(cid:3)(cid:12) (cid:18) (cid:0)K−T 0 Expm(− (cid:12)ηK =0 1 √ d (cid:1)X(cid:0)K−T = EN (x|0,τ ) (cid:2)∇2 ̃ηK (cid:8)Tr[xT ηK)K−1 0 (cid:1) ⊗ (cid:0)C−T 0 C−1 0 (cid:1) (cid:19) x](cid:3)(cid:12) (cid:12)ηK =0 (drop linear terms in the log-det term) = EN (x|0,τ ) (cid:2)∇2 ̃ηK (cid:8)Tr[XT (cid:0)C−T 0 C−1 0 = dEN (x|0,τ ) (cid:2)∇2 ̃ηE (cid:8)Tr[Expm(− 1 √ d ηE)(cid:9)](cid:3)(cid:12) ηK)K−1 0 0 Expm(− 1 √ d (cid:12)ηK =0 (note: EN (x|0,τ 0)[XT (cid:0)C−T (cid:1)](cid:9)(cid:3)(cid:12) (cid:12)ηK =0 (note: xT (U ⊗ W)x = Tr(XT WXUT )) 0 C−1 0 (cid:1)X] = dK0KT 0 ). (76) 23 Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL It is easy to show that FK(0) = I w.r.t. block K in coordinate ηK, which means Assumption 2 holds. Since block C is frozen, we can prove as in Appx. H.1 that all assumptions are satisfied for the coordinate ηK. Similarly, for block C, we can consider the coordinate where ηC ∈ Rd×d is symmetric and A(cur) = K(cur) ⊗ C(cur), and show that it defines a normal coordinate. A = K(cur) ⊗ (cid:0)C(cur)Expm( 1 √ 2 p ηC)(cid:1), (77) I.2. (Euclidean) Gradient Computation for Deep Learning We consider τ = Σ = (KKT ) ⊗ (CCT ). As suggested by Lin et al. (2021b), the Euclidean gradient w.r.t. τ is computed as gΣ := 1 μl(μ) ≈ μAA ⊗ μGG, where matrices μAA ∈ Rp×p In KFAC (Martens & Grosse, 2015), the Hessian is approximated as ∇2 and μGG ∈ Rd×d are two dense symmetric positive semi-definite matrices and are computed as suggested by the authors. To handle the singularity of μAA and μGG, Martens & Grosse (2015) introduce a damping term λ when it comes to inverting μAA and μGG such as μ−1 In our update, we use the KFAC approach to approximate the Hessian. We add a damping term by including it in gΣ as AA ≈ (μAA + λIp)−1 and μ−1 GG ≈ (μGG + λId)−1. μl(μ) − Σ−1). 2 (∇2 gΣ ≈ 1 2 (μAA ⊗ μGG (cid:123)(cid:122) (cid:125) μl(μ) ≈∇2 (cid:124) +λIpd − Σ−1), where Ipd = Ip ⊗ Id and Σ−1 = (K−T K−1) ⊗ (C−T C−1). The Euclidean gradient g(ηK0) w.r.t. ηE can be computed as (cid:1)T ∂τ ∂ηKij = Tr(cid:0)(cid:0) ∂l ∂τ ∂l ∂ηKij (cid:1) = Tr(cid:0)[gΣ]T ∂τ ∂ηKij (cid:1). There are three terms in the Euclidean gradient w.r.t. τ = Σ: gΣ ≈ 1 2 (μAA ⊗ μGG + λIp ⊗ Id − (K−T K−1) ⊗ (C−T C−1). (78) (79) (80) Thus, the Euclidean gradient w.r.t. η can be decomposed into three parts. For notation simplicity, we let K0 = K(cur), C0 = C(cur), and τ 0 = τ (cur). The first part of ∂l ∂ηKij can be computed via 1 2 Tr(cid:0)[μAA ⊗ μGG]T ∂τ ∂ηKij (cid:1) = = 1 √ 2 1 √ 2 d d Tr(cid:2)(μT AAK0EijKT 0 ) ⊗ (μT GGC0CT 0 )(cid:3) Tr(μT GGC0CT 0 )Tr(μT AAK0EijKT 0 ). We obtain the expression for the first part of ∂l ∂ηK as 1 √ Tr(CT 0 μGGC0)KT 0 μAAK0. 2 d Similarly, we can obtain the second and third parts, which gives altogether the Euclidean gradient g(ηK) via g(ηK0 ) = 1 √ 2 d [Tr(CT 0 μGGC0)KT 0 μAAK0 + λTr(CT 0 C0)KT 0 K0 − dIp]. Likewise, the Euclidean gradient g(ηC) is g(ηC0) = 1 √ 2 p [Tr(KT 0 μAAK0)CT 0 μGGC0 + λTr(KT 0 K0)CT 0 C0 − pId]. 24 (81) (82) (83) Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL I.3. Derivation of the Update We consider the update for block ηK. By the approximation in Eq. (13), we have w(ηK1 ) ← m(ηK0 ), (84) for block ηK. Since ηK is symmetric, we can further show that the accurate approximation also gives the same update since the second dominant term vanishes as shown in Eq. (56). Since ηK is symmetric (see Eq. (39)), the vector-Jacobian product needed in Eq. (14) can be expressed as w(ξK0 ) = J(ξK0 )w(ηK1 ) = w(ηK1 ). (85) Thus, we have w(ξK0 ) = m(ηK0 ) for ηK. As a consequence (similar to Appx. H.3), our update (defined in Eq. (12)) for block ηK can be expressed as below, where we drop all superscripts and let w = m, Momentum : mK ← αmK + βg(ηK0), GD : ηK1 ← −mK, K ← K(cur)Expm( 1 √ 2 d ηK1 ). Since we initialize mK to 0, we can merge factor 1 √ 2 d into mK as shown below. Momentum : mK ← αmK + β √ 2 d g(ηK0 ), GD : ηK1 ← −mK, K ← K(cur)Expm(ηK1). (86) (87) Note that the affine-invariant metric is defined as twice of the Fisher-Rao metric. To recover structured NGD, we have to set our stepsize β to twice the stepsize of structured NGD. Letting β = 2β2, we can reexpress the above update for block ηK as mK ← αmK + β2√ d g(ηK0 ), K ← K(cur)Expm(−mK). A similar update for the block ηC can also be obtained. J. Implementation for the Baseline Methods We consider the following manifold optimization problem on a SPD full manifold: Recall that a Riemannian gradient w.r.t. τ is ˆg(τ ) := τ (∇τ l) τ = −∇τ −1 l. The Riemannian gradient descent (RGD) is min τ ∈S k×k ++ l(τ ) τ (new) ← RExp(τ (cur), −βˆg(τ (cur))). 25 (88) (89) (90) Simplifying Momentum-based Positive-definite Submanifold Optimization with Applications to DL The update of Alimisis et al. (2020) is shown below, where we initialize z by 0: ν(cur) ← αz(cur) + βˆg(τ (cur)) τ (new) ← RExp(τ (cur), −ν(cur)) z(new) ← ˆTτ (cur)→τ (new)(ν(cur)) The update of Alimisis et al. (2021) is shown below, where we initialize y by τ : z(new) ← RExp(τ (cur), −βˆg(τ (cur))) y(new) ← RExp(y(cur), − β 1 − α ˆTτ (cur)→y(cur) (ˆg(τ (cur)))) τ (new) ← RExp(y(new), αRExp−1(y(new), z(new))) The update of Ahn & Sra (2020) is shown below, where we initialize z by τ : y(new) ← RExp(τ (cur), −βˆg(τ (cur))) z(new) ← RExp(τ (cur), α 1 − α RExp−1(τ (cur), z(cur)) − 2βˆg(τ (cur))) τ (new) ← RExp(y(new), αRExp−1(y(new), z(new))) (91) (92) (93) We properly select momentum weights and stepsizes in Ahn & Sra (2020) and Alimisis et al. (2020; 2021) so that these updates are equivalent in Euclidean cases. Recall that our update with momentum in the GNC τ = CT C (see Sec. 3.2) is =C(cur)(∇τ l(τ (cur)))(cid:16)C(cur)(cid:17)T (cid:122) (cid:123) (cid:125)(cid:124) (C(cur))−T ˆg(τ (cur))(C(cur))−1 m(new) ← αm(cur) + β η1 ← 0 − m(new) C(new) ← Expm( 1 τ (new) ← (cid:0)C(new)(cid:1)T 2 η1)C(cur) C(new) (94) where C is a dense non-singular matrix, we initialize m by 0, and we use the quadratic truncation of the matrix exponential as Expm(N) ≈ I + N + 1 2 N2. Thus, Expm(N)C ≈ 1 2 (I + (I + N)(I + N)) C. (95) (cid:0)I + (I + N)(I + N)T (cid:1) ≻ 0. Since η1 is a symmetric 2 N2 = 1 Note that when N is a symmetric matrix, we have I + N + 1 matrix, we know that the updated τ is SPD even when we use the truncation. The statement about the truncation also holds when N is a triangular matrix arising from a new GNC using a Cholesky factor C. 2 We can recover the update of Lin et al. (2021a) on a SPD manifold by setting α = 0 in Eq. (94). For a Gaussian submanifold τ = (cid:21) (cid:20)Σ + μμT μ μT 1 considered in Sec. 3.3.1, the update of Lin et al. (2021a) on this submanifold is shown below, where we can use the Gaussian gradient identities in Eq. (66) and Σ = UT U: μ ← μ − β 2 Σ (∇μl) (cid:18) β 2 U ← Expm − U (∇Σl) UT (cid:19) U (96) where we use a new GNC and the quadratic truncation for the matrix exponential. 26
http://arxiv.org/abs/2302.09731v1
2023-02-20T02:49:35
2023-02-20T02:49:35
CMVAE: Causal Meta VAE for Unsupervised Meta-Learning
Unsupervised meta-learning aims to learn the meta knowledge from unlabeled data and rapidly adapt to novel tasks. However, existing approaches may be misled by the context-bias (e.g. background) from the training data. In this paper, we abstract the unsupervised meta-learning problem into a Structural Causal Model (SCM) and point out that such bias arises due to hidden confounders. To eliminate the confounders, we define the priors are \textit{conditionally} independent, learn the relationships between priors and intervene on them with casual factorization. Furthermore, we propose Causal Meta VAE (CMVAE) that encodes the priors into latent codes in the causal space and learns their relationships simultaneously to achieve the downstream few-shot image classification task. Results on toy datasets and three benchmark datasets demonstrate that our method can remove the context-bias and it outperforms other state-of-the-art unsupervised meta-learning algorithms because of bias-removal. Code is available at \url{https://github.com/GuodongQi/CMVAE}
[ "Guodong Qi", "Huimin Yu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09731v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09731v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
CMVAE: Causal Meta VAE for Unsupervised Meta-Learning Guodong Qi 1,2, Huimin Yu 1,2,3,4 1College of Information Science and Electronic Engineering, Zhejiang University 2ZJU-League Research & Development Center 3State Key Lab of CAD&CG, Zhejiang University 4Zhejiang Provincial Key Laboratory of Information Processing, Communication and Networking {guodong qi, yhm2005}@zju.edu.cn 3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 1 3 7 9 0 . 2 0 3 2 : v i X r a Abstract Unsupervised meta-learning aims to learn the meta knowl- edge from unlabeled data and rapidly adapt to novel tasks. However, existing approaches may be misled by the context- bias (e.g. background) from the training data. In this pa- per, we abstract the unsupervised meta-learning problem into a Structural Causal Model (SCM) and point out that such bias arises due to hidden confounders. To eliminate the con- founders, we define the priors are conditionally independent, learn the relationships between priors and intervene on them with casual factorization. Furthermore, we propose Causal Meta VAE (CMVAE) that encodes the priors into latent codes in the causal space and learns their relationships simulta- neously to achieve the downstream few-shot image classi- fication task. Results on toy datasets and three benchmark datasets demonstrate that our method can remove the context- bias and it outperforms other state-of-the-art unsupervised meta-learning algorithms because of bias-removal. Code is available at https://github.com/GuodongQi/CMVAE. 1 Introduction Regular meta-learning algorithms such as (Finn, Abbeel, and Levine 2017; Snell, Swersky, and Zemel 2017) aim to learn the meta knowledge to adapt to novel tasks quickly. However, it requires various supervised tasks on large la- beled datasets during the meta-training phase. Recently, re- searchers take great interest in unsupervised meta-learning (Hsu, Levine, and Finn 2019; Khodadadeh et al. 2021). Different from regular meta-learning, unsupervised meta- learning contains unsupervised meta-training and super- vised meta-test. It aims to learn a learning procedure with unlabeled datasets in the meta-training and solve novel su- pervised human-crafted tasks in the meta-test. Previous methods focus on the pseudo-label generation of the task. However, they may ignore the bias. Figure 1a illus- trates a binary-classification toy example where the back- ground prior is one of bias. In the training images, the "birds" are always together with the "sky" and the "air- planes" always park on the ground. As a result, the model will take the "sky" as a part of the "bird", and mistakenly recognize the "airplane" test image as a "bird". It is essential to remove the effect of background prior i.e., context-bias. (a) (b) Figure 1: (a) Illustration of context-bias. (b) SCM of unsu- pervised meta-learning. The dashed line means that the rela- tionship (DAG) need to be learned. However, discerning the context-bias is challenging, be- cause the priors may not be independent. For example, in the task of Figure 1a, the "wing" and the "sky" prior is not inde- pendent statistically1. When the "sky" prior is removed, the "wing" prior will be changed, and then the prediction will be affected. In this case, the model will not know whether the "sky" or "wing" prior is the context-bias. To address the problems, we analyze, discern and re- move the context-bias from a causal perspective via three theories, i.e., Structural Causal Model (SCM) (Glymour, Pearl, and Jewell 2016), Common Cause Principle (CCP) (Sch ̈olkopf et al. 2021) and Independent Causal Mechanism (ICM) (Sch ̈olkopf et al. 2012). Among them, SCM describes the relevant concepts and how they interact with each other. CCP reveals that if two observables are statistically depen- dent, then there exists a variable such that they are indepen- dent conditioned on the variable. ICM states that the con- ditional distribution of each prior given its causes does not influence the others. In other words, SCM explains how the bias affects predictions. CCP makes it reasonable to assume the priors are conditionally independent. For example, in Figure 1a there exists a "flying" prior, which causally af- fects "sky" and "wing" and makes them independent when conditioned on the prior. ICM allows us to remove one prior (e.g., p(sky|flying)) will not affect another prior (e.g., p(wing|flying)). Specially, we build the SCM in Figure 1b. The bias Copyright © 2023, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. 1P (wing, sky) = 1/4, P (wing) = 3/4, P (sky) = 1/2, we have P (wing, sky) (cid:54)= P (wing)P (sky), so they are dependent. Training imagesTest imagesSky √ Wing √ Sky √ Wing × Sky × Wing √ Sky × Wing √ Sky √ Wing √ Sky × Wing ×D1D2DdXY... emerges because the priors are confounders that cause spu- rious correlations from the inputs to predictions. To achieve bias-removal, we define the relationships between priors based on CCP, obtain the structure with a learnable directed acyclic graph (DAG), causally factorize the joint distribution of priors based on ICM, and then perform causal interven- tion (Glymour, Pearl, and Jewell 2016) in sequence. Furthermore, we design the Causal Meta VAE (CMVAE), which learns the priors and the causal factorization simul- taneously. Particularly, we propose the causal intervention formula with the SCM. It leads us to learn the conditionally independent latent codes (priors) as well as the DAG (causal factorization). To make the correspondence between the la- tent codes and priors, we adopt the VAE-based framework (Kingma and Welling 2014) since VAE has been shown to achieve some useful disentangling performance (Higgins et al. 2016). The "DAG-ness" can be quantified by a regu- larizer (Zheng et al. 2018). Besides, we introduce the Causal Latent Space (CaLS) and show its addability, which makes it feasible to represent the class-concept codes while keep- ing the DAG. We also extend one baseline (Lee et al. 2021) into our CMVAE to achieve the downstream few-shot clas- sification with the unsupervised meta-learning settings. The contributions of this paper are as follows: • We point out the context-bias and the dependent priors in unsupervised meta-learning. We propose to learn the relationship among the priors with a learnable DAG and make the priors causally independent and factorize. • We design the intervention formula, introduce the CaLS, and propose CMVAE to learn the factors and the factor- ization for the downstream classification simultaneously. • Extensive experiments on two toy datasets and three widely used benchmark datasets demonstrate that CM- VAE outperforms other state-of-the-art unsupervised meta-learning algorithms. Furthermore, we show that CMVAE can be intervened to generate counterfactual samples with some meaningful explanation. 2 Related Work Unsupervised Meta-Learning aims to learn the meta- knowledge with unlabeled training data. CACTU (Hsu, Levine, and Finn 2019) and UMTRA (Khodadadeh, B ̈ol ̈oni, and Shah 2019) try to create synthetic labels. GMVAE (Lee et al. 2021) introduces a Mixture of Gaussian priors by per- forming Expectation-Maximization (EM). However, none of them notices the bias in the few-shot tasks. Causal Inference helps machines understand how and why causes influence their effects (Glymour, Pearl, and Jewell 2016). Recently, the connection between causality and ma- chine learning (Magliacane et al. 2018; Bengio et al. 2020; Kyono, Zhang, and van der Schaar 2020) or computer vi- sion (Lopez-Paz et al. 2017; Yang et al. 2021b; Wang et al. 2020) have gained increasing interest. Recently, IFSL (Yue et al. 2020) introduces the causality into few-shot learning problem with an SCM. However, CMVAE differs since it explicitly learns and utilizes the causal factorization. DAG Learning is to estimate the structure of variables. There are three types of methods, the discrete optimization (Scanagatta et al. 2016; Viinikka et al. 2020), the continuous optimization (Zheng et al. 2018, 2020) and the sampling- based methods (Charpentier, Kibler, and G ̈unnemann 2022). CMVAE incorporates recent continuous optimization meth- ods to learn the DAG of the context-priors. 3 Proposed Formulation 3.1 Problem Statement Given an unlabeled dataset U in the meta-training stage, we aim to learn the knowledge which can be adapted to novel tasks in the meta-test stage. Each task T is drawn from a few-shot labeled dataset D. The U and D are drawn from the same distribution but a different set of classes. Specially, a K-way S-shot classification task T consists of support data S = {(xs, ys)}KS s=0 with K classes of S few labeled samples and query data Q = {xq}Q q=0 with Q unlabeled samples. Our goal is to predict the labels of Q given S. 3.2 Causal Insight Unsupervised meta-learning methods are confused by the context-bias. To analyze how the bias arises, we formulate the problem into SCM in Figure 1b. In the SCM, 1) D → X means that the priors D determine where the object appears in an image, e.g., the context-priors in training images of Figure 1a put the bird object in the sky. 2) D → Y denotes that the priors D affect the predictions Y , e.g., the wing and sky priors lead to the bird prediction. 3) D1, * * * , Dd are de- pendent statistically, e.g., the "sky", "wing" and prior are not independent but causally dependent. Their causal rela- tionships need to be determined (dashed lines). 4) X → Y is the regular classification process. From the SCM, we observe that context-priors D con- found the effect that input X has on prediction Y , which leads to the bias. Thus, it is critical to eliminate the con- founding effects, we then apply causal intervention with the do-operator (Glymour, Pearl, and Jewell 2016) as follows (Details in Supp. 3.1), P (y|do(x)) = P (y|x, D1 = d1, * * * , (cid:88)d1,*** ,dd Dd = dd)P (D1 = d1, * * * , Dd = dd) (1) where di ranges over all values that variables Di can take. Equation 1 informs that intervening on x calls for the joint distribution of D. Note that D1, * * * , Dd may be dependent statistically (i.e., P (D) (cid:54)= Πd i=1P (Di)). Inspired by CCP (Sch ̈olkopf et al. 2021), we assume the common causes are ones of priors. Then finding the common causes suggests discovering the causal relationships among the priors. The causal relationships can be represented by a DAG (dashed lines). For example in Figure 1a, the flying prior is the com- mon cause of sky and wing priors, the DAG is "sky ← flying → wing", and the latter two are independent when condi- tioned on the flying. Furthermore, based on ICM (Sch ̈olkopf et al. 2021), the joint distribution P (D) can be factorized into, d P (D) = P (Di| PA(i)) (2) i=1 (cid:89) Figure 2: An SEM. [Left]: DAG with 4 nodes. [Right]: A linear equation for Gaussian SEM with noise (cid:15) ∼ N (0, I). where PA(i) denotes the parents of Di, which can be ob- tained from the DAG. To discover the DAG, we utilize Gaussian Structural Equation Model (SEM) (Pearl et al. 2000). Figure 6b shows a linear-Gaussian SEM. Formally, given the variables D, there exist functions hi and hj : Rd → R such that Di = hi(D) + Ui, Dj = hj(D) + Uj (3) where Ui and Uj are independent Gaussian noises, and hi and hj are regarded as structural functions. The relationship between hi and PA() is that hi(d1, * * * , dd) does not depend on dk if Dk /∈ PA(i). The DAG can be learned by maximum likelihood estima- tion E[Di|hi(D)] and E[Dj|hj(D)] over D. Its "DAGness" can be enforced using a trace exponential regularizer such as NoTears penalization (Zheng et al. 2018). Insufficient penal- ization weight may not ensure the "DAGness" and weaken the effect of bias-removal, but default weight works for most scenarios. If the causal graph is Non-DAG graph, a solu- tion is to learn such mixed graphs with score-based methods (Bernstein et al. 2020). It is compatible with our method. 3.3 Adjustment Formulation This section offer an adjustment formulation for Equation 1. Specially, given the DAG function h = {hi}d i=1, the distri- bution P (D) is approximated by P (D1 = d1, * * * , Dd = dd) ≈ P (D = d|h(D = d)), where d = [d1| * * * |dd] ∈ R1×d. Also, given the input data x, we assume its latent codes z ∈ R1×d via VAE (Kingma and Welling 2014). Since VAE has been shown to achieve some useful disen- tangling (Higgins et al. 2016), we perform the dimensional- wise product to make each latent code represents one prior, i.e., z ← z ⊗ d. Then we have P (D = d|h(D = d)) = P (Z = z|h(Z = z)). Finally, the adjustment formulation yields, p(y|do(x)) = E p(z|x) E p(z|h(z)) p(y|z) (4) Sampling Adjusting (cid:124) Equation 4 reveals that the causal intervention can be ac- (cid:124) (cid:123)(cid:122) (cid:125) complished by the sampling term p(z|x) and the adjusting term p(z|h(z)) with the DAG function h. Note that the ad- justing term is short for two steps: 1) Draw e ∼ p(e|z); 2) Make z − e ∼ N (0, I), which is a constraint that forces h to follow the DAG in z. Thus, we call it adjusting. (cid:123)(cid:122) (cid:125) While variables z and function h may be non-identifiable due to non-conditional additionally observed variables (e.g., DAG label) (Khemakhem et al. 2020), we can choose suit- able inductive biases to recover a certain structure in the real world (Locatello et al. 2019; Tr ̈auble et al. 2021). Besides, the formulation is also sufficient for classification based on the two causal principles. Empirical results in Section 5.4 also reveal some meaningful explanation. Though (Yang et al. 2021a; Kim et al. 2021) have stud- ied learning causality with VAE, their generative process is "noises → causal codes → images"and needs additional ob- servations to learn the distributution of codes, which is im- practical and limited. While our generative is "noise → im- ages" and make "noise = causal codes". It is as flexible as vanilla VAE. Compared to Deconfounder (Wang and Blei 2019), our causal structure on the latent confounders is de- fined and to be learned by DAG learning methods. 3.4 Causal Latent Space To achieve the downstream task such as clustering and clas- sification, we introduce the causal latent space (CaLS) and study the computation of weighted sum in this space. Partic- ularly, we assume the distribution of the causally indepen- dent codes z ∈ R1×d is Gaussian 2 z ∼ N (h(z), I) (5) We refer to the latent codes in CaLS as causal codes, and the causal codes follow the same DAG. Then, the weighted sum latent codes can be obtained by the following proposition. Proposition 1. Assume there are n causal codes Z ∈ Rn×d shared same h that represents the DAG, an assignment w ∈ Rn×1 satisfying wT 1 = 1 and the weighted sum z = wT Z. Then z ∼ N (h(z), wT wI) (6) whenever h is linear or non-linear function. Proof is avail- able in Supp. 3.2. Proposition 1 shows that whatever the function h, the causal relationships of z by weighted sum over z will re- main unchanged as h can express the DAG structure. 4 Causal Meta VAE To demonstrate the effectiveness of pipeline, we extent the baseline (Lee et al. 2021) into our CMVAE. It includes the Causal Mixture of Gaussian (CMoG), unsupervised meta- training and meta-test methods with novel causal Expecta- tion Maximization. The following notation subscript is used: z[i] ∈ R1×d for i-th observation of Z, and zj ∈ Rn×1 for j-th dimension of Z. Figure 3 shows the graphical model of CMVAE. 4.1 Causal Mixture of Gaussians The Causal Mixture of Gaussians (CMoG) is an extension of MoG distribution in the CaLS based on proposition 1, c ∼ Cat(π), z|c ∼ N (μ[k], σ2 [k]I), μ[k] ∼ N (h(μ[k]), s2 kI) (7) where π is K dimensional weights, (μ[k], σ2 [k]) are mean and diagonal covariance of the k-th mixture modality, and 2Actually we assume the error term (cid:15) = z − h(z) is Gaussian and ignore this error to focus on z and the corresponding space. D1D2D3D4D1D2D3D4T=D1D2D3D4T00.90.50001.42.200000000+(cid:29)1(cid:29)2(cid:29)3(cid:29)4T Algorithm 1: Unsupervised Causal Meta-training Input: An unlabeled dataset U, causal-EM steps step. Initialized parameterized qφ, pθ. while not converged do Generate unlabeled task Tt = {xu|xu ∈ U} Draw z ∼ qφ(z|x, Tt), e ∼ qφ(e|z, x) in Eq. 9, 10 Compute ψ∗ t in Eq. 14 with step causal-EM Compute loss L in Eq. 16 and update φ, θ, h (a) (b) end while Figure 3: Graphical model of CMVAE. (a) Unsupervised meta-training. CMoG prior ψt = {π, μ}. [Left] Variational posterior qφ(z|x, Tt), qφ(e|z, x). ψt is learned by causal- EM. [Right] Generative model pθ(x|z, e), p(z|e). (b)Meta- test by semi-supervised causal-EM. the scalar s2 k is a scaling parameter. Here we take the diago- nal covariance σ2 [k]I instead of Σk since the relationships between dimensions can be mined by learning the DAG. From another perspective, Eq. 7 can be seen as a regular- ization to make the modality causally independent. we refer to it as causal modality. 4.2 Unsupervised Meta-training We now describe unsupervised meta-training in causal la- tent space based on VAE (Kingma and Welling 2014). Given a meta-training task Tt = {xi ∈ U}M i=1, the goals are to optimize the variational lower bound of the data marginal likelihood of task Tt using an variational posterior. Specif- ically, for the unsupervised meta-learning where labels are unknown, we define the variational posterior qφ(z|x, Tt) t (z). For learning and the task-specific CMoG priors pψ∗ the causal structure, let e be sampled from the causal la- tent space, where function h is applied to z, i.e., e|z ∼ N (h(z), I). For posterior network, we use a factorization qφ(e, z|x, Tt) = qφ(e|z, x, Tt)qφ(z|x, Tt), sampling z given x ∈ Tt first, then conditionally sampling e based on these values. It leads to the evidence lower bound (ELBO) (De- tails in Supp. 3.3), qφ(z|x,Tt)[E E qφ(e|z,x)[log pθ(x|z, e) − log qφ(e|z, x) p(e|z) ] + log pψ∗ t (z) − log qφ(z|x, Tt)] (8) where x ∈ Tt. The ELBO can be approximated by Monte Carlo estimation. We then describe these variational posteri- ors and priors in detail. Variational Posterior. The task-conditioned variational posterior qφ(z|x, Tt) is to encode the dependency into the latent space between data in current task. Following (Lee et al. 2021), we take task Tt as inputs and denote, H = TE(F (x)), x ∈ Tt, μ = WμH + bμ, σ2 = exp(Wσ2H + bσ2 ), qφ(z|x, Tt) = N (z|μ, σ2) (9) where TE(*) is multi-head self-attention mechanism (Vaswani et al. 2017), F is a convolutional neural network (or an identity function). To learn the causal structure, we apply the function h to the latent space and then sample e from the obtained causal latent space, qφ(e|z, x) = N (e|h(z), I), z ∼ qφ(z|x, Tt) (10) Causally Conditional Prior. Ideally if the DAG h repre- sents the true causal structure, the conditional prior p(e|z) can be obtained by replacing the unknown h, p(e|z) = N (0, I) + h(z) = N (e|z, 2I) (11) Task-specific Prior. The task-specific causal multi-modal prior is modeled via CMoG and formally factorized as: K pψt (z) = pψt(z|c)pψt(c), pψt(c) = Cat(c|π), c=0 (cid:88) pψt(z|c) = N (z|μ[k], σ2 [k]I)N (μ[k]|h(μ[k]), s2 kI) (12) where the task-specific parameters ψt is defined as ψt = {π, μ[k], σ2 k}. Maximizing ELBO in Eq. 8 results in locally maximizing the following maximum causal posterior (MCP) problem: [k]I, s2 ψ∗ t = argmax ψt (cid:88) log p(ψt|z) (13) Without losing the DAG structure, the derived EM equations in closed forms are referred to as causal-EM (Derivations in Supp. 3.4), E: ωik = M: μ[k] = αkN (z[i]|μ[k], I)N (μ[k]|h(μ[k]), γ2I) k αkN (z[i]|μ[k], I)N (μ[k]|h(μ[k]), γ2I) M i=1 ωikz[i](I + (cid:15)(γ−1I)(cid:15)T (γ−1I))−1 M i=1 ωik (cid:80) (cid:80) (14) (cid:80)M i=1 ωik (cid:80)M (cid:80) k=1 (cid:80)K i=1 ωik where (cid:15)(z) = z − h(z) and αk = . It can also be simplified using the inverse covariance matrix and we want to show that the term (cid:15)(γ−1I) allows that j(cid:48) propa- gates its information to j if j(cid:48) ∈ PA(j), then intervenes and refines μ[k]. Following the assumption of VAE, the covari- ance of Gaussian distribution is set to I. We also observe that k to a fixed hyper-parameter γ2 results in better con- setting s2 vergence. The αk is initialized as 1 K , and μ[k] is initialized where {z[i]}K as: μ[k] = i=1 are randomly selected. By performing a few causal-EM steps it- eratively, the MCP converges and task-specific parameters ψ∗ i z[i](I+(cid:15)(γ−1I)(cid:15)T (γ−1I))−1 K t is obtained. (cid:80)K σ2Iππczzhhhxxμμeeysπμhxsxqzσ2I (a) (b) (c) (d) Figure 4: Visualization on Omniglot. (a, b) The samples and generated samples for each mode at supervised meta-test step of CMVAE. Each row stands for each modality ob- tained by EM. (c, d) Counterfactual samples by intervention on causes and effects, respectively. The larger the change, the better the intervention, the more we can show that our method has learned the causes and effects. 4.3 Training Objective DAG Loss. DAG loss is to ensure the "DAGness". We consider two types. 1) Linear SEM, h(z) = zA, where A ∈ Rd×d. 2) Nonlinear SEM, we model it with a multi- i ) * * * )Wl layer perceptron (MLP), hi(z) = σ(σ(σ(zW1 i), and define [A]mi = (cid:107)m th-row(W1 i )(cid:107)2 where (cid:107) * (cid:107)2 is (cid:96)2 norm. Then the DAG loss (Zheng et al. 2018) is RD(A) = (tr(exp(A ◦ A)) − d)2 (15) Objective. After getting the task-specific parameters ψ∗ t , we use gradient descent-based method w.r.t. the variational pa- rameter φ, the generative parameter θ and the parameters of function h and minimize the following objective, L = −ELBO + λ1RD(A) + λ2(cid:107)A(cid:107)1 (16) where λ1, λ2 are hyper parameters which control the "DAG- ness", and (cid:107) * (cid:107)1 is (cid:96)1 norm. Algorithm 1 shows the steps of the unsupervised meta- training stage. The outputs of unsupervised meta-training stage consists of variational parameter φ, the generative pa- rameter θ and the parameters of function h. Similar to the regular meta-training stage, these outputs are also model ini- tialization as it is a bi-level optimization (Liu et al. 2022b; Vicol et al. 2022). The inner optimization is to maximize ELBO over task-specific ψ in Equation 8. In th outer loop, our method is to minimize the loss with regard to task- agnostic parameters φ, θ and h in Equation 16. 4.4 Supervised Meta-test With CMoG priors, each causal modality can be seen as a pseudo-class concept. To adapt the causal modality to few- shot classification, we use both support set and query set and draw causal latent codes from the variational posterior qφ. During the meta-test given a task T = {(S, Q)|S = {xs, ys}S q=1}, the goal is to compute the conditional probability p(yq|xq, T ) w.r.t. variational poste- rior qφ, the causal multi-modal prior parameter ψ∗ and the backdoor adjustment in Equation 4: s=1, Q = {xq}Q p(yq|xq, T ) = E (17) Eq. 17 can also be computed by Bayes rule and Monte Carlo sampling. Then the predicted label is qφ(zq|xq,T )p(zq|h(zq))[pψ∗ (yq|zq)] ˆyq = argmax k p(yq = k|zq, T ) (18) (a) (b) (c) Figure 5: (a) DAG on Omniglot by the learned A. Each node represents each dimension of z. Other nodes are not shown because they are independent and have no cause-to-effect relationship (b) Part of DAG to show the causes and effects. The gray nodes represent the causes. (c) Intervention on one cause, e.g., z44, will change the effects e.g., z5 while will not change other causes, e.g., z11. Best viewed in color. To obtain the optimal prior parameters ψ∗ in current meta- test task T and make the causal modality as label, we de- velop a semi-supervised causal-EM algorithm. In particular, we sample the causal code z ∼ qφ(z|x, T ) first and then get the causal multi-modalities with steps as follows, E: ωqk = N (z[q]|μ[k], σ2 k N (z[q]|μ[k], σ2 [k])N (μ[k]|h(μ[k]), γ2I) [k])N (μ[k]|h(μ[k]), γ2I) M: ̃μ[k] = (cid:80) ̃ωskz[s] + ̃ωqkz[q] s (cid:88) q (cid:88) μ[k] = ̃μ[k](I + (cid:15)(γ−1σ[k])(cid:15)T (γ−1σ[k]))−1 (19) σ2 [k] = ̃ωsk(z[s] − μ[k])2 + ̃ωqk(z[q] − μ[k])2 s (cid:80) (cid:80) s ωqk 1ys=k+(cid:80) 1ys=k 1ys=k+(cid:80) q (cid:88) , ̃ωqk = s (cid:88) where ̃ωsk = q ωqk q ωqk and 1 is the indicator function. We keep the mixture prob- ability fixed to 1 K due to the uniformly distributed labels and use diagonal covariance σ2 [k] instead of I to obtain more accurate results. The μ[k] is initialized as: μ[k] = (cid:80) Finally, we can get the s solution of MCP and ψ∗ by a few steps iteratively similar to the meta-training. 1ys=kz[s](I+(cid:15)(γ−1I)(cid:15)T (γ−1I))−1 1ys=k (cid:80) s 5 Experiment In this section we show the empirical performance of our method on few-shot classification tasks. 5.1 Experiment Settings Dataset. One biased toy dataset and three natural datasets are used to test our algorithm. 1) Toy dataset. It is a 2- way biased dataset with a synthetic "bird" and "plane" im- age. (Details in Supp. 5.1.) 2) Omniglot. Omniglot con- sists of 1,623 different characters and 20 images per char- acter. Each image is 28 × 28 gray-scale. We take 1200, 100, 323 classes for training, validation and test, respectively. 3) miniImageNet. It is a subset of ImageNet (Russakovsky et al. 2015) and consists of 100 classes, 600 images per class 152151581021133343944595158244511333951582445113339Intervention Table 1: Results (way, shot) in Omniglot and miniImageNet. The ACAI/DC (RO/N) mean ACAI clustering (Random Out-of- class samples) on Omniglot and DeepCluster (Noise) on miniImageNet. Omniglot (way, shot) miniImageNet (way, shot) Method Clustering (5,1) (5,5) (20,1) (20,5) (5,1) (5,5) (5,20) (5,50) Training from Scratch N/A 52.50 74.78 24.91 47.62 27.59 38.48 51.53 59.63 BiGAN CACTUs-MAML BiGAN CACTUs-ProtoNets ACAI/DC CACTUs-MAML ACAI/DC CACTUs-ProtoNets N/A UMTRA LASIUM-MAML-RO/N N/A LASIUMs-ProtoNets-RO/N N/A N/A Meta-GMVAE IFSL† N/A CMVAE (ours) MAML (Supervised) ProtoNets (Supervised) N/A N/A N/A 58.18 54.74 68.84 68.12 83.80 83.26 80.12 94.92 94.22 78.66 71.69 87.78 83.58 95.43 95.29 91.10 97.09 97.01 35.56 33.40 48.09 47.75 74.25 - - 82.21 82.21 95.11 97.14 82.58 94.46 98.35 98.83 99.58 84.60 95.31 58.62 50.62 73.36 66.27 92.12 - - 90.61 90.65 90.79 96.29 98.81 36.24 36.62 39.90 39.18 39.93 40.19 40.05 42.82 42.90 51.28 50.16 53.97 53.36 50.73 54.56 52.53 55.73 56.01 61.33 59.56 63.84 61.54 61.11 65.17 59.45 63.14 63.24 44.27 58.95 66.25 46.81 46.56 62.13 62.29 71.03 70.05 66.91 63.27 69.64 63.55 67.15 69.13 61.43 68.26 68.90 70.54 75.54 72.04 with size 84 × 84. we take 64 classes for training, 16 for val- idation and 20 for test, respectively. 4) CelebA. CelebA con- sists of 202,599 face images with 10,177 number of identi- ties. It has been used in the 5-way few-shot recognition task. Evaluation metrics. During meta-test, we use the classes in the test set to generate 1000 tasks and compute the mean accuracy and 95% confidence interval on these tasks. Implementation Details. We adopt the high-level feature reconstruction objective for toy dataset, mini-ImageNet and CelebA dataset. The backbone, variational posterior network qφ(z|x, Tt) and the high-level feature extractor (i.e., Sim- CLR (Chen et al. 2020)) are same as (Lee et al. 2021) for fair comparisons (i.e., 4-layer CNN for Omniglot and 5-layer CNN for others). For the generative network pθ(x|z, e), we concatenate z and e in the last dimension, and it outputs the parameter of Bernoulli distribution for Omniglot and the mean of Gaussian distribution for miniImageNet and CelebA. The causal function h is defined as described in section 3.4. There are no other parameters in qφ(e|z, x). The number of iterations for causal-EM steps of all experiment is 10. The hyper-parameters γ, λ1 and λ2 are chosen based on the validation class accuracy. We train all models for 60,000 iterations using Adam (Kingma and Ba 2015). 5.2 Baselines We compare the following unsupervised meta-learning base- lines with our approach. CACTUs (Hsu, Levine, and Finn 2019) extract features by ACAI (Berthelot* et al. 2019), Bi- GAN (Jeff Donahue 2017), and Deep- Cluster (Caron et al. 2018) and then train MAML or ProtoNets. UMTRA (Kho- dadadeh, B ̈ol ̈oni, and Shah 2019) generates training tasks by random sampling and augmentation for unsupervised meta-training. Meta-GMVAE (Lee et al. 2021) learns a set-level latent representation by EM algorithm. LASIUMs (Khodadadeh et al. 2021) creates synthetic training data by adding Noise, Random Out-of-class samples, and then train MAML or ProtoNets. IFSL (Yue et al. 2020) is a supervised method. We reimplement it by using backdoor adjustments in Meta-GMVAE. Furthermore, we compare the classic su- Table 2: Accuracy results on CelebA with 5-way, S-shot identity recognition. All the values are from (Khodadadeh et al. 2021), except for ours and † that we reproduce. Algorithm S = 1 S = 5 Training from scratch CACTUs UMTRA LASIUM-RO-GAN-MAML LASIUM-RO-VAE-MAML LASIUM-RO-GAN-ProtoNets LASIUM-RO-VAE-ProtoNets Meta-GMVAE† IFSL† CMVAE (Ours) MAML (Supervised) ProtoNets (Supervised) 34.69 41.42 39.30 43.88 41.25 44.39 43.22 58.05 57.98 61.04 85.46 84.17 56.50 62.71 60.44 66.98 58.22 60.83 61.12 71.95 72.09 74.18 94.98 90.84 pervised methods MAML (Finn, Abbeel, and Levine 2017), ProtoNets (Snell, Swersky, and Zemel 2017) to indicate the gap between the supervised and unsupervised methods. 5.3 Results Toy dataset. The 2-way 4-shot classification results in the toy dataset are 78.51 ± 0.36 for Meta-GMVAE and 93.08 ± 0.32 for our CMVAE. Since Meta-GMVAE does not take into account the context-bias, its performance is not impres- sive. While our CMVAE notices the existence of context- bias, the about 15% improvement on the biased toy dataset demonstrates that it offers the ability to alleviate the context- bias. Natural dataset. Table 1 reports the results of few-shot image classification for Omniglot and miniImageNet bench- marks. Table 2 shows the results of 5-way few-shot identity recognition on CelebA. We can observe that our method out- performs state-of-the-art methods, except for the UMTRA on the 20-shot 5-shot classification in Omniglot. Our CM- VAE even outperforms 5-way 1-shot classification super- vised MAML in Omniglot. It is noticed that, for challenging dataset e.g., miniImageNet, our method outperforms Meta- Table 3: Results of 5-way 1-shot classification on Omniglot, miniImageNet and CelebA with different settings. We show the impact of choosing hyper parameters on test accuracies. In the Default, the causal function is non-linear, λ1 = 1, λ2 = 10−4, and γ = 1. Table 4: Time (s) cost over 10000 20-way tasks on Omniglot during the meta-test stage. Inverse: Matrix inversion. EM Inverse Causal EM 1-shot 5-shot 129.59 143.36 139.45 (+7.6%) 150.52 (+5.0%) 145.31 (+12.1%) 156.46 (+9.1%) Omniglot miniImageNet CelebA Default 95.11 ± 0.47 43.91 ± 0.74 59.93 ± 0.95 Linear λ1 = 10−1 λ1 = 105 λ1 = 1010 λ2 = 10−2 λ2 = 10−3 λ2 = 10−5 γ2 = s2 k γ2 = 0.5 γ2 = 0.9 γ2 = 5 γ2 = 10 89.26 ± 0.56 42.68 ± 0.72 51.28 ± 0.91 94.46 ± 0.49 94.42 ± 0.48 91.28 ± 0.61 94.91 ± 0.50 94.95 ± 0.48 93.58 ± 0.49 90.34 ± 0.65 94.76 ± 0.48 92.40 ± 0.57 92.52 ± 0.54 58.29 ± 1.07 43.06 ± 0.75 42.11 ± 0.74 41.27 ± 0.70 42.88 ± 0.75 43.05 ± 0.75 42.66 ± 0.72 42.55 ± 0.75 43.48 ± 0.74 43.46 ± 0.74 44.27 ± 0.76 44.11 ± 0.75 59.84 ± 0.95 59.72 ± 0.88 50.92 ± 0.92 59.29 ± 0.93 59.27 ± 0.94 59.59 ± 0.95 54.25 ± 0.97 60.25 ± 0.94 61.04 ± 0.94 59.04 ± 0.92 59.04 ± 0.95 GMVAE by more than about 2.5% average. This shows that 1) Our meta-learning network can capture the causal multi- modal distribution. 2) The causality is a more reliable in the natural images. 3) With causally independent codes and the adjustment for intervention, the confounding effect of meta- knowledge are removed. Visualization. To better understand how CMVAE learns in the supervised meta-test stage, we visualize the real in- stances and ones generated by pθ(x|z, e) in Figure 4a, 4b, where each row represents each modality. We can observe that 1) The distinction between real samples and generated samples reveals how well our generative ability for network p(x|z, h) from output distribution. 2) Our CMVAE can cap- ture the similar visual structure in each modality and make it as a class-concept in the meta-test stage. 5.4 Ablation Study Counterfactual samples. To further demonstrate the effec- tiveness of the causality learned by CMVAE, we plot the DAG structure after obtaining A based on h in Figure 5. The nodes are a collection of dimensions of latent codes i.e., V = {z0, * * * , z63}, and the edges represent cause-to-effect. Note that all the nodes are codes with semantics of interest. We can discover that z1, * * * , z59 are the causes. Figure 5c shows the intervention propagation. Because in- tervening causes will change the effects while intervening effects will not change the causes, the image will change more massively when intervening causes. Although we do not know which parts of the image these causes are respon- sible for generating, they are the most relevant to image gen- eration. To this end, we generate counterfactual samples by intervening the causes and the effects, respectively, with the same amount (e.g., 7 causes or 7 effects) and intervention value (e.g., fixed to 0). Figure 4c, 4d show the visual results. Comparing them, we conclude as follows: 1) Intervention on the causes from the DAG results in larger changes. Since the intervention can propagate from causes to effects, the DAG learned by our CMVAE is reliable. 2) The causes are the most relevant to the images though we do not know what they means in complex real-world scenes. DAG type. We compare the performance of CMVAE with regard to the DAG type, i.e., when the DAG function h is linear or non-linear. The results are shown in the Rows 1- 2 of Table 3. We can observe that performances get worse when the function h is linear, which is in line with the com- mon sense that the cause-to-effect is not a simple linear but a complex non-linear relation in the natural images. Influence of λ1, λ2. The hyper parameters λ1, λ2 control the "DAGness". The larger λ1 and λ2, the more strongly causal relations are enforced. Rows 3-8 of Table 3 show that the setting when λ1 = 1, λ2 = 10−4 outperforms other settings. This is because in the real-world images, factors with seman- tics are unknown and uncountable. The weak constraints can avoid overfitting the causal relations. Effects of γ. The value of hype parameter γ controls the in- fluence of causal regularization on modalities. We tuned this parameter using the validation classes with the following values: [s2 )2 for the meta-training and s2 )2 + k, 0.5, 0.9, 1.0, 5, 10] where s2 s( (cid:80) )2 for the meta-test based on the causal EM algorithm, and select the best γ corresponding to the (cid:80) best average 5-way 1-shot accuracy over meta-validation data for inference over the meta-test data. The last 5 rows of Table 3 shows the test class accuracies with respect to differ- ent values of γ. Though γ2 = 1, γ2 = 5, γ2 = 0.9 provide the best results for Omniglot, miniImageNet and CelebA, which shows that the causal regularization needs to satisfy for different datasets, the default value already outperforms SOTA and it is user-friendly in practice. Time complexity. Compared with the original EM, the in- ference of causal-EM comes with more time cost, as matrix operations (i.e., inversion) have cubic time complexity. Ta- ble 4 reports that causal-EM costs about 10% more time, which is acceptable compared to the better accuracy. ̃ωqk s ̃ωsk+(cid:80) i( wik i wik ̃ωsk s ̃ωsk+(cid:80) (cid:80) k = k = q ̃ωqk q ̃ωqk (cid:80) q( (cid:80) (cid:80) 6 Conclusion The context-bias arises when the priors cause spurious cor- rections between inputs and predictions in unsupervised meta-learning. In this work, we offer an adjustment formu- lation that performs intervention on inputs to achieve bias- removal. We also develop CMVAE that carries out classifi- cation in causal latent space. Extensive experiments demon- strate that our approach has a better generalization ability across different tasks and datasets. CMVAE is also flexible for the extension to supervised learning. The limitation is that CMVAE may lack identifiability without any additional observation. We leave these questions for future work. References Bengio, Y.; Deleu, T.; Rahaman, N.; Ke, N. R.; Lachapelle, S.; Bilaniuk, O.; Goyal, A.; and Pal, C. J. 2020. A Meta-Transfer Objective for Learning to Disentangle Causal Mechanisms. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. Bernstein, D.; Saeed, B.; Squires, C.; and Uhler, C. 2020. Ordering-Based Causal Structure Learning in the Presence of Latent Variables. In Chiappa, S.; and Calandra, R., eds., Proceedings of the Twenty Third International Con- ference on Artificial Intelligence and Statistics, volume 108 of Proceedings of Machine Learning Research, 4098–4108. PMLR. Berthelot*, D.; Raffel*, C.; Roy, A.; and Goodfellow, I. 2019. Understanding and Improving Interpolation in Au- toencoders via an Adversarial Regularizer. In International Conference on Learning Representations. Caron, M.; Bojanowski, P.; Joulin, A.; and Douze, M. 2018. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision (ECCV), 132–149. Charpentier, B.; Kibler, S.; and G ̈unnemann, S. 2022. Dif- ferentiable DAG Sampling. In International Conference on Learning Representations. Chen, T.; Kornblith, S.; Norouzi, M.; and Hinton, G. 2020. A simple framework for contrastive learning of visual repre- sentations. In International conference on machine learning, 1597–1607. PMLR. Finn, C.; Abbeel, P.; and Levine, S. 2017. Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks. In Precup, D.; and Teh, Y. W., eds., Proceedings of the 34th In- ternational Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, 1126–1135. PMLR. Gangloff, H.; Courbot, J.-B.; Monfrini, E.; and Collet, C. 2021. Unsupervised Image Segmentation with Spatial Triplet Markov Trees. In ICASSP 2021 - 2021 IEEE Inter- national Conference on Acoustics, Speech and Signal Pro- cessing (ICASSP), 1790–1794. Glymour, M.; Pearl, J.; and Jewell, N. P. 2016. Causal in- ference in statistics: A primer. John Wiley & Sons. Higgins, I.; Matthey, L.; Pal, A.; Burgess, C.; Glorot, X.; Botvinick, M.; Mohamed, S.; and Lerchner, A. 2016. beta- vae: Learning basic visual concepts with a constrained vari- ational framework. In International Conference on Learning Representations. Hsu, K.; Levine, S.; and Finn, C. 2019. Unsupervised Learn- In International Conference on ing via Meta-Learning. Learning Representations. Jeff Donahue, T. D., Philipp Kr ̈ahenb ̈uhl. 2017. Adversarial Feature Learning. In International Conference on Learning Representations. Khemakhem, I.; Kingma, D.; Monti, R.; and Hyvarinen, A. 2020. Variational autoencoders and nonlinear ica: A uni- fying framework. In International Conference on Artificial Intelligence and Statistics, 2207–2217. PMLR. Khodadadeh, S.; B ̈ol ̈oni, L.; and Shah, M. 2019. Unsuper- vised Meta-Learning for Few-Shot Image Classification. In Wallach, H. M.; Larochelle, H.; Beygelzimer, A.; d'Alch ́e- Buc, F.; Fox, E. B.; and Garnett, R., eds., NeurIPS 2019, 10132–10142. Khodadadeh, S.; Zehtabian, S.; Vahidian, S.; Wang, W.; Lin, B.; and Boloni, L. 2021. Unsupervised Meta-Learning through Latent-Space Interpolation in Generative Models. In International Conference on Learning Representations. Kim, H.; Shin, S.; Jang, J.; Song, K.; Joo, W.; Kang, W.; and Moon, I.-C. 2021. Counterfactual Fairness with Disentan- gled Causal Effect Variational Autoencoder. Proceedings of the AAAI Conference on Artificial Intelligence, 35(9): 8128– 8136. Kingma, D. P.; and Ba, J. 2015. Adam: A Method for Stochastic Optimization. In Bengio, Y.; and LeCun, Y., eds., 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Confer- ence Track Proceedings. Kingma, D. P.; and Welling, M. 2014. Auto-Encoding Vari- ational Bayes. In 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14- 16, 2014, Conference Track Proceedings. Kyono, T.; Zhang, Y.; and van der Schaar, M. 2020. CAS- TLE: Regularization via Auxiliary Causal Graph Discovery. In Larochelle, H.; Ranzato, M.; Hadsell, R.; Balcan, M.; and Lin, H., eds., Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Pro- cessing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual. Lee, D. B.; Min, D.; Lee, S.; and Hwang, S. J. 2021. Meta- GMVAE: Mixture of Gaussian VAE for Unsupervised Meta- Learning. In International Conference on Learning Repre- sentations. Liu, N.; Li, S.; Du, Y.; Torralba, A.; and Tenenbaum, J. B. 2022a. Compositional Visual Generation with Composable Diffusion Models. arXiv preprint arXiv:2206.01714. Liu, R.; Gao, J.; Zhang, J.; Meng, D.; and Lin, Z. 2022b. Investigating Bi-Level Optimization for Learning and Vision From a Unified Perspective: A Survey and Beyond. IEEE Transactions on Pattern Analysis and Machine Intelligence, 44(12): 10045–10067. Locatello, F.; Bauer, S.; Lucic, M.; Raetsch, G.; Gelly, S.; Sch ̈olkopf, B.; and Bachem, O. 2019. Challenging com- mon assumptions in the unsupervised learning of disentan- In international conference on ma- gled representations. chine learning, 4114–4124. PMLR. Lopez-Paz, D.; Nishihara, R.; Chintala, S.; Sch ̈olkopf, B.; and Bottou, L. 2017. Discovering Causal Signals in Images. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, 58–66. IEEE Computer Society. on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, 10757–10767. Com- puter Vision Foundation / IEEE. Wang, Y.; and Blei, D. M. 2019. The blessings of multi- ple causes. Journal of the American Statistical Association, 114(528): 1574–1596. Yang, M.; Liu, F.; Chen, Z.; Shen, X.; Hao, J.; and Wang, J. 2021a. CausalVAE: disentangled representation learn- ing via neural structural causal models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 9593–9602. Yang, X.; Zhang, H.; Qi, G.; and Cai, J. 2021b. Causal In Proceedings of the attention for vision-language tasks. IEEE/CVF Conference on Computer Vision and Pattern Recognition, 9847–9857. Yu, P.; Xie, S.; Ma, X.; Zhu, Y.; Wu, Y. N.; and Zhu, S.-C. 2021. Unsupervised Foreground Extraction via Deep Region Competition. In Beygelzimer, A.; Dauphin, Y.; Liang, P.; and Vaughan, J. W., eds., Advances in Neural Information Processing Systems. Yue, Z.; Zhang, H.; Sun, Q.; and Hua, X.-S. 2020. Interven- tional Few-Shot Learning. In Larochelle, H.; Ranzato, M.; Hadsell, R.; Balcan, M. F.; and Lin, H., eds., Advances in Neural Information Processing Systems, volume 33, 2734– 2746. Curran Associates, Inc. Zheng, X.; Aragam, B.; Ravikumar, P.; and Xing, E. P. 2018. DAGs with NO TEARS: Continuous Optimization In Proceedings of the 32nd Inter- for Structure Learning. national Conference on Neural Information Processing Sys- tems, NIPS'18, 9492–9503. Red Hook, NY, USA: Curran Associates Inc. Zheng, X.; Dan, C.; Aragam, B.; Ravikumar, P.; and Xing, E. 2020. Learning sparse nonparametric dags. In International Conference on Artificial Intelligence and Statistics, 3414– 3425. PMLR. Magliacane, S.; Van Ommen, T.; Claassen, T.; Bongers, S.; Versteeg, P.; and Mooij, J. M. 2018. Domain adaptation by using causal inference to predict invariant conditional distri- butions. Advances in neural information processing systems, 31. Pearl, J.; et al. 2000. CAUSALITY: Models, Reasoning and Inference. Cambridge, UK: CambridgeUniversityPress, 19. Reichenbach, H. 1956. The direction of time, volume 65. Univ of California Press. Russakovsky, O.; Deng, J.; Su, H.; Krause, J.; Satheesh, S.; Ma, S.; Huang, Z.; Karpathy, A.; Khosla, A.; Bernstein, M.; et al. 2015. Imagenet large scale visual recognition chal- International journal of computer vision, 115(3): lenge. 211–252. Scanagatta, M.; Corani, G.; De Campos, C. P.; and Zaffalon, M. 2016. Learning treewidth-bounded Bayesian networks with thousands of variables. Advances in neural information processing systems, 29. Sch ̈olkopf, B.; Locatello, F.; Bauer, S.; Ke, N. R.; Kalch- brenner, N.; Goyal, A.; and Bengio, Y. 2021. Toward Causal Representation Learning. Proceedings of the IEEE, 109(5): 612–634. Sch ̈olkopf, B.; Janzing, D.; Peters, J.; Sgouritsa, E.; Zhang, K.; and Mooij, J. M. 2012. On causal and anticausal learn- ing. In ICML. Snell, J.; Swersky, K.; and Zemel, R. S. 2017. Prototyp- ical Networks for Few-shot Learning. In Guyon, I.; von Luxburg, U.; Bengio, S.; Wallach, H. M.; Fergus, R.; Vish- wanathan, S. V. N.; and Garnett, R., eds., Advances in Neu- ral Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, 4077–4087. Tr ̈auble, F.; Creager, E.; Kilbertus, N.; Locatello, F.; Dit- tadi, A.; Goyal, A.; Sch ̈olkopf, B.; and Bauer, S. 2021. On Disentangled Representations Learned from Correlated Data. In Meila, M.; and Zhang, T., eds., Proceedings of the 38th International Conference on Machine Learning, vol- ume 139 of Proceedings of Machine Learning Research, 10401–10412. PMLR. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A. N.; Kaiser, Ł.; and Polosukhin, I. 2017. At- tention is all you need. In Advances in neural information processing systems, 5998–6008. Vicol, P.; Lorraine, J. P.; Pedregosa, F.; Duvenaud, D.; and Grosse, R. B. 2022. On Implicit Bias in Overparameterized Bilevel Optimization. In Chaudhuri, K.; Jegelka, S.; Song, L.; Szepesvari, C.; Niu, G.; and Sabato, S., eds., Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, 22234–22259. PMLR. Viinikka, J.; Hyttinen, A.; Pensar, J.; and Koivisto, M. 2020. Towards scalable bayesian learning of causal dags. Advances in Neural Information Processing Systems, 33: 6584–6594. Wang, T.; Huang, J.; Zhang, H.; and Sun, Q. 2020. Vi- sual Commonsense R-CNN. In 2020 IEEE/CVF Conference Appendix A Impacts Impacts of Unsupervised Meta-Learning A.1 Though unsupervised meta-learning may not attract much attention now, we argue that it is a promising direction. Su- pervised meta-learning requires a large labeled dataset dur- ing the meta-training phase, which is a limitation in practice. However, unsupervised meta-learning learns to learn with easily obtainable unlabeled datasets in meta-training and only requires few labeled data in meta-test, which is "actu- all" few-shot learning. Furthermore, in more simple datasets (i.e., Omniglot) 5-way 1-shot task, our work even outper- forms supervised MAML. And in more complex datasets (i.e., miniImageNet) 5-way 1-shot task, our work is 2.6% lower than MAML, where the gap is not too large. A.2 Potential Societal Impacts Briefly, Our method using the latent variables could be used to alter certain image semantic aspects, and then create fake images with the intent to deceive the system and spread mis- information. Additionally, for causal inference practitioners may over-rely on the claim with few assumptions, becom- ing less rigorous when considering necessary assumptions such as identifiability. On the other hand, it could have a clear positive social impact, if CMVAE or other unsuper- vised meta-learning methods become usable and prevalent in application areas such as epidemiology where collect- ing labeled data is very expensive. CMVAE may also mo- tivate researchers to investigate causal inference, which is a promising area for machine learning. B Basic Causal Properties Common Principle. Cause 1956; Sch ̈olkopf et al. 2021) If two observables X and Y are statistically dependent, then there exists a variable Z that causally influences both and explains all the dependence in the sense of making them independent when conditioned on Z. (Reichenbach Independent Causal Mechanism Principle. (Sch ̈olkopf et al. 2021) The causal generative process of a system's vari- ables is composed of autonomous modules that do not in- form or influence each other. In the probabilistic case, this means that the conditional distribution of each variable given its causes (i.e., its mechanism) does not inform or influence the other mechanisms. SCM. To describe the relevant concepts and how they in- teract with each other, we abstract the problem into an SCM in Figure 6a. In the SCM, D → X means that the priors D determine where the object appears in an image XX, e.g., in the main paper, the context priors in training images of Figure 1 put the bird object in the sky. D → Y denotes that the priors D affect the predictions Y , e.g. the wing and sky priors lead to the bird prediction. X → Y is the regular classification process. From the SCM, we observe that D are confounders and cause spurious correlation from X to Y . SEM. The causal relationships between the variables D can be estimated via SEM, represented by a weighted DAG. Figure 6b shows a linear-Gaussian SEM. In this paper, one of the goal is to estimated the weighted DAG. The function hi(u1, ..., ud) does not depend on uk if Dk /∈ P A(i). hi can show the dependence among vari- ables. For example, given a 4-node DAG where the nodes are D = {D1, D2, D3, D4} and the edges are {D1 → D2 ← D3, D4}, we have P A(2) = {D1, D3}. Since D2 is not de- pended on {D2, D4}, the function h2 should be constant for all u2, u4 ∈ R where D2 = u2, D4 = u4. In other words, if a learned h2 satisfies the above property, the dependence and parents of D2 will be known. Ditto for other hi, and the DAG will be known. C Theoretical Analysis C.1 Derivation for Bias Removal We offer a theoretical analysis based on the SCM in Fig- ure 2. Before the derivation, we first formally introduce two concepts. Definition 1 (Block (Glymour, Pearl, and Jewell 2016)) A set D of nodes is said to block a path p if either 1) p contains at least one arrow-emitting node that is in D, or 2) p contains at least one collision node that is outside D and has no descendant in D. Definition 2 (Admissible sets (Pearl et al. 2000)) A set D is admissible (or "sufficient") for adjustment if two condi- tions hold: 1). No element of D is a descendant of X. 2). The elements of D "block" all "back-door" paths from X to Y , namely all paths that end with an arrow pointing to X. In the SCM, there exists "back-door" paths P : X ← D1 → Y, ..., X ← Dd → Y that carry spurious associa- tions from X to Y . Blocking the paths P ensures that the measured association between X and Y is purely causative. Meanwhile, the set D = {D1, ..., Dd} is an admissible set and sufficient for adjustment. We consider the binary problem for convenience. For- mally, the average risk difference in stratum {u1, ..., ud} of D is: (P (Y = 1|X = 1, D1 = u1, ..., Dd = ud) u1,...,ud (cid:88) − P (Y = 1|X = 0, D1 = u1, ..., Dd = ud))* P (D1 = u1, ..., Dd = ud) (20) The risk difference focuses on effect of X. It is considered one estimate of the true causal relationship without bias. One the other hand, based on the adjustment formula, the causal effect is P (Y = 1|do(X = 1)) − P (Y = 1|do(X = 0)) (21) We then derive to prove that the above two equations are equivalent. Firstly, according to the the law of total proba- bility, we have: P (Y = 1|do(X = 1)) = P (Y = 1|do(X = 1), D1 = u1, ..., Dd = ud)* u1,...,ud (cid:88) P (D1 = u1, ..., Dd = ud|do(X = 1)) (22) (a) SCM (b) A linear SEM with 4 nodes Figure 6: (a) The Structural Causal Model (SCM). Causalities need to be learned (dashed lines) (b) A Structural Equation Model (SEM). [Left]: DAG with 4 nodes. [Right]: A linear equation for Gaussian SEM with noise (cid:15) ∼ N (0, I). Algorithm 2: Causal Meta-test Input: A meta test task T , causal-EM steps step. Draw z ∼ qφ(z|x, T ) in Eq. 9 Initialize μ[k] Compute ψ∗ in Eq. 19 with step causal-EM iteratively Compute p(yq|xq, T ) in Eq. 17 Output: Query predictions ˆyq computed by Eq. 18 Since D1, ..., Dd block all backdoor paths P , the only connection from X to Y is causal relation. Then, we can remove the do() operator in the factor for Y in the first part and get: P (Y = 1|do(X = 1), D1 = u1, ..., Dd = ud) = P (Y = 1|X = 1, D1 = u1, ..., Dd = ud) (23) Futhermore, there is no path from X to D1, ..Dd since we intervene on X. Then we can remove the do(X = 1) in the second part: P (D1 = u1, ..., Dd = ud|do(X = 1)) = P (D1 = u1, ..., Dd = ud) (24) Combining them, we have: P (Y = 1|do(X = 1)) = P (Y = 1|X = 1, D1 = u1, ..., Dd = ud)* u1,...,ud (cid:88) P (D1 = u1, ..., Dd = ud) (25) Similarity, P (Y = 1|do(X = 0)) = P (Y = 1|X = 0, D1 = u1, ..., Dd = ud)* u1,...,ud (cid:88) P (D1 = u1, ..., Dd = ud) (26) Then P (Y = 1|do(X = 1)) − P (Y = 1|do(X = 0) equals the average risk difference. In general, for multi-classification, given the admissible set, all factors on the right hand side of the equation are es- timable from the observed data, the causal effect can like- wise be estimated from such data without bias. Figure 7: CMVAE projects the latent codes (left) into the Causal space (right) and performs causal-EM algorithm to get the causal multi-modal prior. During training, the com- mon latent space gradually turns into the causal latent space with the novel loss function. Figure 8: DAG on Omniglot by the learned A. Each node represents each dimension of z. Other nodes are not shown because they are independent and have no cause-to-effect relationship D1D2DdXY...D1D2D3D4D1D2D3D4T=D1D2D3D4T00.90.50001.42.200000000+(cid:29)1(cid:29)2(cid:29)3(cid:29)4T: Samples : Correlations: LatentCodes: Causal RelationsCausal(a)Common Latent Space(b)Causal Latent Space15215158102113334394459 Table 5: Set-level variational posterior network qφ(z|x, Tt) used for Omniglot dataset. Output Size Layers 1 × 28 × 28 64 × 14 × 14 64 × 7 × 7 64 × 4 × 4 64 × 2 × 2 256 256 256 64 × 2 Input Images conv2d(3 × 3, stride 1, padding 1), BatchNorm2D, ReLU, Maxpool(2 × 2, stride 2) conv2d(3 × 3, stride 1, padding 1), BatchNorm2D, ReLU, Maxpool(2 × 2, stride 2) conv2d(3 × 3, stride 1, padding 1), BatchNorm2D, ReLU, Maxpool(2 × 2, stride 2) conv2d(3 × 3, stride 1, padding 1), BatchNorm2D, ReLU, Maxpool(2 × 2, stride 2) Flatten TransformerEncoder(dmodel = 256, dff = 256, h = 4, ELU, LayerNorm = False) TransformerEncoder(dmodel = 256, dff = 256, h = 4, ELU, LayerNorm = False) Linear(256, 64 × 2) Table 6: Generative Network pθ(x|z, e) for Omniglot dataset. where some ξj ∈ (0, mini (z[i]j)), ξ(cid:48) Combined with Eq. 27-29, we have j ∈ (0, i wiz[i]j). (cid:80) Output Size 64 × 2 256 256 256 64 × 2 × 2 64 × 4 × 4 64 × 7 × 7 64 × 14 × 14 1 × 28 × 28 Layers Latent code Linear(64,256), ELU Linear(256,256), ELU Linear(256,256), ELU Unflatten deconv2d(4 × 4, stride 2, padding 1), BatchNorm2D, ReLU deconv2d(3 × 3, stride 2, padding 1), BatchNorm2D, ReLU deconv2d(4 × 4, stride 2, padding 1), BatchNorm2D, ReLU deconv2d(4 × 4, stride 2, padding 1), Sigmoid C.2 Proof of Proposition 3.1 Assume z[i] ∈ R1×d and wi ∈ R is the ith element of Z and w. Then, we have z = (wiz[i]) ∼ N ( wih(z[i]), wi 2I) (27) (cid:88) Taking first-order Taylor approximation h(z) = h(0) + (cid:88) (cid:88) zh(cid:48)(0) + R1(z), where R1(z) = z2 h(cid:48)(cid:48)(ξ) . h(cid:48)(0) is an amendatory approximation of the DAG matrix, and R1(z) affects the edge weights only, then 2 wih(z[i]i) (cid:88) = [wih(0) + wiz[i]h(cid:48)(0) + wiR1(z[i])] (cid:88) = h(0) + ( wiz[i])h(cid:48)(0) + R1( wiz[i]) (cid:88) + wiR1(z[i]) − R1( (cid:88) wiz[i]) = h( (cid:88) wiz[i]) + Compared the last two terms: (cid:88) wiR1(z[i]) − R1( (cid:88) wiz[i]) (28) (cid:88) wiR1(z[i]) wiz[i]) R1( (cid:80) wih(cid:48)(cid:48)(ξ) (cid:80) wi)2h(cid:48)(cid:48)(ξ(cid:48)) = = lim z[i]→0 h(cid:48)(cid:48)(ξ) h(cid:48)(cid:48)(ξ(cid:48)) (cid:88) 2h(cid:48)(cid:48)(ξ) wiz[i] wiz[i])2h(cid:48)(cid:48)(ξ(cid:48)) ( (cid:80) (cid:80) lim z[i]→0 = ( (cid:80) (cid:80) z ∼ N (h(z) + ( h(cid:48)(cid:48)(ξ) h(cid:48)(cid:48)(ξ(cid:48)) − I)R1(z), wT wI) ∼ N (h(z), wT wI) + ( h(cid:48)(cid:48)(ξ) h(cid:48)(cid:48)(ξ(cid:48)) − I)R1(z) (30) Because ( h(cid:48)(cid:48)(ξ) h(cid:48)(cid:48)(ξ(cid:48)) − I)R1(z) only changes the causal edge weights, it can be ignored and the DAG structure remains unchanged whenever h is linear or non-linear function: C.3 Details of Equation 8 In this section, we describe the Equation 8 in detail. Given a task Tt, we assume there exists task dependent causal multi- modalities ψ∗ t , and we want maximize the marginal log- likehood of Tt: = = = (cid:88) log pθ(x) log pθ(Tt) = (cid:90) (cid:90) (cid:88) log pθ(x|z, e)pψ∗ t (z)p(e|z) (cid:90) (cid:90) (cid:88) log pθ(x|z, e)pψ∗ t (z)p(e|z) (cid:90) (cid:88) log pθ(x|z, e)p(e|z) qφ(e|z, x) qφ(e|z, x) de (cid:90) pψ∗ t (z) qφ(z|x, Tt) qφ(z|x, Tt) dz dedz qφ(e, z|x, Tt) qφ(e, z|x, Tt) qφ(z|x, Tt)qφ(e|z, x) qφ(z|x, Tt)qφ(e|z, x) dedz ≥ (cid:88) Eqφ(z|x,Tt)[Eqφ(e|z,x)[log pθ(x|z, e) − log qφ(e|z, x) p(e|z) ] (z) − log qφ(z|x, Tt)] + log pψ∗ t (cid:88) ELBO, z ∼ qφ(z|x, Tt), e|z ∼ qφ(e|z, x) (31) = (29) Table 7: Set-level variational posterior network qφ(z|x, Tt) used for miniImageNet and CelebA. Output Size Layers 256 256 256 64 × 2 Flatten TransformerEncoder(dmodel = 256, dff = 256, h = 4, ELU, LayerNorm = False) TransformerEncoder(dmodel = 256, dff = 256, h = 4, ELU, LayerNorm = False) Linear(256, 64 × 2) Table 8: Feature Extractor for SimCLR on miniImageNet and CelebA. Output Size Layers 3 × 84 × 84 64 × 42 × 42 64 × 21 × 21 64 × 10 × 10 64 × 5 × 5 64 × 2 × 2 256 Input Images conv2d(3 × 3, stride 1, padding 1), BatchNorm2D, ReLU, Maxpool(2 × 2, stride 2) conv2d(3 × 3, stride 1, padding 1), BatchNorm2D, ReLU, Maxpool(2 × 2, stride 2) conv2d(3 × 3, stride 1, padding 1), BatchNorm2D, ReLU, Maxpool(2 × 2, stride 2) conv2d(3 × 3, stride 1, padding 1), BatchNorm2D, ReLU, Maxpool(2 × 2, stride 2) conv2d(3 × 3, stride 1, padding 1), BatchNorm2D, ReLU, Maxpool(2 × 2, stride 2) Flatten Table 9: Generative Network pθ(x|z, e) for miniImageNet and CelebA. Table 11: Results (way, shot) with 95% confidence interval on the miniImageNet and CelebA. Output Size Layers 64 × 2 512 512 256 Latent code Linear(64, 512), ELU Linear(512, 512), ELU Linear(512, 256), ELU miniImageNe (way, shot) CMVAE miniImageNe (way, shot) CMVAE CelebA (way, shot) CMVAE (5,1) 44.27 ± 0.76 (5, 20) 66.25 ± 0.51 (5,1) 61.04 ± 0.94 (5,5) 58.95 ± 0.71 (5, 50) 70.54 ± 0.44 (5,5) 74.18 ± 0.67 Table 10: Results (way, shot) with 95% confidence interval on the Omniglot. Omniglot (way, shot) CMVAE Omniglot (way, shot) CMVAE (5,1) 95.11 ± 0.47 (20,1) 82.58 ± 0.41 (5,5) 97.14 ± 0.20 (20,5) 90.97 ± 0.18 C.4 Derivations of Causal-EM The MCP can be rewritten as: (cid:88) (cid:88) (cid:88) log pψt (z[i]) = log pψt (z|c)pψt (c) i = = (cid:88) i (cid:88) log log (cid:88) k (cid:88) i k p(c = k)N (z|μ[k], σ2 [k]I)N (μ[k]|h(μ[k]), s2 kI) p(c = k|z[i], μ[k], σ2 [k]I, s2 kI)* k i p(c = k)N (z|μ[k], σ2 [k]I)N (μ[k]|h(μ[k]), s2 [k]I) kI) p(c = k|z[i], μ[k], σ2 αkN (z|μ[k], σ2 (cid:88) (cid:88) ≥ ωik log k i = Q(ψt, ψ(cid:48) t) [k]I)N (μ[k]|h(μ[k]), s2 kI) ωik (32) t is values of the previous iteration, αk = p(c = )2. Here we fix the parameters of h (cid:80) where ψ(cid:48) k = k) and s2 during the whole progress. (cid:80) i( wik i wik kI) E-step: According to Bayes' theorem, ωik is: ωik = p(c = k|z[i], μ[k], σ2 αkp(z[i]|μ[k], σ2 [k]I, s2 k αkp(z[i]|μ[k], σ2 αkN (z[i]|μ[k], I)N (μ[k]|h(μ[k]), s2 kI) k αkN (z[i]|μ[k], I)N (μ[k]|h(μ[k]), s2 [k]I, s2 kI) [k]I, s2 kI) (cid:80) = = (33) kI) Then we have (cid:80) Q(ψt, ψ(cid:48) t) = ωik(log αk − log ωik i (cid:88) (cid:88)k − log 2πσ2 [k] − (cid:113) − log 2πs2 k − (cid:113) (z[i] − μ[k])(z[i] − μ[k])T 2σ2 [k] (μ[k] − h(μ[k]))(μ[k] − h(μ[k])T 2s2 k ) (34) M-step: The derivations of αk and σ[k] is the same with common M-step, since the additional term does not contain (a) Intervention on z1, z59 (b) Intervention on z7, z30 (c) Intervention on z5, z58 (d) Intervention on z23, z41 (e) Intervention on z1, z59 (f) Intervention on z7, z30 (g) Intervention on z5, z58 (h) Intervention on z23, z41 Figure 9: Counterfactual samples generated. In the top row, the intervened value is 0. In the bottom row, the intervened value is 1. (a, e) The dimensions are two causes. (c, g) The dimensions are two effects. (b, d, f, h) The dimensions are selected randomly. these parameters. αk = M i=1 ωik M i=1 ωik K (cid:80) k=1 σ[k] = M i=1 ωik(z[i] − μ[k])2 (cid:80) (cid:80) M i=1 ωik (cid:80) (35) (36) For μ[k], we take first-order Taylor approximation h(z) ≈ (cid:80) h(0) + zh(cid:48)(0). h(cid:48)(0) is an amendatory approximation of the DAG matrix, and others affects the edge weights only. We assume the errors can be eliminated with neural networks. Denote (cid:15)(*): (cid:15)(z) = z − h(z) ≈ (cid:15)(0) + z(I − h(cid:48)(0)) (37) and b = (cid:15)(0), C = I − h(cid:48)(0), then we have (cid:15)(z) = b + zC. ∂Q ∂μ[k] = ⇒ μ[k] = ωik( zi − μ[k] σ2 [k] i (cid:88) i z[i](I + CCT (s−1 μ[k]CCT − CbT s2 k k σ[k]I)2)−1 − (cid:80) − bCT (s−1 k σ[k]I)2 (cid:80) i ωik ) = 0 (38) Replace b, C back with (cid:15)(), CCT (s−1 ≈ ((cid:15)(s−1 k σ[k]I)2 = (s−1 k σ[k]I) − (cid:15)(0[d×d]))((cid:15)(s−1 k σ[k]IC)(s−1 k σ[k]IC)T k σ[k]I) − (cid:15)(0[d×d]))T (39) bCT (s−1 k σ[k]I)2 = s−2 k σ2 [k]bCT ≈ (cid:15)(s−2 k σ2 [k](cid:15)(0)) − (cid:15)(0) (40) Then we can get the approximated closed solution: μ[k] = (cid:80) i z[i](I + ((cid:15)(s−1 k σ[k]I) − (cid:15)(0[d×d]))((cid:15)(s−1 k σ[k]I) − (cid:15)(0[d×d]))T )−1 (cid:80) i ωik − (cid:15)(s−2 k σ2 [k](cid:15)(0)) + (cid:15)(0) (41) Both in the unsupervised meta-learning and meta-test, we assume (cid:15)(0) = 0 to reduce the complexity of calculation because the errors can be ignored iteratively if Efj(z) = 0. Then Eq 41 can be reduced as: μ[k] = (cid:80) i z[i](I + (cid:15)(s−1 k σ[k]I)(cid:15)T (s−1 i ωik k σ[k]I))−1 (42) D Implementation details (cid:80) D.1 High level of CMVAE We show high level of CMVAE as Figure 7. CMVAE projects the latent codes (left) into the Causal space (right) and performs causal-EM algorithm to get the causal multi- modal prior. During training, the common latent space grad- ually turns into the causal latent space. The Algorithm 2 shows the meta-test stage. D.2 Omniglot Following Meta-GMVAE (Lee et al. 2021), we train all mod- els for 60,000 iterations using Adam (Kingma and Ba 2015) (a) (b) (c) (d) Figure 10: (a)(b) Toy samples generated by "A bird is flying in the sky". (c)(d) Toy samples generated by "A bird is standing on the ground". Table 12: Results with 95% confidence interval on the miniImageNet and CelebA. Method AT Linear Nonlinear Vanilla-EM Causal-EM miniImageNet CelebA Baseline Ours (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) 42.81 ± 0.70 42.68 ± 0.72 43.48 ± 0.74 44.27 ± 0.76 58.05 ± 0.90 51.28 ± 0.91 60.03 ± 0.95 61.04 ± 0.94 (cid:88) with learning rate 1e-3. For the 5-way experiments (i.e., K = 5), we set the mini-batch size, the number of datapoints, and Monte Carlo sample size as 4, 200, and 32, respectively. For the 20-way experiments (i.e., K = 20), we set them as 4, 300, and 32. We set the number of causal EM iterations as 10. Network architecture. The set-level variational posterior network qφ(z|x, Tt) and generative Network pθ(x|z, e) are summarized as Table 5, 6, respectively. 95% Confidence interval. We provide the standard er- rors of our model's performance at 95% confidence interval over 1000 episodes on the Omniglot dataset in Table 10. D.3 miniImageNet and CelebA Since the high-level features for miniImageNet and CelebA are extracted by SimCLR, the settings are also same. We train all models using Adam (Kingma and Ba 2015) with learning rate 1e-4. For the 5/20-way experiments (i.e., K = 5 or 20), we set the mini-batch size, the number of datapoints, and Monte Carlo sample size as 16, 5, and 256, respectively. We set the number of causal EM iterations as 10. Network architecture. The SimCLR, set-level varia- tional posterior network qφ(z|x, Tt) and generative Network pθ(x|z, e) are summarized as Table 8, 7, 9, respectively. 95% Confidence interval. We provide the standard er- rors of our model's performance at 95% confidence interval over 1000 episodes on the miniImageNet and CelebA dataset in Table 11. E Additional Study DAG and Counterfactual Samples. we show the full that DAG in Figure 8. From Figure 8, we discover Table 13: Results with 95% confidence interval on the biased toy examples. Method 2-way 5-shot Meta-GMVAE 78.51 ± 0.36 93.08 ± 0.32 Ours z1, z11, z33, z34, z39, z44, z59 are the causes. More counter- factual samples are shown in Figure 9. In the top row, the in- tervened value is 0. In the bottom row, the intervened value is 1. Results of Each Component. Table 12 reports the results of the ablation study on each component on 5-way 1-shot classification on miniImageNet and CelebA. 'Baseline' de- notes that we do not consider the causality and do not ap- ply the adjusting term. 'AT' denotes that we apply the ad- justing term. 'Linear' denotes that we assume the causal- ity relationship between context priors is linear. 'Nonlinear' denotes that we assume the causality relationship between context priors is nonlinear. 'Vanilla-EM' denotes that we calculate the modalities with traditional EM. 'Causal-EM' denotes that we calculate the modalities with causal-EM. We observe that: (1) It is in line with common sense that the cause-to-effect is not a simple linear but a complex non- linear relationship in the natural images. (2) With nonlinear assumptions, the adjusting term address the context bias. (3) Causal-EM is the solution for maximum causal posterior and can remove the context bias better. E.1 Toy Examples In this section, we perform two types of toy examples. Intuitively-labeled Toy Example. This toy example is to (a) (b) (c) (d) Figure 11: (a) A toy sample generated by "A bird in the sky". (b) A toy sample generated by "A bird is on the ground" (c) A toy sample generated by "A plane in the sky". (d) A toy sample generated by "A plane is on the ground" For probabilistic graphical models (PGMs), STMT (Gan- gloff et al. 2021) enriches the dependencies between the ran- dom variables to better take into account the spatial context of an image in an unsupervised manner. To apply DRC and STMT in unsupervised meta-learning, we train them in the unlabeled train set to remove the background and extract the foreground and then use standard Meta-GMVAE to perform classification. The results of 5-way 1-shot classification are as shown in Table 14. Our method performs best. The rea- son may be (1) DRC and STMT do not consider the depen- dence among priors. (2) Meta-GMVAE highly depends on the qualities of DRC and STMT. Table 14: Results with 95% confidence interval on the miniImageNet and CelebA. Method miniImageNet CelebA DRC STMT Ours 43.14 ± 0.73 41.97 ± 0.65 44.27 ± 0.76 59.67 ± 0.91 58.92 ± 0.90 61.04 ± 0.94 further show the learned DAG with an unsupervised manner is meaningful. We build a synthetic bird image dataset. Each image contains 3 concepts (wing, flying, sky). Intuitively, the relationship-label Ag is "wing ← flying → sky". Figure 10 shows some samples. Specially, 1K images with 84 × 84 size are generated by the Composable Diffusion Models (Liu et al. 2022a) with the text input "A bird is flying in the sky" and "A bird is standing on the ground". During unsupervised training, we set the dimension to 3 and the number of clus- ters to 1. During test, we calculate the relationship A from the learned DAG, and compute the Structural Hamming dis- tance (SHD). We ran 100 random experiments. For the total 2 edges, the average of SHD is 0.7 in the linear DAG setting, and 0.4 with the nonlinear DAG setting, respectively. (lower is better). Biased Toy Example. Here we provide a 2-way biased toy example. We build a synthetic image dataset with two class "bird" and "plane". Specially, 2k images (1K for train- ing and 1K for test) are generated by the Composable Diffu- sion Models (Liu et al. 2022a) with the text input "A bird in the sky", "A bird is on the ground", "A plane in the sky" and "A plane is on the ground". Figure 11 shows some samples. As Figure 1 shows, in the tasks, the support sets are biased and the query sets are drawn uniformly at random. During test, the number of clusters is set to 2 and the number of query data is 15. The results are as shown in Table 13. We can observe that our can alleviate the bias with about 15% improvement. E.2 Compared with Other Methods For background removal approaches, DRC (Yu et al. 2021) is probabilistic foreground-background modeling by recon- ciling energy-based prior in a fully unsupervised manner.
http://arxiv.org/abs/2302.09726v1
2023-02-20T02:37:26
2023-02-20T02:37:26
Nystrom Method for Accurate and Scalable Implicit Differentiation
The essential difficulty of gradient-based bilevel optimization using implicit differentiation is to estimate the inverse Hessian vector product with respect to neural network parameters. This paper proposes to tackle this problem by the Nystrom method and the Woodbury matrix identity, exploiting the low-rankness of the Hessian. Compared to existing methods using iterative approximation, such as conjugate gradient and the Neumann series approximation, the proposed method avoids numerical instability and can be efficiently computed in matrix operations without iterations. As a result, the proposed method works stably in various tasks and is faster than iterative approximations. Throughout experiments including large-scale hyperparameter optimization and meta learning, we demonstrate that the Nystrom method consistently achieves comparable or even superior performance to other approaches. The source code is available from https://github.com/moskomule/hypergrad.
[ "Ryuichiro Hataya", "Makoto Yamada" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09726v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09726v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Nystr ̈om Method for Accurate and Scalable Implicit Differentiation 3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 6 2 7 9 0 . 2 0 3 2 : v i X r a 1RIKEN ADSP 2RIKEN AIP 3OIST 4Kyoto University Ryuichiro Hataya1,2 Makoto Yamada2,3,4 Abstract The essential difficulty of gradient-based bilevel optimization using implicit differentiation is to estimate the inverse Hessian vector product with This to neural network parameters. respect paper proposes to tackle this problem by the Nystr ̈om method and the Woodbury matrix iden- tity, exploiting the low-rankness of the Hes- sian. Compared to existing methods using it- erative approximation, such as conjugate gra- dient and the Neumann series approximation, the proposed method avoids numerical insta- bility and can be efficiently computed in ma- trix operations without iterations. As a result, the proposed method works stably in various tasks and is faster than iterative approximations. Throughout experiments including large-scale hyperparameter optimization and meta learning, we demonstrate that the Nystr ̈om method con- sistently achieves comparable or even superior performance to other approaches. The source code is available from https://github. com/moskomule/hypergrad. 1 Introduction Bilevel optimization is an essential problem in machine learning, which includes hyperparameter optimization (HPO) (Hutter et al., 2019) and meta learning (Hospedales et al., 2021). This problem consists of an inner problem to minimize an inner objective f (θ, φ, T ) on data T with respect to parameters θ ∈ Rp and an outer problem to min- imize an outer objective g(θ, φ, V) on data V with respect to hyper or meta parameters φ ∈ Rh. In the case of HPO, f and g correspond to a training loss function and a validation criterion. In contrast, in the case of meta learning, f and g correspond to meta-training and meta-testing objectives. Proceedings of the 26th International Conference on Artificial Intelligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR: Volume 206. Copyright 2023 by the author(s). Typically in the deep learning literature, the bilevel opti- mization problem can be formulated as min φ g(θT (φ), φ, V) (1) s.t. θt(φ) = Θ(θt−1(φ), ∇θf (θt−1(φ), φ, T ), φ), (2) where Θ is a gradient-based optimizer, such as SGD and Adam (Kingma and Ba, 2015), and t = 1, 2, . . . , T . In some cases, the outer problem (1) can also be optimized by gradient-based optimization methods by using hypergra- dient ∇φg, in a similar way to the inner problem, which is expected to be more efficient and scalable than black- box counterparts. Especially when combined with warm- start bilevel optimization that alternately updates outer pa- rameters as Equation (1) and inner parameters as Equa- tion (2) during training (Jaderberg et al., 2017; Vicol et al., 2022), the gradient-based approaches enjoy higher effi- ciency (Lorraine et al., 2020; Luketina et al., 2016). A straightforward approach to achieve this goal is to unroll the inner problem to back-propagate through Equation (2) for hypergradient (Domke, 2012; Finn et al., 2017; Grefen- stette et al., 2019). However, unrolling increases the mem- ory cost as the number of inner optimization T increases, which may also cause gradient vanishing/explosion (Anto- niou et al., 2019). Truncating the backward steps (Shaban et al., 2019) may unburden these issues while sacrificing the quality of hypergradients. Alternatively, approximating hypergradient using implicit differentiation is promising because it requires much less space complexity than the unrolling approach. Exact im- plicit differentiation needs computationally demanding in- verse Hessian vector product, which has been approxi- mated by iterative methods such as conjugate gradient (Pe- dregosa, 2016; Rajeswaran et al., 2019) and the Neumann series approximation (Lorraine et al., 2020). Thanks to their space efficiency, these methods can scale to large- scale problems (Hataya et al., 2022; M. Li et al., 2021; Lorraine et al., 2020; Zhang et al., 2021), but such itera- tive approximations cost time complexities. Furthermore, these methods need careful configuration tuning to avoid numerical instability caused by ill-conditioned Hessian or the norm of Hessian. In this paper, we propose to use the Nystr ̈om method to Nystr ̈om Method for Accurate and Scalable Implicit Differentiation leverage the low-rank nature of Hessian matrices of neu- ral networks and compute its inverse by the Woodbury ma- trix identity, inspired by recent works in quasi second-order optimization literature (D. Singh et al., 2021; S. P. Singh and Alistarh, 2020). Unlike the iterative approaches men- tioned above, this approximation excludes iterative evalu- ations and can be computed instantly in matrix operations. Additionally, the proposed method avoids numerical insta- bility. As a result, the Nystr ̈om method is robust to config- urations, and empirically compares favorably with existing approximation methods consistently on various tasks, from HPO to meta learning. In addition, by using the recurrence of the Woodbury matrix identity, this approach can control the tradeoff between time and space complexities without losing accuracy according to one's computational resource. In the remaining text, we introduce the proposed method in Section 2. After reviewing related work in Section 3, we analyze the approximation quality of the proposed method when Hessian is low-rank in Section 4. Then, Section 5 empirically demonstrates the effectiveness of the method from a synthetic logistic regression problem to a large-scale real-world data reweighting problem, and finally Section 6 concludes this work. 2 Method 2.1 Approximating Hypergradient by Implicit Differentiation In this paper, we focus on the methods to approximate hypergradients ∇φg by implicit differentiation so that the outer problem can also be efficiently optimized by gradient descent. Specifically, if ∇θf (θT , φ) ≈ 0, then according to the implicit function theorem, we obtain (cid:19)−1 ∂2f ∂φ∂θ dg(θT , φ) dφ (cid:18) ∂2f ∂θ2 ∂g ∂φ ∂g ∂θ = − (3) + , where, in the r.h.s., f = f (θT , φ) and g = g(θT , φ). Fol- lowing the prior works (Lorraine et al., 2020; Pedregosa, 2016; Rajeswaran et al., 2019), we assume that this approx- imation holds after T iterations of the inner optimization. We also assume that factors in the r.h.s. of Equation (3) are available, e.g., g is differentiable w.r.t. θ. In some cases, such as optimization of hyperparameters for regularization, ∇φg(θT , φ) is always zero. Still solving Equation (3) seems computationally in- tractable, as computing inverse Hessian (∇2 θf )−1 is com- putationally expensive, when the number of model param- eters p = dim θ is large. Though early works compute in- verse Hessian directly (Bengio, 2000; Larsen et al., 1996), especially for modern neural networks, just storing Hessian ∇2 θf is already infeasible in practice. To mitigate this issue, some approximations have been pro- posed. Pedregosa, 2016; Rajeswaran et al., 2019 used the conjugate gradient method (Hestenes and Stiefel, 1952), which iteratively solves a linear equation Ax = b to obtain x = A−1b, where, in this case, A = ∇2 θf and b = ∇θg. Lorraine et al., 2020 adopted the Neumann series approxi- mation, A−1 = α (cid:80)∞ i=1(I − αA)i, where A is an invert- ible matrix that satisfies (cid:107)αA(cid:107) ≤ 1 and α > 0 is a constant. As these algorithms may take arbitrarily long iterations for convergence, their truncated versions are preferred in prac- tice, which cut off the iterations at a predefined number of steps l. Importantly, these methods do not require keeping actual Hessian but accessing it as Hessian vector product (HVP), which modern automatic differentiation tools (Bradbury et al., 2018; Paszke et al., 2019) can efficiently compute in O(p) (Baydin et al., 2018). Because they consist of HVP and vector arithmetics, their time and space complexities are O(lp + h) and O(p + h) for the number of iterations l, where p = dim θ and h = dim φ. In the following discus- sion, we omit the complexity regarding h for simplicity. i.e., The downside of conjugate gradient and the Neumann se- ries approximation may be their numerical instability. Con- jugate gradient needs a well-conditioned matrix for fast convergence (Golub and Van Loan, 2013; Yousef Saad, it works sub-optimally with ill-conditioned 2003), Its longer iterations accumulate numerical er- Hessian. rors, and these errors typically need to be alleviated by pre- conditioning or reorthogonalization, which requires extra time and space complexities. The Neumann series needs the matrix norm to be less than 1, and thus α needs to be carefully configured. 2.2 Nystr ̈om Approximation Different from these previous methods using iterative com- putation, we instead propose to use a low-rank approx- imation for approximated inverse Hessian vector prod- uct (IHVP). Specifically, we propose to use the Nystr ̈om method to obtain IHVP by leveraging the low-rank nature of Hessian matrix (Ghorbani et al., 2019; Karakida et al., 2019; LeCun et al., 2012). We use the following k-rank approximation to the original p dimensional Hessian matrix, where we assume k (cid:28) p: Hk = H[:,K]H † [K,K]H (cid:62) [:,K], (4) where K is a randomly selected index set of size k, H[:,K] ∈ Rp×k is a matrix extracted columns of H corre- sponding to indices in K, and H[K,K] ∈ Rk×k is a matrix extracted rows of H[:,K] corresponding to indices in K. H † [K,K] = U Λ−1U (cid:62) denotes the pseudo inverse, where U and Λ are eigenvectors and engenvalues of H[K,K]. Then, we use the Woodbury matrix identity for matrices Ryuichiro Hataya & Makoto Yamada A, B, C such that (A + CBC(cid:62))−1 (5) =A−1 − A−1C(B−1 + C(cid:62)A−1C)−1C(cid:62)A−1 to obtain the inverse Hessian. Namely, we compute (Hk + ρIp)−1, where ρ > 0 is a small constant to improve numer- ical stability and Ip is the p-dimensional identity matrix, to approximate H −1 as follows: (ρIp + H[:,K]H † [K,K]H (cid:62) (cid:18) = Ip − 1 ρ 1 ρ2 H[:,K] [:,K])−1 1 ρ H[K,K] + H (cid:62) [:,K]H[:,K] (6) (cid:19)−1 H (cid:62) [:,K]. Although this left-hand side requires the inversion of a p×p matrix, the right-hand side only needs the inversion of a k × k matrix. Because k (cid:28) p, the computational burden of the l.h.s. is drastically reduced in the r.h.s. The use of Woodbury matrix identity as Equation (6) is similar to the idea of D. Singh et al., 2021, but our formulation is slightly efficient as it avoids unnecessary eigen decomposition. The small constant ρ in Equation (6) makes a low-rank ma- trix Hk invertible. Additionally, it can also be regarded as being stemmed from a proximally regularized inner ob- jective f (θ, φ) + f (θ, φ) (cid:107)θ − θ(cid:48)(cid:107), where θ(cid:48) ∈ argmin ρ 2 (Vicol et al., 2022). θ We visualize the inverse of a low-rank matrix and its ap- proximations in Figure 1. Nystr ̈om method can approxi- mate the true inverse efficiently and accurately. Because conjugate gradient cannot explicitly output inverse Hes- sian, we do not display its result here. To sum up, the proposed method approximates the hyper- gradient by using a low-rank Hessian Hk as dg(θT , φ) dφ ≈ − ∂g ∂θ (Hk + ρIp)−1 ∂2f ∂φ∂θ + ∂g ∂φ . (7) 2.3 Space-efficient Variant The Nystr ̈om approximation is free from iterative algo- rithms, but it needs to store k columns of the original Hes- sian matrix H[:,K] and compute the inverse of a k × k matrix. As a result, its time and space complexities are O(p + k3) and O(kp + k2), but k3 and k2 are ignorable because usually k (cid:28) p. Some readers may worry about memory explosion when k is relatively large. Actually, this Nystr ̈om approximation can be turned into an iterative algorithm that saves mem- ory. Recall that the low-rank matrix can be decomposed as follows Hk = H[:,K]H † [K,K]H (cid:62) [:,K] = (cid:88) i∈K 1 λi lil(cid:62) i , (8) Algorithm 1 Algorithm of the proposed method Require: κ: control parameter of computational cost K: randomly selected index set, where #K = k H[:,K]: a column matrix of H corresponding to K U , Λ: eigen decomposition of H[K,K] = U ΛU (cid:62) Partition K in to size κ subsets K ˆH = 1 ρ Ip for K (cid:48) in K do L ← (H[:,K]U )[:,K(cid:48)] J ← Λ[K(cid:48),K(cid:48)] ˆH ← ˆH − ˆHL(J + L(cid:62) ˆHL)−1L(cid:62) ˆH end for Return ˆH, equivalent to (Hk + ρIp)−1 where λi ∈ R is the ith value of Λ and li = (H[:,K]U )[:,i] ∈ Rp. Then, we can iteratively compute the inverse of Hk + ρIp by the Woodbury matrix identity (Equation (5)) as ˆHi+1 = ˆHi − where ˆH0 = ˆHi ˆHili ˆHilil(cid:62) i λi + l(cid:62) i 1 ρ Ip, , (9) ˆHk = (Hk + ρIp)−1, for i = 0, 1, . . . , k − 1. This variant needs O(k2p) time complexity and O(p) space complexity like iterative algo- rithms. S. P. Singh and Alistarh, 2020 proposed a dynami- cal algorithm for a similar problem to compute the inverse of the Fisher information matrix (FIM). 2.4 Controlling the Cost Tradeoff Furthermore, by chunking H[:,K] into thinner matrices of width κ ∈ (1, k) and applying the Woodbury matrix iden- tity iteratively as Algorithm 1, (Hk + ρIp)−1 can be ob- tained in a hybrid manner with less memory footprint, i.e., O(κp), than Equation (6) and faster, i.e., O({k/κ}2p), than Equation (9). In other words, our method allows users to dynamically control the necessary tradeoff between time and space complexities for given accuracy, which is a unique characteristic of our proposed method. See Table 1 for comparison with other methods. Notice that for any κ, the computational result is equiva- lent to each other up to machine precision. Thus, in the remaining paper, we use Equation (6), where κ = k, with- out otherwise specified. Nystr ̈om Method for Accurate and Scalable Implicit Differentiation Figure 1: Comparison of inverse of a 40 dimensional matrix A + ρI. A is a rank 20 symmetric matrix, and ρ is set to 0.1. Nystr ̈om method can approximate the true inverse accurately even in the rank 5 setting. Table 1: Comparison of time and space complexity. p denotes the number of model parameters. l is the number of iterations of the algorithms, k is the rank of low-rank Hessian. The Nystr ̈om method allows users to control the complexities by choosing κ ∈ {1, 2, . . . , k} . Approximation Time Complexity Space Complexity Conjugate gradient (Rajeswaran et al., 2019) Neumann series Nystr ̈om method (ours) O(lp) O(lp) O((k/κ)2p) O(p) O(p) O(κp) 2.5 Limitations The proposed method cannot straightforwardly optimize outer parameters φ that do not directly affect the training loss, inheriting the limitation of the methods to approxi- mate hypergradient by implicit differentiation (Lorraine et al., 2020). Such parameters include a learning rate of an optimizer of the inner problem, which needs to be care- fully tuned in deep learning research (Schmidt et al., 2021). We may need to rely on unrolling approaches for this prob- lem (Andrychowicz et al., 2016; Grefenstette et al., 2019; K. Li and Malik, 2017). Additionally, the method does not directly applicable to non-smooth problems as other gradient-based methods, part of which could be alleviated by smoothing the problem or using sub-gradients and sub- Hessians. 3 Related Work 3.1 Gradient-based Hyperparameter Optimization and Meta Learning The development of automatic differentiation (Baydin et al., 2018; Bradbury et al., 2018; Paszke et al., 2019) has encouraged the active research of gradient-based HPO and meta learning, where the outer problem of a bilevel prob- lem (Equation (1)) is also optimized by gradient descent using hypergradient (Franceschi, 2021; Franceschi, Fras- coni, et al., 2018). One way to compute hypergradients is to backpropagate through the unrolled inner optimization (Equation (2)) (Domke, 2012; Finn et al., 2017; Grefenstette et al., 2019). Except for the special cases, where a specific inner op- timization algorithm (Maclaurin et al., 2015) or forward- mode automatic differentiation (Franceschi, Donini, et al., 2017) can be used, this approach suffers from space com- plexity as the inner optimization step T increases. Another approach is to approximate hypergradient using the implicit differentiation as Equation (3) with less space complexity (Bengio, 2000; Lorraine et al., 2020; Pe- dregosa, 2016; Rajeswaran et al., 2019). Although Equa- tion (3) includes inverse Hessian, which is infeasible to compute for modern neural networks, truncated solutions of conjugate gradient (Pedregosa, 2016; Rajeswaran et al., 2019) and the Neumann series approximation (Lorraine et al., 2020) have been adopted to approximate this term effi- ciently. Other solvers for linear systems, such as GMRES (Youcef Saad and Schultz, 1986), can also be used (Blondel et al., 2021). Our work is in line with these works, but com- pared to these methods using generic techniques for matrix inverse, the proposed method exploits the low-rankness of Hessian of neural networks. 3.2 Inverse Hessian Approximation The application of inverse Hessian approximation is not limited to the computation of hypergradient. It has been a key element in estimation of influence function (Koh and Liang, 2017), backpropagation through long recurrence True Inverse (dim=40)Nyström (rank=5)Nyström (rank=10)Neumann (iteration=10) Ryuichiro Hataya & Makoto Yamada (Liao et al., 2018), and network pruning (Hassibi and Stork, 1992; S. P. Singh and Alistarh, 2020). The inverse of Hessian or an FIM is also indispensable in (quasi) second-order optimization (Martens, 2010) and nat- ural gradient descent (Amari, 1998). Thus, its estimation has been studied for a long time. For example, LBFGS em- ploys past gradients and updates (Liu and Nocedal, 1989), and KFAC adopts block-diagonal approximation of FIM (Martens and Grosse, 2015) for efficient approximation of large matrix inversion. The Hessians and FIMs of neural networks have low-rank structures, as most of their eigenvalues are nearly zero (Ghorbani et al., 2019; Karakida et al., 2019; LeCun et al., 2012). Exploiting this nature, inverse FIM (Frantar et al., 2021) or inverse Hessian (D. Singh et al., 2021) are com- puted using the Woodbury identity in the literature of quasi second-order optimization. Especially, the latter used the Nystr ̈om method. Although these approaches are techni- cally similar to ours, they are in a different context. chosen proportional to H 2 i,i, then, E[(cid:107)H − Hk(cid:107)op] ≤ (cid:107)H − ̄Hk(cid:107)op + (cid:15) p (cid:88) i=1 H 2 i,i. (11) Especially if H is a rank k matrix, then E[(cid:107)H − Hk(cid:107)op] ≤ (cid:15) p (cid:88) i=1 H 2 i,i (12) Because Hessian of a trained neural network can be re- garded as low rank (Ghorbani et al., 2019; Karakida et al., 2019; LeCun et al., 2012), we may expect that Equa- tion (12) holds. Equation (10) indicates that an approximated hypergradi- ent converges to the true hypergradient as Hk approaches to H. This differs from truncated iterative approximations, such as conjugate gradient, where their expected solutions never converge to the true one for a small number of itera- tions. 4 Theoretical Analysis 5 Experiments This section theoretically shows that the proposed approach can efficiently approximate the true hypergradient. In this section, we empirically demonstrate the effective- ness of the proposed method. Theorem 1 Suppose H is a positive semidefinite. Let h(cid:63) and h be hypergradients using the true inverse Hessian (H + ρIp)−1 (r.h.s. of Equation (3)) and the Nystr ̈om method (Hk + ρIp)−1 (r.h.s. of Equation (6)), and g = ∇θg(θT , φ), F = ∇φ∇θf (θT , φ). Then, the accuracy of approximated hypergradient is bounded (cid:107)h(cid:63) − h(cid:107)2 ≤ (cid:107)g(cid:107)2(cid:107)F (cid:107)op (cid:18) 1 ρ (cid:107)H − Hk(cid:107)op ρ + (cid:107)H − Hk(cid:107)op (cid:19) . (10) (cid:107)*(cid:107)2 and (cid:107)*(cid:107)op denote L2 norm and operator norm, respec- tively. This theorem is based on (Frangella et al., 2021). See the supplemental material for the derivation. When considering neural networks, because the training objective f is not convex w.r.t. θ, its Hessian H is not always positive semi-definite. However, Ghorbani et al., 2019 empirically demonstrated that most negative eigen- values disappeared even after a few iterations of training, indicating that we may assume that H + ρI for ρ > 0 is positive semi-definite in practice. Also importantly, (cid:107)H − Hk(cid:107)op is bounded. Remark 1 (Theorem 3 in Drineas and Mahoney, 2005) Let ̄Hk be the best k-rank approximation of H. If O(k/(cid:15)4) columns are selected for (cid:15) > 0 so that the ith column is Experimental Setups We implemented models and algorithms using PyTorch v1.12 (Paszke et al., 2019) and its accompanying functorch (He and Zou, 2021). The reference code is available from https://github.com/moskomule/ hypergrad. Experiments were conducted on a single NVIDIA A100 GPU with CUDA 11.3. The implemen- tations of conjugate gradient and the Neumann series ap- proximation algorithms were adopted from betty v0.1.1 (Choe et al., 2022). In the following experiments, the Nystr ̈om method was implemented according to Equation (6), that is, the time- efficient variant otherwise spcified. Using ReLU as an acti- vation function leads some columns of Hessian to zero vec- tors, and then the inversion in Equation (6) fails. To circum- vent this problem, we replaced ReLU with leaky ReLU: LR(x) = max(0, x) + 0.01 × min(0, x). 5.1 Optimizing Weight-decay of Linear Regression We first showcase the ability of the Nystr ̈om approximation by optimizing weight-decay parameters for each parameter of a linear regression model using synthetic data. For D dimensional data, inner parameters θ ∈ RD and outer pa- rameters φ ∈ RD are optimized. The inner problem is f (θ, φ) = (cid:96)(θ(cid:62)x, y) + θ(cid:62) diag(φ)θ, for an input x and its label y, where (cid:96) is binary cross entropy loss. Each input Nystr ̈om Method for Accurate and Scalable Implicit Differentiation x is sampled from a standard normal distribution, and its label is defined as y = w∗(cid:62)x + (cid:15) > 0, where w∗ ∈ RD is a constant vector and (cid:15) ∈ RD is a noise vector. This inner problem is optimized by SGD with a learning rate of 0.1, and the inner parameters are reset every 100 iteration. The outer problem is to minimize validation loss by SGD with a learning rate of 1.0 and a momentum of 0.9. The outer parameters φ, initialized to 1, are updated after every 100 inner parameter update. We set D = 100 and used 500 data points for both inner and outer optimization. Figure 2 (top) shows validation loss curves, comparing ap- proximated implicit differentiation methods, conjugate gra- dient, and the Neumann series approximation, with our pro- posed method. For the conjugate gradient method and the Neumann series approximation, we set the number of iter- ations l to 5, following Rajeswaran et al., 2019. Accord- ingly, we set the rank of the Nystr ̈om method to 5. As can be seen, the Nystr ̈om method can optimize the weight- decay parameters faster than other methods. Figure 2 (bot- tom) displays training loss curves. Because the inner pa- rameters are reset when the outer parameters are updated, training loss values at inner-parameter reset moments are high (around 0.7). As the outer optimization proceeds, the inner parameters, particularly those of the Nystr ̈om method, quickly decreases the training loss during each in- ner optimization period. For the experiments in Figure 2, the "learning rate" pa- rameter α of conjugate gradient and the Neumann series approximation was set to 0.01, and ρ of the Nystr ̈om method was set to 0.01. We compare other choices of α in {0.01, 0.1, 1.0} in Figure 3. Accordingly, we try other values of ρ in {0.01, 0.1, 1.0}. The results indicate that the Nystr ̈om method surpasses others in most cases and show robustness to the choice of ρ. We will revisit the robustness of the Nystr ̈om method later in Section 5.4. These exper- imental results were averaged over five runs of different random seeds. 5.2 Dataset Distillation Dataset distillation is a task to optimize a small synthesized training dataset Tφ = {φ1, φ2, . . . , φC} parametrerized by φ so that validation loss on real data is minimized (Wang et al., 2018). We used MNIST dataset (Le Cun et al., 1998) and a LeNet-like CNN, and followed the fixed-known ini- tialization setting that CNN weights, i.e., the inner param- eters, are reset every 100 model parameter update. As MNIST is a 10-class dataset, we set C = 50, so each class has 5 distilled images. Each φi ∈ Tφ has an equal size to an MNIST image. We used fixed learning rates for inner and outer optimization to simplify the problem. Namely, the inner problem is optimized by SGD with a learning rate of 0.01, while the outer problem is optimized with an Adam optimizer with a learning rate of 1.0 × 10−3. Figure 2: Optimization of weight decay parameters to each model parameter in logistic regression. The top figure shows the validation loss curve of the outer problem, and the bottom figure shows the training loss curves of the in- ner problem, optimized in 100 iterations. Table 2: Test accuracy of the dataset-distillation task on the MNIST dataset. The Nystr ̈om method shows better perfor- mance than others. Conjugate gradient Neumann series Nystr ̈om method 0.17 ± 0.04 0.47 ± 0.03 0.49 ± 0.04 The test accuracy after 5,000 outer parameter updates is reported in Table 2. These results were averaged over five runs. We set α = ρ = 0.01 and l = k = 10. The Nystr ̈om method yields comparable performance to the Neumann series approximation. However, despite our best efforts to select appropriate values of α ∈ {0.01, 0.1, 1.0} and l ∈ {5, 10, 20} based on the validation performance on a 10% split of training data, the conjugate gradient method failed to learn this task. This failure may be attributed to ill-conditioned Hessian. 5.3 Gradient-based Meta Learning MAML is a typical method of gradient-based meta learn- ing, where the inner problem learns to adapt to a given problem while the outer problem aims to find good param- eters that adapts quickly to new tasks (Finn et al., 2017). Among its variants, iMAML uses implicit differentiation to compute hypergradient, achieving better memory effi- ciency (Rajeswaran et al., 2019). Although the original iMAML adopts conjugate gradient to obtain IHVP, this 01020304050Updates of Outer Parameters0.300.350.400.450.500.550.60Validation LossConjugate GradientNeumann seriesNyström method010002000300040005000Updates of Inner Parameters0.30.40.50.60.7Training Loss Ryuichiro Hataya & Makoto Yamada idation loss on balanced validation data. The inner param- eters are not reset when the outer parameters are updated. We adopted long-tailed CIFAR-10 datasets (Cui et al., 2019), which simulate class imbalance at several degrees, WideResNet 28-10 (Zagoruyko and Komodakis, 2016) as νθ, which has approximately 3.6 × 107 parameters, and a two-layer MLP with a hidden dimension of 100 as μφ. The inner problem is optimized by SGD with a learning date of 0.1, momentum of 0.9, and weight decay of 5.0 × 10−4, and the outer problem is optimized with an Adam optimizer with a learning rate of 1.0 × 10−5 on 2% split of training data, following Shu et al., 2019. We set α = ρ = 0.01 and l = k = 10. Table 4 shows the averaged test accuracy over three runs after 1.5 × 104 inner updates and 1.5 × 103 outer updates. Again, the Nystr ̈om method consistently yielded matching or better performance to other methods and outperformed the baseline. Runtime Speed and Memory Consumption Table 5 compares speed and peak GPU memory con- sumption to compute hypergradients on the data reweight- ing task (averaged over 10 runs). Because WideResNet 28-10 caused out of memory when k = 20 with the time-efficient Nystr ̈om method, we instead used relatively smaller WideResNet 28-2, which has 1.5 × 106 parame- ters. The reported values were measured after 10 iterations of warmup. As shown in Table 1, the time complexity of iterative al- gorithms, conjugate gradient and the Neumann series, de- pends on l, whereas that of the Nystr ̈om method is in- dependent of k. As a result, the runtime speed of it- erative algorithms slowdowns as the approximation qual- ity l increases, while the deceleration of the time-efficient Nystr ̈om method is marginal. On the other hand, the space complexity of the iterative algorithms is constant of l, which is reflected in the results. In contrast, that of the time-efficient Nystr ̈om method relies on k, which can also be observed from the linear growth of the actual memory consumption. Table 5 also presents the results of the space-efficient vari- ant of the Nystr ̈om method, where κ = 1. Its memory con- sumption is constant, while the speed is almost quadratic to k, demonstrating the controllability of the tradeoff between speed and memory consumption as expected in Table 1. Figure 3: Validation loss curves of implicit differentiation methods with different configurations. Table 3: Test accuracy of the meta learning task on the Omniglot dataset. The Nystr ̈om method shows comparable performance to conjugate gradient. Task 1-shot 5-shot Conjugate gradient Neumann series Nystr ̈om method 0.96 ± 0.00 0.91 ± 0.00 0.95 ± 0.00 0.98 ± 0.00 0.97 ± 0.00 0.98 ± 0.00 choice can be replaced with the Neumann series approxi- mation and the Nystr ̈om method. We compared such backends using few-shot image classi- fication, where models are learned to classify images only from few examples (Fei-Fei et al., 2006; B. Lake et al., 2011; Ravi and Larochelle, 2017), on the Omniglot dataset (B. M. Lake et al., 2015) with a VGG-like CNN, follow- ing (Antoniou et al., 2019; Rajeswaran et al., 2019). We set k = l = 10, α = ρ = 0.01. The inner problem is to optimize model parameters by SGD with a learning rate of 0.1 in 10 steps, and the outer problem is to update the initial model parameters by Adam with a learning rate of 1.0 × 10−3. Table 3 shows the averaged accuracy on the test tasks over three runs after training on 1.6 × 106 tasks. As can be seen, the Nystr ̈om method achieved comparable results with iMAML using conjugate gradient both in the 1-shot and 5-shot settings. 5.4 Data Reweighting Data reweighting is a task to learn to weight a loss value to each example, which aims to alleviate the effect of class imbalance and label noise (M. Li et al., 2021; Shu et al., 2019). Its inner problem can be formulated as f (θ, φ) = (cid:96)(νθ(x), y) * μφ((cid:96)(νθ(x), y)), where (cid:96) is cross-entropy loss, νθ is a model, and μφ is a neural network to weight samples. The outer problem is to update φ to minimize val- Robustness of the Nystr ̈om method The Nystr ̈om method has two parameters ρ for numerical stability and k for the matrix rank. Table 6 shows the ef- fect of these configurations on the data reweighting task using WideResNet 28-2 on the long-tailed CIFAR-10 of the imbalanced factor of 50 over ρ ∈ {0.01, 0.1, 1.0} and 01020304050Updates of Outer Parameters0.200.250.300.350.400.450.500.550.60Validation Loss==0.01==0.1==1Conjugate GradientNeumann seriesNyström method Nystr ̈om Method for Accurate and Scalable Implicit Differentiation Table 4: Test accuracy of the data reweighting task on the long-tailed CIFAR-10 datasets. Baseline indicates training without outer optimization. The Nystr ̈om method achieves consistently favorable results. Imbalanced factor 200 100 50 Baseline Conjugate gradient Neumann series Nystr ̈om method 0.62 ± 0.06 0.63 ± 0.06 0.60 ± 0.09 0.66 ± 0.02 0.67 ± 0.13 0.70 ± 0.05 0.73 ± 0.01 0.73 ± 0.02 0.74 ± 0.08 0.78 ± 0.02 0.79 ± 0.01 0.79 ± 0.01 Table 5: Average runtime speed and peak memory consumption for hypergradient computation in data reweighting task over 10 runs. Speed (s) Peak GPU Memory Consumption (GB) Conjugate gradient (Pedregosa, 2016) Neumann series (Lorraine et al., 2020) Nystr ̈om method (ours) (time efficient) Nystr ̈om method (ours) (space efficient) l = 5 l = 10 l = 20 l = 5 l = 10 l = 20 k = 5 k = 10 k = 20 k = 5 k = 10 k = 20 0.44 0.83 1.68 0.40 0.75 1.48 0.24 0.33 0.54 3.11 10.7 41.0 2.46 2.46 2.46 2.39 2.39 2.39 4.66 8.15 15.1 1.94 1.94 1.94 k ∈ {5, 10, 20}. The results differ only marginally, i.e., the proposed method is robust to the choice of configurations, which is a favorable property in practical applications. Fig- ure 4 compares the validation curves in weight-decay opti- mization of logistic regression using the Nystr ̈om method with different k. Again, the differences of curves among configurations are marginal, emphasizing the robustness of the Nystr ̈om method. These results suggest that k = 5 may be sufficient for prac- tically sized problems, which is faster than other methods, while consuming only twice memory (Table 5). Also no- tice that, throughout various experiments including HPO and meta learning, the proposed method successfully and consistently works, different from other methods that failed at some tasks. This indicates that the Nystr ̈om method may also be robust to the types of problems. These prop- erties are appealing for practical use cases, that is, the Nystr ̈om method may need minimum efforts for "hyper- hyperparameter optimization." 6 Conclusion and Discussion This paper introduced an approximated implicit differen- tiation method for gradient-based bilevel optimization us- ing the Nystr ̈om method. The key idea was to exploit the low-rank property of Hessian of neural networks by the Table 6: The effect of ρ and k of the Nystr ̈om method on the data reweighting task. Test accuracy is reported. The baseline without outer optimization yields test accuracy of 0.75 ± 0.03. These results indicate the robustness of the proposed method to configurations. ρ 0.1 0.01 1.0 k 5 10 20 0.79 ± 0.01 0.79 ± 0.01 0.78 ± 0.02 0.78 ± 0.01 0.78 ± 0.01 0.78 ± 0.01 0.79 ± 0.01 0.78 ± 0.01 0.79 ± 0.01 Nystr ̈om method and use the Woodbury matrix identity for fast and accurate computation of inverse Hessian vector product in hypergradient. The proposed method scaled to large-scale problems and was applicable to hyperparame- ter optimization and meta learning. Empirically, the ap- proach was robust to configurations and about two times faster than iterative approximation methods. Although hyperparameter optimization is crucial in ma- chine learning, especially in deep learning, traditional hy- perparameter optimization is costly and emits a substantial amount of CO2 (Strubell et al., 2020). Contrarily, gradient- based hyperparameter optimization is efficient and may help alleviate this issue. Since the proposed method is fast, Ryuichiro Hataya & Makoto Yamada Version 0.2.5. URL: http : / / github . com / google/jax. Choe, Sang Keun, Willie Neiswanger, Pengtao Xie, and Eric Xing (2022). "Betty: An Automatic Differentiation Library for Multilevel Optimization". In: arXiv. Cui, Yin, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie (2019). "Class-balanced loss based on effective number of samples". In: CVPR. Domke, Justin (2012). "Generic methods for optimization- based modeling". In: JMLR 22, pp. 318–326. Drineas, Petros and Michael W. Mahoney (2005). "On the Nystrom Method for Approximating a Gram Matrix for Improved Kernel-Based Learning". In: Journal of Ma- chine Learning Research 6.72, pp. 2153–2175. Fei-Fei, Li, Robert Fergus, and Pietro Perona (2006). "One- shot learning of object categories". In: TPAMI 28.4, pp. 594–611. Finn, Chelsea, Pieter Abbeel, and Sergey Levine (2017). "Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks". In: ICML. Franceschi, Luca (2021). "A Unified Framework for Gradient-based Hyperparameter Optimization and Meta- learning". PhD thesis. UCL (University College Lon- don). Franceschi, Luca, Michele Donini, Paolo Frasconi, and Massimiliano Pontil (2017). "Forward and Re- verse Gradient-Based Hyperparameter Optimization". In: ICML. Franceschi, Luca, Paolo Frasconi, Saverio Salzo, and Massimilano Pontil (2018). "Bilevel Programming for Hyperparameter Optimization and Meta-Learning". In: ICML. Frangella, Zachary, Joel A Tropp, and Madeleine Udell (2021). "Randomized Nystr ̈om Preconditioning". In: arXiv. Frantar, Elias, Eldar Kurtic, and Dan Alistarh (2021). "M- FAC: Efficient Matrix-Free Approximations of Second- Order Information". In: NeurIPS. Ghorbani, Behrooz, Shankar Krishnan, and Ying Xiao (2019). "An Investigation into Neural Net Optimization via Hessian Eigenvalue Density". In: ICML. Golub, Gene H and Charles F Van Loan (2013). Matrix computations. JHU press. Grefenstette, Edward, Brandon Amos, Denis Yarats, Phu Mon Htut, Artem Molchanov, Franziska Meier, Douwe Kiela, Kyunghyun Cho, and Soumith Chintala (2019). "Generalized Inner Loop Meta-Learning". In: arXiv. Hassibi, Babak and David Stork (1992). "Second order derivatives for network pruning: Optimal brain surgeon". In: NIPS. Hataya, Ryuichiro, Jan Zdenek, Kazuki Yoshizoe, and Hideki Nakayama (2022). "Meta Approach for Data Augmentation Optimization". In: WACV. Figure 4: The effect of k when ρ = 0.01 in weight-decay optimization of logistic regression. scalable, robust, and applicable to a wide range of tasks, it may provide a reliable way for researchers and practition- ers to introduce efficient bilevel optimization. Acknowledgments We thank anonymous reviewers for constructive comments to improve the manuscript. R.H. was supported by JST, ACT-X Grant Number JPMJAX210H, and M.Y. was sup- ported by MEXT KAKENHI Grant Number 20H04243. We used computational resources of "mdx: a platform for the data-driven future." References Amari, Shunichi (1998). "Natural Gradient Works Ef- ficiently in Learning". In: Neural Computation 10.2, pp. 251–276. Andrychowicz, Marcin, Misha Denil, Sergio G ́omez, Matthew W Hoffman, David Pfau, Tom Schaul, Brendan Shillingford, and Nando de Freitas (2016). "Learning to learn by gradient descent by gradient descent". In: NIPS. Antoniou, Antreas, Harrison Edwards, and Amos Storkey (2019). "How to train your MAML". In: ICLR. Baydin, Atilim Gunes, Barak A. Pearlmutter, Alexey An- dreyevich Radul, and Jeffrey Mark Siskind (2018). "Au- tomatic Differentiation in Machine Learning: a Survey". In: JMLR 18.153, pp. 1–43. Bengio, Yoshua (2000). "Gradient-based optimization of hyperparameters". In: Neural Computation 12.8, pp. 1889–1900. Blondel, Mathieu, Quentin Berthet, Marco Cuturi, Roy Frostig, Stephan Hoyer, Felipe Llinares-L ́opez, Fabian Pedregosa, and Jean-Philippe Vert (2021). "Efficient and Modular Implicit Differentiation". In: arXiv. Bradbury, James, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang (2018). JAX: com- posable transformations of Python+NumPy programs. 01020304050Updates of Outer Parameters0.300.350.400.450.500.550.60Validation Lossk=5k=10k=20 Nystr ̈om Method for Accurate and Scalable Implicit Differentiation He, Horace and Richard Zou (2021). functorch: JAX-like composable function transforms for PyTorch. https: //github.com/pytorch/functorch. Hestenes, Magnus R. and E. Stiefel (1952). "Methods of conjugate gradients for solving linear systems". In: Jour- nal of research of the National Bureau of Standards 49, pp. 409–435. Hospedales, Timothy, Antreas Antoniou, Paul Micaelli, and Amos Storkey (2021). "Meta-learning in neural net- works: A survey". In: TPAMI 44.9, pp. 5149–5169. Hutter, Frank, Lars Kotthoff, and Joaquin Vanschoren, eds. (2019). Automatic Machine Learning: Methods, Sys- tems, Challenges. Springer. Jaderberg, Max, Valentin Dalibard, Simon Osindero, Wo- jciech M. Czarnecki, Jeff Donahue, Ali Razavi, Oriol Vinyals, Tim Green, Iain Dunning, Karen Simonyan, Chrisantha Fernando, and Koray Kavukcuoglu (2017). "Population Based Training of Neural Networks". In: arXiv. Karakida, Ryo, Shotaro Akaho, and Shun-ichi Amari (2019). "NeurIPS". In: Advances in Neural Information Processing Systems. Kingma, Diederik P. and Jimmy Lei Ba (2015). "Adam: a Method for Stochastic Optimization". In: ICLR. Koh, Pang Wei and Percy Liang (2017). "Understand- ing Black-box Predictions via Influence Functions". In: ICML. Lake, Brenden, Ruslan Salakhutdinov, Jason Gross, and Joshua Tenenbaum (2011). "One shot learning of simple visual concepts". In: Proceedings of the annual meeting of the cognitive science society. Vol. 33. 33. Lake, Brenden M, Ruslan Salakhutdinov, and Joshua B Tenenbaum (2015). "Human-level concept learning through probabilistic program induction". In: Science 350.6266, pp. 1332–1338. Larsen, Jacob, Lars Kai Hansen, Claus Svarer, and Mat- tias Ohlsson (1996). "Design and regularization of neu- ral networks: the optimal use of a validation set". In: Neural Networks for Signal Processing VI. Proceedings of the 1996 IEEE Signal Processing Society Workshop. Le Cun, Yann, Leon Bottou, Yoshua Bengio, and Patrij Haffner (1998). "Gradient-based learning applied to doc- ument recognition". In: Proceedings of the IEEE 86.11, pp. 2278–2324. LeCun, Yann, L ́eon Bottou, Genevieve Orr, and Klaus- Robert M ̈uller (2012). "Efficient BackProp". In: Neural Networks: Tricks of the Trade: Second Edition. Springer Berlin Heidelberg, pp. 9–48. Li, Ke and Jitendra Malik (2017). "Learning to Optimize". In: ICLR. Li, Mingchen, Xuechen Zhang, Christos Thrampoulidis, Jiasi Chen, and Samet Oymak (2021). "AutoBalance: Optimized Loss Functions for Imbalanced Data". In: NeurIPS. Liao, Renjie, Yuwen Xiong, Ethan Fetaya, Lisa Zhang, Ki Jung Yoon, Xaq Pitkow, Raquel Urtasun, and Richard Zemel (2018). "Reviving and improving recurrent back- propagation". In: ICML. Liu, Dong C and Jorge Nocedal (1989). "On the limited memory BFGS method for large scale optimization". In: Mathematical programming 45.1, pp. 503–528. Lorraine, Jonathan, Paul Vicol, and David Duvenaud (2020). "Optimizing Millions of Hyperparameters by Implicit Differentiation". In: AISTATS. Luketina, Jelena, Mathias Berglund, Klaus Greff, and Tapani Raiko (2016). "Scalable Gradient-Based Tun- ing of Continuous Regularization Hyperparameters". In: ICML. Maclaurin, Dougal, David Duvenaud, and Ryan P. Adams (2015). "Gradient-based Hyperparameter Optimization through Reversible Learning". In: ICML. Martens, James (2010). "Deep learning via hessian-free op- timization." In: ICML. Martens, James and Roger Grosse (2015). "Optimizing Neural Networks with Kronecker-Factored Approximate Curvature". In: ICML. Paszke, Adam, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zem- ing Lin, Natalia Gimelshein, Luca Antiga, Alban Des- maison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala (2019). "PyTorch: An Imperative Style, High- Performance Deep Learning Library". In: NeurIPS. Pedregosa, Fabian (2016). "Hyperparameter optimization with approximate gradient". In: ICML. Rajeswaran, Aravind, Chelsea Finn, Sham Kakade, and Sergey Levine (2019). "Meta-Learning with Implicit Gradients". In: NeurIPS. Ravi, Sachin and Hugo Larochelle (2017). "Optimization as a Model for Few-Shot Learning". In: ICLR. Saad, Youcef and Martin H. Schultz (1986). "GMRES: A Generalized Minimal Residual Algorithm for Solving Nonsymmetric Linear Systems". In: SIAM Journal on Scientific and Statistical Computing 7.3, pp. 856–869. DOI: 10.1137/0907058. Saad, Yousef (2003). Iterative methods for sparse linear systems. SIAM. Schmidt, Robin M, Frank Schneider, and Philipp Hennig (2021). "Descending through a Crowded Valley - Bench- marking Deep Learning Optimizers". In: ICML. Shaban, Amirreza, Ching-An Cheng, Nathan Hatch, and Byron Boots (2019). "Truncated Back-propagation for Bilevel Optimization". In: AISTATS. Shu, Jun, Qi Xie, Lixuan Yi, Qian Zhao, Sanping Zhou, Zongben Xu, and Deyu Meng (2019). "Meta-Weight- Net: Learning an Explicit Mapping For Sample Weight- ing". In: NeurIPS. Ryuichiro Hataya & Makoto Yamada Singh, Dinesh, Hardik Tankaria, and Makoto Yamada (2021). "Nys-Newton: Nystr ̈om-Approximated Curva- ture for Stochastic Optimization". In: arXiv. Singh, Sidak Pal and Dan Alistarh (2020). "WoodFisher: Efficient Second-Order Approximation for Neural Net- work Compression". In: NeurIPS. Strubell, Emma, Ananya Ganesh, and Andrew McCallum (2020). "Energy and policy considerations for modern deep learning research". In: AAAI. Vicol, Paul, Jonathan P Lorraine, Fabian Pedregosa, David Duvenaud, and Roger B Grosse (2022). "On Implicit Bias in Overparameterized Bilevel Optimization". In: ICML. Wang, Tongzhou, Jun-Yan Zhu, Antonio Torralba, and Alexei A Efros (2018). "Dataset Distillation". In: arXiv. Zagoruyko, Sergey and Nikos Komodakis (2016). "Wide Residual Networks". In: BMVC. Zhang, Miao, Steven W. Su, Shirui Pan, Xiaojun Chang, Ehsan M Abbasnejad, and Reza Haffari (2021). "iDARTS: Differentiable Architecture Search with Stochastic Implicit Gradients". In: ICML. Nystr ̈om Method for Accurate and Scalable Implicit Differentiation Supplemental Material of "Nystr ̈om Method for Accurate and Scalable Implicit Differentiation" A Proof of Theorem 1 For positive semi-definite matrices H and Hk, we have (H + ρIp)−1 ∂2f ∂φ∂θ + ∂g(θT , φ) ∂φ (cid:18) − − ∂g(θT , φ) ∂θ (Hk + ρIp)−1 ∂2f ∂φ∂θ + ∂g(θT , φ) ∂φ (cid:19)(cid:13) (cid:13) (cid:13) (cid:13)2 (cid:107)h∗ − h(cid:107)2 ≤ = ≤ ≤ ≤ (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) − − ∂g(θT , φ) ∂θ ∂g(θT , φ) ∂θ ∂g(θT , φ) ∂θ ∂g(θT , φ) ∂θ ∂g(θT , φ) ∂θ (cid:13) (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13) (cid:13) (cid:13)2 (cid:8)(H + ρIp)−1 − (Hk + ρIp)−1(cid:9) ∂2f ∂φ∂θ (cid:13) ∂2f (cid:13) {(H + ρIp)−1 − (Hk + ρIp)−1} (cid:13) ∂φ∂θ (cid:13) (cid:13) ∂2f (cid:13) (cid:13) ∂φ∂θ (cid:13) (cid:13)(H + ρIp)−1 − (Hk + ρIp)−1(cid:13) (cid:13) (cid:13)op (cid:13) (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13) (cid:13) (cid:13)op (cid:13) (cid:13) (cid:13) (cid:13)op (cid:13) (cid:13) (cid:13) (cid:13) ∂2f ∂φ∂θ (cid:13) (cid:13) (cid:13) (cid:13)op (cid:18) 1 ρ (cid:107)E(cid:107)op (cid:107)E(cid:107)op + ρ (cid:19) , where E = H − Hk. In the final step, we used proposition 3.1 of Frangella et al. (2021).
http://arxiv.org/abs/2302.09712v2
2023-05-26T18:07:07
2023-02-20T01:30:27
Depth Degeneracy in Neural Networks: Vanishing Angles in Fully Connected ReLU Networks on Initialization
Despite remarkable performance on a variety of tasks, many properties of deep neural networks are not yet theoretically understood. One such mystery is the depth degeneracy phenomenon: the deeper you make your network, the closer your network is to a constant function on initialization. In this paper, we examine the evolution of the angle between two inputs to a ReLU neural network as a function of the number of layers. By using combinatorial expansions, we find precise formulas for how fast this angle goes to zero as depth increases. These formulas capture microscopic fluctuations that are not visible in the popular framework of infinite width limits, and leads to qualitatively different predictions. We validate our theoretical results with Monte Carlo experiments and show that our results accurately approximate finite network behaviour. The formulas are given in terms of the mixed moments of correlated Gaussians passed through the ReLU function. We also find a surprising combinatorial connection between these mixed moments and the Bessel numbers that allows us to explicitly evaluate these moments.
[ "Cameron Jakub", "Mihai Nica" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09712v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09712v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG", "math.PR" ]
3 2 0 2 y a M 6 2 ] L M . t a t s [ 2 v 2 1 7 9 0 . 2 0 3 2 : v i X r a Depth Degeneracy in Neural Networks: Vanishing Angles in Fully Connected ReLU Networks on Initialization Cameron Jakub Department of Mathematics & Statistics University of Guelph Mihai Nica Department of Mathematics & Statistics University of Guelph [email protected] [email protected] Abstract Despite remarkable performance on a variety of tasks, many properties of deep neural networks are not yet theoretically understood. One such mystery is the depth degeneracy phenomenon: the deeper you make your network, the closer your network is to a constant function on initialization. In this paper, we examine the evolution of the angle between two inputs to a ReLU neural network as a function of the number of layers. By using combinatorial expansions, we find precise formulas for how fast this angle goes to zero as depth increases. These formulas capture microscopic fluctuations that are not visible in the popular framework of infinite width limits, and leads to qualitatively different predictions. We validate our theoretical results with Monte Carlo experiments and show that our results accurately approximate finite network behaviour. The formulas are given in terms of the mixed moments of correlated Gaussians passed through the ReLU function. We also find a surprising combinatorial connection between these mixed moments and the Bessel numbers that allows us to explicitly evaluate these moments. Keywords: deep learning theory, infinite limits of neural networks, network initialization, Markov chains, combinatorics 1. Introduction The idea of stacking many layers to make truly deep neural networks (DNNs) is what arguably led to the neural net revolution in the 2010s. Indeed, from a function-space point of view, it is known that depth exponentially improves expressibility (Poole et al., 2016; Eldan and Shamir, 2015). However, an important but less well known fact is that under standard initialization schemes, deep neural networks become more and more degenerate as depth gets larger and larger. One sense in which this happens is the phenomenon of vanishing and exploding gradients (Hanin, 2018). Another sense in which networks become degenerate is that a neural network gets closer and closer to a (random) constant function, i.e. the network sends all inputs to the same output and cannot distinguish input points. This phenomenon seems to have been discovered and analyzed from different points of view by several authors (Avelin and Karlsson, 2022; Dherin et al., 2022; Li et al., 2022; Hayou et al., 2019; Schoenholz et al., 2017; Nachum et al., 2022; Buchanan et al., 2021). Nachum et al. (2022) found for convolutional neural networks, the level of degeneracy was dependent on the type of input fed into the network. ©2023 Cameron Jakub and Mihai Nica. License: CC-BY 4.0, see https://creativecommons.org/licenses/by/4.0/. Attribution requirements are provided at http://jmlr.org/papers/v24/21-0000.html. Jakub and Nica One method already proposed to deal with the degeneracy phenomenon is the idea of activation function shaping (Martens et al., 2021). In particular, Li et al. (2022), showed that rescaling the non-linear activation function (i.e. using Leaky ReLUs with leakiness depending on network depth) can lead to a non-trivial angle between inputs. However, a detailed analysis of the evolution of the angle θ without any scaling (e.g. using an ordinary ReLU in all layers) remained an outstanding problem. This is the gap we fill in this article. 1.1 Main Results for the Angle Process θl In this paper, we examine the evolution of the angle θl between two arbitrary inputs xα, xβ ∈ Rnin after passing through l layers of a fully connected ReLU network (a.k.a. a multi-layer perceptron) on initialization. The angle is defined in the usual way by the inner product between two vectors in Rnl. (cid:16) θl(cid:17) := cos ⟨F l(xα), F l(xβ)⟩ ∥F l(xα)∥∥F l(xβ)∥ , where nl is the width (i.e. number of neurons) of the l-th layer and F l : Rnin → Rnl is the (random) neural network function mapping input to the post-activation logits in layer l on initialization. We assume here that the initialization is done with appropriately scaled independent Gaussian weights so that the network is on the "edge of chaos" (Hayou et al., 2019; Schoenholz et al., 2017), where the variance of each layer is order one as layer width increases. See Table 2 for our precise definition of the fully connected ReLU neural network. With this setup, since the effect of each layer is independent of everything previous, θl can be thought of as a Markov chain evolving as layer number l increases. As expected by the aforementioned "large depth degeneracy" phenomenon, we observe that the angle concentrates θl → 0 as l → ∞ (see Figure 1 for an illustration). This indicates that the hidden layer representation of any two inputs in a deep neural network becomes closer and closer to co-linear as depth increases. In this paper, we obtain a simple, yet remarkably accurate, approximation for the evo- lution of θl as a function of l that captures precisely how quickly this degeneracy happens for small angles θl and large layer widths nl. Approximation 1 For small angles θl ≪ 1 and large layer width nl ≫ 1, the angle θl+1 at layer l + 1 is well approximated by ln sin2(θl+1) ≈ ln sin2(θl) − 2 3π θl − ρ(nl), where ρ(nl) is a constant which depends on the width nl of layer l, namely: ρ(n) := ln (cid:19) (cid:18) n + 5 n − 1 − 10n (n + 5)2 + 6n (n − 1)2 = 2 n + O (cid:0)n−2(cid:1) . (1) (2) Figure 1 illustrates how well this prediction matches Monte Carlo simulations of θl sampled from real networks. Also illustrated is the infinite width prediction for θl (discussed in Appendix A.9) which is less accurate at predicting finite width network behaviour than our formula, due to the n−1 effects that our formula captures in the term ρ(nl) but are l 2 Depth Degeneracy in Neural Networks Figure 1: We feed 2 inputs with initial angle θ0 = 0.1 into 5000 Monte Carlo samples of independently initialized networks with network width nl = 256 for all layers. Left: Using the Monte Carlo samples, we plot the empirical mean and standard deviation of ln(sin2(θl)) at each layer. We compare this to both the infinite width update rule and our prediction using Approximation 1 for the mean of ln(sin2(θl)). Our prediction for the standard deviation in each layer using Approximation 2 is also plotted as the shaded area In contrast to our prediction, the infinite width rule predicts 0 variance in all layers. Right: We plot histograms of our simulations as well as our predicted probability density function using Approximation 2 from (10) at Layer 1 (top) and Layer 30 (bottom). The predicted and empirical distribution are statistically indistinguishable according to a Kolmogorov- Smirnov test, with p values 0.987 > 0.05 (top) and 0.186 > 0.05 (bottom). not present in the infinite width formula. Approximation 1 is a simple corollary to the mathematically rigorous statement, Theorem 1, for the mean and variance of the random variable ln sin2(θl). 1.1.1 Consequences and Comparison to Previous Work The simple Approximation 1 predicts that θl → 0 exponentially fast in l due to the term ρ(n); it predicts (cid:32) θl ≤ exp − l (cid:88) i=1 (cid:33) (cid:32) ρ(ni) = exp − (cid:33) + O(n−2 i ) . l (cid:88) i=1 2 ni (Note that the exponential behaviour vanishes when nl → ∞ with l fixed). In contrast to this prediction, an analysis using only expected values or equivalently working in the infinite- width n → ∞ limit predicts that θl → 0 like l−1, which is qualitatively very different! The prediction of this rate was first demonstrated under the name "edge of chaos" (Hayou et al., 2019; Schoenholz et al., 2017) and again in Roberts et al. (2022); Hanin (2023). These earlier works studied the correlation cos(θl) as a function of layer number, and showed showed that 3 Jakub and Nica 1 − cos(θl) → 0 like l−2, which is equivalent to θl → 0 like l−1 by Taylor series expansion cos(x) ≈ 1 2 x2 as x → 0. To unify the notation, we also present a derivation of the update rule for cos(θl) in the infinite width limit in our notation in Appendix A.9. We can also recover the infinite width prediction from our result by replacing ρ(n) with 0 in Approximation 1 in the update rule (1). Exponentiating both sides and using sin(θ) ≈ θ, eθ ≈ 1 + θ for θ ≪ 1, Approximation 1 becomes (θl+1)2 ≈ (cid:0)θl)2(1 − 2 3π θl(cid:1), which is equivalent to the result of Proposition C.1 of Hanin (2023) and is also a corollary of Lemma 1 of Hayou et al. (2019). In those papers, the rule was derived directly from the infinite width update rule for cos(θ), and those results are equivalent to the fact that θl ≈ 1 l as l → ∞. One of the main limitations of the infinite width predictions is that they predict zero In contrast to this, our methods allow us to also variance in the random variable θl. understand the variance of this random variable, as discussed below. 1.1.2 More detailed results for the mean and variance Approximation 1 comes from a simplification of more precise formulas for the mean and variance of the random variable ln(sin2(θl)), which are stated in Theorem 1 below. Theorem 1 (Formula for mean and variance in terms of J functions) Conditionally on the angle θl in layer l, the mean and variance of ln sin2(θl+1) obey the following limit as the layer width nl → ∞ E[ln sin2(θl+1)] =μ(θl, nl) + O(n−2 l ), Var[ln sin2(θl+1)] = σ2(θl, nl) + O(n−2 l ), (cid:32) μ(θ, n) := ln (n − 1)(1 − 4J 2 4J2,2 − 1 + n 1,1) (cid:33) + 4(J2,2 + 1) (cid:16) 4J2,2−1 (cid:17)2 4 (cid:0)8J 2 1,1J2,2 − 8J 4 − n + 1 n 1,1 − 8J1,1J3,1 + J2,2 + 1(cid:1) (cid:17)2 1 − 4J 2 1,1 1,1J2,2 − 8J 4 1,1 + 4J 2 1,1 + 4J 2 (cid:1)2 (cid:16) n (cid:0)1 − 1 n 8n(8J 2 , σ2(θ, n) := 8n(J2,2 + 1) (4J2,2 − 1 + n)2 + 1,1 − 8J1,1J3,1 + J2,2 + 1) (n − 1)2(1 − 4J 2 1,1)2 (5) (3) (4) − 16n(2J 2 (4J2,2 − 1 + n)(n − 1)(1 − 4J 2 1,1 − 4J1,1J3,1 + J2,2 + 1) 1,1) , where E, Var denote the conditional mean and variance of quantities in layer l + 1 given the value of θl in the previous layer and Ja,b := Ja,b(θl) are the joint moments of correlated Gaussians passed through the ReLU function φ(x) = max{x, 0}, namely Ja,b(θ) := EG, ˆG[φa(G)φb( ˆG)], (6) where G, ˆG are marginally N (0, 1) random variables with correlation E[G ˆG] = cos(θ). The joint moments Ja,b(θ) are discussed in detail in Section 3. A new combinatorial method of computing these moments is presented, which is used to give an explicit formula is given 4 Depth Degeneracy in Neural Networks for these joint-moments, which is presented in Theorem 4. Using the explicit formula for Ja,b, the result of Theorem 1 can be used to obtain useful asymptotic formulas for μ and σ, as in the following corollary. Corollary 2 (Small θ asymptotics for mean and variance) Conditionally on the an- gle θl in layer l, the mean and variance of ln sin2(θl+1) obey the following limit as the layer width nl → ∞ E[ln sin2(θl+1)] =μ(θl, nl) + O(n−2 μ(θ, n) = ln sin2 θ − 2 3π l ), Var[ln sin2(θl+1)] = σ2(θl, nl) + O(n−2 l ), θ2 + O(θ3), (cid:18) 2 θ − ρ(n) − − (cid:19) 9π2 − 68 45π2n 8θ 15πn σ2(θ, n) = 8 n − 64 15π θ n (cid:18) − 8 + 296 45π (cid:19) θ2 n + O (cid:0)θ3(cid:1) , where ρ(n) is as defined in (2). (7) (8) (9) To derive Approximation 1 from Theorem 1, we simply keep only the first few terms of the series expansion (8), and then also completely drop the variability, essentially approxi- mating σ2(θl, n) ≈ 0 (Note that in reality σ2(θ, n) ≈ 8/n from (9)). Therefore Approxima- tion 1 is a greatly simplified consequence of Theorem 1. Moreover, our derivation shows that ln sin2(θl) can be expressed in terms of averages over n pairs of independent Gaussian variables (see (14-16)). Thus, by central-limit-theorem type arguments, one would expect the following approximation by Gaussian laws which also accounts for the variability of ln sin2(θ) using our calculated value for the variance. (a) Mean as a function of θ (b) Variance as a function of θ Figure 2: Plots comparing the functions μ(θ, n) and σ2(θ, n) to simulated neural networks. The linear approximation of μ, used to create Approximation 1 is also displayed. Confidence bands are constructed by randomly initializing 10000 neural networks with layer width nl = 1024, and a range of 100 initial angles 0.005 ≤ θl ≤ 0.8. We study θl+1 and use the simulations to construct 99% confidence intervals for a) E (cid:2)ln(sin2(θl)) − ln(sin2(θl+1))(cid:3) and b) Var (cid:2)ln(sin2(θl+1))(cid:3). 5 Jakub and Nica Approximation 2 Conditional on the value of θl, the angle at layer l + 1 is well approx- imated by a Gaussian random variable ln sin2(θl+1) d ≈ N (μ(θl, nl), σ2(θl, nl)), (10) where μ, σ2 are as in Theorem 2. We find that the normal approximation (10) matches simulated finite neural networks remarkably well; see Monte Carlo simulations from real networks in Figure 1. The big advan- tage of this approximation is that it very accurately captures the variance of ln(sin2(θl)), not just its mean. This variance grows as l increases, so it is crucial for understanding behaviour of very deep networks. The methods we use to obtain these approximations are quite flexible. For example, more accurate approximations can be obtained by incorporating higher moments Ja,b(θ) (see Section 2 for a discussion). We also believe that it should be possible to extend these methods to other non-linearities beyond ReLU and more complicated neural network architectures through the same basic principles we introduce here. 1.2 J Functions and Infinite Width Limits In 2009, Cho and Saul (2009) introduced the p-th moment for correlated ReLU-Gaussians, which they denoted with the letter J, Jp(θ) := 2πE (cid:105) (cid:104) φp(G)φp( ˆG) , (11) where p ∈ N, φ(x) = max{x, 0} is the ReLU function, and G, ˆG ∈ R are marginally two standard N (0, 1) Gaussian random variables with correlation Cov(G, ˆG) = cos(θ). This quantity has found numerous applications for infinite width networks. One simple application of J1 appears in the infinite width approximation for cos(θl), where l is fixed and we take the limit n1, n2, . . . nl → ∞ (see Appendix A.9 for a detailed derivation): Approximation 3 The infinite-width approximation for the angle θl+1 given θl is (cid:16) θl+1(cid:17) = cos J1(θl) π = sin(θl) + (π − θl) cos(θl) π . (12) The formula for J1 is the p = 1 case of a remarkable explicit formula for Jp derived by Cho and Saul (2009) namely, Jp(θ) = (−1)p(sin θ)2p+1 (cid:18) 1 sin θ ∂ ∂θ (cid:19)p (cid:18) π − θ sin θ (cid:19) . This allows one to derive asymptotics of θl in the infinite width limit, as in Section 1.1.1. However, there are several limitations to this approach. Most important is that the infinite width limit is not a good approximation when the network depth l is comparable to the network width n (Li et al. (2022)). The infinite width limit uses the law of large numbers to obtain (12), thereby discarding random fluctuations. For very deep networks, microscopic fluctuations (on the order of O(1/nl)) from layer to layer can accumulate over l layers to 6 Depth Degeneracy in Neural Networks give macroscopic effects. This is why the infinite width predictions for θl are not a good match to the simulations in Figure 1; very deep networks are far from the infinite width limit in this case. See Figure 1 where the infinite width predictions are compared to finite networks. Instead, to analyze the evolution of the angle θl more accurately, we need to do some- thing more precise than the law of large numbers to capture the effect of these microscopic fluctuations. This is the approach we carry out in this paper. While the mean only de- pends on the p-th moment functions Jp from (11), these fluctuations depend on the mixed moments, which we denote by Ja,b for a, b ∈ N as follows1 Ja,b(θ) := E (cid:104) (cid:105) φa(G)φb( ˆG) , (13) with G, ˆG again as in (11) are marginally N (0, 1) with correlation cos(θ). In Section 2.1 we carry out a detailed asymptotic analysis to write the evolution of θl in terms of the mixed moments Ja,b. In order to make useful predictions, one must also calculate a formula for Ja,b(θ). Unfortunately, the method that Cho-Saul originally proposed for this does not seem to work when a ̸= b. This is because that method used contour integrals, and relied on using certain trig identities which do not hold when a ̸= b. Instead, in Section 3, we introduce a new method, based on Gaussian integration by parts, to compute Ja,b for general a, b via a recurrence relation. By serendipity2, we find a remarkable combinatorial connection between Ja,b and the Bessel numbers (Cheon et al. (2013)), which allows one to find an explicit (albeit complicated) formula for Ja,b in terms of binomial coefficients. The formula for the first few functions are shown in Table 1, and the general explicit formula is presented in Theorem 4. 1.3 Outline The two main contributions of this paper are to prove Theorem 1 for the evolution of θl in terms of the mixed moments Ja,b, and then separately derive an explicit formula, Theorem 4, for any of the mixed moments Ja,b. Combined, these allow for the explicit formula Corollary 2 and the useful simpler Approximations 1 and 2. See Figure 1 and Figure 2 for comparisons of these predictions to Monte-Carlo simulations. We also believe the methods proposed here are flexible enough to be modified to apply to non-linearities other than ReLU and to different neural network architectures beyond fully-connected networks in future work. Section 2 contains the analysis of the angle process and predicted distribution of ln(sin2(θl)) in deep ReLU networks. Section 2.1 covers our approximation of E[ln(sin2(θl+1))] which leads to the rule for θl as in equation (1), while Section 2.2 outlines our approximation for Var[ln(sin2(θl+1))]. 1. Note that compared to Cho and Saul's definition for Jp, we omit the factor of 2π in our definition of Ja,b. The factor of 2π seems natural when a + b is even (like the case a = b = p that Cho-Saul considered), but when a + b is odd a different factor of 2 2π appears! Therefore the factor of 2π would confuse things in the general case (see Table 1). The correct translation between Cho-Saul Jp and our Ja,b is Jp = 2πJp,p. 2. This connection was first noticed by calculating the first few J functions, and then using the On-Line Encyclopedia of Integer Sequence to discover the connection to Bessel number (https://oeis.org/ A001498). √ 7 Jakub and Nica b 0 a 1 2 3 0 1 2 3 π−θ cos θ+1 (π−θ)+sin θ cos θ 2(cos θ+1)+sin2 θ cos θ sin θ+(π−θ) cos θ (cos θ+1)2 3(π−θ) cos θ+sin θ cos2 θ+2 sin θ (π−θ)(2 cos2 θ+1)+3 sin θ cos θ 3 cos θ(cos θ+1)2+2(cos θ+1)+sin2 θ cos θ (π−θ)(6 cos2 θ+9) cos θ +5 sin θ cos2 θ+(6 cos2 θ+4) sin θ √ Table 1: Table of formulas for the first few J functions. The normalizing constant appearing in all entries, either c0 = 2π, c1 = 2 2π depending on the parity of a + b, has been omitted, i.e. the table shows the value of c(a+b mod 2)Ja,b(θ). (Note that when a = 0, the appropriate convention of 00 = 0 is needed, see (25) for details). These generalize Jp(θ) of (11) which appear on the diagonal of this table. Note that Ja,b = Jb,a so only upper triangular entries are shown. An explicit formula for all Ja,b is derived in Section 3.4. In Section 3, we cover the derivation of the explicit formula for the J functions. We state the main results of this section in Section 3.1, and cover the mathematical tools needed to solve the expectations using Gaussian integration by parts in Section 3.2. We develop the formula for Ja,b by first finding a recursive formula in Section 3.3, which reveals a connection between the J functions and the Bessel numbers. This recursion is studied to develop an explicit formula for Ja,b in Section 3.4. 2. ReLU Neural Networks on Initialization In this section, we analyze ReLU neural networks and show how the the mixed moments Ja,b appear in evolution of the angle θl on initialization. We define the notation we use for a fully connected ReLU neural network, along with other notations we will use in Table 2. Note that the factor of (cid:112)2/nl in our definition is implementing the so called He initialization (He et al., 2015), which ensures that E[∥zl∥2] = ∥x∥2 for all layers l. This initialization is known to be the "critical" initialization for taking large limits of the network (Roberts et al., 2022; Hayou et al., 2019). Given this neural network, we wish to study the evolution of 2 inputs xα and xβ as they traverse through the layers of the network. Specifically, we wish to study how the angle θ between the inputs changes as the inputs move from layer to layer. α , φl+1 The starting point for our calculation is to notice that because the weights are Gaussian, the values of φl+1 are jointly Gaussian given the vectors of φl β. In fact, it turns out that by properties of Gaussian random variables, one only needs to know the values of the scalars ∥φl (see Appendix A.5 for details) By using the positive homogeneity of the ReLU function φ(λx) = λφ(x) for λ > 0, we can factor out the effect of the norm of each vector in layer l. After β∥ and θl to understand the full distribution of φl+1 α , φl+1 α∥, ∥φl α, φl β β . 8 Depth Degeneracy in Neural Networks Symbol x ∈ Rnin l ∈ N nl ∈ N Definition Input (e.g. training example) in the input dimension nin ∈ N Layer number. l = 0 is the input Width of hidden layer l (i.e. number of neurons in layer l) W l ∈ Rnl+1×nl Weight matrix for layer l. Initialized with iid standard Gaussian entries φ : Rn → Rn Entrywise ReLU activation function φ(x)i = φ(xi) = max{xi, 0} zl(x) ∈ Rnl Pre-activation vector in the lth layer for input x (a.k.a logits of layer l) W l a,b ∼ N (0, 1) α, φl φl β ∈ Rnl θl ∈ [0, π] Rl+1 ∈ R z1(x) := W 1x, zl+1(x) := (cid:113) 2 nl W l+1φ(zl(x)). Post-activation vector on inputs xα, xβ respectively α := φ(zl(xα)), φl α and φl β := φ(zl(xβ)) φl β defined by cos(θl) := Angle between φl Shorthand for the ratio Rl+1 := α,φl β ⟩ α∥∥φl β ∥ ⟨φl ∥φl ∥2 α ∥2∥φl+1 ∥φl+1 β α∥2∥φl β ∥2 ∥φl Table 2: Definition and notation used for fully connected ReLU neural networks. some manipulations, these ideas lead us to the following identities that are the heart of our calculations; a full derivation of these quantities are provided in Appendix A.5 and A.6. ∥φl+1 α ∥2= ∥φl α∥2 nl nl(cid:88) i=1 2φ2(Gi), ∥φl+1 β ∥2= ⟨φl+1 α , φl+1 β ⟩ = α ∥2∥φl+1 ∥φl+1 β ∥2 α∥2∥φl β∥2 ∥φl sin2(θl+1) = 2 n2 l ∥φl β∥ α∥∥φl nl nl(cid:88) (cid:16) i,j=1 β∥2 ∥φl nl nl(cid:88) nl(cid:88) i=1 2φ2( ˆGi), 2φ(Gi)φ( ˆGi), i=1 φ(Gi)φ( ˆGj) − φ(Gj)φ( ˆGi) (cid:17)2 , (14) (15) (16) where Gi, ˆGi are all marginally N (0, 1), with correlation Cov(Gi, ˆGi) = cos(θl) and inde- pendent for different indices i. The identity in (16) is derived using the determinant of the Gram matrix for vectors φl+1 (full derivation given in Appendix A.6). Combining the equations in (14) gives us a useful identity for the ratio Rl+1, namely: α , φl+1 β Rl+1 = 4 n2 l nl(cid:88) i,j=1 φ2(Gi)φ2( ˆGj). (17) Given some θl, we wish to predict the behaviour of θl+1. Rather than studying θl+1 directly, we instead study the quantity ln(sin2(θl+1)). This allows us to use convenient 9 Jakub and Nica approximations and identities for quantities we are interested in. (And indeed, a post-hoc analysis shows that as θ → 0, the random variable ln sin2(θl+1) has a non-zero constant variance which depends only on nl. This is in contrast to θl itself which has variance tending to zero. This is one reason why the Gaussian approximation for ln sin2(θl) ∈ (−∞, ∞) works well, whereas Gaussian approximations for θl or cos(θl) ∈ [−1, 1] are less accurate.) We first derive a formula for E (cid:2)ln(sin2(θl+1))(cid:3). 2.1 Expected Value In this section, we show how to compute the expected value of ln(sin2(θl)) in terms of the J functions as in Theorem 1. Firstly, we rewrite this expectation as the difference (cid:104) (cid:105) ln(sin2(θl+1)) E (cid:16) (cid:104) ln = E Rl+1 sin2(θl+1) (cid:17)(cid:105) (cid:104) ln (cid:16) Rl+1(cid:17)(cid:105) . − E (18) The two random variables Rl+1 and Rl+1 sin2(θl+1) in (18) both have interpretations in terms of sums of Gaussians as in (16) and (17) which makes it possible to calculate their moments in terms of the J functions. To enable our use of the moments here, we use the following approximation of ln(X) for a random variable X, which is based on the Taylor expansion for ln(1 + x) = x − 1 2 x2 + . . . (a full derivation is given in Appendix A.1): ln(X) = ln(E[X]) + X − E[X] E[X] − (X − E[X])2 2E[X]2 + ε2 (cid:18) X − E[X] E[X] (cid:19) , (19) where ε2(x) is the Taylor remainder term in ln(1 + x) = x − x2 2 + ε2(x) and satisfies ε2(x) = O(x3). Applying this approximation to the terms appearing on the right hand side of (18), and taking expected value of both sides, we obtain the estimates (cid:16) (cid:104) ln E Rl+1 sin2(θl+1) (cid:17)(cid:105) (cid:104) (cid:16) E = ln Rl+1 sin2(θl+1) (cid:105)(cid:17) − Var (cid:2)Rl+1 sin2(θl+1)(cid:3) 2E (cid:2)Rl+1 sin2(θl+1)(cid:3)2 + O(n−2 l ), (cid:104) (cid:16) Rl+1(cid:17)(cid:105) ln E (cid:16) (cid:104) Rl+1(cid:105)(cid:17) E − = ln Var (cid:2)Rl+1(cid:3) 2E [Rl+1]2 + O(n−2 l ). To control the error here, we have used here the fact that Rl+1 and Rl+1 sin2(θl+1) can be written as averages over random variables as in (14 - 16). This allows us to show the 3rd central moments for Rl+1 and Rl+1 sin2(θl+1) are O(n−2 l ); see Appendix A.1 for details. This approximation is convenient because we are able to calculate the values on the right hand side of the equations in terms of the moments Ja,b by expanding/taking expectations 10 Depth Degeneracy in Neural Networks of the representations (14 - 16). The key quantities we calculate are Rl+1(cid:105) (cid:104) E = 4J2,2 − 1 nl + 1, Rl+1(cid:105) (cid:104) = Var (cid:104) (cid:104) E Var Rl+1 sin2(θl+1) Rl+1 sin2(θl+1) (cid:105) (cid:105) = = (J2,2 + 1) + 16 4 n2 nl l (nl − 1)(1 − 4J 2 1,1) nl 1,1 + 8J 2 8 (cid:0)−8J 4 5 2 J2,2 + J 2 2,2 + (cid:19) 5 8 + O (cid:0)n−3 l (cid:1) , (20) (21) (22) (cid:18) 2J4,2 − , 1,1 − 8J1,1J3,1 + J2,2 + 1(cid:1) 1,1J2,2 + 4J 2 nl + O (cid:0)n−2 l (cid:1) , (23) where Ja,b = Ja,b(θl). These formulas are calculated in Appendix A.7 and Appendix A.8 by a combinatorial expansion using the representations from (14-16). Combining these gives the result for μ(θ, n) in Theorem 1. Note that to obtain a more accurate approximation, we would simply include more terms in the variance expressions in (21, 23). 2.2 Variance of ln(sin2(θl+1)) In this section, we show how to compute the variance of ln(sin2(θl)) in terms of the J functions as in Theorem 1. We can rewrite Var[ln(sin2(θl+1))] in the following way: Var[ln(sin2(θl+1))] = Var (cid:16) (cid:17)(cid:105) (cid:104) Rl+1 sin2(θl+1) + Var ln (cid:104) ln Rl+1(cid:17)(cid:105) = Var (cid:16) (cid:104) ln (cid:16) (cid:17) Rl+1 sin2(θl+1) (cid:16) Rl+1(cid:17)(cid:105) − ln − 2Cov (cid:16) (cid:16) ln Rl+1 sin2(θl+1) (cid:17) , ln (24) Rl+1(cid:17)(cid:17) . (cid:16) We have now expressed this in terms of Rl+1 and Rl+1 sin2(θl+1) which will allow us to use identities as in (14 - 16) in our calculations. Appendix A.2 and Appendix A.3 cover the method used to approximate the unknown variance and covariance terms above. Once again, we control the error term arising from moments in the error term of the Taylor series by using representation as sums (14 - 16). We have already calculated most of the quantities on the right hand side already in our calculation for μ(θ, n). The only new term is Cov (cid:16) Rl+1 sin2(θl+1), Rl+1(cid:17) = 1 nl (cid:0)16J 2 1,1 − 32J1,1J3,1 + 8J2,2 + 8(cid:1) + O (cid:0)n−2 l (cid:1) . This is again computed by a combinatorial expansion of the sums (14-16). (Full cal- culation given in Appendix A.8). We now have solved for all of the functions needed to perform our approximation of Var[ln(sin2(θl+1))]. Putting it together, we end up with the expression for σ2(θ, n) as in (5). We compare the predicted probability distribution of ln(sin2(θ)) using our formulas μ(θ, n) and σ2(θ, n) to empirical probability distributions in Figure 1. 3. Explicit Formula for the Mixed-Moment J Functions In this section we develop a combinatorial method that allows us compute exact formulas for the J functions. The method is to use Gaussian integration by parts to find a recurrence 11 Jakub and Nica relationship between the moments Ja,b, and then solve it explicitly. We begin by generalizing the definition of Ja,b from (13) to include a = 0 and/or b = 0 as follows. Let G, W be independent N (0, 1) variables. Then, we define the functions Ja,b(θ) as Ja,b(θ) = E[Ga(G cos θ + W sin θ)b 1{G > 0} 1{G cos θ + W sin θ > 0}], (25) where a, b ∈ N ∪ {0}. Note that G cos θ + W sin θ = ˆG is marginally N (0, 1) and has correlation cos(θ) with G, matching the original definition. The ReLU function satisfies the identity φ(x)a = xa1{x > 0} for a ≥ 1, so (25) generalizes (13) to the case a = 0. We also note that Ja,b(θ) = Jb,a(θ) for all a, b ∈ N ∪ {0}. 3.1 Statement of Main Results and Outline of Method By using the method of Gaussian integration by parts, we are able to derive recurrence relations for the Ja,b functions. Since the definition of Ja,b involves the indicator function 1{G > 0}, we must make sense of what the derivative of this function means for the purposes of integration by parts; see Section 3.2 where this is carried out. Then, by use of the generalized Gaussian integration by parts formula, we obtain the following recurrence relations for Ja,b. Proposition 1 (Recurrence relations for Ja,b) For a ≥ 2, the sequence Ja,0 satisfies the recurrence relation: Ja,0(θ) = (a − 1)Ja−2,0(θ) + sina−1 θ cos θ ca mod 2 (a − 2)! ! , (26) where c0 = 2π, c1 = 2 two-index recurrence relation: √ 2π. For a ≥ 2, and b ≥ 1, the collection Ja,b satisfies the following Ja,b(θ) = (a − 1)Ja−2,b(θ) + b cos θJa−1,b−1(θ). (27) The same integration by parts technique that yields the recurrence relation also makes it easy to evaluate the first few J functions. They are as follows: Proposition 2 (Explicit Formula for J0,0, J1,0, J1,1) J0,0, J1,0, and J1,1 are given by J0,0(θ) = π − θ 2π , J1,0(θ) = 1 + cos θ √ 2 2π , J1,1(θ) = sin θ + (π − θ) cos θ 2π . (28) See Appendix B.1 for a derivation of these quantities. Note that Cho and Saul (2009) have previously discovered the formulas for J0,0 and J1,1 by use of a completely different contour-integral based method. The combination of Propositions 1 and 2 make it possible to practically calculate any value of Ja,b when a, b are not too large. However, by serendipity, we are able to find remarkable explicit formulas for Ja,b, which we report below. 12 Depth Degeneracy in Neural Networks Proposition 3 (Explicit Formulas for Ja,0(θ), Ja,1(θ)) Let a ≥ 2. Then, Ja,0 and Ja,1 are explicitly given by the following:  Ja,0(θ) = (a − 1)! !    Ja mod 2,0 + cos θ ca mod 2 (cid:88) i̸≡a( mod 2) 0<i<a (i − 1)! ! i! ! sini θ     , where c0 = 2π, c1 = 2 for Ja,1: √ 2π. We can then use the explicit formula for Ja,0 in the formula  Ja,1(θ) = (a − 1)! !    Ja mod 2,1 + cos θ     , Ji,0(θ) i! ! (cid:88) i̸≡a( mod 2) 0<i<a where an explicit formula for the first term (either J1,0 or J1,1 depending on the parity of a) is given in Proposition 2. We can finally express Ja,b as a linear combination of J0,n and J1,n, as follows. (In light of the previous explicit formulas, this is an explicit formula for Ja,b.) It turns out that the coefficients are given in terms of two special numbers P (a, b) and Q(a, b) which are known as the Bessel numbers. Definition 3 (Bessel numbers) The numbers P (a, b) and Q(a, b) are defined as follows,   a! b!( a−b 2 )2  0, (cid:40) ( a+b 2 )! b! 2 P (a, b) = Q(a, b) = , a ≥ b, a ≡ b (mod 2) a−b 2 , otherwise b−a 2 (cid:80) a−b 2 i=0 (cid:0)a+1 i (cid:1), a ≥ b, a ≡ b (mod 2) 0, otherwise (29) (30) . P (a, b) represents a family of numbers known as the Bessel numbers of the second kind (Cheon et al. (2013)), and Q(a, b) comes from a closely related family of numbers (Kreinin (2016)). Using these, we can express Ja,b as follows. Theorem 4 (Explicit Formula for Ja,b(θ)) Let b ≥ 2, a ≥ 1, b ≥ a. Then, we have the following formula for Ja,b(θ) in terms of J0,n and J1,n Ja,b = (cid:88) (b)a−i(cos θ)a−i (P (a, a − i) − Q(a − 1, a − 1 − i)) J0,b−a+i i≡0( mod 2) 0<i≤a (cid:88) (b)a−i(cos θ)a−iQ(a − 1, a − i)J1,b−a+i. + i≡1( mod 2) 0<i≤a 13 Jakub and Nica Remark 5 Since J1,n is also given in terms of J0,n, one may further simplify the formula for Ja,b to be in terms of only J0,n, J0,0 and J0,1. This substitution yields the following formula. For notational convenience, we will let δ := b − a, Ja,b = (cid:88) (b)a−i(cos θ)a−i(P (a, a − i) − Q(a − 1, a − 1 − i))J0,δ+i i≡0( mod 2) 0<i≤a (cid:88) (b)a−i(cos θ)a−iQ(a − 1, a − i)(δ + i − 1)! ! J(δ+1) mod 2,1 + i≡1( mod 2) 0<i≤a + cos θ (cid:88) (cid:88) (b)a−i(cos θ)a−iQ(a − 1, a − i) i≡1( mod 2) 0<i≤a j≡δ( mod 2) 0<j<δ+i (δ + i − 1)! ! j! ! J0,j. 3.2 Gaussian Integration-by-Parts Formulas In this section, we state two important formulas that together give us the tools for computing the expectations that appear in Ja,b. Fact 1 (Gaussian Integration by Parts) Let G ∼ N (0, 1) be a Gaussian variable and f : R → R be a differentiable function. Then, E[Gf (G)] = E[f ′(G)]. (31) Using this type of Gaussian integration by parts formula, we can generalize the expected value of Gaussians to derivatives of functions which are not necessarily differentiable. For example the indicator function 1{x > a} is not differentiable, but for the purposes of computing Gaussian expectation, we can use the following integration formula. Fact 2 (Gaussian expectations involving 1′{x > a}) Let G be a Gaussian variable and −g2 a ∈ R. Let f : R → R such that limg→∞ f (g)e 2 = 0. Then, using the Gaussian integra- tion by parts formula to assign a meaning to expectations involving the "derivative of the indicator function", 1′{x > a}, we have E[1′{G > a}f (G)] = f (a) −a2 2 e √ 2π . (32) Remark 6 The purpose of assigning a value to the expectation (32) is to allow one to compute "honest" expectations of the form (31) when f (x) involves 1{x > 0}; see Lemma 7 for an illustrative example. The final result does not require interpreting "1′{x > a}"; this is only a useful intermediate step in the sequence of calculations leading to the final result. The formula can also be understood or proven in a number of different alternative ways. One is simply to say that 1′{x > a} = δ{x = a} is a "Dirac delta function" at x = a. A more rigorous way would be to take any differentiable family of functions 1ε{x > a} which suitably converge to 1{x > a} as ε → 0 and then interpret the result as the limit of the expectation limε→0 E[1′ ε{G > a}f (G)]. 14 Depth Degeneracy in Neural Networks Proof [Of Fact 2] Applying integration by parts, we formally have E[1′{G > a}f (G)] = ∞ (cid:90) −∞  1′{g > a}f (g) −g2 2 e √ 2π dg = 1{g > a}f (g) −g2 2 e √ 2π  ∞  ∞ (cid:90) − −∞ −∞ 1{g > a}  f (g) d dg −g2 2 e √ 2π   dg. Note that the first term is 0 by the hypothesis lim g→∞ f (g)e −g2 2 = 0, and we have then E[1′{G > a}f (G)] = −  f (g) ∞ (cid:90) a d dg −g2 2 e √ 2π    dg = − f (g)  ∞ −g2 2 e √  2π a = 0 + f (a) −a2 2 e √ 2π , where we have used the hypothesis on f once again. The two facts about Gaussian integration by parts can be combined to create recurrence relations for expectations involving 1{G > a}. A simple example is the following lemma, which we will also use later in our derivation. The proof strategy of this lemma is a microcosm of the proof strategy we use to compute Ja,b in general, namely to use Gaussian integration by parts to derive a recurrence relation and initial condition, and then solve. Lemma 7 (Moments of φ(G)) For k ≥ 0, we have E[φ(G)k] = E[Gk1{G > 0}] = (cid:40) (k−1)!! 2 (k−1)!! √ 2π k is even k is odd √ 2π = (k − 1)! ! ck−1 mod 2 , where c0 = 2π and c1 = 2 √ 2π. Proof We prove this for even and odd k separately by induction on k. The base case for k = 0 is trivial since (0 − 1)! ! = 1 is the empty product. The base case k = 1 follows by first applying (31) with f (x) = 1{x > 0} and then applying (32) with f (x) ≡ 1, E[φ(G)] = E[G1{G > 0}] = E[1′{G > 0}] = √ 2π −1 . Now, to see the induction, we apply (31) with f (x) = xk−11{x > 0}, k ≥ 2. Due to the product rule, there are two terms in the derivative, E[φ(G)k] = E[G * Gk−11{G > 0}] (33) = (k − 1)E[Gk−21{G > 0}] + E[Gk−11′{G > 0}] = (k − 1)E[φ(G)k−2] + 0, where we have recognized that the second term is 0 by application of (32) with f (x) = xk−1 which has f (0) = 0. The recurrence E[φ(G)k] = (k − 2)E[φ(G)k−2] along with initial con- dition leads to the stated result by induction. 15 Jakub and Nica 3.3 Recursive Formulas for Ja,b(θ) - Proof of Proposition 1 Proof [Of Proposition 1] To find a recursive formula for Ja,0, a ≥ 2, we apply the Gaussian integration by parts formula (31) to f (x) = xa−11{x > 0}1{cos θx+W sin θ > 0} to evaluate the expected value over G first. When applying product rule there are three terms Ja,0 =E[G * Ga−11{G > 0}1{G cos θ + W sin θ > 0}] (34) =(a − 1)E[Ga−21{G > 0}1{G cos θ + W sin θ > 0}] + E[Ga−11{G > 0}1′{G cos θ + W sin θ > 0}] cos θ + E[Ga−11′{G > 0}1{G cos θ + W sin θ > 0}]. The first term is simply (a−1)Ja−2,0. The last two terms can now be evaluated with the help of (32). The last term of (34) is (32) with the function f (x) = xa−11{x cos θ + W sin θ > 0} which has f (0) = 0 for a ≥ 2. Therefore, this term simply vanishes. To evaluate the middle term of (34), we introduce a change of variables to express G cos θ + W sin θ in terms of two other independent Gaussian variables Z, W ∼ N (0, 1) Z = G cos θ + W sin θ, G = Z cos θ + Y sin θ, (35) Y = G sin θ − W cos θ, W = Z sin θ − Y cos θ, where Y, Z iid N (0, 1). Under this change of variables, Ja,0, a ≥ 2 is setup to apply (32) with f (x) = 1{x cos θ + Y sin θ}a−11{x cos θ + Y sin θ > 0} Ja,0 = (a − 1)Ja−2,0 + E[Ga−11{G > 0}1′{G cos θ + W sin θ > 0}] cos θ = (a − 1)Ja−2,0 + E[(Z cos θ + Y sin θ)a−11{Z cos θ + Y sin θ > 0}1′{Z > 0}] cos θ = (a − 1)Ja−2,0 + E[(0 + Y sin θ)a−11{0 + Y sin θ > 0}] 1 √ 2π cos θ = (a − 1)Ja−2,0 + sina−1 θ cos θ ca mod 2 where we have applied Lemma 7 to evaluate the last expectation. (a − 2)! ! , A similar argument is used to find the recursive formula for Ja,b, a ≥ 2, b ≥ 1, by using (31) with the function f (x) = xa−1(x cos θ + W sin θ)b1{x > 0}1{x cos θ + W sin θ > 0}. There are 4 terms in the product rule derivative. Fortunately in this case, the last two terms are simply zero by application of (32) since the expressions vanish when G = 0, so we get Ja,b = E[G * Ga−1(G cos θ + W sin θ)b1{G > 0}1{G cos θ + W sin θ > 0}] = E[(a − 1)Ga−2(G cos θ + W sin θ)b1{G > 0}1{G cos θ + W sin θ > 0}] + E[Ga−1b cos θ(G cos θ + W sin θ)b−11{G > 0}1{G cos θ + W sin θ > 0}] + E[Ga−1(G cos θ + W sin θ)b1′{G > 0}1{G cos θ + W sin θ > 0}] + E[Ga−1(G cos θ + W sin θ)b1{G > 0}1′{G cos θ + W sin θ > 0} cos θ] = (a − 1)Ja−2,b + b cos θJa−1,b−1 + 0 + 0, as desired. 16 Depth Degeneracy in Neural Networks 3.4 Solving the Recurrence to get an Explicit Formula for Ja,b(θ) - Proof of Theorem 4 Solving the recurrence for the sequences Ja,0 and Ja,1 to get the claimed explicit formula for Ja,0 is a simple induction proof. We defer these to Appendix B.2. More difficult and interesting is the 2D array Ja,b. To solve the recurrence Ja,b = (a − 1)Ja−2,b + b cos θJa−1,b−1, a ≥ 2, b ≥ 1, (36) we will apply the recursion repeatedly until Ja,b can be expressed as a linear combination of J0,n and J1,n terms for which we already have an explicit formula developed. To determine the coefficients in front of J0,n and J1,n, we take a combinatorial approach by thinking of the recurrence relation as a weighted directed graph as defined below. Definition 8 (Viewing a recursion as a directed weighted graph) We can view the recurrence relation for Ja,b as a weighted directed graph on the vertex set (a, b) ∈ Z2 where vertices represent the values of Ja,b and directed edges capture how values of Ja,b are con- nected through the recurrence relation. To be precise, the graph edges and edge weights we are defined so that the recursion (36) for Ja,b can be expressed in the graph as a sum over incoming edges, Ja,b = (cid:88) wJ e Ja′,b′, (37) e:(a′,b′)→(a,b) where the sum is over the edges e with weight wJ of the graph to calculate J6,8 is illustrated in Figure 3. e incoming to the vertex (a, b). An example By repeatedly applying the recursion, Ja,b can be expressed as a linear combination of the values at the source vertices of the graph (i.e. those with no incoming edges). For the recurrence Ja,b, the source vertices are J0,n and J1,n. The coefficients in front of each source is simply the weighed sum over all paths from the source to the node, namely Ja,b = (cid:88) W J v→(a,b)Jv = source vertices v (cid:88) n≥0 W J (0,n)→(a,b)J0,n + W J (1,n)→(a,b)J1,n, (cid:88) n≥0 W J (a′,b′)→(a,b) := (cid:88) (cid:89) wJ e , π:(a′,b′)→(a,b) e∈π (38) (39) where the sum is over all paths π from the vertex (a′, b′) to the vertex (a, b) in the J graph. In light of (38), to prove Theorem 4, we have only to calculate the weighted sum of path (0,n)→(a,b) and W J (1,n)→(a,b). These weighted sums turn out to be given in terms of the P W J and Q numbers which were defined in Definition 3. Proposition 4 (Weighted sums of paths for J) In the graph for J, we have the fol- lowing formulas for the sum over weighted paths W J defined in (39), W J W J (0,n)→(a,b) = (b)b−n(cos θ)b−n(P (a, b − n) − Q(a − 1, b − n − 1)), (1,n)→(a,b) = (b)b−n(cos θ)b−nQ(a − 1, b − n). (40) (41) 17 Jakub and Nica 8 7 6 5 4 3 2 8 7 6 5 4 3 2 6 5 4 3 2 1 0 J6,8 8 cos θ 5 J5,7 7 cos θ J4,8 4 J4,6 8 cos θ 6 cos θ 3 J3,7 3 J3,5 7 cos θ 5 cos θ J2,8 2 J2,6 2 J2,4 8 cos θ 6 cos θ 4 cos θ 1 J1,7 1 J1,5 1 J1,3 J0,8 J0,6 J0,4 J0,2 6 5 4 3 2 1 0 1 J ∗ 5,7 4 1 J ∗ 3,7 2 1 J ∗ 1,7 J ∗ 6,8 5 J ∗ 4,8 3 J ∗ 2,8 1 J ∗ 0,8 1 J ∗ 4,6 3 1 J ∗ 2,6 1 1 J ∗ 0,6 1 J ∗ 3,5 2 1 J ∗ 1,5 1 J ∗ 2,4 1 1 J ∗ 0,4 1 J ∗ 1,3 1 J ∗ 0,2 (a) Directed graph associated with J (b) Directed graph associated with J ∗ Figure 3: The graph associated with the recursions for J in (36) (left) and J ∗ in (43) (right). The graph is defined so that the recursion is given by a sum of incoming edges as in (37). The edges are color coded red and blue to match the coefficients in the recursion. To prove this Proposition 4, we first create a simpler recursion, J ∗, which we solve first and then slightly modify the solution to get the solution for J. Lemma 9 (Weighted sums of paths for J ∗) Let J ∗ a,b be defined to be the recursion: a,b := (a − 1)J ∗ J ∗ 1,b := 0 + 1J ∗ J ∗ a−2,b + 1J ∗ 0,b−1 for 1 ≤ b. a−1,b−1 for 2 ≤ a ≤ b, (42) (43) Thinking of this recursion as a graph as in Definition 8 (see Figure 3 for an illustration), we have that the sum of weighted paths W J ∗ defined analogously to those in (39), are given by P and Q numbers, namely W J ∗ (0,n)→(a,b) = P (a, b − n), W J ∗ (1,n)→(a,b) = Q(a − 1, b − n). (44) The connection between the J ∗ and the P , Q numbers is through the following recursion for the P , Q numbers. Lemma 10 (Recursion for P and Q numbers) The P numbers, defined in Definition 3, satisfy P (0, 0) = 1, P (n, n) = P (n − 1, n − 1) for n ≥ 1, and the recursion P (a, b) = (a − 1) * P (a − 2, b) + 1 * P (a − 1, b − 1), for a ≥ 2, 0 ≤ b ≤ a − 2, under the convention that P (a, −1) = 0. The Q numbers satisfy the same recursion as the P numbers, with a coefficient of a rather than (a − 1). The proof of Lemma 10 is an easy consequence of known results from Kreinin (2016) and is deferred to Appendix C. Proof [Of Lemma 9] Using the same idea of recursions expressed as graphs as in Definition 8, the recursion from Lemma 10 means that P and Q can be expressed as weighted directed 18 Depth Degeneracy in Neural Networks graphs. These are displayed in Figure 4. Since the P and Q graphs have only one single unit valued source vertex at (0, 0), (38) shows that the P and Q numbers are actually themselves equal to sums over weighted paths in their respective graphs P (a, b) = W P (0,0)→(a,b), Q(a, b) = W Q (0,0)→(a,b). Therefore the statement of the lemma is that sum over weighted paths in the J ∗ graph are 0 1 0 1 1 0 3 3 1 0 1 0 2 3 0 4 1 1 1 0 5 15 2 0 0 1 0 3 6 3 0 0 0 1 0 4 1 1 0 5 10 1 1 1 1 1 4 0 0 0 0 1 1 0 5 5 0 0 0 0 0 1 15 0 6 45 0 6 15 0 6 6 0 0 0 0 0 0 1 1 0 1 2 3 4 5 6 (a) P 0 1 2 3 4 5 6 0 1 0 2 2 0 4 8 1 0 1 0 3 5 0 5 1 1 1 0 6 33 2 0 0 1 0 4 9 3 0 0 0 1 0 5 1 1 0 6 14 1 1 1 ... 0 7 ... 0 7 (b) Q 4 0 0 0 0 1 0 6 ... 1 1 5 0 0 0 0 0 1 1 1 0 7 6 0 0 0 0 0 0 ... 8 7 6 5 4 3 2 6 5 4 3 2 1 0 1 J ∗ 5,7 4 1 J ∗ 3,7 2 1 J ∗ 1,7 J ∗ 6,8 5 J ∗ 4,8 3 J ∗ 2,8 1 J ∗ 0,8 1 J ∗ 4,6 3 1 J ∗ 2,6 1 1 J ∗ 0,6 1 J ∗ 3,5 2 1 J ∗ 1,5 (c) J ∗ 6,8 1 J ∗ 2,4 1 1 J ∗ 0,4 1 J ∗ 1,3 1 J ∗ 0,2 Figure 4: Graphs associated with the recursions for the P numbers (left), Q numbers (middle), and J ∗ (right). The weighted edges indicate the coefficients in the recursions for P, Q, J ∗ respectively. The diagrams are lined up so that the sum of weighted paths in from J ∗ 6,8 can be directly read from the P and Q entries in the same location. By reading from the bottom displayed row of P we see that the weighted sum over paths W J ∗ (0,n)→(6,8) are 15, 45, 15 and 1 for n = 8, 6, 4 and 2 respectively. (Since these are the source vertices, this shows that J ∗ 0,2.) From the bottom displayed row of Q we see that the values for sums of weighted paths from vertices W J ∗ (1,n)→(6,8) are 33, 14 and 1 for n = 7, 5 and 3 respectively. 6,8 = 15J ∗ 0,8 + 45J ∗ 0,6 + 15J ∗ 0,4 + 1J ∗ the same as other sums over weighted paths in the P graph/Q graphs, W J ∗ (0,n)→(a,b) = W P (0,0)→(a,b−n), W J ∗ (1,n)→(a,b) = W Q (0,0)→(a−1,b−n). (45) The fact that these are equal is demonstrated by establishing a simple bijection between weighted paths in the P graph/Q graph, and weighted paths in the J ∗ graph. For example, in Figure 4, there is a bijection between the weighted paths in the P graph which connect P (0, 0) to P (6, 2), to the paths which connect J ∗ 0,6 in the J ∗ graph. The bijection is simply to flip any path in the P -graph by rotating it by 180◦ to get a valid path in the J ∗-graph. Moreover, the edge weights for J ∗ and P are precisely set up so that under this bijection, the paths will have the same set of weighted edges in the same order. A full, more detailed, explanation of this bijection is given in Appendix B.3. This argument shows that W J ∗ 6,8 to J ∗ (0,n)→(a,b) = P (a, b − n) as desired. The P numbers do not apply for paths between J ∗ a,b because we are starting one row higher so the first vertical upward edge is weight 2. In this case, there is a bijection to the Q-graph after flipping the path. For any path which runs from a node in row 1 to 1,n and J ∗ 19 Jakub and Nica the top left corner of the J ∗-graph, we can find the same "flipped" path in the graph of the Q, running from the top left entry to the corresponding node in row a − 1. (The bijection is explained in detail in Appendix B.3.) Hence W J ∗ (1,n)→(a,b) = Q(a − 1, b − n) as desired. Having solved for J ∗ in terms of P and Q, it remains to translate these into the weights for J to obtain Proposition 4. Proof [Of Proposition 4] The proof follows by relating the weighted sum of paths for J in terms of J ∗ and then applying the result of Lemma 9. There are two differences between the formula for Ja,b compared to J ∗ a,b, which can both be seen in Figure 3. We handle both differences as follows: Difference #1: J has a weight of b cos θ on the blue diagonal edges (a, b) → (a + 1, b + 1) vs J ∗ has a weight of 1. This difference is handled by the following observation: any path from (a, b) → (a′, b′) in the graph goes through each column between b and b′ exactly once. This means that the contribution of the edge weights from these edges do not depend on the details of which path was taken, only the starting and ending points. They always contribute the same factor, (b)b′−b(cos θ)b′−b. (here (b)k = b(b − 1) * * * (b − k + 1) is the falling factorial with k terms). This argument shows that the weighted sum of paths in J and J ∗ are related by W J (a,b)→(a′,b′) = (b)b′−b(cos θ)b′−bW J ∗ (a,b)→(a′,b′). (46) By the result of Lemma 9, this shows that W J (1,n)→(a,b) = (b)b−n(cos θ)b−nQ(a − 1, b − n) as desired. Equation (46) holds for all paths with starting point a ≥ 1. When a = 0, there is one additional difference between J and J ∗ which is accounted for below. Difference #2: J0,n has no diagonal edge vs J ∗ 0,n has a diagonal blue edge of weight 1. Because of this "missing edge", the only choice in J for paths starting from (0, n) is to first go vertically up by 2 units to (2, n). Hence W J (2,n)→(a,b). To evaluate this, we use the decomposition of paths in J ∗ by what their first step is, either a diagonal blue step or a red vertical up step, to see that (0,n)→(a,b) = W J W J ∗ =⇒ W J ∗ (0,n)→(a,b) = W J ∗ (2,n)→(a,b) = W J ∗ (1,n+1)→(a,b) + W J ∗ (0,n)→(a,b) − W J ∗ (2,n)→(a,b), (1,n+1)→(a,b) = P (a, b − n) − Q(a − 1, b − n − 1), (47) (48) (49) by the result of Lemma 9. By applying now (46) to relate J and J ∗, we obtain W J (2,n)→(a,b) = (b)b−n(cos θ)b−n(P (a, b − n) − Q(a − 1, b − n − 1)) as desired. W J (0,n)→(a,b) = Proof [Of Theorem 4] The formula is immediate from (38), which writes Ja,b as a linear combination of J0,n and J1,n, and Proposition 4 which gives the the coefficients. 20 Depth Degeneracy in Neural Networks Appendix A. A.1 Expected Value Approximation Lemma 11 Both the random variables X = Rl+1 and X = Rl+1 sin2(θl) satisfy E[ln(X)] = ln(E[X]) − Var[X] 2E[X]2 + O(n−2 l ). (50) Proof First note that by the properties of the logarithm, we have (cid:18) ln(X) = ln E[X] (cid:18) E[X] + (X − E[X]) E[X] (cid:19)(cid:19) = ln(E[X]) + ln 1 + (cid:18) X − E[X] E[X] (cid:19) . (51) We can now apply the Taylor series ln(1 + x) = x − x2 series remainder and satisfies ε2(x) = O(x3). Hence 2 + ε2(x), where ε2(x) is the Taylor ln(X) = ln(E[X]) + X − E[X] E[X] − (X − E[X])2 2E[X]2 + ε2 (cid:18) X − E[X] E[X] (cid:19) . Note that E[X − E[X]] = 0, and E[(X − E[X])2] = Var[X]. Thus, if we take the expected value of our above approximation, we get the following: E[ln(X)] = ln(E[X]) − Var[X] 2E[X]2 + E (cid:20) ε2 (cid:18) X − E[X] E[X] (cid:19)(cid:21) . By using bounds on the Taylor series error term ε2(x) = O(x3), one can obtain bounds for this last error term. By (16, 17), both X = Rl+1 and X = Rl+1 sin2(θl+1) can be expressed as averages of the form X = 1 n2 l nl(cid:88) i,j f (Gi, ˆGj). (52) From the bound on the 3rd moment in Lemma 14, it follows that E[ε2(X −E[X])] = O(n−2 thus giving the desired result. l ), A.2 Variance Approximation Lemma 12 Both the random variables X = Rl+1 and X = Rl+1 sin2(θl) satisfy Var[ln(X)] = Var[X] E[X]2 + O(n−2 l ). Proof Starting with (51), and using the first term of the Taylor series approximation for ln(1 + x) = x + ε1(x) now, we have that ln(X) = ln(E[X]) + X − E[X] E[X] + ε1 (cid:18) X − E[X] E[X] (cid:19) . (53) 21 Jakub and Nica where ε1(x) is the Taylor error term and satisfies ε1(x) = O(x2). Taking the variance of this, we arrive at an approximation of Var[ln(X)]. Var[ln(X)] = Var ln(E[X]) + (cid:20) X − E[X] E[X] = Var (cid:20) X − E[X] E[X] (cid:21) + Var (cid:20) ε1 (cid:18) X − E[X] E[X] (cid:19)(cid:21) + Cov + ε1 (cid:18) X − E[X] E[X] (cid:18) X − E[X] E[X] (cid:19)(cid:21) , ε1 (cid:18) X − E[X] E[X] (cid:19)(cid:19) . As with the expected value approximation, this approximation for variance is used twice, once for X = Rl+1, and once for X = Rl+1 sin2(θl+1) (see Section 2.2), both of which can can be expressed as a sum as in (52). Since ε1(x) = O(x2), we have that the terms with = Var[X] ε1(x) are both O(n−2 l ) from Lemma 14. Simplifying the first term, Var E[X]2 gives the result of the Lemma. (cid:104) X−E[X] E[X] (cid:105) A.3 Covariance Approximation Lemma 13 Both the random variables X = Rl+1 and X = Rl+1 sin2(θl) satisfy Cov(ln(X), ln(Y )) = Cov(X, Y ) E[X]E[Y ] + O(n−2 l ). Proof Using the approximation in (53) for ln(X) and ln(Y ), we get the following expression for the covariance: + ε1 (cid:18) X − E[X] E[X] (cid:19) , ln(E[Y ]) + Y − E[Y ] E[Y ] + ε1 (cid:18) Y − E[Y ] E[Y ] (cid:19)(cid:19) Cov(ln(X), ln(Y )) (cid:18) ln(E[X]) + = Cov = Cov = Cov (cid:18) X E[X] (cid:18) X E[X] (cid:18) X − E[X] E[X] (cid:18) X − E[X] E[X] + ε1 (cid:19) , Y E[Y ] + Cov (cid:18) X − E[X] E[X] (cid:19) , ε1 + Cov ε1 (cid:19) , Y E[Y ] (cid:18) X (cid:19)(cid:19) (cid:18) Y − E[Y ] E[Y ] + ε1 (cid:18) Y − E[Y ] E[Y ] , ε1 E[X] (cid:18) Y − E[Y ] E[Y ] (cid:19)(cid:19) . (cid:19)(cid:19) (cid:18) + Cov ε1 (cid:18) X − E[X] E[X] (cid:19) , Y E[Y ] (cid:19) We get the desired result from the fact that that the error term ε1(x) satisfies ε1(x) = O(x2) and from our result in Lemma 16. A.4 Third and Fourth Moment Bound Lemma Lemma 14 Let Gi, ˆGi, 1 ≤ i ≤ n be marginally N (0, 1) random variables with correlation i,j f (Gi, ˆGj) be the average over cos(θ) and independent for different indices i. Let A = 1 n2 all n2 pairs of some function f : R2 → R which has finite fourth moment, E[f (Gi, ˆGi)4] < ∞. Then, the third and fourth central moment of A satisfy (cid:80)n E[(A − E[A])3] = O(n−2), E[(A − E[A])4] = O(n−2). (54) 22 Depth Degeneracy in Neural Networks Proof We begin by showing the third moment bound. First, we can express E[(A−E[A])3] as a sum in the following way: A − E[A] = 1 n2 n (cid:88) i,j (cid:16) (cid:17) f (Gi, ˆGj) − E[f (Gi, ˆGj)] =⇒ E (cid:2)(A − E[A])3(cid:3) = 1 n6 n (cid:88) i1,i2,i3 j1,j2,j3 (cid:34) 3 (cid:89) E k=1 (cid:16) (cid:17) f (Gik , ˆGjk ) − E[f (Gik , ˆGjk )] (cid:35) . (55) Note that many of these terms are mean zero. For example, for any configuration of the indices where there is no overlap between the indices (i1, j1) and the other two index pairs ({i1, j1} ∩ {i2, j2, i3, j3} = ∅), we may use independence to observe that (cid:34) 3 (cid:89) E k=1 (cid:16) (cid:17) f (Gik , ˆGjk ) − E[f (Gik , ˆGjk )] (cid:35) =E (cid:104) (cid:105) f (Gi1, ˆGj1) − E[f (Gi1, ˆGj1)] E (cid:16) (cid:17) f (Gik , ˆGjk ) − E[f (Gik , ˆGjk )] (cid:35) = 0. (cid:34) 3 (cid:89) k=2 When this happens we say that (i1, j1) is a "reducible point". Similarly, (i2, j2) or (i3, j3) can be reducible if they have no overlap with the other two index pairs. To control E (cid:2)(A − E[A])3(cid:3), it will suffice to enumerate the number of indices {i1, j1, i2, j2, i3, j3} so that all three points (i1, j1), (i2, j2), (i3, j3) are not reducible. We call these "irreducible configurations". We now observe that at least one of the points (i1, j1),(i2, j2) or (i3, j3) is reducible (cid:12) (cid:12) (cid:83)3 (cid:12) (cid:12) (cid:12) ≥ 5. This is because, by the k=1{ik, jk} whenever the number of unique numbers is (cid:12) pigeonhole principle, if there are no repeated or only one repeated number between 6 indices, then at least one of the 3 pairs (i1, j1),(i2, j2) or (i3, j3) must consist of two unique numbers and therefore is a reducible point. Since the irreducible configurations can only have at most 4 unique numbers, the number of irreducible configurations is O(n4) as n → ∞. In fact, a detailed enumeration of the number of configurations reveals that the number of irreducible configurations is precisely 32(n)4 + 68(n)3 + 28(n)2 + 1(n)1. (56) The leading term is 32 because there are 32 possible "patterns" for how the indices can be (cid:12) (cid:12) arranged to be both irreducible and contain exactly 4 unique numbers (cid:12) = 4; these patterns are listed in Table 3. Each pattern contributes (n)4 = n(n − 1)(n − 2)(n − 3) possible index configurations by filling in the 4 unique numbers in all the possible ways. Similarly, there are respectively 68, 28, and 1 pattern(s) for irreducible configurations with 3,2 and 1 unique number(s) in them which each contribute (n)3, (n)2 and (n)1 configurations per pattern (Here, (n)k denotes the falling factorial with k terms). k=1{ik, jk} (cid:83)3 (cid:12) (cid:12) (cid:12) Since the number of irreducible configurations is O(n4), the normalization by n6 in (55) shows that E[(A − E[A])3] is O(n−2) as desired for the third moment. 23 Jakub and Nica The argument for the 4th moment is similar. We write E[(A − E[A])4] as a sum over i1, j1, i2, j2, i3, j3, i4, j4 and again enumerate irreducible configurations. In this case, once again by the pigeonhole principle any configuration with 7 or more unique points (cid:12) (cid:12) (cid:83)3 (cid:12) (cid:12) (cid:12) ≥ 7 will be reducible. Since there are at most 6 unique numbers, there will k=1{ik, jk} (cid:12) be O(n6) irreducible configurations. A detailed enumeration of all the possible irreducible patterns and the number of unique elements in each yields that the number of irreducible configurations is precisely 48(n)6 + 544(n)5 + 1268(n)4 + 844(n)3 + 123(n)2 + 1(n)1. The normalization factor of n−8 then shows that E[(A − E[A])4] = O(n−2). Remark 15 A more detailed enumeration of the 4th moment actually shows that the dom- inant terms in the 4th moment correspond to the terms in the 2nd moment written twice, and asymptotically E[(A − E[A])4] = 3E[(A − E[A])2]2 + O(n−3). Here, 3 arises as the number of pair partitions of 4 items, and is related to the fact that 3 = E[G4]. Lemma 16 Let Gi, ˆGi, 1 ≤ i ≤ n be marginally N (0, 1) random variables with correla- i,j f1(Gi, ˆGj), and let tion cos(θ) and independent for different indices i. Let A1 = 1 n2 i,j f2(Gi, ˆGj), where f1, f2 : R2 → R have finite fourth moments, E[f1(Gi, ˆGi)4], A2 = 1 n2 E[f2(Gi, ˆGi)4] < ∞. Then, (cid:80)n (cid:80)n E[(A1 − E[A1])2(A2 − E[A2])] = O (cid:0)n−2(cid:1) . Proof We can express E[(A1 − E[A2])2(A2 − E[A2])] using sums as follows: E[(A1 − E[A1])2(A2 − E[A2])] (cid:34) 2 (cid:89) n (cid:88) (cid:16) = 1 n6 i1,i2,i3 j1,j2,j3 k=1 E f1(Gik , ˆGjk ) − E[f1(Gik , ˆGjk )] (cid:17) (cid:16) (cid:17) f2(Gi3, ˆGj3) − E[f2(Gi3, ˆGj3)] (cid:35) . By the same argument as in Lemma 14, we can show that the number of nonzero terms in the above summation is O(n4) as n → ∞. Thus, we have that E[(A − E[A])2(A′ − E[A′])] = O(n−2). A.5 Derivation of Useful Identities - Equations (14, 15) Let G ∈ Rn be a Gaussian vector with iid entries Gi ∼ N (0, 1). Then, by standard properties of Gaussians, the function f : Rn → R given by f (x) = ⟨G, x⟩ is a Gaussian 24 Depth Degeneracy in Neural Networks (i1, j1) (i2, j2) (i3, j3) {(a, b), (b, a)} × {(a, c), (c, a)} × {(a, d), (d, a)} 8 patterns {(a, b), (b, a)} × {(a, c), (c, a)} × {(c, d), (d, c)} 8 patterns {(a, b), (b, a)} × {(c, d), (d, c)} × {(a, c), (c, a)} 8 patterns {(a, c), (c, a)} × {(a, b), (b, a)} × {(c, d), (c, b)} 8 patterns Table 3: All 32 irreducible patterns using exactly 4 unique index values a, b, c, d. For example the pattern (i1, j1), (i2, j2), (i3, j3) = (a, b), (a, c), (a, d) represents all configurations where i1 = i2 = i3 and the j's are all unique and different from i. For each pattern, there are (n)4 = n(n − 1)(n − 2)(n − 3) configurations by filling in a, b, c, d with unique numbers in [n]. These are the dominant terms in (55). random variable. Further, f (x) ∼ N (0, ∥x∥2) for all x ∈ Rn, and for any two vectors xα, xβ ∈ Rn, the joint distribution of f (xα), f (xβ) is jointly Gaussian with   f (xα) f (xβ)    ∼ N (0, Σ(xα, xβ)) , Σ(xα, xβ) :=  ∥xα∥2 ⟨xα, xβ⟩   , ⟨xα, xβ⟩ ∥xβ∥2 where Σ(xα, xβ) is sometimes called the 2 × 2 Gram matrix of the vectors xα, xβ. In the setting of our fully connected neural network, any index i ∈ [nl+1] in the vector of zl+1 is actually the inner product with the i-th row (cid:114) 2 nl , φ(zl(x))⟩. ⟨W l+1 i,* zl+1 i (x) = Note that each row W l+1 is a Gaussian vector, so the previous fact about Gaussians applies and we see that the entries of zl+1 are conditionally Gaussian given the value of the previous layer. By the previous Gaussian fact, we have that zl+1 (xβ) are jointly Gaussian with (xα), zl+1 i,* i i   zl+1 i zl+1 i    ∼ N 0, 2 nl (xα) (xβ)   ∥φl α∥2 α, φl β⟩ ⟨φl     =: N (cid:16) 0, Kl(cid:17) , ⟨φl α, φl β⟩ β∥2 ∥φl where we use Kl to denote the 2×2 covariance matrix. Kl is precisely the 2×2 Gram matrix β scaled by 2/nl and its entries Kl α, φl of the previous layer φl γδ, for γ ∈ {α, β}, δ ∈ {α, β} are actually averages of entries in the previous layer Kl γ,δ := 2 nl ⟨φl γ, φl δ⟩ = 1 nl nl(cid:88) k=1 2φ(zl k(xi))φ(zl k(xj)). Moreover, in the weight matrix W l+1, the ith and jth rows (W l+1 , respec- tively) are independent. Therefore, all entries of zl+1 are identically distributed and con- ditionally independent given φ(zl). From this fact, we can equivalently write the entries explicitly as and W l+1 j,* i,* 25 Jakub and Nica zl+1 i (xα) = (cid:114) 2 nl ∥φl α∥Gi, zl+1 i (xβ) = (cid:114) 2 nl ∥φl β∥ ˆGi, (57) where Gi, ˆGi are marginally N (0, 1) variables with covariance Cov(Gi, ˆGi) = cos(θl) and independent for different indices. This formulation precisely ensures that the covariance structure for the entries is exactly what is specified by the covariance kernel Kl. With this representation of zl+1 (xα) and zl+1 i i (xβ), we can apply φ(*) to each entry. By using the property of ReLU φ(λx) = λφ(x) for λ > 0 to factor out the norms, we obtain φ(zl+1 i (xα)) = (cid:114) 2 nl ∥φl α∥φ(Gi), φ(zl+1 i (xβ)) = (cid:114) 2 nl ∥φl β∥φ( ˆGi). (58) Taking the norm/inner product of the vector now yields (14-16) as desired. A.6 Cauchy-Binet and Determinant of the Gram Matrix - Equation (16) To prove this identity, we begin with the fact that ∥φl+1 α ∥2∥φl+1 β ∥2sin2(θl+1) = det   α ∥2 ∥φl+1 α , φl+1 β ⟨φl+1 ⟨φl+1 α , φl+1 β ∥φl+1 β ∥2 ⟩  ⟩  . By the Cauchy-Binet identity, we can express the determinant as det   α ∥2 ∥φl+1 α , φl+1 β ⟨φl+1 ⟨φl+1 α , φl+1 β ∥φl+1 β ∥2 ⟩  ⟩  = (cid:88) (cid:16) 1≤i<j≤nl i;α φl+1 φl+1 j;β − φl+1 j;α φl+1 i;β (cid:17)2 . (59) Due to the fact that the summand is equal to 0 when i = j, we can equivalently take the sum over all indices i, j ∈ [nl] and halve the result. We can also express layer l + 1 using the following conditioning on the previous layer φl+1 i;α = (cid:114) 2 nl ∥φl α∥*φ(Gi), φl+1 i;β = (cid:114) 2 nl ∥φl β∥*φ( ˆGi). Applying these facts to our expression in (59), and dividing both sides by ∥φl get our desired result. α∥2∥φl β∥2, we A.7 Expected Value Calculations In this section, we derive the formulas for E (cid:2)Rl+1(cid:3), E (cid:2)Rl+1 sin2(θl+1)(cid:3). We use Ja,b to represent Ja,b(θl). Note that E[φ2(G)] = 1 2 , E[φ4(G)] = 3 2 . Calculation of E (cid:2)Rl+1(cid:3) : First, we apply the identity as in (17): Rl+1(cid:105) (cid:104) E = (cid:19)2 (cid:18) 2 nl  E  nl(cid:88) i,j=1  φ2(Gi)φ2( ˆGj)  . 26 Depth Degeneracy in Neural Networks Whenever i = j, taking the expected value will give us a J2,2 term. When i ̸= j, the expected value of this term will be E[φ2(G)]2 = 1 4 . Since i = j happens nl times, and therefore i ̸= j happens n2 l − nl times, we arrive at the following expression: (cid:104) Rl+1(cid:105) E = (cid:18) 2 nl (cid:19)2 (cid:18) nlJ2,2 + (n2 l − nl) (cid:19)(cid:19) (cid:18) 1 4 = 4J2,2 − 1 nl + 1. Calculation of E (cid:2)Rl+1 sin2(θl+1)(cid:3) : Applying the identity (16), we get (cid:105) (cid:104) Rl+1 sin2(θl+1) E = = (cid:16) (cid:16)  nl(cid:88)  i,j  nl(cid:88)  i,j 2 n2 l 2 n2 l E E φ(Gi)φ( ˆGj) − φ(Gj)φ( ˆGi) (cid:17)2   φ2(Gi)φ2( ˆGj) − 2φ(Gi)φ( ˆGi)φ(Gj)φ( ˆGj) + φ2(Gj)φ2( ˆGi) (cid:17)   . In the case where i = j, the expected value is equal to 0. Thus, we only need to consider the case where i ̸= j, which happens n2 l − nl times. When i ̸= j, the expectation of φ(Gi)φ( ˆGi)φ(Gj)φ( ˆGj) is J 2 4 . All together, we have 1,1, and the expectation of φ2(Gi)φ2( ˆGj) is 1 (cid:105) (cid:104) Rl+1 sin2(θl+1) E = (cid:19) (cid:18) 2 n2 l (n2 l − nl) (cid:18) 1 4 − 2J 2 1,1 + (cid:19) 1 4 = (nl − 1)(1 − 4J 2 nl 1,1) . A.8 Variance and Covariance Calculations In this section, Var (cid:2)Rl+1(cid:3), Var (cid:2)Rl+1 sin2(θl+1)(cid:3), and Cov (cid:0)Rl+1 sin2(θl+1), Rl+1(cid:1) are evaluated. We use Ja,b to represent Ja,b(θl). Note that E[φ2(G)] = 1 2 , E[φ4(G)] = 3 2 . We will see that there are simple functions f1, f2 : R2 → R so that all of the variance and covariance calculations can be expressed as sums over i1, j1, i2, j2 of the form 1 n4 l (cid:88) (cid:16) (cid:104) f1(Gi1, ˆGj1)f2(Gi2, ˆGj2) (cid:105) E − E (cid:104) f1(Gi1, ˆGj1) (cid:105) E (cid:104) f2(Gi2, ˆGj2) (cid:105)(cid:17) , (60) i1,j1 i2,j2 where the sum goes over index configurations (i1, j1), (i2, j2) ∈ [nl]4. We will use this form to organize our calculations of the variance and covariance formulas. The strategy is to evaluate each term in the sum (60) individually. Since the random variables {Gi, ˆGi}n i=1 are exchangeable, the only thing that matters is the "pattern" of which of the indices i1, j1, i2, j2 are repeated versus which are distinct. For example, there will be n index configurations where i1 = j1 = i2 = j2 are all equal. All n of these give same contribution. There are (n)4 = n(n − 1)(n − 2)(n − 3) configurations where i1, j1, i2, j2 are all distinct. Knowing which indices are repeated/distinct allows us to evaluate the corresponding term in (60). We use the following formal notion of a pattern to organize this idea of repeated versus distinct indices. 27 Jakub and Nica Definition 17 A pattern for (i1, j1), (i2, j2) is a subset of all possible index configurations (i1, j1), (i2, j2) ∈ [n]4 represented by an assignment of each index to the letters a, b, c, d. Each letter a, b, c, d represents a choice of unique indices from [n]. For example, the pattern (i1, j1), (i2, j2) = (a, a), (a, a) represents the set of all index configurations where all indices are equal and the pattern (i1, j1), (i2, j2) = (a, b), (c, d) rep- resents the set with all indices unique. The pattern (i1, j1), (i2, j2) = (a, b), (a, c) represents all configurations where i1 = i2 and j1, j2 are unique and different from i1 = i2. For this pattern, there are (n)3 = n(n − 1)(n − 2) configurations by filling in a, b, c with unique numbers in [n]. More generally, for a pattern with k letters, there are (n)k configurations that fall into that pattern. Fortunately, when enumerating (60), many patterns have no contribution and can be ignored. We formalize this in the following definition. Definition 18 We say that the configuration of indices (i1, j1), (i2, j2) is reducible if {i1, j1} ∩ {i2, j2} = ∅. Otherwise, the index configuration is called irreducible. A pat- tern is called reducible if all index configuration in that pattern are reducible. By the independence of the random variables f1(Gi1, Gj1) and f2(Gi2, Gj2), whenever (i1, j1), (i2, j2) is reducible, we see that the corresponding term in (60) completely vanishes! Therefore, to evaluate (60), we have only to understand the contribution of irreducible configurations. The irreducible configurations can be organized into irreducible patterns. For example, the pattern (a, b), (c, c) is reducible (since formally {a, b} ∩ {c} = ∅) and so any configuration from this pattern has no contribution in the expectation. There are 11 irreducible patterns. (All these patterns are listed as part of Table 4.) The expected value of the terms for each pattern will give a contribution that is expressed in terms of the Ja,b depending on the details of exactly which indices are repeated. Then by enumerating the number of configurations in each pattern, we can evaluate (60). This strategy is precisely how we evaluate each variance/covariance in this section. Calculation of Var (cid:2)Rl+1(cid:3) : First, applying the identity in (17), we get (cid:104) Rl+1(cid:105) = Var (cid:19)4 (cid:18) 2 nl Var   nl(cid:88) i,j=1   φ2(Gi)φ2( ˆGj)    = 16 n4 l E       (cid:88) i1,j1 i2,j2  φ2(Gi1)φ2( ˆGj1)φ2(Gi2)φ2( ˆGj2)   − E   nl(cid:88)  2 φ2(Gi)φ2( ˆGj)  i,j=1     . Var[Rl+1] follows the form of (60), with f1(Gi, ˆGi) = f2(Gi, ˆGi) = φ2(Gi)φ2( ˆGj). We then evaluate the contribution from each irreducible pattern in Table 4. Combining all these cases and simplifying based on powers of 1 , we arrive at the following expression for nl Var (cid:2)Rl+1(cid:3): 4 nl (J2,2 + 1) + (cid:18) 2J4,2 − 5 2 16 n2 l J2,2 + J 2 2,2 + (cid:19) 5 8 + 16 n3 l 28 (cid:18) J4,4 − 2J4,2 − 2J 2 2,2 + 2J2,2 − (cid:19) . 9 8 Depth Degeneracy in Neural Networks # (i1, j1) (i2, j2) E[f1(Gi1, ˆGj1)] E[f2(Gi2, ˆGj2)] E[f1(Gi1, ˆGj1)f2(Gi2, ˆGj2)] Var[Rl+1] Calculation (n)1 (a, a) (a, a) (a, b) (a, b) (a, b) (b, a) (a, a) (a, b) (a, a) (b, a) (a, b) (a, a) (b, a) (a, a) (a, b) (a, c) (a, b) (c, b) (a, b) (c, a) (a, b) (b, c) (n)2 (n)3 J2,2 (cid:1)2 (cid:0) 1 2 J2,2 (cid:1)2 (cid:0) 1 2 (cid:1)2 (cid:0) 1 2 J2,2 (cid:1)2 (cid:0) 1 2 (cid:1)2 (cid:0) 1 2 J2,2 (cid:1)2 (cid:0) 1 2 J4,4 (cid:0) 3 (cid:1)2 2 J 2 2,2 1 2 J4,2 (cid:1)2 (cid:0) 1 2 3 2 (cid:0) 1 2 (cid:1)2 J2,2 Table 4: Var[Rl+1] calculated in the form of (60) with f1(Gi, ˆGj) = f2(Gi, ˆGj) = φ2(Gi)φ2( ˆGj). The contribution from all 11 possible irreducible patterns of the indices are shown. Calculation of Var (cid:2)Rl+1 sin2(θl+1)(cid:3) : Applying identity (16), we can express Var[Rl+1 sin2(θl+1)] as (cid:104) Var Rl+1 sin2(θl+1) (cid:105) = (cid:19)4 1 4 (cid:18) 2 nl Var   nl(cid:88) (cid:16) i,j=1 φ(Gi)φ( ˆGj) − φ(Gj)φ( ˆGi) (cid:17)2   . Note that we can express Var[Rl+1 sin2(θl+1)] as in (60) by letting f1(Gi, ˆGj) = f2(Gi, ˆGj) = (φ(Gi)φ( ˆGj) − φ(Gj)φ( ˆGi))2.We then evaluate the contribution from each irreducible pat- tern in Table 5. Combining all these cases and simplifying based on powers of 1 , we arrive nl at the following expression: (cid:104) Var + + 2 n2 l 2 n3 l Rl+1 sin2(θl+1) (cid:0)80J 4 1,1 − 96J 2 (cid:105) (cid:0)−8J 4 = 8 nl 1,1J2,2 − 40J 2 1,1 + 8J 2 1,1J2,2 + 4J 2 1,1 − 8J1,1J3,1 + J2,2 + 1(cid:1) 1,1 + 96J1,1J3,1 + 24J 2 2,2 − 12J2,2 − 32J 2 3,1 + 5(cid:1) (cid:0)−48J 4 1,1 + 64J 2 1,1J2,2 + 24J 2 1,1 − 64J1,1J3,1 − 24J 2 2,2 + 8J2,2 + 32J 2 3,1 − 9(cid:1) . 29 Jakub and Nica Var[Rl+1 sin2(θl+1)] Calculation # (i1, j1) (i2, j2) E[f (Gi1, ˆGj1)] E[f (Gi2, ˆGj2)] E[f (Gi1, ˆGj1)f (Gi2, ˆGj2)] (n)2 (n)3 (a, b) (a, b) (a, b) (b, a) (a, b) (a, c) (a, b) (c, a) (a, b) (a, b) (c, b) (b, c) 1 2 − 2J 2 1,1 1 2 − 2J 2 1,1 6J 2 2,2 − 8J 2 3,1 + 9 2 4J2,2J 2 1,1 − 4J3,1J1,1 + 1 2 J2,2 + 3 4 Table 5: Var[Rl+1 sin2(θl+1)] calculated in the form of (60) with f1(Gi, ˆGj) = f2(Gi, ˆGj) = (φ(Gi)φ( ˆGj) − φ(Gj)φ( ˆGi))2. The non-zero contribution irreducible patterns of the indices are shown. Note that because f1(Gi1, Gj1) = 0 when i1 = j1 and f2(Gi2, Gj2) = 0 when i2 = j2, there are 5 irreducible patterns (of the possible 11) that have zero contribution and are not displayed in this table. Cov(Rl+1, Rl+1 sin2(θl+1)) Calculation # (i1, j1) (i2, j2) E[f1(Gi1, ˆGj1)] E[f2(Gi2, ˆGj2)] E[f1(Gi1, ˆGj1)f2(Gi2, ˆGj2)] (n)2 (n)3 (a, b) (b, b) (a, b) (a, a) (a, b) (a, b) (a, b) (b, a) (a, b) (a, c) (a, b) (c, a) (a, b) (a, b) (b, c) (c, b) J2,2 J4,2 − 2J1,1J3,3 1 2 − 2J 2 1,1 (cid:1)2 (cid:0) 1 2 2,2 − 2J 2 J 2 3,1 + (cid:0) 3 2 (cid:1)2 Table 6: Cov (cid:0)Rl+1 sin2(θl+1), Rl+1(cid:1) calculated in the form of (60) with f1(Gi, ˆGj) = (φ(Gi)φ( ˆGj) − φ(Gj)φ( ˆGi))2, and f2(Gi, ˆGj) = φ2(Gi)φ2( ˆGj). The non-zero contribution from irreducible patterns of the indices are shown. Note that because f1(Gi1, Gj1) = 0 when i1 = j1, there are 3 irreducible patterns (of the possible 11) that have zero contribution which are not displayed in this table. Calculation of Cov (cid:0)Rl+1 sin2(θl+1), Rl+1(cid:1): Cov (cid:16) Rl+1 sin2(θl+1), Rl+1(cid:17) = E (cid:20)(cid:16) Rl+1(cid:17)2 sin2(θl+1) (cid:21) (cid:104) (cid:105) Rl+1 sin2(θl+1) (cid:104) Rl+1(cid:105) . E − E 30 Depth Degeneracy in Neural Networks Applying known identities (16, 17) derived in Appendix A.5 and Appendix A.6, we can express this in the form of (60), where f1(Gi, ˆGj) = (φ(Gi)φ( ˆGj) − φ(Gj)φ( ˆGi))2, and f2(Gi, ˆGj) = φ2(Gi)φ2( ˆGj). Table 6 shows the calculation of all the irreducible patterns. Collecting all cases and simplifying based on powers of 1 nl Rl+1 sin2(θl+1), Rl+1(cid:17) 1,1 − 32J1,1J3,1 + 8J2,2 + 8(cid:1) (cid:0)16J 2 gives: Cov = (cid:16) 1 nl 1,1J2,2 − 40J 2 1,1 + 96J1,1J3,1 − 32J1,1J3,3 + 16J 2 2,2 − 32J2,2 − 32J 2 3,1 + 16J4,2 + 10(cid:1) 1,1 − 32J 2 1,1J2,2 − 64J1,1J3,1 + 32J1,1J3,3 − 16J 2 2,2 + 24J2,2 + 32J 2 3,1 − 16J4,2 − 18(cid:1) . + + 1 n2 l 1 n3 l (cid:0)32J 2 (cid:0)24J 2 A.9 Infinite Width Update Rule Lemma 19 Let f (x) be a feed forward neural network as defined in 2. Conditional on the value of θl in layer l, the angle θl between inputs at layer l of f follows the following deterministic update rule in the limit nl → ∞. cos(θl+1) = 2J1,1(θl). Remark 20 Note that a more general proof of this result appears in prior work Hanin (2023) which allows one to take the layer sizes n1, n2, . . . , nl → ∞ in any order, rather than one layer at a time as we prove here. Proof We begin with the identity (15), and use the inner product to introduce cos(θl+1), ∥φl β∥ α∥∥φl nl nl(cid:88) i=1 2φ(Gi)φ( ˆGi) = ⟨φl+1 α , φl+1 β ⟩ = ∥φl+1 α ∥∥φl+1 β ∥cos(θl+1). Applying the identities in (14) to ∥φl+1 α ∥ and ∥φl+1 β ∥, we get ∥φl β∥ α∥∥φl nl nl(cid:88) i=1 2φ(Gi)φ( ˆGi) = =⇒ 1 nl nl(cid:88) i=1 φ(Gi)φ( ˆGi) = (cid:118) (cid:117) (cid:117) (cid:116) (cid:118) (cid:117) (cid:117) (cid:116) α∥2 ∥φl nl nl(cid:88) i=1 2φ2(Gi) (cid:118) (cid:117) (cid:117) (cid:116) ∥φl β∥2 nl nl(cid:88) i=1 2φ2( ˆGi) cos(θl+1), 1 nl nl(cid:88) i=1 φ2(Gi) (cid:118) (cid:117) (cid:117) (cid:116) 1 nl nl(cid:88) i=1 φ2( ˆGi) cos(θl+1). Now, in the limit nl → ∞ we have by application of the Law of Large Numbers, lim nl→∞ (cid:32) 1 nl nl(cid:88) i=1 (cid:33) φ(Gi)φ( ˆGi) = lim nl→∞   (cid:118) (cid:117) (cid:117) (cid:116) 1 nl nl(cid:88) φ2(Gi) (cid:118) (cid:117) (cid:117) (cid:116) 1 nl nl(cid:88) i=1  φ2( ˆGi) cos(θl+1)  =⇒ E (cid:104) (cid:105) φ(Gi)φ( ˆGi) = (cid:112) E [φ2(Gi)] E[φ2( ˆGi)] cos(θl+1) i=1 (cid:113) =⇒ J1,1(θl) = 1 2 cos(θl+1), where we have used the definition of J1,1(θ) and the fact that E[φ2(G)] = 1 2 . 31 Jakub and Nica Appendix B. B.1 Derivation of Lower-Order J Functions - Proof of Proposition 2 Proof to obtain the formula. First note the initial condition J0,0(0) = E[1{G > 0}] = 1 J ′ 0,0(θ), we take the derivative inside the expectation and have by the chain rule that [Of formula for J0,0] We find a differential equation that J0,0 satisfies and solve it 2 . To find 0,0(θ) = E[1{G > 0}1′{G cos θ + W sin θ > 0}G](− sin θ) J ′ + E[1{G > 0}1′{G cos θ + W sin θ > 0}W ] cos θ. Applying the change of variables as in (35), we have 0,0(θ) = E[(Z cos θ + Y sin θ)1{Z cos θ + Y sin θ > 0}1′{Z > 0}](− sin θ) J ′ + E[(Z sin θ − Y cos θ)1{Z cos θ + Y sin θ > 0}1′{Z > 0}] cos θ − sin θ √ 2π + E[(−Y cos θ)1{Y sin θ > 0}] = E[(Y sin θ)1{Y sin θ > 0}] cos θ √ 2π = (− sin2 θ − cos2 θ)E[Y 1{Y > 0}] 1 √ 2π = − 1 2π , √ where we have used (32) to evaluate the integrals involving 1′{Z > 0} and E[Y 1{Y > 2π with initial condition given by 0}] = ( J0,0(0) = 0. Solving this differential equation gives the desired result. 2π)−1 from Lemma 7. We now have J ′ 0,0(θ) = − 1 Proof [J1,0 and J1,1] Here we use the Gaussian integration-by-parts strategy (31 -32). Formula for J1,0: J1,0(θ) = E[G1{G > 0} 1{G cos θ + W sin θ > 0}] = E (cid:20) d dg ( 1{G > 0} 1{G cos θ + W sin θ > 0}) (cid:21) = E (cid:2)1′{G > 0} 1{G cos θ + W sin θ > 0}(cid:3) + E (cid:2)1{G > 0} 1′{G cos θ + W sin θ > 0}(cid:3) cos θ. By using the change of variables as in (35) on the second term, we arrive at J1,0(θ) = E[1{W sin θ > 0}] 1 √ 2π + cos θE[1{Z cos θ + Y sin θ > 0}1′{Z > 0}] = 1 2 1 √ 2π + cos θE[1{Y sin θ > 0}] 1 √ 2π = 1 2 1 √ 2π + cos θ 2 1 √ 2π = 32 1 + cos θ √ . 2 2π Depth Degeneracy in Neural Networks Formula for J1,1: J1,1(θ) = E[G(G cos θ + W sin θ)1{G > 0}1{G cos θ + W sin θ > 0}] = E[cos θ 1{G > 0}1{G cos θ + W sin θ}] + E[(G cos θ + W sin θ)1′{G > 0}1{G cos θ + W sin θ > 0}] + E[(G cos θ + W sin θ)1{G > 0}1′{G cos θ + W sin θ > 0}] cos θ = cos θJ0,0 + E[W sin θ 1{W sin θ > 0}] 1 √ 2π + E[Z1{Z cos θ + Y sin θ}1′{z > 0}] = cos θJ0,0 + sin θE[φ(W )] 1 √ 2π + 0 = sin θ + (π − θ) cos θ 2π . B.2 Proof of Explicit Formulas for Jn,0 and Jn,1 Once the recursion is established, the formula for both Jn,0 and Jn,1 is a simple proof by induction. We provide a detailed proof for Jn,0 here; Jn,1 is similar. n,0 be the recursively defined formula, and let J exp Lemma 21 Let J rec formula for Jn,0, namely n,0 be the explicitly defined n,0 := (n − 1)J rec J rec n−2,0 +  sinn−1 θ cos θ cn mod 2 J exp n,0 := (n − 1)! !    Jn mod 2,0 + cos θ cn mod 2 (n − 2)! ! , J rec 1,0 := J1,0, J rec 0,0 := J0,0, (cid:88) i̸≡n( mod 2) 0<i<n (i − 1)! ! i! ! sini θ     . n,0 = J exp n,0 for all n ≥ 0. Then J rec n,0 = J exp Proof Let Sn, n ∈ N, n ≥ 2 be the statement J rec Sn is true by induction. The base case S2 is true because, n,0 and J rec n−1,0 = J exp n−1,0. We prove J rec 2,0 = (2 − 1)J0,0 + (2 − 2)! ! = J0,0 + sin θ cos θ c2 mod 2 1 (cid:88) , cos θ sin θ 2π sin2i−1 θ 2π J exp 2,0 = (2 − 1)! ! J0,0 + cos θ (2 − 1)! ! (2i − 1)! ! i=1 (2i − 2)! ! = J0,0 + cos θ sin θ 2π , and the fact that J rec we have only to show that J exp sum to get 1,0 = J exp 1,0 is trivial. Induction step: Assume Sn is true. To prove Sn+1, n+1,0. To do this, we separate the last term of the n+1,0 = J rec J exp n+1,0 = n! !     J(n+1) mod 2,0 + cos θ c(n+1) mod 2 (cid:88) i̸≡(n+1)( mod 2) 0<i<n−1 (i − 1)! ! i! ! sini θ     + n! ! cos θ c(n+1) mod 2 (n − 1)! ! n! ! sinn θ. 33 Jakub and Nica Because the parity of n + 1 and n − 1 are the same, and using n! ! = n(n − 2)! ! we recognize the first term as nJ exp n−1,0. So after simplifying the last term, we remain with n+1,0 = nJ exp J exp n−1,0 + sinn θ cos θ c(n+1) mod 2 (n − 1)! ! = J rec n+1,0, by the induction hypothesis. This completes the induction. B.3 Bijection between Paths in Graphs of J Functions and the Bessel Number graphs P ,Q Let GJ ∗ = (VJ∗, EJ∗) be the graph of J ∗ a,b as in Figure 4c. Similarly, let GP = (VP , EP ) and GQ = (VQ, EQ) be the graph of the P and Q matrices up to row a, respectively, as in Figures 4a, 4b. We define a map λ : Z2 × Z2 → Z2 as follows: Let ((i, j), (m, n)) ∈ Z2 × Z2, 0 ≤ i ≤ a, b − a + m ≤ j ≤ b. Then define λ by λ((i, j), (m, n)) := (i − m, j − n), λ−1((i, j), (m, n)) = (i + m, j + n). The function λ can be used as a map between vertices of graph GJ ∗ to vertices of graph GP or GQ. Let π = (v1, v2, ..., vk−1, vk) be a path in GJ ∗ from vertex v1 = (m, n) to vertex vk = (a, b), where vi ∈ Z2, 1 ≤ i ≤ k is a vertex on the graph. λ extends to a map on paths, Λ, defined by Λ((v1, v2, ..., vk−1, vk)) :=(λ(v1, v1), λ(v2, v1), ..., λ(vk−1, v1), λ(vk, v1)), Λ−1((v1, v2, ..., vk−1, vk)) =(λ−1(v1, v1), λ−1(v2, v1), ..., λ−1(vk−1, v1), λ−1(vk, v1)). Now, let ΓJ ∗(a, b, m, n) be the set of all paths in the graph of J ∗ from J ∗ a,b, and let ΓP (a, b, m, n) be the set of all paths in the graph of P from P (0, 0) to P (a − m, b − n) = P (λ((a, b), (m, n))). For example, ΓJ ∗(6, 8, 0, 4) is the set of all paths which run from J ∗ 6,8 to J ∗ 0,4, and ΓP (6, 8, 0, 4) is the set of all paths which run from P (0, 0) to P (6, 4). With these definitions, Λ : ΓJ ∗(a, b, 0, n) → ΓP (a, b, 0, n) is a bijection. An illustration of all paths π ∈ Π(6, 8, 0, 6) and the corresponding paths Λ(π) ∈ ΓP (6, 8, 0, 6) is given in Figure 5. Similarly, if we let ΓQ(a, b, m, n) be the set of all paths from Q(0, 0) to Q(a − m, b − n) = Q(λ((a, b), (m, n))) then Λ : ΓJ ∗(a, b, 1, n) → ΓQ(a, b, 1, n) is a bijection. This bijection establishes the equality of the weighted paths claim in (45). m,n to J ∗ C. Recursions for the P and Q numbers - Proof of Lemma 10 Earlier work established the following properties of the P and Q numbers. Theorem 22 (Kreinin (2016)) The elements of the matrices P and Q satisfy b * P (a, b) = a * P (a − 1, b − 1), P (a + 1, b) = P (a, b − 1) + (b + 1) * P (a, b + 1), Q(a, b) = P (a, b) + (b + 1) * Q(a − 1, b + 1), Q(a, b) = a * Q(a − 2, b) + Q(a − 1, b − 1), a ≥ 1, 1 ≤ b ≤ a, a ≥ 0, 1 ≤ b ≤ a, a ≥ 1, 1 ≤ b ≤ a, a ≥ 2, 1 ≤ b ≤ a. (61) (62) (63) (64) 34 Depth Degeneracy in Neural Networks 8 7 6 8 7 6 8 7 6 8 7 6 8 7 6 8 7 6 J6,8 J6,8 J6,8 J6,8 J6,8 J6,8 5 J5,7 5 J5,7 5 J5,7 1 J5,7 1 J5,7 J4,8 J4,6 J4,8 J4,6 J4,8 J4,6 J4,8 4 J4,6 J4,8 4 J4,6 J4,8 3 J3,7 1 J3,7 1 J3,7 1 J3,7 J3,7 1 1 J5,7 1 J4,6 J3,7 3 J2,8 J2,6 J2,8 2 J2,6 J2,8 J2,6 J2,8 2 J2,6 J2,8 J2,6 J2,8 J2,6 1 J1,7 1 J1,7 1 J1,7 1 J1,7 1 J1,7 1 J1,7 1 J0,8 J0,6 J0,8 J0,6 J0,8 J0,6 J0,8 J0,6 J0,8 J0,6 J0,8 J0,6 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 P (0, 0) 1 P (0, 0) 1 P (0, 0) P (0, 0) 1 P (0, 0) P (0, 0) P (1, 1) 1 P (1, 1) 1 P (1, 1) P (1, 1) 1 P (1, 1) 1 P (1, 1) P (2, 0) P (2, 2) P (2, 0) 2 P (2, 2) P (2, 0) P (2, 2) P (2, 0) 2 P (2, 2) P (2, 0) P (2, 2) P (2, 0) P (2, 2) P (3, 1) 3 P (3, 1) 1 1 P (3, 1) 1 P (3, 1) 1 P (3, 1) 3 P (3, 1) P (4, 0) P (4, 2) P (4, 0) P (4, 2) P (4, 0) P (4, 2) P (4, 0) 4 P (4, 2) P (4, 0) 4 P (4, 2) P (4, 0) P (4, 2) P (5, 1) 5 P (5, 1) 5 P (5, 1) 5 P (5, 1) 1 P (5, 1) 1 1 P (5, 1) 1 P (6, 0) P (6, 2) P (6, 0) P (6, 2) P (6, 0) P (6, 2) P (6, 0) P (6, 2) P (6, 0) P (6, 2) P (6, 0) P (6, 2) 6 5 4 3 2 1 0 0 1 2 3 4 5 6 Figure 5: Top: All paths π ∈ ΓJ ∗(6, 8, 0, 6). Bottom: All paths Λ(π) ∈ ΓP (6, 8, 0, 6). The paths are lined up so that for each path π in the top row, Λ(π) appears in the bottom row. Proof [Of Lemma 10] Equation (62) tells us that P (a, b) = P (a−1, b−1)+(b+1)*P (a−1, b+ 1) for a ≥ 1, 1 ≤ b ≤ a−1, while equation (61) tells us that P (a−1, b+1) = (a−1) (b+1) *P (a−2, b) for a ≥ 2, 0 ≤ b ≤ a − 2. Putting these together, we get the following recurrence equation for P (a, b): P (a, b) = P (a − 1, b − 1) + (b + 1) (cid:18) (a − 1) (b + 1) (cid:19) * P (a − 2, b) = (a − 1) * P (a − 2, b) + P (a − 1, b − 1), which holds for a ≥ 3, 1 ≤ b ≤ a − 2. Further, looking at equation (64), we see that the recursion for the Q numbers is very similar to that of the P numbers, but with a coefficient of a rather than (a − 1). This establishes Lemma 10. 35 Jakub and Nica References Benny Avelin and Anders Karlsson. Deep limits and a cut-off phenomenon for neural networks. Journal of Machine Learning Research, 23(191):1–29, 2022. URL http:// jmlr.org/papers/v23/21-0431.html. Sam Buchanan, Dar Gilboa, and John Wright. Deep networks and the multiple manifold problem. In International Conference on Learning Representations, 2021. URL https: //openreview.net/forum?id=O-6Pm_d_Q-. Gi-Sang Cheon, Ji-Hwan Jung, and Louis W. Shapiro. Generalized Bessel numbers and some combinatorial settings. Discrete Mathematics, 313(20):2127–2138, 2013. ISSN 0012-365X. Youngmin Cho and Lawrence Saul. In Y. Bengio, D. Schuurmans, J. Lafferty, C. Williams, edi- tors, Advances in Neural Information Processing Systems, volume 22. Curran As- sociates, URL https://proceedings.neurips.cc/paper/2009/file/ 5751ec3e9a4feab575962e78e006250d-Paper.pdf. for deep learning. and A. Culotta, Kernel methods Inc., 2009. Benoit Dherin, Michael Munn, Mihaela Rosca, and David GT Barrett. Why neural net- works find simple solutions: The many regularizers of geometric complexity. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors, Advances in Neu- ral Information Processing Systems, 2022. URL https://openreview.net/forum?id= -ZPeUAJlkEu. Ronen Eldan and Ohad Shamir. The power of depth for feedforward neural networks. In Annual Conference Computational Learning Theory, 2015. Boris Hanin. Which neural net architectures give rise to exploding and vanishing gra- dients? In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. URL https://proceedings.neurips.cc/paper/2018/ file/13f9896df61279c928f19721878fac41-Paper.pdf. Boris Hanin. Random fully connected neural networks as perturbatively solvable hierarchies, 2023. URL https://arxiv.org/abs/2204.01058. Soufiane Hayou, Arnaud Doucet, and Judith Rousseau. On the impact of the activation In International Conference on Machine function on deep neural networks training. Learning, 2019. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into recti- In 2015 IEEE fiers: Surpassing human-level performance on imagenet classification. International Conference on Computer Vision (ICCV), pages 1026–1034, 2015. doi: 10.1109/ICCV.2015.123. Alexander Kreinin. Integer sequences connected to the Laplace continued fraction and Ramanujan's identity. Journal of Integer Sequences, 19:1–12, 06 2016. 36 Depth Degeneracy in Neural Networks Mufan Bill Li, Mihai Nica, and Daniel M. Roy. The neural covariance SDE: Shaped infinite depth-and-width networks at initialization. In Alice H. Oh, Alekh Agarwal, Danielle Bel- grave, and Kyunghyun Cho, editors, Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=WG3vmsteqR_. James Martens, Andy Ballard, Guillaume Desjardins, Grzegorz Swirszcz, Valentin Dalibard, Jascha Sohl-Dickstein, and Samuel S. Schoenholz. Rapid training of deep neural networks without skip connections or normalization layers using deep kernel shaping. CoRR, 2021. URL https://arxiv.org/abs/2110.01765. Ido Nachum, Jan Hazla, Michael Gastpar, and Anatoly Khina. A Johnson-Lindenstrauss framework for randomly initialized CNNs. In International Conference on Learning Rep- resentations, 2022. URL https://openreview.net/forum?id=YX0lrvdPQc. Exponential expressivity in deep neural networks Ben Poole, Subhaneil Lahiri, Maithra Raghu, Jascha Sohl-Dickstein, and Surya through transient Ganguli. chaos. I. Guyon, and R. Garnett, edi- tors, Advances in Neural Information Processing Systems, volume 29. Curran As- URL https://proceedings.neurips.cc/paper/2016/file/ sociates, 148510031349642de5ca0c544f31b2ef-Paper.pdf. In D. Lee, M. Sugiyama, U. Luxburg, Inc., 2016. Daniel A. Roberts, Sho Yaida, and Boris Hanin. The Principles of Deep Learning Theory: An Effective Theory Approach to Understanding Neural Networks. Cambridge University Press, 2022. doi: 10.1017/9781009023405. Samuel S. Schoenholz, Justin Gilmer, Surya Ganguli, and Jascha Sohl-Dickstein. Deep information propagation. In International Conference on Learning Representations, 2017. URL https://openreview.net/forum?id=H1W1UN9gg. 37
http://arxiv.org/abs/2303.05456v2
2023-05-14T14:54:29
2023-02-20T00:53:33
Restoration based Generative Models
Denoising diffusion models (DDMs) have recently attracted increasing attention by showing impressive synthesis quality. DDMs are built on a diffusion process that pushes data to the noise distribution and the models learn to denoise. In this paper, we establish the interpretation of DDMs in terms of image restoration (IR). Integrating IR literature allows us to use an alternative objective and diverse forward processes, not confining to the diffusion process. By imposing prior knowledge on the loss function grounded on MAP-based estimation, we eliminate the need for the expensive sampling of DDMs. Also, we propose a multi-scale training, which improves the performance compared to the diffusion process, by taking advantage of the flexibility of the forward process. Experimental results demonstrate that our model improves the quality and efficiency of both training and inference. Furthermore, we show the applicability of our model to inverse problems. We believe that our framework paves the way for designing a new type of flexible general generative model.
[ "Jaemoo Choi", "Yesom Park", "Myungjoo Kang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2303.05456v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2303.05456v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Restoration based Generative Models Jaemoo Choi * 1 Yesom Park * 1 Myungjoo Kang 1 3 2 0 2 y a M 4 1 ] G L . s c [ 2 v 6 5 4 5 0 . 3 0 3 2 : v i X r a Abstract Denoising diffusion models (DDMs) have re- cently attracted increasing attention by showing impressive synthesis quality. DDMs are built on a diffusion process that pushes data to the noise distribution and the models learn to denoise. In this paper, we establish the interpretation of DDMs in terms of image restoration (IR). Inte- grating IR literature allows us to use an alterna- tive objective and diverse forward processes, not confining to the diffusion process. By imposing prior knowledge on the loss function grounded on MAP-based estimation, we eliminate the need for the expensive sampling of DDMs. Also, we propose a multi-scale training, which improves the performance compared to the diffusion pro- cess, by taking advantage of the flexibility of the forward process. Experimental results demon- strate that our model improves the quality and efficiency of both training and inference. Further- more, we show the applicability of our model to inverse problems. We believe that our framework paves the way for designing a new type of flexible general generative model. 1. Introduction Generative modeling is a prolific machine learning task that the models learn to describe how a dataset is distributed and generate new samples from the distribution. The most widely used generative models primarily differ in their choice of bridging the data distribution to a tractable latent distribution (Goodfellow et al., 2020; Kingma & Welling, 2014; Rezende et al., 2014; Rezende & Mohamed, 2015; Sohl-Dickstein et al., 2015; Chen et al., 2022). In recent years, denoising diffusion models (DDMs) (Ho et al., 2020; Song & Ermon, 2019; Song et al., 2021b; Dockhorn et al., 2022a) have drawn considerable attention by demonstrat- *Equal contribution 1Department of Mathematical Sciences, Seoul National University, Seoul, South Korea. Correspondence to: Myungjoo Kang <[email protected]>. Proceedings of the 39 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). Figure 1: Conceptual comparison of RGMs and DDMs. Here, x is the original data, y is the degradation of x with noise ξ ∼ N (0, σ2I), and ˆx is the reconstruction of y. ing remarkable results. DDMs rely on a forward diffusion process that progressively transforms the data into Gaussian noise, and they learn to reverse the noising process. Albeit their enormous successes, their gradual denoising generative process gives rise to low inference efficiency. To pull latent variables back to the data distribution, the denoising pro- cess often requires hundreds or even thousands of network evaluations to sample a single instance. Many follow-up studies consider enhancing inference speed (Song et al., 2021a; Tachibana et al., 2021; Lu et al., 2022) or grafting with other generative models (Xiao et al., 2021a; Vahdat et al., 2021; Zhang & Chen, 2021; Pandey et al., 2022). In this study, we focus on a different perspective. We in- terpret the DDMs through the lens of image restoration (IR), which is a family of inverse problems for recover- ing the original images from corrupted ones (Castleman, 1996; Gunturk & Li, 2018). The corruption arises in vari- ous forms, including noising (Rudin et al., 1992; Buades et al., 2005) and downsampling (Farsiu et al., 2004). IR has been a long-standing problem because of its high practical value in various applications (Besag et al., 1991; Banham & Katsaggelos, 1997; Lehtinen et al., 2018; Ma et al., 2011). Generative ModelingImage RestorationMMSEMAPRGM(Ours)DDMs1σ2Aොx−y2+gොxRGMsDDMsForward Processy=Ax+ς(noising, blurring,downsampling, ..)y=x+ς(noising)Objectiveොx−x2 Restoration based Generative Models From the IR point of view, DDMs can be considered as IR models based on minimum mean square error (MMSE) estimation (Zervakis & Venetsanopoulos, 1991; Laumont et al., 2022), focusing only on the denoising task. Mathe- matically, IR is an ill-posed inverse problem in the sense that it does not admit a unique solution (Hadamard, 1902) and hence, leads to instability in reconstruction. Owing to the ill-posedness of IR, MMSE produces impertinent results. DDMs alleviate this problem by leveraging costly stochastic sampling, which has been regarded as an indispensable tool in the literature on DDMs. Inspired by this observation, we propose a new flexible fam- ily of generative models that we refer to restoration-based generative models (RGMs). We adopt an alternative objec- tive; a maximum a posteriori (MAP) based regularization (Hunt, 1977; Trussell, 1980), which is predominantly used in IR. This approach detours the ill-posedness by regular- izing the data fidelity loss by prior knowledge rather than doing costly iterative sampling. Prior knowledge can be utilized in a variety of ways. Moreover, we also have the freedom to design the degradation process. RGMs with variability of these two have several benefits: Implicit Prior knowledge Many hand-crafted regulariza- tion schemes (Tikhonov, 1963; Donoho, 1995; Baraniuk, 2007) encourage solutions to satisfy certain properties, such as smoothness and sparsity. However, for the purpose of density estimation, we parametrize the prior term to learn the statistical distance, e.g., Kullback–Leibler divergence or Wasserstein distance. We also introduce a random auxiliary variable to further ease the ill-posedness. Our MAP-based estimation allows a much smaller computational cost, re- taining the density estimating capability of DDMs. Various Forward process DDMs are buried in a Gaus- sian noising process. On the other hand, fluidity in the forward process of RGMs improves model performance because the behavior of generative models is significantly affected by how the data distribution is transformed into a simple distribution. As one instantiation, we design a degra- dation process that progressively reduces the dimension by block averaging the image, which improves performance. Our comprehensive empirical studies on image generation and inverse problems demonstrate that RGMs generate sam- ples rivaling the quality of DDMs with several orders of mag- nitude faster inference. In particular, our model achieves FID 2.47 on CIFAR10, with only seven network function evaluations. Furthermore, through rigorous experiments with various prior terms and degradation, we validate that our RGM framework is well-structured that opens the way for designing more efficient and flexible generative models. 2. Background Image Restoration A common inverse problem arising in image processing, including denoising and inpainting, is the estimation of an image x given a corrupted image y = Ax + ξ, (1) where A is a matrix that models the degradation process, and ξ ∼ N (0, Σ) is an additive noise. A family of such problems is known as image restoration (IR). A popular approach is the maximum-a-posteriori (MAP) estimation argmaxx log p (x | y) = log p (y | x) + log p (x) . (2) However, since the explicit density function log p (x) is intractable, they replace the objective (2) with argminx f (y, x) + g (x) , (3) 2 (Ax − y) (cid:13) (cid:0)Σ†(cid:1) 1 (cid:13) (cid:13) (cid:13) 2 where f (x, y)=−log p (y | x)= 1 (cid:13) (cid:13) 2 2 is the data fidelity term with the pseudoinverse (Moore, 1920) Σ† and g is a regularization term (or prior knowledge) that represents prior or constraints on the solution. Since (3) originated from the MAP objective, it is also called the MAP-based approach. Prior knowledge can be imposed in a variety of ways and the choice is crucial because the quality of the restoration varies according to different prior. Moreover, the ill-posedness nature of the inverse problem (1), that is non-uniqueness of the solution, necessitates the use of regularization. By imposing certain prior information about the desirable recovery, the prior knowledge g relieves the ill-posedness. Therefore, many researchers have been devoted to designing a proper prior g (Rudin et al., 1992; Mallat, 1999; Lunz et al., 2018). Denoising Generative Models Denoising diffusion mod- els (DDMs) (Ho et al., 2020; Song et al., 2021b) have re- cently emerged as the forefront of image synthesis research. Starting from the image distribution, they gradually corrupt the image x0 ∼ pdata into Gaussian noise over time through a forward diffusion process with a given noise schedule σt: q(t) (xt | x0) = N (cid:0)x0, σ2 t I(cid:1) , also known as VESDE (Song et al., 2021b). Another linear diffusion process named VPSDE is also leveraged, but since these two are known to be exchangeable with each other (Kim et al., 2022), the paper focuses on VESDE. DDMs pose the data generation as an iterative denoising procedure by learning the reverse of the forward process. As they are modeled with conditional Gaussian distributions, evidence lower bound (ELBO) (Sohl-Dickstein et al., 2015) could be simplified to the following objective with a weight λ (t) ≥ 0 (Ho et al., 2020; Song et al., 2021b): Ex0∼pdata,xt∼qσt (xt|x0) (cid:2)λ (t) (cid:107)Gθ (xt, t) − x0(cid:107)2 ΣT t=0 2 (cid:3) , (4) Restoration based Generative Models where Gθ is a neural network parametrized by θ. For each forward step t, (4) is the minimum mean square error (MMSE) objective. MMSE loss is simple and straight- forward to train, however, the solution is only optimized to ensure accordance with the degradation process because it only contains the recovery term. Consequently, MMSE is affected by ill-posedness. To be precise, when σt is large, (1) becomes highly ill-posed and possesses many solutions for a given observation. In this case, the MMSE solution av- erages all these candidate solutions, resulting in an atypical reconstruction. Recent works (Laumont et al., 2022; Kawar et al., 2021) have endeavored to resolve this problem by stochastic sampling, however, they suffer from notoriously low efficiency as they roll out thousands of trajectories. In a similar manner, DDMs utilize a sampling scheme that often requires hundreds to thousands of steps. In summary, there are two limitations of DDMs from the IR perspective: 1. The degradation process is restricted to Gaussian noising. 2. The inference efficiency is intrinsically low due to the MMSE estimator. 3. Method 3.1. MAP-based Estimation for Generation As alluded in Section 2, DDMs can be regarded as MMSE- grounded IR models, specialized in denoising. This obser- vation brings us a new perspective on the design of a family of flexible generative models. As an alternative to MMSE, we propose a new generative model based on (3): Ex∼pdata,y∼N (x,σ2I) (cid:20) 1 2σ2 (cid:107)Gθ(y) − y(cid:107)2 2 + λg(Gθ(y))) (cid:21) , (5) where the first term measures the data fidelity and the sec- ond term delivers the prior knowledge of the data distri- bution. It has been adopted as a standard approach for high-dimensional imaging problems and is known to be more relevant than MMSE in many applications (Saha et al., 2009; Bigdeli et al., 2019; Chen, 2016). By leveraging prior information on the solution, MAP-based approaches alle- viate the ill-posedness of the inverse problem (1), without the use of costly sampling. Therefore, carefully crafting the relevant prior term is crucial. We now show how one can execute an appropriate prior term for density estimation while alleviating the ill-posedness. Alleviation of ill-posedness Unlike the generic denoising task, it is necessary to bridge the image to the Gaussian noise to learn the data distribution. As the noise level increases, a single distorted observation has several solutions, which indicates that the ill-posedness deepens. Therefore, our generator Gθ should be able to recover diverse restorations from a degraded image to express the data distribution more abundantly. Since it is difficult for the regularization term to remedy all these problems on its own, we further offload the ill-posedness by introducing a random auxiliary variable z ∼ N (z | 0, I). In other words, we use the stochastic variable z as an input of Gθ. As Gθ (y, z) generates various restores for different z, it is more amenable to faithfully recovering the data distribution. Implicit Prior Knowledge For density estimation, the knowledge about the data distribution should be properly encoded in the prior term g of (5). However, since the explicit density of the data is inaccessible, we parameterize g to learn the prior. For each forward step, our new objective for the generator Gθ in conjunction with the z is given by: Ex∼pdata,y∼N (x,σ2I),z∼N (0,I) (cid:20) 1 2σ2 (cid:107)Gθ(y, z) − y(cid:107)2 + λgφ(Gθ(y, z)))] , 2 (6) where gφ is a learnable prior term parameterized by φ. For example, we can learn an implicit representation of the data by adopting gφ(x) = log (1 − Dφ (x)) − log Dφ (x) where Dφ is a discriminator trained coupled with Gθ. As Dφ gets close to the optimal, i.e., Dφ(x) = pdata(x)+pθ(x) , the ex- pectation of gφ approaches to Kullback–Leibler divergence (KLD) DKL(pθ||pdata), which leads the loss (6) with λ = 1 to agree with the following objective: pdata(x) Ex∼pdata,y∼N (x,σ2I) [DKL(pθ(x|y)||p(x|y))] + H(pθ), (7) where H denotes an entropy and pθ the distribution gener- ated by Gθ. The overall training procedure combined with all σ ∈ {σk}T k=1 is provided in Appendix B.2. Remark 3.1. Contrary to conventional IR literature whose prior term is pre-defined, our approach (6) tries to learn the prior term by coordinating with Gθ. This end-to-end training allows our MAP-inspired scheme to deliver more promising performance. Moreover, it is worth noting that our framework has the wide freedom in the choice of gφ without being tied to the discriminative learning for KLD ex- emplified above. Consequently, we further design the prior term by mounting maximum mean discrepancy (MMD) (Dziugaite et al., 2015) and distributed sliced Wasserstein distance (DSWD) (Nguyen et al., 2020) in Section 4. Small Denoising Steps A major downside of DDMs is their sampling inefficiency, which often requires hundreds to thousands of denoising steps to obtain a single image. By adopting regularization term g, our approach provides an avenue to offload the time-consuming sampling and enables significantly small denoising steps. For small degradation, we can obtain a restored image in one shot. But, as our restoration starts from the Gaussian noise, the data distribu- tion is not completely estimated. Therefore, we perform the Restoration based Generative Models Figure 2: Generated samples on LSUN Church (left) and CelebA-HQ (right). generation iteratively. In our experiments on CIFAR10, we generate a high-quality sample in four denoising steps. 3.2. Extension to General Restoration In Section 3.1, we proposed a denoising generative model based on MAP objective. However, from the IR perspective, it is not necessary to restrict the forward process to Gaussian noising (A = I) and it can be generalized to any family of degradation matrices A and noise factors Σ in (1). Utilizing the general forward process, we can learn the generative model by generalizing the loss function (6) as follows: Ex∼pdata,y∼N (Ax,Σ),z∼N (0,I) [λgφ(Gθ(y, z))) 2 (cid:13) (cid:13) (cid:13) 2 2 (A * Gθ(y, z) − y) (cid:13) (cid:0)Σ†(cid:1) 1 (cid:13) (cid:13) + 1 2 (cid:21) . (8) Therefore, RGM has an flexible structure that can permeate any forward process, and aids in designing a new generative model. Here, we propose a new model established upon super-resolution (SR). Multi-scale RGM Most DDMs maintain the image size during the diffusion process by adding noise to individual pixels. Consequently, they are very inefficient because they require a latent as much as dimension of pixel space that is much larger than the submanifold of the image space. Motivated by this, we take A as a block averaging filter that averages out 2 × 2 pixel values. Halving the image size at each coarsening step allows us a more expressive gen- erative model with a lower-dimensional latent distribution. Moreover, multi-scale training has proven to be an effective strategy for synthesizing large scale images (Denton et al., 2015; Karras et al., 2017b; Reed et al., 2017). Therefore, our model produces strikingly realistic images by progressively extracting spatial information. also analyze our model through extensive ablation studies. Furthermore, we show the capability of RGMs for solving inverse problems. We parametrize Gθ based on the UNet- like structure (Ronneberger et al., 2015) which was success- fully used in NCSN++ (Xiao et al., 2021a). The internal details of the implementation can be found in Appendix B. Setup Our RGMs have a free hand in designing the for- ward process (i.e. data fidelity) and the prior term. To verify the pliability of RGMs, we implement RGMs with diverse forward processes and regularization terms: • We consider three prior knowledge by leveraging KLD, MMD, and DSWD, where each stands for the measure- ment of the difference between two distributions. KLD measures how much two distributions diverge from each other entropically as introduced in Section 3.1. Using a kernel trick, MMD measures the mean squared differ- ence of the statistics of two sets of samples. DSWD estimates the difference by calculating the sliced Wasser- stein distance for two distributions for multiple projection vectors. With the Gaussian noise forward process, we call these models RGM-KLD-D, RGM-MMD-D, and RGM- DSWD-D, respectively. Here, the term "D" stands for "denoising". See Appendix B.2 for a detailed explanation. • Additional to the Gaussian noise forward process, which is primarily used in DDM, we also carry out an RGM- KLD with the multi-scale forward process introduced in Section 3.2. In this case, the image is corrupted by a downsampling filter together with additive noise. There- fore, the model (termed by RGM-KLD-SR (naive)) is de- manded to conduct upsampling and denoising at the same time. To ease the task, we separate the downsampling and noising processes and perform them alternatively. We call a model using this separated schedule RGM-KLD-SR. (See Appendix B.1 for details). 4. Experiments 4.1. 2D Toy Example This section evaluates the performance of the proposed RGMs on synthetic and several benchmark datasets. We We first employ a two-dimensional example to validate the effectiveness and flexibility of our framework. We adopt Restoration based Generative Models Table 1: Results on unconditional generation of CIFAR10. Model FID (↓) IS (↑) NFE (↓) Class RGM DDM RGM−DSWD−D RGM-KLD-D RGM-KLD-SR 3.11 3.04 2.47 NCSN (Song & Ermon, 2019) DDPM (Ho et al., 2020) Score SDE (VE) (Song et al., 2021b) Score SDE (VP) (Song et al., 2021b) Probability Flow (VP) (Song et al., 2021b) DDIM (50 steps) (Song et al., 2021a) Recovery EBM (Gao et al., 2021) LSGM (Vahdat et al., 2021) FastDDPM (T = 50) (Kong & Ping, 2021) VDM (Kingma et al., 2021) UDM (Kim et al., 2021) 25.3 3.21 2.20 2.41 3.08 4.67 9.58 2.10 3.41 4.00 2.33 Gotta Go Fast (Jolicoeur-Martineau et al., 2021b) 2.44 2.17 2.25 3.75 3.37 5.52 2.70 3.94 Subspace Diffusion (Jing et al., 2022) CLD (Dockhorn et al., 2022a) DDGAN (Xiao et al., 2021a) DEIS (Zhang & Chen, 2022) StyleGAN2+ES-DDPM (Lyu et al., 2022) DPM-Solver-3 (Lu et al., 2022) GENIE (Dockhorn et al., 2022b) GAN Others SNGAN+DGflow (Ansari et al., 2020) AutoGAN (Gong et al., 2019) TransGAN (Jiang et al., 2021) StyleGAN2 w/o ADA (Karras et al., 2020) StyleGAN2 w/ ADA (Karras et al., 2020) NVAE (Vahdat & Kautz, 2020) Glow (Kingma & Dhariwal, 2018) PixelCNN (Van Oord et al., 2016) VAEBM (Xiao et al., 2020) 9.62 12.4 9.26 8.32 2.92 23.5 48.9 65.9 12.2 9.08 9.14 9.68 8.87 9.46 9.89 9.68 9.83 8.78 8.30 9.87 8.98 - 10.1 - 4 4 7 1000 1000 2000 2000 140 50 180 147 50 1000 2000 1000 9.94 ≥ 1000 - 9.63 9.74 - - - 9.35 8.60 9.02 9.18 9.83 7.18 3.92 4.60 8.43 2000 4 15 101 30 20 25 1 1 1 1 1 1 1024 16 Despite this simple structure, the results confirm that our RGM with MMD is more efficient than MMSE. 4.2. Image Generation We compare the performance of our RGMs with several existing baselines. We use Fréchet Inception Distance (FID) and Inception Score (IS) as the evaluation metrics. We also report the number of network function evaluations (NFEs). For DDMs and RGMs, NFE value and real inference time are proportional. Following (Song et al., 2021b; Dockhorn et al., 2022a), we focus on the widely used CIFAR10 un- conditional image generation benchmark (Krizhevsky et al., 2009) and also validate the performance of RGMs on large- scale (256 × 256) images: CelebA-HQ (Liu et al., 2015) and LSUN Church (Yu et al., 2015). Tables 1 and 2 summarize the quantitative evaluations on CIFAR10 and CelebA-HQ, respectively. The qualitative performance of RGM-KLD-D is depicted in Figures 2 and 4. Results We can see that our models are comparable to the best existing DDMs on CIFAR10 and achieve the state- of-the-art FID score on CelebA-HQ-256. Although the best denoising models obtain better results than ours on CIFAR10, they use a much larger number of denoising steps (e.g. ScoreSDE with VESDE requires 2000 steps). Notably, our RGM-KLD-SR achieves FID 2.47 and IS 9.68 with Figure 3: Comparison of recovering density by MMSE versus three RGMs with different priors. All three RGMs are much more efficient than the MMSE approach. a mixture of Gaussian with eight components (Grathwohl et al., 2018) as a target distribution. Our results are depicted in Figure 3. As illustrated in the first column, we diffuse the data distribution through four different noise levels. From left to right, each of the columns represents the learned distribution of our RGMs with the regularization term pa- rameterized by KLD, MMD, DSWD, and lastly MMSE estimation. Effectiveness of MAP-based approach Figure 3 shows the benefits of our methodology over the MMSE approach. First, the rightmost column shows the failure of MMSE, where the modes of the distribution are connected and then missed. This tendency exacerbates as the noise level in- creases. Since the MMSE fails to reconstruct the data distribution even with a small rise in the noise level, the MMSE does not yield a satisfactory generative model with a small number of diffusion steps. Consequently, MMSE approaches, such as DDMs, require a large number of steps to stably recover the data distribution. On the other hand, by adding the prior knowledge our RGMs generate sam- ples from the multimodal distribution significantly better, which allow distribution recovery with a much smaller num- ber of forward processes than the MMSE approach. This demonstrates the effectiveness of using the prior term g. Flexibility of the prior term Our RGMs have the free- dom to parametrize the prior term g of (6). To demonstrate that the RGM framework universally works for variously parametrized prior terms, we manifoldly design the prior term by KLD, MMD, and DSWD. The results depicted in Figure 3 validate that RGMs parametrized in three different ways show consistent performance, where they are all more efficient than the MMSE estimator. In particular, MMD measures the distance between two distributions based on a pre-defined kernel, and hence g is fixed rather than learned. RGM-KLDMMSERGM-DSWDRGM-MMD Restoration based Generative Models Figure 4: CIFAR10 generated samples. only seven steps, which is state-of-the-art sampling FID performance when NFE is limited. The overall results con- firm that our method immediately eliminates the need for an expensive sampling scheme while still maintaining the density estimating capability of DDMs. Interestingly, RGM- KLD-SR outperforms RGM-KLD-D by a large margin even with far fewer latent variables than RGM-KLD-D. This im- proved performance may be attributed to the increase in NFE; however, the FID of RGM-KLD-D with T = 8 re- ported in Table 7 confirms that it is not. In addition, RGM with the DSWD prior term retains comparable performance. This verifies that our MAP-inspired objective (6) works universally well, not being tied to how we parametrize the prior term. The overall results indicate that the prior knowl- edge regularized estimation of RGMs is a promising way of generating high-quality samples in limited steps. More uncurated images can be founded in Appendix C.5. Table 2: Results on generation of CelebA-HQ-256. Class RGM DDM GAN VAE Model RGM-KLD-D Score SDE (VP) (Song et al., 2021b) Probability Flow (Song et al., 2021b) LSGM (Vahdat et al., 2021) UDM (Kim et al., 2021) DDGAN (Xiao et al., 2021a) PGGAN (Karras et al., 2017a) Adv. LAE (Pidhorskyi et al., 2020) VQ-GAN (Esser et al., 2021) DC-AE (Parmar et al., 2021) NVAE (Vahdat & Kautz, 2020) VAEBM (Xiao et al., 2020) NCP-VAE (Aneja et al., 2021) FID (↓) NFE (↓) 7.15 7.23 128.13 7.22 7.16 7.64 8.03 19.2 10.2 15.8 29.7 20.4 24.8 4 4000 335 23 2000 4 1 1 1 1 1 1 1 4.3. Ablation Studies This section is devoted to validating that the structure of the RGM framework is well-organized, with all parts of our objective, including fidelity term, prior knowledge, auxiliary variable, and regularization parameter, faithfully fulfilling their respective roles. For a fair comparison, we used the same network for all experiments. Figure 5: Study on the effect of auxiliary variable z. Figure 6: FIDs for different regularization parameter λ. On the effect of Varying λ We investigate the sensitivity of the regularization parameter λ in (6). Since it controls the relative importance between the fidelity term and the prior term, λ is a trade-off hyperparameter that determines how much regularizes the joint distribution of pk and pk+1. In Figure 6, we present FID scores measured on CIFAR10 with the same number of degradation steps (T = 4) and varying λ. We can see that our models are quite robust with respect to λ. An empirically observed sweet spot of λ is d/10 ≤ λ ≤ d for the image size d, in which FID is no longer improved outside this threshold. For small λ, the models put a lot of effort to recover the degradation, which hinders estimating data distribution. Choosing a large λ also results in performance degeneration. On the Importance of Fidelity term The results of RGMs trained without the fidelity term also draw our atten- tion. Table 3 shows that the FID scores of both RGM-KLD- D and RGM-DSWD-D degenerate when there is no fidelity term. In particular, looking at RGM-DSWD-D, the perfor- mance without fidelity term is inferior to the vanilla DSWD model despite using multiple timesteps. This demonstrates that the performance improvement of our model is not solely due to the power of the existing generative models we used to design the prior knowledge. On the other hand, including the fidelity term significantly improves performance. In particular, RGM-DSWD-D achieves more than two times performance improvement over the vanilla DSWD. The ab- lation studies we discuss here confirm that RGMs owe the performance improvement to the fidelity term, not simply because we borrow the expressivity from the regularization term. We further observe that with the help of the fidelity term, our model enhances the mode-collapsing resiliency of GAN (See Figure 18). Overall results validate that the per- formance of RGMs owes to both fidelity and prior term, and the reliable regularization parameter should be determined to balance these two terms. On the role of z We include experimental results on LSUN church, which demonstrate how the auxiliary vari- able z alleviates the ill-posedness of the inverse problem. By noising the upper-left image x0, we obtain the forward trajectory {xk}4 k=1. The figures on the right are restored x0x1x2x3x4 Restoration based Generative Models Figure 7: Colorization (left) and super-resolution (right) results on LSUN and CelebA-HQ datasets. Table 3: Ablation studies of RGMs on CIFAR10. Gaussian noise. This is reflected in the poor FID score. Model Multi-step Fidelity RGM-KLD-D RGM-DSWD-D RGM-KLD-SR (naive) RGM-KLD-SR (cid:55) (cid:55) (cid:51) (cid:51) (cid:51) (cid:55) (cid:51) (cid:51) (cid:51) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:51) (cid:55) (cid:55) (cid:51) (cid:51) (cid:51) z (cid:55) (cid:51) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:51) (cid:51) (cid:51) FID (↓) 42.8 14.6 32.5 3.87 3.04 7.12 16.3 3.14 3.17 2.47 images of xk by RGM-KLD-D together with four different z. We can see that reconstruction is almost unique when the noise level is small. But, as the noise level increases, a single xk has various reconstructions. It is evident that assigning z helps generate different denoised images from a heavily degraded xk through the guidance provided by z. However, one might think that the ill-posedness is de- toured by multi-step training using multiple σk rather than through z. This claim can be refuted using the result of RGM-KLD-D without z reported in Table 3. We observe the significant difference in FIDs of RGM-KLD-D with and without z under the same number of denoising steps, which indicates the effectiveness of z. We also study the forward process schedule of the SR model. We can observe that the separation of the same forward pro- cess into two steps makes the model easier to learn, and this brings the performance enhancement of RGM-KLD-SR compared to RGM-KLD-SR (naive). From this, we would like to point out that properly designing the forward process can significantly increase performance. We leave the devel- opment of more useful and rigorous forward process as a promising future direction. 4.4. Inverse Problems While our model was originally devised to generate images, we further show the applicability of RGMs to inverse prob- lems. Recently, a promising approach in imaging inverse problems is to leverage a learned denoiser as an alternative to the proximal operator of splitting algorithms (Romano et al., 2017; Hurault et al., 2021). Such methodology is referred to as Plug-and-Play (PnP) algorithms (Venkatakrishnan et al., 2013). In a similar spirit, we utilize the trained RGMs as a modular part of the PnP algorithms to solve various inverse problems. In this section, we testify our RGM-KLD-D for two inverse problems; SR and colorization, by plugging our model into Douglas-Rachford Splitting algorithm (Lions & Mercier, 1979). Details can be found in Appendix B.4. On the forward process schedule Since the forward pro- cess determines the way of connecting the data and latent distributions, it significantly affects the performance of mod- els. The first important factor is the number of forward steps T , which is directly related to NFE. In Table 3, we ablate the effect of T . When T = 1, it may be difficult for the model to directly approximate the data distribution from the Results We compare the performance of our model with current-leading models: We compare our model with DDRM (Kawar et al., 2022), which solves inverse prob- lems with a pre-trained DDPM by a posterior sampling scheme. As a GAN baseline, we adopt StyleSwin (Zhang et al., 2022) and reconstruct the image by optimizing over the latent vector (Pan et al., 2021). We also consider bicu- OriginalGrayscaleOursDDRMDownsampledOursBicubicGAN baselineDDRMGAN baselineColorizationSuper-Resolution (×8) Restoration based Generative Models Table 4: Quantitative comparison of RGM-KLD-D and RGM-KLD-SR on image reconstruction. Model Super-Resolution Denoising (×2) (×4) (σ = 10/255) (σ = 20/255) (σ = 40/255) PSNR SSIM PSNR SSIM PSNR SSIM PSNR SSIM PSNR SSIM RGM-KLD-D RGM-KLD-SR 26.63 27.42 0.88 0.90 20.84 21.14 0.58 0.59 30.11 29.41 0.93 0.92 26.57 25.87 0.86 0.84 24.23 23.53 0.80 0.77 bic interpolation as a baseline for super-resolution. We observe that our model is capable of reconstructing faith- ful and realistic images, as evident in Figure 7. Compared with baselines, our model produces high-quality reconstruc- tions across all the datasets. In particular, our model shows promising performance for colorization. These results show the applicability of RGMs to PnP prior, and this will bring a range of potential applications, including image segmen- tation, conditional generation, and other imaging inverse problems. Additional quantitative and qualitative results are provided in Appendix C.3. Comparison of RGM-D and RGM-SR We investigate the effect of the degradation process used during training on the performance of solving inverse problems. We com- pare the reconstruction performance of RGM-KLD-D and RGM-KLD-SR which are trained on different degradation processes by applying both models to denoising and super- resolution (SR) tasks on CIFAR10. Quantitative results are presented in Table 4. We can see that the RGM-KLD-SR that is trained based on SR actually performs the SR task better. Also, we can observe a similar tendency for denois- ing. The results confirm that the degradation process used in training actually helps in solving the corresponding inverse problem. 5. Related Work In recent years, DDMs (Ho et al., 2020; Song & Ermon, 2019; Song et al., 2021b) have emerged as a class of density estimation models, first sparked by (Sohl-Dickstein et al., 2015). They define a sampling process as the reverse of a forward diffusion process that maps data to Gaussian noise by consecutively adding a small portion of the noise to the input data. DDMs are known to faithfully estimate the data distribution and generate high-fidelity samples, however, their major drawback is slow and expensive sampling speed. Many studies have been dedicated to circumventing this downside by developing a fast numerical solver (Jolicoeur- Martineau et al., 2021a; Zhang & Chen, 2022; Tachibana et al., 2021; Liu et al., 2022) or using an alternative nois- ing process such as non-Markovian (Song et al., 2021a), a second-order Langevin dynamics (Dockhorn et al., 2022a), and non-linear diffusion processes (De Bortoli et al., 2021; Chen et al., 2022). Another line of work improves sampling efficiency by incorporating it into other generative models, including GAN (Xiao et al., 2021a; Lyu et al., 2022), and VAE (Vahdat & Kautz, 2020). Xiao et al. (2021a) which enjoys small sampling steps by using GAN is one of our re- lated works. On a side note, all the aforementioned models use the Gaussian noising process as the forward process. Recently, the literature has begun to replace the additive Gaussian noising process with other transforms. Breaking away from the diffusion process, (Rissanen et al., 2022) proposed a forward blurring process inspired by heat dis- sipation. They suggest a new generation process, but they specialize in the proposed blurring process and cannot be incompatible with other degradation processes. Possibly the closest study to our work is Cold Diffusion (Bansal et al., 2022) which generalizes the diffusion process to arbitrary image transformations. It seems to use a general trans- form similar to our models, but Cold Diffusion only uses deterministic degradation processes by entirely removing additive Gaussian noise, which hinders its density estima- tion performance. Also, they use the MMSE objective, still requiring an array of several forward steps. We include a comparison with these related works in Appendix C.2. 6. Conclusion and Future Work In this study, we presented a general framework for mod- eling efficient generative models through the lens of IR. Compared to DDMs whose both forward and reverse pro- cesses are fixed to thousands of Gaussian steps, our ap- proach provides more flexible models that eliminate expen- sive sampling and can enjoy versatile forward processes. We eliminated the usage of slow sampling by taking on the MAP-based approach and incorporating implicit priors. In addition, we propose a multi-scale method as an example of the usability of various forward processes. The experimen- tal results showed that the image quality obtained was on par with the leading DDMs, and we achieved state-or-the- art performance using a limited number of forward steps. We hope that this work provides a broad view of modeling useful generative models. Our model has two degrees of freedom: One is how to parametrize the prior knowledge, and the other is the choice of the forward process. Designing new prior terms and degradation processes would be an interesting direction for future research. Future work could include the comprehen- Restoration based Generative Models sive design of a convergence-guaranteed PnP algorithm for application to various inverse problems. We leave these fur- ther extensions to future work. Furthermore, notwithstand- ing the high performance, our methodology lacks theoretical justification. We also leave this as interesting future work. Acknowledgements by supported This work was the NRF grant [2012R1A2C3010887] and the MSIT/IITP ([1711117093], [2021-0-00077], [No. 2021-0-01343, Artificial Intelligence Graduate School Program(SNU)]). The author appreci- ate the financial support provided by the Data-driven Flow Modeling Research Laboratory funded by the Defense Acquisition Program Administration under Grant UD230015SD. We are also grateful to Jaewoong Choi and Changyeon Yoon for reviewing an early draft of this paper and providing thoughtful feedback. References Aneja, J., Schwing, A., Kautz, J., and Vahdat, A. A con- trastive learning approach for training variational autoen- coder priors. Advances in neural information processing systems, 34:480–493, 2021. Ansari, A. F., Ang, M. L., and Soh, H. Refining deep generative models via discriminator gradient flow. arXiv preprint arXiv:2012.00780, 2020. Banham, M. R. and Katsaggelos, A. K. Digital image IEEE signal processing magazine, 14(2): restoration. 24–41, 1997. Bansal, A., Borgnia, E., Chu, H.-M., Li, J. S., Kazemi, H., Huang, F., Goldblum, M., Geiping, J., and Goldstein, T. Cold diffusion: Inverting arbitrary image transforms without noise. arXiv preprint arXiv:2208.09392, 2022. Baraniuk, R. G. Compressive sensing [lecture notes]. IEEE signal processing magazine, 24(4):118–121, 2007. Besag, J., York, J., and Mollié, A. Bayesian image restora- tion, with two applications in spatial statistics. Annals of the institute of statistical mathematics, 43(1):1–20, 1991. Bigdeli, S., Honzátko, D., Süsstrunk, S., and Dunbar, L. A. Image restoration using plug-and-play cnn map denoisers. arXiv preprint arXiv:1912.09299, 2019. Boyd, S., Parikh, N., Chu, E., Peleato, B., Eckstein, J., et al. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations and Trends® in Machine learning, 3(1):1–122, 2011. Buades, A., Coll, B., and Morel, J.-M. A non-local al- gorithm for image denoising. In 2005 IEEE computer society conference on computer vision and pattern recog- nition (CVPR'05), volume 2, pp. 60–65. Ieee, 2005. Castleman, K. R. Digital image processing. Prentice Hall Press, 1996. Chen, T., Liu, G.-H., and Theodorou, E. A. Likelihood training of schrödinger bridge using forward-backward sdes theory. The International Conference on Learning Representations, 2022. Chen, Y. Higher-order mrfs based image super resolution: why not map? IET Image Processing, 10(4):297–303, 2016. Daras, G., Delbracio, M., Talebi, H., Dimakis, A. G., and Milanfar, P. Soft diffusion: Score matching for general corruptions. arXiv preprint arXiv:2209.05442, 2022. De Bortoli, V., Thornton, J., Heng, J., and Doucet, A. Diffu- sion schrödinger bridge with applications to score-based generative modeling. Advances in Neural Information Processing Systems, 34:17695–17709, 2021. Denton, E. L., Chintala, S., Fergus, R., et al. Deep generative image models using a laplacian pyramid of adversarial networks. Advances in neural information processing systems, 28, 2015. Dockhorn, T., Vahdat, A., and Kreis, K. Score-based gener- ative modeling with critically-damped langevin diffusion. The International Conference on Learning Representa- tions, 2022a. Dockhorn, T., Vahdat, A., and Kreis, K. Genie: Higher- order denoising diffusion solvers. Advances in Neural Information Processing Systems, 2022b. Donoho, D. L. De-noising by soft-thresholding. IEEE transactions on information theory, 41(3):613–627, 1995. Dziugaite, G. K., Roy, D. M., and Ghahramani, Z. Training generative neural networks via maximum mean discrep- ancy optimization. arXiv preprint arXiv:1505.03906, 2015. Esser, P., Rombach, R., and Ommer, B. Taming transformers for high-resolution image synthesis. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 12873–12883, 2021. Brock, A., Donahue, J., and Simonyan, K. Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018. Farsiu, S., Robinson, M. D., Elad, M., and Milanfar, P. Fast and robust multiframe super resolution. IEEE transac- tions on image processing, 13(10):1327–1344, 2004. Restoration based Generative Models Gao, R., Song, Y., Poole, B., Wu, Y. N., and Kingma, D. P. Learning energy-based models by diffusion recovery like- lihood. Advances in neural information processing sys- tems, 2021. Jolicoeur-Martineau, A., Li, K., Piché-Taillefer, R., Kach- man, T., and Mitliagkas, I. Gotta go fast when gen- erating data with score-based models. arXiv preprint arXiv:2105.14080, 2021a. Geman, D. and Yang, C. Nonlinear image recovery with half-quadratic regularization. IEEE transactions on Im- age Processing, 4(7):932–946, 1995. Gong, X., Chang, S., Jiang, Y., and Wang, Z. Autogan: Neural architecture search for generative adversarial net- works. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 3224–3234, 2019. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. Generative adversarial networks. Communications of the ACM, 63(11):139–144, 2020. Grathwohl, W., Chen, R. T., Bettencourt, J., Sutskever, I., and Duvenaud, D. Ffjord: Free-form continuous dy- namics for scalable reversible generative models. arXiv preprint arXiv:1810.01367, 2018. Gunturk, B. and Li, X. Image restoration. CRC Press, 2018. Hadamard, J. Sur les problèmes aux dérivées partielles et leur signification physique. Princeton university bulletin, pp. 49–52, 1902. Ho, J., Jain, A., and Abbeel, P. Denoising diffusion proba- bilistic models. Advances in Neural Information Process- ing Systems, 33:6840–6851, 2020. Hoogeboom, E. and Salimans, T. Blurring diffusion models. arXiv preprint arXiv:2209.05557, 2022. Hunt, B. R. Bayesian methods in nonlinear digital image restoration. IEEE Transactions on Computers, 26(03): 219–229, 1977. Hurault, S., Leclaire, A., and Papadakis, N. Gradient step denoiser for convergent plug-and-play. arXiv preprint arXiv:2110.03220, 2021. Hurault, S., Leclaire, A., and Papadakis, N. Proxi- mal denoiser for convergent plug-and-play optimiza- arXiv preprint tion with nonconvex regularization. arXiv:2201.13256, 2022. Jiang, Y., Chang, S., and Wang, Z. Transgan: Two transformers can make one strong gan. arXiv preprint arXiv:2102.07074, 1(3), 2021. Jing, B., Corso, G., Berlinghieri, R., and Jaakkola, T. Subspace diffusion generative models. arXiv preprint arXiv:2205.01490, 2022. Jolicoeur-Martineau, A., Li, K., Piché-Taillefer, R., Kach- man, T., and Mitliagkas, I. Gotta go fast when gen- erating data with score-based models. arXiv preprint arXiv:2105.14080, 2021b. Karras, T., Aila, T., Laine, S., and Lehtinen, J. Progres- sive growing of gans for improved quality, stability, and variation. arXiv preprint arXiv:1710.10196, 2017a. Karras, T., Aila, T., Laine, S., and Lehtinen, J. Progres- sive growing of gans for improved quality, stability, and variation. arXiv preprint arXiv:1710.10196, 2017b. Karras, T., Aittala, M., Hellsten, J., Laine, S., Lehtinen, J., and Aila, T. Training generative adversarial networks with limited data. Advances in Neural Information Pro- cessing Systems, 33:12104–12114, 2020. Kawar, B., Vaksman, G., and Elad, M. Snips: Solving noisy inverse problems stochastically. Advances in Neural Information Processing Systems, 34:21757–21769, 2021. Kawar, B., Elad, M., Ermon, S., and Song, J. Denoising diffusion restoration models. Advances in Neural Infor- mation Processing Systems, 2022. Kim, D., Shin, S., Song, K., Kang, W., and Moon, I.-C. Score matching model for unbounded data score. arXiv preprint arXiv:2106.05527, 2021. Kim, D., Shin, S., Song, K., Kang, W., and Moon, I.-C. Soft truncation: A universal training technique of score- based diffusion model for high precision score estimation. In International Conference on Machine Learning, pp. 11201–11228. PMLR, 2022. Kingma, D., Salimans, T., Poole, B., and Ho, J. Varia- tional diffusion models. Advances in neural information processing systems, 34:21696–21707, 2021. Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. Kingma, D. P. and Dhariwal, P. Glow: Generative flow with invertible 1x1 convolutions. Advances in neural information processing systems, 31, 2018. Kingma, D. P. and Welling, M. Auto-encoding variational bayes. International conference on machine learning, 2014. Kong, Z. and Ping, W. On fast sampling of diffusion proba- bilistic models. arXiv preprint arXiv:2106.00132, 2021. Restoration based Generative Models Krizhevsky, A., Hinton, G., et al. Learning multiple layers Moore, E. H. On the reciprocal of the general algebraic of features from tiny images. 2009. matrix. Bull. Am. Math. Soc., 26:394–395, 1920. Laumont, R., Bortoli, V. D., Almansa, A., Delon, J., Dur- mus, A., and Pereyra, M. Bayesian imaging using plug & play priors: when langevin meets tweedie. SIAM Journal on Imaging Sciences, 15(2):701–737, 2022. Lehtinen, J., Munkberg, J., Hasselgren, J., Laine, S., Kar- ras, T., Aittala, M., and Aila, T. Noise2noise: Learning image restoration without clean data. arXiv preprint arXiv:1803.04189, 2018. Li, C.-L., Chang, W.-C., Cheng, Y., Yang, Y., and Póczos, B. Mmd gan: Towards deeper understanding of moment matching network. Advances in neural information pro- cessing systems, 30, 2017. Li, Y., Swersky, K., and Zemel, R. Generative moment matching networks. In International conference on ma- chine learning, pp. 1718–1727. PMLR, 2015. Lions, P.-L. and Mercier, B. Splitting algorithms for the sum of two nonlinear operators. SIAM Journal on Numerical Analysis, 16(6):964–979, 1979. Liu, L., Ren, Y., Lin, Z., and Zhao, Z. Pseudo numeri- cal methods for diffusion models on manifolds. arXiv preprint arXiv:2202.09778, 2022. Liu, Z., Luo, P., Wang, X., and Tang, X. Deep learning face attributes in the wild. In Proceedings of the IEEE international conference on computer vision, pp. 3730– 3738, 2015. Lu, C., Zhou, Y., Bao, F., Chen, J., Li, C., and Zhu, J. Dpm-solver: A fast ode solver for diffusion probabilistic model sampling in around 10 steps. Advances in Neural Information Processing Systems, 2022. Lunz, S., Öktem, O., and Schönlieb, C.-B. Adversarial regularizers in inverse problems. Advances in neural information processing systems, 31, 2018. Lyu, Z., Xu, X., Yang, C., Lin, D., and Dai, B. Accelerating diffusion models via early stop of the diffusion process. arXiv preprint arXiv:2205.12524, 2022. Ma, J., Huang, J., Feng, Q., Zhang, H., Lu, H., Liang, Z., and Chen, W. Low-dose computed tomography image restoration using previous normal-dose scan. Medical physics, 38(10):5713–5731, 2011. Mallat, S. A wavelet tour of signal processing. Elsevier, 1999. Meng, C., Song, Y., Song, J., Wu, J., Zhu, J.-Y., and Ermon, S. Sdedit: Image synthesis and editing with stochastic differential equations. arXiv preprint arXiv:2108.01073, 2021. Neal, R. M. Probabilistic inference using Markov chain Monte Carlo methods. Department of Computer Science, University of Toronto Toronto, ON, Canada, 1993. Nguyen, K., Ho, N., Pham, T., and Bui, H. Distributional sliced-wasserstein and applications to generative model- ing. arXiv preprint arXiv:2002.07367, 2020. Pan, X., Zhan, X., Dai, B., Lin, D., Loy, C. C., and Luo, P. Exploiting deep generative prior for versatile image restoration and manipulation. IEEE Transactions on Pat- tern Analysis and Machine Intelligence, 2021. Pandey, K., Mukherjee, A., Rai, P., and Kumar, A. Dif- fusevae: Efficient, controllable and high-fidelity gen- eration from low-dimensional latents. arXiv preprint arXiv:2201.00308, 2022. Parikh, N., Boyd, S., et al. Proximal algorithms. Founda- tions and trends® in Optimization, 1(3):127–239, 2014. Parmar, G., Li, D., Lee, K., and Tu, Z. Dual contradistinctive generative autoencoder. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 823–832, 2021. Pidhorskyi, S., Adjeroh, D. A., and Doretto, G. Adversarial latent autoencoders. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14104–14113, 2020. Reed, S., Oord, A., Kalchbrenner, N., Colmenarejo, S. G., Wang, Z., Chen, Y., Belov, D., and Freitas, N. Parallel multiscale autoregressive density estimation. In Interna- tional conference on machine learning, pp. 2912–2921. PMLR, 2017. Reehorst, E. T. and Schniter, P. Regularization by denoising: Clarifications and new interpretations. IEEE transactions on computational imaging, 5(1):52–67, 2018. Rezende, D. and Mohamed, S. Variational inference with normalizing flows. In International conference on ma- chine learning, pp. 1530–1538. PMLR, 2015. Rezende, D. J., Mohamed, S., and Wierstra, D. Stochastic backpropagation and approximate inference in deep gen- erative models. In International conference on machine learning, pp. 1278–1286. PMLR, 2014. Rissanen, S., Heinonen, M., and Solin, A. Generative modelling with inverse heat dissipation. arXiv preprint arXiv:2206.13397, 2022. Restoration based Generative Models Romano, Y., Elad, M., and Milanfar, P. The little engine that could: Regularization by denoising (red). SIAM Journal on Imaging Sciences, 10(4):1804–1844, 2017. Van Oord, A., Kalchbrenner, N., and Kavukcuoglu, K. Pixel recurrent neural networks. In International conference on machine learning, pp. 1747–1756. PMLR, 2016. Ronneberger, O., Fischer, P., and Brox, T. U-net: Convolu- tional networks for biomedical image segmentation. In In- ternational Conference on Medical image computing and computer-assisted intervention, pp. 234–241. Springer, 2015. Rudin, L. I., Osher, S., and Fatemi, E. Nonlinear total variation based noise removal algorithms. Physica D: nonlinear phenomena, 60(1-4):259–268, 1992. Saha, S., Boers, Y., Driessen, H., Mandal, P. K., and Bagchi, A. Particle based map state estimation: A comparison. In 2009 12th International Conference on Information Fusion, pp. 278–283. IEEE, 2009. Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. Deep unsupervised learning using nonequi- librium thermodynamics. In International Conference on Machine Learning, pp. 2256–2265. PMLR, 2015. Song, J., Meng, C., and Ermon, S. Denoising diffusion implicit models. Advances in Neural Information Pro- cessing Systems, 2021a. Song, Y. and Ermon, S. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 32, 2019. Venkatakrishnan, S. V., Bouman, C. A., and Wohlberg, B. Plug-and-play priors for model based reconstruction. In 2013 IEEE Global Conference on Signal and Information Processing, pp. 945–948. IEEE, 2013. Wang, Z., Bovik, A. C., Sheikh, H. R., and Simoncelli, E. P. Image quality assessment: from error visibility to struc- tural similarity. IEEE transactions on image processing, 13(4):600–612, 2004. Xiao, Z., Kreis, K., Kautz, J., and Vahdat, A. Vaebm: A symbiosis between variational autoencoders and energy- based models. arXiv preprint arXiv:2010.00654, 2020. Xiao, Z., Kreis, K., and Vahdat, A. Tackling the generative learning trilemma with denoising diffusion gans. arXiv preprint arXiv:2112.07804, 2021a. Xiao, Z., Yan, Q., and Amit, Y. Ebms trained with max- imum likelihood are generator models trained with a self-adverserial loss. arXiv preprint arXiv:2102.11757, 2021b. Yu, F., Seff, A., Zhang, Y., Song, S., Funkhouser, T., and Xiao, J. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Er- mon, S., and Poole, B. Score-based generative modeling through stochastic differential equations. The Interna- tional Conference on Learning Representations, 2021b. Zervakis, M. and Venetsanopoulos, A. A class of nonitera- IEEE tive estimators for nonlinear image restoration. transactions on circuits and systems, 38(7):731–744, 1991. Zhang, B., Gu, S., Zhang, B., Bao, J., Chen, D., Wen, F., Wang, Y., and Guo, B. Styleswin: Transformer-based gan for high-resolution image generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11304–11314, 2022. Zhang, Q. and Chen, Y. Diffusion normalizing flow. Ad- vances in Neural Information Processing Systems, 34: 16280–16291, 2021. Zhang, Q. and Chen, Y. models with exponential integrator. arXiv:2204.13902, 2022. Fast sampling of diffusion arXiv preprint Tachibana, H., Go, M., Inahara, M., Katayama, Y., and Watanabe, Y. It\ˆ{o}-taylor sampling scheme for denois- ing diffusion probabilistic models using ideal derivatives. arXiv preprint arXiv:2112.13339, 2021. Tikhonov, A. N. On the regularization of ill-posed prob- lems. In Doklady Akademii Nauk, volume 153, pp. 49–52. Russian Academy of Sciences, 1963. Trussell, H. The relationship between image restoration by the maximum a posteriori method and a maximum entropy method. IEEE Transactions on Acoustics, Speech, and Signal Processing, 28(1):114–117, 1980. Vahdat, A. and Kautz, J. Nvae: A deep hierarchical vari- ational autoencoder. Advances in Neural Information Processing Systems, 33:19667–19679, 2020. Vahdat, A., Kreis, K., and Kautz, J. Score-based generative modeling in latent space. Advances in Neural Information Processing Systems, 34:11287–11302, 2021. A. Continuation of Related Works Restoration based Generative Models DDMs have been pertinent generative models by showing promising results on various generation tasks. DDMs degrade the data with a reference diffusion process and learn the data distribution by restoring it. We have arranged DDMs in the context of restoration, and DDMs can be interpreted as an MMSE estimator for a denoising task. • Energy-based models (EBMs) are another line of generative models that learn the unnormalized data distribution by giving low energy to high-density regions in the data space. As DDMs have demonstrated that recovery of a sequence of noisy data is more effective than directly approximating the data density, Gao et al. (2021) recently proposed a recovery energy-based model (REBM) by using a diffusion process. Inspired by DDMs, REBM learns a sequence of energy functions for the marginal distributions of the diffusion process. More precisely, from the noisy observation ̃x = x + ξ, ξ ∼ N (cid:0)0, σ2I(cid:1), they estimate the conditional likelihood pθ (x | ̃x) ∝ exp−Eθ(x| ̃x) by learning the energy function Eθ = 1 2σ2 (cid:107)x − ̃x(cid:107)2 − fθ (x) . (9) They indeed learn the marginal density fθ and infer the data through the recovery likelihood. The marginal density fθ is adversarially trained by assigning low energy to high-probability regions in the data space and high energy values outside these regions. Since direct sampling from pθ (x | ̃x) is intractable, samples are usually drawn by leveraging Langevin dynamics (LD) (Neal, 1993), which is a conventional sampling method of EBMs. Therefore, REBM trains marginal density fθ using a kind of adversarial loss, but REBM is actually a MAP estimator implicitly defined by the sampling dynamics. In other words, REBM learns the posterior distribution using the reference diffusion process, but it does not deviate from the traditional sampling method of EBM, still generating samples through inefficient LD. There are two difficulties of such a Markov Chain Monte Carlo (MCMC) sampling: Applying MCMC in pixel space to sample one instance from the model is impractical due to the high dimensionality and long inference time. As reported in (Xiao et al., 2021b), the estimated density of EBMs can sometimes differ significantly from the data distribution, even if the model with the short-run LD produces relevant samples. It is also known that the convergence of LD is very difficult when the energy function is complicated. • Another related work is a denoising diffusion GAN (DDGAN) (Xiao et al., 2021a), which enjoys small sampling steps by using GAN. DDGAN focuses on improving the sampling efficiency while maintaining the sample quality and mode coverage of DDMs. The reason why DDMs adhere to the heavy sampling scheme is their common assumption that the true posterior is approximated by Gaussian distributions. This assumption holds only with small denoising steps. When the number of denoising steps is reduced, the denoising distribution is no longer a Gaussian distribution, but a non-Gaussian multi-modal, which is usually intractable. DDGAN breaks the Gaussian assumption by reducing the number of denoising steps and then approximates the non-Gaussian multimodal posterior distribution with the help of GAN. DDGAN enhances the sampling efficiency of DDMs and also resolves the mode collapse problem of GANs by using a couple of denoising steps from the perspective of GAN literature. The architecture of DDGAN is somewhat similar to that of our RGM-KLD-D. However, there is a difference in a way of estimating MAP. DDGAN assigns all responsibility for MAP estimation to the GAN structure. On the other hand, our models learn the MAP-based estimator by separating the posterior distribution into the fidelity term and the prior term. Therefore, the model is much easier to learn than DDGAN. As a consequence, RGM-KLD-D obtains substantial savings in terms of training iterations than DDGAN. Specifically, in CIFAR10 experiments, DDGAN takes 400K iterations to achieve FID of 3.75. In comparison, our RGM-KLD-D only uses 150K iterations to achieve the same performance as DDGAN and takes 200K iterations for FID of 3.04. For the CelebA dataset, DDGAN requires 750K iterations to attain FID 7.64, while RGM-KLD-D obtains the same FID score using only 450K iterations and FID 7.15 even with 500K iterations. Furthermore, our framework can be extended to various forward processes and regularization terms, which are more flexible and utilizable. As such, there have been various density estimation models based on denoising. Diffusion models, such as DDPM and score matching with Langevin dynamics and its variants, are MMSE-based estimators. The model of REBM itself approximates the marginal density as we do, but our model is trained with MAP-based loss, whereas REBM generates samples from the posterior distribution through the sampling method. Diffusion models and REBM train different estimators, but both models use a Langevin sampling scheme that requires thousands of network evaluations. On the other hand, DDGAN is a model that can perform one-shot sampling with the help of GAN (away from the Langevin sampling), just like our RGMs. However, since DDGAN learns the whole posterior density through the discriminator, it is more inefficient in terms of learning than our models, which separate the fidelity and the prior term. Consequently, our RGMs achieve better performance than DDGAN with much fewer iterations. All these models are restricted to the diffusion process. Otherwise, our RGMs can Restoration based Generative Models enjoy flexible forward processes and are also given a degree of freedom in how to parametrize the prior term. In other words, our approach does not need to restrict to the diffusion process and unlike DDGAN, which is limited to the GAN structure, it is possible to design the prior term by leveraging different generation models. This is further discussed in Appendix B.2. B. Implementation Details B.1. Degradation Schedule Let Ak and Σk be a degradation matrix and a noise variance on the k-th degradation step, respectively. Then, given a data x sampled from the real data distribution pdata, a degraded data yk on the k-th forward step is sampled from p (yk | x) = N (yk; Akx, Σk) . We denote the marginal distribution at the T -th degradation step as pT . Because our primary goal is to bridge pdata to an easy-to-sample distribution pT , (especially to a zero mean Gaussian distribution), we gradually decrease the norm of Ak to zero as k increases. In Section 4, we introduced two families of models based on the degradation schedule {(Ak, Σk)}T k=1 with the corner cases: RGM-KLD-D for Ak = I and RGM-SR for Ak = Pk a 2 × 2 averaging filter. Roughly speaking, we consider three models based on different forward processes designed as follows: • RGM-D: noise → noise → noise → noise → * * * . • RGM-SR (naive): downsample + noise → downsample + noise → * * * . • RGM-SR: noise → downsample → noise → downsample → * * * , shown schematically in Figure 8. With the following notations βk = ̃βk = 1 4 1 4 (βmax − βmin) (βmax − βmin) (cid:19)2 (cid:19)4 (cid:18) k T (cid:18) k T + + 1 2 1 2 βmin βmin , k T (cid:18) k T (cid:19)2 , (10) (11) where βmax = 20 and βmin = 0.1, table 5 details the explicit form of the forward processes used for each model. The noise Table 5: The choice of schedule Ak and Σk and the corresponding latent distribution pT for RGM-D, RGM-SR (naive), and RGM-SR. Pk is a projection matrix that downscales the images by block averaging in a factor of 2k. For RGM-SR, we set T in (10) to be half of the total steps added by one. RGM-D Ak Σk pT e−βk I (cid:0)1 − e−2βk (cid:1)2 N (0, I) I (cid:16) RGM-SR (naive) e− ̃βk Pk (cid:17)2 P(cid:62) 64 I(cid:1) N (cid:0)0, 1 1 − e−2 ̃βk k Pk RGM-SR e−β(cid:100)k/2(cid:101) P(cid:98)k/2(cid:99) (cid:0)2(cid:100)k/2(cid:101) (cid:0)1 − e−2β(cid:100)k/2(cid:101)(cid:1)(cid:1)2 N (0, 4I) P(cid:62) (cid:98)k/2(cid:99)P(cid:98)k/2(cid:99) schedule of RGM-D follows the Variance Preserving SDE provided bySong et al. (2021b), and others are implemented with a slight modification of them. When we use the degradation matrix Ak as the averaging filter, the corresponding forward process downsamples the image while adding Gaussian noise. RGM according to this forward process, referred to as RGM-SR (naive), is demanded to super-resolve the degraded data while simultaneously denoising it. It is considerably more difficult than the denoising task when the noise level is the same. To address this difficulty, we consider a newly scheduled degradation scheme that decomposes the forward process into downsampling and noising operations. We name the RGM designed in conjunction with this forward schedule as RGM-SR. As provided in Table 5, when the step k is odd, the difference from the (k + 1)-th step is only the projection matrix. Namely, only downsample is performed when sampling the (k + 1)-th degraded data from the k-th degraded observation. Conversely, when k is an even number, the forward process produces the (k + 1)-th degraded image by adding the Gaussian noise. In summary, RGM-SR focuses on denoising the data in odd steps and super-resolving Restoration based Generative Models Figure 8: Degradation sequences for RGMs. the data in even steps. Provably due to the difficulty of performing super-resolution and denoising simultaneously, RGM-SR (naive) has the worst performance. Whereas RGM-SR, which uses the decomposed forward process, outperforms both RGM-D and RGM-SR by a large margin as reported in Section 4.2. B.2. Training RGMs In this section, we unambiguously elucidate how we train our RGMs. In Algorithms 1 and 2, we summarize the two training procedures of GAN-based prior that are suited to different situations. We also provide an explanation of the training procedure of RGMs with other priors. Moreover, the generation process is provided in Algorithm 3. Training As proposed in Section 3.1, RGMs learn the data distribution pdata through the process of degrading the image through a forward process and then restoring it using the MAP-based objective (6). However, since it is too difficult to restore the image directly from the Gaussian distribution in one shot, we use a handful of forward steps and train RGMs that recover the distribution between each step. (We also include an ablation study on this in Appendix C.1) In other words, at each step k, we first sample a degraded image yk of a given image x ∼ pdata. The generator Gθ generates the restored image ˆx, and then, we degrade it by the posterior distribution ˆyk−1 ∼ p (ˆyk−1 | yk, ˆx). We train our loss function so that ˆyk−1 becomes a restoration of yk. The discriminator loss is also imposed on the (k − 1)-th step. Through the overall process, we ultimately learn the model that restores the distribution of the previous (k − 1)-th step at each k-th step. The training procedure is articulated in Algorithm 1. However, we can exactly formulate the posterior distribution only when the forward process satisfies certain conditions. For all k = 1, * * * , T , if there exists satisfying (cid:16) ̃Ak, ̃Σk (cid:17) Ak = ̃AkAk−1, ̃Σk := Σk − ̃AkΣk ̃A(cid:62) k (cid:31) 0, (12) we can explicitly construct a conditional distribution pk|k−1(yk|yk−1) = N ( ̃Akyk−1, ̃Σk) and a posterior distribution (Ho et al., 2020; Kingma et al., 2021; Xiao et al., 2021a). For example, the forward process of RGM-D falls under this condition (12), but that of RGM-SR does not. Therefore, the Algorithm 1 does not fit with RGM-SR. To unravel such a problem, we propose a prevalent algorithm that is applicable to forward processes that are in discord with the condition (12). See Algorithm 2. The only difference from the Algorithm 1 is the replacement of the posterior sampling by the prior sampling in Line 5 and the data fidelity term in Line 9. When the posterior distribution is unavailable, we corrupt the image ˆx restored by the generator Gθ to the (k − 1)-th degraded distribution using the k-th forward process rather than posterior sampling. Moreover, since the conditional distribution between k and (k − 1) steps is unknown, we adopt the fidelity term of the image ˆx reconstructed by the generator. This algorithm is universally applicable to general forward processes. One notable fact is that RGM-D, whose posterior distribution is tractable, learns the data distribution better when using this algorithm than Algorithm 1. This is discussed in detail in Appendix C.1. Training with other priors Without being tied to the GAN discriminator, our RGMs have the freedom to parametrize the prior term g of regularizer (6) in any other way. To demonstrate that the RGM framework universally works for variously RGM-DRGM-SR (naive)RGM-SRNoiseDownsampleNoise + Downsample Restoration based Generative Models Algorithm 1 Training of RGMs with Posterior sampling Input: Dataset D, degradation schedule {(Ak, Σk)}T pk|k−1 (yk−1, yk) = N , generator Gθ, discriminator Dφ, and regularization parameter λ ≥ 0. (cid:16) ̃Akyk, ̃Σk (cid:17) k=0 with (A0, Σ0) = (I, 0), posterior distribution 1: for i = 0, 1, 2, . . . do 2: 3: 4: 5: 6: 7: 8: Sample data x ∈ D. Sample k ∼ Uniform({1, 2, . . . , T }). Sample z ∼ N (0, I). Sample degraded data yk ∼ N (Akx, Σk) and yk−1 ∼ N (Ak−1x, Σk−1). Generate an image ˆx = Gθ(yk, k, z). Degrade data by posterior sampling ˆyk−1 ∼ p (ˆyk−1 | yk, ˆx). Update φ by the following loss: 9: Update θ by the following loss: log (1 − Dφ (ˆyk−1, k − 1)) + log Dφ (yk−1, k − 1) . log (1 − Dφ (ˆyk−1, k − 1)) − log Dφ (ˆyk−1, k − 1) + 1 2λ (cid:13) (cid:16) ̃Σ† (cid:13) (cid:13) (cid:13) k (cid:17) 1 2 (cid:16) ̃Ak ˆyk−1 − yk (cid:17)(cid:13) 2 (cid:13) (cid:13) (cid:13) 2 . 10: end for Algorithm 2 Relaxed training algorithm of RGMs Input: Dataset D, degradation schedule {(Ak, Σk)}T regularization parameter λ ≥ 0. k=0 with (A0, Σ0) = (I, 0), discriminator Dφ, generator Gθ, and 1: for i = 0, 1, 2, . . . do 2: 3: 4: 5: 6: 7: 8: Sample x ∈ D. Sample k ∼ Uniform({1, 2, . . . , T }). Sample z ∼ N (0, I). Sample degraded data yk ∼ N (Akx, Σk) and yk−1 ∼ N (Ak−1x, Σk−1). Generate an image ˆx = Gθ(yk, k, z). Degrade ˆx by ˆyk−1 ∼ N (Ak−1 ˆx, Σk−1). Update φ by the following loss: 9: Update θ by the following loss: log (1 − Dφ (ˆyk−1, k − 1)) + log Dφ (yk−1, k − 1) . log (1 − Dφ (ˆyk−1, k − 1)) − log Dφ (ˆyk−1, k − 1) + 1 2λ (cid:16) (cid:13) (cid:13) (cid:13) (cid:13) Σ† k (cid:17) 1 2 (Ak ˆx − yk) (cid:13) 2 (cid:13) (cid:13) (cid:13) 2 . 10: end for Restoration based Generative Models parametrized prior terms, we design the prior term in two additional ways: maximum mean discrepancy (MMD) (Dziugaite et al., 2015) and distributed sliced Wasserstein distance (DSWD) (Nguyen et al., 2020): • We replace KLD objective to MMD, a two-sample test based on kernel maximum mean discrepancy (Li et al., 2017). For given two sets of data X = {x1, x2 . . . , xM } and Y = {y1, y2 . . . , yM }, the MMD prior g(X, Y ), which estimates the MMD distance, is defined as follows; g (X, Y ) =  (cid:88)  i(cid:54)=j 1 (cid:0)M 2 (cid:1) k (xi, xj) − 2 (cid:88) i(cid:54)=j k (xi, yj) +  k (yi, yj)  , (cid:88) i(cid:54)=j (13) where k is a positive definite kernel. Following the prior works (Dziugaite et al., 2015; Li et al., 2015; 2017), we use a mixture of RBF kernels k(x, x(cid:48)) = (cid:80)n i=1 kσi(x, x(cid:48)) where kσ is a Gaussian kernel with bandwidth parameter of σ. • To measure the distance of two datasets X = {x1, x2 . . . , xM } and Y = {y1, y2 . . . , yM }, sliced Wasserstein-based framework (SW) projects the data into a one-dimensional vector then explicitly calculates the Wasserstein distance on the projected space. In such an explicit calculation, SW can be freed from an unstable adversarial framework. Recently, Nguyen et al. (2020) has proposed a novel and efficient method to obtain useful projection samples, hence, we followed the implementation of this prior work in our experiments. Specifically, following Nguyen et al. (2020), we use the learnable feature function and calculate DSWD on the feature space for CIFAR10 experiments. In other words, we replace the prior term g of line 9 of Algorithm 2 to DSWD objective. The results on the 2D synthetic example discussed in Figure 3 validate that RGMs parametrized in three different ways show consistent performance, where they are all more efficient than the MMSE estimator. Furthermore, we also carried out the experiment of RGM-D with the DSWD prior, termed RGM-DSWD-D, on CIFAR10. Consequently, RGM-DSWD-D achieves an FID score of 3.14 retaining comparable performance with RGM-KLD-D. The overall results verify that our MAP approach works universally well for the various prior terms. Sampling The sampling algorithm is sum- marized in Algorithm 3. Starting from a la- tent variable yT ∼ pT , the trained Gθ gener- ates the restored image ̃x = Gθ (yk+1, k, z) with a randomly selected auxiliary variable z from the (k + 1)-the degraded image yk+1, and then corrupt it by passing the k-th for- ward process. Continue this procedure until k = 0. When we train our model with Al- gorithm 1, line 5 should be replaced by the posterior sampling. For a schematic represen- tation of this hierarchical sampling process of RGMs, see Figure 9. B.3. Implementation Details Algorithm 3 Sampling Procedure of RGMs Input: Trained generator Gθ and degradation schedule {Ak, Σk}T 1: Sample initial state yT ∼ N (0, ΣT ). 2: for k = T − 1, T − 2, . . . , 0 do Sample z ∼ N (0, I). 3: Restore image ˆxk by ˆxk = Gθ (yk+1, k + 1, z). 4: Sample yk ∼ N (Ak ˆxk, Σk). 5: 6: end for 7: return ˆx0 k=1. We refer to (Nguyen et al., 2020) for the precise definition of hyperparameters of RGM-DSWD-D. Experiments on 2D dataset In the implementation of the two-dimensional Gaussian Mixture, we use a 3-layered MLP of 32 hidden dimensions for both generator and discriminator with Tanh activation. We concatenated all the inputs and passed them through the network. For the RGM-KLD-D experiment, models are trained for 100K iterations with a learning rate of 10−4, a batch size of 1000. For the RGM-DSWD-D experiment on the 2D data, we use the number of iterations of 100K, the number of projections of 10, 10 DSW iterations, and λC = 10. For the MMD experiment, we applied kernel bandwidths of 0.1, 0.5, 1, 2, and 10. Image generation To optimize our RGMs, we mostly followed the previous literature (Xiao et al., 2021a), including network architectures, R1 regularization, and optimizer settings. Note that our code is largely built on top of DDGAN 1 1https://github.com/NVlabs/denoising-diffusion-gan Restoration based Generative Models Figure 9: Hierarchical generation process of RGMs. (MIT License). We vary the discriminator by simply changing input channels into three. Moreover, we use a learning rate of 2 × 10−4 for generator update in all experiments and a learning rate of 10−4 for discriminator update. We use λ−1 = 10−3 for image size of 32, and λ−1 = 5 × 10−5 for image size of 256. The models are trained with Adam (Kingma & Ba, 2014) in all experiments. In CIFAR10 experiments, we train RGM-KLD-D and RGM-KLD-SR (naive) for 200K iterations and RGM-KLD-SR for 230K iterations. Moreover, for RGM-DSWD-D implementation on CIFAR10, we use the output of the fifth convolutional layer of the discriminator as a feature vector. We use the number of iterations of 150K, the number of projections of 1000, 10 DSW iterations, and λC = 1 for the DSWD experiment. Lastly, we train RGM-KLD-D for 500K iterations and 300K iterations in LSUN experiments. Other details We train our models on CIFAR-10 using 4 V100 GPUs. The training takes approximately 40 hours on CIFAR-10. Moreover, the sampling of 100 samples takes approximately 0.25 seconds for RGM-KLD-D on single V100 GPUs. For evaluation on CIFAR10, we use 50K generated samples to measure IS and FID. For CelebA-HQ-256, we use 30K samples to compute FID. B.4. Solving Inverse Problems Modern image processing algorithms reconstruct the ground-truth image by solving the following minimization problem: minimize x fy (x) + λg (x), where f measures the fidelity to a corrupted observation y, and g constrains the solution space by measuring the complexity or noisiness of the image. Many imaging inverse problems, such as colorization, super-resolution (SR), and deblurring, fall under this form. Since the above optimization problem does not have a closed-form solution in general, first-order proximal splitting algorithms, including half-quadratic splitting (HQS) (Geman & Yang, 1995), alternating direction method of multipliers (ADMM) (Boyd et al., 2011), solve the problem by operating individually on f and g via the proximal operator (Parikh et al., 2014). With the aid of the emergence of deep learning, Plug-and-Play (PnP) algorithms (Venkatakrishnan et al., 2013) have recently begun to connect proximal splitting algorithms and deep neural networks by replacing the proximity operator of the regularization term g with a generic denoiser (Romano et al., 2017; Reehorst & Schniter, 2018). Similarly, our trained RGMs can be used as PnP priors. In Section 4.4 we solved two inverse problems, colorization, and super-resolution, by plugging the trained RGMs into Douglas-Rachford Splitting (DRS) algorithm (Lions & Mercier, 1979), x4x3x2x1x0 Restoration based Generative Models following (Hurault et al., 2022). This is summarized in Algorithm 4. Starting from the degraded observation y, the DRS algorithm updates the solution by alternatively utilizing proximal operations for both f and g. By iteratively updating the solution, the solution lies far outside the distribution on which our denoiser Gθ trained. For this out-distribution data, Gθ cannot recover the original image distribution, which in turn prevents the DRS algorithm from convergence. To remedy this problem, the input of Gθ should always be within the trained distribution. Therefore, we push the updated solution into the learned distribution through the forward process. Note that the proximal operation is calculated by utilizing efficient singular value decomposition proposed in Kawar et al. (2022). Algorithm 4 Solving Inverse Problems by RGMs Input: A degraded observation y, fidelity loss function fy, repeat number M , update rate α ∈ (0, 1], regularization parameter λ ≥ 0, trained generator Gθ, and degradation schedule {Ak, Σk}T i=1. for i = K, K − 1, . . . , 1 do Sample ˆy ∼ N (Axi, Σi) and z ∼ N (0, I). ˆx ← Gθ(ˆy, i − 1, z). ˆx ← (1 − α)xi + αˆx. ∆x ← proxλfy (2ˆx − xi) − ˆx. xi−1 ← xi + ∆x. 1: Initialize xK = y. 2: for 0, 1, . . . , M do 3: 4: 5: 6: 7: 8: 9: 10: end for 11: return x0 end for In SR experiments, we downscale images by using a block averaging filter by r in each Settings & Hyperparameters axis. The filter is applied for the stride of r. We experiment on r = 4 and r = 8 for LSUN and CelebA-HQ datasets. In the CIFAR10 experiment, we use r = 2 and r = 4. In colorization experiments, we simply degrade color images to gray by averaging images along the channels of each pixel. All tasks are evaluated on hundred samples that are sampled from the evaluation dataset. Table 6 reports the exact set of hyperparameters that we used in our experiments. We set K = 2 for colorization and K = 1 for denoising and SR tasks. On CIFAR10 experiments, to fairly compare RGM-KLD-D and the naive version of RGM-KLD-SR, we train both models with the same degradation steps of three (T = 3). For RGM-KLD-D, we used Ak = e− ̃βk I and Σk = 1 − e−2 ̃βk (cid:17)2 (cid:16) I. For RGM-KLD-SR, we used Ak = e− ̃βk Pk and Σk = (cid:16) 1 − e−2 ̃βk (cid:17)2 P(cid:62) k Pk. Table 6: Hyperparameters used for solving inverse problems. CIFAR10 LSUN/CelebA-HQ SR(×2) SR(×4) σ = 10/255 σ = 20/255 σ = 40/255 SR(×4) SR(×8) Color M λ α 5 0.2 0.2 10 0.1 0.2 10 0.01 0.2 20 5 0.1 10 5 0.1 40 10 0.05 40 10 0.05 20 5 0.5 Baselines We employed two main comparison models, namely DDRM (Kawar et al., 2022) and GAN baseline, which is close to our work. Similar to our method, both comparison models assume that a degradation matrix is given and they iteratively update degraded images by using their knowledge obtained from the pretrained network and degradation matrix. Moreover, our model and these comparisons do not require heavy additional training. The implementation of DDRM follows its original implementation. The implementation of GAN baseline mainly follows the implementation of DGP (Pan et al., 2021), however, instead of using BigGAN (Brock et al., 2018), we replaced it with a pretrained model of StyleSwin (Zhang et al., 2022), which is one of the state-of-the-art. For discriminator loss of DGP, we used the last feature vector of StyleSwin discriminator. We additionally adjusted the weights of the losses. For experiments in SR, we use an MSE loss weight of 1.0 and a discriminator loss weight of 1.0. For colorization, we use MSE loss weight of 1.0 and discriminator loss of 1.0 for the previous 400 iterations and 0.1 after that. Other hyperparameters of GAN baseline implementation follow Pan et al. (2021). Restoration based Generative Models We also compare our model with SDEdit (Meng et al., 2021), a stroke-based diffusion model. In the implementation of SDEdit, we use total denoising steps of 200 with the number of repeats of three. C. Additional Results C.1. Additional Ablation Studies In this section, we include additional ablation studies on our training procedure and the forward process schedule. All experiments are conducted on the CIFAR10 dataset and focused on RGM-KLD-D. Directly restoring the data distribution Given a k-th degraded image yk, the generator is trained to restore the original image in one shot. Therefore, we can train RGMs to directly restore the real image distribution from each degraded step k. RGM-KLD-D trained in this say is denoted by Directly matching data in Table 7. This model was trained in the same forward process as RGM-KLD-D (T = 4). The FID score shows that the model has difficulties in learning the data distribution, falling short of FID score by 21.2. It seems that it is still difficult to directly restore the image of the real data distribution from a severely degraded image yk (k ≈ T ) even with the help of auxiliary variable z. Table 7: Additional ablation studies on CIFAR10 experiments. Model FID (↓) Directly matching data RGM-KLD-D w/ posterior RGM-KLD-D (T = 8) RGM-KLD-D (T = 4) 21.2 3.52 6.50 3.04 Training with posterior sampling While training, there are two ways to sample ˆyk−1 from ˆyk (See line 7 of Algorithm 1 and 2). The posterior sampling (line 7 of Algorithm 1) is theoretically well-grounded since it minimizes the statistical MAP loss of the posterior distribution. However, to obtain an explicit form of posterior sampling, the forward process should be constrained to satisfy the conditions (12). Since the noising forward process of RGM-KLD-D satisfies these conditions, we trained RGM-KLD-D with both posterior sampling (Algorithm 1) and prior sampling (Algorithm 2) under the same setup. In Table 7, RGM-KLD-D (T = 4) and RGM-KLD-D w/ posterior refer to the model trained with prior and posterior sampling, respectively. As shown in Table 7, both models achieve similar results in terms of FID score, where RGM-KLD-D with prior sampling slightly precedes posterior sampling. This verifies that the two training objectives of Algorithms 1 and 2 are somewhat consistent. Because the performance is a bit better, we adopt the prior sampling in all our experimental studies. Effect of the number of forward steps The number of forward steps is one of the important factors affecting the performance of the model. We investigated this in Section 4.3 by comparing a four-step model RGM-KLD-D (T = 4) with the RGM-KLD-D (T = 1), where we use only one degradation step. As reported in Table 3, RGM-KLD-D (T = 1) struggles to learn the data distribution because it needs to recover the real data distribution directly from Gaussian noise with one chance. On the other hand, RGM-KLD-D (T = 4) estimates the data density well. Besides, what happens when we use more steps? Since our RGMs learn the data distribution in a way that restores the distribution of the previous degradation step (k − 1) distribution from the k-th degraded distribution, one may expect that the models will be easier to estimate the density as the distribution between the two steps is closer by dividing the forward process with more steps. However, the opposite results are presented in Table 7. The results show that RGM-KLD-D (T = 8) attains a higher FID score. In other words, dividing the forward process into smaller pieces does not enhance the model performance. In addition, this phenomenon is also observed for Directly matching data. RGM-KLD-D (T = 1) can actually be regarded as Directly matching data (T = 1), whereas the Directly matching data presented in the table uses T = 4. Comparing these two, we can observe that the model using fewer degradation steps performs better. Xiao et al. (2021a) reported a similar tendency. Choosing appropriate T is crucial for algorithmic performance, but not straightforward how many steps are optimal. Reducing mode collapse using data fidelity Lastly, we examine the influence of the data fidelity term in our MAP-based estimation. To quantify the contribution of the fidelity term, we trained RGM-KLD-D by the loss function without the data fidelity loss (termed by RGM-KLD-D (λ = ∞)) in Section 4.3, and we reached an FID score of 32.5 (See Table 3). This result clearly motivates our objective. Moreover, we observe the mode collapse for RGM-KLD-D (λ = ∞), which is the one of common failure modes of GAN. As evidence, generated samples are presented in Figure 18. Comparing samples generated by our RGM-KLD-D (see Figure 2) to Figure 18, it is clear that images generated by RGM-KLD-D have higher diversity and better quality. The results verify that it is beneficial to train our RGMs together with the data fidelity term. C.2. Comparison with existing models using various destruction Restoration based Generative Models Recently, several works introduce various degradation processes as an alternative to the diffusion process. Rissanen et al. (2022) proposed an inverse heat dissipation model (IHDM) with a forward blurring process inspired by heat equation. Afterward, Hoogeboom & Salimans (2022) established a theoretical bridge between diffusion models and IHDM using Fourier transform. Based on this insight, they built a blurring diffusion model. Daras et al. (2022) proposed a general framework for learning the score function for any linear corruption process. Moreover, Cold Diffusion (Bansal et al., 2022) proposed a new family of models using deterministic degradation processes. Similarly, the proposed RGMs can leverage general linear degradation processes. Therefore, we compare the performance of RGMs with the aforementioned related works in Table 8. In comparison with our model itself, the change in the forward process brings FID improvement. But compared to other models, we can observe how efficiently our proposed method produces high-quality images. Table 8: Comparison with restoration-based models with various forward processes. Sample quality on CIFAR10 is measured by FID score. Model FID (↓) NFE Cold Diffusion (SR) (Bansal et al., 2022) Cold Diffusion (Blur) (Bansal et al., 2022) IHDM (Rissanen et al., 2022) Soft Diffusion (Daras et al., 2022) Soft Diffusion (Blur) (Daras et al., 2022) Blurring Diffusion (Hoogeboom & Salimans, 2022) RGM-KLD-D RGM-KLD-SR 152.76 80.08 18.96 3.86 4.64 3.17 3.04 2.47 3 50 200 ≤ 100 ≤ 100 1000 4 7 C.3. Additional Results on Inverse Problems To quantify the performance of our RGM, we report signal-to-noise ratio (PSNR), which measures faithfulness to the ground-truth image. Also, as a perceptual metric, we include structural similarity index measure (SSIM) (Wang et al., 2004) that quantifies the image. Table 9 summarizes the PSNR and SSIM performances of colorization and super-resolution (SR) on CelebA-HQ and LSUN datasets. Since the primary goal of SDEdit is to generate a realistic and faithful image in the absence of paired data, we did not make a quantitative comparison with SDEdit. But we include qualitative comparisons. Colorization The goal of image colorization is to restore a gray-scale image to a colorful image with RGB channels. We present more colorization results on CelebA-HQ and LSUN church in Figure 11 and 12, respectively. Results reported in Table 9 show that our RGM achieves comparable and sometimes even better performance than baselines. From the qualitative results, we can observe that our RGM is able to reconstruct more faithful and realistic images than other models. Super-resolution Super-resolution aims at recovering high-resolution images corresponding to a given low-resolution image. We consider downsampled images with two scale factors 4 and 8. We also compare SR results with bicubic interpolation. Figure 13 and 14 present the qualitative comparisons. Compared against bicubic upsampling, bicubic attains Table 9: Colorization and super-resolution results of different methods. Model Colorization Super-Resolution LSUN CelebA-HQ LSUN CelebA-HQ PSNR SSIM PSNR SSIM PSNR SSIM PSNR SSIM PSNR SSIM PSNR SSIM (×4) (×8) (×4) (×8) RGM DDRM 23.78 23.68 GAN baseline 20.02 0.93 0.94 0.81 25.57 23.94 24.79 0.93 0.93 0.88 22.74 23.22 20.32 0.65 0.67 0.48 19.96 20.61 18.06 0.48 0.51 0.34 28.51 29.32 26.77 0.81 0.83 0.71 24.86 26.23 23.92 0.70 0.73 0.59 Restoration based Generative Models higher PSNR and SSIM values. However, we can observe from Figure 13 and 14 that bicubic interpolation results in blurry images, and RGM super-resolves more plausible images. Also, visual differences between RGM and DDRM are qualitatively not large. C.4. Additional results of varying z We investigated the influence of the auxiliary variable z in Section 4.3. Here, we include more observations in Figure 10. C.5. Additional Qualitative Results on Generation We present more generated image samples in Figures 15, 16, 17, 19, and 20. Restoration based Generative Models Figure 10: Illustration of the effect of varying z on CelebA-HQ (top) and LSUN (bottom). The images in the leftmost column depict the selected trajectory {xk}4 k=1 degraded from an image x0. Each row on the right presents restored images of xt using four different random auxiliary values z. When the noise level is small, they generate almost identical images, which means that the restoration problem is almost well-posed. As the noise level increases, however, each degraded observation xk estimates diverse images depending on the z. In other words, the larger the noise, the more severe the ill-posedness, and the results validate that a much wider restoration is possible through the introduction of z. x0x1x2x3x4x0x1x2x3x4 Restoration based Generative Models Figure 11: Colorization. Qualitative comparison on CelebA-HQ. Figure 12: Colorization. Qualitative comparison on LSUN church. GrayscaleOriginalOursGANbaselineDDRMSDEditGrayscaleOriginalOursGANbaselineDDRMSDEdit Restoration based Generative Models Figure 13: Super-resolution. Qualitative comparison on CelebA-HQ. DownSampled(×4)OriginalOursGANbaselineDDRMSDEditBicubicDownSampled(×8)OursGANbaselineDDRMSDEditBicubic Restoration based Generative Models Figure 14: Super-resolution. Qualitative comparison on LSUN church. DownSampled(×4)OriginalOursGANbaselineDDRMSDEditBicubicDownSampled(×8)OursGANbaselineDDRMSDEditBicubic Restoration based Generative Models Figure 15: Generated samples of RGM-DSWD-D on CIFAR10. Figure 16: Generated samples of RGM-KLD-D on CIFAR10. Restoration based Generative Models Figure 17: Generated samples of RGM-KLD-SR on CIFAR10. Figure 18: Mode collapse of RGM-KLD-D trained without the data fidelity term. Sampled images of RGM-KLD-D (λ = ∞) seem repetitive. Restoration based Generative Models Figure 19: Additional qualitative results of RGM-KLD-D trained on CelebA-HQ-256. Restoration based Generative Models Figure 20: More qualitative results of RGM-KLD-D trained on LSUN Church.
http://arxiv.org/abs/2302.09703v2
2023-05-19T01:01:39
2023-02-20T00:31:18
Reinforcement Learning with Function Approximation: From Linear to Nonlinear
Function approximation has been an indispensable component in modern reinforcement learning algorithms designed to tackle problems with large state spaces in high dimensions. This paper reviews recent results on error analysis for these reinforcement learning algorithms in linear or nonlinear approximation settings, emphasizing approximation error and estimation error/sample complexity. We discuss various properties related to approximation error and present concrete conditions on transition probability and reward function under which these properties hold true. Sample complexity analysis in reinforcement learning is more complicated than in supervised learning, primarily due to the distribution mismatch phenomenon. With assumptions on the linear structure of the problem, numerous algorithms in the literature achieve polynomial sample complexity with respect to the number of features, episode length, and accuracy, although the minimax rate has not been achieved yet. These results rely on the $L^\infty$ and UCB estimation of estimation error, which can handle the distribution mismatch phenomenon. The problem and analysis become substantially more challenging in the setting of nonlinear function approximation, as both $L^\infty$ and UCB estimation are inadequate for bounding the error with a favorable rate in high dimensions. We discuss additional assumptions necessary to address the distribution mismatch and derive meaningful results for nonlinear RL problems.
[ "Jihao Long", "Jiequn Han" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09703v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09703v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Reinforcement Learning with Function Approximation: From Linear to Nonlinear Jihao Long* Jiequn Han† May 22, 2023 Abstract Function approximation has been an indispensable component in modern reinforcement learning algorithms designed to tackle problems with large state spaces in high dimensions. This paper reviews recent results on error analysis for these reinforcement learning algorithms in linear or nonlinear approximation settings, emphasizing ap- proximation error and estimation error/sample complexity. We discuss various properties related to approximation error and present concrete conditions on transition probability and reward function under which these properties hold true. Sample complexity analysis in reinforcement learning is more complicated than in supervised learning, primarily due to the distribution mismatch phenomenon. With assumptions on the linear structure of the problem, numerous algorithms in the literature achieve polynomial sample complexity with respect to the number of features, episode length, and accuracy, although the minimax rate has not been achieved yet. These results rely on the L∞ and UCB estimation of estimation error, which can handle the distribution mismatch phenomenon. The problem and analysis become substantially more challenging in the setting of nonlinear function approximation, as both L∞ and UCB estimation are inadequate for bounding the error with a favorable rate in high dimensions. We discuss additional assumptions necessary to address the distribution mismatch and derive meaningful results for nonlinear RL problems. Keywords: Reinforcement learning, Function approximation, High-dimensionality analysis, Distribution mis- match 1 Introduction Reinforcement learning (RL) studies how an agent can learn, through interaction with the environment, an optimal policy that maximizes his/her long-term reward [52]. When the problem involves a finite set of states and actions of moderate size, the corresponding value or policy functions can be represented precisely as a table, which is called the tabular setting. However, when the problem contains an enormous number of states or continuous states, often in high dimensions, function approximation must be introduced to approximate the involved value or policy functions. With the rapid development of machine learning techniques for function approximation, modern reinforcement learning (RL) algorithms increasingly rely on function approximation tools to tackle problems with growing complexity, including video games [41], Go [50], and robotics [32]. 3 2 0 2 y a M 9 1 ] G L . s c [ 2 v 3 0 7 9 0 . 2 0 3 2 : v i X r a Despite the astonishing practical success of RL with function approximation when applied to challenging high- dimensional problems, the theoretical understanding of RL algorithms with function approximation remains rela- tively limited, particularly when compared to the theoretical results in the tabular setting. In the tabular setting, roughly speaking, we can achieve the minimax sample complexity up to the logarithm term: we need samples of the order of H denote the to obtain an ǫ-optimal policy, where H denotes the episode length, size of the state space and action space (see [25, 8, 14] for detailed discussions). Apparently, these kinds of results become vacuous when ) is extremely large or infinite. Therefore, the study of sample complexity in the presence of function approximation has received considerable attention in recent years in the RL community. Relatively simple function approximation methods, such as the linear model in [57, 29] or generalized linear model |S||A| ǫ2 (and/or and |A| |A| |S| |S| 3 *Princeton University †Flatiron Institute 1 in [56, 37] have been examined in the context of RL algorithms. Meanwhile, nonlinear forms like kernel approxima- tion [15, 58, 59, 40, 39] have also been studied in RL problems to further bridge the gap between theoretical results under restrictive assumptions and practice. In this paper, we review recent theoretical results in RL with function approximation, from linear setting to nonlinear setting. We mainly focus on the results regarding approximation error and estimation error/sample com- plexity, which are errors introduced by function approximation and finite datasets, respectively. We first review the basic concepts of RL in Section 2 and introduce two categories of RL algorithms: value-based methods and policy- based methods in Section 3. We are interested in these algorithms when combined with function approximation. In Section 4, we give a general framework for the theoretical analysis of RL with function approximation. We adopt the concepts of approximation error, estimation error, and optimization error from supervised learning to RL and discuss the crucial challenges of analyzing these errors in RL. In Section 5, we introduce RL algorithms with linear function approximation, as it is the simplest function approximation. We introduce the basic linear MDP assump- tion [29], which assumes that both reward function and transition probability are linear with respect to d known features. Under this or similar assumptions, the Q-value function can be represented as a linear function with respect to the features, and numerous algorithms in the literature can achieve polynomial sample complexity with respect to the number of features d, episode length H, and accuracy ǫ. However, the minimax sample complexity has not been achieved yet. In Section 6, we further discuss RL with nonlinear function approximation. We first introduce the theoretical results of supervised learning on reproducing kernel Hilbert space, neural tangent kernel, and Barron space, and then discuss how to analyze the approximation error in RL problems with nonlinear function approximation. We then focus on the distribution mismatch phenomenon, which is a crucial challenge of RL compared to supervised learning when analyzing the estimation error in the presence of function approximation. In tabular and linear settings, the distribution mismatch is handled by the L∞ and UCB estimation. However, as we will point out, both L∞ and UCB estimation suffer from the curse of dimensionality for various function spaces, including neural tangent kernel, Barron space, and many common reproducing kernel Hilbert spaces. This challenge reveals an essential difficulty of RL problems with nonlinear function approximation, and thus additional assumptions are needed to derive meaningful results for nonlinear RL in the literature, including assumptions on the fast eigenvalue decay of the kernel and assumptions on the finite concentration coefficient. We finally introduce the perturbational complexity by distribution mismatch in [39], which quantifies the difficulty of a large class of the RL problems in the nonlinear setting, as it can give both lower bound and upper bound of the sample complexity of these RL problems. Directions for future work are discussed in Section 7. as an arbitrary subset of Euclidean space, we use C( X ) to denote the probability distribution space on (X) to denote its law. Given a positive integer H, [H] denotes the set X , and X Notations. Given function space on use matrix of size d. The notation ̃O( * ( X P L ) ignores poly-logarithmic factors. ) to denote the bounded continuous . For any random variable X, we . Id denotes the identity X 1, . . . , H { } 2 Preliminary 2.1 Markov Decision Processes Throughout this article, otherwise explicitly stated, we mainly focus on the finite-horizon Markov decision process , H, P, r, μ) with general time-inhomogeneity as the mathematical model for the RL problem. (MDP) M = ( , A The specifications are the following. S is the state space and we assume S is the action space and we assume • • S A • H is the length of each episode. is a subset of a Euclidean space. is a compact subset of a Euclidean space. A • P : [H] ) is the state transition probability. For each (h, s, a) denotes the transition probability for the next state at step h if the current state is s and action a is taken. × S × A 7→ P × S × A . P ( ( S [H] * | ∈ h, s, a) 2 • r : [H] R is the reward function, denoting the reward at step h if we choose action a at the state s. Unless explicitly stated, we assume r is deterministic and the range of r is a subset of [0, 1]. We also assume that r is a continuous function. × S × A 7→ • μ ( S We denote a policy by π = ∈ P ) is the initial distribution. { πh} , H) = H h=1 ∈ P πh( ( A | S H h=1 : πh( ) } * | * , H), where ( A | S P { n In some cases, we need to work with time-homogeneous, infinite-horizon MDP M = ( s) * | ∈ P ) for any s ( A and h ∈ ∈ S [H] . , o , γ, P, r, μ), where A S • S • γ ∈ • P : and μ are the same with the finite-horizon case, , A [0, 1) is the discount factor, S × A 7→ P ( S • r : S × A 7→ ) is the state transition probability, R is the deterministic reward function. 2.2 Total Reward, Value Function and Bellman Equation πh( Given an MDP M and a policy π, the agent's total reward is defined according to the following interaction protocol [H] the agent takes action with the MDP. The agent starts at an initial states S0 ∼ h, Sh, Ah). In this Ah ∼ way, we generate a trajectory (S0, A0, . . . , SH , AH ) and we will use PM,π and EM,π to denote the probability and expectation of the trajectory generated by policy π on the MDP M . The expected total reward under policy π is defined by Sh), obtains the reward r(h, Sh, Ah) and observes the next state Sh+1 ∼ μ; at each time step h P ( * | * | ∈ and our goal is to find a policy π to maximize J(M, π) for a fixed MDP M . We will use Xh=1 J(M, π) = EM,π[ r(h, Sh, Ah)], H J ∗(M ) = sup π∈P(A|S,H) J(M, π) to denote the optimal value. For ease of notation in analysis, we will use ρh,P,π,μ to denote the distribution of (Sh, Ah) under transition P , policy π and initial distribution μ. Moreover, we use Π(h, P, μ) to denote the set of all the possible distributions of ρh,P,π,μ: and let Π(h, P, μ) = ρh,P,π,μ : π { ( A | S , H) } , ∈ P Π(P, μ) = Π(h, P, μ). Given an MDP M , a policy π, a state s and Q-value function as follows: [h∈[H] , an action a ∈ A ∈ S and time step h ∈ [H], we define the value function h (s) = EM,π[ V π r(h′, S′ h, A′ h) H Sh = s], | Xh′=h H Qπ h(s, a) = EM,π[ Xh′=h r(h′, S′ h, A′ h) h = s, A′ S′ h = a], | as the expected cumulative reward of the MDP starting from step h. We have the following Bellman equation: Qπ h(s, a) = r(h, s, a) + Es′∼P ( * | h,s,a)[V π h+1(s′)], V π h (s) = ZA Qπ h(s, a) dπh(a s), | 3 where we define V π H+1 = 0. The optimal value function and the optimal Q-value function are defined by V ∗ h (s) = sup π∈Π(S,A,H) V π h (s), Q∗ h(s, a) = sup π∈Π(S,A,H) Qπ h(s, a). The famous Bellman optimality equation gives, h(s, a) = r(h, s, a) + Es′∼P ( * | h,s,a)[V ∗ Q∗ V π h (s) = max a∈A Qh(s, a). h+1(s′)], (1) where we again define V ∗ condition H+1 = 0. We will use π∗ to denote an optimal policy of Q∗ h satisfying the following greedy for any (h, s, a) to [44] for an in-depth discussion of the value function, Bellman equation, and optimal policy. × S × A [H] ∈ s)) supp(π∗ a h( . The optimal policy π∗ satisfies that V π∗ h(s, a) = V ∗ : Q∗ h (s) } h and Qπ∗ h = V ∗ ∈ A ⊂ { * | h = Q∗ h. We refer readers In the case of the time-homogenous MDP, our goal is to find a policy to maximize the discounted total reward ∞ EM,π[ γh−1r(Sh, Ah)]. Xh=1 We can then introduce the value function, Bellman equation, and optimal policy similarly as in the time-inhomogeneous case, and we refer [44] for details. 2.3 Simulator Models In RL problems, the exact form of the transition probability P and reward function r is unknown, and we can only interact with the MDP to obtain a near-optimal policy. Obviously, the sample complexity of an algorithm depends on the way in which we are allowed to interact with the MDP (the interaction can be different from the interaction according to which the total reward is defined, as described above). There are two main types of simulators for the MDP, which specify the allowed interaction: the generative model setting and the episodic setting. We describe these settings below, and the results in both settings will be reviewed in this paper. Generative model setting. the input of the simulator and obtain a sample s′ simulator works as a general generative model. ∼ * | In the generative model setting, one can take any time-state-action tuple (h, s, a) as h, s, a) and the reward r(h, s, a). In this sense, the MDP P ( Episodic setting. The episodic setting is a more restrictive scenario compared to the generative model setting. In the episodic setting, one can only decide an initial state s and the action on each time step to obtain from the simulator a trajectory (S1, A1, . . . , SH , AH ) and the rewards on the trajectory r(1, S1, A1), . . . , r(H, SH , AH ). In the episodic setting, it is common to consider the regret: the cumulative difference between the obtained reward and the optimal reward over K episodes: K Regret(K) = [J ∗(M ) Xk=1 J(M, πk)] − for any given policy sequence (π1, . . . , πK ) and we aim to minimize the regret over K episodes. If we define a random policy ̄π, which uniformly chooses a policy among π1, . . . , πK and apply it to the MDP, then Therefore, a policy sequence with low regret can generate a near-optimal policy. J ∗(M ) − J(M, ̄π) = 1 K Regret(K). 4 3 RL Algorithms with Function Approximation In this section, we introduce some typical RL algorithms with function approximation. They can be divided into two categories: valued-based methods and policy-based methods. 3.1 Value-Based Method Value-based methods approximate the value or Q-value functions and use the Bellman optimality equation (1) to learn the optimal value or Q-value functions. The near-optimal policy can then be obtained through the greedy policy with respect to the optimal Q-value function. If we have access to a generative model, one typical value-based algorithm with function approximation is the fitted Q-iteration algorithm [42, 4, 12, 22]. Its main idea is as follows: noticing that the conditional expectation minimizes the L2-loss corresponding to the Bellman optimality equation (1), we know that for any function space such that Q∗ h is the minimizer of the following optimization problem: , Q∗ F h ∈ F min f ∈F E(s,a)∼μ,s′∼Ph(* | s,a)| f (s, a) − r(h, s, a) V ∗ h+1(s′) | 2. − (2) Therefore, in the fitted Q-iteration algorithm, we compute the Q∗ h backwardly through the Bellman optimality equa- h, Ai (Si tion (1). At each step h, we choose n state-action pairs }1≤i≤n, submit the queries h) }1≤i≤n { h, ˆSi (ri to the generative model, and obtain the reward and next state }1≤i≤n. We solve an empirical version of the least-square problem (2) for h = H, H 1, . . . , 1 backwardly. The pseudocode of the fitted Q-iteration is presented in Algorithm 1. We comment that the performance of the fitted Q-iteration algorithm relies on the samples (Si }1≤i≤n: we hope these samples are representative enough among those encountered of state-action pairs under the optimal policy. h, Ai h) h, Ai h+1) h, h) (Si − { { { Algorithm 1 Fitted Q-iteration algorithm Input: MDP ( , S state-action pairs , H, P, r, μ) , function classes h, Ai }h∈[H],i∈[n]. h) (Si A { − h, A1 Initialize: QH+1(x, a) = 0 for any (x, a) for h = H, H Send (S1 h, ˆS1 (r1 h + maxa∈A Qh+1( ˆSi Compute yi Compute ˆQh as the minimizer of the optimization problem 1, . . . , 1 do h, h), . . . , (Sn h , ˆSn h+1) for all the state-action pairs h+1), . . . , (rn h = ri h+1, a) h , An {Fh} . ∈ S × A H h=1, regularization terms Λh} { H h=1, number of samples n, h, h) to the generative model and obtain the rewards and next states min f ∈Fh 1 n n i=1 X . yi h − | f (Si h, Ai h) | 2 + Λh(f ) (3) Set Qh = max 0, min { { ˆQh, H }} end Output: ˆπ as the greedy policies with respect to Qh} { H h=1. In contrast to the generative model setting where we can directly choose arbitrary state-action pairs to query at each step, when we work in the episodic setting, we need to decide how to take action on each step in order to balance the trade-off between exploitation and exploration. Exploitation concerns taking actions with large estimated Q-values in order to obtain large rewards, while exploration concerns taking actions with high uncertainty in their Q-values in order to obtain more accurate estimates. On the one hand, taking actions with large estimated Q-values can lead to large estimated total rewards in this episode, but it can also prevent the agent from discovering better actions. On the other hand, taking actions with high uncertainty can lead to more accurate Q-value estimates, but it may also result in lower total rewards in this episode. Finding the proper balance between exploitation and exploration is an important challenge in RL. The upper confidence bound (UCB) method is a common approach used in reinforcement learning to balance such a trade-off. In the UCB method, a bonus function is added to the estimated Q-value function to reflect the uncertainty in the Q-value estimates. The action that is chosen is the one 5 with the highest sum of the estimated Q-value and the bonus. Since the estimated Q-value and the bonus reflect exploitation and exploration, respectively, the UCB method is widely used in reinforcement learning algorithms and often achieves good performance. The UCB method allows the algorithm to balance the need for exploitation, in order to obtain large immediate rewards, with the need for exploration, in order to obtain more accurate Q-value estimates. We present the pseudocode of one typical such algorithm, the value iteration algorithm [29], in Algorithm 2. , A S h(s, a) = 0 for any (h, s, a) , H, P, r, μ), number of episodes K, function classes [H] Algorithm 2 Value iteration with function approximation and bonus term Input: MDP ( Initialize: Q1 for k = 1, . . . , K do Sample Sk for h = 1, . . . , H do Take action Ak Sk 1 from the initial state distribution μ. h = arg maxa∈A Qk h, Sk h). × S × A h, Ak h, Ak h(Sk , Qk P ( ∈ h+1 ∼ end if k < K then * | {Fh} H+1(s, a) = 0 for any (k, s, a) H h=1, regularization terms H h=1. Λh} { . × S × A [K] ∈ h) and observe the reward rk h = r(h, Sk h, Ak h) and next state for h = H, H 1, . . . , 1 do Compute ˆQk+1 − h as the minimizer of the optimization problem min f ∈Fh ( 1 n k i=1 X ri h + max a∈A | Qk+1 h+1(Si h+1, a) f (Si h, Ai h) | − 2 + Λh(f ) ) . (4) Compute the bonus function bk+1 ˆQk+1 max h + bk+1 h , H h 0, min { { }} end end S × A → [0, + ) based on ∞ (Si h, Ai h) } { k i=1 and Fh. Set Qk+1 h+1 = : . end Output: ˆπk as the greedy policies with respect to Qk h} { H h=1 for k = 1, . . . , K. 3.2 Policy-Based Method In policy-based methods, the policy function is approximated and optimized based on cumulative reward using stochastic gradient descent. A key step in this process is calculating the gradient with respect to the cumulative reward. This relies on the policy gradient theorem [53]: ∇θJ(πθ) = EM,πθ [ H Xh=1 ∇θ log πθ(Ah | Sh) T Xh′=h r(h′, Sh′, Ah′ )]. Here we only state the naive method to compute the gradient. Several variants can be used to replace to reduce the variance, see [48] for a detailed discussion. Algorithm 3 gives the pseudocode of the policy gradient method. Besides the vanilla policy gradient method, several variants of the policy gradient method have been pro- posed by adding various regularization terms to the cumulative reward as the target of the optimization, including the natural policy gradient [31], proximal policy optimization [49], and trust region policy optimization [47]. P T h′=h r(h′, Sh′ , Ah′) 4 General Framework of Theoretical Analysis on RL with Function Ap- proximation In this section, we will discuss how to distinguish and quantify different sources that affect the performance of RL algorithms that use function approximation. To begin, we will provide a brief overview of supervised learning 6 Algorithm 3 Policy gradient method Input: MDP ( , ing rate η. S A , H, P, r, μ), parametrization of policy πθ, initialization θ0, batch size N , iteration step K, learn- Initialize: Set θ = θ0 for k = 1, . . . , K do Sample N i.i.d. states Estimate the gradient Si 1} { N i=1 from μ and collect N trajectories { (Si 1, Ai 1, . . . , Si H , Ai H ) } N i=1 using policy πθ. gk = 1 N N H i=1 X Xh=1 ∇θ log πθ(Ai h | Si h) T Xh′=h Update θ end Output: πθ. θ + ηgk. ← r(h′, Si h′, Ai h′ ). and error decomposition in that context. Then, we will examine how to adapt these concepts for application in the analysis of RL algorithms with function approximation. In supervised learning, the goal is to estimate the target function f ∗ based on a finite training set xi, yi} where x1, . . . , xn are i.i.d. sampled from a fixed distribution μ, = D { n i=1, and the noises ǫ1, . . . , ǫn are i.i.d. standard normal distribution independent of x1, . . . , xn. We aim to find an estimator ˆf with a small population loss yi = f ∗(xi) + ǫi ( ˆf ) = Ex∼μ| R f ∗(x) ˆf (x) | 2. − f (x; θ) : θ In a standard procedure of supervised learning, one first chooses a hypothesis space or a set of trial functions Hm. Hm = Common choices of the hypothesis space include linear functions, kernel functions, and neural networks. The next step is to choose a loss function and formulate an optimization problem. The loss function is typically composed of the empirical loss , where θ denotes the parameters and m denotes the number of parameters in Θm} ∈ { Rn(θ) and a regularization term Λ(θ): 1 n Rn(θ) + Λ(θ) = Ln(θ) = n i=1 X yi − | f (xi; θ) | 2 + Λ(θ). The last step is to solve the optimization problem that aims to minimize the above loss function. It is usually solved by the gradient descent method, stochastic gradient descent method, or their variants. Let fm be the minimizer of the population loss R Ln(θ) in the hypothesis space (f ), the best approximation to f ∗ in Hm, fm,n be the minimizer Hm and ˆf be the output of the optimization algorithm. Then of the loss function the total error between the true target function f ∗ and the output of the supervised learning algorithm ˆf can be decomposed into three parts, where f ∗ k − ˆf kL2(μ) ≤ k k * kL2(μ) denotes the L2-norm under the distribution μ: ˆf f ∗ kL2(μ) fm,nkL2(μ) fmkL2(μ) fm,n − fm − + − + k k . approximation error estimation error optimization error | The first part is the approximation error } {z {z Hm may not k be able to represent the true function f ∗ exactly. The second part is the estimation error fm,nkL2(μ), which fm − arises because we only have a finite dataset and may not be able to find the best approximation fm. The third part ˆf kL2(μ), which arises because the optimization algorithm may not converge to the is the optimization error fm,n − true minimizer of the empirical loss. We will then discuss the approximation error, estimation error, and optimization error in the context of RL with function approximation. } } fmkL2(μ), which arises because the hypothesis space f ∗ {z − k k | | 7 4.1 Approximation Error To investigate the approximation error in the context of RL, we aim to understand the requirements for the transition probability and reward function needed to accurately approximate the Q-value function for value-based methods and the policy function for policy-based methods. Note that the value function V ∗ h is less significant, as we cannot directly compute the optimal policy based on it. The subsequent theorem demonstrates that when the action space is finite and the optimal Q-value function can be accurately approximated, the optimal policy can also be accurately approximated by the corresponding softmax policy. Consequently, our primary focus is on the conditions that ensure the Q-value function can be effectively approximated. Theorem 1. Assume that let A is a finite set. Given any β > 0 and continuous functions Q = Qh} { H h=1 : S × A → R, πQ,β h (a s) = | exp(βQh(s, a)) a′∈A exp(βQh(s, a′)) . Then, P J ∗(M ) 0 ≤ − J(M, πQ,β) H log β ≤ |A| + 2βH H Xh=1 E M,πQ∗,β max a∈A | Q∗ h(Sh, a) Qh(Sh, a) | . − In supervised learning, a common approach to investigating the approximation error involves proving that the target function resides in specific function spaces, such as reproducing kernel Hilbert space (RKHS) and Barron space. These spaces are ideal for particular approximation schemes, like kernel function and neural network approx- imation, due to the direct and inverse approximation theorems present within these function spaces. In other words, any function within the space can be approximated using the selected approximation method at a specific rate of convergence, and any function that can be approximated at a particular rate belongs to that function space. We will provide a comprehensive introduction to RKHS and Barron space in Section 6.1. In RL, our primary focus is on whether the Q-value function, as a function of state and action, lies within the specific function space. Depending on the specific algorithm we analyze, we need to determine the conditions of P and r under which the MDP satisfies the following properties: Property 1 The optimal Q-value function Q∗ h lies in the specific function space. Property 2 The Q-value function Qπ h lies in the specific function space for any policy π. This is often required in the policy iteration algorithm with function approximation (see, e.g., [34]). Property 3 The Bellman optimal operator ∗ h f )(s, a) = r(h, s, a) + Es′∼P ( * | h,s,a)[max ( T a′∈A f (s′, a′)] ] for a constant C > 0. This is often maps the specific function space to itself and k ≤ required in the fitted Q-iteration and value iteration algorithm with function approximation (see, e.g., [60, 58, 59]). C[1 + kT k k f ∗ h f Property 4 The Bellman operator maps any bounded function in C( constant C > 0. Thf )(s, a) = r(h, s, a) + Es′∼P ( * | h,s,a)[f (s′)] ( ) to the specific function spaces and kThf S C[1 + f kC(S)] for a k k ≤ ). Noticing that for any policy π, we have that Qπ and a subset of the space of In these questions, we assume that the function space is a Banach space with norm ThV π all bounded functions in C( [0, H], we know that Property 4 implies Property 2 and hence implies Property 1. Observing that for any bounded function f in C( ), we know that Property 4 implies Property 3. Moreover, since Q∗ h+1, Property 3 implies Property 1. Finally, we remark that Property 2 and Property 3 cannot be inferred from each other [60, Proposition 5]. We introduce Property 4 because it is the strongest one among those properties and the conditions which imply Property 4 are easy to analyze due to the linearity of ), maxa′∈A f (s′, a′) is a bounded function in C( S h+1 and V π ThQ∗ h+1 ∈ k * k h = S × A S × A h = Th. 8 Proof. (of Theorem 1) By the definition of the optimal value, we have J ∗(M ) − J(M, πQ,β ) 0. ≥ Noticing that J ∗(M ) J(M, πQ,β ) = J ∗(M ) − we will estimate I1 and I2 respectively. J(M, πQ∗,β) + J(M, πQ∗,β) − J(M, πQ,β) := I1 + I2, − Using the classical performance difference lemma [30], we have Q∗ h(Sh, a)[π∗ h(a Sh) | − πQ∗,β h (a Sh)] | E M,πQ∗,β I1 = H Xh=1 H = E M,πQ∗,β Xh=1 Xa∈A max a∈A (cid:20) Q∗ h(Sh, a) a∈A Q∗ h(Sh, a) exp(βQ∗ a∈A exp(βQ∗ h(Sh, a)) h(Sh, a)) − P . (cid:21) P We will then prove that for any q = (qa)a∈A, where qm = maxa∈A qa. We can then conclude that P qm − a∈A qa exp(βqa) a∈A exp(βqa) ≤ P log |A| β , I1 ≤ H log β |A| . (5) Noticing that Define φ : R|A| R: → Then qm − a∈A qa exp(βqa) a∈A exp(βqa) P = − (qa − qm) exp(β(qa − qm)) exp(β(qa − qm)) . P φ(x) = β−1 log( exp(βxa)). Xa∈A qm − a∈A qa exp(βqa) a∈A exp(βqa) = (q − − qm)T φ(q ∇ − qm). Noticing that φ is a convex function, we have [24] P P qm)]T − − such that qa − (q − − qm)T φ(q ∇ − qm) = [0 (q Noticing that there exists an a ∈ A Therefore, φ(0) φ(q qm) ∇ − qm = 0, we have ≤ φ(q − − qm) = log |A| β − φ(q − qm). φ(q qm) 0. ≥ − log |A| β For I2, we again use the performance difference lemma to obtain that a∈A qa exp(βqa) a∈A exp(βqa) ≤ qm − P . H I2 = E M,πQ∗ ,β ∗ ,β QπQ h P (Sh, a)[πQ∗,β h Sh) (a | − πQ,β h (a Sh)] | Xa∈A E M,πQ∗,β E M,πQ∗,β | Xa∈A Xh=1 H H ≤ = H Xh=1 H Xh=1 πQ∗,β h (a Sh) | − πQ,β h (a Sh) | | Xa∈A (cid:12) (cid:12) (cid:12) (cid:12) P exp(βQ∗ a′∈A exp(βQ∗ h(Sh, a)) h(Sh, a′)) − P 9 exp(βQh(Sh, a)) a′∈A exp(βQh(Sh, a′)) . (cid:12) (cid:12) (cid:12) (cid:12) Given q = qa}a∈A and ̄q = { { ̄qa}a∈A, we have exp(βqa) a′∈A exp(βqa′ ) − exp(β ̄qa) a′∈A exp(β ̄qa′ ) a′∈A | exp(βqa + β ̄qa′ ) P exp(β ̄qa + βqa′ ) | − a∈A exp(βqa) a∈A exp(β ̄qa) (cid:12) (cid:12) (cid:12) (cid:12) a∈A a′∈A[exp(βqa + β ̄qa′ ) + exp(β ̄qa + βqa′ )] P a∈A exp(βqa) a∈A exp(β ̄qa) P P P Xa∈A (cid:12) (cid:12) (cid:12) a∈A (cid:12) P ≤ P β max a∈A | ≤ =2β max a∈A | P P qa − qa − (ex + ey) | ̄qa| P , ̄qa| where we used ex | − ey | ≤ /2. Therefore x y − H | I2 ≤ 2βH Xh=1 E M,πQ∗,β max a∈A | Q∗ h(Sh, a) Qh(Sh, a) | . − Combining the above estimation and inequality (5), we conclude our proof. 4.2 Estimation Error In the context of RL, sample complexity, i.e., the number of samples required to obtain a near-optimal policy, is often used to refer to the estimation error and plays a central role in the theoretical analysis of RL. However, in contrast to the estimation error in supervised learning, which can be characterized by the gap between the empirical loss and the population loss, the estimation error in RL is much more complex. The main challenge in the RL problem is the so-called distribution mismatch phenomenon. Take value-based methods as an example. Assume that we have h, denoted by ˆQ∗ h in the sense of L2(ν) for a an estimation of the optimal Q-value function Q∗ prespecified distribution ν. Then, we consider the performance of the greedy policy ˆπ with respect to ˆQ∗ h. Using the performance difference lemma, we have h, which is close to Q∗ J(M, π∗) 0 ≤ − J(M, π) = EM,ˆπ H Xh=1 Xa∈A H Q∗ h(Sh, a)[π∗ h(a Sh) | − ˆπh(a Sh)] | EM,ˆπ ≤ [Q∗ h(Sh, a) ˆQ∗ h(Sh, a)][π∗ h(a − Sh) | − ˆπh(a | Sh)], s)] ≤ h and ˆQ∗ h. Therefore, we need to control the difference between Q∗ 0 since ˆπh is the greedy policy where in the last inequality, we use that with respect to ˆQ∗ h under the state distribution generated by the policy ˆπ, which is unknown before we obtain ˆQ∗ h. We refer to this phenomenon as the distribution mismatch: a mismatch between the distribution ν for estimation and the distribution for evaluation that is unknown a priori. This phenomenon is ubiquitous in the analysis of RL; see, e.g., [30, Section 6]. ˆπh(a h(a a∈A P s) − h(s, a)[π∗ | | Xh=1 Xa∈A ˆQ∗ 4.3 Optimization Error In the context of RL, the optimization error differs significantly between value-based methods and policy-based methods. In value-based methods, the optimization error arises during the optimization process at each iteration, such as in (3) or (4) in Algorithm 1 or 2. As these optimization problems typically have a similar form to those in supervised learning, the analysis of the optimization error in RL is largely comparable to the analysis of the optimiza- tion error in supervised learning. On the other hand, the optimization error in policy-based methods, particularly the rate at which the algorithm's performance converges as the number of iterations increases, is a key focus in the the- oretical analysis of these methods. The analysis of the optimization problem in policy-based methods is more chal- lenging than in supervised learning due to the shift of the distribution of the trajectories in Algorithm 3 during the optimization process in policy-based methods. 1, . . . , Si 1, Ai Si H , Ai N i=1 H } { 10 5 Linear Setting The simplest form of function approximation is linear function approximation. It is the setting under which the most recent theoretical results in RL are derived with function approximation. In the linear setting, we do not assume that the state space and action space are finite, and hence we need to make some structural assumptions to obtain meaningful results. The most common one is the linear MDP assumption introduced in [29]. Definition 1 (Linear MDP). We say an MDP( if for any h θh ∈ Rd, such that for any (s, a) ∈ S × A ∈ [H], there exists d unknown signed measures μh = (μ1 , S A , H, P, r, μ) is a linear MDP with a feature map φ : h, . . . , μd Rd, and an unknown vector h) over S × A → S h, s, a) = φT(s, a)μh( * P ( r(h, s, a) = φT(s, a)θh. * | ), We shall notice that the tabular MDP is a special case of the linear MDP if we set d = , index each coordinate of Rd by state-action pair (s, a) , choose φ(s, a) as the canonical basis in Rd and set |S||A| ∈ S × A (θh)s,a = r(h, s, a), (μh( * ))s,a = P ( h, s, a) * | for any (h, s, a) [H] . × S × A ∈ 5.1 Approximation Error The next theorem demonstrates that the linear MDP assumption is the necessary and sufficient condition of the Property 4 holding true when discussing the approximation error in Section 4.1. Noticing that Property 4 is the strongest one among the four, we know that under linear MDP assumption, for any policy π, the corresponding Q-value function Qπ [H] wπ h}h∈[H] such that for any (h, s, a) h lies in the linear space, i.e., there exist weights ∈ { , × S × A Qπ h(s, a) = φT(s, a)wπ h . Theorem 2. Assume that statements are equivalent. S × A is a compact set and φ : S × A → Rd is a feature map. Then the following two 1. There exist d signed measures μh = (μ1 h, . . . , μd h) over and a vector θh ∈ S Rd, such that for any (s, a) ∈ S × A h, s, a) = φT(s, a)μh( * P ( r(h, s, a) = φT(s, a)θh. * | ), 2. For any f C( S ), there exists ωf,h ∈ ∈ Rd such that Thf )(s, a) = r(h, s, a) + Es′∼P ( * | h,s,a)[f (s′)] = φT(s, a)ωf,h ( and ωf,hk ≤ k C[ f kC(S) + 1] for a constant C > 0, where we use k k * k to denote the l2-norm on Rd. The linear MDP assumption completely ensures Property 4 (in Section 4.1) in the linear setting, but it rules out non-trivial deterministic MDPs that are frequently encountered in real-world situations. This is because P ( h, s, a) is a delta distribution and hence the supports of μ1 h are all single point sets. Therefore, the MDP can only 2. Hence, there are some studies that direct assume Property 2 [2] or Property 3 visit at most d state when h [60]. However, there has been little investigation into the concrete conditions of the transition probability and reward function under which the MDP satisfies Property 2 or Property 3. h, . . . , μd ≥ * | 11 Proof. (Proof of Theorem 2) 1 2: for any f C( ), we have ⇒ ∈ Thf = r(h, s, a) + Es′∼P ( * | h,s,a)[f (s′)] = φT(s, a)[θh + S f (s′) dμh(s′)]. ZS Therefore, let Hence, ωf,h = θh + f (s′) dμh(s′). ZS ωf,hk ≤ k kC(S×A), k μ1 μd μh|T V = ( h|T V ) is the total variation of signed measures μh. We can then choose C = where h|T V , . . . , | | θhk . μ max , |T V k} k| {k 1: Let f = 0, we know that we can choose θh = ω0,h such that r(h, s, a) = φT(s, a)θh. Moreover 2 ⇒ θhk ≤ C. Let μh|T V kk θhk k| + k f | W0 = W0 is a subspace of Rd, we can define ∈ { ω W Noticing that let ω′ f,h be the orthogonal projection of ωf,h to . Then by the definition of W Rd : φT(s, a) ω = 0, (s, a) . ∀ ∈ S × A} * as the orthogonal complement of W0, we have f,h. Thf )(s, a) = φT(s, a)ωf,h = φT(s, a)ω′ ( such that ( ∈ W f,h. We can then define a mapping from f to ω′ Thf )(s, a) = φT(s, a)ω holds for any (s, a) : C( f,h and On the other hand, for any ω of N0, we know that ω = ω′ W0. For any f ), C( S ∈ , by the definition ∈ S ×A ) S × A → N : B where θ′ h is the orthogonal projection of θh to θ′ h, f,h − f = ω′ B . Then, W We can then prove that B f is a linear mapping and Es′∼P ( * | h,s,a)[f (s′)] = φT(s, a)( B f ). f ω′ k ≤ k f,hk kB kC(S×A) = 1, we have + θ′ hk ≤ k + ωf,hk θhk ≤ 3C, which means that k k f Then for any f k f C( k kC(S×A) + 2) kB k ≤ f k ≤ f is a bounded linear mapping from C( Therefore, space, we can use the Risez representation theorem on C( μh = (μ1 B h, . . . , μd h) such that for any f C( kB ), S × A ∈ S × A 3C f k kC(S×A). ) to . Noticing that is a finite-dimensional linear W ) [45] to show that there exists d signed measure S × A W Es′∼P ( * | h,s,a)[f (s′)] = φT(s, a)( B f ) = φT(s, a) f (s′) dμh(s′) = f (s′) dφT(s, a)μh(s′), ZS ZS which means that P ( h, s, a) = φT(s, a)μh( * ). * | 12 5.2 Estimation and Optimization Error Under the linear MDP assumption, the above analysis justifies our use of a linear function to approximate the Q- value function. We can then apply the fitted Q-iteration algorithm or value iteration methods in Section 3.1 with linear function approximation. We can also use the linear function to approximate the Q-value function and then use the softmax policy to approximate the optimal policy to apply the policy gradient algorithms in Section 3.2. Here we take the value iteration (Algorithm 2) in the episodic setting [29] as an example to discuss the estimation error. In [29], they set φT(s, a)θ, θ { Fh = Λh(f ) = λ k 2, θ k Rd , } ∈ k bk+1 h (s, a) = β[φ(s, a)T( φ(Si h, Ai h)φT(Si h, Ai h) + nλI)−1φ(s, a)] 1 2 . Intuitively speaking, the bonus term bk+1 Lemma B.5], with high probability, h i=1 X is proportional to the standard deviation of the ˆQk+1 . It is proved that [29, h Q∗ Qk+1 h h(s, a) ≤ is the uniformly upper confidence bound of Q∗ . ∈ S × A In this sense, Qk+1 h. The introduction of the bonus term bk+1 and resulting UCB estimation is the crucial step to address the distribution mismatch phenomenon. By properly choosing the parameters β and λ, [29] prove that Algorithm 2 can achieve the following regret bounds (recalling that K denotes the number of episodes) (s, a), (s, a) ∀ h h Regret(K) = ̃O(√d3H 4K), which implies that to obtain an ǫ-optimal policy, the algorithm needs at most ̃O( d independent of the number of states and actions and is much more general than the tabular setting. H ǫ2 ) samples. Such a result is 3 5 In Algorithm 2, the optimization problem (4) is a ridge regression problem whose solution can be exactly com- h(s, a) is infinite, numerical errors puted, so there is no error introduced in this optimization step. However, we need to compute maxa∈A Qk many times. If may be introduced when calculating the maximum value. is finite, the maximum can be exactly computed. However, if |A| |A| There are other works in the RL literature studying RL problems in the linear setting. [57, 36, 54] consider the linear setting with a generative model in the time-homogeneous case. These works use L∞ estimation instead of UCB estimation to handle the distribution mismatch phenomenon. [60] considers a similar assumption with [29] but provides an algorithm with a tighter regret bound. [61] also considers the RL problem in a linear setting but with respect to discounted MDP with infinite horizons. [10, 1, 2] study the policy-based methods for the RL problem in the linear setting. Most of these results establish the polynomial sample complexity with respect to the number of features d, the length of the episode H, and the accuracy ǫ under similar assumptions. However, so far, the gap between the lower bound and upper bound in sample complexity still exists in the linear setting, except for results in [57, 54], which require a generative model and a very restrictive assumption called anchor state-action pairs assumption. This gap is evident by noticing that the tabular MDP is a special case of the linear MDP, and the lower bound in the tabular MDP implies a naive lower bound dH ǫ2 ; see [29, Section 5] for a detailed discussion. Bridging the gap is an important direction for future work. 3 6 Nonlinear Setting 6.1 RKHS, NTK and Barron Space As powerful function approximation tools (particularly in high dimensions), kernel functions and neural networks are now widely used in various machine learning tasks, including RL problems. Theoretical analysis of RL algorithms involving function approximations hinges on the proper choice of function spaces and a deep understanding of these spaces. In this subsection, we will briefly introduce the concepts of reproducing kernel Hilbert space (RKHS), neural tangent kernel (NTK), and Barron space, as they are suitable function spaces associated with kernel function and neural network approximation. In particular, we introduce the theoretical results of supervised learning algorithms in these function spaces, which will be the foundation for analyzing RL algorithms with function approximation. 13 RKHS. Suppose k is a continuous positive definite kernel that satisfies: 1. k(x, x′) = k(x′, x), x, x′ ∀ 2. m ∀ ≥ 1, x1, . . . , xm ∈ X ; ∈ X and a1, . . . , am ∈ R, we have: m m i=1 X j=1 X aiajk(xi, xj) 0. ≥ Then, there exists a Hilbert space Hk ⊂ C( X ) such that Rd, k(x, ) ∀ ∀ x x ∈ 2. 1. Rd and f ∈ Hk; * ∈ Hk, f (x) = k is called the reproducing kernel of examples of reproducing kernels include the Gaussian kernel k(x, x′) = exp( k(x, x′) = exp( f, k(x, h * Hk [5], and we use ) (α > 0). iHk . ) x′ ∈ k*kHk to denote the norm of the Hilbert space α k − Hk. Common 2) and the Laplacian kernel x′ − x k x − The kernel method can efficiently learn functions in the RKHS with finite data. In the kernel method, we set the Hk, the approximation α k Hk, the entire RKHS. In this sense, since the target function f ∗ lies in hypothesis space as error is zero. We can then define the loss function − k Ln(f ) = 1 n n i=1 X yi − | f (xi) | 2 + λ k f k 2 Hk. error We can then obtain the kernel ridge estimator ˆf = arg minf ∈Hk Ln(f ). If we choose λ = n− 1 ˆf kL2(μ) ≤ kHk]n− 1 O([1 + f ∗ 4 ). − k k f 2 , then the estimation We can then show that the kernel ridge estimator can be computed exactly, and hence the optimization error is zero. First, using the Proposition 4.2 in [43], we know that f ∈Hk Ln(f ) = min f =Pn i=1 αik(*,xi) Ln(f ). min Then we only need to compute the α1, . . . , αn to minimize the loss function. Moreover, if f = then 1 n where y = (y1, . . . , yn)T, α = (α1, . . . , αn)T and Kn = (k(xi, xj))1≤i,j≤n is an n Knα] + λαTKnα, Ln(f ) = Knα]T[y [y − − n i=1 αik( * , xi), P n matrix. Therefore, × which can be computed directly. See [11, 51, 46] for more details on the kernel method. ˆα = (Kn + λnId)−1y, NTK. Neural tangent kernel (NTK) was first introduced to study the overparameterized neural networks ([27]). Rd, we consider a two-layer ReLU neural network with m neurons: For the input data x ∈ f (x; θ) = 1 √m m i=1 X aiσ(ωT i x), where σ(x) = max (a1, ω1, . . . , am, ωm), with ai ∈ x, 0 { } is the ReLU activation function. Here θ denotes the collection of all the parameters Rd, i = 1, . . . , m. If we initialize θ according to the following rule: R, ωi ∈ ai i.i.d. ∼ N (0, 1), ωi i.i.d. ∼ N (0, Id/d), (6) 14 then the fully trained neural networks approximate the kernel ridge regression on the RKHS with respect to the NTK kNTK when the width m goes to the infinity [7], where kNTK(x, x′) = Eω∼N (0,Id/d)[xTx′σ′(ωTx)σ′(ωTx′) + σ(ωTx)σ(ωTx′)] and σ′(x) = 1x>0 is the derivative of σ. The theory of NTK establishes a connection between neural network and kernel methods and shows that it is sufficient to study the corresponding NTK if we are interested in the over- parameterized neural networks with the NTK scaling (6). Therefore, we will not discuss RL with neural network approximation under the NTK regime, as it is covered by the kernel function approximation. For more details on the NTK theory, including the NTK corresponding to multi-layer neural networks, see [27, 6, 3, 7, 18]. Barron space. different scaling. We consider the two-layer ReLU neural network with mean-field scaling: Barron space is introduced to study the overparameterized neural networks as well but with a i=1 X The function in the Barron space serves as the continuous analog of the two-layer neural network as the width m goes to infinity: f (x; θ) = m aiσ(ωT i x). 1 m The Barron space is defined as follows f (x) = Rd Z a(ω)σ(ωTx) dρ(ω). (7) . (cid:27) Due to the scaling invariance of the ReLU function, the norm of the Barron space can be defined by dρ(ω) < + a(ω) | a(ω)σ(ωTx) dρ(ω), ρ (Rd), and f (x) = ∈ P Rd | ∞ = (cid:26) B Rd Z Z where the infimum is taken over all possible ρ following relationship between the RKHS and Barron space: ∈ P L1(ρ) such that Eq. (7) is satisfied. We have the ∈ f k kB = inf a,ρ Z (Sd−1) and a Sd−1 | a(ω) | dρ(ω), = ∪π∈P(Sd−1) Hkπ , B (8) where kπ(x, y) = Eω∼π[σ(ωTx)σ(ωTy)]. We shall also point out that compared to the RKHS, the Barron space is much larger in high dimensions, see Example 4.3 in [21]. We refer to [17, 20] for more details and properties of the Barron space. For a detailed comparison between the NTK and the Barron space, see [18, 16]. We can approximate the target function in Barron space with the two-layer neural networks: Hm = { f (x, θ) = 1 m Then we have that for any f ∗ m i=1 X ∈ B aiσ(ωT i x) : θ = (a1, ω1, . . . , am, ωm), ai ∈ R, ωi ∈ Sd−1, 1 i m . } ≤ ≤ and μ (Rd): ∈ P inf fm∈Hm Ex∼μ| f ∗(x) 2 fm(x) | − ≤ 2 B . k f k m Similar to the kernel ridge regression, we can define the following loss function: Ln(θ) = 1 n n j=1 X max (ln n)2, [yi − { f (xi, θ)]2 λ m + } m i=1 X ai|k ωik | to obtain the estimator ˆf . Under proper condition, we can obtain that kB[m− 1 ˆf kL2(μ) = ̃O( k f ∗ − k f 2 + n− 1 4 ]), if we set λ = ̃O(n− 1 see, e.g., [18, 16]. More work is needed to further understand the optimization error in this case. 2 ), see [19] for details. However, it is still not clear how to efficiently compute the estimator ˆf , 15 6.2 Reinforcement Learning with Nonlinear Function Approximation We first discuss the approximation error in the nonlinear setting. To this end, we generalize Theorem 2 to the case of RKHS. Theorem 3. Assume that and S × A ψi} { +∞ i=1 to denote the eigenvalues and eigenfunctions of the operator is a compact set. Let ρ be a probability distribution on , we will use S × A +∞ i=1 λi} { from L2(ρ) to L2(ρ). We further require that the following statements are equivalent. λi} { +∞ i=1 is orthonormal in L2(ρ). Then, ψi} { Kρg)(x) := ( k(x, x′)g(x′) dρ(z′) ZS×A +∞ i=1 is nonincreasing and 1. For any h [H], r(h, ) * ∈ Hk and there exist signed measures ∈ μi h} { +∞ i=1 over S , such that for any (s, a) P ( * | h, s, a) = +∞ i=1 X ψi(s, a)μi h( * ) in the sense that for any f ) C( S ∈ f (s′) dP (s′ h, s, a) = | ZS +∞ i=1 ZS X f (s′) dμi h(s′)ψi(s, a), where the convergence is in the sense of L2(ρ). Moreover, for any f ) C( S ∈ 1 λi | +∞ i=1 X ZS f (s′) dμi h(s′) | 2 C f k k ≤ 2 C(S), for a constant C > 0. 2. For any f C( S ∈ ) and h [H], ∈ Thf )(s, a) = r(h, s, a) + Es′∼P ( * | h,s,a)[f (s′)] ( ∈ Hk and kThf kHk ≤ C′[ f kC(S) + 1] for a constant C′ > 0. k Proof. We will use the following representation of the RKHS norm: 2 k = g k k +∞ i=1 X 1 λi |h g, ψiiL2(ρ)| 2. (9) See, e.g., [9, Section 2.1]. 2: For any f 1 ⇒ ), C( S ∈ Thf )(s, a) = r(h, s, a) + ( +∞ i=1 ZS X f (s′) dμi h(s′)ψi(s, a). Let then gf,h, ψiiL2(ρ) = h S f (s′) dμi R gf,hkHk = k +∞ gf,h = i=1 ZS X f (s′) dμi h(s′)ψi, h(s′) for any i N+. Therefore gf,h ∈ Hk and ∈ +∞ v u u t i=1 X 1 λi | ZS f (s′) dμi(s′) | 2 ≤ √C f kC(S). k 16 Hence 2 ⇒ 1: Choose f = 0 we know that r(h, kThf kHk ≤ k C′[1 + f k C′. Let kC(S)]. * ) r(h, kHk + ) * k ∈ Hk and gf,hkHk ≤ ) r(h, kHk ≤ * k gf,h = Es′∼P ( * | h,s,a)[f (s′)], kC(S) = 1, we have kHk + k r(h, f S ∈ C( then for any f ), gf,h ∈ Hk. If k Then by the linearity of gf,h with respect to f , we have that for any f ∈ kC(S). ), gf,hkHk ≤ L2(ρ), we know that for any f k gf,hkHk ≤ kThf k C( 3C′ k f * Noticing that gf,h ∈ Hk ⊂ ∈ S ) kHk ≤ C( 3C′. ), S f (s′) dP (s′ | ZS Noticing that h, s, a) = gf,h = gf,h(s′, a′)ψi(s′, a′) dρ(s′, a′)ψi(s, a). +∞ i=1 ZS×A X gf,h(s′, a′)ψi(s′, a′) dρ(s′, a′) | ≤ k gf,hkL2(ρ) ≤ λ1k gf,hkHk ≤ 3C′ p We can then use the Riesz representation theorem to obtain that there exists signed measures p | ZS×A f kC(S). λ1k μi { h} +∞ i=1 such that Therefore, Moreover, gf,h(s′, a′)ψi(s′, a′) dρ(s′, a′) = f (s′) dμi h(s′). ZS ZS P ( * | h, s, a) = +∞ i=1 X μi h( * )ψi(s, a). gf,hk k 2 Hk = 1 λi | +∞ i=1 X ZS f (s′) dμi h(s′) | 2 ≤ 9(C′)2 f k k 2 C(S) := C 2 C(S). f k k ∈ Similar to the discussions in the linear setting, Theorem 3 provides a necessary and sufficient condition to ensure Property 4 in the RKHS setting. The extension of Theorem 3 to the Barron space is not yet clear, mainly due to the lack of a representation of the Barron norm that is similar to (9). Nevertheless, it is still worthwhile to consider only sufficient conditions for Property 4 in Barron space. [40] introduce one such condition: for any h [H], r(h, kB < + ) , ∞ sup s′∈S k p(h, s′, kB < + ) , ∞ * k where p(h, s′, s, a) = dP (s′ | h,s,a) . Similar to the situation in the linear setting, these conditions rule out many interesting deterministic MDPs, since these MDPs can only visit countably 2. Additionally, there has been little investigation into the concrete conditions on the infinite states when h transition probability and reward function that ensure Property 2 and Property 3 in Section 4.1 in the nonlinear setting. and ρh is a probability distribution on dρh(s′) ≥ S * (10) With theoretical results in supervised learning and analysis on the approximation error of RL in the nonlinear setting, it remains to develop tools to handle the distribution mismatch phenomenon in the nonlinear setting, which leads to a paramount difference in RL analysis between tabular/linear settings and nonlinear settings. In the tabular and linear settings, the L∞ estimation and UCB estimation are used to handle the distribution mismatch. The L∞ estimation or UCB estimation of the value function is obtained such that the error under any distribution can be controlled. However, as pointed out in [33], [40] and the theorem below, both L∞ and UCB estimations will suffer from the curse of dimensionality for high-dimensional NTK, Barron space, and many common RKHSs. This challenge reveals at least one essential difficulty of RL problems in the nonlinear setting compared to the tabular and linear settings. 17 X Theorem 4. Given an RKHS , let and any x1, . . . , xn ∈ X Hk on 1 k be the unit ball of H f, f ′ Gnf ′, Gnf = ∀ , let For any given distribution ρ on L2(ρ): λi} X { associated with a continuous kernel k (assuming that supx∈X k(x, x) Gn : 1 Hk and k → k such that f (xi) = f ′(xi), i = 1, . . . , n. 1 C( H X ) be a mapping satisfying ∈ H +∞ i=1 be the nonincreasing eigenvalues of the mapping Kρ : L2(ρ) 1) ≤ → (Kρg)(x) = k(x, x′)g(x′) dρ(x′). The following two statements hold true. 1. (L∞ estimation) sup f ∈H1 k f k − Gnf k∞ ≥ ZX 1 2 . λi) +∞ ( i=n+1 X 2. (UCB estimation) If Gn additionally satisfies that then, Gnf (x) ≥ f (x), f ∀ 1 k and x ∈ H , ∈ X (11) sup f ∈H1 k Eρ[ Gnf − f ] ≥ +∞ λi. i=n+1 X We can interpret the mapping Gn in Theorem 4 as an abstraction of a function approximation algorithm that takes the function values at n points, x1, . . . , xn as input and returns a continuous function. The requirement in Theorem 4 is naturally satisfied: if two target functions have the same values at x1, . . . , xn, the function approximation result will be identical. From the definition, UCB estimation must satisfy condition (11) as the UCB estimation should give a pointwise upper bound of the target function. Therefore, Theorem 4 gives the lower bound of the worst-case error of both L∞ and UCB estimation based on the eigenvalue decay of the kernel. As pointed out in [40], if we +∞ choose i=n+1 λi of the following RKHSs: = Sd−1, the unit ball in Rd and ρ the uniform distribution on Sd−1, the eigenvalue decay X P k(x, x′) =   kLap(x, x′) = exp( x kN T K(x, x′) = Eω∼π(x kπ(x, x′) = Eω∼πσ(ω −k x′ ) k x′)σ′(ω − * x)σ(ω * x′) * * x)σ′(ω x′) *  is n− α d for some universal constant α. Here π is also the uniform distribution on Sd−1. Therefore, if the target function lies in the RKHS associated with the Laplacian kernel or NTK, according to the first argument in Theorem 4, the L∞ estimation suffers from the curse of dimensionality: the number of points needed to achieve an error tolerance (equation scales exponentially with respect to the dimension d. Since the (8)), the L∞ and UCB estimation in the Barron space also suffer from the curse of dimensionality. Hkπ is the subspace of the Barron space B Proof. (of Theorem 4) We first prove that sup f ∈H1 k,f (x1)=***=f (xn)=0 | 2 f (x) | ≥ +∞ λl. Xl=n+1 (12) Notice that Ex∼ρ sup f ∈H1 k,f (x1)=***=f (xn)=0 f (x) = sup kf kH≤1,hf,k(xi,*)iHk =0,1≤i≤nh f, k(x, ) iHk * = inf c1,...,cn k k(x, ) * − n i=1 X cik(xi, kHk . ) * 18 P and Hence, Then, let φ1, . . . , φn be the Gram-Schmidt orthonormalization of k(x1, { * ), . . . , k(xn, in ) } * H , then inf c1,...,cn k k(x, ) * − n i=1 X cik(xi, ) k * 2 Hk = k(x, x) n − i=1 X φ2 i (x). Therefore, Ex∼ρ sup f ∈H1 k,f (x1)=***=f (xn)=0 | 2 = Ex∼ρk(x, x) f (x) | n − i=1 X Ex∼ρφ2 i (x). +∞ l=1 be the eigenfunctions corresponding to Let n ψl} { i=1(Ex∼ρψl(x)φi(x))2, then, +∞ l=1 , which is an orthonormal basis in L2(ρ). Let cl = λl} { λl = λ2 l k ψlk 2 Hk ≥ λ2 l n i=1 X ψl, φiiHk )2 = λ2 ( h l (Ex∼ρψl(x)φi(x))2 λ2 l = cl ≥ 0, n i=1 X cl λl = +∞ Xl=1 n +∞ i=1 X Xl=1 n (Ex∼ρψl(x)φi(x))2 λl = n i=1 X 2 H = n. φik k The famous Mercer decomposition states that i=1 X Ex∼ρφ2 i (x) = +∞ n cl ≤ Xl=1 Xl=1 λl. k(x, x′) = +∞ i=1 X λiψi(x)ψi(x′). Therefore, with the observation that Ex∼ρk(x, x) = we obtain inequality (12). To prove the first argument, first notice that λl, +∞ Xl=1 sup f ∈H1 k,f (x1)=***=f (xn)=0 k f k∞ = sup x∈X sup f ∈H1 k,f (x1)=***=f (xn)=0 | f (x) | (Ex∼ρ ≥ sup f ∈H1 k,f (x1)=***=f (xn)=0 | 1 2 2) f (x) | ≥ 1 2 . λl) +∞ ( Xl=n+1 Then, noticing that for any f 1 k such that f (x1) = ∈ H * * * = f (xn) = 0, we have sup f ∈H1 k f k − Gnf k∞ = ≥ which concludes the proof. sup f k − Gnf f ∈H1 k,f (x1)=***=f (xn)=0 sup f ∈H1 k,f (x1)=***=f (xn)=0 k f k∞, f ). Therefore Gnf = f Gn( − − Gnf k∞ k∞ + k − 2 For the second argument, let f0 = 0. For any f ∈ H Gnf0(x) = 1 k such that f (x1) = Gnf (x) f (x), ≥ = f (xn) = 0, we have * * * for any x ∈ X . Therefore, Gnf0(x) ≥ sup f (x) = f ∈H1 k,f (x1)=***=f (xn)=0 sup f ∈H1 k,f (x1)=***=f (xn)=0 | f (x) | . 19 Combining the fact that sup f ∈H1 k f (x) | | = sup f ∈H1 k f, k(x, |h ) iHk | * = k k(x, kHk = k(x, x) ) * ≤ 1, we know that Therefore, Gnf0(x) ≥ sup f ∈H1 k,f (x1)=***=f (xn)=0 | 2. f (x) | sup f ∈H1 k Ex∼ρ[ Gnf − f ] ≥ Ex∼ρGnf0(x) ≥ Ex∼ρ sup f ∈H1 k,f (x1)=***=f (xn)=0 | 2 f (x) | ≥ +∞ λi. i=n+1 X Theorem 4 indicates that the L∞ or UCB estimation is too strong as a requirement to pursue in the high- dimensional cases with nonlinear function approximation. Therefore, to obtain meaningful results in the nonlinear setting, besides the assumption that ensures the value or policy function can be approximated by the kernel or neural functions, some additional assumptions are needed to handle the distribution mismatch phenomenon. Based on the assumptions used, most of the existing works addressing this difficulty can be divided into two categories. The first category [58, 59] assumes the fast eigenvalue decay of the kernel such that the L∞ and UCB estimation still provide a meaningful bound in high dimensions. The second category [23, 12, 55, 22, 2, 40] requires the following concentration coefficient condition: for any h [H], there exists a distribution νh such that for any policy π, the corresponding state-action distribution ρh,P,π,μ satisfies ∈ dρh,P,π,μ dνh k kL2(νh) ≤ C, where C > 0 is a universal constant. Under this assumption, an L2 estimation under νh is sufficient to handle distribution mismatch since we can control the estimation error under the state-action distributions generated by all possible policies, including the optimal policy. This assumption is commonly used to study the convergence of the fitted Q-iteration algorithm (Algorithm 1) [23, 12, 22, 40]. In the episodic setting, due to the lack of a generative model, we need to additionally assume that νh is the state-action distribution ρh,P, ̄π,μ for a policy ̄π [55]. To better capture the influence of distribution mismatch in the RL problem, [39] introduce a quantity called perturbational complexity by distribution mismatch for a large class of the RL problems in the nonlinear setting when a generative model is accessible. This quantity can give both the lower bound and upper bound of the sample complexity of these RL problems and hence measure their difficulty. Moreover, both fast eigenvalue decay and finite concentration coefficient can lead to small perturbational complexity by distribution mismatch [39, Proposition 2 and 3] and hence the results in [39] generalize both categories of the previous results in the nonlinear setting. The formal definition of the perturbational complexity by distribution mismatch is given as follows. Definition 2. (i) For any set Π consisting of probability distributions on , we define a semi-norm S × A We call this semi-norm Π-norm. g kΠ := sup ρ∈Π | k ZS×A g(s, a) dρ(s, a) | . k * kΠ on C( S × A ): (ii) Given a Banach space, a positive constant ǫ > 0 and a probability distribution ν a ν-perturbation space with scale ǫ, as follows: ( S × A ), we define Bǫ,ν, ∈ P Bǫ,ν := (iii) The perturbation response by distribution mismatch is defined as the radius of kL2(ν) ≤ kB ≤ ∈ B 1, } { k k g g g ǫ : . Bǫ,ν under Π-norm, (Π, R B , ǫ, ν) := sup g∈Bǫ,ν k g kΠ. 20 We consider an RL problem whose underlying MDP belongs to a family of MDPs = { M Mθ = ( S , , P, rθ , H, μ) : θ A Θ } ∈ where initial distribution. The unknown reward function lies in the unit ball of a Banach space , P , H and μ are common state space, action space, transition probability1, length of each episode, and A S , : B rθ, θ { Θ } ∈ = B 1. In the generative model setting, [39] prove that any RL algorithm Jn : θ generative model satisfies that R on with at most n accesses to the M sup θ∈Θ E | Jn(θ) − J ∗(Mθ) | ≥ → ∆M(n− 1 2 ), 1 12 where ∆M(ǫ) = inf ν∈P(S×A) R (Π(P, μ), , ǫ, ν). B Therefore, the perturbational complexity by distribution mismatch gives a lower bound for RL problems on . M Note that in [39], it is assumed that we can only obtain a noisy reward with a standard normal noise in the generative is the Barron space or an RKHS, then the output ˆπθ of model, rather than the exact reward. On the other hand, if Algorithm 4 satisfies: J(Mθ, ˆπθ) sup θ∈Θ | − B J ∗(Mθ) | ≤ ̃O(H∆M(n− 1 4 )). Therefore, the perturbational complexity by distribution mismatch also gives an upper bound for RL problems on . M Algorithm 4 Fitted reward algorithm Input: MDP family , generative model of MDP ( , , H, P, rθ , μ), sampling distribution ˆν = for h = 1, 2, . . . , H do (Π(P0, μ), M arg minν∈P(S×A) R Hk, n− 1 Sample (s1, a1), . . . , (sn, an) i.i.d. from ˆν Sample r1 h from ) as the minimizer of the optimization problem Compute ˆrθ(h, (rθ(h, s1, a1), 1), . . . , h, . . . , rn 4 , ν). N N S A * (rθ(h, sn, an), 1), respectively min krkB≤1 n i=1 X [r(si, ai) h]2 ri − end Collect the fitted reward function to form the MDP ( are known. Denote it as ˆMθ. Output: ˆπθ as the optimal policy of ˆMθ. S , , H, P, ˆrθ , μ), of which both reward function and transition A suffer from the curse of dimensionality [39]. The first example involves a state space s0, while the action space A value of the reward function lying in the unit ball of The perturbational complexity by distribution mismatch can also be used to construct various RL problems that consisting of a single point is Sd−1 and H = 1. In this setting, the RL problem essentially aims to find the maximum based on the values of n points. We can prove that when is the Barron space and the RKHS corresponding to the Laplacian kernel and NTK, the convergence rate can be B bounded below by the eigenvalue decay. Therefore, if we consider the RKHS corresponding to the Laplacian kernel or neural tangent kernel, the convergence rate suffers from the curse of dimensionality. We can then conclude that if we want to solve RL problems with high dimensional action space, we need to assume the decay of the eigenvalue is fast enough to break the curse of dimensionality. The other example involves a high-dimensional state space and B S 1In [39], the general case where the transition probability is unknown is also considered and fitted Q-iteration algorithm (Algorithm 1) with kernel function approximation is studied in this case. Here for brevity we only discuss the case where the transition probability is known. 21 finite action space. For any dimension d an MDP family ≥ 2, length of each episode H N+ and positive constant δ > 0, we define ∈ Md,H,δ as follows: = Sd−1, A S Θr} rθr : θr ∈ k { k((s, a), (s′, a′)) = exp( −k 0, 1 r : = = { } { , H = H, μ = UniformSd−1, r(h, s 1, ∀ ), P ( [H] h ) kHk ≤ s′ k ∈ h, s, a) = δTa,hs( * } , ), * − (φ1, . . . , φhd + δ, . . . , φd), when a = 0, δ, . . . , φd), when a = 1, (φ1, . . . , φhd − * | Ta,hs = ( where hd = h mod d and we use the spherical coordinates (φ1, . . . , φd) to denote the points on Sd−1. Then we can show that there exist no universal constants α, β > 0 and constant Cd > 0 only depending on d such that ∆Md,H,δ (n− 1 2 ) sup δ>0 CdH α( ≤ 1 n )β holds for all n, H dimensionality. ∈ N+ and d ≥ 2. Therefore, the above RL problems cannot be solved without the curse of 7 Discussion and Conclusion In this paper, we review existing research on reinforcement learning with function approximation. The results in the tabular and linear settings are well-developed because methods such as L∞ and UCB estimation can be used to handle the phenomenon of distribution mismatch. When a generative model is available, the perturbational complexity by distribution mismatch can be used to measure the impact of distribution mismatch and assess the difficulty of reinforcement learning problems in the nonlinear setting. However, it remains unclear how to extend these results to the episodic setting, and it is still an open question how to use perturbational complexity information to guide the design of efficient reinforcement learning algorithms in practice. Approximation error is also an important topic in RL, especially in the nonlinear setting. Apart from the Theorem 2 for linear space, Theorem 3 for RKHS, and the condition (10) for Barron space, there are limited results in this area, particularly for deterministic MDPs. We remark that the solution of the continuous-time Hamilton-Jacobi-Bellman equation, which is the value function of continuous-time MDPs, can be approximated by neural networks, see, e.g., [26]. However, it is not clear whether this result can be applied to discrete-time MDPs. Computational issues are another important topic in reinforcement learning, particularly for reinforcement learning with neural function approximation. The convergence of the gradient descent method of neural networks in the mean field regime is still not well-understood. We hope that further research will be conducted on these topics. Finally, a significant gap exists between the current theory and practice of reinforcement learning, even in the absence of function approximation. The majority of theoretical results focus on algorithms that employ strategic exploration, such as the UCB method [8, 28, 29, 59]. However, RL algorithms in practice often utilize the random exploration. Theoretical research suggests that, in the worst-case scenario, RL with random exploration exhibits exponential difficulty with respect to the horizon [13], which does not accurately explain practical performance. While some theoretical studies [38, 35] have examined instance-based bounds by identifying specific RL problem properties that lead to better performance than the worst case when random exploration is employed, these properties do not fully account for the success of all practical RL problems, nor do they address function approximation. Furthermore, many practical techniques, such as reward shaping, experience replay, and pre-trained policies, have not been sufficiently explored in theoretical research to explain their positive impact on RL algorithm performance. It is essential for future research to bridge the gap between theory and practice, particularly in the presence of function approximation. References [1] Alekh Agarwal, Mikael Henaff, Sham Kakade, and Wen Sun. PC-PG: Policy cover directed exploration for provable policy gradient learning. Advances in neural information processing systems, 33:13399–13412, 2020. 22 [2] Alekh Agarwal, Sham M Kakade, Jason D Lee, and Gaurav Mahajan. On the theory of policy gradient methods: Optimality, approximation, and distribution shift. Journal of Machine Learning Research, 22(98):1–76, 2021. [3] Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via over- parameterization. In International Conference on Machine Learning, pages 242–252. PMLR, 2019. [4] Andr ́as Antos, Csaba Szepesv ́ari, and R ́emi Munos. Learning near-optimal policies with Bellman-residual minimization based fitted policy iteration and a single sample path. Machine Learning, 71(1):89–129, 2008. [5] Nachman Aronszajn. Theory of reproducing kernels. Transactions of the American mathematical society, 68(3):337–404, 1950. [6] Sanjeev Arora, Simon Du, Wei Hu, Zhiyuan Li, and Ruosong Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. In International Conference on Machine Learning, pages 322–332. PMLR, 2019. [7] Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, Russ R Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. Advances in Neural Information Processing Systems, 32, 2019. [8] Mohammad Gheshlaghi Azar, Ian Osband, and R ́emi Munos. Minimax regret bounds for reinforcement learn- ing. In International Conference on Machine Learning, pages 263–272. PMLR, 2017. [9] Francis Bach. On the equivalence between kernel quadrature rules and random feature expansions. The Journal of Machine Learning Research, 18(1):714–751, 2017. [10] Qi Cai, Zhuoran Yang, Chi Jin, and Zhaoran Wang. Provably efficient exploration in policy optimization. In International Conference on Machine Learning, pages 1283–1294. PMLR, 2020. [11] Andrea Caponnetto and Ernesto De Vito. Optimal rates for the regularized least-squares algorithm. Foundations of Computational Mathematics, 7(3):331–368, 2007. [12] Jinglin Chen and Nan Jiang. Information-theoretic considerations in batch reinforcement learning. In Interna- tional Conference on Machine Learning, pages 1042–1051. PMLR, 2019. [13] Chris Dann, Yishay Mansour, Mehryar Mohri, Ayush Sekhari, and Karthik Sridharan. Guarantees for epsilon- greedy reinforcement learning with function approximation. In International Conference on Machine Learning, pages 4666–4689. PMLR, 2022. [14] Christoph Dann, Tor Lattimore, and Emma Brunskill. Unifying PAC and regret: Uniform PAC bounds for episodic reinforcement learning. In Advances in Neural Information Processing Systems, volume 30, pages 5713–5723, 2017. [15] Omar Darwiche Domingues, Pierre M ́enard, Matteo Pirotta, Emilie Kaufmann, and Michal Valko. Regret bounds for kernel-based reinforcement learning. arXiv preprint arXiv:2004.05599, 2020. [16] Weinan E, Chao Ma, Stephan Wojtowytsch, and Lei Wu. Towards a mathematical understanding of neural network-based machine learning: what we know and what we don't. arXiv preprint arXiv:2009.10713, 2020. [17] Weinan E, Chao Ma, and Lei Wu. Barron spaces and the compositional function spaces for neural network models. arXiv preprint arXiv:1906.08039, 2019. [18] Weinan E, Chao Ma, and Lei Wu. A comparative analysis of optimization and generalization properties of two-layer neural network and random feature models under gradient descent dynamics. Sci. China Math, 2019. [19] Weinan E, Chao Ma, and Lei Wu. A priori estimates of the population risk for two-layer neural networks. Communications in Mathematical Sciences, 17:1407–1425, 2019. [20] Weinan E, Chao Ma, and Lei Wu. The barron space and the flow-induced function spaces for neural network models. Constructive Approximation, 55(1):369–406, 2022. 23 [21] Weinan E and Stephan Wojtowytsch. Kolmogorov width decay and poor approximators in machine learning: Shallow neural networks, random feature models and neural tangent kernels. Research in the Mathematical Sciences, 8(1):1–28, 2021. [22] Jianqing Fan, Zhaoran Wang, Yuchen Xie, and Zhuoran Yang. A theoretical analysis of deep Q-learning. In Learning for Dynamics and Control, pages 486–489. PMLR, 2020. [23] Amir-massoud Farahmand, Mohammad Ghavamzadeh, Csaba Szepesv ́ari, and Shie Mannor. Regularized pol- icy iteration with nonparametric function spaces. The Journal of Machine Learning Research, 17(1):4809– 4874, 2016. [24] Bolin Gao and Lacra Pavel. On the properties of the softmax function with application in game theory and reinforcement learning. arXiv preprint arXiv:1704.00805, 2017. [25] Mohammad Gheshlaghi Azar, R ́emi Munos, and Hilbert J Kappen. Minimax PAC bounds on the sample complexity of reinforcement learning with a generative model. Machine learning, 91(3):325–349, 2013. [26] Martin Hutzenthaler, Arnulf Jentzen, and Thomas Kruse. Overcoming the curse of dimensionality in the nu- merical approximation of parabolic partial differential equations with gradient-dependent nonlinearities. Foun- dations of Computational Mathematics, 22(4):905–966, 2022. [27] Arthur Jacot, Franck Gabriel, and Cl ́ement Hongler. Neural tangent kernel: Convergence and generalization in neural networks. arXiv preprint arXiv:1806.07572, 2018. [28] Chi Jin, Zeyuan Allen-Zhu, Sebastien Bubeck, and Michael I Jordan. Is Q-learning provably efficient? In Advances in Neural Information Processing Systems, volume 31, pages 4863–4873, 2018. [29] Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement learning with linear function approximation. In Conference on Learning Theory, pages 2137–2143, 2020. [30] Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In In Proc. 19th International Conference on Machine Learning. Citeseer, 2002. [31] Sham M Kakade. A natural policy gradient. Advances in neural information processing systems, 14, 2001. [32] Jens Kober, J Andrew Bagnell, and Jan Peters. Reinforcement learning in robotics: A survey. The International Journal of Robotics Research, 32(11):1238–1274, 2013. [33] Frances Y Kuo, Grzegorz W Wasilkowski, and Henryk Wo ́zniakowski. Multivariate L∞ approximation in the worst case setting over reproducing kernel Hilbert spaces. Journal of approximation theory, 152(2):135–160, 2008. [34] Michail G Lagoudakis and Ronald Parr. Least-squares policy iteration. The Journal of Machine Learning Research, 4:1107–1149, 2003. [35] Cassidy Laidlaw, Stuart Russell, and Anca Dragan. Bridging rl theory and practice with the effective horizon. arXiv preprint arXiv:2304.09853, 2023. [36] Tor Lattimore, Csaba Szepesvari, and Gellert Weisz. Learning with good feature representations in bandits and in RL with a generative model. In International Conference on Machine Learning, pages 5662–5670. PMLR, 2020. [37] Gen Li, Yuxin Chen, Yuejie Chi, Yuantao Gu, and Yuting Wei. Sample-efficient reinforcement learning is feasible for linearly realizable MDPs with limited revisiting. arXiv preprint arXiv:2105.08024, 2021. [38] Yao Liu and Emma Brunskill. When simple exploration is sample efficient: Identifying sufficient conditions for random exploration to yield pac rl algorithms. arXiv preprint arXiv:1805.09045, 2018. [39] Jihao Long and Jiequn Han. Perturbational complexity by distribution mismatch: A systematic analysis of reinforcement learning in reproducing kernel Hilbert space. Journal of Machine Learning vol, 1:1–34, 2022. 24 [40] Jihao Long, Jiequn Han, and Weinan E. An L2 analysis of reinforcement learning in high dimensions with kernel and neural network approximation. CSIAM Transactions on Applied Mathematics, 3(2):191–220, 2022. [41] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing Atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. [42] R ́emi Munos. Error bounds for approximate value iteration. In Proceedings of the National Conference on Artificial Intelligence, volume 20, page 1006. Menlo Park, CA; Cambridge, MA; London; AAAI Press; MIT Press; 1999, 2005. [43] Vern I Paulsen and Mrinal Raghupathi. An introduction to the theory of reproducing kernel Hilbert spaces, volume 152. Cambridge university press, 2016. [44] Martin L Puterman. Markov decision processes: discrete stochastic dynamic programming. John Wiley & Sons, 2014. [45] Frigyes Riesz. Sur les op ́erations functionnelles lin ́eaires. Gauthier-Vllars, 1909. [46] Alessandro Rudi, Luigi Carratino, and Lorenzo Rosasco. FALKON: An optimal large scale kernel method. Advances in neural information processing systems, 30, 2017. [47] John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy opti- mization. In International conference on machine learning, pages 1889–1897. PMLR, 2015. [48] John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional contin- uous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015. [49] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. [50] David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of Go with deep neural networks and tree search. nature, 529(7587):484–489, 2016. [51] Ingo Steinwart, Don R Hush, and Clint Scovel. Optimal rates for regularized least squares regression. In Conference on Learning Theory, pages 79–93, 2009. [52] Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018. [53] Richard S Sutton, David McAllester, Satinder Singh, and Yishay Mansour. Policy gradient methods for re- inforcement learning with function approximation. Advances in neural information processing systems, 12, 1999. [54] Bingyan Wang, Yuling Yan, and Jianqing Fan. Sample-efficient reinforcement learning for linearly- parameterized mdps with a generative model. Advances in Neural Information Processing Systems, 34:23009– 23022, 2021. [55] Lingxiao Wang, Qi Cai, Zhuoran Yang, and Zhaoran Wang. Neural policy gradient methods: Global optimality and rates of convergence. arXiv preprint arXiv:1909.01150, 2019. [56] Yining Wang, Ruosong Wang, Simon S Du, and Akshay Krishnamurthy. Optimism in reinforcement learning In International Conference on Learning Representations, with generalized linear function approximation. 2021. [57] Lin Yang and Mengdi Wang. Sample-optimal parametric Q-learning using linearly additive features. In Inter- national Conference on Machine Learning, pages 6995–7004. PMLR, 2019. [58] Zhuoran Yang, Chi Jin, Zhaoran Wang, Mengdi Wang, and Michael Jordan. Provably efficient reinforcement learning with kernel and neural function approximations. Advances in Neural Information Processing Systems, 33, 2020. 25 [59] Zhuoran Yang, Chi Jin, Zhaoran Wang, Mengdi Wang, and Michael I Jordan. On function approximation in reinforcement learning: Optimism in the face of large state spaces. arXiv preprint arXiv:2011.04622, 2020. [60] Andrea Zanette, Alessandro Lazaric, Mykel Kochenderfer, and Emma Brunskill. Learning near optimal poli- cies with low inherent Bellman error. In International Conference on Machine Learning, pages 10978–10989. PMLR, 2020. [61] Dongruo Zhou, Jiafan He, and Quanquan Gu. Provably efficient reinforcement learning for discounted MDPs with feature mapping. In International Conference on Machine Learning, pages 12793–12802. PMLR, 2021. 26
http://arxiv.org/abs/2302.09700v2
2023-09-11T14:19:05
2023-02-20T00:15:45
Leveraging Reviews: Learning to Price with Buyer and Seller Uncertainty
In online marketplaces, customers have access to hundreds of reviews for a single product. Buyers often use reviews from other customers that share their type -- such as height for clothing, skin type for skincare products, and location for outdoor furniture -- to estimate their values, which they may not know a priori. Customers with few relevant reviews may hesitate to make a purchase except at a low price, so for the seller, there is a tension between setting high prices and ensuring that there are enough reviews so that buyers can confidently estimate their values. Simultaneously, sellers may use reviews to gauge the demand for items they wish to sell. In this work, we study this pricing problem in an online setting where the seller interacts with a set of buyers of finitely many types, one by one, over a series of $T$ rounds. At each round, the seller first sets a price. Then a buyer arrives and examines the reviews of the previous buyers with the same type, which reveal those buyers' ex-post values. Based on the reviews, the buyer decides to purchase if they have good reason to believe that their ex-ante utility is positive. Crucially, the seller does not know the buyer's type when setting the price, nor even the distribution over types. We provide a no-regret algorithm that the seller can use to obtain high revenue. When there are $d$ types, after $T$ rounds, our algorithm achieves a problem-independent $\tilde O(T^{2/3}d^{1/3})$ regret bound. However, when the smallest probability $q_{\text{min}}$ that any given type appears is large, specifically when $q_{\text{min}} \in \Omega(d^{-2/3}T^{-1/3})$, then the same algorithm achieves a $\tilde O(T^{1/2}q_{\text{min}}^{-1/2})$ regret bound. We complement these upper bounds with matching lower bounds in both regimes, showing that our algorithm is minimax optimal up to lower-order terms.
[ "Wenshuo Guo", "Nika Haghtalab", "Kirthevasan Kandasamy", "Ellen Vitercik" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09700v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09700v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.GT", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.GT", "cs.LG" ]
Leveraging Reviews: Learning to Price with Buyer and Seller Uncertainty Wenshuo Guo∗ UC Berkeley [email protected] Nika Haghtalab UC Berkeley [email protected] Kirthevasan Kandasamy UW Madison [email protected] Ellen Vitercik Stanford University [email protected] September 12, 2023 Abstract In online marketplaces, customers have access to hundreds of reviews for a single product. Buyers often use reviews from other customers that share their type-such as height for clothing, skin type for skincare products, and location for outdoor furniture-to estimate their values, which they may not know a priori. Customers with few relevant reviews may hesitate to make a purchase except at a low price, so for the seller, there is a tension between setting high prices and ensuring that there are enough reviews so that buyers can confidently estimate their values. Simultaneously, sellers may use reviews to gauge the demand for items they wish to sell. In this work, we study this pricing problem in an online learning setting where the seller interacts with a set of buyers of finitely many types, one by one, over a series of T rounds. At each round, the seller first sets a price. Then a buyer arrives and examines the reviews of the previous buyers with the same type, which reveal those buyers' ex-post values. Based on the reviews, the buyer decides to purchase if they have good reason to believe that their ex-ante utility is positive. Crucially, the seller does not know the buyer's type when setting the price, nor even the distribution over types. We provide a no-regret algorithm that the seller can use to obtain high revenue. When there are d types, after T rounds, our algorithm achieves a problem- independent ̃O(T 2/3d1/3) regret bound. However, when the smallest probability qmin that any given type appears is large, specifically when qmin ∈ Ω(d−2/3T −1/3), then the same algorithm achieves a ̃O(T 1/2q−1/2 min ) regret bound. Our algorithm starts by setting lower prices initially so as to (i) boost the number of reviews and increase the accuracy of future buyers' value estimates while also (ii) allowing the seller to identify which customers need to be targeted to maximize revenue. This mimics real-world pricing dynamics. We complement these upper bounds with matching lower bounds in both regimes, showing that our algorithm is minimax optimal up to lower-order terms. ∗Work done while the author was a PhD student at UC Berkeley. 3 2 0 2 p e S 1 1 ] T G . s c [ 2 v 0 0 7 9 0 . 2 0 3 2 : v i X r a 1 1 Introduction The rapid growth of e-commerce, now accounting for 22% of global retail sales1, has allowed cus- tomers to make far more informed purchase decisions than ever before. Potential buyers can gain insights from thousands of reviews before deciding whether to purchase an item. Customers often use reviews by buyers who share their "type"-such as body type for clothes or skin type for skin- care products-to develop high-fidelity estimates of how much they value different items, which are quantities they may be uncertain of before purchasing. When learning from reviews, a customer's purchase decision is no longer just a function of the item's price but also of how certain the customer is about her valuation, which in turn depends on the earlier sales and reviews of the items. This leads to a tension between setting revenue-optimal prices while ensuring that buyers have enough reviews to confidently estimate their values. This tension is perhaps most clear for customers of rare types (for example, particularly tall or short individuals shopping for clothing) who may find only a few reviews from similar customers and, due to this uncertainty, may only be willing to buy at relatively low prices. We introduce a model that simultaneously captures the seller's pricing problem, the buyers' learning problem, and the modus through which the buyers learn: reviews. We study how a seller-who is uncertain about the buyers' type distribution-can learn to set high-revenue prices when the buyers themselves are uncertain about their own values and are learning from reviews. Thus, there is information uncertainty on both sides of the market: the seller has uncertainty about which buyer will arrive and the buyers' type distribution, but the buyer, who knows their type, suffers from the uncertainty about their ex-ante value. Both sides of the market are operating with significantly less information than has historically been assumed in mechanism design. We study this pricing problem with an online sequential learning model where the seller attempts to sell identical copies of an item to a series of distinct buyers over T timesteps. Each buyer has one of d types drawn from a distribution P, and a buyer of type i has an ex-ante value of θi for the item. At each timestep t, the seller sets a price pt. Although the seller knows the ex-ante values θ1, . . . , θd and thus has some limited information about the buyers (for example, from market research), he does not know the buyer's type on each round nor even the distribution P. A buyer on any round could be of (i) a high-value type, but who is uncertain of their value since their type has few reviews, and thus may be hesitant to make a purchase except at a low price, (ii) of a high-value type, and who is more certain of their value since their type has many reviews, and thus is willing to purchase at a high price, or (iii) of a low-value type whom the seller should not target even if they were absolutely certain of their value since it leads to small per-purchase revenue. If a buyer of type i purchases the item, they will leave a review communicating their ex-post value for the item, which is a random variable with mean θi. To decide whether to purchase, a new buyer evaluates reviews left by buyers of type i who bought the item in the past. Specifically, the buyer at round t ∈ [T ] uses the past reviews to select a threshold τt and chooses to buy as long as pt ≤ τt. If the buyer's threshold τt is too pessimistic-for example, it always equals zero no matter the reviews-then optimizing revenue would be hopeless. In our model, we bound the level of pessimism that the buyer can display: we assume that τt is at least a lower confidence bound we denote LBt that equals the average of the reviews left by buyers with the same type, minus an uncertainty term that depends on the number of such reviews. Intuitively, the buyer can be 1https://www.trade.gov/ecommerce-sales-size-forecast 2 confident that their ex-ante value is at least LBt with high probability, so they always buy if they have good reason to believe that their ex-ante utility (value minus price) will be positive. The ex-post value is the actual experience of the buyer and is different from the ex-ante value due to exogenous stochastic factors that cannot be known at the time of purchase (for example, manufacturing defects, color on the website not matching the actual color). Hence, the buyer decides based on their ex-ante value when there is complete information. In our problem, the buyer does not even know their ex-ante value and uses reviews from previous buyers (whose reviews are based on their actual experiences, i.e., ex-post values) to update their estimate of the ex-ante value (as the expected ex-post value is the ex-ante value). 1.1 Our contributions We provide a no-regret learning algorithm for the seller that balances setting high-revenue prices with soliciting reviews from rare but high-value customers. Key technical challenges. The seller does not know the current buyer's type on each round a priori, which means the prices are anonymous. Moreover, this means the seller does not know the number of reviews that the buyer will use to construct their value estimate. If the buyer on round t has a rare type, then the lower confidence bound LBt will be low, and thus the seller would have to set a low price to ensure a purchase and a review. Suppose this rare type of buyer's ex-ante value is high enough. In that case, it may be worthwhile to initially set a low price to solicit enough reviews to ensure future purchases at a higher price, thereby winning over these rare but high-value customers. The seller, however, has to decide which buyers to win over without knowing the type of the buyer on each round, nor even the distribution over types (and, thus, which types are common and which are rare). He may, therefore, wastefully offer a low price to a high-value buyer with a common type-meaning that LBt is near the buyer's ex-ante value-who would be willing to buy at a higher price. If a rare buyer's value is high enough, it may be worthwhile to set a low price to ensure future purchases at a higher price. However, if the buyer's type is exceedingly rare, the seller will lose too much revenue by setting such a low price. The challenge is that the seller has to decide which buyers to target without knowing the distribution over types. Algorithm overview. With this intuition in mind, our algorithm maintains a set St at each step t consisting of buyer types with a sufficiently high value that are not exceedingly rare. It gradually refines this set over the T rounds. Intuitively, St is the set of buyers the algorithm targets. To refine St, the algorithm has two phases. In the first phase, the algorithm offers the item for free for a carefully chosen number of rounds, observing i.i.d. samples from the type distribution. The algorithm sets St to be the set of types appearing in a sufficiently large fraction of rounds, as in Figure 1a. In the second phase, the algorithm sets the price low enough to ensure that buyers in St always buy the item, as in Figure 1b. It successively eliminates types from St that contribute too little revenue. In this model, we define regret as the difference Regret upper bound and proof overview. between (1) the algorithm's total expected revenue and (2) the expected revenue of the opti- mal fixed price if the buyers bought whenever their ex-ante value was larger than the price, i.e., max p Pri∼P [θi ≥ p]. 3 (a) Illustration of our algorithm's first phase, at the end of which only the red circle and the green square are in St. (b) During the second phase, the algorithm sets the price pt low enough to ensure types in St will buy. Figure 1: Illustration of our algorithm's first and second phases when there are three types: a red circle, green square, and orange star. We contend with several sources of regret. The first phase of the algorithm, where the item is sold for free, inevitably leads to regret, so it must be made as brief as possible. The algorithm then completely disregards the buyer types that appeared too rarely during that phase. This results in a subset Q ⊆ [d] of buyer types that appear sufficiently often. In the second phase, the algorithm only attempts to optimize revenue with respect to the buyers in Q instead of the entire set [d], which contributes to regret. Finally, the buyers themselves do not know their ex-ante values, whereas, under our regret benchmark, buyers buy whenever their ex-ante value is larger than the price. We obtain our final regret bound by analyzing these three sources of error. Our bound depends on the smallest probability that any given type appears, which we denote as qmin. If qmin is not tiny-specifically, qmin > 2d−2/3T −1/3-then we obtain a regret bound that scales with T , as desired. In particular, our regret upper bound is ̃O(T 1/2q−1/2 min + T 1/3d2/3). Otherwise, for arbitrary qmin, our regret bound scales with T 2/3 as ̃O (cid:0)T 2/3d1/3 + T 1/3d2/3(cid:1). √ Regret lower bound and proof overview. Typical bandit lower bounds rely on hypothesis testing arguments to show that any algorithm would struggle to distinguish between similar prob- lems but with different optimal outcomes. Such an analysis would not capture the main difficulty in our setting: how fast customers can estimate their ex-ante values from past reviews. Instead, our proof leverages the buyers' uncertainty to establish a ̃Ω (cid:0)T 2/3d1/3(cid:1) worst-case lower bound and a ̃Ω(T 1/2q−1/2 min ) lower bound when qmin is large. This establishes the optimality of our algorithm. Our proof constructs a hard problem instance where buyer types with low probability of appear- ance have comparable ex-ante values to types with high probability of appearance. On each round, an algorithm should decide whether it wishes to target low-probability customers who may be less certain about their value due to fewer reviews and consequently have small LBt. Keeping prices low to do so leads to low revenue in the current round, but ignoring low-probability customers by choosing a high price risks losing potentially high per-purchase revenue in the future. By carefully choosing the probability of appearance in our construction, we obtain a tight lower bound. Our lower bound proof also provides insights that support the structure of our learning al- gorithm. If the seller knew the type distribution, he could choose a threshold a priori and only target customer types with probability larger than that threshold. Our proof illustrates that no policy could do essentially better than this thresholding approach: it does not help significantly to dynamically change which types the seller targets based on appearance probability. Our algorithm 4 exhibits a similar behavior even though the seller does not know the type distribution: it uses the first phase to discard low-probability types, focusing on the remaining types in the second phase. 1.2 Related work Learning to price when buyers do not know their values. Learning to price when buyers do not know their values requires new machinery beyond classic pricing algorithms and auction design. Prior works propose different strategies for the seller when the buyers learn through various means. One line of work studies bidding strategies for buyers who do not know their values in auction settings [Feng et al., 2018, Weed et al., 2016, Kandasamy et al., 2023]. Another line of work considers selling repeatedly to a single buyer while the buyer is learning from their own experience at each round [Papadimitriou et al., 2022, Ashlagi et al., 2016, Chawla et al., 2022]. However, a significant limitation in practice is that buyers on online platforms do not necessarily return repeatedly to buy the same item and can only obtain feedback from previous buyers via reviews. In this paper, we study the seller's pricing strategy when the buyers can only learn from past reviews. Ifrach et al. [2019] consider a similar pricing problem for the seller when the buyers learn from reviews. However, their model is limited to one buyer type, where the buyers' values for the item are i.i.d. random variables from a fixed distribution. In contrast, we study the setting where there are multiple buyer types. Moreover, the seller does not know the frequency of each type and the type of buyer who arrives at each round, which leads to crucial difficulties in our analysis. Learning to price when buyers know their values. Zhao and Chen [2020] study a setting where the buyers know their values, but the seller does not know the distribution over buyers' values. Reviews give the seller more information about this distribution than purchase decisions alone would. Zhao and Chen [2020] present an algorithm that uses the (non-noisy) reviews to obtain a ̃O (cid:0)T 1/2(cid:1) regret bound. In contrast, if the seller only observes purchase decisions and not reviews, Kleinberg and Leighton [2003] provide a Ω (cid:0)T 2/3(cid:1) lower bound. While they show that this bound can be improved to ̃Θ (cid:0)T 1/2(cid:1), it requires additional distributional assumptions. Selling to no-regret buyers who know their values. In situations where buyers know their values, the buyer may strategically improve their purchase decisions or bidding strategy over re- peated interactions to achieve a higher accumulated utility. No-regret learning has been explored as a model of buyer behavior [Braverman et al., 2018, Deng et al., 2019, Nekipelov et al., 2015, Devanur et al., 2014]. In this literature, buyers know their values but may use no-regret algorithms to learn how to bid. In comparison, in this paper, we work with buyers who do not know their values and need to estimate them from historical reviews. This leads to different dynamics. For example, suppose a seller repeatedly sets the Myerson reserve price. In that case, any buyer who knows her value a priori and uses a no-regret algorithm will eventually learn to submit a winning bid. However, a buyer without a reasonable estimate of her value may consider the Myerson price too high and will not buy. Interestingly, a seller dealing with either type of learner may benefit from selling the item for a low price early on, but for two very different reasons. In our setting, this will give buyers of a given type the opportunity to refine their estimated value and will encourage future buyers of the same type to buy at higher prices if their value is indeed high. On the other hand, as Braverman et al. [2018] show, giving items for free to agents who are learning to bid will 5 accrue welfare (as long as agents are allowed to overbid), which the algorithm can then extract in future rounds by setting prices that are higher than agent values. Buyers' social learning from reviews. Our work is also related to a rich literature on buyer behavior and social learning from reviews when buyers do not know their values [Ifrach et al., 2019, Boursier et al., 2022, Han and Anderson, 2020, Chamley, 2004, Besbes and Scarsini, 2018, Bose et al., 2006, Crapis et al., 2017, Kakhbod et al., 2021, Acemoglu et al., 2022]. Much of the research on social learning from reviews can be categorized into two groups depending on whether the decision model is Bayesian or non-Bayesian. In the Bayesian model, Ifrach et al. [2019], Acemoglu et al. [2022], and Boursier et al. [2022] study a setting where the buyers decide whether to purchase the item by calculating posterior probabilities about the item's quality given the past reviews. It may be computationally challenging for buyers to compute Bayesian updates, so several papers relax this assumption [Crapis et al., 2017, Besbes and Scarsini, 2018]. Besbes and Scarsini [2018], for example, study both fully rational Bayesian buyers and buyers with limited rationality who can only observe the average of the past reviews. Under these two extremes, they analyze the conditions under which buyers can recover a product's true quality based on their observed feedback. Unlike our paper, the buyers have private signals about the item for sale, influencing their purchase decisions. Our model can be seen as situated between these two extremes because the purchase decisions depend on the average of the past reviews and the number of those reviews. Moreover, whereas Besbes and Scarsini [2018] analyze risk-neutral buyers, we study a form of risk aversion where buyers may not purchase even if the price is below the average reviews. Unlike this prior research, we do not assume all buyers share a specific decision policy. Instead, we identify a broad family of decision policies under which our results hold. In particular, we only require that the buyer purchases the item if the price is sufficiently low. 2 Notation and online learning setup In our model, an item is sold repeatedly to a sequence of distinct buyers over a series of T rounds. Each buyer has a type i ∈ [d], and there is an unknown distribution P over the types [d]. We use the notation qi = Prj∼P [j = i] and qmin = mini∈[d] qi. The ex-ante value of a buyer with type i ∈ [d] is θi ∈ [0, 1]. If a buyer with type i ∈ [d] purchases the item, their ex-post value is drawn from a distribution Di with support [0, 1] and mean θi. The seller knows θ1, . . . , θd but not the distributions P, D1, . . . , Dd. For ease of analysis, we assume that the seller has ordered the types such that θ1 ≤ θ2 ≤ * * * ≤ θd, but the buyers are unaware of this ordering. This assumption is not necessary for the results to hold. At each timestep t ∈ [T ]: 1. There is a set σt−1 of reviews which describe past buyers' types and their ex-post values. 2. The seller first sets a price pt ∈ [0, 1]. 3. A buyer arrives with type it ∼ P. They observe the past reviews of buyers with type it: Φit,t = {v : (i, v) ∈ σt−1 and i = it}. They decide whether to purchase the item using Φit,t. We describe the buyer's purchasing model in more detail in Section 2.1. Observe that the seller is unaware of the buyer's type it when they set the price. 6 4. If the buyer purchases the item, they pay pt and leave a review of (it, vt) describing both their type and their ex-post value vt ∼ Dit. In this case, σt = σt−1 ∪ {(it, vt)}, and otherwise, σt = σt−1. Our assumptions and model reflect practical e-commerce settings. First, quite often, it is rea- sonable to assume that sellers know customers' ex-ante values as they may have inside information. For instance, a skincare product vendor may know that a particular product works better on some skin types. However, buyers may not simply trust the seller if they were to publish this value, as the seller has every incentive to overstate this value to maximize revenue. A buyer would instead decide if a product is suitable for her via independent reviews from other customers. Second, for fairness reasons, in e-commerce platforms, sellers typically have to publish a single price for all customers and cannot sell the item at individualized prices. Third, if a buyer does not purchase an item, they will not leave a review, and the seller has no way of knowing their type or ex-post value. 2.1 Buyers' purchasing model At time step t, the agent's purchase decision is defined by a threshold τt(σt−1, it) ≥ 0 that takes as input their type it and the reviews left by past agents. Intuitively, τt(σt−1, it) represents the agent's estimate of their value θit based on past reviews. The agent purchases the item if pt ≤ τt(σt−1, it). A conservative agent would choose τt(σt−1, it) to be low in order to always guarantee that τt(σt−1, it) ≤ θit, so that they only purchase when their ex-ante utility is non-negative. An extreme example of this type of conservatism would set τt(σt−1, it) = 0, meaning that the agent would only purchase the item if offered for free. Optimizing revenue with such a conservative agent would be hopeless. Therefore, we impose the following natural lower bound on τt(σt−1, it): Definition 2.1. Let Φt ⊆ σt−1 be the reviews left by agents with type it: Let LBt be the average of these reviews minus a standard confidence term: Φt = {v : (i, v) ∈ σt−1 and i = it} . LBt =  0  max  (cid:110) 0, 1 |Φt| (cid:80) v∈Φt v − (cid:113) 1 2|Φt| ln t η (cid:111) if Φt = ∅, else. We say that the agent on round t is η-pessimistic if, τt(σt−1, it) ≥ LBt. This uncertainty term corresponds to the standard confidence interval defined by the Hoeffding bound. Intuitively, as a buyer sees more reviews from his type, this uncertainty decreases, and he is more certain about his ex-ante valuation. The ln t term is necessary to construct a valid confidence interval for an arbitrary algorithm as the data may not be independent (see Appendix A): the algorithm's price may depend on previous reviews, which in turn will affect future buyers and reviews. This ln t term is not fundamental-the lower bound does not use it. Intuitively, the agents can be confident that regardless of the policy used by the seller, with probability 1 − η, for all rounds t ∈ [T ], θit ≥ LBt. We prove this formally in Appendix A. Therefore, if the price is lower than LBt, an η-pessimistic agent will buy the item as they can be confident, based on past reviews, that their ex-ante utility θit − pt will be non-negative. This restriction bounds the level of pessimism that the agents can display and thus makes it possible to set reasonable prices. We clip this lower confidence bound at 0 since valuations are always in [0, 1]. 7 Algorithm 1: TypeElimination Input: Number of timesteps tλ, number of types d, parameter λ ∈ [0, 1] for t = 1, . . . , tλ do Set pt = 0 Buyer with type it arrives and purchases item Buyer leaves review (it, vt), where vt ∼ Dit end for i ∈ [d] do Set end Set Q = (cid:8)i : qi ≥ 3λ Output: Q 4 (cid:9) qi = 1 tλ tλ(cid:88) t=1 I(it = i) ▷ Calculate the fraction of rounds each type appeared ▷ Set of types that appeared at least a (3λ/4)-fraction of rounds 2.2 Regret We define regret as the difference between: 1. The algorithm's total expected revenue, and 2. (baseline) The expected revenue of the optimal fixed price if the agents bought whenever their ex-ante value was larger than the price. Under the baseline that we compete with, both the buyer and the seller are equipped with more information than in the learning problem: the seller knows all distributions P, D1, . . . , Dd and the buyers know their ex-ante values θ1, . . . , θd. Therefore, the seller knows a priori which customers to target to maximize revenue. Moreover, since the buyers do not need to learn their ex-ante values from reviews, the seller can extract higher revenue than they could from uncertain buyers who may only buy when the price is likely lower than their ex-ante value. Formally, let bt ∈ {0, 1} indicate whether or not the buyer bought on round t ∈ [T ] and let p∗ = argmaxp∈[0,1] p Pri∼P [θi ≥ p] be the price with highest expected revenue if the agents bought whenever their ex-ante value was larger than the price. Regret is defined as E [RT ] = T p∗ Pr i∼P [θi ≥ p∗] − E (cid:35) ptbt . (cid:34) T (cid:88) t=1 (1) 3 Online Pricing Algorithm This section describes our algorithm, which has two phases: Algorithm 1 and 2. It is defined by a parameter λ > 0. (We will choose λ = d−2/3T −1/3 to obtain optimal trade-offs). Our algorithm has two phases. In the first phase (Algorithm 1), the algorithm sets a price of 0 for tλ = Θ(ln(dT )/λ) rounds. The agent will buy the item at each round since the price is 0 and leave a review. This allows the algorithm to obtain i.i.d. samples from the type distribution 8 Algorithm 2: Online pricing with reviews Input: Number of timesteps T , number of types d, η ∈ [0, 1] such that the agents are η-pessimistic, parameter λ ∈ [0, 1] def= 32 ln(dT 2) Set tλ + 1 Set Stλ+1 = TypeElimination(tλ, d, λ) for t = tλ + 1, . . . , T do λ for i ∈ St do Compute Φit = {vs : (i, vs) ∈ σt−1} and LBit = (cid:40)0 max (cid:110) 1 |Φit| (cid:80) v∈Φit v − ▷ St is the set of "active types" (cid:113) 1 2|Φit| ln T η , 0 (cid:111) if Φit = ∅ else end Set price pt = mini∈St {min {θi, LBit}} ▷ pt is the smallest LBit or θi of any active type bt = I(buyer buys at price pt) ▷ We prove that if it ∈ St, then bt = 1 if bt = 1 then The buyer leaves a review (it, vt) where vt ∼ Dit end (cid:113) ln(dT 2) 2(t−tλ) Set ρt = for i ∈ St do (cid:80)t μi,t = 1 t−tλ pμi,t = μi,t + ρt qμi,t = μi,t − ρt s=tλ+1 θi * I(bs = 1 ∧ θis ≥ θi ∧ is ∈ Q) ▷ Estimate of rev (θi, Q) ▷ Upper confidence bound ▷ Lower confidence bound end Set i0 = min {i ∈ St : pμi,t ≥ maxk∈St Set St+1 = St ∩ {i0, i0 + 1, . . . , d} qμk,t} end ▷ For i < i0, rev (θi, Q) is likely too small ▷ Eliminate types i < i0 P. In phase 2 (Algorithm 2), i.e, the remaining T − tλ rounds, the algorithm will ignore types that appeared too rarely during phase 1-in particular, on fewer than a (3λ/4)-fraction of rounds. Intuitively, customers of these types have a low probability of appearance and thus will have more uncertainty about their values due to fewer reviews. The uncertainty term will cause the lower confidence bound LBt in Definition 2.1 to be small. As the seller will have to choose a low price to target these customers (even if their ex-ante value is large), they may have to forego higher revenue from more frequent customer types. Therefore, it is not worthwhile for the algorithm to target these customers. We use Q to denote the buyer types that appeared on at least a (3λ/4)-fraction of rounds. To describe the algorithm's second phase, we will use the notation rev(p, Q) = p Pr i∼P [θi ≥ p and i ∈ Q] , to denote the expected revenue of a price p restricted to buyers in Q and p∗(Q) = argmax rev(p, Q). In this phase, Algorithm 2 will ignore the extremely rare buyers not in Q and aim to set prices that 9 compete with p∗(Q). In the analysis, we will show that by competing with p∗(Q), Algorithm 2 also competes with the optimal price p∗. Observe that p∗(Q) = θiQ for some iQ ∈ Q. On each round t > tλ of the second phase, Algorithm 2 maintains a set St of "active types" such that iQ is likely in St. Algorithm 2 sets the price pt low enough to ensure that if the current type it is in St, then the buyer will buy. In particular, we define LBit as the largest price the seller can set to ensure a purchase from a buyer of type i. We then set the price pt to be the smallest LBi,t or θi of any active type i ∈ St (we include θi for ease of analysis). If the buyer purchases the item, they leave a review (it, vt) where vt ∼ Dit. Next, for each active type i ∈ St, the seller estimates rev(θi, Q). We denote this estimate as μi,t along with upper and lower confidence bounds pμi,t and qμi,t. We will describe this estimate more in Section 4. When estimating the revenue for different prices via the averages μi,t, we only use samples from the second phase. Doing so leads to a cleaner analysis, allowing us to separate the randomness in eliminating low probability types to determine the set Q from the randomness of estimating rev(θi, Q). However, when constructing the lower confidence bound LBi,t for customers of type i, we use reviews from all rounds. This is to be expected, as customers will use all past reviews when making a purchasing decision. Algorithm 2 defines (cid:26) i0 = min i ∈ St : pμi,t ≥ max k∈St qμk,t (cid:27) to be the smallest active type such that θi0 may plausibly be p∗(Q). For all i < i0, the upper confidence bound on rev (θi, Q) is small (pμi,t < maxk∈St qμk,t), so it is unlikely that θi = p∗(Q). Algorithm 2 concludes round t by eliminating all types i < i0 from the active set. 4 Regret upper bounds We now state our main upper bounds on regret (Equation (1)). Theorem 4.1. Suppose the agents are η-pessimistic. If qmin ≤ 2λ then E[RT ] = O (cid:32) ln(dT ) λ + T dλ + (cid:112)T ln(dT ) + (cid:115) (cid:33) , T λ ln dT η and if qmin > 2λ, then E[RT ] = O (cid:32) ln(dT ) λ + (cid:112)T ln(dT ) + (cid:115) T qmin ln dT η (cid:33) . Theorem 4.1 implies the following corollary for the specific choice of λ = d−2/3T −1/3. Corollary 4.2. Suppose the agents are η-pessimistic. Setting λ = d−2/3T −1/3, we have that if qmin ≤ 2d−2/3T −1/3 then (cid:32) (cid:115) E[RT ] = O T 2/3d1/3 + T 1/3d1/3 ln dT η + (cid:112)T ln(dT ) + T 1/3d2/3 ln(dT ) (cid:33) , 10 and if qmin > 2d−2/3T −1/3, then E[RT ] = O (cid:32)(cid:115) T qmin ln dT η + T 1/3d2/3 ln(dT ) . (cid:33) √ We note that while the worst-case regret scales with T 2/3, it improves to T when all types appear with large enough probability since customers of all types will be able to form accurate estimates of their values quickly. We emphasize that our algorithm and analysis are markedly different from explore-then-commit (ETC) style algorithms in stochastic bandit settings, which share a similar two-phase strategy and have T 2/3 regret. First, the first 'explore' phase of ETC algorithms is much longer (typically ̃O(T 2/3) rounds) than our Phase 1, which lasts only ̃O(T 1/3) rounds. ETC algorithms also focus on learning all unknowns in their first phase, while here, its only purpose is to eliminate low probability types. Second, in the 'commit' phase of ETC algorithms, typically, no learning is required, while in our second phase, the algorithm is still learning the optimal price. Third, unlike our algorithm, ETC algorithms cannot obtain T regret even under favorable conditions [Garivier et al., 2016]. Fourth, we reiterate that the T 2/3 worst-case regret is due to the uncertainty on the buyers' side, which is a challenge specific to our setting. √ We will first provide an overview of our proof, with the full proof to follow in Section 4.1. Proof sketch of Theorem 4.1. The terms of our regret bounds in Theorem 4.1 arise from the fol- to the regret since lowing steps of our analysis. The first phase immediately contributes O the item is sold for free during that phase. At the end of the first phase, Algorithm 1 discards the types that appeared too infrequently, resulting in a set Q, and only aims to maximize revenue over Q. When qmin ≤ 2λ, we prove that competing with p∗(Q) rather than p∗([d]) contributes T dλ to the regret. Meanwhile, when qmin > 2λ, we prove that with high probability, Q = [d], and thus p∗(Q) = p∗([d]), so there is no impact on regret. (cid:16) ln(dT ) λ (cid:17) In order to gradually learn a price that competes with p∗(Q), Algorithm 2 maintains estimates μi,t of rev(θi, Q) = θi Prj∼P [θj ≥ θi and j ∈ Q] for the active types i ∈ St. The error of these to the regret. This step of the analysis takes some estimates contributes a factor of O care because we cannot observe at each round t whether or not it ∈ Q, provided the buyer did not buy the item. If we were able to observe whether it ∈ Q, we could simply set (cid:17) (cid:16)(cid:112)T ln(dT ) μi,t = 1 t − tλ t (cid:88) s=tλ+1 θi * I(θis ≥ θi and is ∈ Q), and the concentration would follow from a Hoeffding bound. Instead, we set μi,t = 1 t − tλ t (cid:88) s=tλ+1 θi * I(bs = 1, θis ≥ θi, and is ∈ Q), but nonetheless prove that it is a good estimate of rev (θi, Q). To do so, we show that for all active types i ∈ St and all rounds s ≤ t of Algorithm 2, I(θis ≥ θi and is ∈ Q) = I(bs = 1, θis ≥ θi, and is ∈ Q), (2) so we can still apply a Hoeffding bound (taking into account that the set St is a random variable). If bs = 1, then clearly Equation (2) holds. Otherwise, is ̸∈ Ss because any buyer in Ss will always 11 buy. We show that this means that either is ̸∈ Q or-based on the way that types are eliminated from the active sets-θis < θi, so Equation (2) holds in this case as well. Finally, the agents themselves are learning as the algorithm progresses, which increases the regret since our benchmark is the expected revenue of the optimal price if the agents buy whenever their ex-ante value is larger than the price. When qmin ≤ 2λ, the fact that the agents are learning contributes O to the regret and when qmin > 2λ, it contributes O (cid:16)(cid:113) T (cid:17) (cid:17) . (cid:16)(cid:113) T qmin ln dT η λ ln dT η 4.1 Proof of the regret upper bound (Theorem 4.1) In this section, we prove Theorem 4.1. The proof relies on a handful of helper lemmas which we prove in Appendix B. Proof of Theorem 4.1. In this proof, on each round t > tλ, we use the notation p′ split the regret into five terms as follows: t = mini∈St θi. We RT = T (cid:88) t=1 p∗([d])I (θit ≥ p∗([d])) − T (cid:88) t=1 ptbt = Z1 + Z2 + Z3 + Z4 + Z5. The first term Z1 = p∗([d])tλ ≤ 32 ln(dT 2) free for the first tλ rounds. The second term λ + 1 measures the revenue lost from offering the item for Z2 = = (cid:88) t>tλ (cid:88) t>tλ p∗([d])I (θit ≥ p∗([d])) − (cid:88) t>tλ p∗([d])I (θit ≥ p∗([d]) and it ∈ Q) p∗([d])I (θit ≥ p∗([d]) and it ̸∈ Q) relates to the revenue lost due to the fact that we only aim to compete with the optimal price for relatively-common types-namely those in Q-as does the third term Z3 = (cid:88) t>tλ The fourth term p∗([d])I (θit ≥ p∗([d]) and it ∈ Q) − p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q) . (cid:88) t>tλ Z4 = (cid:88) t>tλ p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q) − p′ t I (cid:0)θit ≥ p′ t and it ∈ Q(cid:1) (cid:88) t>tλ relates the cumulative revenue of the optimal price over Q-that is, p∗(Q)-to the cumulative revenue of the "proxy" price p′ t = mini∈St θi. Finally, the last term Z5 = (cid:88) t>tλ p′ t I (cid:0)θit ≥ p′ t and it ∈ Q(cid:1) − (cid:88) t>tλ ptbt relates the cumulative revenue of the proxy price p′ following claims, we bound Z2, Z3, Z4, and Z5. The full proofs are in Appendix B. Claim 4.3. If qmin ≤ 2λ then E[Z2] ≤ T dλ + 1 and if qmin > 2λ, then E[Z2] ≤ 1. t to the algorithm's cumulative revenue. In the 12 Proof sketch of Claim 4.3. First, we bound Z2 as follows: (cid:88) p∗([d])I (θit ≥ p∗([d]) and it ̸∈ Q) ≤ Z2 = (cid:88) p∗([d])I (it ̸∈ Q) ≤ t>tλ t>tλ I (it ̸∈ Q) . (cid:88) t>tλ Recall from Algorithm 1 that qi is the fraction of times that type i appears in phase 1 and let G be the event that for all i ∈ [d] such that qi ≥ λ, we have that qi ≥ 3λ 4 , which means that i ∈ Q. In other words, when G happens, [d] \ Q ⊆ {qi : qi < λ}. In Lemma B.1, we prove that Pr[Gc] ≤ 1 T , so E[Z2] ≤ E[Z2 | G] + T Pr[Gc] ≤ E[Z2 | G] + 1. Next, since Q is a random variable, we condition on it as well: E[Z2 | G] = (cid:88) Q′⊆[d] E[Z2 | Q = Q′, G] Pr[Q = Q′ | G]. If [d] \ Q′ ̸⊆ {qi : qi < λ}, then Pr[Q = Q′ | G] = 0. For any Q′ such that [d] \ Q′ ⊆ {qi : qi < λ}, we prove E[Z2 | Q = Q′, G] = (cid:88) (cid:88) Pr [it = i] . If qmin ≤ 2λ, then t>tλ i̸∈Q′ (cid:88) (cid:88) t>tλ i̸∈Q′ Pr [it = i] ≤ (cid:88) (cid:88) t>tλ i̸∈Q′ λ ≤ T dλ, which implies that E[Z2] ≤ T dλ + 1. The case where qmin > 2λ follows similarly. Claim 4.4. E[Z3] ≤ 0. Proof sketch of Claim 4.4. In this proof we bound Z3 = (cid:88) t>tλ p∗([d])I (θit ≥ p∗([d]) and it ∈ Q) − (cid:88) t>tλ p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q) . (3) We begin by conditioning the first term of Equation (3) on Q since it is a random variable: (cid:34) E (cid:88) t>tλ (cid:35) p∗([d])I (θit ≥ p∗([d]) and it ∈ Q) (cid:88) (cid:88) p∗([d]) Pr (cid:2)θit ≥ p∗([d]) and it ∈ Q′ | Q = Q′(cid:3) Pr[Q = Q′] Q′⊆[d] (cid:88) Q′⊆[d] t>tλ (T − tλ) p∗(Q′) Pr i∼P (cid:2)θi ≥ p∗(Q′) and i ∈ Q′(cid:3) Pr[Q = Q′], (4) = ≤ where the final inequality follows from the definition of p∗(Q′). Next, for the second term of Equation (3), (cid:34) (cid:88) E t>tλ (cid:88) E = p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q) (cid:35) p∗(Q′)I (cid:0)θit ≥ p∗(Q′) and it ∈ Q′(cid:1) | Q = Q′ (cid:35) Pr[Q = Q′] (cid:34) (cid:88) t>tλ = Q′⊆[d] (cid:88) Q′⊆[d] (T − tλ) p∗(Q′) Pr i∼P (cid:2)θi ≥ p∗(Q′) and i ∈ Q′(cid:3) Pr[Q = Q′]. 13 Combined with Equation (4), we have that E[Z3] ≤ 0. Claim 4.5. E[Z4] ≤ 5 + 4(cid:112)2T ln(dT 2). Proof sketch of Claim 4.5. In this claim, we bound Z4 = (cid:88) t>tλ p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q) − p′ t I (cid:0)θit ≥ p′ t and it ∈ Q(cid:1) (cid:88) t>tλ where p′ t = mini∈St θi. Beginning with the first term of this equation, we prove that E [p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q)] = (cid:88) t>tλ E [rev(p∗(Q), Q)] . (cid:88) t>tλ Moving on to the second term of Equation (5), we prove that for any t > tλ, E (cid:2)p′ t I (cid:0)θit ≥ p′ t and it ∈ Q(cid:1)(cid:3) = E (cid:2)rev (cid:0)p′ t, Q(cid:1)(cid:3) . Combining Equations (6) and (7), we have that E[Z4] ≤ (cid:88) t>tλ E (cid:2)rev (p∗(Q), Q) − rev (cid:0)p′ t, Q(cid:1)(cid:3) . Next, for all t > tλ, let Bt be the event that: 1. iQ ∈ St and 2. rev(p∗(Q), Q) − rev (p′ t, Q) ≤ 4ρt−1 (where ρtλ = 1). Also, let Ct = (cid:84)t s=tλ+1 Bs. In Lemma B.2, we prove that Pr [Cc t ] ≤ 1 T . By Equation (8), E[Z4] ≤ E (cid:34) (cid:88) t>tλ rev (p∗(Q), Q) − rev (cid:0)p′ t, Q(cid:1) (cid:35) CT + T Pr [Cc T ] ≤ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) t>tλ 4ρt−1 + 1 which implies the result. Claim 4.6. If qmin ≤ 2λ, then E[Z5] ≤ 4 λ ln dT 2 η +3 and if qmin > 2λ, E[Z5] ≤ 4 (cid:113) 2T (cid:113) T qmin (5) (6) (7) (8) ln dT 2 η +2. Proof sketch of Claim 4.6. On each round t > tλ, recall that LBit = (cid:40)0 max (cid:110) 1 |Φit| (cid:80) v∈Φit v − Let jt = argminj∈St θj, so p′ t = θjt. We prove that (cid:113) 1 2|Φit| ln T η , 0 (cid:111) if Φit = ∅ else. Z5 ≤ (cid:88) t>tλ p′ t I (cid:0)θit ≥ p′ t ∧ it ∈ Q ∧ bt = 0(cid:1) + (p′ t − pt)bt. (cid:88) t>tλ 14 Since pt ≤ p′ t, we have that Z5 ≤ (cid:88) t>tλ p′ t I (cid:0)θit ≥ p′ t ∧ it ∈ Q ∧ bt = 0(cid:1) + (cid:0)p′ t − pt (cid:1) . (cid:88) t>tλ By definition of the pricing rule, if it ∈ St, then bt = 1. Therefore, if bt = 0, then either it ̸∈ Q or it ∈ Q \ St. Since St contains every i ∈ Q with i > jt, we can conclude that if it ∈ Q \ St, then θit < θjt = p′ t ∧ it ∈ Q ∧ bt = 0) = 0, which means that t. Therefore, I (θit ≥ p′ E [Z5] ≤ E (cid:35) p′ t − pt . (cid:34) (cid:88) t>tλ Let j′ t = argminj∈St LBjt, which means that pt = mini∈St {min {θi, LBit}} = min (cid:110) p′ t, LBj′ tt (cid:111) . We also know that p′ t = θjt ≤ θj′ t . Therefore, E [Z5] ≤ E (cid:34) (cid:88) t>tλ max (cid:110) 0, θj′ t (cid:35) (cid:111) . − LBj′ tt Let E1 be the event that for all t > tλ, |Φi,t| ≥ 1 prove that if qmin > 2λ, then Pr [E c 1] ≤ 1 2 qmin(t − 1) for all i ∈ St. In Lemma B.4, we T . Also, let H be the event that for all t > tλ and all i ∈ St, |Φit|θi ≤ (cid:88) v + v∈Φit (cid:114) 1 2 |Φit| ln(dT 2). In Lemma B.7, we prove that Pr[Hc] ≤ 1 T . Suppose that qmin > 2λ. In this case, (cid:34) E [Z5] ≤ E (cid:88) (cid:110) 0, θj′ t − LBj′ tt max max    t>tλ (cid:88) t>tλ = E Under events E1 and H, (cid:35) E1 ∧ H + 2 (cid:111) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)    0, θj′ t − 1 tt| |Φj′ (cid:115) (cid:88) v + v∈Φj′ tt 1 tt| 2|Φj′ ln E[Z5] ≤ E (cid:115) (cid:34) (cid:88) t>tλ ln(dT 2) tt| 2|Φj′ + (cid:115) 1 tt| 2|Φj′ ln and by definition of the event E1, (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 η (cid:35)  E1 ∧ H   + 2.    (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 η (cid:35) E1 ∧ H + 2 (cid:34) (cid:88) (cid:115) E[Z5] ≤ E ln(dT 2) tt| 2|Φj′ + (cid:115) 1 tt| 2|Φj′ ln (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 η E1 ∧ H + 2 t>tλ (cid:32)(cid:115) ≤ T (cid:88) t=2 (cid:115) ln(dT 2) qmin(t − 1) + 1 qmin(t − 1) ln 1 η (cid:33) (cid:115) + 2 ≤ 4 T qmin ln dT 2 η + 2. The proof when qmin < 2λ follows similarly. 15 The final regret bound follows by combining these claims. We conclude this section by providing a proof sketch of one of the lemmas we used in Theo- rem 4.1. The full proof and the remaining lemmas are in Appendix B. This lemma shows that for all active types i ∈ St, μi,t is indeed a good estimate of rev (θi, Q) = θi Prj∼P [θj ≥ θi and j ∈ Q]. As we described in the proof sketch of Theorem 4.1, this takes some care because we cannot observe at each round t whether or not it ∈ Q, provided the buyer did not buy the item. Lemma 4.7. For all t > tλ, let At be the event rev (θi, Q) ∈ [qμi,t, pμi,t] for all i ∈ St. Then Pr[Ac t ] ≤ 1 T 2 . Proof sketch. Recall that pμi,t = μi,t + ρt and qμi,t = μi,t − ρt with (cid:115) ρt = ln(dT 2) 2 (t − tλ) . We also define the related quantities for all i ∈ [d] and all Q′ ⊆ [d]: γi,t(Q′) = 1 t − tλ t (cid:88) s=tλ+1 θi * I (cid:0)θis ≥ θi ∧ is ∈ Q′(cid:1) , pγi,t(Q′) = γi,t(Q′) + ρt, and qγi,t(Q′) = γi,t(Q′) − ρt. By a Hoeffding bound, for all Q′ ⊆ [d] and i ∈ [d], Pr (cid:2)rev (cid:0)θi, Q′(cid:1) ̸∈ (cid:2)qγi,t(Q′), pγi,t(Q′)(cid:3)(cid:3) ≤ We claim that for any i ∈ St and any s > tλ, 1 dT 2 . I(bs = 1 ∧ θis ≥ θi ∧ is ∈ Q) = I (θis ≥ θi ∧ is ∈ Q) , (9) which means that μi,t = γi,t(Q), pμi,t = pγi,t(Q), and qμi,t = qγi,t(Q). To see why, if bs = 1, then clearly Equation (9) holds. Otherwise, suppose bs = 0, in which case I(bs = 1 ∧ θis ≥ θi ∧ is ∈ Q) = 0. Then is ̸∈ Ss because any buyer in Ss will always buy by the definition of the pricing rule. Let js = min {j ∈ Ss} . Since Ss contains every element in Q larger than js, we know that either: 1. is ̸∈ Q, in which case I (θis ≥ θi ∧ is ∈ Q) = 0, or 2. is ∈ Q but is ̸∈ Ss, which means that θis < θjs. Since i ∈ St, it must be that i ∈ Ss, so θis < θjs ≤ θi. In this case, I (θis ≥ θi ∧ is ∈ Q) = 0 as well. Therefore, Equation (9) holds. The fact that μi,t = γi,t(Q), pμi,t = pγi,t(Q), and qμi,t = qγi,t(Q) for all i ∈ St implies that Pr[Ac t ] = Pr (∃i ∈ St s.t. rev (θi, Q) ̸∈ [qμi,t, pμi,t]) ≤ Pr (∃i ∈ [d] s.t. rev (θi, Q) ̸∈ [qγi,t(Q), pγi,t(Q)]) ≤ d (cid:88) i=1 Pr (rev (θi, Q) ̸∈ [qγi,t(Q), pγi,t(Q)]) . (10) The result now follows from a union bound. 16 5 Regret lower bounds In this section, we state our regret lower bounds. Recall that qmin = mini∈[d] Prj∼P [j = i] denotes the minimum probability of appearance among all types. Let RT (A, P ) denote the regret after T rounds when using an algorithm A on a problem P . Our theorem below presents two lower bounds that correspond to our upper bounds. First, we prove a qmin independent (cid:101)Ω (cid:0)T 2/3d1/3(cid:1) lower bound on the regret. Next, when qmin is large, we show that (cid:101)Ω regret is still unavoidable. (cid:16)(cid:112)T /qmin (cid:17) Theorem 5.1. For T ∈ Ω (cid:16) d (ln(1/η))2 (ln d)3/2(cid:17) , inf A sup P RT (A, P ) ≥ 1 4 T 2/3(d − 1)1/3 (cid:19)1/3 (cid:18) ln 1 η (cid:32) − 2T 1/2 ∈ Ω T 2/3d1/3 (cid:19)1/3(cid:33) . (cid:18) ln 1 η Next, suppose qmin ≥ q0 T def= T −1/3(d − 1)−2/3 (ln (1/η))1/3. Then for T ∈ Ω (cid:16) d (ln(1/η))2 (ln d)3/2(cid:17) , inf A sup P ; qmin≥q0 T RT (A, P ) ≥ (cid:115) 1 4 T qmin ln 1 η − 2T 1/2 ∈ Ω (cid:32)(cid:115) T qmin ln (cid:33) . 1 η Comparing this with Corollary 4.2, we see that our algorithm is minimax optimal, up to con- stants and polylog terms. This is the case even when qmin is larger than ̃Ω(T −1/3d−2/3) where √ T rates are possible. As we mentioned at the end of Section 1.1, our proof reveals interesting properties about the structure of an optimal policy; we discuss these in detail at the end of this section. Proof of Theorem 5.1. Unlike typical proofs of lower bounds in stochastic bandit settings, which usually rely on hypothesis testing arguments, our result stems from the buyers' uncertainty about their values. To demonstrate this, we will construct a representative problem instance and show that any algorithm will do poorly on this instance. √ Construction. For all types j ∈ [d], we set the ex-post value distribution to be Dj = Unif(1 − 2/ T . Next, we define the type distribution P as shown below. Here q < 1/d is a parameter we will specify later in the proof. T , 1). Hence, for all j ∈ [d], θj = 1 − 1/ √ ∀ j ∈ {1, . . . , d − 1}, qj = Pr i∼P [i = j] = q, qd = Pr i∼P [i = d] = 1 − q(d − 1). (11) We will use the following threshold functions for each buyer of each type. Recall that Φi,t−1 = {v; (i, v) ∈ σt−1} denotes the reviews in σt−1 left by customers of type i. τt(σt−1, i) = max    1 |Φi,t−1| (cid:88) v − v∈Φi,t−1 (cid:115) 1 2|Φi,t−1| ln 1 η   , 0 .  Note that τt(σt−1, it) is larger than LBt as defined in Definition 2.1 and satisfies the η−pessimistic agents' assumption. We will also assume that the seller knows the type distribution P; this addi- tional information can only help the seller. Despite this, we show that if buyers choose conservative threshold functions, T 2/3 regret is unavoidable. 17 √ The optimal price for the above construction is p∗ = θ1 = * * * = θd = 1 − 1/ T . The seller could simply set this price if all buyers knew their ex-ante values. However, when buyers learn their values from past observations, the confidence of their estimates shrinks only with the number of observations of their type. In particular, if q is very small, then a seller might find it beneficial to ignore customers of the first d − 1 types and set the highest possible price that can still attract customers of type d. On the other hand, if q is large, the higher price may not warrant the revenue foregone by ignoring the first d−1 types. By carefully choosing q, we can balance these trade-offs to obtain the tightest lower bound. We have set the value of all types to be equal in this construction to simplify some of our calculations, but it is not hard to see how this phenomenon affects pricing decisions for the seller. Set up and notation. For brevity, we use the following notation for the sample mean of obser- vations, the number of observations, and the threshold function for type i on round t. pEi,t−1 def= 1 |Φi,t−1| (cid:88) v, v∈Φi,t−1 (cid:101)Ni,t−1 def= |Φi,t−1|, τi,t def= τt(σt−1, i) = max (cid:40) pEi,t−1 − (cid:115) 1 2 (cid:101)Ni,t−1 ln (cid:18) 1 η (cid:41) (cid:19) , 0 . (12) Next, let τ ′ i′ t denote the corresponding maximizer. t denote the maximum of the threshold functions of the first d − 1 types on round t and i′ t = argmax j∈{1,...,d−1} τj,t, τ ′ t = τi′ t,t. (13) Recall that on each round t, a seller's policy chooses a price pt based on all past information σt−1 and possibly some source of external randomness. We next define W1,t, W2,t, W3,t below based on how pt compares to the threshold functions: W1,t = I(pt ≤ τ ′ t), W2,t = I(τ ′ t < pt ≤ τd,t), W3,t = I(∀ j ∈ [d], τj,t < pt). (14) Here, W1,t is 1 when the price pt is smaller than the thresholds for any of the first d − 1 types, W2,t is 1 when pt is larger than the thresholds for all d − 1 types but smaller than the threshold τd,t for type d (note that W2,t can be 1 only when τ ′ t < τd,t), and W3,t is 1 when pt is larger than all thresholds. It is easy to verify that exactly one of W1,t, W2,t, W3,t is 1 on any given round. Lower bounding the instantaneous regret. We can decompose the expected revenue revt = ptbt on round t, conditioned on the price pt and history σt−1 as follows. E[revt|σt−1, pt] = E[ptbt|σt−1, pt] = = = pt E[bt|σt−1, pt, it = i] Pr[it = i|σt−1, pt] pt1(pt ≤ τi,t)qi (cid:88) i∈[d] (cid:88) i∈[d] (cid:88) i∈[(d−1)] pt1(pt ≤ τi,t)q + pt1(pt ≤ τd,t)qd. (15) 18 In the third step we have used the fact that that the probability of appearance of a type does not depend on the history or the price chosen, hence Pr[it = i|σt−1, pt] = Prj∼P [j = i] = qi. Second, we note that for a customer of type i, they will purchase if and only if the price is smaller than their threshold; therefore E[bt|σt−1, pt, it = i] = 1(pt ≤ τi,t). The following lemma upper bounds E[revt|pt] in terms of the Wi,t terms defined in (14). Lemma 5.2. E[revt|σt−1, pt] ≤ W1,tτ ′ t + W2,tqdτd,t. Proof of Lemma 5.2. We will consider four exhaustive cases for pt and analyze the right-hand side of the inequality in the claim as a function of W1,t and W2,t, which we denote as RHS(W1,t, W2,t). t, τd,t}: Here, W1,t = 1 and W2,t = 0. Using (15), we obtain E[revt|pt] ≤ (d − 1. pt ≤ min {τ ′ 1)ptq + ptqd = pt ≤ τ ′ t < pt ≤ τd,t: Here, W1,t = 0 and W2,t = 1. Using (15), E[revt|pt] = ptqd ≤ τd,tqd = RHS(0, 1). t = RHS(1, 0). 2. τ ′ 3. τd,t < pt ≤ τ ′ t: Here, W1,t = 1 and W2,t = 0. Using (15), we obtain E[revt|pt] ≤ pt(d − 1)q < pt ≤ τ ′ t = RHS(1, 0). Some of terms in the first summation in (15) may be 0, but we can bound it by pt(d − 1)q regardless. 4. pt > max {τ ′ t, τd,t}: Here, W1,t = W2,t = 0. Using (15), E[revt|pt] = 0 = RHS(0, 0). Equipped with this lemma, we can now lower bound the instantaneous regret on round t con- ditioned on the price pt and history σt−1, which we denote as E[rt|σt−1, pt]: E[rt|σt−1, pt] = E[p∗ − revt|σt−1, pt] ≥ W1,t * (p∗ − τ ′ t) + W2,t * (p∗(d − 1)q + qd(p∗ − τd,t)) + W3,t * p∗. (16) Recall that i′ observations of type i′ using the fact that t is the index such that τ ′ t,t−1 is the number of t in σt−1 as defined in (12). We can further lower bound Equation (16) by t,t as defined in (13) and (cid:101)Ni′ t = τi′ p∗ − τ ′ t = p∗ − τi′ t,t = p∗ − max (cid:40) pEi′ t,t−1 − (cid:115) 1 2 (cid:101)Ni′ t,t−1 ln (cid:19) (cid:18) 1 η (cid:41) , 0 . (17) Since the support of each ex-post value distribution is bounded within an ±1/ Equation (17) implies that √ T interval of p∗, p∗ − τ ′ t ≥ p∗ − max p∗ + (cid:40) (cid:40)(cid:115) (cid:40)(cid:115) = min = min 1 2 (cid:101)Ni′ t,t−1 1 2 (cid:101)Ni′ t,t−1 (cid:115) 1 2 (cid:101)Ni′ t,t−1 (cid:41) (cid:19) , 0 (cid:18) 1 η ln (cid:41) (cid:19) − 1 √ T (cid:41) (cid:19) , 1 − , p∗ 1 √ T . (18) − 1 √ T (cid:18) 1 η ln ln (cid:18) 1 η 19 The same argument guarantees that p∗−τd,t ≥ − 1√ T and (17), and recalling that W1,t + W2,t + W3,t = 1, we have that . Combining this inequality with Equations (16) E[rt|σt−1, pt] ≥ W1,t min (cid:40)(cid:115) 1 2 (cid:101)Ni′ t,t−1 (cid:41) ln (cid:19) (cid:18) 1 η , 1 + W2,tp∗(d − 1)q + W3,tp∗ − 1 √ T . (19) t,t−1. To convert the above instantaneous bound to a lower bound on the t,t−1 which counts the number of reviews in σt−1 by t ∈ [(d − 1)] which means that the appearance probability t is q, we define the following event E below. Lemma 5.3 upper bounds the probability of this Upper bounding (cid:101)Ni′ cumulative regret, we will need to control (cid:101)Ni′ customers of type i′ of i′ event. t. Observing that i′ E = (cid:110) ∀ j ∈ [(d − 1)], ∀ t ≤ T, (cid:101)Nj,t−1 ≤ 2q(T − 1) (cid:111) . (20) Lemma 5.3. Let T ≥ 3 q ln(2d) + 1. Then, Pr[E] ≥ 1/2. Proof of Lemma 5.3. Note that (cid:101)Ni,t−1 = t−1 (cid:88) s=1 1(bs = 1, is = i) counts the number of times a customer of type i made a purchase. Let Ni,t−1 = t−1 (cid:88) s=1 1(is = i) be the number of times a customer of type i arrived. Since Ni,T −1 ≥ (cid:101)Ni,t−1, the Chernoff bound implies that Pr[∃t ≤ T such that (cid:101)Ni,t−1 > 2q(T − 1)] ≤ Pr[Ni,T −1 > 2q(T − 1)] ≤ exp (cid:19) (cid:18) q(T − 1) 3 ≤ 1 2d . The last step uses the condition on T . The claim follows via a union bound over j ∈ [d − 1]. Lower bound on cumulative regret. We are now ready to lower bound regret. By Equa- tion (19), E[RT ] ≥ E T (cid:88) (cid:32) (cid:40)(cid:115) W1,t min       t=1 (cid:124) 1 2 (cid:101)Ni′ t,t−1 ln (cid:18) 1 η (cid:41) (cid:19) , 1 (cid:123)(cid:122) rt + W2,tp∗(d − 1)q + W3,tp∗ − (cid:125)  (cid:33)      . 1 √ T Conditioning on the event E, √ E[RT ] ≥ − T + E (cid:34) T (cid:88) t=1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) rt (cid:35) E Pr[E] + E (cid:34) T (cid:88) t=1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) rt (cid:35) E c Pr[E c] 20 (cid:34) T (cid:88) rt (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:35) E − T * 1 √ T and by Lemma 5.3, √ E[RT ] ≥ − T + E 1 2 √ T + ≥ −2 E 1 2 For T > 1 4q ln (cid:16) 1 η (cid:17) , t=1 (cid:34) T (cid:88) t=1 W1,t min (cid:40)(cid:115) (cid:41) 1 4qT ln (cid:19) (cid:18) 1 η , 1 + W2,tp∗(d − 1)q + W3,tp∗ (cid:35) E . (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) E[RT ] ≥ −2 √ T + E 1 2 (cid:34) T (cid:88) t=1 (cid:115) W1,t 1 4qT ln (cid:19) (cid:18) 1 η + W2,tp∗(d − 1)q + W3,tp∗ (cid:35) E . (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) We will use the notation Mi,t = (cid:80)t s=1 Wi,s for i ∈ {1, 2, 3} which counts the number of times each Wi,s was 1 in the first t rounds. Note that M1,t +M2,t +M3,t = t since exactly one of W1,s, W2,s, W3,s is 1 on any round s. With this notation, we have that E[RT ] ≥ −2 √ T + (cid:115) (cid:34) E 1 2 M1,T 1 4qT ln (cid:19) (cid:18) 1 η + M2,T p∗(d − 1)q + M3,T p∗ (cid:35) E . (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (21) We note that M1,T , M2,T , M3,T are random quantities that depend on the execution of the algorithm. However, we can use the fact that they are non-negative and that M1,T +M2,T +M3,T = T to obtain a lower bound as follows. E[RT ] ≥ −2 √ T + 1 2 inf x1,x2,x3>0 x1+x2+x3=T (cid:32) (cid:115) x1 1 4qT ln (cid:19) (cid:18) 1 η + x2p∗(d − 1)q + x3p∗ . (cid:33) As (d − 1)q ≤ 1, for any choice (x′ 2, x′ value for the term in parentheses via (x′ 1, x′ 3 > 0, we can obtain a lower 3, 0). Therefore, the above expression simplifies to: 3) for (x1, x2, x3) such that x′ 2 + x′ 1, x′ (cid:115) (cid:32) (cid:33) + (T − x)p∗(d − 1)q . (22) E[RT ] ≥ −2 √ T + 1 2 inf 0≤x≤T x 1 4qT ln (cid:19) (cid:18) 1 η Finally, we are taking the infimum of a linear function in the bounded interval [0, T ], so the infimum lies at one of the end points x = 0 or x = T . Therefore, E[RT ] ≥ −2 ≥ −2 √ √ T + T + 1 2 1 2 min min (cid:40)(cid:115) (cid:40)(cid:115) T 4q T 4q ln ln (cid:19) (cid:19) (cid:18) 1 η (cid:18) 1 η , T p∗(d − 1)q (cid:41) (cid:41) , T p∗(d − 1)q . (23) Putting it all together. To complete the proof, first note that for all T ≥ 4, p∗ ≥ 1/2; hence, the second term inside the min can be upper bounded by 1 2 T (d − 1)q. To obtain a qmin independent bound, we set q = T −1/3(d − 1)−2/3(ln(1/η))1/3 to obtain the first result of the theorem. 21 Next, since qmin = q for this problem, we have that when qmin > q0 T = T −1/3(d − 1)−2/3 (ln (1/η))1/3 , the minimum is the first of the two terms in (23). This leads to our second lower bound. Our construction uses p∗ close to 1 to simplify some of the calculations in the analysis, but a similar analysis is possible for any p∗ bounded away from 0. Second, while our construction sets the ex-ante value θj to be the same for all types, a similar result can be shown in cases where a low probability type has ex-ante value similar to or larger than the ex-ante value of high probability types. Third, recall that we have assumed in this proof that the seller knows the type distribution P. If it is unknown, as was shown in our upper-bound analysis, the seller only really needs to estimate the low probability types and the expected revenue when targeting the remaining types, both of which can be done at rates T 1/3 and T 1/2 respectively without having to learn P entirely. The T 2/3 bottleneck arises as the seller needs to wait for the buyers' estimates of their values become accurate. We also make the following observation via Equations (21)–(23). Intuitively, M1,T in (21) denotes the number of times the seller's policy targeted the low probability types, M2,T denotes the number of times it targeted the high probability type while ignoring the low probability types, and M3,T is the number of times it targeted none of the types. Equation (22) states that any reasonable policy will never ignore all customer types, choosing M3,T = 0. On the other hand, the fact that the infimum in (23) lies in one of two extremes (M1,T , M2,T ) ∈ {(0, T ), (T, 0)} indicates that any reasonable policy cannot do significantly better than a policy which chooses ahead of time to target all customer types or only focus on the high probability types. Intuitively, this means that the seller's policy can decide ahead of time which customers it wants to ignore due to a low probability of appearance. In other words, it does not significantly help to change which types you target on different rounds based on their appearance probability. Interestingly, this is precisely the behavior of our algorithm as well; it uses a small initial phase of at most T 1/3 rounds to identify and eliminate low probability types. From thereon, it only targets the remaining high probability types. 6 Conclusion We proposed no-regret online pricing strategies when both sides of the market learn from reviews. Our algorithm strategically sets lower prices during its early phase to boost sales from customers with rare types and high values. Reviews from the early phase benefit future buyers in the long run. Our algorithm carefully trades off the revenue loss due to discounts from the initial phase and future gains. Our lower bound demonstrates that our algorithm is optimal up to lower order and constant terms. To the best of our knowledge, this is the first result on online pricing when both the seller learns to price and buyers with different types learn from reviews. Future directions. Many questions remain open for future research. We assumed that purchases always come with a noisy review. An interesting direction would be providing pricing strategies when the reviews are left with varying probabilities, which mimics real-world buyer behaviors. We studied myopic buyers who make their purchase decisions based on estimates of their ex- ante values from historical reviews, regardless of the seller's policy. What if the buyers appear over several rounds and may behave strategically to purchase at lower future prices? 22 We take a frequentist perspective on this problem. It is also possible to take a Bayesian view of this problem and impose a prior on the ex-ante value so that the buyer starts with some prior information. We expect adapting our main proof intuitions to that setting is possible. The main differences would be: (i) we would use Bayesian credible intervals instead of frequentist confidence intervals for the η-pessimism definition, (ii) we would control the Bayes' risk when estimating the ex-ante values instead of frequentist concentration arguments, and (iii) our final regret could have a nuanced dependence on this prior which may offer tighter bounds. Another direction would be to explore the case where the seller does not know the buyers' ex-ante values. The key challenge would be related to the regret benchmark: we compete with the optimal price if the buyers knew their own ex-ante values and bought whenever their ex-ante value was above the price (thus, the buyers are not learning). To compete with this benchmark, we require unbiased estimates of the revenue of different prices if the buyers bought when their ex-ante value was above the price. Computing these unbiased estimates is challenging: if a buyer does not buy on a given round, the algorithm does not learn their type, so it cannot tell whether the buyer has a low ex-ante value or he has a high value but a low confidence bound. If the seller knows the buyers' ex-ante values, we can circumvent this subtle challenge, as we explain in the proof sketch of Theorem 4.1. However, this is not possible if the ex-ante values are unknown. References Daron Acemoglu, Ali Makhdoumi, Azarakhsh Malekian, and Asuman Ozdaglar. Learning from reviews: The selection effect and the speed of learning. Econometrica, 90(6):2857–2899, 2022. Itai Ashlagi, Constantinos Daskalakis, and Nima Haghpanah. Sequential mechanisms with ex-post participation guarantees. In ACM Conference on Economics and Computation (EC), 2016. Omar Besbes and Marco Scarsini. On information distortions in online ratings. Operations Research, 66(3):597–610, 2018. Subir Bose, Gerhard Orosel, Marco Ottaviani, and Lise Vesterlund. Dynamic monopoly pricing and herding. The RAND Journal of Economics, 37(4):910–928, 2006. Etienne Boursier, Vianney Perchet, and Marco Scarsini. Social learning in non-stationary envi- ronments. In International Conference on Algorithmic Learning Theory (ALT), pages 128–129, 2022. Mark Braverman, Jieming Mao, Jon Schneider, and Matt Weinberg. Selling to a no-regret buyer. In ACM Conference on Economics and Computation (EC), 2018. Christophe Chamley. Rational herds: Economic models of social learning. Cambridge University Press, 2004. Shuchi Chawla, Nikhil R Devanur, Anna R Karlin, and Balasubramanian Sivan. Simple pricing schemes for consumers with evolving values. Games and Economic Behavior, 134:344–360, 2022. Davide Crapis, Bar Ifrach, Costis Maglaras, and Marco Scarsini. Monopoly pricing in the presence of social learning. Management Science, 63(11):3586–3608, 2017. 23 Yuan Deng, Jon Schneider, and Balasubramanian Sivan. Prior-free dynamic auctions with low regret buyers. In Conference on Neural Information Processing Systems (NeurIPS), 2019. Nikhil R Devanur, Yuval Peres, and Balasubramanian Sivan. Perfect Bayesian equilibria in repeated sales. In Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2014. Zhe Feng, Chara Podimata, and Vasilis Syrgkanis. Learning to bid without knowing your value. In ACM Conference on Economics and Computation (EC), 2018. Aur ́elien Garivier, Tor Lattimore, and Emilie Kaufmann. On explore-then-commit strategies. In Conference on Neural Information Processing Systems (NeurIPS), 2016. Saram Han and Chris K Anderson. Customer motivation and response bias in online reviews. Cornell Hospitality Quarterly, 61(2):142–153, 2020. Bar Ifrach, Costis Maglaras, Marco Scarsini, and Anna Zseleva. Bayesian social learning from consumer reviews. Operations Research, 67(5):1209–1221, 2019. Ali Kakhbod, Giacomo Lanzani, and Hao Xing. Heterogeneous Learning in Product Markets. Available at SSRN 3961223, 2021. Kirthevasan Kandasamy, Joseph E Gonzalez, Michael I Jordan, and Ion Stoica. VCG mechanism design with unknown agent values under stochastic bandit feedback. Journal of Machine Learning Research, 24(53):1–45, 2023. Robert Kleinberg and Tom Leighton. The value of knowing a demand curve: Bounds on regret for online posted-price auctions. In Symposium on Foundations of Computer Science (FOCS), 2003. Denis Nekipelov, Vasilis Syrgkanis, and Eva Tardos. Econometrics for learning agents. In ACM Conference on Economics and Computation (EC), 2015. Christos Papadimitriou, George Pierrakos, Alexandros Psomas, and Aviad Rubinstein. On the complexity of dynamic mechanism design. Games and Economic Behavior, 2022. Jonathan Weed, Vianney Perchet, and Philippe Rigollet. Online learning in repeated auctions. In Conference on Learning Theory (COLT), 2016. Haoyu Zhao and Wei Chen. Stochastic one-sided full-information bandit. In European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases (ECML PKDD), 2020. A Additional details about η-pessimistic agents Intuitively, in Definition 2.1, LBt serves as a lower confidence bound on the buyer's value who arrives at round t. The buyers can be confident that, regardless of the policy used by the seller, with probability 1 − η, for all rounds t ∈ [T ], θit ≥ LBt. We show this formally below. Lemma A.1. Denote the type of the buyer who arrives at round t as it. On all rounds t, with probability at least 1 − η, LBt ≤ θit. 24 Proof. Let us consider a sequence of T rewards { ̃vi1, * * * ̃viT } for each buyer type i ∈ [d] generated beforehand, where each reward is a random reward sample drawn from Di. Each time a buyer with type i arrives and makes a purchase, it obtains an ex-post value from the reward sequence { ̃vi1, * * * ̃viT } in order. For example, if the type of the buyer who arrives on round t is it, then if that buyer makes a purchase, their ex-post value will be ̃vit,|Φi,t|+1. First, we will show that Pr (LBt > θj | it = j) ≤ η for any j ∈ [d]. At any round t, notice that if |Φt| = 0, then LBt = 0, the conclusion trivially holds since θj > 0 for all j ∈ [d]. When |Φt| > 0: (cid:18) Pr LBt > θj (cid:32) = Pr max 0, (cid:19) (cid:12) (cid:12) it = j (cid:12) (cid:12) (cid:40) 1 |Φt| v − (cid:88) v∈Φt (cid:115) 1 2|Φt| ln t η (cid:41) > θj (cid:12) (cid:12) (cid:12) (cid:12) (cid:33) it = j = Pr = Pr (cid:32)   (cid:32) 1 |Φt| (cid:88) v∈Φt v − (cid:115) ̃vjs − 1 |Φt| |Φt| (cid:88) s=1 ≤ Pr ∃l ∈ [t − 1], s.t. (cid:115) 1 2|Φt| ln t η > θj (cid:33) (cid:12) (cid:12) it = j (cid:12) (cid:12) 1 2|Φt| ln t η > θj   (cid:12) (cid:12) it = j (cid:12) (cid:12) 1 l l (cid:88) s=1 ̃vjs − (cid:114) 1 2l ln t η (cid:33) (cid:12) (cid:12) it = j (cid:12) (cid:12) > θj ≤ t−1 (cid:88) l=1 (cid:32) Pr 1 l l (cid:88) s=1 ̃vjs − (cid:114) 1 2l ln t η > θj (cid:12) (cid:12) (cid:12) (cid:12) (cid:33) it = j . Here, the second step uses the fact that θj ≥ 0. In the fifth step, we have used the fact that |Φt| is a random quantity, which depends on the specific algorithm, but with support [(t − 1)]. The last step follows from a union bound over (t − 1) rounds. s=1 ̃vjs − Note that for any fixed j ∈ [d], the event 1 l η > θj is independent of the value 2l ln T (cid:113) 1 (cid:80)l of it. Therefore, by Hoeffding inequality, for any l ∈ [t − 1] and j ∈ [d], we have that (cid:32) Pr 1 l l (cid:88) s=1 ̃vjs − (cid:114) 1 2l ln t η (cid:33) (cid:12) (cid:12) it = j (cid:12) (cid:12) > θj = Pr (cid:32) 1 l l (cid:88) s=1 ̃vjs − (cid:114) 1 2l ln t η (cid:33) > θj ≤ η t . Putting this together we have: Pr (LBt > θj | it = j) ≤ (t − 1) η t ≤ η. Lastly, by the law of total probability, Pr (LBt > θit) = (cid:88) j∈[d] Pr (LBt > θj | it = j) * Pr (it = j) ≤ (cid:88) j∈[d] η * Pr (it = j) ≤ η, which completes the proof. 25 B Additional proofs about regret upper bound (Section 4.1) Claim 4.3. If qmin ≤ 2λ then E[Z2] ≤ T dλ + 1 and if qmin > 2λ, then E[Z2] ≤ 1. Proof. First, we bound Z2 as follows: Z2 = (cid:88) t>tλ p∗([d])I (θit ≥ p∗([d]) and it ̸∈ Q) ≤ p∗([d])I (it ̸∈ Q) ≤ (cid:88) t>tλ I (it ̸∈ Q) . (cid:88) t>tλ Recall from Algorithm 1 that qi is the fraction of times that type i appears in phase 1 and let G be the event that for all i ∈ [d] such that qi ≥ λ, we have that qi ≥ 3λ 4 , which means that i ∈ Q. In other words, when G happens, [d] \ Q ⊆ {qi : qi < λ}. In Lemma B.1, we prove that Pr[Gc] ≤ 1 T , so E[Z2] ≤ E[Z2 | G] + T Pr[Gc] ≤ E[Z2 | G] + 1. Next, since Q is a random variable, we condition on it as well: E[Z2 | G] = (cid:88) Q′⊆[d] E[Z2 | Q = Q′, G] Pr[Q = Q′ | G]. If [d] \ Q′ {qi : qi < λ}, ̸⊆ {qi : qi < λ}, then Pr[Q = Q′ | G] = 0. Moreover, for any Q′ such that [d] \ Q′ ⊆ E[Z2 | Q = Q′, G] ≤ E (cid:34) (cid:88) I (cid:0)it ̸∈ Q′(cid:1) (cid:35) Q = Q′, G (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) = = (cid:88) t>tλ Pr (cid:2)it ̸∈ Q′ | Q = Q′, G(cid:3) t>tλ (cid:88) (cid:88) t>tλ i̸∈Q′ Pr (cid:2)it = i | Q = Q′, G(cid:3) . The event (Q = Q′ ∧ G) depends only on the first tλ timesteps, so it is independent of the event that it = i for t > tλ. Therefore, E[Z2 | Q = Q′, G] = (cid:88) (cid:88) t>tλ i̸∈Q′ Pr [it = i] . If qmin > 2λ, then {qi : qi < λ} = ∅, so the only Q′ such that [d] \ Q′ ⊆ {qi : qi < λ} is Q′ = [d]. In this case, (cid:88) (cid:88) t>tλ i̸∈Q′ Pr [it = i] = 0, so E[Z2 | G] = 0 and finally, E[Z2] ≤ 1. Otherwise, qmin ≤ 2λ, so so (cid:88) (cid:88) t>tλ i̸∈Q′ Pr [it = i] ≤ (cid:88) (cid:88) t>tλ i̸∈Q′ λ ≤ T dλ, E[Z2 | G] ≤ T dλ (cid:88) Q′⊆[d] Pr[Q = Q′ | G] ≤ T dλ and finally, E[Z2] ≤ T dλ + 1. 26 Claim 4.4. E[Z3] ≤ 0. Proof. In this proof we bound (cid:88) Z3 = p∗([d])I (θit ≥ p∗([d]) and it ∈ Q) − t>tλ p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q) . (24) (cid:88) t>tλ We begin by conditioning the first term of Equation (24) on Q since it is a random variable: (cid:34) E (cid:88) t>tλ p∗([d])I (θit ≥ p∗([d]) and it ∈ Q) (cid:35) I (cid:0)θit ≥ p∗([d]) and it ∈ Q′(cid:1) | Q = Q′ (cid:35) Pr[Q = Q′] (cid:34) (cid:88) t>tλ p∗([d]) Pr (cid:2)θit ≥ p∗([d]) and it ∈ Q′ | Q = Q′(cid:3) Pr[Q = Q′]. (25) (cid:88) p∗([d]) E = = Q′⊆[d] (cid:88) (cid:88) Q′⊆[d] t>tλ The event that Q = Q′ only depends on the first tλ timesteps, so it is independent of the event (θit ≥ p∗([d]) ∧ it ∈ Q′) for t > tλ. Therefore, for t > tλ, p∗([d]) Pr (cid:2)θit ≥ p∗([d]) and it ∈ Q′ | Q = Q′(cid:3) = p∗([d]) Pr (cid:2)θit ≥ p∗([d]) and it ∈ Q′(cid:3) ≤ max p∈[0,1] p Pr (cid:2)θit ≥ p and it ∈ Q′(cid:3) = p∗(Q′) Pr (cid:2)θit ≥ p∗(Q′) and it ∈ Q′(cid:3) . Combining this fact with Equation (25), we have that (cid:34) (cid:88) E t>tλ p∗([d])I (θit ≥ p∗([d]) and it ∈ Q) (cid:35) (cid:88) ≤ Q′⊆[d] (T − tλ) p∗(Q′) Pr i∼P (cid:2)θi ≥ p∗(Q′) and i ∈ Q′(cid:3) Pr[Q = Q′]. (26) Next, for the second term of Equation (24), (cid:34) E (cid:88) t>tλ (cid:88) E = (cid:35) p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q) (cid:34) (cid:88) p∗(Q′)I (cid:0)θit ≥ p∗(Q′) and it ∈ Q′(cid:1) | Q = Q′ (cid:35) Pr[Q = Q′]. Q′⊆[d] t>tλ As before, the event that Q = Q′ only depends on the first tλ timesteps, so it is independent of the event (θit ≥ p∗(Q′) ∧ it ∈ Q′) for t > tλ. Therefore, (cid:34) (cid:88) E t>tλ p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q) (cid:35) (cid:88) = Q′⊆[d] (T − tλ) p∗(Q′) Pr i∼P (cid:2)θi ≥ p∗(Q′) and i ∈ Q′(cid:3) Pr[Q = Q′]. Combined with Equation (26), we have that E[Z3] ≤ 0. 27 Claim 4.5. E[Z4] ≤ 5 + 4(cid:112)2T ln(dT 2). Proof. In this claim, we bound Z4 = (cid:88) t>tλ p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q) − p′ t I (cid:0)θit ≥ p′ t and it ∈ Q(cid:1) , (27) (cid:88) t>tλ where p′ t = mini∈St θi. Beginning with the first term of this equation, for any t > tλ, E [p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q)] (cid:88) E (cid:2)p∗(Q′)I (cid:0)θit ≥ p∗(Q′) and it ∈ Q′(cid:1) | Q = Q′(cid:3) Pr[Q = Q′]. = Q′⊆[d] The event (θit ≥ p∗(Q′) ∧ it ∈ Q′) is independent of the event that Q = Q′, so E (cid:2)p∗(Q′)I (cid:0)θit ≥ p∗(Q′) and it ∈ Q′(cid:1) | Q = Q′(cid:3) = E (cid:2)p∗(Q′)I (cid:0)θit ≥ p∗(Q′) and it ∈ Q′(cid:1)(cid:3) = rev(p∗(Q′), Q′). Therefore, (cid:88) t>tλ E [p∗(Q)I (θit ≥ p∗(Q) and it ∈ Q)] = (cid:88) (cid:88) rev(p∗(Q′), Q′) Pr[Q = Q′] Q′⊆[d] E [rev(p∗(Q), Q)] . t>tλ (cid:88) t>tλ = (28) Moving on to the second term of Equation (27), we have that for any t > tλ, E (cid:2)p′ t (cid:88) t and it ∈ Q(cid:1)(cid:3) I (cid:0)θit ≥ p′ (cid:20) (cid:88) θi * I Q = Q′, St = S′ θi and it ∈ Q′ (cid:18) E (cid:21) min i∈S′ θit ≥ min i∈S′ (cid:19) (cid:12) (cid:12) (cid:12) (cid:12) = Q′⊆[d] S′⊆Q′ Pr[Q = Q′, St = S′]. (29) The event that Q = Q′ only depends on the first tλ timesteps and the event that St = S′ only de- pends on the first t − 1 timesteps. Therefore, the event (θit ≥ mini∈S′ θi and it ∈ Q′) is independent of the event (Q = Q′ and St = S′). This means that (cid:18) θit ≥ min i∈S′ (cid:18) θit ≥ min i∈S′ (cid:20) (cid:20) E = E θi * I min i∈S′ θi * I min i∈S′ (cid:18) = rev min i∈S′ (cid:19) . θi, Q′ θi and it ∈ Q′ Q = Q′, St = S′ (cid:21) (cid:19) (cid:12) (cid:12) (cid:12) (cid:12) (cid:19)(cid:21) θi and it ∈ Q′ Combined with Equation (29), we have that E (cid:2)p′ t I (cid:0)θit ≥ p′ t and it ∈ Q(cid:1)(cid:3) = (cid:88) (cid:88) (cid:18) rev S′⊆Q′ Q′⊆[d] = E (cid:2)rev (cid:0)p′ t, Q(cid:1)(cid:3) . 28 (cid:19) θi, Q′ min i∈S′ Pr[Q = Q′, St = S′] (30) Combining Equations (28) and (30), we have that E[Z4] ≤ (cid:88) t>tλ E (cid:2)rev (p∗(Q), Q) − rev (cid:0)p′ t, Q(cid:1)(cid:3) . (31) Next, for all t > tλ, let Bt be the event that: 1. iQ ∈ St and 2. rev(p∗(Q), Q) − rev (p′ t, Q) ≤ 4ρt−1 (where ρtλ = 1). Also, let Ct = (cid:84)t that s=tλ+1 Bs. In Lemma B.2, we prove that Pr [Cc t ] ≤ 1 T . By Equation (31), we have E[Z4] ≤ E (cid:34) (cid:88) t>tλ rev (p∗(Q), Q) − rev (cid:0)p′ t, Q(cid:1) (cid:35) CT + T Pr [Cc T ] (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ (cid:88) t>tλ 4ρt−1 + 1 (cid:114) T (cid:88) ln(dT 2) 2t 2T ln(dT 2). ≤ 5 + 4 ≤ 5 + 4 t=1 (cid:112) Claim 4.6. If qmin ≤ 2λ, then E[Z5] ≤ 4 λ ln dT 2 η +3 and if qmin > 2λ, E[Z5] ≤ 4 (cid:113) 2T (cid:113) T qmin ln dT 2 η +2. Proof. On each round t > tλ, recall that LBit = (cid:40)0 max (cid:110) 1 |Φit| (cid:80) v∈Φit v − Let jt = argminj∈St θj, so p′ t = θjt. Then (cid:113) 1 2|Φit| ln T η , 0 (cid:111) if Φit = ∅ else. Z5 = = = ≤ (cid:88) t>tλ (cid:88) t>tλ (cid:88) t>tλ (cid:88) t>tλ p′ t I (cid:0)θit ≥ p′ t and it ∈ Q(cid:1) − p′ t I (cid:0)θit ≥ p′ t and it ∈ Q(cid:1) − (cid:88) t>tλ (cid:88) ptbt (p′ t + (p′ t − pt))bt p′ t (cid:0)I (cid:0)θit ≥ p′ t>tλ t and it ∈ Q(cid:1) − bt (cid:1) + (cid:88) (p′ t − pt)bt p′ t I (cid:0)θit ≥ p′ t ∧ it ∈ Q ∧ bt = 0(cid:1) + t>tλ (cid:88) (p′ t − pt)bt. t>tλ Since pt ≤ p′ t, we have that Z5 ≤ (cid:88) t>tλ p′ t I (cid:0)θit ≥ p′ t ∧ it ∈ Q ∧ bt = 0(cid:1) + (cid:0)p′ t − pt (cid:1) . (cid:88) t>tλ 29 By definition of the pricing rule, if it ∈ St, then bt = 1. Therefore, if bt = 0, then either it ̸∈ Q or it ∈ Q \ St. Since St contains every i ∈ Q with i > jt, we can conclude that if it ∈ Q \ St, then θit < θjt = p′ t ∧ it ∈ Q ∧ bt = 0) = 0, which means that t. Therefore, I (θit ≥ p′ E [Z5] ≤ E (cid:35) p′ t − pt . (cid:34) (cid:88) t>tλ Let j′ t = argminj∈St LBjt, which means that pt = mini∈St {min {θi, LBit}} = min (cid:110) p′ t, LBj′ tt (cid:111) . We also know that p′ t = θjt ≤ θj′ t . Therefore, E [Z5] ≤ E (cid:34) (cid:88) t>tλ max (cid:110) 0, θj′ t (cid:35) (cid:111) . − LBj′ tt For the remainder of our analysis, we will require the following events: • Let E1 be the event that for all t > tλ, |Φi,t| ≥ 1 prove that if qmin > 2λ, then Pr [E c 1] ≤ 1 T . 2 qmin(t − 1) for all i ∈ St. In Lemma B.4, we • Similarly, let E2 be the event that for all t > tλ, |Φi,t| ≥ 1 qi ≥ λ 2 . In Lemma B.5, we prove that if qmin ≤ 2λ, then Pr[E c • Let F be the event that for all i ∈ [d] such that qi ≤ λ that i ̸∈ Q. In Lemma B.6, we prove that Pr[F c] ≤ 1 T . 4 λ(t − 1) for all i ∈ St such that 2] ≤ 1 T . 2 , we have that qi < 3λ 4 , which means • Let H be the event that for all t > tλ and all i ∈ St, (cid:114) 1 2 |Φit|θi ≤ v + (cid:88) v∈Φit |Φit| ln(dT 2). In Lemma B.7, we prove that Pr[Hc] ≤ 1 T . We now split our analysis into two cases depending on whether or not qmin > 2λ. Suppose that qmin > 2λ. In this case, (cid:34) E [Z5] ≤ E (cid:88) max (cid:34) t>tλ (cid:88)    t>tλ (cid:88) t>tλ ≤ E = E max max Under events E1 and H, (cid:110) 0, θj′ t (cid:110) 0, θj′ t    0, θj′ t − LBj′ tt − LBj′ tt (cid:111) (cid:111) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) E1 ∧ H (cid:35) (cid:35) + T Pr[(E1 ∧ H)c] E1 ∧ H + 2 − 1 tt| |Φj′ (cid:115) (cid:88) v + v∈Φj′ tt 1 tt| 2|Φj′ ln  E1 ∧ H   + 2.    (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 η E[Z5] ≤ E (cid:115) (cid:34) (cid:88) t>tλ ln(dT 2) tt| 2|Φj′ + (cid:115) 1 tt| 2|Φj′ ln (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 η (cid:35) E1 ∧ H + 2 30 and by definition of the event E1, (cid:34) (cid:88) t>tλ (cid:32)(cid:115) (cid:115) ln(dT 2) tt| 2|Φj′ + (cid:115) 1 tt| 2|Φj′ ln (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 η (cid:35) E1 ∧ H + 2 (cid:115) ln(dT 2) qmin(t − 1) + 1 qmin(t − 1) ln 1 η (cid:33) + 2 E[Z5] ≤ E ≤ T (cid:88) t=2 (cid:115) ≤ 4 T qmin ln dT 2 η + 2. Meanwhile, suppose that qmin < 2λ. When F happens, for all t > tλ, St ⊆ Q ⊆ (cid:8)i : qi > λ (cid:9), so 2 when both E2 and F happen, |Φi,t| ≥ 1 (cid:34) E [Z5] ≤ E (cid:88) 4 λ(t − 1) for all t > tλ and i ∈ St. Therefore, (cid:110) 0, θj′ t (cid:110) 0, θj′ t − LBj′ tt − LBj′ tt E2 ∧ F ∧ H (cid:35) (cid:35) + T Pr[(E2 ∧ F ∧ H)c] E2 ∧ F ∧ H + 3 (cid:111) (cid:111) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)    0, θj′ t − 1 tt| |Φj′ (cid:115) (cid:88) v + v∈Φj′ tt 1 tt| 2|Φj′ ln    (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 η  E2 ∧ F ∧ H   + 3. max max max (cid:34) t>tλ (cid:88)    t>tλ (cid:88) t>tλ ≤ E = E When E2, F, and H all happen, E [Z5] ≤ E (cid:115) (cid:34) (cid:88) t>tλ ln(dT 2) 2|Φj′ tt| + (cid:115) 1 2|Φj′ tt| ln (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 η (cid:35) E2 ∧ F ∧ H + 3 and by definition of E2 ∧ F, (cid:34) (cid:88) (cid:115) E [Z5] ≤ E (cid:115) ln(dT 2) tt| 2|Φj′ + 1 tt| 2|Φj′ ln 1 η E2 ∧ F ∧ H (cid:35) + 3 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:33) 2 ln(dT 2) λ(t − 1) + (cid:115) 2 λ(t − 1) ln 1 η + 3 t>tλ (cid:32)(cid:115) ≤ T (cid:88) t=2 (cid:115) ≤ 4 2T λ ln dT 2 η + 3. Lemma 4.7. For all t > tλ, let At be the event rev (θi, Q) ∈ [qμi,t, pμi,t] for all i ∈ St. Then Pr[Ac Proof. Recall that pμi,t = μi,t + ρt and qμi,t = μi,t − ρt with t ] ≤ 1 T 2 . (cid:115) ρt = ln(dT 2) 2 (t − tλ) . 31 We also define the related quantities for all i ∈ [d] and all Q′ ⊆ [d]: γi,t(Q′) = 1 t − tλ t (cid:88) s=tλ+1 θi * I (cid:0)θis ≥ θi ∧ is ∈ Q′(cid:1) , pγi,t(Q′) = γi,t(Q′) + ρt, and qγi,t(Q′) = γi,t(Q′) − ρt. By a Hoeffding bound, for all Q′ ⊆ [d] and all i ∈ [d], Pr (cid:2)rev (cid:0)θi, Q′(cid:1) ̸∈ (cid:2)qγi,t(Q′), pγi,t(Q′)(cid:3)(cid:3) ≤ We claim that for any i ∈ St and any s > tλ, 1 dT 2 . I(bs = 1 ∧ θis ≥ θi ∧ is ∈ Q) = I (θis ≥ θi ∧ is ∈ Q) , (32) which means that μi,t = γi,t(Q), pμi,t = pγi,t(Q), and qμi,t = qγi,t(Q). To see why, if bs = 1, then clearly Equation (32) holds. Otherwise, suppose bs = 0, in which case I(bs = 1 ∧ θis ≥ θi ∧ is ∈ Q) = 0. Then is ̸∈ Ss because any buyer in Ss will always buy by definition of the pricing rule. Let js = min {j ∈ Ss} . Since Ss contains every element in Q larger than js, we know that either: 1. is ̸∈ Q, in which case I (θis ≥ θi ∧ is ∈ Q) = 0, or 2. is ∈ Q but is ̸∈ Ss, which means that θis < θjs. Since i ∈ St, it must be that i ∈ Ss, so θis < θjs ≤ θi. In this case, I (θis ≥ θi ∧ is ∈ Q) = 0 as well. Therefore, Equation (32) holds. The fact that μi,t = γi,t(Q), pμi,t = pγi,t(Q), and qμi,t = qγi,t(Q) for all i ∈ St implies that Pr[Ac t ] = Pr (∃i ∈ St s.t. rev (θi, Q) ̸∈ [qμi,t, pμi,t]) ≤ Pr (∃i ∈ [d] s.t. rev (θi, Q) ̸∈ [qγi,t(Q), pγi,t(Q)]) ≤ d (cid:88) i=1 Pr (rev (θi, Q) ̸∈ [qγi,t(Q), pγi,t(Q)]) . (33) The set Q is a random variable, so we must condition on it to bound Equation (33): Pr (rev (θi, Q) ̸∈ [qγi,t(Q), pγi,t(Q)]) (cid:88) Pr (cid:0)rev (cid:0)θi, Q′(cid:1) ̸∈ (cid:2)qγi,t(Q′), pγi,t(Q′)(cid:3) | Q = Q′(cid:1) Pr[Q = Q′]. = Q′⊆[d] Since the event that Q = Q′ and the event that rev (θi, Q′) ̸∈ [qγi,t(Q′), pγi,t(Q′)] depend on disjoint timesteps, the two events are independent. Therefore, Pr (rev (θi, Q) ̸∈ [qγi,t(Q), pγi,t(Q)]) = (cid:88) Pr (cid:0)rev (cid:0)θi, Q′(cid:1) ̸∈ (cid:2)qγi,t(Q′), pγi,t(Q′)(cid:3)(cid:1) Pr (cid:2)Q = Q′(cid:3) (cid:88) Pr (cid:2)Q = Q′(cid:3) Q′⊆[d] Q′⊆[d] 1 dT 2 1 dT 2 , ≤ = so the result follows from Equation (33). 32 The next lemma shows that for more common types with qi ≥ λ, the fraction of times qi that that type appears during Algorithm 1 is large enough that i is added to Q. Lemma B.1. Let G be the event that for all i such that qi ≥ λ, we have that qi ≥ 3λ Pr[Gc] ≤ 1 T . 4 . Then Proof. Fix an index i such that qi ≥ λ. Then (cid:20) Pr qi < (cid:21) 3λ 4 = Pr (cid:34) tλ(cid:88) t=1 I(it = i) < λtλ * (cid:35) 3 4 (cid:18) ≤ exp − (cid:19) λtλ 32 ≤ 1 dT . The lemma the follows by a union bound over all i ∈ [d]. The next lemma proves that the expected revenue (with respect to agents in Q) of the smallest active price min {θi : i ∈ St} is converging to the optimal revenue rev(p∗(Q), Q) as t grows. Later in the analysis, we will show-at a high level-that since the algorithm sets a price within a neighborhood of min {θi : i ∈ St}, its revenue is converging to that of p∗(Q). For this next lemma, recall that p∗(Q) = θiQ for some iQ ∈ Q. The proof is similar to that of standard successive arm elimination algorithms [e.g., Zhao and Chen, 2020]. Lemma B.2. For all t > tλ, let jt = min{j ∈ St}. Let Bt be the event that: 1. iQ ∈ St and 2. rev(p∗(Q), Q) − rev (θjt, Q) ≤ 4ρt−1 (where ρtλ = 1). Also, let Ct = (cid:84)t s=tλ+1 Bs. Then Pr [Cc t ] ≤ 1 T . Proof. We begin by partitioning Cc t into the disjoint events t = Cc Cc tλ+1 ∪ (cid:0)Ctλ+1 ∩ Bc tλ+2 (cid:1) ∪ * * * ∪ (Ct−1 ∩ Bc t ) . Since these events are disjoint, Pr [Cc t ] = Pr (cid:2)Cc tλ+1 (cid:3) + Pr (cid:2)Ctλ+1 ∩ Bc (cid:3) = Pr (cid:2)Bc tλ+1 tλ+2 tλ+1 (cid:3) + * * * + Pr [Ct−1 ∩ Bc t ] . (cid:3) = 0 because Stλ = Q, so iQ ∈ Stλ, and (34) Beginning with the first summand, Pr (cid:2)Cc 4ρtλ > 1. Next, for s > tλ + 1, Pr [Cs−1 ∩ Bc s] = Pr   s−1 (cid:92) s′=tλ+1   ≤ Pr [Bs−1 ∩ Bc s] . Bs′ ∩ Bc s (35) We will prove that Bs−1 ∩ Bc Claim B.3. The event Bs−1 ∩ Bc s implies Ac s implies Ac s−1. s−1, which will allow us to apply Lemma 4.7. 33 Proof. Proof of Claim B.3] First suppose Bs−1 happens and iQ ̸∈ Ss (so Bc s happens). Since Bs−1 happens, we know that iQ ∈ Ss−1 but since iQ ̸∈ Ss, it must be that iQ was eliminated at the end qμk,s−1. Then of round s − 1. This means that pμiQ,s−1 < maxk∈Ss−1 qμk,s−1. Let k′ = argmaxk∈Ss−1 rev(p∗(Q), Q) − qμiQ,s−1 ≥ rev (θk′, Q) − qμiQ,s−1 = rev (θk′, Q) − pμiQ,s−1 + 2ρs−1 > rev (θk′, Q) − qμk′,s−1 + 2ρs−1. (36) Suppose that rev (θk′, Q) ≥ qμk′,s−1. Then Equation (36) implies that 2ρs−1 < rev(p∗(Q), Q) − qμiQ,s−1 = rev(p∗(Q), Q) − (pμiQ,s−1 − 2ρs−1) so rev(p∗(Q), Q) > pμiQ,s−1. Therefore, either rev (θk′, Q) < qμk′,s−1 or rev(p∗(Q), Q) > pμiQ,s−1, which means that Ac s−1 happens. Meanwhile, suppose Bs−1 happens and iQ ∈ Ss but rev(p∗(Q), Q) − rev (θjs, Q) > 4ρs−1 (so Bc s happens). Then rev(p∗(Q), Q) − qμiQ,s−1 + pμjs,s−1 − rev (θjs, Q) > pμjs,s−1 − qμiQ,s−1 + 4ρs−1. (37) qμk,s−1. Since js ∈ Ss, it must be that pμjs,s−1 ≥ qμk′,s−1, or else js Again, let k′ = argmaxk∈Ss−1 would have been eliminated at the end of round s − 1. Combining this fact with Equation (37), we have that rev(p∗(Q), Q) − qμiQ,s−1 + pμjs,s−1 − rev (θjs, Q) > qμk′,s−1 − qμk′,s−1 + 4ρs−1 = 4ρs−1. This means that either: 1. 2ρs−1 < rev(p∗(Q), Q)− qμiQ,s−1 = rev(p∗(Q), Q)− pμiQ,s−1 +2ρs−1, or in other words pμiQ,s−1 < rev(p∗(Q), Q), meaning Ac s−1 happens, or 2. 2ρs−1 < pμjs,s−1 − rev (θjs, Q) = qμjs,s−1 + 2ρs−1 − rev (θjs, Q), or in other words, rev (θjs, Q) < qμjs,s−1, meaning Ac s−1 happens. Therefore, the claim holds. Claim B.3, Equation (35), and Lemma 4.7 imply that Pr [Cs−1 ∩ Bc t ] < 1 T . Equation (34), we have that Pr [Cc s] ≤ Pr (cid:2)Ac s−1 (cid:3) ≤ 1 T 2 , so by The next lemma will prove that for all rounds t > tλ of Algorithm 2 and all active types i ∈ St, there are a non-trivial number of reviews by buyers of type i. The following lemma holds when qmin > 2λ, and Lemma B.5 holds when qmin ≤ 2λ. Lemma B.4. Suppose that qmin > 2λ. Let E1 be the event that on each round t > tλ, |Φi,t| ≥ 1 2 qmin(t − 1) and all i ∈ St. Then Pr[E c 1] ≤ 1 T . Proof. Fix any t > tλ. We will show that (cid:20) Pr ∃i ∈ St such that |Φi,t| < (cid:21) qmin(t − 1) ≤ 1 2 1 T 2 . 34 I(bs = 1 ∧ is = i). If |Φi,t| were equal to (cid:80)t−1 s=1 By definition, |Φi,t| = (cid:80)t−1 I(is = i), then the claim s=1 would hold immediately by a Chernoff bound. However, we do not know at each round s whether is = i provided the buyer does not make a purchase. Therefore, we also define the random variable Xi,t = (cid:80)t−1 I(is = i). We claim that for all i ∈ St, |Φi,t| = Xi,t. This is because we know that s=1 i ∈ Ss for all s ≤ t and by definition of the pricing rule, if is = i, then bs = 1. Therefore, (cid:20) ∃t > tλ, ∃i ∈ St such that |Φi,t| < Pr (cid:21) qmin(t − 1) 1 2 = Pr (cid:20) (cid:20) ∃t > tλ, ∃i ∈ St such that Xi,t < ≤ Pr ∃t > tλ, ∃i ∈ [d] such that Xi,t < d (cid:88) T (cid:88) ≤ (cid:20) Pr Xi,t < i=1 t=tλ+1 (cid:21) qmin(t − 1) . 1 2 1 2 1 2 (cid:21) qmin(t − 1) (cid:21) qmin(t − 1) (38) By a Chernoff bound, (cid:20) Pr Xi,t ≤ 1 2 (cid:21) qmin(t − 1) ≤ Pr (cid:20) Xi,t ≤ (cid:21) qi(t − 1) (cid:19) 1 2 qi(t − 1) 8 qmin(t − 1) 8 (cid:19) (cid:18) ≤ exp − (cid:18) ≤ exp − (cid:18) ≤ exp − (cid:19) λ(t − 1) 4 ≤ 1 dT 2 . The lemma now follows from Equation (38). We now prove a similar result for the case where qmin ≤ 2λ. Lemma B.5. Suppose that qmin ≤ 2λ. Let E2 be the event that for all t > tλ, |Φi,t| ≥ 1 2] ≤ 1 all i ∈ St such that qi ≥ λ T . Proof. Let Q0 = (cid:8)i : qi ≥ λ (cid:9) . Fix any t > tλ. We will show that 2 . Then Pr[E c 2 4 λ(t − 1) for (cid:20) Pr ∃i ∈ St ∩ Q0 such that |Φi,t| < (cid:21) λ(t − 1) ≤ 1 4 1 T 2 . By definition, |Φi,t| = (cid:80)t−1 s=1 variable Xi,t = (cid:80)t−1 s=1 know that i ∈ Ss for all s ≤ t and by definition of the pricing rule, if is = i, then bs = 1.). I(bs = 1 ∧ is = i). As in the proof of Lemma B.4, we define the random I(xs = ei). As in that proof, for all i ∈ St, |Φi,t| = Xi,t (this is because we 35 Therefore, Pr = Pr (cid:20) (cid:20) (cid:20) ∃t > tλ, ∃i ∈ St ∩ Q0 such that |Φi,t| < ∃t > tλ, ∃i ∈ St ∩ Q0 such that Xi,t < λ(t − 1) (cid:21) λ(t − 1) (cid:21) 1 4 1 4 ≤ Pr ∃t > tλ, ∃i ∈ Q0 such that Xi,t < (cid:88) T (cid:88) ≤ i∈Q0 t=tλ+1 (cid:20) Xi,t < Pr 1 4 (cid:21) λ(t − 1) . (cid:21) λ(t − 1) 1 4 (39) By a Chernoff bound, for any i ∈ Q0, (cid:20) Pr Xi,t < 1 4 (cid:21) (cid:20) λ(t − 1) ≤ Pr Xi,t < (cid:21) qi(t − 1) 1 2 qi(t − 1) 8 λ(t − 1) 16 (cid:19) (cid:19) (cid:18) ≤ exp − (cid:18) ≤ exp − ≤ 1 dT 2 . The lemma therefore follows from Equation (39). We next observe that for all very rare types with qi ≤ λ/2, the fraction of times qi that that type appears during Algorithm 1 is small. Therefore, i is not added to the set Q and is ignored for the remainder of the algorithm. Lemma B.6. Let F be the event that for all i ∈ [d] such that qi ≤ λ Pr[F c] ≤ 1 T . 2 , we have that qi ≤ 3λ 4 . Then Proof. Fix an index i such that qi ≤ λ (cid:34) tλ(cid:88) (cid:21) 2 . Then (cid:20) qi ≥ Pr 3λ 4 = Pr t=1 I(it = i) ≥ (cid:35) λtλ 2 * 3 2 (cid:18) ≤ exp − (cid:19) λtλ 24 = 1 dT . The lemma the follows by a union bound over all i ∈ [d]. Our final lemma proves that for all active types i ∈ St, the average reviews of agents with this type is close to the true ex-ante value θi. This helps us ensure that the price we set is not too low. Lemma B.7. Let H be the event that for all t > tλ and all i ∈ St, Then Pr[Hc] ≤ 1 T . |Φit|θi ≤ (cid:88) v + v∈Φit (cid:114) 1 2 |Φit| ln(dT 2). 36 Proof. Fix any t > tλ. Let v1, . . . , vt−1 be the buyers' ex-post values (which are defined even if the buyer didn't buy on a particular round s as vs ∼ Dis). For each i ∈ [d], let Rit = {s < t : is = i} be the set of rounds in which the buyer had type i. Since any buyer i ∈ Ss will buy if is = i, we have that |Φit| = |Rit| and (cid:88) v = (cid:88) vs. Therefore, v∈Φit s∈Rit  Pr ∃i ∈ St such that |Φit|θi > (cid:88) v +  ≤ Pr ∃i ∈ [d] such that |Rit|θi > v∈Φit (cid:88) s∈Rit  Pr |Rit|θi > (cid:88) s∈Rit vs + (cid:114) 1 2 vs + (cid:114) 1 2  |Rit| ln(dT 2)  d (cid:88) i=1 d (cid:88) ≤ = (cid:114) 1 2 |Φit| ln(dT 2)    |Rit| ln(dT 2)  (cid:88) (cid:34) Pr |R|θi > (cid:88) s∈R vs + (cid:114) 1 2 |R| ln(dT 2) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:35) Rit = R Pr[Rit = R]. (40) i=1 R⊆[t−1] For any s ∈ R, E [vs | Rit = R] = θi. Therefore, (cid:34) Pr |R|θi > (cid:88) s∈R vs + (cid:114) 1 2 |R| ln(dT 2) (cid:35) Rit = R ≤ 1 dT 2 . (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) The lemma therefore follows from Equation (40) and a union bound over all rounds t > tλ. 37
http://arxiv.org/abs/2302.09699v1
2023-02-20T00:11:19
2023-02-20T00:11:19
Private (Stochastic) Non-Convex Optimization Revisited: Second-Order Stationary Points and Excess Risks
We consider the problem of minimizing a non-convex objective while preserving the privacy of the examples in the training data. Building upon the previous variance-reduced algorithm SpiderBoost, we introduce a new framework that utilizes two different kinds of gradient oracles. The first kind of oracles can estimate the gradient of one point, and the second kind of oracles, less precise and more cost-effective, can estimate the gradient difference between two points. SpiderBoost uses the first kind periodically, once every few steps, while our framework proposes using the first oracle whenever the total drift has become large and relies on the second oracle otherwise. This new framework ensures the gradient estimations remain accurate all the time, resulting in improved rates for finding second-order stationary points. Moreover, we address a more challenging task of finding the global minima of a non-convex objective using the exponential mechanism. Our findings indicate that the regularized exponential mechanism can closely match previous empirical and population risk bounds, without requiring smoothness assumptions for algorithms with polynomial running time. Furthermore, by disregarding running time considerations, we show that the exponential mechanism can achieve a good population risk bound and provide a nearly matching lower bound.
[ "Arun Ganesh", "Daogao Liu", "Sewoong Oh", "Abhradeep Thakurta" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09699v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09699v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CR", "math.OC", "stat.ML" ]
Private (Stochastic) Non-Convex Optimization Revisited: Second-Order Stationary Points and Excess Risks Arun Ganesh ∗ Daogao Liu † Sewoong Oh ‡ Abhradeep Thakurta § February 21, 2023 Abstract We consider the problem of minimizing a non-convex objective while preserving the privacy of the examples in the training data. Building upon the previous variance-reduced algorithm SpiderBoost, we introduce a new framework that utilizes two different kinds of gradient oracles. The first kind of oracles can estimate the gradient of one point, and the second kind of oracles, less precise and more cost-effective, can estimate the gradient difference between two points. SpiderBoost uses the first kind periodically, once every few steps, while our framework proposes using the first oracle whenever the total drift has become large and relies on the second oracle otherwise. This new framework ensures the gradient estimations remain accurate all the time, resulting in improved rates for finding second-order stationary points. Moreover, we address a more challenging task of finding the global minima of a non-convex objective using the exponential mechanism. Our findings indicate that the regularized expo- nential mechanism can closely match previous empirical and population risk bounds, without requiring smoothness assumptions for algorithms with polynomial running time. Furthermore, by disregarding running time considerations, we show that the exponential mechanism can achieve a good population risk bound and provide a nearly matching lower bound. 1 Introduction Differential privacy [DMNS06] is a standard privacy guarantee for training machine learning models. R, where P is a data domain and R is a range of outputs, Given a randomized algorithm [0, 1] if for any neighboring we say datasets R, the distribution of the outcome of the algorithm, e.g., pair of models trained on the respective datasets, are similar: is (ε, δ)-differentially private (DP) for some ε , P ∗ that differ in at most one element and any : P ∗ → ∈ R ⊆ 0 and δ D′ ∈ A A ≥ D Pr ( D ∼A ) x [x ] ∈ R ≤ eε Pr ( x D ∼A ′) [x ] + δ. ∈ R 3 2 0 2 b e F 0 2 ] G L . s c [ 1 v 9 9 6 9 0 . 2 0 3 2 : v i X r a Smaller ε and δ imply the distributions are closer; hence, an adversary accessing the trained model cannot tell with high confidence whether an example x was in the training dateset. Given this measure of privacy, we consider the problem of optimizing a non-convex loss while ensuring a drawn i.i.d. desired level of privacy. In particular, suppose we are given a dataset z1, . . . , zn} D { R is G-Lipschitz over the convex from underlying distribution (x) := Ez [f (x; z)] and the set empirical risk function be F S f (x; z) for ∈ S K → ∼P f (x; z). We also denote FS(x) := 1 S | Rd of diameter D. Let the population risk function be F P ; z) : . Each loss function f ( * P (x) := 1 n K ⊂ ∈D = D . z z | ⊆ D ∗Google Research, [email protected] †University of Washington, most of this work was done while interning at Google, [email protected] ‡University of Washington and Google Research, [email protected] §Google Research, [email protected] P P 1 α-SOSP empirical 1 4 7 4 4 1 7 2 , d n SOTA min( d n population ) N/A Ours LB 1 3 2 3 d n √d n 3 7 + √d n 1 1 3 n 1 (cid:17) (cid:16) √n + √d n Excess population risk exp-time poly-time d ε2 log n ♠ d log log n ε log(n) d nε + d n q N/A d nε + d nε + d n d n q q Table 1: SOTA refers to the best previously known bounds on α for α-SOSP by [WCX19] and on the excess population risk by [WCX19]. We introduce algorithm 1 that finds an α-SOSP (columns 2–3) with an improved rate. We show exponential mechanism can minimize the excess risk in polynomial time and exponential time, respectively (columns 4 and 5). ♠ requires extra assumption on bounded smoothness. The lower bounds for SOSP are from [ABG+22], and the lower bound on excess population risk is from Theorem 4.11. We omit logarithmic factors in n and d. Our focus is in minimizing non-convex risk functions, both empirical and population, which may have multiple local minima. Since finding the global optimum of a non-convex function can be challenging, an alternative goal in the field is to find stationary points: A first-order stationary point is a point with a small gradient of the function, and a second-order stationary point is a first- order stationary point where additionally the function has a positive or nearly positive semi-definite Hessian. As first order stationary points can be saddle points or even a local maximum, we focus on the problem of finding a second order stationary point, i.e., a local minimum, privately. Existing . We works in finding approximate SOSP privately only give guarantees for the empirical function F improve upon the state-of-the-art result for empirical risk minimization and give the first guarantee for the population function F . This requires standard assumptions on bounded Lipschitzness, smoothness, and Hessian Lipschitzness, which we make precise in Section 2 and in Assumption 3.1. Compared to finding a local minimum, finding a global minimum can be extremely chal- lenging. Progress towards finding the global minima is measured in the excess empirical risk, E[F (x) for a D private solution xpriv. We provide two approaches, in polynomial time and exponential time, that improve upon the state-of-the-art guarantees as measured in the excess risks for the respective families of computational complexity. (x), and the excess population risk, E[F P (xpriv)] (xpriv)] minx minx ∈K ∈K − − F F D D P P 1.1 Main results Our main contribution is a private non-convex optimization algorithm based on the variance- reduced SpiderBoost [WJZ+19]; Algorithm 1 achieves improved rates on the approximation error for finding SOSP of the empirical and population risks privately. Table 1 summarizes our main results. Finding second-order stationary points. Advances in private non-convex optimization have focused on finding a first-order stationary point (FOSP), whose performance is measured in (i) , and (ii) the norm of the (x) the norm of the empirical gradient at the solution x, i.e., k F population gradient, i.e., F . We survey the recent progress in Appendix C in detail. (x) k k∇ k∇ D P Definition 1.1 (First-order stationary point). We say x (FOSP) of g : Rd g(x) = 0. x is an α-FOSP of g, if R iff ∈ → ∇ g(x) k2 ≤ k∇ α. Rd is a First-Order Stationary Point 2 ∈ ∇ ∇ 2g(x) 2g(x) 0. We say x √ραI . Rd is an α-SOSP for ρ-Hessian Lipschitz function g, if Since FOSP can be a saddle point or a local maxima, finding a second-order stationary point is desired. Exact second-order stationary points can be extremely challenging to find [GHJY15]. Instead, progress is commonly measured in terms of how well the solution approximates an SOSP. Rd is a Second- k2 = 0 g(x) g(x) k2 ≤ Definition 1.2 (Second-order stationary point, [AAZB+17]). We say a point x Order Stationary Point (SOSP) of a twice differentiable function g : Rd and α (cid:23) (cid:23) − , the SOTA on privately finding α-SOSP is by [WCX19, WX20], On the empirical risk F V D which achieves α = ̃O(min (√d/n)1/2, (d/n)4/7 In Theorem 3.9, we show that the proposed ). } { Algorithm 1 achieves a rate bounded by α = ̃O((√d/n)2/3), which improves over the SOTA in 1/6 gap to a known lower bound of α = Ω(√d/n) all regime.1 There remains a factor (√d/n)− that holds even if privacy is not required and even if finding only an α-FOSP [ABG+22]. On the , Algorithm 1 is the first private algorithm to guarantee finding an α-SOSP population risk F with α = ̃O(n− 1/3 + (√d/n)3/7) in Theorem 3.12. There is a gap to a known lower bound of α = Ω(1/√n + √d/n) that holds even if privacy is not required and even if finding only an α-FOSP [ABG+22]. ∈ R iff k∇ k∇ → P D F − ∈K minx (xpriv)] (x), and the excess population risk, E[F P Minimizing excess risk. We also provide sampling-based algorithms that aims to tackle the ul- Rd that minimizes the excess empirical risk: timate objective of finding a private solution xpriv E[F (x), where D the expectation is over the randomness on the solution xpriv. With a mild smoothness assumption, log(1/δ)/(ε2 log n)) for both excess empiri- [WCX19] achieves in polynomial time a bound of O(d cal and population risks. In Table 1 we omit excess empirical risk, as the bounds are the same. We introduce a sampling-based algorithm from the exponential mechanism, which runs in polynomial time and achieves excess empirical and population risks bounded by O(d log(1/δ)/(ε log(nd))) with improved dependence on ε (Theorem 4.6). Moreover, we do not need the smoothness assump- tion required by [WCX19]. (xpriv)] minx p p ∈K − ∈ F P If we allow an exponential running time, [GTU22] demonstrated ̃O(d/(εn)) upper bound for non-convex excess empirical risks along with a nearly matching lower bound. It remained an open question to obtain a tight bound for the excess population risk. We close this gap by providing a nearly matching upper and lower bounds of ̃Θ(d/(εn) + d/n) for the excess population risk (Theorem 4.8). p 1.2 Our techniques Stationary points. We propose a simple framework based on SpiderBoost [WJZ+19] and its private version [ABG+22] that achieves the current best rate for finding the first order stationary f (xt). point privately. In SGD and its variants, we usually get an estimation ∆t of the gradient In the stochastic variance-reduced algorithm SpiderBoost, it only queries the gradient f (xt) directly every q steps with some oracle ∇ queries the difference between two steps, that is ∆t = ∆t that, in many situations, one can treat or privacy budget), though our framework does not necessarily assume this. ≈ 1 steps in each period, it O1, and for the other q 1), and maintain f (xt) 1) O2(xt, xt 1). One interpretation of the difference between these two kinds of oracles is O1 as more accurate and more costly (e.g., in computation O1 every q steps, the error on the estimation may accumulate and can be large. Though on average, as shown in [ABG+22], these estimations can be ∆t − ∇ k good enough to find a private first-order stationary point, such a large deviation makes it challenging to analyze the behavior near a saddle point and to provide a tight analysis of the population risk. As SpiderBoost queries ∇ O1(xt) O2(xt, xt f (xt) k − − ∇ f (xt ≈ ∇ 1 + − − − − 1We want α = o(1) and hence can assume d ≤ n2. 3 f (xt f (xt) In our framework, rather than using keeping track of the total drift we make, i.e., driftt = stamp when we used O1 once every q steps, we introduce a new technique of t 2 2, where τt is the last time 1k i=τt k O1. As we are considering smooth functions, the worst error to estimate 1k2. When the driftt is small, we know the current ∇ estimation should still be good enough, and we do not need to get an expensive fresh estimation O1. When driftt is large, the gradient estimation error may be large and we query O1 and get from ∆t = O1(xt). To control the total cost, we need an appropriate threshold to determine when the drift is large. The smaller the threshold is, we can guarantee more accurate estimations but may need to pay more cost for querying 1) is proportional to xt − k xi − − ∇ P xt xi − − − We want to bound the total occurrences of the event that driftt is large, which leads to querying O1. A crucial observation is that, if driftt increases quickly, then the gradient norms are large and hence function values decrease quickly, which we know does not happen frequently under the standard assumption that the function is bounded. O1 more frequently. In our framework, we assume Norm-SubGaussian (Definition 2.2), and similarly O1(x) is an unbiased estimation of O1(x) ∇ O2(x, y) is an unbiased estimation of − f (y) whose error is also Norm-SubGaussian. In the empirical case, we can simply add Gaussian ∇ for noises with appropriately chosen variances to the gradients of the empirical function D simplicity, and one can choose a smaller batch size to reduce the computational complexity. In the population case, we draw samples from the dataset without replacement to avoid dependence issues, and add the Gaussian noises to the sampled gradients. Hence we only need the gradient oracle complexity to be linear in the number of samples for the population case. f (x) is f (x) f (x), and − ∇ ∇ ∇ F D D (cid:1) (cid:0) − − − βF βF (x) (x) r(x) Minimizing excess risk. Our polynomial time approach relies on the Log-Sobolev Inequality (LSI) and the classic Stroock perturbation lemma. The previous work of [MASN16] shows that satisfies the LSI for some regularizer r, then sampling a if the density exp model x from this density satisfies differential privacy with an appropriate (ε, δ). If r is a μ r) satisfies LSI with constant 1/μ, strongly convex function, then the density proportional to exp( − )/μ by the Stroock (y) F r(x)) satisfies LSI with constant exp(maxx,y | and exp( | perturbation lemma. Our bound on the empirical risk follows from choosing the appropriate inverse temperature β and regularizer r to satisfy (ε, δ)-DP. The final bound on the population risk also follows from LSI, which bounds the stability of the sample drawn from the respective distribution. When running time is not concerned, we apply an exponential mechanism over a discretization of to get the upper bound. The empirical risk bound follows from [BST14], and we use concentration K of sums of bounded random variables to bound the maximum difference over the discretizations between the empirical and population risk. We show this is nearly tight by reductions from selection to non-convex Lipschitz optimization of [GTU22]. (x) − − F D D 1.3 Further related work In the convex setting, it is feasible to achieve efficient algorithms with good risk guarantees. In turn, differentially private empirical risk minimization (DP-ERM) [CM08, CMS11, CYS21, INS+19, KST12, BST14, TGTZ15, SCS13, SSTT21] and differentially private stochastic optimiza- tion [ALD21, BFTT19, BFGT20, FKT20, KLL21, AFKT21, KLZ22, GLL22, GTU22, CJJ+23, GLL+23] have been two of the most extensively studied problems in the DP literature. Most common approaches are variants of DP-SGD [CMS11] or the exponential mechanism [MT07]. As for the non-convex optimization, due to the intrinsic challenges in minimizing general non-convex functions, most of the previous works [WYX17, WJEG19, WX19, WCX19, ZCH+20, SSTT21, TC22, YZCL22, ABG+22, WB23, GW23] adopted the gradient norm as the accuracy metric rather than risk. Instead of minimizing the gradient norm discussed before, [BGM21] tried to minimize the stationarity gap of the population function privately, which is defined as 4 F GapFP (x) := maxy to be a bounded domain. There are also some different definitions of the second order stationary point. We refer the readers to [LRY+20] for more details. Some more detailed comparisons on FOSP and SOSP in the DP literature can be found in Appendix C. , which requires i ∈Kh∇ (x), x − K y P The risk bound achieved by algorithms with polynomial running time is weak and requires d to be meaningful. Many previous works consider minimizing risks of non-convex functions n under stronger assumptions, such as, Polyak-Lojasiewicz condition [WYX17, ZMLX21], Generalized linear model (GLM) [WCX19] and weakly convex functions [BGM21]. ≫ In the (non-private) classic stochastic optimization, there is a long line of influential works on finding the first and second-order stationary points for non-convex functions, [AAZB+17, JGN+17, FLLZ18, XJY18, CO19]. 2 Preliminary Throughout the paper, if not stated explicitly, the norm means the l2 norm. k * k Definition 2.1 (Lipschitz and Smoothness). Given a function f : , if for all x1, x2 ∈ K f (x2) , if for all x1, x2 ∈ K Definition 2.2 (SubGaussian, and Norm-SubGaussian). A random vector x 2ζ 2/2, (SG(ζ)) if there exists a positive constant ζ such that E eh k x1 − G k | ≤ M f (x2) k ≤ , and we say a function f : f (x1) | k∇ x2k x1 − k − f (x1) . x2k K → − ∇ v ek E x v,x − R, we say f is G-Lipschitz, R is M -smooth, K → ∈ Rd is SubGaussian Rd is v ∀ ∈ 2 t 2ζ2 , 2e− Rd. x ∈ R. t ∀ ∈ t] ≤ i ≤ E x x norm-SubGaussian (nSG(ζ)) if there exists ζ such that Pr[ k k ≥ (0, σ2Id), θ is SG(σ) and nSG(σ√d). − Fact 2.3. For a Gaussian θ ∼ N Rd be Lemma 2.4 (Hoeffding type inequality for norm-subGaussian, [JNG+19]). Let x1, Fi is the corresponding random vectors, and for each i filtration. Then there exists an absolute constant c such that for any δ > 0, with probability at least 1 is zero-mean nSG(ζi) where [k], xi | Fi , xk ∈ * * * ∈ − 1 ω, − k k i=1 xik ≤ c * k i=1 ζ 2 i log(2d/ω), which means k i=1 xi is nSG( c log(d) k i=1 ζ 2 i ). qP Definition 2.5 (Laplace distribution). We say X 1 2b exp( −| P x |b ). P Lap(b) if X has density f (X = x) = P q ∼ Theorem 2.6 (Matrix Bernstein inequality, [Tro15]). Consider a sequence mean-zero, symmetric d Xi}i { d random matrices. If for each matrix Xi, we know , where σ2 = 0, we have Pr for all t d exp × t t2 − 2(σ2+M t/3) i [m] Xikop ≥ ≥ ≤ Theorem 2.7 (Basic composition, [DR+14]). If combination is (ε1 + ε2, δ1 + δ2)-DP. P k h i ∈ (cid:16) (cid:17) A1 is (ε1, δ1)-DP and m of independent, ∈ M , then Xikop ≤ k E X 2 i kop. k P A2 is (ε2, δ2)-DP, then their [m] ∈ i Theorem 2.8 (Advanced composition, [KOV15]). For ε 0.9, an end-to-end guarantee of (ε, δ)- differential privacy is satisfied if a database is accessed at most k times, where each time with a (ε/(2 2k log(2/δ)), δ/(2k))-differentially private mechanism. ≤ p Due to space limit, some proofs are left in the Appendix. 3 Convergence to Stationary points We follow the assumptions of [WCX19], which also studies privately finding an α-SOSP. 5 Assumption 3.1. Any function drawn from almost surely, and the risk is upper bounded by B. P is G-Lipschitz, ρ-Hessian Lipschitz, and M -smooth, As discussed before, we define two different kinds of gradient oracles, one for estimating the gradient at one point and the other for estimating the gradient difference at two points. Definition 3.2 (SubGaussian gradient oracles). For a G-Lipschitz and M -smooth function F : (1) We say O1 is a first kind of ζ1 norm-subGaussian Gradient oracle if given x E O1(x) = F (x) and ∇ (2) We say O2 is a second kind of ζ2 norm-subGaussian stochastic Gradient oracle if given x, y O2(x, y) satisfies that E F (y) and ). y k O1(x) − ∇ O2(x, y) = Rd, ∈ x F (y)) is nSG(ζ2k F (x) is nSG(ζ1). O2(x, y) (x) satisfies F (x) F (x) ( ∇ Rd, − ∇ − ∇ ∇ O − − ∈ Note that we should assume M √ρα to make finding a second-order stationary point strictly ≥ more challenging than finding a first-order stationary point. We use smin( ) to denote the smallest * eigenvalue of a matrix. 3.1 Meta framework Algorithm 1 Stochastic Spider 1: Input: Objective function F , Gradient Oracle parameters of objective function B, M, G, ρ, parameter κ, failure probability ω O1, O2 with SubGaussian parameters ζ1 and ζ2, M log( dM B ργω ) √ργ * 7: p 8: 9: ∇− 1 = 0 4C(ζ 2 2 κ + 4ζ 2 1 ) frozent ργω )/γ2 T do 1k ≤ log(BM d/ρω), Γ = γ log3(BM d/ρω) 2: Set γ = 3: Set η = 1/M, t = 0, T = BM log4( dM B 4: Set drift0 = κ, frozen = 1, 5: while t ≤ if 6: k∇t − frozent = Γ, driftt = 0 ∇t = else if driftt ∇t = ∆t = end if xt+1 = xt − x1, { O1(xt) + gt, where gt ∼ N κ then O1(xt), driftt = 0, frozent = frozent ∇t = O2(xt, xt η ∇t − ∇t, driftt = driftt 14: 15: end while 16: Return: , xT } (0, ζ 2 1 + η2 d Id) 1 ≥ else 1), * * * 11: 10: 12: 13: V − − − − 1 0 then 1 ≤ 1 1 − − 1 + ∆t, frozent = frozent 1 1 − − 2 2, t = t + 1 k∇tk We demonstrate a framework based on the SpiderBoost in Algorithm 1. Our analysis of Algo- rithm 1 builds upon three key properties we prove in this section: (i) ∇t is consistently close to the true gradient F (xt) with high probability; (ii) the algorithm can escape the saddle point with high probability, and (iii) a large drift implies significant decrease in the function value, allowing us to limit the number of queries to the more accurate but more expensive first kind of gradient oracle ∇ O1. Lemma 3.3. For any 0 ≤ be 0, with probability at least 1 ≤ t T and letting τt ≤ − ω/T , for some universal constant C > 0, we have t be the largest integer such that driftτt is set to k∇t − ∇ 2 F (xt) k ≤ ζ 2 2 * (cid:0) t Xi=τt+1 xi − k xi − 2 + 4ζ 2 1 1k C * * log(T d/ω). (1) (cid:1) 6 Hence with probability at least 1 2 κ + 4ζ 2 γ2 := 16C(ζ 2 1 ) − ω, we know for each t T , ≤ k∇t − ∇ 2 F (xt) k ≤ γ2/16, where log(T d/ω) and κ is a parameter we can choose in the algorithm. * As shown in Lemma 3.3, the error on the gradient estimation for each step is bounded with high probability. Then we can show the algorithm can escape the saddle point efficiently based on previous results. ∇t, with step size η = 1/M . Suppose x0 is a stationary point satisfying Lemma 3.4 (Essentially from [WCX19]). Under Assumption 3.1, run SGD iterations xt+1 = α η xt − k ≤ and smin( γ, ζ1k ≤ k log(1/ω), (0, ζ2 ∼ N * one has ∇0 = [Γ], with probability at least 1 F (x0) + ζ1 + ζ2 where ω 2F (x0)) ∇ d log(d/ω) Id), and √ρα, α = γ log3(dBM/ρω). If k∇t−∇ γ for all t F (x0) F (xt) ≤ − k ≤ k∇ ∇ − γ2 ∈ F (xΓ) F (x0) Ω ≤ − − γ3/2 √ρ log3( dM B ργω ) , (cid:1) (cid:0) where Γ = M log( dM B ργω ) √ργ . We discuss this lemma in the Appendix A.2 in more details. The next lemma is standard, showing how large the function values can decrease in each step. Lemma 3.5. By setting η = 1/M , we have F (xt+1) F (xt) + η k∇tk * k∇ F (xt) − ∇tk − ≤ η 2 k∇tk 2. Moreover, with probability at least 1 F (xt+1) − − ω, for each t ≤ T such that F (xt) γ, we have k ≥ F (xt) η ≤ − 2/6 k∇tk ≤ − k∇ ηγ2/6. With the algorithm designed to control the drift term, the guarantee for Stochastic Spider to find the second order stationary point is stated below: Lemma 3.6. Suppose O(1) x1, { (ζ 2 2 κ + 4ζ 2 1 ) , xT } p * * * * O1 and log(T d/ω), with probability at least 1 O2 are ζ1 and ζ2 norm-subGaussian respectively. If one sets γ = ω, at least one point in the output set of Algorithm 1 is α-SOSP, where − α = γ log3(BM d/ρωγ) = (ζ 2 2 κ + 4ζ 2 1 ) s log( * d/ω 2 κ + ζ 2 ζ 2 1 ) * log3( BM d 2 κ + ζ 2 1 ) ρω(ζ 2 ). As mentioned before, we can bound the number of occurrences where the drift gets large and hence bound the total time we query the oracle of the first kind. Lemma 3.7. Under the event that settings, letting K = [T ] : driftt ≥ Bη K | k∇t − ∇ κ } κ + T γ2η2/κ) = O(Bη log4( dM B ργω )/κ (cid:1) t { | ≤ O ∈ (cid:0) . 3.2 Convergence to the SOSP of the empirical risk F (xt) [T ] and our parameter be the set of iterations where the drift is large, we know γ/4 for all t k ≤ ∈ We use Stochastic Spider to improve the convergence to α-SOSP of the empirical risk, and aim at getting α = ̃O(d1/3/n2/3). We let F D be the objective function F and use the gradient oracles O1(x) := F D ∇ (x) + g1, and O2(x, y) := F D ∇ (x) F D − ∇ (y) + g2, (2) 7 Algorithm 2 AboveThreshold T i=1, dataset S, parameters of objective function B, M, G, ρ, objective xi} { 1: Input: A set of points error α T1 = α + Lap( 4G , T do 2: Set 3: for i = 1, if 4: * * * b FS(xi) k∇ k Output: xi Halt end if 7: 8: end for 5: 6: nε ) + 16 log(2T /ω)G nε , T2 = + Lap( 8G nε ) T1 ≤ b smin( ∇ V b √ρα + Lap( 4M nε ) − 2FS(xi)) + Lap( 8M nε ) − 16 log(2T /ω)M nε T2 then ≥ b (0, σ2 (0, σ2 2Id) ensures privacy. 1Id) and g2 ∼ N where g1 ∼ N Before stating the formal results, note that by Lemma 3.6, the framework can only guarantee the existence of an α-SOSP in the outputted set. In order to find the SOSP privately from the set, we adopt the well-known AboveThreshold algorithm, whose pseudo-code can be found in Algorithm 2. Algorithm 2 is a slight modification of the AboveThreshold algorithm [DR+14], and we get the following guarantee immediately. Lemma 3.8. Algorithm 2 is (ε, 0)-DP. Given the point set input, x1, { * * * , xT } and S of size n as the • if it outputs any point xi, then with probability at least 1 ω, we know − FS (xi) k ≤ k∇ α + 32 log(2T /ω)G nε , and smin( ∇ 2FS(xi)) √ρα ≥ − 32 log(2T /ω)M nε − • if there exists a α-SOSP point x will output one point. xi}i ∈ { [T ], then with probability at least 1 ∈ − ω, Algorithm 2 Combining Algorithm 1 and Algorithm 2, we can find the SOSP we want, which is stated formally below: Theorem 3.9 (Empirical). Using full batch in Algorithm 1, and setting κ = G4/3B1/3 σ1 = G√Bη log2(1/δ)/κ log2(ndM B/ω) and with probability at least 1 with ω, at least one point in the output set M√log2(1/δ)BM/α2 1 log5(ndM B/ω) , σ2 = M 5/3 − nε nε , Algorithm 1 is (ε, δ)-DP, xi}i { [T ] is α1-SOSP of F ∈ D √d log(1/δ) nε ( )2/3, dBGM log2(1/δ) q nε 2/3 * log6 nBM d ρω  . α1 = O  (cid:0)  Moreover, if we run Algorithm 2 with inputs ω, we can get an α2-SOSP of F with 1 − D G log(n/Gω) nε α2 = O α1 + (cid:18) (cid:1) [T ], ∈ D xi}i {  , B, M, G, ρ, α1, with probability at least + M log(ndBGM/ρω) nε√ρ √α1 . (cid:19) 3.3 Convergence to the SOSP of the population risk This subsection aims at getting an α-SOSP for F stochastic oracles used for empirical function F (the population function). Differing from the P , we do not use full batch in the oracle. As an D 8 alternative, we draw fresh samples from D without replacement with a smaller batch size: O1(x) := 1 b1 ∇ S1 Xz ∈ f (x; z) + g1, and O2(x, y) := 1 b2 S2 Xz ∈ f (x; z) ( ∇ − ∇ f (y; z)) + g2, (3) (0, σ2 where S1 and S2 are sets of size of b1 and b2 respectively drawn from (0, σ2 x 1Id) and g2 ∼ N g1 ∼ N 2k Claim 3.10. The gradient oracles O( L√log d √b1 subGaussian gradient oracle respectively. + √dσ1) norm-subGaussian gradient oracle and second kind of O( M √log d 2 2 * − k O1 and O2 constructed in Equation (3) are a first kind of + √dσ2) norm- Id). These gradient oracles satisfy the following. without replacement, √b2 D y F Proof. For the oracle − (x) is nSG(L) due to the Lipschitzness assumption. The statement follows from Fact 2.3 and O1, we know for each z O2, the statement follows similarly with the smoothness assumption. ∇ Lemma 2.4. As for the f (x, z)] = (x) and f (x, z) [ ∇ ∼P ∇ ∇ ∈ F P P S1, Ez Recall that in the empirical case, we use Algorithm 2 to choose the SOSP for F D , and what we have are samples from . But in the . We need population case, we need to find SOSP for F the following technical results to help us find the SOSP from the set, which follows from Hoeffding inequality for norm-subGaussians (Lemma 2.4) and Matrix Bernstein inequality (Theorem 2.6). P P Lemma 3.11. Fix a point x Rd. Given a set S of m samples drawn i.i.d. from the distribution , then we know with probability at least 1 ∈ P FS(x) F P − ∇ (x) k2 ≤ O k∇ − G log(d/ω) √m ω, we have 2FS(x) 2F P (x) kop ≤ O − ∇ k∇ M log(d/ω) √m (cid:1) ^ We can bound the population bound similar to the empirical bound with these tools. (cid:0) (cid:0) . (cid:1) Theorem 3.12 (Population). Divide the dataset n/2 ⌋ ⌊ n/2 and ⌈ ⌉ max( G4/3B1/3 log1/3 d M 5/3 oracles, Algorithm 1 with the output is α1-SOSP of F P Bη , b2 = nα2 respectively. Setting b1 = nκ √d log(1/δ) M 5/3 )6/7( nε D1 is (ε, δ)-DP, and with probability at least 1 1/3, ( GB2/3 BM , σ1 = n− 1 with D into two disjoint datasets G√log(1/δ) b1ε , σ2 = D1 and M√log(1/δ) b2ε D2 of size and κ = )4/7) in Equation (3) and using them as gradient ω, at least one point in α1 = O (BGM log d)1/3 1 * (cid:16)(cid:0) n1/3 + (G1/7B3/7M 3/7)( xi}i { p [T ], ∈ with d log(1/δ) nε )3/7 log3(nBM d/ρω) (cid:17) . D2, B, M, G, ρ, α1, with probability at Moreover, if we run Algorithm 2 with inputs least 1 − ω, Algorithm 2 can output an α2-SOSP of F P − (cid:1) α2 = O α1 + (cid:18) M log(ndBGM/ρω) √ρ min(nε, n1/2) √α1 + G( log(n/Gω) nε + log(d/ω) √n . ) (cid:19) 4 Bounding the excess risk In this section, we consider the risk bounds. 9 4.1 Polynomial time approach If we want the algorithm to be efficient and implementable in polynomial time, to our knowledge the only known bound is O( d log(1/δ) ε2 log n ) in [WCX19] for smooth functions. [WCX19] used Gradient Langevin Dynamics, a popular variant of SGD to solve this problem, and prove the privacy by advanced composition. We generalize the exponential mechanism to the non-convex case and implement it without smoothness assumption. First recall the Log-Sobolev inequality: We say a probability distribution π satisfies LSI with constant CLSI if for all f : Rd R, Eπ[f 2 log f 2] Eπ[f 2] log Eπ[f 2] → − 2CLSI Eπ k∇ f 2 2. k ≤ A well-known result ([OV00]) says if f is μ-strongly convex, then the distribution proptional to f ) satisfies LSI with constant 1/μ. Recall the results from previous results [MASN16] about exp( − LSI and DP: Theorem 4.1 ([MASN16]). Sampling from exp( 2 Gβ is (ε, δ)-DP, where ε n √CLSI − 1 + 2 log(1/δ), and CLSI is the worst LSI constant. − D βF (x; ) r(x)) for some public regularizer r ≤ We can apply the classic perturbation lemma to get the new LSI constant in the non-convex p case. Suppose we add a regularizer μ x 2 k 2, and try to sample from exp( k − β(F (x; D ) + μ x 2 k 2)). k Lemma 4.2 (Stroock perturbation). Suppose π satisfies LSI with constant CLSI(π). If 0 < c dπ′ dπ ≤ C, then CLSI(π′) C c CLSI(π). ≤ ≤ Lemma 4.3 is a more general version of Theorem 3.4 in [GTU22] and can be used to bound the empirical risk. Lemma 4.3. Let π(x) ∝ exp( β(F (x) + μ x 2 k 2 2)). Then for βGD > d, we know k D E π x ∼ (F D (x) + x 2 2) k − min x∗ ∈K (F D (x∗) + μ 2 k x∗ 2 2) k ≤ d β log(βGD/d) − μ 2 k We now turn to bound the generalization error, and use the notion of uniform stability: Lemma 4.4 (Stability and Generalization [BE02]). Given a dataset from some underlying distribution a sample s in E [F P by an independent fresh one s′ from F ,s′, , and given any algorithm [n] drawn i.i.d. ∈ , suppose we randomly replace D′, then ) is the output of and get the neighoring dataset si}i { ); s′)) P f ( [f ( = D A D′); s′))], where ( ( A ( D D ))] = E D ( D A ( D A − A − A ( , D D P A with input A ( A D )) . D is sampling from the exponential mechanism, letting π As each function f (; s′) is G-Lipschitz, it suffices to bound the W2 distance of ( ) and D′). ( A A D (x) + μ 2)) and If x 2 k k 2)), it suffices to bound the W2 distance between π ′. The and π π k D following lemma can bound the generalization risk of the exponential mechanism under LSI: ′(x) + μ x 2 k D ∝ exp( exp( β(F β(F A ′ − − ∝ D D D D Lemma 4.5 (Generalization error bound). Let π exp( − β(F D (x) + μ x 2 k 2 2)). Then we have k D ∝ E ,x ∼ D (x) [F P F D − πD (x)] ≤ O( G2 exp(βGD) nμ ). We get the following results: Theorem 4.6 (Risk bound). We are given ε, δ with β = O( 2 (0, 1/2). Sampling from exp( 2)) k D2β is (ε, δ)-DP. The empirical risk and population risk are bounded ), μ = d (x)+ μ x 2 k β(F − ∈ D ε log(nd) GD√log(1/δ)) log log(n)√log(1/δ) ε log(nd) by O(GD d * ). 10 4.1.1 Implementation There are multiple existing algorithms that can sample efficiently from density with LSI, under mild assumptions. For example, when the functions are smooth or weakly smooth, one can turn to the Langevin Monte Carlo [CEL+22], and [LC22]. The algorithm in [WCX19] also requires mild smoothness assumptions. We discuss the implementation of non-smooth functions in bit more details, which is more challenging. We can adopt the rejection sampler in [GLL22], which is based on the alternating sampling algorithm in [LST21]. Both [LST21] and [GLL22] are written in the language of log-concave and strongly log-concave densities, but their results hold as long as LSI holds. By combining them together, we can get the following risk bounds. The details of the implementation can be found in Appendix B.3. Theorem 4.7 (Implementation, risk bound). For ε, δ sampler that can achieve the empirical and population risks O(GD in expectation, the sampler takes ̃O Gaussian random variables restricted to the convex set nε3 log3(d) (cid:16) log(1/δ)/(GD) in total. (cid:17) p K ∈ (0, 1/2), there is an (ε, 2δ)-DP efficient log log(n)√log(1/δ) ε log(nd) ). Moreover, d * function values query and some 4.2 Exponential time approach In [GTU22], it is shown that sampling from exp( risk bound of ̃O( DGd non-convex DP-SO. (x)) is ε-DP, and a nearly tight empirical nε ) is achieved for convex functions. It is open what is the bound we can get for − εn GD F D 4.2.1 Upper Bound Given exponential time we can use a discrete exponential mechanism as considered in [BST14]. We recap the argument and extend it to DP-SO. The proof is based on a simple packing argument, and can be found in Appendix B.4. Theorem 4.8. There exists an ε-DP differentially private algorithm that achieves a population risk of O d log(εn/d)/(εn) + d log(εn/d)/(√n) GD . (cid:16) (cid:16) 4.2.2 Lower Bound p (cid:17)(cid:17) Results in [GTU22] imply that the first term of ̃O(GDd/εn) is tight, even if we relax to approximate DP with δ > 0. A reduction from private selection problem shows the ̃O( d/n) generalization term is also nearly-tight (Theorem 4.11). In the selection problem, we have k coins, each with an unknown probability pi. Each coin is flipped n times such that [n], each xi,j i.i.d. sampled ∈ from Bern(pi), and we want to choose a coin i with the smallest pi. The risk of choosing i is pi − Theorem 4.9. Any algorithm for the selection problem has excess population risk ̃Ω( xi,j}j { mini∗ pi∗. p log k n ). This follows from a folklore result on the selection problem (see e.g. [BU17]). We can combine q this with the following reduction from selection to non-convex optimization: Theorem 4.10 (Restatement of results in [GTU22]). If any (ε, δ)-DP algorithm for selection has risk R(k), then any (ε, δ)-DP algorithm for minimizing 1-Lipschitz losses over Bd(0, 1) (the d-dimensional unit ball) has risk R(2Θ(d)). From this and the aforementioned lower bounds in empirical non-convex optimization we get the following: 11 Theorem 4.11. For ε 1, δ Lipschitz losses over Bd(0, 1) has excess population risk max [2− ≤ ∈ Ω(n), 1/n1+Ω(1)], any (ε, δ)-DP algorithm for minimizing 1- Ω(d log(1/δ)/(εn)), ̃Ω( { . d/n) } 5 Conclusion p We present a novel framework that can improve upon the state-of-the-art rates for locating second- order stationary points for both empirical and population risks. We also examine the utilization of the exponential mechanism to attain favorable excess risk bounds for both a polynomial time sampling approach and an exponential time sampling approach. Despite the progress made, several interesting questions remain. There is still a gap between the upper and lower bounds for find- ing stationary points. As noted in [ABG+22], it is quite challenging to beat the current ( √d n )2/3 empirical upper bound, and overcoming this challenge may require the development of new tech- niques. A potential avenue for improving the population rate for SOSP could be combining our drift-controlled framework with the tree-based private SpiderBoost algorithm in [ABG+22]. Addi- tionally, it is worth exploring if it is possible to achieve better excess risk bounds within polynomial time, and what the optimal risk bound could be. 6 Acknowledgement DG would like to thank Ruoqi Shen and Kevin Tian for several discussions. 12 References [AAZB+17] Naman Agarwal, Zeyuan Allen-Zhu, Brian Bullins, Elad Hazan, and Tengyu Ma. Find- ing approximate local minima faster than gradient descent. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, pages 1195–1199, 2017. [ABG+22] Raman Arora, Raef Bassily, Tom ́as Gonz ́alez, Crist ́obal Guzm ́an, Michael Menart, and Enayat Ullah. Faster rates of convergence to stationary points in differentially private optimization. arXiv preprint arXiv:2206.00846, 2022. [AFKT21] Hilal Asi, Vitaly Feldman, Tomer Koren, and Kunal Talwar. Private stochastic convex optimization: Optimal rates in l1 geometry. In International Conference on Machine Learning, pages 393–403. PMLR, 2021. [ALD21] Hilal Asi, Daniel Asher Nathan Levy, and John Duchi. Adapting to function difficulty In Advances in Neural Information and growth conditions in private optimization. Processing Systems, 2021. [BE02] Olivier Bousquet and Andr ́e Elisseeff. Stability and generalization. The Journal of Machine Learning Research, 2:499–526, 2002. [BFGT20] Raef Bassily, Vitaly Feldman, Crist ́obal Guzm ́an, and Kunal Talwar. ity of stochastic gradient descent on nonsmooth convex losses. arXiv:2006.06914, 2020. Stabil- arXiv preprint [BFTT19] Raef Bassily, Vitaly Feldman, Kunal Talwar, and Abhradeep Thakurta. Private stochastic convex optimization with optimal rates. In Advances in Neural Information Processing Systems, pages 11279–11288, 2019. [BGM21] Raef Bassily, Crist ́obal Guzm ́an, and Michael Menart. Differentially private stochastic optimization: New results in convex and non-convex settings. Advances in Neural Information Processing Systems, 34:9317–9329, 2021. [BST14] Raef Bassily, Adam Smith, and Abhradeep Thakurta. Private empirical risk mini- mization: Efficient algorithms and tight error bounds. In Proc. of the 2014 IEEE 55th Annual Symp. on Foundations of Computer Science (FOCS), pages 464–473, 2014. [BU17] Mitali Bafna and Jonathan Ullman. The price of selection in differential privacy. In Satyen Kale and Ohad Shamir, editors, Proceedings of the 2017 Conference on Learning Theory, volume 65 of Proceedings of Machine Learning Research, pages 151– 168. PMLR, 07–10 Jul 2017. [CCSW22] Yongxin Chen, Sinho Chewi, Adil Salim, and Andre Wibisono. Improved analysis for a proximal algorithm for sampling. In Conference on Learning Theory, pages 2984–3014. PMLR, 2022. [CEL+22] Sinho Chewi, Murat A Erdogdu, Mufan Li, Ruoqi Shen, and Shunshi Zhang. Analysis In Conference on Learning of langevin monte carlo from poincare to log-sobolev. Theory, pages 1–2. PMLR, 2022. [CJJ+23] Yair Carmon, Arun Jambulapati, Yujia Jin, Yin Tat Lee, Daogao Liu, Aaron Sidford, and Kevin Tian. Resqueing parallel and private stochastic convex optimization. arXiv preprint arXiv:2301.00457, 2023. 13 [CM08] Kamalika Chaudhuri and Claire Monteleoni. Privacy-preserving logistic regression. Advances in neural information processing systems, 21, 2008. [CMS11] Kamalika Chaudhuri, Claire Monteleoni, and Anand D Sarwate. Differentially private empirical risk minimization. Journal of Machine Learning Research, 12(Mar):1069– 1109, 2011. [CO19] Ashok Cutkosky and Francesco Orabona. Momentum-based variance reduction in non-convex sgd. Advances in neural information processing systems, 32, 2019. [CYS21] Rishav Chourasia, Jiayuan Ye, and Reza Shokri. Differential privacy dynamics of In Advances in Neural Information langevin diffusion and noisy gradient descent. Processing Systems, 2021. [DMNS06] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise In Proc. of the Third Conf. on Theory of to sensitivity in private data analysis. Cryptography (TCC), pages 265–284, 2006. [DR+14] Cynthia Dwork, Aaron Roth, et al. The algorithmic foundations of differential privacy. Foundations and Trends® in Theoretical Computer Science, 9(3–4):211–407, 2014. [FKT20] Vitaly Feldman, Tomer Koren, and Kunal Talwar. Private stochastic convex optimiza- tion: Optimal rates in linear time. In Proc. of the Fifty-Second ACM Symp. on Theory of Computing (STOC'20), 2020. [FLLZ18] Cong Fang, Chris Junchi Li, Zhouchen Lin, and Tong Zhang. Spider: Near-optimal non-convex optimization via stochastic path-integrated differential estimator. Ad- vances in Neural Information Processing Systems, 31, 2018. [GHJY15] Rong Ge, Furong Huang, Chi Jin, and Yang Yuan. Escaping from saddle points-online stochastic gradient for tensor decomposition. In Conference on learning theory, pages 797–842. PMLR, 2015. [GLL22] Sivakanth Gopi, Yin Tat Lee, and Daogao Liu. Private convex optimization via ex- ponential mechanism. In Conference on Learning Theory, pages 1948–1989. PMLR, 2022. [GLL+23] Sivakanth Gopi, Yin Tat Lee, Daogao Liu, Ruoqi Shen, and Kevin Tian. Private convex optimization in general norms. In Proceedings of the 2023 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 5068–5089. SIAM, 2023. [GTU22] Arun Ganesh, Abhradeep Thakurta, and Jalaj Upadhyay. Langevin diffusion: An almost universal algorithm for private euclidean (convex) optimization. arXiv preprint arXiv:2204.01585, 2022. [GW23] Changyu Gao and Stephen J Wright. Differentially private optimization for smooth nonconvex erm. arXiv preprint arXiv:2302.04972, 2023. [INS+19] Roger Iyengar, Joseph P Near, Dawn Song, Om Thakkar, Abhradeep Thakurta, and Lun Wang. Towards practical differentially private convex optimization. In 2019 IEEE Symposium on Security and Privacy (SP), 2019. [JGN+17] Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M Kakade, and Michael I Jordan. How to escape saddle points efficiently. In International conference on machine learning, pages 1724–1732. PMLR, 2017. 14 [JNG+19] Chi Jin, Praneeth Netrapalli, Rong Ge, Sham M Kakade, and Michael I Jordan. A short note on concentration inequalities for random vectors with subgaussian norm. arXiv preprint arXiv:1902.03736, 2019. [KLL21] Janardhan Kulkarni, Yin Tat Lee, and Daogao Liu. Private non-smooth erm and sco in subquadratic steps. Advances in Neural Information Processing Systems, 34, 2021. [KLZ22] Gautam Kamath, Xingtu Liu, and Huanyu Zhang. Improved rates for differentially private stochastic convex optimization with heavy-tailed data. In International Con- ference on Machine Learning, pages 10633–10660. PMLR, 2022. [KOV15] Peter Kairouz, Sewoong Oh, and Pramod Viswanath. The composition theorem for differential privacy. In Francis Bach and David Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 1376–1385, Lille, France, 07–09 Jul 2015. PMLR. [KST12] Daniel Kifer, Adam Smith, and Abhradeep Thakurta. Private convex empirical risk In Conference on Learning Theory, minimization and high-dimensional regression. pages 25–1, 2012. [LC22] Jiaming Liang and Yongxin Chen. A proximal algorithm for sampling from non-smooth potentials. In 2022 Winter Simulation Conference (WSC), pages 3229–3240. IEEE, 2022. [LRY+20] Songtao Lu, Meisam Razaviyayn, Bo Yang, Kejun Huang, and Mingyi Hong. Finding second-order stationary points efficiently in smooth nonconvex linearly constrained optimization problems. Advances in Neural Information Processing Systems, 33:2811– 2822, 2020. [LST21] Yin Tat Lee, Ruoqi Shen, and Kevin Tian. Structured logconcave sampling with In Conference on Learning Theory, pages 2993–3050. a restricted gaussian oracle. PMLR, 2021. [MASN16] Kentaro Minami, HItomi Arai, Issei Sato, and Hiroshi Nakagawa. Differential privacy without sensitivity. Advances in Neural Information Processing Systems, 29, 2016. [MT07] Frank McSherry and Kunal Talwar. Mechanism design via differential privacy. In 48th Annual IEEE Symposium on Foundations of Computer Science (FOCS'07), pages 94– 103. IEEE, 2007. [OV00] Felix Otto and C ́edric Villani. Generalization of an inequality by talagrand and links with the logarithmic sobolev inequality. Journal of Functional Analysis, 173(2):361– 400, 2000. [SCS13] Shuang Song, Kamalika Chaudhuri, and Anand D Sarwate. Stochastic gradient descent with differentially private updates. In 2013 IEEE Global Conference on Signal and Information Processing, pages 245–248. IEEE, 2013. [SSTT21] Shuang Song, Thomas Steinke, Om Thakkar, and Abhradeep Thakurta. Evading the curse of dimensionality in unconstrained private glms. In International Conference on Artificial Intelligence and Statistics, pages 2638–2646. PMLR, 2021. [TC22] Hoang Tran and Ashok Cutkosky. Momentum aggregation for private non-convex erm. In Advances in Neural Information Processing Systems, 2022. 15 [TGTZ15] Kunal Talwar, Abhradeep Guha Thakurta, and Li Zhang. Nearly optimal private lasso. Advances in Neural Information Processing Systems, 28, 2015. [Tro15] Joel A Tropp. An introduction to matrix concentration inequalities. Foundations and Trends® in Machine Learning, 8(1-2):1–230, 2015. [WB23] Yongqiang Wang and Tamer Ba ̧sar. Decentralized nonconvex optimization with guar- anteed privacy and accuracy. Automatica, 150:110858, 2023. [WCX19] Di Wang, Changyou Chen, and Jinhui Xu. Differentially private empirical risk min- In International Conference on Machine imization with non-convex loss functions. Learning, pages 6526–6535. PMLR, 2019. [WJEG19] Lingxiao Wang, Bargav Jayaraman, David Evans, and Quanquan Gu. Efficient privacy- preserving stochastic nonconvex optimization. arXiv preprint arXiv:1910.13659, 2019. [WJZ+19] Zhe Wang, Kaiyi Ji, Yi Zhou, Yingbin Liang, and Vahid Tarokh. Spiderboost and momentum: Faster variance reduction algorithms. Advances in Neural Information Processing Systems, 32, 2019. [WX19] Di Wang and Jinhui Xu. Differentially private empirical risk minimization with smooth non-convex loss functions: A non-stationary view. In Proceedings of the AAAI Con- ference on Artificial Intelligence, volume 33, pages 1182–1189, 2019. [WX20] Di Wang and Jinhui Xu. Escaping saddle points of empirical risk privately and scalably via dp-trust region method. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 90–106. Springer, 2020. [WYX17] Di Wang, Minwei Ye, and Jinhui Xu. Differentially private empirical risk minimiza- tion revisited: Faster and more general. Advances in Neural Information Processing Systems, 30, 2017. [XJY18] Yi Xu, Rong Jin, and Tianbao Yang. First-order stochastic algorithms for escaping from saddle points in almost linear time. Advances in neural information processing systems, 31, 2018. [YZCL22] Xiaodong Yang, Huishuai Zhang, Wei Chen, and Tie-Yan Liu. Normalized/clipped sgd with perturbation for differentially private non-convex optimization. arXiv preprint arXiv:2206.13033, 2022. [ZCH+20] Yingxue Zhou, Xiangyi Chen, Mingyi Hong, Zhiwei Steven Wu, and Arindam Baner- jee. Private stochastic non-convex optimization: Adaptive algorithms and tighter generalization bounds. arXiv preprint arXiv:2006.13501, 2020. [ZMLX21] Qiuchen Zhang, Jing Ma, Jian Lou, and Li Xiong. Private stochastic non-convex optimization with improved utility rates. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, 2021. 16 A Omitted Proof of Section 3 A.1 Proof of Lemma 3.3 Lemma 3.3. For any 0 ≤ be 0, with probability at least 1 ≤ t ω/T , for some universal constant C > 0, we have t be the largest integer such that driftτt is set to T and letting τt ≤ − t k∇t − ∇ 2 F (xt) k ≤ ζ 2 2 * xi − k xi − 2 + 4ζ 2 1 1k C * * log(T d/ω). (1) Xi=τt+1 (cid:0) ω, we know for each t (cid:1) Hence with probability at least 1 2 κ + 4ζ 2 γ2 := 16C(ζ 2 1 ) − * log(T d/ω) and κ is a parameter we can choose in the algorithm. T , ≤ k∇t − ∇ 2 F (xt) k ≤ γ2/16, where Proof. If driftτt = 0 happens, we use the first kind oracle to query the gradient, and hence ∇τt − If t = τt, Equation (1) holds by the property of norm- F (xτt ) is zero-mean and nSG(2ζ1). ∇ subGaussian. For each τt + 1 xi xi − and nSG(ζ2k i ≤ 1k − t, conditional on ≤ ). Note that ∇i − 1, we know ∆i − ( ∇ F (xi) − F (xi − 1)) is zero-mean ∇t − ∇ F (xt) = ∇τt − ∇ F (xτt ) + t Xi=τt+1 [∆i − ( ∇ F (xi) − ∇ F (xi 1))]. − Equation (1) follows from Lemma 2.4. xi − We know driftt t i=τt+1 k 1 = − xi 2 1k − ≤ union bound, we know with probability at least 1 P k∇t − ∇ 2 F (xt) k ≤ A.2 Discussion of Lemma 3.4 κ almost surely by the design of the algorithm. By − 2 κ + 4ζ 2 1 ) C(ζ 2 ω, for each t [T ], ∈ log(T d/ω) = γ2/16. * ∇t, with step size η = 1/M . Suppose x0 is a stationary point satisfying Lemma 3.4 (Essentially from [WCX19]). Under Assumption 3.1, run SGD iterations xt+1 = α η xt − k ≤ and smin( γ, ζ1k ≤ k log(1/ω), (0, ζ2 ∼ N * one has ∇0 = [Γ], with probability at least 1 F (x0) + ζ1 + ζ2 where ω 2F (x0)) ∇ d log(d/ω) Id), and √ρα, α = γ log3(dBM/ρω). If k∇t−∇ γ for all t F (x0) F (xt) ≤ − k ≤ k∇ ∇ − γ2 ∈ F (xΓ) F (x0) Ω ≤ − − γ3/2 √ρ log3( dM B ργω ) , (cid:1) (cid:0) where Γ = M log( dM B ργω ) √ργ . We briefly recap the proof of Lemma 3.4 in [WCX19]. One observation between the decreased function value, and the distance solutions moved is stated below: Lemma A.1 (Lemma 11, [WCX19]). For each t [Γ], we know ∈ xt+1 − k x0k 2 2 ≤ 8η(Γ(F (x0) − F (xΓ)) + 50η2Γ k∇i − ∇ 2 2. F (xt) k [Γ] Xi ∈ 17 The difference between our algorithm and the DP-GD in [WCX19] is the noise on the gradient. 2 2 in our algorithm is controlled and small, F (xt) k F (xΓ) is small, i.e., the Note that with high probability, [Γ] k∇i − ∇ i ∈ and hence does not change the other proofs in [WCX19]. Hence if F (x0) function value does not decrease significantly, we know xt is close to x0. P − Let Bx(r) be the unit ball of radius r around point x. Denote the (x)Γ the point xΓ after running SGD mentioned in Lemma 3.4 for Γ steps beginning at x. With this observation, denote Bγ(x0) := . [WCX19] demonstrates the following } lemma: Bx0(ηα), Pr[F ((x)Γ) F (x) ≥ − x { Φ] ≥ − ∈ ω x | Lemma A.2. If F (x0) k∇ k ≤ α and smin( 2F (x0)) ∇ along the minimum eigenvector of 2F (x0) is at most ≤ − √ργ, then the width of Bγ(x0) along the ωηγ log(1/ω) 2π d . ∇ The intuition is that if two different points x1, x2 Bx0(ηα), and x1 minimum eigenvector, then with high probability, the distance between large, and either F (x2) kick off the point. x2 is large along the − (x2)Γk (x1)Γ − will be k F ((x1)Γ) or is large, and hence either F (x1) − F ((x2)Γ) is large. The Lemma 3.4 follows from Lemma A.2 by using the Gaussian ζ2 to (x2)Γ − k (x1)Γ − k x1 x2 or − ∈ k k q A.3 Proof of Lemma 3.5 Lemma 3.5. By setting η = 1/M , we have F (xt+1) F (xt) + η k∇tk * k∇ F (xt) − ∇tk − ≤ η 2 k∇tk 2. Moreover, with probability at least 1 F (xt+1) − − ω, for each t ≤ T such that F (xt) γ, we have k ≥ F (xt) η ≤ − 2/6 k∇tk ≤ − k∇ ηγ2/6. Proof. By the assumption on smoothness, we know F (xt+1) F (xt) + ≤ =F (xt) − F (xt) + η ≤ k∇ h∇ η/2 F (xt), xt+1 − 2 k∇tk F (xt) + xti F (xt) − h∇ − ∇tk * k∇tk − M xt+1 − 2 k − ∇t, η ∇ti η 2 k∇tk 2. 2 xtk By Lemma 3.3, with probability at least 1 Hence we know if F (xt) ∇ ≥ γ, we have ω, for each t [T ] we have F (xt) k∇ − ∇tk2 ≤ γ/4. ∈ − F (xt+1) F (xt) η ≤ − − 2/6 k∇tk ≤ − ηγ2/6. A.4 Proof of Lemma 3.6 Lemma 3.6. Suppose O(1) x1, { (ζ 2 2 κ + 4ζ 2 1 ) , xT } p * * * * O1 and log(T d/ω), with probability at least 1 O2 are ζ1 and ζ2 norm-subGaussian respectively. If one sets γ = ω, at least one point in the output set of Algorithm 1 is α-SOSP, where − α = γ log3(BM d/ρωγ) = (ζ 2 2 κ + 4ζ 2 1 ) s log( * d/ω ζ 2 2 κ + ζ 2 1 ) * log3( BM d 2 κ + ζ 2 1 ) ρω(ζ 2 ). 18 Proof. By Lemma 3.5, we know if the gradient F (xt+1) but the Hessian has a small eigenvalue), then with high probability that F (xΓ+t) γ, then with high probability that k ≥ ηγ2/6. By Lemma 3.4, if xt is a saddle point (with small gradient norm F (xt) F (xt) F (xt) ≤ − k∇ − Ω( − γ3/2 √ρ log3( dM B ργω ) Recall the assumption that the risk is upper bounded by B, by our setting T = Ω ), and the function values decrease Ω γ2 M log4( dM B ργω ) (cid:1) (cid:0) on average for each step. − ≤ BM γ2 log4( dM B ργω ) (cid:1) , (cid:0) the statement is proved. A.5 Proof of Lemma 3.7 [T ] and our parameter be the set of iterations where the drift is large, we know γ/4 for all t k ≤ ∈ Lemma 3.7. Under the event that settings, letting K = [T ] : driftt ≥ Bη K | Proof. By Lemma 3.5, if F (xt) k∇t − ∇ κ } κ + T γ2η2/κ) = O(Bη log4( dM B ργω )/κ (cid:0) (cid:1) γ, we know F (xt+1) ηγ2 otherwise. Index the items in K = F (xt) k F (xt) k ≥ t { | ≤ O ∈ . ≤ F (xti+1) F (xti) − ≤ − 1 6η driftti+1 + (ti+1 − Recall by the assumption that maxy F (y) K |6η κ + T γ2η, and we know | F (xt1 ) ≤ − minx F (x) − ≤ t1, t2, { K |} − , t * * * | ti)γ2η F (xt) η k∇tk ≤ − 2/6, and F (xt+1) − such that ti < ti+1. We know 1 6η ≤ − κ + (ti+1 − B. And hence ti)γ2η. B − ≤ F (xt|L| ) − K | | ≤ O Bη κ (cid:0) + T γ2η2/κ) = O(Bη log4( dM B ργω )/κ . (cid:1) A.6 Proof of Theorem 3.9 Theorem 3.9 (Empirical). Using full batch in Algorithm 1, and setting κ = G4/3B1/3 σ1 = G√Bη log2(1/δ)/κ log2(ndM B/ω) and with probability at least 1 with , σ2 = M√log2(1/δ)BM/α2 ω, at least one point in the output set 1 log5(ndM B/ω) M 5/3 − nε nε , Algorithm 1 is (ε, δ)-DP, xi}i { [T ] is α1-SOSP of F ∈ D √d log(1/δ) nε ( )2/3, dBGM log2(1/δ) q nε 2/3 * log6 nBM d ρω  . α1 = O  (cid:0)  Moreover, if we run Algorithm 2 with inputs ω, we can get an α2-SOSP of F with 1 − D G log(n/Gω) nε α2 = O α1 + (cid:18) (cid:1) [T ], ∈ D xi}i { , B, M, G, ρ, α1, with probability at least  + M log(ndBGM/ρω) nε√ρ √α1 . (cid:19) Proof. The privacy guarantee can be proved by composition theorems (Theorem 2.7 and Theo- rem 2.8) and Lemma 3.7. As for the utility, we know the O2 constructed in Equation (2) are first kind of σ1√d and second kind of σ2√d norm-subGaussian gradient oracle by Fact 2.3. Hence by Lemma 3.6, the utility α1 satisfies that O1 and α1 =O(σ1√d + σ2√dκ) log3(BM d/ρω) * L dBη log2(1/δ)/κ q nε + =O (cid:16) M log3(ndM B/ω) log2(1/δ)BM q nεα1 19 log5(nBM d/ρω). √dκ * (cid:17) Choosing the best κ demonstrates the bound on α1. The bound for α2 follows from the value of α1 ω, and Lemma 3.8. Combining the two items in Lemma 3.8, we know with probability at least 1 the output point x of Algorithm 2 satisfies that − F 32 log(2T /ω)G nε Hence we know x is an α2-SOSP for α2 stated in the statement. , and smin( 2F D α1 + (x)) k ≤ (x) k∇ ∇ D ≥ − √ρα1 − 32 log(2T /ω)M nε . A.7 Proof of Lemma 3.11 Lemma 3.11. Fix a point x Rd. Given a set S of m samples drawn i.i.d. from the distribution , then we know with probability at least 1 ∈ P FS(x) F P − ∇ (x) k2 ≤ O k∇ − G log(d/ω) √m ω, we have 2FS(x) 2F P (x) kop ≤ O − ∇ k∇ M log(d/ω) √m . Proof. As for any s P for norm-subGuassians (Lemma 2.4) demonstrates with probability at least 1 (x) is zero-mean nSG(G). Then the Hoeffding inequality ω/2, we have − ∇ S, ∇ ∈ F (cid:0) f (x; s) (cid:1) ^ (cid:0) (cid:1) k∇ FS(x) As for the other term, we know for any s k2 ≤ − ∇ (x) O F G log(d/ω) √m P . (cid:0) (cid:1) − 2M almost surely. Hence applying Matrix Bernstein inequality (Theorem 2.6) with , we know with probability at least 1 √mM log(d/ω) ω/2, − ∇ k∇ ∇ ∈ 2FS(x) S, E[ 2f (x; s) (x)] = 0, and 2f (x; s) 2F P − k∇ − 2F P (x) kop ≤ ∇ σ2 = 4M 2m, t = O t/m. kop ≤ ∇ (x) 2F P Applying the Union bound completes the proof. (cid:0) (cid:1) − A.8 Proof of Theorem 3.12 Theorem 3.12 (Population). Divide the dataset n/2 ⌋ ⌊ n/2 and ⌉ ⌈ max( G4/3B1/3 log1/3 d M 5/3 oracles, Algorithm 1 with the output is α1-SOSP of F P n− Bη , b2 = nα2 respectively. Setting b1 = nκ √d log(1/δ) M 5/3 )6/7( nε D1 is (ε, δ)-DP, and with probability at least 1 1/3, ( GB2/3 BM , σ1 = 1 − )4/7) in Equation (3) and using them as gradient ω, at least one point in D into two disjoint datasets G√log(1/δ) b1ε , σ2 = D1 and M√log(1/δ) b2ε D2 of size and κ = α1 = O (BGM * (cid:16)(cid:0) Moreover, if we run Algorithm 2 with inputs least 1 − ω, Algorithm 2 can output an α2-SOSP of F P n1/3 + (G1/7B3/7M 3/7)( xi}i { p [T ], ∈ with )3/7 d log(1/δ) nε D2, B, M, G, ρ, α1, with probability at log3(nBM d/ρω) (cid:17) (cid:1) . with log d)1/3 1 α2 = O α1 + (cid:18) M log(ndBGM/ρω) √ρ min(nε, n1/2) √α1 + G( log(n/Gω) nε + log(d/ω) √n . ) (cid:19) Proof. We should have all samples to be fresh to avoid dependency, and hence we need + b2 * which is satisfied by the parameter settings and Lemma 3.7. As we never reuse a sample, the privacy guarantee follows directly from the Gaussian Mechanism [DR+14]. By lemma 3.6, we have K b1 * | n/2, ≤ T | α1 log3(nBM d/ρω) =O(σ1√d + + σ2√dκ + G√log d √b1 d log(1/δ) nεκ p M √κ log d √b2 log(1/δ) ) * √dκ + BM 2 + nεα2 p 1 GBη =O( G√Bη log d √nκ + M √κ √BM log d √nα1 ). 20 Setting κ = max( G4/3B1/3 log1/3 d M 5/3 (n)− 1/3, ( GB2/3 M 5/3 )6/7( √d log(1/δ) nε )4/7), we get α1 = O (BGM log d)1/3 1 n1/3 + (G1/7B3/7M 3/7)( d log(1/δ) nε )3/7 p Then we use the other half fresh samples (cid:16)(cid:0) log3(nBM d/ρω) (cid:17) . (cid:1) D2 to find the point in the set by Algorithm 2. By ω, for some large enough − Lemma 3.8 and Lemma 3.11, we know with probability at least 1 constant C > 0, the output point x of Algorithm 2 satisfies that F P k∇ (x) k2 ≤ α1 + G( 32 log(2T /ω) nε + C log(dn/ω) √n ), smin( ∇ 2F P (x)) √ρα1 − M ( ≥ − 32 log(2T /ω) nε + C log(dn/ω) √n ) Hence we know x is an α2-SOSP for α2 stated in the statement. The privacy guarantee follows from Basic composition and Lemma 3.8. B Omitted proof of Section 4 B.1 Proof of Lemma 4.5 Lemma 4.5 (Generalization error bound). Let π exp( − β(F D (x) + μ x 2 k 2 2)). Then we have k D ∝ E ,x ∼ D (x) [F P F D − πD (x)] ≤ O( G2 exp(βGD) nμ ). Proof. We know how to bound the KL divergence by LSI: KL(π , π D D ′) := ≤ ≤ log dπ dπ dπ D ′ D D Z CLSI 2 ∇ log E πD (cid:13) (cid:13) 2CLSIG2β2/n2. (cid:13) (cid:13) dπ dπ D ′ D 2 2 (cid:13) (cid:13) (cid:13) (cid:13) LSI can lead to Talagrand transportation inequality [Theorem 1 in [OV00]], i.e., W2(π , π D D ′) . CLSI * KL(π , π D D ′) = CLSIGβ/n. The generalization error is bounded by O(CLSIG2β/n). Using Holley-Stroock perturbation, we ′ can be bounded by and hence the W2 distance between π D ). The statement follows the Lipschitzness constant and Lemma 4.4. exp(βGD) βμ and π p ≤ D D ) know CLSI(π O( G exp(βGD) nμ B.2 Proof of Theorem 4.6 Theorem 4.6 (Risk bound). We are given ε, δ with β = O( 2 (0, 1/2). Sampling from exp( 2)) k D2β is (ε, δ)-DP. The empirical risk and population risk are bounded ), μ = d (x)+ μ x 2 k β(F − ∈ D ε log(nd) GD√log(1/δ)) log log(n)√log(1/δ) ε log(nd) ). by O(GD d * β(F Proof. Denote π(x) Plugging in the parameters and applying Theorem 4.1, we get 2 2)). By Lemma 4.2, we know CLSI(π) k x 2 k exp( ∝ − D (x)+ μ 1 βμ * ≤ exp(βGD). 2Gβ n * s exp(βGD) βμ p 3 log(1/δ) = O(1) GDβ n√d exp(βGD) log(1/δ) 1 ≤ p 21 and hence prove the privacy guarantee. As for the empirical risk bound, by Lemma 4.3, we know E π x ∼ (F D (x) + μ 2 k x 2 2) k − min x∗ ∈K (F D (x∗) + μ 2 k x∗ 2 2) . k d log(βGD/d) β , and we know E π x ∼ (x) F D − min x∗ ∈K F D (x∗) . d log(βGD/d) β + μD2. Replacing the value of β achieves the empirical risk bound. As for the population risk, we have E x π ∼ = E x π ∼ E π x (x) F P − (x) [F P − [F (x) P F F (y∗) min y∗ ∈K (x)] + E[F D (x)] + E[F D F D F D (x∗)] + E[ min ∈D x∗ (x∗) F D − min y∗ ∈K F P (y∗)] (x) − (x) min x∗ ∈K min x∗ ∈K F (x∗)]. P D ∼ − ≤ − O( G2 exp(βGD) We can bound Ex an arbitrarily small constant c > 0. Hence the empirical risk is dominated term compared to Ex (x)], and we complete the proof. ) by Lemma 4.5 for O( GDε log(n) n1−cd√log(1/δ) π[F P (x)] (x) (x) ≤ ≤ − nμ F F ∼ D D ) π[F P ∼ − D B.3 Implementation We rewrite them below: Let is the expectation of a family of G-Lipschitz functions. F (x) := F (x) + r(x) where r(x) is some regularizer, and F = Ei I fi ∈ b 1: Input: Function 2: for t 3: Algorithm 3 AlternateSample, [LST21] F , initial point x0 ∼ b (0, Id) 1 + √ηζ where ζ ∼ N 1 2 2) ytk x F (x) exp( 2η k − [T ] do ∈ yt ← xt Sample xt ← − − − 4: 5: end for 6: Output: xT b π0, step size η Theorem B.1 (Guarantee of Algorithm 3, [CCSW22]). Let exp( D, and R, and π F : F ) satisfies LSI with constant CLSI. Then set η K ⊂ Rd be a convex set of diameter K → ∝ − 0, we have ≥ b b Rq(πt, π) Rq(π0, π) (1 + η/CLSI)2t/q , ≤ where Rq(π′, π) is the q-th order of Renyi divergence between π′ and π. To get a sample from exp( − whose guarantee is stated below: F (x) 1 x 2η k − − 2 2), we use the rejection sampler from [GLL22], ytk b 1(1/δinner) and the inner Lemma B.2 (Rejection Sampler, [GLL22]). If the step size η . G− (0, 1/2), there is an algorithm that can return a random point x that has δinner accuracy δinner ∈ 2 2). Moreover, the total variation distance to the distribution proportional to exp( k algorithm accesses O(1) different fi function values and O(1) samples from the density proportional to exp( 1 x 2η k 2 log− F (x) r(x) − − − b y y − 1 x 2η k − − 2 2). k 22 Combining Theorem 4.6, Theorem B.1 and Lemma B.2, we can get the following implementation of the exponential mechanism for non-smooth functions. Theorem 4.7 (Implementation, risk bound). For ε, δ sampler that can achieve the empirical and population risks O(GD in expectation, the sampler takes ̃O Gaussian random variables restricted to the convex set nε3 log3(d) (cid:16) log(1/δ)/(GD) in total. (cid:17) p K ∈ (0, 1/2), there is an (ε, 2δ)-DP efficient log log(n)√log(1/δ) ε log(nd) ). Moreover, d * function values query and some β(F Proof. By Theorem 4.6, it suffices to get a good sample from π with density proportional to exp( ) , D2β . Set q = 1, which gives that Rq( * * 2 2), then k is the KL-divergence. Suppose we let x0 is drawn from density proportional to exp( the KL divergence between π0 and π is bounded by exp(qβGD). 2 2)) where β = O( k ε log(nd) GD√log(1/δ)) (x) + μ x 2 k ), μ = d x k β 2 μ − − D Now let π(i) T be the distribution we get over xT from Algorithm 3 if we use an exact sampler i iterations. The output of 1(2T /δ). for i iterations, then the sampler of Lemma B.2 for the remaining T Algorithm 3 that we actually get is π(0) Setting T . Note that CLSI ≤ − D2n, and η . β− 2 log− 2G− T = O CLSI η (cid:18) log(exp(qβGD)/δ2) = ̃O (cid:19) nε3 log3(d) log(1/δ) GD p ! we get δinner = δ/2T in Lemma B.2 and that R1(π(T ) distance between π(T ) processing inequality, the total variation distance between π(i) Then by triangle inequality the total variation distance between π(0) δ2/8. This implies the total variation and π is at most δ/2 by Pinsker's inequality. Furthermore, by the post- is at most δ/2T for all i. T and π(i+1) T , π) T and π is at most δ. ≤ T T B.4 Proof of Theorem 4.8 Theorem 4.8. There exists an ε-DP differentially private algorithm that achieves a population risk of O d log(εn/d)/(εn) + d log(εn/d)/(√n) GD . (cid:16) (cid:16) p (cid:17)(cid:17) Proof. We pick a maximal packing P of O((D/r)d) points, such that every point in is distance at most r from some point in P . By G-Lipschitzness, the risk of any point in P for the DP-ERM/SCO are at most Gr plus the risk of the same point for DP-ERM/SCO over P . The problems over . Next, note that exponential mechanism over P gives a DP-ERM risk bound of O the empirical loss of each point in P is the average of n random variables in [0, GD] wlog. So, the expected maximum difference between the empirical and population loss of any point in P is GD εn log | (cid:1) P | K K (cid:0) GD√log √n P | | O (cid:18) (cid:19) . Putting it all together we get a DP-SCO expected risk bound of: O Gr + GD d log(D/r) εn + d log(D/r) √n . !! p This is approximately minimized by setting r = Dd/εn. This gives a bound of: O GD d log(εn/d) εn + d log(εn/d) √n p . !! 23 C Extended related work First order stationary points. Progress towards privately finding a first-order stationary point is measured in (i) the norm of the empirical gradient at the solution x, i.e., , and (ii) (x) k the norm of the population gradient, i.e., . We summarize compare these first-order (x) k guarantees achieved by Algorithm 1 with previous algorithms in Table 2: k∇ k∇ F F D P References [WYX17] [WX19] [WJEG19] [ZCH+20] Empirical d1/4 √n d1/4 √n ( √d n )2/3 d1/4 √n [TC22] 1 √n + [ABG+22] (cid:16) √d n 2/3 √d n 2/3 (cid:17) Population N/A √d √n N/A d1/4 √n N/A n1/3 + ( √d 1 n )1/2 (cid:17) Table 2: Previous work in finding first-order stationary points. We omit logarithmic terms and dependencies on other parameters such as Lipschitz constant. "N/A" means we do not find an explicit result in the work. (cid:16) Second order stationary points. We say a point x is a Second-Order Stationary Point (SOSP), or a local minimum of a twice differentiable function g if 0. Exact second-order stationary points can be extremely challenging to find [GHJY15]. Instead, it is common to measure the progress in terms of how well the solution approximates an SOSP. k2 = 0 and smin( ∇ 2g(x)) g(x) k∇ ≥ Definition C.1 (approximate-SOSP, [AAZB+17]). We say x point (α-SOSP) for ρ-Hessian Lipschitz function g, if ∈ Rd is an α-second order stationary g(x) k2 ≤ α k∇ smin( ∇ 2g(x)) ≥ − √ρα. ^ References Empirical [WCX19] d1/4 √n ( d n )4/7 ( d n )1/2 ( √d n )2/3 Population N/A N/A N/A n1/3 + ( √d 1 n )3/7 [WX20] [GW23] Ours Table 3: Summary of previous results in finding α-SOSP, where α is demonstrated in the Table. Omit the logarithmic terms and the dependencies on other parameters like Lipschitz constant. "N/A" means we do not find an explicit result in the work. Existing works in finding approximate SOSP privately give guarantees for the empirical function . We improve upon the state-of-the-art result and give the first guarantee for the population F function F D P , which is summarized in Table 3. 24
http://arxiv.org/abs/2302.09694v1
2023-02-19T23:37:17
2023-02-19T23:37:17
Disentangled Representation for Causal Mediation Analysis
Estimating direct and indirect causal effects from observational data is crucial to understanding the causal mechanisms and predicting the behaviour under different interventions. Causal mediation analysis is a method that is often used to reveal direct and indirect effects. Deep learning shows promise in mediation analysis, but the current methods only assume latent confounders that affect treatment, mediator and outcome simultaneously, and fail to identify different types of latent confounders (e.g., confounders that only affect the mediator or outcome). Furthermore, current methods are based on the sequential ignorability assumption, which is not feasible for dealing with multiple types of latent confounders. This work aims to circumvent the sequential ignorability assumption and applies the piecemeal deconfounding assumption as an alternative. We propose the Disentangled Mediation Analysis Variational AutoEncoder (DMAVAE), which disentangles the representations of latent confounders into three types to accurately estimate the natural direct effect, natural indirect effect and total effect. Experimental results show that the proposed method outperforms existing methods and has strong generalisation ability. We further apply the method to a real-world dataset to show its potential application.
[ "Ziqi Xu", "Debo Cheng", "Jiuyong Li", "Jixue Liu", "Lin Liu", "Ke Wang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09694v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09694v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "stat.ME" ]
Disentangled Representation for Causal Mediation Analysis Ziqi Xu 1, Debo Cheng 2,1,*, Jiuyong Li 1,*, Jixue Liu 1, Lin Liu 1, Ke Wang 3 1 University of South Australia 2 Guangxi Normal University 3 Simon Fraser University 1 [email protected], {Jiuyong.li, Jixue.Liu, Lin.Liu}@unisa.edu.au 2 [email protected] 3 [email protected] 3 2 0 2 b e F 9 1 ] G L . s c [ 1 v 4 9 6 9 0 . 2 0 3 2 : v i X r a Abstract Estimating direct and indirect causal effects from observa- tional data is crucial to understanding the causal mechanisms and predicting the behaviour under different interventions. Causal mediation analysis is a method that is often used to re- veal direct and indirect effects. Deep learning shows promise in mediation analysis, but the current methods only assume latent confounders that affect treatment, mediator and out- come simultaneously, and fail to identify different types of latent confounders (e.g., confounders that only affect the me- diator or outcome). Furthermore, current methods are based on the sequential ignorability assumption, which is not fea- sible for dealing with multiple types of latent confounders. This work aims to circumvent the sequential ignorability as- sumption and applies the piecemeal deconfounding assump- tion as an alternative. We propose the Disentangled Mediation Analysis Variational AutoEncoder (DMAVAE), which disen- tangles the representations of latent confounders into three types to accurately estimate the natural direct effect, natural indirect effect and total effect. Experimental results show that the proposed method outperforms existing methods and has strong generalisation ability. We further apply the method to a real-world dataset to show its potential application. 1 Introduction Causal mediation analysis (CMA) aims to reveal how other attributes mediate the causal effect of a treatment on the outcome. It can help understand how the mechanism works and enable outcome prediction under various interventions in practice. In recent years, CMA has been widely used in operational decision (Yin and Hong 2019) and policy evalu- ation (Cheng, Guo, and Liu 2022). For example, in the UC Berkeley admission process, it was found that female ap- plicants were more likely to be rejected than male appli- cants (Bickel, Hammel, and O'Connell 1975). However, in- vestigators through CMA understood that the choice of dis- ciplines, as a mediator was affected by gender and affected the acceptance rate. There was in fact no discrimination be- cause female applicants preferred to apply for admission into disciplines with a higher level of competition and lower acceptance rates. *Corresponding author. Copyright © 2023, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. (a) (b) Figure 1: (a) A causal graph for the UC Berkeley admission process example. T denotes gender (treatment), M denotes discipline choice (mediator), and Y denotes acceptance rate (outcome). (b) Causal graph for CMAVAE (Cheng, Guo, and Liu 2022). T denotes treatment, M denotes mediator, Y de- notes outcome, X denotes proxy attributes and Z denotes the representation of latent confounders which affect T , M and Y simultaneously. The above example illustrates three essential ingredients of CMA, the natural direct effect (NDE), the natural indi- rect effect (NIE) and the total effect (TE), respectively. We use Figure 1a to illustrate the above example in terms of the three types of effects. Here, TE measures the expected in- crease in the acceptance rate as gender changes from male to female; NDE measures the expected increase in acceptance rate as gender changes from male to female while setting the discipline choice to whatever value it would have attained prior to the change (i.e., under gender being male); NIE mea- sures the expected increase in acceptance rate when gender is male, and discipline choice changes to whatever value it would have attained under gender being female (Pearl 2014). To be fair for all applicants, the NDE should be zero since gender should not directly affect the acceptance rate, while the NIE is allowed to be non-zero if discipline choice is considered a non-sensitive attribute. The major challenge in CMA is latent confounders. In the above example, an applicant's economic status affects his or her discipline choice and acceptance rate, and without measuring it, we cannot estimate NDE, NIE or TE. Fortu- nately, leveraging the strength of representation learning, re- searchers are able to learn the representations of latent con- founders from other attributes. For example, the representa- tion of the applicants' economic status can be learned from the collected information of their addresses and parental and Pischke 2009). Our proposed disentanglement scheme in Figure 2 follows the piecemeal deconfounding assump- tion (Pearl 2014), which is a more relaxed assumption than sequential ignorability. We propose a novel method, namely Disentangled Mediation Analysis Variational AutoEncoder (DMAVAE) to learn the disentangled representations of the three types of latent confounders as illustrated in Figure 2 by using a VAE-based approach, for estimating NDE, NIE and TE. We make the following contributions in this paper: • We study a general case of CMA under the piecemeal deconfounding assumption, where there are three types of latent confounders. • We propose a novel CMA method, DMAVAE, to learn the disentangled representations of the three types of la- tent confounders from proxy attributes to more accu- rately estimate NDE, NIE and TE. • We evaluate the effectiveness of the DMAVAE method on synthetic datasets. Experiments show that DMAVAE outperforms existing CMA methods and has a strong generalisation ability. Furthermore, we conduct a case study to show the application scenarios of DMAVAE. The rest of this paper is organised as follows. In Section 2, we discuss background knowledge on CMA. The details of DMAVAE are shown in Section 3. In Section 4, we dis- cuss the experiment results. In Section 5, we discuss related works. Finally, we conclude the paper in Section 6. 2 Background We use upper case letters to represent attributes and lower case letters to represent the values of the attributes. We fol- low the work in (Pearl 2014) to introduce the notations, def- initions and assumptions. 2.1 Notations and Definitions Let Ti represent the treatment status of the i-th individual, with Ti = 1 indicating the i-th individual receiving the treat- ment and Ti = 0 otherwise. We use Mi to represent the mediator for the i-th individual, Mi(t) for the value of the mediator when Ti is fixed to t, where t ∈ {0, 1}. Similarly, Yi is used to represent the outcome of the i-th individual and Yi(t, m) for the outcome when Ti = t and Mi = m. Fi- nally, we use Xi to denote the set of proxy attributes. When the context is clear we omit the subscript i. Definition 1 (Total Effect (Pearl 2014)). TE = E[Y (1, M (1)) − Y (0, M (0))]. (1) As stated in (Pearl 2014), TE is the measure of "the expected increase in the outcome Y when the treatment changes from T = 0 to T = 1, while the mediator is al- lowed to track the change in T ." Definition 2 (Natural Direct Effect (Pearl 2014)). NDE = E[Y (1, M (0)) − Y (0, M (0))]. (2) Based on (Pearl 2014), NDE is the measure of "the ex- pected increase in the outcome Y that the treatment changes from T = 0 to T = 1, while setting the mediator to what- ever value it would have attained (for each individual) prior to the change, i.e., under T = 0." Figure 2: The causal graph for the proposed Disentangled Mediation Analysis Variational AutoEncoder (DMAVAE). T is the treatment, M is the mediator, Y is the outcome and X represents the set of the proxy attributes. ZT M , ZT Y and ZM Y denote the disentangled representations of the three types of latent confounders. information. Deep learning has made significant progress in representation learning in the past decade. For exam- ple, Kingma and Welling (2014) proposed Variational Au- toEncoder (VAE) to learn representations with neural net- works. Louizos et al. (2017) first combined causal infer- ence and VAE and proposed CEVAE. CEVAE can learn the representation of latent confounders and inference in- dividual treatment effect (ITE) and average treatment ef- fect (ATE). Zhang, Liu, and Li (2021) proposed TEDVAE, which disentangles latent representations into three parts to achieve more accurate estimation of causal effects than CE- VAE does. However, both CEVAE and TEDVAE do not con- sider mediator and cannot estimate NDE or NIE. Cheng, Guo, and Liu (2022) proposed CMAVAE, which considers mediator and the estimation of NDE and NIE. It is the first work that combines deep learning and CMA, and CMAVAE assumes that the latent confounders affect treatment, mediator and outcome simultaneously as shown in Figure 1b. Their work extended sequential ignorabil- ity (Imai, Keele, and Tingley 2010) to representation learn- ing and used proxy attributes X to learn the representation of latent confounders. However, CMAVAE has limited gen- eralisation ability since it does not consider different types of confounders, which, however, are often seen in practice. For example, the demand of the job market can be consid- ered as a confounder that affects M (discipline choice) and Y (acceptance rate) in Figure 1a, because the popularity of a job area affects students' choice of disciplines, the univer- sity may need to limit the acceptance rate due to the lim- itation of teaching resources. Furthermore, this confounder does not affect an applicant's gender. CMAVAE cannot han- dle this case since it assumes a confounder that affects treat- ment (gender in this example), mediator and outcome simul- taneously. In this paper, we consider a general case with three types of latent confounders as shown in Figure 2, where ZT M is the representation of the latent confounders that affect treatment and mediator; ZT Y is the representation of the latent confounders that affect treatment and outcome; and ZM Y is the representation of the latent confounders that affect mediator and outcome. We can access the observed proxy attributes X and assume that the proxy attributes and latent confounders are inherently correlated (Angrist Definition 3 (Natural Indirect Effect (Pearl 2014)). NIE = E[Y (0, M (1)) − Y (0, M (0))]. (3) As explained in (Pearl 2014), NIE is the measure of "the expected increase in the outcome Y when the treatment is held constant, at T = 0, and M changes to whatever value it would have attained (for each individual) under T = 1." Additionally, TE can be decomposed as follows: TE = NDE − NIEr, (4) where NIEr denotes the reverse version of NIE, as follows: NIEr = E[Y (1, M (0)) − Y (1, M (1))]. (5) This implies that TE is identifiable whenever NDE and NIEr are identifiable (Pearl 2014). Note that NDE and NIE are defined in counterfactual expressions. To allow these counterfactual expressions to be estimated, Pearl (2014) pro- posed three steps for the counterfactual derivation of NDE and NIE: First, we find an adjustment set under suitable assumptions; Second, we reduce all counterfactuals to do- expressions by using the adjustment set found; Finally, we identify the do-expressions from the data. 2.2 Assumptions Assumption 1 (Sequential Ignorability (Imai, Keele, and Tingley 2010)). There exists a set W of measured attributes such that: 1. W and T deconfound the mediator-outcome relation- ship, keeping T fixed: [Y (t(cid:48), m)⊥⊥M (t)|T = t, W = w]; 2. W deconfounds the treatment-{mediator, outcome} rela- tionship: [T ⊥⊥ (Y (t(cid:48), m), M (t))|W = w], where 0 < p(M = m|do(T = t, W = w)) < 1, 0 < p(Y = y|do(T = t, M = m, W = w)) < 1, and t, t(cid:48) ∈ {0, 1}. Pearl (2014) proposed the following assumption, which is more relaxed than Assumption 1. Assumption 2 (Piecemeal Deconfounding (Pearl 2014)). There exists three sets of measured attributes W = {W1, W2, W3} such that: 1. No member of W1 is affected by the treatment; 2. W1 deconfounds the M → Y relationship (holding T constant); 3. {W2, W1} deconfounds the T → M relationship; 4. {W3, W1} deconfounds the {T, M } → Y relationship. We note that Assumption 2 follows the idea of divide-and- conquer, and allows the use of different sets of attributes to deconfound the mediator and outcome processes separately, rather than having to use the same set of deconfounding at- tributes as required by Assumption 1 (Pearl 2014). 3 Method 3.1 CMA via Representations As mentioned above, the piecemeal deconfounding assump- tion is more relaxed than the sequential ignorability assump- tion. Our goal is to extend the piecemeal deconfounding as- sumption to disentangled representation learning. For this, we propose the causal graph for the disentanglement as shown in Figure 2, and introduce the following assumption for the disentangled representations. Assumption 3 (Assumption for DMAVAE). 1. There exist three types of confounders, i.e., ZT M , ZT Y and ZM Y as shown in Figure 2. 2. There exist proxy attributes X that approximate ZT M , ZT Y and ZM Y . 3. p(T, M, Y, X, ZT M , ZT Y , ZM Y ) can be recovered from all observed attributes (T, M, Y, X). For our proposed disentanglement, we have the following theorem. Theorem 1. The disentangled representation ZM Y follow- ing Figure 2 satisfies Conditions 1 and 2 of Assumption 2. Proof. ZM Y is a non-descendant of T as shown in Figure 2, hence Condition 1 of Assumption 2 is satisfied (considering ZM Y as W1). All the back-door paths between M and Y when holding T constant are blocked by ZM Y , i.e., M ← ZM Y → Y is blocked by ZM Y , M ← ZM Y → X ← ZT Y → Y , M ← ZT M → X ← ZT Y → Y and M ← ZT M → X ← ZM Y → Y are all blocked by ∅ since X is a collider. Hence, Condition 2 of Assumption 2 is also satisfied when considering ZM Y as W1. Based on Theorem 1 and Equation 13 in (Pearl 2014), the counterfactual expression of NDE (Equation 2) and NIEr (Equation 5) can be reduced to do-expressions as follows: NDE = [E(Y |do(T = 1, M = m), ZM Y = zM Y ) − E(Y |do(T = 0, M = m), ZM Y = zM Y )] × p(M = m|do(T = 0), ZM Y = zM Y ) × p(ZM Y = zM Y ), NIEr = E(Y |do(T = 1, M = m), ZM Y = zM Y ) × [p(M = m|do(T = 0), ZM Y = zM Y ) − p(M = m|do(T = 1), ZM Y = zM Y )] × p(ZM Y = zM Y ), (6) (7) Following Pearl's back-door adjustment formula (Pearl 2009a,b), we propose the following theorem which is used to reduce the do-expressions to probability expressions. Theorem 2. If we can estimate p(T, M, Y, X, ZT M , ZT Y , ZM Y ) under the causal graph in Figure 2, NDE and NIEr can be identified from data as follows: NDE = [E(Y |T = 1, M = m, ZM Y = zM Y , ZT Y = zT Y ) − E(Y |T = 0, M = m, ZM Y = zM Y , ZT Y = zT Y )] × p(M = m|T = 0, ZM Y = zM Y , ZT M = zT M ) × p(ZM Y = zM Y , ZT M = zT M , ZT Y = zT Y ), NIEr = E(Y |T = 1, M = m, ZM Y = zM Y , ZT Y = zT Y ) × [p(M = m|T = 0, ZM Y = zM Y , ZT M = zT M ) − p(M = m|T = 1, ZM Y = zM Y , ZT M = zT M )] × p(ZM Y = zM Y , ZT M = zT M , ZT Y = zT Y ). (8) (9) Proof. We prove that Equations 6 and 7 can be identified, i.e., the do-expressions can be converted to the do-free ex- pressions in Equations 8 and 9, respectively. For this, we prove that p(M = m|do(T = 0), ZM Y = zM Y ) and Figure 3: The architecture of Disentangled Mediation Analysis Variational AutoEncoder (DMAVAE). p(Y = y|do(T = 0, M = m), ZM Y = zM Y ) are identi- fiable. The case for T = 1 is identical and the expectation expressions with the do-operators are identifiable when the corresponding probability expressions are identifiable. Once NDE and NIEr are identified, TE is calculated as shown in Equation 4. p(M = m|do(T = 0), ZM Y = zM Y ) is identifiable by adjusting ZT M , since all the back-door paths between T and M when conditioning on ZM Y are blocked by ZT M , i.e., T ← ZT M → M is blocked by ZT M , T ← ZT M → X ← ZT Y → Y ← M , T ← ZT Y → X ← ZT M → M and T ← ZT Y → Y ← M are blocked by ∅ since X or Y is a collider. Hence, p(M = m|do(T = 0), ZM Y = zM Y ) = p(M = m|T = 0, ZM Y = zM Y , ZT M = zT M ). p(Y = y|do(T = 0, M = m), ZM Y = zM Y ) is iden- tifiable by adjusting ZT Y , since all the back-door paths between {T, M } and Y when conditioning on ZM Y are blocked by ZT Y , i.e., T ← ZT Y → Y is blocked by ZT Y , T ← ZT M → X ← ZT Y → Y and M ← ZT M → X ← ZT Y → Y are blocked by ∅ since X is a collider. Hence, p(Y = y|do(T = 0, M = m), ZM Y = zM Y ) = p(Y |T = 0, M = m, ZM Y = zM Y , ZT Y = zT Y ). 3.2 Learning Disentangled Representations In the previous discussion, we have assumed that X con- tains (or captures) the information of the latent confounders, which can be disentangled into three types, i.e., ZT M , ZT Y and ZM Y . With these representations, we can estimate NDE and NIEr by Equations 8 and 9, respectively. To learn these representations, we propose DMAVAE based on Variational Autoencoder (VAE) (Kingma and Welling 2014), which uses variational inference to learn rep- resentations. DMAVAE parameterises the causal graph in Figure 2 as a model with neural network functions con- necting the attributes of interest. The objective function of DMAVAE is the reconstruction error of the observed (X, T, M, Y ) and the inferred ( ˆX, ˆT , ˆM , ˆY ). The architec- ture of DMAVAE is shown in Figure 3. We note that Y is not shown in Figure 3 since Y is not used as an input to the generative model. In the inference model, we design three separate encoders q(ZT M |X), q(ZM Y |X) and q(ZT Y |X) that serve as vari- ational posteriors over the three representations. The varia- tional approximations of the posteriors are defined as: T M j ); j=1 N (μ = ˆμT M j , σ2 = ˆσ2 q(ZT M |X) = (cid:81)DZT M q(ZM Y |X) = (cid:81)DZM Y j=1 N (μ = ˆμM Y j , σ2 = ˆσ2 M Y j ); j=1 N (μ = ˆμT Y j , σ2 = ˆσ2 T M , ˆσ2 q(ZT Y |X) = (cid:81)DZT Y T Y j ), where ˆμT M , ˆμM Y , ˆμT Y and ˆσ2 T Y are the means and variances of the Gaussian distributions parameterised by neural networks. DZT M , DZM Y and DZT Y are the dimen- sions of ZT M , ZT M and ZT Y , respectively. M Y , ˆσ2 The generative models for T and X are defined as: p(T |ZT M , ZT Y ) = Bern(σ(g(ZT M , ZT Y ))); p(X|ZT M , ZT Y , ZM Y ) = (cid:81)DX where g(*) is a neural network parameterised by its own pa- rameters, σ(*) is the logistic function and DX is the dimen- sion of X. j=1 p(Xj|ZT M , ZT Y , ZM Y ), Specifically, the generative models for M and Y vary de- pending on the types of the attribute values. For continuous M and Y , the models are defined as: p(M |T, ZT M , ZM Y ) = N (μ = ˆμM , σ2 = ˆσ2 M ); ˆμM = (T g(ZT M , ZM Y ) + (1 − T )g(ZT M , ZM Y )); ˆσ2 M = (T g(ZT M , ZM Y ) + (1 − T )g(ZT M , ZM Y )), p(Y |T, M, ZT Y , ZM Y ) = N (μ = ˆμY , σ2 = ˆσ2 ˆμY = (T g(M, ZT Y , ZM Y ) + (1 − T )g(M, ZT Y , ZM Y )); ˆσ2 Y = (T g(M, ZT M , ZM Y ) + (1 − T )g(M, ZT M , ZM Y )), For binary M and Y the models are defined as: Y ); p(M |T, ZT M , ZM Y ) = Bern(σ(g(T, ZT M , ZM Y ))); p(Y |T, M, ZT Y , ZM Y ) = Bern(σ(g(T, M, ZT Y , ZM Y ))). Following the same setting in (Kingma and Welling 2014), we choose Gaussian distribution as the prior distri- butions of the representations, which are defined as: p(ZT M ) = (cid:81)DZT M j=1 N (zT M j |0, 1); p(ZM Y ) = (cid:81)DZM Y j=1 N (zM Y j |0, 1); p(ZT Y ) = (cid:81)DZT Y j=1 N (zT Y j |0, 1). We can now form the evidence lower bound (ELBO) for the above inference and generative networks: M = Eq[log p(X|ZT M , ZT Y , ZM Y )] − DKL[q(ZT M |X)||p(ZT M )] − DKL[q(ZM Y |X)||p(ZM Y )] − DKL[q(ZT Y |X)||p(ZT Y )], (10) where Eq stands for Eq(ZT M |X)q(ZM Y |X)q(ZT Y |X). The first term denotes the reconstruction loss between X and ˆX ; each of the other terms is used to calculate the KL diver- gence between the prior knowledge and the learned repre- sentations. Following the works in (Louizos et al. 2017; Zhang, Liu, and Li 2021), we design three auxiliary predictors to encour- age the disentanglement of the representations. To optimise the parameters in the auxiliary predictors, we add them to the loss function. Since maximising M is equal to minimis- ing −M, the final loss function of DMAVAE is defined as: LDMAVAE = − M + logq(T |ZT M , ZT Y ) + logq(M |T, ZTM, ZMY) + logq(Y |T, M, ZT Y , ZM Y ). (11) 4 Experiments Evaluating estimated causal effects has always been a huge challenge because we have no access to ground truth in prac- tice (Guo et al. 2020). Evaluating the results of CMA is con- sidered a more difficult task, as it requires accurate estima- tion of causal effects with respect to different paths. There- fore the evaluation of causal effect estimation and CMA mainly relies on simulated datasets (Huber, Lechner, and Mellace 2016). Following the works in (Louizos et al. 2017; Cheng, Guo, and Liu 2022), we construct simulated datasets to evaluate the performance of DMAVAE and compare it with the baseline methods. We also evaluate the generali- sation ability of DMAVAE. Finally, we apply DMAVAE to a real-world dataset and verify its usability. The code is avail- able at https://github.com/IRON13/DMAVAE. 4.1 Experiment Setup Methods for Comparison We compare DMAVAE with traditional and deep learning-based CMA methods. For tra- ditional CMA methods, we select the commonly used para- metric methods LSEM (Baron and Kenny 1986), LSEM- I (Imai, Keele, and Tingley 2010), NEW-I, NEW-W (Lange, Vansteelandt, and Bekaert 2012), and semi-parametric method IPW (Robins, Rotnitzky, and Zhao 1994; Huber 2014). For deep learning-based CMA methods, we compare our method with CMAVAE (Cheng, Guo, and Liu 2022), which is the only VAE-based CMA method. Since there are no other deep learning-based CMA methods, we select two well-known causal effect estimators (CEVAE (Louizos et al. 2017) and TEDVAE (Zhang, Liu, and Li 2021)) as baselines for TE estimation only. Evaluation Criterion For evaluating the performance of DMAVAE and the baselines, we use the estimation bias |( ˆβ − β)/β| × 100% as the metric, where ˆβ is the estimated results and β is the ground truth. Implementation Details We use PyTorch (Paszke et al. 2019) and Pyro (Bingham et al. 2018) to implement DMAVAE. For LSME and LSME-I, we use their implemen- tations in R package "mediation" (Tingley et al. 2014). For NEW-I and NEW-W, we use their implementations in the R package "Medflex" (Steen et al. 2017). For IPW, we use the implementation in the R package "causal-weight" (Bodory and Huber 2018). CEVAE1 and TEDVAE2 are open-source on GitHub, and CMAVAE is implemented in Pyro and Py- Torch by us. 4.2 Performance Evaluation We firstly generate synthetic datasets based on the causal graph in Figure 2 (hence we know the ground truth) to eval- uate the performance of our methods, in comparison with the baselines. We follow the same procedure in (Louizos et al. 2017; Cheng, Guo, and Liu 2022) to generate synthetic datasets with a variety range of sample sizes (denoted as N): 2k, 3k, 4k, 5k, 6k, 7k, 8k, 9k and 10k. To avoid the bias brought by data generation, we repeat- edly generate 30 datasets for each sample size. The results for the mean and the standard deviation of estimation bias for NDE, NIEr and TE are shown in Table 1. Results DMAVAE achieves the lowest estimation bias in both NDE and NIEr compared with the baseline methods as shown in Tables 1a and 1b. We note that DMAVAE per- forms clearly better than CMAVAE under the current data generation mechanism. A possible explanation is that since there are three types of latent confounders, but CMAVAE only learns one type of representation. As we mentioned above, different adjustment sets are needed for different esti- mation tasks, so only considering one type of representation can lead to a relatively large bias in estimating NDE and NIEr in this case. In Table 1c, LSEM, LSEM-I, CMAVAE and DMAVAE show better performance for estimating TE compared with the other baseline methods. With the increase in sample size, CMAVAE shows lower estimation bias than DMAVAE. The reason could be that estimating TE requires the represen- tation of all confounders, as DMAVAE disentangles three types of representations, it may produce more cumulative errors compared to CMAVAE, which only assumes one type of latent confounders. 4.3 Evaluation on Generalisability We also conduct experiments on multiple cases to verify the effectiveness and the generalisation ability of DMAVAE to data generated from structures with different types of latent confounders. We note that among the baseline methods used previously, only CMAVAE can achieve a similar level of es- timation bias as our methods for NDE and NIEr. Hence, we select CMAVAE as the compared model in this part of the evaluation. We have already compared DMAVAE and CMAVAE un- der the latent confounder assumption shown in Figure 2. We have seen that our proposed DMAVAE method outperforms CMAVAE in estimating NDE and NIEr and achieves simi- lar performance in estimating TE. In this section, we firstly compare DMAVAE and CMAVAE with the data generated based on the causal graph shown in Figure 1b. The results are shown in Table 2. We note that DMAVAE has a higher 1https://github.com/AMLab-Amsterdam/CEVAE 2https://github.com/WeijiaZhang24/TEDVAE 2k N 7.1 ± 1.6 LSEM 8.3 ± 1.8 LSEM-I NEW-I 10.9 ± 8.4 NEW-W 32.1 ± 12.0 IPW CMAVAE DMAVAE 7.5 ± 2.5 8.9 ± 5.0 4.2 ± 2.7 3k 7.1 ± 1.3 7.9 ± 1.3 7.8 ± 6.7 21.5 ± 8.9 7.0 ± 1.7 5.5 ± 2.3 1.7 ± 1.3 2k N 11.0 ± 3.0 LSEM 13.2 ± 3.1 LSEM-I NEW-I 11.7 ± 9.1 NEW-W 24.6 ± 9.3 58.0 ± 3.7 15.1 ± 8.7 6.4 ± 4.9 IPW CMAVAE DMAVAE 3k 10.7 ± 2.2 12.1 ± 2.3 9.5 ± 7.6 18.7 ± 5.8 57.1 ± 3.6 8.2 ± 5.0 3.9 ± 2.6 2k N 1.1 ± 0.9 LSEM 1.2 ± 0.9 LSEM-I NEW-I 10.9 ± 8.6 NEW-W 27.9 ± 11.2 14.8 ± 1.4 24.1 ± 5.6 28.3 ± 1.3 1.1 ± 0.9 1.1 ± 0.9 IPW CEVAE TEDVAE CMAVAE DMAVAE 3k 1.0 ± 0.8 1.1 ± 0.7 8.2 ± 7.0 18.8 ± 7.5 14.8 ± 1.0 27.0 ± 4.3 28.3 ± 1.3 1.0 ± 0.7 1.0 ± 0.7 4k 7.3 ± 1.2 8.1 ± 1.3 7.9 ± 6.3 22.2 ± 7.7 7.7 ± 1.4 4.4 ± 2.2 1.7 ± 1.3 (a) Estimation bias (%) for the estimated NDE. 6k 7.4 ± 0.9 8.2 ± 1.0 7.6 ± 4.5 20.7 ± 9.6 7.5 ± 1.4 3.9 ± 1.9 1.8 ± 1.1 5k 6.9 ± 1.3 7.8 ± 1.1 7.5 ± 5.5 20.3 ± 8.4 7.3 ± 1.4 3.8 ± 2.0 1.8 ± 1.4 7k 7.5 ± 0.9 8.6 ± 0.9 8.8 ± 5.9 16.8 ± 7.0 7.9 ± 1.4 4.6 ± 1.7 1.4 ± 0.8 4k 10.6 ± 2.5 12.5 ± 2.4 10.0 ± 7.0 18.3 ± 7.2 58.2 ± 2.5 6.1 ± 4.1 5.1 ± 3.5 (b) Estimation bias (%) for the estimated NIEr. 6k 11.0 ± 1.6 12.7 ± 1.8 10.5 ± 4.7 19.2 ± 6.4 57.7 ± 2.2 6.0 ± 2.9 4.2 ± 2.4 5k 10.4 ± 2.7 12.2 ± 2.5 9.0 ± 6.6 20.8 ± 7.0 57.7 ± 2.5 5.7 ± 3.5 4.8 ± 3.1 7k 10.4 ± 1.9 12.1 ± 1.9 12.1 ± 5.6 16.6 ± 5.5 57.7 ± 1.9 7.7 ± 3.7 4.5 ± 2.5 4k 1.3 ± 0.8 1.2 ± 0.7 8.6 ± 6.4 19.0 ± 7.3 14.8 ± 0.6 28.1 ± 1.1 27.9 ± 1.3 1.2 ± 0.7 1.3 ± 0.7 (c) Estimation bias (%) for the estimated TE. 6k 1.1 ± 0.6 1.2 ± 0.7 8.5 ± 4.6 18.3 ± 8.3 14.7 ± 0.7 28.1 ± 0.8 27.9 ± 1.0 1.2 ± 0.8 1.2 ± 0.7 5k 1.1 ± 0.7 1.1 ± 0.6 7.9 ± 5.9 18.5 ± 7.9 14.9 ± 0.7 28.3 ± 1.0 28.1 ± 0.9 0.9 ± 0.7 0.8 ± 0.7 7k 1.4 ± 0.6 1.5 ± 0.7 9.9 ± 5.8 15.4 ± 5.6 14.5 ± 0.7 27.8 ± 0.8 27.6 ± 0.8 1.0 ± 0.6 1.3 ± 0.9 8k 7.2 ± 1.0 8.0 ± 1.0 6.8 ± 4.5 12.9 ± 5.0 7.3 ± 1.3 4.5 ± 2.1 1.7 ± 1.3 9k 7.2 ± 0.7 8.1 ± 0.8 6.4 ± 4.2 18.6 ± 6.5 7.6 ± 1.0 4.7 ± 1.4 1.3 ± 1.0 10k 7.4 ± 0.9 8.3 ± 0.8 8.2 ± 5.2 15.6 ± 6.2 8.0 ± 0.9 5.2 ± 2.0 1.5 ± 1.1 8k 10.8 ± 1.7 12.5 ± 1.6 9.1 ± 5.4 16.5 ± 5.7 57.6 ± 1.7 9.6 ± 3.3 4.3 ± 2.1 9k 10.5 ± 1.8 12.2 ± 1.6 9.6 ± 4.1 13.5 ± 5.5 58.0 ± 2.0 9.4 ± 3.3 4.5 ± 2.3 10k 11.1 ± 1.5 13.0 ± 1.5 11.2 ± 5.1 18.7 ± 6.4 58.1 ± 1.2 9.2 ± 3.4 4.6 ± 2.3 8k 1.1 ± 0.5 1.3 ± 0.6 7.5 ± 4.8 11.6 ± 5.0 14.8 ± 0.5 27.9 ± 1.1 28.3 ± 1.0 1.1 ± 0.8 1.3 ± 0.9 9k 1.2 ± 0.5 1.2 ± 0.5 7.3 ± 4.3 14.6 ± 5.7 14.8 ± 0.5 27.5 ± 0.8 28.0 ± 0.9 0.9 ± 0.6 1.2 ± 0.8 10k 1.1 ± 0.5 1.1 ± 0.5 9.2 ± 5.2 14.9 ± 5.9 14.5 ± 0.5 27.7 ± 1.1 27.9 ± 1.0 1.1 ± 0.8 1.2 ± 0.9 Table 1: Estimation bias for the estimated NDE ,NIEr and TE on synthetic datasets. The best results are shown in boldface, and the runner-up results are underlined. estimation bias compared to the results in Table 1, while CMAVAE achieves a lower estimation bias than that in Ta- ble 1. Such results are reasonable since the data generation mechanism fully complies with the assumption of CMAVAE (i.e., there only exists one type of confounder that affects T , M and Y simultaneously). However, we find that even under this assumption, DMAVAE achieves lower estimation bias in some datasets compared to CMAVAE, which implies that DMAVAE has good generalisation ability. Furthermore, we consider multiple cases when compar- ing DMAVAE and CMAVAE in terms of their generalisabil- ity. Similar to the job market example mentioned in Sec- tion 1, the causal graph for real applications may contain one type or two types or all the three types of latent con- founders. When considering the different combinations of the three types of latent confounders, we get six cases (in- dicated in Figure 4 as Case 1 to Case 6). The datasets for each case are generated separately following the respective causal graphs. For Case 1 to Case 3, we assume only one type of latent confounders exists. For Case 4 to Case 6, we assume there exist two types of latent confounders. The re- sults for the six cases are shown in Figure 4. From the figure, we see that DMAVAE outperforms CMAVAE in all 6 cases. This indicates that DMAVAE has better generalisation abil- ity, and can deal with different cases in practice more effec- Model N 2k 3k 4k 5k 6k 7k 8k 9k 10k DMAVAE CMAVAE NDE 8.5 ± 4.8 4.6 ± 3.6 4.3 ± 2.4 4.3 ± 2.1 4.2 ± 2.0 3.6 ± 1.9 3.9 ± 1.7 4.1 ± 1.8 4.0 ± 1.9 NIEr 7.4 ± 5.5 5.4 ± 3.5 4.5 ± 3.5 4.5 ± 2.6 4.8 ± 3.5 4.9 ± 3.2 4.6 ± 2.6 4.7 ± 2.8 4.7 ± 3.0 NDE 5.2 ± 4.4 2.6 ± 2.3 2.9 ± 2.1 3.8 ± 2.2 4.3 ± 2.5 3.8 ± 2.0 3.5 ± 1.7 3.9 ± 1.8 4.0 ± 1.8 NIEr 19.9 ± 8.8 18.7 ± 9.3 9.9 ± 5.8 4.8 ± 1.0 4.8 ± 4.1 5.4 ± 3.8 4.7 ± 4.4 3.9 ± 3.9 3.8 ± 3.2 Table 2: Estimation bias (%) for the estimated NDE and NIEr with data generated based on the causal graph shown in Figure 1b. The best results are shown in boldface. tively than CMAVAE. 4.4 Case Study Adult Dataset To illustrate the potential of DMAVAE for real-world applications, we show that DMAVAE can be used for detecting discrimination. We apply DMAVAE on the real-world dataset Adult. The dataset is retrieved from the UCI repository (Dua and Graff 2017) and it contains 14 at- tributes including personal, educational and economic infor- mation for 48842 individuals. We use the sensitive attribute 1988) and epidemiology (Robins and Greenland 1992), to- gether with the formal definitions based on non-parametric structural equations provide theoretical support for media- tion analysis to be expanded from linear to nonlinear mod- els. With counterfactual thinking, defining direct and indi- rect effects requires no commitment to the distributional forms, and thus applies under functions with arbitrary non- linear interactions, and both continuous and categorical vari- ables (Pearl 2014; Rubin 2005). For example, Imai, Keele, and Tingley (2010) extended LSEM and proposed a gen- eral approach that brings the definition, identification, es- timation, and sensitivity analysis of causal mediation ef- fects closely together within a single method; Huber (2014) demonstrated that the applicability of inverse probability weighting depends on whether some confounders are them- selves influenced by the treatment or not. For more details on mediation analysis, please refer to the papers (MacKinnon, Fairchild, and Fritz 2007; VanderWeele 2016). In recent years, deep learning has demonstrated power- ful ability in fitting non-linear models, and researchers are devoted to estimating causal effects through deep learn- ing techniques. CEVAE (Louizos et al. 2017) is the first method that uses VAE to learn the representation of la- tent confounders and adjust for confounding bias using the learned representation. Cheng, Guo, and Liu (2022) used VAE-based techniques for mediation analysis and proposed CMAVAE that can learn the representation of latent con- founders to estimate direct and indirect effects under the se- quential ignorability assumption (Imai, Keele, and Tingley 2010). However, CMAVAE assumes that there is only one type of latent confounders, which is not applicable to the dif- ferent cases in practice. Our work improves CMAVAE. We extend the piecemeal deconfounding assumption to disen- tangled representation learning. The goal is to achieve more accurate estimation results and enhance the generalisation ability of the method. 6 Conclusion This work investigates an important causal mediation anal- ysis problem, i.e., how to achieve accurate estimation of NDE, NIE and TE. We use a relaxed assumption, piecemeal deconfounding rather than sequential ignorability for causal mediation analysis. We extend the piecemeal deconfound- ing assumption to representation learning in a general case with three types of latent confounders. Then, we introduce DMAVAE, a VAE-based method that can learn disentangled representations from proxy attributes for estimating NDE, NIE and TE. With extensive experiments, we show that the proposed method significantly outperforms other mediation analysis methods on synthetic datasets. We demonstrate that DMAVAE has a strong generalisation ability and can be ap- plied to different cases. Furthermore, we verify the ability of DMAVAE on a real-world application. For future work, we will apply this model to scenarios of interest in media- tion analysis to help understand mechanisms or guide policy formulation. Figure 4: Results for the six cases. The horizontal axis indi- cates sample size (N) and the vertical axis indicates estima- tion bias (%). gender as T , occupation as M , income as Y and all the other attributes as the proxy attributes X. For causality-based discrimination detection, NDE indi- cates the causal effect that the sensitive attribute directly has on the outcome and NIE refers to the causal effect through the mediator on the outcome. Hence the approach detects discrimination in a dataset by estimating NDE and NIE. There is direct discrimination when the NDE is greater than a given threshold τ , and there exists indirect discrimination when the mediator is also considered as a sensitive attribute and the NIE is greater than τ (Zhang, Wu, and Wu 2018). We obtain that NDE = 0.804 and NIE = 0.002 by apply- ing DMAVAE on the Adult dataset (τ = 0.05). The results indicate that there is significant direct discrimination against gender, while the discrimination against gender through oc- cupation is ignorable. 5 Related Work Mediation analysis has its origins in structural equation models (SEMs), and the specific methods of CMA can be traced back to path analysis (Wright 1934), which has been widely used in social sciences for decades (Baron and Kenny 1986; Bollen 1989). Under the linear models, causal ef- fects are expressed as the coefficients of structural equa- tions. These coefficients are defined, identified, and esti- mated based on the assumption of sequential ignorabil- ity and commitment to a specific distribution. Specifically, LSEM is a well-established method based on linear SEMs for mediation analysis (Baron and Kenny 1986; James, Mu- laik, and Brett 1983; Judd and Kenny 1981; MacKinnon 2012; MacKinnon and Dwyer 1993). Although LSEM is ex- tremely simple to use, the additional assumptions are often not satisfied in reality, leading to biased estimation (Huber, Lechner, and Mellace 2016; Rudolph et al. 2019). The above situation has been improved in recent decades. Counterfactual thinking in statistics (Rubin 1974; Holland 7 Acknowledgments This work has been partially supported by Australian Re- search Council (DP200101210), Natural Sciences and Engi- neering Research Council of Canada and University Presi- dents Scholarship (UPS) of University of South Australia. References Angrist, J. D.; and Pischke, J.-S. 2009. Mostly harmless econometrics: An empiricist's companion. Princeton Uni- versity Press. Baron, R. M.; and Kenny, D. A. 1986. The moderator– mediator variable distinction in social psychological re- search: Conceptual, strategic, and statistical considerations. Journal of Personality and Social Psychology, 51(6): 1173– 1182. Bickel, P. J.; Hammel, E. A.; and O'Connell, J. W. 1975. Sex bias in graduate admissions: Data from Berkeley: Measur- ing bias is harder than is usually assumed, and the evidence is sometimes contrary to expectation. Science, 187(4175): 398–404. Bingham, E.; Chen, J. P.; Jankowiak, M.; Obermeyer, F.; Pradhan, N.; Karaletsos, T.; Singh, R.; Szerlip, P.; Horsfall, P.; and Goodman, N. D. 2018. Pyro: Deep universal prob- abilistic programming. Journal of Machine Learning Re- search, 1–6. Bodory, H.; and Huber, M. 2018. The causalweight package for causal inference in R. Bollen, K. A. 1989. Structural equations with latent vari- ables, volume 210. John Wiley & Sons. Cheng, L.; Guo, R.; and Liu, H. 2022. Causal Mediation Analysis with Hidden Confounders. In The Fifteenth ACM International Conference on Web Search and Data Mining, WSDM 2022, 113–122. Dua, D.; and Graff, C. 2017. UCI Machine Learning Repos- itory. Guo, R.; Cheng, L.; Li, J.; Hahn, P. R.; and Liu, H. 2020. A survey of learning causality with data: Problems and meth- ods. ACM Computing Surveys (CSUR), 53(4): 1–37. Holland, P. W. 1988. Causal inference, path analysis and recursive structural equations models. ETS Research Report Series, 1988(1): 1–50. Huber, M. 2014. Identifying causal mechanisms (primarily) based on inverse probability weighting. Journal of Applied Econometrics, 29(6): 920–943. Huber, M.; Lechner, M.; and Mellace, G. 2016. The finite sample performance of estimators for mediation analysis un- der sequential conditional independence. Journal of Busi- ness & Economic Statistics, 34(1): 139–160. Imai, K.; Keele, L.; and Tingley, D. 2010. A general ap- proach to causal mediation analysis. Psychological Meth- ods, 15(4): 309–334. James, L. R.; Mulaik, S. A.; and Brett, J. M. 1983. Causal analysis: Assumptions, models, and data. Beverly Hills (Calif.): Sage, 1983. Judd, C. M.; and Kenny, D. A. 1981. Process analysis: Es- timating mediation in treatment evaluations. Evaluation Re- view, 5(5): 602–619. Kingma, D. P.; and Welling, M. 2014. Auto-Encoding Vari- ational Bayes. In 2nd International Conference on Learning Representations, ICLR 2014, 1–14. Lange, T.; Vansteelandt, S.; and Bekaert, M. 2012. A simple unified approach for estimating natural direct and indirect effects. American Journal of Epidemiology, 176(3): 190– 195. Louizos, C.; Shalit, U.; Mooij, J. M.; Sontag, D. A.; Zemel, R. S.; and Welling, M. 2017. Causal Effect Inference with Deep Latent-Variable Models. In Advances in Neural Infor- mation Processing Systems 30, NeurIPS 2017, 6446–6456. MacKinnon, D. P. 2012. Introduction to statistical mediation analysis. Routledge. MacKinnon, D. P.; and Dwyer, J. H. 1993. Estimating medi- ated effects in prevention studies. Evaluation Review, 17(2): 144–158. MacKinnon, D. P.; Fairchild, A. J.; and Fritz, M. S. 2007. Mediation analysis. Annual Review of Psychology, 58: 1– 22. 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. 2019. Pytorch: An imperative style, high- performance deep learning library. In Advances in Neural Information Processing Systems 32, NeurIPS 2019, 8024– 8035. Pearl, J. 2009a. Causal inference in statistics: An overview. Statistics Surveys, 3: 96–146. Pearl, J. 2009b. Causality. Cambridge University Press. Pearl, J. 2014. Interpretation and identification of causal me- diation. Psychological Methods, 19(4): 459–481. Robins, J. M.; and Greenland, S. 1992. Identifiability and exchangeability for direct and indirect effects. Epidemiol- ogy, 143–155. Robins, J. M.; Rotnitzky, A.; and Zhao, L. P. 1994. Estima- tion of regression coefficients when some regressors are not always observed. Journal of the American Statistical Asso- ciation, 89(427): 846–866. Rubin, D. B. 1974. Estimating causal effects of treatments in randomized and nonrandomized studies. Journal of Edu- cational Psychology, 66(5): 688. Rubin, D. B. 2005. Causal inference using potential out- comes: Design, modeling, decisions. Journal of the Ameri- can Statistical Association, 100(469): 322–331. Rudolph, K. E.; Goin, D. E.; Paksarian, D.; Crowder, R.; Merikangas, K. R.; and Stuart, E. A. 2019. Causal mediation analysis with observational data: considerations and illustra- tion examining mechanisms linking neighborhood poverty to adolescent substance use. American Journal of Epidemi- ology, 188(3): 598–608. Steen, J.; Loeys, T.; Moerkerke, B.; and Vansteelandt, S. 2017. Medflex: an R package for flexible mediation analysis using natural effect models. Journal of Statistical Software, 76: 1–46. Tingley, D.; Yamamoto, T.; Hirose, K.; Keele, L.; and Imai, K. 2014. Mediation: R package for causal mediation analy- sis. VanderWeele, T. J. 2016. Mediation analysis: a practitioner's guide. Annual Review of Public Health, 37: 17–32. Wright, S. 1934. The method of path coefficients. The An- nals of Mathematical Statistics, 5(3): 161–215. Yin, X.; and Hong, L. 2019. The Identification and Esti- mation of Direct and Indirect Effects in A/B Tests through Causal Mediation Analysis. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discov- ery & Data Mining, KDD 2019, 2989–2999. Zhang, L.; Wu, Y.; and Wu, X. 2018. Causal modeling-based discrimination discovery and removal: criteria, bounds, and algorithms. IEEE Transactions on Knowledge and Data En- gineering, 31(11): 2035–2050. Zhang, W.; Liu, L.; and Li, J. 2021. Treatment Effect In Thirty- Estimation with Disentangled Latent Factors. Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, 10923–10930.
http://arxiv.org/abs/2302.09693v2
2023-10-01T02:19:50
2023-02-19T23:27:12
mSAM: Micro-Batch-Averaged Sharpness-Aware Minimization
Modern deep learning models are over-parameterized, where different optima can result in widely varying generalization performance. The Sharpness-Aware Minimization (SAM) technique modifies the fundamental loss function that steers gradient descent methods toward flatter minima, which are believed to exhibit enhanced generalization prowess. Our study delves into a specific variant of SAM known as micro-batch SAM (mSAM). This variation involves aggregating updates derived from adversarial perturbations across multiple shards (micro-batches) of a mini-batch during training. We extend a recently developed and well-studied general framework for flatness analysis to theoretically show that SAM achieves flatter minima than SGD, and mSAM achieves even flatter minima than SAM. We provide a thorough empirical evaluation of various image classification and natural language processing tasks to substantiate this theoretical advancement. We also show that contrary to previous work, mSAM can be implemented in a flexible and parallelizable manner without significantly increasing computational costs. Our implementation of mSAM yields superior generalization performance across a wide range of tasks compared to SAM, further supporting our theoretical framework.
[ "Kayhan Behdin", "Qingquan Song", "Aman Gupta", "Sathiya Keerthi", "Ayan Acharya", "Borja Ocejo", "Gregory Dexter", "Rajiv Khanna", "David Durfee", "Rahul Mazumder" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09693v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09693v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG" ]
3 2 0 2 t c O 1 ] L M . t a t s [ 2 v 3 9 6 9 0 . 2 0 3 2 : v i X r a mSAM: Micro-Batch-Averaged Sharpness-Aware Minimization Kayhan Behdin∗1,2, Qingquan Song1, Aman Gupta1, Sathiya Keerthi1, Ayan Acharya1, Borja Ocejo1, Gregory Dexter1,3, Rajiv Khanna3, David Durfee1, and Rahul Mazumder1,2 1LinkedIn Corporation, USA 2Massachusetts Institute of Technology, USA 3Purdue University, USA Abstract Modern deep learning models are over-parameterized, where different optima can result in widely varying generalization performance. The Sharpness-Aware Minimization (SAM) technique modifies the fundamental loss function that steers gradient descent methods toward flatter minima, which are be- lieved to exhibit enhanced generalization prowess. Our study delves into a specific variant of SAM known as micro-batch SAM (mSAM). This variation involves aggregating updates derived from adversarial perturbations across multiple shards (micro-batches) of a mini-batch during training. We extend a re- cently developed and well-studied general framework for flatness analysis to theoretically show that SAM achieves flatter minima than SGD, and mSAM achieves even flatter minima than SAM. We provide a thorough empirical evaluation of various image classification and natural language processing tasks to substantiate this theoretical advancement. We also show that contrary to previous work, mSAM can be implemented in a flexible and parallelizable manner without significantly increasing computational costs. Our implementation of mSAM yields superior generalization performance across a wide range of tasks compared to SAM, further supporting our theoretical framework. 1 Introduction Overparameterized deep neural networks (DNNs) have established themselves as a cornerstone of modern advancements in machine learning, consistently delivering state-of-the-art results across diverse domains such as image comprehension [1, 2, 3], natural language processing (NLP) [4, 5, 6], and recommender systems [7, 8]. The training of DNNs necessitates the minimization of complex and non-convex loss functions, entailing a multitude of minima. Intriguingly, these distinct minima can exhibit varying degrees of generalizability when faced with previously unseen data [9, 10]. Consequently, the selection of an optimization framework capable of identifying minima that contribute to robust generalization performance assumes paramount significance. A broad spectrum of optimization algorithms has been developed to cater to diverse domains, including methodologies like stochastic gradient descent (SGD), heavy-ball momentum [11], Adam [12], and LAMB [13], among others. When complemented with appropriate regularization techniques, these approaches play a pivotal role in yielding robust generalization capabilities. The ability to perform implicit regularization of SGD-like methods has also garnered considerable attention in recent years [14, 15]. In recent times, a substantial body of work has been dedicated to exploring the relationship between the geometry of the loss landscape and its impact on generalization [9, 16, 17, 18, 19, 20]. The novel Sharpness- Aware Minimization (SAM) algorithm [21] capitalizes on this interplay by introducing adjustments to the loss function that enable the optimization process to gravitate towards solutions characterized by increased flatness during training, resulting in enhanced generalization across a broad spectrum of tasks and domains. ∗[email protected] 1 Specifically, this approach transforms the structure of the loss function to account for the maximal value within a localized vicinity surrounding the current parameters within the loss landscape. The gradient descent step within this framework involves a composite of two distinct phases, the first applying an adversarial perturbation. Conceptually, SAM gauges flatness by analyzing gradients in an adversarial direction, guiding a descent strategy based on the sharpness at its worst case. Unlike standard gradient descent (GD), the compositional nature of the SAM gradient computation implies that further splitting the mini-batch into disjoint shards (micro-batches) and averaging the updates will not lead to the same gradient. This was noted in Foret et al. [21], where they introduced this notion as mSAM, with m being the number of micro-batches of a single mini-batch. By splitting into disjoint shards, mSAM leverages several adversarial directions, which may more robustly represent flatness. In this work, we build the corresponding theoretical framework for improved flatness of mSAM that utilizes and extends previous techniques. Our extensive experimental results confirm these insights on a wide range of tasks. While the focus will particularly be on mSAM, our techniques apply more generally. They further imply that splitting the mini-batch for compositional gradient computations, utilized in other variants of SAM, may also lead to an improved flatness of minima. Such observations invariably encourage further study of splitting the mini-batch into shards whenever the gradient update follows a non-linear aggregation. Related Work: Although the sharpness of the loss landscape can be calculated using several different measures, such as the largest eigenvalue [22], trace [23], or Frobenius norm [18] of the loss Hessian, many of these metrics prove to be computationally demanding for practical purposes. Given the established correlation between the sharpness of the loss landscape and generalization performance [9], the central concept underlying the SAM algorithm [21] revolves around guiding the network to explore regions where the worst-case loss value within a local neighbourhood remains reasonably moderate. This pragmatic approximation of sharpness offers a computationally manageable alternative, distinct from the sharpness metrics mentioned before. The emergence of SAM has sparked a wave of interest in sharpness-aware training, culminating in the development of several variants [24, 25, 26, 27, 28]. In this paper, we focus on the effect of further splitting the mini-batch into shards for gradient compu- tation of sharpness-aware minimization methods. While our theoretical results on flatness will generalize, we primarily consider mSAM, which is this technique applied to the original SAM algorithm. In Foret et al. [21], mSAM is used implicitly to reduce the computational cost of SAM by avoiding synchronization across multiple GPUs (referred to as "accelerators" hereinafter). Recently, it has been observed via limited ex- perimentation that mSAM results in better generalization performance [21, 29, 30]. Andriushchenko and Flammarion [31] present mathematical expressions for mSAM, but their analysis is primarily focused on a particular version of mSAM (see Section 2 for more details). The experiments are also limited to image classification tasks on small architectures. This paper provides a more general theoretical framework that can also be extended to other sharpness-aware minimization variants. A cluster of contemporary research papers centered on the stability analysis of GD and SGD-like algo- rithms unveil that they function in a regime teetering on the edge of stability [14, 15, 32, 33]. This precarious balance is characterized by the maximum eigenvalue of the Hessian matrix associated with the training loss converging near the threshold of 2/η, where η denotes the learning rate. These findings subsequently offer a foundation upon which upper bounds on the maximum eigenvalue of the Hessian can be formulated (further elaboration is provided in Section 3). Our Contributions: Our contributions in this paper can be summarized as follows: • We demonstrate how mSAM improves flatness over SAM, which in turn guarantees better flatness than SGD. To that end, we leverage theoretical ideas about the implicit generalization ability of SGD-like methods and recent work related to the stability analysis of full-batch GD and SGD. • Starting from the mathematical description of mSAM, we present an explicit and flexible implementation of mSAM that does not rely on accelerator synchronization and is compatible with any single/multi-accelerator setup. 2 • We conduct extensive experiments on a wide variety of computer vision and NLP tasks, leveraging archi- tectures like Convolutional Neural Networks (CNNs) [1, 2] and Transformers [4], where mSAM consistently outperforms SAM and vanilla training strategy. 2 Algorithm In this section, we rigorously introduce mSAM, based on the SAM algorithm that aims to obtain flat solutions to the empirical loss function. In particular, SAM tries to find a solution that minimizes the worst-case loss in a ball around the solution. Mathematically, let T = {(xi, yi), i ∈ [n] : xi ∈ X , yi ∈ Y} be a training dataset of n samples, where X is the set of features, Y is the set of outcomes and [n] = {1, . . . , n}. Moreover, let l : Rd × X × Y (cid:55)→ R be a differentiable loss function, where d is the number of model parameters. Let S ⊂ [n] be a randomly chosen mini-batch of size B. The empirical loss over the mini-batch S is defined as LS (w) = (cid:80) i∈S l(w; xi, yi)/B, where w parameterizes the neural network. With this notation in place, the SAM loss function is defined as [21]: LSAM S (w) = max ∥ε∥p≤ρ LS (w + ε) (1) for some p ≥ 1. In this work, we use p = 2. In practice, however, the maximization step in (1) cannot be done in closed form. Hence, authors in [21] use a first-order approximation to LS to simplify (1) as LSAM S (w) ≈ max ∥ε∥2≤ρ LS (w) + εT ∇LS(w). It is easy to see that the maximum in Problem (2) is achieved for As a result, LSAM S ≈ LS (w + ˆε). This leads to the gradient ˆε = ρ∇LS (w)/∥∇LS (w)∥2. ∇LSAM S (w) ≈ ∇w [LS (w + ˆε)] = ∂(w + ˆε) ∂w ∇LS (w + ˆε). (2) (3) However, calculating ∂(w + ˆε)/∂w involves second-order terms that require access to Hessian, which can be computationally inefficient in practice. Thus, by ignoring the second-order terms in the above approximation, the gradient of the SAM loss can be approximated as [21]: ∇LSAM S (w) ≈ ∇LS (w + ρ∇LS (w)/∥∇LS (w)∥2) (4) which is used in the SAM algorithm (for example, in conjunction with SGD). We refer to Foret et al. [21] for more details and intuitions about SAM. We call the inner gradient calculations on the right-hand side of (4) as the SAM ascent step and the outer gradient calculations as the gradient step. mSAM [21] is a variation of the SAM algorithm. In general, for mSAM, a mini-batch of data S is further divided into m smaller disjoint shards (aka "micro-batches"), such as S1, * * * , Sm where ∪m j=1Sj = S. For simplicity, we assume |S1| = * * * = |Sm| = |S|/m although such an assumption is not necessary in general. The mSAM loss is a variation of the SAM loss, defined as: LmSAM S (w) = 1 m m (cid:88) j=1 max ∥ε(j)∥2≤ρ LSj (w + ε(j)). (5) Intuitively, mSAM is a version of SAM where the ascent step (or the weight perturbation) of SAM is done independently on each micro-batch using different ε(j), instead of using an average perturbation such as ε for all micro-batches. The mSAM gradient can thereby be derived as: ∇LmSAM S (w) = 1 m m (cid:88) j=1 ∇LSj (w + ρ ∇LSj (w) ∥∇LSj (w)∥2 ), (6) 3 SAM mSAM Loss function Ascent step Gradient Implementations Possible m values Processor support max∥ε∥2≤ρ i=1 LSi(w + ε)/m (cid:80)m ˆε ∝ ρ(cid:80)m g = (cid:80)m i=1 ∇LSi(w)/m i=1 ∇LSi(w + ˆε)/m (cid:80)m i=1 max∥ε(i)∥2≤ρ LSi(w + ε(i))/m ˆε(i) ∝ ρ∇LSi(w), i ∈ [m] g = (cid:80)m i=1 ∇LSi (w + ˆε(i))/m [FKMN] - Multiple [FKMN] # of accelerators Multiple Ours [AF] flexible flexible Single Multiple Table 1: Comparison of SAM with Different mSAM Implementations. [FKMN] refers to Foret et al. [21] and [AF] refers to Andriushchenko and Flammarion [31]. where (6) is a first-order approximation to the gradient of (5). We also note that the loss (5) is related to the mSAM definition of Andriushchenko and Flammarion [31]. See Table 1 for a side-by-side comparison of SAM and mSAM and their different implementations. An important distinction between our work and prior work is that we treat m as a model hyper-parameter to improve generalization. In particular, in mSAM implementation of Foret et al. [21], the value of m is fixed to the number of hardware accelerators, micro-batch i is the part of the data that is loaded onto accelerator i, and each accelerator uses a separate perturbation, simulating the effect of mSAM. With this implementation, m is an artefact of the hardware setup. On the other hand, the analysis of Andriushchenko and Flammarion [31] mostly concerns the value m = |S| := B where S is the mini-batch under consideration, and we denote its size as B for ease of use in latter sections. In contrast, we consider a wide range of values for m in our experiments. This offers the flexibility to choose an appropriate value of m that leads to a better generalization performance. Moreover, our implementation supports any single/multi-accelerator setup and allows the user to set an appropriate value of m. 3 Justification of mSAM Over-parameterized DNNs have a continuum (a manifold of large size) of minima, M due to the number of parameters being much larger than the number of training examples. An intriguing property of DNNs is that different minima in M have different sharpness values. When trained using SGD with a large learning rate and small batch size, these DNNs have an implicit ability to move towards minima which are flat - or equivalently, less sharp, with sharpness expressed as the spectral norm of the Hessian1 [18, 22]. Jastrzebski et al. [14], Cohen et al. [15] establish a theoretical framework to explain this phenomenon with strong empirical backing. Accordingly, this approach is followed by most recent theoretical papers on analyzing the properties of GD, SGD, and SAM [15, 32, 34, 35, 36]. In this section, we review a generalized version of such analyses in SGD and extend it to SAM and mSAM. This extension of the well-studied framework implies that SAM improves flatness over SAM, and mSAM improves flatness even further than SAM. The proofs of all results in this section are given in appendix A. 3.1 Analysis of Linear Stability Our analysis will focus on the general minibatch stochastic dynamic update of the following form: w(t+1) = wt − η dS (wt) (7) The trio of methodologies under scrutiny - SGD, SAM and mSAM - all derive from the common foundation of ∇LS , yet they adopt distinct formulations for dS . Given their shared objective to minimize the training 1Sharpness can also be quantified in other ways. See [14, 18, 22, 32] for some details. 4 loss, each minimum within the continuum M can be posited as an equilibrium point of the dynamic system (7). Let w∗ represent a minimum within this continuum. It is anticipated that the stability attributes of trajectories surrounding w∗ will depend on hyperparameters, specifically the learning rate η and the mini- batch size B. Furthermore, due to inherent differences in their dynamics, the three methods mentioned above will manifest varying stability characteristics even with identical values of η and B. Establishing these properties hinges upon an extension of an approach to stability introduced by Wu et al. [22]. In particular, Wu et al. [22] use a linear approximation of the gradient (equivalently, a quadratic approx- imation of the loss) around w∗: ∇Li(w) ≈ Hi(w∗)(w − w∗), (8) where the subscript i corresponds to the ith training example. For the sake of simplicity in notation, and with- out sacrificing generality, we assume that w∗ = 0. Incorporating the approximation (8) into the construction of d as outlined in (7) yields a reformulation of the following manner: w(t+1) = (I − ηJS (w∗)) wt The comprehensive derivation of JS (w∗) for all three methods are presented in section 3.2, with further elaboration available in appendix A. We assume that JS (w∗) is symmetric and positive semi-definite (PSD). The corresponding stability concept as outlined by Wu et al. [22] is articulated by examining the following expression: (9) (10) To ensure that IE∥w(t+1)∥2 ≤ ∥wt∥2 ∀wt, we must have λ1(IE[(I − ηJS (w∗))2]) ≤ 1, where λ1(A) is the spectral norm of matrix A. Lemma 3.1. IE[(I − ηJS (w∗))2] = (I − ηJ∗)2 + η2Σ, where Σ = IE[(JS (w∗) − J∗)2] and J∗ = IE[JS (w∗)]. t IE[(I − ηJS (w∗))2] wt IE∥w(t+1)∥2 = wT Therefore, stability holds iff λ1((I − ηJ∗)2 + η2Σ) ≤ 1 For the full batch case, Σ = 0, rendering the verification of (11) straightforward (see Lemma 3.2 below). However, for the mini-batch case, due to the complexity of analyzing (11), Wu et al. [22] opt to substitute the stability evaluation, (11), with the following necessary condition: (11) S1 : λ1((I − ηJ∗)2) ≤ 1 and S2 : η2λ1(Σ) ≤ 1, (12) which we consider hereafter to define stability. Since λ1(A + B) ≥ max{λ1(A), λ1(B)} holds true for any pair of symmetric PSD matrices A and B, the condition stated in (12) can be considered as a relaxation of the condition in (11). Lemma 3.2. S1 is equivalent to checking if ηλ1(J∗) ≤ 2. The following result is a corollary of (12) and Lemma 3.2, and it plays a pivotal role in substantiating the principal conclusions of subsection 3.2. Lemma 3.3. The stability condition of (12) will be violated (i.e., the equilibrium point, w∗ is considered to be unstable for (9)) iff ηλ1(J∗) > 2 or η2λ1(Σ) > 1. (13) Several previous works [14, 18, 37, 38] empirically demonstrate and use an alignment assumption between J∗ and Σ. We make a similar assumption as given below: Assumption 3.1. J∗ = βΣ, where β > 0 is a constant that depends on hyper-parameters, B and n. Jastrzebski et al. [14] also point out that β depends on B and the number of training examples only. Given assumption 3.1, the conditions for stability, instability and edge (boundary) can be written more simply as: Stability Condition: αλ1(J∗) ≤ 1 Instability Condition: αλ1(J∗) > 1 Edge of Stability: αλ1(J∗) = 1 (14) (15) (16) where α = max{ η 2 , η2β}. 5 3.2 Application to SGD, SAM and mSAM We delve into applying the findings from section 3.1 to SGD, SAM and mSAM. For differentiation, we employ subscripts 1, 2, and 3 to denote SGD, SAM, and mSAM. Since w∗ is a minimum, we assume that, for each example i, the Hessian, Hi(w∗) is symmetric and positive semi-definite (PSD). Given this foundation, all other matrices we engage with in the subsequent analysis also turn out to be PSD. For SGD, Wu et al. [22] show that: (17) S is the Hessian of LS at w∗, ̄H∗ is the Hessian of the full batch mean loss at w∗ and V(XS ) = 1 = ̄H∗ and Σ1 = IE[(H∗ J∗ S − ̄H∗)2] = V(H∗ S ), where H∗ IE[(XS − IE[XS ])2] denotes the variance of XS . Assumption 3.2. For analysis with SAM and mSAM, we leave out the normalization terms in (4) and (6). In a recent study, Agarwala and Dauphin [39] analyze the stability characteristics of the full batch unnormalized SAM, as described in (4), where S signifies the complete training set. Notably, they too exclude the normalizer term ∥∇LS (w)∥2 to simplify the analysis. However, unlike Agarwala and Dauphin [39], we do not require the full batch assumption. Let us now apply the general linear stability analysis that we develop in section 3.1 to SAM and mSAM; for them, dS is given by d2,S (w) = d1,S (w + ρd1,S (w)), d3,S (w) = 1 m m (cid:88) j=1 d2,Sj (w). where d1,S is the SGD gradient given by d1,S (w) = 1 |S| (cid:88) i∈S ∇L(w; ei), (18) (19) (20) and ei = (xi, yi) denotes the i-th training example. It is clear from (18) and (19) that the linear approxima- tions of SAM and mSAM, i.e., the determination of J1,S (w∗) and J2,S (w∗) depend on the linearization of ∇d1,S which is given by: ∇d1,S = H∗ S w ⇒ J1,S (w∗) = H∗ S def== 1 |S| (cid:88) i∈S Hi(w∗) (21) When the details are worked out (see appendix A) we obtain expressions for J1,S (w∗) and J2,S (w∗) given by the following lemma. Lemma 3.4. (a) J∗ for SAM and mSAM are given by where 2 = ̄H∗ + ρ( ̄H∗)2 + ρΣ1, J∗ 3 = ̄H∗ + ρ( ̄H∗)2 + ρΣ1 + Ω, J∗ Ω = IE   ρ m m (cid:88) (H∗ Sj j=1  − H∗ S )2  . (b) Σ for SAM and mSAM are given by Σ2 = IE[(H∗ S + ρ(H∗ Σ3 = IE[(J3,S (w∗) − J∗ 2)2] S )2 − J∗ 3)2] 6 (22) (23) (24) (25) (26) where J3,S (w∗) = H∗ S + ρ(H∗ S )2 + ρ m (cid:80)m j=1(H∗ Sj − H∗ S )2. (c) Equivalently, Σ2 and Σ3 can also be written as matrix variances: Σ2 = V(H∗ S + ρ(H∗ Σ3 = V(J3,S (w∗)) S )2) (27) (28) Dataset Model Vanilla SAM mSAM CIFAR 10 CIFAR 100 ImageNet 1k ResNet50 WRN-28-10 ViT-B/16 ResNet50 WRN-28-10 ViT-B/16 ResNet50 WRN50-2-bottleneck ViT-S/32 95.45 ± 0.10 95.92 ± 0.12 97.68 ± 0.03 80.68 ± 0.13 81.01 ± 0.19 88.02 ± 0.17 76.35 ± 0.09 78.04±0.09 64.53 ± 0.72 96.09 ± 0.11 96.90 ± 0.05 97.75 ± 0.06 81.49 ± 0.18 82.93 ± 0.13 88.75 ± 0.07 76.61 ± 0.07 78.50 ± 0.09 65.86 ± 0.81 96.40 ± 0.06 96.95 ± 0.04 98.29 ± 0.08 83.37 ± 0.10 84.07 ± 0.06 89.00 ± 0.17 76.79 ± 0.09 79.36 ± 0.04 66.76 ± 0.22 Table 2: Accuracy Results for CNN Architectures It is imperative to acknowledge that the theoretical analysis of SAM-like methodologies with the nor- malization term presents a formidable undertaking, as highlighted by Dai et al. [40]. Consequently, we defer this intricate endeavour to a subsequent phase. 3.3 Implications on Sharpness It is apparent from the expressions in (17), (27), and (28) that, in the progression from SGD to mSAM, the Σ's are computed as variances of matrices, with the inclusion of supplementary stochastic matrices at each stage. Consequently, one can anticipate the validity of the following theorem. Theorem 3.1. For any given η, B and w∗, (a) if SGD is unstable then SAM is unstable; and, (b) if SAM is unstable, then mSAM is unstable. Thanks to the rigorous theoretical and empirical analyses by Cohen et al. [15, 32], Arora et al. [33], GD on neural network training is understood to reach and operate in a regime known as the Edge of Stability (EoS), where the maximum eigenvalue of the training loss Hessian hovers just above the value 2/η (see Lemma 3.2 above). Upon entering the EoS region, the training loss exhibits non-monotonic behavior over brief time intervals, while consistently decreasing over longer periods. In the mini-batch setting, Jastrzebski et al. [14] conduct systematic experiments, applying the stability theory introduced by Wu et al. [22], thereby identifying a corresponding EoS behavior for SGD. The assertion of Theorem 3.1 remains independent of the reliance on assumption 3.1. Through the meticulous delineation of precise mathematical expressions, this theorem unveils the inherent propensity of mSAM to manifest greater susceptibility to instability in contrast to SAM, attributed to the incorporation of micro-batching. It is notable that SAM, owing to its adversarial step, exhibits a heightened level of instability as compared to SGD. For the mini-batch setting, these results are new. Combined with the way ̄H∗ is involved in the expressions, theorem 3.1, assumption 3.1, and the EoS theory culminate in the following pivotal finding, which serves as a direct comparative analysis of the sharpness inherent in the three methods. Theorem 3.2. For any given η and B, if H∗ and mSAM at their edge of stability, then λ1(H∗ 1, H∗ 2 and H∗ 1) ≥ λ1(H∗ 3 denote, respectively the Hessians of SGD, SAM 2) ≥ λ1(H∗ 3). 7 Appendix A gives a proof of this result. Let us give a rough explanation of this important result. Com- 3 in (17) (22) and (23), we can see from the additional terms that i ) = 1 ∀i, λ1(H∗ 3) 1). Thus, mSAM has better flatness 1, J∗ 2 to J∗ 2), which in turn cannot be larger than λ1(H∗ paring the expressions for J∗ come as we go from J∗ 1 to J∗ cannot be larger than λ1(H∗ than SAM, and SAM has better flatness than SGD. 3 that, for meeting the edge of stability condition λ1(J∗ 2 and J∗ We support Theorem 3.2 with an empirical investigation on three datasets in Section 5; see Table 4 there and the discussion below it. 4 Numerical Experiments This section compares mSAM to SAM and vanilla optimization methods (i.e. without sharpness-aware mod- ification) on various model architectures and datasets. We report the average and standard deviation of accuracy on the test data over five independent runs. We also note that we use the same values of hyper- parameters for all algorithms, where ρ is chosen based on the best validation performance for SAM, and other hyper-parameters are chosen based on the best validation error for vanilla methods. Moreover, although using different values of ρ for each micro-batch in mSAM is possible, doing so requires tuning numerous hyper- parameters, which is computationally infeasible. Therefore, we use the exact value of ρ for all micro-batches. 4.1 Image Classification In our first set of experiments on image classification datasets, we compare the performance of mSAM, SAM and vanilla methods with multiple CNN architectures such as ResNets [2] and WideResNet [41]. We use CIFAR10/100 [42] and ImageNet [43] datasets as our test bed. We use different seeds for all five runs of each experiment. The average accuracies corresponding to the experiments with the three datasets and the architectures of ResNet and WideResNet are reported in Table 2. For the CIFAR datasets, we use an effective batch size of 512 across four NVIDIA V100 GPUs. For the ImageNet dataset, we use an effective batch size of 2048 across eight GPUs. We use m = 32 for mSAM for CIFAR and 4/8 for ResNet50 and WideResNet-50-2, respectively, for ImageNet. Details about hyper-parameters used to produce these results can be found in Appendix C. Overall, mSAM consistently leads to better accuracy than SAM and vanilla methods in all CNN-related experimental results reported in Table 2. Following recent results that suggest that sharpness-aware optimization can substantially improve the generalization quality of Vision Transformers (ViTs) [29], we conduct additional experiments on ViT ar- chitectures. In particular, we use the pre-trained ViT-B/16 checkpoint from [44] and fine-tune the model on CIFAR10/100 data independently. For ImageNet, we train a smaller version of the ViT model (ViT- S/32) from scratch. We choose 512 as the batch size for the CIFAR fine-tuning tasks and use 4096 as the batch size for training from scratch on the ImageNet dataset. The average accuracy results for ViT are reported in Table 2. Similar to results on CNNs, mSAM outperforms both SAM and vanilla training across all sets of ViT-related tasks. Note that we do not leverage any advanced data augmentation techniques, and only use inception-style image pre-processing. Other hyper-parameters to produce these results are listed in Appendix C. 4.2 NLP Fine-tuning Our next set of experiments is based on four tasks from the GLUE benchmark [45]. In particular, we choose COLA and MRPC as two small datasets and SST-2 and QQP as two larger datasets for empirical evaluation. Fine-tuning experiments are performed with the RoBERTa-base model [6] on four NVIDIA V100 GPUs with an effective batch size of 32. For the ease of reproduction of the results, we tabulate all the hyper-parameters used in Appendix D. For the fine-tuning experiments, we report the average value of Matthews Correlation Coefficient for COLA, and average accuracy for other datasets in Table 3. Overall, mSAM performs better than the baseline methods on these datasets. However, the variance among different runs is comparably high 8 for smaller datasets such as COLA and MRPC. On the other hand, the results on larger data such as SST-2 and QQP are expectedly more robust across different runs. Task Vanilla SAM mSAM (m = 8) COLA 63.66 ± 2.46 MRPC 89.79 ± 0.05 94.27 ± 0.18 SST-2 91.70 ± 0.11 QQP 64.30 ± 0.49 90.37 ± 0.13 95.21 ± 0.12 92.13 ± 0.02 64.57 ± 0.66 90.92 ± 0.16 95.38 ± 0.10 92.18 ± 0.03 Table 3: Accuracy Results for GLUE Tasks Model Vanilla SAM mSAM ResNet50 WRN-28-10 26 ± 2 92 ± 4 21 ± 3 30 ± 2 18 ± 1 17 ± 1 Table 4: λmax (sharpness) for CNNs 5 A Deeper Investigation of mSAM To further understand the mSAM algorithm, we design and report some experiments in this section. Addi- tional experimental results are moved to Appendix B. ResNet50 WRN-28-10 m m Figure 1: The effect of varying m on accuracy. We see that increasing m up to 32 results in better accuracy. However, increasing m further leads to worse results/marginal improvements. Effect of varying m: In our experiments, we have observed that a larger value of m often leads to better test accuracy. We recover SAM by setting m = 1, which produces inferior results. To test this hypothesis, we set up the experiments with the CIFAR100 dataset on two CNNs, ResNet50 and WRN-28-10, in the same setup as in Section 4.1. We run mSAM for different values of m ∈ {4, 8, 16, 32, 64}. The accuracy results for these experiments are shown in Figure 1. Increasing m improves the performance up to m ≈ 32. However, a value of m larger than this threshold either leads to worse performance or marginal improvements, so increasing m does not necessarily result in better generalization. Intuitively, when the micro-batch is too small, the perturbation derived according to the micro-batch might not be a good estimate of the actual SAM perturbation, leading to worse performance. We leave the theoretical analysis of such a phenomenon an interesting direction for future research. We also note that understanding how the optimal value of m and batch size interact is an open question for future work. 9 101102m787980818283101102m8181.58282.58383.58484.5 Are mSAM solutions flat? The SAM algorithm hypothesizes that flat solutions generalize better. Since mSAM consistently outperforms SAM, it is worth investigating if mSAM settles for even flatter solutions than SAM, as predicted by our theory in section 3. To that end and to quantify sharpness, we calculate the largest eigenvalue of the Hessian of the loss function LS ( ⃗w) at the final solution, denoted as λmax. We calculate λmax over the full train data using power iteration, as implemented by [46]. We use the ResNet50 and WRN-28-10 models trained on CIFAR100 (see Section 4.1) to calculate λmax. The average results for these experiments are reported in Table 4. We see that mSAM leads to solutions with smaller λmax than SAM and vanilla SGD, and this finding agrees with Theorem 3.2. Model Vanilla SAM mSAM ResNet50 WRN-50-2-bottleneck ViT-S/32 14.74 27.68 19.91 25.54 52.02 24.50 25.87 58.93 30.66 Table 5: Runtime of different methods and architectures on ImageNet data (in hours) mSAM runtime: A general misconception about mSAM is that it is computationally inefficient, as the total number of forward-backwards passes in the network is multiplied by m [30]. However, note that these passes are performed on micro-batches, which are m times smaller than the actual minibatch. Hence, the overall computational cost gets amortized and is never as high as m times the cost of SAM. In practice, on large networks, the runtime of mSAM is only 1.1-1.2 times more compared to SAM. Particularly, in Table 5 we report the runtime of SGD, SAM and mSAM for the ImageNet data. The overhead of mSAM over SAM for ViT-S/32 is about 20%, while for ResNet50 the overhead is negligible. We discuss the computational efficiency of mSAM in more details in Appendix B, as well as discussing a few hybrid algorithms to reduce the computational cost of mSAM even further. 6 Discussion Within the confines of this study, we proffer a theoretical rationale that explains how mSAM leads to flatter solutions when compared with SAM. This perspective extends a contemporary framework of stability dynamics. It is discernible from intuitive observations that minima characterized by heightened flatness frequently correlate with enhanced generalization capabilities. Our comprehensive empirical inquiry reinforces such theoretical assertion by demonstrating the superiority of mSAM over SAM across diverse datasets with image classification and NLP tasks and a spectrum of model architectures, including CNNs and Transformers. The extent of performance differentiation is notably contingent upon the specifics of the dataset and the inherent architecture. Our empirical endeavours reveal that the computational overhead associated with mSAM does not incur a significantly higher cost than SAM, thereby establishing its viability for solving large-scale problems. Furthermore, our theoretical framework is amenable to broader generalization, specifically, the dissec- tion of the conventional mini-batch into micro-batches. This extension becomes particularly pertinent when considering gradient computation of a compositional nature, an attribute often observed in other iterations of sharpness-aware minimization algorithm. An avenue ripe for future exploration entails the augmentation and extension of the flatness theory as applied to the segmentation of mini-batches into micro-batches, par- ticularly in the context of gradient updates characterized by non-linear aggregation. Such a development presents an intriguing prospect wherein this technique could be pragmatically harnessed to enhance the generalization efficacy of alternative methodologies. 10 Acknowledgements Kayhan Behdin contributed to this work while he was an intern at LinkedIn during summer 2022 and 2023. This work is not a part of his MIT research. Rahul Mazumder contributed to this work while he was a consultant for LinkedIn (in compliance with MIT's outside professional activities policies). This work is not a part of his MIT research. References [1] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84–90, 2017. [2] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. [3] M. Tan and Q. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In Inter- national conference on machine learning, pages 6105–6114. PMLR, 2019. [4] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, (cid:32)L. Kaiser, and I. Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. [5] J. Devlin, M. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. [6] Y. Liu, M. Ott, N. Goyal, J. Du, M. Joshi, D. Chen, O. Levy, M. Lewis, L. Zettlemoyer, and V. Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019. [7] H. Guo, R. Tang, Y. Ye, Z. Li, and X. He. Deepfm: a factorization-machine based neural network for ctr prediction. arXiv preprint arXiv:1703.04247, 2017. [8] M. Naumov, D. Mudigere, H. Shi, J. Huang, N. Sundaraman, J. Park, X. Wang, U. Gupta, C. Wu, A. G. Azzolini, et al. Deep learning recommendation model for personalization and recommendation systems. arXiv preprint arXiv:1906.00091, 2019. [9] N. Keskar, D. Mudigere, J. Nocedal, M. Smelyanskiy, and P. Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016. [10] S. Liu, D. Papailiopoulos, and D. Achlioptas. Bad global minima exist and sgd can reach them. Advances in Neural Information Processing Systems, 33:8543–8552, 2020. [11] I. Sutskever, J. Martens, G. Dahl, and G. Hinton. On the importance of initialization and momentum in deep learning. In International conference on machine learning, pages 1139–1147. PMLR, 2013. [12] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [13] Y. You, J. Li, S. Reddi, J. Hseu, S. Kumar, S. Bhojanapalli, X. Song, J. Demmel, K. Keutzer, and C. Hsieh. Large batch optimization for deep learning: Training BERT in 76 minutes. arXiv preprint arXiv:1904.00962, 2019. [14] S. Jastrzebski, M. Szymczak, S. Fort, D. Arpit, J. Tabor, K. Cho*, and K. Geras*. The break-even point on optimization trajectories of deep neural networks. In International Conference on Learning Representations, 2020. [15] J. Cohen, S. Kaur, Y. Li, J.Z. Kolter, and A. Talwalkar. Gradient descent on neural networks typically occurs at the edge of stability. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=jh-rTtvkGeM. 11 [16] G. K. Dziugaite and D. M. Roy. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. arXiv preprint arXiv:1703.11008, 2017. [17] Z. Xie, I. Sato, and M. Sugiyama. A diffusion theory for deep learning dynamics: Stochastic gradient In International Conference on Learning Representations, descent exponentially favors flat minima. 2021. [18] L. Wu, M. Wang, and W. Su. When does sgd favor flat minima? a quantitative characterization via linear stability, 2022. URL https://arxiv.org/abs/2207.02628. [19] J. Z. HaoChen, C. Wei, J. Lee, and T. Ma. Shape matters: Understanding the implicit bias of the noise covariance. In Proceedings of Thirty Fourth Conference on Learning Theory, volume 134, pages 2315–2357, 2021. [20] Samuel L. S. and Quoc V. L. A bayesian perspective on generalization and stochastic gradient descent. In International Conference on Learning Representations, 2018. [21] P. Foret, A. Kleiner, H. Mobahi, and B. Neyshabur. Sharpness-aware minimization for efficiently im- proving generalization. arXiv preprint arXiv:2010.01412, 2020. [22] L. Wu, C. Ma, and W. E. How sgd selects the global minima in over-parameterized learning: A dynamical stability perspective. In Advances in Neural Information Processing Systems, volume 31, 2018. [23] H. Ibayashi, T. Hamaguchi, and M. Imaizumi. Minimum sharpness: Scale-invariant parameter- robustness of neural networks. arXiv preprint arXiv:2106.12612, 2021. [24] J. Zhuang, B. Gong, L. Yuan, Y. Cui, H. Adam, N. Dvornek, S. Tatikonda, J. Duncan, and T. Liu. Surrogate gap minimization improves sharpness-aware training. arXiv preprint arXiv:2203.08065, 2022. [25] Y. Liu, S. Mai, X. Chen, C. Hsieh, and Y. You. Towards efficient and scalable sharpness-aware mini- mization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12360–12370, 2022. [26] J. Du, D. Zhou, J. Feng, V. YF Tan, and J. T. Zhou. Sharpness-aware training for free. arXiv preprint arXiv:2205.14083, 2022. [27] J. Kwon, J. Kim, H. Park, and I. K. Choi. Asam: Adaptive sharpness-aware minimization for scale- invariant learning of deep neural networks. In Proc. of ICML, volume 139, pages 5905–5914, 2021. [28] M. Kim, D. Li, S. X. Hu, and T. M. Hospedales. Fisher sam: Information geometry and sharpness aware minimisation, 2022. URL https://arxiv.org/abs/2206.04920. [29] X. Chen, C. Hsieh, and B. Gong. When vision transformers outperform resnets without pre-training or strong data augmentations. arXiv preprint arXiv:2106.01548, 2021. [30] D. Bahri, H. Mobahi, and Y. Tay. Sharpness-aware minimization improves language model generaliza- tion. arXiv preprint arXiv:2110.08529, 2021. [31] M. Andriushchenko and N. Flammarion. Towards understanding sharpness-aware minimization. In International Conference on Machine Learning, pages 639–668. PMLR, 2022. [32] J. M. Cohen, B. Ghorbani, S. Krishnan, N. Agarwal, S. Medapati, M. Badura, D. Suo, D. Cardoze, Z. Nado, G. E. Dahl, and J. Gilmer. Adaptive gradient methods at the edge of stability, 2022. URL https://arxiv.org/abs/2207.14484. [33] S. Arora, Z. Li, and A. Panigrahi. Understanding gradient descent on edge of stability in deep learning, 2022. URL https://arxiv.org/abs/2205.09745. 12 [34] P. L. Bartlett, P. M. Long, and O. Bousquet. The dynamics of sharpness-aware minimization: Bouncing across ravines and drifting towards wide minima, 2022. URL https://arxiv.org/abs/2210.01513. [35] K. Wen, T. Ma, and Z. Li. How does sharpness-aware minimization minimize sharpness?, 2022. URL https://arxiv.org/abs/2211.05729. [36] S. Ujv ́ary, Z. Telek, A. Kerekes, A. M ́esz ́aros, and F. Husz ́ar. Rethinking sharpness-aware minimization as variational inference, 2022. URL https://arxiv.org/abs/2210.10452. [37] S. Jastrzebski, Z. Kenton, D. Arpit, N. Ballas, A. Fischer, Y. Bengio, and A. J. Storkey. Three factors influencing minima in SGD. CoRR, abs/1711.04623, 2017. URL http://arxiv.org/abs/1711.04623. [38] Z. Li, T. Wang, and S. Arora. What happens after SGD reaches zero loss? –a mathematical framework. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum? id=siCt4xZn5Ve. [39] A. Agarwala and Y. N. Dauphin. SAM operates far from home: eigenvalue regularization as a dynamical phenomenon. CoRR, abs/2302.08692, 2023. URL https://doi.org/10.48550/arXiv.2302.08692. [40] Y. Dai, K. Ahn, and S. Sra. The crucial role of normalization in sharpness-aware minimization, 2023. [41] S. Zagoruyko and N. Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016. [42] A. Krizhevsky, G. Hinton, et al. Learning multiple layers of features from tiny images. 2009. [43] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. Inter- national Journal of Computer Vision (IJCV), 115(3):211–252, 2015. doi: 10.1007/s11263-015-0816-y. [44] B. Wu, C. Xu, X. Dai, A. Wan, P. Zhang, Z. Yan, M. Tomizuka, J. Gonzalez, K. Keutzer, and P. Vajda. Visual transformers: Token-based image representation and processing for computer vision, 2020. [45] A. Wang, A. Singh, J. Michael, F. Hill, O. Levy, and S. Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 353–355, Brussels, Belgium, November 2018. Association for Computational Linguistics. [46] N. Golmant, Z. Yao, A. Gholami, M. Mahoney, and J. Gonzalez. pytorch-hessian-eigenthings: efficient pytorch hessian eigendecomposition, October 2018. 13 A Proofs of the results in section 3 Lemma A.1. For a random symmetric PSD matrix X: IE[X2] = IE[X]2 + IE[(X − IE[X])2]. (29) Proof. Note that IE[(X − IE[X])2] = IE[X2 − XIE[X] − IE[X]X − IE(X)2] = IE[X2] − IE[X]IE[X] − IE[X]IE[X] − IE[X]2 = IE[X2] − IE[X]2 which proves the above lemma. Proof of Lemma 3.1: Proof. We have IE[(I − ηJS (w∗))2] = IE[(I − 2ηJS (w∗) + η2(JS (w∗))2)] = (I − 2ηJ∗ + η2(J∗)2) + IE[(JS (w∗) − J∗)2] (30) which completes the proof. Proof of Lemma 3.2: Proof. S1 translates to the eigenvalues of (I − J∗) to be between −1 and 1. The upper bound holds auto- matically since J∗ is PSD. The lower bound completes the proof. Proof of Lemma 3.3: This is just a restatement of Lemma 3.2. Proof of Lemma 3.4: Proof. For SGD, SAM and mSAM, let us recall, from subsection 3.2, their expressions for d given by d1,S (w) = 1 |S| (cid:88) e∈S ∇L(w; e), d2,S (w) = d1,S (w + ρd1,S (w)), d3,S (w) = 1 m m (cid:88) j=1 d2,Sj (w). Consider the linear approximations of the three methods to obtain their JS (w∗). For SGD, we have: ∇d1,S = H∗ S w ⇒ J1,S (w∗) = H∗ S def== 1 |S| (cid:88) i∈S Hi(w∗) For SAM, we have: ∇d2,S = H∗ S (w + ρH∗ S w) = [H∗ S + ρ(H∗ S )2]w ⇒ J2,S (w∗) = H∗ S + ρ(H∗ S )2 (31) (32) (33) (34) (35) For mSAM, we have: ∇d3,S = [ 1 m m (cid:88) (H∗ Sj j=1 + ρ(H∗ Sj )2)]w = [H∗ S + ρ m m (cid:88) (H∗ Sj j=1 )2)]w ⇒ J3,S (w∗) = H∗ S + ρ m m (cid:88) (H∗ Sj j=1 )2 (36) Applying Lemma A.1 to the second term of J3,S (w∗) in Eq. 36 gives: J3,S (w∗) = H∗ S + ρ m m (cid:88) j=1 (H∗ Sj )2 = H∗ S + ρ(H∗ S )2 + ρ m m (cid:88) (H∗ Sj j=1 − H∗ S )2 (37) 14 Let us now derive J∗ and Σ for the three methods. For SGD: 1 = ̄H∗, Σ1 = IE[(H∗ J∗ S − ̄H∗)2] SAM: Applying Lemma A.1 again gives 2 = ̄H∗ + ρIE[(H∗ J∗ S )2] = ̄H∗ + ρ( ̄H∗)2 + ρIE[(H∗ S − ̄H∗)2] = ̄H∗ + ρ( ̄H∗)2 + ρΣ1, Σ2 = IE[(J2,S (w∗) − J∗ 2)2] = IE[(H∗ S + ρ(H∗ S )2 − J∗ 2)2] mSAM: 3 = IE[J3,S (w∗)] = IE[H∗ J∗ S + ρ(H∗ S )2 + ρ m m (cid:88) j=1 (H∗ Sj − H∗ S )2] The expectations of the first two terms are exactly as in SAM. Thus, 3 = J∗ J∗ 2 + Ω = ̄H∗ + ρ( ̄H∗)2 + ρΣ1 + Ω Σ3 = IE[(J3,S (w∗) − J∗ 3)2] where Ω is as in (24). Next, which is (26). Proof of Theorem 3.1 (38) (39) (40) (41) (42) (43) Proof. It follows in a straightforward way from (15), (17), (22), and (23), J∗ 3 ⪰ J∗ 2 ⪰ J∗ 1. Proof of Theorem 3.2 3) denote the linearized dynamics and Hessians of SGD, SAM and Proof. Let (J∗ mSAM at their edges of stability, at points w∗ 2) and (J∗ 1) (J∗ 2, H∗ 3, H∗ 1, H∗ 2, and w∗ Let us first compare SAM and mSAM. Let R+ denote the non-negative reals. Define the quadratic function with non-negative coefficients (and hence monotone), f : R+ → R+ as f (x) = α(1 + ρ β )x + αρx2. For any symmetric PSD matrix, A, λ1(f (A)) = f (λ1(A)). This follows from the fact that, if A is symmetric PSD and has {(eigenvalue, eigenvector)} pairs {(μi, vi)}, then for any positive integer p, Ap has {(μp i , vi)} as its set of (eigenvalue, eigenvector) pairs. Starting from the edge of stability condition for SAM (16), 3 respectively. 1, w∗ αλ1(J∗ 2) = αλ1(H∗ = λ1(αH∗ = λ1(αH∗ 2 + ρ(H∗ 2 + αρ(H∗ 2 + αρ(H∗ 2)2 + ρΣ1) 2)2 + αρΣ1) αρ 2)2 + H2) β = λ1(f (H∗ 2)), where the third line follows from H∗ 2 satisfy assump- tion 3.1. Meanwhile, by the same steps we applied to the SAM dynamics while accounting for the extra term Ω, we find that: 2,S ] = βΣ1, since the SGD dynamics around w∗ 2 = E[H∗ Since both the SAM and mSAM dynamics are assumed to satisfy the edge-of-stabililty condition, we have that λ1(J∗ 2). By Weyl's inequality, 3) = λ1(J∗ αλ1(J∗ 3) = λ1(f (H∗ 3) + αΩ). λ1(f (H∗ 2)) = λ1(f (H∗ 3) + αΩ) ≥ λ1(f (H∗ 3)) + αλmin(Ω). (44) We know that Ω is PSD, so we conclude that λ1(f (H∗ the monotonicity of f (*), we conclude that λ1(H∗ 2) ≥ λ1(H∗ 3). 2)) ≥ λ1(f (H∗ 3)), hence f (λ1(H∗ 2)) ≥ f (λ1(H∗ 3)). By 15 Now let us compare SGD and SAM. We have λ1(H∗ 1) = 1 and λ1(H∗ 2) ≤ 1, where the second is an inequality because J∗ 2 in (22) has an additional psd term, ρ(H∗ 1)2 + ρΣ1. Now, αλ1(H∗ 2) ≤ 1 = αλ1(H∗ 1) (45) (46) and, since α > 0, we have λ1(H∗ 2) ≤ λ1(H∗ 1), which completes the proof. B mSAM and Computational Efficiency In this section, we discuss details of mSAM implementation and review its computational efficiency. mSAM can be implemented either to have less memory footprint or to be faster. We choose to use the memory- efficient version, making mSAM more suitable for training larger models. Specifically, given a mini-batch of data such as S, this mini-batch is divided into m micro-batches in the system memory, and then load each micro-batch separately to the GPU memory whenever it is used. This leads to a slight runtime overhead due to the need to move the data (micro-batches) in and out of the GPU memory. However, we opted to use the memory-efficient implementation as it enables us to train models with any batch size, as long as the micro-batch size is sufficiently small. This choice of a memory-optimized implementation is due to the fact that newer DNN models tend to be larger. We reemphasize that although mSAM performs m-times many more forward-backward passes, each pass is done on a micro-batch that is m-times smaller. Therefore, in terms of forward-backward passes, SAM and mSAM are equivalent. To be more specific, we report the runtime for SGD, SAM and mSAM in Table B.1 for CIFAR100 data and in Table B.2 for ImageNet data. Table B.1: Runtime of different methods and architectures on CIFAR100 data (in seconds) Model Vanilla SAM mSAM ResNet50 WRN ViT-B/16 4497 ± 11 10675 ± 18 4349 ± 21 7440 ± 9 17483 ± 40 7007 ± 43 16196 ± 77 22261 ± 24 8163 ± 14 Table B.2: Runtime of different methods and architectures on ImageNet data (in hours) Model Vanilla SAM mSAM ResNet50 WRN-50-2-bottleneck ViT-S/32 14.74 ± 0.68 27.68 ± 0.18 19.91 ± 0.13 25.54 ± 0.25 52.02 ± 0.36 24.50 ± 0.26 25.87 ± 0.08 58.93 ± 0.26 30.66 ± 0.15 Since SAM requires two forward-backwards passes for each batch of data, SAM is almost twice as slow as vanilla training. In our experiments, mSAM appears to be slower than SAM, although not m times slower, as suggested by Bahri et al. [30]. Expectedly, SAM is almost twice as slow as the vanilla method in most cases (despite ViT-S/32 experiment where the common data pre-processing stage requires more time for preparing the images into a sequence of 32 patches). We see that in the worst case, mSAM is only twice as slow as SAM, and in the best case, the computational penalty is only within 10% increase compared to SAM. Interestingly, for large models the runtime overhead of mSAM seems insignificant. For example in Table B.1 for CIFAR100, the overhead is the smallest for ViT with 86M parameters, then WRN with 36M parameters 16 has the best performance, and then ResNet50 with 23M parameters. This can be explained as we noted above, the mSAM overhead results from loading micro-batches to GPU. Note that this data communication overhead is constant regardless of the model size. This leads to the runtime overhead of mSAM being smaller for larger models, where more time is spent in the forward-backward pass. ResNet50 WRN-28-10 Figure B.1: Effect of switching training algorithm Although mSAM does not appear to be computationally prohibitive in our experiments, it is still not as efficient as vanilla training, leaving room for further improving its efficiency. To that end, we conduct the following set of experiments. Building on our CIFAR100 experiments from Section 4.1, we start the training either with mSAM or vanilla training and then switch to the other training algorithm at some point. We keep all other training parameters fixed. The accuracy results for this setup for ResNet50 and WRN-28-10 are reported in Figure B.1. In this figure, the switch percent is the threshold in training when we transition from one algorithm to the other. For example, for the switch percent of 20, if we start with mSAM, we use mSAM for the first 20% of epochs and vanilla updates for the rest. If mSAM is used for the initial and/or final part of training, the accuracy is always better than vanilla training. In fact, in the WRN-28-10 case, as long as we partially use mSAM, the accuracy is almost the same as training with mSAM for the entire duration. For ResNet50, not using mSAM for the whole training leads to a drop in performance; however, even in this case, the accuracy of the hybrid training is better than the SAM training. These observations suggest that it is possible to enjoy the superior performance of mSAM, at least to some degree, while not having to deal with the computational complexity of mSAM for the entire training. A better theoretical and empirical understanding of the hybrid training method can be an exciting avenue for future work. C Hyper-parameters for Image Classification Experiments As mentioned, our experiments on CIFAR data in this section are done on 4 Nvidia V100 GPUs, with an effective batch size of 512. For mSAM, we used the micro-batch size of 16, corresponding to m = 32. The rest of the hyper-parameters are chosen as in Table C.1 for CIFAR10/100 experiments. For ImageNet experiments, we use 8 Nvidia V100 GPUs, with an effective batch size of 2048 for ResNet50 and WideResNet- 50-2-bottleneck, and 4096 for ViT-S/32. The micro-batch size and m are chosen based on a grid search within the set of {2, 4, 8, 16}. The rest of the hyper-parameters are listed in Table C.2 for ImageNet experiments. 17 020406080100Switch Percentage80.58181.58282.58383.5mSAM->VanillaVanilla->mSAM020406080100Switch Percentage80.58181.58282.58383.58484.5mSAM->VanillaVanilla->mSAM Table C.1: Hyper-parameters for CIFAR10/100 experiments Model ResNet50 WRN-28-10 ViT-B/16 (fine-tuning) Optimizer Peak Learning Rate Batch Size Number of epochs Momentum Weight Decay Label Smoothing Learning Rate Schedule Gradient Clipping ρ (SAM/mSAM) m (mSAM) SGD 0.5 512 200 0.9 5 × 10−4 0.1 SGD 0.75 512 200 0.9 5 × 10−4 0.1 AdamW 10−3 512 20 - 0.3 - All methods use one cycle with 5% warm-up - 0.2 32 - 0.2 32 norm=1 0.3 32 Table C.2: Hyper-parameters for ImageNet experiments Model ResNet50 WRN-50-2-bottleneck ViT-S/32 Optimizer Peak Learning Rate Batch Size Number of epochs Momentum Weight Decay Label Smoothing Learning Rate Schedule Gradient Clipping ρ (SAM/mSAM) m (mSAM) SGD 0.8 2048 90 0.9 1 × 10−4 0.1 17.7% (5K step) - 0.05 4 SGD 0.5 2048 100 0.9 1 × 10−4 0.1 1% - 0.05 8 AdamW 3e-3 4096 300 - 0.3 - 10% norm=1 0.05 8 D Hyper-parameters for GLUE Experiments Our experiments in this section are done on four Nvidia V100 GPUs, with an effective batch size of 32. For mSAM, we have used the micro-batch size of four, which corresponds to m = 8. The other hyper-parameters are listed in Table D.1. 18 Table D.1: Hyper-parameters for NLP experiments Task COLA MRPC SST-2 QQP Optimizer Learning Rate Learning Rate Schedule Number of Epochs Weight Decay ρ (SAM/mSAM) AdamW 10−5 10−5 5 × 10−6 2 × 10−5 One cycle with 6% warm-up 60 60 20 15 0.01 0.01 0.05 0.05 0.01 19
http://arxiv.org/abs/2302.09691v1
2023-02-19T23:12:45
2023-02-19T23:12:45
Forecasting Pressure Of Ventilator Using A Hybrid Deep Learning Model Built With Bi-LSTM and Bi-GRU To Simulate Ventilation
A ventilator simulation system can make mechanical ventilation easier and more effective. As a result, predicting a patient's ventilator pressure is essential when designing a simulation ventilator. We suggested a hybrid deep learning-based approach to forecast required ventilator pressure for patients. This system is made up of Bi-LSTM and Bi-GRU networks. The SELU activation function was used in our proposed model. MAE and MSE were used to examine the accuracy of the proposed model so that our proposed methodology can be applied to real-world problems. The model performed well against test data and created far too few losses. Major parts of our research were data collection, data analysis, data cleaning, building hybrid Bi-LSTM and Bi-GRU model, training the model, model evaluation, and result analysis. We compared the results of our research with some contemporary works, and our proposed model performed better than those models.
[ "Md. Jafril Alam", "Jakaria Rabbi", "Shamim Ahamed" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09691v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09691v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
3 2 0 2 b e F 9 1 ] G L . s c [ 1 v 1 9 6 9 0 . 2 0 3 2 : v i X r a Forecasting Pressure Of Ventilator Using A Hybrid Deep Learning Model Built With Bi-LSTM and Bi-GRU To Simulate Ventilation Md. Jafril Alam Department of Computer Science and Engineering Khulna University of Engineering & Technology Khulna, Bangladesh [email protected] Jakaria Rabbi Department of Computer Science and Engineering Khulna University of Engineering & Technology Khulna, Bangladesh jakaria [email protected] Shamim Ahamed Department of Computer Science and Engineering Khulna University of Engineering & Technology Khulna, Bangladesh [email protected] Abstract-A ventilator simulation system can make mechanical ventilation easier and more effective. As a result, predicting a patient's ventilator pressure is essential when designing a simulation ventilator. We suggested a hybrid deep learning-based approach to forecast required ventilator pressure for patients. This system is made up of Bi-LSTM and Bi-GRU networks. The SELU activation function was used in our proposed model. MAE and MSE were used to examine the accuracy of the proposed model so that our proposed methodology can be applied to real- world problems. The model performed well against test data and created far too few losses. Major parts of our research were data collection, data analysis, data cleaning, building hybrid Bi-LSTM and Bi-GRU model, training the model, model evaluation, and result analysis. We compared the results of our research with some contemporary works, and our proposed model performed better than those models. Index Terms-Ventilator pressure , Bi-LSTM , Bi-GRU , Deep Learning , Time Series Data I. INTRODUCTION In medicine and medical transportation systems, many dis- eases necessitate a ventilator. The efficiency of a mechanical ventilator was proved in the 1950s during the poliomyelitis pandemic [1]. If a person cannot breathe adequately due to hypoxemia, hypercapnia, or respiratory failure, the ventilator can help flow air in and out of the lungs. Another application of a ventilator is if anyone is going to have surgery with general anesthesia, they need it for proper breathing. However, it is very hard to maintain mechanical ventilator services for all patients during a pandemic because it is time-consuming, costly, and less effective. However, machine learning can help to predict and select appropriate pressure automatically. Machine learning-based simulation ventilators can antici- pate ventilator pressure for any patient, and mechanical venti- lators can use that information to offer services to patients. In addition, deep learning models like LSTM, GRU, Bi-LSTM, and Bi-GRU excel with time series prediction and sequence modeling. In this research paper, the next sections contain the following parts: related works, motivation, goals of this research, theory and proposed methodology, experiment, experimental result, conclusion, and limitations. Theory and methodology contain two parts: theory of different neural network models for time series analysis and a brief discussion of our proposed methodology. II. RELATED WORKS Mong Yang et al. [2] suggested a Bi-LSTM-based model for financial time series data prediction.Rong Liang et al. [3] suggested a model for estimating mine gas concentration based on Bi-GRU. A hybrid LSTM-GRU model was developed by Noureen Zafar et al. [4] to predict city traffic speed. A deep learning based model for pressure prediction was proposed by NP Sable et al. [5] where LSTM was used. III. MOTIVATION AND GOAL Covid-19, Pneumonia, and many other diseases make breathing difficult and result in a lack of oxygen in the blood. Therefore, a ventilator is required to maintain a normal oxygen rate. However, manually handling mechanical ventilators is expensive and inefficient; thus, using the manual ventilation process is critical. Ventilation simulation has the potential to reduce both costs and difficulties. As a result, Google and Princeton University organized a Kaggle research challenge to find effective machine learning-based models to simulate breathing and control mechanical ventilators. Our goal was to create a machine learning-based model to assist in the control of mechanical ventilators. Our system will predict the required ventilator pressure for a certain patient over a time period. 3) GRU: GRU, or gated recurrent network, is an RNN proposed by Cho et al. [9] .It does not have extra memory cells but contains a gating unit capable of modulating information flow inside the unit [10]. GRU is implemented using the following equations [11] [12]: rt = sigmoid(Wr.[ht−1, xt]) zt = sigmoid(Wz.[ht−1, xt]) (cid:101)ht = tanh(W (cid:102)ht .[rt ∗ ht−1, xt]) ht = (1 − zt) ∗ ht−1 + zt ∗ (cid:101)ht ot = sigmoid(Wo.ht) (6) (7) (8) (9) (10) Here, rt , zt , ht , (cid:101)ht denotes the reset gate, the update gate, the hidden state, and the candidate vector, respectively, in t timestamp. Wr , Wz , Wo are the weight metrics . 4) Bi-GRU: A bi-directional gated recurrent unit(Bi-GRU) is composed of backward and forward GRU. Both backward and forward GRU is used for obtaining future information and memorizing past information, respectively. Fig -2 shows the basic structure of Bi-GRU [11]. Fig. 2. Basic structure of layers of Bi-GRU B. Proposed Methodology Fig-3 depicts our proposed methodology for predicting ventilator pressure. Working with data, modeling, and model evaluation are two essential aspects of the methodology. The methodology's first two steps are data collection and pre- processing. The next step is to construct the proposed DNN model. The following steps are model training, testing, and evaluation. 1) Proposed model: Fig-4 depicts our proposed model for predicting ventilator pressure. This model contains seven Bi- LSTM layers, five Bi-GRU levels, four multiply layers, and five batch normalization layers. The input layer is connected with a Bi-LSTM layer, which is also connected to another LSTM layer. A Bi-LSTM and a Bi-GRU layer receive the previous layer's output. The multiply layer receives one Bi- LSTM and one Bi-GRU of the same number of units as input Fig. 1. Basic structure of layers of Bi-LSTM IV. THEORY AND METHODOLOGY A. Different Deep Learning Algorithm for time series data 1) LSTM: Long short-term memory(LSTM) [6] is a re- current neural network type extensively employed in time series prediction and natural language processing. This neural network can learn the sequencing process, whereas basic artificial neural networks cannot. The LSTM is made up of three main gates: input, output, and forget gate. Input gate, output gate, and forget gate are used to accept input, generate output, and forget the memory. Long-term memory and short- term memory are used as memory cells in LSTM. Current data, previous hidden state, and internal state are used as input in an LSTM. The values of gates, current hidden state, and current state are computed following corresponding equations [7]. ft = sigmoid(Wf h[ht−1], Wf x[xt], bf ) it = sigmoid(Wih[ht−1], Wix[xt], bi) ct = tanh(Wch[ht−1], Wcx[xt], bc) ot = sigmoid(Woh[ht−1], Wox[xt], bo) ht = ot ∗ tanh(ct) (1) (2) (3) (4) (5) Here, ft , it , ct , ot , and ht represent the result of the forget gate,the input gate, candidate vector, the result of output gate, and the memory of LSTM, respectively. Wf h , Wf x , Wih ,Wix, Woh , Wox represent weight metrics . bf , bi ,bc ,bo indicate bias corresponding to different gates . tanh and sigmoid are two nonlinear activation functions. 2) Bi-LSTM: Bi-LSTM is a type of RNN, which is the expended architecture of LSTM. It overcame the problem of the one-directional information capture flow of LSTM. Bi- LSTM can capture information from both past and present flow. It contains a backward hidden layer and a forward hidden layer. Fig-1 shows the basic structure of bi-directional long short-term memory [8]. "In" and "out" denotes input and output respectively. the minimum and highest pressures are -1.8957 and 64.8209 cmH2O, respectively. Missing values are imputed as part of data processing to produce a more accurate result. The data were scaled using robust scaling, a well-known technique. It is written as follows [14]: RobustScaling(X[i]) = X[i] − median(X) IQR(X) (13) where: • X is the data • IQR is the inter-quartile range C. Train the model The model was trained with the training dataset after data preprocessing and model selection. To implement the program for our proposed system, we used Keras and Python. During training, some of the parameters were tuned, and the critical parameters were called. The table below summarizes key parameters and gives an overview of the model. TABLE II IMPORTANT PARAMETERS AND MODEL SUMMURY DURING TRAINING OF THE MODEL Total params Activation function Batch size Main layers Optimizer 54,733,569 SELU 512 Bi-GRU , Bi-LSTM Adam D. Evaluation metrics Performance metrics are critical for justifying and exam- ining any machine learning model since the accuracy of a machine learning model is critical for applying that model practically. As a result, mean absolute error (MAE) and mean squared error (MSE) was employed to assess the proposed model's error. MAE can be expressed mathematically as: M AE = 1 N N (cid:88) k=1 |ypr[k] − yac[k]| (14) MSE is formulated as : M SE = 1 N N (cid:88) (ypr[k] − yac[k])2 (15) k=1 where: • ypr is the predicted output • yac is the actual output • N is the total number of samples VI. EXPERIMENTAL RESULT Fig. 3. Proposed methodology to forecast pressure of a ventilator and outputs a single tensor. In our model, the multiply layer exists four times. Batch normalizing employs the outputs of multiply layers. A dense layer is used as the output layer. The model uses the SELU activation function, which produces the model's output using results generated from Bi-LSTM and Bi-GRU. SELU activation function was proposed by G. Klambauer et al. [13] and formulated as follows: SELU (x) = λ ∗ x if x > 0 SELU (x) = λ ∗ (α ∗ ex − α) if x <= 0 (11) (12) where: • x is the input • α = 1.6732632423543772848170429916717 • λ = 1.0507009873554804934193349852946 α and λ are two constants. V. EXPERIMENT A. Data in ob- in our which used Kaggle, datasets from study were located is The tained https://www.kaggle.com/competitions/ventilator-pressure- prediction/data. Google Brain published this dataset, and it contains time series data. The numbers of data in train and test sets data are 6036000 and 4024000, respectively. The data was generated by connecting a fully-open supply-chain resilient pressure control ventilator to an artificial lung. This type of ventilator includes modules for the GUI, controller, alarm, common, and IO. The artificial lung is small and can stimulate a patient's condition. The table below summarizes information regarding important features and target columns. TABLE I DESCRIPTION OF FEATURES OF THE DATASET Feature R C time-step uin uout pressure Description It indicates restriction of the airway(in cmH2O/L/S) It indicates tractablity of the lung (in mL/cmH2O) It indicates time step Control input for the inspiratory solenoid valve Control input for the exploratory solenoid valve Pressure of air(in cmH2O) , Target column B. Data Analysis and Preprocessing Data processing and analysis are critical in machine learning tasks to achieve more accurate and efficient results. As a result, we investigated the pressure in the training dataset, where The results and related graphs were saved after the final execution and training of models for ventilator pressure pre- diction. The MAE and MSE of our proposed model were 0.145 and 0.094 respectively. Fig. 4. Proposed hybrid Bi-LSTM and Bi-GRU based model to forecast pressure of a ventilator The graph of pressure(in cmH2O) vs. time is shown in Fig- 5. This graph depicts the projected pressure at a specific time- step, with the dotted red line representing predicted pressure and the rest line representing the ventilator's actual pressure. Fig. 6. Graph of MSE vs Epochs Fig. 5. Graph of predicted pressure vs time-step From the fig-5 it is clear that , difference between the actual result and predicted result is too little which indicates good performance of the proposed model. Fig-6 depicts the MSE vs. Epochs graph, whereas Fig-7 depicts the MAE vs. Epochs graph. The graph demonstrates that MAE and MSE decreased significantly after a few epochs. From Fig-6 and ,7 it is also clear that , after few epochs, error of the proposed model decreased significantly which denotes the good accuracy and higher acceptability of the model. Fig. 7. Graph of MAE vs Epochs We compared our result with some contemporary works 0255075100125150175Epoch0.20.40.60.81.01.21.4MSEValidaion Loss (MSE)0255075100125150175Epoch0.20.40.60.81.0MAEValidaion Loss (MAE) [13] G. Klambauer, T. Unterthiner, A. Mayr, and S. Hochreiter. Self- normalizing neural networks. Advances in neural information processing systems, 30, 2017. [14] V. G. Raju, K. P. Lakshmi, V. M. Jain, A. Kalidindi, and V. (2020 In InThird International, editor, Study the influence Padma. August). of normalization/transformation process on the accuracy of supervised classification, pages 729–735. Conference on Smart Systems and Inven- tive Technology (ICSSIT) . IEEE, 2020. [15] Abdelghani Belgaid. Deep Sequence Modeling for Pressure Controlled Mechanical Ventilation. medRxiv, 2022. [16] Dr. Vinod Wadne et al. Pressure prediction system in lung circuit using deep learning and machine learning. International Research Journal of Engineering and Technology (IRJET), 0, 9, May 2022. related to ventilator pressure prediction. Our proposed model performed better than those research's proposed models. The following table shows a comparison of our work with some previous research. The same dataset was used in all of these research works. TABLE III COMPARING OUR RESULT WITH SOME CONTEMPORARY WORKS Authors Abdelghani Belgaid [15] Wadne et al. [16] Our research Techniques ResBiLSTM RNN Bi-LSTM and Bi-GRU MAE 0.15 0.3256 (average) 0.145 We took the average of the MAE of five samples because research by Wadne et al. [16] showed results for five samples. VII. CONCLUSION A methodology was designed and implemented successfully to simulate a ventilator and predict a ventilator's pressure. The main deep learning networks used in this research were Bi- LSTM and Bi-GRU, which are different kinds of recurrent neural networks. The proposed model was evaluated using MAE and MSE to know the capability of the real-world application of this model. As a result, we found a low error rate in our proposed model. However, this model also has shortcomings, such as not being tested on a real-time mechanical ventilator. Therefore, we plan to decrease the error rate and make an entire system so that it can be used directly in the real-world ventilator of a hospital. REFERENCES [1] Claude Gu ́erin and Patrick L ́evy. Easier access to mechanical ventilation worldwide: an urgent need for low income countries, especially in face of the growing covid-19 crisis. European Respiratory Journal, 55:6, 2020. [2] M. Yang and J. Wang. Adaptability of financial time series prediction based on bilstm. Procedia Computer Science, 199:18–25, 2022. [3] R. Liang, X. Chang, P. Jia, and C. Xu. Mine gas concentration forecasting model based on an optimized bigru network. ACS omega, 5(44):28579–28586, 2020. [4] N. Zafar, I. U. Haq, J. U. R. Chughtai, and O. Shafiq. Applying hybrid lstm-gru model based on heterogeneous data sources for traffic speed prediction in urban areas. Sensors, 22(9):3348, 2022. [5] Nilesh P. Sable et al. Pressure prediction system in lung circuit using deep learning. In ICT with Intelligent Applications. , Singapore, pages 605–615. 2023. [6] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [7] Sima Siami-Namini, Neda Tavakoli, and Akbar Siami Namin. The In 2019 performance of lstm and bilstm in forecasting time series. IEEE International Conference on Big Data (Big Data). IEEE, 2019. [8] Rabah Alzaidy, Cornelia Caragea, and C. Lee Giles. Bi-LSTM-CRF sequence labeling for keyphrase extraction from scholarly documents. The world wide web conference, 2019. [9] K. Cho, B. Van Merri ̈enboer, D. Bahdanau, and Y. Bengio. On the properties of neural machine translation: Encoder-decoder approaches. arxiv. preprint, 2014. [10] J. Chung, C. Gulcehre, K. Cho, and Y. Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arxiv. preprint, 2014. [11] Qing Zhu et al. A hybrid vmd–bigru model for rubber futures time series forecasting. Applied Soft Computing, 84, 2019. [12] Rong Liang et al. Mine gas concentration forecasting model based on an optimized bigru network. ACS omega, 5(44):28579–28586, 2020.
http://arxiv.org/abs/2302.09688v1
2023-02-19T23:06:19
2023-02-19T23:06:19
AutoDOViz: Human-Centered Automation for Decision Optimization
We present AutoDOViz, an interactive user interface for automated decision optimization (AutoDO) using reinforcement learning (RL). Decision optimization (DO) has classically being practiced by dedicated DO researchers where experts need to spend long periods of time fine tuning a solution through trial-and-error. AutoML pipeline search has sought to make it easier for a data scientist to find the best machine learning pipeline by leveraging automation to search and tune the solution. More recently, these advances have been applied to the domain of AutoDO, with a similar goal to find the best reinforcement learning pipeline through algorithm selection and parameter tuning. However, Decision Optimization requires significantly more complex problem specification when compared to an ML problem. AutoDOViz seeks to lower the barrier of entry for data scientists in problem specification for reinforcement learning problems, leverage the benefits of AutoDO algorithms for RL pipeline search and finally, create visualizations and policy insights in order to facilitate the typical interactive nature when communicating problem formulation and solution proposals between DO experts and domain experts. In this paper, we report our findings from semi-structured expert interviews with DO practitioners as well as business consultants, leading to design requirements for human-centered automation for DO with RL. We evaluate a system implementation with data scientists and find that they are significantly more open to engage in DO after using our proposed solution. AutoDOViz further increases trust in RL agent models and makes the automated training and evaluation process more comprehensible. As shown for other automation in ML tasks, we also conclude automation of RL for DO can benefit from user and vice-versa when the interface promotes human-in-the-loop.
[ "Daniel Karl I. Weidele", "Shazia Afzal", "Abel N. Valente", "Cole Makuch", "Owen Cornec", "Long Vu", "Dharmashankar Subramanian", "Werner Geyer", "Rahul Nair", "Inge Vejsbjerg", "Radu Marinescu", "Paulito Palmes", "Elizabeth M. Daly", "Loraine Franke", "Daniel Haehn" ]
10.1145/3581641.3584094
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1145/3581641.3584094", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.09688v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09688v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.HC", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.HC", "cs.AI", "cs.LG" ]
3 2 0 2 b e F 9 1 ] C H . s c [ 1 v 8 8 6 9 0 . 2 0 3 2 : v i X r a AutoDOViz: Human-Centered Automation for Decision Optimization DANIEL KARL I. WEIDELE, SHAZIA AFZAL, ABEL N. VALENTE, COLE MAKUCH, OWEN CORNEC, LONG VU, DHARMASHANKAR SUBRAMANIAN, and WERNER GEYER, IBM Research, USA RAHUL NAIR, INGE VEJSBJERG, RADU MARINESCU, PAULITO PALMES, and ELIZABETH M. DALY, IBM Research, Ireland LORAINE FRANKE and DANIEL HAEHN, University of Massachusetts Boston, USA Fig. 1. Reinforcement learning agent evaluation in AutoDOViz. We present AutoDOViz, an interactive user interface for automated decision optimization (AutoDO) using reinforcement learning (RL). Decision optimization (DO) has classically being practiced by dedicated DO researchers [43] where experts need to spend long periods of time fine tuning a solution through trial-and-error. AutoML pipeline search has sought to make it easier for a data scientist to find the best machine learning pipeline by leveraging automation to search and tune the solution. More recently, these advances have been applied to the domain of AutoDO [36], with a similar goal to find the best reinforcement learning pipeline through algorithm selection and parameter tuning. However, Decision Optimization requires significantly more complex problem specification when compared to Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the owner/author(s). © 2023 Copyright held by the owner/author(s). Manuscript submitted to ACM 1 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. an ML problem. AutoDOViz seeks to lower the barrier of entry for data scientists in problem specification for reinforcement learning problems, leverage the benefits of AutoDO algorithms for RL pipeline search and finally, create visualizations and policy insights in order to facilitate the typical interactive nature when communicating problem formulation and solution proposals between DO experts and domain experts. In this paper, we report our findings from semi-structured expert interviews with DO practitioners as well as business consultants, leading to design requirements for human-centered automation for DO with RL. We evaluate a system implementation with data scientists and find that they are significantly more open to engage in DO after using our proposed solution. AutoDOViz further increases trust in RL agent models and makes the automated training and evaluation process more comprehensible. As shown for other automation in ML tasks [33, 59], we also conclude automation of RL for DO can benefit from user and vice-versa when the interface promotes human-in-the-loop. CCS Concepts: • Human-centered computing → Human computer interaction (HCI); Visualization; • Computer systems organization → Real-time systems; • Computing methodologies → Reinforcement learning; Artificial intelligence; • Ap- plied computing → Enterprise computing. Additional Key Words and Phrases: decision optimization, reinforcement learning, automation ACM Reference Format: Daniel Karl I. Weidele, Shazia Afzal, Abel N. Valente, Cole Makuch, Owen Cornec, Long Vu, Dharmashankar Subramanian, Werner Geyer, Rahul Nair, Inge Vejsbjerg, Radu Marinescu, Paulito Palmes, Elizabeth M. Daly, Loraine Franke, and Daniel Haehn. 2023. AutoDOViz: Human-Centered Automation for Decision Optimization. In 28th International Conference on Intelligent User Interfaces (IUI '23), March 27–31, 2023, Sydney, NSW, Australia. ACM, New York, NY, USA, 28 pages. https://doi.org/10.1145/3581641.3584094 1 INTRODUCTION Decision optimization (DO) is a discipline tightly integrated with business domain users to enable better, faster, and more efficient decision-making. DO systems aim to recommend single decisions or present multiple alternatives to users and improve continuously while in production. DO finds application in virtually every industry and business practice that involves decision-making and optimization of resource allocation, such as uncertain demand in inventory networks or intelligent scheduling of heating, ventilation, and air conditioning in building control [57]. However, DO is a reasonably specialized, knowledge-oriented field that requires expertise in operations research and mathematical optimization and a deep understanding of specific business processes. This combination is challenging to find in individuals, so tight integration across teams or specifically tailored software solutions is necessary to succeed in DO projects. Recent advances in reinforcement learning (RL) have created new opportunities to add to the DO toolbox [36]. RL gyms flexibly encode problem settings in which RL agents decide actions to optimize a given reward function. Furthermore, advances in automation have shown how the process of designing high-quality machine learning pipelines accelerates the democratization of Artificial Intelligence (AI) from machine learning researchers and engineers towards data scientists and business users [10, 15, 25, 32, 42, 44]. In this paper, we want to take the next step towards a user experience1 for automation of decision optimization with RL to accelerate democratization from DO researchers to data scientists and business users. Our goal is to empower a broader set of people to develop optimization models and make automated decision-making more accessible overall. A fundamental task on this path is to precisely understand the decision optimization process, the tools used, and associated challenges to identify opportunities and scope for automation and support. Additionally, characterizing the range of business domain stakeholders and users, their skills, goals, and expectations can help design a more practical and effective solution. We, therefore, conducted extensive 1Throughout this paper we use the term user experience in a broader sense for the system design, its implementation and usability but would like to point the reader in acknowledgement to more granular differentiation as suggested in previous work [11, 20, 31]. 2 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia semi-structured one-on-one interviews with DO practitioners and business domain experts to provide insights into these questions. Regarding business experts, we aimed to characterize potential stakeholders, such as their ability to use such a system as well as their needs, goals, and expectations, which can help design a solution that is more practical and effective as well as enhancing the democratization of AI for our target group, such as the general data scientist. Based on our requirements, we propose a novel system design for automated decision optimization using reinforcement learning, AutoDOViz. AutoDOViz builds on the AutoDO core engine [36], which leverages search techniques to automate algorithm selection and hyperparameter optimization. In AutoDOViz, we bring together novel UI interfaces to simplify the problem formulation process, leveraging the AutoDO capabilities to generate optimized agents and, finally, policy visualizations and metrics to enable better communication between the agent designer and the domain expert to align the end solution with domain expert needs and inputs. We rigorously test our design in an evaluation study with data scientists and report our findings, which also leads to future work. The contribution of this paper is 4-fold. After reviewing related work in section 2, we present insights from expert interviews with (1) decision optimization researchers as well as (2) business domain consultants, which lead to system design requirements in section 3. Section 4 provides details about our (3) implementation of a user experience for an automated DO system with RL ("AutoDOViz"). Lastly, section 5 contains the evaluation of AutoDOViz in the form of (4) a user study with data scientists. We discuss our results in section 6 before drawing conclusions and suggesting directions for future work in section 7. 2 RELATED WORK 2.1 Decision Optimization and Reinforcement Learning In decision optimization, the goal is to find the best solution for an optimization problem according to a given criterion among a set of possible solutions. Therefore, the use of optimization algorithms as general step-by-step procedures plays a crucial role. Optimization algorithms are exact if they can find the optimal solution to the problem. They are heuristic if they propose an appropriate solution that is not necessarily optimal in the solution set [3]. Optimization problems are commonly found in scheduling problems, transportation, logistics, or supply chain planning [3]. In general, decision optimization can benefit from creating interactive methods, especially dynamic interaction between the user and the system [9]. Interaction with end-users makes the optimization procedure more effective by enriching the selected optimization model or informing the decision maker regarding available solutions proposed by the optimization system [38]. Using machine learning for combinatorial optimization to learn an approximate relation between decisions and their impact on the system plays a crucial role in current research. Such systems suggest optimal decision outcomes in complex real-world settings by taking advantage of the recent developments in artificial intelligence [35]. Recent literature confirms that agent-based approaches can successfully cope with a large spectrum of optimization problems. Agent-based computing has computational advantages as problems can be divided into multiple sub-problems, which can then be solved by massive parallelization (e.g., involving GPU). This is preferable for large problem spaces [3]. Earlier approaches also already proposed solving optimization problems, such as dynamic job shop scheduling, by using reinforcement learning agents [2]. Reinforcement learning (RL) or deep reinforcement learning (DRL) have become prominent techniques in machine learning to address sequential decision-making problems by training autonomous agents [26, 50]. A trained model is usually referred to as an independent agent that interacts in a particular environment with specific predefined actions. RL uses a trial-and-error approach to learn an optimal policy or behavioral strategy [4]. The RL algorithm surveys the 3 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. optimal action space given observed feedback on decisions, for example, a reward from the environment, to learn which actions are beneficial in a given state. Primarily, RL's success originates from RL agents' ability to solve decision-making problems in complex and uncertain environments. RL is popular in various fields such as autonomous driving, robotics, health, finance, smart grids, video games, and education [34]. Other applications of RL include inventory management with multiple stages and suppliers with strict lead times under demand uncertainty or control problems such as autonomous manufacturing operations with resource allocation constraints. RL can also reduce the need for repetitive human interaction by decreasing manual work like calibrating or monitoring a system, allowing systems to adapt faster to changes [47]. RL agents aim to maximize the total expected reward by learning an optimal policy. However, RL agents might lack semantic knowledge on the current goal, i.e., why some actions and elements are preferable over others [48]. The agent should be able to explain their reasoning and decision-making process to users, which could increase the user's trust towards the RL agent. Explainable Reinforcement Learning (XRL) is a form of Explainable Artificial Intelligence (XAI), focusing on the importance of providing explanations to gain the trust of users [8, 14, 41, 46].Several methods have been proposed to provide greater transparency for users [12, 13, 51]. With the increasing use of intelligent agents, it is essential to introduce methods to uncover agent behaviors and limitations. For example, algorithms provide users a behavioral summary of the agent in different situations by extracting critical trajectories from simulations of the agent [1]. Gajcin et al. [16] further suggests that understanding the differences in strategies between RL policies is required to enable users to choose between those policies. 2.2 Visual Analytics for Reinforcement Learning Next to XRL, visual analytics is a promising technique for making the RL training and evaluation process more understandable and trustworthy. The use of visual analytics tools and interactive user interfaces provides insights on decisions and representations [23, 60]. Within RL, ReLVis [47] is a visual analytics tool designed to help data scientists keep track of RL experimentation. It visualizes relations between hyperparameter changes and outcomes, such as behaviors associated with specific rewards and how agent behavior evolves. DRLViz [24] is an interface to interpret internal memory of an agent. DRLIVE [54] is a visual analytics system for RL that tracks agents through interactive visualizations and further diagnoses the DRL model by perturbing its inputs. PolicyExplainer [39] is a visual analytics interface that allows users to query an autonomous agent directly. The tool extracts data from a trained agent, summarizes the optimal policy, analyzes states and expected rewards, and visualizes a trajectory to see the agent's progression. Moreover, tools for the visualization of specific RL algorithms have been presented. For example, DQNViz [53] visualizes states of Deep Q-networks (DQNs) during the training of a deep RL agent. DynamicsExplorer [21] diagnoses an RL policy under different dynamic settings. Direct visualization of the internals of RL agents has been discussed in past research for games [19], including dimensionality reduction, reward curves, or Jacobian saliency maps [40, 61]. However, they all point out the growing need for human-interpretable explanations of deep RL agents and difficulty for non-experts to interpret. Especially in real-world scenarios, where design problems consist of more than one conflicting or cooperative objective ("multi-objective optimization problems"), visualization can be challenging [9]. Overall, more research and exploration on how to connect RL with visualization is required [55]. 2.3 User Experiences for Automation in Machine Learning Novel methods have been developed to automate parts of the data science process, from data pre-processing, feature engineering, and model selection to hyperparameter optimization (HPO) [27, 28, 30, 56, 63]. While much work has been shown to help solve specific problems, only a few can run in a fully automated and interactive way to enhance 4 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia usability and decrease manual work. Mainly HPO relies on data scientists' experience and the dataset itself. Therefore, automated methods for HPO are also an active area of research in AutoML [17]. Recently, new research has emerged to automate the full artificial intelligence lifecycle, so-called Automated Artificial Intelligence (AutoAI ) or Automated machine learning (AutoML). The goal is to enable domain experts to automatically build ML applications without extensive statistics or AI knowledge. Furthermore, such systems should reduce repetitive, manual workloads for data scientists and shift their time spent on summarizing and controlling visualization techniques [58, 59]. Commercial AutoML and AutoAI products have been released as fully managed machine learning services. Examples are Amazon SageMaker[10], Azure AutoML[42], H2O AutoML [32], Google AutoML [5] and IBM AutoAI [49, 52, 59]. Additionally, open-source software packages are available, such as AutoKeras [25], TPOT [44], Auto-Sklearn [15] and LALE [22]. Recently, Marinescu et al. [36] have proposed an automation engine towards data- or knowledge-driven dynamic optimization problems using reinforcement learning. 3 EXPLORATIVE INTERVIEWS 3.1 Decision Optimization Researchers' perspective Semi-structured interviews were conducted to collect individual opinions and experiences of DO practitioners while allowing flexibility for deeper discussions or exploration of people's views or narratives. Initial research questions were framed as prompts to guide the interview process but were not strictly adhered to formally or linearly. Instead, the interviews evolved into free-flowing conversations where participants delved into their subjective experiences and reflected on topics of interest. 3.1.1 Participants. These interviews were conducted with six people with extensive applied industry experience in DO. Five of the six people we interviewed had over 20 years of experience in optimization and vast experience developing and consulting optimization solutions for clients. Only one was a data scientist but had practical experience working on optimization problems. All interviews were conducted remotely and recorded using standard commercial video conference software with an automatic transcribing facility. The interviews took about 60 minutes on average, giving rich insights into our research questions. We know that this sample size is limited in terms of the number of participants and range of optimization experience. However, since our interview participants are experts with extensive experience in optimization, their views can be considered reliable and valid for the early insights we were looking for. Note that optimization is an extremely niche domain. One of the aims of AutoDO is to increase the accessibility of DO solutions to a broader user base that may not have significant OR/DO expertise. So, it is meaningful to engage with DO experts to design for the non-DO experts we aim for as target users. 3.1.2 Analysis. Thematic analysis is a popular method to uncover meanings from qualitative descriptions of experiences and contexts. Using thematic analysis, the interview data was analyzed to find patterns and themes of interest. The initial set of research questions guided the coding of this data and helped to formulate some actionable insights. 3.1.3 Results. The interviews' findings and implications for an automated solution are structured by the various themes and dimensions we identified during the analysis. Domains. Our interview participants reported first-hand experience across various domains like energy, transporta- tion, aviation, retail, finance, education, defense, semiconductors, telecommunication, and healthcare. This emphasizes 5 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. the relevance of decision optimization and its potential to help businesses drive timely and efficient decisions. Opti- mization models are required for tasks like determining production capacity, planning inventory, supply chain routing, operations, and maintenance scheduling, workforce planning, and manufacturing and warehouse management. The challenge is that these models are sensitive to a given business context, and they must be customized considering the constraints and objectives of each business or client. This makes it difficult to think of a generic DO model that is portable across contexts and domains. However, it appears that various optimization tasks can be broadly categorized into the following four categories based on factors like time and precedence: resource assignment (1), selection & allocation (2), supply & demand planning (3) and scheduling (4). For automated DO, this simplifies the problem space into a categorization that can enable building resources aligned to these four generic templates [R1]. For example, visualizations that are an important mode of communicating results with the stakeholders can be built to incorporate the essential characteristics and requirements for each category instead of customizing each business problem [R2]. User Identification and Characterization. Various internal and external stakeholders can be identified based on their needs and goals in generating a DO model. The interview data's roles, titles, and personas ranged from business representatives, business analysts, data engineers, data scientists, planners, quantitative analysts, developers, IT specialists, business consultants, and salespeople to one or more optimization experts. This is a broad spectrum of technical and non-technical expertise with clearly different but highly dependent roles in the workflow. This implies that any automated solution should ideally be collaborative if it intends to be a one-stop workbench for creating an end-to-end DO model [R3]. This, in turn, necessitates the characterization of skills and identification of goals explicitly when designing the user interface [R4]. One can also consider creating levels of complexity in the solution interface so that supported personas can easily navigate between more transparent and detailed or complex views of the pipeline. A hierarchical granularity or visibility into the execution flow may well serve the requirements of the diverse stakeholders involved at various stages of the solution process. Given the complexity of designing and implementing an end-end solution, it is likely that initial versions of automated DO can only support model development with explanations and a provision to import and export process modules (like input and output) for communicating with the broader set of stakeholders. Tools. We found that DO practitioners use a range of tools, often building customized UIs for clients. The popular modelling languages used are OPL, Python, Java and even C++ with a clear preference towards OPL by our expert sample. Specifically, OPL seemed to be the choice for building quick prototypes for client demos. From informal notes, whiteboard discussions, excel sheets, to the use of special and general purpose modelling languages and enterprise software suites – there seems to be a lack of a powerful one-stop workspace that offers end-to-end workflow support. A need for interactive visualizations at various levels of granularity was a key missing piece of technology identified in our data. It is worthwhile to explore designing a solution that supports an end-end workflow providing users with an integrated framework for ease and usability [R5]. Data Scientists as DO Practitioners. Data scientists are being considered as the primary target users for AutoDO. Even though most data scientists have a mathematical background they generally use statistical or machine learning techniques to derive insights from data or build ML models. Since AutoDO is also data-driven, the data scientists are a natural choice to be potential end-users. Our interviews with DO experts sought to understand potentials for introducing DO as a method to data scientists and the challenges they might face. While it is uncommon for data scientists to 6 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia solve DO problems, we did have one participant (ID 1) who had some experience in working on optimization problems. Interestingly, the challenges he faced had less to do with the modelling part but were mostly related to approaching the DO problems, framing or scoping them and explaining the solution to the clients. This echoes exactly with views of participant ID 2 who believes that optimization is just another technique that a data scientist can use but will require an understanding of the business and what one needs to model to be able to formulate the right problem. Understanding the business problem and not blindly taking data to try different things is what differentiates a data scientist from an optimization expert for ID 4. As ID 3 puts it – "DO is a different way of thinking that requires mapping between business to decision variables and constraints" and a lot depends on what would motivate a data scientist to consider DO for problem-solving (ID 4). This is an interesting aspect also mentioned by ID 5 saying that a "data scientist would be completely lost if they don't already know that the problem is an optimization one" or even ID 6 mentioning that "Data scientists do not uncover optimization opportunities". Highlighting the importance of business knowledge, ID 6 quantifies the role of a data scientist as relying about 70% on data and 30% on the business process and vice-versa for an optimization expert. For the former the question is about how to build an ML model from given data and infuse it into the existing process; while for an optimization expert a deep understanding of the business process and scoping it determines the data requirements. It is the thinking and refinement of the specified business problem within the given constraints that distinguish the optimization expert from the typical data scientist. To consider data scientists as target users for AutoDO depends a great deal on which aspects of the DO workflow are incorporated into it. Scoping or problem specification and model evaluation are the most challenging phases and in the real-world are conducted in close collaboration with other stakeholders like business analysts or subject matter experts. In the standard DO process, testing and validation of the solution on KPIs or against various scenarios and use-cases determines its acceptability. A data scientist in the role of an optimization solution builder has neither the mandate nor the proficiency to take this decision individually. Leveraging Automation and AI. We asked our participants about how automation or AI could help in overcoming some of the challenges and bottlenecks they currently face. We find that developers need tools to monitor performance and understand execution flow, while consumers need to trust and have confidence in the solution [R6]. Therefore, explanations and interactive visualizations that help monitor the execution and enable communication between all the stakeholders was unanimously called out. Testing the solution on historical data or using multiple scenarios, replaying decisions, ML guided tuning of solution, using visualizations to uncover bottlenecks, graphical interactive monitoring of solution, and gathering of insights are some areas where our participants desired tooling or automation support. Interestingly, there is a strong requirement for interactive UIs and rich visualizations in the community and AutoDO has an opportunity to make a convincing contribution in this space. 3.2 Business Domain Consultants' perspective We further aim to improve AutoDO's relevance to real-world use cases by conducting semi-structured interviews with business consultants. We sought consultants with deep knowledge in particular industries, rather than generalists, to learn about potential optimization problems within that specific industry. The interviews were based on the following six semi-structured questions: (1) What is your primary industry? (2) What kinds of clients do you work with in this industry? (3) What are main problems these clients face? 7 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. (4) Have you seen integration of AI in this industry? What does it do? (5) Which problems in this industry cannot be solved with AI? (6) Reinforcement Learning trains agents via reward and punishment for actions and can be good at making discrete decisions such as driving instructions for self-driving cars, moves in games such as chess and checkers, or recommendations in the stock market. Can you think of decisions in your industry that would be particularly helpful to automate? The interviews were scheduled for 30 minutes in length, and conducted remotely over video conference during the consultant's workday with two interviewers in attendance. A total of eight interviews were conducted with consultants (henceforward, 'specialists') specializing in Advertising, Agriculture, Automotive, Government (two consultants), Industrial Manufacturing, Oil, and Retail. Everyone except of the Oil specialist was hand-selected from a staff list of 547 global consultants. Our interviews consisted of three women and five men, ranging in age from early-career to mid-career. Information on age or race was not solicited. 3.2.1 Summary of findings. The Advertising specialist was an early-career generalist consultant who communicated that many of the core tasks in advertising are still time-consuming manual processes, and approximated the breakdown of big data, AI, and human input for each stage of the digital advertising work cycle. They believed that algorithms are efficient at optimizing many decisions, but that humans were necessary to drive high-level strategy and focus algorithms on particular tasks. They gave specific examples of automated processes that they believe required human input to function optimally. Based on our explanation of RL in question six, they believed that RL could be most useful for identifying the types of content that resonate with people. The Agriculture specialist was a mid-career consultant who grew up on a farm, had a formal education in Agronomy (agricultural consulting), and spent their entire pre-consulting career with agriculture firms. They claimed that farmers were generally distrustful of new technology, but that application of Big Data was increasingly common in agriculture. For example, farmers are now able to purchase crop insurance based on conditions such as the maximum outside temperature during a particular period, which is calculated using advanced underwriting models. The Automotive specialist was a mid-career consultant with additional background in retail consulting.They identified current trends in the automotive industry and felt RL's impact in the automotive industry were mainly related to self-driving cars as referenced in question six. When challenged to propose applications unrelated to the driving experience, they suggested RL could help manufacturers identify how to configure future cars according to consumer preferences. The first Government specialist had spent over a decade consulting for multiple government agencies. They have observed the demand for data within government agencies is changing. Particularly, they described how legacy systems had been adapted to meet modern demands for information access and transparency. They identified handling requests for security clearances as a potential application for RL. The second Government specialist had worked for various federal agencies, including defense and security agencies, before their time as a consultant. They believe that distributing and optimizing the use of resources across locations and agencies is the primary problem for the government organizations they had interacted with. They presented the potential issue of getting security clearance for AI models and programs. Their proposed RL use cases were for generating government reports and testing new applications. The Manufacturing specialist had prior experience at a coal power and mining firm, and had primarily consulted for coal, oil, and large pharmaceutical companies during their consulting career. The key insight from this conversation was the importance of constant analysis of the entire supply chain. They believed that much of the technical innovation 8 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia in the manufacturing industry is related to accurate modelling and analysis of when and how machines might fail, and that one of the biggest current problems in manufacturing is insufficient information. This specialist believed that AI could have the biggest impact on manufacturing by improving efficiency, and proposed use of RL to monitor the consumption, use, and disposal of raw materials according to material-specific considerations. The Oil specialist was a geologist by training, and had spent their consulting career working with oil companies in and off the coast of Texas. They identified pieces of the drilling process that are currently trial-and-error rather than data-driven, and offered that proper modelling and responses to models could significantly increase the longevity and output of wells. They also shared that oil infrastructure was an interconnected superstructure of equipment from many manufacturers, and navigating the supply chain required constant real-time communication between many different stakeholders. The Retail specialist had experience with some of the world's largest big-box retailers and responsible for overseeing the creation and acquisition of multiple e-commerce retail organizations. They shared thoughts on the emerging issues presented by the demand for retail delivery, the current state of warehousing and changing philosophies on stocking, and how to render the in-store experience online. 3.2.2 Discussion. The consultants offered useful and nuanced insight into how AI is currently employed in their respective industries and potential future applications. We found that questions related specifically to RL yielded less actionable results than general discussion about AI, which leads us to believe that business people have a good sense for AI's capabilities, but a limited sense of the differences between training methods. It seems useful for a tool to provide insights on the RL process to end users, so that it becomes clear how the training process yields the trained model [R7]. The discussion of specialized problems within particular industries highlighted the usefulness of breaking down templates of DO problems by industry. An interface that helps users identify the type of business their problem is centered on would help them more easily locate relevant solutions [R8]. We also learned of types of non-industry- specific business processes that are very relevant to multiple or all industries. These kinds of general business DO problem templates should also be made available within industries, even when they are shared among different industries [R9]. 3.3 Design Requirements Capturing experts' needs and interests from our detailed semi-structured interviews, table 1 summarizes requirements for human-centered automation for DO with RL. 9 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. Table 1. System requirements for human-centered automation for decision optimization. R1 Generic templates which align with common categories of DO problems. R2 Visualizations for DO problem categories rather than for each business problem. R3 Encourage collaboration between stakeholders. R4 Characterization of skills and identification of goals for supported personas. R5 R6 Support end-to-end workflow with an integrated framework for ease and usability. Promote trust and confidence in the solution. R7 Explain the RL training process for non-technical users. R8 Classify templates by industry for ease of location. R9 Provide templates for general business problems shared by multiple industries. 4 SYSTEM DESIGN 4.1 Integrating Core Engine and User Interface Elements AutoDO [36] is an end-to-end system for automated reinforcement learning using a bi-level nested search to optimize RL pipelines. More specifically, in the first level, the system admits pipelines with different flavours of RL, namely online and offline methods combined with model-free and model-based approaches. In the inner level, it further admits a mixed discrete and continuous search space to tune the RL agent hyperparameters as well as the neural architecture choices. The system employs different search strategies to traverse this complex search space such as random search, Bayesian optimization or a more recent multi-fidelity strategy based on limited discrepancy search [29]. The input to the system consists of a collection of RL agents and either a gym-compatible environment or a dataset containing tuples (s, a, r, s ′), where s and s ′ represent the current and respectively the next state of the underlying Markov decision process, a is the current action and r is the reward. Optimization problems can be provided in the form of RL environments based on the open-source toolkit OpenAI Gym [7], a Python programming interface. The RL agent then acts on the OpenAI Gym in a series of episodes, where each episode starts with a user-defined initial state followed by interactions with the environment until a user-defined termination criteria is reached. The performance of RL agents is assessed via user-defined a reward function. The output consists of a the set of top k pipelines produced by the joint pipeline and hyperparameter optimizer and representing the best performing agents with their hyperparameters. Based on this specification of the core engine, we identify three entities that need to be managed by the user of AutoDOViz: gyms (or environments), engine configurations, and resulting jobs (or executions). Regarding requirement R3, we also propose organizing these entities in projects, which can then be shared among stakeholders. For example, a business domain user does not necessarily need to be able to modify the gym implementation. However, they might want to trigger a gym execution and assess high-level visualizations. While gyms are only accessible within a project, configurations of the AutoDO engine can be shared across projects. Thus, users can bring along configurations that work well in other cases when they move on to a new project. Figure 2 shows the project dashboard with a clear layout and a simple table view for each of the three entities. Figure 3 depicts the configuration wizard of AutoDOViz. The left hand side pane shows the list of selected RL agents. The right hand side shows the tunable hyperparameters of a particular agent (e.g., d3_bear). For each hyperparameter we specify the type, possible values if discrete or the range if continuous, as we well as the default value. The result 10 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia Fig. 2. Project dashboard in AutoDOViz Users can manage gyms, engine configurations and trigger RL agent training. of this configuration phase is the definition of the joint pipeline and hyperparameter search space traversed by the AutoDO engine. We handle the user interface elements for gyms in more detail throughout sections 4.3 and 4.4, as well as for job results/executions in sections 4.5 and 4.6. 4.2 (Remote) Execution with Streaming Architecture User experiences for automation often incorporate an explicit Human-in-the-loop (HitL) mechanism [18, 33, 38, 52, 59]. Users of HitL optimization systems are part of the optimization process after every turn of the automation (see Figure 4). In our implementation, specifically under consideration of R5, we aim to evolve this approach towards a more involved Human-within-the-loop (HwtL) process (Figure 4 right). With HitL being an important aspect of designing automated optimization systems, designing more towards HwtL should lead to beneficial progress of an intelligent user interface [38]. Since HwtL constitutes a very high technical challenge, in this prototype we currently only support real-time tracking of the AutoDO engine, which means the user already has full transparency of the process at any step of the process. As we will now describe details of our streaming architecture, we would like to highlight that full real-time manipulation of the engine is not yet part of this work, but will benefit from the same architectural design in a future iteration of the software. For example, users will then also be able to add/remove RL agents or modify hyperparameter search constraints in real-time during the execution of the engine to focus computational resources or to allow for quick intermediate What-If? scenarios. Figure 5 shows a sequence diagram of our proposed architecture towards HwtL featuring a controller plane in action. When users want to execute a job in our user interface, the controller manages workers, their execution, and logging of progress in real time. The controller first only creates an entry about the job to be executed in the database. In return, 11 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. Fig. 3. Optional AutoDO engine configuration in AutoDOViz. Users can toggle individual agents and set hyperparameter search constraints. Fig. 4. Human-within-the-Loop. Instead of round-based interaction at the beginning and end of each cycle (left), we aim to include the user in automation in real-time to promote high interactivity and usability. the controller receives a job ID. The controller then deploys a Dockerized version of the AutoDO engine in a custom cluster provided by the user or executes in a shared cluster. In both cases the job ID is handed to the worker, together with an API token. The worker starts execution of the AutoDO agent search given the selected gym and configuration in the database found via the job ID. During the execution, the worker can log events via the controller in real-time. The user interface can now present logs, charts, graphs or agent policies in real-time as events stream in from the worker. This offers an substantive improvement over the classical turn-based execution of experiments where results are made 12 Human-in-the-loopConfigure experiment, run, wait till finished, then reconfigure & rerunHuman-within-the-loopChange experiment in real-time as it progresses, not only before it started or after it ended AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia Fig. 5. (Remote) Execution in AutoDOViz: The sequence diagram outlines the interplay between users, API controller and compute cluster workers to track RL agents, allowing the user interface to present logs, graphs and report on agent progress in real-time. available at termination of a run. The next iteration of our HwtL approach will allow for direct manipulation of running experiments. 4.3 Gym Composer Our system greatly expands on the OpenAI gym interface and provides a mechanism to create gyms through a composer. The composer provides several abstractions to ease creation of the gym. Specifically, definitions of observation and action space, along with reward function primitives allow the user to focus on specifying the main logic of state transitions. The system, as shown in Figure 6, aids in composing gyms using industry-specific templates for a broad range of sectors. An end-user still has several choices to make on how best to model the environment. The first choice users face is on deciding state variables, a minimal set of quantities that describe the system dynamics. Next the user is guided through the definition of a transition function, the reward function which can be comprised of a linear combination of individual metrics, as well as a termination criteria. Once the user is satisfied with their inputs to the gym composer, our API controller can auto-generate the final Python implementation script from these, which in turn serves as input to the AutoDO engine. 4.4 Gym Template Catalog With respect to R1, R8, R9 we propose a gym template catalog. While a type-driven categorization according to R1 is already provided by the DO researchers, we parsed options for a more domain-driven hierarchy towards R8. Our research on methods for classifying different kinds of business problems led us to the North American Industry Classification System (NAICS) as a robust and continually-improving breakdown of different industries. It was created jointly between the governments of The United States, Canada, and Mexico, and is updated every five years to capture emerging industries and technologies. The NAICS summarizes industries into 20 sectors, and hierarchically expands 13 create job Controller API (public)Worker private ClusterDBdeploy dockerstart joblog to DBlog resultUserfinishmark finishpoll state IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. Fig. 6. Gym creation in AutoDOViz. Users can provide OpenAI gyms in three alternative ways: (A) Compose gym via guiding Gym Composer. (B) Directly upload gym from Python file. (C) Choose gym from Gym Template Catalog. into 1,012 unique industries.2 Figure 7 shows the design of our template catalog in AutoDOViz. Users can click through the catalog hierarchy via tiles on each level, with the parent node pinned to the top with a blue border. When arriving on a leaf-level, the catalog shows the list of available templates. Upon loading a gym template from the catalog the gym composer (ref. section 4.4), the composer is prefilled with the corresponding inputs so the user can study the environment and make customized changes according to their exact optimization problem. 4.5 State-Transition Visualizations In order to promote trust and confidence into agents R6 as well as to add to more generic visualization techniques R2 we propose two types of visualizations as part of AutoDOViz. Consider a typical evaluation protocol as provided in table 2, consisting of chosen action, state of the environment and reward at any step in the process. Figure 8 then depicts a graphical representation of the evaluation protocol, with states as vertices of the graph and the trajectory of the agent shown as edges. The time step of transition is shown as labels on the edges. 2https://www.census.gov/naics/ 14 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia Fig. 7. Gym Template Catalog in AutoDOViz. Gym templates can be explored optimization-type-based or industry-based (ac- cording to the NAICS standard). Table 2. Typical RL agent evaluation protocol. ... ... 72 75 +1 Step Action State Reward δReward ... tk tk+1 tk+2 tk+3 tk+4 tk+5 tk+6 ... ... A1 A2 A3 A1 A3 A2 A3 ... ... S1 S3 S1 S4 S2 S1 S3 ... +3 +3 +2 +4 74 80 81 82 78 -1 -1 ... ... S3 S4 tk+1 tk+6 tk+2 tk+3 tk+4 S1 tk+5 S2 Fig. 8. Temporal transition graph. Transition Matrix. Since edge labels become impractical with larger evaluation protocols, we propose a level of abstraction as shown in table 3. Here, we infer an adjacency matrix from the evaluation protocol and count the number of the times the agent moves between any two states. A similar abstraction can be made for the action space as shown in table 4. While not preserving the information on sequence of steps in such transition matrices, it allows for a very compact representation of the transition pattern, which can favor comparison of many RL agents and large protocols. 15 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. Table 3. State transition matrix. Table 4. Action transition matrix. S1 S2 S3 2 S4 1 1 1 1 S1 S2 S3 S4 A1 A2 A3 1 1 2 1 1 A1 A2 A3 Transition Graph. From the abstracted adjacency matrices we can render graphs, as shown in figures 9 and 10 respectively. Here, the number of times the agent transitioned between any two states is encoded via the thickness or opacity of the edge. Note that compared to prior work, where projection of the state space happens solely based on the feature space of the environment, the proposed graph-based approach adjusts proximity of states taking into account the transitional behavior of the agent. S3 2 1 S1 1 1 S4 1 S2 A2 1 A1 2 1 1 1 A3 Fig. 9. State transition graph Fig. 10. Action transition graph. Scalability. In AutoDOViz, we implemented both the matrix and graph-based technique to present behavioral information about the agent. With real-world evaluation protocols having larger action or state spaces and going into the thousands of steps per episode, our visualizations need to be able to scale well. With respect to transition matrices, where the scalability bottleneck is the dimensionality of the matrix, the user can cluster states prior to abstraction of the matrix. This scales since the matrix will then be limited to a user-defined dimensionality k the number of clusters. Furthermore, states can be filtered based on certain criteria even before going into the clustering algorithm. Figures 11 and 12 depict a 10-means clustering of states before and after training. Initial random behavior of the agent is replaced by more selective transitions during training, as to avoid less rewarding states of the environment. 16 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia Fig. 13. Transition graph: States are projected with multi-dimensional scaling before augmenting the tour of the RL agent. Fig. 11. Clustered state transitions of early training episode. Fig. 12. Clustered state transitions of late training episode. While the transition graph could in principle cope with thousands of states directly in the visualization (even without prior clustering) the bottleneck is the time to compute the projection of the states, i.e. the exact X ,Y or X ,Y ,Z coordinates of the state nodes. For AutoDOViz, we therefore implemented state-of-the-art graph layout algorithms [6, 45, 62] in JavaScript to speedily compute layouts in the browser in 2D or 3D. Figure 13 shows an example where states of an evaluation protocol are projected with stress-based dimensionality reduction. We then depict the tour of the agent as it moves from state to state. Here, the thickness of an edge encodes the time of the step, so that later transitions can again be distinguished from earlier transitions. 4.6 Policy Explanations Once end-users have selected one or more agents of interest, they may inspect the agent's behavior using a surrogate rule set. The surrogate rules are learnt using observed state-action pairs of the policy behaviour in order to classify the action taken by the agent based on the state [37]. The resulting surrogate is a set of boolean logic rules that attempt to encompass and translate an agent's behavior in the most compact way possible. Rules are hierarchical, the first covers the largest population in the data, then any unexplained data points are covered by the second rule, followed by the 17 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. Fig. 14. Extracted surrogate rule set third etc. In order to approximate an agent's behavior in the form of rules, users may choose a set of evaluations over a predefined interval of episodes, ranging from 0 to 20. The rule extraction method performs more accurately with more inputs but early episodes may not be as representative of the final agent as the final episodes. Once this interval is selected, all evaluations are concatenated into one, then users are required to select and batch a desired column into buckets as rules require a categorical prediction label. Once this batching process is completed, the selected column is discarded and rules are generated for each available prediction label. These are displayed as a list of boolean rules with their respective coverage chart as well as a global coverage tree map, displaying the weight of each rule. Boolean rules enable end-users to quickly understand an agent's behavior and compare it to other similar agents, providing better comparative insights than simple accuracy scores. 5 EVALUATION 5.1 User Study with Data Scientists Building on results of prior expert interviews potential target end-users for AutoDOViz were identified to be data scientists. To validate this assumption and the platform's development with regard to design requirements a user study was conducted with 13 data scientists3 employed internally in the company from across 8 different countries, with varying levels of ML experience. Participants were recruited both from pools of self-selecting volunteers via an open call on the company's internal messaging software, and others whom were contacted directly. The participants were 3University collaborators were not directly involved in conduction of the user study with human subjects so this study is not subject to federal IRB oversight. IBM Business Conduct Guidelines have been followed at all times https://www.ibm.com/investor/governance/business-conduct-guidelines. 18 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia not additionally compensated for their time. Participants were given no prior knowledge of study content apart from that it was to test a novel UI aimed towards data scientists. The aim of the study was to broadly evaluate whether the system successfully affords the user the ability to employ AutoDOViz to create and manage gyms and configure agents, as set out by the design requirements in section 3.3 and design choices made in section 4. We also aimed to evaluate the UI to identify any usability concerns and to solicit feedback about potential improvements to the tool. The study took the form of a 45 minute online session for each participant comprising a set of tasks and a semi-structured interview, which was recorded for later analysis. Detail about the participants is given in Table 5. Each participant was guided by an interviewer to complete a pre-study questionnaire, complete a list of tasks using an online environment and then complete a post-study questionnaire to reflect upon the experience. Pre-study Questionnaire. This questionnaire contained 14 questions covering demographic information to learn more about the participants as well as questions to determine their level of prior knowledge and trust in Auto ML, reinforcement learning, and decision optimization. Tasks. Participants were encouraged to "think aloud" as they followed through a set of tasks. In order to account for differing knowledge levels, an explanation of the concept of OpenAI gyms was given to some of the participants. When incorrect basic assumptions were made, help was provided to allow them to proceed with the tasks if necessary. Participants were asked to answer questions designed to check their ability to gather information from different parts of the UI and to assess their understanding of the scenario. After the interviews, participants' task responses were categorized as correct/successful or incorrect/fail by the interviewers, taking into account the level of additional help required to get through the tasks. As earlier interviews with DOs highlighted the importance of a thorough understanding of the business problem and processes rather than simply understanding through the lens of data, scenarios were prepared using real-world examples to allow assessment of both how well the UI assisted in data scientists' understanding of the business problem, as well as their success in creating, editing and configuring OpenAI gyms and jobs using the composer interface. In the first scenario, participants were asked to use the online environment and a configuration file to create and modify an OpenAI gym representing a bakery (ref. figure 15), which included details of certain recipes and how these affected inventory levels. Participants were provided with a link to an online tool and a pre-configured JSON file containing details of the bakery to use to complete the task. The questions were designed to guide them through the process of creating a gym and creating and modifying jobs and configurations, and assess their understanding of the optimization problems posed in the bakery. Participants were asked to use the catalog to load another scenario based on a produce arrangement problem of the chemical reactions between different fruits (described in section 3.2) and asked to create an additional metric which determines the distance between specified fruits. Post-study reflection. The post-study questionnaire took the form of 14 questions, including 11 5-point Likert agreement scale questions attempting to assess trust in the system, ease of use and usefulness of the UI and visualizations, attitude to the catalog and any change in their self-reported level of understanding of reinforcement learning. Free-text sections were provided for the participants to record what they liked and disliked about the tool. These were used as a basis for informal discussions with the participants to further determine their attitudes to the tool and how it might fit into their current workflows. 19 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. Fig. 15. Job preview screen in AutoDOViz: Execution of a job to evaluate agents on Bakery-gym during user study. 5.2 Results In the following subsections we report results from our user study leading up to a discussion of our findings and limitations in section 6. 5.2.1 Pre-study questionnaire. Table 5 shows the demographic data on user study participants. While gender is balanced (A1), age distribution leans towards younger professionals (A2). Yet, 23.1 % of participants were above the age of 51, with 1 participant above the age of 61. All participants had a university degree, with the majority of participants having advanced degrees (A3), also in fields outside of computer science, data science or artificial intelligence (A4). All users had prior experience in machine learning or data science, with the majority between 2 and 10 years, and 1 outlier with up to more than 30 years of experience in machine learning (A5). Many (46.2 %) users stated that they had no prior experience with decision optimization (A6). In self-assessment, 84.61 % of users reported to have worked or frequently work with automated machine learning (A7). Furthermore, 61.5 % of participants state to have worked with RL before (A10), however, only 30.8 % claimed skills beyond beginner level (A8). All participants with prior RL experience have seen or directly experimented with OpenAI Gym implementations before. Less than half of the users seemed interested in applying AutoDO in real-world problems with clients (A9). However, 69.2 % reported they would trust automated decision optimization (A12). Regarding the execution environment for RL agent optimization workers, only 1 user felt comfortable to use automated decision optimization in a shared environment, 38.5 % preferring to exclusively work in custom environments, and 53.9 % with the desire for both (A13). 5.2.2 Tasks. Task B1 was correctly executed by all but 2 users, who were unable to find the button to open their project after creation. Loading from file (B2) or catalog (B3) was mostly successful, however, with few templates in our catalog, 20 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia Table 5. Participant demographic data gathered from pre-study questionnaire A1 Gender A2 Age A3 Degree A4 Field of study 51 - 60 2 (15.38 %) 41 - 50 0 (0 %) PhD 3 (23.08 %) Male 7 (53.85 %) 31 - 40 2 (15.39 %) Master 6 (46.15 %) Female 6 (46.15 %) 20 - 30 8 (61.54 %) Bachelor 4 (30.77 %) Data Science & Artificial Intelligence (3), Computer Science (3), Physics (2), Design Engineering (1), Electrical Engineering (1), Geospatial Science (1), Computer Applications (1), Tourism & Communication (1) 61 - 70 1 (7.69 %) A5 Experience with ML/DS (years) A6 Experience with DO (years) 0-1 1 (7.69 %) 0 6 (46.15 %) 2-4 6 (46.15 %) 1 4 (30.77 %) 5-10 3 (23.08 %) 2-3 3 (23.08 %) 11-30 2 (15.38 %) 30+ 1 (7.69 %) Table 6. Results pre-study questionnaire (Scale 1 to 5) A7 Experience AutoML A8 Experience RL A9 Interest in AutoDO A10 A11 A12 Trust in AutoDO A13 Previously worked with RL Previously used Simplex algorithm 3 (23.08 %) 9 (69.23 %) Shared 1 (7.69 %) Preferred execution environment. 1 1(7.69 %) 1 (7.69 %) 1 (7.69 %) Yes 8 2 1 (7.69 %) 3 (23.08 %) 1 (7.69 %) No 5 10 (76.92 %) 4 (30.77 %) Custom 5 (38.47 %) 3 5 (38.47 %) 5 (38.47 %) 5 (38.47 %) 4 2 (15.38 %) 4 (30.77 %) 2 (15.38 %) 5 4 (30.77 %) 0 (0 %) 4 (30.77 %) Both 7 (53.85 %) 3 participants were confused as to why the template counter in the category tiles did not change and needed little guidance drilling down the hierarchy. Reading simple information about the gym (B4-6) was easy enough for most users, however 3 users gave the right answer based on reading from the wrong location: when asked about the length of the state vector they instead read the length from the observation space. The advanced task of adding a custom reward metric to a gym was successfully completed by 84.6 % of the users. All users correctly explained the transition function, with 8 (5) people giving a very precise, problem-specific (more general) explanation. Further, 9 (5) participants provided precise, problem-specific (more general) explanations on the termination criteria, with only 1 person failing to provide a meaningful description in the given scenario. Regarding tasks to modify the configuration of the AutoDO core engine (B10-12), almost all users correctly solved all tasks, with only 1 person changing the number of pipeline workers rather than the number of optimization workers. Tasks concerned with the interpretation and launch of automation jobs (B13-17) were successfully executed by all participants. A single user misread the number of active agents despite looking at the right information in the tool. In B18-19 users were presented transition matrix and transition graph visualizations and asked to answer a total of 6 questions associated with the interpretation of the visualizations: number of clusters, behavioral changes before and after training, tour of the agent. All participants gave the correct answers, 21 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. Table 7. Results tasks Correct/success Incorrect/fail Project B1 Create Gym B2 Load from file B3 Load from catalog B4 Read size of action space B5 Read length of state vector B6 Read reward B7 Add reward metric B8 Explain transition function B9 Explain termination criteria Configuration B10 Change number of workers B11 Enable/disable agents B12 Change agent hyperparameter Job B13 Read number of workers B14 Read number of agents B15 B16 Read agent hyperparameter B17 List 3 agents Launch Visualization Interpret matrix Interpret graph TOTAL B18 B19 11 12 10 13 10 13 11 8 + 5 9 + 3 12 13 13 13 12 13 13 13 2 1 3 0 3 0 2 0 1 1 0 0 0 1 0 0 0 12 12 230 (93.1 %) 1 1 17 (6.9 %) with 2 different participants answering only partially correctly in some of the 6 questions. Overall, 93.1 % of the tasks were executed correctly. 5.2.3 Post-study questionnaire. Table 8 shows results of the post-study questionnaire with a Likert scale from 1 (strongly disagree) to 5 (strongly agree). 92.3 % of the participants found the gym composer to be helpful or very helpful (C1). 84.6 % strongly agreed that the visualizations provided useful insights on RL agents (C2). All users found it very easy to launch jobs once a gym was created (C3). 11 of 13 participants strongly agreed that knowing the behavior of individual metrics of reward functions made them more comfortable using an agent in production (C4). While not all participants felt a strong desire to contribute to the gym template catalog (C5), 92.3 % could see themselves consulting the template catalog before coding a gym themselves (C6). 10 participants expressed strong preference to be able to fine-tune the AutoDO engine with configurations (C7). 69.2 % agreed to trust or strongly trust AutoDO, with only 4 participants being neutral. No participant reported distrust (C8). 9 participants expressed strong or advanced understanding of RL after our study, 2 were neutral and only 2 participants reported less than neutral understanding of RL (C9). 92.3 % of users would like to use AutoDO in their own projects with only 1 user being neutral (C10). Lastly, 3 participants did not necessarily prefer to execute AutoDO jobs in a custom environment rather than a shared one, 5 participants were neutral, 3 would prefer to and 2 users would strongly prefer to execute AutoDO in their custom environment/private cluster (C11). 22 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia Table 8. Results post-study questionnaire C1 Gym Composer C2 Visualizations C3 Launching jobs C4 Reward metrics C5 Catalog contrib. C6 Catalog consult. C7 Engine config C8 Trust AutoDO C9 Understand RL C10 Apply AutoDO C11 Custom env. 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 2 0 3 3 1 2 0 0 4 1 1 4 2 1 5 4 6 5 0 2 3 0 2 5 3 2 3 5 6 6 13 11 6 12 10 4 6 10 2 5.2.4 Post-survey likes, dislikes and reflection. Participants made comments in the post-survey questionnaire relating to specific UX improvements (5 comments), and need for additional on-screen explanation for less familiar users (2 comments). Areas which they felt could be improved included user experience for small screen-size users, to reduce the amount of scrolling necessary in the composer screen while trying to remember relevant information. The agent listing screen was also something users felt could be refined. One user felt that interpretability of visualizations should be improved. Three participants reported that there was nothing in particular they disliked about the tool. Other suggestions included time sliders to replay real-time feedback on the visualizations of the agents' progress. The participants reported things they liked which can be summarized as the overall experience was reported as intuitive (5 comments), easy to work with (6 comments), customizable (4 comments) and transparent (1 comment). Participants called out the visualizations as an element that they found useful (4 comments). It was appreciated that the code and the builder were presented side-by-side and that the UI was generally fun to use. The interviewer discussed these reflections further with the participants to ensure that their feedback was being interpreted as intended. In general, the written feedback comments suggest that the tool is perceived as both useful and highly usable. 6 DISCUSSION 6.1 Trust, control & transparency A surprisingly high level of trust in automated decision-making was already reported in the pre-study questionnaire (A12), with 69.23% of participants in agreement that they had confidence in automated DO and 30.77% against it. Several participants expressed reservations about the trust question as they wished to qualify that it could be circumstance- dependent. Still, it could be that as people involved daily in ML, they had some idea of the potential problems and rewards. "Perfectly comfortable with it. I know the pros and cons. I know what can go wrong. Uh, yeah, so that's the qualified yes." After the study, we can see that the same amount of participants remains positive, but the remainder has moved to a neutral position (R6). "I mean, I couldn't even see what happens in the back end, but it does seem to inspire trust". Participants further appreciated that the UI allowed them to customize gyms and job configuration quickly; this appeared to positively affect perception of control of the tool and its output (R5). Although they have a level of trust in AI, they wish to remain able to verify and control the system's output. "Definitely having that control to a certain extent... that's definitely preferable." "Yeah, I mean, ... especially if you're an expert user... you know how machine learning works, what kind of things you want to leave to the machine, and which type of things you want to control yourself." 23 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. Transparency was an aspect participants felt was imperative, particularly on metrics. "knowing how it's measured, that makes one more comfortable." The majority appeared to scroll through the generated gym code output to verify and understand. "Just having insights into what is doing, maybe what are some of the trade-off that it is making... to get a little bit more of that,... " 6.2 Accessibility for novice and expert users The initial interviews suggested that the tool should support users of multiple optimization problems (R4). The tool aimed to balance wizard-style tasks for entry-level and direct code access to gyms for more experienced users. This appears to have been successful in that both low-code and code-first configurations are supported, and the participants recognized this. Some advocated for low-code solutions with even more adaptations for novice users, such as UI labels for the state. "Well, compared to code, it makes it much more accessible, that's for sure. If that's the alternative, I'll take this tool any time of the day for these kinds of things. So that's, I think, a big plus. It makes the code a little bit less daunting and makes it easier to use" Others were more comfortable having a flexible approach but thought that the UI would increase their efficiency and save time when creating a gym. "I like the flexibility of having code there." Overall, the feedback would suggest that the UI successfully allows data scientists to learn to automate DO tasks with RL quickly. "Kudos to you guys! I liked it as a beginner and someone who's not used these things in my day-to-day project. I think it was it was very user-friendly." 6.3 Leveraging the UI as an educational tool We observe that participants' previous level of RL knowledge did not correlate directly to their success in completing the required tasks, or the fluency in which they could navigate the interface. The tool and the experience of completing the tasks in the user study attempt to make the complex area of RL more palatable to the novice user, as directed by requirement R7. This is supported by the increase in self-reported understanding of RL (C9) and comments from participants. "having had almost no experience with this, it was intuitive enough for me to follow and, you know, just get a sense of what was happening." (R7) 6.4 Collaborative potential & resource sharing With respect to the gym template catalog (R1, R8, R9), participants seemed well-disposed towards finding and reusing code samples from the catalog for different domains. "As a new user, you probably want to have a look for some examples before you go in and try on yourself". However, they were less sure that they would contribute to the catalog due to concerns about client confidentiality for their work. One user in particular seemed eager to collaborate in AutoDOViz with their clients and external stakeholders (R3). "With this tool, it's something that I would consider playing around with, coming up with use cases, you know, doing some testing. That's definitely something. Even opening this conversation with clients... and thinking of use cases in the industry could be beneficial. But definitely, this is this could be a conversation starter for sure". Several participants asked when AutoDOViz would be integrated into their existing toolkits for them to start to experiment with it for clients. "I'm a data scientist within client engineering, so we work on... 6 to 8-week intervals with their clients and create a product within that, an MVP or proof of concept. So definitely, something like this, I can see, is very helpful, rather than me focusing on, like, the little itty-bitty like the parameters. I think you should have a Kaggle mindset to see how you can make the best model, but to have something that works and the client's happy with it. I think this is a good option." 24 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia When questioned about attitudes to working in a shared versus a custom environment (C11), it emerged that this is highly use-case dependent (R1, R8), on customer need driven by security, privacy, and cost factors. Participants working in pre-sales on customer demos would have a different perspective than those working on government projects. 6.5 Design decisions & mental model The UI was designed and developed using a UI framework that was familiar to the data scientists from other software that they used daily (R2). This consistency was appreciated by some of the participants and they suggested that it helped them navigate through the tasks more smoothly. "Right and the placement also, right? I mean, yeah, it helps to... it's sort of like muscle memory that okay I know where to find." "As a whole, it kind of fits my mental model. I think of where you would click and where you would find things. So, that fits well as well...it's kind of logical that way." 6.6 Limitations Although the population was diverse in age and experience level, all participants were selected from the same company, which might yield familiarity with similar tools. This could potentially affect the generalization of results if the study was replicated with external participants (external validity). Overall, we could criticize differing ML/RL knowledge levels amongst participants, such as using a task script augmented by verbal instructions and discussion, which differed slightly for each participant. Also, the participants are subjectively self-reporting their skill level (internal validity). The tasks and examples chosen could be simpler than those encountered in real-world scenarios. However, we needed to balance ease of access for a beginner and an experienced user (construct validity). Another limitation could be the question of how to measure trust in AutoDOViz. Yes-No questions may not provide the nuance that participants expressed verbally since there were a few "Yes, but..." responses. 7 CONCLUSION AND FUTURE WORK We presented AutoDOViz, an interactive user experience for automated DO with RL. Findings from semi-structured expert interviews with DO practitioners and business consultants generated design requirements for human-centered automation for DO. We implemented a system design and evaluated our software in a rigorous user study with data scientists. We found that they are significantly more open to engaging in DO after using our proposed solution. AutoDOViz promotes trust and confidence in RL agent models via reward metrics and makes the automated training and evaluation process more accessible and understandable. This is further expanded by leveraging the benefits of AutoDO algorithms for RL pipeline search to generate policy insights and advanced visualizations to enable communication between DO experts and domain experts. The novel gym composer and proposed gym template catalog lower the barrier of entry for data scientists in problem specification for RL problems. The provided streaming architecture enables Human-within-the-Loop for enhanced interaction, with real-time manipulation subject to future work. The user study further gave rise to helpful design improvements in the overall user interface. Future work will be conducted in the direction of real-world applications for our proposed system to test and demonstrate the interface's efficiency amongst various personas. In this regard, we would also like to iterate on the application to become role-based and add collaborative features directly to the interface. Lastly, more problem-specific visualizations will make the agents' performance more interpretable and explainable. 25 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. REFERENCES [1] Dan Amir and Ofra Amir. 2018. Highlights: Summarizing agent behavior to people. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems. 1168–1176. [2] M Emin Aydin and Ercan Öztemel. 2000. Dynamic job-shop scheduling using reinforcement learning agents. Robotics and Autonomous Systems 33, 2-3 (2000), 169–178. [3] Maria Barbati, Giuseppe Bruno, and Andrea Genovese. 2012. Applications of agent-based models for optimization problems: A literature review. Expert Systems with Applications 39, 5 (2012), 6020–6028. [4] Andrew G Barto, Satinder Singh, Nuttapong Chentanez, et al. 2004. Intrinsically motivated learning of hierarchical collections of skills. In Proceedings of the 3rd International Conference on Development and Learning. Piscataway, NJ, 112–19. [5] Ekaba Bisong. 2019. Google AutoML: cloud vision. In Building Machine Learning and Deep Learning Models on Google Cloud Platform. Springer, 581–598. [6] Ulrik Brandes and Christian Pich. 2006. Eigensolver methods for progressive multidimensional scaling of large data. In International Symposium on Graph Drawing. Springer, 42–53. [7] Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. 2016. Openai gym. arXiv preprint arXiv:1606.01540 (2016). [8] Angelos Chatzimparmpas, Rafael Messias Martins, Ilir Jusufi, Kostiantyn Kucher, Fabrice Rossi, and Andreas Kerren. 2020. The state of the art in enhancing trust in machine learning models with the use of visualizations. In Computer Graphics Forum, Vol. 39. Wiley Online Library, 713–756. [9] Po-Wen Chiu and Christina Bloebaum. 2008. Hyper-Radial Visualization (HRV) for decision-making in multi-objective optimization. In 46th AIAA Aerospace Sciences Meeting and Exhibit. 907. [10] Piali Das, Nikita Ivkin, Tanya Bansal, Laurence Rouesnel, Philip Gautier, Zohar Karnin, Leo Dirac, Lakshmi Ramakrishnan, Andre Perunicic, Iaroslav Shcherbatyi, et al. 2020. Amazon SageMaker Autopilot: a white box AutoML solution at scale. In Proceedings of the fourth international workshop on data management for end-to-end machine learning. 1–7. [11] Pieter Desmet and Paul Hekkert. 2007. Framework of product experience. International journal of design 1, 1 (2007), 57–66. [12] Finale Doshi-Velez and Been Kim. 2017. Towards a rigorous science of interpretable machine learning. arXiv preprint arXiv:1702.08608 (2017). [13] Mengnan Du, Ninghao Liu, and Xia Hu. 2019. Techniques for interpretable machine learning. Commun. ACM 63, 1 (2019), 68–77. [14] Mary T Dzindolet, Scott A Peterson, Regina A Pomranky, Linda G Pierce, and Hall P Beck. 2003. The role of trust in automation reliance. International journal of human-computer studies 58, 6 (2003), 697–718. [15] Matthias Feurer, Aaron Klein, Katharina Eggensperger, Jost Springenberg, Manuel Blum, and Frank Hutter. 2015. Efficient and robust automated machine learning. Advances in neural information processing systems 28 (2015). [16] Jasmina Gajcin, Rahul Nair, Tejaswini Pedapati, Radu Marinescu, Elizabeth Daly, and Ivana Dusparic. 2022. Contrastive Explanations for Comparing Preferences of Reinforcement Learning. In AAAI Conference on Artificial Intelligence. [17] Claudio Gambella, Bissan Ghaddar, and Joe Naoum-Sawaya. 2021. Optimization problems for machine learning: A survey. European Journal of Operational Research 290, 3 (2021), 807–828. [18] Yolanda Gil, James Honaker, Shikhar Gupta, Yibo Ma, Vito D'Orazio, Daniel Garijo, Shruti Gadewar, Qifan Yang, and Neda Jahanshad. 2019. Towards human-guided machine learning. In Proceedings of the 24th International Conference on Intelligent User Interfaces. 614–624. [19] Samuel Greydanus, Anurag Koul, Jonathan Dodge, and Alan Fern. 2018. Visualizing and understanding atari agents. In International conference on machine learning. PMLR, 1792–1801. [20] Marc Hassenzahl and Noam Tractinsky. 2006. User experience-a research agenda. Behaviour & information technology 25, 2 (2006), 91–97. [21] Wenbin He, Teng-Yok Lee, Jeroen van Baar, Kent Wittenburg, and Han-Wei Shen. 2020. DynamicsExplorer: Visual analytics for robot control tasks involving dynamics and LSTM-based control policies. In 2020 IEEE Pacific Visualization Symposium (PacificVis). IEEE, 36–45. [22] Martin Hirzel, Kiran Kate, Parikshit Ram, Avraham Shinnar, and Jason Tsay. 2022. Gradual AutoML using Lale. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. 4794–4795. [23] Fred Hohman, Minsuk Kahng, Robert Pienta, and Duen Horng Chau. 2019. Visual Analytics in Deep Learning: An Interrogative Survey for the Next Frontiers. IEEE Transactions on Visualization and Computer Graphics 25, 8 (2019), 2674–2693. https://doi.org/10.1109/TVCG.2018.2843369 [24] Theo Jaunet, Romain Vuillemot, and Christian Wolf. 2020. DRLViz: Understanding decisions and memory in deep reinforcement learning. In Computer Graphics Forum, Vol. 39. Wiley Online Library, 49–61. [25] Haifeng Jin, Qingquan Song, and Xia Hu. 2019. Auto-keras: An efficient neural architecture search system. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining. 1946–1956. [26] Leslie Pack Kaelbling, Michael L Littman, and Andrew W Moore. 1996. Reinforcement learning: A survey. Journal of artificial intelligence research 4 (1996), 237–285. [27] James Max Kanter and Kalyan Veeramachaneni. 2015. Deep feature synthesis: Towards automating data science endeavors. In 2015 IEEE international conference on data science and advanced analytics (DSAA). IEEE, 1–10. [28] Udayan Khurana, Deepak Turaga, Horst Samulowitz, and Srinivasan Parthasrathy. 2016. Cognito: Automated feature engineering for supervised learning. In 2016 IEEE 16th International Conference on Data Mining Workshops (ICDMW). IEEE, 1304–1307. 26 AutoDOViz: Human-Centered Automation for Decision Optimization IUI '23, March 27–31, 2023, Sydney, NSW, Australia [29] A. Kishimoto, D. Bouneffouf, R. Marinescu, P. Ram, A. Rawat, M. Wistuba, P. Palmes, and A Botea. 2022. Bandit Limited Discrepancy Search and Application to Machine Learning Pipeline Optimization. In AAAI Conference on Artificial Intelligence (AAAI). 10228–10237. [30] Hoang Thanh Lam, Johann-Michael Thiebaut, Mathieu Sinn, Bei Chen, Tiep Mai, and Oznur Alkan. 2017. One button machine for automating feature engineering in relational databases. arXiv preprint arXiv:1706.00327 (2017). [31] Effie Lai-Chong Law, Arnold POS Vermeeren, Marc Hassenzahl, and Mark Blythe. 2007. Towards a UX manifesto. In Proceedings of HCI 2007 The 21st British HCI Group Annual Conference University of Lancaster, UK 21. 1–2. [32] Erin LeDell and Sebastien Poirier. 2020. H2o automl: Scalable automatic machine learning. In Proceedings of the AutoML Workshop at ICML, Vol. 2020. [33] Doris Jung-Lin Lee and Stephen Macke. 2020. A Human-in-the-loop Perspective on AutoML: Milestones and the Road Ahead. IEEE Data Engineering Bulletin (2020). [34] Yuxi Li. 2017. Deep reinforcement learning: An overview. arXiv preprint arXiv:1701.07274 (2017). [35] Michele Lombardi, Michela Milano, and Andrea Bartolini. 2017. Empirical decision model learning. Artificial Intelligence 244 (2017), 343–367. [36] Radu Marinescu, Tejaswini Pedapati, Long Vu, Paulito Palmes, Todd Mummert, Peter Kirchner, Dharmashankar Subramanian, Parikshit Ram, and Djallel Bouneffouf. 2022. Automated Decision Optimization with Reinforcement Learning. (2022). [37] James McCarthy, Rahul Nair, Elizabeth Daly, Radu Marinescu, and Ivana Dusparic. 2022. Boolean Decision Rules for Reinforcement Learning Policy Summarisation. International Workshop on Safe Reinforcement Learning, IJCAI (2022). [38] David Meignan, Sigrid Knust, Jean-Marc Frayret, Gilles Pesant, and Nicolas Gaud. 2015. A review and taxonomy of interactive optimization methods in operations research. ACM Transactions on Interactive Intelligent Systems (TiiS) 5, 3 (2015), 1–43. [39] Aditi Mishra, Utkarsh Soni, Jinbin Huang, and Chris Bryan. 2022. Why? Why not? When? Visual Explanations of Agent Behaviour in Reinforcement Learning. In 2022 IEEE 15th Pacific Visualization Symposium (PacificVis). IEEE, 111–120. [40] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. 2015. Human-level control through deep reinforcement learning. nature 518, 7540 (2015), 529–533. [41] Sina Mohseni, Niloofar Zarei, and Eric D Ragan. 2021. A multidisciplinary survey and framework for design and evaluation of explainable AI systems. ACM Transactions on Interactive Intelligent Systems (TiiS) 11, 3-4 (2021), 1–45. [42] Deepak Mukunthu, Parashar Shah, and Wee Hyong Tok. 2019. Practical Automated Machine Learning on Azure: Using Azure Machine Learning to Quickly Build AI Solutions. O'Reilly Media. [43] John A Nelder and Roger Mead. 1965. A simplex method for function minimization. The computer journal 7, 4 (1965), 308–313. [44] Randal S Olson, Nathan Bartley, Ryan J Urbanowicz, and Jason H Moore. 2016. Evaluation of a tree-based pipeline optimization tool for automating data science. In Proceedings of the genetic and evolutionary computation conference 2016. 485–492. [45] Mark Ortmann, Mirza Klimenta, and Ulrik Brandes. 2016. A sparse stress model. In International Symposium on Graph Drawing and Network Visualization. Springer, 18–32. [46] Erika Puiutta and Eric Veith. 2020. Explainable reinforcement learning: A survey. In International cross-domain conference for machine learning and knowledge extraction. Springer, 77–95. [47] Emily Saldanha, Brenda Praggastis, Todd Billow, and Dustin Lockhart Arendt. 2019. ReLVis: Visual Analytics for Situational Awareness During Reinforcement Learning Experimentation.. In EuroVis (Short Papers). 43–47. [48] Pedro Sequeira, Eric Yeh, and Melinda T Gervasio. 2019. Interestingness Elements for Explainable Reinforcement Learning through Introspection.. In IUI workshops, Vol. 1. [49] Syed Yousaf Shah, Dhaval Patel, Long Vu, Xuan-Hong Dang, Bei Chen, Peter Kirchner, Horst Samulowitz, David Wood, Gregory Bramble, Wesley M Gifford, et al. 2021. AutoAI-TS: AutoAI for time series forecasting. In Proceedings of the 2021 International Conference on Management of Data. 2584–2596. [50] Richard S Sutton and Andrew G Barto. 2018. Reinforcement learning: An introduction. MIT press. [51] Alfredo Vellido, José David Martín-Guerrero, and Paulo JG Lisboa. 2012. Making machine learning models interpretable.. In ESANN, Vol. 12. Citeseer, 163–172. [52] Dakuo Wang, Justin D Weisz, Michael Muller, Parikshit Ram, Werner Geyer, Casey Dugan, Yla Tausczik, Horst Samulowitz, and Alexander Gray. 2019. Human-AI collaboration in data science: Exploring data scientists' perceptions of automated AI. Proceedings of the ACM on Human-Computer Interaction 3, CSCW (2019), 1–24. [53] Junpeng Wang, Liang Gou, Han-Wei Shen, and Hao Yang. 2018. Dqnviz: A visual analytics approach to understand deep q-networks. IEEE transactions on visualization and computer graphics 25, 1 (2018), 288–298. [54] Junpeng Wang, Wei Zhang, Hao Yang, Chin-Chia Michael Yeh, and Liang Wang. 2021. Visual analytics for rnn-based deep reinforcement learning. IEEE Transactions on Visualization and Computer Graphics (2021). [55] Qianwen Wang, Zhutian Chen, Yong Wang, and Huamin Qu. 2021. A Survey on ML4VIS: Applying MachineLearning Advances to Data Visualization. IEEE Transactions on Visualization and Computer Graphics (2021). [56] Qianwen Wang, Yao Ming, Zhihua Jin, Qiaomu Shen, Dongyu Liu, Micah J Smith, Kalyan Veeramachaneni, and Huamin Qu. 2019. Atmseer: Increasing transparency and controllability in automated machine learning. In Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems. 1–12. [57] Tianshu Wei, Yanzhi Wang, and Qi Zhu. 2017. Deep reinforcement learning for building HVAC control. In Proceedings of the 54th annual design automation conference 2017. 1–6. 27 IUI '23, March 27–31, 2023, Sydney, NSW, Australia Weidele, et al. [58] Daniel Karl I Weidele. 2019. Conditional parallel coordinates. In 2019 IEEE Visualization Conference (VIS). IEEE, 221–225. [59] Daniel Karl I Weidele, Justin D Weisz, Erick Oduor, Michael Muller, Josh Andres, Alexander Gray, and Dakuo Wang. 2020. AutoAIViz: opening the blackbox of automated artificial intelligence with conditional parallel coordinates. In Proceedings of the 25th International Conference on Intelligent User Interfaces. 308–312. [60] Jun Yuan, Changjian Chen, Weikai Yang, Mengchen Liu, Jiazhi Xia, and Shixia Liu. 2021. A survey of visual analytics techniques for machine learning. Computational Visual Media 7, 1 (2021), 3–36. [61] Tom Zahavy, Nir Ben-Zrihem, and Shie Mannor. 2016. Graying the black box: Understanding dqns. In International conference on machine learning. PMLR, 1899–1908. [62] Jonathan X Zheng, Samraat Pawar, and Dan FM Goodman. 2018. Graph drawing by stochastic gradient descent. IEEE transactions on visualization and computer graphics 25, 9 (2018), 2738–2748. [63] Marc-André Zöller and Marco F Huber. 2021. Benchmark and survey of automated machine learning frameworks. Journal of artificial intelligence research 70 (2021), 409–472. Received 15 October 2022; revised 03 February 2023; accepted 10 February 2023 28
http://arxiv.org/abs/2302.09683v2
2023-02-22T04:05:28
2023-02-19T22:30:47
SimFair: A Unified Framework for Fairness-Aware Multi-Label Classification
Recent years have witnessed increasing concerns towards unfair decisions made by machine learning algorithms. To improve fairness in model decisions, various fairness notions have been proposed and many fairness-aware methods are developed. However, most of existing definitions and methods focus only on single-label classification. Fairness for multi-label classification, where each instance is associated with more than one labels, is still yet to establish. To fill this gap, we study fairness-aware multi-label classification in this paper. We start by extending Demographic Parity (DP) and Equalized Opportunity (EOp), two popular fairness notions, to multi-label classification scenarios. Through a systematic study, we show that on multi-label data, because of unevenly distributed labels, EOp usually fails to construct a reliable estimate on labels with few instances. We then propose a new framework named Similarity $s$-induced Fairness ($s_\gamma$-SimFair). This new framework utilizes data that have similar labels when estimating fairness on a particular label group for better stability, and can unify DP and EOp. Theoretical analysis and experimental results on real-world datasets together demonstrate the advantage of over existing methods $s_\gamma$-SimFair on multi-label classification tasks.
[ "Tianci Liu", "Haoyu Wang", "Yaqing Wang", "Xiaoqian Wang", "Lu Su", "Jing Gao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09683v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09683v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
SimFair: A Unified Framework for Fairness-Aware Multi-Label Classification Tianci Liu, Haoyu Wang, Yaqing Wang, Xiaoqian Wang, Lu Su, Jing Gao* School of Electrical and Computer Engineering, Purdue University, West Lafayette, USA, 47907 {liu3351, wang5346, wang5075, joywang, lusu, jinggao}@purdue.edu 3 2 0 2 b e F 2 2 ] G L . s c [ 2 v 3 8 6 9 0 . 2 0 3 2 : v i X r a Abstract Recent years have witnessed increasing concerns towards un- fair decisions made by machine learning algorithms. To im- prove fairness in model decisions, various fairness notions have been proposed and many fairness-aware methods are developed. However, most of existing definitions and methods focus only on single-label classification. Fairness for multi- label classification, where each instance is associated with more than one labels, is still yet to establish. To fill this gap, we study fairness-aware multi-label classification in this paper. We start by extending Demographic Parity (DP) and Equalized Opportunity (EOp), two popular fairness notions, to multi- label classification scenarios. Through a systematic study, we show that on multi-label data, because of unevenly distributed labels, EOp usually fails to construct a reliable estimate on labels with few instances. We then propose a new framework named Similarity s-induced Fairness (sγ-SimFair). This new framework utilizes data that have similar labels when esti- mating fairness on a particular label group for better stability, and can unify DP and EOp. Theoretical analysis and experi- mental results on real-world datasets together demonstrate the advantage of sγ-SimFair over existing methods on multi-label classification tasks. 1 Introduction Nowadays, machine learning algorithms play increasingly more important roles in decision-making for a broad spec- trum of applications, such as applicant screening in job mar- kets, credit risk analysis, and recommendation systems. How- ever, recent studies (Barocas and Selbst 2016; Buolamwini and Gebru 2018; Dressel and Farid 2018) have discovered that machine learning algorithms tend to make discrimina- tory decisions. For example, a dataset may contain records of physicians most of whom are male. As a result, a job screening algorithm trained on this dataset may unfairly pre- dict if a person is suitable for a physician position based on their gender, instead of education background or professional experience. Obviously, such favorable prediction for male applicants is unfair to female applicants. Formally, the algorithmic fairness issue refers to the phe- nomenon that machine learning algorithms make discrim- inatory decisions across different demographic subgroups *Corresponding author Copyright © 2023, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. and give favorable predictions for some particular subgroups. Intuitively, discriminatory decisions are associated with some demographic features contained in the data, such as age, gen- der, and race. These features are referred to as sensitive fea- tures. Ideally, a fair model should be able to make decisions independent of sensitive features. Towards this end, differ- ent fairness notions (Pedreshi, Ruggieri, and Turini 2008; Dwork et al. 2011; Hardt, Price, and Srebro 2016; Choulde- chova and Roth 2020) have been proposed. Among them, Demographic Parity (DP) (Pedreshi, Ruggieri, and Turini 2008) and Equalized Opportunity (EOp) (Hardt, Price, and Srebro 2016) are two of the most widely-used definitions. DP requires a model's decision to be independent of sensitive features, achieving a population-level fairness (Edwards and Storkey 2015; Madras et al. 2018; Creager et al. 2019). How- ever, Dwork et al. (2011) showed that such population level fairness does not necessarily guarantee fairness in all label groups. To address this limitation, Hardt, Price, and Srebro (2016) proposed to take label information into consideration and defined EOp and its stronger version Equalized Odds (EO). Specifically, EOp requires the decision to be indepen- dent of sensitive features conditionally in the label group receiving an favorable outcome (Hardt, Price, and Srebro 2016). Examples of favorable outcomes include "being ad- mitted to a position" in job screening, and "approval of credit card application". For brevity, we refer to the label group in which each individual receives the favorable outcome as the advantaged group. With a more restrictive fairness defi- nition, EO further requires that the decision is independent of sensitive features in each label group, including not only the advantaged group but also the groups receiving other outcomes. Some methods have been proposed based on the aforemen- tioned fairness definitions. However, they are focused only on scenarios where each instance is associated with a single target label (Hardt, Price, and Srebro 2016; Woodworth et al. 2017; Zafar et al. 2017). In many real-world applications, multiple labels need to be predicted for an instance. For ex- ample, in job screening, an applicant may apply for multiple positions, and the admission decision of each position is a tar- get label of the applicant. Similarly, undergraduates usually submit applications to multiple programs when applying to graduate schools, and thus associate themselves with multi- ple target labels of admission. Scenarios where each instance is associated with more than one target labels are termed as multi-label classification (Zhang and Zhou 2014). Obvi- ously, fairness concerns also exist in multi-label classification scenarios. One straightforward approach toward fairness in a multi-label scenario is to decompose multi-label classifica- tion into multiple binary classification tasks, each of which judges whether a label is associated with an instance or not, and then apply existing fairness metric separately on each binary classification task (Zhang et al. 2018). However, this naive approach ignores one unique property of multi-label classification, i.e., the correlations among labels. Again, take job screening as an example. Applicants usually apply for positions with similar requirements of skill sets and experi- ences at the same time, and thus the application outcomes (labels) are correlated. Ignoring such correlations among la- bels would lead to unsatisfactory classification and let alone fairness results. On the other hand, existing multi-label clas- sification methods consider the correlations among labels but cannot enforce fairness in the predictions. Therefore, it is critical to define fairness directly in the context of multi-label classification. Unfortunately, we did not find existing work along this direction. This motivates us to study this problem. In a multi-label scenario, since different target labels usually occur together, it is more natural to treat their combinations as an advantaged outcome (label). For example, the advantaged group in the job screening example with two possible positions can be the applicants who "received offers of position A and position B". Note that this definition allows us to define more general and complex advantaged groups by specifying more than one favorable labels and requires fairness on all of them. In practice, the discussed fairness objective is usually achieved by incorporating some fairness notions into op- timization (Mohler et al. 2018; Scutari, Panero, and Proissl 2021). Such an optimization is non-trivial when tackling fair- ness issue based on this extended concept of advantaged group in multi-label classification, where collected data is usually not evenly distributed among different labels (Dekel and Shamir 2010). When few instances are in the advantaged group (i.e., the group that has the favorable label), it may in- troduce unreliable fairness constraints into optimization and degrade the fairness performance. In this work, we show that the aforementioned optimization challenges can be alleviated by utilizing information sharing among labels. Intuitively, we group data with different but similar labels to alleviate data shortage issue, and then enable an EOp-like framework to incorporate fairness constraints on advantaged groups.This will be formalized in Section 3. We refer to our framework as Similarity s-induced Fairness (sγ-SimFair), highlighting the crucial requirement of a similarity measure between different labels in the data grouping step. The proposed framework sγ-SimFair is principled in the sense that it unifies DP and EOp, bringing the flexibility of leveraging a population level fairness or fairness on some particular label groups (e.g., the advantaged group) per de- sires. The DP and EOp are two extreme cases of sγ-SimFair. When treating all labels as equally similar and ignoring their differences, we end up with one label group of data, in which sγ-SimFair becomes DP. On the contrary, if two labels are similar only if they are the same, then each label group in- volves only one label, in which sγ-SimFair becomes EOp. Moreover, sγ-SimFair is able to enforce a restrictive fairness notion on the advantaged group even when data is inadequate by utilizing information from other similar label groups. Our main contributions are summarized below. • To the best of our knowledge, we are the first to investigate fairness in a multi-label classification setting. We extend DP and EOp to the multi-label classification setting, and recognize the challenge of achieving EOp based on both theoretical and empirical studies. • To handle the recognized challenge, we propose a novel framework, namely sγ-SimFair, to achieve the fairness objective for multi-label classification even when imbal- anced label distributions exist. We further support the proposed framework with rigorous theoretical analysis. • The comprehensive experiments show that the proposed framework sγ-SimFair is able to achieve competitive and even better performance in term of DP and EOp com- pared to that of directly incorporating DP and EOp into optimization respectively. 2 Related Work Algorithmic Fairness Most existing fairness definitions fall into two categories: group fairness (Pedreshi, Ruggieri, and Turini 2008; Dwork et al. 2011; Hardt, Price, and Srebro 2016; Chouldechova and Roth 2020) and individual fairness (Dwork et al. 2011). Group fairness requires that the probability of being assigned to a group by a model is independent of sensitive features such as gender, age and race. For example, Demographic Parity (DP) requires that the prediction is independent of sensitive features, while Equalized Odds (EO) and Equalized Opportunity (EOp) require that the prediction is condition- ally independent of sensitive features in each or some label group. When labels are binary, this is equivalent to requiring an equality of true and false positive rates across different demographic subgroups. Modifications of DP and EO (EOp) have also been studied. For example, in Pleiss et al. (2017), a relaxed condition is required by replacing EO with some calibration. Individual fairness, on the other hand, requires that a model treats similar individuals similarly (Dwork et al. 2011). In this work we focus on group fairness. In order to correct the unfairness of models, many methods have also been proposed, which can be classified into one of the following three categories: pre-processing biased datasets, in-processing models during training, and post-processing the outputs of models. In-processing is usually the most effective way to intervene an unfair model (Petersen et al. 2021), which can be done by penalizing unfair predictions directly (Mohler et al. 2018; Scutari, Panero, and Proissl 2021), or by disen- tangling some intermediate representations (on which final predictions are made) from sensitive features (Locatello et al. 2019; Creager et al. 2019). Nevertheless, penalty-based meth- ods are still good and effective starting points to mitigate un- fairness (Mary, Calauzenes, and El Karoui 2019; Kamishima et al. 2012). Multi-label Classification Multi-label classification is a general family of classification tasks where each instance is associated with multiple target labels. This task has very broad applications (El Kafrawy, Mausad, and Esmail 2015), such as recommendation sys- tems (Zheng, Mobasher, and Burke 2014; Zhang et al. 2020), multi-object detection (Gong et al. 2019; Zhao et al. 2020), and text classification (Yang et al. 2009; Nam et al. 2014). Methods for multi-label classification can be grouped into two categories (Zhang and Zhou 2014; Tsoumakas, Katakis, and Vlahavas 2006): problem transformation and algorithm adaptation. Problem transformation tackles multi-label classi- fication by transforming the task into other well-defined tasks. One possible transformation is binary relevance (Boutell et al. 2004), which ignores all dependencies among different tar- gets and predicts each target separately. Classifier chain, the other extreme case, learns the joint distribution of different labels by applying the chain rule of probability (Read et al. 2011). In summary, these problem transformation multi-label classification tasks into other well-established learning prob- lems and adopt existing methods to solve them (Tsoumakas and Vlahavas 2007; F ̈urnkranz et al. 2008). Algorithm adap- tation, on the other hand, modify existing algorithms such as kNN (Zhang and Zhou 2007) and decision tree (Clare and King 2001) to model multi-label data directly. We refer readers to Zhang and Zhou (2014); Tsoumakas, Katakis, and Vlahavas (2006) for more details. Deep learning has advanced multi-label classification as well (Liu et al. 2021). Recently, Chen, Xue, and Gomes (2018); Bai, Kong, and Gomes (2020) revisited the Multi- variate Probit (MP) model (Chib and Greenberg 1998) with the equipment of deep learning tools. MP model assumes that the joint distribution of labels is controlled by a mul- tivariate Gaussian random variable, and the probability of a label is determined by the cumulative density function (CDF) at the value of this Gaussian variable. The correlations in the Gaussian variable allows the model to capture pair- wise dependencies in a multi-label setting. Chen, Xue, and Gomes (2018) parameterized the MP model with a deep neu- ral network resulting in the deep Multivariate Probit model (DMVP), and Bai, Kong, and Gomes (2020) proposed to combine DMVP and variational autoencoder (Kingma and Welling 2014) to obtain better performance. 3 Methodology In this section, we propose sγ-SimFair, a flexible framework to unify Demographic Parity (DP) and Equalized Opportunity (EOp). We start with deriving DP and EOp in multi-label sce- narios. Then we provide a systematic study on the challenges of estimating EOp in multi-label scenarios. We propose sγ- SimFair based on the these studies to achieve the fairness objective even when imbalanced label distributions exist. Preliminaries Consider a dataset and lowercase p denotes a distribution. We summarize nota- tions used in this paper in appendix A for better readability. that contains N samples D = {(x(i), a(i), y(i))}N i=1. Without loss of generality, we assume each sample is associated with M non-sensitive features x(i) ∈ X = RM , a K-way scalar sensitive feature a(i) ∈ A = {1, . . . , K} where K is the number of demographic sub- groups (e.g., K = 2 if gender is the sensitive feature that takes female and male), and L binary labels y(i) ∈ Y = {0, 1}L. We further assume N samples are drawn from an unknown underlying distribution p over space (X × A × Y), and use (x, a, y) ∼ p to denote a random sample. To avoid ambiguity, for y = (y1, . . . , yL), we call y a label, and yl ∈ {0, 1} the l-th target, where yl = 1 indicates the presence of l-th target. We use h : X → Y to denote a multi-label classifier that predicts label based on non-sensitive features. Under these settings, L = 1 corresponds to single-label classification, and L > 1 corresponds to multi-label classification. Multi-Label Classification Prediction We consider a wide family of multi-label classifiers that satisfy h = f ◦ g : X → [0, 1]L → Y. In particular, a classifier first predicts ̃y = g(x), the probability of the presence of L targets given x. Then l-th target prediction is given by ˆyl = 1( ̃yl ≥ 0.5) ele- mentwisely, in which f denotes this elementwise threshold- ing function. This family of classifiers is capable of capturing dependencies between different targets by predicting ̃y given x jointly as shown in Chen, Xue, and Gomes (2018); Bai, Kong, and Gomes (2020). DP and EOp on Multi-Label Classification DP and EOp Condition In this section, we establish DP and EOp condition in multi-label scenarios. For classifier h = f ◦ g : X → Y and random sample (x, a, y) ∼ p, h is fair in terms of (1) DP if ˆy ⊥ a; and (2) EOp if ˆy ⊥ a | yadv, where yadv ∈ Y denotes some advantaged label where only favor- able outcomes (e.g., "received offer" in the job screening example) present. In essence, DP requires predictions to be independent with sensitive variables, and EOp requires condi- tional independence to hold on label yadv. As assumed, pre- diction ˆy depends on predicted probability ̃y elmentwisely, therefore distribution of ˆy is fully parameterized by ̃y. Propo- sition 3.1 gives a condition for DP and EOp to hold in multi- label classification. Proposition 3.1 (DP and EOp condition for multi-label classifier). For a multi-label classifier that takes the form h = f ◦ g, where ̃y = g(x) is the predicted probability and ˆy = f ( ̃y) is computed elementwisely, DP and EOp hold if for any k ∈ A DP: E[ ̃y | a = k] = E[ ̃y] EOp: E[ ̃y | a = k, y = yadv] = E[ ̃y | y = yadv]. (1) Proof. See appendix B. Notations Throughout this paper, we use bold capital let- ters (e.g., X) to denote matrices, bold lowercase letters (e.g., x) to denote (column) vectors, and calligraphic letters (e.g., X ) to denote spaces. Finally, capital P denotes a probability Remark 1. Proposition 3.1 indicates that on multi-label data where labels are correlated, for classifier h, we can still eval- uate its fairness performances in the same way as evaluating traditional single label classifiers by comparing the averaged predicted probability on different subgroups. Moreover, we can construct estimations with finite samples E[ ̃y | a = k] ≈ (cid:80)N i=1 ̃y(i)1(a(i) = k) (cid:80)N i=1 1(a(i) = k) (cid:80)N E[ ̃y] ≈ 1 N N (cid:88) i=1 ̃y(i) i=1 ̃y(i)1(a(i) = k)1(y = yadv) (cid:80)N i=1 1(a(i) = k)1(y = yadv) E[ ̃y | a = k, y = yadv] ≈ E[ ̃y | y = yadv] ≈ (cid:80)N i=1 ̃y(i)1(y = yadv) (cid:80)N i=1 1(y = yadv) (2) (3) Estimation Challenge of EOp In multi-label scenarios, a long-tailed phenomenon, i.e., most labels only associate with few samples (Dekel and Shamir 2010), brings additional challenges for EOp estimation. Without sufficient samples, EOp is barely able to construct reliable estimates for fairness and correspondingly may not achieve fairness objective in an in-processing framework on such datasets. Mathematically, the challenge of estimating EOp stems from terms (cid:80)N i=1 1(a(i) = k)1(y(i) = yadv) and (cid:80)N i=1 1(y(i) = yadv) in eqn (2) and (3). When these sum- mations are close to 0, the two estimates are unstable or even undefined. More formally, the conditional expectation in eqn (1) is E[ ̃y | a = k, y = yadv] = = (cid:90) ̃yp( ̃y | a = k, y = yadv) d ̃y (cid:82) ̃yp( ̃y, a = k, y = yadv) d ̃y P (a = k, y = yadv) . Here P (a = k, y = yadv) = E[1(a = k)1(y = yadv)], and (cid:90) = ̃yp( ̃y, a = k, y = yadv) d ̃y (cid:90)(cid:90)(cid:90) ̃y1(a = k)1(y = yadv)p( ̃y, a, y) da dy d ̃y = E[ ̃y1(a = k)1(y = yadv)]. This implies E[ ̃y | a = k, y = yadv] = E[ ̃y | y = yadv] = E[ ̃y1(a = k)1(y = yadv)] E[1(a = k)1(y = yadv)] E[ ̃y1(y = yadv)] E[1(y = yadv)] . Henceforth, eqn (1) is equivalent to E[ ̃y1(y = yadv)] E[1(y = yadv)] = E[ ̃y1(a = k)1(y = yadv)] E[1(a = k)1(y = yadv)] (4) (5) (6) for ∀ k ∈ A. If event 1(y = yadv) = 1 happens with low prob- ability, i.e., few samples are from label group yadv, EOp is difficult and even impossible to estimate from eqn (2) and (3) directly. Similarity s-induced Fairness (sγ-SimFair) Motivated by the above analysis, we propose a new frame- work to help achieve DP or EOp, where hard 1(y = yadv) ∈ {0, 1} is relaxed to some similarity function s(y, yadv) ∈ [0, 1]. Informally, we loosen the membership of the advan- taged group requirement in EOp and use a soft conditioning. For any random sample (x, a, y), fairness of its prediction is always taken in consideration, but as the affinity of y to yadv decreases, it will be down-weighted when estimating fairness violations with respect to yadv. Definition 1 (sγ-SimFair). Given a similarity function s : Y × Y → [0, 1], a multi-label classifier h satisfies Similarity s-induced Fairness (sγ-SimFair) if for ∀ k ∈ A, E[ ̃ys(y, yadv)] E[s(y, yadv)] = E[ ̃y1(a = k)s(y, yadv)] E[1(a = k)s(y, yadv)] . (7) Same as DP and EOp, terms involved in eqn (7) can be estimated with (cid:80) ≈ ≈ (cid:80) (8) i ̃y(i)s(y(i), yadv) (cid:80) is(y(i), yadv) i ̃y(i)1(a(i) = k)s(y(i), yadv) (cid:80) i 1(a(i) = k)s(y(i), yadv) E[ ̃ys(y, yadv)] E[s(y, yadv)] E[ ̃y1(a = k)s(y, yadv)] E[1(a = k)s(y, yadv)] In this paper, we adopt the Jaccard score to define simi- larity s. In essence, we use the cardinality ratio between the intersection and union of pair (y, y(cid:48)) to measure their simi- larity, then apply some monotonic transformation for scaling. Formally, for y ∈ Y with yl = 1 represents the presence of the l-th target, we denote cate(y) = {l : yl = 1, l = 1, . . . , L}, i.e., the collection of indices of present targets, and define (9) . Jac(y, yadv) = |cate(y) ∩ cate(yadv)| |cate(y) ∪ cate(yadv)| sγ(y, yadv) = exp (γ (Jac(y, yadv) − 1)) where γ is a scaling parameter. It is worth mentioning that the choice of s is not unique and can be task- or data-specific. sγ-SimFair Unifies DP and EOp One key characteristic of sγ-SimFair is that it can be seen as an unification of DP and EOp, as formalized by Proposition 3.2 and 3.3. Proposition 3.2 (DP and EOp are special cases of sγ-SimFair). Consider sγ-SimFair defined in eqn (7), if similarity s is a constant function s(y, y(cid:48)) = c for some c, then sγ-SimFair implies DP; if s is an indicator function s(y, y(cid:48)) = 1(y = y(cid:48)), then sγ-SimFair implies EOp. Proof. See appendix B. Proposition 3.3 (sγ-SimFair helps achieve DP and EOp). For any multi-label classifier h satisfying sγ-SimFair, its violation of DP will be arbitrarily small if γ is sufficiently small; and its violation of EOp will be arbitrarily small if γ is sufficiently large. More generally, its violation of DP is arbitrarily close to its violation of sγ-SimFair for sufficiently small γ, and its violation of EOp is arbitrarily close to its violation of sγ-SimFair for sufficiently large γ. Proof. See appendix B. Remark 2. Proposition 3.2 reveals the connection between sγ-SimFair and DP (EOp). Proposition 3.3 further shows that sγ-SimFair condition indeed helps achieve DP and EOp, es- tablishing a theoretical foundation of borrowing information from similar labels. sγ-SimFair Regularized Model Training Fairness Violation Violation of sγ-SimFair denoted by (cid:96)sγ (y,yadv)(h), is defined as K (cid:88) k=1 (cid:13) (cid:13) (cid:13) (cid:13) E[ ̃ysγ(y, yadv)] E[sγ(y, yadv)] − E[ ̃y1(a = k)sγ(y, yadv)] E[1(a = k)sγ(y, yadv)] (cid:13) (cid:13) (cid:13) (cid:13) (10) where (cid:107) * (cid:107) is the L2 norm. In words, we count how the fairness conditions in eqn (7) are violated in all demographic subgroup a = k. When K = 2 (i.e., the sensitive feature is binary), it can also be writen as E[ ̃y1(a = 1)sγ(y, yadv)] E[1(a = 1)sγ(y, yadv)] (cid:13) (cid:13) (cid:13) (cid:13) DP and EOp, as discussed, are special cases of sγ-SimFair so we omit their forms. E[ ̃y1(a = 2)sγ(y, yadv)] E[1(a = 2)sγ(y, yadv)] (11) (cid:13) (cid:13) (cid:13) (cid:13) − . In-processing with sγ-SimFair We use sγ-SimFair to im- prove fairness of classifier h in an in-processing framework. Specifically, on each mini-batch during training, we estimate the fairness violation (defined in eqn (10) or (11)) by eqn (8) and (9). The estimate defines the regularization term as parts of training loss. In particular, we train h with stochastic gra- dient descent-based methods by minimizing (cid:96)mlc(h) + λ(cid:96)sγ (y,yadv)(h). (12) min h Here (cid:96)mlc(h) is the loss for multi-label classification, and (cid:96)sγ (y,yadv)(h) estimates the violation of sγ-SimFair. Hyper- parameter λ ≥ 0 balances the two losses. Multivariate Probit Variational AutoEncoder (MPVAE) We use MPVAE as a backbone model to illustrate and verify the performance of our work. MPVAE is a multi-label classi- fication method without fairness constraint enforcement, and we adapt it with a fairness penalty to ensure sγ-SimFair. MPVAE is a variational autoencoder structured model that is capable to capture pairwise dependency in label y. It learns two encoders to map x and y into a shared representation space and decode with the same decoder. A Multivariate Probit (MP) model is used to predict ˆy, and model correla- tions between different labels yd and y(cid:48) d. Fig. 1 illustrates the structure of MPVAE, where green color marks the addi- tional fairness penalty. Algorithm 1 in appendix C provides a concise summary of updating MPVAE with one step on a minibatch. Due to the page limitation, we refer readers to Bai, Kong, and Gomes (2020) for details about MPVAE. 4 Experiments In this section, we evaluate sγ-SimFair with the goal of pro- viding insights from three aspects: • How does sγ-SimFair approximate DP and EOp? • How does sγ-SimFair help achieve DP and EOp? • How does sγ-SimFair affect fairness-accuracy tradeoff? In the following, we will discuss experiment settings first and then present the details about the evaluation from these three aspects. Datasets and Experiment Setup Datasets Due to the lack of existing work in fairness-aware multi-label classification, we transform two tabular datasets Figure 1: Framework of training MPVAE (Bai, Kong, and Gomes 2020) with fairness regularization (in green). Blocks in blue mark the label branch and blocks in yellow mark the (non-sensitive) feature branch. During training, MPVAE predicts two probability vectors ̃y on two branches separately. Both of them are used to construct the sγ-SimFair regular- izer. During testing, only yellow blocks (prediction from the feature branch) are accessible. that are ubiquitous in fairness literature into multi-label set- tings. Towards this goal, we select some features and treat them as additional targets. To help focus on the challenge brought by multi-label, we use binary sensitive features, but as defined in eqn (3), our methods can easily generalize to where more complicated sensitive features are used1. • Adult (Kohavi 1996) is a widely-used fairness dataset from UCI repository that contains 48,842 samples. Original Adult dataset contains 112 features and a binary label income level, which denotes whether an individual's yearly income is greater than $50K dollars or not. We further use workclass and occupation as two other targets. In terms of sensitive features, we follow Reddy et al. (2021) and binarize age into 25-44 years old and else. This allows us to construct two balanced demographic subgroups. • Credit (Yeh and Lien 2009) is another popular fairness dataset from UCI repository. It contains 30,000 samples, each sample is associated with 24 features and a binary label indicates the existence of default payments. We treat education level as an additional target, and use gender as the sensitive feature. Baselines We compare MPVAE h trained with proposed sγ-SimFair regularizer with three baseline methods: (1) No regularizer: use (cid:96)mlc loss only by setting λ = 0 in eqn (12); (2) DP regularizer: use DP violation as a regularizer, can be seen as an extension of Calders, Kamiran, and Pechenizkiy (2009); and (3) EOp regularizer: use EOp violation as a regularizer, which can be seen as an extension of Zafar et al. (2017). Regularizers are constructed according to eqn (11). Evaluation Metrics To evaluate the fairness mitigation, we report the values of eqn (11) on test sets. As these are vio- lations of fairness, smaller values indicate better performance. To evaluate the multi-label classification, we report three pop- ular metrics in multi-label classifications (Wu and Zhou 2017; Bai, Kong, and Gomes 2020): micro-averaged F1 (micro-F1), macro-averaged F1 (macro-F1), and example-averaged F1 1See appendix E for experiments where a multi-class sensitive feature race is considered. MP ModuleKL lossLabel EncoderFeature EncoderDecoderMPVAE lossFeaturesLabelsaxyzxzymxmyΣgFairness LossE[)yx|a]E[)yy|a])yx)yyE[)yx]E[)yy] SimFair estimates EOp SimFair estimates 0.18 0.17 0.16 0.15 0.14 0.13 0.12 t e s a t a d t l u d A : n o i t a l o i V s s e n r i a F DP EOp 0.034 0.032 0.030 0.028 t e s a t a d t i d e r C : n o i t a l o i V s s e n r i a F DP 0.026 0.1 0.5 1.0 5.0 Hyper-parameter γ in SimFair estimator 0.0 1 0.1 0.5 1.0 5.0 Hyper-parameter γ in SimFair estimator 0.0 1 Figure 2: sγ-SimFair can estimate DP and EOp with different hyperparameter γ, DP and EOp estimates are marked on left and right y-axes. (example-F1) as defined below 2 (cid:80)L (cid:80)L micro-F1 = l=1 l=1 (cid:80)N i=1 y(i) i=1 y(i) (cid:80)N i=1(y(i) 2 (cid:80)N (cid:80)N i=1(y(i) 2 (cid:80)L (cid:80)L l=1(y(i) l ˆy(i) l l + ˆy(i) l ) l ˆy(i) l l + ˆy(i) l ) l ˆy(i) l l + ˆy(i) l ) l=1 y(i) . macro-F1 = example-F1 = 1 L 1 N L (cid:88) l=1 N (cid:88) i=1 These metrics compute either F1-score over the label ma- trix or averaged F1-score over targets or samples. Implementation Details For sγ-SimFair, we use γ = 1, 5, 10 to illustrate when it approximates DP or EOp. We also vary λ, the coefficient of fairness loss (cid:96)sγ (y,yadv)(h), from 1 to 5000 to study the trade-off between fairness and accuracy (in terms of micro-, macro-, and example-F1). We randomly choose 70% data for training and 30% for testing. Other hyperparameters for MPVAE training such as batch size, epochs, and learning rates are fixed throughout all ex- periments. A full list of hyperparameters used in this paper is provided in appendix D. Estimate DP and EOp with sγ-SimFair We first evaluate how well sγ-SimFair can approximate DP and EOp to answer RQ1. To do so, we train a MPVAE without any regularizers for 20 epochs on Adult and Credit datasets and evaluate how it violates DP and EOp. We choose the largest label group (i.e., the label that appears most frequent) as the advantaged group. This allows us to construct a reliable estimate of EOp, which could be used as the ground truth. Figure 2 shows how fairness violations estimated by sγ- SimFair change under different γ, with DP and EOp marked on the left and right y-axis. From the figure, the starting points of sγ-SimFair curves at γ = 0.1 locate close to DP, and the ending points at γ = 10 are close to EOp; these observations justify the effectiveness of sγ-SimFair in approximating DP and EOp, consistent with theoretical analysis. Next, we study the robustness of three estimators by vary- ing the numbers of samples in the advantaged group to dif- ferent levels and evaluating how estimates of DP and EOp change. Results summarized in Table 1 are averaged over 10 independent replications. Empirically, EOp estimator de- grades drastically as the size of observed advantaged group decreases. sγ-SimFair with large γ(= 5), in contrary, pro- duces more stable EOp estimates when EOp estimator fails. yadv obs.(%) DP 100 % 0.11∗ 70 % 0.11 30 % 0.10 10 % 0.10 5 % 0.10 100 % 0.03∗ 70 % 0.03 30 % 0.02 10 % 0.02 5 % 0.02 s0.1-SF 0.12 0.11 0.10 0.10 0.10 s0.5-SF 0.12 0.12 0.11 0.10 0.10 0.03 0.03 0.02 0.02 0.02 0.03 0.03 0.02 0.02 0.02 s1-SF 0.13 0.13 0.12 0.11 0.11 0.03 0.03 0.02 0.02 0.02 s5-SF 0.18 0.18 0.17 0.14 0.15 0.03 0.03 0.03 0.03 0.03 s10-SF 0.17 0.18 0.18 0.16 0.23 0.03 0.04 0.03 0.04 0.04 EOp 0.17∗ 0.17 0.17 0.17 0.27 0.03∗ 0.04 0.03 0.04 0.05 t l u d A t i d e r C Table 1: DP, EOp, and sγ-SimFair estimates (denoted as sγ-SF) on Adult and Credit datasets. Certain portions of samples in the advantaged group are kept (col. yadv obs.(%)) to check the robustness of different estimators. Results are averaged over 10 replications. Estimates of DP and EOp on 100% portion of samples are considered as the ground truth (marked with asterisk). sγ-SimFair estimator is more robust than EOp estimator. In terms of DP, both its own and sγ-SimFair estimator pro- duce similarly stable results, which is reasonable as we only decrease the size of the advantaged group. Performance of Regularization After showing that sγ-SimFair can approximate DP and EOp well, we evaluate how well it can help achieve DP and EOp. We start with reporting fairness violations of MPVAE trained with DP, EOp, and sγ-SimFair regularizers. On each dataset, two potential advantaged groups are considered. The first group is the largest label group as in the last subsection, and the second group is chosen to be a small label group but we can still estimate EOp on the test set. For Adult dataset, since it has more labels, we choose the 18-th largest label group, which is the smallest one that has more than 100 test samples from the advantaged group out of 152 possible labels. For Credit dataset, we choose the 9-th largest, this group has at least 10 test samples from the advantaged label out of 13 possible labels. Throughout experiments, we fix λ = 10 and run 10 replications to smooth out randomness. Table 2 shows resultant DP and EOp achieved by different methods. In all experiments, sγ-SimFair performs compet- itive to DP regularizer and better than EOp regularizer in terms of minimizing these metrics as objectives. Notably, when the advantaged group is small, the vanilla EOp regu- larizer mitigates EOp violation poorly, but sγ-SimFair still reduces it significantly. Moreover, sγ-SimFair maintains a better DP-EOp balance, even they are known to be incom- patible (Barocas, Hardt, and Narayanan 2017). For example, s1-SF regularzier helps achieve better DP and EOp simulta- neously than a DP regularizer on the largest label group on Adult dataset. We interpret this observation as a byproduct of the biased estimation given by sγ-SimFair. As sγ-SimFair is biased towards DP (EOp) when estimating EOp (DP), such bias implicitly considers the other metric and hence strikes a batter balance. These results clearly establish the power of sγ-SimFair in minimizing DP and EOp. To better reveal the limitation of EOp regularizer, we fur- ther evaluate how fair a model can be achieved by the use of different methods. To do so, we choose a large λ = 5000. Note that such large λ, will be shown shortly, significantly impedes accuracy. Here we sacrifice all accuracy to check the potential of different methods. |yadv| Metric DP reg 0.038 DP 0.051 EOp s1-SF reg 0.031 0.042 s5-SF reg 0.038 0.030 s10-SF reg EOp reg No reg 0.111 0.161 0.043 0.034 0.045 0.035 DP EOp DP EOp DP EOp 0.038 0.076 0.018 0.026 0.018 0.202 0.038 0.072 0.018 0.026 0.018 0.192 0.043 0.037 0.017 0.025 0.019 0.193 0.045 0.027 0.018 0.025 0.019 0.197 0.094 0.066 0.018 0.026 0.030 0.241 0.111 0.095 0.029 0.038 0.030 0.241 t No.1 l u d A No.18 t No.1 i d e r C No.9 Table 2: DP and EOp violations of MPVAE trained with DP, EOp, and sγ-SimFair regularziers. On each dataset, a large and a small advantaged groups (measured by their rank- ing in col. |yadv|) are tested. Results are averaged over 10 replications, best results are in bold. We run 3 replications on top 18 largest label groups in Adult dataset and top 9 largest label groups in Credit dataset as advantaged group separately2. Figure 3 shows resultant DP and EOp achieved by different methods. Compared to EOp regularizer, which performs the worst on all labels, sγ- SimFair is much more stable. In extreme cases, sγ-SimFair, as a good approximation of EOp, also encounter failure ulti- mately, but it is much more robust. 0.40 0.35 0.30 0.25 0.20 0.15 0.10 0.05 0.00 t e s a t a d t l u d A : P D t e s a t a d t i d e r C : P D 0.030 0.025 0.020 0.015 0.010 0.005 0.000 DP s1 -SF s5 -SF s10 -SF EOp DP s1 -SF s5 -SF s10 -SF EOp t e s a t a d t l u d A : p O E 0.14 0.12 0.10 0.08 0.06 0.04 0.02 0.00 7 7 7 1 6 3 7 1 0 0 7 1 2 2 5 1 2 9 8 8 6 9 8 9 8 4 6 1 1 Label group size (training set) 1 4 8 0 1 7 1 8 6 0 1 5 2 6 4 9 5 3 9 0 3 8 9 2 7 9 2 7 4 2 7 7 7 1 6 3 7 1 0 0 7 1 2 2 5 1 2 9 8 8 9 8 8 6 9 4 6 1 1 Label group size (training set) 9 5 3 1 4 8 0 1 7 1 8 6 0 1 5 2 6 4 9 0 3 8 9 2 7 9 2 7 4 2 DP s1 -SF s5 -SF s10 -SF EOp (a) Adult dataset DP s1 -SF s5 -SF s10 -SF EOp t e s a t a d t i d e r C : p O E 0.20 0.15 0.10 0.05 0.00 4 4 5 7 1 9 8 5 5 6 3 2 3 5 4 0 3 6 2 1 Label group size (training set) 0 8 8 6 0 2 4 9 3 3 4 4 5 7 1 9 8 5 5 6 3 2 3 5 4 0 3 6 2 1 Label group size (training set) 0 8 8 6 0 2 4 9 3 3 (b) Credit dataset Figure 3: Achieved DP and EOp as the advantaged group becomes smaller. An extremely large λ = 5000 is used to enforce fairness mitigation. Compared to EOp regularizer, sγ-SimFair is more robust to the sample size. Fairness-Accuracy Tradeoff We end up this section with a study on the tradeoff between fairness and accuracy on the two label groups from the previ- ous section. Hyperparameter λ varies from 1 to 5000 and re- sults are averaged over 10 replications. Due to the page limit, we only report EOp-accuracy tradeoffs on Credit dataset in Figure 4 here and defer other figures to appendix E. Never- theless, conclusions drawn here apply to all experiments. 2As described above, these groups have sufficient test samples to check violations. t e s a t a d t i d e r C : 1 F - o r c i m 0.65 0.60 0.55 0.50 0.45 0.675 0.650 0.625 0.600 0.575 0.550 0.525 0.500 t e s a t a d t i d e r C : 1 F - o r c i m t e s a t a d t i d e r C : 1 F - o r c a m 0.30 0.25 0.20 0.15 0.10 DP s1 -SF s5 -SF s10 -SF EOp 3 0.0 4 0.0 0 0.0 1 0.0 2 0.0 EOp t e s a t a d t i d e r C : 1 F - e l p m a x e 0.65 0.60 0.55 0.50 0.45 DP s1 -SF s5 -SF s10 -SF EOp 3 0.0 4 0.0 DP s1 -SF s5 -SF s10 -SF EOp 3 0.0 4 0.0 0 0.0 1 0.0 2 0.0 EOp 0 0.0 1 0.0 2 0.0 EOp (a) Credit dataset: No.1 label group t e s a t a d t i d e r C : 1 F - o r c a m 0.30 0.25 0.20 0.15 0.10 DP s1 -SF s5 -SF s10 -SF EOp 0 0.2 5 0.2 DP s1 -SF s5 -SF s10 -SF EOp 0 0.2 5 0.2 5 0.0 0 0.1 5 0.1 EOp 0.675 0.650 0.625 0.600 0.575 0.550 0.525 0.500 t e s a t a d t i d e r C : 1 F - e l p m a x e DP s1 -SF s5 -SF s10 -SF EOp 0 0.2 5 0.2 5 0.0 0 0.1 5 0.1 EOp (b) Credit dataset: No.9 label group 5 0.0 0 0.1 5 0.1 EOp Figure 4: EOp-accuracy tradeoffs on Credit dataset. EOp regularizer is unstable and ineffective when the advantaged group is small, sγ-SimFair, on the other hand, preserves similar tradeoff trend as DP on both large and small label groups. Overall, micro- and example-F1 are much more robust to fairness requirement than macro-F1. On Credit dataset, they are even improved slightly when a small fairness regulariza- tion is added. We hypothesize that fairness regularization indirectly adds smooth conditions and penalizes unstable pre- dictions. sγ-SimFair has similar tradeoff patterns compared with the DP regularizer and does not encounter instability as EOp regularizer does. In addition, on small label groups where EOp regularizer fails, its sγ-SimFair approximation succeeds in achieving low EOp violation, and performs one of the best in handling tradeoffs. 5 Conclusions In this paper, We study the important problem of enforcing fairness on multi-label classification. Given the ubiquitous imbalanced issue with respect to label groups, we propose sγ-SimFair, an effective framework that helps achieve exist- ing group fairness metric: DP and EOp. We first establish a formal extension of DP and EOp condition to multi-label sce- narios, then prove that (extended) DP and EOp can be exactly expressed by sγ-SimFair, and can be approximated arbitrar- ily well. Experiments on two real-world datasets echos with theoretical analysis and reveals limitations of EOp regularizer. sγ-SimFair, in contrary, shows strong robustness against the challenges EOp regularizer cannot overcome. sγ-SimFair is a general tool. The concept and technique derived in this paper can be applied to multi-class classifica- tion as well, so long as a proper similarity function can be defined in the label space Y. In the future, we plan to fur- ther conduct theoretical analysis on sγ-SimFair regularizer and convergence, and apply sγ-SimFair in a post-processing framework. Acknowledgement This work is supported in part by the US National Sci- ence Foundation under grant NSF IIS-2226108 and NSF IIS-2141037. Any opinions, findings, and conclusions or rec- ommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Na- tional Science Foundation. References Bai, J.; Kong, S.; and Gomes, C. 2020. Disentangled Vari- ational Autoencoder based Multi-Label Classification with Covariance-Aware Multivariate Probit Model. Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence. Barocas, S.; Hardt, M.; and Narayanan, A. 2017. Fairness in machine learning. Nips tutorial, 1: 2. Barocas, S.; and Selbst, A. D. 2016. Big data's disparate impact. Calif. L. Rev., 104: 671. Boutell, M. R.; Luo, J.; Shen, X.; and Brown, C. M. 2004. Learning multi-label scene classification. Pattern recognition, 37(9): 1757–1771. Buolamwini, J.; and Gebru, T. 2018. Gender shades: In- tersectional accuracy disparities in commercial gender clas- In Conference on fairness, accountability and sification. transparency, 77–91. PMLR. Calders, T.; Kamiran, F.; and Pechenizkiy, M. 2009. Building In 2009 IEEE classifiers with independency constraints. International Conference on Data Mining Workshops, 13–18. IEEE. Chen, D.; Xue, Y.; and Gomes, C. 2018. End-to-end learning In International for the deep multivariate probit model. Conference on Machine Learning, 932–941. PMLR. Chib, S.; and Greenberg, E. 1998. Analysis of multivariate probit models. Biometrika, 85(2): 347–361. Chouldechova, A.; and Roth, A. 2020. A snapshot of the frontiers of fairness in machine learning. Communications of the ACM, 63(5): 82–89. Clare, A.; and King, R. D. 2001. Knowledge Discovery in In European conference on Multi-label Phenotype Data. principles of data mining and knowledge discovery, 42–53. Springer. Creager, E.; Madras, D.; Jacobsen, J.-H.; Weis, M. A.; Swer- sky, K.; Pitassi, T.; and Zemel, R. 2019. Flexibly Fair Repre- sentation Learning by Disentanglement. arXiv:1906.02589. Dekel, O.; and Shamir, O. 2010. Multiclass-Multilabel Classi- fication with More Classes than Examples. In Teh, Y. W.; and Titterington, M., eds., Proceedings of the Thirteenth Inter- national Conference on Artificial Intelligence and Statistics, volume 9 of Proceedings of Machine Learning Research, 137–144. Chia Laguna Resort, Sardinia, Italy: PMLR. Dressel, J.; and Farid, H. 2018. The accuracy, fairness, and limits of predicting recidivism. Science Advances, 4(1): eaao5580. Dwork, C.; Hardt, M.; Pitassi, T.; Reingold, O.; and Zemel, R. 2011. Fairness Through Awareness. arXiv:1104.3913. Edwards, H.; and Storkey, A. 2015. Censoring Representa- tions with an Adversary. arXiv preprint arXiv:1511.05897. El Kafrawy, P.; Mausad, A.; and Esmail, H. 2015. Experi- mental comparison of methods for multi-label classification in different application domains. International Journal of Computer Applications, 114(19): 1–9. F ̈urnkranz, J.; H ̈ullermeier, E.; Loza Menc ́ıa, E.; and Brinker, K. 2008. Multilabel classification via calibrated label ranking. Machine learning, 73(2): 133–153. Gong, T.; Liu, B.; Chu, Q.; and Yu, N. 2019. Using multi- label classification to improve object detection. neurocom- puting, 370: 174–185. Hardt, M.; Price, E.; and Srebro, N. 2016. Equality of Oppor- tunity in Supervised Learning. arXiv:1610.02413. Kamishima, T.; Akaho, S.; Asoh, H.; and Sakuma, J. 2012. Fairness-aware classifier with prejudice remover regularizer. In Joint European conference on machine learning and knowl- edge discovery in databases, 35–50. Springer. Kingma, D. P.; and Ba, J. 2014. Adam: A method for stochas- tic optimization. arXiv preprint arXiv:1412.6980. Kingma, D. P.; and Welling, M. 2014. Auto-Encoding Varia- tional Bayes. arXiv:1312.6114. Kohavi, R. 1996. Scaling up the Accuracy of Naive-Bayes Classifiers: A Decision-Tree Hybrid. In Proceedings of the Second International Conference on Knowledge Discovery and Data Mining, KDD'96, 202–207. AAAI Press. Liu, W.; Wang, H.; Shen, X.; and Tsang, I. 2021. The Emerg- ing Trends of Multi-Label Learning. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1–1. Locatello, F.; Abbati, G.; Rainforth, T.; Bauer, S.; Sch ̈olkopf, B.; and Bachem, O. 2019. On the Fairness of Disentangled Representations. arXiv:1905.13662. Madras, D.; Creager, E.; Pitassi, T.; and Zemel, R. 2018. Learning Adversarially Fair and Transferable Representa- tions. In International Conference on Machine Learning, 3384–3393. PMLR. Mary, J.; Calauzenes, C.; and El Karoui, N. 2019. Fairness- aware learning for continuous attributes and treatments. In International Conference on Machine Learning, 4382–4391. PMLR. Mohler, G.; Raje, R.; Carter, J.; Valasik, M.; and Branting- ham, J. 2018. A penalized likelihood method for balancing accuracy and fairness in predictive policing. In 2018 IEEE international conference on systems, man, and cybernetics (SMC), 2454–2459. IEEE. Nam, J.; Kim, J.; Loza Menc ́ıa, E.; Gurevych, I.; and F ̈urnkranz, J. 2014. Large-scale multi-label text classifi- cation-revisiting neural networks. In Joint european con- ference on machine learning and knowledge discovery in databases, 437–452. Springer. and Turini, F. 2008. Pedreshi, D.; Ruggieri, S.; In Proceedings of Discrimination-aware data mining. the 14th ACM SIGKDD international conference on Knowledge discovery and data mining, 560–568. Petersen, F.; Mukherjee, D.; Sun, Y.; and Yurochkin, M. 2021. Post-processing for Individual Fairness. Advances in Neural Information Processing Systems, 34. Zheng, Y.; Mobasher, B.; and Burke, R. 2014. Context recommendation using multi-label classification. In 2014 IEEE/WIC/ACM International Joint Conferences on Web Intelligence (WI) and Intelligent Agent Technologies (IAT), volume 2, 288–295. IEEE. Pleiss, G.; Raghavan, M.; Wu, F.; Kleinberg, J.; and Weinberger, K. Q. 2017. On Fairness and Calibration. arXiv:1709.02012. Read, J.; Pfahringer, B.; Holmes, G.; and Frank, E. 2011. Classifier chains for multi-label classification. Machine learn- ing, 85(3): 333–359. Reddy, C.; Sharma, D.; Mehri, S.; Romero-Soriano, A.; Sha- banian, S.; and Honari, S. 2021. Benchmarking bias mitiga- tion algorithms in representation learning through fairness metrics. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 1). Scutari, M.; Panero, F.; and Proissl, M. 2021. Achieving Fairness with a Simple Ridge Penalty. arXiv:2105.13817. Tsoumakas, G.; Katakis, I.; and Vlahavas, I. 2006. A re- view of multi-label classification methods. In Proceedings of the 2nd ADBIS workshop on data mining and knowledge discovery (ADMKD 2006), 99–109. Citeseer. Tsoumakas, G.; and Vlahavas, I. 2007. Random k-labelsets: An ensemble method for multilabel classification. In Euro- pean conference on machine learning, 406–417. Springer. Woodworth, B.; Gunasekar, S.; Ohannessian, M. I.; and Sre- bro, N. 2017. Learning non-discriminatory predictors. In Conference on Learning Theory, 1920–1953. PMLR. Wu, X.-Z.; and Zhou, Z.-H. 2017. A unified view of multi- label performance measures. In international conference on machine learning, 3780–3788. PMLR. Yang, B.; Sun, J.-T.; Wang, T.; and Chen, Z. 2009. Effective multi-label active learning for text classification. In Proceed- ings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, 917–926. Yeh, I.-C.; and Lien, C.-h. 2009. The comparisons of data mining techniques for the predictive accuracy of probabil- ity of default of credit card clients. Expert systems with applications, 36(2): 2473–2480. Zafar, M. B.; Valera, I.; Gomez Rodriguez, M.; and Gum- madi, K. P. 2017. Fairness beyond disparate treatment & disparate impact: Learning classification without disparate mistreatment. In Proceedings of the 26th international con- ference on world wide web, 1171–1180. Zhang, D.; Zhao, S.; Duan, Z.; Chen, J.; Zhang, Y.; and Tang, J. 2020. A multi-label classification method using a hierarchical and transparent representation for paper-reviewer recommendation. ACM Transactions on Information Systems (TOIS), 38(1): 1–20. Zhang, M.-L.; Li, Y.-K.; Liu, X.-Y.; and Geng, X. 2018. Binary relevance for multi-label learning: an overview. Fron- tiers of Computer Science, 12(2): 191–202. Zhang, M.-L.; and Zhou, Z.-H. 2007. Ml-knn: A Lazy Learn- ing Approach to Multi-Label Learning. Pattern recognition, 40(7): 2038–2048. Zhang, M.-L.; and Zhou, Z.-H. 2014. A Review on Multi- Label Learning Algorithms. IEEE Transactions on Knowl- edge and Data Engineering, 26(8): 1819–1837. Zhao, Z.; Guo, Y.; Shen, H.; and Ye, J. 2020. Adaptive ob- ject detection with dual multi-label prediction. In European Conference on Computer Vision, 54–69. Springer. We summarize notations used in this paper in table 3. Notations Meaning A Notation Table x ∈ X a ∈ A y ∈ Y = {0, 1}L h = f ◦ g : X → Y ˆy = h(x) = g(f (x)) ̃y = f (x) sγ(y, y(cid:48)) γ ≥ 0 λ ≥ 0 (cid:96)mlc(h) ˆ(cid:96)sγ (y,yadv)(h) Non-sensitive feature and non-sensitive feature space. Sensitive feature and sensitive feature space. Label and label space. A composited multi-label classifier, f : X → [0, 1]L and g : [0, 1]L → Y. Predicted label (Prediction). Predicted probability vector. Similarity between label y and y(cid:48). Scaling hyperparameter in similarity. Coefficient of fairness penalty. Multi-label classification loss. sγ-SimFair violation (penalty). Table 3: Main notations used in this paper. B Omitted Proofs Proof of Proposition 3.1 Proposition B.1 (DP and EOp condition in MLC). For a multi-label classifier that takes the form h = f ◦ g, where ̃y = g(x) is the predicted probability and ˆy = f ( ̃y) is computed elementwisely, DP and EOp hold if for any k ∈ A DP: E[ ̃y | a = k] = E[ ̃y] EOp: E[ ̃y | a = k, y = yadv] = E[ ̃y | y = yadv]. (13) Proof. Here we derive the condition of EOp in eqn (13), the proof for DP can be obtained in the same way. Note that the conditional distribution of prediction y in k-th demographic subgroup of the advantaged group is given by p(ˆy | a = k, y = yadv) = (cid:90) p(ˆy, x | a = k, y = yadv) dx (cid:90) = (cid:90) (a) = (cid:90) = p(ˆy | x, a = k, y = yadv)p(x | a = k, y = yadv) dx p(ˆy | x)p(x | a = k, y = yadv) dx g(x)p(x | a = k, y = yadv) dx = E[ ̃y | a = k, y = yadv], where (a) holds because of the conditional independence ˆy ⊥ (y, a) | x. Similar derivation gives us p(ˆy | y = yadv) = E[ ̃y | y = yadv]. This indicates that the conditional independence requirement in EOp can be fulfilled if corresponding conditional expectations match. Proof of Proposition 3.2 Proposition B.2 (DP and EOp are special cases of sγ-SimFair). Consider sγ-SimFair defined in eqn (7), if similarity s is a constant function s(y, y(cid:48)) = c for some c, then sγ-SimFair implies DP; if s is an indicator function s(y, y(cid:48)) = 1(y = y(cid:48)), then sγ-SimFair implies EOp. Proof. The EOp case can be seen by taking special s(y, y(cid:48)) = 1(y = y(cid:48)) in eqn (7). To prove the DP case, note that for constant function s(y, y(cid:48)) = c, the left hand side of eqn (7) becomes E[c ̃y]/E[c] = E[ ̃y], and the right hand side is = E[ ̃y1(a = k)] E[1(a = k)] ̃y1(a = k)p( ̃y, a) da ̃y E[c ̃y1(a = k)] E[c1(a = k)] 1 P (a = k) (cid:90) (cid:90) = = ̃y (cid:90) (cid:90) 1 P (a = k) p(1(a = k)p( ̃y, a)) da d ̃y (cid:90) = ̃yp( ̃y | a = k) d ̃y = E[ ̃y | a = k]. Now eqn (7) requires E[ ̃y | a = k] = E[ ̃y] for all k, which is exactly the condition of DP. Proof of Proposition 3.3 Proposition B.3 (sγ-SimFair helps achieve DP and EOp). For any multi-label classifier h satisfying sγ-SimFair, its violation of DP will be arbitrarily small if γ is sufficiently small; and its violation of EOp will be arbitrarily small if γ is sufficiently large. More generally, its violation of DP is arbitrarily close to its violation of sγ-SimFair for sufficiently small γ, and its violation of EOp is arbitrarily close to its violation of sγ-SimFair for sufficiently large γ. Proof. Let y, y(cid:48) be two arbitrary label vectors, and s∗(y, y(cid:48)) denote the limit of their similarity sγ(y, y(cid:48)) as γ → 0 or γ → ∞. Equivalently speaking, s∗(y, y(cid:48)) is constant 1 or indicator function 1(y = y(cid:48)), which are special sγ by Proposition 3.2. This allows us to express and upper bound the difference between violations of DP (or EOp) and sγ-SimFair on subgroup with a = k and label yadv defined in eqn (10) by (cid:107)(cid:96)s∗(y,yadv)(f ) − (cid:96)sγ (y,yadv)(f )(cid:107) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) E[ ̃y1(a = k)s∗(y, yadv)] E[1(a = k)s∗(y, yadv)] = (cid:13) (cid:13) (cid:13) − (cid:13) (cid:13) (cid:13) E[ ̃ysγ(y, yadv)] E[sγ(y, yadv)] − E[ ̃y1(a = k)sγ(y, yadv)] E[1(a = k)sγ(y, yadv)] (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) − E[ ̃ys∗(y, yadv)] E[s∗(y, yadv)] (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:18) E[ ̃ys∗(y, yadv)] E[s∗(y, yadv)] E[ ̃ys∗(y, yadv)] E[s∗(y, yadv)] − (a) ≤ (b) ≤ − E[ ̃y1(a = k)s∗(y, yadv)] E[1(a = k)s∗(y, yadv)] (cid:19) − (cid:18) E[ ̃ysγ(y, yadv)] E[sγ(y, yadv)] − E[ ̃ysγ(y, yadv)] E[sγ(y, yadv)] (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) + (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) E[ ̃y1(a = k)s∗(y, yadv)] E[1(a = k)s∗(y, yadv)] − E[ ̃y1(a = k)sγ(y, yadv)] E[1(a = k)sγ(y, yadv)] (cid:13) (cid:13) (cid:13) , (cid:13) (cid:13) E[ ̃y1(a = k)sγ(y, yadv)] E[1(a = k)sγ(y, yadv)] (cid:19) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) where (a) holds from the reverse triangle inequality and (b) holds from the triangle inequality. Next, sequence sγ(y, y(cid:48)) converges to s∗(y, y(cid:48)) monotonically, we have the following almost surely convergence ̃ysγ(y, yadv) a.s.−−→ ̃ys∗(y, yadv). Recall that ̃y is the predicted probability vector so E[(cid:107) ̃y(cid:107)] < ∞, and sγ(y, yadv), s∗(y, yadv) ∈ [0, 1], we have Let γ∗ denote 0 (for DP) or ∞ (for EOp). According to Dominated Convergence Theorem max((cid:107) ̃ysγ(y, yadv)(cid:107), (cid:107) ̃ys∗(y, yadv)(cid:107)) ≤ (cid:107) ̃y(cid:107) and lim γ→γ∗ (cid:107)E[ ̃ysγ(y, yadv)] − E[ ̃ys∗(y, yadv)](cid:107) = 0, lim γ→γ∗ (cid:107)E[sγ(y, yadv)] − E[s∗(y, yadv)](cid:107) = 0. Without loss of generality we further assume E[sγ(y, yadv)] and E[s∗(y, yadv)] are positive 3. This gives us E[ ̃ysγ(y, yadv)] E[sγ(y, yadv)] → E[ ̃ys∗(y, yadv)] E[s∗(y, yadv)] . (14) 3This only rules out case p(yadv) = 0 when Y is discrete, where fairness concern does not exist. In other words, the first term in eqn (14) can be bounded with arbitrarily small ε as γ → 0 (for DP case with s∗(y, y(cid:48)) = 1) or γ → ∞ (for EOp case with s∗(y, y(cid:48)) = 1(y = y(cid:48))). Similar upper bound can be derived for the second term in the same way. Put together, we have where ε depends on γ and can be made arbitrarily small. The first part of the proposition is proved by further assuming (cid:96)sγ (y, yadv) = 0, i.e., (cid:107)(cid:96)s∗(y,yadv)(f ) − (cid:96)sγ (y,yadv)(f )(cid:107) ≤ 2ε, (15) E[ ̃ysγ(y, yadv)] E[sγy, yadv)] = E[ ̃y1(a = k)sγ(y, yadv)] E[1(a = k)sγ(y, yadv)] . (16) This completes our proof. C Algorithm Here we provide a concise illustration of MPVAE traininig with sγ-SimFair regularizer. In each step, we take one minibatch randomly selected from the dataset and update MPVAE with loss defined in eqn (12). Algorithm 1 summarizes this step. Algorithm 1: One update of MPVAE with sγ-SimFair regularizer. Input: mini-batch {(x(i), a(i), y(i))}n Output: Updated MPVAE h 1: Compute the empirical multi-label classification loss on the minibatch i=1, advantaged group yadv, MPVAE h, hyperparameters γ and λ. ˆ(cid:96)mlc = 1 n n (cid:88) i=1 (cid:96)mlc(x(i), y(i); h). 2: For each sample, compute predictions from label and feature branches ̃y(i) 3: Compute empirical fairness loss ˆ(cid:96)sγ (y,yadv) on the minibatch with eqn (10) or (11). Estimate each term by eqn (8) or (9). 4: Take one updates on h with Adam (Kingma and Ba 2014) to minimize the final empirical loss γ = sγ(y(i), yadv). y , ̃y(i) x , and s(i) ˆ(cid:96) = ˆ(cid:96)mlc + λˆ(cid:96)sγ (y,yadv) D Experimental Details Here we present the hyperparameters we used in experiments for reproducibility. For experiments run 10 replications, we used random seeds from 1 to 10; for experiments that only had 3 replications, we used seeds from 1 to 3. We used the same fixed hyperparameters except λ and γ throughout all experiments. We made one modification to MPVAE training by clipping the gradient norm to stabilize the training, other training strategies are adopted from Bai, Kong, and Gomes (2020) and details can be found therein. Hyperparameters that are different from Bai, Kong, and Gomes (2020) are listed in table 4. Epochs Ranking loss coefficient Latent dimension Max. gradient norm 20 100 32 5 Table 4: Hyperparameter settings of our experiments. Other hyperparameters are adopted from Bai, Kong, and Gomes (2020). E More Experimental Results Fairness-Accuracy Tradeoff In this section we show full EOp- and DP-accuracy tradeoff in Figure 5 and 6 following the same logic as in Section 4. Note that whereas EOp-accuracy tradeoff on Adult dataset has different curvatures, but the conclusion does not change. DP-accuracy tradeoff has the similar trends as the EOp-accuracy tradeoff, so we omit reiterating observations. 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - o r c i m t e s a t a d t i d e r C : 1 F - o r c i m 0.65 0.60 0.55 0.50 0.45 0.22 0.20 0.18 0.16 0.14 0.12 0.10 0.08 t e s a t a d t l u d A : 1 F - o r c a m DP s1 -SF s5 -SF s10 -SF EOp 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - e l p m a x e DP s1 -SF s5 -SF s10 -SF EOp DP s1 -SF s5 -SF s10 -SF EOp 0 0 0.0 5 2 0.0 0 5 0.0 0 0 0.1 5 2 0.1 0 5 0.1 5 7 0.0 EOp 0 0 0.0 5 2 0.0 0 5 0.0 0 0 0.1 5 2 0.1 0 5 0.1 5 7 0.0 EOp 0 0 0.0 5 2 0.0 0 5 0.0 0 0 0.1 5 2 0.1 0 5 0.1 5 7 0.0 EOp (a) Adult dataset: No.1 label group t e s a t a d t i d e r C : 1 F - o r c a m 0.30 0.25 0.20 0.15 0.10 DP s1 -SF s5 -SF s10 -SF EOp t e s a t a d t i d e r C : 1 F - e l p m a x e 0.65 0.60 0.55 0.50 0.45 DP s1 -SF s5 -SF s10 -SF EOp 0 0.0 1 0.0 2 0.0 EOp 3 0.0 4 0.0 0 0.0 1 0.0 2 0.0 EOp 3 0.0 4 0.0 0 0.0 1 0.0 2 0.0 EOp DP s1 -SF s5 -SF s10 -SF EOp 3 0.0 4 0.0 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - o r c i m t e s a t a d t i d e r C : 1 F - o r c i m 0.675 0.650 0.625 0.600 0.575 0.550 0.525 0.500 0.22 0.20 0.18 0.16 0.14 0.12 0.10 0.08 t e s a t a d t l u d A : 1 F - o r c a m DP s1 -SF s5 -SF s10 -SF EOp 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - e l p m a x e DP s1 -SF s5 -SF s10 -SF EOp DP s1 -SF s5 -SF s10 -SF EOp 0 0.0 2 0.0 4 0.0 6 0.0 8 0.0 0 0.1 0 0.0 2 0.0 EOp 4 0.0 6 0.0 EOp 8 0.0 0 0.1 0 0.0 2 0.0 4 0.0 6 0.0 8 0.0 0 0.1 EOp (b) Adult dataset: No.18 label group t e s a t a d t i d e r C : 1 F - o r c a m 0.30 0.25 0.20 0.15 0.10 DP s1 -SF s5 -SF s10 -SF EOp t e s a t a d t i d e r C : 1 F - e l p m a x e 0.675 0.650 0.625 0.600 0.575 0.550 0.525 0.500 DP s1 -SF s5 -SF s10 -SF EOp 5 0.0 0 0.1 5 0.1 EOp 0 0.2 5 0.2 5 0.0 0 0.1 5 0.1 EOp 0 0.2 5 0.2 5 0.0 0 0.1 5 0.1 EOp DP s1 -SF s5 -SF s10 -SF EOp 0 0.2 5 0.2 (c) Credit dataset: No.1 label group (d) Credit dataset: No.9 label group Figure 5: EOp-accuracy tradeoffs. EOp regularizer was unstable and ineffective when the advantaged group is small, sγ-SimFair, on the other hand, preserved similar tradeoff trend as DP on both large and small label groups. 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - o r c i m t e s a t a d t i d e r C : 1 F - o r c i m 0.65 0.60 0.55 0.50 0.45 0.22 0.20 0.18 0.16 0.14 0.12 0.10 0.08 t e s a t a d t l u d A : 1 F - o r c a m DP s1 -SF s5 -SF s10 -SF EOp 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - e l p m a x e DP s1 -SF s5 -SF s10 -SF EOp 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - o r c i m DP s1 -SF s5 -SF s10 -SF EOp 0.22 0.20 0.18 0.16 0.14 0.12 0.10 0.08 t e s a t a d t l u d A : 1 F - o r c a m DP s1 -SF s5 -SF s10 -SF EOp 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - e l p m a x e DP s1 -SF s5 -SF s10 -SF EOp DP s1 -SF s5 -SF s10 -SF EOp 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP (a) Adult dataset: No.1 label group (b) Adult dataset: No.18 label group t e s a t a d t i d e r C : 1 F - o r c a m 0.30 0.25 0.20 0.15 0.10 DP s1 -SF s5 -SF s10 -SF EOp t e s a t a d t i d e r C : 1 F - e l p m a x e 0.65 0.60 0.55 0.50 0.45 DP s1 -SF s5 -SF s10 -SF EOp t e s a t a d t i d e r C : 1 F - o r c i m 0.675 0.650 0.625 0.600 0.575 0.550 0.525 0.500 DP s1 -SF s5 -SF s10 -SF EOp t e s a t a d t i d e r C : 1 F - o r c a m 0.30 0.25 0.20 0.15 0.10 DP s1 -SF s5 -SF s10 -SF EOp t e s a t a d t i d e r C : 1 F - e l p m a x e 0.675 0.650 0.625 0.600 0.575 0.550 0.525 0.500 DP s1 -SF s5 -SF s10 -SF EOp DP s1 -SF s5 -SF s10 -SF EOp 0 0 0.0 5 0 0.0 0 1 0.0 5 1 0.0 DP 0 2 0.0 5 2 0.0 0 3 0.0 0 0 0.0 5 0 0.0 0 1 0.0 5 1 0.0 DP 0 2 0.0 5 2 0.0 0 3 0.0 0 0 0.0 5 0 0.0 0 1 0.0 0 2 0.0 5 2 0.0 0 3 0.0 5 1 0.0 DP 0 0 0.0 5 0 0.0 0 1 0.0 5 1 0.0 DP 0 2 0.0 5 2 0.0 0 3 0.0 0 0 0.0 5 0 0.0 0 1 0.0 5 1 0.0 DP 0 2 0.0 5 2 0.0 0 3 0.0 0 0 0.0 5 0 0.0 0 1 0.0 0 2 0.0 5 2 0.0 0 3 0.0 5 1 0.0 DP (c) Credit dataset: No.1 label group (d) Credit dataset: No.9 label group Figure 6: DP-accuracy tradeoffs. EOp regularizer was unstable and ineffective when the advantaged group is small, sγ-SimFair, on the other hand, preserved similar tradeoff trend as DP on both large and small label groups. Experiments on Multiclass Sensitive Feature In this section we report results of sγ-SimFair on multiclass sensitive feature, where corresponding regularizers are constructed based on eqn (10). We take Adult dataset as an example and use race as the sensitive feature. All other experiment settings are same as before. Table 5 reports corresponding DP and EOp violations using different regularizers with coefficient λ = 10. Again, sγ-SimFair achieves the lowest DP and EOp violations as before. Figure 7 shows corresponding fairness-accuracy tradeoffs, where sγ-SimFair strikes a good tradeoff balances. |yadv| Metric DP reg 0.009 DP 0.013 EOp s1-SF reg 0.009 0.014 s5-SF reg 0.008 0.009 s10-SF reg EOp reg No reg 0.110 0.160 0.008 0.005 0.051 0.041 DP EOp 0.009 0.023 0.010 0.022 0.004 0.009 0.002 0.006 0.105 0.090 0.110 0.101 t No.1 l u d A No.18 Table 5: DP and EOp violations of MPVAE trained with DP, EOp, and sγ-SimFair regularziers. Sensitive feature is multiclass race. A large and a small advantaged groups (measured by their ranking in col. |yadv|) are tested. Results are averaged over 10 replications, best results are in bold. 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - o r c i m 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - o r c i m 0.22 0.20 0.18 0.16 0.14 0.12 0.10 0.08 t e s a t a d t l u d A : 1 F - o r c a m DP s1 -SF s5 -SF s10 -SF EOp 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - e l p m a x e DP s1 -SF s5 -SF s10 -SF EOp 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - o r c i m DP s1 -SF s5 -SF s10 -SF EOp 0.22 0.20 0.18 0.16 0.14 0.12 0.10 0.08 t e s a t a d t l u d A : 1 F - o r c a m DP s1 -SF s5 -SF s10 -SF EOp 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - e l p m a x e DP s1 -SF s5 -SF s10 -SF EOp DP s1 -SF s5 -SF s10 -SF EOp 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP 0 0.0 2 0.0 4 0.0 8 0.0 0 0.1 6 0.0 DP (a) DP-accuracy tradeoff on Adult dataset: No.1 label group (b) DP-accuracy tradeoff on Adult dataset: No.18 label group 0.22 0.20 0.18 0.16 0.14 0.12 0.10 0.08 t e s a t a d t l u d A : 1 F - o r c a m DP s1 -SF s5 -SF s10 -SF EOp 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - e l p m a x e DP s1 -SF s5 -SF s10 -SF EOp 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - o r c i m DP s1 -SF s5 -SF s10 -SF EOp 0 0 0.0 5 2 0.0 0 5 0.0 0 0 0.1 5 2 0.1 0 5 0.1 5 7 0.0 EOp 0 0 0.0 5 2 0.0 0 5 0.0 0 0 0.1 5 2 0.1 0 5 0.1 5 7 0.0 EOp 0 0 0.0 5 2 0.0 0 5 0.0 0 0 0.1 5 2 0.1 0 5 0.1 5 7 0.0 EOp 0 0.0 2 0.0 4 0.0 6 0.0 EOp 0.22 0.20 0.18 0.16 0.14 0.12 0.10 0.08 t e s a t a d t l u d A : 1 F - o r c a m DP s1 -SF s5 -SF s10 -SF EOp 8 0.0 0 0.1 0.6 0.5 0.4 0.3 t e s a t a d t l u d A : 1 F - e l p m a x e DP s1 -SF s5 -SF s10 -SF EOp 0 0.0 2 0.0 4 0.0 6 0.0 8 0.0 0 0.1 0 0.0 2 0.0 EOp 4 0.0 6 0.0 EOp DP s1 -SF s5 -SF s10 -SF EOp 8 0.0 0 0.1 (c) EOp-accuracy tradeoff on Adult dataset: No.1 label group (d) EOp-accuracy tradeoff on Adult dataset: No.18 label group Figure 7: DP- and EOp-accuracy tradeoffs. Sensitive feature is multiclass race.
http://arxiv.org/abs/2302.09676v2
2023-09-01T18:03:09
2023-02-19T21:47:24
Leveraging Prior Knowledge in Reinforcement Learning via Double-Sided Bounds on the Value Function
An agent's ability to leverage past experience is critical for efficiently solving new tasks. Approximate solutions for new tasks can be obtained from previously derived value functions, as demonstrated by research on transfer learning, curriculum learning, and compositionality. However, prior work has primarily focused on using value functions to obtain zero-shot approximations for solutions to a new task. In this work, we show how an arbitrary approximation for the value function can be used to derive double-sided bounds on the optimal value function of interest. We further extend the framework with error analysis for continuous state and action spaces. The derived results lead to new approaches for clipping during training which we validate numerically in simple domains.
[ "Jacob Adamczyk", "Stas Tiomkin", "Rahul Kulkarni" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09676v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09676v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Leveraging Prior Knowledge in Reinforcement Learning via Double-Sided Bounds on the Value Function Jacob Adamczyk1, Stas Tiomkin2, Rahul V. Kulkarni1 1Department of Physics, University of Massachusetts Boston 2Department of Computer Engineering, San Jos ́e State University [email protected], [email protected], [email protected] 3 2 0 2 p e S 1 ] G L . s c [ 2 v 6 7 6 9 0 . 2 0 3 2 : v i X r a Abstract An agent's ability to leverage past experience is critical for efficiently solving new tasks. Approximate solutions for new tasks can be obtained from previously derived value func- tions, as demonstrated by research on transfer learning, cur- riculum learning, and compositionality. However, prior work has primarily focused on using value functions to obtain zero- shot approximations for solutions to a new task. In this work, we show how an arbitrary approximation for the value func- tion can be used to derive double-sided bounds on the optimal value function of interest. We further extend the framework with error analysis for continuous state and action spaces. The derived results lead to new approaches for clipping during training which we validate numerically in simple domains. Introduction The field of reinforcement learning (RL) has seen impres- sive successes (Degrave et al. 2022; Schrittwieser et al. 2020; Vinyals et al. 2019; Silver et al. 2018) in recent years due to the development of novel algorithms in combina- tion with deep learning architectures. However, for com- plex tasks, the amount of training time required for learn- ing an optimal solution from scratch can be prohibitively large and thus presents a significant obstacle to further de- velopment. To address this challenge, approaches that lever- age prior knowledge to efficiently calculate policies for new tasks are needed. While policies generated from prior solu- tions may not be the optimal policies for the new tasks, they can serve as useful approximations that reduce training time. Correspondingly, there is a need to develop approaches that further leverage the use of approximations based on prior knowledge to address the problem of solving new tasks. Previous work has focused on addressing this problem us- ing different approaches such as transfer learning, curricu- lum learning, and compositionality. In particular, we con- sider value-based RL approaches, wherein the agent's goal is to learn the expected value of every state and action pair. Given this value function, Q(s, a), the agent can act opti- mally by choosing actions which maximize its expected fu- ture returns. In many instances, the agent has an estimate for the value function before training begins. For example, in the case of curriculum learning, the agent has the Q-values for previously learned (progressively more challenging) tasks. In the case of compositional or hierarchical RL, the agent can combine knowledge by applying a function on subtasks' Q-values. When using an exploratory skill-acquisition ap- proach such as DIAYN (Eysenbach et al. 2019) or CSD (Park et al. 2023), the agent obtains Q-values for a diverse set of skills. Even in cases where an initial estimate is not explicitly provided, the agent can provide itself an estimate by using Q-values that were obtained during the ongoing learning phase (bootstrapping). An underlying question in these scenarios is the follow- ing: How can the agent use the known value function esti- mate(s) for solving a new target task? Does the estimate only serve as a zero-shot approximation or is there additional use- ful information that can be extracted from it? In the work of (Adamczyk et al. 2023a), the authors show that there exists a method of "closing the gap" between any estimate (Q∗(s, a)) and any target ( (cid:101)Q∗(s, a)) task (with an accessible reward function) in entropy-regularized RL. This statement is facilitated by the work of (Cao, Cohen, and Szpruch 2021) which can be used to show that any estimate can be viewed as an optimal value function corresponding to a suitably defined reward function. Here, we show that since the gap between the target and estimated value func- tions: (cid:101)Q∗(s, a) − Q∗(s, a) = K ∗(s, a) is itself an optimal value function, it can be bounded. As a consequence, instead of providing only a zero-shot approximation or a warmstart for training the target task, we show that the estimates avail- able to the agent also provide a double-sided bound on the optimal Q-values being learned. A schematic illustration of our approach is provided in Fig. 1. Starting with an estimate of the optimal value function and samples of the reward function, we derive double-sided bounds on the true optimal value function. We find that applying these bounds during training improves the agent's training performance and allows an additional method for monitoring convergence. We provide further the- oretical analysis on continuous state-action spaces, relevant for the function approximator (FA) setting in Deep RL. Main contributions The main contributions of our work, applicable to both stan- dard and entropy-regularized RL, are: 1. Development of a general framework for bounding opti- mal value functions based on prior knowledge. 2. Extension of derived results to include theoretical error by the agent, i.e. π∗ = arg max π (cid:34) ∞ (cid:88) E t=0 (cid:35) γtr(st, at) . (1) An important generalization is entropy-regularized RL (Ziebart 2010), which augments the un-regularized RL ob- jective (Eq. (1)) by including an entropic regularization term which penalizes control over a pre-specified reference pol- icy: π∗ = arg max π (cid:34) ∞ (cid:88) E (cid:18) γt rt − t=0 1 β log (cid:18) π(at|st) π0(at|st) (cid:19)(cid:19)(cid:35) where π0(a|s) is the fixed prior policy. The additional control cost discourages the agent from choosing policies that deviate too much from this prior policy. Importantly, entropy-regularized MDPs lead to stochastic optimal poli- cies that are provably robust to perturbations of rewards and dynamics (Eysenbach and Levine 2022); making them a more suitable approach to real-world problems. The solution to the RL problem is defined by its optimal action-value function (Q∗(s, a)) from which one can derive the aforementioned optimal policy π∗(a|s). For both un- regularized and entropy-regularized RL, the optimal value function can be obtained by iterating a recursive Bell- man equation. In un-regularized RL, the Bellman optimality equation is given by (Sutton and Barto 2018): Q∗(s, a) = r(s, a) + γEs′∼p(*|s,a) max a′ (Q∗(s′, a′)) . (2) The entropy term in the objective function of entropy- regularized RL modifies the previous optimality equation in the following way (Ziebart 2010; Haarnoja et al. 2018b): Q∗(s, a) = r(s, a) + γ β Es′∼p log Ea′∼π0eβQ∗(s′,a′). (3) The regularization parameter β can be interpreted as be- ing analogous to an inverse temperature parameter, its value is used to control the degree of stochasticity in the optimal policy. In the entropy-regularized setting, Q∗ is referred to as the optimal "soft" action-value function. For brevity, we will hereon refer to Q∗ simply as the value function. Prior Work The importance of double-sided bounds on value functions has been explored in prior work. In this section we review a set of the most relevant prior works (Nemecek and Parr 2021; Kim, Park, and Kim 2022; Haarnoja et al. 2018a; Adamczyk et al. 2023b; Todorov 2009; Van Niekerk et al. 2019; Tasse, James, and Rosman 2020; Lee et al. 2021). We contrast the existing works with regard to the following features: i) the assumption about composition and/or trans- formation of known solutions in the derivation of bounds, ii) the requirement for additional samples needed to derive bounds, iii) the generality and applicability of bounds to un- regularized RL and entropy-regularized RL, and to deter- ministic and stochastic dynamics, iv) double or single-sided bounds. Figure 1: Schematic illustration of the main contribution of this work. Given any approximation (red curve) to the optimal value function of interest (black curve), we derive double-sided bounds (blue curves) that lead to clipping ap- proaches during training. Based solely on the current ap- proximation for Q(s, a) (red curve), we derive double-sided bounds on the unknown optimal value function Q∗(s, a) (black curve). In the right panel, we show the different clip- ping methods, which are described further in the "Experi- mental Validation" section. In "Hard Clipping", the target is replaced with the exceeded bound; in "Soft Clipping", an additional loss term is appended to the Bellman loss, propor- tional to the magnitude of the bound violation; in "Smoothed Clipping", the target update is replaced with a weighted av- erage of the original value and the exceeded bound. analysis in continuous state-action spaces. 3. Demonstration of value-based clipping methods as prac- tical applications of the derived theoretical results. There are multiple applications that arise from the deriva- tion of such double-sided bounds. The bounds (1) allow con- finement of FA training to a limited output range, (2) provide a mechanism to choose the "best" skill from a pre-trained set of skills and (3) establish a framework that provides insights into and extends previous results on exact compositions of value functions. Preliminaries For the theoretical setup, we consider initially the case of finite, discrete state and action spaces, and we will subse- quently extend our analysis to continuous spaces. In this set- ting, the reinforcement learning (RL) problem is modeled by a Markov Decision Process (MDP) represented as a tu- ple ⟨S, A, p, r, γ⟩ where S is the set of available states; A is the set of possible actions; p : S × A → S is the transition function (dynamics); r : S × A → R is a (bounded) re- ward function which associates a reward (or cost) with each state-action pair; and γ ∈ (0, 1) is a discount factor which discounts future rewards and assures convergence of the to- tal reward for an infinitely long trajectory. The objective in standard (un-regularized) RL is to find an optimal policy that maximizes expected rewards collected ×Q(s,a)Bound ViolationsOptimal Q-functionDouble-Sided BoundsCurrent ApproximationBatch of Samples×Hard ClippingNo ClippingSoft ClippingSmoothed Clipping In (Nemecek and Parr 2021), the authors have derived double-sided bounds on the state value function V (s) by the positive conical combination of subtask rewards. The method in (Nemecek and Parr 2021) requires additional samples for first learning the successor features before then deriving the double-sided bounds for a downstream task. The applicability of (Nemecek and Parr 2021) is limited to un-regularized RL. The aforementioned work was subsequently extended by (Kim, Park, and Kim 2022), where, in the same GPI set- ting, they present double-sided bounds on Q-values for lin- ear combinations of subtask reward functions. They intro- duce the notion of "soft clipping" which we adapt to our set- ting (details in the "Experimental Validation" section), but it was not demonstrated in practice. Similarly to (Nemecek and Parr 2021), the method in (Kim, Park, and Kim 2022) requires firstly to learn the successor features, and it is lim- ited to un-regularized RL only. The previous two works were focused on the standard (un- regularized) reinforcement learning setting. However, the double-sided bounds presented in (Haarnoja et al. 2018a)'s Lemma 1 are derived for the MaxEnt setting, for the case of convex reward combinations. It is worth noting that the lower bound in this case must be learned (the C function). Extending these results to other more general classes of functional composition, (Adamczyk et al. 2023b) provides double-sided bounds for both entropy-regularized and un- regularized RL. However, one side of the bound in all cases must be learned as well. Finally, multiple prior works have focused on specific ex- amples of compositionality for which exact results can be obtained for the optimal value function. These results typ- ically involve multiple limiting assumptions on the struc- ture of rewards functions, nature of transition dynamics and specific forms for the composition function. (Todorov 2009; Van Niekerk et al. 2019; Tasse, James, and Rosman 2020). In a broader context, (Lee et al. 2021) proposes to bound "Bellman updates", which improves the stability of training and sample efficiency in entropy-regularized RL. However, the method in (Lee et al. 2021) does not leverage known so- lutions for new tasks, instead using a parallel ensemble of learners for variance estimation. In the current work we propose a novel method for the derivation of double-sided bounds, which is not limited to a particular type of composition or transformation of prior so- lution(s), and is valid for an arbitrary function. Our method is a "zero-shot" approach for deriving double-sided bounds – it does not require additional samples beyond those col- lected by the learning agent. It is applicable to both standard and entropy-regularized RL, to deterministic and stochastic environments, and to discrete and continuous domains. The theoretical results are provided in the following "Results" section, and in the "Applications" section we demonstrate the applications of the theory in simple domains, leaving large scale experiments to future work. Results In this section, we focus on entropy-regularized (MaxEnt) RL, the case considered in (Adamczyk et al. 2023a). The analogous results for un-regularized RL (which can be con- sidered as a limiting case of entropy-regularized RL) are provided later. The proofs of all results shown can be found in the Appendix. Our main result provides double-sided bounds on the op- timal Q function. We emphasize that any (bounded) function Q : S × A → R can be used to generate a bound. We sug- gestively use the notation "Q" for this otherwise arbitrary function to note that it can be derived from a previous tasks' solution, an estimate, or other ansatz (e.g. composition or hierarchical function) of subtask Q-values. Theorem 4.1. Consider an entropy-regularized MDP ⟨S, A, p, r, γ, β⟩ with (unknown) optimal value function Q∗(s, a). Let an estimate for the value function Q(s, a) be given. Denote V (s) . = 1/β log Ea∼π0 exp βQ(s, a). The optimal value function Q∗(s, a) is then bounded by: Q∗(s, a) ≥ r(s, a) + γ Q∗(s, a) ≤ r(s, a) + γ (cid:18) (cid:18) E s′∼p E s′∼p V (s′) + V (s′) + (cid:19) inf ∆ 1 − γ sup ∆ 1 − γ (cid:19) (4a) (4b) where ∆(s, a) . = r(s, a) + γ E s′∼p V (s′) − Q(s, a). In Eq. (4a) and (4b), the inf and sup are taken over the continuous state-action space S × A. During training, the Bellman loss L = ||∆||2 → 0, im- plying that inf ∆ → 0 and sup ∆ → 0, hence the bounds in Eq. (4.1) will become tight upon convergence of the soft action-value function. We note that this is generally not the case for un-regularized RL, as will be discussed later. In principle, given some assumptions on the structure of the reward function or dynamics, it is possible to tighten these bounds. As an example, we provide a tighter lower bound when the MDP always has an "identity" action al- lowing the agent to return to the same state: Lemma 4.1a. Consider an entropy-regularized MDP ⟨S, A, p, r, γ, β⟩ with (unknown) optimal value function Q∗(s, a). Let an estimate for the value function Q(s, a) be . = 1/β log Ea∼π0 exp βQ(s, a). Sup- given. Denote V (s) pose there exists an "identity" action a∅(s) ∈ A for each state, which deterministically transitions the agent to the same state: p(s′|s, a∅(s)) = δ(s′ − s) for all s ∈ S. Then the lower bound on the optimal value function Q∗(s, a) can be improved: Q∗(s, a) ≥ r(s, a) + γ (cid:18) V (s′) + 1 1 − γ (cid:19) ∆(s′, a∅) (5) In the Appendix, we show that the lower bound of Eq. (5) is indeed tighter than Eq. (4a) at all state-actions except the minimizer (s∗, a∗) = arginf ∆(s, a). As an alternative, in practice, one can replace the inf and sup in the previous results by a min and max, respectively, over the finite dataset provided (e.g. the current batch of re- play data). Although not exact, this substitution becomes in- creasingly accurate for large batch sizes. We employ this substitution in the experiments shown in section . Never- theless, we provide an exact extension of our results in the subsequent section for sufficiently well-behaved state-action spaces. In a similar manner, we may also bound the rate of sub- optimality induced by using the policy derived from some estimate Q(s, a): Corollary 4.2 (Suboptimality Bounds). Let policy π(a|s) be given with soft value Qπ(s, a). The rate of the suboptimality gap, Q∗(s, a) − Qπ(s, a), is then bounded between d(s, a) ≤ inf (s,a) Q∗(s, a) − Qπ(s, a) H ≤ sup (s,a) d(s, a) (6) where d(s, a) . = r(s, a) + γ Es′ V π(s′) − Qπ(s, a), . = log Ea exp βQπ(s, a) is the soft state-value func- V π(s) tion, and H = (1 − γ)−1 is the effective time horizon. This result implies that any policy with a known soft value function has a (lower and upper) bounded suboptimality. The typically-stated objective of minimizing the Bellman loss can be understood as minimizing the suboptimality suf- fered by the induced policy π ∝ exp βQ. We conclude this section by showing that a new Bellman operator, which includes clipping when applicable, con- verges to the optimal Q function: Theorem 4.3. Let the functions L(s, a), U (s, a) be lower and upper bounds on the optimal value func- Q∗(s, a) tion: L(s, a) ≤ U (s, a) for all s ∈ S and a ∈ A. The clipped Bellman operator, BCQ(s, a) := maxs,a (mins,a (BQ(s, a), U (s, a)) , L(s, a)) converges the Q∗(s, a) = B∞Q(s, a). function optimal value ≤ to This result shows that updates with clipping are guaran- teed to converge to the same solution. We experimentally demonstrate this in Fig. 3. Error Propagation in Continuous Spaces The bounds presented in the previous section, though exact, are often intractable due to the required global extremiza- tion over continuous state-action spaces. One cannot access the global extrema of ∆ given only finitely many samples in state-action space. Thus, we provide the following bounds, allowing for the extension of our results to (sufficiently well- behaved) continuous spaces. In this section, we loosen those bounds by relaxing the required extremization with a sim- pler optimization over a given discrete batch of replay data. We begin with some helpful definitions. (cid:12) ≤ ε for all s ∈ S, a ∈ A. Definition 1. A function ̄X : S × A → R is an ε-optimal approximation of X(s, a) : S × A → R if it satisfies (cid:12) (cid:12) ̄X(s, a) − X(s, a)(cid:12) Definition 2. The diameter of a bounded metric space, X , endowed with a metric d(*, *) → R≥0 is a constant D ∈ R>0 such that d(x1, x2) ≤ D for all x1, x2 ∈ X . Lemma 4.4. Let S × A be a bounded metric space with diameter D, and let r : S × A → R be Lr-Lipschitz (w.r.t. the same metric). Then the global extrema of r(s, a) on S × A are bounded as follows: sup s∈S,a∈A inf s∈S,a∈A r(s, a) ≤ min (s,a)∈D r(s, a) + LrD r(s, a) ≥ max (s,a)∈D r(s, a) − LrD where D is the dataset of (s, a) tuples available for querying the magnitude of r (e.g. the current batch or buffer). As an example, in the case that one uses the simple upper bound, Q(s, a) ≤ 1 1−γ sup r(s, a), over a finite-sized batch of replay experience {si, ai, ri, si+1}T i=1, one can bound the (intractable) sup which is taken over all state-action space: sup r(s, a) ≤ mini ri + Lr||(DS , DA)||p. In the case of continuous spaces, we cannot calculate the state-value function directly, so one typically resorts to actor-critic methods (Haarnoja et al. 2018b) where a policy network π and value network Q are trained together. In this case, one must calculate the entropy-regularized state-value (cid:2)Qπ(s, a) − β−1 log π(a|s)(cid:3). function as V π(s) = Ea∼π However, the expectation over continuously many actions is intractable in the general case. The solution to this is pa- rameterizing the policy network by a simple, but expres- sive distribution at each state, for instance a Gaussian actor N (μ(s), σ(s)). With knowledge of the means and variances, the sampling error can be bounded as we show below. Theorem 4.5. Let an entropy-regularized MDP be given with an LQ-Lipschitz value function ̄Qπ. Using a Gaus- sian parameterization for the associated policy π(*|s) = N (μ(s), σ(s)), suppose that ̄Qπ is an ε-optimal approxi- mation of the policy's true value, Qπ. By estimating the state-value function as: ̄V π(s) = ̄Qπ(s, μ) − 1 β E a∼π log π(a|s) π0(a|s) , (7) the error in using such an approximation is upper bounded: | ̄V π(s) − V π(s)| ≤ (cid:114) 2 π LQσ(s)e−μ(s)2/2σ(s)2 + ε In the case that the function Q used is an optimal value func- tion for an (Lr, Lp)-Lipschitz task, with a policy whose vari- ance is lower bounded σ(s) ≥ σmin and γLp(1 + LN ) < 1, where LN = σ−2 min(2πe)−1/2 is the Lipschitz constant of the Gaussian distribution, then the Lipschitz constant for Q can be computed as: LQ = Lr + γLp(βσmin)−1 1 − γLp(1 + LN ) . (8) As the policy becomes deterministic (σ → 0), in the un- regularized limit (βσ → ∞), the error reduces to zero as expected (since accurately sampling a deterministic policy only requires one action). Further, the Lipschitz constant in Eq. (8) matches that of the un-regularized case (Rachelson and Lagoudakis 2010). Although the expectation in Eq. (7) appears intractable, the Gaussian parameterization allows it to be calculable, since the entropy of the policy only depends on its variance. Under the stated hypotheses, this allows us to translate our bounds in Theorem 4.1 to the continuous set- ting. However, satisfying these hypotheses (e.g. the restric- tion on γ) may be challenging in practice. One way of cir- cumventing this is to consider works such as (Fazlyab et al. 2019), where one can estimate the Lipschitz constant of the neural net (Q-function) being used to generate bounds. We note that with the Gaussian policy parameterization, the relative entropy (second term in Eq. (7)) can be com- puted exactly from the mean action. In principle, the analy- sis may be extended to other policy parameterizations. For simplicity, the analysis is carried out for single-dimensional action spaces in the p = 1 norm, which is easily generalized to other contexts. These results allow us to derive the following upper and lower bounds in continuous spaces (an extension of Theo- rem 4.1), when the Q-function used for deriving ∆ is known to be LQ-Lipschitz, or is optimal for an (Lr, Lp)-Lipschitz MDP: Theorem 4.6. Let the LQ-Lipschitz value function Qπ and corresponding Gaussian policy π(*|s) = N (μ(s), σ(s)) be given, where Qπ is an ε-optimal estimate of the true pol- icy's value function. For an (Lr, Lp)-Lipschitz task with (unknown) optimal value function Q∗, let ̄V π be the one- point estimate of the (known) value function Qπ, and denote ̄∆(s, a) = r(s, a) + γ Es′∼p ̄V π(s′) − Qπ(s, a). Then: Q∗(s, a) ≤ r(s, a) + γ E s′∼p (cid:2) ̄V π(s′) + A(s′)(cid:3) + γ 1 − γ (cid:18) (cid:18) min (s,a)∈D Q∗(s, a) ≥ r(s, a) + γ E s′∼p ̄∆(s, a) + γ E s′∼p (cid:2) ̄V π(s′) − A(s′)(cid:3) A(s′) (cid:19) + L∆D + γ 1 − γ (cid:18) (cid:18) max (s,a)∈D ̄∆(s, a) − γ E s′∼p (cid:19) A(s′) − L∆D (cid:19) (cid:19) (cid:113) 2 where we let A(s) = L∆ = max (cid:8)Lr, LQ, γLp and D denotes the diameter of the state-action space. + ε and (cid:0)LQ(1 + LN ) + (βσmin)−1(cid:1)(cid:9) π LQσ(s)e−μ(s)/2σ(s)2 Extension to Un-Regularized RL Although the previous results have been discussed in the context of entropy-regularized RL, it is possible to extend them to the un-regularized (β → ∞) domain as well with the replacement ∆′ → r(s, a)+γ Es′ V (s′)−V (s). This can be understood as taking the estimated state-value function V (s) to generate a potential function for shaping (Ng, Harada, and Russell 1999) the original reward function r(s, a), with ∆′ now representing this shaped reward. The corresponding value functions are then related by Eq. (3) in (Ng, Harada, and Russell 1999) which can be seen as the analog of The- orem 1 in (Adamczyk et al. 2023a) for the un-regularized case. In the Appendix, we show that replacing ∆ → ∆′ in Theorem 4.1, leaves Eq. (4a) and (4b) valid for the un- regularized case. In this case, as the Bellman loss decreases, L → 0, there is no guarantee that ∆′ → 0 as in the reg- ularized case. Interestingly, we nevertheless find that in the un-regularized case, the clipping does occur, and the magni- tude of bound violations decreases throughout training. We use this form (un-regularized RL double-sided clipping) for the FA experiments shown in the next section. The preceding extension to un-regularized RL can be gen- eralized to address an open problem in research on composi- tionality. Specifically, we can now address a question posed by (Nemecek and Parr 2021) concerning the possibility of composing prior solutions in un-regularized RL. We can ad- dress this question by deriving an extension of Theorem 10 in (Adamczyk et al. 2023a) to the case of un-regularized RL. Theorem 4.8. Given a set of primitive tasks {Tj} with cor- j }, denote (cid:101)Q∗ as the responding optimal value functions {Q∗ optimal value function for the composition of {Tj} under the composition function f : RM → R. Define K ∗ as the optimal value function for a task with reward function κ defined by: κ(s, a) = f ({rj(s, a)}) + γ E s′ f (cid:0){Q∗ Vf (s) = max a j (s, a)}(cid:1) Vf (s′) − Vf (s) Then, the optimal value functions (cid:101)Q∗ and K ∗ are related by: (cid:101)Q∗(s, a) = Vf (s) + K ∗(s, a) (9) Thus, multiple primitive tasks can indeed be composed (via Vf ) and subsequently corrected (via K ∗) in un- regularized RL. Applications The framework developed in this work has applications on both theoretical and experimental fronts. In this section, we discuss some applications relating to compositionality and approaches to clipping. Exact Composition in Entropy-Regularized RL One application of the framework developed is to provide new insights and extensions of previously derived results for value function compositions, as seen in Theorem 4.8. Previ- ous work (Van Niekerk et al. 2019) on entropy-regularized RL has shown that, for a specific choice of composition function, an exact expression for the optimal value function of interest can be derived. This result can be rederived from a different perspective and also extended to a broader class of compositions using the framework developed. Specifically, we use the composition of value functions for previously solved tasks as an estimate for the optimal value function of the composite task. Then, using this estimate in combina- tion with Theorem 4.1, we derive conditions such that both of the bounds can be saturated with ∆(s, a) = 0, thereby giving an exact composition. Using this approach, we are able to extend the results of (Van Niekerk et al. 2019), who find an instance of exact composition in entropy-regularized RL for tasks with ab- sorbing states. Our derivation (see Appendix) provides new insight into why specific choices of reward compositions lead to exact compositions of optimal value functions. Theorem 5.1. Consider m solved tasks in the entropy- regularized setting, with reward functions {r1, . . . , rm} varying only on the set of absorbing states. Assume all tasks are given with the same deterministic dynamics. Given a set of non-negative weights wj, consider a new task with the same reward function for the interior (i.e. non-absorbing) states and with reward function for the absorbing states given by (cid:101)r(s, a) = τ log m (cid:88) j=1 wjerj (s,a)/τ . (10) Then, the optimal value function for such a task is given by: (cid:101)Q(s, a) = τ log m (cid:88) j=1 wjeQj (s,a)/τ . (11) A detailed derivation of the result is provided in the Ap- pendix; in the following we note some key points. We con- sider the setting discussed in (Van Niekerk et al. 2019) (undiscounted, deterministic dynamics with rewards varying only on the absorbing states for the solved tasks). By analyz- ing the exponentiated version of the backup equation for the solved tasks, we obtain a general class of reward composi- tions and value function compositions that satisfy the same form of backup equation. The extension from previous work is that the weights no longer need to be normalized to unity. Figure 2: The discrete maze considered for the tabular exper- iments. The agent begins at the green circle, and the yellow star is the only rewarding state. The action space consists of the cardinal directions, and the state is encoded by the lo- cation on the grid. At each step, the agent receives a small penalty if it has not reached the goal. γ = 0.98, β = 0.1. On the left plot, we show the optimal value function V (s) (blue indicates high value). On the right plot, we show the greedy policy extracted from the optimal action value func- tion argmaxaQ(s, a). Experimental Validation In the following experiments, we study the utility of clipping based on our theoretical results. For simplicity, we highlight the results on a simple discrete environment. Without any external estimates for the Q function, we use the estimate given by the previous step's Q-function. Figure 3: Q-values during training with respect to the de- rived bounds. The error is the maximum difference between consecutive Bellman updates. (Note the log-scaled axes.) Tabular Experiments In the tabular case, since we have access to the Q-table and we perform exact updates, we simply clip the updated Q-table according to the derived bounds. In Fig. 3 we show the results of training in a simple maze environment (Fig. 2). In experiments across different sized environments, and with various levels of stochasticity, we universally find the increase in convergence speed shown in the inset plot of Fig. 3. In the main plot of Fig. 3, we depict the mean Q values over all (s, a) pairs. We find that the vio- lated upper bound (over-optimism) occurs across many tabu- lar domains. In this experiment, we use stochastic transition dynamics with a 50% probability of taking the intended ac- tion and 25% probability of taking an action perpendicular to that intended. As claimed previously, we see that as the Bellman loss reduces (inset plot), the double-sided bounds become tight (blue and orange lines converge). Function Approximator Experiments In the DQN algo- rithm used, a target network is employed for stability. We can therefore also use the target network to derive another set of bounds on the true Q-values (cf. Appendix for the un- regularized RL bounds corresponding to those given in The- orem 4.1). Since both bounds must hold, we take the tightest bound possible. In general, given many sources of an esti- mate Q-function, one can collectively use them to obtain the tightest bound possible. The derived bounds can be imple- mented using different approaches for clipping of the value function during training. We highlight the different methods used below, inspired by the methods used in (Kim, Park, and Kim 2022; Adamczyk et al. 2023b): (0) No Clipping: The standard training scheme for DQN is implemented, with no clipping. (1) Hard Clipping: At each backward pass to the function approximator we enforce the following bounds on the target value: Q(s, a) ←− ˆQ(s, a) where L and U denote the lower and upper bounds derived in Theorem 4.1, and (12) ˆQclip . = min{max{r(s, a) + γV (s′), L(s, a)}, U(s, a)} (13) 100101102Iteration Step4035302520151050Q-ValuesQ-Values and Bounds During TrainingLower BoundUpper BoundUnclipped Q-ValueClipped Q-Value0200400600Iteration Step108104100Error bounds in tabular domains, finding that application of the bounds through clipping is able to speed up training. We also provide some preliminary exploration in the FA domain where new experimental methods for clipping were pre- sented. Furthermore, beyond the theoretical contributions, we believe the current work has the potential to open new directions of research as outlined below. While the derived bounds are applicable generally to any value function estimate and for arbitrary transition dynam- ics, it is possible that they are tightened for specific classes of the estimates and restrictions on the dynamics or struc- ture of reward functions. For example, in (Adamczyk et al. 2023b) which analyzed compositions in RL, it was shown that one side of the bound can be simplified further for spe- cific classes of functional transformations or compositions. In future work, it would be interesting to explore under what conditions the bounds may be further simplified or tight- ened. Other promising avenues for future research include: (i) combining our results with ensemble methods such as SUN- RISE (Lee et al. 2021) which can lead to tighter bounds on the value function, as more estimates are used to de- rive the double-sided bounds in Theorem 4.1, (ii) using bound violations as a proxy for the best prior task to trans- fer (minimizing bound violations) when multiple prior solu- tions are known, (iii) implementing a dynamic schedule for the soft clipping weight parameter, similar to the approach in (Haarnoja et al. 2018b) which includes learning a dynamical temperature parameter. The extension of (Van Niekerk et al. 2019)'s Theorem 2 (shown above in Theorem 5.1) for value function composi- tion was proved for the case of deterministic dynamics in this work. However, it still remains an open question as to whether this result is generalizable to other domains, e.g. stochastic dynamics. Moreover, other composition methods may yield exact results for the composite task's value func- tion (cf. (Tasse, James, and Rosman 2020, 2021)). It will be of interest to see if the framework developed in this work can be used to provide insight into the different conditions under which exact compositions can be obtained. Considering further the composition of multiple previ- ously solved tasks, one can consider the problem of learn- ing a composition function f , which takes into account the derived bounds. As a learning objective, one could use the magnitude of the difference in bounds, to learn a function f which can be considered an "optimal composition" (e.g. related to (Rusu et al. 2016). The framework established in this work can be used to ob- tain bounds for optimal value functions in general settings, not just limited to the composition of tasks. Specifically, we can use any estimate for the optimal value function as the base knowledge and use the derived results to obtain bounds on the exact optimal value function. In combination with the regret bound derived in this work, iterations of PE/PI can serve as the initial steps in an iterative procedure for progressively improving the bounds to obtain improved ap- proximate solutions. The development of such iterative pro- cedures will be explored in future work. Figure 4: Reward curves for the MountainCar environment. We fine tune each method's hyperparameters, and average over 20 random initializations. The 95% confidence inter- vals are shaded for each method. (2) Soft Clipping: An additional term, the "clipping loss", is added to the function approximator's loss function. The clipping loss is defined as Lclip = (cid:12) (cid:12) (cid:12)Q(s, a) − ˆQclip(s, a) (cid:12) (cid:12) (cid:12) (14) This gives a total loss of L = LBellman + ηLclip. The hy- perparameter η weights the relative importance of the bound violations against the Bellman error. In principle it can be tuned, but we choose to fix η = 10−5 for all experiments, ensuring LBellman ∼ ηLclip. Alternatively, one can view this as equivalent to providing a bonus to the reward function for states with high bound violation. This is analogous to the UCB-style bonus applied in (Lee et al. 2021). (3) Smoothed Clipping: The updated Q-values are set as an average between those given by Hard Clipping and No Clipping, with a relative weight factor inversely related to the bound violations. Q(s, a) −→ (1 − τ ) (r(s, a) + γV (s′)) + τ ˆQclip(s, a) where τ = Lclip 1 + Lclip We note that when the bound violations are zero, the stan- dard update rule is recovered. This value for τ is chosen to set the relative weight of the two terms to match the mag- nitude of bound violations: τ /(1 − τ ) = Lclip. Therefore, the clipped values will be preferred over the standard update rule, in direct proportion to the bound violations. (15) Figure 4 indicates that clipping is able to improve the stability and speed of training in the MountainCar environ- ment. Here, we use a bootstrapped estimate of Q(s, a) (that is, the target Q-network is bounded by the actively trained Q-network). Discussion theoretical In summary, we have established a general framework for deriving double-sided bounds in reinforce- ment learning. We have explored the use of the double-sided Technical Appendix In this technical appendix, we provide further discussion on experimental details and give proofs for all the results shown in the main text. Experiments In the tabular setting, we perform exact updates of the Bell- man backup equation for entropy-regularized RL. At each update step, we calculate the bounds given by Theorem 4.1, which are exact in this case. Then we perform Hard Clip- ping, by following Eq. (13) in the main text. Interestingly, we see that as the upper bound becomes tight, the Q-values are constantly saturated by this value. The departure of the No Clipping and Hard Clipping Q-values is also evident in the reduction of error (l∞ distance) between consecutive it- erations. To explore the utility of clipping in function approxima- tor (FA) systems, we use a DQN learning algorithm (Raf- fin et al. 2021), while applying and monitoring clipping given by the bounds in Theorem 4.1 for un-regularized RL. In particular, we continuously bootstrap by using the pre- vious estimate of the Q-function to generate the bounds, and we clip the target network's output value accordingly. In particular, we extract bounds from both the target net- work and Q-network at each step, and take the tighter of the two bounds. For continuous spaces, we use the estimate sup r(s, a) ≈ maxi∈D r(s, a), where the max is taken over the current batch (and similarly for inf r(s, a)). We consider the three clipping methods described in the Experiments sec- tion of the main text. We have also performed the same experiment, with a fixed learning rate, for the Mountain-Car environment (Brockman et al. 2016). These experiments share the hyperparameters shown in Table and are averaged over 25 runs. Figure 5: Mountain-Car learning curves for a fixed learning rate α = 0.004. The mean bound violations and episode rewards throughout training are shown for each clipping method. In the right panel, we plot the total bound viola- tions (magnitude of over- or under-estimation of Q based on the allowed upper and lower bounds). We find that bound violations decrease during training (most quickly for hard and smoothed clipping), which corresponds to better perfor- mance in terms of the mean evaluation reward (left plot). remaining hyperparameters (shared by all clipping methods) are listed below. Hyperparameter Value Learning Rate Batch Size Buffer Size Discount Factor, γ Gradient Steps Policy Architecture "Learning Starts" Polyak Update, τ Target Update Interval Training Frequency 0.004 128 10,000 0.98 8 (256, 256) 1,000 1.0 600 16 Table 1: Hyperparameters shared by all Deep Q Networks. These are the hyperparameters published by the authors of the algorithm used (Raffin et al. 2021): https://huggingface. co/sb3/dqn-MountainCar-v0. Proofs In this section we provide proofs of the theoretical results in the main text. Each proof is prefaced with a restatement of the theorem for the reader's convenience. We begin with a helpful lemma which bounds the opti- mal action-value function Q∗(s, a) for any task. We note that these bounds hold for both un-regularized RL and entropy- regularized RL. Lemma A. For a task with reward function r(s, a), discount factor γ, the (soft) optimal action-value function Q∗(s, a) satisfies: Q∗(s, a) ≥ r(s, a) + γ Q∗(s, a) ≤ r(s, a) + γ inf s,a r(s, a) 1 − γ sups,a r(s, a) 1 − γ We will prove the upper bound for un-regularized RL, but the proof is identical in entropy-regularized RL and for the lower bound. Proof. The proof follows from induction on the Bellman backup equation: Q(n+1)(s, a) = r(s, a) + γ E s′∼p(s′|s,a) max a′ (cid:16) Q(n)(s′, a′) (cid:17) (16) The result we aim to prove is the following: Q(n)(s, a) ≥ r(s, a) + γ Q(n)(s, a) ≤ r(s, a) + γ 1 − γn 1 − γ 1 − γn 1 − γ r(s, a) inf s,a r(s, a) sup s,a We use ε-greedy exploration, with a linear schedule from 1.0 to 0.07 after 20% of the total (N = 500k) timesteps. The Since limn→∞ Q(n)(s, a) = Q∗(s, a) and γ ∈ (0, 1) the desired result will follow from this limit. 0100200300400500Environment Steps (×1k)200190180170160150140130120Mean RewardMean Reward During Training0100200300400500Environment Steps (×1k)0100101102103104||clip||Magnitude of Bound ViolationsNo clippingHard ClippingSoft ClippingSmoothed Clipping We set Q(0)(s, a) = r(s, a). The base case (n = 1) holds In Eq. (18a) and (18b), the inf and sup are taken over the as: continuous state-action space S × A. Q(1)(s, a) = r(s, a) + γ = r(s, a) + γ E s′∼p(s′|s,a) E s′∼p(s′|s,a) max a′ max a′ (cid:16) Q(0)(s′, a′) (cid:17) r(s′, a′) r(s, a) ≤ r(s, a) + γ sup s,a 1 − γ1 1 − γ = r(s, a) + γ r(s, a) sup s,a We proceed in proving the upper bound. For brevity we shall denote sups,a r(s, a) . = R. The inductive hypothesis is Q(n)(s, a) ≤ r(s, a) + γ 1 − γn 1 − γ R. (17) To prove that the inequality holds for n + 1, we use the Bell- man backup equation: Q(n+1)(s, a) ≤ r(s, a) + γ E s′ (cid:18) max a′ ≤ r(s, a) + γ R + γ (cid:18) r(s′, a′) + γ 1 − γn 1 − γ (cid:19) R 1 − γn 1 − γ (cid:19) R At this point, if the dynamics model were known then one could improve this bound by including the next term, Es′∼p(s′|s,a) maxa′ r(s′, a′), which we instead bound by R. Continuing without this term, we have Q(n+1)(s, a) ≤ r(s, a) + γ (cid:18) R + γ 1 − γn 1 − γ (cid:19) R = r(s, a) + γ 1 − γn+1 1 − γ R which completes the proof of the inductive step. As stated above, this completes the proof of the upper bound by taking the limit n → ∞. The lower bound follows similarly by swapping all in- equalities. The same proof also holds for the soft Bellman backup equation. We now proceed with the proof of the first result, Theorem 4.1. We do so by applying Lemma A to the K ∗ function of (Adamczyk et al. 2023a)'s Theorem 1. Theorem 4.1. Consider an entropy-regularized MDP ⟨S, A, p, r, γ, β⟩ with (unknown) optimal value function Q∗(s, a). Let an estimate for the value function Q(s, a) be given. Denote V (s) . = 1/β log Ea∼π0 exp βQ(s, a). The optimal value function Q∗(s, a) is then bounded by: Q∗(s, a) ≥ r(s, a) + γ Q∗(s, a) ≤ r(s, a) + γ (cid:18) (cid:18) E s′∼p E s′∼p V (s′) + V (s′) + (cid:19) inf ∆ 1 − γ sup ∆ 1 − γ (18a) (18b) (cid:19) where ∆(s, a) . = r(s, a) + γ E s′∼p V (s′) − Q(s, a). Proof. As a point of notation, (cid:101)r(s, a) in (Adamczyk et al. 2023a) is the same as our r(s, a). Using Theorem 1 of (Adamczyk et al. 2023a), we have Q∗(s, a) = Q(s, a) + K ∗(s, a) (19) where K ∗ is the optimal soft action value function corre- . sponding to a task with reward function ∆(s, a) = r(s, a) + γ Es′∼p(*|s,a) V (s′)−Q(s, a). By applying Lemma A on the value function K ∗, we arrive at the stated result in Eq. (18b): Q∗(s, a) = Q(s, a) + K ∗(s, a) ≤ Q(s, a) + ∆(s, a) + γ = Q(s, a) + r(s, a) + γ − Q(s, a) + γ sup ∆ 1 − γ E s′∼p(*|s,a) sup ∆ 1 − γ V (s′) = r(s, a) + γ (cid:18) E s′∼p(*|s,a) V (s′) + (cid:19) . sup ∆ 1 − γ A similar proof holds for the lower bound. Lemma 4.1a. Consider an entropy-regularized MDP ⟨S, A, p, r, γ, β⟩ with (unknown) optimal value function Q∗(s, a). Let an estimate for the value function Q(s, a) be . = 1/β log Ea∼π0 exp βQ(s, a). Sup- given. Denote V (s) pose there exists an "identity" action a∅(s) ∈ A for each state, which deterministically transitions the agent to the same state: p(s′|s, a∅(s)) = δ(s′ − s) for all s ∈ S. Then the lower bound on the optimal value function Q∗(s, a) can be improved: Q∗(s, a) ≥ r(s, a) + γ (cid:18) V (s′) + 1 1 − γ (cid:19) ∆(s′, a∅) (20) Proof. The lower bound in Theorem 4.1 can be tightened by noting that the value function (in both un-regularized and entropy-regularized RL) satisfies a variational form: Q(s, a) = sup Qπ(s, a) π (21) where Qπ(s, a) = E p,π (cid:34) ∞ (cid:88) t=0 (cid:12) (cid:12) γtr(st, at) (cid:12) (cid:12) (cid:35) s0 = s, a0 = a and Qπ(s, a) = E p,π (cid:34) ∞ (cid:88) (cid:18) γt t=0 r(st, at) − (cid:19)(cid:35) 1 β log π(at|st) π0(at|st) for standard and entropy-regularized RL, respectively (we have dropped the initial state-action conditioning in the latter equation for brevity). Therefore, one can supply any policy π into the objective Qπ to obtain a lower bound on the optimal value function. However, the expectation (policy evaluation) is difficult to perform in practice because it corresponds to the solution to another Bellman equation (Sutton and Barto 2018). Nevertheless, for particular choices of the input policy π, one can obtain a simplified expression for Qπ leading to a tractable lower bound. With this in mind, we choose the de- terministic "identity policy", π∅, defined as: π∅(a|s) = a∅(s) (22) where a∅(s) is the action (for a given state s ∈ S) such that p(s′|s, a∅(s)) = δ(s′ − s). (23) In other words, the identity policy is a deterministic policy which transitions the agent back to the same state. We note that this requires the transition dynamics of the task to be deterministic (at least, for this identity action). With this in mind, we must evaluate the objective Qπ∅ = ˆQπ∅ + Sπ∅ , which we split between the reward and entropic terms. First, we note that since π∅ is determin- istic, the relative entropy term satisfies Sπ∅ = E p,π∅ (cid:34) ∞ (cid:88) t=0 (cid:35) γt log π∅(at|st) π0(at|st) = 0. (24) Therefore, it suffices to evaluate the reward contributions alone which can be done as follows: (cid:98)Qπ∅ (s, a) = E p,π∅ (cid:34) ∞ (cid:88) (cid:12) (cid:12) γtr(st, at) (cid:12) (cid:12) = r(s0, a0) + γr(s1, a∅) + γ2r(s1, a∅) + . . . s0 = s, a0 = a t=0 (cid:35) = r(s0, a0) + γ 1 − γ r(s1, a∅) We see that the determinism of transitions arising from non- identity actions is required for the first step away from the initial condition. Therefore, we have Q(s, a) ≥ r(s, a) + 1−γ r(s′, a∅). γ Now, applying this result to the auxiliary task with opti- mal value function K ∗: K ∗(s, a) ≥ ∆(s, a) + γ 1 − γ ∆(s′, a∅). (25) Inserting this bound into Theorem 1 of (Adamczyk et al. 2023a), we find: Q∗(s, a) ≥ Q(s, a) + ∆(s, a) + ∆(s′, a∅) = r(s, a) + γ V (s′) + (cid:18) (cid:19) ∆(s′, a∅) γ 1 − γ 1 1 − γ Corollary 4.2 (Suboptimality Bounds). Let policy π(a|s) be given with soft value Qπ(s, a). The rate of the suboptimality gap, Q∗(s, a) − Qπ(s, a), is then bounded between d(s, a) ≤ inf (s,a) Q∗(s, a) − Qπ(s, a) H ≤ sup (s,a) d(s, a) (26) where d(s, a) . = r(s, a) + γ Es′ V π(s′) − Qπ(s, a), . = log Ea exp βQπ(s, a) is the soft state-value func- V π(s) tion, and H = (1 − γ)−1 is the effective time horizon. d(s, a) log E a′∼π exp βQπ(s′, a′). . = Qπ(s, a) − Proof. Consider a task with the stated reward function γ β E s′∼p By (Cao, Cohen, and Szpruch 2021), this task's correspond- ing optimal value function is Q∗ d(s, a) = Qπ(s, a). We see that the suboptimality gap Q∗ − Qπ is nothing but the soft value function K ∗(s, a) (Adamczyk et al. 2023a) for a task with reward function d(s, a), given above. Applying the simple bounds H inf d(s, a) ≤ K ∗(s, a) ≤ H sup d(s, a) yields the stated result, with H = (1 − γ)−1 being the time horizon. Theorem 4.3. Let the functions L(s, a), U (s, a) be lower and upper bounds on the optimal value func- Q∗(s, a) tion: L(s, a) ≤ U (s, a) for all s ∈ S and a ∈ A. The clipped Bellman operator, BCQ(s, a) := maxs,a (mins,a (BQ(s, a), U (s, a)) , L(s, a)) converges the Q∗(s, a) = B∞Q(s, a). function optimal value ≤ to Proof. We first show convergence of the operator BC, then show that it converges to the same fixed point. For conver- gence, it suffices to show that |BCQ(s, a) − Q∗(s, a)| ≤ γ|Q(s, a) − Q∗(s, a)|. There are three cases for the magnitude of BQ(s, a) rela- tive to the upper and lower bounds: 1. BQ(s, a) ∈ (L(s, a), U (s, a)) 2. BQ(s, a) ∈ (−∞, L(s, a)) 3. BQ(s, a) ∈ (U (s, a), ∞) In the first case, clipping does not occur and hence BCQ(s, a) = BQ(s, a), which contracts with rate γ.In the second case, we can write BQ(s, a) = L(s, a) − χ(s, a) where χ(s, a) := BQ − L(s, a) > 0 is referred to as the "bound violation". Then, |BCQ(s, a) − Q∗(s, a)| = |Q∗(s, a) − BCQ(s, a)| = |Q∗(s, a) − L(s, a)| ≤ |Q∗(s, a) − L(s, a) + χ(s, a)| = |Q∗(s, a) − (L(s, a) − χ(s, a))| = |Q∗(s, a) − BQ(s, a)| ≤ γ|Q(s, a) − Q∗(s, a)| As claimed in the main text, we now show that this lower bound is tighter than the previous one in Eq. 18a of the main text. Since ∆(s′, a∅) ≥ inf ∆(s, a), this bound can be satu- rated only for the initial state-action (s, a) which transitions the agent to s′ = s∗, the state in which the global reward function ∆ attains its minimum. A similar proof holds for case 3. By the Banach fixed point theorem, it follows that re- peated application of BC converges to a fixed point. It is clear that the fixed point for B is also a fixed point for BC, and since it is unique, we have B∞ C Q(s, a) = B∞Q(s, a) = Q∗(s, a). since the reward function r is Lr-Lipschitz in the d metric. In practice, the distance between the extrema and an arbi- trary point (right-hand side) is unknown, and a generally ap- plicable (albeit loose) bound on this distance is simply the diameter of the space, D = ||(DS , DA)||p. This leads to the following bound: r(s∗, a∗) ≤ r(s, a) + LrD. (27) This follows from the definition of Lipschitz continuity: r(s∗, a∗) − r(s, a) = |r(s∗, a∗) − r(s, a)| ≤ Lrd ((s∗, a∗), (s, a)) ≤ LrD Since each (s, a) ∈ D provides such a bound, we can take the best one (i.e. the minimum over all points in the subset D), recovering the stated bound: r(s∗, a∗) ≤ min (s,a)∈D r(s, a) + LrD. (28) In case the calculation d((s1, a1), (s2, a2)) is feasible, one can replace the diameter with the furthest distance from the point in question to any other point in the (bounded) set: r(s∗, a∗) ≤ min (s,a)∈D (cid:18) r(s, a) + Lr sup s′,a′ d((s, a), (s′, a′)) (cid:19) where the sup is over all (s, a) ∈ S × A. which follows by a similar argument as given above: r(s∗, a∗) − r(s, a) = |r(s∗, a∗) − r(s, a)| ≤ Lrd ((s∗, a∗), (s, a)) sup ≤ Lr (s′,a′)∈S×A d((s, a), (s′, a′)) This provides a tighter bound but is less tractable in practice. We now provide some preliminary results on Lipschitz MDPs which facilitate the proofs of the subsequent results. The following result proves Lipschitz continuity of the value function in un-regularized RL, provided by (Rachelson and Lagoudakis 2010). Theorem 4.5a (Rachelson and Lagoudakis). Given an (Lr, Lp)-Lipschitz continuous MDP and an Lπ-Lipschitz continuous, stationary policy π, if γLp(1 + Lπ) < 1, then the infinite horizon, γ-discounted value function Qπ is LQ- Lipschitz continuous, with: LQ = Lr 1 − γLp(1 + Lπ) (29) We will extend this result to the case of entropy- regularized RL where the policy's entropy plays a role. To extend it to the entropy-regularized case, we begin with (and following the notation of) Lemma 1 in (Rachelson and Lagoudakis 2010). Since the entropy of the policy appears in the calculation of the state-value function, we require a tractable policy class. We use the Gaussian parameterization due to its widespread use (Haarnoja et al. 2018b; Raffin et al. 2021). Figure 6: Depiction of a continuous state-action space with a finite set of samples (black points) used to bound the global extrema (star). The diameter of the space is depicted in red. The distance between each sample and the global extrema (dashed lines) is always less than the diameter (solid red line) of the space. Since the growth of the function is linearly bounded by Lipschitz continuity, we can derive a bound on the value of the global extrema given the finitely many sam- ples. Error Analysis for Continuous Spaces In this subsection, we turn to those results specific to the bounds in continuous spaces and their error analysis, based on Lipschitz-continuity. Lemma 4.4. Let S × A be a bounded metric space with diameter D, and let r : S × A → R be Lr-Lipschitz (w.r.t. the same metric). Then the global extrema of r(s, a) on S × A are bounded as follows: sup s∈S,a∈A inf s∈S,a∈A r(s, a) ≤ min (s,a)∈D r(s, a) + LrD r(s, a) ≥ max (s,a)∈D r(s, a) − LrD where D is the dataset of (s, a) tuples available for querying the magnitude of r (e.g. the current batch or buffer). Proof. We prove the upper bound on the supremum, the lower bound on the infimum follows similarly. Let S × A be a bounded metric space endowed with the p-product metric (for simplicity) and let r : S × A → R (the function for which we wish to find the global extrema) be Lr-Lipschitz continuous. Let the diameters of state and action space be given: DS , DA. Suppose a finite set of sam- ples D ⊂ S × A is given. Denote sups∈S,a∈A r(s, a) = r(s∗, a∗). For each (s, a) ∈ D, the following holds: r(s∗, a∗) − r(s, a) = |r(s∗, a∗) − r(s, a)| ≤ Lrd ((s∗, a∗), (s, a)) × Lemma 4.5b. In entropy-regularized RL, given an LQ- Lipschitz continuous Q-function Qπ denoting the soft value of a Gaussian policy π(*|s) ∼ N (μ(s), σ(s)), the corre- sponding value function V π(s) is L-Lipschitz continuous, with: L = LQ(1 + LN ) + 1 βσmin where σmin = mins σ(s) and LN = σ−2 min(2πe)−1/2 is the maximum Lipschitz constant of the Gaussian density across all states. (30) , Proof. As in SAC (Haarnoja et al. 2018b; Raffin et al. 2021) we assume a Gaussian parameterization with bounded vari- ance σ(s) ≥ σmin. We begin by finding the Lipschitz con- stant for V π(s) in the entropy-regularized setting. Using the definition of the soft state-value function (Haarnoja et al. 2018b), (cid:12)V π(s) − V π(ˆs)(cid:12) (cid:12) (cid:12) E a∼π (cid:12) (cid:12) (cid:12) (cid:12) ≤ (cid:12) (cid:12) (cid:12) (cid:12) = ≤ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Qπ(s, a) − E a∼π (cid:12) (cid:12) Qπ(ˆs, a) (cid:12) (cid:12) + β−1 (H [π(*|s)] − H [π(*|ˆs)]) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Qπ(ˆs, a) (cid:12) (cid:12) (cid:12) (cid:12) Qπ(ˆs, a) (cid:12) (cid:12) (cid:12)s − ˆs(cid:12) (cid:12) (cid:12) 1 βσmin (cid:19) (cid:12)s − ˆs(cid:12) (cid:12) (cid:12). E a∼π Qπ(s, a) − E a∼π E a∼π Qπ(s, a) − E a∼π ≤ LQ(1 + Lπ)(cid:12) (cid:12)s − ˆs(cid:12) (cid:12) + (cid:18) = LQ(1 + Lπ) + 1 βσmin log + β−1 (cid:12) (cid:12) σ(s) (cid:12) (cid:12) (cid:12) (cid:12) σ(ˆs) (cid:12) (cid:12) (cid:12) log(s) − log(ˆs)(cid:12) + β−1(cid:12) (cid:12) The second line follows from the entropy of the Gaus- sian distribution. The fourth line follows from (Rachelson and Lagoudakis 2010) and from the Lipschitz-continuity of log(*) on the domain (σmin, ∞). In practice, one must choose some σmin to ensure numerical stability. In the case βσmin → ∞, σmin → 0, the policy becomes deterministic and the RL objective reduces to un-regularized RL and the previous result is recovered. Since the Gaussian distribution is continuous everywhere, its Lipschitz constant LN = σ−2(2πe)−1/2 is easily found by finding the maximum magnitude of the first derivative. Since we are interested in a globally applicable Lipschitz constant, we take the upper bound given by σmin. Substitut- ing Lπ = LN above gives the stated result. Now, we extend Lemma 2 of (Rachelson and Lagoudakis 2010) to the entropy-regularized setting with a Gaussian pol- icy: Lemma 4.5c. Given an (Lp, Lr)-Lipschitz continuous entropy-regularized MDP and a Gaussian policy with bounded variance σ(s) ≥ σmin, the n-step, finite horizon, γ-discounted soft value function Qπ nis LQn -Lipschitz con- tinuous and LQn obeys the recurrence relation LQn+1 = Lr + γ (cid:0)(1 + LN )LQn + (βσmin)−1(cid:1) Lp Proof. The proof is identical to that of Lemma 2 in (Rachel- son and Lagoudakis 2010) except the penultimate line, where we instead use the Lipschitz constant computed for V π(s) in Lemma 4.5b: n+1(s, a) − Qπ (cid:12) (cid:12)Qπ ≤ (Lr + γLVn Lp) (|s − ˆs| + |a − ˆa|) n+1(ˆs, ˆa)(cid:12) (cid:12) (cid:18) (cid:18) = Lr + γ LQn (1 + LN ) + = LQn+1 (|s − ˆs| + |a − ˆa|) . (cid:19) (cid:19) Lp 1 βσmin (|s − ˆs| + |a − ˆa|) × We are now ready to prove the extension of Theorem 4.5a in entropy-regularized RL: Theorem 4.5d. Given an (Lr, Lp)-Lipschitz continuous MDP and a Gaussian policy N (μ(s), σ(s)) with bounded variance σ(s) ≥ σmin, if γLp(1+LN ) < 1, then the infinite horizon, γ-discounted value function Qπ is LQ-Lipschitz continuous, with: LQ = Lr + γLp(βσmin)−1 1 − γLp(1 + LN ) (31) Proof. We follow the same steps as given in the proof of Theorem 1 of (Rachelson and Lagoudakis 2010), conclud- ing by considering the recurrence relation in the convergent limit LQn → LQ: LQ = Lr + γ (cid:0)(1 + LN )LQ + (βσmin)−1(cid:1) Lp (32) Solving for LQ yields LQ = Lr + γLp(βσmin)−1 1 − γLp(1 + LN ) . (33) Theorem 4.5. Let an entropy-regularized MDP be given with an LQ-Lipschitz value function ̄Qπ. Using a Gaus- sian parameterization for the associated policy π(*|s) = N (μ(s), σ(s)), suppose that ̄Qπ is an ε-optimal approxi- mation of the policy's true value, Qπ. By estimating the state-value function as: ̄V π(s) = ̄Qπ(s, μ) − 1 β the error in using such an approximation is upper π(a|s) π0(a|s) E a∼π (34) log , bounded: | ̄V π(s) − V π(s)| ≤ (cid:114) 2 π LQσ(s)e−μ(s)2/2σ(s)2 + ε In the case that the function Q used is an optimal value func- tion for an (Lr, Lp)-Lipschitz task, with a policy whose vari- ance is lower bounded σ(s) ≥ σmin and γLp(1 + LN ) < 1, where LN = σ−2 min(2πe)−1/2 is the Lipschitz constant of the Gaussian distribution, then the Lipschitz constant for Q can be computed as: LQ = Lr + γLp(βσmin)−1 1 − γLp(1 + LN ) . (35) Proof. We first note that although the relative entropy ap- pears in Eq. (7), we will substitute it with the entropy alone. This is the typical scenario for MaxEnt RL, where the prior policy is ignored. However, in the case of a Gaussian-parameterized prior policy, the remaining term Ea∼π log π0(a|s) has an analytical form. Continuing with the entropy, we see that if the variance is known, it is easily expressed as: log(2πσ2) + H[N (μ, σ)] = 1 2 Alternative to the variance, the log-probability of the mean is sometimes used in the parameterization (Raffin et al. 2021), which encodes the same information: (cid:19) (36) 1 2 . − log(p(μ)) = − log = H[N (μ, σ)] − (cid:18) 1 √ 2πσ2 1 2 . Therefore, we only take into account the error in the first term, the estimation of Ea∼π Qπ(s, a) given only the mean action μ. We drop the s dependence, denoting μ = μ(s) and σ = σ(s). (cid:12) (cid:12) (cid:12) E a∼π Qπ(s, a) − ̄Qπ(s, μ) (cid:12) (cid:12) (cid:12) = E a∼π (cid:12) ̄V π(s) − V π(s)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Qπ(s, a) − Qπ(s, μ) (cid:12) (cid:12) (cid:12) + (cid:12) ≤ E |Q(s, a) − Q(s, μ)| + ε a∼π ≤ E a∼π LQ|a − μ| + ε (cid:90) ∞ e− (a−μ)2 2σ2 |a − μ|da + ε −∞ 2σ2e−μ2/2σ2 + ε = = = LQ√ 2πσ2 LQ√ 2πσ2 (cid:114) 2 π LQσe−μ2/2σ2 + ε Here we have used the one-dimensional absolute value norm for actions, but the result can be readily extended in a sim- ilar way for particular choices of the metric on the action space. The fifth line follows from the Q function being LQ- Lipschitz continuous, and the final line follows from substi- tuting in Theorem 4.5a for LQ. Interestingly, this result has shown that there is maximum potential error obtained in iterations of policy evaluation, with a non-trivial dependence on the variance of the distri- bution in question. To prove Theorem 4.6 we first provide some lemmas de- tailing the error analysis for the V π(s) and ∆(s, a) terms appearing in the double-sided bounds of Theorem 4.1 and Lemma 4.4; both of which are prone to estimation errors. Lemma 4.6a. The maximum error in replacing ∆ with ̄∆ (as defined in Theorem 4.6, i.e. by using the one-point esti- mate for the expected Q-value) is upper bounded: |∆(s, a) − ̄∆(s, a)| ≤ γ (cid:114) 2 π LQ E s′∼p A(s′) Proof. |∆(s, a) − ̄∆(s, a)| = γ(cid:12) (cid:0)V (s′) − ̄V (s′)(cid:1) (cid:12) (cid:12) E (cid:12) s′∼p (cid:12)V (s′) − ̄V (s′)(cid:12) (cid:12) (cid:12) ≤ γ E s′∼p (cid:32)(cid:114) 2 π ≤ γ LQ E s′∼p σ(s′)e−μ(s′)2/2σ(s′)2 + ε (cid:33) reward 4.6b. The function ∆ generated Lemma function Q(s, a), continuous from an LQ-Lipschitz . = r(s, a) + γ Es′ V (s′) − Q(s, a) with (Lr, Lp)- ∆(s, a) Lipschitz rewards and dynamics, is Lipschitz continuous with L∆ = max (cid:8)Lr, LQ, γLp (cid:0)LQ(1 + LN ) + (βσmin)−1(cid:1)(cid:9) . Proof. The Lipschitz constant of a sum of Lipschitz func- tions: r(s, a) + γ Es′ ̄V (s′) − Q(s, a) is itself Lipschitz con- tinuous, with the Lipschitz constant being the maximum of all terms' Lipschitz constants: L∆ = max {Lr, LQ, γLpLV } , (37) where LV is given in Lemma 4.5b. Since the relative magni- tude of each Lipschitz constant is unknown a prior, we can make no further simplification without additional assump- tions. Now we are positioned to prove Theorem 4.6, the double- sided bounds on the soft Q-function with estimation errors included. Theorem 4.6. Let the LQ-Lipschitz value function Qπ and corresponding Gaussian policy π(*|s) = N (μ(s), σ(s)) be given, where Qπ is an ε-optimal estimate of the true pol- icy's value function. For an (Lr, Lp)-Lipschitz task with (unknown) optimal value function Q∗, let ̄V π be the one- point estimate of the (known) value function Qπ, and denote ̄∆(s, a) = r(s, a) + γ Es′∼p ̄V π(s′) − Qπ(s, a). Then: Q∗(s, a) ≤ r(s, a) + γ E s′∼p (cid:2) ̄V π(s′) + A(s′)(cid:3) + γ 1 − γ (cid:18) (cid:18) min (s,a)∈D Q∗(s, a) ≥ r(s, a) + γ E s′∼p ̄∆(s, a) + γ E s′∼p (cid:2) ̄V π(s′) − A(s′)(cid:3) A(s′) (cid:19) + L∆D + γ 1 − γ (cid:18) (cid:18) max (s,a)∈D ̄∆(s, a) − γ E s′∼p (cid:19) A(s′) − L∆D (cid:19) (cid:19) (cid:113) 2 where we let A(s) = L∆ = max (cid:8)Lr, LQ, γLp and D denotes the diameter of the state-action space. + ε and (cid:0)LQ(1 + LN ) + (βσmin)−1(cid:1)(cid:9) π LQσ(s)e−μ(s)/2σ(s)2 where we σ(s)e−μ(s)2/2σ(s)2 introduce + ε. the shorthand A(s) = Proof. We will prove the upper bound, with the lower bound following accordingly. Beginning with the exact form in Theorem 4.1, the main idea is to propagate the errors due to the single-point estima- tion for ̄V , the resulting error in the calculation of ∆ itself, and the sup(∆) estimation. Q(s, a) ≤ r(s, a) + γ (cid:18) (cid:19) V π(s′) + sup ∆(s, a) E 1 − γ s′∼p (cid:20) (cid:12)V π(s′) − ̄V π(s′)(cid:12) (cid:12) (cid:18) (cid:21) (cid:12) + ̄V π(s′) (cid:19) (cid:19) min (s,a)∈D ∆(s, a) + L∆D (cid:2) ̄V π(s′) + A(s′)(cid:3) (cid:18) min (s,a)∈D ∆(s, a) + L∆D (cid:2) ̄V π(s′) + A(s′)(cid:3) ≤ r(s, a) + γ E s′∼p + γ 1 − γ ≤ r(s, a) + γ E s′∼p γ 1 − γ ≤ r(s, a) + γ E s′∼p (cid:18) + (cid:18) + γ 1 − γ min (s,a)∈D ̄∆(s, a) + γ E s′∼p (cid:19) A(s′) + L∆D (cid:19) (cid:113) 2 π LQσ(s)e−μ(s)2/2σ(s)2 where A(s) = + ε and L∆ = max {Lr, LQ, γLpLV }. The second line follows from Lemma 4.4, the third line follows from Theorem 4.5, and the fourth line follows from Lemma 4.6a. Un-Regularized RL We now turn to proofs of the analogous results in stan- dard (un-regularized) RL. We begin by using (Ng, Harada, and Russell 1999) to connect to the results of (Adamczyk et al. 2023a) and (Cao, Cohen, and Szpruch 2021). In un- regularized RL (Adamczyk et al. 2023a) Theorem 1 holds, Theorem 6.1a (Ng, Harada, and Russell). Let a (stan- dard RL) primitive task T with reward function r be given, with the optimal value function V ∗(s). Consider another (standard RL) task, (cid:101)T with reward function (cid:101)r, with an un- . known optimal action-value function, (cid:101)Q∗. Define κ(s, a) = (cid:101)r(s, a) + γ Es′ V ∗(s′) − V ∗(s). Denote the optimal action-value function K ∗ as the solution of the following Bellman optimality equation K ∗(s, a) = κ(s, a) + γ E s′∼p max a′ K ∗(s′, a′) Then, (cid:101)Q∗(s, a) = V ∗(s) + K ∗(s, a) (38) (39) Proof. Since κ(s, a) is simply the reward function (cid:101)r(s, a) shaped by the potential function V ∗(s), this is simply a re- writing of Eq. (3) in (Ng, Harada, and Russell 1999). Now we provide a lemma before proving a similar result for compositions. Motivated by (Cao, Cohen, and Szpruch 2021)'s Theorem 1, we provide the same result for standard (un-regularized) RL: Lemma 4.8a. Let Q(s, a) be given. Define V ∗(s) = maxa Q(s, a) as the corresponding state value functions for a un-regularized RL task. Then R(s, a) = Q(s, a) − γ E s′∼p V ∗(s′) (40) is the reward function for a task with optimal action-value function Q∗(s, a) = Q(s, a). Proof. The proof is trivial, given by rearrangement of the Bellman optimality equation. Theorem 4.8. Given a set of primitive tasks {Tj} with cor- j }, denote (cid:101)Q∗ as the responding optimal value functions {Q∗ optimal value function for the composition of {Tj} under the composition function f : RM → R. Define K ∗ as the optimal value function for a task with reward function κ defined by: κ(s, a) = f ({rj(s, a)}) + γ E s′ f (cid:0){Q∗ Vf (s) = max a j (s, a)}(cid:1) Vf (s′) − Vf (s) Then, the optimal value functions (cid:101)Q∗ and K ∗ are related by: (cid:101)Q∗(s, a) = Vf (s) + K ∗(s, a) (41) Proof. Let f (cid:0){Q∗ j (s, a)}(cid:1) stand for the primitive task's solution, as in Theorem 6.1a. Then, by Lemma 4.8a, such a value function is optimal for a un-regularized RL j (s, a)}(cid:1) − task with reward function R(s, a) = f (cid:0){Q∗ j (s, a)}(cid:1). By f (s′), where Vf (s) = maxa f (cid:0){Q∗ γ Es′∼p V ∗ Theorem 6.1a, the corrective task has a reward function κ(s, a) = f ({rj(s, a)}) + γ E s′ Vf (s′) − Vf (s) (42) with corresponding optimal value function K ∗(s, a), related to (cid:101)Q∗(s, a) by (cid:101)Q∗(s, a) = Vf (s) + K ∗(s, a) (43) Again, this result can be seen as (Ng, Harada, and Russell 1999)'s reward shaping with a potential function Φ(s) = Vf (s). We now note that Lemma A applies to the cases of The- orem 6.1a and 4.8, which results in double-sided bounds given any estimate of the state value function V (s): Theorem 4.9. Consider a (standard RL) task with re- ward function r(s, a) and (unknown) optimal value func- tion Q∗(s, a). Let an estimate for the state value function be given as V (s). The optimal value function Q∗(s, a) is then bounded by: Q∗(s, a) ≥ r(s, a) + γ Q∗(s, a) ≤ r(s, a) + γ (cid:18) (cid:18) E s′∼p E s′∼p V (s′) + V (s′) + (cid:19) inf ∆ 1 − γ sup ∆ 1 − γ (cid:19) (44) (45) where ∆(s, a) . = r(s, a) + γ E s′∼p V (s′) − V (s). In Eq. (45), the inf and sup are taken over the continuous the soft back-up equations for the subtasks. state-action space S × A. Proof. The proof is identical to that of Theorem 4.1, except with the proper replacement of ∆. Exact composition in entropy regularized RL Here, we provide a new proof and extension of Theorem 2 in (Van Niekerk et al. 2019) to highlight that our results can provide new insight to exact compositions in entropy- regularized RL. To align with the assumptions of (Van Niekerk et al. 2019), we consider the undiscounted, finite horizon setting with deterministic dynamics. We first note the observation which forms the starting point of our analysis: the difference between the true optimal value function (Q∗(s, a)), corre- sponding to reward function r(s, a), and any estimate of the value function (Q(s, a)) can itself be represented as another optimal value function, with the corresponding reward func- tion given by (Adamczyk et al. 2023a): . = r(s, a) + γV (s′) − Q(s, a) ∆(s, a) It is straightforward to show that this observation remains valid in the undiscounted (γ = 1) setting as well. Now, if the estimate of the value function is exact, we must have ∆(s, a) = 0. In the following, we determine conditions which lead to ∆(s, a) = 0 and correspondingly to exact compositions. Proof. We consider M solved tasks with reward functions {r1, . . . , rM } varying only on the set of absorbing states (s ∈ G). Let Qi(s, a) denote the optimal value function for the ith task. Consider the composite task with the following reward structure: • For the absorbing states (s ∈ G), the reward function is given by the reward composition function (cid:101)r(s, a) = g({ri(s, a)}). • For the interior states (s ̸∈ G), the reward function is taken to be the same as the solved tasks and will be de- noted by r(s, a). For the composite task defined in this way, we wish to determine if the corresponding optimal value function can be expressed exactly as some global composition of the known value functions for the solved tasks, denoted by f ({Qi(s, a)}). In other words, the estimate of the optimal value function is given by f ({Qi(s, a)}), and we will show how a specific form for f corresponds to ∆(s, a) = 0 (exact composition). In the following, we will first show that we must have f = g, i.e the value composition function must be identical to the reward composition function for the absorbing states. We will then determine a specific form of f ({Q(s, a)}) such that the corresponding reward function (i.e. f ({Q(s, a)}) − Vf (s′), by (Cao, Cohen, and Szpruch 2021)) is equal to the reward function for the composite task ((cid:101)r(s, a)), thus yielding ∆(s, a) = 0. We will do so by deriving the soft back-up equation for f ({Q(s, a)}) using We begin by observing that, on the absorbing set G, we have r(s, a) = Q(s, a) for all s ∈ G, implying that (cid:101)Q(s, a) = (cid:101)r(s, a) = g({ri(s, a)}) = g({Qi(s, a)}). Thus, for exact composition on the absorbing set G, the value com- position function must be the same as the reward composi- tion function (i.e f = g), for any reward composition func- tion g. Since we are interested in a global value composition function, this means that the reward composition function g also determines the composition function f ({Q(s, a)}) for states s ̸∈ G. However, for arbitrary choices of g, the cor- responding f ({Q(s, a)}) will not, in general, correspond to the exact optimal value function for states s ̸∈ G. We now consider a special class of reward composition functions g, such that the corresponding value composition function f is an exact composition globally. Consider g such that we have, for the absorbing states s, e(cid:101)r(s,a) = wieri(s,a) (cid:88) i (46) with weights wi > 0 and we have set τ = 1 for simplicity. For deterministic dynamics, focusing on the non- absorbing states (i.e. s ̸∈ G ) the soft backup equation for the subtask m can be expressed as eQm(s,a) = erm(s,a)eVm(s′). (47) Since the subtask reward functions are identical for those s ̸∈ G, this simplifies to eQm(s,a) = er(s,a)eVm(s′). (48) Since the state space is made of disjoint absorbing and non-absorbing (i.e. boundary and interior as in (Todorov 2009)), we can split to two cases as s, a which transition to s′ ∈ G and otherwise. Now, consider the backup equation for each subtask, where we split those states s ̸∈ G and s ∈ G. eQi(s,a) = er(s,a)×  (cid:88)  s′∈G p(s′|s, a)eVi(s′) + p(s′|s, a)eVi(s′) (cid:88) s′̸∈G   But for s ∈ G, the state value function is simply Vm(s) = rm(s). Thus we have eQi(s,a) = er(s,a)×  (49)  (cid:88)  s′∈G p(s′|s, a)eri(s′) + p(s′|s, a)eVi(s′)  (cid:88) s′̸∈G Now, since we have f = g, the optimal value composition function is given by ef ({Qi(s,a)}) = (cid:88) i wieQi(s,a) (50) Multiplying each of the subtask backup equations (above) by the respective weight (wi) and summing up we obtain ef ({Qi(s,a)}) = er(s,a)× (cid:18)(cid:88) (cid:88) wi i s′∈G p(s′|s, a)eri(s′) + p(s′|s, a)eVi(s′) (cid:19) . (cid:88) s′̸∈G Now we observe that for f as defined above, the soft state- value function Vf (s) derived from f (Q) satisfies: eVf (s) = E a′∼π0 ef ({Qi(s′,a′)}) = E a′∼π0 (cid:88) wi eQi(s′,a′) eQi(s′,a′) i wi E a′∼π0 wi eVi(s′) = = (cid:88) i (cid:88) i Using the above, we obtain ef ({Qi(s,a)}) = er(s,a)×   (cid:88) s′∈G p(s′|s, a)e(cid:101)r(s,a) + p(s′|s, a)eVf (s′) (cid:88) s′̸∈G   Comparing the above equation with the backup equation for the subtask Eq. (49), we obtain that f ({Qi(s, a)}) (de- fined in Eq. (50)) is the exact optimal value function for the composite task with reward function (cid:101)r(s, a) for the absorb- ing states (s ∈ G) and r(s, a) for the non-absorbing states (s ̸∈ G). The result stated in the main text (Theorem 5.1) follows, given that (cid:101)Q(s, a) = f ({Qi(s, a)}). References Adamczyk, J.; Arriojas, A.; Tiomkin, S.; and Kulkarni, R. V. 2023a. Utilizing Prior Solutions for Reward Shaping and Composition in Entropy-Regularized Reinforcement Learn- ing. Proceedings of the AAAI Conference on Artificial Intel- ligence, 37(6): 6658–6665. Adamczyk, J.; Makarenko, V.; Arriojas, A.; Tiomkin, S.; and Kulkarni, R. V. 2023b. Bounding the optimal value function in compositional reinforcement learning. In Evans, R. J.; and Shpitser, I., eds., Proceedings of the Thirty-Ninth Confer- ence on Uncertainty in Artificial Intelligence, volume 216 of Proceedings of Machine Learning Research, 22–32. PMLR. Brockman, G.; Cheung, V.; Pettersson, L.; Schneider, J.; Schulman, J.; Tang, J.; and Zaremba, W. 2016. Openai gym. arXiv preprint arXiv:1606.01540. Cao, H.; Cohen, S.; and Szpruch, Ł. 2021. Identifiability in inverse reinforcement learning. Advances in Neural Infor- mation Processing Systems, 34: 12362–12373. Degrave, J.; Felici, F.; Buchli, J.; Neunert, M.; Tracey, B.; Carpanese, F.; Ewalds, T.; Hafner, R.; Abdolmaleki, A.; de Las Casas, D.; et al. 2022. Magnetic control of toka- mak plasmas through deep reinforcement learning. Nature, 602(7897): 414–419. Eysenbach, B.; Gupta, A.; Ibarz, J.; and Levine, S. 2019. Diversity is all you need: Learning skills without a reward function. International Conference on Learning Represen- tations. Eysenbach, B.; and Levine, S. 2022. Maximum Entropy RL (Provably) Solves Some Robust RL Problems. In Interna- tional Conference on Learning Representations. Fazlyab, M.; Robey, A.; Hassani, H.; Morari, M.; and Pap- pas, G. 2019. Efficient and accurate estimation of lipschitz constants for deep neural networks. Advances in Neural In- formation Processing Systems, 32. Haarnoja, T.; Pong, V.; Zhou, A.; Dalal, M.; Abbeel, P.; and Levine, S. 2018a. Composable deep reinforcement learn- In 2018 IEEE international ing for robotic manipulation. conference on robotics and automation (ICRA), 6244–6251. IEEE. Haarnoja, T.; Zhou, A.; Abbeel, P.; and Levine, S. 2018b. Soft actor-critic: Off-policy maximum entropy deep rein- forcement learning with a stochastic actor. In International conference on machine learning, 1861–1870. PMLR. Kim, J.; Park, S.; and Kim, G. 2022. Constrained GPI for Zero-Shot Transfer in Reinforcement Learning. In Koyejo, S.; Mohamed, S.; Agarwal, A.; Belgrave, D.; Cho, K.; and Oh, A., eds., Advances in Neural Information Processing Systems, volume 35, 4585–4597. Curran Associates, Inc. Lee, K.; Laskin, M.; Srinivas, A.; and Abbeel, P. 2021. Sun- rise: A simple unified framework for ensemble learning in In International Conference deep reinforcement learning. on Machine Learning, 6131–6141. PMLR. Nemecek, M.; and Parr, R. 2021. Policy caches with suc- In International Conference on Machine cessor features. Learning, 8025–8033. PMLR. Ng, A. Y.; Harada, D.; and Russell, S. 1999. Policy invari- ance under reward transformations: Theory and application to reward shaping. In Proceedings of the 16th International Conference on Machine Learning, volume 99, 278–287. Park, S.; Lee, K.; Lee, Y.; and Abbeel, P. 2023. Controllability-Aware Unsupervised Skill Discovery. arXiv:2302.05103. Rachelson, E.; and Lagoudakis, M. G. 2010. On the Locality In of Action Domination in Sequential Decision Making. 11th International Symposium on Artificial Intelligence and Mathematics (ISIAM 2010), 1–8. Fort Lauderdale, US. Raffin, A.; Hill, A.; Gleave, A.; Kanervisto, A.; Ernestus, M.; and Dormann, N. 2021. Stable-Baselines3: Reliable Re- inforcement Learning Implementations. Journal of Machine Learning Research, 22(268): 1–8. Rusu, A. A.; Rabinowitz, N. C.; Desjardins, G.; Soyer, H.; Kirkpatrick, J.; Kavukcuoglu, K.; Pascanu, R.; and Had- sell, R. 2016. Progressive neural networks. arXiv preprint arXiv:1606.04671. Schrittwieser, J.; Antonoglou, I.; Hubert, T.; Simonyan, K.; Sifre, L.; Schmitt, S.; Guez, A.; Lockhart, E.; Hassabis, D.; Graepel, T.; et al. 2020. Mastering atari, go, chess and shogi by planning with a learned model. Nature, 588(7839): 604– 609. Silver, D.; Hubert, T.; Schrittwieser, J.; Antonoglou, I.; Lai, M.; Guez, A.; Lanctot, M.; Sifre, L.; Kumaran, D.; Graepel, T.; Lillicrap, T.; Simonyan, K.; and Hassabis, D. 2018. A general reinforcement learning algorithm that masters chess, shogi, and Go through self-play. Science, 362(6419): 1140– 1144. Sutton, R. S.; and Barto, A. G. 2018. Reinforcement learn- ing: An introduction. MIT press. Tasse, G. N.; James, S.; and Rosman, B. 2020. A Boolean task algebra for reinforcement learning. Advances in Neural Information Processing Systems, 33: 9497–9507. Tasse, G. N.; James, S.; and Rosman, B. 2021. Generali- sation in Lifelong Reinforcement Learning through Logical Composition. In Deep RL Workshop NeurIPS 2021. Todorov, E. 2009. Compositionality of optimal control laws. Advances in neural information processing systems. Van Niekerk, B.; James, S.; Earle, A.; and Rosman, B. 2019. Composing value functions in reinforcement learning. In International conference on machine learning, 6401–6409. PMLR. Vinyals, O.; Babuschkin, I.; Czarnecki, W. M.; Mathieu, M.; Dudzik, A.; Chung, J.; Choi, D. H.; Powell, R.; Ewalds, T.; Georgiev, P.; et al. 2019. Grandmaster level in Star- Craft II using multi-agent reinforcement learning. Nature, 575(7782): 350–354. Ziebart, B. D. 2010. Modeling purposeful adaptive behavior with the principle of maximum causal entropy. PhD Disser- tation, Carnegie Mellon University.
http://arxiv.org/abs/2302.09668v1
2023-02-19T20:33:32
2023-02-19T20:33:32
Physics-aware deep learning framework for linear elasticity
The paper presents an efficient and robust data-driven deep learning (DL) computational framework developed for linear continuum elasticity problems. The methodology is based on the fundamentals of the Physics Informed Neural Networks (PINNs). For an accurate representation of the field variables, a multi-objective loss function is proposed. It consists of terms corresponding to the residual of the governing partial differential equations (PDE), constitutive relations derived from the governing physics, various boundary conditions, and data-driven physical knowledge fitting terms across randomly selected collocation points in the problem domain. To this end, multiple densely connected independent artificial neural networks (ANNs), each approximating a field variable, are trained to obtain accurate solutions. Several benchmark problems including the Airy solution to elasticity and the Kirchhoff-Love plate problem are solved. Performance in terms of accuracy and robustness illustrates the superiority of the current framework showing excellent agreement with analytical solutions. The present work combines the benefits of the classical methods depending on the physical information available in analytical relations with the superior capabilities of the DL techniques in the data-driven construction of lightweight, yet accurate and robust neural networks. The models developed herein can significantly boost computational speed using minimal network parameters with easy adaptability in different computational platforms.
[ "Arunabha M. Roy", "Rikhi Bose" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09668v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09668v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.NE", "math.AP" ]
3 2 0 2 b e F 9 1 ] G L . s c [ 1 v 8 6 6 9 0 . 2 0 3 2 : v i X r a Physics-aware deep learning framework for linear elasticity Arunabha M. Roy∗1 and Rikhi Bose2 1Aerospace Engineering, University of Michigan, Ann Arbor, MI 48109, U.S.A. 2Mechanical Engineering, Johns Hopkins University, Baltimore, MD 21218, U.S.A. Abstract The paper presents an efficient and robust data-driven deep learning (DL) computational framework developed for linear continuum elasticity problems. The methodology is based on the fundamentals of the Physics Informed Neural Networks (PINNs). For an accurate repre- sentation of the field variables, a multi-objective loss function is proposed. It consists of terms corresponding to the residual of the governing partial differential equations (PDE), constitu- tive relations derived from the governing physics, various boundary conditions, and data-driven physical knowledge fitting terms across randomly selected collocation points in the problem do- main. To this end, multiple densely connected independent artificial neural networks (ANNs), each approximating a field variable, are trained to obtain accurate solutions. Several bench- mark problems including the Airy solution to elasticity and the Kirchhoff-Love plate problem are solved. Performance in terms of accuracy and robustness illustrates the superiority of the current framework showing excellent agreement with analytical solutions. The present work combines the benefits of the classical methods depending on the physical information available in analytical relations with the superior capabilities of the DL techniques in the data-driven construction of lightweight, yet accurate and robust neural networks. The models developed herein can significantly boost computational speed using minimal network parameters with easy adaptability in different computational platforms. ∗Corresponding author - first version submitted on December, 2021 1 2 Keywords: Physics Informed Neural Networks (PINNs); Artificial neural networks (ANNs); Linear elasticity; Bi-harmonic equations; Deep learning (DL) 1. Introduction : In recent years, driven by the advancement of bigdata-based architectures (Khan et al., 2022a), deep learning (DL) techniques (LeCun et al., 2015) have shown great promises in computer vision (Voulodimos et al., 2018; Roy and Bhaduri, 2021; Roy et al., 2022c; Roy and Bhaduri, 2022; Roy et al., 2022a), object detection (Zhao et al., 2019; Chandio et al., 2022; Roy et al., 2022b; Singh et al., 2023a), image classification (Rawat and Wang, 2017; Irfan et al., 2021; Jamil et al., 2022; Khan et al., 2022b), damage detection (Guo et al., 2022; Glowacz, 2022, 2021) brain-computer interfaces (Roy, 2022b,a,c; Singh et al., 2023b) and across various scien- tific applications (Butler et al., 2018; Ching et al., 2018; Bose and Roy, 2022). The success of these methods, such as various classes of Neural Networks (NNs), can be largely attributed to their capacity in excavating large volumes of data in establishing com- plex high-dimensional non-linear relations between input features and output (Kutz, 2017). However, the availability of sufficient data is a major bottleneck for analyzing various com- plex physical systems (Butler et al., 2018; Ching et al., 2018). Consequently, the majority of state-of-the-art machine learning algorithms lack robustness in predicting these systems. Upon availability of sufficient data, these have also garnered considerable success in problems gov- erned by physics, such as dynamical systems (Dana and Wheeler, 2020), geosciences (DeVries et al., 2018; Bergen et al., 2019; Racca and Magri, 2021; Saha et al., 2021; Jahanbakht et al., 2022), material science and informatics (Butler et al., 2018; Ramprasad et al., 2017; Batra et al., 2021; M ̈a ̈att ̈a et al., 2021), fluid mechanics (Kutz, 2017; Brunton et al., 2020), various constitutive modeling (Tartakovsky et al., 2018; Xu et al., 2021), etc. Their applicability how- ever may be further enhanced by utilizing physical information available by mathematical/ analytical means. The recent endeavor of scientific and engineering community has been in attempting to incorporate such physical information within their predictive scheme in small data regimes. 3 The incorporation of physical information into the DL framework may have several advantages. First, as previously mentioned, in absence of sufficient data, it may be possible to solely utilize physical knowledge for solving such problems (Raissi et al., 2019), or to the least, enhance solutions in a data-driven predictive scheme (Raissi et al., 2020; Karniadakis et al., 2021). For example, in Sirignano and Spiliopoulos (2018), a high-dimensional Hamilton–Jacobi–Bellman PDE has been solved by approximating the solution with a DNN trained to satisfy the differ- ential operator, initial condition, and boundary conditions. In incompressible fluid mechanics, the use of the solenoidality condition of the velocity fields restricts the solution space of the momentum equations. Therefore, this condition may be used as a constraint for solving the governing equations (conventional solvers are generally developed in a way to satisfy this con- straint through the Poisson equation for pressure), or at least improve the predictions in a data-driven approach. Second, physical systems are often governed by laws that must satisfy certain properties, such as invariance under translation, rotation, reflection, etc. In a purely data-driven approach, it is almost impossible for a DL algorithm to inherit those properties entirely from data without explicit external forcing. Embedding such properties in the DL algorithm might automatically improve the accuracy of the predictions. For example, Ling et al. (2016) used a Tensor-based Neural Network (TBNN) to embed Galilean invariance that improved NN models for Reynolds-averaged Navier Stokes (RANS) simulations for the pre- diction of turbulent flows. And lastly, any scientific problem is governed by some underlying mechanism dictated by physical laws. Neglect of such physical information in a purely data- driven framework in the current state of affairs is, therefore, an unsophisticated approach, if not an ignorant one. Partial differential equations (PDEs) represent underlying physical processes governed by first principles such as conservation of mass, momentum, and energy. In most cases, analytical so- lutions to these PDEs are not obtainable. Various numerical methods, such as finite-difference (Sengupta, 2013), finite element (FE) (Zienkiewicz and Taylor, 2005), Chebyshev and Fourier spectral methods (Boyd, 2001), etc are used to obtain approximate solutions. However, such techniques are often computationally expensive and suffer from various sources of errors due to 4 the complex nature of the underlying PDEs, numerical discretization and integration schemes, iterative convergence techniques, etc. Moreover, the solution of inverse problems is the cur- rent endeavor of the engineering community which requires complex formulations and is often prohibitively expensive computationally. The use of the NNs in solving/modeling the PDEs governing physical processes in a forward/ inverse problem is an important challenge worth pursuing, as these methods have the capacity to provide accurate solutions using limited com- putational resources in a significantly robust framework relative to the conventional methods. In this paper, we explore the possibility of using NN to obtain solutions to such PDEs govern- ing linear continuum elasticity problems applicable in solid mechanics. There has been a recent thrust in developing machine learning (ML) approaches to obtain the solution of governing PDEs (Karniadakis et al., 2021; von Rueden et al., 2019). The idea is to combine traditional scientific computational modeling with a data-driven ML framework to embed scientific knowledge into neural networks (NNs) to improve the performance of learning algorithms (Lagaris et al., 1998; Raissi and Karniadakis, 2018; Karniadakis et al., 2021). The Physics Informed Neural Networks (PINNs) (Lagaris et al., 1998; Raissi et al., 2019, 2020) were developed for the solution and discovery of nonlinear PDEs leveraging the capabilities of deep neural networks (DNNs) as universal function approximators achieving considerable success in solving forward and inverse problems in different physical problems such as fluid flows (Sun et al., 2020; Jin et al., 2021), multi-scale flows (Lou et al., 2021), heat transfer (Cai et al., 2021; Zhu et al., 2021), poroelasticity (Haghighat et al., 2022), material identification (Shukla et al., 2021), geophysics (bin Waheed et al., 2021, 2022), supersonic flows (Jagtap et al., 2022), and various other applications (Waheed et al., 2020; Bekar et al., 2022). Contrary to traditional DL approaches, PINNs force the underlying PDEs and the boundary conditions in the solu- tion domain ensuring the correct representation of governing physics of the problem. Learning of the governing physics is ensured by the formulation of the loss function that includes the underlying PDEs; therefore labeled data to learn the mapping between inputs and outputs is no more necessary. Such architectural construction can be utilized for complex forward and inverse (finding parameters) solutions for various systems of ODEs and PDEs (Karniadakis et al., 2021). Additionally, the feed-forward neural networks utilize graph-based automated 5 differentiation (AD) (Baydin et al., 2018) to approximate the derivative terms in the PDEs. Various PINNs architectures notably self-adaptive PINNs (McClenny and Braga-Neto, 2020), extended PINNs (XPINN) (Hu et al., 2021; De Ryck et al., 2022) have been proposed that demonstrated superior performance. Moreover, multiple DNN-based solvers such as cPINN (Jagtap et al., 2020), XPINNs (Jagtap and Karniadakis, 2021), and PINNs framework for solid mechanics (Haghighat et al., 2021b) have been developed that provide important ad- vancement in terms of both robustness and faster computation. In this regard, (Haghighat et al., 2020, 2021b) have been the breakthrough works geared towards developing a DL-based solver for inversion and surrogate modeling in solid mechanics for the first time utilizing PINNs theory. Additionally, PINNs have been successfully applied to the solution and discovery in linear elastic solid mechanics (Zhang et al., 2020; Samaniego et al., 2020; Haghighat et al., 2021a; Guo and Haghighat, 2020; Vahab et al., 2021; Rezaei et al., 2022; Zhang et al., 2022), elastic-viscoplastic solids (Frankel et al., 2020; Goswami et al., 2022; Arora et al., 2022; Roy and Guha, 2022), brittle fracture (Goswami et al., 2020) and computational elastodynamics (Rao et al., 2021) etc. The solution of PDEs corresponding to elasticity problems can be ob- tained by minimizing the network's loss function that comprises the residual error of governing PDEs and the initial/boundary conditions. In this regard, PINNs can be utilized as a compu- tational framework for the data-driven solution of PDE-based linear elasticity problems that can significantly boost computational speed with limited network parameters. The potential of the PINNs framework in achieving computational efficiency beyond the capacity of the con- ventional computational methods for solving complex problems in linear continuum elasticity is the main motivation behind the present work. In the present work, an efficient data-driven deep learning computational framework has been presented based on the fundamentals of PINNs for the solution of the linear elasticity problem in continuum solid mechanics. In order to efficiently incorporate physical information for the elasticity problem, an improved multi-objective loss considering additional physics-constrained terms has been carefully formulated that consists of the residual of governing PDE, various boundary conditions, and data-driven physical knowledge fitting terms that demonstrate the efficacy of the model by accurately capturing the elasticity solution. Several benchmark prob- 6 lems including the Airy solution to an elastic plane-stress problem for an end-loaded cantilever beam and simply supported rectangular Kirchhoff-Love thin plate under transverse sinusoidal loading conditions have been solved which illustrates the superiority of the proposed model in terms of accuracy and robustness by revealing excellent agreement with analytical solutions. The employed models consist of independent multi-layer ANNs that are separately trained on minimizing the prescribed loss function specific to the problem under consideration. The performance of PINNs has been evaluated for different activation functions and network archi- tectures. Furthermore, we have illustrated the applicability of data-driven enhancement using the smart initialization of a data-driven learning-based approach in reducing training time, while simultaneously improving the accuracy of the model which is not possible in conventional numerical algorithms. Such an approach would be important in achieving computational effi- ciency beyond the capacity of conventional computational methods for solving complex linear elasticity problems. The present study also demonstrates the contribution of analytical solu- tions for the data-driven construction of an accurate and robust PINNs framework that can significantly boost computational speed utilizing minimal trainable network parameters. The paper is organized as follows: Section 2 introduces the background of PINNs the- ory and the generalized idea of implementing multi-objective loss function into the PINNs framework; In section 3, a brief overview of the theory of linear elasticity has been presented; Section 4 introduces the extension of the proposed PINNs framework for the Airy solution to an elastic plane-stress problem for an end-loaded cantilever beam; in section 5, the proposed PINNs framework has been extended to the solution of Kirchhoff–Love thin plate governed by Biharmonic PDE; Section 7 deals with the relevant finding and prospects of the current work. Finally, the conclusions have been discussed in section 8. 2. Physics-Informed Neural Networks : The concept of training a NN in the PINNs framework is the construction of the loss function. The loss function is intended to embed the underlying physics which is represented in mathe- matical terms by the PDEs and the associated boundary conditions. In this section, we discuss the construction of the proposed multi-object loss functions for embedding a data-driven phys- ical model that has been associated with the PINNs framework. Let us consider a fully connected NN defined by N k+1(N k) = κk(WWW k * N k + bbbk) 7 (1) where k ∈ {0, 1, * * * , N } represents the layer number of NN. N is a nonlinear map defined by N m(ˆxxxm) := κm(WWW m * xxxm + bbbm) for mth-layer where WWW m and bbbm represents the weights and biases of this transformation, respectively; κ(*) is the non-linear transformer or activation function acting on a vector element-wise. Therefore, k = 0 represents the input layer of the NN taking in the input xxx0. Also consider a steady state general nonlinear partial differential operator G operated on a scalar solution variable φ((cid:126)x) such that, G φ((cid:126)x) = 0 (cid:126)x ∈ Rndim (2) Since G is a differential operator, in general, Eq. 2 is accompanied by appropriate boundary conditions to ensure the existence and uniqueness of a solution. Let us assume, it is subjected to the boundary condition B φ(∂(cid:126)Γ) = τ (∂(cid:126)x) on the boundary (cid:126)Γ in domain Ω ∈ Rndim, ndim being the spatial dimension. In a PINNs framework, the solution to Eq. 2, φ(xxx), subjected to the aforementioned boundary condition may be approximated for an input xxx = (cid:126)x by constructing a feed-forward NN expressed mathematically as ˆφ = N N (cid:125) N N −1 (cid:125) * * * (cid:125) N 0(xxx) (3) where ˆφ is the approximate solution to Eq. 2; (cid:125) denotes the general compositional construction of the NN; the input to the NN N 0 := xxx0 = (cid:126)x = (x1, x2, * * * xndim) is the spatial coordinate at which the solution is sought. Following Eq. 1 and Eq. 3, if WWW i and bbbi are all collected in θ = (cid:83)N i=0(WWW i, bbbi), the output layer N N contains the approximate solution ˆφ((cid:126)x) to the PDE such that N k+1 = ˆφ [xxx, θ] = [ ˆφ1, ˆφ2, ..., ˆφm] (4) The spatial dependence of ˆφ is implicitly contained in the NN parameter θ. In the inter- nal/ hidden layers of NN, several variations of nonlinear transformer or the activation func- tion κ may be used, such as, the hyperbolic-tangent function tanh(ξ), the sigmoid function κ(ξ) = 1/(1 + e−ξ), the rectified linear unit (ReLU) κ(ξ) = max(0, ξ), etc. The activation in the final layer is generally taken to be linear for regression-type problems considered here. 8 2.1 Embedding constraints in NN : This section briefly describes the general idea of embedding linear constraints into NN (Lagaris et al., 1998; Du and Zaki, 2021). Let us consider U and A, two complete normed vector spaces, where NN function class M ⊂ U need to be constrained. A linear constraint on φ ∈ M can be expressed as: Pφ(xxx) = 0, φ ∈ M (5) where, P : U → A expresses a linear operator on U. Generally, a such constraint can be realized for solving PDEs in most of the DL framework by minimizing the following functional JA = (cid:107)Pφ(cid:107)A, φ ∈ M (6) where (cid:107) (cid:5) (cid:107)A denotes the norm corresponding to space A. It is noteworthy to mention that the aforementioned procedure approximately enforces linear constraint in Eq. 5. However, the accuracy of the imposed constraint relies on the relative weighting between the constraint and other objectives involved in the training include the satisfaction of the governing PDEs or the integration of data-driven schemes. 2.2 Multiple objective loss functions : In order to incorporate physical information of the problem, one of the possibilities is to impose Eq. 2 as a hard constraint in xxx ∈ Ω while training the NN on the physical data. Math- ematically, such a condition is imposed by formulating a constrained optimization problem which can be expressed as (Krishnapriyan et al., 2021), min θ ∆L(xxx, θ) s.t. G φ((cid:126)x) = 0. (7) where ∆L represents data-driven physical knowledge fitting term which includes the imposed initial and boundary conditions. G φ((cid:126)x) denotes the constraint corresponding to the residual 9 PDE imposing the governing PDE itself. Thus, it is important to carefully impose appropriate constraints for the NN to realize the underlying physics of the problem. In the present work, we propose a multi-objective loss function that consists of residuals of governing PDEs, various boundary conditions, and data-driven physical knowledge fitting terms that can be expressed in the following general form: ∆L(xxx, θ) = φ(cid:107)G φ(xxx) − ˆ0(cid:107)Ω + βu(cid:107)B Γuφ − g Γu(cid:107)Γu + βt(cid:107)B Γtφ − g Γt(cid:107)Γt + α(cid:107)φ − ˆφ(cid:107)Ω + * * * (8) where, ∆L(xxx, θ) is the total loss function; the symbol (cid:107) (cid:125) (cid:107) represents the mean squared error norm, i.e., (cid:107) (cid:74) (cid:107) = M SE((cid:74)) for regression type problem; (cid:107)G φ(xxx)−ˆ0(cid:107)Ω denotes the residual of the governing differential relation in Eq. 2 for xxx ∈ Ω; Γu and Γt are the Dirichlet and Neumann boundaries subjected to conditions B Γuφ = g Γu and B Γtφ = g Γt, respectively. The values of g Γu and g Γt are specific to the problem under consideration, and therefore, pre-specified as inputs to the problem/ loss function. Note φ, βu, and, βt, are weights associated with each loss term regularizing the emphasis on each term (the higher the relative value, the more emphasis on satisfying the relation). The remaining task is to utilize standard optimization techniques to tune the parameters of the NN minimizing the proposed objective/ loss function ∆L(xxx, θ) in Eq. 8. However, even with a large volume of training data, such an approach may not guarantee that the NN strictly obeys the conservation/governing equations in Eq. 2. Thus, additional loss terms to fit the observation data can be introduced. Hence, in the proposed objective loss function, additional loss terms such as (cid:107)φ − ̄φ(cid:107)Ω have been included that represent the data- driven physical knowledge fitting term for the state variable φ((cid:126)x). Here, ̄φ is the true (target) value of φ provided from either the analytical solution (if available), numerical simulation, or experimental observations. α is the weight associated with the data-driven physical knowledge fitting term for φ((cid:126)x). In the NN approximation, various degrees of differentials of the state variable φ(xxx) (i.e., φ(cid:48)(xxx), φ(cid:48)(cid:48)(xxx), * * * ) can also be included (if known) for stronger coupling in the data-driven approach. The partial differentials of φ(xxx) may be evaluated utilizing the graph- based automatic differentiation (Baydin et al., 2018) with multiple hidden layers representing the nonlinear response in PINNs. Following the same steps, the initial conditions can also be incorporated in Eq. 8. The loss from the initial conditions is not included herein due to the quasi-static nature of the elasticity problem. In a more general case, the additional loss term (cid:107)φ0 − ˆφ0(cid:107)t=t0 Ω should be added for the loss contribution from the initial condition. Finally, the optimal network parameters of NN ̃θ can be obtained by optimizing the loss function in Eq. 8 as ̃θ = arg min θ⊂RN t ∆L( ̄X ̄X ̄X, θ). (9) 10 where, ̃θ := (cid:83)N ) is the set of optimized network parameters; N t is the total number of trainable parameters; and ̄X ̄X ̄X ∈ RNc×N t is the set of Nc collocation points used for optimization. i=0( ̃W ̃W ̃W i i , ̃b ̃b ̃b 3 Theory of linear elastic solid: Consider an undeformed configuration B of an elastic body bounded in the domain Ω ⊂ Rndim (1 ≤ ndim ≤ 3) with boundary Γ = Γu ∪ Γt where Γu (cid:54)= ∅ is the Dirichlet boundary, Γt is the Neumann boundary, and Γu ∩ Γt = ∅. With respect to the undeformed surface, the elastic body can be subjected to a prescribed displacement ̄uuu on ΓD, and a prescribed surface traction ̄ttt ∈ [L2(Γt)]ndim. Additionally, a body force of density BBB ∈ [L2(Ω)]ndim in Ω can be prescribed with respect to the undeformed volume. Using a standard basis {eieiei} in Rndim, we can express the displacement, uuu = uieieiei, and its gradient, ∇uuu = 1 2 (ui,j + uj,i) eieiei ⊗ ejejej; where, ⊗ denotes the tensor products. Second order symmetric tensors are linear transformations in S, defined as S := (cid:8)ξξξ : Rndim → Rndim| ξξξ = ξTξTξT (cid:9) with inner product ξξξ : ξξξ = tr (cid:2)ξξξξTξTξT (cid:3) ≡ ξijξij. Therefore, the stress tensor can be expressed as σσσ := σijeieiei ⊗ ejejej. For infinitesimal strain, displacement (cid:2)∇uuu + ∇(uuu)T(cid:3) is the (cid:2)∇uuu − ∇(uuu)T(cid:3) is the in- infinitesimal strain tensor with ∇ × εεε = eijk εrj,i ekekek ⊗ ererer, and ω := 1 2 gradient tensor ∇uuu can be expressed as: ∇uuu = εεε + ω where εεε := 1 2 finitesimal rotation tensor. 3.1 Compatibility condition: In the context of infinitesimal strain theory, we seek to find uuu : Ω → Rndim and corresponding εεε : Ω → Rndim×ndim, and σσσ : Ω → Rndim×ndim for a given infinite elastic solid satisfying the following compatibility conditions (Marsden and Hughes, 1994): R :R :R : = ∇ × (∇ × εεε)T = 000; (10) 11 where, RRR is Saint-Venant compatibility tensor. Alternatively, the elastic solid should satisfy the Navier–Cauchy equations which can be expressed as (Lurie, 2010): (λ + μ)∇(∇ * uuu) + μ∆uuu + BBB = 000, in Ω uuu |ΓD = ̄u ̄u ̄u; (11) where uuu = (u1, u2, ..., undim) is the unknown displacement field; μ > 0 and λ > −μ are Lame constants; ∇, ∆, and ∇ represent the gradient, the Laplacian, and the divergence operators, respectively. Equation 11 satisfies the continuity of the displacement field uuu and Dirichlet boundary condition. 3.2 Equilibrium condition: In addition, the equilibrium condition and the Neumann boundary condition should be satisfied which can be expressed as (Marsden and Hughes, 1994): ∇* σσσ + BBB = 000, in Ω ttt := Tuuu = ̄ttt, on Γt σσσ |Γt ˆnˆnˆn = ̄t ̄t ̄t (12) where, ̄ttt is a prescribed function on Γt; ˆnˆnˆn is the field normal to Γt. Equation 12 satisfies the momentum equation and the Neumann boundary condition where T follows the conformal derivative operator such that (Atkin and Fox, 2005) Tuuu = λ(∆ uuu) * ˆnˆnˆn + 2μ ∂uuu ∂ˆnˆnˆn + μ ˆnˆnˆn × (∇ × uuu) (13) 3.3 Constitutive relation: Subsequently, the elastic constitutive relation can be expressed from generalized Hooke's law (Timoshenko, 1970) as: σσσ = CCC : εεε (14) where, the fourth-order stiffness tensor CCC = Cijkl eieiei ⊗ ejejej ⊗ ekekek ⊗ elelel denotes the constitutive relation that maps the displacement gradient ∇uuu to the Cauchy stress tensor σσσ. For an isotropic linearly elastic material, Cijkl = λδijδkl + μ(δikδjl + δilδjk) where δij is the Kronecker 12 delta. The components of the stress tensor σσσ, and the strain tensor εεε, are expressed as : σij(uuu) = λδij ndim(cid:88) k=1 εkk(uuu) + 2μεij(uuu), εij(uuu) = 1 2 (cid:18) ∂ui ∂xj + (cid:19) , ∂uj ∂xi i, j = 1, 2, ..., ndim. (15) Note that σ is the Cauchy stress tensor in linear elasticity applicable under small deformation. The constitutive relation in terms of strain can be alternatively expressed as, εij,kl + εkl,ij − εik,jl − εjl,ik = 0 i, j, k, l ∈ 1, 2, ..., ndim. (16) Equations governing a linear elastic boundary value problem (BVP) are defined by Eqs. 11–16 where the field variables uuu, σ, εεε can be obtained for given material constants (Atkin and Fox, 2005; Lurie, 2010). 4. PINNs formulation for continuum linear elasticity: The proposed PINNs framework is applied to linearly elastic solids. A two-dimensional (ndim = 2) problem is considered. The input features (variables) to the models are the spatial coordi- nates xxx = (x, y). A separate NN is used to approximate each output field variable. As shown in Fig. 1, displacement uuu(xxx), stress σσσ(xxx), and strain εεε(xxx) fields are obtained by densely connected independent ANNs. For ndim = 2, considering symmetry of the stress and strain tensors, uuu(xxx), σσσ(xxx), and εεε(xxx) fields can be approximated as: uuu(xxx) (cid:39) ΞNN uuu (xxx) = (cid:21) (cid:20) ̃uNN x (xxx) ̃uNN y (xxx) σσσ(xxx) (cid:39) ΞNN σσσ (xxx) = (cid:20) ̃σNN xx (xxx) ̃σNN ̃σNN yx (xxx) ̃σNN (cid:21) xy (xxx) xy (xxx) ; εεε(xxx) (cid:39) ΞNN εεε (xxx) = (cid:20) ̃εNN xx (xxx) ̃εNN ̃εNN yx (xxx) ̃εNN xy (xxx) xy (xxx) (cid:21) (17) (18) Here ΞNN uuu (xxx), ΞNN σσσ (xxx), and ΞNN εεε (xxx) denote the NN approximations for uuu(xxx), σσσ(xxx), and εεε(xxx), respectively. 4.1 Loss function: To define the loss function for the linear elasticity problem, governing equations including compatibility conditions, equilibrium conditions, constitutive relations, and boundary condi- tions that fully describe the problem have been considered. Additionally, as in a data-driven 13 Figure 1: PINNs network architecture for solving linear elasticity problem consisting of multi- ANN (NNi ∀ i = 1, k) for each output variables ̃uNN xx (xxx), yy (xxx), and ̃εNN ̃εNN xx (xxx), ̃σNN xy (xxx), with independent variable xxx = (x, y) as input features. yy (xxx), ̃σNN y (xxx), ̃σNN x (xxx), ̃uNN xy (xxx), ̃εNN approach, the field variables in Eq. 8 have been included. The generalized mutli-objective loss functional ∆L can be expressed as: ∆L(xxx, θ) = φ ∆Ω L + φe ∆e L + φc ∆c L + βu ∆Γu L + βt ∆Γt L + αuuu ∆uuu L + ασσσ∆σσσ L + αεεε∆εεε L (19) where, ∆e L, ∆c L, and ∆Ω L are the loss components from the equilibrium condition (Eq. 12), constitutive relation (Eq. 14), and the compatibility condition (Eq. 15), respectively; ∆Γu L and L represent the loss components computed at the Dirichlet boundary Γu, and the Neumann L , and ∆εεε ∆Γt boundary Γt (Eq. 11), respectively; ∆uuu uuu(xxx), σσσ(xxx), and εεε(xxx), respectively, when a data driven approach is pursued. The coefficients L are the loss components for the fields L , ∆σσσ φ, φe, φc, βu, βt, αuuu, ασσσ, and αεεε are the weights associated with each loss term that dictates the emphasis on each penalty term. Evidently, the terms in the cost function are the measures of the errors in the displacement and stress fields, the momentum balance, and the constitutive 14 (20) (21) (22) (23) (24) (25) (26) (cid:110) xxx1|Γu, ..., xxxN Γu c |Γu (cid:111) law. The explicit expression for each term in ∆L(xxx, θ) is, ∆Ω L = ∆c L = ∆Γu L = ∆Γt L = ∆uuu L = ∆σσσ L = ∆εεε L = 1 N Ω c 1 N Ω c 1 N Γu c 1 N Γt c N Ω c(cid:88) l=1 N Ω c(cid:88) (cid:107)∇ * ΞNN σ (xxxl|Ω) + BBB(xxxl|Ω)(cid:107) (cid:107)ΞNN σσσ (xxxl|Ω) − CCC (cid:2)∇ * ΞNN uuu (xxxl|Ω)(cid:3)(cid:107) l=1 N Γu c(cid:88) (cid:107)ΞNN uuu (xxxk|Γu ) − ̄u ̄u ̄u(xxxk|Γu)|(cid:107) k=1 N Γt c(cid:88) (cid:107)ΞNN σσσ (xxxj|Γt)ˆnˆnˆn − ̄t ̄t ̄t(xxxj|Γt)(cid:107) j=1 1 N Ω c 1 N Ω c 1 N Ω c N Ω c(cid:88) l=1 N Ω c(cid:88) l=1 N Ω c(cid:88) l=1 (cid:107)ΞNN uuu (xxxl|Ω) − ˆuuu(xxxl|Ω)(cid:107) (cid:107)ΞNN σσσ (xxxl|Ω) − ˆσσσ(xxxl|Ω)(cid:107) (cid:107)ΞNN εεε (xxxl|Ω) − ˆεεε(xxxl|Ω)(cid:107) (cid:9) are randomly chosen collocation points over the domain Ω; where, (cid:8)xxx1|Ω, ..., xxxN Ω c |Ω (cid:110) (cid:111) xxx1|Γt, ..., xxxN Γt and are those chosen randomly along the boundaries Γu and Γt, respectively. c |Γt The terms ˆuuu(xxxl|Ω), ˆσσσ(xxxl|Ω), and ˆεεε(xxxl|Ω) represent the true (target) value obtained by means of analytical solution or high-fidelity simulation. The weights φ, φe, φc ∈ R+ are the weights corresponding to the compatibility, equilibrium, and constitutive relations, respectively. In general, these coefficients can be prescribed as 1 for solving a relatively less complex problem, whereas, βu and βt are the binary (i.e., either 0 or 1) integers. The weights αi = 1; ∀ i = uuu, σσσ, εεε for a complete data driven approach for uuu(xxx), σσσ(xxx), and εεε(xxx), respectively at the collocation points N Ω c . However, we prescribe αi = 0 ∀ (i = uuu, σσσ, εεε) as labeled training data is unavailable, which may not guarantee the accuracy of PINNs solutions. The forward problem is studied herein, where the displacement, stress, and strain fields are obtained as the PINNs solutions assuming material properties λ and μ remain constant. However, the loss functional in Eq. 19 can also be utilized in an inverse problem for parameter identification, where λ and μ can be treated as network outputs which may vary during train- ing (Fig. 1). For the network construction in the PINNs framework, SciANN (Haghighat and 15 (a) Elastic plane-stress problem for an end-loaded cantilever beam of length L, Figure 2: height 2a and out-of-plane thickness b which has been clamped at x = L; (b) distributions of total collocations points Nc = 5, 000 on the problem domain and various boundaries during PINNs training. Juanes, 2021), a convenient high-level Keras (Chollet et al., 2015) wrapper for PINNs is used. 4.2 Solution for linear elasticity problem : For this study, an end-loaded isotropic linearly elastic cantilever beam of height 2a, length L, thickness b (assuming b (cid:28) a) has been considered to ensure a state of plane-stress condition as shown in Fig. 2. The left edge of the beam is subjected to a resultant force P . Whereas, the right-hand end is clamped. The top and bottom surfaces of the beam, y = ±a are traction free. An approximate solution to the problem can be obtained from the Airy function discussed next. 4.2.1 The Airy solution to the end-loaded cantilever beam: The Airy solution in Cartesian coordinates Ω ⊂ R2 can be found from the Airy potential φ(x, y) that satisfies (Bower, 2009), ∇φ = ∂4φ ∂x4 + 2 ∂4φ ∂x2∂y2 + ∂4φ ∂y4 = C(ν)( ∂bx ∂x + ∂by ∂y ) where, C(ν) = (cid:26) 1−ν 1−2ν 1 1−ν (plane strain) (plane stress) (27) (28) 16 Here, the body forces bx, by have the form ρ0bx = ∂Ω ∂y ; Ω(x, y) is the positional scalar function. The solution of the Airy function can be expressed in the polynomial form φ(x, y) = (cid:80)∞ n=0 Amn xmyn. For m+n ≤ 3, the terms automatically satisfy the biharmonic equation ∂x , ρ0by = ∂Ω (cid:80)∞ m=0 for any Amn. Additionally, φ must satisfy the following traction boundary conditions on Ω. ∂2φ ∂y2 nx − ∂2φ ∂x∂y ny = tx; ∂2φ ∂x2 ny − ∂2φ ∂x∂y ny = ty (29) Here, (nx, ny) are the components of a unit vector normal to the boundary. For the end-loaded cantilever beam, the Airy function can be formulated as, φ = − 3P 4ab xy + P 4a3b xy3 (30) where, σxx = ∂2φ ∂x∂y with Ω = 0. At the clamped end, x1 = L, displacement boundary conditions are ux = uy = ∂uy/∂x = 0. The top and bottom ∂x2 − Ω; ∂y2 − Ω; σxy = σyx = − ∂2φ σyy = ∂2φ surfaces of the beam (i.e., y = ±a) are traction free, σijni = 0, that requires σyy = σxy = 0. Whereas, the resultant of the traction acting on the surface at x = 0 is −P ey with traction vector ti = σijnj = −σxyδiy = − 3P Fi = b (cid:82) a 4ab(1 − y2 a2 )δiy. The resultant force can be obtained as : a2 )δiydx2 = −P δiy. On satisfaction of the aforementioned conditions, approximate analytical solutions for the displacements ux, uy, the strain fields εxx, εyy, εxy and −a − 3P 4ab(1 − y2 the stress fields σxx, σyy, σxy can be expressed as: 3P 4Ea3b 3μP 4Ea3b 3P 2Ea3b 3P 2a3b xy; xy; εxx = σxx = ux = x2y − (2 + μ) P 4Ea3b y3 + 3(1 + μ) P a2 2Ea3b y − 3P L2 4Ea3b y uy = − xy2 − P 4Ea3b x3 + 3P L2 4Ea3b x − P L3 2Ea3b εyy = − 3P μ 2Ea3b xy; εxy = 3P (1 + μ) 4Eab σyy = 0; σxy = 3P 4ab (cid:18) 1 − (cid:19) y2 a2 (cid:18) 1 − (cid:19) y2 a2 (31) (32) (33) (34) These analytical solutions for uuu(xxx), σσσ(xxx), and εεε(xxx) have been used as ˆuuu(xxxl|Ω), ˆσσσ(xxxl|Ω), and ˆεεε(xxxl|Ω) at the collocation points for data-driven enhancement in Eqs. 24-26, respectively, for solving the field variables in the proposed PINNs framework. 4.2.2 PINNs solutions for linear elasticity problem: For the benchmark, end-loaded cantilever beam problem, L = 3 m, a = 0.5 m, and b = 0.001 17 m have been considered. The material properties are, Young's modulus E = 1 GPa, and the Poisson ratio ν = 0.25 as shown in Fig. 2 -(a). Unless otherwise stated, a total of Nc = 5, 000 randomly distributed collocation points over the domain and boundaries have been used for training the PINNs model as shown in Fig. 2 -(a). During training, the optimization loop was run for 500 epochs using the Adam optimization scheme with a learning rate of 0.001, and a batch size of 32 for optimal accuracy and faster convergence. The Airy solutions for various fields including displacements ux, uy, stresses σxx, σyy, σxy, and strains εxx, εyy, εxy as in Eqs. 31-34 are shown in Fig. 3-(a). The corresponding PINNs approximations using the tanh activation function are shown in Fig. 3 -(b). Additionally, in Fig. 3 -(c), the absolute error between the Airy solutions and PINNs predictions for each field variable is shown. The overall results from PINNs are in excellent agreement with the Airy solutions. The PINNs approximations attained satisfactory accuracy with low absolute errors for all field variables. For the displacement fields, the absolute error is relatively high near to clamped edge for ux. For uy, the absolute error is maximum at the midsection and near the horizontal edges as shown in Fig. 3 -(c). This is due to the approximate nature of the Airy solu- tions at clamped end x1 = L for the displacement boundary conditions ux = uy = ∂uy/∂x = 0. Such differences also propagate through the solutions of stress and strain fields, where PINNs predictions slightly deviate from the Airy solutions, in particular, near the free vertical and horizontal edges as shown in Fig. 3 -(c). However, according to Saint-Venant's principle, these deviations do not sufficiently influence the solution far from the end, which is reflected in the result. Overall, the proposed PINNs model can capture the distributions of various fields ac- curately from the solution of the Airy stress function. 4.2.3 Suitable activation function : The impact of the use of various activation functions on training the PINNs models in pre- dicting field variables and the epoch evolution of various components of the loss function is explored. The ReLU, sigmoid, and tanh activation functions are compared; the network archi- tecture remains the same: the number of neurons in each layer N = 20 with the total number of hidden layers Ln = 5 in the PINNs model. The evolution of the total loss ∆L, and the 18 Figure 3: (a) The Airy solutions for displacements ux, uy, stresses σxx, σyy, σxy, strains εxx, yy , and ̃εNN εyy, εxy; (b) corresponding PINNs solutions for ̃uNN x , ̃uNN xy ; (c) absolute error between the Airy solutions and PINNs predictions associated with each field variables for an end-loaded cantilever beam. xx , ̃σNN yy , ̃σNN y , ̃σNN xy , ̃εNN xx , ̃εNN 19 Figure 4: Comparison of (a) total loss ∆Ω ReLU activation functions for network parameters N = 20, Ln = 5. L; (b) constitutive loss ∆Ω L for tanh, sigmoid and constitutive loss ∆Ω L are depicted in Fig. 4. Additionally, values of the various loss components and training times ttr at the end of training are compared in Table. 1. Evidently, the tanh activation provides the best performance in terms of the value of the total loss at the end of training. The final constitutive loss with tanh activation is significantly lower compared to the other two activations illustrating the suitability of the use of the tanh activation for the PINNs model for solving the elasticity problem herein. In addition, all other loss components obtained are lowest upon using the tanh activation as shown in Table 1. Comparing the evolution of ∆L, the convergence characteristics for the ReLU activation are better compared to the tanh with fewer fluctuations and rapid decrease in loss values as shown in Fig. 4-(a). However, the tanh illustrates better adaptability in the constitutive loss with an excellent convergence rate in Fig. 4-(b). Out of the three activations, ReLU performs the worst possibly due to its derivative being discontinuous. However, the total loss for all three activations is negligible (loss value in the range below 10−4 to 10−5) within 200 epochs indi- cating the adaptability of the proposed PINNs framework to any of these activations provided the models are trained sufficiently long. In comparing the training time, the tanh activation takes longer for the same number of epochs compared to the other two. This coincides with the fact that the evolution of the total loss has a higher degree of discontinuity. However, the model with the ReLU activation trains the fastest possibly due to its linear nature. From the comparison, it can be concluded that although tanh is the best in terms of accuracy, however, ReLU can be an optimal choice of activation considering both accuracy and training time for 20 Table 1: Influence of different activation functions on the final values of various loss components (in 10−09) and training times ttr in the proposed PINNs model for solving linear elastic beam problem. Activation Function ∆Ω L ∆c L ∆Γu L ∆Γt L ∆uuu L ∆σσσ L ∆εεε L ∆L ReLU 107.16 43.43 14.51 36.75 24.97 1.07 5.48 233.37 Sigmoid 30.96 54.33 517.38 126.14 37.85 124.51 592.82 1483.99 tanh 4.56 0.73 31.47 25.64 3.11 9.60 10.45 85.56 ttr (min) 9.4 13.8 15.7 Table 2: Influence of network parameters N and Ln on training times ttr and final values various loss components (in 10−09) for tanh activation. Network identifier np ttr (min) ∆Ω L ∆c L ∆Γu L ∆Γt L ∆uuu L ∆σσσ L ∆εεε L ∆L N-1 (N = 20, Ln = 5) N-2 (N = 40, Ln = 5) N-3 (N = 20, Ln = 10) N-4 (N = 40, Ln = 10) 22,706 15.7 4.56 0.73 31.47 25.64 3.11 9.60 10.45 85.56 113,530 23.8 2.21 90.39 77.73 59.58 4.29 24.16 78.39 336.75 54,494 18.3 6.89 0.89 12.73 65.42 13.01 17.19 4.67 120.8 272,472 32.3 2.78 3.67 18.78 12.63 24.19 43.10 2.49 107.64 solving elasticity equation in the proposed PINNs framework. 4.2.4 Influence of network complexity: It is worth mentioning that the PINNs approximations are sensitive to network architecture including the depth of the hidden layer and the number of network parameters. In this section, the influence of network architecture parameters, i.e., the number of neurons in each hidden layer N , and the number of hidden layers Ln on the accuracy and the efficiency of the PINNs solution are explored. Since the tanh activation performs the best in terms of accuracy (see previous section), it is chosen as the activation for different networks used in the following experiments. In the current study, four different networks considering the combinations N = 20, 40, and Ln = 5, 10 are tested, and values of different loss components at the end of the training, train- 21 Figure 5: Comparison of (a) total loss ∆Ω of network parameters N and Ln considering tanh activation function. L; (b) constitutive loss ∆Ω L for various combinations ing duration (ttr), along with model complexities in terms of network parameters (np) for these architectures are presented in Table. 2. For fair comparison, Nc = 5, 000 for all experiments. The evolution of the total loss ∆L and the constitutive loss ∆Ω L for these networks are shown in Fig. 5. From the comparisons, for the chosen number of collocation points relatively shallow network N = 20, Ln = 5 provides the best performance in terms of ∆L and ∆Ω L at the end of training. Additionally, the time required for training is faster due to a significantly lower number of network parameters. However, for a relatively deeper network, N = 20, Ln = 10 with increased network complexity, the performance of the model degrades with respect to loss values as shown in Table. 2 possibly due to an increase in variability and reduction in bias. Interestingly, an increase in the number of neurons N = 40 while maintaining the depth of the network (Ln = 5) leads to the worst performance which can be attributed to over-fitting (Bilbao and Bilbao, 2017; Jabbar and Khan, 2015). The epoch evolution of the loss for various network architectures demonstrates the efficacy of a relatively shallow network with signifi- cantly faster training for solving elasticity problems in the proposed PINNs framework. 5. PINNs formulation for linear elastic plate theory : In this section, the PINNs framework is expanded for the solution of the classical Kirchhoff- Love thin plate (Timoshenko and Woinowsky-Krieger, 1959) subjected to a transverse loading in linearly elastic plate theory. In the subsequent section, the Kirchhoff-Love theory has been briefly described; PINNs formulation for solving the governing fourth-order biharmonic partial differential equation (PDE) for the solution of the thin plate is elaborated. For a benchmark problem, the proposed PINNs approach is applied for the solution of a simply supported rect- angular plate under a transverse sinusoidal loading condition. 22 5.1 Kirchhoff-Love thin plate theory : Thin plates are structurally planar elements that have small thickness relative to their in- plane dimensions which can be simplified as a two-dimensional plate problem. According to the Kirchhoff-Love theory, the kinetics of a thin plate under the effect of a distributed trans- verse loading q = q(x, y) can be described by a fourth-order differential equation (Timoshenko and Woinowsky-Krieger, 1959; Reddy, 2006). ∆(D∆w) = q (35) When the elastic plate is bounded in the domain Ω ⊂ R2, Eq. 35 is known as the Kirchhoff- Love equation. In Cartesian coordinates, w = w(x, y) represents the transverse displacement field, D = D(x, y) is the bending stiffness of the plate, and ∆ = ∂2/∂x2 + ∂2/∂y2 is the Laplace operator. Considering a homogeneous and isotropic plate (i.e., D ≡ constant ), Eq. 35 becomes the biharmonic equation (Timoshenko and Woinowsky-Krieger, 1959; Szilard and Nash, 1974) D∆2w = D (cid:18) ∂4w ∂x4 + 2 ∂4w ∂x2∂y2 + ∂4w ∂y4 (cid:19) = q (36) Under appropriate boundary conditions, and with D(x, y) > 0 and q(x, y) ≥ 0, both being known, the problem possesses a unique solution for the displacement w(x, y). The set of solution variables includes the primitive variable deflection w, and the derived quantities, moments Mxx, Myy, Mxy = −Myx, and shearing forces Qxx, Qyy. The expressions for the derived fields are, Mxx = −D (cid:18) ∂2w ∂x2 + ν (cid:19) ∂2w ∂y2 ; Myy = −D (cid:18) ∂2w ∂y2 + ν (cid:19) ∂2w ∂x2 ; Mxy = −D(1 − ν) (cid:18) ∂2w ∂x∂y (cid:19) (37) Qxx = ∂Myx ∂y + ∂Mxx ∂x = −D ∂ ∂x (cid:18) ∂2w ∂x2 + ∂2w ∂y2 (cid:19) ; Qyy = ∂Myy ∂y − ∂Mxy ∂x = −D ∂ ∂y (cid:18) ∂2w ∂x2 + ∂2w ∂y2 (cid:19) (38) 23 Figure 6: PINNs network architecture for solving Kirchhoff-Love thin plate problem governed by biharmonic equation consisting of multi-ANN (NNi ∀ i = 1, k) for each field variables ̃wNN(xxx), ̃MNN yy (xxx) with independent variable xxx = (x, y) as input features. xx (xxx), and ̃QNN xx (xxx), ̃MNN xy (xxx), ̃MNN yy (xxx), ̃QNN 5.2 PINNs formulation for the Biharmonic equation: For solving the Biharmonic equation using the PINNs framework, the input features are the spatial coordinates xxx := (x, y); the field variables, w(xxx), MMM (xxx), and QQQ(xxx) are obtained using multiple densely connected independent ANNs, with each network approximating one of the outputs (Fig. 7). Different field variables approximated by the NNs are as follows: w(xxx) (cid:39) ΞNN w = ̃wNN(xxx) MMM (xxx) (cid:39) ΞNN M = (cid:20) ̃MNN ̃MNN xx (xxx) yx (xxx) ̃MNN ̃MNN xy (xxx) yy (xxx) (cid:21) ; QQQ(xxx) (cid:39) ΞNN QQQ = (cid:20) ̃QNN ̃QNN (cid:21) xx (xxx) yx (xxx) (39) (40) where, ΞNN w , ΞNN MMM , and ΞNN QQQ are the neural network appoximations. From the NN approximations of the fields, the muti-objective loss function ∆L(xxx, θ) can be defined as: ∆L(xxx, θ) = φ ∆Ω L + βu ∆Γu L + βt ∆Γt L + αw ∆w L + αM ∆M L + αQ ∆Q L (41) L, ∆Γu where, ∆Ω L , ∆Γt respectively. Their expressions are, L are the losses in the domain Ω, and along the boundaries Γu and Γt, 24 N Ω c(cid:88) (cid:107)∇2∇2w − ˆq D (cid:107) l=1 N Γu c(cid:88) ∆Ω L = ∆Γu L = ∆Γt L = 1 N Ω c 1 N Γu c 1 N Γt c (cid:107)ΞNN w (xxxk|Γu ) − ̄w(xxxk|Γu)|(cid:107) k=1 N Γt c(cid:88) (cid:107)ΞNN M (xxxj|Γt j=1 ) − ̄M ̄M ̄M (xxxj|Γt)|(cid:107) (42) (43) (44) where, (cid:8)xxx1|Ω, ..., xxxN Ω are the collocation points over c |Ω the domain Ω, and along the boundaries Γu and Γt, respectively; φ ∈ R+ is the penalty c |Γt (cid:9), |Γu , (cid:110) xxx1|Γu, ..., xxxN Γu (cid:110) xxx1|Γt, ..., xxxN Γt (cid:111) (cid:111) c coefficient for imposing the biharmonic relation in Eq. 36. Additionally, data driven estimates of w(xxx), MMM (xxx), and QQQ(xxx) at the collocation points across Ω are used to define ∆L(xxx, θ). ∆w L = ∆M L = ∆Q L = 1 N Ω c 1 N Ω c 1 N Ω c N Ω c(cid:88) (cid:107)ΞNN w (xxxl|Ω) − ˆw(xxxl|Ω)(cid:107) l=1 N Ω c(cid:88) (cid:107)ΞNN M (xxxl|Ω) − ˆMˆMˆM (xxxl|Ω)(cid:107) l=1 N Ω c(cid:88) (cid:107)ΞNN Q (xxx l=1 ) − ˆQˆQˆQ(xxxl|Ω)(cid:107) l|Ω (45) (46) (47) Here, ˆw(xxxl|Ω), ˆMˆMˆM (xxxl|Ω), and ˆQˆQˆQ(xxxl|Ω) are obtained by means of analytical or high-fidelity nu- merical solutions. Note, αi = 1; ∀ i = w, M, Q for data-driven enhancement coupled with physics-informed regression by forcing the PDE constraints in Eqs. 36-38. Whereas, αi = 0 switches off the data-driven enhancement of accuracy of the NN approximations. The loss function in Eq. 41 can either be used for obtaining PINNs approximations of w(xxx), MMM (xxx), and QQQ(xxx) (i.e., forward problem ), or identification of model parameters λ and μ (i.e., inverse problem ). 5.3 Simply supported Kirchhoff-Love plate: A simply supported rectangular plate of size (a×b) under a sinusoidal load q(x, y) = q0 sin πx a sin πy b is considered in Cartesian coordinates as shown in Fig. 7. Here, q0 is the intensity of the load at 25 Figure 7: Benchmark problem setup for Kirchhoff-Love plate: (a, b) simply supported rect- angular plate of a = 200 cm and b = 300 cm with thickness t = 1 cm subjected to transverse sinusoidal loading of intensity q0 = 9.806 × 10−4 MPa; (b) distributions of total collocations points Nc = 10, 000 on the problem domain and various boundaries during PINNs training. the center of the plate. The following boundary conditions are applied at the simply supported (SS) edges: w = 0; w = 0; ∂2w ∂x2 = 0 ∂2w ∂y2 = 0 for x = 0 and x = a for y = 0 and y = b (48) (49) 5.3.1 Analytical solution: Along with the governing equation in Eq. 36 and the bound- ary conditions in Eqs. 48- 49, the analytical solutions of w are obtained as: w = q0 a2 + 1 b2 )2 π4( 1 sin πx a sin πy b (50) Utilizing Eqs. 37-38, analytical solutions for the moments Mxx, Myy, Mxy and the shearing forces, Qxx, Qyy are obtained as: Mxx = Myy = Mxy = Qxx = Qyy = (cid:1)2 (cid:1)2 π2 (cid:0) 1 π2 (cid:0) 1 q0 a2 + 1 b2 q0 a2 + 1 b2 q0(1 − ν) a2 + 1 b2 q0 πa (cid:0) 1 a2 + 1 b2 q0 πa (cid:0) 1 a2 + 1 b2 π2 (cid:0) 1 1 b2 ν b2 (cid:18) 1 a2 + (cid:18) ν a2 + (cid:18) ν a2 + πx a πx a sin sin (cid:19) (cid:19) sin sin πx a πx a sin sin πy b πy b cos πx a cos πy b (cid:19) 1 b2 πy b πy b (51) (52) (53) (54) (55) (cid:1)2 ab (cid:1) cos (cid:1) sin These analytical solutions, w(xxx), MMM (xxx), and QQQ(xxx) have been utilized as ˆw(xxxl|Ω), ˆMˆMˆM (xxxl|Ω), and ˆQˆQˆQ(xxxl|Ω) for data driven enhancement in Eqs. 45-47, respectively for the PINNs approximations of the field variables. 26 5.4 PINNs solutions for the Biharmonic equation: For the benchmark problem, a rectangular plate (a = 200 cm, b = 300 cm) with thickness t = 1 cm is considered with the following material properties: Young's modulus of elasticity E= 202017.03 MPa, Poisson's ratio ν = 0.25, and flexural rigidity D= 17957 N-m. The sinu- soidal load intensity q0 = 9.806 × 10−4 MPa is presribed as shown in Fig. 7. A similar problem has been also solved in the recent work(Vahab et al., 2021). Unless otherwise stated, the total number of randomly distributed collocation points, Nc = 10, 000 is used during the training of the PINNs model. Additionally, a learning rate of 0.001, and a batch size of 50 were prescribed for optimal accuracy and faster convergence of the optimization scheme. For better accuracy during training, the Adam optimization scheme is employed with 1000 epochs. In the present study, three different activation functions were tested (see section 5.4.1). In Fig. 8(a–f), the analytical solution for various fields including plate deflection w, mo- ments Mxx, Myy, Mxy, and shearing forces Qxx, and Qyy in Eqs. 50-55 are shown. Corre- sponding approximations from PINNs for various activation functions are shown in Fig. 8 (a–f) which illustrate the efficacy of the proposed model in terms of accuracy and robustness as excellent agreement with the analytical solutions is evident. 5.4.1 Influence of the activation function: The accuracy of the field variables and epoch evolution of the loss functions are explored for various activation functions for solving the fourth-order biharmonic PDE. To this end, three different activations, i.e., ReLU, sigmoid, and tanh are selected; the network used is defined by N = 20, Ln = 5. The corresponding results are depicted in Fig. 8 (g–l). Based on the results, all the activations perform well as the NN approximations are in good agreement with the analytical solutions both qualitatively and quantitatively. For further insight into the 27 Figure 8: Solution of field variables obtained from (a-f) analytical solutions (left to right): w, Mxx, Myy, Mxy, Qxx, and Qyy ; (g-l) proposed PINNs results (left to right): ̃wNN, ̃MNN xx , ̃MNN xy , ̃MNN yy for activation functions (i) ReLU, (ii) sigmoid, and (iii) tanh. xx , and ̃QNN yy , ̃QNN 28 9 Figure 9: Absolute error of field variables between analytical solution and PINNs results (a) |w − ̃wNN|; (b) |Mxx − ̃MNN xx |; and (f) |Qyy − ̃QNN yy | for activation functions (i) ReLU, (ii) sigmoid, and (iii) tanh. yy |; (d) |Mxy − ̃MNN xx |; (c) |Myy − ̃MNN xy |; (e) |Qxx − ̃QNN Figure 10: Comparison of (a) total loss ∆L; (b) constitutive loss ∆Ω sigmoid and ReLU activation functions for network parameters N = 20, Ln = 5. L during training for tanh, 29 Table 3: Influence of different activation functions on the final values of various loss components (in 10−05) and training times ttr in the proposed PINNs model for solving biharmonic PDE. Activation Function ∆Ω L ∆Γt L ∆Γu L ∆w L ∆M L ∆Q L ∆L ReLU 5.34 132.31 1672.91 278.43 498.76 101.36 2689.11 Sigmoid 63.07 980.67 4601.60 1707.50 987.89 117.56 8458.29 ttr (min) 23.1 25.8 tanh 0.12 7138.43 9807.31 6809.34 397.89 500.37 24653.46 34.6 influence of an activation function on the accuracy of the solutions, the absolute error between the analytical solutions and the PINNs approximations for each field variable is compared for the solutions obtained with different activations in Fig. 9 (a–f). From the comparison, ReLU provides the least absolute error distributions in solving the Biharmonic equation for the simply supported plate. Although, the sigmoid activation provides the best result for |Mxy − ̃MNN xy |, the absolute error for the rest of the fields is higher compared to the solutions obtained with ReLU. Because of the sinusoidal nature of the solution, it was expected that tanh activation might be specifically suitable for this problem. Surprisingly, tanh provides worse results compared to ReLU and sigmoid activations. This can be due to the complex nature of the solution space, where ReLU can provide better adaptability during training. Furthermore, in Fig. 10, the epoch evolution of the total loss ∆Ω L, and constitutive loss ∆Ω L is compared for different activa- tion functions. For a particular epoch, ReLU performs better than the other two activations for ∆L. For ∆Ω L, tanh activation shows better convergence and the lowest loss value at the end of training due to the sinusoidal nature of the solution of the Biharmonic PDE. However, the fluctuations in the loss curve for tanh have a relatively higher variance compared to ReLU and sigmoid. As reported in Table 3, overall, performance in terms of various loss components at the end of training is superior for the ReLU activation for solving the Biharmonic PDE using the proposed PINNs framework. Additionally, the model with the ReLU activation requires the least training time ttr, indicating better convergence and faster computation of the forward and backpropagation steps. 5.4.2 Influence of network parameters: 30 As was found for the linear elasticity problem, PINNs solutions are sensitive to the NN ar- chitecture. Various parameters that influence the NN architectures, the number of neurons in each hidden layer N , and the total number of hidden layers Ln, on the accuracy of the model and the efficiency of training the model have been explored herein. Because of its superior performance for the problem, ReLU is chosen as the activation function. Four different net- works with combinations N = 20, 40, and Ln = 5, 10 were trained. Corresponding network parameters (np), model training time (ttr), and values of different loss components at the end of training have been presented in Table. 4. The comparisons of the absolute error between the analytical solutions and the PINNs approximations for each field are shown in Fig. 11. Comparisons of the total loss ∆L, the constitutive loss ∆Ω parameters, N and Ln are shown in Fig. 12. L for various combinations of network Based on the comparisons shown in Fig. 11, increased network depth improves the accuracy of the PINNs approximations for all variables. Predictions by both networks with Ln = 10 are superior compared to the analytical solutions for the chosen number of collocation points. On the other hand, an increase in the number of neurons in each layer increases model predic- tion variance which is reflected in the higher absolute error comparisons for N = 20, 40 and Ln = 10. Similar conclusions may be drawn based on Fig. 12 and Table. 4. The total and constitutive losses are minimum for N = 40 and Ln = 10 at the end of training. However, the approximations by this model have higher variance. Expectedly, more complex models (higher Ln), or with larger np, require longer training time ttr. For the chosen number of collocation points, Ln = 10 is optimal. 5.4.3 Smart initialization of data-driven enhancement: In this section, we explore the applicability of data-driven enhancement in the proposed PINNs framework to improve the accuracy of the solution. Initially, the network is trained with rel- atively low Nc = 10, 000. The pre-trained model is then trained for the higher number of collocation datasets Nc = 15, 000 and Nc = 20, 000 to further improve the model accuracy. 31 Figure 11: Absolute error of field variables between analytical solution and PINNs results (a) |w − ̃wNN|; (b) |Mxx − ̃MNN xx |; and (f) |Qyy − ̃QNN yy | for various network parameters (i) N = 20, Ln = 5, (ii) N = 40, Ln = 5, (iii) N = 20, Ln = 10, and (iv) N = 40, Ln = 10. yy |; (d) |Mxy − ̃MNN xx |; (c) |Myy − ̃MNN xy |; (e) |Qxx − ̃QNN Figure 12: Comparison of (a) total loss ∆Ω of network parameters N and Ln considering ReLU activation. L; (b) constitutive loss ∆Ω L for various combinations 32 Table 4: various loss components (in 10−05) for tanh activation. Influence of network parameters N and Ln on training times ttr and final values of Network identifier np ttr (min) N-1 (N = 20, Ln = 5) N-2 (N = 40, Ln = 5) 12,940 52,760 N-3 (N = 20, Ln = 10) 32,056 23.1 29.8 31.7 ∆Ω L ∆Γu L ∆Γt L ∆w L ∆M L ∆Q L ∆L 5.34 132.31 1672.91 278.43 498.76 101.36 2689.11 0.47 35.13 467.34 128.38 198.11 40.29 869.72 0.07 82.15 86.84 77.82 298.01 10.17 555.06 N-4 (N = 40, Ln = 10) 126,224 42.8 0.009 0.67 5.12 4.21 0.53 0.17 10.709 L; (b) constitutive loss ∆Ω Influence of smart initialization of data-driven enhancement on (a) total loss Figure 13: ∆Ω L for increasing Nc considering ReLU activation; (c) Absolute error of field variables between analytical solution and PINNs results for (i) Nc = 10, 000, (ii) Nc = 15, 000 TL, and Nc = 20, 000 TL. 33 Table 5: Network parameters, training time, and the component of loss for different smart initialization of data-driven enhancement models. Network identifier Nc Epochs ∆Ω L ∆Γt L ∆Γu L ∆w L ∆M L ∆Q L ∆L ttr (min) N-1 10000 1000 5.34 132.31 1672.91 278.43 498.76 101.36 2689.11 23.1 N-TL1 15000 N-TL2 20000 250 250 0.025 1.31 17.34 0.005 0.71 2.96 1.43 2.01 13.11 2.56 9.89 0.87 43.11 9.11 5.1 7.2 The idea is to speed up the training by utilizing pre-trained weights; the initial states of the PINNs models in the later phases of training are not random anymore. The speed-up is reflected in Figs. 13-(a, b) when the convergence of the loss curves (∆L and ∆Ω L) for the pre- trained models corresponding to Nc = 15, 000 and Nc = 20, 000 are much improved compared to the first training phase with Nc = 10, 000. In Fig. 13-(c), the absolute errors between the approximations and analytical solutions are shown which demonstrate significant improvement of the PINNs approximations with the increase in Nc. Additionally, parameters related to the efficiency of the network training processes with initialization of data-driven enhancement are reported in Tab. 5. The loss terms quickly reduce by orders of magnitude in the second train- ing phase which indicates that for the considered network architecture, Nc = 15000 is possibly optimal. 6. Discussions : In the current study, a generalized PINNs framework for solving problems in linear contin- uum elasticity in the field of solid mechanics is presented. The fundamentals of the PINNs framework involve a construction of the loss function for physics-informed learning of the NNs through the embedding of the linear constraint during training. Following the PINNs philos- ophy to solve the linear elastic problem accurately, a multi-objective loss function has been formulated and implemented. The proposed multi-objective loss function consists of the resid- ual of the governing PDE, various boundary conditions, and data-driven physical knowledge fitting terms. Additionally, weights corresponding to the terms in the loss function dictate 34 the emphasis on satisfying the specific loss terms. To demonstrate the efficacy of the frame- work, the Airy solution to an end-loaded cantilever beam and the Kirchhoff-Love plate theory governed by fourth-order Biharmonic PDE has been solved. The proposed PINNs framework is shown to accurately solve different fields in both problems. Parametric investigations on activation functions and network architectures highlight the scope of improvement in terms of solution accuracy and performance. Data-driven enhancement of the PINNs approximations using analytical solutions significantly boosts accuracy and speed only using minimal network parameters. Therefore, such an approach can be employed to enhance solution accuracy for complex PDEs. Additionally, the applicability of a smart initialization of data-driven en- hancement learning-based approach quickening the training process and also improving model accuracy have been illustrated. Such an approach would be key in achieving computational efficiency beyond conventional computational methods for solving linear continuum elasticity. The proposed PINNs elasticity solvers utilize Tensorflow as the backend which can be easily de- ployed in CPU/ GPU clusters, whereas, conventional algorithms lack such adaptability. Thus, it opens new possibilities for solving complex elasticity problems that have remained unsolved by conventional numerical algorithms in the regime of continuum mechanics. It is however worth noting that exploitation of the computational advantages of the PINNs framework de- pends on various factors including the choice of the network architectures, hyperparameter tuning, sampling techniques (distribution) of collocation points, etc. It has been shown that appropriate combinations of such factors significantly improve the training process and the trained models. In the present study, random sampling of the collocation points has been considered which is simple, yet powerful, that can lead to a significantly better reconstruction of the elastic fields. Importantly, this approach does not increase computational complexity, and it is easy to implement. However, in elastic/elastoplastic PDE problem which exhibits local behavior (e.g., in presence of sharp, or very localized, features) or problems with singularities the performance of PINNs may vary drastically with various sampling procedures (Daw et al., 2022; Leiteritz and Pfl ̈uger, 2021). To overcome such an issue, a failure-informed adaptive enrichment strategy such as failure-informed PINNs (FI-PINNs) can be employed that adopts the failure probability as the posterior error indicator to generate new training points in the failure region (Gao et al., 35 2022). Furthermore, the basic resampling scheme can be further improved with a gradient- based adaptive scheme to relocate the collocation points through a cosine-annealing to areas with higher loss gradient, without increasing the total number of points that demonstrated significant improvement under relatively fewer number of collocation points and sharper forcing function (Subramanian et al., 2022). In addition, the evolutionary sampling (Evo) method (Daw et al., 2022) that can incrementally accumulate collocation points in regions of high PDE residuals can be an efficient choice for solving various time-dependent PDEs with little to no computational overhead. Instead of using a random approach such as Latin Hypercube sampling, in the future, different deterministic and pseudo-random sampling strategies such as Sparse Grid sampling or Sobol Sequences can be employed to further improve the performance of the model. Furthermore, it is critical to obtain the statics of saturation along different parts of the solution domain during the training of DNNs (Glorot and Bengio, 2010; Rakitianskaia and Engelbrecht, 2015b). The saturation occurs when the hidden units of a DNN predominantly output values close to the asymptotic ends of the activation function range which reduces the particular PINNs model to a binary state, thus limiting the overall information capacity of the NN (Rakitianskaia and Engelbrecht, 2015a; Bai et al., 2019). The saturated units can make gradient descent learning slow and inefficient due to small derivative values near the asymptotes which can hinder the training PINNs efficiently (Bai et al., 2019). Thus, in the future, NN saturation can be studied quantitatively in relation to the ability of NNs to learn, generalize, and the degree of regression accuracy. In addition, various weighting coefficients of the loss terms in Eq. 8 and implementation of second-order optimization techniques (Tan and Lim, 2019) can accelerate the training significantly. Based on the performance of the PINNs framework herein, further studies quantifying the computational gains of the PINNs approach compared to conventional numerical methods are in order. The proposed approach can be extended to the solution in various computational mechanics problems such as soil plastic- ity (Chen and Baladi, 1985; Bousshine et al., 2001), strain-gradient plasticity (Guha et al., 2013, 2014), composite modeling (Roy, 2021c) etc. Furthermore, the present model can be employed to predict microstructure evolution in Phase-field (PF) approach including various solid-solid phase transitions (PTs) (Levitas et al., 2013; Levitas and Roy, 2015; Roy, 2020c,a,b), solid-solid PT via intermediate melting (Levitas and Roy, 2016; Roy, 2021a,f,e,d,b, 2022d), etc. 36 7. Conclusions : Summarizing, the current work presents a deep learning framework based on the fundamen- tals of PINNs theory for the solution of linear elasticity problems in continuum mechanics. A multi-objective loss function is proposed for the linear elastic solid problems that include gov- erning PDE, Dirichlet, and Neumann boundary conditions across randomly chosen collocation points in the problem domain. Multiple deep network models trained to predict different fields result in a more accurate representation. Traditional ML/ DL approaches that only rely on fit- ting a model that establishes complex, high-dimensional, non-linear relationships between the input features and outputs, are unable to incorporate rich information available through gov- erning equations/ physics-based mathematical modeling of physical phenomena. Conventional computational techniques on the other hand rely completely on such physical information for prediction. The PINNs approach combines the benefits of the DL techniques in the extraction of complex relations from data with the advantages of the conventional numerical techniques for physical modeling. The proposed method may be extended to nonlinear elasticity, vis- coplasticity, elastoplasticity, and various other mechanics and material science problems. The present work builds a solid foundation for new promising avenues for future work in machine learning applications in solid mechanics. Acknowledgements: The support of the Aeronautical Research and Development Board (Grant No. DARO/08/1051450/M/I) is gratefully acknowledged. Competing interests: The author declares no competing interests. References Arora, R., Kakkar, P., Dey, B., and Chakraborty, A. (2022). Physics-informed neural networks for modeling rate-and temperature-dependent plasticity. arXiv preprint arXiv:2201.08363. Atkin, R. J. and Fox, N. (2005). An introduction to the theory of elasticity. Courier Corporation. 37 Bai, W., Zhou, Q., Li, T., and Li, H. (2019). Adaptive reinforcement learning neural net- work control for uncertain nonlinear system with input saturation. IEEE transactions on cybernetics, 50(8):3433–3443. Batra, R., Song, L., and Ramprasad, R. (2021). Emerging materials intelligence ecosystems propelled by machine learning. Nature Reviews Materials, 6(8):655–678. Baydin, A. G., Pearlmutter, B. A., Radul, A. A., and Siskind, J. M. (2018). Automatic differentiation in machine learning: a survey. Journal of machine learning research, 18. Bekar, A. C., Madenci, E., Haghighat, E., Waheed, U. b., and Alkhalifah, T. (2022). Solving the eikonal equation for compressional and shear waves in anisotropic media using peridynamic differential operator. Geophysical Journal International, 229(3):1942–1963. Bergen, K. J., Johnson, P. A., Maarten, V., and Beroza, G. C. (2019). Machine learning for data-driven discovery in solid earth geoscience. Science, 363(6433). Bilbao, I. and Bilbao, J. (2017). Overfitting problem and the over-training in the era of data: Particularly for artificial neural networks. In 2017 eighth international conference on intelligent computing and information systems (ICICIS), pages 173–177. IEEE. bin Waheed, U., Alkhalifah, T., Haghighat, E., and Song, C. (2022). A holistic approach to computing first-arrival traveltimes using neural networks. In Advances in Subsurface Data Analytics, pages 251–278. Elsevier. bin Waheed, U., Haghighat, E., Alkhalifah, T., Song, C., and Hao, Q. (2021). Pinneik: Eikonal solution using physics-informed neural networks. Computers & Geosciences, 155:104833. Bose, R. and Roy, A. (2022). Accurate deep learning sub-grid scale models for large eddy simulations. Bulletin of the American Physical Society. Bousshine, L., Chaaba, A., and De Saxce, G. (2001). Softening in stress–strain curve for drucker–prager non-associated plasticity. International Journal of Plasticity, 17(1):21–46. Bower, A. F. (2009). Applied mechanics of solids. CRC press. Boyd, J. P. (2001). Chebyshev and Fourier spectral methods. Courier Corporation. 38 Brunton, S. L., Noack, B. R., and Koumoutsakos, P. (2020). Machine learning for fluid me- chanics. Annual Review of Fluid Mechanics, 52:477–508. Butler, K. T., Davies, D. W., Cartwright, H., Isayev, O., and Walsh, A. (2018). Machine learning for molecular and materials science. Nature, 559(7715):547–555. Cai, S., Wang, Z., Wang, S., Perdikaris, P., and Karniadakis, G. E. (2021). Physics-informed neural networks for heat transfer problems. Journal of Heat Transfer, 143(6). Chandio, A., Gui, G., Kumar, T., Ullah, I., Ranjbarzadeh, R., Roy, A. M., Hussain, A., and Shen, Y. (2022). Precise single-stage detector. arXiv preprint arXiv:2210.04252. Chen, W.-F. and Baladi, G. Y. (1985). Soil plasticity: theory and implementation. Elsevier. Ching, T., Himmelstein, D. S., Beaulieu-Jones, B. K., Kalinin, A. A., Do, B. T., Way, G. P., Ferrero, E., Agapow, P.-M., Zietz, M., Hoffman, M. M., et al. (2018). Opportunities and obstacles for deep learning in biology and medicine. Journal of The Royal Society Interface, 15(141):20170387. Chollet, F. et al. (2015). keras. Dana, S. and Wheeler, M. F. (2020). A machine learning accelerated fe homogenization algo- rithm for elastic solids. arXiv preprint arXiv:2003.11372. Daw, A., Bu, J., Wang, S., Perdikaris, P., and Karpatne, A. (2022). Rethinking the importance of sampling in physics-informed neural networks. arXiv preprint arXiv:2207.02338. De Ryck, T., Jagtap, A. D., and Mishra, S. (2022). Error estimates for physics informed neural networks approximating the navier-stokes equations. arXiv preprint arXiv:2203.09346. DeVries, P. M., Vi ́egas, F., Wattenberg, M., and Meade, B. J. (2018). Deep learning of aftershock patterns following large earthquakes. Nature, 560(7720):632–634. Du, Y. and Zaki, T. A. (2021). Evolutional deep neural network. Phys. Rev. E, 104:045303. Frankel, A., Tachida, K., and Jones, R. (2020). Prediction of the evolution of the stress field of polycrystals undergoing elastic-plastic deformation with a hybrid neural network model. Machine Learning: Science and Technology, 1(3):035005. 39 Gao, Z., Yan, L., and Zhou, T. (2022). Failure-informed adaptive sampling for pinns. arXiv preprint arXiv:2210.00279. Glorot, X. and Bengio, Y. (2010). Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intel- ligence and statistics, pages 249–256. JMLR Workshop and Conference Proceedings. Glowacz, A. (2021). Fault diagnosis of electric impact drills using thermal imaging. Measure- ment, 171:108815. Glowacz, A. (2022). Thermographic fault diagnosis of shaft of bldc motor. Sensors, 22(21):8537. Goswami, S., Anitescu, C., Chakraborty, S., and Rabczuk, T. (2020). Transfer learning en- hanced physics informed neural network for phase-field modeling of fracture. Theoretical and Applied Fracture Mechanics, 106:102447. Goswami, S., Yin, M., Yu, Y., and Karniadakis, G. E. (2022). A physics-informed variational deeponet for predicting crack path in quasi-brittle materials. Computer Methods in Applied Mechanics and Engineering, 391:114587. Guha, S., Sangal, S., and Basu, S. (2013). Finite element studies on indentation size effect using a higher order strain gradient theory. International Journal of Solids and Structures, 50(6):863–875. Guha, S., Sangal, S., and Basu, S. (2014). On the fracture of small samples under higher order strain gradient plasticity. International Journal of Fracture, 187(2):213–226. Guo, M. and Haghighat, E. (2020). An energy-based error bound of physics-informed neural network solutions in elasticity. arXiv preprint arXiv:2010.09088. Guo, X., Liu, X., Kr ́olczyk, G., Sulowicz, M., Glowacz, A., Gardoni, P., and Li, Z. (2022). Damage detection for conveyor belt surface based on conditional cycle generative adversarial network. Sensors, 22(9):3485. Haghighat, E., Amini, D., and Juanes, R. (2022). Physics-informed neural network simulation of multiphase poroelasticity using stress-split sequential training. Computer Methods in Applied Mechanics and Engineering, 397:115141. 40 Haghighat, E., Bekar, A. C., Madenci, E., and Juanes, R. (2021a). A nonlocal physics-informed deep learning framework using the peridynamic differential operator. Computer Methods in Applied Mechanics and Engineering, 385:114012. Haghighat, E. and Juanes, R. (2021). Sciann: A keras/tensorflow wrapper for scientific com- putations and physics-informed deep learning using artificial neural networks. Computer Methods in Applied Mechanics and Engineering, 373:113552. Haghighat, E., Raissi, M., Moure, A., Gomez, H., and Juanes, R. (2020). A deep learning framework for solution and discovery in solid mechanics. arXiv preprint arXiv:2003.02751. Haghighat, E., Raissi, M., Moure, A., Gomez, H., and Juanes, R. (2021b). A physics-informed deep learning framework for inversion and surrogate modeling in solid mechanics. Computer Methods in Applied Mechanics and Engineering, 379:113741. Hu, Z., Jagtap, A. D., Karniadakis, G. E., and Kawaguchi, K. (2021). When do ex- tended physics-informed neural networks (xpinns) improve generalization? arXiv preprint arXiv:2109.09444. Irfan, M., Iftikhar, M. A., Yasin, S., Draz, U., Ali, T., Hussain, S., Bukhari, S., Alwadie, A. S., Rahman, S., Glowacz, A., et al. (2021). Role of hybrid deep neural networks (hdnns), computed tomography, and chest x-rays for the detection of covid-19. International Journal of Environmental Research and Public Health, 18(6):3056. Jabbar, H. and Khan, R. Z. (2015). Methods to avoid over-fitting and under-fitting in su- pervised machine learning (comparative study). Computer Science, Communication and Instrumentation Devices, 70. Jagtap, A. D. and Karniadakis, G. E. (2021). Extended physics-informed neural networks (xpinns): A generalized space-time domain decomposition based deep learning framework for nonlinear partial differential equations. In AAAI Spring Symposium: MLPS. Jagtap, A. D., Kharazmi, E., and Karniadakis, G. E. (2020). Conservative physics-informed neural networks on discrete domains for conservation laws: Applications to forward and inverse problems. Computer Methods in Applied Mechanics and Engineering, 365:113028. 41 Jagtap, A. D., Mao, Z., Adams, N., and Karniadakis, G. E. (2022). Physics-informed neural networks for inverse problems in supersonic flows. arXiv preprint arXiv:2202.11821. Jahanbakht, M., Xiang, W., and Azghadi, M. R. (2022). Sediment prediction in the great barrier reef using vision transformer with finite element analysis. Neural Networks, 152:311– 321. Jamil, S., Abbas, M. S., and Roy, A. M. (2022). Distinguishing malicious drones using vision transformer. AI, 3(2):260–273. Jin, X., Cai, S., Li, H., and Karniadakis, G. E. (2021). Nsfnets (navier-stokes flow nets): Physics-informed neural networks for the incompressible navier-stokes equations. Journal of Computational Physics, 426:109951. Karniadakis, G. E., Kevrekidis, I. G., Lu, L., Perdikaris, P., Wang, S., and Yang, L. (2021). Physics-informed machine learning. Nature Reviews Physics, 3(6):422–440. Khan, W., Kumar, T., Cheng, Z., Raj, K., Roy, A. M., and Luo, B. (2022a). Sql and nosql databases software architectures performance analysis and assessments–a systematic litera- ture review. arXiv preprint arXiv:2209.06977. Khan, W., Raj, K., Kumar, T., Roy, A. M., and Luo, B. (2022b). Introducing urdu digits dataset with demonstration of an efficient and robust noisy decoder-based pseudo example generator. Symmetry, 14(10):1976. Krishnapriyan, A., Gholami, A., Zhe, S., Kirby, R., and Mahoney, M. W. (2021). Charac- terizing possible failure modes in physics-informed neural networks. Advances in Neural Information Processing Systems, 34. Kutz, J. N. (2017). Deep learning in fluid dynamics. Journal of Fluid Mechanics, 814:1–4. Lagaris, I. E., Likas, A., and Fotiadis, D. I. (1998). Artificial neural networks for solving ordinary and partial differential equations. IEEE transactions on neural networks, 9(5):987– 1000. LeCun, Y., Bengio, Y., and Hinton, G. (2015). Deep learning. nature, 521(7553):436–444. 42 Leiteritz, R. and Pfl ̈uger, D. (2021). How to avoid trivial solutions in physics-informed neural networks. arXiv preprint arXiv:2112.05620. Levitas, V. I. and Roy, A. M. (2015). Multiphase phase field theory for temperature-and stress-induced phase transformations. Physical Review B, 91(17):174109. Levitas, V. I. and Roy, A. M. (2016). Multiphase phase field theory for temperature-induced phase transformations: Formulation and application to interfacial phases. Acta Materialia, 105:244–257. Levitas, V. I., Roy, A. M., and Preston, D. L. (2013). Multiple twinning and variant-variant transformations in martensite: phase-field approach. Physical Review B, 88(5):054113. Ling, J., Kurzawski, A., and Templeton, J. (2016). Reynolds averaged turbulence modelling using deep neural networks with embedded invariance. Journal of Fluid Mechanics, 807:155– 166. Lou, Q., Meng, X., and Karniadakis, G. E. (2021). Physics-informed neural networks for solving forward and inverse flow problems via the boltzmann-bgk formulation. Journal of Computational Physics, 447:110676. Lurie, A. I. (2010). Theory of elasticity. Springer Science & Business Media. M ̈a ̈att ̈a, J., Bazaliy, V., Kimari, J., Djurabekova, F., Nordlund, K., and Roos, T. (2021). Gradient-based training and pruning of radial basis function networks with an application in materials physics. Neural Networks, 133:123–131. Marsden, J. E. and Hughes, T. J. (1994). Mathematical foundations of elasticity. Courier Corporation. McClenny, L. and Braga-Neto, U. (2020). Self-adaptive physics-informed neural networks using a soft attention mechanism. arXiv preprint arXiv:2009.04544. Racca, A. and Magri, L. (2021). Robust optimization and validation of echo state networks for learning chaotic dynamics. Neural Networks, 142:252–268. 43 Raissi, M. and Karniadakis, G. E. (2018). Hidden physics models: Machine learning of non- linear partial differential equations. Journal of Computational Physics, 357:125–141. Raissi, M., Perdikaris, P., and Karniadakis, G. E. (2019). Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics, 378:686–707. Raissi, M., Yazdani, A., and Karniadakis, G. E. (2020). Hidden fluid mechanics: Learning velocity and pressure fields from flow visualizations. Science, 367(6481):1026–1030. Rakitianskaia, A. and Engelbrecht, A. (2015a). Measuring saturation in neural networks. In 2015 IEEE symposium series on computational intelligence, pages 1423–1430. IEEE. Rakitianskaia, A. and Engelbrecht, A. (2015b). Saturation in pso neural network training: Good or evil? In 2015 IEEE Congress on Evolutionary Computation (CEC), pages 125– 132. IEEE. Ramprasad, R., Batra, R., Pilania, G., Mannodi-Kanakkithodi, A., and Kim, C. (2017). Ma- chine learning in materials informatics: recent applications and prospects. npj Computational Materials, 3(1):1–13. Rao, C., Sun, H., and Liu, Y. (2021). Physics-informed deep learning for computational elastodynamics without labeled data. Journal of Engineering Mechanics, 147(8):04021043. Rawat, W. and Wang, Z. (2017). Deep convolutional neural networks for image classification: A comprehensive review. Neural computation, 29(9):2352–2449. Reddy, J. N. (2006). Theory and analysis of elastic plates and shells. CRC press. Rezaei, S., Harandi, A., Moeineddin, A., Xu, B.-X., and Reese, S. (2022). A mixed formu- lation for physics-informed neural networks as a potential solver for engineering problems in heterogeneous domains: comparison with finite element method. Computer Methods in Applied Mechanics and Engineering, 401:115616. Roy, A. M. (2020a). Effects of interfacial stress in phase field approach for martensitic phase transformation in nial shape memory alloys. Applied Physics A, 126(7):1–12. 44 Roy, A. M. (2020b). Evolution of martensitic nanostructure in nial alloys: tip splitting and bending. Material Science Research India (Online), 17(special 1):03–06. Roy, A. M. (2020c). Influence of interfacial stress on microstructural evolution in nial alloys. JETP Letters, 112(3):173–179. Roy, A. M. (2021a). Barrierless melt nucleation at solid-solid interface in energetic nitramine octahydro-1, 3, 5, 7-tetranitro-1, 3, 5, 7-tetrazocine. Materialia, 15:101000. Roy, A. M. (2021b). Energetics and kinematics of undercooled nonequilibrium interfacial molten layer in cyclotetramethylene-tetranitramine crystal. Physica B: Condensed Matter, 615:412986. Roy, A. M. (2021c). Finite element framework for efficient design of three dimensional multi- component composite helicopter rotor blade system. Eng, 2(1):69–79. Roy, A. M. (2021d). Formation and stability of nanosized, undercooled propagating inter- mediate melt during β→ δ phase transformation in hmx nanocrystal. Europhysics Letters, 133(5):56001. Roy, A. M. (2021e). Influence of nanoscale parameters on solid–solid phase transformation in octogen crystal: Multiple solution and temperature effect. JETP Letters, 113(4):265–272. Roy, A. M. (2021f). Multiphase phase-field approach for solid–solid phase transformations via propagating interfacial phase in hmx. Journal of Applied Physics, 129(2):025103. Roy, A. M. (2022a). Adaptive transfer learning-based multiscale feature fused deep convolu- tional neural network for eeg mi multiclassification in brain–computer interface. Engineering Applications of Artificial Intelligence, 116:105347. Roy, A. M. (2022b). An efficient multi-scale CNN model with intrinsic feature integration for motor imagery EEG subject classification in brain-machine interfaces. Biomedical Signal Processing and Control, 74:103496. Roy, A. M. (2022c). A multi-scale fusion cnn model based on adaptive transfer learning for multi-class mi-classification in bci system. BioRxiv. 45 Roy, A. M. (2022d). Multiphase phase-field approach for virtual melting: a brief review. Roy AM Multiphase Phase-Field Approach for Virtual Melting: A Brief Review. Mat. Sci. Res. India, 18(2). Roy, A. M. and Bhaduri, J. (2021). A deep learning enabled multi-class plant disease detection model based on computer vision. AI, 2(3):413–428. Roy, A. M. and Bhaduri, J. (2022). Real-time growth stage detection model for high degree of occultation using densenet-fused YOLOv4. Computers and Electronics in Agriculture, 193:106694. Roy, A. M., Bhaduri, J., Kumar, T., and Raj, K. (2022a). A computer vision-based object localization model for endangered wildlife detection. Ecological Economics, Forthcoming. Roy, A. M., Bhaduri, J., Kumar, T., and Raj, K. (2022b). Wildect-yolo: An efficient and robust computer vision-based accurate object localization model for automated endangered wildlife detection. Ecological Informatics, page 101919. Roy, A. M., Bose, R., and Bhaduri, J. (2022c). A fast accurate fine-grain object detection model based on YOLOv4 deep neural network. Neural Computing and Applications, pages 1–27. Roy, A. M. and Guha, S. (2022). Elastoplastic physics-informed deep learning approach for j2 plasticity. Available at SSRN 4332254. Saha, P., Dash, S., and Mukhopadhyay, S. (2021). Physics-incorporated convolutional recur- rent neural networks for source identification and forecasting of dynamical systems. Neural Networks, 144:359–371. Samaniego, E., Anitescu, C., Goswami, S., Nguyen-Thanh, V. M., Guo, H., Hamdia, K., Zhuang, X., and Rabczuk, T. (2020). An energy approach to the solution of partial differen- tial equations in computational mechanics via machine learning: Concepts, implementation and applications. Computer Methods in Applied Mechanics and Engineering, 362:112790. Sengupta, T. (2013). High accuracy computing methods: fluid flows and wave phenomena. Cambridge University Press. 46 Shukla, K., Jagtap, A. D., Blackshire, J. L., Sparkman, D., and Karniadakis, G. E. (2021). A physics-informed neural network for quantifying the microstructural properties of poly- crystalline nickel using ultrasound data: A promising approach for solving inverse problems. IEEE Signal Processing Magazine, 39(1):68–77. Singh, A., Raj, K., Kumar, T., Verma, S., and Roy, A. M. (2023a). Deep learning-based cost-effective and responsive robot for autism treatment. Drones, 7(2):81. Singh, A., Ranjbarzadeh, R., Raj, K., Kumar, T., and Roy, A. M. (2023b). Understanding eeg signals for subject-wise definition of armoni activities. arXiv preprint arXiv:2301.00948. Sirignano, J. and Spiliopoulos, K. (2018). Dgm: A deep learning algorithm for solving partial differential equations. Journal of computational physics, 375:1339–1364. Subramanian, S., Kirby, R. M., Mahoney, M. W., and Gholami, A. (2022). Adap- tive self-supervision algorithms for physics-informed neural networks. arXiv preprint arXiv:2207.04084. Sun, L., Gao, H., Pan, S., and Wang, J.-X. (2020). Surrogate modeling for fluid flows based on physics-constrained deep learning without simulation data. Computer Methods in Applied Mechanics and Engineering, 361:112732. Szilard, R. and Nash, W. (1974). Theory and analysis of plates, classical and numberical methods. Tan, H. H. and Lim, K. H. (2019). Review of second-order optimization techniques in ar- tificial neural networks backpropagation. In IOP conference series: materials science and engineering, volume 495, page 012003. IOP Publishing. Tartakovsky, A. M., Marrero, C. O., Perdikaris, P., Tartakovsky, G. D., and Barajas-Solano, D. (2018). Learning parameters and constitutive relationships with physics informed deep neural networks. arXiv preprint arXiv:1808.03398. Timoshenko, S. (1970). Theory of elastic stability 2e. Tata McGraw-Hill Education. Timoshenko, S. and Woinowsky-Krieger, S. (1959). Theory of plates and shells. 47 Vahab, M., Haghighat, E., Khaleghi, M., and Khalili, N. (2021). A physics-informed neural network approach to solution and identification of biharmonic equations of elasticity. Journal of Engineering Mechanics, 148(2):04021154. von Rueden, L., Mayer, S., Beckh, K., Georgiev, B., Giesselbach, S., Heese, R., Kirsch, B., Pfrommer, J., Pick, A., Ramamurthy, R., et al. (2019). Informed machine learning– a taxonomy and survey of integrating knowledge into learning systems. arXiv preprint arXiv:1903.12394. Voulodimos, A., Doulamis, N., Doulamis, A., and Protopapadakis, E. (2018). Deep learning for computer vision: A brief review. Computational intelligence and neuroscience, 2018. Waheed, U., Haghighat, E., Alkhalifah, T., Song, C., and Hao, Q. (2020). Eikonal solution using physics-informed neural networks. In EAGE 2020 Annual Conference & Exhibition Online, volume 2020, pages 1–5. European Association of Geoscientists & Engineers. Xu, K., Huang, D. Z., and Darve, E. (2021). Learning constitutive relations using symmetric positive definite neural networks. Journal of Computational Physics, 428:110072. Zhang, E., Dao, M., Karniadakis, G. E., and Suresh, S. (2022). Analyses of internal struc- tures and defects in materials using physics-informed neural networks. Science advances, 8(7):eabk0644. Zhang, E., Yin, M., and Karniadakis, G. E. (2020). Physics-informed neural networks for non- homogeneous material identification in elasticity imaging. arXiv preprint arXiv:2009.04525. Zhao, Z.-Q., Zheng, P., Xu, S.-t., and Wu, X. (2019). Object detection with deep learning: A review. IEEE transactions on neural networks and learning systems, 30(11):3212–3232. Zhu, Q., Liu, Z., and Yan, J. (2021). Machine learning for metal additive manufacturing: predicting temperature and melt pool fluid dynamics using physics-informed neural networks. Computational Mechanics, 67(2):619–635. Zienkiewicz, O. C. and Taylor, R. L. (2005). The finite element method for solid and structural mechanics. Elsevier.
http://arxiv.org/abs/2302.11554v1
2023-02-19T20:33:24
2023-02-19T20:33:24
Greedy Discovery of Ordinal Factors
In large datasets, it is hard to discover and analyze structure. It is thus common to introduce tags or keywords for the items. In applications, such datasets are then filtered based on these tags. Still, even medium-sized datasets with a few tags result in complex and for humans hard-to-navigate systems. In this work, we adopt the method of ordinal factor analysis to address this problem. An ordinal factor arranges a subset of the tags in a linear order based on their underlying structure. A complete ordinal factorization, which consists of such ordinal factors, precisely represents the original dataset. Based on such an ordinal factorization, we provide a way to discover and explain relationships between different items and attributes in the dataset. However, computing even just one ordinal factor of high cardinality is computationally complex. We thus propose the greedy algorithm in this work. This algorithm extracts ordinal factors using already existing fast algorithms developed in formal concept analysis. Then, we leverage to propose a comprehensive way to discover relationships in the dataset. We furthermore introduce a distance measure based on the representation emerging from the ordinal factorization to discover similar items. To evaluate the method, we conduct a case study on different datasets.
[ "Dominik Dürrschnabel", "Gerd Stumme" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11554v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11554v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.LO", "68T30, 03G10", "I.2.6" ]
Greedy Discovery of Ordinal Factors Dominik D ̈urrschnabel Knowledge and Data Engineering Group and Interdisciplinary Research Center for Information System Design University of Kassel Kassel, Germany [email protected] ORCID: 0000-0002-0855-4185 Gerd Stumme Knowledge and Data Engineering Group and Interdisciplinary Research Center for Information System Design University of Kassel Kassel, Germany [email protected] ORCID: 0000-0002-0570-7908 3 2 0 2 b e F 9 1 ] G L . s c [ 1 v 4 5 5 1 1 . 2 0 3 2 : v i X r a Abstract-In large datasets, it is hard to discover and analyze structure. It is thus common to introduce tags or keywords for the items. In applications, such datasets are then filtered based on these tags. Still, even medium-sized datasets with a few tags result in complex and for humans hard-to-navigate systems. In this work, we adopt the method of ordinal factor analysis to address this problem. An ordinal factor arranges a subset of the tags in a linear order based on their underlying structure. A complete ordinal factorization, which consists of such ordinal factors, precisely represents the original dataset. Based on such an ordinal factorization, we provide a way to discover and explain relationships between different items and attributes in the dataset. However, computing even just one ordinal factor of high cardinality is computationally complex. We thus propose the greedy algorithm ORDIFIND in this work. This algorithm extracts ordinal factors using already existing fast algorithms developed in formal concept analysis. Then, we leverage ORDIFIND to propose a comprehensive way to discover relationships in the dataset. We furthermore introduce a distance measure based on the representation emerging from the ordinal factorization to discover similar items. To evaluate the method, we conduct a case study on different datasets. Index Terms-Ordinal Factor Analysis, Ordinal Data Science, Concept Lattice I. INTRODUCTION A binary dataset consists of an object set and an attribute set together with an incidence relation. Items with tags, keywords, or categories are an example of such binary datasets where the items are the objects, and the tags are the attributes. Typical examples of tagged data are movies or songs with category or genre tags. Furthermore, keywords in articles such as blog posts or scientific works are also tagged datasets. Another example of such data would be researchers publish- ing at different conferences. Understanding relationships and extracting knowledge from such datasets based on these tags or keywords quickly becomes an impossible task, while on the other hand being a necessity. Thus, providing systems that allow extracting explanations and discover relationships in such data is an important research task. A common way to tackle this task is to treat the binary attributes as numerical, where the value 1 is assigned to an object if it has the attribute and 0 otherwise. Then, methods from the classical toolkit of dimensionality reduction, such as principal component analysis, are applied. These approaches merge the different tags into a few axes while weighting the attributes in each axis. An emerging axis thus yields infor- mation about the presence or absence of correlated features in the original dataset. Then, each object is assigned a real- valued number in each axis to represent whether this item has its attributes. As a single axis represents multiple merged attributes, the resulting placement of objects with only a part of attributes yields an ambiguous representation. Because of this, the main issues of this method arise. Assigning a real value to an object is not consistent with the level of measurement of the underlying binary data. The assigned value promotes the perception that an element has, compared to others, a stronger bond to some attributes, which is impossible. Thus, a method that encourages such comparisons and results in such an inaccurate representation of the original information is, in our opinion, not valid. An example of such a PCA projection is on the right side of Figure 1. To tackle this problem, Ganter and Glodeanu propose in [1] the ordinal factor analysis, a method that does not use real- valued measurement on the binary attributes. The main idea is to condense multiple attributes into a single factor, similar to principal component analysis. The projection consists of linear orders of attributes, the so-called ordinal factors. Then, the method assigns each object, based on its attributes, a position in every factor. Compared to the PCA approach, the positions assigned in the process are natural numbers instead of real-valued ones. Thus, the resulting projection does not express inaccurate or even incorrect information. A complete ordinal factorization furthermore allows deducing all original information. Similar to the PCA projection, there is a visualization method for small datasets. Thereby one places each object in a two-dimensional coordinate system at the last position for each axis such that it has all attributes until this position. Figure 1 compares such a visualization to a PCA-projection. The main advantage of the ordinal factor plot compared to the principal component analysis is that all its information is guaranteed to be correct. For example, Facebook and Instagram both have ads and are USA-based, which is depicted in the vertical axis. On the other hand, the principal component analysis projection gives the impression Telegram WhatsApp WeChat Snapchat group messages  mobile first  timeline private messages  Twitter Reddit Reddit YouTube premium YouTube ads Facebook Snapchat Instagram ads stories timeline TikTok Twitter Instagram Facebook private messages group messages mobile first USA-based premium private USA-based WhatsApp TikTok, WeChat Telegram U S A-based tim eline ads stories first 0 m essages m obile 0 m essages group Fig. 1. Left: A 2-dimensional embedding of the objects using principal component analysis. Right: An ordinal factorization restricted to the two largest factors for improved readability. All incidences can be deduced from the right projection except: (TikTok, timeline), (Whatsapp, stories), (Facebook, timeline), (YouTube, stories), (Facebook, stories). The ordinal projection does not contain false data. that Instagram has more ads than Snapchat and both of them are not USA-based, which are both false claims. However, Ganter and Glodeanu neither provide a method for the computation of ordinal factorizations nor does the visual- ization method transfer to larger datasets. Yet, in our opinion, this method is especially suited to handle larger datasets. Still, for those, neither a method to compute the factorizations nor a visualization method exists so far. Furthermore, for the application of the method, it is still necessary to demonstrate how to use it to discover and explain structure in such large datasets. Here is the point where we step in with our present work. We propose ORDIFIND, a greedy algorithm to compute a complete ordinal factorization of a dataset leveraging fast algorithms from formal concept analysis. Furthermore, we extend the existing theory of ordinal factor analysis into a tool to explain relationships in large binary datasets. Then we demonstrate how to discover knowledge in them using ordinal factor analysis by investigating different datasets. Thus, our research question condenses to the following: Is it possible to compute ordinal factorizations of large datasets and use them to discover relationships in the data? II. RELATED WORK We discuss work related to our topic in three different domains. First, we discuss general tagging systems that gen- erate binary data. Then, we consider methods that represent attributes in a low number of dimensions. In the final section, we discuss work done in formal concept analysis, which is the realm in which our work is positioned. A. Tagging, Categories and Keywords In the modern world, data often appear in large, unorganized chunks. Thus, tags, categories, or keywords are assigned to items to tackle the problem of the sheer amount of data. These allow the items to be filtered. The transition between those concepts is seamless, as they are often used interchangeably. Frequently, a community defines the tags on the items, which is a process commonly referred to as social tagging. An extensive survey on social tagging techniques is published in [2]. [3] is a study examining the reasons behind tagging. In [4], various types of tags created by users are analyzed and compared. A method to automatically extract topics from a paper corpus is described in [5] The automatic annotation of images in the domain of computer vision is explored in [6]. B. Methods to Embed (Binary) Data The two main reasons for the research of embedding high dimensional data into a lower number of dimensions are the following. First, embeddings are applied to escape the so- called curse of dimensionality [7], which is a phenomenon that causes distances to become less meaningful in higher dimensional spaces. Secondly, it provides a way to better visualize [8] complex data, as humans are better adapted to understand relationships in lower-dimensional spaces. For an extensive survey on dimensional reduction methods, we refer the reader to [9]. A commonly applied approach for embedding high dimensional data into lower dimensions is the principal component analysis [10], which is a method that minimizes the average squared distances from the data points to a line. It is often confused [11] with exploratory factor analysis [12], a technique that allows exploring a dataset by reconstructing underlying factors. C. Factor Analysis in Formal Concept Analysis Formal concept analysis is a research field of mathematical data analysis introduced by Wille in 1982 [13]. For a com- prehensive overview of the theory and foundations of formal concept analysis, we refer the reader to [14]. The canonical way to depict information in formal concept analysis is the concept lattice. Still, some approaches arrange data differently to make it more accessible. One of them is the Boolean factor analysis, which was developed in [15]–[19]. In [1] introduces the ordinal factor analysis. Applications of the method are demonstrated in [20] where it is applied to some smaller medical datasets. In [21] the theory is lifted to the case of triadic incidence relations and in [22] into the setting of fuzzy formal contexts. III. BASICS FOR ORDINAL FACTOR ANALYSIS As formal concept analysis is the realm of ordinal factor analysis, we start this section with a brief introduction to FCA. Then, we introduce the Boolean factor analysis, which gives rise to the ordinal factor analysis. The running example that we use to explain the theory of this section is the dataset in Figure 2 about different features and attributes of various social media platforms. A. Formal Concept Analysis The notations used in this work are the standard ones notations adapted from [14]. A formal context is a triple (G, M, I) consisting of an object set G and an attribute set M together with an incidence relation I ⊆ G × M . For arbitrary subsets A ⊆ G and B ⊆ M define the two derivation operators as A′ := {m ∈ M | ∀g ∈ A : (g, m) ∈ I}, B′ := {g ∈ G | ∀m ∈ B : (g, m) ∈ I}. For a single attribute m or object g, we write short m′ := {m}′ and g′ := {g}′. A pair (A, B) with A ⊆ G and B ⊆ M such that A′ = B and B′ = A is called a formal concept of (G, M, I). The partial order relation (A1, B1) ≤ (A2, B2) : ⇐⇒ A1 ⊆ A2 ( ⇐⇒ B1 ⊇ B2). orders all formal concepts of a context. The set of all concepts with this order relation is denoted by (B, ≤). A subset of concepts where all concepts are comparable with each other is called a chain. The order has a lattice structure, i.e., for each s e g a s s e m e t a v i r p s e g a s s e m p u o r g d e s a b - A S U m u i m e r p s d a t s r fi e l i b o m e n i l e m i t s e i r o t s Facebook Instagram Reddit Snapchat Telegram TikTok Twitter WeChat WhatsApp × YouTube × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × Fig. 2. Running example: This dataset compares attributes of different social media platforms. private messages ads group messages USA-based mobile first Telegram stories timeline premium Reddit Twitter YouTube WeChat TikTok WhatsApp Facebook Snapchat Instagram Fig. 3. The order diagram of the concept lattice for the running example depicts its 41 concepts. pair of concepts, a unique supremum and a unique infimum exists. The emerging so-called concept lattice is used in formal concept analysis to analyze the structure and relationships in a formal context. Two distinct concepts (A1, B1) and (A2, B2) are in covering relation, if (A1, B1) ≤ (A2, B2) and there is no other concept (A3, B3) with (A1, B1) ≤ (A3, B3) ≤ (A2, B2). It is then denoted by (A1, B1) ≺ (A2, B2). An order diagram graphically visualize the concept lattice. In this diagram, nodes on the plane depict the concepts, whereby they are places such that smaller concept nodes are below the greater ones. Continuous straight lines connect concept pairs in covering relation. The greatest concept to contain a specific attribute is annotated with its name, while symmetrically, the smallest one to include an object has the annotation of this object name. The attributes are annotated above the concept dot, while object labels are below the node. By this construction, it is possible to reconstruct all information of the formal context from the concept lattice diagram. Figure 3 depicts the concept lattice for our running example. B. Boolean Factor Analysis Research on Boolean factor conducted within [15]–[19] and outside [23] the realm of formal concept analysis. For this work, we use the notations as they are used in formal concept analysis. A formal context K = (G, M, I) analysis is f1 f2 × f3 f4 × × × × f5 f6 × × × × × × 1 2 3 4 5 6 7 8 9 10 f10 f8 f7 × × × × × f9 × × × × × × × × × × × × f11 × × × × × × f12 × × × × × × f13 × × × × × × × f14 × × × × × × × f15 × × × × × × × f16 × × × × × × × × f17 × × × × × × × × × Objects: (1) Facebook (2) Instagram (3) Reddit (4) Snapchat (5) Telegram (6) TikTok (7) Twitter (8) WeChat (9) WhatsApp (10) YouTube Attributes: (a) USA-based (b) premium (c) ads (d) private messages (e) group messages (f) mobile first (g) stories (h) timeline f e g b d c h × × × × × × × a × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 × f13 f14 f15 × f16 f17 Fig. 4. A conceptual Boolean factorization of the dataset from Figure 2 using 17 Boolean factors. can be disassembled into two factorizing formal contexts (G, F, IGF ) and (F, M, IF M ) such that (g, m) ∈ I ⇐⇒ (g, f ) ∈ IGF and (f, m) ∈ IF M for some f ∈ F . Elements in F are called Boolean factors. For each factor f ∈ F , let the factorizing family be the pair (A, B) with A = {g | (g, f ) ∈ IGF } and B = {m | (f, m) ∈ IF M }. Then, for each object g ∈ A and each attribute m ∈ B it holds that (g, m) ∈ I. Thus, it is sensible and possible to extend each factor such that its factorizing family is a formal concept. The emerging factorization is called a conceptual factorization. A Boolean factorization with few factors can have two benefits. It compresses the size of a dataset and increases its understandability. However, the existence of a small factorization for a formal context is not guaranteed. Contrarily, for a given k deciding if a factorization into k factors exists is an N P -complete task [18]. For our running example, there exists a conceptual factor- ization using 17 factors as depicted in Figure 4. C. Ordinal Factor Analysis To overcome the shortcomings of large Boolean factoriza- tions, Ganter and Glodeanu propose in [1] to group multiple Boolean factors into a single factor as follows. For a given formal context K = (G, M, I) with a pair of factorizing contexts (G, F, IGF ) and (F, M, IF M ) a set E ⊆ F is called a many-valued factor of (G, M, I). An ordinal factor is then defined as a many-valued ordinal factor E where for all elements e1, e2 ∈ E with factorizing families (A1, B1) and (A2, B2) it holds that A1 ⊆ A2 or A2 ⊆ A1. A complete ordinal factorization of width k of a formal context K = (G, M, I) is a set of ordinal factors F1, . . . Fk such that k i=1 Fi = I. Similar to the case of Boolean factors, it is S possible to extend each ordinal factor to a chain of formal concepts. Such an ordinal factorization is called a conceptual ordinal factorization. Ordinal factors are highly related to Ferrers relations. A Ferrers relation F in the context (G, M, I) is a subset of G × M where for all g, h ∈ G and m, n ∈ M it holds that (g, m) ∈ I ∧ (h, n) ∈ I ⇒ (g, n) ∈ I ∨ (h, m) ∈ I. We call a Ferrers relation F maximal in a formal context (G, M, I) if F ⊆ I and there is no Ferrers relation F ′ ⊆ I with F ( F ′. The maximal Ferrers relations correspond 1-to-1 to the maximal chains of the concept lattice, which describe the maximal conceptual ordinal factors. Because of this duality, we refer to both, maximal Ferrers relations as well as maximal chains of formal concepts as maximal ordinal factors. We call the size of an ordinal factor the number of incidences contained in its Ferrers relation. Consider once again the running example. It is not possible to do a factorization with two factors because no two of gm, mf, tl Twitter Reddit pm pr YouTube ads USA WhatsApp mf g m FB p m stories pm,gm ads tl USA mf Snapchat tl U S A Telegram st ads Insta WeChat TikTok Fig. 5. A complete ordinal factorization of the dataset from Figure 2 into three factors. the three elements (YouTube, premium), (WhatsApp, mobile- first) and (Facebook, timeline) can appear in the same Ferrers is possible to generate a relation. On the other hand, complete ordinal factorization into three factors as follows: it 1) f 17 < f 16 < f 13 < f 10 < f 8 < f 3 < f 1 2) f 15 < f 12 < f 6 < f 5 < f 2 3) f 14 < f 11 < f 9 < f 7 < f 4 < f 1 Note that every factor from the conceptual Boolean factor- ization in Figure 4 appears in at least one ordinal factor, and this is thus a complete ordinal factorization. Ganter and Glodeau propose a coordinate system to depict the information of the dataset using ordinal factorizations. Every axis of this plot represents a single ordinal factor as follows. Each tick of such an axis is associated with a concept of the concept chain. The label for the tick contains the additional attributes that this concept gains compared to the previous tick's. The plot depicts the objects in each axis such that they are one tick before the first tick with an attribute they do not have. For our given factorization of the running example, the complete factorization would result in a three- dimensional coordinate system. Presenting a more complex dataset with three ordinal factors on a plane results in hard to read projections as Figure 1 demonstrates. Thus, restricting such a plot to the two largest ordinal factors is sensible. However, with this method, the information of the third factor is lost. Figure 1 compares an ordinal factor analysis plot to a principal component analysis one. IV. GREEDY ORDINAL FACTORIZATIONS ARE HARD In the following two sections, we introduce and investigate greedy ordinal factorizations. Definition IV.1. Let (G, M, I) be a formal context. A set of ordinal factors F1, . . . , Fk is called greedy, if for each i ∈ {1, . . . , k} there is no factor ̃Fi with | ̃Fi \ {F1 ∪* * *∪Fi−1}| > |Fi \ {F1 ∪ * * * ∪ Fi−1}|. Repeatedly computing a Ferrer's relation, which covers the maximum possible uncovered part of the incidence, results in such a factorization. A complete ordinal factorization arises by repeating this process until every part of the incidence relation is covered. Still, it turns out that even deciding on the size of the first ordinal factor of this greedy process is an N P - complete problem. To see this, consider an auxiliary Lemma from Yannakakis [24]. This Lemma refers to the bipartite graphs corresponding to Ferrer's relations as chain graphs. The to notions of this work adapted version is the following. Lemma IV.1. Let K = (G, M, I) be a formal context and k a natural number. It is N P -complete to decide whether there is a set ̃I ⊆ G × M of size k such that I ∪ ̃I is a Ferrers relation. The complement of a Ferrers relation is once again a Ferrers relation. Thus, it follows immediately that deciding on the number of pairs that have to be removed from a binary relation to make it a Ferrers relation is equally computationally complex. Algorithm 1 Maximal Ferrers Relation Input: Concept lattice with covering relation (B, ≺) Covered E Output: Maximal Ferrers Relation F F(A,B) := ∅ ∀(A, B) ∈ B L := linear extension(B, ≺) f o r (A1, B1) i n L : f o r (A2, B2) ∈ B w i t h (A2, B2) ≺ (A1, B1) : ^F(A1,B1) = F(A2,B2) ∪ (A1 × B1) i f | ^F(A1,B1) \ E| ≥ |F(A1,B1) \ E| : F(A1,B1) = ^F(A1,B1) r e t u r n Fmax(B,≺) Corollary IV.1.1. Let K = (G, M, I) be a formal context and k a natural number. It is N P -complete to decide whether there is a set ̃I ⊆ I of size k such that I \ ̃I is a Ferrers relation. Proof. To see this, one has to show that the complement of a Ferrer's relation is once again a Ferrer's relation. Assume not, i.e. there is a Ferrer's relation F ⊆ G × M such that its complement (G×M )\F is no Ferrer's relation. Then there has to be g, h ∈ G and m, n ∈ M with (g, m) 6∈ F and (h, n) 6∈ F for which (g, n) ∈ F and (h, m) ∈ F , a contradiction to F being a Ferrer's relation. Now let (G, M, I) be a context and ̃I ⊆ G × M . Then (G × M ) \ (I ∪ ̃I) is a Ferrers relation exactly when I \ ̃I also is a Ferrers relation, which completes the proof. Thus, even deciding if the first greedy factor has a given size k is an N P -complete task which makes the problem of computing a greedy ordinal factorization N P -hard. V. COMPUTING GREEDY ORDINAL FACTORIZATIONS In this section, we provide ORDIFIND (Algorithm for ORDinal Factors IN Binary Data), an algorithm that to com- pute greedy ordinal factorization. As discussed in the last section, this problem is of high computation complexity. Thus, the best algorithm we can hope to find will still have exponential time with respect to the input size. Still, it is possible to leverage fast concept lattice algorithms from formal concept analysis. Especially Lindig's algorithm [25] which can be equipped with speed-up techniques [26] is useful. This algorithm computes the covering relation of a formal context in a reasonable time. The main advantage of this approach is that the exponential-time task of computing the concept lattice is executed only once. After this, the algorithm has linear time complexity in the size of the covering relation of the concept lattice. Note that the size of this covering relation may still be exponential in the size of the input data. The routine described in Algorithm 1 lays the foundation for ORDIFIND. It takes the covering relation of a concept lattice and a set E as its input. The routine then computes an ordinal factor that covers a maximal number of incidences in I \ E. Thus, the output of the routine is an ordinal factor F , in its Ferrers relation form, such that there is no ordinal factor ̃F with | ̃F \ E| > |F \ E|. The main idea of the routine is the following. The concept lattice of a formal context is iterated from the bottom to the top in order of a linear extension, i.e., in a linear order compatible with the concept lattice. Thus, each concept is not processed before the same process finishes for all smaller ones. After each concept is processed, the ordinal factor covering a maximal number of incidences of I \ E with this specific concept (A, B) as a top concept is in the variable F(A,B). Therefore, after every element is processed, the variable corresponds to the top concept Fmax(B,≺) contains the factor excluding with the highest number of incidences from I \ E. For a set of already computed factors, it is possible to compute the ordinal factor containing a maximal number of uncovered incidences by choosing the union of those factors as E. Iteratively repeating this procedure thus results in a complete greedy factorization of the formal context as described in Algorithm 2. Consequently, the following lemma concerning the overall runtime of the algorithm follows. Lemma V.1. For a formal context with k concepts and given covering relation, it is possible to compute a greedy ordinal factorization consisting of r ordinal factors in O(rk2). Proof. The runtime of Algorithm 1 is bounded from above by the size of the covering relation. The covering relation is bounded from above by the number of concept pairs. The loop in Algorithm 2 is repeated r times. The algorithm described above computes a greedy ordinal factorization. For the usefulness of this algorithm, it is crucial i.e., how it to investigate how good the factorization is, performs compared to an ordinal factorization that minimizes the number of factors. We investigate this in the following Lemma. Lemma V.2. Let K = (G, M, I) that can be optimally decomposed into k ordinal factors. Let F1, . . . , Fr be a greedy ordinal factor decomposition. Then r ≤ k loge |I|. Proof. By pigeon-hole principle it holds that |Fi| ≥ (|I| − |F1 ∪ . . . ∪ Fi−1|)/k for all i ∈ N. Thus, for r > k loge |I| it Algorithm 2 Naive Complete Ordinal Factorization Formal context (G, M, I) Covering relation (B, ≺) Input: Output: Greedy ordinal factorization F1, . . . , Fk E = ∅ i = 1 w h i l e E 6= I : Fi = max f errers((B, ≺), E) E = E ∪ Fi i = i + 1 r e t u r n F1, . . . , Fi holds that |I|−|F1|−* * *−|Fr| ≤ |I|(1− 1 implying that all incidences are covered after r repetitions. k )r ≤ |I|e−r/k < 1, The naive algorithm, proposed in Algorithms 1 and 2, reprocesses each concept in every step for each computation of a new factor. However, especially in the later and smaller factors, the algorithm does not modify all concepts in the lattice. Identifying concepts not touched by the algorithm enables a speed-up technique as the value of those can be saved between the steps. To do so, we have to modify how the naive algorithm stores the computed information. Instead of saving all incidences of the ordinal factor at each concept in the lattice, we only store their size. Additionally, we store for each concept in the factor its predecessor. The factor is then extracted by trailing the predecessors, starting with the top concept. Now, not every factor contains every attribute. Thus, after a factor with missing attributes was computed, only concepts that have a greater concept with an attribute in it have to be recomputed. The speed speed-up thus emerges from just recomputing those concepts. To determine which concepts are to recompute, we store the attributes of the factor in some set R. We use the set R furthermore to determine which concepts to iterate next. Instead of enumerating the concepts in the order of a previously fixed linear extension, the smallest attribute set of R is always the next one to iterate. Then it is removed from R. To enable this extraction, we implement R as a heap. The size of the attribute sets of concepts increases for smaller ones Thus, a linear order compatible with the concept lattice is respected. The proposed algorithm ORDIFIND in Algorithm 3 uses the new ideas from this paragraph to speed up the first two algorithms. VI. RELATIONSHIP BETWEEN FACTORS AND OBJECTS Let (G, M, I) be a formal context with an ordinal factoriza- tion F1, . . . Fk. For a fixed factor Fi = (A1, B1), . . . , (Aj , Bj) and an object g call the position of g in Fi the maximal r, such that Br ⊆ g′. Because Fi is a chain of concepts, all attribute sets of the concepts B1 . . . Br are thus subsets of g′. If this is true, we say that the object g supports the factor Fi until position r. If r = j the object g supports the whole factor Fi. For two objects g1, g2 ∈ G in a dataset, we can now define the ordinal factorization distance as d(g1, g2) = |g′ 1 \ g′ 2|. This distance between two objects thus counts the number of attributes that one object has, and the other one is missing. Note that this distance is not symmetric and f g′ 2 it becomes 0. The Hamming distance, which is the symmetric version of the distance defined above is commonly used to compute distances in binary datasets and can then be defined by 1 ⊆ g′ dh(g1, g2) = d(g1, g2) + d(g2, g1). We can generalize the notion of the ordinal factorization distance to positions in the factors. To do so, we compute the number of attributes in a factorization based on these Algorithm 3 OrdiFIND Input: Formal context (G, M, I) Covering relation (B, ≺) Output: Greedy ordinal factorization F1, . . . , Fk E = ∅ i = 1 R = min(B ≺) w h i l e E 6= I : b(A,B) := ⊥ ∀(A, B) ∈ B s(A,B) := ∅ ∀(A, B) ∈ B w h i l e R 6= ∅ : (A1, B1) = R.pop concept min no attr() f o r (A2, B2) ∈ B w i t h (A1, B1) ≺ (A2, B2) : ^s(A2,B2) = s(A1,B1) + |(A2 × B2) \ E| i f ^s(A2,B2) > s(A2,B2) : s(A2,B2) = ^s(A2,B2) b(A2,B2) = (A1, B1) R = R ∪ {(A2, B2)} Fi := ∅ b = max(B ≺) w h i l e b 6= ⊥ : Fi = Fi ∪ {(A, B)} b = b(A,B) R = {(g′′, g′) | g ∈ B, (A, B) ∈ Fi} i = i + 1 r e t u r n F1, . . . , Fi positions. Then the number of missing attributes of the object is computed. Let thus (G, M, I) be a formal context with a factorization F1, . . . , Fk and p1, . . . , pk integers representing the position in each factor. Define the ordinal factorization distance of the object g to the positions p1, . . . , pk as dF (g, p1, . . . , pk) = |{m | m ∈ Fi before position pi } \ g′|. The distance thus counts how many attributes an item is miss- ing support all factors until position Fi until position pi. Note that it is possible to which the ordinal factorization distance of an object is 0. This is trivially true, if for p1 = * * * = pk = 0. VII. ORDINAL FACTORIZATION AS A TOOL TO DISCOVER STRUCTURE We see the ordinal factor analysis as a tool to explain and discover relationships in unordered datasets. The computation- ally expensive task to compute the factorization only has to be done once in the preprocessing step. To make the tool easily accessible, we envision a web platform that only has to do the relatively light computation of positions of objects in the ordinal factors. A user can then interactively navigate the dataset to discover the preexisting relationships in the data. To do so, we propose a navigation system consisting of slide controls. Each slide control thereby corresponds to one factor. In the case of an ordinal factorization with k factors, there are k slide controls. For each concept of a factor, there is a position in the corresponding slide control. As the top and bottom concepts of a factor usually have an empty object they do not get a corresponding position or attribute set, in the slide control. Additionally, a 0-position is introduced for each slide control to indicate an empty selection. Each position is annotated with the attributes that the corresponding concept gains compared to the previous one in the factor. An analyst can then use the sliders to select the attribute positions for the slide controls. The system then displays the objects ordered by their ordinal factorization distance to the selected position. The second feature of this platform is that the analyst can select an object by clicking it. Then, the system automatically moves the slider for each factor to the maximal position the selected object supports. The remaining objects are then sorted based on the ordinal factorization distance of the selected position. For a prototype of how such a navigation system might work, we refer the reader to our demonstration platform1. We computed the ordinal factorizations of this tool using the greedy factor analysis as proposed in this work. The source code of this platform may be the basis for a more sophisticated exploration tool in the future. VIII. CASE STUDY Now, we demonstrate for five exemplary datasets that ordi- nal factor analysis is a method that can be applied to discover relationships in a dataset. A. Source Code Our algorithms are implemented in Python 3. An improved version of Lindigs algorithm [25], [26] directly and fastly computes the covering relation of the concept lattice needed for our approach. We thus use this method to compute the concept lattice. Even though we carefully implemented the code of our algorithms, it is focused on allowing experiments rather than speed. We thus believe that it is possible that optimizing the code could result in a speed-up. The source code2 is available for review and reproducibility. B. Datasets We conduct our experiments on multiple datasets from various sources, which we introduce in this section. a) German AI and General AI: We generated this bib- liometry based on a work by Koopmann et.al. [27]. It contains the publication relationship between authors and conferences in the realm of artificial intelligence. They chose the confer- ences in this data based on an article by Kersting [28]. We generate from this data two different datasets. The first one contains the AI community restricted to authors with a German affiliation, while the other is unrestricted. We refer to the two datasets by German AI and General AI. 1https://factoranalysis.github.io/ordinal/ 2https://figshare.com/s/8edc72eaebc53e74f146 TABLE I DATASET DESCRIPTIONS German AI General AI IMDb Wahl-O-Mat parties Wahl-O-Mat statements Attributes Objects Concepts Density Mean attributes per concept Mean object per concept Size of covering relation Number of greedy ordinal factors 133 2238 12709 0.0258 4.87 7.35 46776 129 137 218308 1981691 0.0149 7.24 13.54 11455411 137 28 3784644 6765616 0.0680 11.52 792.78 63990855 28 38 76 24245 0.429 7.26 8.28 24245 20 76 38 24245 0.429 8.28 7.26 24245 20 b) IMDb: We generated this dataset from the IMDb, a database that contains information on films and series. The movies and series are the objects of the dataset and their categories the attributes. We use the data as it was on the 6th of October 2021 [29] and refer to this dataset as the IMDb dataset. c) Wahl-O-Mat: The Wahl-O-Mat is a website provided by the "Bundeszentrale f ̈ur politische Bildung" [30] in Ger- many. It is a tool that helps german citizens decide which parties to vote in federal elections. Thereby a set of statements is provided on which the citizens have to decide whether they agree or disagree. Afterward, the system compares the results to statements of different parties to suggest which party might fit the views of the specific citizen. We extracted the statements and parties of the 2021 election to create two datasets. The first one, which we refer to as Wahl-O-Mat-parties has the parties as objects and the statements as attributes. The dataset Wahl-O-Mat-statements has the statements as objects and the parties as attributes. C. Runtime We performed all computations on an Intel Xeon Gold 5122 CPU equipped with 800 GB of memory. For each dataset, we used the methods from this work to compute a complete ordinal factorization. In Table II the runtime of ORDIFIND is compared to the naive algorithm. Also, the runtime of the computation of the concept lattice is listed. One can observe that in almost all instances, the computation of the covering relation takes a substantial amount of time. It is also clearly visible that ORDIFIND outperforms the naive version of the algorithm. We were not able to compute the factorization of the IMDb dataset using the naive algorithm. All in all, we conclude that it is feasible to apply the method proposed in this paper on all datasets, for which it is possible to compute the concept lattice. D. Interesting Findings In this section we demonstrate how to use the method to discover relationships and discuss findings in our datasets. a) German AI and General AI: The greedy factorization of the German AI and the General AI datasets results in 129 and 137 factors, respectively. For the German AI dataset, we include the factors in Figure 6, the prototype web platform from Section VII provides insight for the General AI com- munity. It seems sensible to interpret the single factors as communities of conferences, where authors of similar interest publish. For example, the first factor in both cases consists of Robotics conferences. The second factor of the German AI dataset corresponds then to the computer vision community, while the third factor contains the general AI conferences. Because of the nature of ordinal factorizations, the conferences that appear early in such a factor are the more general ones. The ones that are deep into a factor are more specialized. Such an ordinal factor analysis can thus provide an author with a tool to select a conference. It is interesting to note that the communities discovered with this method mostly coincide with the AI communities as formulated by Kersting in [28]. b) IMDb: The complete greedy factorization of the movie dataset by IMDb contains 27 factors. Each factor corresponds to a linear order of genres. One can derive knowledge about the movie landscape using these factors as follows. The first factor seems to focus on light entertainment. As most movie productions are in this factor, this is one with the highest relevance for the industry. The second factor then has a more educational focus. The third one is once again a factor with entertaining shows. However, the entertainment in this factor is not as light as in the first one. This factorization is valuable, as it is, to navigate a movie database or any database with a similar genre system. We furthermore believe that it is possible to extend the current method to a more sophisticated recommendation paradigm based on these factors. The users could then select, for example, that they want to view a movie that is highly entertaining but also a bit educational. Then the system would recommend movies based on the ordinal factor distance. c) Wahl-O-Mat: We use two different interpretations of the Wahl-O-Mat dataset for our research. The reason is that, TABLE II RUNTIME OF THE ALGORITHM Concepts Naive OrdiFIND General AI German AI IMDb Wahl-O-Mat parties Wahl-O-Mat statements 4.63h 3.76s 4.46d 4.34s 8.18s 4.18h 33.54s - 16.92s 14.23s 3.57h 12.97s 14.42d 11.96s 13.36s 1) ICRA - IROS - I. J. Robotics Res. - IEEE Trans. Robotics - Robotics and Autonomous Systems - Auton. Robots - IEEE Robotics and Automation Letters - IEEE Robot. Automat. Mag. - J. Field Robotics - Robotics: Science and Systems - FSR - ISRR - AAAI - IJCAI - NIPS, ICML - Humanoids, Artif. Intell., J. Artif. Intell. Res., Machine Learning - ACL, AAMAS, CoRL, IEEE Trans. Pattern Anal. Mach. Intell., ICCV, UAI, J. Mach. Learn. Res., ICAPS 2) CVPR - ICCV - ECCV - IEEE Trans. Pattern Anal. Mach. Intell. - International Journal of Computer Vision - Computer Vision and Image Understanding - ACCV - AAAI - IJCAI - NIPS - ICML - IEEE Trans. Neural Networks - NeurIPS - IJCNN - IEEE Trans. Knowl. Data Eng., ICDM - SDM, KDD, AISTATS - IEEE Trans. Neural Netw. Learning Syst., IEEE Trans. Systems, Man, and Cybernetics, Part C, Neural Computation - Data Min. Knowl. Discov., NAACL-HLT, Machine Learning, IROS, UAI, J. Mach. Learn. Res. 3) AAAI - IJCAI - CIKM - KDD - ICDM - IEEE Trans. Knowl. Data Eng. - SDM - PAKDD - WWW - WSDM - SIGIR - ECML/PKDD - ICML - ACL - NIPS - CVPR - UAI, IEEE Trans. Pattern Anal. Mach. Intell. - Artif. Intell. - Machine Learning - ACL/IJCNLP, International Semantic Web Conference, EMNLP/IJCNLP, ECML - NeurIPS, HLT-NAACL, ICRA, CoNLL, Autonomous Agents and Multi-Agent Systems, NAACL-HLT, PKDD, ML, Robotics and Autonomous Systems, ECAI, COLT, AISTATS, J. Mach. Learn. Res., EMNLP, IROS, COLING, EMNLP-CoNLL 4) IJCNN - Neural Networks - IEEE Trans. Neural Networks - ICANN - Neural Computation - NIPS - J. Mach. Learn. Res. - IEEE Trans. Pattern Anal. Mach. Intell. - Machine Learning - ICML - ECML/PKDD - UAI - SDM - KDD - COLT - EMNLP/IJCNLP, AAAI, PAKDD, AISTATS, RecSys - HLT-NAACL, CVPR, International Journal of Computer Vision, CIKM, SIGIR, WSDM, EACL, ICCV, ECML, WWW, EMNLP-CoNLL 5) IROS - Robotics and Autonomous Systems - Auton. Robots - IEEE Robot. Automat. Mag. - ICRA - Humanoids - ISRR - Robotics: Science and Systems - IEEE Robotics and Automation Letters - I. J. Robotics Res. - NIPS - IJCAI - AISTATS - J. Mach. Learn. Res. - ICML, CoRL, ECML, IEEE Trans. Robotics, Neural Networks, Neural Computation, IJCNN - ECML/PKDD, IEEE Trans. Neural Netw. Learning Syst., Artif. Intell., AAAI, ICANN, AAMAS, Machine Learning, ECAI, IEEE Trans. Pattern Anal. Mach. Intell., ICAPS 6) NIPS - ICML - AISTATS - J. Mach. Learn. Res. - UAI - Machine Learning - COLT - NeurIPS - KDD - ICDM - IJCAI - IEEE Trans. Pattern Anal. Mach. Intell. - AAAI - Neural Computation - ICRA, IEEE Trans. Neural Networks, SDM, Neural Networks, IJCNN - Humanoids, ICANN, Auton. Robots, PAKDD, IROS - Artif. Intell., IEEE Robotics and Automation Letters, CVPR, International Journal of Computer Vision, ACCV, PKDD, I. J. Robotics Res., WSDM, ECCV, ICCV, ECML, WWW, Robotics: Science and Systems, ICLR 7) CHI - UbiComp - ACM Trans. Comput.-Hum. Interact. - IUI - IJCAI - AAMAS - J. Artif. Intell. Res. - HCOMP, Artif. Intell., AAAI - WWW, UAI - HLT-NAACL, ACL, ICML, CIKM, KDD, WSDM, EMNLP - ACL/IJCNLP, IEEE Trans. Knowl. Data Eng., KR, EMNLP/IJCNLP, NAACL-HLT, Machine Learning, AIPS, ICAPS 8) IJCAI - Artif. Intell. - ECAI - J. Artif. Intell. Res. - KR - JELIA - TPLP - ICLP - AAAI - LPAR - RR - ESWC - IEEE Trans. Knowl. Data Eng., International Semantic Web Conference, RuleML - RuleML+RR - IJCAR, ILP, CPAIOR, CP, WWW, TARK 9) CIKM - SIGIR - WWW - WSDM - KDD - ACL - EMNLP - EMNLP/IJCNLP - AAAI - NAACL-HLT - NeurIPS - NIPS, ICML - IJCAI - ECML/PKDD - J. Artif. Intell. Res. - COLT, ICDM, Machine Learning - ACL/IJCNLP, HLT- NAACL, Artif. Intell., HLT/EMNLP, ML, RecSys, SDM, UAI, EMNLP-CoNLL, ICLR - CoNLL, PAKDD, EACL, ICCV, COLING, J. Mach. Learn. Res. 10) ACL - EMNLP - COLING - HLT-NAACL - EACL - NAACL-HLT - EMNLP/IJCNLP - CoNLL - EMNLP-CoNLL - HLT/EMNLP - J. Artif. Intell. Res. - AAAI - ICML - IJCAI, KDD, Machine Learning, NIPS, J. Mach. Learn. Res. - COLING-ACL - IEEE Trans. Knowl. Data Eng., KR, ILP, AAMAS, PKDD, ECCV, WWW, ECML/PKDD, CVPR, CIKM, IEEE Trans. Pattern Anal. Mach. Intell., NeurIPS, Artif. Intell., ECML, Neural Computation, COLT, AISTATS, ICDM, J. Autom. Reasoning 11) KDD - ICDM - SDM - IEEE Trans. Knowl. Data Eng. - PAKDD - Data Min. Knowl. Discov. - ECML/PKDD - PKDD - Machine Learning - ICML - IJCAI - CIKM - AAAI - J. Mach. Learn. Res. - UAI - NeurIPS, J. Artif. Intell. Res., ECML - KR, Artif. Intell., ILP, ICRA, Int. J. Approx. Reasoning, Auton. Robots, ICLP, TPLP, EWSL, ML, ECAI, Inductive Logic Programming Workshop, Computer Vision and Image Understanding, ICCV, IROS, EMNLP-CoNLL, Probabilistic Graphical Models, IJCNN 12) IEEE Trans. Pattern Anal. Mach. Intell. - ECCV - ACCV - Computer Vision and Image Understanding - International Journal of Computer Vision - ICCV - CVPR - IEEE Trans. Neural Netw. Learning Syst. - AAAI - IEEE Trans. Knowl. Data Eng. - ICDM - WWW - IJCAI - SIGIR - PAKDD - CHI, EMNLP, WSDM, KDD - EMNLP/IJCNLP, ECML/PKDD, HLT-NAACL, ACL, CIKM, SDM Fig. 6. The attributes of the first twelve factors of a greedy factorization for the German AI dataset it topics, in our opinion, both datasets are of interest for examination with ordinal factor analysis. In the first one, the factors contain the political parties, while in the second case, they contain statements. When discussing political is common to refer to statements as progressive or conservative. Often, these statements are even compared with each other concerning their progressiveness or conservativeness. Thus, the everyday intercourse with political topics implies that there is a linear order on the positions. The same is true for political parties, which we also ordered similarly. However, in a diverse political landscape, a single order is most likely not adequate to be analyzed in this way. In our dataset, we identify parties typically classified as right-wing, with some progressive po- sitions such as raising the minimum wage. The ordinal factor analysis enables a more sophisticated investigation of this situation. Each factor provides a linear order which arranges the parties or statements respectively. Thereby, each factor is consistent with the positions of a party. If we analyze the statement dataset, we can observe that the classical progressive positions are condensed in the first factor, while the second factor contains the conservative ones. The other factors are more specialized as the order of the positions bases not on the conservative-progressive spectrum but, for example, migration or economics. In every factor, the early statements are those many parties hold. Thus they are the ones that have the highest probability to be implemented by a future government. E. Limitations The main limitation of the method is the computational fea- sibility. The algorithm has to solve an N P -complete problem which results in an exponential-time algorithm with respect to the size of the input data. Thus, it is not feasible for large datasets, where it is currently impossible to compute concept lattices. A further limitation is that the algorithm, as it is, currently can only deal with binary datasets. Datasets with numerical or categorical data have to be scaled into a binary form before the algorithm can be applied. IX. CONCLUSION AND OUTLOOK In this work, we proposed the algorithm ORDIFIND by building upon the prior existing notion of ordinal factor analysis. To do so, we leveraged fast algorithms developed in formal concept analysis. The resulting algorithm enables us to compute a greedy ordinal factorization for larger unordered binary datasets, which commonly appear in data mining tasks. Leveraging this factorization, we demonstrated how to dis- cover relationships in the original data. Datasets often consist not only of binary but also already ordinal data. The ordinal factor analysis in its current form can only deal with this data by interpreting it as binary. While scaling in formal concept analysis is a tool to deal with this data, factors will not necessarily respect the order encapsulated in the data. In our opinion, the next step should be to extend this method to deal with ordinal data directly. Furthermore, faster algorithms for the concept lattice are always desirable, especially in the modern web, where the growth of datasets is often even accelerating. For datasets of sizes unfeasible for our method, heuristics to approximate the ordinal factors may be developed. Finally, we believe it could be interesting to explore other non-ordinal many-valued factors. REFERENCES [1] B. Ganter and C. V. Glodeanu, "Ordinal factor analysis," in Formal Concept Analysis - 10th International Conference, ICFCA, ser. Lecture Notes in Computer Science, vol. 7278. Springer, 2012, pp. 128–139. tagging [2] M. Gupta, R. Li, Z. Yin, and J. Han, "Survey on social techniques," SIGKDD Explor., vol. 12, no. 1, pp. 58–72, 2010. [3] O. Nov, M. Naaman, and C. Ye, "What drives content tagging: the case of photos on flickr," in Proceedings of the 2008 Conference on Human Factors in Computing Systems, CHI. ACM, 2008, pp. 1097–1100. [4] M. Heckner, T. Neubauer, and C. Wolff, "Tree, funny, to read, google: what are tags supposed to achieve? a comparative analysis of user keywords for different digital resource types," in Proceeding of the 2008 ACM Workshop on Search in Social Media, SSM. ACM, 2008, pp. 3–10. [5] A. Onan, "Two-stage topic extraction model for bibliometric data analysis based on word embeddings and clustering," IEEE Access, vol. 7, pp. 145 614–145 633, 2019. [6] M. M. Kalayeh, H. Idrees, and M. Shah, "NMF-KNN: image annotation using weighted multi-view non-negative matrix factorization," in 2014 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2014. IEEE Computer Society, 2014, pp. 184–191. [7] R. Bellman, "Dynamic programming," Science, vol. 153, no. 3731, pp. 34–37, 1966. [8] P. E. Hoffman and G. G. Grinstein, "A survey of visualizations for high- dimensional data mining," in Information visualization in data mining and knowledge discovery, 2001, pp. 47–82. [9] M. Espadoto, R. M. Martins, A. Kerren, N. S. T. Hirata, and A. C. Telea, "Toward a quantitative survey of dimension reduction techniques," IEEE Trans. Vis. Comput. Graph., vol. 27, no. 3, pp. 2153–2173, 2021. [10] K. Pearson, "Liii. on lines and planes of closest fit to systems of points in space," The London, Edinburgh, and Dublin philosophical magazine and journal of science, vol. 2, no. 11, pp. 559–572, 1901. [11] P. M. Jain and V. Shandliya, "A survey paper on comparative study be- tween principal component analysis (pca) and exploratory factor analysis (efa)," International Journal of Managment, IT and Engineering, vol. 3, no. 6, pp. 415–424, 2013. [12] D. Child, The essentials of factor analysis. Cassell Educational, 1990. [13] R. Wille, "Restructuring lattice theory: An approach based on hierarchies of concepts," pp. 445–470, 1982. [14] B. Ganter and R. Wille, Formal Concept Analysis - Mathematical Foundations. Springer, 1999. [15] A. Keprt and V. Sn ́asel, "Binary factor analysis with help of formal concepts," in Proceedings of the CLA 2004 International Workshop on Concept Lattices and their Applications, ser. CEUR Workshop Proceedings, vol. 110. CEUR-WS.org, 2004. [16] A. Keprt, "Algorithms for binary factor analysis," Ph.D. dissertation, PhD thesis, 2006. [17] R. Belohl ́avek and V. Vychodil, "Formal concepts as optimal factors in boolean factor analysis: Implications and experiments," in Proceedings of the Fifth International Conference on Concept Lattices and Their Applications, CLA 2007, ser. CEUR Workshop Proceedings, vol. 331. CEUR-WS.org, 2007. [18] --, "Discovery of optimal factors in binary data via a novel method of matrix decomposition," J. Comput. Syst. Sci., vol. 76, no. 1, pp. 3–20, 2010. [19] P. D. Boeck and S. Rosenberg, "Hierarchical classes: Model and data analysis," Psychometrika, vol. 53, no. 3, pp. 361–381, Sep. 1988. [20] C. V. Glodeanu and B. Ganter, "Applications of ordinal factor analysis," in Formal Concept Analysis, 11th International Conference, ICFCA 2013, ser. Lecture Notes in Computer Science, vol. 7880. Springer, 2013, pp. 109–124. [21] --, "Applications of ordinal factor analysis," in Formal Concept Anal- ysis, 11th International Conference, ICFCA 2013, Dresden, Germany, May 21-24, 2013. Proceedings, ser. Lecture Notes in Computer Science, vol. 7880. Springer, 2013, pp. 109–124. [22] C. V. Glodeanu and J. Konecny, "Ordinal factor analysis of graded data," in Formal Concept Analysis - 12th International Conference, ICFCA 2014, ser. Lecture Notes in Computer Science, vol. 8478. Springer, 2014, pp. 128–140. [23] Z. Zhang, T. Li, C. H. Q. Ding, and X. Zhang, "Binary matrix factor- ization with applications," in Proceedings of the 7th IEEE International Conference on Data Mining (ICDM 2007). IEEE Computer Society, 2007, pp. 391–400. [24] M. Yannakakis, "Computing the minimum fill-in is np-complete," SIAM Journal on Algebraic Discrete Methods, vol. 2, no. 1, pp. 77–79, 1981. [25] C. Lindig, "Fast concept analysis," Working with Conceptual Structures- Contributions to ICCS, vol. 2000, pp. 152–161, 2000. [26] P. Krajca, "Improving the performance of lindig-style algorithms with empty intersections," in Graph-Based Representation and Reasoning - 26th International Conference on Conceptual Structures, ICCS 2021, ser. Lecture Notes in Computer Science, vol. 12879. Springer, 2021, pp. 91–104. [27] T. Koopmann, M. Stubbemann, M. Kapa, M. Paris, G. Buenstorf, T. Hanika, A. Hotho, R. J ̈aschke, and G. Stumme, "Proximity dimen- sions and the emergence of collaboration: a hyptrails study on german ai research," Scientometrics, pp. 1–22, 2021. [28] K. Kersting, J. Peters, and C. A. Rothkopf, "Was ist eine professur fuer kuenstliche intelligenz?" CoRR, vol. abs/1903.09516, 2019. [Online]. Available: http://arxiv.org/abs/1903.09516 [29] IMDb.com, "Imdb datasets," 2004, [Online; accessed 06-October-2021]. [Online]. Available: https://www.imdb.com/interfaces/ [30] Bundeszentrale [Online; https://www.bpb.de/politik/wahlen/wahl-o-mat/337541/download politische Bildung, 07-February-2022]. "Wahl-o-mat," [Online]. f ̈ur accessed 2021, Available:
http://arxiv.org/abs/2302.09664v3
2023-04-15T12:55:45
2023-02-19T20:10:07
Semantic Uncertainty: Linguistic Invariances for Uncertainty Estimation in Natural Language Generation
We introduce a method to measure uncertainty in large language models. For tasks like question answering, it is essential to know when we can trust the natural language outputs of foundation models. We show that measuring uncertainty in natural language is challenging because of "semantic equivalence" -- different sentences can mean the same thing. To overcome these challenges we introduce semantic entropy -- an entropy which incorporates linguistic invariances created by shared meanings. Our method is unsupervised, uses only a single model, and requires no modifications to off-the-shelf language models. In comprehensive ablation studies we show that the semantic entropy is more predictive of model accuracy on question answering data sets than comparable baselines.
[ "Lorenz Kuhn", "Yarin Gal", "Sebastian Farquhar" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09664v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09664v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.AI", "cs.LG" ]
3 2 0 2 r p A 5 1 ] L C . s c [ 3 v 4 6 6 9 0 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 SEMANTIC UNCERTAINTY: LINGUISTIC INVARIANCES FOR UNCERTAINTY ESTIMATION IN NATURAL LANGUAGE GENERATION Lorenz Kuhn, Yarin Gal, Sebastian Farquhar OATML Group, Department of Computer Science, University of Oxford [email protected] ABSTRACT We introduce a method to measure uncertainty in large language models. For tasks like question answering, it is essential to know when we can trust the natu- ral language outputs of foundation models. We show that measuring uncertainty in natural language is challenging because of 'semantic equivalence'-different sentences can mean the same thing. To overcome these challenges we introduce semantic entropy-an entropy which incorporates linguistic invariances created by shared meanings. Our method is unsupervised, uses only a single model, and requires no modifications to 'off-the-shelf' language models. In comprehensive ablation studies we show that the semantic entropy is more predictive of model accuracy on question answering data sets than comparable baselines. 1 INTRODUCTION Despite progress in natural language generation (NLG) tasks like question answering or abstractive summarisation (Brown et al., 2020; Hoffmann et al., 2022; Chowdhery et al., 2022), there is little understanding of uncertainty in foundation models. Without measures of uncertainty in transformer- based systems it is hard to use generated language as a reliable source of information. Reliable measures of uncertainty have been identified as a key problem in building safer AI systems (Amodei et al., 2016; Hendrycks et al., 2022). Unfortunately, uncertainty in free-form NLG faces unique challenges. This limits how much we can learn from uncertainty estimation techniques in other applications of deep learning (Gal et al., 2016; Lakshminarayanan et al., 2017; Ovadia et al., 2019) which focuses especially on image classification (Kendall & Gal, 2017) or regression in low-dimensional data spaces (Kuleshov et al., 2018). The key challenges come from the importance in language of meanings and form. This corresponds to what linguists and philosophers call the semantic content of a sentence and its syntactic or lexical form. Foundation models output token-likelihoods-representing lexical confidence. But for almost all applications we care about meanings! For example, a model which is uncertain about whether to generate "France's capital is Paris" or "Paris is France's capital" is not uncertain in any important sense. Yet, at a token-level the model is uncertain between two forms of the same meaning. Existing unsupervised methods (e.g., Malinin & Gales (2020)) ignore this distinction. To address semantic equivalence, we estimate semantic likelihoods-probabilities attached to mean- ings of text rather than standard sequence-likelihoods. We introduce an algorithm for clustering sequences that mean the same thing based on the principle that two sentences mean the same thing if you can infer each from the other. We then use these semantic-likelihoods to estimate seman- tic uncertainty-uncertainty over different meanings. In particular, we compute the entropy of the probability distribution over meanings. Adjusting for semantic equivalence in this way offers bet- ter uncertainty estimation than standard entropy and also greatly improves over methods for model self-evaluation (Kadavath et al., 2022). In addition, semantic entropy scales better with model size and makes better use of increasing numbers of samples than baselines. We further analyse major challenges for measuring uncertainty in NLG. We show empirically how sampling a set of model answers to estimate entropies in NLG must balance sample accuracy and diversity, which significantly strengthens the baselines we compare against relative to prior imple- 1 Published as a conference paper at ICLR 2023 (a) (b) Figure 1: (a) Our semantic entropy (blue) predicts model accuracy better than baselines on the free-form question answering data set TriviaQA (30B parameter OPT model). Normalised entropy reimplements single-model variant of Malinin & Gales (2020), lexical similarity measures the av- erage Rouge-L in a sampled set of answers for a given question analogously to Fomicheva et al. (2020), entropy and p(True) reimplement Kadavath et al. (2022). (b) Our method's outperformance increases with model size while also doing well for smaller models. mentations. We also examine the situational heuristic of length-normalising predictive entropies. Our main contributions are thus as follows: • We explain why uncertainty in free-form NLG is different from other settings (Section 3). • We introduce semantic entropy-a novel entropy-based uncertainty measure which uses our algorithm for marginalising over semantically-equivalent samples (Section 4) and show that it outperforms comparable baselines in extensive ablations with both open- and closed- book free-form question answering using TriviaQA and CoQA (Section 6). • Through hyperparameter ablations we suggest how to balance the trade-off between sam- pling diverse and accurate generations for our method as well as baselines (Section 6.2) and show that far fewer samples are needed for effective uncertainty than prior work presumes. We focus on free-form question answering (QA) because it is a difficult and important use of NLG with high-stakes applications. At the same time, it is easier to establish a ground truth without expensive human evaluation than more nebulous tasks like summarisation. Ultimately, we show that semantic entropy is an effective unsupervised way to estimate uncertainty in NLG. As an unsupervised method, it requires no further training or data-gathering, unlike super- vised methods including Lin et al. (2022a); Kadavath et al. (2022). Semantic entropy is designed to work with existing foundation and large language models with no modifications 'out-of-the-box'. Our experiments use OPT (Zhang et al., 2022) but semantic entropy works with any similar model. 2 BACKGROUND ON UNCERTAINTY ESTIMATION Our method draws inspiration from probabilistic tools for uncertainty estimation, which have been extensively employed in settings like deep image classification (Gal et al., 2016). Although these methods are often used in Bayesian models, we emphasise that our method does not require any special training or architectural modifications and is not limited to Bayesian settings. The total uncertainty of a prediction can be understood as the predictive entropy of the output dis- tribution. This measures the information one has about the output given the input. This entropy is highest when the output is minimally informative-predicting the same probability for all possible outcomes. The predictive entropy for a point x is the conditional entropy of the output random variable Y with realisation y given x P E(x) = H(Y | x) = − (cid:90) p(y | x) ln p(y | x)dy (1) One can further distinguish aleatoric uncertainty-uncertainty in the underlying data distribution- and epistemic uncertainty-resulting from missing information (Kendall & Gal, 2017). Epistemic 2 p(True)Lexical similarityEntropyNormalised entropySemantic entropy (ours)0.650.700.750.800.85AUROC2.7B6.7B13B30BNumber of parameters of model0.720.740.760.780.800.82AUROCSemantic entropy (ours)Normalised entropyPredictive entropyLexical similarity Published as a conference paper at ICLR 2023 uncertainty, measured using a mutual information, can be useful but is hard to estimate, especially for very large models, requiring special methods and computational expense. Instead of estimating the epistemic uncertainty based on the model variance, the epistemic uncertainty can also be pre- dicted directly using a second model (see e.g. Jain et al. (2021)). We do not use mutual information in this work, because our focus is on existing foundation models 'off-the-shelf'. Similarly, while, e.g., Malinin & Gales (2020) use ensembles of models to estimate the integral in Eq. (1) we use samples from a single model's output distribution. Prior networks (Malinin & Gales, 2018; Malinin et al., 2020) estimate model uncertainty by emulating an ensemble with a single model. This could be important for NLG because of large model sizes. For sequence-prediction tasks like NLG, the probability of the entire sequence, s, is the product of the conditional probabilities of new tokens given past tokens, whose resulting log-probability is log p(s | x) = (cid:80) i log p(si | s<i), where si is the i'th output token and s<i denotes the set of previous tokens. Sometimes, instead of the entropy of these probabilities, the geometric mean token- probability is used instead (Malinin & Gales, 2020) becoming an arithmetic mean log-probability 1 log p(si | s<i). Despite empirical success Murray & Chiang (2018), so far this has little N theoretical justification. (cid:80)N i Direct application of language models to uncertainty. In contrast to our approach using prob- abilistic methods, recent work has sought to use the generating language model itself to estimate its own uncertainty. For example, Lin et al. (2022a) finetune language models to verbally describe their confidence. Meanwhile, Kadavath et al. (2022) sample multiple generations and return the completion to an NLG prompt asking if a proposed answer is true (further detail in Appendix B.5). Both Lin et al. (2022a) and Kadavath et al. (2022) also propose ways to finetune predictors on the embeddings of generating models to predict models uncertainty. While promising, these approaches need task-specific labels, additional training, and seem to be unreliable out-of-distribution (as shown in Figures 13 and 14 in Kadavath et al. (2022)). 3 CHALLENGES IN UNCERTAINTY ESTIMATION FOR NLG Approaches to NLG uncertainty might treat the language model as a black-box (e.g., asking it if its answer is correct) or alternatively focus on the probabilistic model without accounting for the special characteristics of language (e.g., measuring predictive entropy). Our unsupervised approach instead uses the powerful tools of probabilistic modelling, but also recognises the unique challenges posed by free-form NLG. In this section, we critically analyse the probabilistic interpretation of language models in order to ground both our method and future exploration of the field. 3.1 SEMANTIC EQUIVALENCE IN LANGUAGE OUTPUTS Most machine learning problems have mutually exclusive outputs. An image in class 17 is not class 29 as well; a regression output of 23.1 is not anything else; an RL agent going left does not go right. In contrast, for free-form text generation an output usually means the same thing as many other outputs. For example, "The capital of France is Paris" means the same thing as "France's capital is Paris". Linguists and philosophers distinguish text's meaning-its semantic content-from its syntactic and lexical form. The syntax is the grammatical structure while its lexical form is the specific words used. Lexical equivalence entails the other two, but not the reverse. We almost always care about the semantic content of a sentence. For decision-problems relying on NLG, meaning is usually an invariance in output-space which is not present in the model spec- ification. This is true for question answering, summarisation, artificial assistants. Meanings are especially important for trustworthiness: a system can be reliable even with many different ways to say the same thing but answering with inconsistent meanings shows poor reliability. We can formalize semantic equivalence mathematically. Let the space of tokens in a language be T . The space of all possible sequences of tokens of length N is then SN ≡ T N . For some sentence s ∈ SN , a sequence of tokens si ∈ T there is an associated meaning.1 Let us introduce a placeholder semantic equivalence relation, E(*, *), which holds of any two sen- tences that mean the same thing-we operationalise this in Section 4. Recall that an equivalence 1Theories of meaning are contested (Speaks, 2021). However, for specific models and deployment contexts many considerations can be set aside. Care should be taken comparing very different models and contexts. 3 Published as a conference paper at ICLR 2023 Table 1: Answers to the question "What is the capital of France?" (a) When all generations from the model mean different things, semantic clustering has no effect-the entropy and semantic entropy are identical. (b) When some of the answers are semantically equivalent ("Paris" and "It's Paris") the semantic entropy does a better job of capturing the actually low uncertainty. (a) Scenario 1: No semantic equivalence (b) Scenario 2: Some semantic equivalence Answer s Paris Rome London Entropy Likelihood p(s | x) 0.5 0.4 0.1 0.94 (cid:80) Semantic likelihood s∈c p(s | x) 0.5 0.4 0.1 0.94 Answer s Paris It's Paris London Entropy Likelihood p(s | x) Semantic likelihood s∈c p(s | x) (cid:80) 0.5 (cid:111) 0.4 0.1 0.94 0.9 0.1 0.33 relation is any reflexive, symmetric, and transitive relation, and that any equivalence relation on a set corresponds to a set of equivalence classes. Each semantic equivalence class corresponds to one possible meaning that our text can have. That is, for the space of semantic equivalence classes C the sentences in the set c ∈ C all share a meaning such that ∀s, s(cid:48) ∈ c : E(s, s(cid:48)). Ordinarily, large language models produce conditional distributions over tokens and their resulting sequences. That is, the probability of the sequence conditioned on the context comes from condi- tional token probabilities p(s | x) = (cid:81) i p(si | s<i, x). Instead, we focus on the probability of the model generating any sequence that shares some meaning. This can be written as p(c | x) = p(s | x) = (cid:88) s∈c (cid:88) (cid:89) s∈c i p(si | s<i, x). (2) Formally, this treats the output random variable whose event-space is C, a sub-σ-algebra of the standard event-space S. 3.2 SAMPLING THE EXTREMELY HIGH-DIMENSIONAL LANGUAGE-SPACE Recall from Eq. (1) that estimating predictive entropy requires taking an expectation in output-space. However, the output-space of natural language has O(|T |N ) dimensions. Moreover, while we can sample from our autoregressive token-model, we lack a normalized probability density function over sentences. The expectation must be approximated by Monte Carlo integration-sampling a finite set of sentences from the output distribution and averaging their likelihoods to compute the entropy. For entropies the average is dominated by low-probability sentences (whose logs are large and negative) making Monte Carlo integration difficult (Mackay, 2003). 3.3 VARIABLE LENGTH GENERATIONS Sentences of natural language have different lengths. As is widely noted (Murray & Chiang, 2018) and especially in the context of NLG uncertainty by Malinin & Gales (2020), in expectation longer sequences have lower joint likelihoods because of the conditional independence of the token prob- abilities. The joint likelihood of a sequence of length N shrinks exponentially in N . Its negative log-probability therefore grows linearly in N , so longer sentences tend to contribute more to entropy. We therefore interpret length-normalising the log-probabilities when estimating the entropy as as- serting that the expected uncertainty of generations is independent of sentence length. Sometimes, this is approximately valid. Other times, longer sentences may well be usually more uncertain (e.g., when the goal is to exactly match a typically short reference answer, such as for TriviaQA). In these cases, the advantages of length-normalisation become less clear-cut, as we show empirically in Sec- tion 6.1. This offers some guidance a priori on cases when length-normalisation is appropriate. 4 SEMANTIC UNCERTAINTY We have introduced the idea that uncertainty over meanings is more important for most situations than uncertainty over the exact tokens used to express those meanings. Our method examines un- certainty in meaning-space-the entropy of the random variable representing the output distribution in the semantic event-space. This is in contrast to entropy in the usual token event-space. To do this we introduce a novel algorithm for estimating the semantic equivalence relation as well as a novel uncertainty estimation algorithm for semantic entropy. At a high level this involves three steps: 4 Published as a conference paper at ICLR 2023 1. Generation: Sample M sequences {s(1), . . . , s(M )} from the predictive distribution of a large language model given a context x. 2. Clustering: Cluster the sequences which mean the same thing using our bi-directional entailment algorithm. 3. Entropy estimation: Approximate semantic entropy by summing probabilities that share a meaning following Eq. (2) and compute resulting entropy. This is illustrated in Table 1. Step 1: Generating a set of answers from the model First we sample M sequences {s(1), . . . , s(M )} which we will use later to estimate the uncertainty. These sequences must be sampled according to the distribution p(s | x). In this paper, we sample these sequences only from a single model using either multinomial sampling or multinomial beam sampling. We show in Section 6.2, that the choice of sampling temperature and sampling method can have a significant impact on the performance of both our method and the baselines. Unlike Malinin & Gales (2020), we do not use an ensemble of models. Ensembling would probably improve performance, but the cost of training multiple independent foundation models is often prohibitive. Step 2: Clustering by semantic equivalence In Section 3.1, we formalised semantic equivalence by introducing the semantic equivalence rela- tion, E(*, *), which induces semantic equivalence classes which are sets of sequences that share a meaning. Recall that the equivalence class c is a set of sequences s such that ∀s, s(cid:48) ∈ c : E(s, s(cid:48)). We operationalise E(*, *) using the idea of bi-directional entailment. A sequence, s, means the same thing as a second sequence, s(cid:48), if and only if they entail (i.e. logically imply) each other. E.g., "The capital of France is Paris." entails "Paris is the capital of France." because they mean the same thing. Importantly, we require that the sequences mean the same thing with respect to the context-key meaning is sometimes contained within the context. For example, "Paris." does not entail "The capital of France is Paris." because "Paris." is not a declarative sentence without context. But within the context of the question, the one-word answer does entail the fuller answer. In general, any natural language inference classification system (NLI) can be used for our bidirec- tional entailment clustering algorithm. In our case, we use a Deberta-large model (He et al., 2020a) that is fine-tuned on the NLI data set MNLI (Williams et al., 2017). For each pair of sequences in our set of samples, s and s(cid:48), we detect whether it is possible to infer the concatenation of the context and s from the concatenation of the context and s(cid:48) and vice versa. To do this we concatenate each of the two question/answer pairs, and then concatenate them both together separated by a special token. The Deberta model then classifies this sequence into one of: entailment, neutral, contradiction. We compute both directions, and the algorithm returns equivalent if and only if both directions were entailment. Algorithm pseudocode is provided in Appendix A.2. Because this component is novel, we confirm in Appendix B.2 that the bidirectional entailment classifier works by manually labelling 300 generations for semantic equivalence, finding an accuracy of 92.7% on TriviaQA and 95.5% on CoQA. 2 Computational cost. The bidirectional equivalence algorithm is combinatorially complex in M , it requires (cid:0)M (cid:1)-many comparisons in the worst-case. In practice, however, the computational cost is small compared to the cost of generating sequences. First, as we show in Section 6.2, M < 20 is often sufficient for good uncertainty. Second, because the Deberta-large model is so much smaller than the main language model (1.5B parameters), each pair comparison is much faster than generat- ing even one token from the main model. Third, because semantic equivalence is transitive we only need to compare one member of each equivalence class to remaining sequences (see Algorithm 1). Additionally, the number of semantic clusters in our tasks is empirically quite low, see Table 2. Step 3: Computing the semantic entropy Having determined the clusters of generated sequences that mean the same thing, we add their like- lihoods following Eq. (2) as a way of determining the likelihood of each meaning, rather than each sequence. We then compute the semantic entropy (SE) as the entropy over the meaning-distribution SE(x) = − (cid:88) c p(c | x) log p(c | x) = − (cid:88) (cid:18)(cid:16) (cid:88) (cid:17) p(s | x) (cid:104) (cid:88) log (cid:105)(cid:19) p(s | x) . (3) c s∈c s∈c 5 Published as a conference paper at ICLR 2023 We do not have access to every possible meaning-class c. Instead, we can only sample c from the sequence-generating distribution induced by the model. To handle this, we estimate the expectation in Eq. (3) using Monte Carlo integration over the semantic equivalence classes C from Algorithm 1 SE(x) ≈ −|C|−1 |C| (cid:88) i=1 log p(Ci | x). (4) This is an unbiased estimator of the entropy in Eq. (3). In addition, in some cases we use length- normalisation as described in Section 3.3. 4.1 HOW THE SEMANTIC ENTROPY ADDRESSES THE CHALLENGES OF NLG The main inspiration of semantic entropy is to address the semantic invariance of natural language head-on by converting the problem of uncertainty estimation into meaning-space. In addition, se- mantic entropy goes some way towards addressing unequal token importance. Generations whose meanings are the same but differ on unimportant tokens will be added together, which we expect will reduce the effect of the likelihoods of unimportant tokens although we do not demonstrate this empirically. However, this challenge is only partially addressed: semantic entropy will still pay too much attention to non-keyword likelihoods. This is one area where supervised language-model- based uncertainty tools (Lin et al., 2022a; Kadavath et al., 2022) might enable future improvements that handle this challenge better. We address the challenges of sampling and variable-length gener- ation using specific details of our sampling procedure in Section 4. 5 RELATED WORK Prior work on uncertainty in foundation models for NLP has largely focused on the calibration of classifiers (Jiang et al., 2021; Desai & Durrett, 2020) and text regressors (Glushkova et al., 2021; Wang et al., 2022). These settings, are analogous to classification or regression settings in other modalities like vision, and conventional uncertainty measures like MC dropout or Deep Ensembles can be applied without modification (see Section 2 for a discussion of uncertainty in deep learning in general). As we argue in Section 3, generative natural language poses important further challenges. Jiang et al. (2021) do examine calibration in generative question answering and find only a weak correlation between the log-likelihood models assign to their answer and the answer's correctness. In Section 6 we explain however why semantic equivalence in natural language makes calibration a problematic evaluation for generative language models. Reliable uncertainty can be useful on downstream tasks such as graph semantic parsing (Lin et al., 2022b). Some research has addressed uncertainty or calibration in NLG either by prompting the models to evaluate their own generations or by fine-tuning the generating model to predict its uncertainty (Mielke et al., 2020; Lin et al., 2022a; Kadavath et al., 2022). These methods need further training and supervision. Because they need additional training and supervision, they are hard to reproduce, expensive to create, and have been shown to be sensitive to distribution shift. For example, we were unable to implement one proposal by Kadavath et al. (2022) to train a language model to directly predict confidence due to hardware limitations. Our unsupervised method which uses models 'off- the-shelf' avoids these limitations. Many of the issues that make probabilistic uncertainty estimation in NLG difficult also make au- tomatic evaluation of NLG difficult. Ott et al. (2018), for instance, study how the performance of machine translation models suffers because one sentence can be translated in multiple ways. Sim- ilarly, Sai et al. (2022) discuss how paraphrase detection can be used to evaluate NLG and other related methods might transfer to uncertainty estimation. Automatic paraphrase identification can be based on comparing lexical features of two given se- quences (Fernando & Stevenson, 2008; Issa et al., 2018) or on measuring the similarity between the embeddings of the two sequences (Yu et al., 2014; Socher et al., 2011). Recently, however, SotA paraphrase identification approaches have primarily used BERT-based models to classify pairs of sequences into the classes paraphrases and not paraphrases (He et al., 2020b; Tay et al., 2021). The idea of formalising semantic equivalence via textual entailment has a long history in linguistics (Culicover, 1968) and NLP (Pad ́o et al., 2009; Androutsopoulos & Malakasiotis, 2010). Transformer-based paraphrase detection models such as EFL (Wang et al., 2021) achieve SotA per- formance on paraphrase detection benchmarks such as Quora Question Pairs Wang et al. (2017). 6 Published as a conference paper at ICLR 2023 (a) CoQA (b) TriviaQA Figure 2: (a) On CoQA open-book question answering semantic entropy demonstrates better uncer- tainty than ordinary predictive entropy with and without normalisation at larger model sizes. It also performs significantly better than p(True). (b) TriviaQA shows similar results. Identical to Fig. 1b with the addition of p(True), which was previously omitted to avoid stretching the scale. 6 EMPIRICAL EVALUATION We demonstrate that semantic entropy is an effective way to quantify the uncertainty of NLG on free-form QA tasks. Effective uncertainty measures should offer information about how reliable the model's answers are-that is, very uncertain generations should be less likely to be correct. Performance evaluation. Following prior work (e.g. Filos et al. (2019)), we evaluate uncertainty by treating uncertainty estimation as the problem of predicting whether to rely on a model generation for a given context-whether to trust an answer to a question. The area under the receiver operator characteristic curve (AUROC) metric is equivalent to the probability that a randomly chosen correct answer has a higher uncertainty score than a randomly chosen incorrect answer. Higher scores are better, with perfect uncertainty scoring 1 while a random uncertainty measure would score 0.5. The AUROC is a better measure of uncertainty for free-form question answering and NLG than calibration measures like the Brier score, which are often used in classification or for multiple choice QA. This is because the language model outputs a likelihood for a given token-sequence, but not for an entire meaning. In order to estimate the Brier score, we would need to estimate the entire probability mass assigned to any possible way of saying the correct answer. This is intractable for free form text where we do not have access to probabilities about meanings. In contrast, we can estimate the entropy because it is structured as an expected information, which makes Monte Carlo integration suitable. Model. We use the GPT-like OPT models (Zhang et al., 2022). We vary the size of the model between 2.7B, 6.7B, 13B and 30B parameters, while our headline results are all reported using the largest computationally feasible model, with 30B parameters. In all cases we use only a single un- modified model. There is no ensembling and no stochastic or Bayesian modification. We chose this because in most cases cutting-edge foundation models are not available as ensembles and are too large to efficiently perform approximate Bayesian inference with. We do not fine-tune these models on TriviaQA or CoQA but use them in their pre-trained form. Datasets. We use CoQA Reddy et al. (2019) as an open-book conversational question answering problem (in which the model answers a question using a supporting paragraph). We use the devel- opment split (∼8000 questions). We also use TriviaQA (Joshi et al., 2017) as a closed-book QA problem (in which the model must answer a question without access to a supporting paragraph). We use a subset of 8000 questions of the training split to match the size of CoQA. We evaluate correctness of our model's generations on the underlying dataset using the a fuzzy matching criterion: L(s, s(cid:48)) = 1RougeL(s,s(cid:48))>0.3. That is, we consider an answer s to be correct if its Rouge-L (Lin & Och, 2004) - a measure of the longest common subsequence - with regards to the reference answer is larger than 0.3. In Appendix B.3 we study other objective functions such as exact matching and Rouge-1 and find our method to be robust to these choices. Baselines. We compare our method against predictive entropy, length-normalised predictive en- tropy (Malinin & Gales, 2020), p(True) (Kadavath et al., 2022), and lexical similarity (similar to (Fomicheva et al., 2020)). Predictive entropy is a widely used measure of uncertainty in other 7 2.7B6.7B13B30BNumber of parameters of model0.700.75AUROCSemantic entropyNormalised entropyLexical similarity2.7B6.7B13B30BNumber of parameters of model0.600.700.80AUROCPredictive entropyp(True) Published as a conference paper at ICLR 2023 Table 2: Incorrectly answered questions have more semantically distinct answers than correct ones. On its own, this count is a reasonable uncertainty measure, though semantic entropy is better. Dataset Average # of semantically distinct answers AUROC Correctly answered Incorrectly answered Semantic entropy # distinct answers CoQA TriviaQA 1.27 1.89 1.77 3.89 0.77 0.83 0.66 0.79 domains, and has been used as a baseline without length-normalisation in, e.g., Kadavath et al. (2022). Here, the score is just the predictive entropy of the output distribution as described in Eq. (1). Length-normalised predictive entropy divides the joint log-probability of each sequence by the length of the sequence, as proposed by Malinin & Gales (2020) in the case of NLG uncertainty and further discussed in Section 3.3. Note that unlike Malinin & Gales (2020), we use only a single model, not an ensemble, and use multinomial sampling as we do for all other methods. p(True) proposed by (Kadavath et al., 2022) as a way to estimate the probability that a model's generation is correct by 'asking' the model if its answer is correct. They propose sampling M answers and constructing a new natural language question using these possible answers as context before ask- ing whether the proposed answer is correct and measuring the probability of the completion being True. An example of the format is provided in Appendix B. Note that our implementation of this uses OPT models with up to 30B parameters, while Kadavath et al. (2022) use a proprietary 52B parameter model. We are also limited computationally to 10-shot prompting while the original paper uses 20-shot prompting. Lexical similarity uses the average similarity of the answers in the answer set A: 1 j=1 sim (si, sj), where C = |A| ∗ (|A| − 1)/2, and sim is Rouge-L. Additionally, C we evaluate a margin-probability baseline (Lin et al., 2022b) in Appendix B.6, and study why it is not very predictive of model accuracy in this setting. All code and data used in our experiments is available at https://github.com/lorenzkuhn/semantic_uncertainty. (cid:80)|A| i=1 (cid:80)|A| 6.1 SEMANTIC ENTROPY UNCERTAINTY For both TriviaQA and CoQA, semantic entropy improves over baselines in predicting whether a model's answer to a question is correct. For TriviaQA, using the largest model we show in Fig. 1a we show that semantic entropy has a significantly higher AUROC than entropy in sequence-probability- space with and without length-normalisation, as well as the lexical similarity baseline. At the same time, it performs dramatically better than p(True). Similarly, we find in Fig. 1b that our method out- performs more for larger model sizes and continues to steadily improve as the model size increases, with the performance of the p(True) baseline added in Fig. 2b (not shown in the opening figure for visual clarity). For CoQA, in Fig. 2a we show that semantic entropy predicts model correctness significantly better than the baselines at larger model sizes. The ground truth answers for TriviaQA are generally single words or very short phrases, while CoQA contains both longer and shorter ground truth answers. This is why performing length- normalisation has a large effect for CoQA but no effect for TriviaQA (compare Fig. 2a and Fig. 2b). TriviaQA is also a more challenging dataset: accuracy of 50.6% against 82.3% for CoQA. We can better understand the mechanism of action for semantic entropy by examining the differ- ence between incorrect and correct answers generated by the model. In Table 2 we show that the average number of semantically distinct clusters of answers (|C|) from the 30B parameter model is significantly greater for incorrectly answered questions than correctly answered ones. This fits our predictions, which is that the model is more likely to generate incorrect answers when it is un- certain about the most likely generation. There are 10 answers generated per question, so there is substantial overlap in meaning. We also show that simply using the number of semantically distinct answers as an uncertainty measure on its own performs reasonably well. Semantic entropy has a higher AUROC than the number of distinct answers, especially for CoQA whose difficulty causes greater spread in predicted probabilities between possible answers. Finally, we can see that much of the performance gain comes from making better use of more samples. In Fig. 3a we show that for both CoQA (top) and TriviaQA (bottom) the gap between semantic entropy and length-normalised entropy widens as the number of samples increases. 6.2 HYPERPARAMETERS FOR EFFECTIVE SAMPLING Adjusting the temperature used for multinomial sampling has two competing effects on the gener- ated sequences produced by the model. Increasing the temperature increases the diversity of samples 8 Published as a conference paper at ICLR 2023 (a) (top) CoQA, (bottom) TriviaQA (b) Figure 3: (a) Semantic entropy makes better use of additional samples because it handles duplication better, the performance gap therefore continues to improve. (b) (bottom) Higher temperatures result in more diversity but less accurate generations. (top) The best performing uncertainty comes from an intermediate temperature that balances these two forces. Results on TriviaQA. (Fig. 3b, bottom figure, solid line). One would expect more diverse generations to cover the space of possible meanings more fully. Here we measure the diversity using the average overlap of the longest sub-sequence among sampled answers (1 − (cid:0)M s(cid:54)=s(cid:48)∈C Rouge-L(s, s(cid:48))). At the same time, reducing the temperature improves the average correctness of the answer (Fig. 3b, bottom figure, dashed line). Typically, more accurate models are also better at estimating uncertainty. (cid:1)−1 (cid:80) 2 In fact, we find that these two effects compete and the highest AUROC for semantic entropy and length-normalised entropy is optimised by an intermediate temperature of 0.5 (Fig. 3b, top figure). A lower temperature would improve accuracy, while a higher temperature would improve diversity. A similar figure for CoQA can be found in Appendix B. Note that prior work using predictive entropy as a baseline uses a temperature of 1.0 (Kadavath et al., 2022), which our evaluation suggests would significantly weaken the baseline relative to our implementation. 7 DISCUSSION Many natural language problems display a crucial invariance: sequences of distinct tokens mean the same thing. Addressing this directly, we introduce semantic entropy-the entropy of the distribu- tion over meanings rather than sequences-and show that this is more predictive of model accuracy on QA than strong baselines. Our unsupervised approach using 'out-of-the-box' models improves reproducibility and is easier to deploy. Unsupervised uncertainty may also help address the obser- vation raised in prior work that supervised uncertainty measures struggle with distribution shift. For semantic entropy, we introduce a novel bidirectional entailment clustering algorithm which uses a smaller natural language inference model. Our method therefore represents a middle ground be- tween fully probabilistic methods and methods that use language models to exploit aspects of natural language that are not transparently present in the model activations. We believe that this sort of joint approach is more promising than relying on either perspective on its own, especially as language models continue to improve. This will become more important in cases where language models are capable of deception, something which our method does not protect against, rather than merely being uncertain between many possible meaningful options. By combining model internals with model prediction one can hope to stay a step ahead of model capabilities. We focus on question answering because this is a particularly important free-form NLG problem with relatively clear ground truths. In the future, however, we hope our work on semantic equiva- lence can pave the way towards progress in settings like summarisation where correctness requires more human evaluation although additional progress on paraphrase identification in these settings is likely required first. Semantic likelihoods could also be extended to other tools for probabilistic uncertainty like mutual information, potentially offering new strategies for NLG uncertainty. 9 5100.660.680.700.720.740.76AUROC510#samples used to estimate entropy0.7000.7250.7500.7750.800AUROCSemantic entropy (ours)Length-normalised entropyEntropy0.250.501.001.500.7250.7500.7750.800AUROCSemantic entropy (ours)Length-normalised entropy0.250.501.001.50Temperature0.10.20.30.4AccuracyAverage correctness of sampled answersDiversity of sampled answers0.50.60.70.80.9Diversity Published as a conference paper at ICLR 2023 ACKNOWLEDGMENTS We are grateful to Geoffrey Irving, Kuba Perlin, Laura Rimell, and Miles Turpin for their advice and feedback on earlier drafts of this paper. We are also grateful to the members of the OATML group for helpful discussions about this project. ETHICS STATEMENT Our aim is to work towards safer AI systems by enabling users to understand the confidence and re- liability of language model generations. In principle, this could help mitigate many of the potential harms of NLG from foundation models such as generating false and harmful information in response to genuine questions about important topics like medical questions. However, this potential benefit comes with the risk that systematic mistakes in the assessment of uncertainty or its communication could cause unfounded and misplaced confidence. While this paper represents research progress in identifying new considerations and methods for uncertainty quantification in NLG, before deploy- ment we advise that practitioners conduct extensive evaluations specific to the deployment context to make sure that uncertainty is communicated in a way that empowers users and is not misleading or confusing. REPRODUCIBILITY STATEMENT Because of the computational cost of experimentation with foundation models, most of the relatively small amount of existing research into NLG uncertainty relies on proprietary models, finetuning of expensive models, and human evaluation. These factors put this kind of research out of reach for many academic groups. Our work takes advantage of the recently released, publicly available OPT models, and builds on this to provide an uncertainty quantification pipeline for NLG that uses entirely open source tools. Meanwhile our method requires no finetuning or training of foundation models and can work with 'off-the-shelf' existing models. We hope that this can facilitate more research on these important topics in the academic community as well as making our methods easier to replicate. We make all of our code, as well as the hand-labelled semantic equivalence dataset drawn from TriviaQA and CoQA, available under an MIT license. REFERENCES Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Man ́e. Con- crete Problems in AI Safety. arXiv, 2016. 1 Ion Androutsopoulos and Prodromos Malakasiotis. A survey of paraphrasing and textual entailment methods. Journal of Artificial Intelligence Research, 38:135–187, 2010. 6 Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020. 1 Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022. 1 Peter W Culicover. Paraphrase generation and information retrieval from stored text. Mech. Transl. Comput. Linguistics, 11(3-4):78–88, 1968. 6 Shrey Desai and Greg Durrett. Calibration of pre-trained transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 295– 302, 2020. 6 Samuel Fernando and Mark Stevenson. A semantic similarity approach to paraphrase detection. In Proceedings of the 11th annual research colloquium of the UK special interest group for compu- tational linguistics, pp. 45–52. Citeseer, 2008. 6 Angelos Filos, Sebastian Farquhar, Aidan N Gomez, Tim G J Rudner, Zachary Kenton, Lewis Smith, Milad Alizadeh, Arnoud de Kroon, and Yarin Gal. Benchmarking Bayesian Deep Learning with Diabetic Retinopathy Diagnosis. Bayesian Deep Learning Workshop at NeurIPS, 2019. 7 10 Published as a conference paper at ICLR 2023 Marina Fomicheva, Shuo Sun, Lisa Yankovskaya, Fr ́ed ́eric Blain, Francisco Guzm ́an, Mark Fishel, Nikolaos Aletras, Vishrav Chaudhary, and Lucia Specia. Unsupervised quality estimation for neural machine translation. Transactions of the Association for Computational Linguistics, 8: 539–555, 2020. 2, 7 Yarin Gal et al. Uncertainty in deep learning. PhD thesis, 2016. 1, 2 Taisiya Glushkova, Chrysoula Zerva, Ricardo Rei, and Andr ́e FT Martins. Uncertainty-aware ma- chine translation evaluation. arXiv preprint arXiv:2109.06352, 2021. 6 Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. Deberta: Decoding-enhanced bert with disentangled attention. arXiv preprint arXiv:2006.03654, 2020a. 5 Ruining He, Anirudh Ravula, Bhargav Kanagal, and Joshua Ainslie. Realformer: Transformer likes residual attention. arXiv preprint arXiv:2012.11747, 2020b. 6 Dan Hendrycks, Nicholas Carlini, John Schulman, and Jacob Steinhardt. Unsolved Problems in ML Safety. arXiv, 2022. 1 Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. Train- ing compute-optimal large language models. arXiv preprint arXiv:2203.15556, 2022. 1 Fuad Issa, Marco Damonte, Shay B Cohen, Xiaohui Yan, and Yi Chang. Abstract meaning repre- sentation for paraphrase detection. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Vol- ume 1 (Long Papers), pp. 442–452, 2018. 6 Moksh Jain, Salem Lahlou, Hadi Nekoei, Victor Butoi, Paul Bertin, Jarrid Rector-Brooks, Maksym Korablyov, and Yoshua Bengio. Deup: Direct epistemic uncertainty prediction. arXiv preprint arXiv:2102.08501, 2021. 3 Zhengbao Jiang, Jun Araki, Haibo Ding, and Graham Neubig. How can we know when language models know? on the calibration of language models for question answering. Transactions of the Association for Computational Linguistics, 9:962–977, 2021. 6 Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. arXiv preprint arXiv:1705.03551, 2017. 7 Saurav Kadavath, Tom Conerly, Amanda Askell, Tom Henighan, Dawn Drain, Ethan Perez, Nicholas Schiefer, Zac Hatfield Dodds, Nova DasSarma, Eli Tran-Johnson, et al. Language mod- els (mostly) know what they know. arXiv preprint arXiv:2207.05221, 2022. 1, 2, 3, 6, 7, 8, 9, 18 Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? Advances in neural information processing systems, 30, 2017. 1, 2 Volodymyr Kuleshov, Nathan Fenner, and Stefano Ermon. Accurate uncertainties for deep learning In International conference on machine learning, pp. 2796–2804. using calibrated regression. PMLR, 2018. 1 Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. Advances in neural information processing systems, 30, 2017. 1 Chin-Yew Lin and Franz Josef Och. Automatic evaluation of machine translation quality using In Proceedings of the 42nd Annual longest common subsequence and skip-bigram statistics. Meeting of the Association for Computational Linguistics (ACL-04), pp. 605–612, 2004. 7 Stephanie Lin, Jacob Hilton, and Owain Evans. Teaching models to express their uncertainty in words. arXiv preprint arXiv:2205.14334, 2022a. 2, 3, 6 11 Published as a conference paper at ICLR 2023 Zi Lin, Jeremiah Zhe Liu, and Jingbo Shang. Towards collaborative neural-symbolic graph semantic parsing via uncertainty. In Findings of the Association for Computational Linguistics: ACL 2022, pp. 4160–4173, 2022b. 6, 8, 19 David Mackay. Information Theory, Inference and Learning Algorithms. Cambridge University Press, 2003. 4 Andrey Malinin and Mark Gales. Predictive uncertainty estimation via prior networks. Advances in neural information processing systems, 31, 2018. 3 Andrey Malinin and Mark Gales. Uncertainty estimation in autoregressive structured prediction. arXiv preprint arXiv:2002.07650, 2020. 1, 2, 3, 4, 5, 7, 8 Andrey Malinin, Sergey Chervontsev, Ivan Provilkov, and Mark Gales. Regression prior networks. arXiv preprint arXiv:2006.11590, 2020. 3 Sabrina J Mielke, Arthur Szlam, Y-Lan Boureau, and Emily Dinan. Linguistic calibration through metacognition: aligning dialogue agent responses with expected correctness. arXiv preprint arXiv:2012.14983, 2020. 6 Kenton Murray and David Chiang. Correcting length bias in neural machine translation. arXiv preprint arXiv:1808.10006, 2018. 3, 4 Myle Ott, Michael Auli, David Grangier, and Marc'Aurelio Ranzato. Analyzing uncertainty in neural machine translation. In International Conference on Machine Learning, pp. 3956–3965. PMLR, 2018. 6 Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, David Sculley, Sebastian Nowozin, Joshua Dillon, Balaji Lakshminarayanan, and Jasper Snoek. Can you trust your model's uncertainty? evaluating predictive uncertainty under dataset shift. Advances in neural information processing systems, 32, 2019. 1 Sebastian Pad ́o, Daniel Cer, Michel Galley, Dan Jurafsky, and Christopher D Manning. Measur- ing machine translation quality as semantic equivalence: A metric based on entailment features. Machine Translation, 23(2):181–193, 2009. 6 Siva Reddy, Danqi Chen, and Christopher D Manning. Coqa: A conversational question answering challenge. Transactions of the Association for Computational Linguistics, 7:249–266, 2019. 7 Ananya B Sai, Akash Kumar Mohankumar, and Mitesh M Khapra. A survey of evaluation metrics used for nlg systems. ACM Computing Surveys (CSUR), 55(2):1–39, 2022. 6 Richard Socher, Eric Huang, Jeffrey Pennin, Christopher D Manning, and Andrew Ng. Dynamic pooling and unfolding recursive autoencoders for paraphrase detection. Advances in neural infor- mation processing systems, 24, 2011. 6 Jeff Speaks. Theories of Meaning. In Edward N. Zalta (ed.), The Stanford Encyclopedia of Philos- ophy. Metaphysics Research Lab, Stanford University, 2021. 3 Yi Tay, Vinh Q Tran, Sebastian Ruder, Jai Gupta, Hyung Won Chung, Dara Bahri, Zhen Qin, Si- mon Baumgartner, Cong Yu, and Donald Metzler. Charformer: Fast character transformers via gradient-based subword tokenization. arXiv preprint arXiv:2106.12672, 2021. 6 Sinong Wang, Han Fang, Madian Khabsa, Hanzi Mao, and Hao Ma. Entailment as few-shot learner. arXiv preprint arXiv:2104.14690, 2021. 6 Yuxia Wang, Daniel Beck, Timothy Baldwin, and Karin Verspoor. Uncertainty estimation and reduc- tion of pre-trained models for text regression. Transactions of the Association for Computational Linguistics, 10:680–696, 2022. 6 Zhiguo Wang, Wael Hamza, and Radu Florian. Bilateral multi-perspective matching for natural language sentences. arXiv preprint arXiv:1702.03814, 2017. 6 Adina Williams, Nikita Nangia, and Samuel R Bowman. A broad-coverage challenge corpus for sentence understanding through inference. arXiv preprint arXiv:1704.05426, 2017. 5 12 Published as a conference paper at ICLR 2023 Lei Yu, Karl Moritz Hermann, Phil Blunsom, and Stephen Pulman. Deep learning for answer sentence selection. arXiv preprint arXiv:1412.1632, 2014. 6 Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christo- pher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068, 2022. 2, 7 13 Published as a conference paper at ICLR 2023 Table 3: Illustration of semantic, syntactic, and lexical equivalence. Work with foundation mod- els implicitly focuses on lexical equivalence, which entails the others, but we usually care about semantic equivalence. Sentence A Sentence B Lexical Syntactic Semantic Paris is the capital of France. Paris is the capital of France. Berlin is the capital of France. France's capital is Paris. (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) Equivalence A FURTHER DETAILS ON SEMANTIC ENTROPY A.1 FURTHER DISCUSSION OF SEMANTIC EQUIVALENCE We illustrate the distinction between different kinds of equivalence in Table 3. Lexically equivalent sequences use exactly the same symbols. They are always also semantically and syntactically equiv- alent (in a given context). Syntactically equivalent sentences have the same grammatical form. But they can have different meanings (not semantically equivalent) and can use different symbols (not lexically equivalent). Semantically equivalent sentences mean the same thing, but they might have different grammatical form (not syntactically equivalent) or symbols (not lexically equivalent). Two sentences can also be both syntactically and semantically equivalent but not lexically equivalent if they match up to a synonym. Soft equivalence and transitivity. Formally, semantic equivalence is transitive. That is, if E(s, s(cid:48)) and E(s(cid:48), s(cid:48)(cid:48)) then it follows that E(s, s(cid:48)(cid:48)). However, the implementation of our bidirectional equiv- alence algorithm permits some classification errors and it is slightly 'soft'-it will sometimes return equivalent for pairs that are not quite equivalent. As a result, it is not strictly true that our equiv- alence relation is transitive, and therefore not strictly true that there is a unique set of equivalence classes. For example, the clusters might depend on the order in which the comparisons are made. In practice, however, we find that this does not pose a noticeable problem-usually, inspecting the outputs shows that the equivalence appears clear cut. However, we acknowledge this potential issue as an area for improvement in future clustering algorithms. Unequal token importance. From the perspective of meaning, some tokens can matter more than others-key words. Naive methods like predictive entropy do distinguish between key words or unimportant tokens. Supervised uncertainty methods that make use of language models in the un- certainty evaluation can potentially take this into account better. In addition, our semantic entropy approach partly adjusts for this, as discussed in Section 4.1. A.2 FURTHER ALGORITHMIC DETAILS In addition to the description of the method provided in the main body, in Algorithm 1 we provide the pseudocode for our bi-directional entailment algorithm. A.3 IMPACT OF SAMPLING METHOD ON QUALITY OF UNCERTAINTY ESTIMATE In Section 4, we study the impact of the temperature hyper-parameter on the performance of the uncertainty measures. Here, we show a variant of Fig. 3b for the CoQA dataset showing an almost identical pattern. Like TriviaQA, the optimal temperature is 0.5 despite a significantly harder prob- lem with lower accuracy, suggesting that this choice hyperparameter may generalize well. Unlike TriviaQA, normalised entropy outperforms semantic entropy at high temperatures. Beyond the temperature, there are a number of other design choices to be made when sampling: the sampling method and hyper-parameters such as top-p and top-k. Our contribution in this paper is to show the importance of these choices for uncertainty estimation which has been over- looked previously, and study the temperature in particular. While we leave the detailed study of these hyperparameters to future work, we do compare our default multinomial sampling method, to multinomial beam search sampling which focuses more on high-likelihood regions of the output space. 14 Published as a conference paper at ICLR 2023 Algorithm 1 Bidirectional Entailment Clustering Require: context x, set of seqs. {s(2), . . . , s(M )}, NLI classifier M, set of meanings C = {{s(1)}} for 2 ≤ m ≤ M do for c ∈ C do s(c) ← c0 left ← M(cat(x, s(c), "<g/>", x, s(m))) right ← M(cat(x, s(m), "<g/>", x, s(c))) if left is entailment and right is entailment then (cid:46) Compare to already-processed meanings. (cid:46) Use first sequence for each semantic-class. (cid:46) Does old sequence entail new one? (cid:46) Vice versa? (cid:46) Put into existing class. (cid:46) Semantically distinct, gets own class. c ← c (cid:83) s(m) end if end for C ← C (cid:83){s(m)} end for return C Figure 4: CoQA temperature ablation. (bottom) Similar to TriviaQA, higher temperatures mean (top) The best performance for both methods comes at a higher diversity and lower accuracy. temperature of 0.5. Unlike TriviaQA, normalised entropy outperforms semantic entropy at high temperatures. In Table 4 we show that multinomial beam search sampling yields uncertainty measures that are less predictive of model accuracy than multinomial sampling. Beam search also generates much less diverse samples. We conjecture that multinomial beam search sampling focuses too much on the most likely sequences. The diversity of this beam search corresponds to the lowest temperature result in Fig. 4. As in the main body of the paper, we measure diversity as the average lexical overlap of the answers in the answer set. Additionally, we investigate, why the semantic entropy underperforms the length-normalised entropy at high temperatures. To that end, we manually inspect and label 100 classifications of our semantic equivalence method at T=1.5, and we find that at these temperatures, many of the generated model answers are nonsensical combinations of words from the context that is provided for the question. While the likelihood of these sequences still seems somewhat predictive of the model's accuracy, semantic clustering becomes very difficult and an unreliable signal for uncertainty estimation. At this temperature, the accuracy of the semantic equivalence methods is only 61%, whereas it is over 92% at lower temperatures (see Appendix B.2) Note, that at low-temperatures, where one does gets plausible and well-formed model generations, semantic entropy does clearly outperform the baselines. This finding further underlines the im- portance of choosing appropriate sampling hyper-parameters when using entropy-based uncertainty measures in NLG. 15 0.250.501.001.500.660.680.700.720.740.76AUROCSemantic entropy (ours)Length-normalised entropy0.250.501.001.50Temperature0.30.40.50.6AccuracyAverage correctness of sampled answersDiversity of sampled answers0.40.50.60.70.8Diversity Published as a conference paper at ICLR 2023 Table 4: Multinomial beam search sampling produces sampled answers that are less diverse and thus less useful for uncertainty estimation than multinomial sampling. Sampling method Semantic Entropy AUROC Diversity of answers Multinomial sampling Multinomial beam search sampling 0.758 0.735 0.490 0.258 B EXPERIMENTAL DETAILS AND ABLATIONS We use both the OPT models2 and the Deberta-large model3 via the HuggingFace transformers library which can be easily adopted for reproducibility. All of our code is open-source and relies on no proprietary models. We use the following functions of the HuggingFace API to sample the most likely answers, and the set of answers: • To obtain the answer which is compared to the reference answer, which determines whether the question is correctly answered, we use beam search using the generate() function with num beams = 5 and do sample = True . • To obtain the answer set for uncertainty estimation, by default we use multinomial sam- pling, that is generate() using do sample = True and num beams = 1 . If indicated explicitly, we use beam multinomial sampling, that is generate() using num beams = 5 and do sample = True. We run all of our experiments on 80GB NVIDIA A100s. Testing up to 20 samples per answer on the 2.7B, 6.7B and 13B CoQA experiments, we conclude that using more than 10 samples does not significantly improve the performance of the uncertainty measure, we use 10 sampled answers per question in the remaining experiments on TriviaQA. Note, that in Table 2 we compare the 30B model on CoQA and TriviaQA where in both settings we use answer sets of size 10. We use the following prompts on CoQA and TriviaQA. We find that on CoQA, we obtain accurate model results with zero-shot prompting. While we have to use few-shot prompting to obtain accurate answers on closed-book TriviaQA. We use the following prompts for each of the settings: CoQA: [The provided context paragraph] [additional question-answer pairs] Q: [Provided question] A: where additional question-answer pairs are preceding turns of the conversation about the paragraph consisting of questions and reference answers. TriviaQA: For TriviaQA, we use a 10-shot prompt of the format: Q: Which Oscar-nominated film had You Sexy Thing as its theme song? A: The Full Monty Q: Which Joan's career revived in Whatever Happened to Baby Jane? actor won the Best Actor Oscar for The Philadelphia Story? James Stewart (...) Q: In which river is the Boulder Dam? A: Crawford Q: Which much-loved A: A: To account for generations where the model continues the Q:...A:... pattern after providing an answer to the given question, we trim all generations by pattern matching for a selection of stop- words that we observe in the generations: Q:, Question:, QUESTION: and questions:. 2https://huggingface.co/docs/transformers/model doc/opt 3https://huggingface.co/docs/transformers/model doc/opt 16 Published as a conference paper at ICLR 2023 Table 5: Automatic evaluation of question answering is highly accurate as compared to human evaluation. We evaluate how accurate the automatic evaluation metric. The predictions, in this settings are the automatically determined accuracy labels on our question answering task, and the ground truth are human labels for the accuracy of the provided model generation given the reference answer Data set Accuracy of automatic evaluation CoQA TriviaQA 0.89 0.96 Table 6: TriviaQA: the exact choice of accuracy metric for the free-form QA task has little effect on the assessment of the quality of the uncertainty measure. Metric AUROC Accuracy Semantic entropy Normalised entropy Rouge-L(y, y(cid:48)) > 0.3 Rouge-L(y, y(cid:48)) > 0.5 Rouge-1(y, y(cid:48)) > 0.5 Exact matching 0.828 0.835 0.835 0.828 0.802 0.810 0.810 0.808 0.506 0.456 0.457 0.394 B.1 RELIABILITY OF ACCURACY METRIC AS COMPARED TO HUMAN EVALUATION In our experiments, we evaluate how well our uncertainty measures predict the model's accuracy when answering a given question. The choice of accuracy metric is thus a crucial component of our experimental setup. Generally, it has been shown to be difficult to develop automatic metrics for free-form generation that correlate well with human evaluations. We thus verify our choice of accuracy criterion: Rouge-L(y, y(cid:48)) > 0.3, for a given reference answer y and a model generation y(cid:48). We manually evaluate the accuracy of 200 answers of the 30B parameter model on both COQA and on TriviaQA, and evaluate how closely the human evaluation matches the automatic evaluation. We find that on both data sets, the accuracy of the automatic labels as compared to the human labels as the ground truth is high, see Table 5. B.2 TESTING THE BI-DIRECTIONAL ENTAILMENT CLASSIFIER To the best of our knowledge, this paper is the first application of the bi-directional entailment approach to identifying answers with the same meaning in question answering. Since this is a core component of our approach, we verify how accurately this approach identifies model answers with the same meaning. To this end, we manually label 300 samples for each of TriviaQA and CoQA produced by the 13B parameter model to provide a ground truth as to whether or not they mean the same thing. We find that the model achieves an accuracy of 92.7% and 95.3% respectively. B.3 SENSITIVITY OF RESULTS TO ACCURACY METRIC In principle, the choice of metric to decide whether or not an answer is 'correct' might have a large effect on the assessment of our method and baselines. However, we find empirically that our results are relatively insensitive to the choice of accuracy metric. In Table 6 we show that for TriviaQA the choice of accuracy metric for the question answering has almost no effect on the measured AUROC of the uncertainty estimation, despite making the measured accuracy of the model's generation significantly different. In particular, the exact matching requirement reduces the accuracy significantly but has little effect on the AUROCs. For CoQA, which is an open-book QA task with greater answer variability and longer answers the results are broadly similar (see Table 7) except for the exact matching accuracy criterion which is too demanding because of the much larger variety of possible answers for this task. 17 Published as a conference paper at ICLR 2023 Table 7: CoQA: the exact choice of the accuracy metric for the free-form open-book QA task has little effect on the assessment of the quality of the uncertainty measure except for the use of exact matching. For CoQA, getting an exact match is significantly harder. Metric AUROC Accuracy Semantic entropy Normalised entropy Rouge-L(y, y(cid:48)) > 0.3 Rouge-L(y, y(cid:48)) > 0.5 Rouge-1(y, y(cid:48)) > 0.3 Rouge-1(y, y(cid:48)) > 0.5 Exact matching 0.7672 0.7379 0.7672 0.7397 0.6749 0.7533 0.7290 0.7533 0.7309 0.6727 0.8239 0.7657 0.8239 0.7677 0.6459 (a) CoQA (b) TriviaQA Figure 5: Accuracy improves with model size, as does semantic entropy's uncertainty performance. At the smallest model size, both accuracy and uncertainty diminish. B.4 ACCURACY ABLATIONS WITH MODEL SIZE We confirm that increasing the model size improves the accuracy of the generations on both QA datasets (see Fig. 5a and Fig. 5b). Semantic entropy's uncertainty performance is also shown for context. B.5 EXAMPLE P(TRUE) FORMAT The format of the prompt, reproduced here for convenient reference from the original source Kada- vath et al. (2022), is: James Monroe Question: Who was the third president of the United States? Here are some brainstormed ideas: Thomas Jefferson John Adams Thomas Jefferson George Washington Possible Answer: James Monroe Is the possible answer: (A) True (B) False The possible answer is: where the "brainstormed answers" are from the set of sampled answers A and P(True), i.e. the likelihood of the next token being True is taken as the uncertainty measure. The authors note that doing the above needs to be done in a few-shot manner and does not work well as in a zero-shot format. In our experiments, we use a few-shot prompt with 10 examples. 18 1.3B2.7B6.7B13B30BNumber of parameters of model0.700.750.80Accuracy on QA taskAUROC of Semantic entropy1.3B2.7B6.7B13B30BNumber of parameters of model0.20.40.60.8Accuracy on QA taskAUROC of Semantic entropy Published as a conference paper at ICLR 2023 (a) CoQA (b) TriviaQA Figure 6: The margin probability, i.e. the difference between the likelihood of the most likely answer and the likelihood of the second most likely answer, is not very predictive of models' accuracy on CoQA open-book question answering (a) nor on TriviaQA (b). Identical to Fig. 2 with the addition of Margin probability which was previously omitted to avoid stretching the scale. B.6 MARGIN-PROBABILITY BASELINE We additionally compare our method to the margin probability method used for neural-symbolic parsing in Lin et al. (2022b): Hmargin(p(y | x, D)) = p (cid:16) y(1) | x, D (cid:17) (cid:16) − p y(2) | x, D (cid:17) , where y(1) is the top-1 beam search result and y(2) is the top-2 beam search result. Initially, running the method as proposed in Lin et al. (2022b) using a 13B parameter model on CoQA, we find that Hmargin is not very predictive of the model's accuracy on answering questions in CoQA achieving an AUROC of 0.54. We hypothesise that two factors contribute to this poor performance. First, since this measure only looks at the difference of likelihoods, the information about the magnitude of the likelihood of a given answer is lost. Second-analogously to the predictive entropy-it would be important to take semantic uncertainty into account when computing Hmargin. Manually inspecting model answers on CoQA, and the corresponding Hmargin, we see that the margin between two semantically equiv- alent answers and two semantically distinct answers is often similar. That is, this measure does not distinguish between uncertainty between paraphrases of the same meaning (in which case the model might actually be confident about meaning of the answer), and the model's uncertainty about which semantically distinct meaning is correct. We find that if instead of obtaining y(1) and y(2) by multinomial sampling (as in our other ex- periments) instead of by beam search, this second problem becomes less pronounced and Hmargin performs better while still being clearly outperformed by the other methods we study. We report our full results in Fig. 6. Table 8: Example of challenges for Hmargin. Hmargin does not distinguish between lexical and semantic uncertainty and thus can not distinguish cases where the model is certain about the cor- rect answer (but uncertain about the precise formulation) as in row 1, and cases where the model is uncertain about the correct answer as in row 2. The semantic entropy correctly indicates low uncertainty in the first case and high uncertainty in the second case. y(1) y(2) Thomas Edison. Thomas. Edison. George. Hmargin 0.90 0.36 Semantic entropy 0.10 0.87 19 2.7B6.7B13B30BNumber of parameters of model0.600.70AUROCSemantic entropyNormalised entropyLexical similarity2.7B6.7B13B30BNumber of parameters of model0.600.700.80AUROCPredictive entropyp(True)Margin probability
http://arxiv.org/abs/2302.09659v1
2023-02-19T19:29:59
2023-02-19T19:29:59
Interpret Your Care: Predicting the Evolution of Symptoms for Cancer Patients
Cancer treatment is an arduous process for patients and causes many side-effects during and post-treatment. The treatment can affect almost all body systems and result in pain, fatigue, sleep disturbances, cognitive impairments, etc. These conditions are often under-diagnosed or under-treated. In this paper, we use patient data to predict the evolution of their symptoms such that treatment-related impairments can be prevented or effects meaningfully ameliorated. The focus of this study is on predicting the pain and tiredness level of a patient post their diagnosis. We implement an interpretable decision tree based model called LightGBM on real-world patient data consisting of 20163 patients. There exists a class imbalance problem in the dataset which we resolve using the oversampling technique of SMOTE. Our empirical results show that the value of the previous level of a symptom is a key indicator for prediction and the weighted average deviation in prediction of pain level is 3.52 and of tiredness level is 2.27.
[ "Rupali Bhati", "Jennifer Jones", "Audrey Durand" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09659v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09659v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Interpret Your Care: Predicting the Evolution of Symptoms for Cancer Patients Rupali Bhati 1, Jennifer Jones 2, Audrey Durand 1,3 1 Universit ́e Laval 2 Princess Margaret Cancer Centre, University Health Network 3 CIFAR AI Chair 3 2 0 2 b e F 9 1 ] G L . s c [ 1 v 9 5 6 9 0 . 2 0 3 2 : v i X r a Abstract Cancer treatment is an arduous process for patients and causes many side-effects during and post-treatment. The treatment can affect almost all body systems and result in pain, fatigue, sleep disturbances, cognitive impairments, etc. These conditions are often under-diagnosed or under-treated. In this paper, we use patient data to predict the evolution of their symptoms such that treatment-related impairments can be prevented or effects meaningfully ameliorated. The focus of this study is on predicting the pain and tiredness level of a patient post their diagnosis. We implement an interpretable decision tree based model called LightGBM on real-world patient data consisting of 20163 patients. There exists a class imbalance problem in the dataset which we resolve using the oversampling technique of SMOTE. Our empirical results show that the value of the previous level of a symptom is a key indicator for prediction and the weighted average deviation in prediction of pain level is 3.52 and of tiredness level is 2.27. Introduction Nearly half of Canadians are expected to receive a diag- nosis of cancer in their lifetime (Brenner et al. 2020). Un- like other chronic diseases where disability is commonly caused by the disease process, disability associated with cancer is often caused more by treatment than the disease itself (Short PF 2008). Individual cancer patients may un- dergo different treatments, for different amounts of time and may even suffer from multiple diagnoses. Such experiences render the patients with distinct symptoms along their treat- ment, for example pain, fatigue, sleep disturbances, or cog- nitive impairments. There is a need for tailored models of rehabilitation that account for the fact that "one size is not likely to fit all" needs of different cancer survivors (Chan et al. 2021). To this aim, in many cancer centres, patient symptom data is collected via surveys which are filled by the patient when they come for their cancer clinic visits. How- ever, asking patients to fill in surveys about their health con- ditions too often can be very burdening. Therefore, there is a need to systematically identify the adverse effects of cancer such that they can be treated efficiently. Our aim is to leverage previously collected patient re- ported data to predict the evolution of a patient's symptoms. Copyright © 2022, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. Predicting when a patient encounters high levels of symp- tom burden may help clinicians take precautionary measures to avoid such situations or be able to effectively manage the patient's conditions. For a predictive model to be used within such an application, it should be interpretable by clin- icians (Zhu et al. 2014). The clinician not only needs to see the predicted value of the symptom but also needs to under- stand the criteria based on which the prediction is made. In this paper we, therefore, propose an interpretable pipeline for predicting the level of two different symptoms, i.e. pain and tiredness levels, using LightGBM (Ke et al. 2017), a decision tree (DT) based model which is widely used for its efficiency and interpretability. DT based methods have a wide application in healthcare (Podgorelec, Kokol, and et al. 2002; Rufo et al. 2021) and cancer-related ap- plications, for example to predict breast cancer survivabil- ity (Khan et al. 2008). Although other, possibly more com- plex, predictive models have displayed good performances at predicting future symptoms of oncology patients (N et al. 2018), there has been resistance to adopting these machine learning based methods in clinical practice due to a per- ception that these are "black-box" techniques and incom- patible with decision-making based on evidence and clin- ical experience (Zhu et al. 2014). Therefore, the proposed pipeline rather relies on an interpretable approach based on DTs, combined with a training procedure based on oversam- pling (Chawla et al. 2002) to compensate for the important data imbalance observed across the different values of symp- tom level. By evaluating this approach against a naive pre- dictor based solely on prior distributions of symptoms, we highlight the necessity of using evaluation metrics that com- pensate for data imbalance in order to evaluate fairness in model performances. Finally, although a feature importance analysis of our models reveals that the previous symptom value plays an important role in predicting the current symp- tom value, our results show a clear benefit in leveraging clin- ical variables in the predictions and, in some cases, the cor- relation between symptoms. Problem Statement Post diagnosis, a patient visits the doctor or clinician either when they are going through a treatment or require some assistance. These visits can take place at irregular intervals. During such visits, the patient is asked to fill a survey doc- Figure 1: Example of symptom evolution for one patient umenting their symptoms. Pain and tiredness are two symp- toms which acutely affect the overall quality of life of a pa- tient undergoing cancer treatment. Both symptoms are doc- umented by the patient as a discrete value between 0 and 10, where 0 is the lowest level of pain/tiredness a patient can feel and 10 is the highest based on the Edmonton Symptom As- sessment Scale (ESAS) (Watanabe, Nekolaichuk, and Beau- mont 2012). To demonstrate how the symptoms of a patient can evolve over a period of time, Figure 1 shows an example of the evolution of a patient's symptoms along a timeline. We have access to a dataset of real cases collected for years 2013-2019 on 20163 patients. On average, there are 5.95 observations per patient. Four cancer types are included in this analysis, namely, breast, colorectal, lymphoma and head and neck. The dataset includes patient information, i.e., sex, age, cancer type, and surgery data, in addition to the survey data, i.e., information about the patient's symptoms, including ESAS values and Patient Reported Functional Sta- tus (PRFS) measures (Popovic et al. 2018) which monitor overall nutritional status in patients. For the purpose of this study, we focus on predicting some important symptoms us- ing clinical and demographic information of the patient and their previous symptom values which are summarised in Ta- ble 1 along with the values each feature can take. To avoid a situation where the future observations of a patient are in the training set while the older observations are in the test set, we split the dataset based on a date. The surveys before the date '2017-10-04' are in the training set and the ones after this date are in the test set. This leads to a 75%-25% split between the training and test set, respec- tively. The distribution of number of samples in each class can been seen in Figure 2 for each symptom. We observe that there are class imbalance problems, where ∼ 44% and ∼ 22% of the outputs belong to one class (level 0) for pain and tiredness, respectively. It is also noted that the number of samples in a class are inversely proportional to the symptom level. This occurs because high levels of pain and tiredness levels are relatively rarer events. This bias in the data can lead to unfairness in the model's predictions and therefore Figure 2: Distribution of number of samples over classes for pain and tiredness levels Variable Sex Age Cancer type Number of days between the di- agnosis and the survey date Number of days between the pre- vious and the current survey date Previous pain level Previous tiredness level Possible values male, female 18 to 93 breast, head and neck, lymphoma, colorectal 5 to 23091 (∼ 63 years) 1 to 2002 (∼ 5 years) {0,1,2,3,4,5,6,7,8,9,10} {0,1,2,3,4,5,6,7,8,9,10} Table 1: Variables available for prediction inequity in a patient's treatment and may exacerbate health care disparities (Rajkomar et al. 2018). Methodology In this section, we propose a pipeline to predict the symp- tom levels of a patient while trying to maintain equal per- formance as much as possible over the different classes. As the values to predict are discrete (they belong to the finite, discrete set of symptom levels), we formulate this problem as a classification problem. We propose to evaluate candi- date strategies using an interpretable metric that accounts for class imbalance, ensuring that the performance over all groups of patients (based on their symptoms) is equally rep- resented in the global evaluation score. Predictive model Clinical providers and other decision makers in healthcare note interpretability of model predictions as a priority for implementation and utilization (Ahmad, Teredesai, and Eck- ert 2018). To this end, we use DTs for prediction as each decision point can be visualised individually by clinicians. Among several DT algorithms, we select LightGBM for sev- eral reasons. Firstly, LightGBM is a gradient boosting DT al- gorithm. Gradient boosting is an approach where new mod- els are created that predict the residuals or errors of prior models and then added together to make the final prediction. It is called gradient boosting because it uses a gradient de- scent algorithm to minimize the loss when adding new mod- els which is more beneficial as compared to other DT algo- rithms that either train the different models separately before aggregating them or do not use multiple models at all. Sec- ondly, instead of building trees that have a uniform depth across all branches, LightGBM expands the tree leaf-wise (up to a maximum tree depth given as a parameter), resulting in much lighter trees and making it suitable for high-speed and low memory consumption. For predicting each symptom (pain and tiredness), we consider two variants of LightGBM models. The first vari- ant relies on clinical variables (first five rows of Table 1) and previous level of the predicted symptom (row 6 or 7 of Table 1) in the prediction, while the second variant uses all clinical variables in addition to previous levels of both symptoms (all rows of Table 1). We refer to the first variants as LP1 and LT1, and to the second variants as LP2 and LT2, for pain and tiredness respectively. by data Inspired imbalance Fighting previous works (Yang Zhao and Tsui 2018), we rely on Synthetic Minority Oversampling TEchnique (SMOTE) (Chawla et al. 2002) to address class imbalance by generating synthetic samples. At training time, SMOTE over-samples the minority classes so that the trained model sees the same number of data points of these classes as for the majority class. A minority class is over-sampled by taking each of its samples and introducing synthetic examples along the line segments joining any/all of the k minority class nearest neighbours. For our experiments, we use k = 5. Training To determine the maximum tree depth parameter for LightGBM, we perform a 5-fold cross-validation on the training set (90046 samples from 16674 patients) for tree depths values between 1 and 25 (as the performance satu- rates after 25). The maximum tree depth value minimizing the WMAE metric (described below using Equations 1, 2, 3) averaged over the 5 folds is then used for retraining a Light- GBM model using on the whole training dataset. Baselines We compare the performance of the LightGBM models with two baselines models. We refer to these baselines as NP and PV for naive prior and previous value, respectively. Naive prior This baseline is a naive strategy that always predicts the dominant (most frequent) symptom level (i.e., 0 for both pain and tiredness). Previous value This baseline is slightly smarter than NP. It predicts the current symptom level to be the same as the previous symptom level, which could have been recorded at any time in the past because surveys are collected at irregular intervals. Therefore, the previous value may or may not be a good indicator of the current value of the symptom. Metrics In case of imbalanced classes, there can often be misleading evaluation metrics where mistakes on a minority class can be hidden by good performance on a dominant class. This can lead to unfairness in the treatment of patients, for example, due to the high frequency of low pain level in the data, we might underestimate the level of pain a patient might be in. To this end, we use weighted metrics such that the model can focus on achieving good performance on individual classes as well as overall. Let C denote the set of classes. We mea- sure the performance of a given strategy on each class c ∈ C using the mean absolute error (MAE) : MAEc = 1 Nc Nc(cid:88) i=1 |yi − ˆyi| , (1) where yi is the true value of the ith sample in class c, ˆyi is the value predicted by the strategy for the ith sample in class c, and Nc is the number of samples belonging to class c. The MAE corresponds to the absolute deviation in the symptom level making it interpretable for clinicians to infer and anal- yse. Therefore, a good model would have a low MAE so that for the correct predictions, it would be zero and for the incor- rect predictions, the model would predict a symptom level closer to the true symptom level. We combine these val- ues using the weighted-MAE (WMAE), which essentially gives value to the MAE of each class inversely proportional to the number of samples in that class. Therefore, mistakes on a class for which there is little data account for more in the WMAE. To calculate the WMAE, we first calculate the weight of each class c as wc = maxc(cid:48)∈C Nc(cid:48) Nc . (2) The weight will therefore be of value 1 for the class with the largest amount of data, and would be 10 times larger for a class with 10 times less data. We can then compute the global WMAE as WMAE = (cid:80) c∈C wcMAEc (cid:80) c∈C wc . (3) Results For each symptom, we evaluate the performance of the four considered strategies: the two baselines (NP and PV) and the two variants of LightGBM models (LP1/LT1 and LP2/LT2). We consider both the performance per class (MAEc) and the global performance (WMAE). Table 2 shows the results obtained for the task of pain level prediction. Recall that the dominant class for pain level is class 0, therefore, the NP model predicts 0 every- where. If we did not account for class imbalance, the aver- age of the MAEc's would be 55/11 = 5, which is lower than the WMAE. Even worse, the global MAE would be 1.65. This shows how low MAE values for high frequency classes can compensate for the high MAE values of low frequency classes, ultimately leading to an unfair metric to evaluate the performance of a model. In that case, the model would NP 0 1 2 3 4 5 6 7 8 9 10 MAE0 MAE1 MAE2 MAE3 MAE4 MAE5 MAE6 MAE7 MAE8 MAE9 MAE10 WMAE 8.72 PV 0.52 0.91 1.3 1.5 1.82 2.04 2.39 2.76 2.89 2.98 5.03 3.88 LP1 0.8 1.34 1.89 2.11 2.3 2.45 2.54 2.67 2.65 2.59 4.41 3.52 LP2 0.8 1.35 1.88 2.09 2.26 2.46 2.55 2.72 2.62 2.64 4.53 3.57 Table 2: Prediction performance per pain level (MAEc) and global performance (WMAE) for each strategy NP 0 1 2 3 4 5 6 7 8 9 10 MAE0 MAE1 MAE2 MAE3 MAE4 MAE5 MAE6 MAE7 MAE8 MAE9 MAE10 WMAE 8.43 PV 0.7 0.99 1.22 1.41 1.55 1.71 1.91 2.06 2.2 2.4 3.25 2.65 LT1 0.84 1.21 1.6 1.86 2.02 2.23 2.29 2.17 2.17 2 2.63 2.33 LT2 0.83 1.21 1.59 1.86 2.01 2.22 2.27 2.18 2.15 2.03 2.52 2.27 Table 3: Prediction performance per tiredness level (MAEc) and global performance (WMAE) for each strategy predict high frequency classes more often and still be able to maintain a good average MAE. In application, the model would predict high levels of pain less often which would be detrimental to the patients who might need immediate care. The LP1 model performs the best overall suggesting that using the previous tiredness level is not useful to pre- dict the pain level. Although the discrepancy between class performance is slightly attenuated with the LP1 model com- pared with other strategies, we should still note that, its per- formance (MAEc) is still inversely proportional to the class density. This indicates that the LP1 model is still unfair to- wards individuals with stronger pain and further work would probably be needed to make it clinically acceptable. Table 3 shows the results obtained for the 4 models used to predict the tiredness level. The dominant class here is once again class 0. Unsurprisingly, we observe lower WMAE when predicting tiredness than pain since the former suffers less class imbalance. Moreover, it can be observed that LT2 performs better than LT1 indicated by the lower WMAE. This suggests that adding the previous pain level is a good indicator to predict the tiredness level. It is interesting to note that the advantage of LightGBM- Figure 3: Feature Importance obtained from LightGBM model to predict pain (LP1) Figure 4: Feature Importance obtained from LightGBM model to predict tiredness using previous pain level (LT2) based models is observed for higher symptom levels, i.e., MAEc for c > 6 is higher with PV than with LP1/LP2 and MAEc for c > 7 is higher with PV than with LT1/LT2. This suggests that patients with higher symptom levels would benefit the most from more advanced models. Figures 3 and 4 show the importance of each feature in terms of their SHAP (Lundberg and Lee 2017) values for the LP1 and LT2 models, respectively. The SHAP value of a feature indicates the impact of the feature on the magnitude of the output, helping to understand the contribution of each feature to each class. For both symptoms, we observe that previous symptom levels strongly contribute to the predic- tion for current symptom levels. Conclusion In this study, we predict the pain and tiredness level of a pa- tient using their clinical and demographic data and previous observations of the symptom levels. The results demonstrate the need for weighted metrics and the importance of previ- ous symptom levels. In the future, we want to formulate this problem as a a reinforcement learning problem and model the context-reward relationship using the DTs as discussed in (Elmachtoub et al. 2018). We also plan to predict more qualitative measures like the indicator of quality of life. Acknowledgements We thank Mathieu Godbout for his feedback on the paper and the CanRehab team for their generous support. References Ahmad, M. A.; Teredesai, A.; and Eckert, C. 2018. Inter- pretable Machine Learning in Healthcare. In 2018 IEEE In- ternational Conference on Healthcare Informatics (ICHI), 447–447. Brenner, D. R.; Weir, H. K.; Demers, A. A.; Ellison, L. F.; Louzado, C.; Shaw, A.; Turner, D.; Woods, R. R.; and Smith, L. M. 2020. Projected estimates of cancer in Canada in 2020. CMAJ, 192(9): E199–E205. Chan, R.; Nekhlyudov, L.; Duijts, S.; and et al. 2021. Fu- ture research in cancer survivorship. J Cancer Surviv (2021) https://doi.org/10.1007/s11764-021-01102-x. Chawla, N.; Bowyer, K.; Hall, L.; and Kegelmeyer, W. 2002. SMOTE: Synthetic Minority Over-Sampling Technique. J. Artificial Intelligence Research, vol. 16, pp. 321-357, 2002. Elmachtoub, A. N.; McNellis, R.; Oh, S.; and Petrik, M. 2018. A Practical Method for Solving Contextual Bandit Problems Using Decision Trees. arXiv:1706.04687. Ke, G.; Meng, Q.; Finley, T.; Wang, T.; Chen, W.; Ma, W.; Ye, Q.; and Liu, T.-Y. 2017. LightGBM: A Highly Efficient Gradient Boosting Decision Tree. In Guyon, I.; Luxburg, U. V.; Bengio, S.; Wallach, H.; Fergus, R.; Vishwanathan, S.; and Garnett, R., eds., Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc. Khan, M. U.; Choi, J. P.; Shin, H.; and Kim, M. 2008. Pre- dicting breast cancer survivability using fuzzy decision trees for personalized healthcare. In 2008 30th Annual Interna- tional Conference of the IEEE Engineering in Medicine and Biology Society, 5148–5151. Lundberg, S. M.; and Lee, S.-I. 2017. A unified approach to interpreting model predictions. In Proceedings of the 31st international conference on neural information processing systems, 4768–4777. N, P.; Puschmann D, B. P.; B, C.; X, H.; and R, M. 2018. Learning from data to predict future symptoms of oncology patients. arXiv preprint arXiv:1804.09028. Podgorelec, V.; Kokol, P.; and et al., S. B. 2002. De- cision Trees: An Overview and Their Use in Medicine. In: Journal of Medical Systems 26, 445–463 (2002). https://doi.org/10.1023/A:1016409317640. Popovic, G.; Harhara, T.; Pope, A.; Al-Awamer, A.; Baner- jee, S.; Bryson, J.; Mak, E.; Lau, J.; Hannon, B.; Swami, N.; et al. 2018. Patient-reported functional status in outpatients with advanced cancer: correlation with physician-reported scores and survival. Journal of pain and symptom manage- ment, 55(6): 1500–1508. Rajkomar, A.; Hardt, M.; Howell, M. D.; Corrado, G.; and Chin, M. H. 2018. Ensuring Fairness in Machine Learn- ing to Advance Health Equity. Annals of internal medicine, 169(12), 866–872. https://doi.org/10.7326/M18-1990. Rufo, D. D.; Debelee, T. G.; Ibenthal, A.; and Negera, W. G. 2021. Diagnosis of Diabetes Mellitus Using Gradient Boost- ing Machine (LightGBM). Diagnostics, 11(9). Short PF, B. R., Vasey JJ. 2008. Work disability associ- ated with cancer survivorship and other chronic conditions. Psycho-oncology, 17(1), 91–97. Watanabe, S. M.; Nekolaichuk, C. L.; and Beaumont, C. 2012. The Edmonton Symptom Assessment System, a pro- posed tool for distress screening in cancer patients: develop- ment and refinement. Psycho-Oncology, 21(9): 977–985. Yang Zhao, Z. S.-Y. W.; and Tsui, K. L. 2018. A Frame- work of Rebalancing Imbalanced Healthcare Data for Rare Events' Classification: A Case of Look-Alike Sound-Alike Mix-Up Incident Detection. In: Journal of Healthcare En- gineering https://doi.org/10.1155/2018/6275435. Zhu, M.; Cheng, L.; Armstrong, J. J.; Poss, J. W.; Hirdes, J. P.; and Stolee, P. 2014. Using machine learning to plan re- habilitation for home care clients: Beyond "black-box" pre- In Machine learning in healthcare informatics, dictions. 181–207. Springer.
http://arxiv.org/abs/2302.09657v1
2023-02-19T19:13:24
2023-02-19T19:13:24
Table Tennis Stroke Detection and Recognition Using Ball Trajectory Data
In this work, the novel task of detecting and classifying table tennis strokes solely using the ball trajectory has been explored. A single camera setup positioned in the umpire's view has been employed to procure a dataset consisting of six stroke classes executed by four professional table tennis players. Ball tracking using YOLOv4, a traditional object detection model, and TrackNetv2, a temporal heatmap based model, have been implemented on our dataset and their performances have been benchmarked. A mathematical approach developed to extract temporal boundaries of strokes using the ball trajectory data yielded a total of 2023 valid strokes in our dataset, while also detecting services and missed strokes successfully. The temporal convolutional network developed performed stroke recognition on completely unseen data with an accuracy of 87.155%. Several machine learning and deep learning based model architectures have been trained for stroke recognition using ball trajectory input and benchmarked based on their performances. While stroke recognition in the field of table tennis has been extensively explored based on human action recognition using video data focused on the player's actions, the use of ball trajectory data for the same is an unexplored characteristic of the sport. Hence, the motivation behind the work is to demonstrate that meaningful inferences such as stroke detection and recognition can be drawn using minimal input information.
[ "Kaustubh Milind Kulkarni", "Rohan S Jamadagni", "Jeffrey Aaron Paul", "Sucheth Shenoy" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09657v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09657v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.AI", "cs.LG" ]
Table Tennis Stroke Detection and Recognition Using Ball Trajectory Data Kaustubh Milind Kulkarni [email protected] Jeffrey Aaron Paul [email protected] Abstract In this work, the novel task of detecting and classifying table tennis strokes solely using the ball trajectory has been explored. A single camera setup positioned in the umpire's view has been employed to procure a dataset consisting of six stroke classes executed by four professional table tennis players. Ball tracking using YOLOv4, a traditional object detection model, and TrackNetv2, a temporal heatmap based model, have been implemented on our dataset and their performances have been benchmarked. A mathematical approach developed to extract temporal boundaries of strokes using the ball trajectory data yielded a total of 2023 valid strokes in our dataset, while also detecting services and missed strokes successfully. The temporal convolutional network developed performed stroke recognition on completely unseen data with an accuracy of 87.155%. trained Several machine learning and deep learning based model architectures have been for stroke recognition using ball trajectory input and benchmarked based on their performances. While stroke recognition in the field of table tennis has been extensively explored based on human action recognition using video data focused on the player's actions, the use of ball trajectory data for the same is an unexplored characteristic of the sport. Hence, the motivation behind the work is to demonstrate that meaningful inferences such as stroke detection and recognition can be drawn using minimal input information. 1. Introduction Ball tracking for sports is a popular task in computer vision with a wide range of practical applications. Data from ball tracking can be used for automated umpiring systems, generate game analytics as well as provide technical feedback to the players, and aid in sports training. Table tennis is one of the fastest racket sports involving a range of different strokes. Presently, table tennis ball tracking systems are limited to umpiring purposes and kinematic parameters of the ball during gameplay in order to increase the popularity and public outreach of the sport. Rohan S Jamadagni [email protected] Sucheth Shenoy [email protected] However, the instances of ball trajectory data being used to bring about details regarding the technical aspects in table tennis such as the strokes executed are scarce. Hence, we present our work carried out in this direction, which involves detecting and recognizing strokes executed by professional table tennis players using two-dimensional ball trajectory data obtained from a single camera feed. Table tennis strokes vary from each other in terms of speed and spin imparted on the ball. On manual inspection, slow strokes such as pushes and lobs can be easily distinguished from fast strokes like flicks and flats based on the ball velocity along the length of the table. The presence of spin on the ball in the case of topspin stroke results in a Magnus force acting in the downward direction on the ball and hence, affecting the trajectory of the ball. Therefore, although being of similar speeds, the strokes involving spin on the ball like topspin strokes have discernible differences in the trajectory of the ball as compared to the block strokes, which lack the same amount of spin. The work presented in this paper builds upon these premises and thus, explores the possibility of performing stroke recognition for table tennis using only the two-dimensional ball trajectory data. 2. Related works The preliminary works involving ball tracking in table tennis mainly focused on developing fast models which track the ball to aid an umpire's judgments in the sport. For example, the work carried out by Wong and Dooley [1] discusses algorithms exploiting the spatial and temporal information from table tennis match videos to detect the ball during the toss of a service and provides its decision on the validity of the service based on the rules of the game. Color segmentation and stable principal component pursuit methods have been used by Chang-Hung Hung [2] for detecting the ball present in the frames captured by a high- speed camera during ball toss of a service and hence identify illegal ball toss based on the ball trajectory. Hnin Myint et al. [3] have used stereo videos captured by a system of two cameras to detect and track a table tennis ball and generate the three-dimensional trajectory of the ball, developing a precursor for automatic umpiring systems. The more recent works in the domain have been focussed on the implementation of machine learning and deep learning based approaches for table tennis ball tracking and analysis of the ball trajectory. Yun-Feng Ji et al. [4] have implemented a Visual Object Detection with a Computational attention System (VOCUS) system for image segmentation using color channel information and have used machine learning algorithms to detect table tennis balls in the form of a smear as captured by the frames of a low-speed camera, with the best accuracy of 87%. A method to obtain three-dimensional kinematic parameters of the table tennis ball using a single camera feed is presented by Jordan Calandre et al. [5][6], where a 2D convolutional neural network is used to extract the apparent ball size and hence, derive the depth information for the ball position. Fufeng Qiao [7] has discussed the application of deep learning based Deep Convolutional Neural Network- Long Short Term Memory (DCNN-LSTM) model for ball tracking and prediction of the ball trajectory. Apart from works based on computer vision, Ralf Schneider et al. [8] have conducted a statistical analysis on a database of table tennis ball trajectories and have discussed the effects of ball size, weight, spin, and speed on the trajectory. The task of stroke detection and classification is an emerging application of computer vision and pattern recognition in table tennis. Though plenty of research work has been carried out using sensor-based approaches, only a reasonable amount of work has been carried out in this purview solely based on video data, focusing on action recognition performed on the player. A combination of vision and IMU sensor-based approach has been developed by Yapeng Gao et al. [9] for stroke recognition using 6D racket pose data. Stroke recognition and detection with an average accuracy of 88% - 100% for the forehand and backhand variations of the push stroke has been carried out using three-dimensional pose estimation data from IR depth camera by Habiba Hegazy et al. [10]. Kadir Atkas et al. [11] have implemented a spatiotemporal combination of RGB and optical flow based methods for stroke recognition task, obtaining a test accuracy 90.7% on the MediaEval Challenge 2020 dataset. The application of optical flow singularity for stroke detection has been discussed by Jordan Calandre [12]. They obtained a best accuracy of 14.12% on the test set of the MediaEval 2019 Sports Video Annotation "Detection of Strokes in Table Tennis" task [13]. A twin spatiotemporal convolutional network implementing 3D attention mechanism has been used by Pierre-Etienne Martin et al. [14] for stroke classification. The attention blocks show a 5% the classification accuracies compared to their baseline models. Pierre-Etienne Martine et al. [15] have also introduced a three-stream (RGB, optical flow, and pose estimation) 3D/1D CNN model for stroke classification and detection tasks. increase in SPIN, a multi-task dataset for tracking and action recognition in table tennis, has been presented by Steven Schwarcz et al. [16]. They have also discussed tasks such as ball tracking, spin prediction, and pose detection on their dataset. TTNet, a network for real-time temporal and spatial event spotting for table tennis has been introduced by Roman Voeikov et al. [17]. The network provided a 97.0% test accuracy in the event spotting task on their dataset named OpenTTGames. KM Kulkarni and S Shenoy [18] have described an efficient method for collecting stroke video dataset and have used 2D pose estimation data for stroke recognition. They obtained the best validation accuracy of 97.37% and a generalization accuracy of 98.72% using a Temporal Convolutional Network (TCN) model. Although an abundant amount of work has been carried out in the field of table tennis with respect to ball detection and tracking, and stroke detection and recognition individually, there is a lack of literature addressing a combination of the two. 3. Dataset collection Although there are several open-source datasets available for table tennis along with broadcast footage that can be used for the tasks in our work, none of them provide a standardized view of the ball trajectory during gameplay. There are also issues such as ball occlusion due to movements of the players leading to the discontinuous appearance of the ball in the frames, hiding parts of the trajectory of the ball. Though there exists broadcast footage from desirable viewing angles, the low frame rates at which they are captured do not facilitate the level of accuracy we require for ball tracking due to significant distortion in the shape of the ball. A distinct view where the bounce of the ball is evident is an important part of our process, and camera angles with which the majority of broadcast videos are captured do not encourage this. Therefore, there was a need to collect a custom dataset that enabled an occlusion- free view of the ball trajectory, while also simplifying the labeling process of the dataset. The umpire's view or the side view of the table provides an optimal viewing angle to observe the trajectory of the ball, aiding the extraction of useful features. It enables stroke detection from the ball trajectory based on changes in the horizontal component of the ball position. An elevation in the camera position above the table also facilitates the extraction of the ball pitch position on the table using perspective transformation. 3.1. Setup A GoPro Hero 8 Black camera, is placed at a distance of 1750 mm from the edge of the table along the axis of the net and at an elevation of 1400 mm from the ground level. The entire table is captured in the frame as shown in Fig. 1 when the camera is positioned as depicted in Fig. 2. The camera angle was set such that both ends of the table were in the field of view of the camera. The videos were recorded at a resolution of 1920x1080 pixels, and a frame rate of 120 frames per second (fps) in order to better capture the fast- moving ball. table), down-the-line (along the length of the table), center- to-center (along the centerline), and all other variations combining the above. Data was collected from the strokes executed by four professional table tennis players, out of which three were used in the training dataset and one was considered exclusively for the test dataset. The statistics of our dataset are as shown in Tab. 1. 1 2 3 4 5 6 Figure 1: A frame captured by our camera setup. Stroke Type Number of strokes in validation dataset 80 101 127 74 94 69 545 Table 1: Stroke-wise distribution of the dataset. Number of strokes in training dataset 262 260 236 232 225 263 1478 Topspin Block Push Flick Lob Flat Total 4. Ball tracking It is essential to perform ball tracking with high accuracy since this data has been leveraged to extract information about a stroke. In table tennis, the ball can move at speeds greater than 100 km/h. Even while recording at high frame rates, there is some distortion in the image (as shown in Fig. 1) of the ball when fast strokes are executed. The varying appearance of the ball and lack of physical features further add to the complexity of this task. Hence, accurate tracking of the ball is a challenging task. The objective of this section is to detect the ball and obtain its two-dimensional coordinates in each frame of our dataset, where the top-left corner of the frame is defined as the origin of the pixel space along with x and y axes in the horizontal and vertical directions respectively. This is performed using two distinct deep-learning approaches - object detection using YOLOv4, and TrackNetv2 which uses a neural network to output a heatmap of the location of the ball in a given frame. 4.1. YOLOv4 YOLOv4 is state-of-the-art in terms of object detection algorithms and performs well with regard to detecting the objects in a given frame. The object detection algorithm makes use of the Darknet53 network trained on MS COCO for feature extraction [19]. The YOLOv4 model was trained on 68,467 images of badminton matches where the shuttlecock was labeled [20], followed by 968 images of table tennis matches where the ball was labeled in various conditions. The badminton data was used for training in addition to the table tennis data since the two sports are very similar in the aspect that the object to be tracked is of similar size and color, traveling at similar speeds and range Figure 2: Camera placement for dataset generation. The strokes considered in our dataset include topspins, blocks, pushes, flicks, lobs, and flats. Both forehand and backhand versions of all these strokes were executed by the players in the dataset along with variations in the ball placement such as cross-court (along the diagonal of the of motion in a frame. YOLOv4 is promising when it comes to the detection of objects in single images but fails to consider the relative position of the ball across the temporal dimension and proceeds to make a new prediction for every single input frame. Although accurate, this could lead to several false positives due to balls in the background or static objects having an appearance similar to the ball. 4.2. TrackNetv2 TrackNetv2 [20] was developed to track tiny, fast- moving objects in sports applications. Instead of detecting the bounding boxes of the ball, this model proceeds to generate a heatmap of the probable locations of the ball in a given frame. The network is designed to handle the occlusions of the ball since it takes multiple frames as the input. This enables the model to use temporal information gathered to predict the ball coordinates in each frame. The TrackNetv2 model was trained on the same badminton and table tennis data as the YOLOv4 model. 4.3. Results In order to compare the aforementioned methods, the ground truth for 2 different videos was labeled. The first video involves a professional player playing push strokes at a medium to slow pace, and in the second, the same player executes continuous topspin strokes with the ball traveling at high velocity. The two scenarios provide a clear distinction between the type of strokes that are executed in a match by professional players and the results obtained from both approaches can be accurately measured and benchmarked. We define the conditions for True Positive and False Positive cases as follows: (a) A set of predicted coordinates (x̅ , ȳ) is considered to be a True Positive if the Euclidean distance measured between the predicted point and the ground truth of the ball (x, y) is less than or equal to N=25 pixels. This threshold of N is set because the average diameter of the ball is 30 pixels when the video's resolution is set at 1920x1080. (b) The prediction is considered to be a False Positive if the condition fails or if there is a positive prediction for a negatively labeled frame. We also define the conditions for True Negative and False Negative cases as follows: (a) The prediction is considered to be a True Negative if there is a negative prediction for a negatively labeled frame. (b) A set of predicted coordinates (x̅ , ȳ) is considered to be a False Negative if the condition fails or if there is a negative prediction for a positively labeled frame. The equation for the Euclidean distance is given by (1). center of the ball, while YOLOv4 on the other hand, predicts the center along with the height and width of the bounding box surrounding the ball. In order to benchmark the metrics between the two approaches, only the predicted center has been considered. Although the TrackNetv2 model considers the relative position of the ball with the aid of the temporal aspect of the data, the F1-scores from Tab. 2 reveal that YOLOv4 outperforms TrackNetv2 in both cases - slow and fast ball velocity datasets. This is mainly due to the higher number of false negatives predicted by the TrackNetv2 model. The inference speed for TrackNetv2 is 20 frames per second whereas that of YOLOv4 is 60 frames per second when run on an Nvidia Geforce RTX 3070 GPU. Hence, YOLOv4 is used to detect the ball position for all the videos in our dataset and proceed further with the stroke detection and recognition tasks. Model True Positive True Negative False Positive False Negative Precision Accuracy F1 Score Fast (Topspin) Slow (Push) YOLO v4 374 290 18 11 0.9541 95.82 0.9627 TrackNet v2 369 281 17 26 0.9560 93.80 0.9449 YOLO v4 396 289 5 0 0.9875 99.28 0.9937 TrackNet v2 390 280 12 8 0.9701 97.10 0.9750 Table 2: Ball tracking models benchmarked for fast and slow ball velocity data. 5. Stroke detection As discussed in Section 4, YOLOv4 was used to extract the ball coordinates in all the raw untrimmed videos of our dataset. To automate the process of splitting individual strokes from the data-frame, we use a purely mathematical approach on these extracted coordinates. As elucidated in this section, the temporal boundaries have been determined for each stroke executed by the players in each video of the dataset. This information is further used to train and validate the various stroke recognition models developed in Section 6. Detection Class Total Strokes Serves Missed Strokes: Net Missed Strokes: Out Valid Strokes Overall Accuracy (%) 95.327 100.00 92.857 90.900 93.850 1 2 3 4 5 d = √(x̅ − x)2 + (y̅ − y)2 (1) Table 3: Overall accuracies obtained for the various classes of detection task over the entire dataset. TrackNetv2 makes a single coordinate as a prediction, i.e. (x, y) coordinate in pixel space which represents the Tab. 3 showcases the overall accuracies obtained by the mathematical approach developed for stroke detection over the entire dataset collected. The accuracies have been evaluated by comparing the number of strokes detected for the various classes with the number of strokes obtained for those classes via manual inspection. (x, y, t)End of left−to−right Stroke = (x(t), y(t), t) ∶ ∃ (a, b): a < t < b & x(t) ≥ x(z)∀z ∈ (a, b) (2) 5.1. Data pre-processing The ball tracking model's output data-frame consists of the x and y coordinates of the ball for each frame in the untrimmed video, obtained from the trained YOLOv4 model. The top left corner of the frame is considered to be the origin of the Cartesian coordinate system for ball detection. The rows of the data-frame corresponding to the timestamps where the ball is not detected are dropped. An example of the curves for the ball's x and y coordinates thus obtained are depicted in Fig. 3. 5.2. Valid strokes and pitch detection In table tennis, a valid stroke is one in which the ball traverses from the player's side of the table to the opponent's side, while pitching at least once on the opponent's side of the table. In the scope of our dataset, there are no strokes where the ball pitches more than once on the opponent's side of the table. The ball pitch on the table produces a local maxima in the curve of the y coordinates of the ball as illustrated by the dashed black lines in Fig. 3. A temporal sliding window (a,b) of length 41.67 milliseconds (5 frames) was used for the detection of ball pitch events using (3). The valid strokes are detected with the condition that there is only one ball pitch occurring between the temporal boundaries of the stroke. (x, y, t)Ball Pitch = (x(t), y(t), t) ∶ ∃ (a, b): a < t < b & y(t) ≥ y(z)∀z ∈ (a, b) (3) In a few cases where the ball is occluded by the racket at either the beginning or the end of the stroke, a local maxima is seen at this timestamp as observed at the end of strokes numbered 1 and 3 in Fig 3. Such maxima in the ball's y coordinate curve occurring close to the temporal boundaries of the strokes are not considered pitches. Figure 3: Curves for Ball X and Y coordinates after data pre- processing. 5.3. Missed strokes detection As the ball travels from one side of the table to the other during a stroke, the x coordinate of the ball detected x(t) varies from a local minima to a local maxima or vice-versa depending upon the side from which the stroke has been executed. Hence, temporal boundaries for each stroke as well as the direction of the stroke (either left-to-right or right-to-left) are determined by extracting the timestamps corresponding to each pair of consecutive local extrema detected on the temporal curve of the x coordinates of the ball. A temporal sliding window (a,b) of length 83.33 milliseconds (10 frames) was used for the extraction of the temporal boundaries of the strokes using (2). The temporal boundaries for the strokes obtained are depicted by the red vertical lines in Fig 3. These strokes detected include valid strokes, missed strokes as well as serves. (x, y, t)End of right−to−left Stroke = (x(t), y(t), t) ∶ ∃ (a, b): a < t < b & x(t) ≤ x(z)∀z ∈ (a, b) A missed stroke in table tennis is either a stroke that is played into the net or a stroke where the ball fails to pitch on the opponent's side of the table. A stroke played into the net has a local extrema in the ball's x coordinate curve occurring at lower values of x as the ball does not traverse the entire length of the table. Therefore, such strokes are detected with a threshold for x coordinates at the temporal boundaries of the strokes, roughly corresponding to the position of the net along the X-axis. A stroke with no pitches detected within its temporal boundaries (stroke number 7 in Fig. 3) is classified as a missed stroke of the latter type. 5.4. Service detection The rule for services in the sport dictates the requirement of two pitches, one on each side of the table for the validity of the serve. Hence, strokes with two pitches detected within the temporal boundaries are classified as services. In Fig. 3, stroke number 1 is thus classified as a serve. 6. Stroke recognition One of the main aspects of a table tennis player is the player's stroke. Recognizing a stroke is a stepping stone towards analyzing it in detail and providing technical insights to a player. Each distinct stroke has unique characteristics with respect to the ball. The variation in the speed and trajectory of the ball provides an insight into which stroke has been played, without the need to observe the player playing the stroke. Ball trajectory data for each stroke was obtained using the methods mentioned in Section 4 and Section 5. In a rally, the ball's trajectory varies from left-to-right and right-to-left along the pixel space of the frame, as two players play back and forth. As a standardized method to input data, ball trajectory data was fed to the model in a left- to-right fashion. Using the stroke detection algorithm developed (Section 5), the direction from which the ball was played can be distinguished. Hence, to account for the data where the ball moves from the right to the left, the origin was shifted from the top-left corner to the top-right corner, essentially mirroring the ball trajectory along the y axis. Different speeds of each stroke yield varying amounts of time steps in the data. For input to the model, we chose 200 time steps (approximately 1.67 seconds at 120 fps) as our standard input time step size. Each time step had 2 features, the x and y coordinates of the ball. In the event that the input time series data had fewer than 100 time steps, the input sequence was padded with zeros. Both, pre-padding and post-padding approaches have been implemented and compared. This data was fed into various stroke recognition models which then classified it into one of 6 pre-defined strokes. Sections 6.1 and 6.2 elaborate on the different methods used to recognize a stroke just based on ball trajectory data. For each of these methods, a training-validation split of 85%-15% has been used, and the strokes of a separate player was used for the test dataset 6.1. Machine learning approach To input the data into a machine learning model, the data was first flattened to 400 features per sample (200x2 where 200 is the number of time steps per sample and 2 is the number of features per time step i.e. x and y coordinates of the ball). This flattening of the data results in the elimination of the temporal dimension of the data. Various machine learning models were used to fit this data and the best results obtained after tuning the hyperparameters are as shown in Tab. 4. Pre-Padded Post-Padded Validation (%) Test (%) Validation (%) Test (%) 89.473 77.798 90.460 82.935 91.776 68.990 93.092 76.880 89.802 68.073 92.434 76.697 90.789 66.055 92.434 77.064 82.565 82.385 75.328 76.513 Model Support Vector Machine (RBF kernel, C=10) Random Forest Classifier (n_est=25) XGBoost - Random Forest XGBoost K-Nearest Neighbors (n=9) Table 4: Comparison of machine learning models. When a Random Forest classifier was used to classify the strokes, the best test results were obtained when the number of trees in the model was limited to 25, and the input was post-padded with zeros. We also trained a multi-class Support Vector Machine (SVM) using a Radial Basis Function (RBF) as the kernel for classification. Although the variance was high, the SVM model with post-padded inputs provided the best test accuracy, using a one-vs-rest approach, and the normalization constant at the value c=10. An XGBoost model with a Random Forest classifier generalized better over the test data than an XGBoost classifier without using Random Forest when the input was pre-padded. On the contrary, it was observed that when the input was classifier outperformed the XGBoost model with a Random Forest Classifier in the task of generalizing over the test set. For the K-Nearest Neighbors model, we set the number of nearest neighbors k=9. As the value of k decreased, it was observed that the validation accuracy increased but the test accuracy dropped, and as the k value was increased, both the accuracies saw decremental changes. the XGBoost post-padded, As seen from Tab. 4, it can be concluded that the KNN algorithm was the best out of all the machine learning models for the stroke recognition task using pre-padded inputs, since the accuracies that were obtained, although indicative of high bias, exhibit low variance. As for the models trained on post-padded inputs, it was observed that the developed SVM model outperformed all other models Figure 4: TCN model architecture. k – kernel size, s – stride. on the test set, with the highest accuracy across all variations of the models. Table 6: The deep learning model parameters and inference time evaluated using a system with AMD Ryzen 5 3600 CPU and an NVIDIA RTX 3070 GPU with 8GB VRAM. 6.2. Deep learning approach In our deep learning approach, the temporal dimension of the input data was kept intact. The 200-frame input consisting of x and y coordinates was fed into a neural network model that then classified the input stroke into one of six pre-defined classes. For time series classification, we developed three architectures - An LSTM model [21], a TCN model [22], and a purely dense, fully connected model (FCNN - Fully Connected Neural Network). This main architecture was followed by a classifier block consisting of 2 fully connected layers and maintained throughout all architectures. In these last two layers, the first layer was ReLU activated and the next had a softmax activation to aid multi-class classification. Pre-Padded Post-Padded Validation (%) 91.447 90.013 91.118 91.776 Test (%) 87.155 83.669 80.550 79.266 Validation (%) 91.118 89.144 88.157 92.763 Test (%) 85.871 81.467 79.816 81.100 Model TCN BiLSTM LSTM FCNN Table 5: Comparison of deep learning models. Model TCN BiLSTM LSTM FCNN Trainable Parameters 127k 134k 51.5k 136k Inference Time (s) [per 1500 samples] 0.29 0.45 0.36 0.30 Prior works [18][23][24][25] have shown that TCN models tend to outperform LSTM models for time series data classification. This is also supported by the results obtained from the TCN model we have developed. In this model, all the convolutional layers are ReLU activated. Out of all the models developed, the TCN model generalized best over the test set, with pre and post-padded inputs. The model also exhibits lower variance as well as lower bias. It also has the lowest inference time out of all models developed, which can aid future real-time applications. The TCN model architecture is as illustrated in Fig. 4. 7. Results and discussions The confusion matrix for the predictions made using the TCN model on the pre-padded test dataset is depicted in Fig. 5. Stroke-wise accuracies indicate that the model, at times, falsely predicts push strokes as topspin strokes and vice-versa. We attribute this to the fact that both these strokes are completed in a short duration, and have a low- arcing trajectory across the table. Few flat strokes are also predicted as topspin strokes, and this can be attributed to the high velocity of both strokes. Block and lob strokes have been classified with the highest accuracy due to the highly distinctive nature of the ball trajectories associated with them. Our experiments with pre-padded and post-padded inputs show that models trained on pre-padded inputs outperform the models trained on post-padded inputs in terms of generalization. This aligns with the findings presented by Dwarampudi and Reddy [26]. after the pitch can be accurately determined by using pixel space measurements in tandem with depth and camera information. The information provided by these two characteristics of the ball is a good indicator of the quality of the stroke played. In particular, strokes played close to the height of the net, and certain strokes when played faster are more advantageous to the player. Along with the aforementioned attributes, the exact position in which the ball makes contact with the table can also be determined. This can be vastly useful for umpiring systems as well as helping players improve upon their performance. Finally, viewers of the sport of table tennis find it difficult to follow the ball in a fast-paced rally on television. This has also caused changes to the size and material of the ball to make the sport more audience-friendly. Analytics derived from ball information when presented in a user- friendly manner can help make the viewing experience pleasant. References [1] K. C. P. Wong and L. S. Dooley. High-motion table tennis ball IEEE 10th for umpiring applications. International Conference on Signal Processing Proceedings, pp. 2460-2463, doi: 10.1109/ICOSP.2010.5657001, 2010. tracking [2] C.-H. Hung. A Study of Automatic and Real-Time Table Tennis Fault Serve Detection System. Sports, vol. 6, no. 4, p. 158, doi: 10.3390/sports6040158, Nov. 2018. [3] H. Myint, P. Wong, L. Dooley and A. Hopgood. Tracking a tennis ball for umpiring purposes. 14th IAPR table International Conference on Machine Vision Applications (MVA), pp. 170-173, doi: 10.1109/MVA.2015.7153160, 2015. [4] Yun-Feng Ji, Jian-Wei Zhang, Zhi-hao Shi, Mei-Han Liu & Jie Ren. Research on real – time tracking of table tennis ball based on machine learning with low-speed camera. Systems Science & Control Engineering, 6:1, 71-79, DOI: 10.1080/21642583.2018.1450167, 2018. [5] J. Calandre, R. Péteri, L. Mascarilla and B. Tremblais. Extraction and analysis of 3D kinematic parameters of Table Tennis ball from a single camera. 25th International Conference on Pattern Recognition (ICPR), pp. 9468-9475, doi: 10.1109/ICPR48806.2021.9412391, 2021. [6] J. Calandre, R. Péteri, L. Mascarilla and B. Tremblais. Table Tennis ball kinematic parameters estimation from non- intrusive single-view videos. International Conference on Content-Based Multimedia Indexing (CBMI), pp. 1-6, doi: 10.1109/CBMI50038.2021.9461884, 2021. [7] Qiao F. Application of deep learning in automatic detection of technical and tactical indicators of table tennis. PLoS ONE 16(3):e0245259. https://doi.org/10.1371/journal.pone.0245259, 2021. [8] R. Schneider, L. Lewerentz, K. Lüskow, M. Marschall, and S. Kemnitz. Statistical Analysis of Table-Tennis Ball Figure 5: Confusion Matrix for the test results obtained using the TCN model. 8. Conclusion and future work This paper describes a systematic method in which stroke detection and recognition is performed using ball trajectory data. The optimal camera position being the umpire's view of the table provides a complete view of the table, which helps us capture the entire trajectory of the stroke. Two distinct methods of ball-tracking have been compared and contrasted with, which helped in the labeling of the ball coordinates. This was necessary for the task of stroke detection and recognition. A mathematical model has been developed that utilizes the data from the ball tracking models to detect strokes and split the entire video into individual valid strokes. This data is then further used to train and validate the respective models for stroke recognition. Expanding upon our current work, the use of multiple cameras can prove to be extensively resourceful. Three dimensional coordinates of the ball can be extracted using this method and can give us data that is crucial to analyze the spin of the ball. Information about the trajectory of the ball after the pitch is a very strong indicator of the amount of spin imparted on the ball and can help increase the accuracy of the stroke detection and recognition algorithms. Since these features are a crucial part of player and game analytics in table tennis, player profiling and game simulation merely using the information provided by the ball becomes a possibility. Additionally, the height of the ball from above the table and velocity of the ball before and [19] Bochkovskiy, A., Wang, C. Y., & Liao, H. Y. M. Yolov4: Optimal speed and accuracy of object detection. arXiv preprint arXiv:2004.10934, 2020. [20] Sun, N. E., Lin, Y. C., Chuang, S. P., Hsu, T. H., Yu, D. R., Chung, H. Y., & İk, T. U. TrackNetV2: Efficient Shuttlecock Tracking Network. In 2020 International Conference on Pervasive Artificial Intelligence (ICPAI), pp. 86-91, IEEE, 2020. [21] Sepp Hochreiter, and Jürgen Schmidhuber. Long Short-Term Memory. Neural Computation, 9(8), 1997. [22] Colin Lea, Michael D. Flynn, René Vidal, Austin Reiter, and Gregory D. Hager. Temporal Convolutional Networks for Action Segmentation and Detection. In CVPR, 2017. [23] Shaojie Bai, J. Zico Kolter, and Vladlen Koltun. An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling. arXiv preprint arXiv:1803.01271, 2018. Zhang.Temporal [24] Zhijun Chen, Shijun Sun, Yixin Wang, Qiuyao Wang, convolution-network-based Xudong models for modeling maize evapotranspiration under mulched drip irrigation. Computers and Electronics in Agriculture, Volume 169, 105206, ISSN 0168-1699, https://doi.org/10.1016/j.compag.2019.105206, 2020. [25] S. Gopali, F. Abri, S. Siami-Namini and A. S. Namin. A Comparison of TCN and LSTM Models in Detecting Anomalies in Time Series Data. 2021 IEEE International Conference on Big Data (Big Data), pp. 2415-2420, doi: 10.1109/BigData52589.2021.9671488, 2021. [26] Dwarampudi, M., & Reddy, N. V. Effects of padding on LSTMs and CNNs. arXiv preprint arXiv:1903.07288, 2019. Trajectories. Applied Sciences, vol. 8, no. 12, p. 2595, doi: 10.3390/app8122595, Dec. 2018. [9] Gao Y., Tebbe J., Zell A. Robust Stroke Recognition via Vision and IMU in Robotic Table Tennis. In Artificial Neural Networks and Machine Learning – ICANN 2021, Lecture Notes in Computer Science, vol 12891. Springer, Cham. https://doi.org/10.1007/978-3-030-86362-3_31, 2021. [10] Habiba Hegazy, Mohamed Abdelsalam, Moustafa Hussien, Seif Elmosalamy, Yomna M.I Hassan, Ayman M. Nabil, Ayman Atia. Online detection and classification of in- corrected played strokes in table tennis using IR depth camera. Procedia Computer Science, Volume 170, Pages 555-562, 1877-0509, ISSN https://doi.org/10.1016/j.procs.2020.03.125, 2020 [11] Aktas, K., Demirel, M., Moor, M. et al. Spatiotemporal based table tennis stroke-type assessment. SIViP 15, 1593–1600, https://doi.org/10.1007/s11760-021-01893-7, 2021 [12] Jordan Calandre, Renaud Péteri, Laurent Mascarilla. Optical Flow Singularities for Sports Video Annotation: Detection of Strokes in Table Tennis. MediaEval 2019 Workshop, Sophia Antipolis, France, Volume: urn:nbn:de:0074-2670-7, 2019. [13] Pierre-Etienne Martin, Jenny Benois-Pineau, Boris Mansencal, Renaud Péteri, Laurent Mascarilla, Jordan Calandre, and Julien Morlier. Sports Video Annotation: Detection of Strokes in Table Tennis task for MediaEval 2019. In Proc. of the MediaEval 2019 Workshop, Sophia Antipolis, France, 27-29 October 2019. [14] P. Martin, J. Benois-Pineau, R. Peteri and J. Morlier. 3D attention mechanism for fine-grained classification of table tennis strokes using a Twin Spatio-Temporal Convolutional Neural Networks. In 25th International Conference on Pattern Recognition (ICPR), Milan, Italy, pp. 6019-6026.doi: 10.1109/ICPR48806.2021.9412742, 2021. [15] Pierre-Etienne Martin, Jenny Benois-Pineau, Renaud Péteri, and Julien Morlier. Three-Stream 3D/1D CNN for Fine- Grained Action Classification and Segmentation in Table Tennis. Proceedings of the 4th International Workshop on Multimedia Content Analysis in Sports, Association for Computing Machinery, New York, NY, USA, 35–41. DOI:https://doi.org/10.1145 /3475722.3482793, 2021. [16] Steven Schwarcz, Peng Xu, David D'Ambrosio, Juhana Kangaspunta, Anelia Angelova, Huong Phan, Navdeep Jaitly. SPIN: A High Speed, High Resolution Vision Dataset for Tracking and Action Recognition in Ping Pong. arXiv preprint arXiv:1912.06640, cs.CV, Dec 2019. [17] R. Voeikov, N. Falaleev and R. Baikulov. TTNet: Real-time temporal and spatial video analysis of table tennis. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), Seattle, WA, USA, 2020 pp. 3866-3874. 10.1109/CVPRW50498.2020.00450, 2020. [18] K. M. Kulkarni and S. Shenoy. Table Tennis Stroke Recognition Using Two-Dimensional Human Pose Estimation. 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pp. 4571-4579, doi: 10.1109/CVPRW53098.2021.00515, 2021.
http://arxiv.org/abs/2302.09656v3
2023-09-13T16:40:35
2023-02-19T19:03:26
Imprecise Bayesian Neural Networks
Uncertainty quantification and robustness to distribution shifts are important goals in machine learning and artificial intelligence. Although Bayesian Neural Networks (BNNs) allow for uncertainty in the predictions to be assessed, different sources of uncertainty are indistinguishable. We present Imprecise Bayesian Neural Networks (IBNNs); they generalize and overcome some of the drawbacks of standard BNNs. These latter are trained using a single prior and likelihood distributions, whereas IBNNs are trained using credal prior and likelihood sets. They allow to distinguish between aleatoric and epistemic uncertainties, and to quantify them. In addition, IBNNs are more robust than BNNs to prior and likelihood misspecification, and to distribution shift. They can also be used to compute sets of outcomes that enjoy probabilistic guarantees. We apply IBNNs to two case studies. One, for motion prediction in autonomous driving scenarios, and two, to model blood glucose and insulin dynamics for artificial pancreas control. We show that IBNNs performs better when compared to an ensemble of BNNs benchmark.
[ "Michele Caprio", "Souradeep Dutta", "Kuk Jin Jang", "Vivian Lin", "Radoslav Ivanov", "Oleg Sokolsky", "Insup Lee" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09656v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09656v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "stat.ML", "Primary: 68T37, Secondary: 68T05, 68W25" ]
3 2 0 2 p e S 3 1 ] G L . s c [ 3 v 6 5 6 9 0 . 2 0 3 2 : v i X r a IMPRECISE BAYESIAN NEURAL NETWORKS MICHELE CAPRIO, SOURADEEP DUTTA, KUK JANG, VIVIAN LIN, RADOSLAV IVANOV, OLEG SOKOLSKY, INSUP LEE Abstract. Uncertainty quantification and robustness to distribution shifts are important goals in machine learning and artificial intelligence. Although Bayesian Neural Networks (BNNs) allow for uncertainty in the predictions to be assessed, different sources of uncer- tainty are indistinguishable. We present Imprecise Bayesian Neural Networks (IBNNs); they generalize and overcome some of the drawbacks of standard BNNs. These latter are trained using a single prior and likelihood distributions, whereas IBNNs are trained using credal prior and likelihood sets. They allow to distinguish between aleatoric and epistemic uncer- tainties, and to quantify them. In addition, IBNNs are more robust than BNNs to prior and likelihood misspecification, and to distribution shift. They can also be used to compute sets of outcomes that enjoy probabilistic guarantees. We apply IBNNs to two case studies. One, for motion prediction in autonomous driving scenarios, and two, to model blood glucose and insulin dynamics for artificial pancreas control. We show that IBNNs performs better when compared to an ensemble of BNNs benchmark. 1. Introduction One of the greatest virtues an individual can have is arguably being aware of their own ignorance, and acting cautiously as a consequence. Similarly, an autonomous system using neural networks (NNs) would greatly benefit from understanding the probabilistic properties of the NN's output (e.g., variance, robustness to distribution shift), in order to incorporate them into any further decision-making. In this paper, we present a generalization of Bayesian neural networks that allows us to give a machine such a desirable quality. In the last few years, there has been a proliferation of work on calibrating (classification) NNs, in order to estimate the confidence in their outputs [31] or to produce conformal sets that are guaranteed to contain the true label, in a probably approximately correct (PAC) sense [58]. While such methods are a promising first step, they require a calibration set (in addition to the original training set) and cannot be directly used on out-of-distribution data without further examples. Bayesian neural networks (BNNs) offer one approach to overcome the above limitations. The Bayesian paradigm provides a rigorous framework to analyze and train uncertainty-aware neural networks, and more generally to support the development of learning algorithms [39]. In addition, it overcomes some of the drawbacks of deep learning models, namely that they are prone to overfitting, which adversely affects their generalization capabilities, and that they tend to be overconfident about their predictions when they provide a confidence interval. 2010 Mathematics Subject Classification. Primary: 68T37; Secondary: 68T05, 68W25. Key words and phrases. Bayesian deep learning; imprecise probabilities; credal sets; epistemic and aleatory uncertainties; uncertainty quantification; machine learning robustness. 2 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee BNNs, though, are trained using a single prior, which may still suffer from miscalibration and robustness issues [50]. In this work we introduce imprecise Bayesian neural networks (IBNNs). Unlike other techniques in the fields of artificial intelligence (AI) and machine learning (ML) involving imprecise probabilities – that typically only focus on classification problems – IBNNs can be used for classification, prediction, and regression. They capture the ambiguity the designer faces when selecting which prior to choose for the parameters of a neural network and which likelihood distribution to choose for the training data at hand. An IBNN can be defined as a NN trained using credal prior and likelihood sets. Credal sets are convex sets of probability measures (see Remark 1); we use them to train IBNNs in order to overcome some of the In particular, they allow to counter the criticism to the practice in drawbacks of BNNs. (standard) Bayesian statistics of (i) using a single, arbitrary prior to represent the initial state of ignorance of the agent, (ii) using non-informative priors to model ignorance, and (iii) using a single, arbitrary likelihood to represent the agent's knowledge about the sampling model.1 As a consequence, credal sets make the analysis more robust to prior and likelihood In addition, they make it possible to quantify and distinguish between misspecification. epistemic (i.e. reducible) and aleatoric (i.e. irreducible) uncertainties. This is desirable in light of several areas of recent ML research, such as Bayesian deep learning [19, 41], adversarial example detection [64], and data augmentation in Bayesian classification [40]. The motivation for training an artificial NN using credal sets is twofold: (i) a single prob- ability distribution does not suffice to represent ignorance in the sense of lack of knowledge [35], and (ii) working with credal sets allows to be robust against prior and likelihood mis- specification. A more in-depth discussion can be found in Appendix A. In addition, we point out that despite a hierarchical Bayesian model (HBM) approach seems to be a viable alter- native to one based on credal sets, these latter are better justified philosophically, and do not suffer from the same theoretical shortcomings of HBM approaches [6, 35, 38, 71]. A more detailed explanation can be found in Appendix B. We summarize our contributions next: (1) We present IBNNs, and develop the theoretical tools and the procedure required to use them in practice. (2) We present theoretical results to show that IBNNs are more robust than BNNs to prior and likelihood misspecification, and to distribution shifts. We also prove how IBNNs can be used to specify sets of outcomes that enjoy probabilistic guarantees. (3) We apply IBNNs to model two safety critical systems. One, motion prediction for autonomous driving, and two, the human insulin and blood glucose dynamics for artificial pancreas control. We demonstrate improvements in both these settings with respect to ensemble of BNNs methods. Before moving on, let us point out that while IBNNs pay a computational price coming from the use of credal sets, they are able to quantify epistemic uncertainty, unlike BNNs, and to do so in a principled manner, unlike ensemble of BNNs. In addition, they require less stringent assumptions on the nature of the prior and likelihood ambiguity faced by the agent than other imprecise-probabilities-based techniques, as explained in Appendices B and M. We also stress that if the scholar prioritizes computational efficiency, they should use backpropagation-based methods, as they are much faster than Bayesian techniques. In 1Criticisms (i) and (iii) are also pointed out in [52, Section 2.2]. Imprecise Bayesian Neural Networks 3 safety-critical situations instead – where using uncertainty-informed methods is crucial for the downstream task performance – IBNNs are the natural choice. Structure of the paper. Section 2 presents the needed preliminary concepts, followed by section 3 that introduces some important theoretical results. We discuss the applied aspects of IBNNs in in section 4. We present our experimental results in section 5, and we examine the related work in section 6. Section 7 concludes our work. In the appendices, we give further theoretical and philosophical arguments and we prove our claims. 2. Background and Preliminaries In this section, we present the background notions that are needed to understand our main results. In section 2.1 we introduce Bayesian neural networks, and section 2.2 discusses (finitely generated) credal sets, upper probabilities and lower probabilities. The reader that is familiar with these concepts can skip to section 3. 2.1. Bayesian neural networks. In line with the recent survey on BNNs by [39], Bayes' theorem can be stated as P (H | D) = [P (D | H)P (H)]/P (D) = P (D, H)/ (cid:82) P (D, H ′)dH ′, where H is a hypothesis about which the agent holds some prior beliefs, and D is the data the agent uses to update their initial opinion. Probability distribution P (D | H) represents how likely it is to observe data D if hypothesis H were to be true, and is called likelihood, while probability distribution P (H) represents the agent's initial opinion around the plausibility of hypothesis H, and is called prior. The evidence available is encoded in P (D) = (cid:82) P (D, H ′)dH ′, while posterior probability P (H | D) represents the agent's updated opinion. Using Bayes' theorem to train a predictor can be understood as learning from data D: the Bayesian paradigm offers an established way of quantifying uncertainty in deep learning models. BNNs are stochastic artificial neural networks (ANNs) trained using a Bayesian approach [29, 39, 47, 66, 72]. The goal of ANNs is to represent an arbitrary function y = Φ(x). Let θ represent the parameters of the network, and call Θ the space θ belongs to. Stochastic neural networks are a type of ANN built by introducing stochastic components to the network. This is achieved by giving the network either a stochastic activation or stochastic weights to simulate multiple possible models with their associated probability distribution. This can be summarized as θ ∼ p(θ), y = Φθ(x) + ε, where Φ depends on θ to highlight the stochastic nature of the neural network, p is the density of a probability measure P on Θ,2 and ε represents random noise to account for the fact that function Φθ is just an approximation. To design a BNN, the first step is to choose a deep neural network architecture, that is, functional model Φθ. Then, the agent specifies the stochastic model, that is, a prior distribution over the possible model parametrization p(θ), and a prior confidence in the predictive power of the model p(y | x, θ). Given the usual assumption that multiple data points from the training set are independent, the product (cid:81) (x,y)∈D p(y | x, θ) represents the likelihood of outputs y ∈ Dy given inputs x ∈ Dx and parameter θ, where (a) D = Dx × Dy is the training set; (b) Dx = {xi}n i=1 is the collection of training inputs, which is a subset of the space X of inputs; (c) Dy = {yi}n i=1 is the collection of training outputs, which is 2We can write p as the Radon-Nikodym derivative of P with respect to some σ-finite dominating measure μ, that is, p = dP/dμ. 4 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee a subset of the space Y of outputs. In the paper, we call "likelihood" both p(y | x, θ) and (cid:81) (x,y)∈D p(y | x, θ), as no confusion arises. The model parametrization can be considered to be hypothesis H. Following [39], we assume independence between model parameters θ and training inputs Dx, in formulas Dx ⊥ ⊥ θ. Hence, Bayes' theorem can be rewritten as p(θ | D) = p(Dy | Dx, θ)p(θ) Θ p(Dy | Dx, θ′)p(θ′)dθ′ (cid:82) ∝ p(Dy | Dx, θ)p(θ). Notice that the equality comes from having assumed Dx ⊥⊥ θ. Posterior density p(θ | D) is high dimensional and highly nonconvex [37, 39], so computing it and sampling from it is a difficult task. The first issue is tackled using Variational Inference (VI) procedures, while Markov Chain Monte Carlo (MCMC) methods address the second challenge. Both are reviewed – in the context of machine learning – in [39, Section V], where the authors also inspect their limitations. BNNs can be used for prediction, regression, and classification [39, Section II]; besides having a solid theoretical justification, there are practical benefits from using BNNs, as presented in [39, Section III]. 2.2. Imprecise probabilities. As IBNNs are rooted in the theory of imprecise probabilities (IPs), in this section we give a gentle introduction to the IP concepts we will use throughout the paper. IBNNs are based on the Bayesian sensitivity analysis (BSA) approach to IPs, that in turn is grounded in the dogma of ideal precision (DIP) [5], [71, Section 5.9]. The DIP posits that in any problem there is an ideal probability model which is precise, but which may not be precisely known. We call this condition ambiguity [23, 28]. Facing ambiguity can be represented mathematically by a set P of priors and a set L of likelihoods that seem "plausible" or "fit" to express the agent's beliefs on the parameters of interest and their knowledge of the data generating process (DGP). Generally speaking, the farther apart the "boundary elements" of the sets (i.e. their infimum and supremum), the higher the agent's ambiguity. Of course, if P and L are singletons we go back to the usual Bayesian paradigm. A procedure based on sets P and L yields results that are more robust to prior and likelihood misspecification than a regular Bayesian method. In the presence of prior ignorance and indecisiveness about the sampling model, it is better to give answers in the form of intervals or sets, rather than arbitrarily select a prior and a likelihood, and then update. Sets P and L allow to represent indecision, thus leading to less informative but more robust conclusions. Remark 1. Throughout the paper, we denote by Π = {P1, . . . , Pk}, k ∈ N, a finite set of probabilities on a generic space Ω, such that for all j ∈ {1, . . . , k}, Pj cannot be written as a convex combination of the other k −1 components of Π. We denote by Π′ its convex hull Π′ ≡ ConvΠ, i.e., the set of probabilities Q on Ω that can be written as Q(A) = (cid:80)k j=1 αjPj(A), for all A ⊂ Ω, where the αj's are elements of [0, 1] that sum up to 1. In the literature, it is referred to as a finitely generated credal set [13, 51]. Notice then that the extreme elements of Π′ correspond to the elements of Π, that is, exΠ′ = Π. Simple graphical representations of finitely generated credal sets are given in Figures 1 and 2. Imprecise Bayesian Neural Networks 5 Figure 1. Suppose we are in a 3-class classification setting, so Ω = {ω1, ω2, ω3}. Then, any probability measure P on Ω can be seen as a probability vector. For example, suppose P ({ω1}) = 0.6, P ({ω2}) = 0.3, and P ({ω3}) = 0.1. We have that P ≡ (0.6, 0.3, 0.1)⊤. Since its elements are positive and sum up to 1, probability vector P belongs to the unit simplex, the purple triangle in the figure. Then, we can specify Π = {P1, . . . , P5}, and obtain as a consequence that Π′ = ConvΠ is the orange pentagon. It is a convex polygon with finitely many extreme elements, and it is the geometric representation of a finitely generated credal set. Let us now introduce the concepts of lower and upper probabilities. The lower probability P associated with Π is given by P (A) = inf P ∈Π P (A), for all A ⊂ Ω. The upper probability P as- sociated with Π is defined as the conjugate to P , that is, P (A) := 1−P (Ac) = supP ′∈Π P ′(A), for all A ⊂ Ω. These definitions hold even if Π is not finite. Then, we have the following important result. Proposition 2. P is the upper probability for Π if and only if it is also the upper probability for Π′. That is, P (A) = supP ∈Π P (A) = supP ′∈Π′ P ′(A), for all A ⊂ Ω. A version of Proposition 2 for finitely additive probability measures can be found in [71, Section 3.6]. A simple graphical representation of upper and lower probabilities for a set A is given in Figure 2. 3. Theoretical results In this section, we provide the procedure to follow in order to compute the posterior credal set in the context of IBNNs, and we show how IBNNs are able to capture both aleatoric and epistemic uncertainties associated with the analysis. The training method is presented in Section 3.1. We show that IBNNs are more robust to distribution shifts than regular BNNs as a result of Proposition 4. We first give the formal definition of an IBNN. Definition 3 (IBNN). An IBNN is a stochastic artificial neural network trained using finitely generated credal prior and likelihood sets. i=1 ⊂ X is the collection of training inputs, Dy = {yi}n 3.1. IBNN procedure. Recall that D = Dx × Dy denotes the training set, where Dx = {xi}n i=1 ⊂ Y is the collection of training outputs, and X and Y denote the input and output spaces, respectively. We then denote by P a generic prior on the parameters θ ∈ Θ of a BNN having pdf/pmf p, and by Px,θ a P1P3P4P2P5p(ω1)p(ω2)p(ω3)P({ω1})P({ω2})P({ω3}) 6 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee Figure 2. In this figure, a replica of [24, Figure 1], Π = {P1, P2}, where P1 and P2 are two Normal distributions whose pdf's p1 and p2 are given by the dashed blue and brown curves, respectively. Their convex hull is Π′ = ConvΠ = {Q : Q = βP1 + (1 − β)P2, for all β ∈ [0, 1]}. The pdf q of an element Q of Π′ is depicted by a solid black curve. In addition, let A = [−0.8, −0.4]. Then, P (A) = (cid:82) −0.4 −0.8 p2(ω)dω ≈ 0, while P (A) is given by the red shaded area under p1, that is, P (A) = (cid:82) −0.4 −0.8 p1(ω)dω. generic likelihood on the space Y of outputs having pdf/pmf px,θ. The act of computing the posterior from prior P and likelihood Px,θ using a BNN is designated by post(P, Px,θ). The IBNN procedure follows. Procedure Imprecise Bayesian Neural Network. S1 Specify a finite set P of plausible prior probabilities on the parameters θ of the neural network, and a finite set Lx,θ of plausible likelihoods. S2 Compute posterior P (* | D) ≡ PD = post(P, Px,θ) on the parameters θ of the neural network, for all P ∈ P and all Px,θ ∈ Lx,θ. Step S2 performs an element-wise application of Bayes' rule for all the elements of P and Lx,θ. We obtain a finite set PD of posteriors whose cardinality #PD is given by #P × #Lx,θ. Its convex hull ConvPD is the credal posterior set. By Lemma 2 we have that the upper and lower probabilities of PD and ConvPD coincide. In applications, every element of P should not be obtainable as a convex combination of other elements. This to avoid carrying out redundant operations in Step S2. The same holds for the elements of Lx,θ. Furthermore, choosing 2 to 5 priors and likelihoods is usually enough to safely hedge against prior and likelihood misspecification. Our procedure prescribes the scholar to specify a finite set P of priors on the parameters of the neural network, and to specify a finite set Lx,θ of likelihoods (that can be used to capture different architectures of the neural network) that approximate the true data generating process. For every pair of prior P and likelihood Px,θ, the associated posterior P (* | D) ≡ PD on the parameters θ of the network captures the distribution of these latter, revised according to the available information encapsulated in the likelihood. Eventually, as explained in section 4, we use the posteriors to derive the predictive distributions ˆP on the output space Y, which are the distributions of interests for the downstream tasks. p1(ω)p2(ω)q(ω)ω---------- Imprecise Bayesian Neural Networks 7 Notice that in the case that P and Lx,θ are both not singletons, for all A ⊂ Θ the interval [P D(A), P D(A)] is wider than the case when one or the other is a singleton. In the limiting case where both are singletons, we retrieve the usual Bayesian updating, so the interval shrinks down to a point. Robustness Properties of IBNNs. We follow the Procedure above to compute the posterior credal set for the parameters of our IBNN. Being trained using credal sets makes IBNNs more robust to distribution shifts than BNNs. To see this, we present the following general result, and then we apply it to our case. Let P be a generic set of probabilities, and consider a probability measure P ′ such that P ′ ̸∈ P. Proposition 4. Call d any metric and div any divergence on the space of probability mea- sures of interest. Let d(P, P ′) := inf P ∈P d(P, P ′) and div(P∥P ′) := inf P ∈P div(P ∥P ′). Then, for all P ∈ P, d(P, P ′) ≤ d(P, P ′) and div(P∥P ′) ≤ div(P ∥P ′). Proposition 4 holds if P is any set of probabilities, not just a credal sets. In Appendix J, we show that the above result still holds if the elements of P and P ′ are defined on Euclidean spaces having different dimensions [7]. x,θ, . . . , P k Let us now apply Proposition 4 to IBNNs. Suppose that, when designing a regular BNN, an agent chooses likelihood Px,θ, while when designing a more general IBNN, they start by x,θ : k ∈ N, θ ∈ Θ, x ∈ X }, and then specifying a finite set of likelihoods Lx,θ = {P 1 let the induced credal set ConvLx,θ represent their uncertainty around the sampling model. Assume that Px,θ ∈ Lx,θ (this means that when designing the regular BNN, the agent chooses arbitrarily which of the elements of Lx,θ to use) and that the "oracle" data generating process x,θ is different from Px,θ, P o P o x,θ ̸= Px,θ, so that we are actually in the presence of distribution shift. Then, we have two cases. (1) If the true sampling model P o x,θ belongs to ConvLx,θ, then the distance – measured via a metric or a divergence – between ConvLx,θ and P o x,θ is 0 while that between Px,θ and P o x,θ ̸∈ ConvLx,θ, then the distance between ConvLx,θ and P o x,θ, no matter (i) which metric or distance we use (Proposition 4), (ii) whether or not P o x,θ and the elements of ConvLx,θ are defined on the same Euclidean space (Appendix J, Lemma 16). A visual representation is given in Figure 3. x,θ is no larger than the distance between Px,θ and P o x,θ is positive. (2) If P o Computational aspects of IBNNs. A computational bottleneck of the IBNN procedure appears to be step S2, which is a combinatorial task. We have to calculate #P × #Lx,θ many posteriors, but this procedure allows us to forego any additional assumptions on the nature of the lower and upper probabilities that are often times required by other imprecise- probabilities-based techniques.3 Clearly, the procedure is simplified if either P or Lx,θ are singletons. The posteriors in PD are typically very high-dimensional and highly non-convex; we use variational inference (VI), outlined in [39, Section V], to approximate them in an efficient fashion. That is, we project every PD ∈ PD onto a set S of "well-behaved" distributions In formulas, ̆PD = arg minQ∈S KL(Q∥PD). By (e.g. Normals) using the KL divergence. 3If we are willing to make such assumptions, Theorem 9 in Appendix D shows how to compute the upper posterior using only upper prior and upper likelihood. 8 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee Figure 3. IBNNs are more robust to distribution shifts than regular BNNs. Here ConvLx,θ is the convex hull of five plausible likelihoods, and d denotes a generic metric on the space ∆(Y, Ay) of probabilities on Y. We see how d(ConvLx,θ, P o x,θ) < d(Px,θ, P o x,θ); if we replace metric d by a generic divergence div, the inequality would still hold. "well-behaved", we mean that they have to satisfy the conditions in [75, Sections 2 and 3].4 This ensures that as the sample size goes to infinity, the approximated posteriors converge to the true data generating process. We also point out how despite using a VI approximation for the exact posteriors, by Proposition 4 the credal set of approximated posteriors is closer to the "oracle" posterior P o D than any of its elements. As a consequence, working with credal sets leads to VI posterior approximations that are better than the ones resulting from a single BNN, or an ensemble of BNNs, where several BNNs are combined into one. Remark 5. Although highly unlikely in practice, it is theoretically possible that the VI approximation of the (finite) set PD of posteriors is a singleton, see Figure 4. While the conditions in [75] guarantee that asymptotically the approximated posteriors coincide with the true data generating process, this typically does not happen with finite-dimensional datasets. As a consequence, obtaining a singleton when projecting PD onto S may result In that case, we either in an underestimation of the uncertainties faced by the scholar. consider a different set – whose elements still satisfy the conditions in [75, Sections 2 and 3] – on which to project PD according to the KL divergence, or we use a different "projection operator", that is, a divergence different from the KL. For example, [75] suggest Rényi and χ2 divergences, or Hellinger and total variation metrics. Alternatively, we can consider a different approximation strategy altogether, for instance the Laplace approximation [60]. Remark 6. Assume that the "oracle" prior P o is in the prior credal set ConvP and that the "oracle" likelihood P o x,θ is in the likelihood credal set ConvLx,θ. Then, it is immediate to see that the "oracle" posterior P o D belongs to the posterior credal set ConvPD. Naturally, this does not imply that the posterior credal set collapses to P o D. In general, it is unlikely that a finite amount of data is able to completely annihilate all the epistemic uncertainty faced by the agent. What may happen is that if the training set is large enough, ConvPD may be inscribed in a ball of small radius around P o D. This does not mean that we suffer from under- confidence due to larger-than-necessary epistemic uncertainty. Rather, the relative epistemic 4We assume that the conditions on the priors and the likelihoods given in [75] are satisfied. Δ(Y,Ay) ̄Px,θd( ̄Px,θ,Pox,θ)Px,θd(Px,θ,Pox,θ) Imprecise Bayesian Neural Networks 9 uncertainty (measured by the difference between prior and posterior uncertainty, divided by the prior uncertainty) drops significantly. In addition, working with sets of prior and likelihoods allows us to hedge against prior and likelihood misspecification: the statements P o ∈ ConvP and P o x,θ ∈ ConvLx,θ are either strong assumptions, or very hard to verify. D, P 2 D, P 3 Figure 4. Let ∆(Ω, B) denote the space of probability measures on Θ. Let PD = {P 1 D}, so that ConvPD is the black segment. Then, if we project the elements of PD onto S1 via the KL divergence, we obtain the same distribution ̆PD. This is detrimental to the analysis because such an approximation underesti- mates epistemic (and possibly also aleatoric) uncertainty faced by the agent. Then, the scholar should specify a different set S2 of "well-behaved" distributions onto which project the elements of PD. In the figure, we see that P 1 D, P 2 D are projected D, and ̆P 3 onto S2 via the KL divergence to obtain ̆P 1 D. The convex hull of these latter, captured by the red shaded triangle, represents the variational approximation of ConvPD. D, and P 3 D, ̆P 2 3.2. Aleatoric and epistemic uncertainties. In [35], the authors study uncertainty in the context of supervised learning. In particular, they extensively review the existing approaches to quantify aleatoric and epistemic uncertainty (AU and EU, respectively). The former refers to irreducible uncertainty, the variability in the outcome of an experiment which is due to inherently random effects. An example of AU is coin flipping: the data generating process in this experiment has a stochastic component that cannot be reduced by any additional source of information. EU, instead, corresponds to reducible uncertainty, caused by a lack of knowledge about the best model. Continuing the coin example, this corresponds to holding a belief that the coin is biased. After a few tosses, we realize whether or not the coin is in fact biased, or if instead it is fair. Notice how, in the precise case – that is, when the agent specifies a single distribution – EU is absent. A single probability measure is only able to capture the idea of aleatoric uncertainty, since it represents a case in which the agent knows exactly the true data generating process. This is a well-studied property of credal sets [35, Page 458]. EU should not be confused with the concept of epistemic probability [15, 16, 71]. In the subjective probability literature, epistemic probability can be captured by a single Δ(Ω,B)S1KLP1DP3DP2D ̆PDS2KLKLKL ̆P1D ̆P3D ̆P2D 10 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee distribution. Its best definition can be found in [71, Sections 1.3.2 and 2.11.2]. There, the author specifies how epistemic probabilities model logical or psychological degrees of partial belief of the agent. We remark, though, how de Finetti and Walley work with finitely additive probabilities, while in this paper we use countably additive probabilities. Recall that, given a probability measure P on a generic space Ω, the (Shannon) entropy of P is defined as H(P ) := E[− log p] = − (cid:82) Ω log[p(ω)]P (dω) if Ω is uncountable, where p denotes the pdf of P . If Ω is at most countable, we have that H(P ) = − (cid:80) ω∈Ω P ({ω}) log[P ({ω})]. The entropy primarily captures the shape of the distribution, namely its "peakedness" or non- uniformity [20, 35], and hence informs about the predictability of the outcome of a random experiment: the higher its value, the lower the predictability. Now, consider a generic set of probabilities P on Ω. Then, we can define the imprecise versions of the Shannon entropy as proposed by [1, 35], H(P ) := supP ∈P H(P ) and H(P ) := inf P ∈P H(P ), called the upper and lower Shannon entropy, respectively.5 The upper entropy is a measure of total uncertainty since it represents the minimum level of predictability associated with the elements of P. In [1, 35], the authors posit that it can be decomposed as a sum of aleatoric and epistemic uncertainties, and that this latter can be specified as the difference between upper and lower entropy, thus obtaining H(P ) (cid:124) (cid:123)(cid:122) (cid:125) total uncertainty = H(P ) (cid:124) (cid:123)(cid:122) (cid:125) aleatoric uncertainty + (cid:2)H(P ) − H(P )(cid:3) (cid:125) (cid:123)(cid:122) (cid:124) epistemic uncertainty . We have the following proposition. Proposition 7. Let Π, Π′ be sets of probability measures as the ones considered in Remark 1. Then, supP ∈Π H(P ) = H(P ) ≤ H(P ′) = supP ∈Π′ H(P ). Proposition 7 tells us that the upper entropy of the extreme elements in Π = exΠ′ is a lower bound for the upper entropy of the whole credal set Π′. An immediate consequence of Proposition 7 is that the lower entropy of the extreme elements in Π is an upper bound for the lower entropy of the whole credal set Π′. In the context of IBNNs, we are especially interested in EU and AU associated with the predictive credal set, introduced in the next section. It is the set of distributions on the output set Y induced by the posterior distributions in PD. We also point out a salient feature of this approach: the EU and AU computed from the predictive credal set embed uncertainty comparable to an uncountably infinite ensemble of BNNs, i.e. an ensemble of BNNs of cardinality א1, despite the simple and intuitive mathematics over a finite set. They are not merely pessimistic bounds to the uncertainties associated with a finite ensemble of BNNs. 4. Practical aspects In this section, we first illustrate how to elicit credal prior and likelihood sets that are needed for step S1 of the procedure in section 3.1. Then, we describe how IBNN are instru- mental in specifying a set of outputs that enjoys probabilistic guarantees. 5In Appendix E, we provide bounds to the values of upper and lower entropy. Imprecise Bayesian Neural Networks 11 Outlined in [39, Sections IV-B and IV-C1], for classification, the standard process for BNNs involves • A Normal prior with zero mean and diagonal covariance σ2I on the coefficients of the network, that is, p(θ) = N (0, σ2I). In the context of IBNNs, we could specify e.g. P = {P : p(θ) = N (μ, σ2I), μ ∈ {μ−, 0, μ+}, σ2 ∈ {3, 7}}. That is, the extreme elements of the prior credal set are five independent Normals having different levels of "fatness" of the tails, and centered at a vector μ+ having positive entries, a vector μ− having negative entries, and a vector 0 having entries equal to 0. They capture the ideas of positive bias, negative bias, and no bias of the coefficients, respectively. This is done to hedge against possible prior misspecification. • A Categorical likelihood, p(y | x, θ) = Cat(Φθ(x)), whose parameter is given by the output of a functional model Φθ. In the context of IBNNs, we could specify the set of extreme elements of the likelihood credal set as Lx,θ = {Px,θ : px,θ(y) = Cat(Φs,θ(x)), s ∈ S}, where S = {1, . . . , S} ⊂ N is a generic index set. Specifying set Lx,θ, then, corresponds to eliciting a finite number S of possible (parametrized) architectures for the neural network, Φs,θ, s ∈ S = {1, . . . , S}, and obtain, as a con- sequence, S categorical distributions {Cat(Φs,θ(x))}s∈S. This captures the ambiguity around the true data generating process faced by the agent, and allows them to hedge against likelihood misspecification. More in general, we can use the priors and likelihoods that better fit the type of analysis we are performing. For example, for the choice of the priors we refer to [26], where the authors study the problem of selecting the right type of prior for BNNs. We compute the N := #P × #Lx,θ posteriors post(P, Px,θ), for all P ∈ P and all Px,θ ∈ Lx,θ. They are the elements of set PD, whose convex hull ConvPD represents the posterior credal set. The posteriors PD ∈ PD are distributions on the parameter space Θ.6 Every such posterior induces a distribution on the output space Y via the predictive distribution p( ̃y | ̃x, x1, y1, . . . , xn, yn) = (cid:90) Θ p( ̃y | θ, ̃x) * p(θ | x1, y1, . . . , xn, yn) dθ, where ̃x is a new input and ̃y is the associated output (see Appendix F for more details). In symbols, we can write PD ⇝ ˆP , for all PD ∈ PD, and let ˆP := { ˆP1, . . . , ˆPN }. Its convex hull Conv ˆP is the predictive credal set. To save notation, we write ˆpk(*) ≡ pk(* | ̃x, x1, y1, . . . , xn, yn), for all k ∈ {1, . . . , N }. Now, for every such distribution we compute the α-level Highest Density Region (HDR) R(ˆpα k ), α ∈ (0, 1). As defined in [11, Section 1], it is a subset of the output space Y such that (cid:90) R(ˆpα k ) ˆpk(y)dy ≥ 1 − α and (cid:90) R(ˆpα k ) dy is a minimum. R(ˆpα k ) dy to be a minimum because we want R(ˆpα We need (cid:82) k ) to be the smallest possible region that gives us the desired probabilistic coverage. Equivalently, we can write that R(ˆpα k ) = {y ∈ Y : ˆpk(y) ≥ ˆpα k is a constant value. In particular, it is the largest constant such that ˆPk[y ∈ R(ˆpα k ) can be interpreted as k )] ≥ 1 − α [34]. In dimension 1, R(ˆpα k }, where ˆpα 6Assume for simplicity that they all have density with respect to some (σ-finite) dominating measure. 12 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee the narrowest interval – or union of intervals – in which the value of the (true) output falls with probability of at least 1 − α according to distribution ˆPk. As we can see, HDR's are a Bayesian counterpart of confidence intervals. We give a simple visual example in Figure 5. Figure 5. The 0.25-HDR from a Normal Mixture density. This picture is a replica of [34, Figure 1]. The geometric representation of "75% probability according to ˆP " is the area between the pdf curve ˆp(y) and the horizontal bar corresponding to ˆp0.25. A higher probability coverage (according to ˆP ) would correspond to a lower constant, so ˆpα < ˆp0.25, for all α < 0.25. In the limit, we recover 100% coverage at ˆp0 = 0. Finally, compute the α-level Imprecise Highest Density Region (IHDR) IRα := ∪N k ). By taking the union of the HDR's, we ensure that all the probability measures in the pre- dictive credal set Conv ˆP assign probability of at least 1 − α to the event {y ∈ IRα}; this ˆPk(y ∈ is a consequence of Lemma 2. In turn, this implies that ˆP (y ∈ IRα) = inf k∈{1,...,N } IRα) ≥ 1 − α. This can be interpreted as the event A = {The (true) output belongs to IRα} having lower probability of at least 1 − α, a probabilistic guarantee for the set of outputs IRα generated by our procedure. k=1R(ˆpα This method allows to quantify and control the difference between the upper and lower probabilities of IRα. To see this, notice that ˆP (y ∈ IRα) ≤ 1, so ˆP (y ∈ IRα) − ˆP (y ∈ IRα) ≤ α. Notice also that the size of IRα is an increasing function of both AU and EU. As a consequence, it is related, but it is not equal, to the AU the agent faces. If we want to avoid to perform the procedure only to discover that IRα is "too big", then we can add an "AU check" at the beginning. This, together with computing IRα in a classification setting, is explored in Appendices G and H. We conclude with a remark. We first point out that in applications the predictive density ˆp is computed using the VI approximation ̆p of the posterior density, that is, by solving (cid:82) Θ p( ̃y | θ, ̃x) * ̆p(θ | x1, y1, . . . , xn, yn) dθ. This allows to obtain ˆp even when the exact posterior is intractable. Second, we observe that the scholar is mostly interested in the AU and EU associated with the credal set Conv ˆP of predictive distributions. This because they are ultimately interested in reporting the uncertainty around the predicted outputs given a new input in the problem at hand, more than the uncertainty on the parameters of the BNNs and on the likelihoods. Finally, a tacit assumption is that the EU and AU associated with the predictive credal set Conv ˆP are similar whether we compute its elements using the exact posteriors or their VI approximation. This is needed because in real-world applications the agent would not be able to make the ambiguity around the correct prior and likelihood ̂p0.25ŷp(y) Imprecise Bayesian Neural Networks 13 percolate towards downstream tasks without using variational inference (or other types of approximations). 5. Experiments In this section, we focus on the downstream task performance of IBNNs. We show that they perform better than an ensemble of BNNs (EBNN) – introduced formally in the next paragraph. To demonstrate the utility of the proposed method, we study the behavior of certain safety-critical settings under distribution shifts and its ramifications. One, for motion prediction in autonomous driving scenarios, and two, to model blood glucose and insulin dynamics for artificial pancreas control. In [22], the authors pursue the same heuristic endeavor as we do, but take an ensemble route. They too consider different BNNs, but instead of keeping them separate and use them to build a predictive credal set, they average them out. Similar to theirs, we elicit the following procedure, that we call ensemble of BNNs (EBNN). Consider k different BNNs, and compute the posterior distribution on the parameters. They induce k predictive distributions on the output space Y, each having mean μj and variance σ2 j . We call EBNN distribution Pens a Normal having mean μens = 1/k (cid:80)k j=1 μj and covariance matrix σ2 ens = 1/k (cid:80)k j=1(μj − μens)2. We use the α-level HDR associated with Pens as a benchmark for our IRα. Being rooted in IP theory, IBNNs are a better justified procedure than EBNN from a theoretical standpoint. In this section, we show with two applications that their implementation performs better than EBNN. We do not consider Bayesian Model Averaging (BMA) as a baseline for IBNNs because BMA suffers from pitfalls when used in the context of Bayesian neural networks [36]. In addition, we do not compare IBNNs against belief tracking techniques because these latter require extra assumptions that IBNNs do not, see Appendix L. j + 1/(k − 1) (cid:80)k ensI, where σ2 j=1 σ2 Uncertainty Quantification Benchmark Experiments. In Appendix I, we include de- tails of experiments where we train IBNNs for image classification tasks for standard datasets like CIFAR10 [44], SVHN [56], Fashion-MNIST [74], and MNIST [49]. There, we discuss how IBNNs are better than EBNN at disentangling AU and EU, and at quantifying them. While for IBNNs an increase in the corruption of the dataset corresponds to an increase in both EU and AU, for EBNN the AU either stays constant, or it decreases. This counterintuitive – and erroneous – behavior makes us conclude that we are able to capture the uncertainties better than the baseline. 5.1. Motion Prediction for Autonomous Racing. In this case study, we demonstrate the utility of IBNNs for motion prediction in autonomous driving scenarios. An important challenge in autonomous driving is understanding the intent of other agents and predicting their future trajectories to allow for safety-aware planning. In autonomous racing, where control is pushed to the dynamical limits, accurate and robust predictions are even more essential for outperforming opponent agents while assuring safety. Again, IBNNs provide a straightforward method for quantifying uncertainty and deriving robust prediction regions for anticipating an agent's behavior. 14 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee We use the problem settings in [69] to define the problem of obtaining prediction sets for future positions of an autonomous racing agent. Our results show that the prediction regions have improved coverage when compared to EBNN. These results hold in both in-distribution and out-of-distribution settings, which are described below. Problem. Let Oi(t, l) ≡ Oi = {πi t} denote the i-th trajectory instance of an agent at time t, consisting of the observed positions from time t − l up to time t. Let then C i be a time-invariant context variable. Let also F i(t, h) ≡ F i = {πi t+h} be the collection of the next h future positions. We wish to obtain a model M that predicts region Rα with probabilistic guarantees. In particular, for EBNN Rα is the α-level HDR of Pens, so that Pens(F i ∈ Rα) ≥ 1 − α, while for IBNN Rα = IRα, so that ˆP (F i ∈ Rα) ≥ 1 − α. t+1, . . . , πi t−l, . . . , πi The dataset consists of instances of (Oi, F i) divided into a training set Dtrain and a test- ing set Dtest. We train an uncertainty-aware model on Dtrain that computes the triplet (F i m are the lower, upper, and mean predictions of the future positions, respectively. u) = M (Oi, C i) where F i u, F i l , F i m, F i l , F i The dataset Dall is created by collecting simulated trajectories of autonomous race cars in the F1Tenth-Gym [57] (details in [69]). As shown in Figure 6, different racing lines were utilized including the center, right, left, and optimal racing line for the Spielberg track. Figure 6. Motion Prediction for F1Tenth-Gym Environment [57]. Data is collected by simulating various racing lines on the Spielberg Track. We denote these by Dcenter, Dright, Dleft, and Drace, respectively. Position π is a vector π = (a, b, θ, v)⊤, where a and b are coordinates in a 2-dimensional Euclidean space, and θ and v are the heading and speed, respectively. In total, the Dall consists of 34686 train instances, 4336 validation instances, and 4336 test instances. In-distribution vs. Out-of-distribution. We consider the prediction task to be in- distribution when Dtrain, Dtest ⊂ Dall. It is out-of-distribution (OOD) when Dtrain ⊂ Dcenter ∪ Dright ∪ Dleft and Dtest ⊂ Drace. Metrics. We train the ensemble of BNNs and the IBNN models, Mens and MIBNN respec- tively, using the same architecture and different seeds. We compare the performance with respect to the test set by computing the single-step coverage, where each prediction time- step is treated independently, and the multi-step coverage, which considers the entire h-step prediction. Figure 7 (A) depicts a sample of the in-distribution evaluation for each of the models. For a given trajectory, the red boxes indicate when the prediction region did not cover the Imprecise Bayesian Neural Networks 15 actual trajectory at that time-step. Qualitatively, MIBNN has less missed timesteps when compared to Mens. Table 1 shows that IBNNs perform better in terms of both one-step and multi-step coverage. Similar results can be observed for the OOD scenario. There, all models were trained on racing lines which are predominantly parallel to the track curvature. As a consequence, when the test set consists of instances with higher curvatures, the overall coverage of all models degrades. This can be seen in Figure 7 (B), where the prediction of the models (orange) tends to be straight while the actual trajectory is more curved (green). Despite this, the figure and the coverage metrics in Table 1 show how IBNN exhibits a more robust behavior. In-Distribution Results Ensemble IBNN 1 − α 0.9 0.95 0.99 0.9 0.95 0.99 One-step 0.962 0.980 0.992 0.992 0.995 0.997 Multi-step 0.638 0.826 0.937 0.914 0.948 0.979 Out-of-Distribution Results Ensemble IBNN 1 − α 0.9 0.95 0.99 0.9 0.95 0.99 One-step 0.919 0.950 0.980 0.979 0.988 0.995 Multi-step 0.532 0.703 0.860 0.825 0.884 0.943 Table 1. F1Tenth coverage results. We report one-step coverage and multi-step coverage across 3 different values of α. IBNNs exceed coverage of EBNNs in all settings. 5.2. Artificial Pancreas Control. Overall Setup. In this next case study we consider the problem of data-driven control of human blood glucose-insulin dynamics, using an artificial pancreas system, Figure 8. External insulin delivery is accomplished by using an insulin pump controlled by the ar- tificial pancreas software, which attempts to regulate the blood-glucose (BG) level of the patient within the euglycemic range of [70, 180]mg/dl [46]. Levels below 70mg/dl lead to hypoglycemia, which can lead to loss of consciousness, coma or even death. On the other hand, levels above 300mg/dl lead to a condition called the ketoacidosis, where the body can In order to treat break down fat due to lack of insulin, and lead to build up of ketones. this situation, patients receive external insulin delivery through insulin pumps. Artificial Pancreas (AP) systems can remedy this situation by measuring the blood glucose level, and automatically injecting insulin into the blood stream. Thus, we define the unsafe regions of the space as G(t) ∈ (−∞, 70) ∪ (300, ∞), where G(t) is the BG value at time t. This is the shaded region in Figure 9. 16 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee (a) (b) Figure 7. Left: F1Tenth in-distribution Results. Given an input of past observations, IBNNs exhibit better coverage of the future target trajectory. Predictions which do not cover the target within the desired 1 − α level are indicated in red. Right: F1Tenth Out-of-distribution (OOD) Results. Robust performance is exhibited by IBNNs when compared to EBNN in OOD settings. Figure 8. The Bayesian neural networks predict a future blood glucose value. These individual predictions are combined to get a robust estimate of the true value as an interval. This is used by the MPC control algorithm to recommend insulin dosage for the patient. The patient block in our experiment is simulated using the virtual patient models from the UVa-Padova simulator. Neural Network Models and Controller. Deep neural networks are effective in cap- turing the BG-insulin dynamics for personalized medical devices [46]. This allows for im- proved device performance. Even though standard feedforward neural networks can be used, Bayesian neural networks (BNN), and especially a collection of multiple BNNs, offer a better alternative towards uncertainty aware predictions. Here, we test the ramifications of these prediction sets, when used inside an online receding horizon control scheme for insulin deliv- ery. We use the standard MPC control scheme for this purpose, well-known in the literature [21]. More formally, let G(t) and I(t) ≡ It be the blood-glucose and insulin values at time ←− t, respectively. We denote the finite length trajectory of length H as G H(t) := [G(t − H + ←− I H(t) := [I(t−H +1), . . . , I(t)]. An uncertainty aware model M computes 1), . . . , G(t)], and ←− I H(t)), where Gm is the mean predic- the triplet (Gl(t + l), Gm(t + l), Gu(t + l)) = M ( tion output, and Gl, Gu are the lower and upper predictions of the glucose value, respectively. ←− G H(t), Imprecise Bayesian Neural Networks 17 Figure 9. Starting from an initial glucose value, the task of the artificial pancreas controller is to maintain the blood glucose value within safe operating limits using insulin as a mode of control. By design, it is true that Gl ≤ Gm ≤ Gu. A model predictive control algorithm – whose cost function we denote by J – solves arg minI0,I1,...,Ik−1 ←− I H(t + i))). ←− G H(t + i), i=0 J(M ( After every time step, the control algorithm picks the first insulin input I0 as the insulin bolus for the patient, and discards the rest. Cost function J takes into account three factors, (i) Distance of the mean prediction level Gm at each time step from a target value of 120mg/dl, (ii) Distance of upper and lower predictions (Gu and Gl) from the unsafe regions of the state space G(t) > 300 and G(t) < 70, and (iii) Total insulin injected (cid:80)k−1 (cid:80)k−1 t=0 It. Starting with some initial glucose value G(0), we measure the performance of the artificial pancreas controller as the fraction of time it spends in the unsafe regions, tunsafe = 1 L L (cid:88) t=1 1 {G(t) ∈ (−∞, 70) ∪ (300, ∞)} , where 1{*} denotes the indicator function. A lower value is more desirable. We compare EBNN and IBNNs as different realizations of the model M . Distribution Shift using Meals. A well known problem with learnt models is distri- bution shift. Bayesian neural networks can address this issue by apprising the end user of the increased uncertainty. For regression models of the type described above, this appears as larger prediction intervals [Gl, Gu]. The artificial pancreas controller can run into this situation in the following way: the insulin-glucose time series data collected for training the data-driven model M can be without meals, while at test time the patient can have meals. This creates a distribution shift between the training and test time data. Fortunately, the UVa-Padova simulator [14] allows us to create datasets with and without meal inputs. In this case study, the training data was obtained by randomly initializing the BG value in the range [120, 190], and simulating the patient for 720 minutes. The controller was executed at 5 minutes intervals. At test time the patient was supplied meals at specific time intervals (for details, see Appendix K). This creates a significant distribution shift since meals are effec- tively an unknown variable which can affect the system state. However, from the controller's perspective this is practical, since patients can have unannounced meals. Results and Discussion. To capture the difference in performance between EBNN unsafe depend and IBNN, we compute Perfdiff := (tEBNN unsafe . Both tEBNN unsafe and tIBNN unsafe − tIBNN unsafe)/tEBNN 18 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee on interval [Gl, Gu]; for EBNN, this latter corresponds to the α-level HDR associated with EBNN distribution Pens, while for IBNN it corresponds to the IHDR IRα. We consider one case in which an IBNN is trained using a credal prior set and only one likelihood (we choose different seeds which initialize the prior distributions but we keep the same architecture for the BNNs), and another case in which we do the opposite (we use the same seed and different architectures). We report Perfdiff, across different choices in Table 2. We observe that a more conservative estimate, as informed by the IBNN model as compared to the EBNN framework, results in controllers which respect the safety limits better. To see that IBNNs are more conservative than EBNNs, notice that when combining predictive distributions from multiple BNNs, an IBNN combines the predictions via a finitely generated credal set (FGCS) whose extrema are the individual distributions. On the contrary, EBNNs take an average of the individual distributions to compute the ensemble distribution Pens. The union of the HDRs of the pre- dictive distributions is more conservative (i.e., broader) than the HDR of the single ensemble distribution. While the approach by EBNNs seems like a reasonable choice on the surface, it falls short in capturing the uncertainty necessary for the downstream task. For more details on this case study, see Appendix K. 1 − α 0.9 0.95 Varying Seeds Varying Architectures 2.3% 3.5% 0.5% -3.8% 4.4% 0.99 5.2% Table 2. We report the performance improvements when using IBNNs as compared to EBNNs across 3 different values of α. Row 1 corresponds to the case where the individual BNNs are trained with different seeds for the prior distribution; and Row 2 is the case when the BNNs have different architectures. 6. Related Work In [12], the authors introduce credal classifiers (CCs) as a generalization of classifiers based on Bayesian networks. Unlike CCs, IBNNs do not require independence assumptions between non-descendant, non-parent variables. In addition, IBNNs avoid NP-hard complexity issues of searching for optimal structure in the space of Bayesian networks [10]. In [52], an epis- temic convolutional neural network (ECNN) is developed that explicitly models the epistemic uncertainty induced by training data of limited size and quality. A clear distinction is that ECNNs measure uncertainty in target-level representations whereas IBNNs identify the un- certainty measure on the output space. Despite the merit of their work, we believe IBNNs achieve greater generality, since they are able to quantify aleatoric and epistemic uncertainty and are applicable to problems beyond classification. For a review of the state of the art con- cerning the distinction between EU and AU we refer to [35] and to [52]. We also point out how IBNNs have been recently used to solve prior-likelihood conflicts in Bayesian statistics [54]. Further references can be found in Appendix M. Imprecise Bayesian Neural Networks 19 7. Conclusion We presented IBNNs, a generalization of BNNs that allows to distinguish between AU and EU, and to quantify them. We showed how they can be used to specify a set of outputs that enjoys probabilistic guarantees, and we applied them to safety-critical settings. We point out how a region that improves IRα, meaning that it would be tighter, is the α = {y ∈ Y : ˆp(y) ≥ ˆpα}, where ˆp is the lower pdf/pmf evaluated at y, and ˆpα following: IR′ is the largest constant such that ˆP (y ∈ IR′ α is that, while the highest density regions associated with the predictive distributions can be computed using off-the-shelf tools, calculating ˆp and ˆpα would have been much more computationally expensive. In addition, it would have required to come up with a new technique to find ˆp and ˆpα. We defer studying this to future work. α) ≥ 1 − α. The problem with IR′ We also plan to apply IBNNs to continual learning (CL) to overcome the curse of dimen- sionality and to capture an agent's preference over the tasks to perform. Furthermore, we intend to relate IBNNs to Bayesian model selection (BMS) [27]. This latter suffers from the same problem as "regular" Bayesian inference. That is, while it tries to come up with a sophisticate prior that induces shrinkage, it still relies on the "correctness" of that prior, i.e. on correctly specifying the prior's parameters. In the future, an interesting way of combining IBNNs with BMS will be to use a finite number of regularized horseshoe priors, as suggested by [27, Section 3.2], as extreme elements of the prior credal set. We also call attention to the fact that an IBNN is a model-based approach. The relationship with model-free approaches such as conformal prediction will be the object of future studies. In particular, we are interested in finding in which cases IHDRs are narrower than conformal regions, and vice versa. Finally, we point out how one possible way of easing the burden of the combinatorial task in step S2 of the IBNN procedure is to specify a prior credal set whose size strikes the perfect balance between being "vague enough" so that we do not underestimate the EU, and being "small enough" so that the IBNN is actually implementable. We suspect conjugacy of the priors may play a key role in this endeavor. Because of its centrality, we defer the study of "optimal prior credal sets" to future work. References [1] Joaquín Abellán, George Jiří Klir, and Serafín Moral. Disaggregated total uncertainty measure for credal sets. International Journal of General Systems, 1(35):29–44, 2006. [2] Joaquín Abellán and Serafín Moral. A non-specificity measure for convex sets of probability distributions. International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems, 8(3):357–367, 2000. [3] Alexander Amini, Wilko Schwarting, Ava Soleimany, and Daniela Rus. Deep evidential regression. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 14927–14937. Curran Associates, Inc., 2020. [4] David Avis and Komei Fukuda. Reverse search for enumeration. Discrete Applied Mathematics, 65:21–46, 1996. [5] James O. Berger. The robust Bayesian viewpoint. In Joseph B. Kadane, editor, Robustness of Bayesian Analyses. Amsterdam : North-Holland, 1984. [6] Jose M. Bernardo. Reference posterior distributions for Bayesian inference. Journal of the Royal Statistical Society: Series B, 41(2):113–128, 1979. 20 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee [7] Yuhang Cai and Lek-Heng Lim. Distances between probability distributions of different dimensions. IEEE Transactions on Information Theory, 68(6):4020–4031, 2022. [8] Michele Caprio and Ruobin Gong. Dynamic precise and imprecise probability kinematics. In Enrique Miranda, Ignacio Montes, Erik Quaeghebeur, and Barbara Vantaggi, editors, Proceedings of the Thirteenth International Symposium on Imprecise Probability: Theories and Applications, volume 215 of Proceedings of Machine Learning Research, pages 72–83. PMLR, 11–14 Jul 2023. [9] Simone Cerreia-Vioglio, Fabio Maccheroni, and Massimo Marinacci. Ergodic theorems for lower proba- bilities. Proceedings of the American Mathematical Society, 144:3381–3396, 2015. [10] David M. Chickering, David Heckerman, and Christopher Meek. Large-sample learning of Bayesian networks is NP-hard. The Journal of Machine Learning Research, 5:1287–1330, 2004. [11] Frank P. A. Coolen. Imprecise highest density regions related to intervals of measures. Memorandum COSOR, 9254, 1992. [12] Giorgio Corani, Alessandro Antonucci, and Marco Zaffalon. Bayesian Networks with Imprecise Probabilities: Theory and Application to Classification, chapter 4 of Data Mining: Foundations and Intelligent Paradigms: Volume 1: Clustering, Association and Classification, pages 49–93. Berlin, Germany : Springer, 2012. [13] Fabio Gagliardi Cozman. Credal networks. Artificial Intelligence, 120:199–233, 2000. [14] Chiara Dalla Man, Francesco Micheletto, Dayu Lv, Marc D. Breton, Boris Kovatchev, and Claudio Cobelli. The UVA/PADOVA type 1 diabetes simulator: New features. Journal of Diabetes Science and Technology, 8(1):26–34, 2013. [15] Bruno de Finetti. Theory of Probability, volume 1. New York : Wiley, 1974. [16] Bruno de Finetti. Theory of Probability, volume 2. New York : Wiley, 1975. [17] Thierry Denoeux. An evidential neural network model for regression based on random fuzzy numbers. In Sylvie Le Hégarat-Mascle, Isabelle Bloch, and Emanuel Aldea, editors, Belief Functions: Theory and Applications, pages 57–66, Cham, 2022. Springer International Publishing. [18] Thierry Denoeux. Quantifying prediction uncertainty in regression using random fuzzy sets: the ENNreg model. IEEE Transactions on Fuzzy Systems, pages 1–10, 2023. [19] Stefan Depeweg, Jose-Miguel Hernandez-Lobato, Finale Doshi-Velez, and Steffen Udluft. Decomposition of uncertainty in Bayesian deep learning for efficient and risk-sensitive learning. In International Conference on Machine Learning, pages 1184–1193. PMLR, 2018. [20] Didier Dubois and Eyke Hüllermeier. Comparing probability measures using possibility theory: A notion of relative peakedness. International Journal of Approximate Reasoning, 45(2):364–385, 2007. Eighth European Conference on Symbolic and Quantitative Approaches to Reasoning with Uncertainty (ECSQARU 2005). [21] Souradeep Dutta, Taisa Kushner, and Sriram Sankaranarayanan. Robust data-driven control of artificial pancreas systems using neural networks. In Milan Češka and David Šafránek, editors, Computational Methods in Systems Biology, pages 183–202, Cham, 2018. Springer International Publishing. [22] Romain Egele, Romit Maulik, Krishnan Raghavan, Prasanna Balaprakash, and Bethany Lusch. Autodeuq: Automated deep ensemble with uncertainty quantification. CoRR, abs/2110.13511, 2021. [23] Daniel Ellsberg. Risk, ambiguity, and the Savage axioms. The Quarterly Journal of Economics, 75(4):643–669, 1961. [24] Emlyn Flint, Florence Chikurunhe, and Anthony Seymour. Regime-based tactical allocation for equity factors and balanced portfolios. SSRN Electronic Journal, 01 2017. [25] Benoît Fortin, Samir Hachour, and François Delmotte. Multi-target PHD tracking and classification using imprecise likelihoods. International Journal of Approximate Reasoning, 90:17–36, 2017. [26] Vincent Fortuin, Adrià Garriga-Alonso, Mark van der Wilk, and Laurence Aitchison. BNNpriors: A li- brary for bayesian neural network inference with different prior distributions. Software Impacts, 9:100079, 2021. [27] Soumya Ghosh, Jiayu Yao, and Finale Doshi-Velez. Model selection in Bayesian neural networks via horseshoe priors. Journal of Machine Learning Research, 20(182):1–46, 2019. Imprecise Bayesian Neural Networks 21 [28] Itzhak Gilboa and Massimo Marinacci. Ambiguity and the Bayesian paradigm. In Daron Acemoglu, Manuel Arellano, and Eddie Dekel, editors, Advances in Economics and Econometrics, Tenth World Congress, volume 1. Cambridge : Cambridge University Press, 2013. [29] Ethan Goan and Clinton Fookes. Bayesian Neural Networks: An Introduction and Survey, pages 45–87. Cham, Switzerland : Springer International Publishing, 2020. [30] Ruobin Gong and Xiao-Li Meng. Judicious judgment meets unsettling updating: dilation, sure loss, and Simpson's paradox. Statistical Science, 36(2):169–190, 2021. [31] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In International conference on machine learning, pages 1321–1330. PMLR, 2017. [32] Dan Hendrycks and Thomas G. Dietterich. Benchmarking neural network robustness to common cor- ruptions and perturbations. CoRR, abs/1903.12261, 2019. [33] Peter J. Huber and Elvezio M. Ronchetti. Robust statistics. Wiley Series in Probability and Statistics. Hoboken, New Jersey : Wiley, 2nd edition, 2009. [34] Rob J. Hyndman. Computing and graphing highest density regions. The American Statistician, 50(2):120–126, 1996. [35] Eyke Hüllermeier and Willem Waegeman. Aleatoric and epistemic uncertainty in machine learning: an introduction to concepts and methods. Machine Learning, 3(110):457–506, 2021. [36] Pavel Izmailov, Patrick Nicholson, Sanae Lotfi, and Andrew G Wilson. Dangers of bayesian model averaging under covariate shift. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, volume 34, pages 3309–3322. Curran Associates, Inc., 2021. [37] Pavel Izmailov, Sharad Vikram, Matthew D Hoffman, and Andrew Gordon Gordon Wilson. What are Bayesian neural network posteriors really like? In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139, pages 4629–4640. PMLR, 2021. [38] Harold Jeffreys. An invariant form for the prior probability in estimation problems. Proceedings of the Royal Society A, 186(1007):453–461, 1946. [39] Laurent Valentin Jospin, Hamid Laga, Farid Boussaid, Wray Buntine, and Mohammed Bennamoun. Hands-on Bayesian neural networks – A tutorial for deep learning users. IEEE Computational Intelligence Magazine, 17(2):29–48, 2022. [40] Sanyam Kapoor, Wesley J Maddox, Pavel Izmailov, and Andrew Gordon Wilson. On uncertainty, tem- pering, and data augmentation in bayesian classification. arXiv preprint arXiv:2203.16481, 2022. [41] Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? Advances in neural information processing systems, 30, 2017. [42] John Klein, Christèle Lecomte, and Pierre Miché. Hierarchical and conditional combination of belief functions induced by visual tracking. International Journal of Approximate Reasoning, 51(4):410–428, 2010. [43] Ranganath Krishnan, Mahesh Subedar, and Omesh Tickoo. MOPED: efficient priors for scalable varia- tional inference in bayesian deep neural networks. CoRR, abs/1906.05323, 2019. [44] Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. CIFAR-10 (Canadian Institute for Advanced Research). Available at http://www.cs.toronto.edu/ kriz/cifar.html, 2009. [45] Meelis Kull and Peter A. Flach. Reliability Maps: A Tool to Enhance Probability Estimates and Improve Classification Accuracy. In Toon Calders, Floriana Esposito, Eyke Hüllermeier, and Rosa Meo, editors, Machine Learning and Knowledge Discovery in Databases, Lecture Notes in Computer Science, pages 18–33, Berlin, Heidelberg, 2014. Springer. [46] Taisa Kushner, David Bortz, David M. Maahs, and Sriram Sankaranarayanan. A data-driven approach to artificial pancreas verification and synthesis. In Proceedings of the 9th ACM/IEEE International Conference on Cyber-Physical Systems, ICCPS '18, pages 242–252. IEEE Press, 2018. [47] Jouko Lampinen and Aki Vehtari. Bayesian approach for neural networks - review and case studies. Neural Networks, 4:257–274, 2001. [48] Daniel Lassiter. Representing credal imprecision: from sets of measures to hierarchical Bayesian models. Philosophical Studies, 177(6):1463–1485, 2020. 22 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee [49] Yann Lecun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. [50] Peter Lenk and Bryan Orme. The value of informative priors in Bayesian inference with sparse data. Journal of Marketing Research, 46(6):832–845, 2009. [51] Isaac Levi. The Enterprise of Knowledge. London, UK : MIT Press, 1980. [52] Shireen Kudukkil Manchingal and Fabio Cuzzolin. Epistemic deep learning. Available at arxiv:2206.07609, 2022. [53] Massimo Marinacci and Luigi Montrucchio. Introduction to the mathematics of ambiguity. In Itzhak Gilboa, editor, Uncertainty in economic theory: a collection of essays in honor of David Schmeidler's 65th birthday. London : Routledge, 2004. [54] Alexander Marquardt, Julian Rodemann, and Thomas Augustin. An empirical study of prior-data con- flicts in Bayesian neural networks. Poster presented at 13th International Symposium on Imprecise Probabilities: Theories and Applications (ISIPTA) 2023, 2023. [55] Norman Mu and Justin Gilmer. MNIST-C: A robustness benchmark for computer vision. CoRR, abs/1906.02337, 2019. [56] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011, 2011. [57] Matthew O'Kelly, Hongrui Zheng, Dhruv Karthik, and Rahul Mangharam. F1TENTH: An Open-source Evaluation Environment for Continuous Control and Reinforcement Learning. In Proceedings of the NeurIPS 2019 Competition and Demonstration Track, pages 77–89. PMLR, 2020. [58] Sangdon Park, Osbert Bastani, Nikolai Matni, and Insup Lee. PAC confidence sets for deep neural networks via calibrated prediction. In 8th International Conference on Learning Representations, 2020. [59] Luis Raul Pericchi. Sets of prior probabilites and bayesian robustness. Documentation Section on the website of the Society for Imprecise Probability Theory and Applications (SIPTA), 1998. [60] Hippolyt Ritter, Aleksandar Botev, and David Barber. A scalable laplace approximation for neural networks. In International Conference on Learning Representations, 2018. [61] Robin Senge, Stefan Bösner, Krzysztof Dembczyński, Jörg Haasenritter, Oliver Hirsch, Norbert Donner- Banzhoff, and Eyke Hüllermeier. Reliable classification: Learning classifiers that distinguish aleatoric and epistemic uncertainty. Information Sciences, 255:16–29, January 2014. [62] Murat Sensoy, Lance Kaplan, and Melih Kandemir. Evidential deep learning to quantify classification uncertainty. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. [63] Marek Smieja and Jacek Tabor. Entropy of the mixture of sources and entropy dimension. IEEE Transactions on Information Theory, 58(5):2719–2728, 2012. [64] Lewis Smith and Yarin Gal. Understanding measures of uncertainty for adversarial example detection. arXiv preprint arXiv:1803.08533, 2018. [65] Bjørnar Tessem. Interval probability propagation. International Journal of Approximate Reasoning, 7(3):95–120, 1992. [66] D. Michael Titterington. Bayesian methods for neural networks and related models. Statistical Science, 19(1):128–139, 2004. [67] Krasymyr Tretiak, Georg Schollmeyer, and Scott Ferson. Neural network model for imprecise regression with interval dependent variables. Available at arXiv:2206.02467, 2022. [68] Matthias C.M. Troffaes and Gert de Cooman. Lower Previsions. Chichester, United Kingdom : John Wiley and Sons, 2014. [69] Renukanandan Tumu, Lars Lindemann, Truong Nghiem, and Rahul Mangharam. Physics Constrained Motion Prediction with Uncertainty Quantification, 2023. arXiv:2302.01060. [70] Peter Walley. Coherent lower (and upper) probabilities. Technical report, University of Warwick, Coventry, 1981. [71] Peter Walley. Statistical Reasoning with Imprecise Probabilities, volume 42 of Monographs on Statistics and Applied Probability. London : Chapman and Hall, 1991. Imprecise Bayesian Neural Networks 23 [72] Hao Wang and Dit-Yan Yeung. A survey on Bayesian deep learning. ACM Computing Surveys, 53(5):1– 37, 2021. [73] Larry A. Wasserman and Joseph B. Kadane. Bayes' theorem for Choquet capacities. The Annals of Statistics, 18(3):1328–1339, 1990. [74] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. CoRR, abs/1708.07747, 2017. [75] Fengshuo Zhang and Chao Gao. Convergence rates of variational posterior distributions. The Annals of Statistics, 48(4):2180 – 2207, 2020. Appendix A. Why do we need IPs? The main motivations for training an artificial stochastic neural network using credal sets are two. Let (Ω, F) be the measurable space of interest. (i) A single probability distribution does not suffice to represent ignorance in the sense of lack of knowledge; this is well documented in the literature, see e.g. [35] and refer- ences therein. Consider the example of complete ignorance (CI) in the case of a finite state space Ω [35, Section 3.3]. In standard Bayesian analysis, CI is modeled in terms of the uniform distribution Unif(Ω); this is justified by Laplace's "principle of indif- ference". Then, however, it is not possible to distinguish between precise probabilistic knowledge about a random event – called prior indifference; think of the tossing of a fair coin – and a complete lack of knowledge due to an incomplete description of the experiment – called prior ignorance. Another problem is given by the additive nature of probability distributions. Consider again the example of a uniform distribution. First, let us observe that it is not invariant under reparametrization. In addition, if we model the ignorance about the length x of the side of a cube in R3 via a uniform measure on the interval [l, u] ⊂ R, then this does not yield a uniform distribution of x3 on [l3, u3], which suggests some degree of informedness about the cube's volume. Finally, as pointed out in [71], if we ask a subject – even an expert – about their opinion regarding some events, it is much more likely that they will report interval of probabilities rather than single values. (ii) Working with credal sets allows to achieve prior and likelihood robustness: realistically large sets P of priors and L of likelihoods are elicited. Using credal sets, the agent recognizes that prior beliefs and knowledge about the sampling model are limited and imprecise. Combining each pair of functions in P and L using Bayes' rule, a class of posterior distributions – reflecting the updated state of uncertainty – is formed. If the available information is not sufficient to identify a unique posterior distribution, or a set of posteriors whose diameter is small, credal sets allow to represent indecision, thus leading to a less informative but more robust conclusions.7 Appendix B. On the use of credal sets Let us address a critique raised against the use of credal sets. [48] argues against the use of sets of probabilities to model an agent's prior beliefs and their knowledge of the sampling model, while debating in favor of using hierarchical Bayesian models. As reported in [35, 7Here "diameter" has to be understood as the distance between upper and lower probability of event A, for all A ∈ F. 24 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee Secton 4.6.2], the argument against credal sets that is more cogent for the machine learn- ing literature is that modeling a lack of knowledge in a set-based manner may hamper the possibility of inductive inference, up to a point where learning from empirical data is not possible any more. With this, we mean the following. As [59] points out, the natural candi- date for a class of priors to represent complete ignorance is the class Pall of all distributions. When this class leads to non-vacuous and useful conclusions, these are quite compelling and It turns out that the posterior probabilities obtained from this class are uncontroversial. vacuous, that is, their lower and upper bounds are 0 and 1: no finite sample is enough to annihilate a sufficiently extreme prior belief. There is then a compromise to be made, and this is the compromise of near-ignorance. The near-ignorance class should be vacuous a priori in some respects, typically the ones that are the most important for the analysis at hand. This way of proceeding is labeled as arbitrary by [48], who instead advocates for the use of hierarchical Bayesian procedures. We find this critique not compelling, as during the analysis the job of the agent is to model reality: as pointed out in [35, Secton 5], statistical inference is not possible without underlying assumptions, and conclusions drawn from data are always conditional on those assumptions. If we were to work every time with the maxi- mum level of generality, we would hardly be able to reach any conclusions. For example, in a statistical analysis we never consider the state Ω of apparently possible states [71, section 2.1.2], that is, the one that contains all the states ω that are logically consistent with the available information. If we consider a coin toss, we let the state space be Ω = {heads, tails}, certainly not Ω = {heads, tails, coin landing on its edge, coin braking into pieces on landing, coin disappearing down a crack in the floor}. The same holds for sets of probabilities: it makes much more sense to work with near-ignorance credal sets than to work with Pall. A final reason to rebut the point in [48] is that the problems indicated in (i) in section A that make the use of the uniform prior distribution – often interpreted as representing epistemic uncertainty in standard Bayesian inference – at least debatable are inherited by hierarchical Bayesian modeling, as specified in [6, 35, 38]. Furthermore a single distribution that is the result of a hierarchical Bayesian procedure is unable to gauge epistemic uncertainty [35]. B.1. A note on how to specify credal sets. As pointed out in [12, Section 3.3], there is a way of obtaining credal sets starting from sets of probability intervals; in addition, standard algorithms can compute the extreme elements of a credal set for which a probability interval has been provided [4]. However, the resulting number of extrema is exponential in the size of the possibility space [65];8 for this reason we prefer to specify prior and likelihood finitely generated credal sets instead. Appendix C. A further IP concept: the core Because of the conjugacy property of upper and lower probabilities, let us focus on upper probabilities only. We say that upper probability P is concave if P (A ∪ B) ≤ P (A) + P (B) − P (A ∩ B), for all A, B ∈ F. Recall that ∆(Ω, F) denotes the set of all probability measures 8Recall that the possibility space of a random variable is the space of the values it can take on. Imprecise Bayesian Neural Networks 25 on (Ω, F). Upper probability P is compatible with the convex set [30] core(P ) : = {P ∈ ∆(Ω, F) : P (A) ≤ P (A), ∀A ∈ F} = {P ∈ ∆(Ω, F) : P (A) ≤ P (A) ≤ P (A), ∀A ∈ F} where the second equality is a characterization [9, Page 3389]. Notice that the core is convex [53, Section 2.2]. We assume it is nonempty and weak⋆-closed.9 Then, it is weak⋆-compact as a result of [53, Proposition 3]. Since the core is convex, the set ex[core(P )] of extreme points of the core is well defined. It contains all the elements of the core that cannot be written as a convex combination of one another. The following important result is a consequence of [71, Theorem 3.6.2]. Theorem 8. Suppose core(P ) is nonempty and weak⋆-closed. Then, the following holds. (a) ex[core(P )] ̸= ∅. (b) core(P ) is the closure in the weak⋆ topology of the convex hull of ex[core(P )]. (c) If P (A) = supP ∈core(P ) P (A), for all A ∈ F, then P (A) = supP ∈ex[core(P )] P (A), for all A ∈ F. So in order to define an upper probability P that setwise dominates the elements of core(P ) it is enough to specify the extreme points of the core. Appendix D. A new Bayes' theorem for IPs We present Theorem 9, a result that – although appealing – does not lend itself well to be used to train an IBNN. Call Θ the parameter space of interest and assume it is Polish, that is, the topology for Θ is complete, separable, and metrizable. This ensures that the set ∆(Θ, B) of probability measures on Θ is Polish as well, where B denotes the Borel σ-algebra for Θ. Let X be the set of all bounded, non-negative, B-measurable functionals on Θ. Call D = X × Y the sample space endowed with the product σ-algebra A = Ax × Ay, where Ax is the σ-algebra endowed to X and Ay is the σ-algebra endowed to Y. Let the agent elicit Lθ := {Pθ ∈ ∆(D, A) : θ ∈ Θ}. Assume that each Pθ ∈ Lθ has density L(θ) = p(D | θ) with respect to some σ-finite dominating measure ν on (D, A); this represents the likelihood function for θ having observed data D ⊂ D. We assume for now that L ∈ X , for all D ⊂ D. Let the agent specify a set P of probabilities on (Θ, B). Then, compute P , and consider P co := core(P ); it represents the agent's initial beliefs.10 We assume that every P ∈ P co has density p with respect to some σ-finite dominating measure μ on (Θ, B), that is, p = dP dμ . We require the agent's beliefs to be represented by the core for two main reasons. The first, mathematical, one is to ensure that the belief set is compatible with the upper probability. The second, philosophical, one is the following [8]. A criticism brought forward by [71, Section 2.10.4.(c)] is that, given an upper probability P , there is no cogent reason for which the agent should choose a specific PT that is dominated by P , or – for that matter – a collection of "plausible" probabilities. Because the core considers all (countably additive) 9Recall that in the weak⋆ topology, a net (Pα)α∈I converges to P if and only if Pα(A) → P (A), for all A ∈ F. 10Superscript "co" stands for convex and core. 26 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee probability measures that are dominated by P , it is the perfect instrument to reconcile Walley's behavioral and sensitivity analysis interpretations. Let the agent compute P θ, and consider Lco θ := core(P θ); it represents the set of plausible likelihoods. Let L := (cid:26) L = , Pθ ∈ Lco θ (cid:27) , dPθ dν (1) and denote by L(θ) := supL∈L L(θ) and by L(θ) := inf L∈L L(θ), for all θ ∈ Θ. Call (cid:40) P co D := PD ∈ ∆(Θ, B) : dPD dμ = p(θ | D) = L(θ)p(θ) (cid:82) Θ L(θ)p(θ)dθ , p = dP dμ , P ∈ P co, L = (cid:41) dPθ dν , Pθ ∈ Lco θ the class of posterior probabilities when the prior is in P co and the likelihood is in Lco P D(A) = supPD∈P co theorem in [73]. θ , and let PD(A), for all A ∈ B. Then, the following is a generalization of Bayes' D Theorem 9. Suppose P co, Lco θ are nonempty and weak⋆-closed. Then for all A ∈ B, (cid:82) Θ L(θ)1A(θ)P (dθ) supP ∈P co , (2) P D(A) ≤ c Θ L(θ)1A(θ)P (dθ) + inf P ∈P co (cid:82) (cid:82) Θ L(θ)1Ac(θ)P (dθ), provided that the where c := supP ∈P co ratio is well defined, where 1A denotes the indicator function for A ∈ B. In addition, if P is concave, then the inequality in (2) is an equality for all A ∈ B. This result is particularly appealing because, given some assumptions, it allows to perform a (generalized) Bayesian update of a prior upper probability (PUP) by carrying out only one operation, even when the likelihood is ill specified so that a set of likelihoods is needed. We also have the following. Lemma 10. Suppose P co, Lco have that P D is concave as well. θ are nonempty and weak⋆-closed. Then, if P is concave, we This lemma is important because it tells us that the generalized Bayesian update of Theorem 9 preserves concavity, and so it can be applied to successive iterations. If at time t the PUP is concave, then the PUP at time t + 1 – that is, the posterior upper probabil- ity at time t – will be concave too. Necessary and sufficient conditions for a generic upper probability to be concave are given in [53, Section 5]. In the future, these results can be generalized to the case in which the elements of X are unbounded using techniques in [68], and to the case in which the elements of X are Rd-valued, for some d ∈ N, since we never used specific properties of R in our proofs. Despite being attractive, the generalized Bayesian update of Theorem 9 hinges upon three assumptions, namely that P co and Lco θ are both cores of an upper probability, that they are nonempty and weak⋆-closed, and that the prior upper probability P is concave. As the proverb goes, there is no free lunch. Having to check these assumptions, together with Imprecise Bayesian Neural Networks 27 computing a supremum, an infimum, and the integrals in (2), makes Theorem 9 inadequate to be applied in the context of IBNNs. Appendix E. Bounds on upper and lower entropy In this section we find an upper bound for H(P ) and a lower bound for H(P ) that are extremely interesting. We first need to introduce three new concepts. Definition 11. Consider a set P of probabilities on a generic measurable space (Ω, F). We say that lower probability P is convex if P (A ∪ B) ≥ P (A) + P (B) − P (A ∩ B), for all A, B ∈ F. Then, let P be either an upper or a lower probability, and consider a generic bounded function f on (Ω, F), that is, f ∈ B(Ω). We define the Choquet integral of f with respect to P as follows (cid:90) (cid:90) ∞ (cid:90) 0 f (ω)P(dω) := P ({ω ∈ Ω : f (ω) ≥ t}) dt + [P ({ω ∈ Ω : f (ω) ≥ t}) − P(Ω)] dt, Ω 0 −∞ where the right hand side integrals are (improper) Riemann integrals. If P is additive, then the Choquet integral reduces to the standard additive integral. Finally, if Ω is uncountable, define for all ω ∈ Ω π(ω) := inf P ∈P dP dμ (ω) and π(ω) := sup P ∈P dP dμ (ω). We call them lower and upper densities, respectively. The following theorem gives the desired bounds. Theorem 12. Consider a set P of probabilities on a generic measurable space (Ω, F). If Ω is uncountable, assume that every P ∈ P is dominated by a σ-finite measure μ and that the Radon-Nikodym derivatives dP dμ are continuous and bounded, for all P ∈ P. Define H(P ) := and similarly H(P ) := (cid:40) − (cid:82) − (cid:80) Ω log [π(ω)] P (dω) ω∈Ω P ({ω}) log[P ({ω})] (cid:40) − (cid:82) − (cid:80) Ω log [π(ω)] P (dω) ω∈Ω P ({ω}) log[P ({ω})] if Ω is uncountable if Ω is at most countable if Ω is uncountable if Ω is at most countable , Then, H(P ) ≤ H(P ) and H(P ) ≥ H(P ). In addition, if P is concave, the first bound is tighter, and if P is convex, the second bound is tighter. Remark 13. In [35, Section 4.6.1], the authors point out that [2] presents a generalization of the Hartley measure, called generalized Hartley measure GH(P ), that can be used to dis- aggregate the total uncertainty captured by H(P ) into aleatoric and epistemic uncertainties. We prefer not to introduce it in the present work because GH(P ) is defined based on the mass function of a belief function [30, Definition 2.4].11 This entails that the authors assume 11A belief function is a mathematical concept that should not be confused with the term "belief" we used throughout the paper to address the agent's knowledge. 28 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee that lower probability P associated with the set of probabilities of interest is a belief function, and so that for every collection {A, A1, . . . , Ak} such that A ⊂ Ai, the following holds P (A) ≥ (cid:88) (−1)#I−1P (∩i∈IAi), ∅̸=I⊂{1,...,k} for all k ∈ N. As it is immediate to see, this is assumption is not needed in the context of IBNNs. Appendix F. How to derive a predictive distribution Suppose we performed a Bayesian updating procedure so to obtain posterior pdf p(θ | i=1 ∈ (X × Y)n denotes the training set. We obtain x1, y1, . . . , xn, yn). Recall that {(xi, yi)}n the predictive distribution p( ̃y | ̃x, x1, y1, . . . , xn, yn) on Y as follows p( ̃y | ̃x, x1, y1, . . . , xn, yn) = = = (cid:90) Θ (cid:90) Θ (cid:90) Θ p( ̃y, θ | ̃x, x1, y1, . . . , xn, yn) dθ p( ̃y | θ, ̃x, x1, y1, . . . , xn, yn) * p(θ | ̃x, x1, y1, . . . , xn, yn) dθ p( ̃y | θ, ̃x) * p(θ | x1, y1, . . . , xn, yn) dθ, where p( ̃y | θ, ̃x) is the likelihood used to derive the posterior. Notice that the last equal- ity comes from output ̃y only depending on input ̃x and parameter θ, and from having assumed Dx ⊥⊥ θ (see section 2.1). From an applied point of view, a sample from p( ̃y | ̃x, x1, y1, . . . , xn, yn) is obtained as follows: (1) specify input ̃x; (2) sample a parameter ̃θ from the posterior, ̃θ ∼ p(θ | x1, y1, . . . , xn, yn); (3) plug ̃θ in the likelihood and sample ̃y ∼ p(y | ̃θ, ̃x). Appendix G. Aleatoric uncertainty check for α-level IHDR The diameter of IRα is a function of the aleatoric uncertainty (AU) faced by the agent.12 If we want to avoid to perform the procedure in section 4 only to discover that IRα is "too big", then we can add an "AU check". At the beginning of the analysis, compute the lower entropy H( ˆP ) = inf k∈{1,...,N } H( ˆPk) associated with the set ˆP = { ˆP1, . . . , ˆPN } of extreme elements of the predictive credal set, which gives us the aleatoric uncertainty within ˆP.13 We then verify whether the lower entropy H( ˆP ) is "too high". That is, if H( ˆP ) > φ, for some φ > 0, we want our procedure to abstain. This means that if the aleatoric uncertainty in set ˆP is too high, then our procedure does not return any output set for input ̃x. The value of φ can be set equal to the entropy of the probability measures that are typically used in the context the agent works in. For example, in medical applications the agent may consider the entropy of a Normal distribution, while in 12Since the diameter is a metric concept, we assume that we can find a well-defined metric dy on Y. If that is not the case, we substitute the diameter with the notion of cardinality. 13Also, it gives us a bound for the AU in the convex hull Conv ˆP. Imprecise Bayesian Neural Networks 29 financial applications the entropy of a distribution with fatter tails, such as a t-distribution or a Cauchy. We call these reference φ values. If we are interested in verifying whether (a lower bound for) the AU in Conv ˆP is "too high", we check whether H( ˆP ) > φ + log(N ), where N = # ˆP. The reason for the log(N ) term is presented in Appendix I. If we add this "AU check", the 2-tuple that the agent needs to specify to output an IHDR is ⟨φ, α⟩. Appendix H. α-level IHDR in a Classification setting In classification problems, BNNs compute the probability vector ˆp := 1 #Θ (cid:88) Φθ|D(x), θ∈Θ where we write Φθ|D to highlight the fact that θ is sampled from posterior p(θ | D), and then select the most likely class ˆy := arg maxj ˆpj, where the ˆpj's are the elements of ˆp. When applied to a classification setting, the general procedure introduced in section 4 becomes the following. Recall that we denote by N := #P × #Lx,θ the number of predictive distributions on Y induced by the extreme elements of our posterior credal set. Assume that Y = {y1, . . . , yJ }, that is, there are J ∈ N possible labels. Then, the predictive distributions on Y can be seen as N J-dimensional probability vectors ˆp1, . . . , ˆpN , where ˆpk = (ˆpk 1 = ˆpk(y1), . . . , ˆpk j = 1 for all k. j ∈ [0, 1] for all k and all j, and (cid:80)J J = ˆpk(yJ ))⊤ for all k, ˆpk j=1 ˆpk Now fix any k ∈ {1, . . . , N }, and define the partial order ⪯k on Y as yl ⪯k yi ⇐⇒ ˆpk(yl) ≥ ˆpk(yi) and yl ≺k yi ⇐⇒ ˆpk(yl) > ˆpk(yi), where i, l ∈ {1, . . . , J}, i ̸= l. This means that we can order the labels according to the probability that ˆpk assigns to them: the first label will be the one having highest probability according to ˆpk, the second label will have the second-highest probability according to ˆpk, and so on. Now order the label space Y according to ⪯k so to obtain Y ⪯k := {y⪯k 1 , . . . , y⪯k J }. This means that y⪯k (but y⪯k 1 ⪯k y⪯k according to ˆpk. 1 ⪯k y⪯k , for all j ∈ {3, . . . , J} 2 ), and so on. That is, we order the labels from the most to the least likely , for all j ∈ {2, . . . , J}, y⪯k 2 ⪯k y⪯k j j Then, we call α-level credible set according to ˆpk, α ∈ (0, 1), the set (cid:26) CSk α := y⪯k 1 , . . . , y⪯k j : j (cid:88) i=1 ˆpk(y⪯k i ) ∈ [1 − α, 1 − α + ε], j ≤ J, and ∄j′ < j : j′ (cid:88) i=1 ˆpk(y⪯k i ) ∈ [1 − α, 1 − α + ε] , (cid:27) (3) for some ε > 0. It corresponds to the α-level HDR. Notice that we require (cid:80)j ) ∈ [1 − α, 1 − α + ε] because we may need to go slightly above level 1 − α. Just as a toy example, we may have 7 labels, 3 of which would give a 0.945 coverage, while 4 would give a coverage of 0.953. If we are interested in the α = 0.05-level credible set, we ought to include the fourth label, thus yielding a coverage slightly higher than 1 − α = 0.95. The interpretation to CSk α i=1 ˆpk(y⪯k i 30 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee is the following: it consists of the smallest collection of labels to which ˆpk assigns probability of at least 1 − α (that is, those having the highest probability of being the correct one given the input). Finally, we call α-level imprecise credible set, α ∈ (0, 1), the set ICSα := N (cid:91) k=1 CSk α. In turn, we have that ˆP (y ∈ ICSα) ≥ 1 − α. Remark 14. Notice that if a credible set of level ≈ α is enough, then we can replace the left endpoint of the interval in (3) with 1 − (α + εk), for some εk > 0. Strictly speaking, in this case we obtain an (α + εk)-level credible set, which we denote by CSk , where αk := α + εk, αk k ∈ {1, . . . , N }. Going back to our toy example, we will have a credible set with 3 labels that yields a coverage of 1 − (α + εk) = 0.945 ≈ 0.95 = 1 − α, so εk = 0.005. In turn, this implies that the imprecise credible set will have a coverage of 1 − (α + maxk∈{1,...,N } εk), that is, it will have level α + maxk∈{1,...,N } εk. We denote it by ICS ̃α, where ̃α := α + maxk∈{1,...,N } εk. Appendix I. Experiments: Uncertainty Quantification Figure 10. The different trends with increasing corruption severity for EBNN (baseline) versus IBNNs. IBNNs better inform the degree of shift as compared to EBNN. Distribution shifts can introduce uncertainties in the system which can render the predic- tions meaningless. This can be due to naturally occurring corruptions as introduced in [32] for image datasets. The authors introduced 18 different noise types, which can be varied across 5 different severity levels. The intuition is that in the current context, increasing the noise Imprecise Bayesian Neural Networks 31 severity should generally result in higher uncertainty. We evaluate an IBNN on 4 standard image datasets CIFAR10 [44], SVHN [56], Fashion-MNIST [74], and MNIST [49]. We use a slightly different set of perturbations introduced in [55] for gray-scale images like MNIST and Fashion-MNIST. Additionally, we perform cross domain testing for each dataset, where we expect the uncertainties to be higher. We implement and train a Resnet-20 Bayesian DNN model inside the library Bayesian-torch [43]. For each dataset, we train 4 different networks initialized with different seeds on the prior and with the same architecture. We use a learning-rate of 0.001, batch-size of 128, and train the networks using mean-field variational inference for 200 epochs. The inference is carried out by performing multiple forward passes through parameters drawn from the posterior distribution. We used 20 Monte-Carlo samples in the experiments. Results. Following [22], for EBNN we posit that 1/k (cid:80)k j captures the aleatoric uncertainty, and 1/(k − 1) (cid:80)k j=1(μj − μens)2 captures the epistemic uncertainty; we use these values as baselines.14 For IBNN, we look at lower bounds for both EU and AU. We do so because (i) they are easy to compute and (ii) we expect both EU and AU to increase as the corruption grows, so increasing lower bounds are a good indicator of the desired trend. Denote by ex ˆP the collection of extreme elements of ˆP. Let then sup ˆP ex∈ex ˆP H( ˆP ex) =: H( ˆP ex) and sup ˆP ∈ ˆP H( ˆP ) =: H( ˆP ). Since by Proposition 7 H( ˆP ex) ≤ H( ˆP ) and H( ˆP ex) ≥ H( ˆP ), we have that H( ˆP ex) − H( ˆP ex) is a lower bound for the predictive EU. Also, by Proposition 7 j=1 σ2 14Notice that in this case we retain the assumption that the EBNN distribution on Y has mean μens and covariance matrix σ2 ensI, but we do not require that it is a Normal. That is because in this case Y is finite. Notice also that for IBNN the AU is given by the lower entropy H( ˆP ) := inf ˆP ∈ ˆP H( ˆP ), where ˆP was defined in section 4, while the EU is given by the difference H( ˆP ) − H( ˆP ), and H( ˆP ) := sup ˆP ∈ ˆP H( ˆP ). 32 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee and [63, Theorem III.1], we have that the AU is lower bonded by a quantity that can be approximated by H( ˆP ex) − log(N ), where N = # ˆP. Then, since log(N ) is a fixed quantity, the trend of H( ˆP ex) − log(N ) as we increase the corruption severity is equivalent to the trend of H( ˆP ex). We report the latter for ease of computation. We discuss the results for CIFAR10 presented in Table 3. We report the average uncertainties across all test samples as measured by the respective procedures. Note that we abstracted the severity levels to low (severity = 1), medium (severity = 2, 3), and high (severity = 4, 5) in this paper. For CIFAR10, we observe that IBNNs report lower levels of aleatoric uncertainty when subjected to low levels of corruption, which gradually increases as we move to higher levels. The epistemic uncertainty grows as well, but the change in the aleatoric component is more pronounced. However, for EBNN this is not true. Even though the epistemic uncertainty increases, the aleatoric shows the reverse trend, contrary to our intuition of aleatoric uncertainty. Using IBNNs, we achieve the highest uncertainties, both aleatoric and epistemic, when applied to entirely different test sets, namely MNIST, SVHN, and Fahion-MNIST. We report these numbers as well. Summary. We summarize our results in Figure 10. With increasing corruption severity, the aleatoric uncertainty for IBNNs becomes more pronounced. This is expected since for higher corruptions, it is hard to reconcile the performance gap by simple data-augmentation, without any additional knowledge. For EBNN, even though the epistemic uncertainty grows, the aleatoric part does not. Note that the absolute uncertainty differs due to the quantities being fundamentally different: variance versus entropy. However, the relative trends are consistent for each dataset, demonstrating the utility of IBNNs. Other datasets. The results for MNIST, Fashion-MNIST, and SVHN are presented in Tables 4, 5, and 6, respectively. We observe trends similar to CIFAR10's ones: the aleatoric uncertainty increases with corruption severity, and is the highest for completely unknown datasets. Imprecise Bayesian Neural Networks 33 Appendix J. Distance between a set of distributions P and a single distribution P ′ having different dimensions Many concepts in this section are derived from [7]. Let m, n ∈ N such that m ≤ n, and let p ∈ [1, ∞]. Call M p(Rj) the set of probability measures on Rj having finite p-th moment, and 34 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee Md(Rj) the set of probability measures on Rj having density with respect to some σ-finite dominating measure μ, j ∈ {m, n}. Let O(m, n) := {V ∈ Rm×n : V V ⊤ = Im}, where Im denotes the m-dimensional identity matrix, and for any V ∈ O(m, n) and any b ∈ Rm, define the following function φV,b : Rn → Rm, x (cid:55)→ φV,b(x) := V x + b. Let B(Rn) be the Borel σ-algebra on Rn, and for any Q ∈ ∆(Rn, B(Rn)), define φV,b(Q) := V,b, the pushforward measure. Consider then two generic probability measures Q, S such Q◦φ−1 that Q ∈ M p(Rm) and S ∈ M p(Rn), and call p (Q, n) := {α ∈ M p(Rn) : φV,b(α) = Q, for some V ∈ O(m, n), b ∈ Rm}, Φ+ d (Q, n) := {α ∈ Md(Rn) : φV,b(α) = Q, for some V ∈ O(m, n), b ∈ Rm}, Φ+ Φ−(S, m) := {β ∈ M (Rm) : φV,b(S) = β, for some V ∈ O(m, n), b ∈ Rm}. Recall now the definition of p-Wasserstein metric between two generic distributions defined on the same Euclidean space. Let P1, P2 ∈ M p(Rn), for some n ∈ N and some p ∈ [1, ∞]. Then, the p-Wasserstein distance between them is defined as Wp(P1, P2) := (cid:20) inf γ∈Γ(P1,P2) (cid:90) R2n ∥x − y∥p 2γ(d(x, y)) (cid:21)1/p , where ∥ * ∥2 denotes the Euclidean distance, p = ∞ is interpreted as the essential supremum, and Γ(P1, P2) := {γ ∈ ∆(R2n, B(R2n)) : projn 2 (γ) = P1} is the set of couplings between P1 and P2, where projn 2 is the projection to the last n coordinates. 1 is the projection onto the first n coordinates, and projn 1 (γ) = P2, projn Recall then the definition of f -divergence between two generic distributions defined on the same Euclidean space. Let P1, P2 ∈ ∆(Rn, B(Rn)), for some n ∈ N, and assume P1 ≪ P2. Then, for any convex functional f on R such that f (1) = 0, the f -divergence between P1 and P2 is defined as divf (P1∥P2) := (cid:90) f (cid:18) dP1 dP2 Rn (cid:19) (x) P2(dx). Aside from the Rényi divergence, the f -divergence includes just about every known diver- gences as special case [7]. The following are the main results of this section. Lemma 15. Let m, n ∈ N such that m ≤ n, and let p ∈ [1, ∞] and f be any convex functional on R such that f (0) = 1. Consider a generic P ⊂ M p(Rm) and P ′ ∈ M p(Rn). Let Φ+ d (P, n). Define p (P, n) and Φ+ p (P, n) := ∪P ∈PΦ+ • W + • div+ • W + • div+ p (P, P ′) := inf α∈Φ+ f (P ∥P ′) := inf α∈Φ+ p (P, P ′) := inf α∈Φ+ f (P∥P ′) := inf α∈Φ+ Then, for all P ∈ P the following holds d (P, n) := ∪P ∈PΦ+ p (P,n) Wp(α, P ′), for all P ∈ P; d (P,n) divf (P ∥P ′), for all P ∈ P; p (P,n) Wp(α, P ′); d (P,n) divf (P ∥P ′); W + p (P, P ′) ≤ W + p (P, P ′) and div+ f (P∥P ′) ≤ div+ f (P ∥P ′). Imprecise Bayesian Neural Networks 35 Lemma 16. Let m, n ∈ N such that m ≤ n, and let p ∈ [1, ∞] and f be any convex functional on R such that f (0) = 1. Consider a generic P ⊂ M p(Rn) and P ′ ∈ M p(Rm). Let Φ−(P, m) := ∪P ∈PΦ−(P, m). Define • W − • div− • W − • div− p (P, P ′) := inf α∈Φ−(P,m) Wp(α, P ′), for all P ∈ P; f (P ∥P ′) := inf α∈Φ−(P,m) divf (P ∥P ′), for all P ∈ P; p (P, P ′) := inf α∈Φ−(P,m) Wp(α, P ′); f (P∥P ′) := inf α∈Φ−(P,m) divf (P ∥P ′); Then, for all P ∈ P the following holds W − p (P, P ′) ≤ W − p (P, P ′) and div− f (P∥P ′) ≤ div− f (P ∥P ′). A visual representation of the application of Lemma 16 to IBNNs is given in Figure 11.15 Figure 11. We assume that n > m and that the oracle distribution P o x,θ belongs to M p(Rm), while (finitely generated) credal set ConvLx,θ is a subset of M p(Rm), for some finite p ≥ 1. We also assume that Px,θ is one of the extreme elements of ConvLx,θ. We see how W − x,θ); if we replace metric W − p by a generic f -divergence divf , the inequality would still hold thanks to Lemma 16. p (ConvLx,θ, P o x,θ) < W − p (Px,θ, P o Appendix K. Details on Artificial Pancreas Example Artificial Pancreas Model. An important factor when designing the controller for an artificial pancreas is to adapt the insulin delivery algorithm to the particular details of the patient. This is because patients display a wide range of variability in their response to 15Notice that in Figure 11 we have that Lx,θ ≡ Lx,θ. Mp(Rn)ConvLx,θMp(Rm)Pox,θP1x,θ≡ˇPx,θΦ−(ˇPx,θ,m)W−p(ConvLx,θ,Pox,θ)Φ−(ConvLx,θ,m)W−p(ˇPx,θ,Pox,θ)Px,θΦ−(Px,θ,m)W−p(Px,θ,Pox,θ) 36 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee insulin, depending on age, BMI, and other physiological parameters. The Bayesian neural network models have 2 hidden layers, with 10 neurons each, for the case study with 4 different seeds. This choice was informed by the experiments in [21]. For the case study with different architectures, we trained BNNs with 4 different widths: 10, 20, 30, 40. The horizon length is H = 10 time steps, and the prediction horizon is 5 steps into the future. The neural networks were trained for 200 time steps, with a learning rate of 0.001, and batch size of 128 using mean-field variational inference. The training dataset consisted of 28400 training samples, recorded without meals. Controller. We implemented a simple model predictive controller, using an off the shelf implementation of the covariance matrix adaptation evolution strategy (CMA-ES). The model predictive control planning horizon was k = 5, with a fixed seed for the randomized solver. Appendix L. Other possible baselines for IBNN We considered comparing IBNNs to Bayesian model averaging (BMA) in the initial state of our project. In [36], though, the authors show the pitfalls of BMA in the context of Bayesian neural networks. As a consequence, we decided not to use a credible interval resulting from BMA as a baseline for IBNNs. Furthermore, our experiments may seem like a type of belief tracking [25, 42]. Two comments are in order. First, this line of literature does not use deep learning techniques. Second, in these works the authors rely on Dempster-Shafer theory, a field in imprecise probability theory where lower probabilities are assumed to be belief functions, see Remark 13. We do not rely on this assumption in our work. Appendix M. Further related work Modeling uncertainty has been a longstanding goal of ML/AI research and a variety of approaches have been developed for doing so [31, 58, 39]. Recently, emphasis has been placed on discerning between aleatoric and epistemic uncertainties [61, 45, 41]. In [67], the authors present an IP-based neural network which uses a regression technique based on probability intervals. Contrary to IBNNs, their NN is rooted in the frequentist approach to imprecise probabilities [33]. In [52, Sections 2.1, 2.3], the authors focus on belief-functions-based classification methods. IBNNs cannot be directly compared with this methodologies because (i) they do not require that the scholar expresses their knowledge via a belief function, but rather through a credal set; (ii) they can be used for regression, prediction, and classification; (iii) they are rooted in Bayesian theory, as opposed to Dempster-Shafer theory. Other works in ML using a belief function approach are those from the field of evidential machine learning (EML), see e.g. [17, 18] and references therein. Existing models mainly address clustering, classification, and regression problems. The reasons why IBNNs cannot be directly compared with methods from the EML literature are (i) and (iii) above. We also point out how there exists a field within ML called evidential deep learning (EDL, not to be confused with EML). It aims at quantifying and disentangling EU and AU, and its methodologies can be applied to classification and regression, see e.g. [3, 62] and references therein. IBNNs are not immediately comparable to models from EDL because these latter Imprecise Bayesian Neural Networks 37 are non-Bayesian. In addition, their definitions of AU and EU are slightly different from the canonical ones in ensemble deep learning. Appendix N. Proofs Proof of Proposition 2. If P (A) = supP ′∈Π′ P ′(A), for all A ∈ F, then it is immediate to see that P (A) = supP ∈Π P (A) = supP ′∈exΠ′ P ′(A) = supP ′∈Π′ P ′(A), for all A ∈ F, since Π ⊂ Π′. Suppose now that P (A) = supP ∈Π P (A), for all A ∈ F. Then, we have that for all P ∈ Π j=1 αjPj, j=1 = Π. Pick then any and all A ∈ F, P (A) ≤ P (A). Pick now any P ′ ∈ Π′. We can write it as P ′ = (cid:80)k where αj ∈ [0, 1], for all j ∈ {1, . . . , k}, (cid:80)k A ∈ F; we have j=1 αj = 1, and {Pj}k P ′(A) = k (cid:88) j=1 αjPj(A) ≤ k (cid:88) j=1 αjP (A) = P (A). So P (A) ≥ P ′(A). Because this holds for all P ′ ∈ Π′ and all A ∈ F, the claim is proven. □ Proof of Proposition 4. Pick any metric d on the space ∆(Ω, F) of probabilities on (Ω, F), and any P ∈ P. Because P belongs to P, inf P ∈P d(P, P ′) can only be either equal to or smaller than d(P, P ′). By the definition of d(P, P ′), if inf P ∈P d(P, P ′) = d(P, P ′), then d(P, P ′) = d(P, P ′). If instead inf P ∈P d(P, P ′) < d(P, P ′), then d(P, P ′) < d(P, P ′). The □ proof is similar for a generic divergence div on ∆(Ω, F). Proof of Proposition 7. The result comes immediately from Π′ being a superset of Π. □ Proof of Theorem 9. Assume P co, Lco θ are nonempty and weak⋆-closed. Then, as a conse- quence of [53, Proposition 3] they are also weak⋆-compact. Pick any A ∈ B. Recall that we can rewrite the usual Bayes' updating rule as PD(A) = (cid:82) (cid:82) Θ L(θ)1A(θ)P (dθ) + (cid:82) Θ L(θ)1A(θ)P (dθ) Θ L(θ)1Ac(θ)P (dθ) = 1 1 + (cid:82) Θ L(θ)1Ac (θ)P (dθ) (cid:82) Θ L(θ)1A(θ)P (dθ) , (cid:82) Θ L(θ)1Ac(θ)P (dθ) (cid:82) Θ L(θ)1A(θ)P (dθ) which is maximized when is minimized. But (cid:82) Θ L(θ)1Ac(θ)P (dθ) (cid:82) Θ L(θ)1A(θ)P (dθ) ≥ inf P ∈P co supP ∈P co (cid:82) Θ L(θ)1Ac(θ)P (dθ) (cid:82) Θ L(θ)1A(θ)P (dθ) , which proves the inequality in (2). Assume now that P is concave. By [73, Lemma 1], we have that there exists P ∈ P co such that (cid:90) Θ sup P ∈P co L(θ)1A(θ)P (dθ) = (cid:90) Θ L(θ)1A(θ)P(dθ), (4) 38 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee for all L ∈ L . In addition, by [73, Lemma 4], we have that for all X ∈ X and all ε > 0, there exists a non-negative, upper semi-continuous function h ≤ X such that (cid:20) sup P ∈P co (cid:90) Θ (cid:21) X(θ)P (dθ) − ε < sup P ∈P co ≤ sup P ∈P co (cid:90) Θ (cid:90) Θ h(θ)P (dθ) X(θ)P (dθ). (5) Let now X = L1A. Notice that since Lco is weak⋆-compact, by (1) so is L . This implies θ that L, L ∈ L , since a compact set always contains its boundary, so L ∈ X as well, and in turn L1A ∈ X . Fix then any L ∈ L and put h = L1A. It is immediate to see that h is non-negative and upper semi-continuous. Then, by (5), we have that for all ε > 0 (cid:21) L(θ)1A(θ)P (dθ) − ε < (cid:20) (cid:90) Θ sup P ∈P co (cid:90) sup P ∈P co L(θ)1A(θ)P (dθ) ≤ sup P ∈P co Θ (cid:90) Θ L(θ)1A(θ)P (dθ). Combining (4) and(6), we obtain (cid:21) L(θ)1A(θ)P (dθ) − ε (cid:20) sup P ∈P co (cid:90) (cid:90) Θ < L(θ)1A(θ)P(dθ) ≤ sup P ∈P co Θ (cid:90) Θ L(θ)1A(θ)P (dθ), for all L ∈ L . Pick now any ε > 0 and put (6) (7) (cid:90) Θ k := sup P ∈P co (cid:90) + inf L(θ)1A(θ)P (dθ) L(θ)1Ac(θ)P (dθ) > 0. P ∈P co Choose any L ∈ L and δ ∈ (0, εk). By (7) we have that [supP ∈P co δ < (cid:82) Recall that c := supP ∈P co Θ L(θ)1A(θ)P(dθ) + (cid:82) (cid:82) Θ L(θ)1A(θ)P(dθ) and that [inf P ∈P co (cid:82) Θ L(θ)1A(θ)P (dθ)] − Θ L(θ)1Ac(θ)P (dθ)] + δ > (cid:82) Θ L(θ)1Ac(θ)P(dθ). Θ L(θ)1Ac(θ)P (dθ), and define d := Θ L(θ)1A(θ)P (dθ) + inf P ∈P co (cid:82) (cid:82) (cid:82) Θ Θ L(θ)1Ac(θ)P(dθ). Then, (cid:82) Θ L(θ)1A(θ)P(dθ) d (cid:2)supP ∈P co (cid:82) PD(A) = ≥ Θ L(θ)1A(θ)P (dθ)(cid:3) − δ c + δ − δ Θ L(θ)1A(θ)P (dθ) c Θ L(θ)1A(θ)P (dθ) c − δ k − ε. supP ∈P co supP ∈P co (cid:82) (cid:82) = > Imprecise Bayesian Neural Networks Since this holds for all ε > 0, we have that sup PD∈P co D PD(A) = supP ∈P co (cid:82) Θ L(θ)1A(θ)P (dθ) c , concluding the proof. 39 □ Proof of Lemma 10. [70, 73] show that concave upper probabilities are closed with respect to the generalized Bayes' rule. In particular, this means that, if we let b := sup P ∈P co (cid:90) Θ L(θ)1A(θ)P (dθ) + inf P ∈P co (cid:90) Θ L(θ)1Ac(θ)P (dθ), for any fixed A ∈ B, if P is concave, then for all L ∈ L P D(A) = supP ∈P co (cid:82) Θ L(θ)1A(θ)P (dθ) b (8) is concave. But since Lco is weak⋆-compact (by our assumption and [53, Proposition 3]), by θ (1) so is L . This implies that L, L ∈ L , since a compact set always contains its boundary. Call then L′ = L1A + L1Ac. It is immediate to see that L′ ∈ L . Then, by (8) we have that Θ L′(θ)1Ac(θ)P (dθ), it follows that if we call b′ := supP ∈P co Θ L′(θ)1A(θ)P (dθ) + inf P ∈P co (cid:82) (cid:82) P D(A) = supP ∈P co (cid:82) Θ L′(θ)1A(θ)P (dθ) supP ∈P co = b′ (cid:82) Θ L(θ)1A(θ)P (dθ) c is concave, concluding the proof. □ Proof of Theorem 12. Suppose Ω is uncountable. First notice that, since we assumed dP dμ to be continuous and bounded for all P ∈ P, then so is log ◦ dP dμ , for all P ∈ P, since composing a continuous function with a continuous and bounded one gives us a continuous and bounded function. This entails that the Choquet integrals of log ◦ dP dμ with respect to P and P are both well defined. In addition, being continuous and bounded, both dP dμ attain their infima and suprema thanks to Weierstrass' extreme value theorem, for all P ∈ P. Hence, all the Choquet integrals used in this proof are well defined. dμ and log ◦ dP 40 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee Then, we have the following (cid:18) H(P ) : = sup P ∈P = sup P ∈P H(P ) = sup P ∈P (cid:20)dP dμ (− log) (cid:90) − log (cid:20) dP dμ (cid:21) (cid:19) (ω) P (dω) (cid:90) Ω (cid:21) (ω) P (dω) (cid:26) (− log) (cid:18) dP dμ (cid:19)(cid:27) (ω) P (dω) Ω (cid:90) Ω sup P ∈P (cid:26) ≤ sup P ∈P (cid:90) ≤ sup P ∈P Ω (cid:90) = − Ω (cid:90) Ω (cid:90) Ω = − = − (− log) (cid:18) dP dμ (cid:19)(cid:27) (ω) P (dω) (cid:26) log (cid:18) dP dμ (cid:19)(cid:27) (ω) P (dω) inf P ∈P dP dμ (cid:19) (ω) P (dω) inf P ∈P (cid:18) log log [π(ω)] P (dω) = H(P ). (9) (10) (11) (12) The inequality in (9) is true because for all ω ∈ Ω, (cid:26) sup P ∈P (− log) (cid:18) dP dμ (cid:19)(cid:27) (ω) ≥ (− log) (cid:18)dP dμ (cid:19) (ω) . The inequality in (10) is a property of Choquet integrals taken with respect to upper prob- abilities [53]. The equality in (11) is true because for a generic function f , we have that sup −f = − inf f . Finally, the equality in (12) is true because the logarithm is a strictly increasing function. By [53, Theorem 38], if P is concave, then inequality (10) holds with an equality, and so the bound is tighter. The proof for H(P ) ≥ H(P ) is similar; we use the facts that (cid:17)(cid:111) (cid:110) (− log) (cid:16) dP dμ (ω) ≤ (− log) , for all ω ∈ Ω; (cid:16) dP (cid:17) dμ (ω) • inf P ∈P • by [53], (− log) (cid:26) (cid:90) Ω inf P ∈P (cid:26) inf P ∈P (cid:90) ≥ inf P ∈P (− log) Ω (cid:18) dP dμ (cid:19)(cid:27) (ω) P (dω) (cid:18) dP dμ (cid:19)(cid:27) (ω) P (dω); (13) • for a generic function f , inf −f = − sup f ; • by [53, Theorem 38], if P is convex, then (13) holds with an equality. Suppose now Ω is at most countable; in this case, we do not need any assumptions to make the Choquet integrals well defined, since we will not deal with density functions. The Imprecise Bayesian Neural Networks 41 following holds H(P ) : = sup P ∈P H(P ) = sup P ∈P (cid:32) − (cid:88) ω∈Ω P ({ω}) log [P ({ω})] (cid:33) = sup P ∈P (cid:88) ≤ ≤ ω∈Ω (cid:88) ω∈Ω P ({ω})(− log) [P ({ω})] (cid:88) ω∈Ω {P ({ω})(− log) [P ({ω})]} sup P ∈P P ({ω}) sup P ∈P (− log) [P ({ω})] = − = − = − (cid:88) ω∈Ω (cid:88) ω∈Ω (cid:88) ω∈Ω P ({ω}) inf P ∈P log [P ({ω})] (cid:20) (cid:21) P ({ω}) log inf P ∈P P ({ω}) P ({ω}) log [P ({ω})] = H(P ). (14) (15) (16) (17) The inequality in (14) comes from the well known fact that the sum of the suprema is at least equal to the supremum of the sum. The inequality in (15) comes from the fact that for differentiable functions, the product of the suprema is at least equal to the supremum of the product. The equality in (16) is true because for a generic function f , we have that sup −f = − inf f . Finally, the equality in (17) is true because the logarithm is a strictly increasing function. By [53, Theorem 38], if P is concave, then inequality (14) holds with an equality, and so the bound is tighter. The proof for H(P ) ≥ H(P ) is similar; we use the facts that • the sum of the infima is at most equal to the infimum of the sum; • for differentiable functions, the product of the infima is at most equal to the infimum of the product; • for a generic function f , inf −f = − sup f ; • by [53, Theorem 38], if P is convex, then inf P ∈P (cid:80) (cid:80) ω∈Ω inf P ∈P {P ({ω})(− log) [P ({ω})]}. ω∈Ω P ({ω})(− log) [P ({ω})] = □ p (P,n) Wp(α, P ′) can only be either equal or smaller than inf α∈Φ+ Proof of Lemma 15. Fix any p ∈ [1, ∞] and pick any P ∈ P. Because Φ+ p (P, n), p (P,n) Wp(α, P ′). then inf α∈Φ+ p (P, P ′). If Now, if inf α∈Φ+ p (P, P ′). This instead inf α∈Φ+ concludes the first part of the proof. Fix then any convex functional f on R such that □ f (0) = 1; the proof is similar for f -divergences. p (P,n) Wp(α, P ′), then W + p (P,n) Wp(α, P ′), then W + p (P,n) Wp(α, P ′) = inf α∈Φ+ p (P,n) Wp(α, P ′) < inf α∈Φ+ p (P, P ′) = W + p (P, P ′) < W + p (P, n) ⊂ Φ+ Proof of Lemma 16. The proof is very similar to that of Lemma 15. □ 42 Caprio, Dutta, Jang, Lin, Ivanov, Sokolsky, Lee PRECISE Center, Dept. of Computer and Information Science, University of Pennsylvania, 3330 Walnut Street, Philadelphia, PA 19104 Email address: {caprio,duttaso,jangkj,vilin,sokolsky,lee}@seas.upenn.edu Dept. of Computer Science, Rensselaer Polytechnic Institute, 110 Eighth Street, Troy, NY 12180 Email address: [email protected]
http://arxiv.org/abs/2302.09650v1
2023-02-19T18:43:24
2023-02-19T18:43:24
Scaling Laws for Multilingual Neural Machine Translation
In this work, we provide a large-scale empirical study of the scaling properties of multilingual neural machine translation models. We examine how increases in the model size affect the model performance and investigate the role of the training mixture composition on the scaling behavior. We find that changing the weightings of the individual language pairs in the training mixture only affect the multiplicative factor of the scaling law. In particular, we observe that multilingual models trained using different mixing rates all exhibit the same scaling exponent. Through a novel joint scaling law formulation, we compute the effective number of parameters allocated to each language pair and examine the role of language similarity in the scaling behavior of our models. We find little evidence that language similarity has any impact. In contrast, the direction of the multilinguality plays a significant role, with models translating from multiple languages into English having a larger number of effective parameters per task than their reversed counterparts. Finally, we leverage our observations to predict the performance of multilingual models trained with any language weighting at any scale, significantly reducing efforts required for language balancing in large multilingual models. Our findings apply to both in-domain and out-of-domain test sets and to multiple evaluation metrics, such as ChrF and BLEURT.
[ "Patrick Fernandes", "Behrooz Ghorbani", "Xavier Garcia", "Markus Freitag", "Orhan Firat" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09650v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09650v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.LG" ]
Scaling Laws for Multilingual Neural Machine Translation Patrick Fernandes 1 2 3 Behrooz Ghorbani 1 Xavier Garcia 1 Markus Freitag 1 Orhan Firat 1 Abstract In this work, we provide a large-scale empirical study of the scaling properties of multilingual neural machine translation models. We examine how increases in the model size affect the model performance and investigate the role of the train- ing mixture composition on the scaling behavior. We find that changing the weightings of the individual language pairs in the training mixture only affect the multiplicative factor of the scaling law. In particular, we observe that multilingual models trained using different mixing rates all exhibit the same scaling exponent. Through a novel joint scaling law formulation, we compute the effective number of parameters allocated to each language pair and examine the role of language similarity in the scaling behavior of our models. We find little evidence that language similarity has any impact. the direction of the multilinguality plays a significant role, with models translating from multiple languages into English having a larger number of effective parameters per task than their reversed counterparts. Finally, we leverage our observa- tions to predict the performance of multilingual models trained with any language weighting at any scale, significantly reducing efforts required for language balancing in large multilingual models. Our findings apply to both in-domain and out-of-domain test sets and to multiple evaluation metrics, such as ChrF and BLEURT. In contrast, 3 2 0 2 b e F 9 1 ] L C . s c [ 1 v 0 5 6 9 0 . 2 0 3 2 : v i X r a 1. Introduction Over the past few years, scaling has emerged as a popular and effective way to improve the performance of neural networks (Brown et al., 2020; Chowdhery et al., 2022; Lepikhin et al., 2020). Given the costs associated with training large neural models, much work has gone into understanding their scaling properties and predicting the 1Google Research 2Carnegie Mellon University 3Instituto Su- perior T ́ecnico. Correspondence to: Patrick Fernandes <pfer- [email protected]>. evolution of their performance with scale through scaling laws. Such scaling laws have been instrumental in guiding the model development efforts across a variety of domains such as computer vision (Zhai et al., 2022), language modeling (Kaplan et al., 2020; Hoffmann et al., 2022), and neural machine translation (Ghorbani et al., 2022). Despite these impressive developments, most of the scal- ing laws studies available in the literature only focus on single-task, single-language models. On the contrary, cur- rent massive neural models are often trained to solve more than one task across one or more modalities & languages (Chowdhery et al., 2022; Sanh et al., 2022; Reed et al., 2022). This disconnect from the current research frontier limits the applicability of scaling laws in guiding model development decisions. In particular, currently available scaling laws studies are unable to inform the decision process on balanc- ing the different tasks effectively at training time. Without such guidance, practitioners often have to rely on cumber- some and costly approaches such as approximate grid search to inform their decision-making; such approaches quickly become infeasible as the problem scale grows. In this paper, we take the initial step towards developing a quantitative understanding of the scaling behavior for multitask models. We choose multilingual neural machine translation (MNMT) as the setup for this initial study. This choice is motivated by several reasons: (1) MNMT has been framed and studied as a multi-task optimization problem extensively in the past (Dong et al., 2015; Luong et al., 2015; Arivazhagan et al., 2019b; Wang et al., 2021); (2) It provides a popular setup with mature benchmarks and substantial literature on scaling (Lepikhin et al., 2020; Costa- juss`a et al., 2022; Bapna et al., 2022; Huang et al., 2019); (3) Moreover, recent results on scaling laws for single-task MT models provide a natural starting point for our study (Ghorbani et al., 2022; Bansal et al., 2022; Gordon et al., 2021; Zhang et al., 2022). (4) Finally, recent findings on the optimization dynamics of MNMT models greatly simplify our study by removing the need to examine the role of the optimization algorithm in our results (Xin et al., 2022). For our analysis, we train over 200 MNMT models (ranging from 20M to 1B non-embedding parameters) and system- atically examine their scaling behaviors. We focus our in- vestigation on the data-rich, compute-rich regime where Scaling Laws for Multilingual Neural Machine Translation we have access to vast amounts of training data for all the language pairs (i.e. tasks)1 and the models are trained to near convergence. Here, the main bottleneck in the model performance is the lack of model capacity. We establish the following observations: • For each fixed training mixture, the evolution of the test cross-entropy loss for the ith language pair (Li) with model size (N ) follows a scaling law that resembles the scaling behavior of single-language-pair models: Li(N ; p) ≈ βp,iN −αp,i + L(p,i) ∞ . (1) Here, p is a vector of probabilities that determines the weight of each language pair in the training mixture. Furthermore, we find that changes in the language pair weightings only affect the multiplicative factor β; the scaling exponent α and the irreducible loss L∞ are unaffected by these changes. As such, our results suggest that scaling multilingual models improves the loss at rates that are independent of the weights of the individual language pairs in the training mixture. • We leverage these findings to propose a scaling law that jointly predicts the performance for all language pairs and weightings considered, and use it to examine how the model splits its capacity in between the language pairs by computing the effective number of parame- ters allocated to each language pair (Section 3.3). • We examine the popular belief that training multilin- gual models on similar languages is more effective than training models in unrelated languages. Surpris- ingly, for the high-resource language pairs considered, we do not observe any significant differences in the scaling behavior of models trained to translate from English into related languages (En→{De, Fr}) and models trained in unrelated languages (En→{De, Zh}). In contrast, we observe that models trained to translate from multiple languages into English (XX→En) benefit much more from multitasking compared to those trained on translation out of English (En→XX). • By approximating the capacity splitting behavior of multilingual models, in Section 3.4, we provide a scaling law that predicts the full task performance trade-off frontier as a function of the model size N (See Figure 7). In Section 3.4, we describe how such predictions can be leveraged for efficiently guiding task balancing when training large multilingual models. 2. Background 2.1. Neural Scaling Laws Recent research suggests that the performance of large neu- ral models is well-predicted by a smooth function of the fundamental problem parameters: the model size N 2, the size of the training data D, and the amount of compute used for training C (Hestness et al., 2017; Rosenfeld et al., 2019; Kaplan et al., 2020; Hernandez et al., 2021). The most relevant of these studies to ours is Ghorbani et al. (2022) where the authors study the effects of increasing the model size for single-task NMT models in the data-rich (D → ∞), compute-rich (C → ∞) regime. In this setting, the authors show that the following bivariate law describes the scaling behavior of encoder-decoder Transformers L(Ne, Nd) = βN −αe e N −αd d + L∞. (2) Here, Ne and Nd correspond to the number of parame- ters in the encoder and decoder respectively and L∞ cor- responds to the irreducible loss associated with the task. {β, αe, αd, L∞} are the parameters of the scaling law that need to be empirically estimated from the data. In addition, (Ghorbani et al., 2022) examine the question of optimally allocating parameters between the encoder and the decoder. They show that in order to attain the optimal scaling behavior, one needs to proportionally scale the encoder and the decoder together. Under such scaling scheme, Equation 2 simplifies to L(N ) = βN −α + L∞, (3) which is similar to the scaling behavior observed in other domains such as computer vision (Zhai et al., 2022) and autoregressive generative models (Henighan et al., 2020). Based on these results, to achieve the optimal scaling be- havior, we adopt the proportional encoder-decoder scaling scheme for our experiments. A detailed overview of the size and architecture of our models is presented in Appendix A. 2.2. Multitask Optimization Multilingual NMT is commonly framed and studied as a multitask optimization problem (Dong et al., 2015; Luong et al., 2015; Arivazhagan et al., 2019b; Wang et al., 2021). We focus our investigation on the supervised learning setup where the model parameters θ ∈ RN are trained on K different tasks simultaneously. In multilingual MT, each task corresponds to translation for a different language pair. We denote the loss associated with task i with Li(θ). Multitask models are often trained by minimizing a convex 1Using machine translation terminology, all language pairs are 2Following the literature conventions, we only consider the high-resource. non-embedding layers when computing N . Scaling Laws for Multilingual Neural Machine Translation from 20M to 1B (non-embedding) parameters. When scal- ing encoder-decoder Transformers, to achieve the optimal scaling behavior, we scale the encoder and the decoder proportionally by increasing the model dimension and the number of layers in tandem. See Appendix A for details. For our experiments, we train two cohorts of models: En→XX and XX→En. For En→XX cohort, we train mul- tilingual model for translation from English to {German (De), Chinese (Zh)} and {German (De), French (Fr)}. For XX→En cohort, we present results for {De, Zh}→En. We use the implicit scalarization approach to train our mod- els; each observation in the training batch is chosen from the first language pair with probability p and the second language pair with probability 1 − p. For our experiments, we choose p from the set p ∈ {0, 0.05, 0.1, 0.3, 0.5, 0.7, 0.9, 0.95, 1}. (5) For En→XX models, to avoid confusing the model, we prepend a language token to the source sentence specifying the target language (e.g. <2de>). The models are trained with per-token cross-entropy loss and Adafactor optimizer (Shazeer & Stern, 2018), using a fixed batch size of 500K tokens and inverse square root learning rate schedule. To mirror the compute-rich regime as closely as possible, we trained our models to near convergence. In practice, this translates to training our smaller models (< 500M parame- ters) for 500K gradient steps and larger models for 1M steps. To place our models in the data-rich regime, we use a mas- sive in-house web-crawled dataset for training our models. We filter this data using an online data selection procedure (Wang et al., 2018) and high-quality web-domain reference sets, extracting 600M sentences for each language pair in the En→XX direction and 1.2B sentences for the XX→En lan- guage pairs. We tokenize this corpus by using a pretrained multilingual SentencePiece (Kudo, 2018) vocabulary, with a size of 128K sub-words. We measure the performance of models on both in-domain and out-of-domain test sets. For the in-domain test set, we extract 2000 sentences from the same in-house datasets used to create the training (ensuring no overlap). For out- of-domain, we use newstest2019 (Barrault et al., 2019), consisting of 2000 sentence-pairs extracted from aligned news documents. Figure 1. Cartoon representation of the performance trade-off fron- tier for a hypothetical model. combination of the per-task losses: ˆθ(w) = arg min K (cid:88) i=1 wiLi(θ) ; w > 0, K (cid:88) i=0 wi = 1 (4) Here, w is a fixed vector of the task weights, determined apriori by the practitioner to emphasize her preferences on the balancing of the tasks. This so-called scalarization approach is highly popular in the community due to its ef- fectiveness and simplicity.3 In fact, despite this simplicity, recent results on multitask optimization suggest that scalar- ization achieves performances on par or better than bespoke optimizers designed specifically for multitask models (Xin et al., 2022; Kurin et al., 2022). In current large text models, such explicit scalarization is rare. Instead, scalarization is often implemented implicitly, by sampling observations from each task proportionally to that task's weight. Proportional sampling produces (in expectation) the same overall loss function as explicit scalar- ization but with much less engineering complexity. Xin et al. (2022) demonstrate that there exists a smooth, well-defined performance trade-off frontier for multitask models in the data rich regime. This frontier represents the performance trade-off the model is able to achieve in between the tasks as a function of the task weights (see Figure 1 for a cartoon representation). Naturally, finding an accurate characterization of the performance trade-off frontier is key in finding a systematic solution to the task balancing issue. 3. Effects of Scale in Multilingual MT 3.1. Experimental Setup 3.2. Results & Analysis We use the pre-LN encoder-decoder Transformer architec- ture in our models (Xiong et al., 2020; Vaswani et al., 2017). We train models of up to 8 sizes, approximately ranging 3See (Boyd & Vandenberghe, 2004) for more a detailed discus- sion of scalarization. Understanding Multilingual Scaling We start our analy- sis by independently examining the model scaling behavior for each individual language pair weighting p in (5). For each choice of p, we fit a scaling law of the form Li(N ; p) = βp,iN −αp,i + L(p,i) ∞ (6) 0.40.60.81.0Task 1 Loss0.30.40.50.60.70.80.91.0Task 2 LossPerformance Trade-Off for Data-Rich Regimew1=1w2=1 Scaling Laws for Multilingual Neural Machine Translation Figure 2. The evolution of the in-domain test cross-entropy loss with model size for En→{De, Zh} models, as well as the fitted scaling laws. These scaling laws are fitted separately for each language pair weighting. The color represents the weighting of the languages. The scaling laws are able to capture close to 100% of the variation in the data for both language pairs. Note that we don't show the zero-shot behavior. Figure 3. Log-log plot of the evolution of the (in-domain) test cross-entropy loss as we scale. We subtract a constant L(i) for all the weightings (Equation 7). All lines are nearly parallel, suggesting that the scaling exponent is unchanged for all p. ∞ , jointly fitted to the empirical (test) performance of models resulting from that language pair weighting. Figure 2 presents our findings for En→{De, Zh} models. Each point on the graph corresponds to the empirical test- cross entropy performance of a model at the end of the training.4 We observe that our per-weighting laws are able to capture the scaling behavior of our multilingual models on both language pairs. As expected, when the weight for one of the languages is decreased, the performance of the models on that language decreases for all scales. Our results suggest that the benefits of the increased model size for MNMT models are well-described by a power-law. See Appendix B for similar results for other language pair combinations. Figure 4 shows the fitted scaling law coefficients for differ- ent values of p. The shaded area marks the one standard 4For low probability language pairs, we apply a convergence correction procedure to make up for slow convergence. See Ap- pendix G for more details. deviation uncertainty interval of our estimates.5 Interest- ingly, we find that, across all values of p, both the scaling exponent (α) and the irreducible loss (L∞) seem to be rela- tively unchanged. In particular, all of our estimated α and L∞ parameters are within two standard deviations of each other. In contrast, the multiplicative factor β seems to be highly sensitive to the choice of p. Figure 3 visually confirms the assertion that for our models αp and L∞ are effectively constant. Here, we have sub- tracted a fixed constant L(i) ∞ from all the Figure 4 curves corresponding to the language pair i. We then plot results on log-log axes. As the figure suggests, the lines are all near parallel, suggesting that the scaling exponent is unchanged for all p. In practical terms this means that, for example, 5We gauge the uncertainty in the coefficients by measuring the fluctuations in our estimates when our empirical datapoints are perturbed by (cid:15) i.i.d∼ N (0, σ2). We choose a conservative σ of 1% of the observed empirical loss for each data point. 0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.81.01.21.4Test Cross-EntropyEnglishGerman (R2=99.98,|LL|=0.006)powerlawsempiricalheld-out0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.81.01.21.41.6EnglishChinese (R2=99.97,|LL|=0.008)powerlawsempiricalheld-outZHonly50/50DEonly108109# Parameters (non-embeddings)1000.20.30.40.50.60.70.80.9Test Cross-Entropy - EnglishGerman (R2=99.98,|LL|=0.006)powerlawsempiricalheld-out108109# Parameters (non-embeddings)1000.30.40.50.60.70.80.9EnglishChinese (R2=99.97,|LL|=0.008)powerlawsempiricalheld-outZHonly50/50DEonly Scaling Laws for Multilingual Neural Machine Translation Figure 4. Coefficient values for German (left) and Chinese (right) as a function of the language weight, with the shaded region representing the standard deviation. The dashed lines represent the value of jointly fitted coefficients from Equation 7. Figure 5. The joint scaling law of Equation 7 closely captures the scaling behavior of En→{De, Zh} models. Test loss here is evaluated on in-domain test sets. See Appendix C for similar observations on En→{De, Fr} and {De, Zh}→En models. doubling the capacity of a multilingual model will reduce its loss by the same 1 2α factor, no matter how the training mix- ture looks like. This also means that single-language-pair scaling laws can be used to gauge the benefits of scaling multilingual models. that our joint laws are able to almost completely capture the scaling behavior. We observe a similar phenomenon for out-of-domain test sets and other language pairs (see Appendix C), further suggesting that the joint law accurately describes the scaling behavior of MNMT models. Jointly Modeling Multilingual Scaling Based on the findings above, we make the assumption that the scaling exponents and the irreducible losses are independent of the language pair weights, and propose a joint scaling law of the form Li(N ; p) ≈ βp,iN −αi + L(i) ∞ . (7) Figure 5 shows the fit of this joint scaling law for En→{De, Zh} models evaluated on the in-domain test sets. Note that here, we fit a total of 10 parameters for each language pair – 8 for βp,i's and two for αi and L(i) ∞ . In contrast, in Figure 2, we used 24 overall parameters to capture the scaling behavior for each language pair. Despite this significant decrease in the number of total fitted parameters, we observe 3.3. Effective Network Capacity for Multilingual Models We leverage our joint scaling law to examine how MNMT models split their capacity in between the different language pairs. We start by defining the notion of the effective num- ber of parameters: Definition. Consider a multilingual model in which a lan- guage pair i has been trained with weight p. We define the effective number of parameters allocated to i, N (i,p) , to be equal to the number of parameters necessary for a single- language-pair model solely trained on i to reach the same (test loss) performance as the multilingual model. eff Mathematically, N (i,p) eff can be written as the solution of the 0.20.40.60.81.0Language Weight (p)0.40.60.81.01.2Fitted Coefficient ValuesEnglishGerman0.20.40.60.81.0Language Weight (p)0.20.40.60.81.01.21.4EnglishChinese0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.81.01.21.4Test Cross-EntropyEnglishGerman (R2=99.84,|LL|=0.026)joint powerlawempiricalheld-out0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.81.01.21.41.61.8EnglishChinese (R2=99.79,|LL|=0.030)joint powerlawempiricalheld-outZHonly50/50DEonly Scaling Laws for Multilingual Neural Machine Translation Figure 6. The effective fraction of parameters allocated to each language pair as estimated by our joint scaling laws. Gray dashed lines correspond to the fitted ˆfi described in Equation 12. Left: Comparison of the capacity splitting behavior of En→{De, Zh} models for in-domain and out-of-domain test sets. We observe minimal differences between the two. Center: Comparison of the capacity splitting behavior for En→{De, Zh} and En→{De, Fr} models. We don't observe any changes in the interaction between the language pairs based on language similarity. Right: Comparison of the capacity splitting behavior for translation to and from English. XX→En models exhibit more synergy among the language pairs. equation Li(N ; p) = Li(N (i,p) eff ; 1). A simple derivation yields that 6 N (i,p) eff = (cid:19) 1 αi (cid:18) β1,i βp,i N. (8) (9) Crucially, our calculations suggest that the fraction of pa- rameters allocated to language pair i, which we denote by fi(p), is independent of the model size: fi(p) ≡ N (i,p) eff /N = (cid:19) 1 αi . (cid:18) β1,i βp,i (10) This observation yields a fundamental, scale-independent quantity that can be leveraged for understanding the interac- tions between the different language pairs in the model. Figure 6 shows the empirically estimated effective parameter ratios for our models. Several observations are in order: Consistency Across Domains: In Figure 6 (left), we com- pare the capacity splitting behavior of the models on in- domain and out-of-domain (newstest19) test sets. Even though the scaling laws coefficients for in-domain and out- of-domain test sets differ, we observe that the capacity split- ting behavior is mostly unchanged with different test sets. These findings hint at some measure of universality across test domains on how MNMT models divide their capacity and share their parameters. Consistency Across Languages Pairs: In Figure 6 (cen- ter), we compare the capacity splitting behavior of En→{De, 6See Appendix D for details. Zh} and En→{De, Fr} models. The conventional wisdom in the MT literature suggests that the tasks in En→{De, Fr} should exhibit a more positive interaction with each other compared to En→{De, Zh}. This is often justified by the intuition that representations are more aligned in related languages and more aligned representations will encourage parameter sharing (Dabre et al., 2017). Surprisingly, our re- sults suggest that the interaction dynamics in En→{De, Fr} and En→{De, Zh} models are not significantly different. In both settings, we observe a relatively neutral multilingual behavior – the performance of an MNMT model of size N trained on language pair i with (sampling) weight p is essentially similar to a single-language-pair model of size pN . In other words, there is minimal synergy among the languages in both setups. En→XX vs XX→En: In Figure 6 (right), we compare the interaction between the language pairs when translating out of English vs when translating into English. In stark contrast to the En→XX setting, when translating into English, we observe significant positive synergy among the language pairs. This observation aligns well with recent results in the literature showing multilingual models achieving SOTA performance for translation to English (Chowdhery et al., 2022; Lepikhin et al., 2020). It is unclear if this synergy arises as a specificity of having English as the target language or because multilingual encoding is intrinsically more amenable to parameter sharing than multilingual decoding. Understanding the exact dynamics giving rise to such positive interaction between the language pairs is an exciting open question. Benefits for Massive Multilingual Models: While we observed minimal synergy between En→XX languages pairs, and therefor minimal gains in absolute effective 0.00.20.40.60.81.0Language Weight (p)0.00.20.40.60.81.0NeffNIn-Domain vs Out-of-DomainGerman (indomain)Chinese (indomain)German (newstest19)Chinese (newstest19)y=x0.00.20.40.60.81.0Language Weight (p)0.00.20.40.60.81.0NeffNDifferent Target Language CombinationsGerman (en{de,zh})Chinese (en{de,zh})German (en{de,fr})French (en{de,fr})y=x0.00.20.40.60.81.0Language Weight (p)0.00.20.40.60.81.0NeffNxxen vs enxxGerman (en{de,zh})Chinese (en{de,zh})German ({de,zh}en)Chinese ({de,zh}en)y=x Scaling Laws for Multilingual Neural Machine Translation Figure 7. Approximate joint scaling laws described by equations (11) and (12) almost perfectly capture the language pair interactions across all scales. Left: The fitted approximation ˆf described in Equation 12. Right: The predicted performance trade-off frontier (dashed lines) as well as the empirically observed trade-off values. capacity, if we look at relative effective capacity, we can see considerable benefits in using multilingual models for language pairs with small weight. For example, a model trained for En→{De, Zh} with 5% weight on German has an effective capacity of more than 3× a model trained with 5% capacity of this model for only German. These relative gains are even more evident when there is positive task synergy, such as for XX→En, where models train with 5% weight have more than 6× gain in (effective) parameters. This hints that, if these findings generalize beyond the two-task setup7, then training large multilingual models for training mixtures with a large number of small weight language pairs is significantly more memory efficient than training separate small models for each language pair. 3.4. Guiding Language Balancing As discussed earlier, one of the areas where multilingual scaling laws can be most impactful is in guiding language balancing/weighting when training large multilingual mod- els, an open problem that has been studied extensively (Ari- vazhagan et al., 2019a; Wang et al., 2020). However, in its current form, our (joint) scaling law can only be use to decide between weightings that were used for fitting it and cannot be used to predict performance on new, unseen weightings, as βp,i needs to be estimated empirically. To extend to unseen language pair weightings, we instead focus on estimating fi(*). Given access to fi(p), accurate prediction of Li(N ) for any weighting can be achieved by using the single-language-pair scaling law: Li(N ; p) = β1,i (cid:0) ˆfi(p)N (cid:1)−αi + L(i) ∞ . (11) As observed in Section 3.3, fi(p) has a number of desirable 7see Appendix H for preliminary experiments on models trained on more than two language pairs. properties that makes it easy to estimate: (i) it is invariant to test set and languages, (ii) it is smooth and generally well-behaved. As such, one can achieve an accurate approx- imation of f with just a few data points. We utilize this methodology to estimate the full task per- formance trade-off frontier for En→{De, Zh} models. For estimating fi(*), we fit an approximate joint scaling law of the form Equation 11, where ˆfi(*) is parameterized as ˆfi(p) = p + c1pc2(1 − p)c3 (12) with c1, c2, c3 being fitted coefficients. Figure 7 demon- strates our results; our procedure is able to almost perfectly capture the full task performance frontier across a variety of model scales. With access to such accurate predictions of the performance frontier, a practitioner can precisely de- termine how to weigh the individual language pairs during training based on her preferences and target model size. We should note that the choice of function class to fit fi(*) is highly dependent on the practitioner's computational budget. In our case, we prioritized accuracy and used a flexible function class of the form (12) for fitting. Such flexibility comes with the cost of needing to compute more empirical values to reliably estimate f (*). In the scenarios with more limited computational budget, we have observed that even rudimentary linear approximations of f are able to provide accurate representations of the performance frontier. See Appendix E for examples. Translation Quality Finally, we note that in the MT liter- ature, quality is often measured via metrics such as BLEU (Papineni et al., 2002), ChrF (Popovi ́c, 2015) and BLEURT (Sellam et al., 2020) as opposed to cross-entropy, since the latter doesn't account for the problem of decoding transla- tions from the models and is sometimes found to not corre- 0.00.20.40.60.81.0Language Weight (p)0.00.20.40.60.81.0NeffNEffective Number of ParametersGermanChineseapproxy=x0.60.81.01.21.41.61.8Test Cross-Entropy (German)0.81.01.21.41.61.82.0Test Cross-Entropy (Chinese)Predicted Performance Trade-off Frontiersjoint powerlawN=~20MN=~1B Scaling Laws for Multilingual Neural Machine Translation Figure 8. The generation quality behavior of our models as measured by ChrF. Left: We observe consistent positive correlations between ChrF and cross-entropy loss. Right: Our scaling laws can be used to generate accurate performance trade-off frontiers for ChrF. late with human preferences (Koehn & Knowles, 2017). As such, MT practitioners might be concerned regarding the applicability of these results for practical applications. To ensure that our findings also apply to the quality of transla- tions, we decode translations from our trained models using beam search (Graves, 2012) and evaluate how their quality changes as we scale the models, using ChrF and BLEURT. Figure 8 (left) shows cross-entropy and ChrF scores for the En→De language pair of our En→{De, Fr} models, evalu- ated on the in-domain test set. We find that this automatic metric has an almost-linear relationship with cross-entropy, hinting that our observations also generalize from cross- entropy to generation quality. Figure 8 (right) also shows the predicted ChrF performance trade-off frontier obtained by fitting our joint scaling law (Equation 7) to the ChrF performance on the in-domain test set (parametrizing the ef- fective parameter fraction function as in Equation 12). Our procedure is able to capture this trade-off frontier almost as well as the cross-entropy frontier. Similar findings for the BLEURT metric on out-of-distribution test sets can be found in Appendix F. 4. Conclusions & Future Work Current state-of-the-art large neural models are moving to- wards using as much data from as many domains, modalities and languages as possible to unlock exciting new capabil- ities. Unfortunately, a clear understanding of the behavior of such multitask models at scale is missing. This in turn slows down the model development process since practi- tioners have to resort to trial and error for balancing their tasks in their models. In this paper, we attempted to take an initial step towards alleviating this problem by performing a large-scale study of the properties of multilingual models. In particular, we attempted to study this problem from the lens of multilingual machine translation. We showed that, for each language pair and language pair weighting, a power- law describes the evolution of the model test performance as a function of the model size. We examined the depen- dence of the scaling law parameters on the language pair weights and demonstrated that the scaling exponent and the irreducible loss are independent of the weightings. Using these observations, we provided a novel joint scaling law that succinctly captures the scaling behavior across different model sizes and weightings and used it to define the notion of effective fraction of parameters assigned to a language pair (fi(*)). We showed that this quantity robustly captures the language pair interactions and is surprisingly invariant to the similarity of the languages. In the end, we sketched a procedure to use fi to estimate the task performance trade- off frontier for all model scales. Future Work In this paper, we studied the scaling behav- ior of multilingual translation models. Examining whether the conclusions of our work apply to multi-task setups be- yond translation is a promising research direction. Most of our conceptual framework and experimental setup can easily be reused for this since there is little difference in the mathematical formulation of the optimization problem and it is likely that similar observations regarding the lack of transfer in data-rich scenarios will be found, as multilin- guality can be considered an easier subset of the broader multitask learning challenge. Furthermore, to keep our investigation tractable, we focused most of our experiments on the two-language-pairs scenario. However, we believe the presented results should be eas- ily extendable to models trained with more languages (see Appendix H). We leave such extensions to future work. Finally, to simplify the model scaling behavior, we focused our analysis on the data-rich setup. However, in many appli- cations, at least some of the tasks are mid- or low-resource. Extending these results to such scenarios is an interesting future direction. 0.81.01.21.4Test Cross-Entropy (German)0.580.600.620.640.660.68ChrFChrF-Cross Entropy Correlation for Germanempiricalheld-out0.540.560.580.600.620.640.660.68ChrF (German)0.3250.3500.3750.4000.4250.4500.4750.500ChrF (Chinese)Predicted ChrF Trade-Off Frontiersjoint powerlawZHonlyDEonlyN=~20MN=~1B Scaling Laws for Multilingual Neural Machine Translation References Arivazhagan, N., Bapna, A., Firat, O., Lepikhin, D., John- son, M., Krikun, M., Chen, M. X., Cao, Y., Foster, G. F., Cherry, C., Macherey, W., Chen, Z., and Wu, Y. Mas- sively multilingual neural machine translation in the wild: Findings and challenges. ArXiv, abs/1907.05019, 2019a. Arivazhagan, N., Bapna, A., Firat, O., Lepikhin, D., John- son, M., Krikun, M., Chen, M. X., Cao, Y., Foster, G. F., Cherry, C., Macherey, W., Chen, Z., and Wu, Y. Mas- sively multilingual neural machine translation in the wild: Findings and challenges. CoRR, abs/1907.05019, 2019b. URL http://arxiv.org/abs/1907.05019. Bansal, Y., Ghorbani, B., Garg, A., Zhang, B., Krikun, M., Cherry, C., Neyshabur, B., and Firat, O. Data scaling laws in nmt: The effect of noise and architecture. In ICML, 2022. Bapna, A., Caswell, I., Kreutzer, J., Firat, O., van Esch, D., Siddhant, A., Niu, M., Baljekar, P., Garcia, X., Macherey, W., Breiner, T., Axelrod, V., Riesa, J., Cao, Y., Chen, M. X., Macherey, K., Krikun, M., Wang, P., Gutkin, A., Shah, A., Huang, Y., Chen, Z., Wu, Y., and Hughes, M. Building machine translation systems for the next thousand languages, 2022. URL https: //arxiv.org/abs/2205.03983. Barrault, L., Bojar, O., Costa-juss`a, M. R., Federmann, C., Fishel, M., Graham, Y., Haddow, B., Huck, M., Koehn, P., Malmasi, S., Monz, C., M ̈uller, M., Pal, S., Post, M., and Zampieri, M. Findings of the 2019 conference on machine translation (WMT19). In Pro- ceedings of the Fourth Conference on Machine Transla- tion (Volume 2: Shared Task Papers, Day 1), pp. 1–61, Florence, Italy, August 2019. Association for Computa- tional Linguistics. doi: 10.18653/v1/W19-5301. URL https://aclanthology.org/W19-5301. Boyd, S. and Vandenberghe, L. Convex Optimization. doi: 10.1017/ Cambridge University Press, 2004. CBO9780511804441. Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray, S., Chess, B., Clark, J., Berner, C., McCandlish, S., Radford, A., Sutskever, I., and Amodei, D. Language models are few-shot learners. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1877–1901. Curran Asso- ciates, Inc., 2020. URL https://proceedings. neurips.cc/paper/2020/file/ 1457c0d6bfcb4967418bfb8ac142f64a-Paper. pdf. Chowdhery, A., Narang, S., Devlin, J., Bosma, M., Mishra, G., Roberts, A., Barham, P., Chung, H. W., Sutton, C., Gehrmann, S., Schuh, P., Shi, K., Tsvyashchenko, S., Maynez, J., Rao, A., Barnes, P., Tay, Y., Shazeer, N., Prabhakaran, V., Reif, E., Du, N., Hutchinson, B., Pope, R., Bradbury, J., Austin, J., Isard, M., Gur-Ari, G., Yin, P., Duke, T., Levskaya, A., Ghemawat, S., Dev, S., Michalewski, H., Garcia, X., Misra, V., Robinson, K., Fedus, L., Zhou, D., Ippolito, D., Luan, D., Lim, H., Zoph, B., Spiridonov, A., Sepassi, R., Dohan, D., Agrawal, S., Omernick, M., Dai, A. M., Pillai, T. S., Pellat, M., Lewkowycz, A., Moreira, E., Child, R., Polo- zov, O., Lee, K., Zhou, Z., Wang, X., Saeta, B., Diaz, M., Firat, O., Catasta, M., Wei, J., Meier-Hellstern, K., Eck, D., Dean, J., Petrov, S., and Fiedel, N. Palm: Scaling language modeling with pathways, 2022. URL https://arxiv.org/abs/2204.02311. Costa-juss`a, M. R., Cross, J., C ̧ elebi, O., Elbayad, M., Heafield, K., Heffernan, K., Kalbassi, E., Lam, J., Licht, D., Maillard, J., et al. No language left behind: Scal- ing human-centered machine translation. arXiv preprint arXiv:2207.04672, 2022. Dabre, R., Cromieres, F., and Kurohashi, S. Enabling multi-source neural machine translation by concatenating source sentences in multiple languages. In Proceedings of Machine Translation Summit XVI: Research Track, pp. 96–107, Nagoya Japan, September 18 – September 22 2017. URL https://aclanthology.org/2017. mtsummit-papers.8. Dong, D., Wu, H., He, W., Yu, D., and Wang, H. Multi-task learning for multiple language translation. In Proceed- ings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1723–1732, 2015. Ghorbani, B., Firat, O., Freitag, M., Bapna, A., Krikun, M., Garc ́ıa, X., Chelba, C., and Cherry, C. Scaling laws for neural machine translation. ArXiv, abs/2109.07740, 2022. Gordon, M. A., Duh, K., and Kaplan, J. Data and parame- ter scaling laws for neural machine translation. In Pro- ceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 5915–5922, On- line and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.478. URL https:// aclanthology.org/2021.emnlp-main.478. Graves, A. Sequence transduction with recurrent neural networks, 2012. Scaling Laws for Multilingual Neural Machine Translation Henighan, T., Kaplan, J., Katz, M., Chen, M., Hesse, C., Jackson, J., Jun, H., Brown, T. B., Dhariwal, P., Gray, S., et al. Scaling laws for autoregressive generative modeling. arXiv preprint arXiv:2010.14701, 2020. Hernandez, D., Kaplan, J., Henighan, T. J., and McCandlish, S. Scaling laws for transfer. ArXiv, abs/2102.01293, 2021. Hestness, J., Narang, S., Ardalani, N., Diamos, G., Jun, H., Kianinejad, H., Patwary, M., Ali, M., Yang, Y., and Zhou, Y. Deep learning scaling is predictable, empirically. arXiv preprint arXiv:1712.00409, 2017. Hoffmann, J., Borgeaud, S., Mensch, A., Buchatskaya, E., Cai, T., Rutherford, E., Casas, D. d. L., Hendricks, L. A., Welbl, J., Clark, A., Hennigan, T., Noland, E., Millican, K., Driessche, G. v. d., Damoc, B., Guy, A., Osindero, S., Simonyan, K., Elsen, E., Rae, J. W., Vinyals, O., and Sifre, L. Training compute-optimal large language mod- els, 2022. URL https://arxiv.org/abs/2203. 15556. Huang, Y., Cheng, Y., Bapna, A., Firat, O., Chen, D., Chen, M., Lee, H., Ngiam, J., Le, Q. V., Wu, Y., et al. Gpipe: Efficient training of giant neural networks using pipeline parallelism. Advances in neural information processing systems, 32, 2019. Hutter, M. Learning curve theory. CoRR, abs/2102.04074, URL https://arxiv.org/abs/2102. 2021. 04074. Kaplan, J., McCandlish, S., Henighan, T., Brown, T. B., Chess, B., Child, R., Gray, S., Radford, A., Wu, J., and Amodei, D. Scaling laws for neural language models. CoRR, abs/2001.08361, 2020. URL https://arxiv. org/abs/2001.08361. Koehn, P. and Knowles, R. Six challenges for neural ma- In Proceedings of the First Work- chine translation. shop on Neural Machine Translation, pp. 28–39, Van- couver, August 2017. Association for Computational Lin- guistics. doi: 10.18653/v1/W17-3204. URL https: //aclanthology.org/W17-3204. Kudo, T. Subword regularization: Improving neural net- work translation models with multiple subword can- In Proceedings of the 56th Annual Meeting didates. of the Association for Computational Linguistics (Vol- ume 1: Long Papers), pp. 66–75, Melbourne, Aus- tralia, July 2018. Association for Computational Lin- guistics. doi: 10.18653/v1/P18-1007. URL https: //aclanthology.org/P18-1007. Kurin, V., De Palma, A., Kostrikov, I., Whiteson, S., and Ku- mar, M. P. In defense of the unitary scalarization for deep multi-task learning. arXiv preprint arXiv:2201.04122, 2022. Lepikhin, D., Lee, H., Xu, Y., Chen, D., Firat, O., Huang, Y., Krikun, M., Shazeer, N., and Chen, Z. Gshard: Scaling giant models with conditional computation and automatic sharding. arXiv preprint arXiv:2006.16668, 2020. Luong, M.-T., Le, Q. V., Sutskever, I., Vinyals, O., and Kaiser, L. Multi-task sequence to sequence learn- ing, 2015. URL https://arxiv.org/abs/1511. 06114. Papineni, K., Roukos, S., Ward, T., and Zhu, W.-J. Bleu: a method for automatic evaluation of machine transla- In Proceedings of the 40th Annual Meeting of tion. the Association for Computational Linguistics, pp. 311– 318, Philadelphia, Pennsylvania, USA, July 2002. As- sociation for Computational Linguistics. doi: 10.3115/ 1073083.1073135. URL https://aclanthology. org/P02-1040. Popovi ́c, M. chrF: character n-gram F-score for automatic MT evaluation. In Proceedings of the Tenth Workshop on Statistical Machine Translation, pp. 392–395, Lis- bon, Portugal, September 2015. Association for Compu- tational Linguistics. doi: 10.18653/v1/W15-3049. URL https://aclanthology.org/W15-3049. Reed, S., Zolna, K., Parisotto, E., Colmenarejo, S. G., Novikov, A., Barth-Maron, G., Gimenez, M., Sulsky, Y., Kay, J., Springenberg, J. T., et al. A generalist agent. arXiv preprint arXiv:2205.06175, 2022. Rosenfeld, J. S., Rosenfeld, A., Belinkov, Y., and Shavit, N. A constructive prediction of the generalization error across scales. In International Conference on Learning Representations, 2019. Sanh, V., Webson, A., Raffel, C., Bach, S., Sutawika, L., Alyafeai, Z., Chaffin, A., Stiegler, A., Raja, A., Dey, M., Bari, M. S., Xu, C., Thakker, U., Sharma, S. S., Szczechla, E., Kim, T., Chhablani, G., Nayak, N., Datta, D., Chang, J., Jiang, M. T.-J., Wang, H., Manica, M., Shen, S., Yong, Z. X., Pandey, H., Bawden, R., Wang, T., Neeraj, T., Rozen, J., Sharma, A., Santilli, A., Fevry, T., Fries, J. A., Teehan, R., Scao, T. L., Biderman, S., Gao, L., Wolf, T., and Rush, A. M. Multitask prompted training enables zero-shot task generalization. In International Conference on Learning Representations, 2022. URL https:// openreview.net/forum?id=9Vrb9D0WI4. Sellam, T., Das, D., and Parikh, A. BLEURT: Learn- In Proceed- ing robust metrics for text generation. ings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7881–7892, Online, July 2020. Association for Computational Linguistics. Scaling Laws for Multilingual Neural Machine Translation doi: 10.18653/v1/2020.acl-main.704. URL https: //aclanthology.org/2020.acl-main.704. Shazeer, N. M. and Stern, M. Adafactor: Adaptive learning rates with sublinear memory cost. ArXiv, abs/1804.04235, 2018. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., and Polosukhin, I. At- tention is all you need. Advances in neural information processing systems, 30, 2017. Wang, W., Watanabe, T., Hughes, M., Nakagawa, T., and Chelba, C. Denoising neural machine translation train- ing with trusted data and online data selection. In Pro- ceedings of the Third Conference on Machine Trans- lation: Research Papers, pp. 133–143, Brussels, Bel- gium, October 2018. Association for Computational Lin- guistics. doi: 10.18653/v1/W18-6314. URL https: //aclanthology.org/W18-6314. Wang, X., Tsvetkov, Y., and Neubig, G. Balancing train- ing for multilingual neural machine translation. In Pro- ceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 8526–8537, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.754. URL https: //aclanthology.org/2020.acl-main.754. Wang, Z., Tsvetkov, Y., Firat, O., and Cao, Y. Gra- dient vaccine: Investigating and improving multi-task In In- optimization in massively multilingual models. ternational Conference on Learning Representations, 2021. URL https://openreview.net/forum? id=F1vEjWK-lH_. Xin, D., Ghorbani, B., Garg, A., Firat, O., and Gilmer, J. Do current multi-task optimization methods in deep learning even help? Advances in neural information processing systems, 2022. Xiong, R., Yang, Y., He, D., Zheng, K., Zheng, S., Xing, C., Zhang, H., Lan, Y., Wang, L., and Liu, T. On layer normalization in the transformer architecture. In Inter- national Conference on Machine Learning, pp. 10524– 10533. PMLR, 2020. Zhai, X., Kolesnikov, A., Houlsby, N., and Beyer, L. Scaling vision transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12104–12113, 2022. Zhang, B., Ghorbani, B., Bapna, A., Cheng, Y., Garcia, X., Shen, J., and Firat, O. Examining scaling and transfer of language model architectures for machine translation. arXiv preprint arXiv:2202.00528, 2022. Scaling Laws for Multilingual Neural Machine Translation A. Model Sizes and Hyperparameters Enc. Layers Dec. Layers Emb. Dim # Heads Head Dim MLP dim Vocab Size # Parameters Corrected # Parameters 2 3 6 9 9 12 12 12 2 3 6 9 9 12 12 12 512 768 768 768 1024 1024 1280 1536 8 12 12 12 16 16 16 16 64 64 64 64 64 64 80 96 2048 3072 3072 3072 4096 4096 5120 6144 128k 128k 128k 128k 128k 128k 128k 128k 149,953,024 260,322,816 324,035,328 387,747,840 601,931,776 715,193,344 1,035,876,864 1,412,528,128 18,881,024 63,714,816 127,427,328 191,139,840 339,787,776 453,049,344 707,869,184 1,019,312,128 B. Individual Scaling Laws Fits B.1. Out-of-Domain Figure 9. The evolution with model size of the cross-entropy loss on the newstest19 test set for En→{De, Fr} models, as well as the fitted scaling laws. The color represents the weighting of the languages. Note that we don't show the zero-shot behavior. B.2. English→German, French B.3. German, Chinese→English 0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.81.01.21.41.61.8Newstest19 Cross-EntropyEnglishGerman (R2=99.95,|LL|=0.017)powerlawsempiricalheld-out0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.81.01.21.41.61.82.0EnglishChinese (R2=99.97,|LL|=0.017)powerlawsempiricalheld-outZHonly50/50DEonly Scaling Laws for Multilingual Neural Machine Translation Figure 10. Coefficient values, for scaling laws fitted on newstest2019, for German (left) and French (right) as a function of the language weight, with the shaded region representing the standard deviation. The dashed lines represent the value of jointly fitted coefficients from Equation 7 Figure 11. The evolution of the (in-domain) test cross-entropy loss with model size for En→{De, Fr} models, as well as the fitted scaling laws. The color represents the weighting of the languages. Note that we don't show the zero-shot behavior. Figure 12. Coefficient values for German (left) and French (right) as a function of the language weight, with the shaded region representing the standard deviation. The dashed lines represent the value of jointly fitted coefficients from Equation 7 0.20.40.60.81.0Language Weight (p)0.00.20.40.60.81.01.21.41.6Fitted Coefficient ValuesEnglishGerman (newstest19)0.20.40.60.81.0Language Weight (p)0.250.500.751.001.251.501.752.00EnglishChinese (newstest19)0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.81.01.21.4Test Cross-EntropyEnglishGerman (R2=99.92,|LL|=0.012)powerlawsempiricalheld-out0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.70.80.91.01.11.21.31.4EnglishFrench (R2=99.92,|LL|=0.010)powerlawsempiricalheld-outFRonly50/50DEonly0.20.40.60.81.0Language Weight (p)0.00.20.40.60.81.01.21.41.6Fitted Coefficient ValuesEnglishGerman (newstest19)0.20.40.60.81.0Language Weight (p)0.30.40.50.60.70.80.91.01.1EnglishFrench (newstest19) Scaling Laws for Multilingual Neural Machine Translation Figure 13. The evolution of the (in-domain) test cross-entropy loss with model size for {De, Zh}→En models, as well as the fitted scaling laws. The color represents the weighting of the languages. Note that we don't show the zero-shot behavior. Figure 14. Coefficient values for German (left) and French (right) into English as a function of the language weight. The dashed lines represent the value of jointly fitted coefficients from Equation 7.We omit uncertainty estimates since less model capacities were used to fit the scaling laws, and therefor these estimates would be unreliable. 0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.70.80.91.01.11.21.3Test Cross-EntropyGermanEnglish (R2=99.97,|LL|=0.006)powerlawsempirical0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.80.91.01.11.21.31.41.5ChineseEnglish (R2=99.98,|LL|=0.007)powerlawsempiricalZHonly50/50DEonly0.20.40.60.81.0Language Weight (p)0.00.20.40.60.81.01.21.41.6Fitted Coefficient ValuesGermanEnglish0.20.40.60.81.0Language Weight (p)0.40.60.81.0ChineseEnglish Scaling Laws for Multilingual Neural Machine Translation C. Joint Scaling Law Fits C.1. Out-of-Domain Figure 15. The joint scaling law (Equation 7) fitted to models trained for En→{De, Zh} models. Test loss here is evaluated on the newstest2019 test set. C.2. English→{German, French} Figure 16. The joint scaling law (Equation 7) fitted to models trained for En→{De, Fr} models. Test loss here is evaluated on in-domain test sets. C.3. {German, Chinese}→English 0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.81.01.21.41.61.8Newstest19 Cross-EntropyEnglishGerman (R2=99.68,|LL|=0.042)joint powerlawempiricalheld-out0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.81.01.21.41.61.82.0EnglishChinese (R2=99.71,|LL|=0.054)joint powerlawempiricalheld-outZHonly50/50DEonly0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.81.01.21.4Test Cross-EntropyEnglishGerman (R2=99.73,|LL|=0.036)joint powerlawempiricalheld-out0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.70.80.91.01.11.21.31.4EnglishFrench (R2=99.81,|LL|=0.022)joint powerlawempiricalheld-outFRonly50/50DEonly Scaling Laws for Multilingual Neural Machine Translation Figure 17. The joint scaling law (Equation 7) fitted to models trained for {De, Zh}→En models. Test loss here is evaluated on in-domain test sets. 0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.70.80.91.01.11.21.3Test Cross-EntropyGermanEnglish (R2=99.94,|LL|=0.009)joint powerlawempirical0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.80.91.01.11.21.31.41.51.6ChineseEnglish (R2=99.94,|LL|=0.008)joint powerlawempiricalZHonly50/50DEonly Scaling Laws for Multilingual Neural Machine Translation D. Derivation of the Effective Number of Parameters Li(N ; p) = βp,iN −αi + L(i) ∞ N −αi + L(i) ∞ (cid:33)−αi N + L(i) ∞ (cid:33)−αi N + L(i) ∞ = β1,i = β1,i = β1,i (cid:19)− 1 αi (cid:19) (cid:18) βp,i β1,i (cid:32)(cid:18) βp,i β1,i (cid:32)(cid:18) β1,i βp,i eff + L(i) (cid:19) 1 αi ∞ = β1,iN −αi = Li(Neff; p) E. Other Approximations to the Effective Parameter Ratio We use a linear approximation of the form ˆfi(p) = c1(p − 1) + 1. (13) Figure 18. Approximate joint scaling laws described by equations (11) and (13) is able to capture the task interactions across all scales well, even with single fitted coefficient for ratio function. Left: The fitted approximation ˆf described in Equation 12. Right: The predicted performance trade-off frontier (dashed lines) as well as the empirically observed trade-off values. 0.00.20.40.60.81.0Language Weight (p)0.00.20.40.60.81.0NeffNEffective Number of ParametersGermanChineselinear approx.y=x0.81.01.21.41.6Test Cross-Entropy (German)0.81.01.21.41.61.8Test Cross-Entropy (Chinese)Predicted Performance Trade-off Frontiersjoint powerlawjoint powerlawN=~20MN=~1BN=~20MN=~1B Scaling Laws for Multilingual Neural Machine Translation F. Translation Quality Figure 19. (left) shows cross-entropy and BLEURT scores for the En→De language pair of our En→{De, Fr} models, evaluated on the newstest19 test set. We find that this automatic metric has an almost-linear relationship with cross-entropy, hinting that our observations also generalize from cross-entropy to generation quality. Figure 8 (right) also shows the predicted BLEURT performance trade-off frontier obtained by fitting our joint scaling law (Equation 7) to the BLEURT performance on the newstest19 test set (parametrizing the effective parameter fraction function as in Equation 12). G. Convergence Correction Due to implicit scalarization, models trained with very little task weight (< 0.1) will see less than a full epoch of that task's data, even when trained with 1M steps. I our experiments we saw that this was causing problems in the fit the scaling laws due to an undertraining of our largest models. To mitigate this problem without training these models for a prohibitively large number of steps, we apply recent findings in learning curve (Hutter, 2021) to estimate the performance of largest models trained with p ≤ 0.05 task weight at convergence, by fitting a power-law to the performance evolution as training progresses, and predicting the performance of these models at 2.5M steps. This only affect two models per scenario considered. H. Extension to more than two languages/tasks As an early effort to understand if our findings apply to more than two tasks, we trained various model sizes for to translate into three languages (EEn→{De, Fr, Zh}), and compared the predictions using the scaling laws for models trained on two language pairs (En→{De, Zh} and En→{De, Fr}). Figure Figure 20 shows the results. Overall we find that (combination of) the joint scaling laws fitted on models trained on two language pairs predict well the performance of models trained for three language pairs, showing that the invariances found in previous sections generalize to settings with more than two tasks. These results also hint that computation of effective parameters counts for multi-task models with many tasks can be simplified and made more tractable by training models with much smaller subset of tasks. 0.81.01.21.4Newstest19 Cross-Entropy (German)0.640.660.680.700.720.740.760.780.80Newstest19 BLEURT (German)BLEURT-Cross Entropy Correlation for Germanempirical0.600.650.700.750.80Newstest19 BLEURT (German)0.660.680.700.720.740.760.780.80Newstest19 BLEURT (Chinese)Predicted BLEURT Pareto Frontiersjoint powerlawZHonlyDEonlyN=~20MN=~1B Scaling Laws for Multilingual Neural Machine Translation Figure 20. The evolution of the (in-domain) test cross-entropy loss with model size for En→{De, Fr, Zh} models, as well as the fitted scaling laws fitted for En→{De, Zh} (left and middle) and En→{De, Fr} (right). The color represents the weighting of the languages. Note that we don't show the zero-shot behavior. 0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.70.80.91.01.11.21.31.4Test Cross-EntropyEnglishGerman (R2=99.71)two-lang powerlawtrilingual held-out0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.81.01.21.41.6EnglishChinese (R2=99.51)two-lang powerlawtrilingual held-out0.00.20.40.60.81.0# Parameters (non-embeddings)1e90.70.80.91.01.11.21.3EnglishFrench (R2=99.51)two-lang powerlawtrilingual held-outOthers OnlyTgt Lang Only
http://arxiv.org/abs/2302.12710v1
2023-02-19T18:42:57
2023-02-19T18:42:57
Electrode Clustering and Bandpass Analysis of EEG Data for Gaze Estimation
In this study, we validate the findings of previously published papers, showing the feasibility of an Electroencephalography (EEG) based gaze estimation. Moreover, we extend previous research by demonstrating that with only a slight drop in model performance, we can significantly reduce the number of electrodes, indicating that a high-density, expensive EEG cap is not necessary for the purposes of EEG-based eye tracking. Using data-driven approaches, we establish which electrode clusters impact gaze estimation and how the different types of EEG data preprocessing affect the models' performance. Finally, we also inspect which recorded frequencies are most important for the defined tasks.
[ "Ard Kastrati", "Martyna Beata Plomecka", "Joël Küchler", "Nicolas Langer", "Roger Wattenhofer" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12710v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12710v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.SP", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.SP", "cs.HC", "cs.LG", "q-bio.NC" ]
3 2 0 2 b e F 9 1 ] P S . s s e e [ 1 v 0 1 7 2 1 . 2 0 3 2 : v i X r a Proceedings of Machine Learning Research 1:1–16, 2022 NeurIPS 2022 Gaze Meets ML Workshop Electrode Clustering and Bandpass Analysis of EEG Data for Gaze Estimation Ard Kastrati1 Martyna Beata P(cid:32)lomecka2 Jo ̈el K ̈uchler1 Nicolas Langer2 Roger Wattenhofer1 1ETH Zurich, Switzerland 2University of Zurich, Switzerland [email protected] [email protected] [email protected] [email protected] [email protected] Abstract In this study, we validate the findings of previously published papers, showing the feasibility of an Electroencephalography (EEG) based gaze estimation. Moreover, we extend previous research by demonstrating that with only a slight drop in model performance, we can significantly reduce the number of electrodes, indicating that a high-density, expensive EEG cap is not necessary for the purposes of EEG-based eye tracking. Using data-driven approaches, we establish which electrode clusters impact gaze estimation and how the different types of EEG data preprocessing affect the models' performance. Finally, we also inspect which recorded frequencies are most important for the defined tasks. Keywords: EEG, Clustering, Deep Learning, Gaze Estimation, Bandpassing 1. Introduction The ability to track eye movement patterns offers insights into the cognitive processes un- derlying a wide variety of human behaviour. Eye tracking allows researchers to recognize and quantify visual attention, fatigue and performance in various scientific studies (Eriks- son and Papanikotopoulos (1997); Holmqvist et al. (2011); Liu and Heynderickx (2011)). Nowadays, infrared video-based eye trackers are the most common approach in research labs (Cornelissen et al. (2002)). This eye tracking technique uses infrared light to create a dark pupil and a corneal reflection to provide contrast in locating the center of the pupil (Holmqvist et al. (2011)). Although accurate, there are various limitations (Holmqvist et al. (2012)). Examples include individual differences in the contrast of the pupil and iris, time-consuming setup and calibration for each scanning session (Carter and Luke (2020)). Moreover, installing such a system involves setting up an optical path to align infrared light to the cornea without interference from the visual paradigm display. Another line of research demonstrated the feasibility of Electroencephalography (EEG) and Electrooculography (EOG) signal decoding for gaze estimation purposes. EOG is of- ten concurrently measured with EEG by using electrode pairs placed horizontally and/or vertically around the eye to record changes in electric potentials that originate from move- ments of the eye muscles (Mart ́ınez-Cerver ́o et al. (2020)). However, gaze estimation based on Electroencephalography (EEG) data was mainly overlooked in practice (Manabe et al. © 2022 A. Kastrati, M.B. P(cid:32)lomecka, J. K ̈uchler, N. Langer & R. Wattenhofer. Kastrati P(cid:32)lomecka K ̈uchler Langer Wattenhofer (2015); Hl ́adek et al. (2018)), even though the solution has been known for years. One po- tential reason is the necessity to obtain a rich enough set of data with concurrently recorded EEG data and infrared video-based eye tracking data serving as ground truth. In addition, this solution requires equipment and expertise for both EEG acquisition and eye tracking (Dimigen et al. (2011)). Moreover, the noisiness of EEG data poses an additional challenge leaving the research and development in the EEG-based gaze estimation area behind (Grech et al. (2008)). Nonetheless, with the rapid progress in Machine Learning and the increase in the collection of datasets, the EEG modality became more approachable and easier to process (Kastrati et al. (2021)). The primary goal of this study is to investigate which spatio-spectral brain signal compo- nents are most relevant for decoding eye movement and understanding what is the minimal and best placement of the electrodes. More importantly, we show that good-performing models with high accuracy can be achieved even when the number of electrodes is sig- nificantly reduced compared to a high-density, 128-electrodes EEG cap. Additionally, we demonstrate that when using a standard pipeline for EEG preprocessing that includes in- dependent component analysis (ICA) (Pion-Tonachini et al. (2019)), one can infer gaze direction also from electrodes placed in the occipital part of the head, albeit with much lower accuracy. Finally, we include an experimental analysis of the importance of different frequency intervals of the EEG signals for gaze direction. 2. Related Work To date, only a few EEG studies attempted to estimate the actual eye gaze position on a computer screen, and those resulted in high inaccuracies (estimation error 15°) (Borji and Itti (2012)), and complicated analyses (Manabe et al. (2015)). Moreover, there are a number of limitations associated with EEG and specifically EOG electrodes, including a variety of metabolic activities over time and potential drifts (Martinsen and Grimnes (2011)). There has been some investigation into the traditional methods of supervised machine learning; for instance, (Bulling et al. (2010)) categorized the various directions and durations of saccades with a mean accuracy of 76.1%. Another study (Vidal et al. (2011)) developed an EOG feature-based approach that discriminated between saccades, smooth pursuits, and vestibulo-ocular reflex movement achieving quite good results, all of them being above 80%. Latest approaches in machine learning (ML) have shown promise for the development of more precise EEG/EOG-based eye tracking systems. For example, the EEGEyeNet (Kastrati et al. (2021)) benchmark, along with the rich dataset of simultaneous Electroencephalography and eye tracking recordings, has demonstrated promising results for further development of EEG-EOG-based gaze estimation using deep learning frameworks. Recently, (Wolf et al. (2022)) proposed a novel framework for time-series segmentation, creating ocular event detectors that rely solely on EEG data. This solution achieved state- of-the-art performance in ocular event detection across diverse eye tracking experiment paradigms, showing the high potential of EEG-based eye tracking solution, used not only as a complimentary modality but in some instances, it can also be beneficial when classic eye tracker hardware is unavailable. 2 3. Methods 3.1. Dataset, Benchmarking Tasks and Models We use EEGEyeNet dataset and benchmark (Kastrati et al. (2021)) to run our studies. EEGEyeNet consists of synchronized EEG and eye tracking data and consists of collected from three different experimental paradigms. It also establishes a benchmark consisting of three tasks with an increasing level of difficulty: • Left-Right task (LR): This is a binary classification task, where the goal is determining the direction of the subject's gaze along the horizontal axis. • Direction task: The task is to regress the two target values, i.e., angle and amplitude of the relative change of the gaze position during the saccade. • Absolute position task: The goal of the task is determining the absolute position of the subject's gaze in the screen, described in terms of XY-coordinates. In each task, a window of 1 second (with sampling rate of 500Hz) of EEG data is given as an input sample, and the goal is to classify or regress (depending on the task) the target value. The data acquisition, models used, preprocessing methods, and the whole pipeline is explained in much more detail in the original work (Kastrati et al. (2021)). 3.2. EEG data preprocessing In this manuscript, we use two types of EEG -data preprocessing. The first one, from now on referred to as "Minimal Preprocessing", includes algorithms implemented in the EEGlab plugin: to identify bad channels (clean rawdata1), to reduce the noise (Zapline) and bandpass filtering (0.5-40Hz). Detected bad channels were automatically removed and later interpolated using a spherical spline interpolation. The details of the preprocessing pipeline can be found in the EEGEyeNet paper (Kastrati et al. (2021)). The second pre- processing type, i.e. "Maximal preprocessing", is the state-of-the-art preprocessing used for neuroscientific applications. In addition to the "Minimal Preprocessing" pipeline, it includes a Non-Brain artifactual source components removal based on the automatic clas- sification result as provided by Independent Component Label (ICLabel) (Pion-Tonachini et al. (2019)) algorithm. 3.3. Gradient-Based Feature Importance In order to indicate whether a feature (in our case an electrode) contributes significantly to the prediction, the gradient concerning the input can be computed (Simonyan et al. (2013)). This shows how much the model relies on the feature. In our case, we are interested in aggregating this score over an electrode to get its importance. First, the resulting gradients are normalized for each input separately. Next, all absolute gradient values of an electrode are summed up. If an electrode is left with a higher score comparatively, it indicates that it has a more significant contribution to the input. 1. http://sccn.ucsd.edu/wiki/Plugin_list_process 3 Kastrati P(cid:32)lomecka K ̈uchler Langer Wattenhofer 4. Electrode Clustering on Minimally Preprocessed Data A dense, 128-electrode EEG cap is often infeasible to be used in practice. In this section, we show that most of the important information for eye movement is highly concentrated in the frontal electrodes. 4.1. Finding Important Electrodes We use gradient-based methods to rank the most important electrodes. From the spatial distribution (topoplots) in Figure 1 we can see a clear symmetrical structure and that the most information used for decoding eye movement is in the frontal electrode. Interestingly, the topoplots show that the central electrode (Cz), which was the recording reference elec- trode also carries some relevant information. This can be explained, by the fact that the data were offline re-referenced to average reference and thus Cz was interpolated by all other electrodes. To produce the topoplots we used the average performance across all models and for each task presented in the benchmark (Kastrati et al. (2021)). (a) (b) (c) (d ) Figure 1: Topoplots for (a) LR Task, (b) Position Task, (c) Amplitude Task and (d) Angular Task. Colors of higher intensity represent a higher importance. The colors are shown on a logarithmic scale. The score is averaged over all five deep learning architectures presented in (Kastrati et al. (2021)). 4 0.000.020.040.060.080.100.120.140.16Norm. Gradient Value0.000.020.040.060.080.100.120.14Norm. Gradient Value0.000.020.040.060.080.10Norm. Gradient Value0.000.020.040.060.080.100.12Norm. Gradient Value 4.2. Choice of Electrodes Due to the symmetrical results on the topoplots, the most important electrodes are chosen as follows: first, all electrodes are ranked according to gradient-based analysis (see Figure 2 for the importance of each electrode). The best electrode, which is not yet in the cluster, is added together with its symmetrical counterpart. This method responds to the brain's natural symmetry and focuses on localized head areas that we expect to be more resilient and insightful than single isolated electrodes. This procedure is repeated until the loss stops increasing. With this method, we converged to 23 electrodes which are mainly on the frontal part (as can be observed in the topoplots and Figure 3). In order to compare models with each other and for convenience, it is ensured that the same configurations are used across all tasks and models. (a) (b) (c) (d ) Figure 2: Gradient Based Feature Importance for (a) LR Task, (b) Position Task, (c) Am- plitude Task and (d) Angular Task. The normalized gradient results for each electrode and each task from the experiments on the minimally preprocessed data. 5 020406080100120Electrode Number0.000.020.040.060.080.100.120.140.16Input Gradients020406080100120Electrode Number0.000.020.040.060.080.100.120.14Input Gradients020406080100120Electrode Number0.000.020.040.060.080.10Input Gradients020406080100120Electrode Number0.000.020.040.060.080.100.120.14Input Gradients Kastrati P(cid:32)lomecka K ̈uchler Langer Wattenhofer 4.3. Choice of Clusters We observed that the best electrodes are of similar significance in all architectures for all the tasks and the accuracy. In addition, the choice of 23 electrodes achieves the same accuracy that one achieves with all 128 electrodes. This high accuracy encouraged us to train models on an even more reduced number of electrodes and this way we created several different and smaller clusters. We choose clusters of sizes 2, 3, 8, and 23. For all tasks and the models in EEGEyeNet benchmark, we converged to the same clusters shown below. Figure 3: Electrode Clustering Visualisation. This figure shows the electrode place- ment. Colour-coded electrodes belong to a configuration. Pink nodes form the Top2 configuration. For Top3, the blue electrode is added. By combining Top3 with the teal electrodes, we get the Top8 configuration. The final 23 electrode composition consists of all coloured nodes. 6 Name Top2 Top3 Top8 Electrodes {125,128} Top2 ∪ {17} Top3 ∪ {1,32,38,121,129} SideFronts Top8 ∪ {4,5,6,8,12,14,19,21,25} ∪ {33,43,120,122,126,127} Quantity 2 3 8 23 Colour Combination Pink Pink + Blue Pink + Blue + Teal Pink + Blue + Teal + Yellow Table 1: Electrode Clustering. Each electrode is given a colour as shown in Figure 3. The colours refer to the hues of the used electrodes. 4.4. Evaluation Cluster All (128) Top23 Top8 Top3 Top2 Xception InceptionTime EEGNet CNN Xception InceptionTime EEGNet CNN Model InceptionTime EEGNet CNN LR. (%) ↑ 97.07 ± 0.2 97.86 ± 0.27 97.35 ± 0.48 PyramidalCNN 98.12 ± 0.18 97.05 ± 0.4 97.54 ± 0.91 97.96 ± 0.24 98.16 ± 0.31 PyramidalCNN 98.38 ± 0.2 97.96 ± 0.63 97.92 ± 0.68 98.1 ± 0.13 97.92 ± 0.47 PyramidalCNN 98.12 ± 0.32 97.98 ± 0.24 98.0 ± 0.35 98.46 ± 0.15 98.34 ± 0.24 98.1 ± 0.67 97.72 ± 0.3 98.18 ± 0.49 98.57 ± 0.11 97.39 ± 1.88 PyramidalCNN 98.48 ± 0.21 97.84 ± 0.44 Xception InceptionTime EEGNet CNN PyramidalCNN Xception InceptionTime EEGNet CNN Xception Amp. (mm) ↓ Ang. (rad) ↓ Pos. (mm) ↓ 64.6 ± 4.88 0.36 ± 0.06 27.25 ± 0.94 70.36 ± 1.11 0.38 ± 0.12 29.14 ± 1.92 62.85 ± 0.79 0.33 ± 0.03 27.81 ± 3.39 61.34 ± 1.28 0.27 ± 0.08 25.79 ± 1.25 63.49 ± 1.19 0.4 ± 0.05 28.19 ± 2.14 62.92 ± 1.66 0.32 ± 0.03 27.82 ± 5.48 69.22 ± 1.21 0.26 ± 0.01 29.82 ± 1.31 62.88 ± 1.35 0.3 ± 0.06 25.97 ± 3.94 61.32 ± 0.67 0.32 ± 0.18 24.08 ± 1.08 63.2 ± 1.51 0.37 ± 0.17 28.35 ± 2.08 65.57 ± 0.84 0.35 ± 0.12 26.08 ± 2.34 71.76 ± 1.22 0.27 ± 0.02 29.62 ± 1.61 65.37 ± 1.29 0.32 ± 0.03 27.87 ± 3.17 65.33 ± 1.76 0.26 ± 0.03 26.21 ± 1.75 66.2 ± 1.66 0.34 ± 0.07 25.75 ± 1.03 72.28 ± 1.87 0.36 ± 0.08 31.94 ± 3.27 76.12 ± 0.92 0.38 ± 0.1 33.64 ± 1.68 71.77 ± 0.75 0.32 ± 0.03 28.12 ± 3.92 70.98 ± 0.59 0.27 ± 0.04 29.11 ± 1.98 74.46 ± 1.71 0.35 ± 0.07 30.46 ± 3.15 77.07 ± 3.68 0.36 ± 0.05 32.15 ± 3.31 77.55 ± 0.89 0.34 ± 0.01 38.23 ± 1.55 75.29 ± 2.52 0.34 ± 0.05 33.08 ± 4.28 75.47 ± 0.74 0.28 ± 0.03 33.16 ± 2.01 79.21 ± 1.61 0.47 ± 0.24 34.94 ± 2.43 Table 2: Benchmark. The performance of all models in EEGEyeNet benchmark for each task and each chosen cluster. The error of left-right task (LR) is measured in accuracy, amplitude and position task is measured in pixels, and angle in radians. 7 Kastrati P(cid:32)lomecka K ̈uchler Langer Wattenhofer We evaluate all proposed electrode configurations on all deep learning models. The bench- mark is run for all the tasks separately on NVIDIA GeForce GTX 1080 Ti. We see that on average equal or better results (in comparison with networks that have access to the full information) can be achieved by just using a fraction of electrodes. We can observe that in Table 2, running the benchmark with only 23 electrodes the models perform equally and sometimes even better than training the models with all 128 electrodes. This can be since many of the other electrodes do not add any useful information but just noise. This can be seen for example in the Left-Right task where PyramidalCNN achieves a score of 98.46 which is better than any model trained with 128 electrodes. Similar behavior can be seen also in the amplitude task. We can also observe that decreasing the number of electrodes to 8, decreases the performance of the models in the position task, however, the performance of all the other tasks with 8 electrodes still remains equally good compared to the performance with 128 electrodes. Decreasing the number of electrodes to 3 and 2, leads to a decrease in performance on all the tasks except the left-right task which can be decoded with high accuracy with only 2 electrodes. Nonetheless, with only 2-3 electrodes the performance on the amplitude task and the position task decreases significantly. 5. Electrode Clustering on Maximally Preprocessed Data In the previous section, we saw that the most important electrodes for decoding eye move- ment are the frontal electrodes. More specifically, if we choose 23 frontal electrodes then we achieve the same performance as with the full cap which consists of 128 electrodes. In this section, we investigate how state-of-the-art preprocessing methods used for neuro- scientific applications (maximally preprocessing) affect these results. Maximally preprocess- ing steps exclude ocular artifacts and include ideally only neurophysiological information. This makes the estimation of gaze position harder, however, it also reveals other insights how brain activity is related to eye movement. Interestingly, the analysis of the maximmally preprocessed data shows that the elec- trodes in the occipital part of the brain are also important for inferring gaze direction if one considers only the neurophysiological information. However, even after maximally pre- processing the data, the frontal electrodes can still be used for inferring gaze direction, indicating that the preprocessing might be suboptimal in removing ocular artifacts from the recorded EEG signal. Alternatively one could also speculate that the actual neuronal activity in the frontal electrodes (e.g. frontal eye fields) actually entails information about the eye movement. 5.1. Finding Important Electrodes We use again gradient-based methods to find important electrodes. 8 (a) (c) (b) (d ) Figure 4: Topoplots for (a) LR Task, (b) Position Task, (c) Amplitude Task and (d) Angular Task. Colors of higher intensity represent a higher importance. The colors are shown on a logarithmic scale. The score is averaged over all five deep learning architectures presented in (Kastrati et al. (2021)). We observe in Figure 4 again symmetry but, compared to minimally preprocessed data, we can see more sparsity in the distribution of the important brain regions. In particular, in contrast to minimally preprocessed data, we can identify in left-right and direction task an additional important region. Most of the importance is still located in the frontal electrodes, but now the second region of interest around the occipital region can also be identified. 5.2. Choice of Electrodes Due to the symmetry in the topoplots we use the same technique as in the minimally preprocessed data. That is, we rank the electrodes according to the gradient-based analysis (see Figure 5 for the importance of each electrode). With maximally preprocessed data we identified 40 most important electrodes, which achieve almost the same performance compared to the dense 128-electrode cap. 9 0.000.010.020.030.040.050.06Norm. Gradient Value0.000.020.040.060.080.10Norm. Gradient Value0.000.020.040.060.080.100.12Norm. Gradient Value0.000.010.020.030.040.050.060.07Norm. Gradient Value Kastrati P(cid:32)lomecka K ̈uchler Langer Wattenhofer (a) (b) (c) (d ) Figure 5: Gradient Based Feature Importance for (a) LR Task, (b) Position Task, (c) Am- plitude Task and (d) Angular Task. The normalized gradient results for each electrode and each task from the experiments on the maximally preprocessed data. 5.3. Choice of clusters If we decrease the number of electrodes below 40, then the performance starts decreasing. In this section, we investigate how the performance decreases for several different smaller clusters. Motivated by the fact that there are two different regions in maximally prepro- cessed data, we distinguish between the following clusters: front, back, front extended, and back extended. The extended version includes more electrodes in each region which results in more stable training. In Figure 6, we show all the main clusters for the best 40 elec- trodes. In Figure 6 the most important front electrodes are marked with pink color. The front extended cluster is marked with a purple cluster, composed of less important front electrodes. The back cluster is marked in yellow, which is extended with the green cluster (back extended cluster). 10 020406080100120Electrode Number0.000.010.020.030.040.050.06Input Gradients020406080100120Electrode Number0.000.020.040.060.080.10Input Gradients020406080100120Electrode Number0.000.020.040.060.080.100.12Input Gradients020406080100120Electrode Number0.000.010.020.030.040.050.060.07Input Gradients Figure 6: Electrode Clustering Visualisation. The best 40 electrodes according to our gradient feature importance method are marked. The pink-colored nodes correspond to the front part. For the extended version, the purple electrodes are added. The same is done for back electrodes. Its base consists of the yellow nodes, the extended version consists of the green ones. 5.4. Evaluation We evaluate all proposed electrode configurations on all deep learning models for the max- imally preprocessed data as well. In Table 3, we can see that with only 40 electrodes the models perform equally well and except for LR task, the models perform even better. For example, in the angle task, PyramidalCNN achieves a score of 0.68 if trained with 40 elec- trodes compared to the score of 0.76 radians if trained with 128 electrodes. Similar behavior can be seen also for the amplitude task. We can also observe that the models achieve com- petitive performance compared to the trained models with the full cap, also if they are trained with only the front (extended) cluster. Here we can also see for the angle task, 11 Kastrati P(cid:32)lomecka K ̈uchler Langer Wattenhofer PyramidalCNN trained only on the front extended task achieving a score of 0.67 radian, which is better than all models trained on the full 128-electrode cap. Cluster All (128) Top40 Front & Back Front Ext. Front Back Ext. Back Xception InceptionTime EEGNet CNN Model InceptionTime EEGNet CNN Xception InceptionTime EEGNet CNN PyramidalCNN Xception InceptionTime EEGNet CNN LR. (%) ↑ 93.61 ± 0.67 86.31 ± 1.47 90.48 ± 1.87 PyramidalCNN 93.08 ± 0.49 89.36 ± 3.01 93.59 ± 1.05 87.95 ± 0.09 90.64 ± 1.09 PyramidalCNN 92.01 ± 1.66 92.12 ± 0.8 92.6 ± 0.17 87.26 ± 0.55 90.99 ± 0.8 91.36 ± 1.0 90.07 ± 0.15 92.47 ± 0.81 83.94 ± 1.41 91.42 ± 0.48 PyramidalCNN 91.28 ± 1.69 91.76 ± 0.25 91.68 ± 0.19 83.33 ± 0.63 90.57 ± 0.82 89.54 ± 1.8 91.04 ± 0.69 71.42 ± 2.48 74.32 ± 0.43 71.39 ± 1.02 PyramidalCNN 70.91 ± 1.32 70.67 ± 1.29 69.21 ± 1.85 72.98 ± 0.49 70.02 ± 0.63 PyramidalCNN 67.88 ± 3.94 68.19 ± 2.03 Xception InceptionTime EEGNet CNN PyramidalCNN Xceptio InceptionTime EEGNet CNN Xception InceptionTime EEGNet CNN Xception Amp. (mm) ↓ Ang. (rad) ↓ 0.78 ± 0.08 61.42 ± 3.55 1.18 ± 0.05 60.42 ± 0.7 0.89 ± 0.14 64.31 ± 2.77 0.76 ± 0.09 57.73 ± 1.44 0.9 ± 0.19 64.2 ± 1.41 0.75 ± 0.06 60.42 ± 2.31 1.09 ± 0.03 59.66 ± 0.58 0.83 ± 0.09 62.38 ± 1.4 0.68 ± 0.02 57.04 ± 0.82 0.87 ± 0.13 63.0 ± 1.5 0.86 ± 0.19 59.34 ± 3.23 1.12 ± 0.02 60.52 ± 0.68 0.82 ± 0.03 61.86 ± 2.52 0.75 ± 0.03 58.63 ± 0.47 0.96 ± 0.11 63.15 ± 3.3 0.8 ± 0.15 60.72 ± 1.78 1.08 ± 0.01 63.35 ± 0.92 0.8 ± 0.03 69.73 ± 5.59 0.67 ± 0.03 60.94 ± 1.98 0.81 ± 0.09 66.74 ± 3.45 0.91 ± 0.15 61.31 ± 2.5 1.12 ± 0.02 63.25 ± 0.27 0.85 ± 0.04 61.84 ± 2.28 0.78 ± 0.02 61.36 ± 1.2 0.85 ± 0.07 62.6 ± 2.98 1.52 ± 0.08 78.46 ± 3.53 1.81 ± 0.01 67.93 ± 0.19 1.54 ± 0.07 75.04 ± 1.81 1.56 ± 0.03 70.85 ± 0.58 1.66 ± 0.06 81.64 ± 1.15 1.67 ± 0.08 75.45 ± 2.48 1.78 ± 0.07 68.72 ± 0.37 1.54 ± 0.04 79.54 ± 8.81 1.61 ± 0.02 73.03 ± 2.25 1.7 ± 0.05 81.93 ± 2.57 Pos. (mm) ↓ 125.07 ± 3.43 114.06 ± 0.38 122.59 ± 3.81 133.59 ± 1.62 125.34 ± 2.79 122.48 ± 1.98 112.9 ± 0.19 119.28 ± 0.62 134.6 ± 2.45 125.71 ± 1.96 121.48 ± 2.17 112.91 ± 0.38 118.94 ± 1.69 134.0 ± 2.99 125.17 ± 1.59 124.68 ± 2.12 113.83 ± 0.36 119.23 ± 0.92 135.0 ± 2.27 124.06 ± 1.94 123.05 ± 0.9 114.19 ± 0.39 120.67 ± 3.23 135.15 ± 3.52 125.44 ± 2.74 130.57 ± 1.05 119.88 ± 0.1 127.8 ± 1.55 145.75 ± 2.04 132.16 ± 0.66 127.42 ± 1.63 119.87 ± 0.18 126.45 ± 1.93 145.6 ± 1.69 132.81 ± 2.23 Table 3: Benchmark. The performance of all models in EEGEyeNet benchmark for each task and each chosen cluster for maximally preprocessed data. The error of left- right task (LR) is measured in accuracy, amplitude and position task is measured in pixels, and angle is measured in radians. 12 The position task for maximally preprocessed data is difficult for all the models even with the full cap, and as stated in (Kastrati et al. (2021)) it is not clear how good this task can be solved with only neurophysiological data. Finally, compared to the minimally preprocessed data, we can also see eye movement information can be decoded with only the electrodes on the occipital regions of the scalp, however, the performance decreases significantly. For instance, the best model trained with frontal electrodes achieves an accuracy of 92.58%, whereas the best performing model trained with the electrodes on the occipital part achieves an accuracy of 74.53%. If only the occipital electrodes are used the performance on the other tasks decreases significantly. This can be seen for the angle task where the performance of the models changes from 0.67 to 1.55 radians. This error is close to the naive baselines reported in Kastrati et al. (2021), showing the difficulty in learning more complex eye movements other than left-right classification solely from occipital electrodes. 6. Bandpassing The final analysis of the impact of preprocessing consists of bandpassing our data before training. 6.1. Choice of frequency bands We decided to focus our attention on a limited number of intervals, roughly based on historically pre-defined frequency bands (Newson and Thiagarajan (2019)). We define four frequency intervals: Delta : 1-4Hz, Theta : 4-8Hz, Alpha : 8-13Hz and Beta : 13-32Hz. The raw EEG measurements are bandpass for each subject before preparation of the input data, to allow precise frequency selection before reducing the signals to 1-second intervals to feed our model. This bandpassing is performed on both the maximally and minimally preprocessed data, before training respectively on each band. 6.2. Results We present the results below, including two frequency intervals obtained by merging fre- quency intervals. We report the average results of the EEGEyeNet benchmark for the left-right task. In Figure 7, we observe an important drop in accuracy for each of our bandpass datasets, with expectedly higher results when combined. Interestingly, the maximally preprocessed dataset seems to contain most of its helpful information in the higher frequencies, namely the 13-32Hz dataset, with an accuracy above the combination of the three other intervals. It seems to be the contrary for our minimally preprocessed dataset, with a high accuracy in 4-8Hz frequency band and 1-13Hz frequency band prediction. We see no significant improvement from the inclusion of the 13-32Hz interval. We hypothesize that the significant front electrodes' importance observed during clustering on the minimally preprocessed data contains mainly sub-13Hz signals used for prediction. A potential reason for this is that saccades happen only every 200-300ms. Additionally, the fact that 13-32Hz frequency band is important for maximally preprocessed data indicates that actual neuronal activity is used for decoding. 13 Kastrati P(cid:32)lomecka K ̈uchler Langer Wattenhofer (a) (b) Figure 7: Bandpass analysis. The relation between the frequency intervals and the per- formance of the models in the LR task for the (a) maximally preprocessed data and (b) minimally preprocessed data. 7. Conclusion The study's major finding shows that minimally preprocessed data used for prediction contains most of its information for the task in a limited number of electrodes in the frontal part. Therefore, by reducing their number to one-quarter of its original number, we decreased the input data size significantly and stabilized the prediction results with special cases where the performance even increases. Moreover, the short fit of our data and the high stability of the results might suggest the possibility of reducing the model's complexity without accuracy loss. It is interesting to note that also, for the maximally preprocessed dataset, the frontal electrodes are most important for gaze prediction. Since this dataset was treated with a non-brain artifactual source components removal based on the automatic classification result as provided by Independent Component Analysis, we can speculate the signal stems from the frontal eye field area, which plays an essential role in controlling visual attention and eye movements (Armstrong et al. (2009)). The oculomotor artefact removal in the maximally preprocessed dataset makes the gaze estimation position task more challenging. Nevertheless, this dataset contains mostly neurophysiological information and reveals other In particular, it is interesting insights into how brain activity relates to eye movement. to note how the second region of interest, located at the occipital part of the head, was important for inferring gaze direction. Since, most likely, the electrodes located in this part of the head are not influenced by any residual oculomotor noise, we can conclude that this signal contains information measured in the region of the visual cortex, revealing how neurophysiological brain activity is related to eye movement. Finally, we analyzed the impact of bandpassing our data before training. As expected, the low frequencies were most significant for the minimally preprocessed dataset, as they are related to ocular artefacts. However, the maximally preprocessed dataset revealed a different pattern, showing that the 13-32Hz frequencies contained the most meaningful information 14 All246810121416182022242628303234Frequency020406080Accuracy in LR task (%)1-32Hz1-13Hz1-4Hz4-8Hz8-13Hz13-32HzAll frequenciesAll246810121416182022242628303234Frequency020406080100Accuracy in LR task (%)1-32Hz1-13Hz1-4Hz4-8Hz8-13Hz13-32HzAll frequencies for our tasks. A current limitation in this work is that the bandpass analysis is performed only on the left-right task and for limited windows of frequency bands. Extensions of this work call for a fine-grained spectral analysis and how the performance changes across different eye movement patterns (other than left-right). References Martin Eriksson and Nikolaos P Papanikotopoulos. Eye-tracking for detection of driver fatigue. In Proceedings of Conference on Intelligent Transportation Systems, pages 314– 319. IEEE, 1997. Kenneth Holmqvist, Marcus Nystr ̈om, Richard Andersson, Richard Dewhurst, Halszka Jar- odzka, and Joost Van de Weijer. Eye tracking: A comprehensive guide to methods and measures. OUP Oxford, 2011. Hantao Liu and Ingrid Heynderickx. Visual attention in objective image quality assess- ment: Based on eye-tracking data. IEEE transactions on Circuits and Systems for Video Technology, 21(7):971–982, 2011. Frans W Cornelissen, Enno M Peters, and John Palmer. The eyelink toolbox: eye tracking with matlab and the psychophysics toolbox. Behavior Research Methods, Instruments, & Computers, 34(4):613–617, 2002. Kenneth Holmqvist, Marcus Nystr ̈om, and Fiona Mulvey. Eye tracker data quality: what it is and how to measure it. In Proceedings of the symposium on eye tracking research and applications, pages 45–52, 2012. Benjamin T Carter and Steven G Luke. Best practices in eye tracking research. International Journal of Psychophysiology, 155:49–62, 2020. Jayro Mart ́ınez-Cerver ́o, Majid Khalili Ardali, Andres Jaramillo-Gonzalez, Shizhe Wu, Alessandro Tonin, Niels Birbaumer, and Ujwal Chaudhary. Open software/hardware platform for human-computer interface based on electrooculography (eog) signal classifi- cation. Sensors, 20(9):2443, 2020. Hiroyuki Manabe, Masaaki Fukumoto, and Tohru Yagi. Direct gaze estimation based on IEEE Transactions on Biomedical Engineering, 62(6):1553–1562, nonlinearity of eog. 2015. L'uboˇs Hl ́adek, Bernd Porr, and W Owen Brimijoin. Real-time estimation of horizontal gaze angle by saccade integration using in-ear electrooculography. Plos one, 13(1):e0190420, 2018. Olaf Dimigen, Werner Sommer, Annette Hohlfeld, Arthur M Jacobs, and Reinhold Kliegl. Coregistration of eye movements and eeg in natural reading: analyses and review. Journal of experimental psychology: General, 140(4):552, 2011. 15 Kastrati P(cid:32)lomecka K ̈uchler Langer Wattenhofer Roberta Grech, Tracey Cassar, Joseph Muscat, Kenneth P Camilleri, Simon G Fabri, Michalis Zervakis, Petros Xanthopoulos, Vangelis Sakkalis, and Bart Vanrumste. Re- view on solving the inverse problem in eeg source analysis. Journal of neuroengineering and rehabilitation, 5(1):1–33, 2008. Ard Kastrati, Martyna Martyna Beata P(cid:32)lomecka, Dami ́an Pascual, Lukas Wolf, Victor Gillioz, Roger Wattenhofer, and Nicolas Langer. Eegeyenet: a simultaneous electroen- cephalography and eye-tracking dataset and benchmark for eye movement prediction. arXiv preprint arXiv:2111.05100, 2021. Luca Pion-Tonachini, Ken Kreutz-Delgado, and Scott Makeig. Iclabel: An automated elec- troencephalographic independent component classifier, dataset, and website. NeuroImage, 198:181–197, 2019. Ali Borji and Laurent Itti. State-of-the-art in visual attention modeling. IEEE transactions on pattern analysis and machine intelligence, 35(1):185–207, 2012. Orjan G Martinsen and Sverre Grimnes. Bioimpedance and bioelectricity basics. Academic press, 2011. Andreas Bulling, Jamie A Ward, Hans Gellersen, and Gerhard Tr ̈oster. Eye movement analysis for activity recognition using electrooculography. IEEE transactions on pattern analysis and machine intelligence, 33(4):741–753, 2010. M ́elodie Vidal, Andreas Bulling, and Hans Gellersen. Analysing eog signal features for the discrimination of eye movements with wearable devices. In Proceedings of the 1st international workshop on pervasive eye tracking & mobile eye-based interaction, pages 15–20, 2011. Lukas Wolf, Ard Kastrati, Martyna Beata P(cid:32)lomecka, Jie-Ming Li, Dustin Klebe, Alexan- der Veicht, Roger Wattenhofer, and Nicolas Langer. A deep learning approach for the segmentation of electroencephalography data in eye tracking applications. arXiv preprint arXiv:2206.08672, 2022. Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013. Jennifer Newson and Tara Thiagarajan. Eeg frequency bands in psychiatric disorders: A review of resting state studies. Frontiers in Human Neuroscience, 12, 01 2019. doi: 10.3389/fnhum.2018.00521. Katherine M. Armstrong, Mindy H. Chang, and Tirin Moore. Selection and maintenance of spatial information by frontal eye field neurons. Journal of Neuroscience, 29(50): 15621–15629, 2009. ISSN 0270-6474. doi: 10.1523/JNEUROSCI.4465-09.2009. URL https://www.jneurosci.org/content/29/50/15621. 16
http://arxiv.org/abs/2302.09649v1
2023-02-19T18:31:44
2023-02-19T18:31:44
Weakly Supervised Label Learning Flows
Supervised learning usually requires a large amount of labelled data. However, attaining ground-truth labels is costly for many tasks. Alternatively, weakly supervised methods learn with cheap weak signals that only approximately label some data. Many existing weakly supervised learning methods learn a deterministic function that estimates labels given the input data and weak signals. In this paper, we develop label learning flows (LLF), a general framework for weakly supervised learning problems. Our method is a generative model based on normalizing flows. The main idea of LLF is to optimize the conditional likelihoods of all possible labelings of the data within a constrained space defined by weak signals. We develop a training method for LLF that trains the conditional flow inversely and avoids estimating the labels. Once a model is trained, we can make predictions with a sampling algorithm. We apply LLF to three weakly supervised learning problems. Experiment results show that our method outperforms many baselines we compare against.
[ "You Lu", "Chidubem Arachie", "Bert Huang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09649v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09649v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Weakly Supervised Label Learning Flows 3 2 0 2 b e F 9 1 ] G L . s c [ 1 v 9 4 6 9 0 . 2 0 3 2 : v i X r a You Lu Department of Computer Science Virginia Tech Blacksburg, VA [email protected] Chidubem Arachie Department of Computer Science Virginia Tech Blacksburg, VA [email protected] Bert Huang Department of Computer Science Tufts University Medford, MA [email protected] Abstract Supervised learning usually requires a large amount of labelled data. However, attaining ground-truth labels is costly for many tasks. Al- ternatively, weakly supervised methods learn with cheap weak signals that only approximately la- bel some data. Many existing weakly supervised learning methods learn a deterministic function that estimates labels given the input data and weak signals. In this paper, we develop label learning flows (LLF), a general framework for weakly su- pervised learning problems. Our method is a gen- erative model based on normalizing flows. The main idea of LLF is to optimize the conditional likelihoods of all possible labelings of the data within a constrained space defined by weak sig- nals. We develop a training method for LLF that trains the conditional flow inversely and avoids estimating the labels. Once a model is trained, we can make predictions with a sampling algorithm. We apply LLF to three weakly supervised learn- ing problems. Experiment results show that our method outperforms many baselines we compare against. 1 INTRODUCTION Machine learning has achieved great success in many super- vised learning tasks. However, in practice, data labeling is usually human intensive and costly. To address this prob- lem, practitioners are turning to weakly supervised learn- ing (Zhou, 2018), which trains machine learning models with only noisy labels that are generated by human specified rules or pretrained models for related tasks. Recent research Work was done while You Lu was studying at Virginia Tech. Code can be found at: supervised-label-learning-flow https://github.com/yolu1055/weakly- shows that these models trained with weak supervisions can also perform well. Our method is concerned with the research of constraint- based weakly supervised learning. Previous methods (Bal- subramani and Freund, 2015; Arachie and Huang, 2021a,b; Mazzetto et al., 2021a,b) learn deterministic functions that estimate the unknown labels y given input data x and weak signals Q. Since the observed information is incomplete, the predictions based on it can be varied. However, these methods ignore this uncertainty between x and y. In this paper, we develop a general framework for weakly super- vised learning problems. The main idea behind our method is that we define the relationship between x and y with a probability distribution p(y|x). In training, we use the weak signals Q to define a constrained space for y and then optimize the likelihood of all possible y that are within this constrained space. Therefore, the learned model captures all possible relationships between the input x and output y. We name our framework label learning flows (LLF), since it uses a conditional flow-based model (Dinh et al., 2014; Rezende and Mohamed, 2015; Dinh et al., 2016; Kingma and Dhariwal, 2018; Trippe and Turner, 2018) to define the p(y|x). In this way, the model is flexible and can represent arbitrary distributions. We develop a learning method for LLF that trains the conditional flow inversely and avoids the min-max optimization (Arachie and Huang, 2021b). For prediction, we use sample-based method (Lu and Huang, 2020) to estimate the labels. We apply LLF to three weakly supervised learning prob- lems: weakly supervised classification (Arachie and Huang, 2021b; Mazzetto et al., 2021b), weakly supervised regres- sion, and unpaired point cloud completion (Chen et al., 2019; Wu et al., 2020). These three problems all include supervision that only weakly specifies the labels, but they each have very different label types and weak signals. Our method outperforms all other state-of-the-art methods on weakly supervised classification and regression, and it can perform comparably to other recent methods on unpaired point cloud completion. These experiments show that LLF is versatile and powerful. 2 BACKGROUND conditional affine coupling layer as Weakly Supervised Label Learning Flows In this section, we introduce weakly supervised learning and conditional normalizing flows. Weakly Supervised Learning. Given a dataset D = {x1, ..., xN }, and weak signals Q, weakly supervised learn- ing finds a model that can predict the unknown label yi for each input data xi. Weak signals are inexact or noisy supervision information that weakly label the dataset (Zhou, 2018). For different problems, the type and format of weak signals can be different. In weakly supervised classifica- tion (Arachie and Huang, 2021b; Mazzetto et al., 2021b), weak signals are noisy labels generated by rule-based la- beling methods. In unpaired point cloud completion (Chen et al., 2019; Wu et al., 2020), weak signals are coarse shape and structure information provided by a set of complete point clouds. Detailed illustrations of weakly supervised learning problems are in Section 4. Constraint-based methods (Balsubramani and Freund, 2015; Arachie and Huang, 2021a,b; Mazzetto et al., 2021a,b), de- fine a set of constrained functions based on Q and x. These functions form a space of possible y. The methods then look for one possible y within this constrained space. In this work, we follow this idea and use constrained functions to restrict the predicted y. Conditional Normalizing Flows. A normalizing flow (Rezende and Mohamed, 2015) is a series of invertible functions f = f1 ◦ f2 ◦ * * * ◦ fK that transform the proba- bility density of output variables y to the density of latent variables z. In conditional flows (Trippe and Turner, 2018), a flow layer function fi is also parameterized by the input variables x, i.e., fi = fx,φi, where φi is the parameters of fi. With the change-of-variable formula, the log conditional dis- tribution log p(y|x) can be exactly and tractably computed as ya, yb = split(y), zb = s(x, ya) (cid:12) yb + b(x, ya), z = concat(ya, zb), where s and b are two neural networks. The split() and the concat() functions split and concatenate the variables. 3 PROPOSED METHOD In this section, we introduce the label learning flows (LLF) framework for weakly supervised learning. Given Q and x, we define a set of constraints to restrict the predicted label y. These constraints can be inequalities, formatted as c(x, y, Q) ≤ b, or equalities, formatted as c(x, y, Q) = b. For simplicity, we represent this set of constraints as C(x, y, Q). Let Ω be the constrained sample space of y defined by C(x, y, Q) (when specifying a sample xi, we use Ωi to represent the constrained space of yi, i.e., the Ωi is a specific instance of Ω). For each xi, previous meth- ods (Balsubramani and Freund, 2015; Arachie and Huang, 2021a,b; Mazzetto et al., 2021a,b) only look for a single best yi within Ωi. In contrast, we develop a framework that optimizes the conditional log-likelihood of all possible yi within Ωi, resulting in the objective max φ Epdata(x)Ey∼U (Ω) [log p(y|x, φ)] , (2) where U (Ω) is a uniform distribution within Ω, and p(y|x) is a continuous density model of y. Let ˆy be the true label. We assume that each data point xi only has one unique label ˆyi, so that pdata(x, ˆy) = pdata(x). Let q(ˆy|x) be a certain model of ˆy. Tradi- tional supervised learning learns a q(ˆy|x) that maximizes Epdata(x,ˆy) [log q(ˆy|x, φ)]. Following theorem provides an intuition of how the proposed framework works. log K (cid:88) log p(y|x) = log pZ(fx,φ(y)) + (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) (1) where pZ(z) is a tractable base distribution, e.g. Gaussian ∂fx,φi is the Jacobian matrix of fx,φi. The distribution. The ∂ri−1 ri = fx,φi(ri−1), r0 = y, and rK = z. (cid:18) ∂fx,φi ∂ri−1 (cid:12) (cid:12) det (cid:12) (cid:12) i=1 , Normalizing flows are powerful when flow layers are invert- ible and have tractable Jacobian determinant. This combina- tion enables tractable computation and optimization of exact likelihood. In this paper, we use affine coupling layers (Dinh et al., 2014, 2016) to form normalizing flows. Affine cou- pling splits the input to two parts and forces the first part to only depend on the second part, so that the Jacobian is a triangular matrix. For conditional flows, we can define a i and Ω∗ i is bounded such that Theorem 1 Suppose that for any i, Ω∗ i satisfies that ˆyi ∈ i , and for any two ˆyi (cid:54)= ˆyj, the Ω∗ Ω∗ j are disjoint. The volume of each Ω∗ i | ≤ M , where M is a constant. The relationship between p(y|x) and q(ˆy|x) can be defined as: q(ˆy|x) = (cid:82) y∈Ω∗ p(y|x)dy. Then maximizing log p(y|x) can be interpreted as maximiz- ing the lower bound of log q(ˆy|x). That is, 1 |Ω∗ Epdata(x)Ey∼U (Ω∗) [log p(y|x, φ)] ≤ M Epdata(x,ˆy) [log q(ˆy|x, φ)] (3) The complete proof is in appendix. Theorem 1 indicates that, when the constrained space is Ω∗, learning with Equa- tion 2 is analogous to dequantization (Theis et al., 2015; Ho et al., 2019), i.e., a commonly used technique for generative models that converts a discrete variable to continuous by You Lu, Chidubem Arachie, Bert Huang adding continuous noise to it. That is, our method opti- mizes the likelihood of dequantized true labels. Maximizing log p(y|x) can be interpreted as maximizing a lower bound of log q(ˆy|x). Optimizing Equation 2 will also optimize the certain model on true labels. In practice, the real constrained space, may not fulfill the assumptions for Theorem 1, e.g., for some samples, the true label ˆyi is not contained in the Ωi, or the constrains are too loose, so the Ωs of different samples are overlapped. These will result in inevitable er- rors that come from the weakly supervised setting. Besides, for some regression problems, the ideal Ω∗ only contains a single point: the ground truth label, i.e., ∀i, Ω∗ i = {ˆyi}. 3.1 Learning and Prediction To use the proposed framework, i.e., Equation 2, we need to address two main problems. First, the p(y|x) should be defined by a flexible model, which has a computable likelihood, and can represent complicated distributions. Sec- ond, training the model with Equation 2 requires sampling y within Ω. Using traditional sampling methods, e.g., uni- form sampling, to sample y is inefficient. Due to the high dimensionality of sample space, the rejection rate would be prohibitively high. Moreover, estimating y at each iteration would result in an EM-like algorithm (Arachie and Huang, 2021b), which complicates the training process. Our method is called label learning flows (LLF), because these two problems can instead be solved with normalizing flows. That is, we use the invertibility of flows and rewrite log p(y|x) as log p(y|x) = log pZ(fx,φ(y)) + K (cid:88) log = log pZ(z) − K (cid:88) i=1 i=1 (cid:12) (cid:12) (cid:12) (cid:12) log det (cid:12) (cid:12) (cid:12) (cid:12) det (cid:18) ∂fx,φi ∂ri−1 (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) (cid:18) ∂gx,φi ∂ri (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) , (4) where gx,φi = f −1 x,φi With the inverse flow, Equation 2 can be interpreted as a constrained optimization problem is the inverse flow. (cid:34) max φ Epdata(x)EpZ (z) log pZ(z) − s.t. C(x, gx,φ(z), Q). (cid:12) (cid:12) (cid:12) (cid:12) det (cid:18) ∂gx,φi ∂ri (cid:35) (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) , log K (cid:88) i=1 (5) The final LLF framework is in Equation 5. The original constraint for z is gx,φ(z) ∈ Ω, and it can be replaced with C(x, gx,φ(z), Q). With this equation, the problem of sampling y within Ω is converted to sampling z from pZ(z), so that can be easily solved with an inverse flow. For efficient training, this constrained optimization problem can be approximated with the penalty method, resulting in the objective (cid:34) max φ Epdata(x)EpZ (z) log pZ(z) − K (cid:88) i=1 log (cid:12) (cid:12) det (cid:12) (cid:12) (cid:18) ∂gx,φi ∂ri (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) −λCr(x, gx,φ(z), Q)] , (6) where λ is the penalty coefficient, and Cr() means we re- formulate the constraints to be penalty losses. For example, an inequality constraint will be redefined as a hinge loss. In training, the inverse flow, i.e., gx,φ(z) estimates y and computes the likelihood simultaneously, removing the need of EM-like methods and making the training more straight- forward. In practice, the expectation with respect to pZ(z) can be approximated with a Monte Carlo estimate with Lt samples. Since we only need to obtain stochastic gradients, we follow previous works (Kingma and Welling, 2013) and set Lt = 1. Given a trained model and a data point xi, prediction re- quires outputting a label yi for xi. We follow Lu and Huang (2020) and use a sample average, i.e., yi = (cid:80)Lp j=1 gxi,φ(zj) as the prediction, where Lp is the number of samples used for inference. In our experiments, we found that Lp = 10 is enough for generating high-quality labels. 4 CASE STUDIES In this section, we illustrate how to use LLF to address weakly supervised learning problems. 4.1 Weakly Supervised Classification We follow previous works (Arachie and Huang, 2021b; Mazzetto et al., 2021b) and consider binary classification. For each example, the label y is a two-dimensional vec- tor within a one-simplex. That is, the y ∈ Y = {y ∈ [0, 1]2 : (cid:80) j y[j] = 1}, where y[j] is the jth dimen- sion of y. Each ground truth label ˆy ∈ {0, 1}2 is a two-dimensional one-hot vector. We have M weak label- ers, which will generate M weak signals for each data point xi, i.e., qi = [qi,1, ..., qi,M ]. Each weak signal qi,m ∈ Q = {q ∈ [0, 1]2 : (cid:80) j q[j] = 1} is a soft labeling of the data. In practice, if a weak labeler m fails to label a data point xi, the qi,m can be null, i.e., qi,m = ∅ Arachie and Huang (2021a). Following Arachie and Huang (2021b), we assume we have access to error rate bounds of these weak signals b = [b1, .., bM ]. These error rate bounds can be estimated based on empirical data (Arachie and Huang, 2021b), or set as constants (Arachie and Huang, 2021a). Therefore, the weak signals imply constraints (1 − y[j] i )q[j] i,m + y[j] i (1 − q[j] i,m) ≤ Nmb[j] m N (cid:88) i=1, qi,m(cid:54)=∅ ∀m ∈ {1, ..., M }, ∀j ∈ {0, 1} (7) Weakly Supervised Label Learning Flows where Nm is the number of data points that are labeled by weak labeler m.Equation 7 roughly restricts the difference between estimated labels and weak signals is bounded by the error rate bound. This problem can be solved with LLF, i.e., Equation 5, by defining C(x, gx,φ(z, Q) to be a combination of weak sig- nal constraints, i.e., Equation 7, and simplex constraints, i.e., y ∈ Y. The objective function of LLF for weakly supervised classification is max φ log pZ(z) − K (cid:88) (cid:12) (cid:12) (cid:12) (cid:12) log det (cid:18) ∂gx,φi ∂ri (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) + − λ2 [1 − gx,φ(z)]2  2 + i=1 − λ1 [gx,φ(z)]2  − λ3  (cid:88) j gx,φ(z)[j] − 1   − λ4 1 (cid:88) M (cid:88) j=0 m=1    i=0 qi,m(cid:54)=∅ N (cid:88) (1 − gx,φ(z)[j] i )q[j] i,m +gx,φ(z)[j] i (1 − q[j] i,m) − Nmb[j] m (cid:105)2 + , (8) where the second and third rows are the simplex constraints, and the last term is the weak signal constraints reformulated from Equation 7. The [.]+ is a hinge function that returns its input if positive and zero otherwise. We omit the expectation terms for simplicity. 4.2 Weakly Supervised Regression For weakly supervised regression, we predict one- dimensional continuous labels y ∈ [0, 1] given input dataset D = {x1, ..., xN } and weak signals Q. We define the weak signals as follows. For the mth feature of input data, we have access to a threshold (cid:15)m, which splits D to two parts, i.e., D1, D2, such that for each xi ∈ D1, the xi,m ≥ (cid:15)m, and for each xj ∈ D2, the xj,m < (cid:15)m. We also have ac- cess to estimated values of labels for subsets D1 and D2, i.e., bm,1 and bm,2. This design of weak signals tries to mimic that in practical scenarios, human experts can design rule-based methods for predicting labels for given data. For example, marketing experts can predict the prices of houses based on their size. For houses whose size is greater than a threshold, an experienced expert would know an estimate of their average price. Assuming that we have M rule-based weak signals, the constraints can be mathematically defined as follows: 1 |Dm,1| (cid:88) i∈Dm,1 yi = bm,1, 1 |Dm,2| (cid:88) j∈Dm,2 yj = bm,2, ∀m ∈ {1, ..., M }. (9) Plugging in Equation 9 to Equation 6, we have max φ log pZ(z) − i=1 − λ1 [gx,φ(z)]2   K (cid:88) (cid:12) (cid:12) (cid:12) (cid:12) log det (cid:18) ∂gx,φi ∂ri (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) + − λ2 [1 − gx,φ(z)]2 + − λ3  +  M (cid:88) m=1    1 |Dm,1|  2 gx,φ(z)i − bm,1  (cid:88) i∈Dm,1 1 |Dm,2| (cid:88) j∈Dm,2 2  gx,φ(z)j − bm,2    , (10) where the first two constraints restrict y ∈ [0, 1], and the last two rows are the weak signal constraints reformulated from Equation 9. 4.3 Unpaired Point Cloud Completion 1 , ..., x(p) Unpaired point cloud completion (Chen et al., 2019; Wu et al., 2020) is a practical problem in 3D scanning. Given a set of partial point clouds Xp = {x(p) N }, and a set of complete point clouds Xc = {x(c) N }, we want to restore each x(p) i ∈ Xp by generating its corresponding clean and complete point cloud. Each point cloud is a set of points, i.e., xi = {xi,1, ..., xi,T }, where each xi,t ∈ R3 is a 3D point, and the counts T represent the number of points in a point cloud. 1 , ..., x(c) Note that the point clouds in Xp and Xc are unpaired, so directly modeling the relationship between x(c) and x(p) is impossible. This problem can be interpreted as an inexact supervised learning problem (Zhou, 2018), in which the weak supervision is given by the referred complete point clouds Xc. We predict complete point clouds y ∈ Y for partial point clouds in Xp. The conditional distribution p(y|xp) is an exchangable distribution. We follow previous works (Yang et al., 2019; Klokov et al., 2020) and use De Finetti's representation theorem and variational inference to compute its lower bound as the objective. log p(y|xp) ≥ Eq(u|xp) (cid:35) log p(yi|u, xp) (cid:34) Tc(cid:88) i=1 − KL(q(u|xp)||p(u)), (11) where q(u|xp) is a variational distribution of latent variable u. In practice, it can be represented by an encoder, and uses the reparameterization trick (Kingma and Welling, 2013) to sample u. The p(u) is a standard Gaussian prior. The p(yi|u, xp) is defined by a conditional flow. We follow Chen et al. (2019); Wu et al. (2020) and use the adversarial loss and Hausdorff distance loss as constraints. The final You Lu, Chidubem Arachie, Bert Huang objective function is max φ (cid:34) Tc(cid:88) Eq(u|xp) log pZ(zt) − t=1 − KL(q(u|xp)||p(u)) − Eq(u|xp) +λ2dH (gu,xp,φ(z), xp)(cid:3) , (cid:2)λ1(D(gu,xp,φ(z)) − 1)2 log (cid:12) (cid:12) (cid:12) (cid:12) det (cid:18) ∂gu,xp,φi ∂rt,i (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) (cid:35) K (cid:88) i=1 (12) where D() represents the discriminator of a least square GAN (Mao et al., 2017). It is trained with the referred complete point clouds, so that contains their structure and geometric information. It provides a score for each gener- ated complete point cloud indicating its quality and fidelity, i.e., how close it is to real complete point clouds. The dH () represents the Haudorsff distance, which measures the dis- tance between a generated complete point cloud and its corresponding input partial point cloud. For clarity, we use zt and rt to represent variables of the tth point in a point cloud, and gu,xp,φ(z) to represent a generated point cloud. Detailed derivations of Equation 12 are in appendix. Training with Equation 12 is different from the previous settings, because we also need to train the discriminator of the GAN. The objective for D() is min D (cid:2)(D(xc) − 1)2(cid:3) Epdata(xc) + Epdata(xp),pZ (z),q(u|xp) (cid:2)D(gxp,u,φ(z))2(cid:3) . (13) The training process is similar to traditional GAN training. The inverse flow gu,xp,φ can be roughly seen as the genera- tor. In training, we train the flow to optimize Equation 12 and the discriminator to optimize Equation 13, alternatively. 5 RELATED WORK In this section, we introduce the research that most related to our work. Weakly Supervised Learning. Our method is in the line of constraint-based weakly supervised learning (Balsubramani and Freund, 2015; Arachie and Huang, 2021a,b; Mazzetto et al., 2021a,b), which constrains the label space of the pre- dicted labels using weak supervision and estimated errors. Previous methods are deterministic and developed for clas- sification tasks specifically. They estimate one possible y within the constrained space Ω. In contrast to these methods, LLF learns a probabilistic model, i.e., conditional flow, to represent the relationship between x and y. In training, it optimizes the likelihoods of all possible ys within Ω. For weakly supervised classification, LLF uses the same strat- egy as adversarial label learning (ALL) (Arachie and Huang, 2021b) to define constraint functions based on weak signals. ALL then uses a min-max optimization to learn the model parameters and estimate y alternatively. Unlike ALL, LLF learns the model parameters and output y simultaneously, and does not need a min-max optimization. Besides, LLF is a general framework and can be applied to other weakly supervised learning problems. In another line of research, non-constraint based weak su- pervision methods (Ratner et al., 2016, 2019; Fu et al., 2020; Shin et al., 2021; Zhang et al., 2021; Kuang et al., 2022) typically assume a joint distribution for the weak signals and the ground-truth labels. These methods use graphical models to estimate labels while accounting for dependencies among weak signals. Similar to these methods, we model labels y with a probabilistic model. Unlike these methods, we use a flow network to model dependency between x and y, but does not consider relationships among weak signals. Normalizing Flows. Normalizing flows (Dinh et al., 2014; Rezende and Mohamed, 2015; Dinh et al., 2016; Kingma and Dhariwal, 2018) have gained recent attention because of their advantages of exact latent variable inference and log- likelihood evaluation. Specifically, conditional normalizing flows have been widely applied to many supervised learning problems (Trippe and Turner, 2018; Lu and Huang, 2020; Lugmayr et al., 2020; Pumarola et al., 2020) and semi- supervised classification (Atanov et al., 2019; Izmailov et al., 2020). However, normalizing flows have not previously been applied to weakly supervised learning problems. Our inverse training method for LLF is similar to that of injective flows (Kumar et al., 2020). Injective flows are used to model unconditional datasets. They use an encoder network to map the input data x to latent code z, and then they use an inverse flow to map z back to x, resulting in an autoencoder architecture. Different from injective flow, LLF directly samples z from a prior distribution and uses a conditional flow to map z back to y conditioned on x. We use constraint functions to restrict y to be valid, so that does not need an encoder network. Point Cloud Modeling. Recently, Yang et al. (2019) and Tran et al. (2019) combine normalizing flows with varia- tional autoencoders (Kingma and Welling, 2013) and devel- oped continuous and discrete normalizing flows for point clouds. The basic idea of point normalizing flows is to use a conditional flow to model each point in a point cloud. The conditional flow is conditioned on a latent variable gen- erated by an encoder. To guarantee exchangeability, the encoder uses a PointNet (Qi et al., 2017) to extract features from input point clouds. The unpaired point cloud completion problem is first de- fined by Chen et al. (2019). They develop pcl2pcl-a GAN (Goodfellow et al., 2014) based model-to solve it. Their method is two-staged. In the first stage, it trains au- toencoders to map partial and complete point clouds to their latent space. In the second stage, a GAN is used to transform the latent features of partial point clouds to latent features of complete point clouds. In their follow-up paper (Wu et al., Weakly Supervised Label Learning Flows 2020), they develop a variant of pcl2pcl, called multi-modal pcl2pcl (mm-pcl2pcl), which incorporates random noise to the generative process, so that can capture the uncertainty in reasoning. In contrast to pcl2pcl, LLF can be trained end-to-end. When applying LLF to this problem, LLF has a similar framework to VAE-GAN (Larsen et al., 2016). The main differences are that LLF models a conditional distribution of points, and its encoder is a point normalizing flow. 6 EMPIRICAL STUDY In this section, we evaluate LLF on the three weakly super- vised learning problems. Model architecture. For weakly supervised classification and unpaired point cloud completion, the labels y are multi- dimensional variables. We follow Klokov et al. (2020) and use flows with only conditional coupling layers. We use the same method as Klokov et al. (2020) to define the condi- tional affine layer. Each flow model contains 8 flow steps. For unpaired point cloud completion, each flow step has 3 coupling layers. For weakly supervised classification, each flow step has 2 coupling layers. For weakly supervised re- gression, since y is a scalar, we use simple conditional affine transformation as flow layer. The flow for this problem con- tains 8 conditional affine transformations. For the unpaired point cloud completion task, we need to also use an encoder network, i.e., q(u|xp) and a discrimina- tor D(). We follow Klokov et al. (2020); Wu et al. (2020) and use PointNet (Qi et al., 2017) in these two networks to extract features for point clouds. Experiment setup. In weakly supervised classification and regression experiments, we assume that the ground truth labels are inaccessible, so tuning hyper-parameters for models is impossible. We use default settings for all hyper-parameters of LLF, e.g., λs and learning rates. We fix λ = 10 and use Adam (Kingma and Ba, 2014) with default settings. Following previous works (Arachie and Huang, 2021b,a), we use full gradient optimization to train the mod- els. For fair comparison, we run each experiment 5 times with different random seeds. For experiments with unpaired point cloud completion, we tune the hyper-parameters using validation sets. We use stochastic optimization with Adam to train the models. More details about experiments are in the appendix. 6.1 Weakly Supervised Classification Datasets. We follow Arachie and Huang (2021a,b) and conduct experiments on 12 datasets. Specifically, the Breast Cancer, OBS Network, Cardiotocography, Clave Direction, Credit Card, Statlog Satellite, Phishing Websites, Wine Quality are tabular datasets from the UCI repository (Dua and Graff, 2017). The Fashion-MNIST (Xiao et al., 2017) is an image set with 10 classes of clothing types. We choose 3 pairs of classes, i.e., dresses/sneakers (DvK), sandals/ankle boots (SvA), and coats/bags (CvB), to conduct binary classi- fication. We follow Arachie and Huang (2021b) and create 3 synthetic weak signals for each dataset. Each dataset is split to training set, simulation set and test set. The er- ror rate bounds are estimated based on the simulation set. The IMDB (Maas et al., 2011), SST (Socher et al., 2013) and YELP are real text datasets. We follow Arachie and Huang (2021a) and use keyword-based weak supervision. Each dataset has more than 10 weak signals. The error rate bounds are set as 0.01. Baselines. We compare our method with state-of-the-art methods for weakly supervised classification. For the experiments on tabular datasets and image sets, we use ALL (Arachie and Huang, 2021b), PGMV (Mazzetto et al., 2021b), ACML (Mazzetto et al., 2021a), generalized expec- tation (GE) (Druck et al., 2008; Mann and McCallum, 2010) and averaging of weak signals (AVG). For experiments on text datasets, we use CLL (Arachie and Huang, 2021a), Snorkel MeTaL (Ratner et al., 2019), Data Programming (DP) (Ratner et al., 2016), regularized minimax conditional entropy for crowdsourcing (MMCE) (Zhou et al., 2015), and majority-vote (MV). Note that some baselines, e.g., DP, CLL, used on text datasets are two-stage method. That is, they first predict labels for data points, and then use es- timated labels to train downstream classifiers. For better comparison, we develop a two-stage variant of LLF, i.e., LLF-TS, which first infers the labels, and then train a classi- fier with these inferred labels as a final predictor. We also show supervised learning (SL) results for reference. Results. We report the mean and standard deviation of ac- curacy (in percentage) on test sets in Table 1 and Table 2. For experiments on tabular and image datasets, LLF outper- forms other baselines on 9/11 datasets. On some datasets, LLF can perform as well as supervised learning methods. For experiments on text datasets, LLF outperforms other baselines on 2/3 datasets. LLF-TS performs slightly worse than LLF, we feel that one possible reason is LLF is a probabilistic model, which uses the average of samples as estimate labels, so that can slightly smooth out anomalous values, and improve predictions. These results prove that LLF is powerful and effective. In our experiments, we also found that the performance of LLF will also be impacted by different initialization of weights. This is why LLF has relatively larger variance on some datasets. Ablation Study. We can directly train the model using only the constraints as the objective function. In our experiments, we found that training LLF without likelihood (LLF-w/o- nll) will still work. However, the model performs worse than training with likelihood, i.e., Figure 1 We believe that this is because the likelihood helps accumulate more probability mass to the constrained space Ω, so the model will more You Lu, Chidubem Arachie, Bert Huang Table 1: Test set accuracy (in percentage) on tabular and image datasets. We report the mean accuracy of 5 experiments, and the subscripts are standard deviation. LLF ALL PGMV ACML GE AVG SL Fashion MNIST (DvK) Fashion MNIST (SvA) Fashion MNIST (CvB) Breast Cancer OBS Network Cardiotocography Clave Direction Credit Card Statlog Satellite Phishing Websites Wine Quality 1000.0 94.40.1 91.63.8 96.80.8 68.40.6 93.11.0 85.81.7 68.02.2 99.70.2 90.60.3 64.71.7 99.50.0 90.80.0 80.50.0 93.71.9 69.11.1 79.51.1 75.01.3 67.82.1 95.90.8 89.60.5 62.30.0 50.150.0 56.150.0 56.450.0 84.102.0 72.551.7 93.282.2 64.660.5 57.631.1 66.220.8 75.713.9 59.610.0 75.650.0 71.450.0 68.750.0 91.692.4 71.711.9 94.050.6 70.720.35 62.383.2 88.281.1 84.720.2 59.610.0 97.90.0 50.10.0 50.10.0 93.31.6 67.61.0 66.36.1 75.62.8 49.28.8 98.71.2 87.00.9 44.51.4 83.50.0 79.10.0 74.00.0 91.12.3 70.92.4 90.24.7 70.70.3 60.21.0 91.51.1 84.80.2 55.50.0 1.00.0 97.20.0 98.80.0 97.30.7 70.43.2 94.10.8 96.30.1 71.73.1 99.90.1 92.90.1 68.50.0 Table 2: Test set accuracy (in percentage) on real text datasets. LLF LLF-TS CLL MMCE DP MV MeTaL SL SST IMDB YELP 74.60.3 75.20.1 81.10.1 72.90.4 75.00.6 78.60.2 72.90.1 74.00.5 84.00.1 72.7 55.1 68.0 72.00.1 62.30.7 76.00.5 72.00.1 72.40.4 79.80.7 72.80.1 74.20.4 78.00.2 79.20.1 82.00.3 87.90.1 expertise. In training, we still assume that we do not have access to labels. We normalize the original label to within [0, 1] in training, and recover the predicted label to original value in prediction. Baselines. To the best of our knowledge, there are no meth- ods specifically designed for weakly supervised regression of this form. We use average of weak signals (AVG) and LFF-w/o-nll as baselines. We also report the supervised learning results for reference. Results. We use root square mean error (RSME) as metric. The results of test set are in Table 3. In general, LLF can predict reasonable labels. Its results are much better than AVG or any of the weak signals alone. Similar to the classi- fication results, training LLF without using likelihood will reduce its performance. Figure 1: Evolution of accuracy, likelihood and violation of weak signal constraints. Training with likelihood makes LLF accumulate more probability mass to the constrained space, so that the generated y are more likely to be within Ω, and the predictions are more accurate. likely generate y samples within Ω, and the predictions are more accurate. 6.3 Unpaired Point Cloud Completion 6.2 Weakly Supervised Regression Datasets. We use 3 tabular datasets from the UCI reposi- tory Dua and Graff (2017): Air Quality, Temperature Fore- cast, and Bike Sharing dataset. For each dataset, we ran- domly choose 5 features to develop the rule based weak signals. We split each dataset to training, simulation, and test sets. The simulation set is then used to compute the threshold (cid:15)s, and the estimated label values bs. Since we do not have human experts to estimate these values, we use the mean value of a feature as its threshold, i.e., (cid:15)m = 1 xi[m]. We then compute the esti- mated label values bm,1 and bm,2 based on labels in the simulation set. Note that the labels in the simulation set are only used for generating weak signals, simulating human i∈Dvalid |Dvalid| (cid:80) Datasets. We use the Partnet (Mo et al., 2019) dataset in our experiments. We follow Wu et al. (2020) and conduct experiments on the 3 largest classes of PartNet: Table, Chair, and Lamp. We treat each class as a dataset, which is split to training, validation, and test sets based on official splits of PartNet. For each point cloud, we remove points of randomly selected parts to create a partial point cloud. We follow Chen et al. (2019); Wu et al. (2020) and let the partial point clouds have 1024 points, and the complete point clouds have 2048 points. Metrics. We follow Wu et al. (2020) and use minimal matching distance (MMD) (Achlioptas et al., 2018), total mutual difference (TMD), and unidirectional Hausdorff dis- tance (UHD) as metrics. MMD measures the quality of generated. A lower MMD is better. TMD measures the di- versity of samples. A higher TMD is better. UHD measures 0.60.70.80.90500100015002000EpochAccAccuracy of MNIST−3−2−1010500100015002000EpochNLLNLL of MNIST0.0000.0250.0500.0750.1000500100015002000EpochViolationViolation of MNIST0.50.60.70.80500100015002000EpochAccAccuracy of Clave−3−2−1010500100015002000EpochNLLNLL of Clave0.0000.0250.0500.0750500100015002000EpochViolationViolation of ClavemethodLLF (test)LLF (train)LLF−w/o−nll (test)LLF−w/o−nll (train) Weakly Supervised Label Learning Flows Table 3: Test set RMSE of different methods. The numbers in brackets indicate the label's range. LLF LLF-w/o-nll AVG SL Air Quality (0.1847 ∼ 2.231) Temperature Forecast (17.4 ∼ 38.9) Bike Sharing (1 ∼ 999) 0.2110.009 2.5520.050 157.3480.541 0.2660.004 2.6560.055 162.6971.585 0.3730.005 2.8270.027 171.3381.300 0.1230.002 1.4650.031 141.9201.280 Table 4: Evaluation results on three classes of PartNet. LLF performs comparable to baselines. PartNet Chair TMD↑ UHD↓ MMD↓ Lamp TMD↑ UHD↓ MMD↓ Table TMD↑ UHD↓ MMD↓ 1.72 LLF 1.79 LLF-w/o-nll 1.90 pcl2pcl 1.52 mm-pcl2pcl mm-pcl2pcl-im 1.90 0.63 0.47 0.00 2.75 1.01 5.74 5.49 4.88 6.89 6.65 2.11 2.21 2.50 1.97 2.55 0.57 0.41 0.00 3.31 0.56 4.71 4.61 4.64 5.72 5.40 1.57 1.57 1.90 1.46 1.54 0.55 0.43 0.00 3.30 0.51 5.42 5.13 4.78 5.56 5.38 the fidelity of samples. A lower UHD is better. Baselines. We compare our method with pcl2pcl (Chen et al., 2019), mm-pcl2pcl (Wu et al., 2020), and LLF-w/o- nll. We use two variants of mm-pcl2pcl. Another variant is called mm-pcl2pcl-im, which is different from the original model in that it jointly trains the encoder of modeling multi- modality and the GAN. Hausdorff distance. However, the sample diversity and qual- ity, i.e., TMD and MMD, are worse than LLF. As argued by Yang et al. (2019), the current metrics for evaluating point cloud samples all have flaws, so these scores cannot be treated as hard metrics for evaluating model performance. We visualize some samples in Figure 6.3 and in appendix. These samples show that LLF can generate samples that comparable to mm-pcl2pcl. 7 CONCLUSION In this paper, we propose label learning flows, which rep- resent a general framework for weakly supervised learning. LLF uses a conditional flow to define the conditional distri- bution p(y|x), so that can model the uncertainty between input x and all possible y. Learning LLF is a constrained optimization problem that optimizes the likelihood of all possible y within the constrained space defined by weak signals. We develop a specific training method to train LLF inversely, avoiding the need of estimating y. We apply LLF to three weakly supervised learning problems, and the results show that our method outperforms many state-of- the-art baselines on the weakly supervised classification and regression problems, and performs comparably to other new methods for unpaired point cloud completion. These results indicate that LLF is a powerful and effective tool for weakly supervised learning problems. References P. Achlioptas, O. Diamanti, I. Mitliagkas, and L. Guibas. Learning representations and generative models for 3d point clouds. In International conference on machine learning, pages 40–49. PMLR, 2018. C. Arachie and B. Huang. Constrained labeling for weakly supervised learning. In International Conference in Un- certainty in Artificial Intelligence, 2021a. C. Arachie and B. Huang. A general framework for ad- Figure 2: Random sample point clouds generated by LLF and mm-pc2pc. The point clouds generated by LLF are as realistic as mm-pc2pc. Mm-pc2pc has a higher diversity in samples. However, sometimes it may generate unreasonable or invalid shapes. Results. We list the test set results in Table 4. In gen- eral, pcl2pcl has the best fidelity, i.e., lowest UHD. This is because pcl2pcl is a discriminative model, and it will only predict one certain sample for each input. This is also why pcl2pcl has the worse diversity as measured by TMD. Mm-pcl2pcl has the best diversity. However, as shown in Figure 6.3, some samples generated by mm-pcl2pcl are in- valid, i.e., they are totally different from the input partial point clouds. Therefore, mm-pcl2pcl has the worse fidelity. LLF scores between pcl2pcl and mm-pcl2pcl. It has better UHD than mm-pcl2pcl, and better TMD and MMD than pcl2pcl. The LLF-w/o-nll has a slightly better UHD than LLF. We believe this is because, without using the like- lihood, LLF-w/o-nll is trained directly by optimizing the mm-pc2pc LLF Partial You Lu, Chidubem Arachie, Bert Huang versarial label learning. Journal of Machine Learning Research, 22(118):1–33, 2021b. A. Atanov, A. Volokhova, A. Ashukha, I. Sosnovik, and D. Vetrov. Semi-conditional normalizing flows for semi- supervised learning. arXiv preprint arXiv:1905.00505, 2019. A. Balsubramani and Y. Freund. Scalable semi-supervised aggregation of classifiers. In Advances in Neural Infor- mation Processing Systems, volume 28, 2015. X. Chen, B. Chen, and N. J. Mitra. Unpaired point cloud completion on real scans using adversarial training. arXiv preprint arXiv:1904.00069, 2019. L. Dinh, D. Krueger, and Y. Bengio. NICE: Non-linear arXiv preprint independent components estimation. arXiv:1410.8516, 2014. L. Dinh, J. Sohl-Dickstein, and S. Bengio. Density estima- tion using real NVP. arXiv preprint arXiv:1605.08803, 2016. G. Druck, G. Mann, and A. McCallum. Learning from labeled features using generalized expectation criteria. In Proceedings of the 31st annual international ACM SIGIR conference on Research and development in information retrieval, pages 595–602, 2008. D. Dua and C. Graff. UCI machine learning repository, 2017. URL http://archive.ics.uci.edu/ml. D. Fu, M. Chen, F. Sala, S. Hooper, K. Fatahalian, and C. R ́e. Fast and three-rious: Speeding up weak supervision with triplet methods. In International Conference on Machine Learning, pages 3280–3291. PMLR, 2020. I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Ben- gio. Generative adversarial nets. In Advances in Neural Information Processing Systems, pages 2672–2680, 2014. J. Ho, X. Chen, A. Srinivas, Y. Duan, and P. Abbeel. Flow++: Improving flow-based generative models with variational dequantization and architecture design. arXiv preprint arXiv:1902.00275, 2019. P. Izmailov, P. Kirichenko, M. Finzi, and A. G. Wilson. Semi-supervised learning with normalizing flows. In International Conference on Machine Learning, pages 4615–4630. PMLR, 2020. D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. D. P. Kingma and P. Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pages 10215–10224, 2018. D. P. Kingma and M. Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013. R. Klokov, E. Boyer, and J. Verbeek. Discrete point flow networks for efficient point cloud generation. In Com- puter Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part XXIII 16, pages 694–710. Springer, 2020. Z. Kuang, C. G. Arachie, B. Liang, P. Narayana, G. De- Salvo, M. S. Quinn, B. Huang, G. Downs, and Y. Yang. Firebolt: Weak supervision under weaker assumptions. In International Conference on Artificial Intelligence and Statistics, pages 8214–8259. PMLR, 2022. A. Kumar, B. Poole, and K. Murphy. Regularized autoen- coders via relaxed injective probability flow. In Interna- tional Conference on Artificial Intelligence and Statistics, pages 4292–4301. PMLR, 2020. A. B. L. Larsen, S. K. Sønderby, H. Larochelle, and O. Winther. Autoencoding beyond pixels using a learned similarity metric. In International conference on machine learning, pages 1558–1566. PMLR, 2016. Y. Lu and B. Huang. Structured output learning with con- ditional generative flows. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 5005–5012, 2020. A. Lugmayr, M. Danelljan, L. Van Gool, and R. Timofte. Srflow: Learning the super-resolution space with normal- izing flow. In European Conference on Computer Vision, pages 715–732. Springer, 2020. A. Maas, R. E. Daly, P. T. Pham, D. Huang, A. Y. Ng, and C. Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th annual meeting of the asso- ciation for computational linguistics: Human language technologies, pages 142–150, 2011. G. S. Mann and A. McCallum. Generalized expectation criteria for semi-supervised learning with weakly labeled data. Journal of machine learning research, 11(2), 2010. X. Mao, Q. Li, H. Xie, R. Y. Lau, Z. Wang, and S. Paul Smol- ley. Least squares generative adversarial networks. In Proceedings of the IEEE international conference on com- puter vision, pages 2794–2802, 2017. A. Mazzetto, C. Cousins, D. Sam, S. H. Bach, and E. Upfal. Adversarial multiclass learning under weak supervision with performance guarantees. In International Confer- ence on Machine Learning (ICML), 2021a. A. Mazzetto, D. Sam, A. Park, E. Upfal, and S. Bach. Semi- supervised aggregation of dependent weak supervision sources with performance guarantees. In International Conference on Artificial Intelligence and Statistics, pages 3196–3204. PMLR, 2021b. K. Mo, S. Zhu, A. X. Chang, L. Yi, S. Tripathi, L. J. Guibas, and H. Su. Partnet: A large-scale benchmark for fine- grained and hierarchical part-level 3d object understand- In Proceedings of the IEEE/CVF Conference on ing. Computer Vision and Pattern Recognition, pages 909– 918, 2019. Weakly Supervised Label Learning Flows weak supervision. arXiv preprint arXiv:2109.11377, 2021. D. Zhou, Q. Liu, J. C. Platt, C. Meek, and N. B. Shah. Reg- ularized minimax conditional entropy for crowdsourcing. arXiv preprint arXiv:1503.07240, 2015. Z.-H. Zhou. A brief introduction to weakly supervised learning. National science review, 5(1):44–53, 2018. A. Pumarola, S. Popov, F. Moreno-Noguer, and V. Ferrari. C-flow: Conditional generative flow models for images and 3d point clouds. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7949–7958, 2020. C. R. Qi, H. Su, K. Mo, and L. J. Guibas. Pointnet: Deep learning on point sets for 3d classification and segmenta- tion. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 652–660, 2017. A. Ratner, B. Hancock, J. Dunnmon, F. Sala, S. Pandey, and C. R ́e. Training complex models with multi-task weak In Proceedings of the AAAI Conference supervision. on Artificial Intelligence, volume 33, pages 4763–4771, 2019. A. J. Ratner, C. M. De Sa, S. Wu, D. Selsam, and C. R ́e. Data programming: Creating large training sets, quickly. Advances in neural information processing systems, 29: 3567–3575, 2016. D. J. Rezende and S. Mohamed. Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770, 2015. C. Shin, W. Li, H. Vishwakarma, N. Roberts, and F. Sala. Universalizing weak supervision. arXiv preprint arXiv:2112.03865, 2021. R. Socher, A. Perelygin, J. Wu, J. Chuang, C. D. Manning, A. Y. Ng, and C. Potts. Recursive deep models for se- mantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, pages 1631–1642, 2013. L. Theis, A. v. d. Oord, and M. Bethge. A note on the evaluation of generative models. arXiv preprint arXiv:1511.01844, 2015. D. Tran, K. Vafa, K. K. Agrawal, L. Dinh, and B. Poole. Discrete flows: Invertible generative models of discrete data. arXiv preprint arXiv:1905.10347, 2019. B. L. Trippe and R. E. Turner. Conditional density esti- mation with Bayesian normalising flows. arXiv preprint arXiv:1802.04908, 2018. R. Wu, X. Chen, Y. Zhuang, and B. Chen. Multimodal shape completion via conditional generative adversarial networks. arXiv preprint arXiv:2003.07717, 2020. H. Xiao, K. Rasul, and R. Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algo- rithms. arXiv preprint arXiv:1708.07747, 2017. G. Yang, X. Huang, Z. Hao, M.-Y. Liu, S. Belongie, and B. Hariharan. Pointflow: 3d point cloud generation with In Proceedings of the continuous normalizing flows. IEEE/CVF International Conference on Computer Vision, pages 4541–4550, 2019. J. Zhang, Y. Yu, Y. Li, Y. Wang, Y. Yang, M. Yang, and A. Ratner. Wrench: A comprehensive benchmark for You Lu, Chidubem Arachie, Bert Huang A PROOF OF THEOREM 1 The proof of Theorem 1 is similar to the proof of dequantization (Theis et al., 2015; Ho et al., 2019). The complete proof is as follows. Proof. Epdata(x)Ey∼U (Ω∗) [log p(y|x, φ)] = (cid:90) pdata(x) y∈Ω∗ (cid:88) x 1 |Ω∗| (cid:90) log p(y|x)dy p(y|x)dy y∈Ω∗ ≤ M = M (cid:88) x (cid:88) x,ˆy pdata(x) log pdata(x, ˆy) log q(ˆy|x) In the second row, we use the properties that that pdata(x) = pdata(x, ˆy), and the relationship between p(y|x) and q(ˆy|x). 1 |Ω∗| ≤ M , and the Jensen's inequality. In the third row, we use the assumption (cid:3) = M Epdata(x,ˆy) [log q(ˆy|x)] (14) B LABEL LEARNING FLOW FOR UNPAIRED POINT CLOUD COMPLETION In this section, we provide complete derivations of LLF for unpaired point cloud completion. The conditional likelihood log p(y|xp) is an exchangeable distribution. We use De Finetti's representation theorem and variational inference to derive a tractable lower bound for it. log p(y|xp) = = (cid:90) (cid:90) p(y, u|xp)du p(y|u, xp)p(u)du ≥ Eq(u|xp) [log p(y|u, xp)] − KL(q(u|xp)||p(u)) ≥ Eq(u|xp) (cid:34) Tc(cid:88) i=1 (cid:35) log p(yi|u, xp) − KL(q(u|xp)||p(u)), (15) where in the third row, we use Jensen's inequality to compute the lower bound, and in the last row, we use De Finetti's theorem to factorize p(y|u, xp) to the distributions of points. The least square GAN discriminator and the Hausdorff distance for generated complete point clouds can be treated as two equality constraints D(y) = 1 dH (y, xp) = 0. Weakly Supervised Label Learning Flows Note that the dH () is non-negative. Convert these two constraints to penalty functions, we have max φ Eq(u|xp) (cid:34) Tc(cid:88) t=1 log pZ(zt) − (cid:12) (cid:12) (cid:12) (cid:12) det (cid:18) ∂gu,xp,φi ∂rt,i (cid:35) (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) log K (cid:88) i=1 − KL(q(u|xp)||p(u)) − Eq(u|xp) (cid:2)λ1(D(gu,xp,φ(z)) − 1)2 + λ2dHL(gu,xp,φ(z), xp)(cid:3) . (16) C EXPERIMENT DETAILS In this section, we provide more details on our experiments to help readers reproduce our results. C.1 Model Architectures For experiments of weakly supervised classification, and unpaired point cloud completion, we use normalizing flows with only conditional affine coupling layers (Klokov et al., 2020). Each layer is defined as ya, yb = split(y) s = ms(wy(ya) (cid:12) wx(x) + wb(x)) b = mb(cy(ya) (cid:12) cx(x) + cb(x)) zb = s (cid:12) yb + b z = concat(ya, zb), (17) where m, w, c are all small neural networks. For weakly supervised regression, since the label y is a scalar, we use conditional affine transformation as a flow layer, which is defined as y = s(x) ∗ z + b(x) (18) where s and b are two neural networks that take x as input and output parameters for y. For LLF, we only need the inverse flow, i.e., gx,φ, for training and prediction, so in our experiments, we actually define gx,φ as the forward transformation, and let y = s (cid:12) z + b. We do this because multiplication and addition are more stable than division and subtraction. C.1.1 Weakly Supervised Classification In this problem, we use a flow with 8 flow steps, and each step has 2 conditional affine coupling layers. These two layers will transform different dimensions. Each w and c are small MLPs with two linear layers. Each m has one linear layer. The hidden dimension of linear layers is fixed to 64. C.1.2 Weakly Supervised Regression In this problem, we use conditional affine transformation introduced in Equation 18, as a flow layer. A flow has 8 flow layers. The s and b in a flow layer are three layer MLPs. The hidden dimension of linear layers is 64. C.1.3 Unpaired Point Cloud Completion The model architecture used LLF used for this problem is illustrated in Figure 3. We use the same architecture as DPF (Klokov et al., 2020) for point flow. Specifically, the flow has 8 flow steps, and each step has 3 conditional affine coupling layers, i.e., Equation 17. Slightly different from the original DPF, the conditioning networks wx, cx, wb, and cb will take the latent variable u and the features of partial point cloud xp as input. The ws and cs are MLPs with two linear layers, whose hidden dimension is 64. The ms are one layer MLPs. We use a PointNet (Qi et al., 2017) to extract features from partial point cloud xp. Following Klokov et al. (2020), the hidden dimensions of this PointNet is set as 64 − 128 − 256 − 512. Given the features of xp, the encoder E then uses the reparameterization trick (Kingma and Welling, 2013) to generate latent variable u, which is a 128-dimensional vector. The encoder has two linear layers, whose hidden dimension is 512. You Lu, Chidubem Arachie, Bert Huang The GAN discriminator uses another PointNet to extract features from (generated) complete point clouds. We follow Wu et al. (2020) and set the hidden dimensions of this PointNet as 64 − 128 − 128 − 256 − 128. The discriminator D is a three layer MLP, whose hidden dimensions are 128 − 256 − 512. Figure 3: Model architecture of LLF for unpaired point cloud completion. The E represents the encoder, and the D represents the GAN discriminator. C.2 Experiment setup In weakly supervised classification and regression experiments, we fix λ = 10. and use default settings, i.e., η = 0.001, β1 = 0.9 and β2 = 0.999 for Adam (Kingma and Ba, 2014). We use an exponential learning rate scheduler with a decreasing rate of 0.996 to guarantee convergence. We track the decrease of loss and when the decrease is small enough, the training stops. The random seeds we use in our experiments are {0, 10, 100, 123, 1234}. For experiments on tabular datasets and image sets, we set the maximum epochs to 2000. For experiments on real text datasets, we set the maximum epochs to 500. For experiments with unpaired point cloud completion, we use Adam with an initial learning rate η = 0.0001 and default βs. The best coefficients for the constraints in Equation 12 of main paper are λ1 = 10, λ2 = 100. We use stochastic optimization to train the models, and the batch size is 32. Each model is trained for at most 2000 epochs. All experiments are conducted with 1 GPU. C.3 Data, Training, and Evaluation Details C.3.1 Weakly Supervised Classification For experiments on tabular and image datasets, we use the same approach as Arachie and Huang (2021b,a) to split each dataset to training, simulation, and test sets. We use the data and labels in simulation sets to create weak signals, and estimated bounds. We train models on training sets and test model on test sets. We assume that the models do not have access to any labels. The labels in simulation sets are only used to generated weak signals and estimate bounds. We follow Arachie and Huang (2021b) and choose 3 features to create weak signals. We train a logistic regression with each feature on the simulation set, and use the label probabilities predicted by this logistic regression as weak signals. We compute the error of this trained logistic regression on simulation set as estimated error bound. Note that the weak signals of each data point are probabilities that this sample belongs to the positive class. For PGMV (Mazzetto et al., 2021b) and ACML (Mazzetto et al., 2021a), we round the probabilities to form one-hot vectors. For experiments on real text datasets, we use the same keyword-based method as Arachie and Huang (2021a) to create weak supervision. Specifically, we choose key words that can weakly indicate positive and negative sentiments. Documents containing positive words will be labeled as positive, and vice versa. The weak signals in this task are one-hot vectors, indicating which class a data point belongs to. If a key word is missing in a document, the corresponding weak label will be null. For two-stage methods, we follow Arachie and Huang (2021a) and use a two layer MLP as the classifier, whose latent dimension is 512. PointNetEPoint FlowPointNetDxpuzyxc0 or 1 Weakly Supervised Label Learning Flows We list some main features of these datasets in Table 5. We refer readers to their original papers for more details. For those datasets without official splits, we randomly split them with a ratio of 4 : 3 : 3. Table 5: Summary of datasets used in weakly supervised classification experiments. The "-" indicates this dataset does not have a official split Dataset Size Train Size Test Size No. features No. weak signals Fashion MNIST (DvK) Fashion MNIST (SvA) Fashion MNIST (CvB) Breast Cancer OBS Network Cardiotocography Clave Direction Credit Card Statlog Satellite Phishing Websites Wine Quality IMDB SST YELP 12, 000 14, 000 12, 000 14, 000 12, 000 14, 000 569 - 795 - 963 - 8, 606 - 1, 000 - 3, 041 - 11, 055 - 4, 974 - 49, 574 5, 819 55, 370 29, 182 3, 998 45, 370 2, 000 2, 000 2, 000 - - - - - - - - 20, 392 1, 821 10, 000 784 784 784 30 21 21 16 24 36 30 11 300 300 300 3 3 3 3 3 3 3 3 3 3 3 10 14 14 C.3.2 Weakly Supervised Regression We use three datasets from the UCI repository. For each dataset, we randomly split it to training, simulation, and test sets with a ratio of 4 : 3 : 3. We use the simulation set to create weak signals and estimated label values. We choose 5 features to create weak signals for each dataset. The detailed introduction of these datasets are as follows. Table 6 summarize the statistical results of them. Air Quality. In this task, we predict the absolute humidity in air, based on other air quality features such as hourly averaged temperature, hourly averaged NO2 concentration etc. The raw dataset has 9, 358 instances. We remove those instances with Nan values, resulting in a dataset with 8, 991 instances. We use hourly averaged concentration CO, hourly averaged Benzene concentration, hourly averaged NOx concentration, tungsten oxide hourly averaged sensor response, and relative humidity as features for creating weak signals. Temperature Forecast. In this task, we predict the next day maximum air temperature based on current day information. The raw dataset has 7, 750 instances, and we remove those instances with Nan values, resulting in 7, 588 instances. We use present max temperature, forecasting next day wind speed, forecasting next day cloud cover, forecasting next day precipitation, solar radiation as features for creating weak signals. Bike Sharing. In this task, we predict the count of total rental bikes given weather and date information. The raw dataset has 17, 389 instances, and we remove those instances with Nan values, resulting in 17, 379 instances. We use season, hour, if is working day, normalized feeling temperature, and wind speed as features for creating weak signals. Table 6: Summary of datasets used in weakly supervised regression experiments Dataset Size No. features No. weak signals Air Quality Temperature Forecast Bike Sharing 8, 991 7, 588 17, 379 12 24 12 5 5 5 In these datasets, the original label is within an interval [ly, uy]. In training, we normalize the original label to within [0, 1] by computing y = (y − ly)/(uy − ly). In prediction, we recover the predicted label to original value by computing y = y(uy − ly) + ly. You Lu, Chidubem Arachie, Bert Huang C.3.3 Unpaired Point Cloud Completion Datasets. We use the same way as Wu et al. (2020) to process PartNet Mo et al. (2019). PartNet provides point-wise semantic labels for point clouds. The original point clouds are used as complete point clouds. To generate partial point clouds, we randomly removed parts from complete point clouds, based on the semantic labels. We use Chair, Table, and Lamp categories. The summary of these three subsets are in Table 7. Table 7: Summary of datasets used unpaird point cloud completion experiments Dataset Train Size Valid Size Test Size Chair Table Lamp 4, 489 5, 707 1, 545 617 843 234 1, 217 1, 668 416 Metrics. Let Xc be the set of referred complete point clouds, and Xp be the set of input partial point clouds. For each partial point cloud x(p) , we generate M complete point cloud samples y(1) . All these samples form a new set of complete point clouds Y. In our experiments, we follow Wu et al. (2020) and set M = 10. , ..., y(M ) i i i The MMD Achlioptas et al. (2018) is defined as MMD = 1 |Xc| (cid:88) xi∈Xc dC(xi, NN(xi)), (19) where NN(x) is the nearest neighbor of x in Y. The dC represents Chamfer distance. MMD computes the distance between the set of generated samples and the set of target complete shapes, so it measures the quality of generated. The TMD is defined as TMD = 1 |Xp|   |Xp| (cid:88) i=1 2 M − 1 M (cid:88) M (cid:88) j=1 k=j+1  dC(y(j) i , y(k) i  . ) (20) TMD measures the difference of generated samples given an input partial point cloud, so it measures the diversity of samples. The UHD is defined as UHD = 1 |Xp|   1 M |Xp| (cid:88) i=1 M (cid:88) j=1  dH (xi, y(j) i  , ) (21) where dH represents the unidirectional Hausdorff distance. UHD measures the similarity between generated samples and input partial point clouds, so it measures the fidelity of samples. C.3.4 Point Cloud Samples We show more samples of LLF in Figure 4, Figure 5, and Figure 6. Weakly Supervised Label Learning Flows Figure 4: Random chair samples generated by LLF. The first row is partial point clouds, and the second row is generated complete point clouds. Figure 5: Random lamp samples generated by LLF. Figure 6: Random table samples generated by LLF.
http://arxiv.org/abs/2302.10199v1
2023-02-19T18:22:59
2023-02-19T18:22:59
Evaluating the Effectiveness of Pre-trained Language Models in Predicting the Helpfulness of Online Product Reviews
Businesses and customers can gain valuable information from product reviews. The sheer number of reviews often necessitates ranking them based on their potential helpfulness. However, only a few reviews ever receive any helpfulness votes on online marketplaces. Sorting all reviews based on the few existing votes can cause helpful reviews to go unnoticed because of the limited attention span of readers. The problem of review helpfulness prediction is even more important for higher review volumes, and newly written reviews or launched products. In this work we compare the use of RoBERTa and XLM-R language models to predict the helpfulness of online product reviews. The contributions of our work in relation to literature include extensively investigating the efficacy of state-of-the-art language models -- both monolingual and multilingual -- against a robust baseline, taking ranking metrics into account when assessing these approaches, and assessing multilingual models for the first time. We employ the Amazon review dataset for our experiments. According to our study on several product categories, multilingual and monolingual pre-trained language models outperform the baseline that utilizes random forest with handcrafted features as much as 23% in RMSE. Pre-trained language models reduce the need for complex text feature engineering. However, our results suggest that pre-trained multilingual models may not be used for fine-tuning only one language. We assess the performance of language models with and without additional features. Our results show that including additional features like product rating by the reviewer can further help the predictive methods.
[ "Ali Boluki", "Javad Pourmostafa Roshan Sharami", "Dimitar Shterionov" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.10199v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.10199v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.LG" ]
3 2 0 2 b e F 9 1 ] L C . s c [ 1 v 9 9 1 0 1 . 2 0 3 2 : v i X r a Evaluating the Effectiveness of Pre-trained Language Models in Predicting the Helpfulness of Online Product Reviews Ali Boluki, Javad Pourmostafa Roshan Sharami, and Dimitar Shterionov Tilburg University, Tilburg 5037 AB, Netherlands [email protected], [email protected], [email protected] Abstract. Businesses and customers can gain valuable information from product reviews. The sheer number of reviews often necessitates ranking them based on their potential helpfulness. However, only a few reviews ever receive any helpfulness votes on online marketplaces. Sorting all re- views based on the few existing votes can cause helpful reviews to go unnoticed because of the limited attention span of readers. The prob- lem of review helpfulness prediction is even more important for higher review volumes, and newly written reviews or launched products. In this work we compare the use of RoBERTa and XLM-R language models to predict the helpfulness of online product reviews. The contributions of our work in relation to literature include extensively investigating the efficacy of state-of-the-art language models-both monolingual and multilingual-against a robust baseline, taking ranking metrics into ac- count when assessing these approaches, and assessing multilingual mod- els for the first time. We employ the Amazon review dataset for our experiments. According to our study on several product categories, mul- tilingual and monolingual pre-trained language models outperform the baseline that utilizes random forest with handcrafted features as much as 23% in RMSE. Pre-trained language models reduce the need for complex text feature engineering. However, our results suggest that pre-trained multilingual models may not be used for fine-tuning only one language. We assess the performance of language models with and without addi- tional features. Our results show that including additional features like product rating by the reviewer can further help the predictive methods. Keywords: Helpfulness Prediction, Online Reviews, Pre-trained Lan- guage Models, Monolingual Language Models, Multilingual Language Models 1 Introduction Online reviews are a good source of information for prospective customers, help- ing them decide about purchasing a product or service. Reviews can also be helpful for businesses as a source for their products/services assessment by cus- tomers and to identify their strengths and weaknesses for better planning. As 2 Boluki et al. more customers adopt online shopping, the number of online customer reviews grows daily. Customers and businesses can become overwhelmed by the num- ber of reviews for products/services. Hence, there is a need to identify the most helpful reviews. Specifically, sorting reviews based on their helpfulness can be very useful for both customers and businesses. Some online marketplaces like Amazon have a voting feature allowing readers to specify whether a review is helpful. However, only a small fraction of reviews get any helpfulness votes since each customer usually reads only a few reviews, and many do not vote for reviews' helpfulness. Simply sorting reviews based on their existing votes can exacerbate the problem. Most customers will only look at the few reviews with existing votes, resulting in potentially helpful reviews being neglected or overlooked with no votes [34,27]. This issue can be more prominent for products/services with a high review volume, more recent reviews, or for newly launched products. In literature, the helpfulness of reviews is defined based on the helpfulness votes. In most of the works, reviews are defined as most helpful by the ratio of people that voted for the specific review as helpful over the total number of votes (helpful or not helpful) [37,27,23,3]. However, some datasets may lack the total number of votes for each review. In such cases, researchers have consid- ered helpfulness as the number of votes a review has received for being helpful, possibly normalized by the elapsed time between review publication and dataset collection [31,1]. In this research, we aim to investigate the usefulness of models based on pre-trained language models to predict the helpfulness of an online review, even before the review has any helpfulness vote. An effective predictive method pro- vides a fair chance of visibility to all reviews based on their potential helpfulness. In this research, we intend to compare methods based on fine-tuning state-of- the-art (SOTA) language models, specifically RoBERTa [18] and a multilingual pre-trained language model, XLM-R [5], and some more classical methods com- bined with handcrafted feature constructors. We conducted experiments with English data collected from reviews submitted for Amazon products. Here, we aim to investigate how the method based on the pre-trained mul- tilingual model compares against the one based on the monolingual language model on reviews written in English, a very common language. Given that a method based on multilingual language models is more generally applicable, it can provide additional benefits in case reviews written in multiple languages. Moreover, these models can be fine-tuned on a larger dataset and generalized better to low-resource languages. Our work investigates aspects not previously studied in depth for product review helpfulness prediction. Specifically, we examine the use of SOTA language models, both monolingual and multilingual models, for this task and consider ranking metrics in evaluating the methods. Thus, this work can guide us toward selecting and developing new models for sorting the reviews on online stores based on their predicted helpfulness. Reviews Helpfulness Prediction 3 We would like to emphasize that review helpfulness prediction is a different problem from the typical task of sentiment analysis. Merely comprehending that a review has neutral, positive, or negative sentiment is not the solution for finding and illustrating the most helpful reviews to the customers, as helpful reviews can be located among reviews with all types of sentiments. As the final product, we desire a method of sorting reviews that is more advantageous for the customers by better predicting the most helpful ones. A reliable review helpfulness predictor can assist customers in making more informed purchasing decisions while saving time. Also, businesses can grasp the essential customer needs and opinions more easily to be able to address them by adjusting their product or service according to society's needs. This paper is organized as follows. We first cover the related work in Sect. 2. In Sect. 3, we highlight our main contributions and the importance of the re- search. Sect. 4 presents our proposed methodology – language model-based meth- ods. Empirical evaluations, including details about the dataset, the baseline mod- els, evaluation metrics, and the results, are presented in Sect. 5. Sect. 6 discusses the overall picture that emerges from the findings. Sect. 7 concludes the paper and gives insights for future work. 2 Related Work Researchers have used various algorithms and features on different datasets like Amazon, TripAdvisor, and Yelp [37,27,29,1]. We divide the previous works into three categories: regression, classification, and ranking, based on their approach to dealing with helpfulness prediction. 2.1 Regression The works with a regression approach try to predict a number on a continu- ous scale (typically in [0,1]), indicating a review's helpfulness. Researchers have mainly used support vector regression for the regression approaches [6]. We can also see linear regression [19], probabilistic matrix factorization [30], and ex- tended tensor factorization models [22], which have incorporated contextual in- formation for authors or readers and have achieved better results than simpler regression models. However, depending on non-textual features may be limiting for many applications where that information is not collected. The work presented in [37] isolates review helpfulness prediction from non- text features. They represent reviews in two semantic dimensions: linguistic in- quiry and word count (LIWC) [26,2] and INQUIRER1. LIWC considers semantic features to map text to numerical values representing emotions, writing styles, and other psychological and linguistic dimensions. Their findings reveal that the two semantic feature sets may more precisely predict helpfulness scores and significantly boost performance compared to utilizing features proposed prior to 1INQUIRER dictionary is introduced originally in [28]. 4 Boluki et al. their work like geneva affect label coder (GALC) [21] and structural features [36]. Their work motivates us to use LIWC features for the baseline. Reference [23] utilizes Hidden Markov Model – Latent Dirichlet Allocation to jointly model reviewer expertise as latent time-evolving variables and product aspects as latent topics. The authors give their attention to the semantics of reviews and explain how experts employ salient terms from latent word clusters to describe key aspects of the reviewed item. Their method outperforms the selected baselines from previous works [24,19] for helpfulness prediction. One drawback of their work is that the method heavily depends on having access to multiple reviews from the same users over time, which may only sometimes be possible due to data collection and availability limitations. The work presented in [3] uses word and character representation to pro- pose a convolutional neural network model to address cases with limited data and out-of-vocabulary (OOV) problem. Additionally, in order to predict the cross-domain review helpfulness, they jointly model product domains to transfer knowledge from a domain with more data to the one with less data. They use Amazon product review dataset and achieve better results in terms of correla- tion coefficient and also cross-domain robustness than the competing methods including [37] and [17]. It is noteworthy that with the advent of more advanced language models, OOV may be less of an issue. 2.2 Classification Methods with a classification approach attempt to classify the reviews as helpful or not helpful. Most researchers have used support vector machines (SVMs) for the classification approach [6]. Reference [15] proposes a model for helpfulness prediction extracting linguistic features, and making a feature value by accumu- lating them. The author concludes that these linguistic features help predict the helpfulness of reviews for experience products like books. Nevertheless, using an element of review metadata as a review rating can add noise due to higher mis- alignment with helpfulness. Therefore, they suggest designing a review ranking mechanism depending on the product type. However, some other features, like semantic features of review, are not included in their predictive model. Some newer works have dealt with classification using neural networks [20]. Reference [29] investigates the impact of different review informativeness measurements on review's helpfulness. They use thresholded regression and men- tion that the classification threshold for search products such as laptops is more significant than experience products such as running shoes because search prod- uct attributes can be compared more manageably and objectively. They conclude that review informativeness plays a crucial role in the helpfulness of reviews. Their research does not include features related to the sentiment, which has been suggested by other works to play an essential role in determining review helpfulness. Our baseline includes features related to sentiment. While automatic feature extraction for natural language processing (NLP) can be a significant step in review helpfulness analysis, very few recent works Reviews Helpfulness Prediction 5 have used BERT [12] as one of the best-performing methods for this task [1]. Ref- erence [1] uses the Yelp shopping review dataset to compare the performance of a BERT-based classifier with the bag-of-words approaches combined with SVM or K-nearest neighbors (KNN). They consider reviews with 0 helpful votes un- helpful and reviews with 4 or more helpful votes helpful. One may argue that this labeling of helpful versus unhelpful is very subjective. Nevertheless, the au- thors conclude that in distinguishing helpful and unhelpful reviews, BERT-based classifiers outdo bag-of-words methods. One downside of this work is the weak baseline based on simplistic bag-of-words representations. Moreover, it leaves evaluating the effectiveness of more recent language models and analysis on other datasets like product reviews to future work. To the best of our knowl- edge, no prior work has examined the utility of multilingual language models for review helpfulness prediction. 2.3 Ranking Very few works have considered the problem directly as a ranking problem. Ref- erence [32] proposes an unsupervised method to rank reviews according to their distance to a "virtual core review" which is identified as a lexicon of dominant terms in the reviews. But their approach requires an external reference corpus and is specifically tailored to book reviews only. Although ranking metrics are very relevant for evaluating review helpfulness prediction, works like [23] and [11] that report a ranking-related metric along the usual regression or classification metrics are rare. To the best of our knowledge, no work using modern language models for helpfulness prediction has investigated this aspect and ranking met- rics. 3 Research Contribution Most of the previous works on predicting the helpfulness of the reviews use machine learning techniques such as linear regression, support vector machines, and random forest combined with features constructed from the reviews' texts and possibly utilize additional information like star ratings. Text-based features can include word-based features. For example, TF-IDF, review length, pres- ence of keywords or words from pre-defined lists of words relevant to senti- ments/subjectiveness, and more complex semantic features like LIWC. More- over, very few works have been done on product review helpfulness prediction using deep learning or cutting-edge language modeling approaches. However, this line of research has compared these new approaches with the classical ones using only more superficial text-based features like TF-IDF and not the more complex handcrafted ones that we employ in our baseline. Therefore, in this research, we want to find out how the performance of a SOTA multilingual pre-trained language model (MLLM) like XLM-R compares with a SOTA pre-trained monolingual model (LM) such as RoBERTa and a 6 Boluki et al. classical approach, namely random forest, with handcrafted features in predict- ing helpfulness of product reviews. In addition, the comparisons in the works mentioned above have been primarily based on using only the reviews' text. Thus, we want to investigate to what extent including additional features like star rating and review length helps the predictive models that are based on pre-trained language models for the task of review helpfulness prediction. More- over, as some of the works discussed in the previous section have suggested that methods' results can vary on different product categories, especially between ex- perience and search products. We also investigate how the relative performance of the methods we compare changes across different product categories. 4 Proposed Methodology 4.1 Language Model-Based Methods This work uses SOTA pre-trained language models to build predictive models for review helpfulness prediction. We leverage these models to form (trainable) representations of the text of the reviews, which will then be fed to the predictor module. Since the advent of BERT [12], most of the new developments in language modeling have been primarily composed of transformers [33]. Transformers are based on the multi-head (self) attention mechanism, a different paradigm from recurrent or convolutional networks, based on efficient feed-forward networks for translation and a positional encoder for predicting the word-order. BERT is a bidirectional transformer pre-trained using a combination of next-sentence pre- diction and masked language modeling on a large unlabeled corpus of Toronto Book and Wikipedia. BERT learns representations of text by conditioning on both left and right context. In [12], it has been shown that fine-tuning BERT with just one output layer results in a promising performance in several bench- mark natural language understanding (NLU) tasks. BERT is often credited with marking a new era of NLP and making pre-training of language models a stan- dard. The language models utilized in this work are based on transformers and improvements over BERT. There have been several works that have been improvements of BERT. One that we consider in our work is RoBERTa [18]. RoBERTa discards the next sentence pre-training objective of BERT, trains the model on a larger corpus, and modifies important hyperparameters like using larger batch sizes and learning rates. It is shown in [18] that RoBERTa achieves SOTA results in the NLU benchmarks compared with all works prior to it. Multilingual models based on transformers have also been developed in re- cent years. One of the SOTA models is XLM-R [5], a large multilingual masked language model based on RoBERTa. XLM-R was pre-trained on a large dataset (2.5 TB) from CommonCrawl [35] and one hundred languages. XLM-R has been shown to outperform other multilingual models on various cross-lingual bench- marks and even surpass the per-language performance of BERT monolingual Reviews Helpfulness Prediction 7 baselines [5]. Thus, in this work, we put XLM-R to test for the task of review helpfulness prediction. Fig. 1: Overall model structure We utilize a pre-trained language model to extract a representation from the review text and fine-tune the language and regression model with our review helpfulness data. The overall model structure is shown in Fig. 1. We choose a tokenizer corresponding to the specific language model. We take the embedding of the start-of-sequence token (also known as classification token – CLS) as the representation of review text. One can also take the concatenation of embeddings of the start of the sequence token from the last couple of layers instead or do an average pooling over the embeddings of all tokens in the last layer. In our limited ablation tests, we saw no improvement from these strategies over using only the start of sequence token (CLS) embedding during fine-tuning, as we see in Table 1. Hence, from computational perspective, we choose to use CLS embedding, a 768-dimensional vector. We use two fully-connected layers for the regressor head, with the first one having a nonlinear ReLU activation function when utilizing additional features and a single layer otherwise. We do not want to restrict the relationship between additional features and output to a simple linear one. When using features in addition to the review text, they are concatenated with the text embedding and fed to the regressor head. In this work, we investigate whether models based on language models can benefit from additional features like star rating and review length (in terms of number for words) for review helpfulness prediction. We normalize these two 8 Boluki et al. Table 1: Results of ablation tests, using only the start of sequence token (CLS) embedding during fine-tuning compared with average pooling over the embed- dings of all tokens in the last layer. Results are based on the average of metrics for 3 different random splits of data for all 6 metrics on the cellphone category. Numbers in parentheses denote standard deviation (MAE: mean absolute error, RMSE: root mean squared error, PCC in [-1,1]: Pearson correlation coefficient, SPC in [-1,1]: Spearman's rho, KC in [-1,1]: Kendall's tau, NDCG in [0,1]: nor- malized discounted cumulative gain). Category Model Embedding Method MAE RMSE PCC Cellphone RoBERTa CLS Cellphone RoBERTa Average Pooling Cellphone XLM-R CLS Cellphone XLM-R Average Pooling KC NDCG SPC 0.1380 0.1990 0.6092 0.5215 0.3690 0.9787 (0.0053) (0.0033) (0.0026) (0.0164) (0.0122) (0.0009) 0.1396 0.1985 0.6062 0.5250 0.3721 0.9777 (0.0039) (0.0041) (0.0067) (0.0158) (0.0117) (0.0007) 0.1429 0.1998 0.5997 0.5092 0.3595 0.9784 (0.0054) (0.0014) (0.0072) (0.0164) (0.0112) (0.0012) 0.1429 0.9780 (0.0022) (0.0030) (0.0067) (0.0152) (0.0103) (0.0007) 0.5080 0.3585 0.5916 0.2009 additional features before concatenation with CLS embedding by centering and scaling them based on statistics computed from training data. To select the maximum length of token sequences, we computed the 75% quantile of tokenized reviews' length for each category and computed their av- erage, which resulted in a number close to 300. Motivated by this, and to make the models and their training less computationally expensive, as the computa- tional complexity of attention-based models is quadratic in sequence length, we set the maximum token sequence length to 300 instead of the maximum possible value of 512. A more detailed view of the predictive models based on pre-trained language models is shown in Fig. 2. As the problem is of regression type, the model is trained with mean-squared- error (MSE) loss. Following [18,5,12], we employ Adam optimizer [13] with β1 = 0.9, β2 = 0.999, learning rate warmup over the steps of the first epoch to peak learning rate value and linear decay afterward, and batch size of 16. We did some ablation tests to select the peak learning rate value from [1e-4, 1e-5] and observed that 1e-4 shows slightly better performance. For each training run, 12.5% of the products in training data (equivalent to 10% of all products) are set aside for validation set. We train the model for 5 epochs, monitor the model's performance on the validation set during training, and restore the model state from the epoch with the best performance on the validation set. Facebook has originally developed both RoBERTa and XLM-R, and their official implementation in PyTorch and pre-trained versions are available at [2] and [3]. Both of these models are also implemented in the transformers class of 2https://github.com/pytorch/fairseq/tree/master/examples/roberta 3https://github.com/pytorch/fairseq/tree/master/examples/xlmr Reviews Helpfulness Prediction 9 Fig. 2: Architecture of language model-based methods. Tok stands for token, E and O denote the initial and output embeddings, the regressor head is an FCN (fully-connected network), and M represents the maximum token sequence length set to 300 in this work. When using additional features, the embedding of the start of the sequence is concatenated with additional features and then fed to the regressor head. HuggingFace4 and are available for both PyTorch and TensorFlow. We use the transformers class with PyTorch in this study. The rest of the hyperparameters not discussed in this section are set to their suggested default values in Hug- gingFace. Experiments are run on a cluster node with Intel Xeon 6346 3.10 GHz processor and an NVIDIA A40 Accelerator. 5 Empirical Evaluations 5.1 Dataset Description and Processing As noted in Sect. 1, we work on the Amazon review dataset, which includes reviews (ratings, text, helpfulness votes, product ID, reviewer ID), and product metadata (category information, price, brand) provided by McAuley [10] and downloadable at: [5]. One of the advantages of this dataset is that not only it contains the number of helpful votes that a review gets, but it also includes the total number of votes. This allows us to look at our prediction task with less subjectivity and from a regression perspective without needing to set subjective thresholds or scaling. We use four of the original dataset columns, which are: (i) Review Text: contains the text of the review. (ii) Overall: specifies the product's rating by 4https://huggingface.co/ 5http://jmcauley.ucsd.edu/data/amazon/links.html 10 Boluki et al. the reviewer. (iii) Asin: indicating the product ID. (iv) Helpful: includes the number of people who find the review helpful and the total number of votes. We construct the helpfulness ratio column out of this last original column. We choose four product categories from the dataset: beauty products, movies, cellphones, and electronics, to have a mix of categories in terms of experience vs. search and data size. The pre-processing steps we take are as follows. First, we remove the rows (data points) that do not have any value for review text, overall, or helpful column. In order to have a more stable and less biased helpfulness score (ratio), we follow the common best practices [25,3,37] and filter the reviews to keep the ones with more than 10 votes from our dataset. Although we can expect to only keep meaningful reviews by dropping the ones with less than 10 votes, we further check the remaining data for reviews without any alphabetical words. After filtering, we have 883,412 reviews from the four selected categories. In Table 2, we can see the number of reviews for each of the four categories. Helpfulness scores are between 0 and 1 (inclusive). Table 2: Properties of the different categories of the dataset Category Electronics Beauty Products Cellphone Movies No. Reviews Before Filtering 7,824,482 359,881 No. Reviews After Filtering 2,023,070 59,359 3,447,249 4,607,047 410,318 53,854 5.2 Baseline One advantage of pre-trained language models is that there is usually no need to find additional handcrafted features from text for downstream tasks. How- ever, as our baseline, we include a more classical machine learning-based way of predicting helpfulness. Specifically, instead of a language model, we utilize hand- crafted features from review texts that have been shown to work well among the different features tested in the literature. We use LIWC, a software program to analyze text and convert it into a structured format with numerical scores based on its internal dictionary about different psychological and linguistic fea- tures [26]. In this work, we employ LIWC-22 [2], the fifth upgraded version of the original program with more extensive dictionaries. The core of LIWC is its dictionary. Its inner lexicon comprises around 12,000 words, word stems, idioms, and several emoticons. Each item in the dictionary is a component of one or more sub-dictionaries or categories, mostly organized hierarchically and intended to evaluate different psychological variables. LIWC assigns zero or one to each word in the review text in different language dimen- sions. After summing up the values of all words for each dimension, we will have a histogram of language dimensions for each review. We utilize LIWC and process every review text to get its representation in LIWC dimensions. Overall, LIWC features act as a baseline for review text rep- Reviews Helpfulness Prediction 11 resentation. We use a more classical machine learning method, Random Forest Regressor, and its implementation in scikit-learn6 for this baseline. This base- line follows the construction used in [3,25,37]. For our baseline, we utilize all the available dimensions in LIWC. For hyperparameter tuning, we consider the following hyperparameters and possible values for them: {n estimator: [200, 400], max features: ['auto', 'sqrt'], max depth: [10, None], min samples leaf: [10, 50]}. n estimator determines the number of trees, max features specifies the number of features to consider when searching for the best split at each node, where 'auto' means using all features. max depth is the maximum possible tree depth with 'None' imposing no constraint, and min samples leaf is the required minimum number of samples at each leaf node. 5.3 Evaluation Method We first split the dataset into training/validation and test sets to evaluate the different methods. The splitting strategy has been either entirely random or considered products in previous works. Following [23,9], we split the dataset of each product category to 80% of products for training and validation and 20% of products held out for testing. We split the data by product so that the model does not see any review for the products in the test set during training. This strategy of splitting the data is closer to an actual application of a review helpfulness prediction model compared with a completely random splitting. It is noteworthy that the splitting by product setup may be more challenging for the model than an utterly random splitting setup, since in the latter the model can see labeled reviews for the products in the test set during training. For most of the comparison results, we do three different splits of training/validation and test data to compute statistics of performance metrics. We use standard evaluation metrics for regression which are root mean squared error (RMSE), mean absolute error (MAE), and Pearson correlation coefficient (PCC). As mentioned earlier in Sect. 1, the ground truth of the helpfulness score is defined by the ratio of people that have voted for the specific review as help- ful over the total number of votes (helpful or not helpful) [37,23,27,3]. That is, y = nhelpf ul , with nhelpf ul and ntotal representing the number of helpful votes ntotal and the number of total votes, respectively. PCC is a value between -1 and 1, with higher values indicating the better performance of the model predictions. In ad- dition to the usual regression metrics, we consider ranking metrics for evaluation purposes. Although a marketplace ultimately needs to rank the reviews based on their potential helpfulness, only a few works have reported results related to ranking metrics. Here, we consider ranking metrics such as Spearman's rho (SPC), Kendall's tau (KC), and normalized discounted cumulative gain (NDCG) to compare rankings of reviews based on the prediction of the model and the ground truth. SPC is the non-parametric version of PCC and assesses the monotonic asso- ciation between two variables and returns a value between -1 and 1, with higher 6https://scikit-learn.org/ 12 Boluki et al. values suggesting a stronger association. SPC can be calculated as the PCC of ranks of y and ˆy. KC is another measure for correspondence between two rankings, measuring the ordinal association between variables, and is a value between -1 and 1, with values closer to 1 indicating a stronger association. KC is calculated based on the number of pairs in the same order (concordant) and the number of pairs in a different order (discordant) in the two rankings. While PCC measures the linear relationship between prediction and ground truth, SPC and KC measure more general monotone associations. NDCG is a popular metric for comparing ranking systems in information retrieval. NDCG for a rank position is the DCG through that rank position nor- malized by the ideal maximum possible DCG through that rank position. DCG is the sum of true relevance scores ranked in the order induced by predicted rel- evance scores, with a logarithmic discount that increases with the rank position. Thus, NDCG weights the top-rank positions more than the lower ones and is a value between 0 and 1, with 1 being the best score. In our case, helpfulness scores are, in fact, the relevance scores. As noted in the literature, the users usually only read a limited number of reviews, so NDCG@k, which only considers the top k for computing the metric, may be the most suitable for our application. Hence, in this work, we compute NDCG@10 for each product in the test set and report the average across products. The flowchart of the overall evaluation process is shown in Fig. 3. Fig. 3: Experiment process Reviews Helpfulness Prediction 13 5.4 Results First we conduct an ablation study to find the optimal setting for fine-tuning the language models and present the results below. Then, we provide the results of the models based on pre-trained language models and the baseline for different categories of the products. Ablation Study on Fine-Tuning: The architectures of RoBERTa and XLM- R that we use in this work consist of 12 attention layers. Motivated by prior works such as [16,8] that suggest freezing a subset of layers may be beneficial depending on the task and dataset, we first perform an ablation study to deter- mine how many layers of the pre-trained language model need to be fine-tuned to achieve the best performance that is the best trade-off between performance and computational complexity. Fine-tuning fewer layers can speed up training while potentially reducing the chances of overfitting. Since the pre-training procedure of RoBERTa and XLM-R does not involve the next sentence prediction, there is no justification for freezing all layers of the language model and using the CLS embedding as the text representation without any fine-tuning of the model. Thus, we need to fine-tune a subset of the layers at least. In deep learning models, specifically in NLP and computer vision, a common belief is that the initial layers encode more universal features. In contrast, the top/last layers encode more task-specific ones [14,4,38]. Hence, the freezing of the layers is always done in a bottom (initial layers) to top (last layers) fashion. We train our RoBERTa-based and XLM-R-based models by fine- tuning the top (last) 2, 4, 6, and all of the layers of the language model. The cutoff of 6 layers for exploration of fine-tuning the different number of layers is inspired by [16], where they suggest that the first half of the language model layers can be confidently kept frozen considering the accuracy and computational complexity. It is worth mentioning that in all cases, the regressor head is trained during the fine-tuning procedure. Table 3 shows the results of training models based on pre-trained RoBERTa and XLM-R, with the different number of layers being fine-tuned for cellphone and movie categories. We choose these two categories for this test to have cate- gories with different sample sizes and product types. The results are based on 3 different splits of train/validation and test data, and the reported numbers are the metrics computed on test data and averaged across the 3 runs. 14 Boluki et al. Table 3: Results with changing the number of fine-tuned layers in the models based on pre-trained language models. Results are based on the average of met- rics for 3 different random splits of data for all 6 metrics on cellphone and movie categories. 0.2061 0.2136 0.2142 0.7682 0.7656 0.5650 0.7566 0.7541 0.5538 0.7538 0.7516 0.5523 Category Model No. Lay. MAE ↓ RMSE ↓ PCC ↑ SPC ↑ KC ↑ NDCG ↑ 0.1475 0.2041 0.7742 0.7717 0.5717 0.9737 Movies RoBERTa 0.9733 0.1512 Movies RoBERTa 0.9723 0.1567 Movies RoBERTa 0.9720 0.1546 Movies RoBERTa 0.1564 0.2108 0.7545 0.7558 0.5563 0.9719 Movies XLM-R 0.9715 0.1615 Movies XLM-R 0.9697 0.1671 Movies XLM-R 0.9556 0.2230 Movies XLM-R 0.1380 Cellphone RoBERTa 0.9787 0.1376 0.1967 0.6132 0.5240 0.3710 0.9785 Cellphone RoBERTa 0.5951 0.4977 0.3507 0.1389 Cellphone RoBERTa 0.9787 0.2010 0.1355 0.1988 Cellphone RoBERTa 0.6044 0.5124 0.3620 0.9791 0.1429 0.1998 0.5997 0.5092 0.3595 0.9784 Cellphone XLM-R 0.5915 0.4951 0.3486 0.9786 0.1460 Cellphone XLM-R 0.9777 0.5691 0.4757 0.3338 0.1458 Cellphone XLM-R 0.9777 0.5392 0.4612 0.3223 0.1632 Cellphone XLM-R 0.7446 0.7408 0.5408 0.7207 0.7176 0.5191 0.5633 0.5669 0.4024 0.6092 0.5215 0.3690 2 4 6 all 2 4 6 all 2 4 6 all 2 4 6 all 0.2142 0.2240 0.2706 0.1990 0.2018 0.2044 0.2159 As we see in Table 3, for the movie category, the average results show that with fine-tuning 2 layers, we have the best performance according to all of the 6 metrics for both RoBERTa-based and XLM-R-based models. Fine-tuning 4 layers is also better than all layers. This may indicate that the models can overfit the training data when fine-tuning more layers than needed, given the task and dataset size. For the cellphone category, fine-tuning 2 layers shows the best performance for the XLM-R-based model. For the RoBERTa-based model, although fine-tuning 4 layers shows the best performance overall, the results are very close to fine-tuning 2 layers. It is noteworthy that we also tested fine-tuning all layers with gradient clipping without any success in improving its result. Thus, according to the results of this comparison, and by considering computational complexity, and to have a fair and consistent comparison between the different models based on pre-trained RoBERTa and XLM-R, we choose to fine-tune 2 layers for both RoBERTa-based and XLM-R-based models as our default setting to investigate our research questions further. Results of Different Methods on All Product Categories: We do three random splitting of data to train, validate and test to have a better estimate of performances based on multiple independent runs and data splits. All the methods are tested on each split set; the metrics' average and standard deviation are computed across the independent runs. The average and standard deviation of all metrics for all methods are included in Table 4. Reviews Helpfulness Prediction 15 Table 4: Results based on 3 runs on different random splits for all 6 metrics and product categories. RoBERTa Add and XLM-R Add are setups with additional features concatenated to review text representation. Numbers in parentheses denote standard deviation. RF 0.6362 0.7753 0.5563 0.2017 0.7676 0.7717 0.7742 0.2108 0.5717 0.7558 0.7545 0.5665 0.2041 0.4610 0.7157 0.4732 0.5873 0.6975 0.4140 0.5937 0.2563 0.1962 0.2021 0.6504 0.7104 Movies Movies Movies Movies XLM-R XLM-R RoBERTa Electronics Electronics Electronics XLM-R Add Category Movies Model RoBERTa Electronics XLM-R Add MAE ↓ RMSE ↓ PCC ↑ SPC ↑ KC ↑ NDCG ↑ 0.1475 0.9737 (0.0009) (0.0014) (0.0036) (0.0032) (0.0028) (0.0003) RoBERTa Add 0.1441 0.1983 0.7864 0.7810 0.5797 0.9752 (0.0007) (0.0013) (0.0025) (0.0020) (0.0016) (0.0000) 0.1564 0.9719 (0.0012) (0.0036) (0.0048) (0.0010) (0.0008) (0.0003) 0.1502 0.9737 (0.0011) (0.0011) (0.0026) (0.0032) (0.0034) (0.0002) 0.2091 0.9603 (0.0017) (0.0017) (0.0017) (0.0018) (0.0012) (0.0001) 0.1338 0.2008 0.9804 (0.0007) (0.0036) (0.0071) (0.0032) (0.0030) (0.0002) Electronics RoBERTa Add 0.1339 0.1944 0.7220 0.6565 0.4774 0.9818 (0.0015) (0.0014) (0.0041) (0.0000) (0.0004) (0.0003) 0.1392 0.9798 (0.0027) (0.0013) (0.0013) (0.0024) (0.0023) (0.0003) 0.9816 0.1345 (0.0030) (0.0028) (0.0092) (0.0093) (0.0078) (0.0005) 0.1781 0.9737 (0.0009) (0.0009) (0.0049) (0.0059) (0.0042) (0.0002) 0.9754 0.1313 (0.0019) (0.0028) (0.0142) (0.0008) (0.0007) (0.0005) 0.9763 (0.0022) (0.0043) (0.0171) (0.0101) (0.0074) (0.0007) 0.1327 0.9750 (0.0030) (0.0022) (0.0132) (0.0030) (0.0023) (0.0005) 0.9767 (0.0021) (0.0023) (0.0127) (0.0100) (0.0078) (0.0006) 0.1477 0.9726 (0.0002) (0.0009) (0.0134) (0.0024) (0.0018) (0.0005) 0.1380 0.9787 (0.0053) (0.0033) (0.0026) (0.0164) (0.0122) (0.0009) Cellphone RoBERTa Add 0.1344 0.1940 0.6330 0.5310 0.3759 0.9810 (0.0048) (0.0037) (0.0047) (0.0059) (0.0031) (0.0006) 0.1429 0.9784 (0.0054) (0.0014) (0.0072) (0.0164) (0.0112) (0.0012) 0.1361 0.9802 (0.0043) (0.0030) (0.0034) (0.0146) (0.0106) (0.0008) 0.9747 0.1633 (0.0012) (0.0026) (0.0072) (0.0114) (0.0078) (0.0012) Beauty Prod RoBERTa Add 0.1314 0.1791 0.5877 0.4626 0.3267 Beauty Prod XLM-R Add 0.1305 0.1824 Beauty Prod RoBERTa Cellphone XLM-R Add Beauty Prod Beauty Prod RoBERTa Cellphone Cellphone Cellphone XLM-R XLM-R 0.5997 0.4375 0.3719 0.6189 0.3595 0.1953 0.5215 0.3690 0.5257 0.2628 0.3801 0.5092 0.6092 0.1998 0.1990 0.5679 0.4486 0.2110 0.6522 0.4737 0.3344 0.3165 0.4372 0.4486 0.1995 0.5316 0.4768 0.1841 0.2366 0.1815 0.3155 0.3050 0.5531 0.3075 0.4134 0.2232 0.5719 RF RF RF 16 Boluki et al. To specify the statistical significance of the differences between methods, we perform head-to-head t-tests between different models based on their 3 runs' re- sults to investigate further whether the differences are significant by considering p-value of 0.05 and include the results in Table 5. Table 5: Statistical significance of head-to-head performance differences for all metrics and product categories. All methods are run and tested on 3 different splits of data. Y denotes that performance differences are significant, and N means not significant based on t-test and considering p-value of 0.05. Category RoBERTa vs XLM-R MAE RMSE PCC SPC KC NDCG Movies Y Electronics N Beauty Prod N N Cellphone Y N Y N N N N N Y N N N RoBERTa vs RoBERTa Add MAE RMSE PCC SPC KC NDCG Y Y N N Y Y N N Category Movies Y Electronics N Beauty Prod N N Cellphone Y N N Y Y Y Y Y Y Y N N N N N N Y Y Y Y Category XLM-R vs XLM-R Add MAE RMSE PCC SPC KC NDCG Movies Y N Y Electronics N Y Beauty Prod N N N RoBERTa Add vs XLM-R Add MAE RMSE PCC SPC KC NDCG Y Y N N N N N N Cellphone Category N N Y N Y N N N Movies Y Electronics N Beauty Prod N N Cellphone Y N N N Y N N N Y N N N Y Y N N Y N N N Category RF vs XLM-R MAE RMSE PCC SPC KC NDCG Movies Y Electronics Y Beauty Prod Y Y Cellphone Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Reviews Helpfulness Prediction 17 For the movies category, we see that the RoBERTa-based model outperforms the XLM-R-based one in all six metrics, and the differences are significant for nearly all metrics. We also observe that both models benefit from additional fea- tures with statistically significant differences. The RoBERTa-based model with additional features performs better than the XLM-R-based model with addi- tional features. Comparing our baseline with XLM-R-based model, which has the worst performance among models based on pre-trained language models, we can see that the XLM-R-based model outperforms the baseline in all metrics, with significant differences. In short, we observe that RoBERTa-based model with additional features has the best performance, and the baseline has the worst performance in all metrics. For the electronics category, the results indicate that the RoBERTa-based model's average metrics are better than the average metrics from the XLM-R- based model. However, metrics differences are not significant. Although addi- tional features help models in this category, the differences are insignificant in most metrics. Comparing the model based on RoBERTa with additional fea- tures with the model based on XLM-R with additional features, we can see that the average metrics are very slightly better for RoBERTa. However, none of the differences is detected as significant. We again see that our baseline has the worst performance by far among all the models we tested. The best and worst performing models are the same as for the movies category. For the beauty product category, we again observe that the RoBERTa-based model has better average metrics than XLM-R-based model. However, only the differences in correlation metrics are detected as significant. Comparing the RoBERTa-based model with and without additional features, it appears that additional features help the model, although only on two metrics are the dif- ferences identified as significant. The same holds for comparing XLM-R-based models with and without additional features. Moreover, four of the six average metrics for the RoBERTa-based model with additional features are better than the XLM-R-based model with additional features. At the same time, only two are detected as significant. We can again see that the baseline is significantly worse than all methods based on pre-trained language models. Overall, the best and worst performing methods for this category are the RoBERTa-based model with additional features and the baseline, respectively. For the cellphone category, while the average metrics are better for the RoBERTa-based model compared to the XLM-R-based model, none of the dif- ferences are detected as significant. Models based on RoBERTa and XLM-R benefit slightly from additional features, especially for RoBERTa, where half the differences are recognized as significant. The RoBERTa-based model with additional features performs slightly better than the XLM-R-based model with additional features, albeit no metrics show as significant. All pre-trained lan- guage model-based methods significantly outperform the baseline. The best and worst performing methods are similar to other product categories. 18 Boluki et al. 6 Discussion This work provides an extensive comparison between models based on mono- lingual and multilingual language models and a robust classical baseline for re- view helpfulness prediction. Its results and analysis give insights into designing new methods for review helpfulness prediction and sorting reviews by employing SOTA language models. To the best of our knowledge, our work is the first to consider models based on pre-trained multilingual language models for review helpfulness prediction. According to the results, we can confidently say that models based on pre- trained language models outperform the baseline that employs handcrafted fea- tures. Although BERT-based models have been shown to perform better than classical models using TF-IDF features [1], our results confirm that methods based on transformer-based language models can outperform more traditional machine learning methods even when using handcrafted features. Additionally, the results suggest that models based on RoBERTa perform slightly better than models based on XLM-R for the review helpfulness task under study. i.e., the performance orders among the results are on par across all categories. But only in one product category the difference is strongly statistically significant. More- over, while previous works have mentioned that pre-trained multilingual models can sometimes perform even better than monolingual models for a specific task and target language [7,5], in this work, which compares for the first time these models for review helpfulness prediction, we do not observe any improvement from XLM-R compared with RoBERTa on reviews in English. One advantage of the pre-trained language models is that they learn com- plex and informative text representations. Our results indeed show that they do not require additional out-of-text features to perform reasonably. Nevertheless, to explore whether additional features can still be beneficial, we add two addi- tional features: the star rating that the person who wrote the review gave to the product, and word count, which is the total number of words in the review. The results from our experiments show that adding the additional features can improve the performance of both RoBERTa and XLM-R-based models in all the metrics. Although the degree of result improvement varies for different prod- uct categories from significant (e.g. movies) to non-significant (e.g. electronics), there is no case where additional features hurt the performance. Moreover, we do not observe any meaningful change in the relative ordering of the models' performances across the different product categories. i.e., general conclusions can be drawn regardless of the product category. This is in line with previous works like [27] and somewhat disagrees with [15]. We only see the significance level of differences changing across product categories. The model based on RoBERTa with additional features shows the best performance among all the investigated models, and our baseline, the random forest, has the worst performance. Reviews Helpfulness Prediction 19 7 Conclusion and Future Work In this work, we extensively analyzed the utility of SOTA open-source pre-trained language models, both monolingual and multilingual, for review helpfulness pre- diction. We observe that these models outperform classical approaches, even when classical methods are strengthened by employing handcrafted features from subscription-based software programs. Our experiments indicate that when the fine-tuning and testing are on reviews from the same language, one may not see any improvement from pre-trained multilingual models over monolingual ones. Furthermore, our results suggest that despite the good performance of models based on pre-trained language models, they can still slightly benefit from in- cluding additional features like the review's star rating. Another observation is that the relative performance of different methods is consistent across different product categories. Identifying the most helpful reviews, even before they have any helpfulness vote, and ranking reviews accordingly for customers is advantageous. It helps customers avoid going through many reviews to gain helpful information and perspectives. This can save customers' time, increase their satisfaction, and help them make informed decisions, resulting in more sales and/or lower return rates, eventually benefiting the marketplace and businesses. Businesses can also easily spot their products' strengths and weaknesses from the customers' perspective. For future work, we suggest employing other pre-trained language models and carrying out tests on more datasets. Also, utilizing a multilingual dataset for predicting online reviews' helpfulness can further showcase the true capabilities of multilingual language models and be helpful in building models for different languages simultaneously. We leave comprehensive multilingual data collection and model design to future research. The code used in this paper is publicly available at https://github.com/ AliBol/DSS-project. The data used in this study is publicly available at http: //jmcauley.ucsd.edu/data/amazon/links.html. References 1. Bilal, M., Almazroi, A.A.: Effectiveness of fine-tuned bert model in classification of helpful and unhelpful online customer reviews. Electronic Commerce Research pp. 1–21 (2022) 2. Boyd, R.L., Ashokkumar, A., Seraj, S., Pennebaker, J.W.: The development and psychometric properties of liwc-22. Austin, TX: University of Texas at Austin (2022) 3. Chen, C., Yang, Y., Zhou, J., Li, X., Bao, F.: Cross-domain review helpfulness prediction based on convolutional neural networks with auxiliary domain discrim- inators. In: Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers). pp. 602–607 (2018) 4. Clark, K., Khandelwal, U., Levy, O., Manning, C.D.: What does BERT look at? an analysis of BERT's attention. In: Proceedings of the 2019 ACL Workshop Black- boxNLP: Analyzing and Interpreting Neural Networks for NLP. pp. 276–286 (2019) 20 Boluki et al. 5. Conneau, A., Khandelwal, K., Goyal, N., Chaudhary, V., Wenzek, G., Guzm ́an, F., Grave, ́E., Ott, M., Zettlemoyer, L., Stoyanov, V.: Unsupervised cross-lingual representation learning at scale. In: Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. pp. 8440–8451 (2020) 6. Diaz, G.O., Ng, V.: Modeling and prediction of online product review helpful- ness: a survey. In: Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). pp. 698–708 (2018) 7. Doddapaneni, S., Ramesh, G., Kunchukuttan, A., Kumar, P., Khapra, language models. arXiv preprint M.M.: A primer on pretrained multilingual arXiv:2107.00676 (2021) 8. Eberhard, O., Zesch, T.: Effects of layer freezing on transferring a speech recogni- tion system to under-resourced languages. In: Proceedings of the 17th Conference on Natural Language Processing (KONVENS 2021). pp. 208–212 (2021) 9. Fan, M., Feng, C., Guo, L., Sun, M., Li, P.: Product-aware helpfulness prediction of online reviews. In: The world wide web conference. pp. 2715–2721 (2019) 10. He, R., McAuley, J.: Ups and downs: Modeling the visual evolution of fashion trends with one-class collaborative filtering. In: proceedings of the 25th interna- tional conference on world wide web. pp. 507–517 (2016) 11. Hong, Y., Lu, J., Yao, J., Zhu, Q., Zhou, G.: What reviews are satisfactory: novel features for automatic helpfulness voting. In: Proceedings of the 35th international ACM SIGIR conference on Research and development in information retrieval. pp. 495–504 (2012) 12. Kenton, J.D.M.W.C., Toutanova, L.K.: BERT: Pre-training of deep bidirectional transformers for language understanding. In: Proceedings of NAACL-HLT. pp. 4171–4186 (2019) 13. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. In: ICLR (2015) 14. Kovaleva, O., Romanov, A., Rogers, A., Rumshisky, A.: Revealing the dark secrets of BERT. In: Proceedings of the 2019 Conference on Empirical Methods in Nat- ural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP). pp. 4365–4374 (2019) 15. Krishnamoorthy, S.: Linguistic features for review helpfulness prediction. Expert Systems with Applications 42(7), 3751–3759 (2015) 16. Lee, J., Tang, R., Lin, J.: What would Elsa do? Freezing layers during transformer fine-tuning. arXiv preprint arXiv:1911.03090 (2019) 17. Liu, H., Gao, Y., Lv, P., Li, M., Geng, S., Li, M., Wang, H.: Using argument-based features to predict and analyse review helpfulness. In: Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing. pp. 1358–1363 (2017) 18. Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., Stoyanov, V.: RoBERTa: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692 (2019) 19. Lu, Y., Tsaparas, P., Ntoulas, A., Polanyi, L.: Exploiting social context for review quality prediction. In: Proceedings of the 19th international conference on World wide web. pp. 691–700 (2010) 20. Malik, M., Hussain, A.: Helpfulness of product reviews as a function of discrete positive and negative emotions. Computers in Human Behavior 73, 290–302 (2017) 21. Martin, L., Pu, P.: Prediction of helpful reviews using emotions extraction. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 28 (2014) Reviews Helpfulness Prediction 21 22. Moghaddam, S., Jamali, M., Ester, M.: Etf: extended tensor factorization model for personalizing prediction of review helpfulness. In: Proceedings of the fifth ACM international conference on Web search and data mining. pp. 163–172 (2012) 23. Mukherjee, S., Popat, K., Weikum, G.: Exploring latent semantic factors to find useful product reviews. In: Proceedings of the 2017 SIAM international conference on data mining. pp. 480–488. SIAM (2017) 24. O'Mahony, M.P., Smyth, B.: Learning to recommend helpful hotel reviews. In: Proceedings of the third ACM conference on Recommender systems. pp. 305–308 (2009) 25. Park, Y.J.: Predicting the helpfulness of online customer reviews across different product types. Sustainability 10(6), 1735 (2018) 26. Pennebaker, J.W., Booth, R., Francis, M.E.: Linguistic inquiry and word count (liwc2007) (2007) 27. Singh, J.P., Irani, S., Rana, N.P., Dwivedi, Y.K., Saumya, S., Roy, P.K.: Predicting the "helpfulness" of online consumer reviews. Journal of Business Research 70, 346–355 (2017) 28. Stone, P.J., Bales, R.F., Namenwirth, J.Z., Ogilvie, D.M.: The general inquirer: A computer system for content analysis and retrieval based on the sentence as a unit of information. Behavioral Science 7(4), 484 (1962) 29. Sun, X., Han, M., Feng, J.: Helpfulness of online reviews: Examining review infor- mativeness and classification thresholds by search products and experience prod- ucts. Decision Support Systems 124, 113099 (2019) 30. Tang, J., Gao, H., Hu, X., Liu, H.: Context-aware review helpfulness rating predic- tion. In: Proceedings of the 7th ACM Conference on Recommender Systems. pp. 1–8 (2013) 31. Tsai, C.F., Chen, K., Hu, Y.H., Chen, W.K.: Improving text summarization of online hotel reviews with review helpfulness and sentiment. Tourism Management 80, 104122 (2020) 32. Tsur, O., Rappoport, A.: Revrank: A fully unsupervised algorithm for selecting the most helpful book reviews. In: Proceedings of the International AAAI Conference on Web and Social Media. vol. 3, pp. 154–161 (2009) 33. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, (cid:32)L., Polosukhin, I.: Attention is all you need. Advances in neural information pro- cessing systems 30 (2017) 34. Wan, Y.: The matthew effect in social commerce. Electronic Markets 25(4), 313– 324 (2015) 35. Wenzek, G., Lachaux, M.A., Conneau, A., Chaudhary, V., Guzm ́an, F., Joulin, A., Grave, E.: CCNet: Extracting high quality monolingual datasets from web crawl data. In: Proceedings of the Twelfth Language Resources and Evaluation Conference. pp. 4003–4012. European Language Resources Association, Marseille, France (May 2020), https://aclanthology.org/2020.lrec-1.494 36. Xiong, W., Litman, D.: Automatically predicting peer-review helpfulness. In: Pro- ceedings of the 49th Annual Meeting of the Association for Computational Lin- guistics: Human Language Technologies. pp. 502–507 (2011) 37. Yang, Y., Yan, Y., Qiu, M., Bao, F.: Semantic analysis and helpfulness prediction of text for online product reviews. In: Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 2: Short Papers). pp. 38–44 (2015) 38. Zeiler, M.D., Fergus, R.: Visualizing and understanding convolutional networks. In: European conference on computer vision. pp. 818–833. Springer (2014)
http://arxiv.org/abs/2302.09639v1
2023-02-19T18:03:53
2023-02-19T18:03:53
An overview of differentiable particle filters for data-adaptive sequential Bayesian inference
By approximating posterior distributions with weighted samples, particle filters (PFs) provide an efficient mechanism for solving non-linear sequential state estimation problems. While the effectiveness of particle filters has been recognised in various applications, the performance of particle filters relies on the knowledge of dynamic models and measurement models, and the construction of effective proposal distributions. An emerging trend in designing particle filters is the differentiable particle filters (DPFs). By constructing particle filters' components through neural networks and optimising them by gradient descent, differentiable particle filters are a promising computational tool to perform inference for sequence data in complex high-dimensional tasks such as vision-based robot localisation. In this paper, we provide a review of recent advances in differentiable particle filters and their applications. We place special emphasis on different design choices of key components of differentiable particle filters, including dynamic models, measurement models, proposal distributions, optimisation objectives, and differentiable resampling techniques.
[ "Xiongjie Chen", "Yunpeng Li" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09639v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09639v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "Primary: 62M20, 62M45, 62M05" ]
3 2 0 2 b e F 9 1 ] G L . s c [ 1 v 9 3 6 9 0 . 2 0 3 2 : v i X r a Manuscript submitted to AIMS Journal doi:10.3934/xx.xxxxxxx AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS FOR DATA-ADAPTIVE SEQUENTIAL BAYESIAN INFERENCE Xiongjie Chen(cid:0)∗1 and Yunpeng Li(cid:0)1 1University of Surrey, United Kingdom Abstract. By approximating posterior distributions with weighted samples, particle filters (PFs) provide an efficient mechanism for solving non-linear se- quential state estimation problems. While the effectiveness of particle filters has been recognised in various applications, the performance of particle filters relies on the knowledge of dynamic models and measurement models, and the construction of effective proposal distributions. An emerging trend in design- ing particle filters is the differentiable particle filters (DPFs). By constructing particle filters' components through neural networks and optimising them by gradient descent, differentiable particle filters are a promising computational tool to perform inference for sequence data in complex high-dimensional tasks such as vision-based robot localisation. In this paper, we provide a review of recent advances in differentiable particle filters and their applications. We place special emphasis on different design choices of key components of dif- ferentiable particle filters, including dynamic models, measurement models, proposal distributions, optimisation objectives, and differentiable resampling techniques. 1. Introduction. In many signal processing and control problems, we are often interested in inferring posterior distributions of latent variables that cannot be di- rectly observed but manifest themselves by an observation process conditioned on the unobserved variables. The posterior distribution of latent variables is defined by two elements of the interested system, a prior distribution on the unobserved variables, and a likelihood function that describes the relationship between latent variables and observations. When both latent variables and observations are se- quence data, the task described above is known as the Bayesian filtering problem, where one needs to update the posterior distribution of latent variables recursively. In simple systems such as linear-Gaussian state-space models, the evolving poste- rior distribution can be derived exactly with analytical expressions using Kalman filters [1]. However, in real-world problems, we often need to cope with non-linear and non-Gaussian systems, where posterior distributions are not available analyti- cally because they involve the computation of intractable high-dimensional integrals. As a result, many approximation-based approaches such as the extended Kalman filter [2, 3], the unscented Kalman filter [4], and grid-based filters [5] have been proposed. In spite of that, they often perform poorly in high-dimensional, highly non-linear cases [6]. 2020 Mathematics Subject Classification. Primary: 62M20, 62M45, 62M05. Key words and phrases. Sequential Monte Carlo, differentiable particle filters, parameter esti- mation, machine learning. ∗Corresponding author: Xiongjie Chen. 1 2 XIONGJIE CHEN AND YUNPENG LI One popular alternative solution to the above problem is particle filters, also known as sequential Monte Carlo (SMC) methods [7, 8]. In particle filters, target posterior distributions are recursively approximated by a sequence of empirical dis- tributions associated with a set of particles, i.e. weighted samples. Particle filters do not assume linearity or Gaussianity on the considered state-space model, and con- vergence results on particle filtering methods have been established [9, 10, 11, 12, 13]. Due to the above favourable properties, a variety of particle filtering methods have been developed following the seminal work on the bootstrap particle filter (BPF) introduced in [14]. Examples include auxiliary particle filters (APFs) [15, 16, 17] to guide particles into higher density regions. The Gaussian sum particle filters (GSPFs) [18, 19, 20] approximate posterior distributions with Gaussian mixture models by building banks of Gaussian particle filters. The unscented particle filters (UPFs) [21, 22, 23] incorporate the latest observations in the construction of pro- posal distributions generated by unscented Kalman filters (UKFs). Several other variants of particle filters, including Rao-Blackwellised particle filters [24, 25], mul- tiple particle filters [26, 27], particle flow particle filters [28, 29], have been designed for more efficient sampling in high-dimensional spaces. Although these variants of particle filters have shown to be effective in many applications [30, 31, 32, 33, 34, 35], practitioners often have to design hand-crafted transition kernels of latent states and likelihood functions of observations conditioned on the states, which is often time-consuming and relies on extensive domain knowledge. To meet this challenge, various techniques have been proposed for parameter estimation in state-space models and particle filters [36, 37]. The particle Markov chain Monte Carlo (PMCMC) method and its variants provide a mechanism to per- form parameter estimation for sequential Monte Carlo methods using Markov chain Monte Carlo (MCMC) sampling [38, 39]. The SMC2 algorithm [40] is a particle equivalent of the PMCMC method, which simultaneously tracks the posterior of model parameters and latent variables using two layers of particle filters. Based on a similar nested hybrid filtering framework as in the SMC2 algorithm, a series of nested particle filters was proposed within a purely recursive structure and thus is more suitable for performing Bayesian inference in on-line settings [41, 42, 43]. In [44, 45], the transition matrix in linear-Gaussian state-space models was inter- preted as a directed graph, and a GraphEM method based on the expectation- maximisation (EM) algorithm was proposed to learn the directed graph. An emerging trend in this active research area is to construct and learn compo- nents of particle filters using machine learning techniques, such as neural networks and gradient descent. Such particle filters are often called differentiable particle filters (DPFs) [46, 47, 48, 49, 50, 51]. In particular, differentiable particle filters construct their dynamic models, measurement models, and proposal distributions using expressive neural networks that can model complex high-dimensional non- linear non-Gaussian systems. One main obstacle to develop fully-differentiable par- ticle filters is the resampling step, which is known to be non-differentiable. To this end, different differentiable particle filters have proposed various resampling strategies to cope with this issue, e.g. no resampling [46], soft resampling [47], entropy-regularised optimal transport resampling [51], and transformer-based re- sampling [52]. Another key ingredient to develop data-adaptive particle filters is a loss function, which is minimised using gradient descent to optimise parameters of neural networks used in the construction of differentiable particle filters. AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 3 Despite the surging interest in differentiable particle filters, as far as we know, there is an absence of a comprehensive review of recent advances in this field. There- fore, the main objective in this paper is to provide an overview of the design of differentiable particle filters. We place special emphasis on different design choices of key ingredients in differentiable particle filters, which aim to answer the following questions: • How to describe the transition of latent states in state-space models with neural networks? • How to estimate the likelihood of observations given states using neural net- works? • How can we propose better particles that are close to posterior distributions in complex environments? • What kind of loss functions should we use when training differentiable particle filters? • How to select resampling scheme for differentiable particle filters? The remainder of this paper is organised as follows. In Section 2, we provide necessary background knowledge for introducing differentiable particle filters. In Section 3, we detail different design choices of sampling distributions of latent states in differentiable particle filters, i.e. their dynamic models and proposal distributions. Section 4 discusses the construction of differentiable particle filters' measurement models. In Section 5 we list examples of resampling schemes used in differentiable particle filters. Loss functions used for optimising differentiable particle filters are introduced in Section 6. We conclude the paper in Section 7. 2. Preliminaries. 2.1. State-Space Models. In this section we detail the problem we consider in this paper, including a brief introduction to state-space models and the general goal of Bayesian filtering approaches. State-space models (SSMs) refer to a class of sequential models that consist of two discrete-time variables, the latent state variable (xt)t≥0 defined on X ⊆ RdX , and the observed measurement variable (yt)t≥0 defined on Y ⊆ RdY . The latent state (xt)t≥0 is characterised by a Markov process with an initial distribution π(x0) and a transition kernel p(xt|xt−1) for t ≥ 1. The observation yt is conditionally inde- pendent given the current latent state xt. In this review, we focus on parameterised state-space models defined as follows: x0 ∼ π(x0; θ) , xt|xt−1 ∼ p(xt|xt−1; θ) for t ≥ 1 , yt|xt ∼ p(yt|xt; θ) for t ≥ 0 , (1) (2) (3) where θ ∈ Rdθ is the parameter set of interest, π(x0 ; θ) is the initial distribution of the latent state, p(xt|xt−1; θ) is the dynamic model that describes the transition of the latent state, and p(yt|xt; θ) is the measurement model estimating the condi- tional likelihood of observation yt given xt. Denote by x0:t := {x0, * * * , xt} and y0:t := {y0, * * * , yt} respectively the sequence of latent states and the sequence of observations up to time step t, the above parameterised state-space model can also 4 XIONGJIE CHEN AND YUNPENG LI be defined through the following joint distribution of x0:t and y0:t: p (x0:t, y0:t; θ) = π (x0; θ) p (y0|x0; θ) t (cid:89) k=1 p (xk|xk−1; θ) p (yk|xk; θ) . (4) With the state-space model defined above, our goal is to estimate the joint pos- terior distribution p (x0:t|y0:t; θ), the marginal posterior distribution p (xt|y0:t; θ), or (cid:2)ψt(x0:t)(cid:3), the expectation of a function ψt(*) : X t+1 → Rdψt w.r.t the Ep(x0:t|y0:t;θ) joint posterior distribution. We shall use the joint posterior as an example in the following contents, other quantities of interest can be derived similarly. At the t-th time step, given observations y0:t, the posterior of x0:t can be written as follows: p (x0:t|y0:t; θ) = p (x0:t, y0:t; θ) p(y0:t; θ) = p (x0:t, y0:t; θ) X t+1 p(x0:t, y0:t; θ)dx0:t (cid:82) . (5) (6) In addition to Eq. (5), which directly computes the joint posterior by applying Bayes' theorem, the joint posterior p (x0:t|y0:t; θ) can also be obtained through the following recursion: p(x0|y0; θ) = π(x0; θ)p(y0|x0; θ) p(y0; θ) , p(x0:t|y0:t−1; θ) = p(x0:t−1|y0:t−1; θ)p(xt|xt−1; θ) , t ≥ 1 , p(x0:t|y0:t; θ) = p(yt|xt; θ)p(x0:t|y0:t−1; θ) p(yt|y0:t−1; θ) (7) (8) (9) = p(x0:t−1|y0:t−1; θ) p(yt|xt; θ)p(xt|xt−1; θ) p(yt|y0:t−1; θ) , t ≥ 1 . (10) Similarly, the log evidence Lt(θ) := log p(y0:t; θ) can also be computed recursively: lt(θ) = log (cid:90) X t+1 p(yt|xt; θ)p(x0:t|y0:t−1; θ)dx0:t , Lt(θ) = t (cid:88) k=0 lt(θ) , (11) (12) with L0(θ) = l0(θ) = log (cid:82) X p(y0|x0; θ)π(x0; θ)dx0. However, except for only a lim- ited class of state-space models such as linear-Gaussian models, analytical solutions for the log-likelihood log p(y0:t; θ) and the posterior distribution p(x0:t|y0:t; θ) are usually intractable since they involve the computation of complex high-dimensional integrals over X t+1. As an alternative, particle filters resort to approximating the posterior distribution using weighted samples. We present more details about par- ticle filters in the next section. 2.2. Particle Filters. Particle filters (PFs), also known as sequential Monte Carlo (SMC) methods, are a family of Monte Carlo algorithms designed for performing sequential estimation of latent variables in state-space models [6]. In particular, par- ticle filters approximate the intractable joint posterior with empirical distributions AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 5 consisting of sets of weighted samples {wi t, xi 0:t}i∈[Np]: p(x0:t|y0:t; θ) ≈ Np (cid:88) i=1 wi t δxi 0:t (x0:t) , (13) 0:t, and wi t ≥ 0 with (cid:80)Np where [Np] := {1, * * * , Np}, Np is the number of particles, δxi (*) denotes the Dirac delta function located in xi t = 1 is the normalised importance weight of the i-th particle at the t-th time step. By representing the intractable posterior distributions of latent variables with sets of weighted samples, particle filters can provide efficient and asymptotically unbiased estimates of the posterior distributions, i.e. they are able to approximate the posterior distributions arbitrarily well under weak assumptions when the number of particles Np → +∞ [9, 10, 11, 12, 13]. i=1 wi 0:t As an importance sampling-based algorithm [53, 54, 55, 56], the performance of particle filters highly relies on the distribution where particles are sampled from, which is often called the proposal distribution. An ideal proposal distribution should admit efficient sampling of particles and induce tractable importance weights. In bootstrap particle filters (BPFs), the proposal distribution is simply the system dynamic p(xt|xt−1; θ) [14]. Denote by wi t unnormalised importance weights of par- ticles, in bootstrap particle filters, wi t are updated according to the likelihood of observation yt given state xi t: wi t = wi t−1p(yt|xi t; θ) , (14) 0 = p(y0|xi with wi 0; θ). An obvious drawback of bootstrap particle filters is that sampling from the system dynamic p(xt|xt−1; θ) can often result in trivially small weights for the majority of particles, especially when dealing with long sequences. This is known as the weight degeneracy problem, where the Monte Carlo approxi- mation of the posterior is dominated by only a few particles with large weights [57]. Weight degeneracy leads to poor estimates of posteriors, and most of the computa- tional cost will be wasted on particles with negligible weights. Therefore, in general settings, information from latest observations is usually utilised in the construction of proposal distributions, which give rises to guided particle filters (GPFs) [58]. Compared to bootstrap particle filters, one advantage of guided particle filters is that proposed samples are closer to the true posterior and thus their importance weights are more uniformly distributed. Denote proposal distributions by q(x0|y0; φ) when t = 0 and q(xt|yt, xt−1; φ) for t ≥ 1, the unnormalised importance weight of the i-th particle is updated recursively through: wi t = wi t−1 p(yt|xi q(xi t; θ)p(xi t|yt, xi t|xi t−1; φ) t−1; θ) , (15) with wi 0 = p(y0|xi q(xi 0;θ)π(xi 0|y0;φ) 0;θ) . However, even with the information from observations, the weight degeneracy problem is still a tricky issue since the dimension of the joint posterior p(x0:t|y0:t; θ) increases as time evolves. Therefore, as a critical step of particle filters, particle resampling [14] is introduced to remedy this weight degeneracy issue. It has been proved in the literature, both empirically and theoretically, that resampling steps play a crucial role in avoiding the particle degeneracy problem and stabilise the Monte Carlo error over time [59, 60]. There are different choices of resampling 6 XIONGJIE CHEN AND YUNPENG LI Algorithm 1: A generic particle filtering algorithm 1: Require: A state-space model, resampling threshold ESSmin, particle number Np, proposal distributions q(x0|y0; φ) and q(xt|yt, xt−1; φ), a resampling scheme R({wi t}i∈[Np]) that outputs indices Ai t of selected particles; 0}i∈[Np]) = (cid:80)Np 1 i=1(wi 0)2 ; 2: Initialisation: Sample xi 0 3: Compute weights wi i.i.d∼ q(x0|y0; φ) for ∀i ∈ [Np]; 0 = p(y0|xi 0 = wi 0;θ)π(xi 0|y0;φ) n=1 wn q(xi 0/(cid:80)Np 0;θ) for ∀i ∈ [Np]; 0 for ∀i ∈ [Np]; 9: (cid:80)Np t−1}i∈[Np]) < ESSmin then 4: Normalise weights wi 5: L0(θ) = 1 i=1 wi 0; N 6: Compute the effective sample size: ESS0({wi 7: for t = 1 to T do if ESSt({wi 8: A1:Np ̃wi else Ai ̃wi end if Sample xi t t ← R({wi t−1 ← 1 for ∀i ∈ [Np]; t ← i for ∀i ∈ [Np]; t−1 ← wi t−1 for ∀i ∈ [Np]; t−1}i∈[Np]); t 10: 11: 12: 13: 14: 15: i.i.d∼ q(xt|yt, xAi t;θ)p(xi p(yt|xi t|x Ai t t−1;φ) t|yt,x q(xi t−1; φ) for ∀i ∈ [Np]; Ai t t−1;θ) ; wi t = ̃wi t−1 (optional) Compute Lt(θ) := log p(y0:t; θ): 16: 17: 18: 19: 20: end for lt(θ) = log (cid:80)Np i=1 wi i=1 ̃wi t (cid:80)Np t−1 , Lt(θ) = Lt−1(θ) + lt(θ); Normalise weights wi Compute the effective sample size: ESS({wi n=1 wn t = wi t for ∀i ∈ [Np]; t/(cid:80)Np t}i∈[Np]) = (cid:80)Np 1 i=1(wi t)2 ; schemes, including multinomial resampling, residual resampling, stratified resam- pling, and systematic resampling. More details can be found in [61, 62]. Usually, resampling is triggered when a pre-defined condition is met. One commonly used threshold metric for resampling is the effective sample size (ESS): (cid:16)(cid:8)wi (16) = (cid:17) (cid:9) ESSt t i∈[Np] 1 (cid:0)wi t (cid:1)2 . (cid:80)Np i=1 When using the effective sample size as the threshold metric, resampling steps are triggered only when ESSt ≤ ESSmin, where ESSmin refers to a predefined minimum effective sample size. While the performance of particle filters is not sensitive to the value of ESSmin, one often sets ESSmin = Np 2 . A generic particle filter algorithm is provided in Algorithm 1. 2.3. Differentiable Particle Filters. While parameter estimation techniques for particle filters have long been an active research area [31, 63, 64], many existing approaches are restricted to scenarios where a subset of model parameters is known or the model has to follow certain structures [37]. Recently, an emerging trend in this direction is the so-called differentiable particle filters (DPFs) [46, 47, 48, 51, 52, 65, 66]. The main idea of differentiable particle filters is to develop data-adaptive AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 7 particle filters by constructing particle filters' components through neural networks, and optimise them by minimising a loss function through gradient descent. With the expressiveness of neural networks, differentiable particle filters have shown their effectiveness in complicated applications, e.g. vision-based robot localisation, where the observation can be high-dimensional unstructured data like images [46, 47, 48, 51]. We provide in the remainder of this section an introduction of key components in differentiable particle filters, before we delve into more detailed discussions in the following sections. In differentiable particle filters, given a latent state value at the (t − 1)-th time step, a prediction of the latent state at the t-th time step is generated as follows [46]: t−1, αi t = gθ(xi xi t) ∼ p(xt|xi (17) t ∈ Rdα simulates the process noise, gθ(*) : X ×Rdα → X is a function that is where αi differentiable w.r.t to both xi t. Regarding the measurement model, several differentiable particle filters estimate the conditional likelihood of an observation yt given xi t as follows [46, 47, 48, 51]: t−1 and αi t−1; θ) , p(yt|xi t; θ) ∝ lθ(yt, xi (18) where lθ(*) : Y × X → R is, again, a function that is differentiable w.r.t both yt and xi In addition, proposal distributions can be specified through a parameterised t. function fφ(*) : X × Y × Rdβ → X [49]: t−1, yt, βi xi t = fφ(xi t) ∼ q(xi t−1; φ) , t|yt, xi (19) t) , where βi t ∈ Rdβ is the noise term used to generate proposal particles. In order to build a fully differentiable particle filtering framework, we need to ensure that the whole structure of particle filters is differentiable. However, nei- ther sampling from proposal distributions nor resampling particles with multino- mial distributions parameterised by particle weights are differentiable w.r.t their distribution parameters. Specifically, for the sampling step, it is not differentiable because there is no explicit dependency between the sampling output (particles) and distribution parameters. Different strategies have been proposed to achieve differentiable sampling. A common way to achieve differentiable sampling is to use the reparameterisation trick [67]. In particular, in the reparameterisation trick sampling outputs, i.e. samples from the target distribution, are rewritten as a differ- entiable function of samples from a designed base distribution, where the function is parameterised by parameters of the target distribution. With this reformulation, gradients of sampling outputs w.r.t target distribution parameters can be directly computed. Gradient estimators obtained by using the reparameterisation trick are shown to be unbiased [67]. Not all distributions are reparameterisable, some ex- amples of reparameterisable distributions, e.g. Gaussian distributions, are listed in [67]. As for the resampling step, it is inherently non-differentiable because of the discrete nature of multinomial resampling. Specifically, when using the inverse cumulative distribution function (CDF) algorithm to resample particles according to importance weights of particles, a small change in weights can lead to discrete changes in the resampling output. Recent efforts in differentiable particle filters have proposed various solutions to cope with this issue [46, 47, 51, 52, 66]. Sev- eral variants of differentiable particle filters bypass resampling steps in gradient computation or simply do not use resampling at all [46, 47]. [46] proposed to avoid backpropagating gradients across time steps, and the whole sequence is decomposed 8 XIONGJIE CHEN AND YUNPENG LI into multiple independent steps by truncating backpropagation after every single time step. [47] suggested to use the same particles as the resampling output, i.e. no resampling, and this strategy was found to be effective in low uncertainty environ- ment. In standard resampling steps, the weights of survived particles ̃wi t are set to be a constant, implying the gradient ∂ ̃wi is always zero. To prevent this, there exist t ∂wi t a class of resampling schemes used in differentiable particle filters focusing on gener- ating non-zero values for the gradient ∂ ̃wi . [66] proposed to keep the sum of weights t ∂wi t (cid:80)Np after resampling the same as before resampling: ̃wi gradient ∂ ̃wi becomes non-zero. However, this resampling technique still yields t ∂wj t zero gradients when using loss functions that do not involve unnormalised weights {wj j=1. In [47], a soft resampling approach is introduced to obtain non-zero gra- dients for ∂ ̃wi . The soft resampler resamples particles from a multinomial distri- t ∂wi t t , * * * , ̃wNp bution Mult( ̃w1 multinomial distribution Mult(w1 uniform weights Mult( 1 , * * * , 1 Np Np ) designed as a linear interpolation between the original ) and a multinomial distribution with t = refers to the normalised t , * * * , wNp ), where wi t , such that the t = 1 Np j=1 wj t }Np t t wi t (cid:80)Np j=1 wj t importance weights, and ̃wi t is computed as ̃wi t = λwi t + (1 − λ) 1 Np , (20) t ̃wi t t ∂wi t t = wi is non-zero. t are corrected by . This implies that t for a selected particle depends on the corresponding weight with λ a hyperparameter. Biases brought by resampling from ̃wi updating the unnormalised weights after resampling as ̃wi the updated weight ̃wi t before resampling, hence ∂ ̃wi wi However, the above resampling techniques do not lead to fully differentiable re- sampling because they still rely on multinomial resampling, which is inherently non-differentiable as explained above. One solution to fully differentiable parti- cle resampling is to consider it as an optimal transport (OT) problem [68]. Par- ticularly, [51] proposed an entropy-regularised optimal transport-based resampler. This OT-based resampler reformulates non-differentiable resampling steps as deter- ministic and differentiable operations by solving the optimal transport problem in resampling steps with the Sinkhorn algorithm [69, 70, 71]. It leads to an asymp- totically consistent differentiable estimator of observation log-likelihoods, but it is biased due to the introduced non-zero regularisation term. A particle transformer was introduced in [52] based on a set transformer architecture [72, 73]. The particle transformer is permutation invariant and scale equivariant by design. The output of the particle transformer is a set of new equally-weighted particles, and it is trained by maximising the likelihood of particles before resampling in a Gaussian mixture distribution consisting of Gaussian distributions with new particles as their means. However, a particle transformer trained on one task does not adapt to other tasks, implying that one needs to train a new particle transformer from scratch each time there is a new task. There are different strategies to train differentiable particle filters, which can be classified as end-to-end training and those that involve individual training. In [46, 47, 48, 74, 75, 76], differentiable particle filters are trained in an end- to-end manner where all components of differentiable particle filters are jointly AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 9 In contrast, trained by minimising an overall loss function via gradient descent. in [46, 77, 78, 79], it was proposed to first perform pre-training for independent modules of differentiable particle filters, then fine-tune these models jointly towards a task-specific target. To optimise differentiable particle filters' parameters via gradient descent, a loss function or a training objective is needed. There are two major classes of loss func- tions that are often employed in training differentiable particle filters. The first class is the likelihood-based loss functions. In [80, 81, 82], an evidence lower bound (ELBO) of observation log-likelihood was derived for particle filters. The particle filter-based ELBO is a surrogate objective to the marginal log-likelihood and can be used to learn both model and proposal parameters [51, 81]. Besides, [48] proposed a pseudo-likelihood loss to enable semi-supervised learning for differentiable particle filters when part of the ground-truth states is not provided. Another type of loss functions involves task-specific objectives. For example, in [46, 47, 48, 51, 74], dif- ferentiable particle filters are used in visual robot localisation tasks so the prediction error between estimates and the ground-truth states (RMSE or the log density of ground-truth states) are included in their loss functions. In [76], the state space is discretised and Gaussian blur is applied to the ground-truth states in order to minimise the KL divergence between the ground-truth posteriors and the parti- cle estimate of posteriors. In [83], differentiable particle filters are used to guide the sampling process of the individualisation and refinement (IR) in graph neural networks (GNN), and the differentiable particle filters are learned by minimising the expected colouring error. A discriminative particle filter reinforcement learn- ing (DPFRL) method was proposed in [75], where a differentiable particle filter is jointly trained end-to-end with a value network and a policy network by minimising a task-specific reinforcement learning loss. It was reported in [74] that combining task-specific loss with negative log-likelihood loss gives the best empirical perfor- mance in numerical simulations. Having described the overall structure and design choices of differentiable par- ticle filters, we then provide more detailed discussions on the key components of differentiable particle filters in the following sections. 3. Sampling Distributions of Differentiable Particle Filters. In particle fil- ters, sampling distributions are the distributions which particles are generated from. The sampling distribution can be identical to the dynamic model p(xt|xt−1; θ) (boot- strap particle filters), or designed as a proposal distribution q(xt|yt, xt−1; φ) (guided particle filters) conditioned on both the state xt−1 and the observation yt. The con- struction of sampling distributions that are easy to sample from, close to posterior distributions, and admit efficient weight update steps is one of the key challenges in designing particle filters. We summarise below different design choices of sampling distributions in differentiable particle filters. 3.1. Gaussian dynamic models. In several differentiable particle filter approaches [46, 47, 48, 50, 51, 52, 65, 76, 79], the transition of latent states from xt−1 to xt is mod- elled by a deterministic function gθ(*) : X × RdX → X with the last state xt−1 and a Gaussian noise αt as inputs and new states xt as outputs. We name this type of dynamic models as Gaussian dynamic models. Generally speaking, Gaussian dynamic models used in differentiable particle filters can be described as follows: t ∼ N (μθ(xi xi t−1), ΣdX ) , (21) 10 XIONGJIE CHEN AND YUNPENG LI t = gθ(xi xi t−1, αi t) = μθ(xi t−1) + αi t , (22) t ∼ N (0, ΣdX ), and μθ(*) : X → RdX is a differentiable function of xi where αi t−1 [46, 47, 48, 51, 65]. The covariance matrix ΣdX can be either designed manually [46, 47, 48, 51] or parameterised and learned from data [65]. For data-adaptive covariance matrix ΣdX , [65] proposed two different ways to learn the covariance matrix ΣdX , the constant noise model and the heteroscedastic noise model. In constant noise models, the covariance matrix ΣdX = diag(σ2 ) is a diagonal matrix and keeps the same among different time steps. The diagonal elements (σ2 1, * * * , σ2 ) dX of the covariance matrix ΣdX are set as learnable parameters and updated using gradient descent. For heteroscedastic noise models, the covariance matrix ΣdX is also a diagonal matrix, but it is predicted according to state values in heteroscedastic noise models. Specifically, for the transition from time step t − 1 to time step t, a covariance matrix is computed for each particle: 1, * * * , σ2 dX (σi 1, * * * , σi ) = γθ(xi dX (cid:16) t−1) , 1)2, * * * , (σi dX t−1) = diag (σi ΣdX (xi )2(cid:17) , (23) (24) where γθ(*) : X → RdX is a neural network. The noise term αi N (0, ΣdX ), where the covariance matrix ΣdX = (cid:80)Np the weighted sum of individual covariance matrices ΣdX (xi malised importance weight of xi changes across time steps and hence the name heteroscedastic noise models. t is sampled from t−1) is computed as t the nor- t−1. Within this setup, the covariance matrix ΣdX t−1), with wi tΣdX (xi i=1 wi Although here we only introduced Gaussian dynamic models with additive Gauss- ian noise which are most commonly used in differentiable particle filters [46, 47, 48, 51, 65], one can also use multiplicative Gaussian noise and other reparameterisable distributions depending on applications [67, 80]. 3.2. Dynamic models constructed with normalising flows. One limitation of Gaussian dynamic models is their inability to adapt to complex systems where the latent state evolves according to complicated non-Gaussian dynamics. Moti- vated by this, [49] proposes to construct dynamic models in differentiable particle filters using normalising flows. Normalising flows are a family of invertible trans- formations that provides a general mechanism for constructing complex probability distributions [84]. By applying a series of invertible mappings on samples drawn from simple distributions, e.g. uniform or Gaussian distributions, normalising flows are able to transform simple distributions into arbitrarily complex distributions un- der some mild conditions [84]. In particular, [49] builds flexible dynamic models p(xt|xt−1; θ) upon base dynamic models ̃p( ̃xt|xt−1; θ), e.g. Gaussian dynamic mod- els. Denote by { ̃xi i=1 a set of particles sampled from ̃p( ̃xt|xt−1; θ), in [49] the particles ̃xi t, i ∈ {1, * * * , Np}, are transformed by a normalising flow Tθ(*) : X → X as follows: t}Np t = Tθ( ̃xi xi and the probability density function p(xt|xi through the change of variable formula: t) ∼ p(xt|xi t−1; θ) , where ̃xi t ∼ ̃p( ̃xt|xi t−1; θ) , (25) t−1; θ) evaluated at xi t can be computed p(xi t|xi t−1; θ) = ̃p( ̃xi t|xi t−1; θ) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) det JTθ ( ̃xi t) (cid:12) , where ̃xi t = T −1 θ (xi t) ∼ ̃p( ̃xt|xi t−1; θ) . (26) AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 11 t) refers to the determinant of the Jacobian matrix JTθ ( ̃xi t) = ∂Tθ( ̃xi t) ∂ ̃xi t det JTθ ( ̃xi evaluated at ̃xi t. Because normalising flows can model complex non-Gaussian distributions, dy- namic models constructed with normalising flows are theoretically more flexible than Gaussian dynamic models and require less prior knowledge of the system. In addition, experimental results reported in [49] provided empirical evidence that using normalising flows-based dynamic models in differentiable particle filters can produce better object tracking performance than using Gaussian dynamic models. 3.3. Dynamic models built with observations. In several differentiable parti- cle filtering approaches, dynamic models are constructed as p(xt|y0:t, xt−1; θ) and used to generate new particles [74, 77], which do not fit into the assumptions in state-space models we consider. Nonetheless, this strategy has been successfully applied in a wide range of applications including robot localisation and sequence prediction tasks [74, 77]. For instance, the dynamic model of the differentiable par- ticle filter proposed in [77] employs a neural network to model the displacement of robots. The neural network takes observation images (yt−1, yt) as its inputs, and outputs the mean and the variance of a Gaussian distribution that models the dis- tribution of the robot's displacement. New particles {xi i=1 are obtained by adding t−1}Np Gaussian noise drawn from the learned normal distribution to {xi i=1. A similar dynamic model is used in [75] to assist the training of a reinforcement learning al- gorithm. In [74], recurrent neural networks (RNNs) are used to construct dynamic models in differentiable particle filters. Specifically, [74] proposes to update the latent state using LSTM networks [85] or GRU networks [86], hence the name par- ticle filter recurrent neural networks (PFRNNs). In the PFRNN method, particles at the t-th time step are generated through xi t is sampled from a Gaussian distribution with learnable mean and variance, which are output by a function of xi t−1 and yt. Note that the latent state xt in the PFRNN is not necessarily the state of direct interest. In experiments reported in [74], the actual state of interest is predicted by a function of the weighted average of particles ̄xt = (cid:80)Np t = RNNθ(xi t), where βi t−1, yt, βi t}Np i wi txi t. 3.4. Proposal distributions. As far as we know, the majority of existing differ- entiable particle filter approaches are restricted to the bootstrap particle filtering framework which does not utilise observations to construct proposal distributions. When latent states evolve according to a simple dynamics and the relationship between xt and yt can be easily speculated with prior knowledge, optimal propos- als can be explicitly derived or approximated with closed-form expressions [58]. However, in more complex environments such as vision-based robot localisation, it is intractable to explicitly derive or approximate optimal proposals and thus a more flexible mechanism is needed to learn proposal distributions. [49] proposes to construct proposal distributions for differentiable particle filters with conditional normalising flows [87]. Specifically, proposal distributions in [49] are constructed by stacking a conditional normalising flow Gφ(*) : X × Y → X upon the dynamic model: t = Gφ(ˇxi xi t, yt) ∼ q(xt|yt, xi t−1; φ) , where ˇxi t ∼ p(ˇxt|xi t−1; θ) . (27) The conditional normalising flow Gφ(*) is an invertible function of the particle ˇxi t ∼ p(ˇxt|xt−1; θ) when the observation yt is given. Since the information from the latest 12 XIONGJIE CHEN AND YUNPENG LI observation is taken into account, the conditional normalising flow Gφ(*) has the potential to migrate samples drawn from the prior to regions that are closer to the posterior. Similar to Eq. (26), the proposal density can be evaluated by applying the change of variable formula: q(xi t|yt, xi t−1; φ) = p (cid:0)ˇxi t|xi (cid:12) (cid:12) (cid:12) det JGφ t−1; θ(cid:1) (cid:1) (cid:12) (cid:0)ˇxi (cid:12) (cid:12) t , where ˇxi t = G−1 φ (xi t, yt) ∼ p(ˇxt|xi t−1; θ) . (28) t) refers to the determinant of the Jacobian matrix JGφ(ˇxi t) = ∂Gφ(ˇxi t,yt) ∂ ˇxi t det JGφ(ˇxi evaluated at ˇxi t. 4. Measurement Models of Differentiable Partice filters. In this section we briefly review different designs of measurement models in the current differentiable particle filter literature. We group measurement models used in differentiable par- ticle filters into four categories. The first category estimates p(yt|xt; θ) using known distributions with unknown parameters [51, 80], e.g. parameterised Gaussian dis- tributions or Poisson distributions. The second category relies on neural networks to learn a scalar function to approximate p(yt|xt; θ) [46, 47]. The third category measures the discrepancy or similarity between observations and latent states in a learned feature space [48, 49]. The last category utilises conditional normalising flows to learn the generating process of yt and consequently the density of yt given xt [50]. More details on these different types of measurement models are provided below. 4.1. Measurement models built with known distributions. We first intro- duce measurement models used in differentiable particle filters that capture the relationship between xt and yt using known distributions with unknown parame- ters. An example of this type of measurement model can be found in [81], where differentiable particle filters is used to learn the parameters of a linear-Gaussian state-space model (LGSSM): x0 ∼ N (0, 1) , xt|xt−1 ∼ N (θ1xt−1, 1) , for t ≥ 1 , yt|xt ∼ N (θ2xt, 0.1) , for t ≥ 0 , (29) (30) (31) where θ = {θ1, θ2} are parameters to be estimated. In the above example, p(yt|xt; θ) is established as the probability density function of a Gaussian distribution with learnable parameters. Measurement models built with known distributions are limited to cases where In more complex the relationship between yt and xt can be explicitly inferred. systems where observations are high-dimensional unstructured data like images, one needs to design measurement models using more powerful tools such as neural networks. 4.2. Measurement models as scalar functions built with neural networks. In scenarios where it is non-trivial to model p(yt|xt; θ) with explicit closed-form expressions, several differentiable particle filtering approaches employ neural net- works to approximate p(yt|xt; θ) [46, 47]. A straightforward idea is to learn a scalar function lθ(*) : Y × X → R constructed by neural networks and consider its output as a measure of the compatibility between xt and yt. In [46], observations are first mapped into a feature space through et = Eθ(yt) ∈ Rde, where Eθ(*) : Y → Rde is a AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 13 neural network. Then another neural network hθ(*) : Rde × X → R with et and xi t as inputs is employed, whose outputs are considered as the unnormalised likelihood of yt given xi t: p(yt|xi et = Eθ(yt) , t; θ) ∝ lθ(yt, xi t) (cid:0)Eθ(yt), xi = hθ t (cid:1) . (32) (33) In [47], differentiable particle filters are applied in robot localisation tasks where a global 2D map is provided and observations are 3D local images. For this environment, [47] uses spatial transformer networks [88] to generate local maps ∈ Rh × Rw based on the global map M ∈ RH × RW and particle locations Mxi xi t, where h, w, H, and W are the height and width of the local and global maps, respectively. Then, the 2D local map Mxi is compared with the 3D local image yt through a neural network hθ(*) : Y × (Rh × Rw) → R: t t t = STθ(M, xi Mxi t; θ) ∝ lθ(yt, xi t) t) , p(yt|xi = hθ(yt, Mxi t ) , (34) (35) (36) where STθ(*) : (RH × RW ) × X → Rh × Rw refers to a spatial transformer net- work [88]. One open question for this category of measurements is how to normalise the learned unnormalised likelihood of yt given xi t. 4.3. Measurement models as feature similarities. Instead of solely relying on neural networks to build measurement models for differentiable particle filters, there are other differentiable particle filtering approaches that consider neural networks as feature extractors and employ user-defined metric functions to compare observation In [48], two neural networks Eθ(*) : Y → Rde and features and state features. Oθ(*) : X → Rde are used to extract features, then p(yt|xi t; θ) is assumed to be proportional to the reciprocal of the cosine distance between Eθ(yt) and Oθ(xi t): et = Eθ(yt) , oi c(et, oi t) = 1 − p(yt|xi t; θ) ∝ t) , t = Oθ(xi et * oi t ||et||2||oi t||2 1 c(et, oi t) , , (37) (38) (39) where c(*) : Rde × Rde → R refers to the cosine distance, et * oi t denotes the inner product of features, and || * ||2 is the L2 norm of feature vectors. In the robot localisation experiment of [51], the relationship between observation features and state features is modelled as follows: et = Eθ(yt) ∼ N (oi t, σ2 obsI) . (40) In other words, the conditional likelihood of yt given xt is computed as the Gaussian density of the observation feature et with oi obsI as its mean and variance. t = Oθ(xi t) and σ2 14 XIONGJIE CHEN AND YUNPENG LI Notably, to ensure the observation feature extractor Eθ(*) maintains essential information from yt, [48] and [51] add an auto-encoder loss into their training ob- jective: LAE = T −1 (cid:88) t=0 ||Dθ(Eθ(yt)) − yt||2 2 , (41) where T is the length of sequences, Eθ(*) : Y → Rde and Dθ(*) : Rde → Y are the observation encoder and the observation decoder, respectively. Empirically it was reported in [50] that measurement models built as neural networks with scalar outputs have shown better performance than measurement models as feature similarities. However, sometimes we also want to apply user- defined metric functions in measurement models for some cases where measurement models built as neural networks with scalar outputs may fail. For example, when the loss function used to train differentiable particle filters only focuses on the observation likelihood, measurement models purely built with neural networks may assign arbitrarily high unnormalised likelihood to any input. 4.4. Measurement models built with conditional normalising flows. In [50], a conditional normalising flow-based measurement model is proposed for differen- tiable particle filters. Compared with other measurement models that evaluate p(yt|xt; θ) using neural networks with scalar outputs, conditional normalising flow- based measurement models provide a mechanism to compute valid conditional prob- ability density of yt given xt. In particular, the measurement model proposed in [50] computes p(yt|xi t; θ) via: p(yt|xi t; θ) = pz(Fθ(yt, xi t)) (cid:12) (cid:12) (cid:12) (cid:12) det ∂Fθ(yt, xi t) ∂yt (cid:12) (cid:12) (cid:12) (cid:12) , (42) where Fθ(*) : Y × X → RdY is a parameterised conditional normalising flow, and (cid:12) (cid:12) det ∂Fθ(yt,xi is the determinant of the Jacobian matrix ∂Fθ(yt,xi t) t) evaluated at yt. (cid:12) (cid:12) The base distribution pz(*) defined on RdY can be user-specified and is often chosen as a simple distribution such as an isotropic Gaussian. (cid:12) (cid:12) (cid:12) (cid:12) ∂yt ∂yt In some scenarios where observations yt are high-dimensional data like images, evaluating Eq. (42) with raw observations can be computationally expensive. In addition, when observations contain too much irrelevant information, construct- ing measurement models with raw observations even becomes more challenging. Therefore, [50] proposed an alternative solution, which maps observation yt to a lower-dimensional feature space through a neural network Eθ(*) : Y → Rde . In addi- tion, [50] assumes that the conditional probability density p(et|xi t; θ) of observation features et = Eθ(yt) given state is an approximation of the actual measurement likelihood: p(yt|xi t; θ) ≈ p(et|xi t; θ) = pz(Fθ(et, xi (cid:12) (cid:12) t)) (cid:12) (cid:12) det ∂Fθ(et, xi t) ∂et (cid:12) (cid:12) (cid:12) (cid:12) . (43) (44) 5. Differentiable Resampling. Resampling is the key operation that distinguishes sequential Monte Carlo (SMC) methods from sequential importance sampling (SIS), however, it is also the main obstacle for us to achieve fully differentiable particle filters. Indeed, due to the fact that the resampling output changes in a discrete AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 15 manner, it has been widely documented that the resampling step is not differen- tiable [46, 47, 51, 66]. Additionally, since the importance weights of particles are set to be a constant after resampling, the gradients of particle weights at the t-th time step w.r.t particle weights at time step t(cid:48) < t are always zero, which is also considered to be non-differentiable in [47]. To estimate the gradients of resampling steps, [47, 51, 52] proposed their own solutions towards differentiable resampling. We review these techniques below. 5.1. Soft resampling. The soft resampling method proposed in [47] attempts to generate non-zero values for the gradients ∂ ̃wi t are unnormalised t ∂wi t particle weights after and before resampling, respectively. Denote by {wi i=1 the set of normalised particle weights before resampling, the soft resampling constructs t}Np an importance multinomial distribution Mult( ̃w1 i=1: ) defined with { ̃wi , where ∂ ̃wi t and ∂wi t}Np t ̃wi t = λwi t + (1 − λ) (45) t , * * * , ̃wNp 1 Np . t , * * * , ̃wNp In the soft resampling, the indices of selected particles are sampled from the impor- tance multinomial distribution Mult( ̃w1 ). The importance distribution Mult( ̃w1 ) can be interpreted as a linear interpolation between the orig- t , * * * , wNp inal multinomial distribution Mult(w1 ) and a multinomial distribution Mult( 1 ) with equal weights 1 . To correct the bias brought by sampling Np Np from the importance distribution, soft resampling updates particle weights after resampling as: t , * * * , ̃wNp , * * * , 1 Np t t t ̃wi t = wi t ̃wi t = wi t t + (1 − λ)1/Np λwi . (46) t , the gradient ∂ ̃wi t ∂wi t Since the modified weights in Eq. (46) is a function of the original weight wi t = yields non-zero values with the soft resampling method. wi t (cid:80)Np j=1 wj However, the soft resampling technique still relies on sampling from multinomial distributions, thus doesn't really change the discrete nature of resampling steps. In other words, the soft resampling outputs may still change in a discrete manner with slight changes in wi t, i.e. the non-differentiable part of resampling is ignored in soft resampling [51]. Nonetheless, the soft resampling has been widely used in the differentiable particle filter literature, possibly because it is easy to implement and lead to competitive empirical performance [48, 74, 75, 77, 78]. 5.2. Differentiable resampling via entropy-regularised optimal transport. In [51], an optimal transport (OT) map-based differentiable resampling algorithm was proposed. We use OT-resampler to refer to this resampling technique. The OT-resampler does not follow the traditional multinomial resampling strategy. In- stead, the OT-resampler tries to find the optimal transport map between an equally weighted empirical distribution ρ(xt) = 1 (xt) and the target empirical Np distribution ˆp(xt|y0:t; θ) = (cid:80)Np (xt). Since the original optimal transport problem is computationally expensive and not differentiable, [51] estimates the op- timal transport map by solving an entropy-regularised version of optimal transport problems [89, 90] with the Sinkhorn algorithm [69, 70, 71], which is efficient and differentiable. i=1 wi i=1 δxi (cid:80)Np t δxi t t 16 XIONGJIE CHEN AND YUNPENG LI Let's first consider the application of optimal transport in particle resampling without regularisation. Ideally, we want to find a transportation map T : X → X such that the resulting distribution T #ρ(xt) = 1 t = T (xi t) i=1 δ ̃xi Np exactly matches the target distribution ˆp(xt|y0:t; θ) = (cid:80)Np (xt). However, this is not possible because the resulting distribution has equal weights while the target distribution does not. An approximation ˆT : X → X of the optimal trans- portation map T is the so-called barycentric projection [51, 71]: (xt) with ̃xi i=1 wi (cid:80)Np t δxi t t t = ˆT (xi ˆxi t) = Np Np (cid:88) j=1 P OT(i, j)xj t , ˆXt = NpP OTXt , where P OT ∈ RNp×Np . (47) (48) , * * * , 1 Np We use P OT(i, j) to denote the (i, j)-th element of P OT and 1Np ∈ RNp a Np- dimensional column vector with all entries set to be 1. The matrix P OT is the opti- mal coupling that produces the minimal transportation cost (cid:80)Np t, xj t ) for a predefined distance metric D(*, *) : X × X → R, and satisfies P OT1Np = )(cid:62). In Eq. (48), the i-th row of ˆXt ∈ ( 1 Np RNp×dX and Xt ∈ RNp×dX are the i-th transported particle ˆxi t and the i-th orig- inal particle xi t is the barycentre of the empirical distribution τ i (xt), hence the name barycen- tric projection. The distribution ˆT #ρ(xt) = 1 i=1 δˆxi Np resampling output of the OT-resampler. t, respectively. The transported particle ˆxi (cid:80)Np j=1 P OT(i, j)δxj t (cid:80)Np )(cid:62), (P OT)(cid:62)1Np = (w1 (xt) is considered as the i,j P OT(i, j)D(xi t , * * * , wNp t (xt) = Np t t However, as aforementioned, the original OT problem brings high computational overhead and is not differentiable. [51] resorts to solving a dual OT problem and consider an entropy regularised version of the problem to make it efficient and ∈ RNp×Np to refer to the entropy-regularised coupling differentiable. Using P OT with regularisation coefficient ξ, the corresponding barycentric projection becomes: ξ t,ξ = ˆTξ(xi ˆxi t) = Np Np (cid:88) P OT ξ (i, j)xj t , j=1 ˆXt,ξ = NpP OT ξ Xt . (49) (50) While the OT-resampler is fully differentiable, the regularisation coefficient ξ in- troduces biases into the OT-resampler, and the bias only vanishes when ξ → 0. In spite of that, the OT-resampler still outperforms the soft resampling according to the experimental results reported in [51]. 5.3. Differentiable resampling via neural networks. [52] proposed the parti- cle transformer, a neural network architecture designed for performing differentiable particle resampling. Since the inputs of the resampling step are point sets, the par- ticle transformer is designed to be permutation-invariant and scale-equivariant by utilising the set transformer [72]. The input of the particle transformer is a set of t, xi weighted particles {wi i=1, and the output of the particle transformer is a set t}Np of new particles { ̃xi i=1: t}Np { ̃xi t}Np i=1 = PTθ (cid:0){wi t, xi t}Np i=1 (cid:1) , (51) AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 17 where PTθ(*) denotes the particle transformer. The output particles are assigned with equal weights ̃wi . t = 1 Np Since it is a neural network-based resampler, a training objective is needed to In [52], the particle transformer is optimised by train the particle transformer. maximising the likelihood of original samples {xi i=1 in the distribution after re- sampling, and the likelihood of a particle xi t is weighted by its importance weight wi t. To convert empirical distributions into continuous distributions with proper probability density functions, [52] proposes to construct a Gaussian mixture distri- bution based on the empirical distribution after resampling (one Gaussian kernel per particle). Components of the Gaussian mixture model are weighted equally, since particles after resampling have uniform weights. The loss function used to train the particle transformer is defined as the weighted likelihood of the original samples in the Gaussian mixture distribution: t}Np L(θ) := − Np (cid:88) i=1 wi t log Np (cid:88) j=1 1 (cid:112)|Σ| exp (cid:0) − 1 2 (xi t − ̃xj t )(cid:62)Σ−1(xi t − ̃xj t )(cid:1) , (52) where Σ is a specified covariance matrix of the Gaussian mixture model, and |Σ| refers to the determinant of Σ. After training the particle transformer individu- ally, [52] integrates the particle transformer into differentiable particle filters and train them jointly by minimising a task-specific loss function. One shortcoming of the particle transformer is that it requires pre-training, im- plying one needs to collect training data beforehand, which might not be possible in some cases. In addition, a particle transformer trained for a specific task may not fit into other tasks, and requires re-training when one wants to deploy it to a new task. Additionally, experiment results reported in [52] show that the best performance is achieved when not backpropagating through the particle transformer in training differentiable particle filters. 6. Loss Functions for Training Differentiable Particle Filters. With all the components we have described, we need a loss function to train neural networks used to build the above key components of differentiable particle filters. In the dif- ferentiable particle filter literature, loss functions can be mainly grouped into three categories, supervised losses, semi-supervised losses, and variational objectives, as described below. 6.1. Supervised losses. Supervised losses are a popular choice in differentiable particle filters when the ground-truth states are available [46, 47, 49, 50, 51]. As its name implies, supervised losses require collecting training data beforehand. We use x∗ t to denote the ground-truth states. Training differentiable particle filters with supervised losses implies the ground-truth state x∗ t is available, therefore we can evaluate how close the estimated state ̄xt given by differentiable particle filters is to x∗ t . There are two major classes of supervised losses used in differentiable particle filters, the root mean square error (RMSE) and the negative state likelihood loss. We first introduce the RMSE loss. The RMSE loss computes the distance be- tween the predicted states ̄xt and the ground-truth states x∗ t : ̄xt = Np (cid:88) i=1 wi txi t , (53) 18 XIONGJIE CHEN AND YUNPENG LI LRMSE := (cid:118) (cid:117) (cid:117) (cid:116) 1 T T −1 (cid:88) t=0 ||x∗ t − ̄xt||2 2 , (54) where ||*||2 denotes the L2 norm, and T is the total number of time steps. Minimising the RMSE loss is equivalent to maximising the log-likelihood of the ground-truth state x∗ in the Gaussian distribution with mean ̄xt and an identity covariance t matrix. In contrast to the RMSE loss which considers only the final estimates, the log- likelihood loss takes into account all the particles. The log-likelihood loss LLL com- putes the logarithm of probability density of ground-truth states x∗ t in a Gaussian t}Np mixture distribution defined by a set of weighted particles {wi i=1: t, xi LLL := − 1 T T −1 (cid:88) log Np (cid:88) t=0 i=1 wi t (cid:112)|Σ| exp (cid:0) − 1 2 (x∗ t − xi t)(cid:62)Σ−1(x∗ t − xi t)(cid:1) , (55) where Σ is a specified covariance matrix of the Gaussian mixture model, and |Σ| refers to the determinant of Σ. Despite that supervised losses have been empirically proved to be effective among various differentiable particle filtering methods [46, 47, 49, 50, 51], as discussed above, training differentiable particle filters with supervised losses requires sufficient training data with ground-truth state information, which can be expensive to collect and are often unavailable in real-world applications. We discuss below how to train differentiable particle filters when ground-truth states or at least a part of ground- truth states are not available. 6.2. Semi-supervised loss. When ground-truth states are not provided, a com- mon choice of training objectives for differentiable particle filters is the marginal like- lihood of observations p(y0:t; θ). [91] proposed to search for point estimates of static parameters in particle filters by maximising the log-likelihood Lt(θ) = log p(y0:t; θ) using noisy gradient algorithms. However, this approach requires the estimation of sufficient statistics of joint distributions whose dimension increases over time. An alternative is to use a pseudo-likelihood [64]. Specifically, [64] proposed to split the data into slices and consider the product of each block's likelihood as the pseudo-likelihood of the whole trajectory. Inspired by [64], [48] introduced a semi-supervised training strategy for differentiable particle filters by maximising the pseudo-likelihood of observations yt. To derive the semi-supervised loss, [48] first defined a logarithmic pseudo-likelihood Q(θ). Consider m slices Xb := xbL:(b+1)L−1 and Yb := ybL:(b+1)L−1 of {xt}T −1 t=0 and {yt}T −1 t=0 , where L is the time length of each block, Xb and Yb are the b-th block of states and observations, respectively. Then the log pseudo-likelihood for m blocks of observations is defined as follows: Q(θ) := m−1 (cid:88) b=0 log p(Yb; θ) . (56) Compared to the true log-likelihood Lt(θ) = log p(y0:t; θ), the pseudo-likelihood overcomes the increasing dimension problem by omitting the dependency between blocks. At the b-th block, denote by θb the current estimate of parameter value and θ∗ the optimal parameter value, [48] maximises Q(θ, θb) over θ, which is equivalent to AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 19 maximising the pseudo-likelihood Q(θ), where Q(θ, θb) is defined as follows: (cid:90) Q(θ, θb) := X L×Y L log(p(Xb, Yb; θ)) * p(Xb|Yb; θb)p(Yb; θ∗)dXbdYb . (57) Particularly, Q(θ, θb) is maximised through gradient descent with the initial value of θ set to be θb. With the pseudo-likelihood objective, we can train differentiable particle filters in a semi-supervised manner as follows: (cid:18) θ = argmin θ∈Θ λ1L(θ) − λ2 m (cid:19) Q(θ, θb) , if ground-truth states are available, (58) (cid:18) θ = argmin − θ∈Θ λ2 m (cid:19) Q(θ, θb) , if ground-truth states are not available, (59) where the supervised loss L(θ) can be selected from supervised losses introduced in previous sections and λ1, λ2 are hyperparameters. 6.3. Variational objectives. In variational inference (VI) problems, using the evidence lower bound (ELBO) as a surrogate objective for the maximum likelihood estimation (MLE) enables one to perform model learning and proposal learning simultaneously and has demonstrated its effectiveness in the literature [67, 92, 93, 94, 95, 96]. There are two main components in VI, a parametric family of variational distributions and the ELBO as the training objective. Following the framework of VI, [80, 81, 82] interpreted SMC methods as a VI approach and extended ELBOs to a family of lower bounds defined by estimators of the marginal likelihood given by particle filters. Specifically, [80, 81, 82] proposed a variational objective that can exploit the sequential structure of the filtering problem in which SMC methods are applied in. To present the filtering variational objective, we first introduce a unified perspec- t=0 , the ELBO of the tive on ELBOs used in VI. Given a set of observations {yt}T −1 logarithmic marginal likelihood log p(y0:T −1; θ) can be derived as: log p(y0:T −1; θ) = log (cid:90) p(y0:T −1, x0:T −1; θ)dx0:T −1 (60) X T (cid:90) = log = log Eq ≥ Eq (cid:2) log p(y0:T −1, x0:T −1; θ) q(x0:T −1|y0:T −1; φ) X T (cid:2) p(y0:T −1, x0:T −1; θ) q(x0:T −1|y0:T −1; φ) p(y0:T −1, x0:T −1; θ) q(x0:T −1|y0:T −1; φ) (cid:3) (cid:3) , q(x0:T −1|y0:T −1; φ)dx0:T −1 (61) (62) (63) where Jensen's inequality is applied from Eq. (62) to Eq. (63), and q(x0:T −1|y0:T −1; φ) is the proposal distribution. It can be observed from Eq. (60) to Eq. (63) that as long as we can derive an unbiased estimator of the observation likelihood p(y0:T −1; θ), (cid:3) in Eq. (62), we can apply Jensen's inequality to ob- e.g. Eq tain an ELBO of the logarithmic marginal likelihood log p(y0:T −1; θ). Following this pattern, the importance weighted auto-encoder proposes to use the estimator 1 0:T −1|y0:T −1;φ) by drawing multiple samples from the proposal: Np (cid:2) p(y0:T −1,x0:T −1;θ) q(x0:T −1|y0:T −1;φ) p(y0:T −1,xi q(xi (cid:80)Np i=1 0:T −1;θ) log p(y0:T −1; θ) = log EQIWAE (cid:2) 1 Np Np (cid:88) i=1 p(y0:T −1, xi q(xi 0:T −1; θ) 0:T −1|y0:T −1; φ) (cid:3) (64) 20 XIONGJIE CHEN AND YUNPENG LI ≥ EQIWAE (cid:20) log (cid:0) 1 Np Np (cid:88) i=1 p(y0:T −1, xi q(xi 0:T −1; θ) 0:T −1|y0:T −1; φ) (cid:21) (cid:1) , (65) where QIWAE = (cid:81)Np 0:T −1|y0:T −1; φ). It was proved in [93] that with Np ≥ 1, Eq. (65) is a tighter bound than the ELBO defined by Eq. (63). Similarly, the filtering ELBO for SMC methods can be derived as: i=1 q(xi log p(y0:T −1; θ) ≥ EQSMC (cid:2) log ˆp(y1:T −1; θ)(cid:3) (cid:90) = X0:T −1 QSMC(x1:Np 0:T −1, A1:Np 1:T −2) log ˆp(y1:T −1; θ)dx1:Np , (66) (67) 0:T −1, A1:Np 0:T −1 and 0:T −2 respectively refer to samples from the proposal distribution and resampling where QSMC(x1:Np A1:Np indices, and ˆp(y0:T −1; θ) is the SMC estimates of the marginal likelihood: 0:T −2) is the sampling distribution of SMC [81], x1:Np ˆp(y0:T −1; θ) = T −1 (cid:89) t=0 (cid:20) 1 Np Np (cid:88) i=1 (cid:21) . wi t 7. Discussion & Summary. In this paper, we reviewed recent advances in differ- entiable particle filters, with a particular focus on five core components of differen- tiable particle filters: dynamic models, measurement models, proposal distributions, differentiable resampling techniques, and training objectives. Specifically, the above modules of differentiable particle filters can be summarised as follows: 1. Most dynamic models used in current differentiable particle filter frameworks are Gaussian, where the transition of states are simulated by a Gaussian distribution whose mean and variance are predicted by a function of previous states. Normalising flows can be used to enhance Gaussian dynamic models as it can transform a simple distribution into arbitrarily complex distributions under some mild conditions, and they can also provide densities of transformed particles. Dynamic models in several work are built with observations, and have shown competitive performances in complex scenarios. However, this class of dynamic models does not fit into assumptions of state-space models we consider in Bayesian filtering problems. 2. For the proposal distribution of differentiable particle filters, we can employ conditional normalising flow to incorporate the information from observations into the construction of proposal distributions, with a straightforward evalu- ation of the proposal density. 3. In cases where the relationship between states and observations can be built with known distribution families, measurement models are differentiable by themselves. While in more complex scenarios, differentiable particle filters re- sort to build connections between observations and states in a feature space. Typical examples include: (1) measurement models as scalar functions built with neural networks, where the conditional likelihood of observation is given by neural networks with observation and state features as inputs; (2) mea- surement model as feature similarities, where the conditional likelihood of observation is evaluated as the similarity between the observation feature and the state feature; (3) measurement model built with conditional normalis- ing flows, where observations are transformed into Gaussian samples through AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 21 invertible neural networks and the conditional likelihood of observation is computed through the change of variable formula. 4. To cope with the inherent discrete nature of resampling steps, different tech- niques for differentiable resampling have been proposed. In the soft resam- pling method, the gradients of the importance weights before resampling w.r.t previous weights are non-zero. But the soft resampling is not truly differ- entiable as the non-differentiable part of resampling is simply ignored. A fully-differentiable resampling scheme is achieved by considering resampling operations as solving entropy-regularised optimal transport problems. The regularisation term in the OT-resampler introduces biases into the resam- pling outcome, and the biases only vanish if the regularisation coefficient approaches zero. A transformer-based resampler, particle transformer, was proposed based on the recent development of the transformer architecture and self-attention mechanism. One limitation of the particle transformer is that a particle transformer trained for one specific task cannot be applied in other tasks. 5. The training objective of differentiable particle filters include supervised losses, semi-supervised losses, and variational objectives. Supervised losses require ground-truth states to train differentiable particle filters. One type of semi- supervised losses includes a pseudo-likelihood loss to optimise parameters of differentiable particle filters when part of the ground-truth states are not avail- able. Variational objectives adopt an evidence lower bound (ELBO) of the marginal log-likelihood of observations as a surrogate objective for training differentiable particle filters. REFERENCES [1] R. E. Kalman, "A new approach to linear filtering and prediction problems," J .Basic Eng., vol. 82, no. 1, pp. 33–45, 1960. [2] B. Anderson and J. B. Moore, "Optimal filtering," Prentice-Hall Inform. and Syst. Sci. Ser., 1979. [3] F. E. Daum, "Extended Kalman filters." Encyclo. Syst. and Control, 2015. [4] E. A. Wan and R. Van Der Merwe, "The unscented kalman filter for nonlinear estimation," in Proc. IEEE Adapt. Syst. Signal. Process. Commun. Control Sympos., Oct., Lake Louise, Canada 2000. [5] R. S. Bucy and K. D. Senne, "Digital synthesis of non-linear filters," Automatica, vol. 7, no. 3, pp. 287–298, 1971. [6] A. Doucet, D. N. Freitas, and N. Gordon, "An introduction to sequential Monte Carlo meth- ods," in Sequential Monte Carlo methods in practice. Springer, 2001, pp. 3–14. [7] P. M. Djuri ́c, J. H. Kotecha, J. Zhang, Y. Huang, T. Ghirmai, M. F. Bugallo, and J. Miguez, "Particle filtering," IEEE Signal Process. Mag., vol. 20, no. 5, pp. 19–38, 2003. [8] A. Doucet, N. De Freitas, N. J. Gordon et al., Sequential Monte Carlo methods in practice. Springer, 2001, vol. 1, no. 2. [9] P. Del Moral and L. Miclo, "Branching and interacting particle systems. approximations of Feynman-Kac formulae with applications to non-linear filtering," S ́emin. Probab. Strasbourg, vol. 34, pp. 1–145, 2000. [10] D. Crisan and A. Doucet, "A survey of convergence results on particle filtering methods for practitioners," IEEE Trans. Signal Process., vol. 50, no. 3, pp. 736–746, 2002. [11] P. Del Moral, "Measure-valued processes and interacting particle systems. application to nonlinear filtering problems," Ann. Appl. Probab., vol. 8, no. 2, pp. 438–495, 1998. [12] V. Elvira, J. M ́ıguez, and P. M. Djuri ́c, "Adapting the number of particles in sequential Monte Carlo methods through an online scheme for convergence assessment," IEEE Trans. Signal Process., vol. 65, no. 7, pp. 1781–1794, 2017. [13] V. Elvira, J. Miguez, and P. M. Djuri ́c, "On the performance of particle filters with adaptive number of particles," Stat. Comput., vol. 31, pp. 1–18, 2021. 22 XIONGJIE CHEN AND YUNPENG LI [14] N. Gordon, D. Salmond, and A. Smith, "Novel approach to nonlinear/non-Gaussian Bayesian state estimation," in IEE Proc. F (Radar and Signal Process.), vol. 140, 1993, pp. 107–113. [15] M. K. Pitt and N. Shephard, "Filtering via simulation: Auxiliary particle filters," J. Amer. Statist. Assoc., vol. 94, no. 446, pp. 590–599, 1999. [16] V. Elvira, L. Martino, M. F. Bugallo, and P. M. Djuri ́c, "Elucidating the auxiliary particle filter via multiple importance sampling," IEEE Signal Process. Mag., vol. 36, no. 6, pp. 145–152, 2019. [17] N. Branchini and V. Elvira, "Optimized auxiliary particle filters: adapting mixture proposals via convex optimization," in Proc. Conf. Uncertain. Artif. Intell. (UAI), 2021, pp. 1289–1299. [18] J. H. Kotecha and P. M. Djuri ́c, "Gaussian sum particle filtering," IEEE Trans. Signal Pro- cess., vol. 51, no. 10, pp. 2602–2612, 2003. [19] --, "Gaussian sum particle filtering for dynamic state-space models," in Proc. IEEE Int. Conf. Acoust. Speech Signal Process., Salt Lake City, USA, May 2001. [20] --, "Gaussian particle filtering," IEEE Trans. Signal Process., vol. 51, no. 10, pp. 2592– 2601, 2003. [21] R. Van Der Merwe, A. Doucet, N. De Freitas, and E. Wan, "The unscented particle filter," Proc. Adv. Neur. Inf. Process. Sys. (NeurIPS), Dec. 2000. [22] Y. Rui and Y. Chen, "Better proposal distributions: Object tracking using unscented particle filter," in IEEE Conf. Comp. Vis. and Pat. Recog. (CVPR). Kauai, USA.: IEEE, Dec. 2001. [23] S. J. Julier and J. K. Uhlmann, "Unscented filtering and nonlinear estimation," Proc. IEEE, vol. 92, no. 3, pp. 401–422, 2004. [24] A. Doucet, N. de Freitas, K. Murphy, and S. Russell, "Rao-Blackwellised particle filtering for dynamic Bayesian networks," in Proc. Conf. Uncertain. Artif. Intell. (UAI), Stanford, USA, 2000, pp. 176–183. [25] N. De Freitas, "Rao-Blackwellised particle filtering for fault diagnosis," in Proc. IEEE Aerosp. Conf., vol. 4, 2002, pp. 4–4. [26] P. M. Djuri ́c, T. Lu, and M. F. Bugallo, "Multiple particle filtering," in Proc. IEEE Int. Conf. Acoust. Speech Signal Process. (ICASSP), Honolulu, USA, Apr. 2007. [27] P. M. Djuri ́c and M. F. Bugallo, "Particle filtering for high-dimensional systems," in Proc. Comput. Adv. Multi-Sensor Adapt. Process. (CAMSAP), Saint Martin, France, Dec. 2013. [28] P. Bunch and S. Godsill, "Approximations of the optimal importance density using gaussian particle flow importance sampling," J. Amer. Statist. Assoc., vol. 111, no. 514, pp. 748–762, 2016. [29] Y. Li and M. Coates, "Particle filtering with invertible particle flow," IEEE Trans. Signal Process., vol. 65, no. 15, pp. 4102–4116, 2017. [30] T. Zhang, C. Xu, and M.-H. Yang, "Multi-task correlation particle filter for robust ob- ject tracking," in Proc. IEEE Conf. Comput. Vis. and Pattern Recogn. (CVPR), Honolulu, Hawaii, July 2017. [31] S. Malik and M. K. Pitt, "Particle filters for continuous likelihood evaluation and maximisa- tion," J. Econometrics, vol. 165, no. 2, pp. 190–209, 2011. [32] E. Dupont, A. Doucet, and Y. W. Teh, "Augmented neural odes," in Proc. Advances in Neural Information Processing Systems (NIPS), Vancouver, Canada, 2019, pp. 3140–3150. [33] A. Gunatilake, S. Kodagoda, and K. Thiyagarajan, "A novel UHF-RFID dual antenna signals combined with Gaussian process and particle filter for in-pipe robot localization," IEEE Robot. Autom. Lett., vol. 7, no. 3, pp. 6005–6011, 2022. [34] P. J. Van Leeuwen, H. R. K ̈unsch, L. Nerger, R. Potthast, and S. Reich, "Particle filters for high-dimensional geoscience applications: A review," Q. J. R. Meteorol. Soc., vol. 145, no. 723, pp. 2335–2365, 2019. [35] C. Pozna, R.-E. Precup, E. Horv ́ath, and E. M. Petriu, "Hybrid particle filter–particle swarm optimization algorithm and application to fuzzy controlled servo systems," IEEE Trans. Fuzzy Syst., vol. 30, no. 10, pp. 4286–4297, 2022. [36] N. Kantas, A. Doucet, S. S. Singh, and J. M. Maciejowski, "An overview of sequential Monte Carlo methods for parameter estimation in general state-space models," IFAC Proceedings Volumes, vol. 42, no. 10, pp. 774–785, 2009. [37] N. Kantas, A. Doucet, S. S. Singh, J. Maciejowski, and N. Chopin, "On particle methods for parameter estimation in state-space models," Stat. Sci., vol. 30, no. 3, pp. 328–351, 2015. [38] C. Andrieu, A. Doucet, and R. Holenstein, "Particle markov chain monte carlo methods," J. R. Stat. Soc. Ser. B. Stat. Methodol., vol. 72, no. 3, pp. 269–342, 2010. AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 23 [39] F. Lindsten, M. I. Jordan, and T. B. Schon, "Particle gibbs with ancestor sampling," J. Mach. Learn. Res., vol. 15, pp. 2145–2184, 2014. [40] N. Chopin, P. E. Jacob, and O. Papaspiliopoulos, "SMC2: an efficient algorithm for sequential analysis of state space models," J. R. Stat. Soc. Ser. B. Stat. Methodol., vol. 75, no. 3, pp. 397–426, 2013. [41] S. P ́erez-Vieites, I. P. Mari ̃no, and J. M ́ıguez, "Probabilistic scheme for joint parameter esti- mation and state prediction in complex dynamical systems," Phys. Rev. E, vol. 98, no. 6, p. 063305, 2018. [42] D. Crisan and J. M ́Iguez, "Nested particle filters for online parameter estimation in discrete- time state-space Markov models," Bernoulli, vol. 24, no. 4A, pp. 3039–3086, 2018. [43] S. P ́erez-Vieites and J. M ́ıguez, "Nested Gaussian filters for recursive Bayesian inference and nonlinear tracking in state space models," Signal Proces., vol. 189, p. 108295, 2021. [44] E. Chouzenoux and V. Elvira, "Graphem: Em algorithm for blind kalman filtering under graphical sparsity constraints," in Proc. IEEE Int. Conf. Acoust. Speech Signal Process. (ICASSP), May 2020. [45] V. Elvira and ́E. Chouzenoux, "Graphical inference in linear-gaussian state-space models," IEEE Trans. Signal Process., vol. 70, pp. 4757–4771, 2022. [46] R. Jonschkowski, D. Rastogi, and O. Brock, "Differentiable particle filters: end-to-end learn- ing with algorithmic priors," in Proc. Robot.: Sci. and Syst. (RSS), Pittsburgh, Pennsylvania, July 2018. [47] P. Karkus, D. Hsu, and W. S. Lee, "Particle filter networks with application to visual local- ization," in Proc. Conf. Robot Learn. (CoRL), Zurich, Switzerland, Oct 2018. [48] H. Wen, X. Chen, G. Papagiannis, C. Hu, and Y. Li, "End-to-end semi-supervised learning for differentiable particle filters," in Proc. IEEE Int. Conf. Robot. Automat., (ICRA), Xi'an, China, May 2021. [49] X. Chen, H. Wen, and Y. Li, "Differentiable particle filters through conditional normalizing flow," in Proc. IEEE Int. Conf. Inf. Fusion (FUSION), Sun City, South Africa, Nov. 2021. [50] X. Chen and Y. Li, "Conditional measurement density estimation in sequential Monte Carlo via normalizing flow," in Proc. Euro. Sig. Process. Conf. (EUSIPCO), Belgrade, Serbia, Aug. 2022. [51] A. Corenflos, J. Thornton, G. Deligiannidis, and A. Doucet, "Differentiable particle filtering via entropy-regularized optimal transport," in Proc. Int. Conf. Mach. Learn. (ICML), July 2021. [52] M. Zhu, K. Murphy, and R. Jonschkowski, "Towards differentiable resampling," arXiv preprint arXiv:2004.11938, 2020. [53] V. Elvira and L. Martino, "Advances in importance sampling," Wiley StatsRef-Statistics Reference Online, pp. 1–14, 2021. [54] T. Hesterberg, "Weighted average importance sampling and defensive mixture distributions," Technometrics, vol. 37, no. 2, pp. 185–194, 1995. [55] S. T. Tokdar and R. E. Kass, "Importance sampling: a review," Wiley Interdiscip. Rev. Comput. Stat., vol. 2, no. 1, pp. 54–60, 2010. [56] S. Agapiou, O. Papaspiliopoulos, D. Sanz-Alonso, and A. M. Stuart, "Importance sampling: Intrinsic dimension and computational cost," Statist. Sci., pp. 405–431, 2017. [57] P. Bickel, B. Li, and T. Bengtsson, "Sharp failure rates for the bootstrap particle filter in high dimensions," Pushing the limits of contemporary statistics: Contributions in honor of Jayanta K. Ghosh, 2008. [58] N. Chopin and O. Papaspiliopoulos, An introduction to sequential Monte Carlo. Springer, 2020. [59] M. Gerber, N. Chopin, and N. Whiteley, "Negative association, ordering and convergence of resampling methods," Ann. Statist., vol. 47, no. 4, pp. 2236–2260, 2019. [60] T.-c. Li, G. Villarrubia, S.-d. Sun, J. M. Corchado, and J. Bajo, "Resampling methods for identical distribution, a new method, and comparable study," Frontiers particle filtering: Inform. Tech. & Electron. Eng., vol. 16, no. 11, pp. 969–984, 2015. [61] R. Douc and O. Capp ́e, "Comparison of resampling schemes for particle filtering," in Proc. Int. Symp. Image and Signal Process. and Anal., Zagreb, Croatia, 2005. [62] M. Boli ́c, P. M. Djuri ́c, and S. Hong, "Resampling algorithms for particle filters: A compu- tational complexity perspective," EURASIP J. Adv. Signal Process., vol. 2004, no. 15, pp. 1–11, 2004. 24 XIONGJIE CHEN AND YUNPENG LI [63] A. Doucet and V. B. Tadi ́c, "Parameter estimation in general state-space models using particle methods," Ann. Inst. Stat. Math., vol. 55, no. 2, pp. 409–422, 2003. [64] C. Andrieu, A. Doucet, and V. B. Tadic, "On-line parameter estimation in general state-space models," in Proc. IEEE Conf. Dec. and Contr. (CDC), Seville, Spain, Dec. 2005. [65] A. Kloss, G. Martius, and J. Bohg, "How to train your differentiable filter," Auto. Robot., vol. 45, no. 4, pp. 561–578, 2021. [66] C. Rosato, L. Devlin, V. Beraud, P. Horridge, T. B. Sch ̈on, and S. Maskell, "Efficient learning of the parameters of non-linear models using differentiable resampling in particle filters," IEEE Trans. Signal Process., vol. 70, pp. 3676–3692, 2022. [67] D. P. Kingma and M. Welling, "Auto-encoding variational Bayes," in Proc. Int. Conf. Learn. Represent. (ICLR), Scottsdale, Arizona, May 2013. [68] S. Reich, "A nonparametric ensemble transform method for Bayesian inference," SIAM J. Sci. Comput., vol. 35, no. 4, pp. A2013–A2024, 2013. [69] M. Cuturi, "Sinkhorn distances: Lightspeed computation of optimal transport," in Proc. Adv. Neur. Inf. Process. Sys. (NeurIPS), Lake Tahoe, USA, Dec. 2013. [70] J. Feydy et al., "Interpolating between optimal transport and mmd using Sinkhorn diver- gences," in Proc. Int. Conf. Artif. Intell. Stat. (AISTAS), Naha, Japan, Apr. 2019. [71] G. Peyr ́e and M. Cuturi, "Computational optimal transport," Foundations and Trends® in Machine Learning, vol. 11, no. 5-6, pp. 355–607, 2019. [72] J. Lee et al., "Set transformer: A framework for attention-based permutation-invariant neural networks," in Proc. Int. Conf. Mach. Learn. (ICML), Baltimore, USA, June 2019. [73] A. Vaswani et al., "Attention is all you need," in Proc. Adv. Neur. Inf. Process. Sys. (NeurIPS), Long Beach, USA, Dec. 2017. [74] X. Ma, P. Karkus, D. Hsu, and W. S. Lee, "Particle filter recurrent neural networks," in Proc. AAAI Conf. Artif. Intell. (AAAI), New York, USA, Feb. 2020. [75] X. Ma et al., "Discriminative particle filter reinforcement learning for complex partial obser- vations," in Proc. Int. Conf. Learn. Rep. (ICLR), New Orleans, USA, May 2019. [76] R. Chen, H. Yin, Y. Jiao, G. Dissanayake, Y. Wang, and R. Xiong, "Deep samplable observa- tion model for global localization and kidnapping," IEEE Robot. Autom. Lett. (RAL), vol. 6, no. 2, pp. 2296–2303, 2021. [77] P. Karkus, S. Cai, and D. Hsu, "Differentiable slam-net: Learning particle slam for visual navigation," in Proc. IEEE Conf. Comp. Vis. and Pat. Recog. (CVPR), June 2021. [78] P. Karkus et al., "Differentiable algorithm networks for composable robot learning," in Proc. Robot.: Sci. and Syst. (RSS), Messe Freiburg, Germany, June 2019. [79] M. A. Lee, B. Yi, R. Mart ́ın-Mart ́ın, S. Savarese, and J. Bohg, "Multimodal sensor fusion with differentiable filters," in Proc. IEEE/RSJ Int. Conf. Intel. Robot. Sys. (IROS), Las Vegas, USA, Oct. 2020. [80] C. Naesseth, S. Linderman, R. Ranganath, and D. Blei, "Variational sequential Monte Carlo," in Proc. Int. Conf. Artif. Intel. and Stat. (AISTATS), Playa Blanca, Spain, Apr. 2018. [81] T. A. Le, M. Igl, T. Rainforth, T. Jin, and F. Wood, "Auto-encoding sequential Monte Carlo," in Proc. Int. Conf. Learn. Rep. (ICLR), Vancouver, Canada, Apr. 2018. [82] C. J. Maddison et al., "Filtering variational objectives," in Proc. Adv. Neur. Inf. Process. Sys. (NeurIPS), Long Beach, USA, Dec. 2017. [83] M. H. Dupty, Y. Dong, and W. S. Lee, "PF-GNN: Differentiable particle filtering based approximation of universal graph representations," in Proc. Int. Conf. Learn. Represent. (ICLR), May 2021. [84] G. Papamakarios, E. Nalisnick, D. J. Rezende, S. Mohamed, and B. Lakshminarayanan, "Normalizing flows for probabilistic modeling and inference," J. Mach. Learn. Res., vol. 22, pp. 1–64, 2021. [85] S. Hochreiter and J. Schmidhuber, "Long short-term memory," Neural Comput., vol. 9, no. 8, pp. 1735–1780, 1997. [86] K. Cho, B. van Merri ̈enboer, D. Bahdanau, and Y. Bengio, "On the properties of neural machine translation: Encoder–decoder approaches," Syntax, Semant. and Struct. in Stat. Transl., p. 103, 2014. [87] C. Winkler, D. Worrall, E. Hoogeboom, and M. Welling, "Learning likelihoods with condi- tional normalizing flows," arXiv preprint arXiv:1912.00042, 2019. [88] M. Jaderberg, K. Simonyan, A. Zisserman, and K. Kavukcuoglu, "Spatial transformer net- works," in Proc. Adv. Neur. Inf. Process. Sys. (NeurIPS), Montreal, Canada, Dec. 2015. [89] C. Villani, Topics in optimal transportation. American Mathematical Society, 2003. AN OVERVIEW OF DIFFERENTIABLE PARTICLE FILTERS 25 [90] --, Optimal Transport: old and new. Berlin, Germany: Springer Science & Business Media, 2008, vol. 338. [91] C. Andrieu, A. Doucet, S. Singh, and V. Tadic, "Particle methods for change detection, system identification, and control," Proc. IEEE, vol. 92, no. 3, pp. 423–438, 2004. [92] D. Rezende and S. Mohamed, "Variational inference with normalizing flows," in Proc. Int. Conf. Mach. Learn. (ICML), Lille, France, July 2015. [93] Y. Burda, R. B. Grosse, and R. Salakhutdinov, "Importance weighted autoencoders," in Proc. Int. Conf. Learn. Rep. (ICLR), San Juan, Puerto Rico, May. 2016. [94] M. I. Jordan, Z. Ghahramani, T. S. Jaakkola, and L. K. Saul, "An introduction to variational methods for graphical models," Mach. Learn., vol. 37, no. 2, pp. 183–233, 1999. [95] M. J. Beal, Variational algorithms for approximate Bayesian inference. University of London, University College London, United Kingdom, 2003. [96] D. J. Rezende, S. Mohamed, and D. Wierstra, "Stochastic backpropagation and approximate inference in deep generative models," in Proc. Int. Conf. Mach. Learn. (ICML), Beijing, China, June 2014.
http://arxiv.org/abs/2302.09634v1
2023-02-19T17:42:35
2023-02-19T17:42:35
Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity
Communication overhead has become one of the major bottlenecks in the distributed training of deep neural networks. To alleviate the concern, various gradient compression methods have been proposed, and sign-based algorithms are of surging interest. However, SIGNSGD fails to converge in the presence of data heterogeneity, which is commonly observed in the emerging federated learning (FL) paradigm. Error feedback has been proposed to address the non-convergence issue. Nonetheless, it requires the workers to locally keep track of the compression errors, which renders it not suitable for FL since the workers may not participate in the training throughout the learning process. In this paper, we propose a magnitude-driven sparsification scheme, which addresses the non-convergence issue of SIGNSGD while further improving communication efficiency. Moreover, the local update scheme is further incorporated to improve the learning performance, and the convergence of the proposed method is established. The effectiveness of the proposed scheme is validated through experiments on Fashion-MNIST, CIFAR-10, and CIFAR-100 datasets.
[ "Richeng Jin", "Xiaofan He", "Caijun Zhong", "Zhaoyang Zhang", "Tony Quek", "Huaiyu Dai" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09634v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09634v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity Richeng Jin 1 Xiaofan He 2 Caijun Zhong 1 Zhaoyang Zhang 1 Tony Quek 3 Huaiyu Dai 4 3 2 0 2 b e F 9 1 ] G L . s c [ 1 v 4 3 6 9 0 . 2 0 3 2 : v i X r a Abstract Communication overhead has become one of the major bottlenecks in the distributed train- ing of deep neural networks. To alleviate the concern, various gradient compression methods have been proposed, and sign-based algorithms are of surging interest. However, SIGNSGD fails to converge in the presence of data heterogene- ity, which is commonly observed in the emerg- ing federated learning (FL) paradigm. Error feedback has been proposed to address the non- convergence issue. Nonetheless, it requires the workers to locally keep track of the compression errors, which renders it not suitable for FL since the workers may not participate in the training In this paper, throughout the learning process. we propose a magnitude-driven sparsification scheme, which addresses the non-convergence is- sue of SIGNSGD while further improving commu- nication efficiency. Moreover, the local update scheme is further incorporated to improve the learning performance, and the convergence of the proposed method is established. The effective- ness of the proposed scheme is validated through experiments on Fashion-MNIST, CIFAR-10, and CIFAR-100 datasets. 1. Introduction The past decades have witnessed tremendous achievements of deep learning in a variety of areas. In practical train- ing of deep neural networks, it is often difficult, if not impossible, to store the whole training datasets in a sin- gle machine. Distributed stochastic gradient descent (D- SGD), which leverages the computational power of multi- ple computing machines, becomes a promising approach (Dean et al., 2012; Chen et al., 2016). D-SGD requires in- 1Zhejiang University, China. 2Wuhan University, China 3Singapore University of Technology and Design, Singapore. 4North Carolina State University, USA.. Correspondence to: Richeng Jin <[email protected]>. Preliminary work. tensive communications between the parameter server and the computing nodes for gradient information exchange. As a result, for the training of large deep neural networks, prohibitive communication overhead becomes one of the major bottlenecks. There are two popular approaches in the literature to al- leviate the communication burden: 1) reducing the num- ber of communication rounds by allowing the computing machines to perform multiple local SGD steps before in- formation exchange (e.g., FedAvg (McMahan et al., 2017), local SGD (Stich, 2019)); 2) reducing the message size through various compression methods, including quanti- zation (Alistarh et al., 2017; Wen et al., 2017; Wang et al., 2018), sparsification (Stich et al., 2018; Alistarh et al., 2018; Lin et al., 2018; Sahu et al., 2021) and their combi- nation (Basu et al., 2019). × Among the quantization schemes, SIGNSGD is of particular interest due to its communication efficiency and robustness In SIGNSGD, the comput- (Bernstein et al., 2018; 2019). ing machines transmit the signs of the gradients and there- fore achieve an improvement of 32 in communication efficiency. While SIGNSGD converges with the same rate as D-SGD with homogeneous data (Bernstein et al., 2018), it fails to converge in the presence of data heterogeneity (Chen et al., 2020a). Considering that heterogeneous data distribution is one of the major features in the emerging federated learning paradigm, there has been a surging in- terest in addressing the non-convergence issue of SIGNSGD. (Chen et al., 2020a) proposed to add unimodal noise to the gradients before taking the sign and proved a convergence rate of O(d3/4/T 1/4), in which d is the dimension of the gradients and T the total number of communication rounds. (Karimireddy et al., 2019; Zheng et al., 2019) addressed the non-convergence issue of SIGNSGD by incorporating the error-feedback mechanism, while (Safaryan & Richt ́arik, 2021) proposed stochastic sign gradient descent with mo- mentum (SSDM). Nonetheless, both the error-feedback and the momentum mechanisms require the workers to store errors or momentum locally, and therefore may not be directly applicable in FL in which only a portion of the workers participate in the training process during each round. Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity } {− 1, 0, +1 In this work, we further extend the theory on sign-based Instead of gradient descent methods to the ternary case. the signs, each coordinate of the gradients is mapped to the ternary . It essentially captures two important mechanisms to further improve communication efficiency: 1) sparsification, and 2) worker sampling. More specifi- cally, each coordinate of the gradient is mapped to 0 due to either sparsification or the fact that the worker is not sam- pled/selected for training. To this end, we first derive a suf- ficient condition for the convergence of the ternary-based gradient descent method, based on which a magnitude- driven sparsification mechanism is proposed to address the non-convergence issue of SIGNSGD. Then, the local update scheme on the worker side and the error-feedback scheme on the server side are incorporated to further improve the learning performance. The contribution of this paper is summarized as follows: 1. We extend the convergence analysis for sign-based gradient descent methods to ternary-based gradient descent in the presence of data heterogeneity, which takes two commonly adopted mechanisms in FL into consideration: sparsification and worker sampling. 2. Based on the analyses, a magnitude-driven sparsifi- cation mechanism is proposed to further improve the communication efficiency of SIGNSGD while address- ing its non-convergence issue. 3. We further incorporate the local update scheme at the worker side and the error-feedback mechanism at the parameter server side to improve the learning perfor- mance. The convergence of the proposed method is established, and the effectiveness of the proposed method is validated by experiments. 2. Related Works Quantization: QSGD (Alistarh et al., 2017), TernGrad (Wen et al., 2017), ATOMO (Wang et al., 2018), DIANA (Mishchenko et al., 2019), FedPAQ (Reisizadeh et al., 2020) and FedCOM (Haddadpour et al., 2021) proposed to use unbiased stochastic quantization schemes. Utilizing the unbiased nature of the adopted quantization methods, the convergence of the corresponding algorithms can be estab- lished. (Shlezinger et al., 2020) adopted vector quantiza- tion. (Horv ́ath et al., 2019) extended DIANA to a variance reduced variant, and (Li et al., 2020) proposed an acceler- ated version of DIANA. Sign-based Methods: Among all the quantization meth- ods, the sign-based gradient descent method pushes the compression to the limit by representing each coordinate in 1 bit and is therefore of particular research interest. The idea of sharing the signs of gradients in SGD can be traced back to 1-bit SGD (Seide et al., 2014). Al- though sign-based quantization is biased, (Carlson et al., 2015) and (Bernstein et al., 2018; 2019) showed theoret- ical and empirical evidence that sign-based gradient de- scent schemes achieve comparable performance with the vanilla SGD in the homogeneous data distribution scenario. (Safaryan & Richt ́arik, 2021) showed the convergence of SIGNSGD given the assumption that the element-wise prob- ability of wrong aggregation is less than 1 2 . In the presence of data heterogeneity, (Chen et al., 2020a) showed that the convergence of SIGNSGD is not guaranteed and proposed to add carefully designed noise to ensure a convergence 4 ), while (Jin et al., 2020) further incorpo- rate of O(d rated differential privacy. In this work, we address the non- convergence issue of SIGNSGD with heterogeneous data by incorporating sparsification, which further improves com- munication efficiency. 4 /T 3 1 Sparsification: The sparsification methods only keep a subset of the components of the gradients, resulting in a sparse representation of the original gradients. The Random-k scheme sparsifies the gradient vector by choos- ing k components uniformly at random (Stich et al., 2018), while the Top-k scheme selects k components with the largest magnitudes (Alistarh et al., 2018). Similarly, the Threshold-v scheme selects the components whose abso- lute values are larger than a given threshold v (Lin et al., 2018; Sahu et al., 2021). (Rothchild et al., 2020) incorpo- rated sketching, which approximates the top-k components of the gradients, into the FL framework. (Wangni et al., 2018) proposed an adaptive sparsification method to max- imize the sparsity given a constraint on the induced vari- ance. (Sattler et al., 2019a;b) proposed sparse ternary com- pression (STC), which combines Top-k sparsification and binarization. However, error feedback is usually needed on the worker side to compensate for the bias introduced by sparsification. Error-Compensated SGD: (Seide et al., 2014) corrected the quantization error of 1-bit SGD by adding error feed- back in subsequent updates and empirically achieved al- (Wu et al., 2018) proposed the most no accuracy loss. error-compensated SGD and proved its convergence for quadratic optimization with unbiased stochastic quanti- (Stich et al., 2018) proved the convergence of zations. the proposed error-compensated algorithm for strongly- convex loss functions, and (Alistarh et al., 2018) estab- lished the convergence of sparsified gradient methods with error compensation. (Tang et al., 2019) considered more general compressors with a bounded magnitude of er- ror, with error feedback on both the server side and the (Liu et al., 2020) proposed DORE, which worker side. compressed the gradient residual. (Basu et al., 2019) combined Top-k and Random-k sparsification with quan- tization and local update, along with error feedback. (Gao et al., 2021) further considered bidirectional compres- Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity sion. (Philippenko & Dieuleveut, 2021) proposed Artemis and provided a theoretical framework for bidirectional com- pression with heterogeneous data and partial worker partic- ipation, without considering the local update scheme. Sim- ilar to the error-feedback methods, they required the work- ers to keep track of the gradients. To address the non-convergence issue of sign-based methods, (Karimireddy et al., 2019) proposed EF-SIGNSGD, which combined the error compensation methods and SIGNSGD; however, only the single worker scenario was considered. (Zheng et al., 2019) further extended it to the multi-worker scenario and the convergence was established. (Safaryan & Richt ́arik, 2021) incorporated the momentum mechanism on the worker side. Nonetheless, both the error- feedback scheme and the momentum mechanism require all the workers to participate in training, which may not be feasible in practice. In this work, the proposed meth- ods do not require error feedback on the worker side, and therefore are compatible with the worker sampling mecha- nism in FL. (Horv ́ath & Richt ́arik, 2021) introduced a new compressor to transform contractive compressors into un- biased ones, and therefore alleviated the need for the error- feedback mechanism for biased compressors. However, it cannot be applied to address the issue of SIGNSGD without incurring additional communication overhead. Algorithm 1 Distributed Learning with Compressed Gradi- ent and Worker Sampling learning rate η, current hypothesis vector w(t), Input: M workers each with a local dataset Dm, the compressor m for each Q( * worker m, the aggregation rule for each communication round t = 0, 1, ..., T ) for workers, the compression budget B(t) ) for the server. 1 do ( * C The server selects a random set of workers S(t) for Each worker m S(t) do − Computes the local gradient g(t) m Sends ∆(t) m = Q(g(t) m , B(t) ∈ m ) back to the server end for The server pushes ̃g(t) = all the workers. P All the workers update w(t+1) = w(t) 1 S(t) C (cid:0) | | S(t) ∆(t) m ) to m ∈ η ̃g(t) − end for 3. Problem Setup We consider a typical distributed learning paradigm, in which M workers (denoted as ) collaboratively learn a global model. Formally, the goal of the workers is to solve the optimization problem of the form M M F (w) def= 1 M min Rd w ∈ fm(w), (1) m=1 X → in which fm : Rd R is the local objective function of worker m, which is defined by its local dataset, and w is the model parameters to be optimized. For a supervised learn- ing problem, there is a sample space I = X Y , where X is a space of feature vectors and Y is a label space. Given parameterized by d dimensional the hypothesis space R that mea- vectors, we define a loss function l : I sures the loss of prediction on the data point (x, y) I made with the hypothesis vector w In this case, . ∈ W fm(w) is defined as the empirical risk below W × → W × ∈ fm(w) = 1 Dm| X(xn,yn) ∈ | l(w; (xn, yn)), (2) Dm | Dm| where is the size of worker m's local dataset Dm. When the local datasets are homogeneously distributed, we have E[fm(w)] = F (w), where the expectation is over the training data distribution. In this work, we do not make any assumptions on the training data distribution, i.e., the train- ing data can be arbitrarily distributed across the workers. We consider a parameter server paradigm as in federated learning (McMahan et al., 2017), in which a parameter server coordinates the collaborative training of the M work- ers. During each communication round t, the parameter server selects a subset of workers to perform local model training. Each selected worker samples a batch of training examples, based on which it computes the stochastic gra- dient g(t) m . In this paper, gradient compression is adopted to improve communication efficiency. More specifically, instead of directly sharing the gradient g(t) m , the workers share a compressed version Q(g(t) m ) with the param- eter server, in which Q( m is * the parameter that specifies the compression budget (dis- cussed in detail in Section 4). After receiving the gradients from the selected workers, the parameter server aggregates ) and the collected gradients with some aggregation rule sends the aggregated gradient back to all the workers. Fi- nally, the workers update their local model parameters us- ing the aggregated gradient. The corresponding algorithm is presented in Algorithm 1. ) is the compressor and B(t) m , B(t) ( * C C ( * M ) = ) = sign( * For SIGNSGD with majority vote (Bernstein et al., 2018), ) and S(t) = . Intuitively, when Q( * the local training data are homogeneous across the work- ers, the gradients of the workers follow the same distribu- tion. Therefore, the workers are supposed to share the same magnitude, which can be discarded without ruining the con- vergence guarantees. In the heterogeneous data distribution scenario, however, the magnitude information captures the data heterogeneity, which cannot be discarded. Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity 4. The Convergence of Ternary-based Gradient Descent Methods In this section, we extend the convergence analysis for sign-based gradient descent to the ternary-based gradi- ent descent methods. More specifically, in Algorithm 1, Q(g(t) m,i, B(t) and ). Com- m ) ) = sign( * m ) further captures two sce- pared to sign( * narios: 1) gradient sparsification and 2) worker sampling, in which Q(g(t) m,i, B(t) m ) = 0 if the i-th coordinate of worker m's gradient is zeroed out or worker m is not selected. For ternary-based methods, we have the following theorem. 1, 0, 1 } m,i, B(t) ∈ {− ), Q(g(t) ( * C * * * M m=1 um 6 1, 0, 1 } m Theorem 1. Let u1, u2, , uM be M known and fixed real numbers with 1 = 0, and consider M random variables ˆum ∈ {− (which is the com- P pressed version of um), 1 M . Denote ≤ M m=1 um)) = pm, P (ˆum = P (ˆum = sign( 1 pm − M − M qm. Let ̄p = 1 m=1 qm. If ̄q > ̄p, M the probability of wrong aggregation is given by − M m=1 um)) = qm and P (ˆum = 0) = 1 M m=1 pm and ̄q = 1 M sign( 1 M P P ≤ P sign (cid:18) (cid:18) ˆum = sign (cid:19) M P 1 M m=1 X P 1 M M um (cid:18) (√ ̄q m=1 X (cid:19)(cid:19) √ ̄p)2]M . [1 (3) − − P P ≤ Remark 1. Theorem 1 considers the scalar case, which can be readily generalized to the vector case by apply- ing the result to each coordinate independently. More M specifically, sign( 1 m=1 um) can be understood as M the sign of the global gradient that we want to recover, ˆum is the compressed gradient shared by worker m, and M sign( 1 m=1 ˆum) is the aggregated result. Theorem 1 M suggests that when the average probability of wrong signs (i.e., ̄p) is less than that of correct signs (i.e., ̄q), there exists some M such that the probability of wrong aggre- gation is less than 1 2 , based on which the convergence can be established (c.f. Theorem 2). Intuitively, sup- M M pose that sign( 1 m=1 ˆum converges m=1 um) = 1, M in distribution to a Gaussian random variable with mean ̄p) > 0 according to the Lyapunov central limit M ( ̄q theorem. Therefore, the probability of wrong aggregation is strictly smaller than 1 2 . A similar argument holds for M sign( 1 1. m=1 um) = M P P − − P For SIGNSGD with large batch size and homogeneous data distribution, √ ̄q √ ̄p approaches 1, and therefore the prob- ability of wrong aggregation is small. Without any assump- tions on the data distribution, however, ̄q > ̄p is not guar- anteed for the deterministic sign( * − ). Given Theorem 1, we endeavor to propose a sparsification scheme such that ̄q > ̄p for an arbitrary realization of um's, which is defined as follows. ent vector gm, the proposed compressor outputs sparsign(g(t) m,i, B(t) m ) = sign(g(t) m,i), w.p. w.p. 1 g(t) m,i| g(t) m,i| is the i-th entry of gm and B(t) − | ( 0, | B(t) m,i, B(t) m,i, (4) in which g(t) m,i m,i ≤ controls the sparsity budget. More specifically, 1 g(t) | the expected number of non-zero entries is given by m,i| d i=1 | g(t) m,i| B(t) m,i. , 1 || || ∞ || ∀ and maxm gm|| gm||2 m,i = gm||∞ m,i = 1 Remark 2. Relation to TernGrad (Wen et al., 2017) and P 1-bit QSGD (Alistarh et al., 2017): the compressors in TernGrad and 1-bit QSGD can be understood as scaled ) with B(t) and versions of sparsign( * B(t) i, respectively. In addition, the output of the compressors in TernGrad and 1-bit QSGD are further gm||2, respec- scaled by the factors maxm || tively, to preserve the unbiasedness. Algorithm 1 is differ- ent from TernGrad and 1-bit QSGD in four aspects: 1) The aggregated gradient ̃g(t) in Algorithm 1 is a biased esti- mate of the true gradient. As a result, the convergence anal- ysis of Algorithm 1 is completely different from that of Tern- Grad and 1-bit QSGD. 2) It enjoys flexibility in adjusting the compression ratio by changing B(t) m,i's. 3) It enables compressed communication from the server to the workers. )), More specifically, for majority vote (i.e., ( ) = sign( * C * in communication overhead. 4) there is a reduction of 32 gm||2, gm||∞ It does not require the exchange of and therefore, is robust against re-scaling attacks that ma- nipulate the magnitudes (Jin et al., 2020). and × || || same umBmP (m in (3). S) | ∈A | ∈ the 1. Given Corollary in Theorem 1 and consider as ˆum = sparsign(um, Bm), 1 Let and A that um 6 um = sign( 1 M tively. ers, ̄q = 1 M = sign( 1 M M m=1 um), P P then ̄p = 1 M A ∀ m Let S denote the set of ≤ ≤ c denote the sets of workers M m=1 um), m m ∀ m * * * u1, u2, , uM random variables M . such and respec- selected work- and S) | ∈ A c, ∈ A ∈ | m m ∀ ∈ P m, i.e., ∈A | c ∈A um| Bps, ̄q = 1 M umBmP (m P Remark 3. When Bm = B and Pr(m S) = the workers are selected uniformly at ps, random and share the same Bm, we have ̄p = 1 Bps, which M ensures ̄q > ̄p. That being said, there always exists some M such that the probability of wrong aggregation P = sign M m=1 um − ≤ (cid:16) (cid:17)(cid:17) )2]M < 1 2 . um| Bps( Moreover, in this case, the right-hand side of (3) depends q on the worker sampling probability ps, i.e., a larger ps sug- gests a smaller probability of wrong aggregation. (cid:1) um| − S(t) ˆum (cid:16)P m um| 1 (cid:0)P M sign c ∈A ∈A | 1 M c | P P P P q ∈A [1 m m m ∈ | Definition 1. [The Proposed Compressor] Given a gradi- Given the above results, in the following, we show the con- 6 6 Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity vergence of Algorithm 1. In order to facilitate the conver- gence analysis, the following commonly adopted assump- tions are made. Assumption 1. (Lower Bound). For all w and some con- stant F ∗, we have objective value F (w) Assumption 2. (Smoothness). some non-negative constant L w1, w2, we require for ∀ F ∗. ≥ F (w1) F (w2) + F (w2), w1 − h∇ + w2i ≤ L 2 || w1 − 2 2, w2|| (5) , h* *i ∇ fm(w). is the standard inner product. where Assumption 3. (Unbiased Local Estimator) For any w ∈ Rd, each worker has access to an independent and unbi- ased estimator gm of the true local gradient fm(w), i.e., E[gm] = Assumption 4. Rd, For any w ∈ M 1 m=1 gm of estimator M M 1 fm(w) such that m=1 ∇ M 1 M (SPB: Success Probability Bounds). the workers have access to the true global gradient fm(w)i P sign = sign 1 M gm,i P M ∇ P M ∇ ! 6 (cid:19)(cid:19) (cid:18) m=1 X , ρi < (cid:18) 1 2 , ∀ m=1 X i, (6) fm(w)i are the i-th entry of gm and in which gm,i and ∇ fm(w), respectively. Assumption 4 is ∇ We note that Assumptions 1-3 are commonly adopted in the literature. introduced in (Safaryan & Richt ́arik, 2021), which holds under mild as- sumptions on gradient noise. Remark 4. Different from (Safaryan & Richt ́arik, 2021) that assumes SPB on each individual worker (and therefore cannot deal with heterogeneous data), Assumption 4 is a re- laxed version that concerns the average of the local gradi- ents from the workers. More specifically, it can be verified that if the training data sampling noise in each coordinate of the stochastic gradient is unimodal and symmetric about the mean (e.g., Gaussian) (Bernstein et al., 2018), Assump- tion 4 holds for an arbitrary realization of Theorem 2. Suppose Assumptions 1, 2 and 4 are satisfied, and the learning rate is set as η = 1 . Then by running Algorithm 1 (termed SPARSIGNSGD) with Q(g(t) m , B(t) m,i = B(t) sparsign(g(t) , ) = sign( ( * * T m ), where B(t) ) for T iterations, we have m ) = m, and fm(w)'s. m , B(t) √T d ∇ ∀ C d i 1 T ≤ ≤ (1 2ρi)(1 − − 2κ(t) i ) |∇ t=1 i=1 X X E[F (w(0)) (F (w(0)) F (w(T +1))]√d − √T F ∗)√d + L√d 2√T , − √T F (w(t))i| L√d 2√T + (7) where κ(t) i = E 1 B(t) i ps× − (cid:20)(cid:20) | 2 m m (cid:21) (cid:21) M M (cid:19) + P P 1 M 1 M ∈A(t) | M , such that g(t) m,i| 1 M g(t) P m,i| m,i) = m,i), respectively, and the expectation is m=1 g(t) m,i| 1 c M (t) | ∈A q c (t) are the set of workers P A m,i) and sign(g(t) m=1 g(t) M = sign( 1 M m=1 g(t) M (cid:18) r A(t) and P sign(g(t) m,i) sign( 1 M over the randomness of the gradients g(t) m . m=1 g(t) Remark 5. As long as P ( = 0) < 1, m,i| | there exists some M such that κ(t) i < 1 2 . In addition, it P can be observed that, if B(t) and ps are independent of κ(t) i = 0, which recovers the convergence M , limm rate of SIGNSGD with majority vote in the centralized sce- nario (Safaryan & Richt ́arik, 2021). That being said, the impact of data heterogeneity is mitigated in the large M In the ideal case where all the workers share regime. the same gradients, we can set B(t) i. As a result, we have κ(t) served that in the full gradient descent case (i.e., g(t) fm(w(t))i decreases, κ(t) g(t) m,i| i. Moreover, it can be ob- m = i ap- ∇ proaches 1. In this case, Algorithm 1 does not converge to the (local) optimum. Nonetheless, for SGD, we have i does not P ( | approach 1. This suggests that the stochasticity in SGD is P beneficial. P = 0) < 1, and therefore κ(t) fm(w(t))), as 1 M m=1 g(t) m,i| M m=1 ∇ i = 0, i = →∞ 1 M ∀ ∀ M | , i 5. SPARSIGNSGD with Local Updates Besides gradient compression, another popular approach to improve the communication efficiency is the local up- date scheme, which reduces the number of communication rounds needed for convergence (McMahan et al., 2017). The basic idea is to allow the workers to perform multiple local iterations during each communication round. In this section, we incorporate the local update scheme into SPARSIGNSGD, and the corresponding algorithm is pre- sented in Algorithm 2. More specifically, during each com- munication round, the parameter server selects a random set of workers, and each worker performs multiple local steps using the compressed gradients Q(g(t,c) m ) = sparsign(g(t,c) m ). After τ local steps, each worker transmits the compressed model update to the parameter server. The parameter server adopts an α-approximate x compressor (Karimireddy et al., 2019)) to aggregate the model updates and utilizes the error-feedback mechanism to compensate for the error introduced by the server-to-worker compres- sion. In our experiments, we adopt the scaled sign compres- m , B(t,c) m , B(t,c) 2 2 ≤ ) (i.e., (x) ( * ||C α) 2 2, (1 − − x x ∀ || || || C 6 Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity Algorithm 2 EF-SPARSIGNSGD with Local Updates m and B(t) ( * learning rate η, current hypothesis vector w(t), Input: M workers each with a local dataset Dm, the compres- sion budgets B(t,c) m for each worker m, the ag- ) for the server, residual error vector gregation rule ̃e(t). for each communication round t = 0, 1, ..., T Server selects a random set of workers S(t) for Each worker m m = w(t) S(t) do 1 do − ∈ C Set w(t,0) for Each local step c = 0, 1, ..., τ ηLQ(g(t,c) = w(t,c) m w(t,c+1) m 1 do − m , B(t,c) m ) end for Sends ∆(t) the server m = Q( − c=0 Q(g(t,c) τ − 1 m , B(t,c) m ), B(t) m ) to P end for Server pushes ̃g(t) = to all the workers. Server updates residual error C (cid:0) 1 S(t) | m ∈ | P 1.0 0.8 0.6 0.4 0.2 y t i l i b a b o r P n o i t a g e r g g A g n o r W 0.0 0 3000 2500 2000 1500 1000 500 l e u a V n o i t c n u F k c o r b n e s o R Deterministic Sign B = 0.01 B = 0.1 Deterministic Sign B = 0.01 B = 0.1 500 1000 Communication Rounds 1500 2000 0 0 500 1000 Communication Rounds 1500 2000 Figure1. The left figure shows the probability of wrong aggrega- tion and the right figure shows the Rosenbrock function value that is minimized. During each communication round, 10 out of 100 workers are randomly selected to participate in the training. B(t) l * 1, B(t) 1 T 1 T − m = B(t) g 1 m, B(t) ∀ * F (w(t)) || ≤ 2 l B(t) (F (w(0)) − Bτ √T g = B, we have F ∗)√d ||∇ t=0 X (1 + L + L2β)√d Bτ √T (9) + L2(τ + 1)(2τ + 1) 6T τ 2 . (cid:1) Remark 6. We note that different from Theorem 2, Theo- rem 3 does not require a large M . S(t) ∆(t) m + ̃e(t) + ̃e(t+1) = 1 S(t) | | Xm S(t) ∈ ∆(t) m + ̃e(t) − ̃g(t). (8) All workers update w(t+1) = w(t) end for ηηL ̃g(t) − C (x) = || x d sign(x)) (Karimireddy et al., 2019). sor (i.e., ||1 We note that different from the majority of existing works, the error-feedback mechanism is only adopted on the server side. Therefore, the proposed method is compatible with worker sampling in federated learning. ) } C ( * ∈ {− Different from the existing literature that uses full preci- sion gradients for local updates, Algorithm 2 adopts com- pression during the local training as well. On one hand, this mimics the gradient compression at the server side, es- . On the other hand, the pecially when 1, 0, 1 output of sparsign lies in the ternary set , and therefore is itself bounded by definition. In this sense, the difference between the global model and the local mod- els after local training is also bounded, which further al- leviates the impact of data heterogeneity. As a result, dif- ferent from the existing works in federated learning, e.g., (Li et al., 2018; Haddadpour et al., 2021), we do not need the bounded gradient dissimilarity assumption for conver- gence analysis. Formally, we have the following theorem. 1, 0, 1 {− } Theorem 3. When Assumptions 1, 2 and 3 are satisfied, by running Algorithm 2 with ηL = 1 m = , η = τ , B(t,c) √T dτ l ∞ and B(t) Remark 7. In the implementation of the sparsign com- pressor, there are multiple ways to set the compression bud- gets B(t) g . For instance, the magnitude sharing protocol in (Wen et al., 2017) can be adopted, in which the norm of the gradients, and the pa- workers share the L rameter server sets the compression budget by taking the In our experiments, we set maximum of the L ∞ some pre-determined values for B(t) and B(t) In this g . case, it is possible that the probabilities in Definition 1 fall out of [0, 1], and we round them to 0 or 1, respectively. This is equivalent to gradient clipping, which is commonly adopted in deep learning (Chen et al., 2020b; Zhang et al., 2022). norms. l 6. Experiments In this section, we first verify the theoretical results in Sec- tion 4 and demonstrate the effectiveness of the proposed compressor by comparing the probability of wrong aggre- gation between the deterministic sign and sparsign in the minimization of the Rosenbrock function. Then, we exam- ine the performance of the proposed algorithms on Fashion- MNIST, CIFAR-10 and CIFAR-100. 6.1. Minimization of the Rosenbrock Function In this subsection, we consider the minimization of the well-known Rosenbrock function with 10 variables as in (Safaryan & Richt ́arik, 2021): d F (x) = Fi(x), where Fi(x) = 100(xi+1 − i=1 X x2 i ) + (1 xi)2. − (10) Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity Table1. Learning Performance on Fashion-MNIST (α = 0.1) ALGORITHM FINAL ACCURACY COMMUNICATIONS ROUND TO ACHIEVE 74% COMMUNICATION OVERHEAD TO ACHIEVE 74% (BITS) SIGNSGD SCALED SIGNSGD NOISY SIGNSGD 1-BIT L2 NORM QSGD NORM QSGD 1-BIT L ∞ TERNGRAD SPARSIGNSGD (B = 1) EF-SPARSIGNSGD (B(t) l = 10, B(t) g = 1, τ = 1) 74.44 69.61 77.84 79.05 80.07 79.17 79.05 80.75 ± ± ± ± ± ± ± ± 0.71% 1.99% 0.37% 1.22% 0.75% 1.41% 0.39% 0.20% 193 N.A. 79 75 68 66 65 65 4.56 107 × N.A. 1.88 1.98 1.13 4.34 8.19 1.93 107 105 106 105 105 105 × × × × × × 1.0 0.8 0.6 0.4 0.2 y t i l i b a b o r P n o i t a g e r g g A g n o r W 0.0 0 3000 2500 2000 1500 1000 500 l e u a V n o i t c n u F k c o r b n e s o R 0 0 Deterministic Sign sparsign − 5% sparsign − 10% sparsign − 50% 500 1000 Communication Rounds 1500 2000 Deterministic Sign sparsign − 5% sparsign − 10% sparsign − 50% 500 1000 Communication Rounds 1500 2000 Figure2. The left figure shows the probability of wrong aggrega- tion and the right figure shows the Rosenbrock function value that is minimized. For "Deterministic Sign", all the workers are se- lected to participate in the training during each communication round. For sparsign, B = 0.01, and 5%, 10%, 50% workers are selected during each communication round, respectively. The collaborative training of M = 100 workers is consid- ered. To simulate the data heterogeneity, we assume that ), in each worker m has access to a scaled objective vmF ( * which vm is some random number such that M M vm = 1, 1vm<0 = 80. (11) } ∈ { m=1 X 0.01, 0.1 m=1 X The second condition suggests that the signs of the gradi- ents from 80 out of the 100 workers are opposite to those of the true gradients. Fig. 1 shows the probability of wrong ag- gregation and the Rosenbrock function value for determin- istic sign (i.e., SIGNSGD) and sparsign (i.e., SPARSIGNSGD) with B . It can be observed that the probabil- ity of wrong aggregation (i.e., the signs of the aggregated results are different from those of the true gradients) for the deterministic sign is 1, and SIGNSGD diverges, while the probability of wrong aggregation for sparsign is always smaller than 1 2 , and SPARSIGNSGD converges, which verifies the effectiveness of sparsign. Fig. 2 examines the impact of worker sampling. It can be observed that as the num- ber of selected workers increases, the probability of wrong aggregation decreases, and the algorithm converges faster, which validates our results in Remark 3. 6.2. Results on Fashion-MNIST and CIFAR-10 . { 0.0001, 0.001, 0.01, 0.1, 1.0 0.0001, 0.001, 0.01, 0.1, 1.0 } In this subsection, we implement our proposed meth- ods with a three-layer fully connected neural network on the Fashion-MNIST dataset and VGG-9 (Lee et al., 2020) on the CIFAR-10 dataset. For Fashion-MNIST, we use a fixed learning rate, which is tuned from the set For CIFAR- learning rate from the set 10, we tune the initial , which is reduced by a fac- { } tor of 2 at communication round 1,500. We consider a sce- nario of M = 100 normal workers and follow (Hsu et al., 2019) to simulate heterogeneous data distribution, in which the training data on each worker are drawn independently with class labels following a Dirichlet distribution. More specifically, a vector of length C that follows the Dirichlet distribution Dir(α) is generated, in which C is the num- ber of classes, and α controls the level of data heterogene- ity. Each element of the vector specifies the proportion of training examples that belong to the corresponding class. The mini-batch sizes of the workers are set to 128 and 32 for Fashion-MNIST and CIFAR-10, respectively. For the experiments on Fashion-MNIST, the test accuracy is evaluated for every communication round, while for those on CIFAR-10, it is evaluated for every 25 communication rounds. We compare the proposed methods with various base- including SIGNSGD (Bernstein et al., line compressors, 2018), Scaled SIGNSGD (Karimireddy et al., 2019), Noisy SIGNSGD (Chen et al., 2020a), TernGrad (Wen et al., 2017), QSGD (Alistarh et al., 2017) (including 1-bit L2 norm norm QSGD). More details can be QSGD and 1-bit L found in Section B in the supplementary material. Par- ticularly, Scaled SIGNSGD and Noisy SIGNSGD are pro- posed to address the non-convergence issue of SIGNSGD, while the compressor of QSGD is one of the most com- monly adopted quantization methods in the literature (e.g., (Reisizadeh et al., 2020; Haddadpour et al., 2021; ∞ Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity and obtain the communication overhead (in bits) for each communication round by following Theorem 3.4 in (Alistarh et al., 2017). It can be observed that the com- munication efficiency of EF-SPARSIGNSGD improves as the number of local steps increases from 1 to 20. In addition, EF-SPARSIGNSGD outperforms FedCom in both final accu- racy and the overall communication overhead to achieve a test accuracy of 74%, which demonstrates its effectiveness. Similar results are obtained on the CIFAR-100 dataset with , which can be found in Section D 0.1, 0.3, 0.6, 1.0 α of the supplementary material. ∈ { } 7. Conclusion In this work, we addressed the non-convergence issue of SIGNSGD in the presence of data heterogeneity. The con- vergence analysis for sign-based gradient descent methods was extended to the ternary case, which essentially cap- tured the sparsification and the worker sampling mecha- nisms in federated learning. A sufficient condition for the convergence of ternary-based gradient descent methods was derived, based on which a magnitude-driven gradient sparsification scheme was incorporated into the sign-based compressor to deal with heterogeneous data distributions. Based on the proposed compressor, two communication- efficient algorithms, SPARSIGNSGD and EF-SPARSIGNSGD are proposed, and the corresponding convergence is estab- lished. Extensive experiments are conducted to validate the effectiveness of the proposed algorithms. The pro- posed methods are expected to find wide applications in the paradigms like federated learning. CIFAR-10 CIFAR-10 0.8 0.6 0.4 0.2 y c a r u c c A g n i t s e T 0.8 0.6 0.4 0.2 y c a r u c c A g n i t s e T FedCom-Local1 FedCom-Local5 FedCom-Local10 FedCom-Local20 EF-SPARSIGNSGD-local1 EF-SPARSIGNSGD-local5 EF-SPARSIGNSGD-local10 EF-SPARSIGNSGD-local20 FedCom-Local1 FedCom-Local5 FedCom-Local10 FedCom-Local20 EF-SPARSIGNSGD-local1 EF-SPARSIGNSGD-local5 EF-SPARSIGNSGD-local10 EF-SPARSIGNSGD-local20 0 500 2000 1500 1000 Communication Round 2500 3000 0 2 4 6 Communication Overhead 8 ×109 Figure3. The left and right figures compare the testing accuracy of EF-SPARSIGNSGD and FedCom with respect to the number of communication rounds and the communication overhead, respec- tively. Philippenko & Dieuleveut, 2021)). ∞ We note that Scaled SIGNSGD and Noisy SIGNSGD use 1 bit to represent each coordinate of the gradients. 1-bit L2 norm QSGD, 1-bit L norm QSGD and TernGrad are ternary- based methods, which can be understood as special cases of SPARSIGNSGD. For all the ternary-based gradient descent methods, instead of using log2(3) bits to represent each co- ordinate as in (Wen et al., 2017), the lossless Golomb code (Golomb, 1966) can be adopted to encode the indices of the non-zeros elements. The average number of bits for each index is given by (Sattler et al., 2019a) ̄b = b∗ + 1 p)2b∗ , 1 (1 − − log2( log(√5+ 1 2 ) p) ) log(1 ⌋ − (12) and p is the sparsity in which b∗ = 1 + ratio. ⌊ Effectiveness of the compressor: Table 1 and Table 2 compare the performance of the proposed methods with the baselines. We run the algorithms for 200 and 3,000 commu- nication rounds for Fashion-MNIST and CIFAR-10, respec- tively. We consider full worker participation (i.e., all the 100 workers participate in the training process throughout the training period) for Fashion-MNIST and 20% worker participating ratio (i.e., 20 workers are randomly sam- pled to participate during each communication round) for CIFAR-10. The final test accuracy, the number of com- munication rounds, and the corresponding communication overhead (from the workers to the server) to achieve a test accuracy of 55%/74% are presented. "N.A." means that the corresponding algorithm does not achieve the required test accuracy. It can be observed that EF-SPARSIGNSGD outper- forms all the baselines in both the number of communica- tion rounds and the communication overhead. For instance, TernGrad requires 2.7 communication rounds and 27% more communication overhead to achieve a test accuracy of 74% on CIFAR-10, and the gap is larger for the other baselines. × Impact of the local training steps: Fig.3 and Ta- ble. 3 compare the performance of EF-SPARSIGNSGD and FedCom (Haddadpour et al., 2021) that incorporates the compressor of QSGD (Alistarh et al., 2017) into FedAvg (McMahan et al., 2017). We consider 8-bit QSGD as suggested in the experiments in (Haddadpour et al., 2021) Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity Table2. Learning Performance on CIFAR-10 (α = 0.5) ALGORITHM FINAL ACCURACY COMMUNICATIONS ROUNDS TO ACHIEVE 55%/74% COMMUNICATION OVERHEAD TO ACHIEVE 55%/74% (BITS) SIGNSGD SCALED SIGNSGD NOISY SIGNSGD 1-BIT L2 NORM QSGD NORM QSGD 1-BIT L ∞ TERNGRAD SPARSIGNSGD (B = 1) EF-SPARSIGNSGD (B(t) l = 10, B(t) g = 1, τ = 1) 55.35 46.86 74.41 54.58 74.52 74.92 62.34 78.51 ± ± ± ± ± ± ± ± 0.71% 2.72% 0.61% 0.35% 0.58% 0.42% 0.58% 0.51% 3,000/N.A. N.A./N.A. 625/2,600 N.A./N.A. 750/2,950 800/2,800 1,550/N.A. 300/1,025 1.15 1010/N.A. × N.A./N.A. 109/9.89 × N.A./N.A. 108/1.05 107/5.38 × × × 108/N.A. 109 109 108 × 107/4.24 108 × 2.31 1.64 9.61 × × 1.44 7.42 × Table3. Learning Performance on CIFAR-10 (α = 0.5) ALGORITHM FINAL ACCURACY COMMUNICATIONS ROUNDS TO ACHIEVE 74% COMMUNICATION OVERHEAD TO ACHIEVE 74% (BITS) FEDCOM-LOCAL5 FEDCOM-LOCAL10 FEDCOM-LOCAL20 EF-SPARSIGNSGD-LOCAL5 EF-SPARSIGNSGD-LOCAL10 EF-SPARSIGNSGD-LOCAL20 76.03 76.20 77.10 79.84 79.61 79.46 ± ± ± ± ± ± 0.53% 0.05% 0.29% 0.17% 0.25% 0.09% 1,025 575 425 550 450 475 2.75 1.51 1.10 3.39 2.58 2.14 109 109 109 108 108 108 × × × × × × References Alistarh, D., Grubic, D., Li, J., Tomioka, R., and Vojnovic, M. QSGD: Communication-efficient SGD via gradient quantization and encoding. In Advances in Neural Infor- mation Processing Systems, pp. 1709–1720, 2017. Alistarh, D., Hoefler, T., Johansson, M., Konstantinov, N., Khirirat, S., and Renggli, C. The convergence of sparsi- fied gradient methods. In Advances in Neural Informa- tion Processing Systems, pp. 5973–5983, 2018. Basu, D., Data, D., Karakus, C., and Diggavi, S. Qsparse- local-sgd: Distributed sgd with quantization, sparsifica- tion and local computations. Advances in Neural Infor- mation Processing Systems, 32, 2019. Bernstein, J., Wang, Y.-X., Azizzadenesheli, K., and Anandkumar, A. signSGD: Compressed optimisation for In International Conference on non-convex problems. Machine Learning, pp. 560–569, 2018. Bernstein, J., Zhao, J., Azizzadenesheli, K., and Anand- kumar, A. signSGD with majority vote is communica- tion efficient and byzantine fault tolerant. In In Seventh International Conference on Learning Representations (ICLR), 2019. Carlson, D., Hsieh, Y. P., Collins, E., Carin, L., and Cevher, V. Stochastic spectral descent for discrete graphical mod- els. IEEE Journal of Selected Topics in Signal Process- ing, 10(2):296–311, 2015. Chen, J., Pan, X., Monga, R., Bengio, S., and Jozefow- icz, R. Revisiting distributed synchronous sgd. arXiv preprint arXiv:1604.00981, 2016. Chen, X., Chen, T., Sun, H., Wu, S. Z., and Hong, M. Distributed training with heterogeneous data: Bridging In Advances in median- and mean-based algorithms. Neural Information Processing Systems, volume 33, pp. 21616–21626, 2020a. Chen, X., Wu, S. Z., and Hong, M. Understanding gra- dient clipping in private sgd: A geometric perspective. Advances in Neural Information Processing Systems, 33: 13773–13782, 2020b. Dean, J., Corrado, G., Monga, R., Chen, K., Devin, M., Mao, M., Senior, A., Tucker, P., Yang, K., Le, Q. V., et al. Large scale distributed deep networks. In Advances in neural information processing systems, pp. 1223–1231, 2012. Gao, H., Xu, A., and Huang, H. On the convergence of communication-efficient local sgd for federated learning. In Proceedings of the AAAI Conference on Artificial In- telligence, Virtual, pp. 18–19, 2021. Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity Golomb, S. Run-length encodings (corresp.). IEEE trans- actions on information theory, 12(3):399–401, 1966. Haddadpour, F., Kamani, M. M., Mokhtari, A., and Mah- davi, M. Federated learning with compression: Unified analysis and sharp guarantees. In International Confer- ence on Artificial Intelligence and Statistics, pp. 2350– 2358. PMLR, 2021. Horv ́ath, S. and Richt ́arik, P. A better alternative to error feedback for communication-efficient distributed learn- ing. International Conference on Learning Representa- tions, 2021. Horv ́ath, S., Kovalev, D., Mishchenko, K., Stich, S., and Richt ́arik, P. Stochastic distributed learning with gradi- ent quantization and variance reduction. arXiv preprint arXiv:1904.05115, 2019. Hsu, T.-M. H., Qi, H., and Brown, M. Measuring the effects of non-identical data distribution for federated visual classification. arXiv preprint arXiv:1909.06335, 2019. Jin, R., Huang, Y., He, X., Dai, H., and Wu, T. Stochastic- sign sgd for federated learning with theoretical guaran- tees. arXiv preprint arXiv:2002.10940, 2020. Karimireddy, S. P., Rebjock, Q., Stich, S., and Jaggi, M. Er- ror feedback fixes signSGD and other gradient compres- sion schemes. In International Conference on Machine Learning, pp. 3252–3261, 2019. Lee, C., Sarwar, S. S., Panda, P., Srinivasan, G., and Roy, K. Enabling spike-based backpropagation for training deep neural network architectures. Frontiers in neuroscience, 14, 2020. Li, T., Sahu, A. K., Zaheer, M., Sanjabi, M., Talwalkar, A., and Smith, V. Federated optimization in heterogeneous networks. arXiv preprint arXiv:1812.06127, 2018. Li, Z., Kovalev, D., Qian, X., and Richtarik, P. Accelera- tion for compressed gradient descent in distributed and federated optimization. In International Conference on Machine Learning, pp. 5895–5904. PMLR, 2020. Lin, Y., Han, S., Mao, H., Wang, Y., and Dally, B. Deep gra- dient compression: Reducing the communication band- width for distributed training. In International Confer- ence on Learning Representations, 2018. McMahan, B., Moore, E., Ramage, D., Hampson, S., and y Arcas, B. A. Communication-efficient learning of deep In Artificial Intelli- networks from decentralized data. gence and Statistics, pp. 1273–1282, 2017. Mishchenko, K., Gorbunov, E., Tak ́aˇc, M., and Richt ́arik, P. Distributed learning with compressed gradient differ- ences. arXiv preprint arXiv:1901.09269, 2019. Philippenko, C. and Dieuleveut, A. Bidirectional com- pression in heterogeneous settings for distributed or fed- erated learning with partial participation: tight conver- gence guarantees. arXiv preprint arXiv:2006.14591v3, 2021. Reisizadeh, A., Mokhtari, A., Hassani, H., Jadbabaie, A., and Pedarsani, R. Fedpaq: A communication-efficient federated learning method with periodic averaging and quantization. In Proceedings of the Twenty Third Inter- national Conference on Artificial Intelligence and Statis- tics, pp. 2021–2031. PMLR, Aug 2020. Rothchild, D., Panda, A., Ullah, E., Ivkin, N., Stoica, I., Braverman, V., Gonzalez, J., and Arora, R. Fetchsgd: Communication-efficient federated learning with sketch- ing. In International Conference on Machine Learning, pp. 8253–8265. PMLR, 2020. Safaryan, M. and Richt ́arik, P. Stochastic sign descent methods: New algorithms and better theory. In Interna- tional Conference on Machine Learning, pp. 9224–9234. PMLR, 2021. Sahu, A., Dutta, A., M Abdelmoniem, A., Banerjee, T., Canini, M., and Kalnis, P. Rethinking gradient sparsi- fication as total error minimization. Advances in Neural Information Processing Systems, 34, 2021. Sattler, F., Wiedemann, S., M ̈uller, K.-R., and Samek, W. Robust and communication-efficient federated learning IEEE transactions on neural net- from Non-iid data. works and learning systems, 31(9):3400–3413, 2019a. Sattler, F., Wiedemann, S., M ̈uller, K.-R., and Samek, W. Sparse binary compression: Towards distributed deep In 2019 Inter- learning with minimal communication. national Joint Conference on Neural Networks (IJCNN), pp. 1–8. IEEE, 2019b. Seide, F., Fu, H., Droppo, J., Li, G., and Yu, D. 1-bit stochastic gradient descent and its application to data- parallel distributed training of speech dnns. In Fifteenth Annual Conference of the International Speech Commu- nication Association, 2014. Liu, X., Li, Y., Tang, J., and Yan, M. A double resid- ual compression algorithm for efficient distributed learn- In International Conference on Artificial Intelli- ing. gence and Statistics, pp. 133–143. PMLR, 2020. Shlezinger, N., Chen, M., Eldar, Y. C., Poor, H. V., and Cui, S. Uveqfed: Universal vector quantization for federated learning. IEEE Transactions on Signal Processing, 69: 500–514, 2020. Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity Stich, S. U. Local SGD converges communicates ence on Learning Representations, 2019. https://openreview.net/forum?id=S1g2JnRcFX. and In International Confer- URL little. fast Stich, S. U., Cordonnier, J. B., and Jaggi, M. Sparsified SGD with memory. In Advances in Neural Information Processing Systems, pp. 4447–4458, 2018. Tang, H., Yu, C., Lian, X., Zhang, T., and Liu, J. Dou- blesqueeze: Parallel stochastic gradient descent with double-pass error-compensated compression. In Interna- tional Conference on Machine Learning, pp. 6155–6165. PMLR, 2019. Wang, H., Sievert, S., Liu, S., Charles, Z., Papailiopoulos, D., and Wright, S. ATOMO: Communication-efficient learning via atomic sparsification. In Advances in Neural Information Processing Systems, pp. 9850–9861, 2018. Wangni, J., Wang, J., Liu, J., and Zhang, T. Gradient spar- sification for communication-efficient distributed opti- mization. Advances in Neural Information Processing Systems, 31, 2018. Wen, W., Xu, C., Yan, F., Wu, C., Wang, Y., Chen, Y., and Li, H. TernGrad: Ternary gradients to reduce commu- In Advances in nication in distributed deep learning. neural information processing systems, pp. 1509–1519, 2017. Wu, J., Huang, W., Huang, J., and Zhang, T. Error compen- sated quantized SGD and its applications to large-scale distributed optimization. In International Conference on Machine Learning, pp. 5325–5333, 2018. Zhang, X., Chen, X., Hong, M., Wu, S., and Yi, J. Under- standing clipping for federated learning: Convergence In International and client-level differential privacy. Conference on Machine Learning, pp. 26048–26067. PMLR, 2022. Zheng, S., Huang, Z., and Kwok, J. Communication- efficient distributed blockwise momentum sgd with error-feedback. Advances in Neural Information Pro- cessing Systems, 32:11450–11460, 2019. Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity A. Proofs A.1. Proof of Theorem 1 , uM be M known and fixed real numbers with 1 M Theorem 1. Let u1, u2, ables ˆum ∈ {− 1, 0, 1 } pm, P (ˆum = sign( 1 M If ̄q > ̄p, the probability of wrong aggregation is given by * * * (which is the compressed version of um), 1 M m=1 um)) = qm and P (ˆum = 0) = 1 − m P ≤ ≤ qm. Let ̄p = 1 pm − M m=1 um 6 M . Denote P (ˆum = = 0, and consider random vari- M m=1 um)) = M m=1 qm. sign( 1 M M m=1 pm and ̄q = 1 P M − M P P sign (cid:18) (cid:18) 1 M M ˆum = sign m=1 X (cid:19) 1 M (cid:18) M um m=1 X (cid:19)(cid:19) [1 − ≤ (√ ̄q P √ ̄p)2]M . − P (13) (14) (15) (16) Proof. Define a series of random variables { Xm} 1, Xm =    Then, we have M m=1 given by if ˆum 6 if ˆum = 0, = sign 0, 1, − if ˆum = sign 1 M 1 M (cid:18) (cid:18) P P M m=1 um M m=1 um , (cid:19) . (cid:19) M M P sign ˆum = sign um = P (cid:18) (cid:18) m=1 X (cid:19) (cid:18) m=1 X (cid:19)(cid:19) M m=1 X Xm ≥ 0 . ! For any variable a > 0, we have M P Xm ≥ which is due to Markov's inequality, given the fact that ea P (Xm = 1) = pm and P (Xm = 1) = qm, we have, m=1 X = P ! ≥ (cid:16) P 0 ea M m=1 Xm e0 P E[ea M m=1 Xm ] e0 P ≤ = E[ea P M m=1 Xm ], M (cid:17) m=1 Xm is non-negative. For the ease of presentation, let − E[ea P M m=1 Xm ] = eln(E[ea M P m=1 Xm ]) = eln( Q m=1 ln(eapm+e−aqm+(1 M M m=1 pm E[eaXm ]) = e qm)) M m=1 ln(E[eaXm ]) P = e P = eM( 1 M P − m=1 ln(eapm+e−aqm+(1 − M eM ln(ea ̄p+e−a ̄q+(1 ̄p − − ̄q)), pm − qm))) (17) − ≤ M m=1 qm and the inequality is due to Jensen's inequality. Suppose that ̄q > ̄p and let eM ln(ea ̄p+e−a ̄q+(1 − ̄p − ̄q)) = [2√ ̄p ̄q + (1 ̄p − − ̄q)]M = [1 (√ ̄q − − √ ̄p)2]M , (18) where ̄p = 1 M ̄q ̄p a = ln (cid:16)q (cid:17) M m=1 pm, ̄q = 1 M > 0, then P P which completes the proof. A.2. Proof of Corollary 1 Corollary 1. Given the same u1, u2, 1 m ≤ sign( 1 M S) | M . Let M m=1 um), m and ̄q = 1 M P and m A ∀ c ∈A ≤ | * * * , uM as in Theorem 1 and consider random variables ˆum = sparsign(um, Bm), = sign( 1 and um = M M m=1 um), m c denote the sets of workers such that um 6 A c, respectively. Let S denote the set of selected workers, then ̄p = 1 M ∈ A umBmP (m in (3). P umBmP (m ∀ m ∈ A ∈A | ∈ S) | P ∈ P Proof. For Q( * ) given by (4), we have pm = 0, ( umBm Pr(m S), ∈ 0, if um ≤ if um > 0. (19) 6 6 Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity qm = − ( umBm Pr(m S), ∈ 0, if um < 0, if um ≥ 0. (20) With some algebra, we can show that ̄p = 1 M A.3. Proof of Theorem 2 m ∈A | P umBm Pr(m S) | ∈ and ̄q = 1 M m c ∈A | umBm Pr(m . S) | ∈ P Theorem 2. Suppose Assumptions 1, 2 and 4 are satisfied, and the learning rate is set as η = 1 Algorithm 1 (termed SPARSIGNSGD) with Q(g(t) m , B(t) sign( * m ) = sparsign(g(t) ) for T iterations, we have m )), where B(t) √T d m,i = B(t) m , B(t) i . Then by running , m, and ∀ ) = ( * C T d 1 T (1 − 2ρi)(1 − t=1 X i=1 X 2κ(t) i ) F (w(t))i| ≤ |∇ E[F (w(0)) F (w(T +1))]√d − √T + L√d 2√T (21) ≤ (F (w(0)) − √T 2 F ∗)√d + L√d 2√T , M where κ(t) − 1  m,i = E       g(t) m,i B(t) i ps   1 M such that sign tation is over the randomness of the gradients g(t) (cid:17) m . = sign m,i (cid:17) (cid:16) (cid:16) M m=1 g(t) P and sign M m=1 g(t) | 1 M P g(t) m,i| + r m,i| 1 M 1 M r P m∈Ac (t) | m∈A (t) | P g(t) m,i g(t) m,i|   = sign ,  A(t) and c (t) are the set of workers A    m=1 g(t) M m,i , respectively, and the expec-    1 M (cid:16) (cid:17) (cid:16) P (cid:17) The proof of Theorem 2 follows the well-known strategy of relating the norm of the gradient to the expected improvement of the global objective in a single iteration. Then accumulating the improvement over the iterations yields the convergence rate of the algorithm. Proof. According to Assumption 2, we have F (w(t+1)) F (w(t)) − F (w(t)), w(t+1) ≤ h∇ w(t) − L 2 || w(t+1) w(t) 2 || − + i M Q(g(t) m , B(t) m ) i (cid:19) m=1 X M Q(g(t) m , B(t) m ) i (cid:19) d = η − = η − = η − F (w(t)), sign h∇ 1 M (cid:18) F (w(t)), sign h∇ F (w(t)) ||1 + ||∇ 1 M (cid:18) Lη2d 2 m=1 X + 2η where yields F (w(t))i is the i-th entry of the vector ∇ ∇ + + ηsign L 2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Lη2d (cid:12) (cid:12) 2 1 M (cid:18) M m=1 X Q(g(t) m , B(t) m ) 2 (cid:19)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) F (w(t))i| |∇ 1 sign( 1 M M m=1 Q(g(t) m ,B(t) m )i) =sign( F (w(t) )i), ∇ P (22) F (w(t)) and η is the learning rate. Taking expectation on both sides i=1 X E[F (w(t+1)) F (w(t))] η ≤ − − d ||∇ F (w(t)) ||1 + Lη2d 2 (23) + 2ηE (cid:20) Denote ρi = P sign 1 M i=1 X M F (w(t))i| |∇ P sign (cid:18) m=1 g(t) m,i = sign( ∇ (cid:16) (cid:16) P (cid:17) M 1 M (cid:18) m=1 X F (w(t))i) (cid:17) Q(g(t) m , B(t) m )i = sign( F (w(t))i) ∇ (cid:19)(cid:21) (cid:19) and 6 6 6 6 Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity φi = P sign (cid:16) sign E P (cid:20) 1 M (cid:16) 1 M M m=1 Q(g(t) m , B(t) m )i = sign 1 M M m=1 g(t) m,i , we have Q(g(t) m , B(t) m )i (cid:17) = sign ! 6 M P m=1 X (cid:16) P F (w(t))i ∇ (cid:16) (cid:17)(cid:17) = E[φi(1 ! (cid:21) (cid:17) ρi) + (1 − − φi)ρi] = E[(1 2ρi)φi + ρi] − M 2 ρi + (1 ≤ 2ρi)E  1  −      1 M −    v u u t | c Xm (t) ∈A 1 M m,iB(t) g(t) i ps| − v u u t | Xm ∈A(t) m,iB(t) g(t) i ps|   M 2        = ρi + (1 2ρi)E  1  B(t) i ps  − −        v u u t = ρi + (1 − 2ρi)E       1 − B(t) i ps        r 1 M 1 M 1 M = ρi + (1 , ρi + (1 2ρi)E      2ρi)κ(t) i − − B(t) i ps   1 −    .    r 1 M m P 1 M | g(t) m,i| − v u u t c Xm (t) ∈A Xm ∈A(t) | g(t) m,i|          2 M g(t) m,i| − g(t) m,i| + m c ∈A (t) | P m P c ∈A (t) | g(t) m,i| g(t) m,i| ∈A(t) | 1 M m ∈A(t) | P 1 M m q P | 1 M g(t) P m,i| M m=1 g(t) m,i| 1 M + c ∈A (t) | q P m ∈A(t) | g(t) m,i|      2    M                   where sign 1 M A(t) and c (t) are the set of workers such that sign A m=1 g(t) , respectively. m,i M Plugging (24) into (23), we can obtain P (cid:17) (cid:16) g(t) m,i = sign 1 M (cid:16) (cid:17) (cid:16) P M m=1 g(t) m,i (24) and sign g(t) m,i = (cid:17) (cid:16) (cid:17) E[F (w(t+1)) F (w(t))] − ≤ − ≤ − η η ||∇ d i=1 X F (w(t)) Lη2d 2 ||1 + d + 2η F (w(t))i| [ρi + (1 − 2ρi)κ(t) i ]. |∇ (1 − 2ρi)(1 − 2κ(t) i ) |∇ i=1 X F (w(t))i| + Lη2d 2 Adjusting the above inequality and averaging both sides over t = 1, 2, , T , we can obtain η(1 − 2ρi)(1 − 2κ(t) i ) F (w(t))i| ≤ |∇ * * * E[F (w(0)) F (w(T +1))] + Lη2d 2 − T 1 T T d t=1 X i=1 X Letting η = 1 √dT and dividing both sides by η gives 1 T T d t=1 X i=1 X (1 − 2ρi)(1 − which completes the proof. 2κ(t) i ) F (w(t))i| ≤ |∇ E[F (w(0)) F (w(T +1))]√d − √T + L√d 2√T (F (w(0)) − √T F ∗)√d + L√d 2√T , ≤ (25) (26) (27) 6 6 Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity A.4. Proof of Theorem 3 Theorem 3. When Assumptions 1, 2 and 3 are satisfied, by running Algorithm 2 with ηL = 1 B(t) g = B, we have m = B(t) l B(t) 1 g √T dτ , η = τ , B(t,c) m = B(t) l 1, * F (w(t)) || 2 ≤ (F (w(0)) F ∗)√d − Bτ √T + (1 + L + L2β)√d Bτ √T + L2(τ + 1)(2τ + 1) 6T τ 2 . * m, B(t) ∀ 1 T 1 T − ||∇ t=0 X Before proving Theorem 3, we first show the following lemmas. Lemma 1. Let y(t) = w(t) − ηηL ̃e(t), we have y(t+1) = y(t) ηηL − 1 S(t) | | Xm S(t) ∈ ∆(t) m . Proof. y(t+1) = w(t+1) = w(t) = w(t) = w(t) − − − ηηL ̃e(t+1) − ηηL ̃g(t) ηηL (cid:18) | 1 S(t) ηηL | − 1 S(t) ηηL ̃e(t+1) ∆(t) m + ̃e(t) ̃e(t+1) − − (cid:19) ηηL ̃e(t+1) | Xm S(t) ∈ ∆(t) m − ηηL ̃e(t) | Xm S(t) ∈ = y(t) ηηL − 1 S(t) | ∆(t) m . | Xm S(t) ∈ Lemma 2. There exists a positive constant β > 0 such that E[ ̃e(t) 2 2] || ≤ || βd, t. ∀ (28) (29) (30) Proof. Since ( * C ) is an α-approximate compressor, it can be shown that 2 1 S(t) ̃e(t+1) E || 2 2 ≤ || (1 − (1 − ≤ α) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) | | Xm S(t) ∈ ̃e(t) 2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) α) (cid:18) 1 + 2 2 + (1 − || α)(1 + ρ)E || ∆(t) m + ̃e(t) t [(1 α)(1 + ρ)]t − j(1 − − α) 1 + (cid:18) 1 ρ ≤ j=0 X (1 ≤ 1 α) 1 + 1 ρ (cid:18) (cid:19) α)(1 + ρ) d, − (1 − − 2 2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (31) 1 S(t) 1 ρ E E (cid:19) | (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 (cid:12) (cid:12) S(t) | Xm S(t) ∈ ∆(j) m (cid:19) | (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) | Xm S(j) ∈ ∆(t) m 2 2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) where we invoke Young's inequality recurrently and ρ can be any positive constant. Therefore, there exists some constant β > 0 such that E[ ̃e(t) βd, t. 2 2] || ≤ || ∀ Now, we are ready to prove Theorem 3. Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity Proof. Let y(t) = w(t) ηηL ̃e(t), according to Lemma 1, we have E[F (y(t+1)) − − F (y(t))] ≤ − ηηLE (cid:20) F (y(t)), h∇ | 1 S(t) + ∆(t) m i (cid:21) L 2 E ηηL 1 S(t) | Xm S(t) ∈ F (y(t)), 1 S(t) | (cid:12) (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∆(t) m i (cid:21) | Xm | S(t) ∈ Lη2η2 E L 2 + 1 S(t) ∆(t) m 2 2(cid:21) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) | Xm S(t) ∈ | (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) | Xm S(t) ∈ . = ηηLE (cid:20) F (w(t)) h∇ − ∇ ηηLE (cid:20) − F (w(t)), h∇ 1 S(t) | | Xm S(t) ∈ ∆(t) m i (cid:21) ∆(t) m 2 2(cid:21) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) The second term can be bounded as follows. Lη2η2 L 2 E | We then bound the first term, in particular, we have 1 S(t) (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) F (w(t)) h∇ F (y(t)), − ∇ 1 S(t) | | Xm S(t) ∈ ∆(t) m i ≤ (32) (33) (34) Ld Lη2η2 2 . ≤ ∆(t) m || 2 2 + 1 2ηηL ||∇ F (w(t)) F (y(t)) || − ∇ 2 2 ∆(t) m || 2 2 + ∆(t) m || 2 2 + L2 2ηηL || L2ηηL 2 y(t) w(t) 2 2 || − ̃e(t) 2 2 || || ∆(t) m || 2 2 + L2ηηL 2 βd ∆(t) m 2 (cid:12) (cid:12) (cid:12) (cid:12) 2(cid:21) (cid:12) (cid:12) (cid:12) (cid:12) | Xm S(t) ∈ | Xm S(t) ∈ | Xm S(t) ∈ | Xm S(t) ∈ L2ηηLβd 2 | Xm S(t) ∈ ηηL 2 || ηηL ≤ 2 || = ηηL 2 || ηηL ≤ 2 || 1 S(t) 1 S(t) 1 S(t) 1 S(t) | | | | ηηLd 2 + ≤ l E 1, B(t) When B(t,c) m = B(t) F (w(t)), where the second inequality is due to the L-smoothness of F . m = B(t) ∆(t) m i (cid:21) τ Q( * 1 S(t) F (w(t)), Q(g(t,c) m , B(t,c) | Xm S(t) ∈ 1 S(t) h∇ h∇ − − = E 1 ∀ (cid:20) − 1 | * g (cid:20) | | Xm S(t) ∈ m ), B(t) m ) i (cid:21) m, we can bound the last term as follows. c=0 X τ − B(t) g 1 c=0 X 1 − τ B(t) l ∇ fm(w(t,c) m ) i (cid:21) E E = − = − h∇ (cid:20) h∇ (cid:20) F (w(t)), 1 S(t) F (w(t)), | | Xm S(t) ∈ l B(t) B(t) g S(t) | = E (cid:20) F (w(t)), h∇ − B(t) l B(t) g B(t) l B(t) g − 1 M B(t) l B(t) g τ = − M τ 1 − m=1 X c=0 X F (w(t)) || ||∇ F (w(t)) i (cid:21) ∇ c=0 X 1 τ − | Xm S(t) ∈ M 1 M m=1 X c=0 X fm(w(t,c) m ) i (cid:21) ∇ = − E (cid:20) F (w(t)), B(t) l B(t) g h∇ fm(w(t,c) m ) + B(t) l B(t) g ∇ 1 M M τ 1 − m=1 X c=0 X F (w(t)) ∇ 1 M M τ 1 − m=1 X c=0 X fm(w(t,c) m ) i (cid:21) ∇ 2 2 + E (cid:20) F (w(t)), h∇ − B(t) l B(t) g 1 M M τ 1 − m=1 X c=0 X fm(w(t,c) m ) + B(t) l B(t) g ∇ 1 M M τ 1 − m=1 X c=0 X ∇ . F (w(t)) i (cid:21) (35) Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity M τ 1 − m=1 X M c=0 X τ − 1 m=1 X E c=0 X 1 M 1 √τ (cid:20) 2 + E (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) fm(w(t,c) m ) M τ 1 − m=1 X 1 √τ c=0 X 1 M (cid:20) 2 (cid:21)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 (cid:12) (cid:12) √τ (cid:21) 1 M (cid:20) 2 + E (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) l B(t) B(t) (cid:12) (cid:12) g 2 M τ 1 − m=1 X c=0 X M τ 1 − F (w(t)), h∇ − E (cid:20) B(t) l B(t) g 1 M 1 M = B(t) l B(t) g h∇ F (w(t)), E (cid:20) = B(t) l B(t) g h √τ F (w(t)), ∇ = B(t) l B(t) 2 g √τ || (cid:20) F (w(t)) || ∇ M τ 1 − −∇ c=0 X F (w(t)) || ∇ m=1 X √τ || F (w(t)) || ||∇ 2 + F (w(t)) || ||∇ 2 + F (w(t)) || ||∇ 2 + l B(t) B(t) g 2M 2τ l B(t) B(t) 2M g E 1 √τ 1 M (cid:12) (cid:12) (cid:20) (cid:12) (cid:12) (cid:12) (cid:12) B(t) l B(t) (cid:12) (cid:12) 2 g (cid:20) l B(t) B(t) g τ 2 l B(t) B(t) g τ 2 l B(t) B(t) g τ 2 l B(t) B(t) g τ 2 − ≤ ≤ = ≤ ≤ (cid:12) (cid:12) (cid:20) (cid:12) (cid:12) (cid:12) (cid:12) M (cid:12) (cid:12) m=1 X 1 τ − c=0 X E m=1 X c=0 X τ M 1 − m=1 X c=0 X fm(w(t,c) m ) + B(t) l B(t) g ∇ 1 M M τ 1 − fm(w(t,c) m ) + −∇ 1 M fm(w(t,c) m ) + −∇ F (w(t)) i (cid:21) ∇ m=1 X 1 − τ c=0 X fm(w(t)) (cid:21) i ∇ M m=1 X M τ 1 − c=0 X 1 M m=1 X fm(w(t)) (cid:21) ∇ i fm(w(t,c) m ) + −∇ c=0 X 1 M 1 M M τ 1 − m=1 X c=0 X M τ 1 − 2 fm(w(t)) ∇ (cid:21)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (36) fm(w(t,c) m ) + m=1 X 1 M 1 √τ (cid:20) M τ − E (cid:12) (cid:12) (cid:12) (cid:12) E (cid:12) (cid:12) (cid:12) (cid:12) −∇ c=0 X M τ − 1 ( ∇ c=0 X fm(w(t)) m=1 X 1 ( ∇ fm(w(t)) − ∇ fm(w(t,c) m )) − ∇ fm(w(t)) ∇ m=1 c=0 X X fm(w(t,c) m )) 2 (cid:21) (cid:21)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 2 (cid:12) (cid:21)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:21)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) fm(w(t)) fm(w(t,c) m ) || − ∇ 2 ||∇ F (w(t)) || ||∇ 2 + g L2 l B(t) B(t) 2M w(t) E || w(t,c) m || 2. − In addition, we have w(t) E || w(t,c) m || − (w(t) − − 1 c − j=0 X 2 = E w(t) (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ηLQ(g(t,j) m , B(t,j) m )) (cid:12) (cid:12) (cid:12) (cid:12) 2 (cid:21) (cid:12) (cid:12) (cid:12) (cid:12) = E (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 c − j=0 X ηLQ(g(t,j) m , B(t,j) m ) (cid:12) (cid:12) (cid:12) (cid:12) 2 (cid:12) (cid:12) (cid:12) (cid:12) Lc2d. η2 ≤ (cid:21) (37) Plugging (36) and (37) into (35) yields 1 S(t) F (w(t)), h∇ − E (cid:20) ∆(t) m i (cid:21) | Xm S(t) ∈ | B(t) l B(t) g τ = − F (w(t)) || ||∇ 2 2 + E (cid:20) F (w(t)), h∇ − B(t) l B(t) g 1 M M τ 1 − m=1 X c=0 X fm(w(t,c) m ) ∇ + B(t) l B(t) g 1 M B(t) l B(t) g τ ≤ − M τ 1 − ∇ c=0 X F (w(t)) || F (w(t)) i (cid:21) l B(t) B(t) g τ 2 2 2 + m=1 X ||∇ F (w(t)) || ||∇ 2 + g L2 l B(t) B(t) 2M (38) M τ 1 − m=1 X c=0 X Lc2d η2 l B(t) B(t) g τ 2 l B(t) B(t) g τ 2 = − = − F (w(t)) || ||∇ 2 + F (w(t)) || ||∇ 2 + l B(t) B(t) g L2η2 2M l B(t) B(t) g L2η2 2 Ld Ld M τ 1 − c2 c=0 X m=1 X τ (τ + 1)(2τ + 1) 6 Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity Plugging (33), (34) and (38) into (32) yields E[F (y(t+1)) η2η2 Ld 2 + ≤ F (y(t))] − L2η2η2 Lβd 2 + Ld Lη2η2 2 − l B(t) B(t) g τ ηηL 2 F (w(t)) || ||∇ 2 + g L2ηη3 Ld l B(t) B(t) 2 τ (τ + 1)(2τ + 1) 6 . (39) Rewriting (39) and taking average over t = 0, 1, 2, 1 T T 1 − t=0 X F (w(t)) || ||∇ 2 ≤ T 1 − t=0 X 2E[F (y(t)) − l B(t) B(t) g τ ηηLT , T F (y(t+1))] * * * − + 1 on both sides yields (ηηL + LηηL + L2ηηLβ)d l B(t) B(t) g τ + L2η2 Ld(τ + 1)(2τ + 1) 6 . (40) Taking ηL = 1 , η = τ and w(0) = y(0) and B(t) l B(t) g = B, F (w(t)) || ||∇ 2 ≤ (F (w(0)) F ∗)√d − Bτ √T + t yields ∀ (1 + L + L2β)√d Bτ √T + L2(τ + 1)(2τ + 1) 6T τ 2 . (41) √T dτ T 1 − 1 T t=0 X Remark 8. Despite not requiring the bounded gradient dissimilarity assumption, another assumption that we implicitly make is m, i, t, as in Definition 1. This can be easily satisfied given the bounded gradient assump- , g(t) m,i| ≤ | 1 B(t) l ∀ tion, which is commonly adopted in the literature (e.g., (Tang et al., 2019; Karimireddy et al., 2019; Chen et al., 2020a; Zheng et al., 2019)) that aims to address the non-convergence issue of SIGNSGD. More specifically, Theorem 3 suggests that 1 when limT B√T can find some B(t) →∞ = 0, the convergence of Algorithm 2 is guaranteed. For any fixed B(t) g , if limT g(t) m,i| √T | →∞ = 0, we such that g(t) m,i| ≤ l | m, i, t, for some a < 1 ∀ and limT 1 B(t) l 2 , the convergence is guaranteed by setting B(t) 1 B√T →∞ g(t) m,i| ≤ | T a, a. In this case, however, the as 1 −a) ) with respect to the number of communication rounds. On the other algorithm converges with a slower rate of O( T ( 1 hand, as we discussed in Definition 1, the sparsity of the compressor is proportional to B. As an example, if we use log2(d) bits to encode the positions of the non-zero entries of the compressed gradients, the communication overhead for each communication round is proportional to B as well. Therefore, the convergence rate with respect to the communication overhead remains the same. l = T − 2 = 0 are satisfied simultaneously. That being said, as long B. Details about the Baselines We compare the proposed methods with the following baselines. • SIGNSGD (Bernstein et al., 2018): each worker adopts the sign compressor and transmits the signs of the gradients. • Scaled SIGNSGD (Karimireddy et al., 2019): each worker m transmits || which g(t) m is the local stochastic gradient. g(t) m ||1 d sign(g(t) m ) to the parameter server, in • Noisy SIGNSGD (Chen et al., 2020a): each worker m first adds a zero-mean Gaussian noise n to the gradients, and m + n). In our experiments, we tune the then applies the sign compressor. More specifically, it transmits sign(g(t) variance of the noise from the set and present the best results. 0.001, 0.01, 0.1, 1.0 { } Qs(g(t) in which s is the quantization level and ξ(g(t) • QSGD (Alistarh et al., 2017): For the gradient g(t) m , worker m compresses it to m ||2sign(g(t) g(t) m , s), m , s) = m , s) is defined as follows. g(t) m,i| | g(t) m,i||2 otherwise, l s , w.p. 1 l+1 s , m )ξ(g(t) m,i, s) = ξ(g(t) + l, − || || s   in which 0 ≤ l < s is some integer such that g(t) m,i| |  g(t) m,i||2 ∈ || s , l+1 [ l s ]. (42) (43) Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity • 1-bit L2 norm QSGD: we set s = 1 in QSGD. • 1-bit L norm QSGD, we set s = 1 and replace ∞ || • TernGrad (Wen et al., 2017): For the gradient g(t) g(t) m,i||2 with g(t) m,i||∞ || in QSGD. m , worker m compresses it to ternarize(g(t) m ) = stsign(g(t) m , st) is defined as follows. and ξ(g(t) m )ξ(g(t) m , st), in which st = maxm || g(t) m ||∞ ξ(g(t) m,i, st) = C. Details of the Implementation 0,    1, w.p. | s g(t) m,i| st otherwise. , (44) (45) Our experiments are mainly implemented using Python 3.8 with packages tensorflow 2.4.1 and numpy 1.19.2. Two Intel(R) Xeon(R) Platinum 8280 CPUs and 8 Tesla V100 GPUs are used in the experiments. C.1. Dataset and Pre-processing We perform experiments on the standard MNIST dataset, the CIFAR-10 dataset and the CIFAR-100 dataset. MNIST is for handwritten digit recognition consisting of 60,000 training samples and 10,000 testing samples. Each sample is a 28 28 size gray-level image. We normalize the data by dividing it with the max RGB value (i.e., 255.0). The CIFAR-10 dataset contains 50,000 training samples and 10,000 testing samples. Each sample is a 32 32 color image. The CIFAR-100 dataset is similar to CIFAR-10, but with 100 classes. The data are normalized with zeor-centered mean. 32x32 color images. × × C.2. Neural Network Setting For Fashion-MNIST, we implement a three-layer fully connected neural network with softmax of classes with cross-entropy loss. The two hidden layers has 256 and 128 hidden ReLU units, respectively. For CIFAR-10, we implement VGG-9 with 7 convolution layers. It has two contiguous blocks of two convolution layers with 64 and 128 channels, respectively, followed by a max-pooling, then it has one blocks of three convolution layers with 256 channels followed by max-pooling, and at last, we have one dense layer with 512 hidden units. For CIFAR-100, we implement VGG-11 with 8 convolution layers. It has four contiguous blocks of two convolution layers with 64, 128, 256 and 512 channels, respectively, followed by a max-pooling, then it has two dense layers with 1024 hidden units. D. Results on CIFAR-100 In this section, we present the results on the CIFAR-100 dataset. we tune the initial learning rate from the set , which is reduced by factors of 2, 5, and 10 at communication round 1,000, 3,000, and 4,500, 0.0001, 0.001, 0.01, 0.1, 1.0 { } . It respectively. We consider a scenario of M = 100 normal workers and examine the scenarios of α can be observed from Table 4-7 that EF-SPARSIGNSGD outperforms FedCom in all the examined scenarios, which validates the effectiveness of the proposed method. 0.1, 0.3, 0.6, 1.0 ∈ { } Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity Table4. Learning Performance on CIFAR-100 (α = 0.1) ALGORITHM FINAL ACCURACY COMMUNICATIONS ROUNDS TO ACHIEVE 40% COMMUNICATION OVERHEAD TO ACHIEVE 40% (BITS) FEDCOM-LOCAL5 FEDCOM-LOCAL10 FEDCOM-LOCAL20 EF-SPARSIGNSGD-LOCAL5 EF-SPARSIGNSGD-LOCAL10 EF-SPARSIGNSGD-LOCAL20 39.76 40.45 40.65 43.13 46.65 46.83 ± ± ± ± ± ± 0.27% 0.16% 0.67% 0.51% 0.43% 0.43% N.A. 4,200 4,225 1,350 1,125 1,300 N.A. 1.76 1.77 1.71 1.52 1.41 × × × × × 1010 1010 109 109 109 Table5. Learning Performance on CIFAR-100 (α = 0.3) ALGORITHM FINAL ACCURACY COMMUNICATIONS ROUNDS TO ACHIEVE 40% COMMUNICATION OVERHEAD TO ACHIEVE 40% (BITS) FEDCOM-LOCAL5 FEDCOM-LOCAL10 FEDCOM-LOCAL20 EF-SPARSIGNSGD-LOCAL5 EF-SPARSIGNSGD-LOCAL10 EF-SPARSIGNSGD-LOCAL20 42.50 42.35 42.41 51.66 52.37 52.16 ± ± ± ± ± ± 0.63% 0.29% 0.57% 0.52% 0.31% 0.30% 2,050 1,325 1,400 1,025 825 925 8.58 5.55 5.86 1.38 1.12 9.71 109 109 109 109 109 108 × × × × × × Table6. Learning Performance on CIFAR-100 (α = 0.6) ALGORITHM FINAL ACCURACY COMMUNICATIONS ROUNDS TO ACHIEVE 40% COMMUNICATION OVERHEAD TO ACHIEVE 40% (BITS) FEDCOM-LOCAL5 FEDCOM-LOCAL10 FEDCOM-LOCAL20 EF-SPARSIGNSGD-LOCAL5 EF-SPARSIGNSGD-LOCAL10 EF-SPARSIGNSGD-LOCAL20 42.57 42.71 43.62 51.36 52.59 51.41 ± ± ± ± ± ± 0.24% 0.37% 0.39% 0.20% 0.06% 0.17% 1,775 1,050 1,025 1,025 875 1,025 7.43 4.40 4.29 1.33 1.15 1.07 109 109 109 109 109 109 × × × × × × Table7. Learning Performance on CIFAR-100 (α = 1.0) ALGORITHM FINAL ACCURACY COMMUNICATIONS ROUNDS TO ACHIEVE 40% COMMUNICATION OVERHEAD TO ACHIEVE 40% (BITS) FEDCOM-LOCAL5 FEDCOM-LOCAL10 FEDCOM-LOCAL20 EF-SPARSIGNSGD-LOCAL5 EF-SPARSIGNSGD-LOCAL10 EF-SPARSIGNSGD-LOCAL20 40.90 42.40 42.59 51.01 52.17 51.37 ± ± ± ± ± ± 0.97% 0.31% 0.65% 0.16% 0.22% 0.29% 3,075 1,075 1,025 1,025 875 1,025 1.29 4.50 4.29 1.33 1.10 1.01 × × × × × × 1010 109 109 109 109 109
http://arxiv.org/abs/2302.09632v1
2023-02-19T17:37:24
2023-02-19T17:37:24
HomoDistil: Homotopic Task-Agnostic Distillation of Pre-trained Transformers
Knowledge distillation has been shown to be a powerful model compression approach to facilitate the deployment of pre-trained language models in practice. This paper focuses on task-agnostic distillation. It produces a compact pre-trained model that can be easily fine-tuned on various tasks with small computational costs and memory footprints. Despite the practical benefits, task-agnostic distillation is challenging. Since the teacher model has a significantly larger capacity and stronger representation power than the student model, it is very difficult for the student to produce predictions that match the teacher's over a massive amount of open-domain training data. Such a large prediction discrepancy often diminishes the benefits of knowledge distillation. To address this challenge, we propose Homotopic Distillation (HomoDistil), a novel task-agnostic distillation approach equipped with iterative pruning. Specifically, we initialize the student model from the teacher model, and iteratively prune the student's neurons until the target width is reached. Such an approach maintains a small discrepancy between the teacher's and student's predictions throughout the distillation process, which ensures the effectiveness of knowledge transfer. Extensive experiments demonstrate that HomoDistil achieves significant improvements on existing baselines.
[ "Chen Liang", "Haoming Jiang", "Zheng Li", "Xianfeng Tang", "Bin Yin", "Tuo Zhao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09632v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09632v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.LG" ]
3 2 0 2 b e F 9 1 ] L C . s c [ 1 v 2 3 6 9 0 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 HOMODISTIL: HOMOTOPIC TASK-AGNOSTIC DISTIL- LATION OF PRE-TRAINED TRANSFORMERS Chen Liang(cid:63)∗, Haoming Jiang(cid:5), Zheng Li(cid:5), Xianfeng Tang(cid:5), Bin Yin(cid:5) & Tuo Zhao(cid:63) (cid:63)Georgia Institute of Technology, (cid:5) Amazon {cliang73,tourzhao}@gatech.edu, {jhaoming,amzzhe,xianft,alexbyin}@amazon.com ABSTRACT Knowledge distillation has been shown to be a powerful model compression ap- proach to facilitate the deployment of pre-trained language models in practice. This paper focuses on task-agnostic distillation. It produces a compact pre-trained model that can be easily fine-tuned on various tasks with small computational costs and memory footprints. Despite the practical benefits, task-agnostic distil- lation is challenging. Since the teacher model has a significantly larger capacity and stronger representation power than the student model, it is very difficult for the student to produce predictions that match the teacher's over a massive amount of open-domain training data. Such a large prediction discrepancy often dimin- ishes the benefits of knowledge distillation. To address this challenge, we propose Homotopic Distillation (HomoDistil), a novel task-agnostic distillation approach equipped with iterative pruning. Specifically, we initialize the student model from the teacher model, and iteratively prune the student's neurons until the target width is reached. Such an approach maintains a small discrepancy between the teacher's and student's predictions throughout the distillation process, which ensures the effectiveness of knowledge transfer. Extensive experiments demonstrate that Ho- moDistil achieves significant improvements on existing baselines1. 1 INTRODUCTION Pre-trained language models have demonstrated powerful generalizability in various downstream applications (Wang et al., 2018; Rajpurkar et al., 2016a). However, the number of parameters in such models has grown over hundreds of millions (Devlin et al., 2018; Raffel et al., 2019; Brown et al., 2020). This poses a significant challenge to deploying such models in applications with latency and storage requirements. Knowledge distillation (Hinton et al., 2015) has been shown to be a powerful technique to compress a large model (i.e., teacher model) into a small one (i.e., student model) with acceptable performance degradation. It transfers knowledge from the teacher model to the student model through regulariz- ing the consistency between their output predictions. In language models, many efforts have been devoted to task-specific knowledge distillation (Tang et al., 2019; Turc et al., 2019; Sun et al., 2019; Aguilar et al., 2020). In this case, a large pre-trained model is first fine-tuned on a downstream task, and then serves as the teacher to distill a student during fine-tuning. However, task-specific distillation is computational costly because switching to a new task always requires the training of a task-specific teacher. Therefore, recent research has started to pay more attention to task-agnostic distillation (Sanh et al., 2019; Sun et al., 2020; Jiao et al., 2019; Wang et al., 2020b; Khanuja et al., 2021; Chen et al., 2021), where a student is distilled from a teacher pre-trained on open-domain data and can be efficiently fine-tuned on various downstream tasks. Despite the practical benefits, task-agnostic distillation is challenging. The teacher model has a significantly larger capacity and a much stronger representation power than the student model. As a result, it is very difficult for the student model to produce predictions that match the teacher's ∗Work done while interning at Amazon. 1Checkpoints will be released soon. 1 Published as a conference paper at ICLR 2023 Figure 1: Left: In HomoDistil, the student is initialized from the teacher and is iteratively pruned through the distillation process. The widths of rectangles represent the widths of layers. The depth of color represents the sufficiency of training. Right: An illustrative comparison of the student's optimization trajectory in HomoDistil and standard distillation. We define the region where the prediction discrepancy is sufficiently small such that the distillation is effective as the Effective Dis- tillation Region. In HomoDistil, as the student is initialized with the teacher and is able to maintain this small discrepancy, the trajectory consistently lies in the region. In standard distillation, as the student is initialized with a much smaller capacity than the teacher's, the distillation is ineffective at the early stage of training. over a massive amount of open-domain training data, especially when the student model is not well- initialized. Such a large prediction discrepancy eventually diminishes the benefits of distillation (Jin et al., 2019; Cho & Hariharan, 2019; Mirzadeh et al., 2020; Guo et al., 2020; Li et al., 2021). To reduce this discrepancy, recent research has proposed to better initialize the student model from a subset of the teacher's layers (Sanh et al., 2019; Jiao et al., 2019; Wang et al., 2020b). However, selecting such a subset requires extensive tuning. To address this challenge, we propose Homotopic Distillation (HomoDistil), a novel task-agnostic distillation approach equipped with iterative pruning. As illustrated in Figure 1, we initialize the student model from the teacher model. This ensures a small prediction discrepancy in the early stage of distillation. At each training iteration, we prune a set of least important neurons, which leads to the least increment in loss due to its removal, from the remaining neurons. This ensures the prediction discrepancy only increases by a small amount. Simultaneously, we distill the pruned student, such that the small discrepancy can be further reduced. We then repeat such a procedure in each iteration to maintain the small discrepancy through training, which encourages an effective knowledge transfer. We conduct extensive experiments to demonstrate the effectiveness of HomoDistil in task-agnostic distillation on BERT models. In particular, HomoBERT distilled from a BERT-base teacher (109M) achieves the state-of-the-art fine-tuning performance on the GLUE benchmark (Wang et al., 2018) and SQuAD v1.1/2.0 (Rajpurkar et al., 2016a; 2018) at multiple parameter scales (e.g., 65M and 10 ∼ 20M). Extensive analysis corroborates that HomoDistil maintains a small prediction discrep- ancy through training and produces a better-generalized student model. 2 PRELIMINARY 2.1 TRANSFORMER-BASED LANGUAGE MODELS Transformer architecture has been widely adopted to train large neural language models (Vaswani et al., 2017; Devlin et al., 2018; Radford et al., 2019; He et al., 2021). It contains multiple identically constructed layers. Each layer has a multi-head self-attention mechanism and a two-layer feed- forward neural network. We use f (*; θ) to denote a Transformer-based model f parameterized by θ, where f is a mapping from the input sample space X to the output prediction space. We define the loss function L(θ) = Ex∼X [(cid:96)(f (x; θ))], where (cid:96) is the task loss.2 2.2 TRANSFORMER DISTILLATION Knowledge Distillation trains a small model (i.e., student model) to match the output predictions of a large and well-trained model (i.e., teacher model) by penalizing their output discrepancy. Specif- 2For notational simplicity, we will omit x throughout the rest of the paper. 2 Published as a conference paper at ICLR 2023 ically, we denote the teacher model as ft(θt) and the student model as fs(θs), and consider the following optimization problem: min θs L(θs) + DKL(θs, θt), (1) where DKL(θs, θt) is the KL-Divergence between the probability distributions over their output predictions, i.e., KL(fs(θs)||ft(θt)). Transformer Distillation. In large Transformer-based models, distilling knowledge from only the output predictions neglects the rich semantic and syntactic knowledge in the intermediate layers. To leverage such knowledge, researchers have further matched the hidden representations, attention scores and attention value relations at all layers of the teacher and the student (Romero et al., 2014; Sun et al., 2019; 2020; Jiao et al., 2019; Hou et al., 2020; Wang et al., 2020b;a). 2.3 TRANSFORMER PRUNING Pruning is a powerful compression approach which removes redundant parameters without signifi- cantly deteriorating the full model performance Han et al. (2015b;a); Paganini & Forde (2020); Zhu & Gupta (2017); Renda et al. (2020); Zafrir et al. (2021); Liang et al. (2021). Importance Score. To identify the redundant parameters, researchers estimate the importance of each parameter based on some scoring metrics. A commonly used scoring metric is the sensitivity of parameters (Molchanov et al., 2017; 2019; Theis et al., 2018; Lee et al., 2019; Ding et al., 2019; Xiao et al., 2019). It essentially approximates the change in the loss magnitude when this parameter is completely zeroed-out (LeCun et al., 1990; Mozer & Smolensky, 1989). Specifically, we denote θ = [θ0, ..., θJ ] ∈ RJ , where θj ∈ R for j = 1, ..., J denotes each parameter. We further define θj,−j = [0, ..., 0, θj, 0, ..., 0] ∈ RJ . Then we define the sensitivity score as S ∈ RJ , where Sj ∈ R computes the score of θj as Sj = |θ(cid:62) j,−j∇θL(θ)|. (2) This definition is derived from the first-order Taylor expansion of L(*) with respect to θj at θ. Specifically, Sj approximates the absolute change of the loss given the removal of θj: θ(cid:62) j,−j∇θL(θ) ≈ L(θ) − L(θ − θj,−j). (3) The parameters with high sensitivity are of high importance and should be kept (Lubana & Dick, 2020). Parameters with low sensitivity are considered redundant, and can be safely pruned with only marginal influence on the model loss. Other importance scoring metrics include the magnitude of parameters Han et al. (2015b) and the variants of sensitivity, e.g., movement score (Sanh et al., 2020), sensitivity score with uncertainty (Zhang et al., 2022), and second-order expansion of Eq 3 (LeCun et al., 1990). Iterative Pruning gradually zeroes out the least important parameters throughout the training pro- cess. Specifically, given a gradient updated model θ(t) at the t-th training iteration, iterative prun- ing methods first compute the importance score S(t) following Eq 2, then compute a binary mask M (t) ∈ RJ as M (t) j = (cid:26) 1 0 if S(t) j is in the top r(t) of S(t), otherwise. ∀j = 1, ..., J. (4) where r(t) ∈ (0, 1) is the scheduled sparsity at the t-th iteration determined by a monotonically decreasing function of t. Then the model is pruned as M (t) (cid:12) θ(t), where (cid:12) denotes the Hadamard product. Such a procedure is repeated through training. Structured Pruning. Pruning the model in the unit of a single parameter leads to a highly sparse subnetwork. However, the storage and computation of sparse matrices are not often optimized on commonly used computational hardware. Structured pruning resolves this issue by pruning the model in the unit of a structure, e.g., a neuron, an attention head, or a feed-forward layer (Wang et al., 2019; Michel et al., 2019; Liang et al., 2021; Hou et al., 2020; Lagunas et al., 2021). To estimate the importance score of a structure, existing works compute the expected sensitivity with respect to the structure's output (Michel et al., 2019; Liang et al., 2021; Kim & Awadalla, 2020). 3 Published as a conference paper at ICLR 2023 3 METHOD We introduce Homotopic Distillation, as illustrated in Figure 1. Specifically, we initialize the student model from the teacher model. At each iteration, we prune the least important neurons from the student and distill the pruned student. We repeat such a procedure throughout the training process. Task-Agnostic Distillation. We consider the following losses to optimize the student model: 1) The knowledge distillation loss as defined in Eq 1. In task-agnostic distillation, L is the loss for continual pre-training of the student model on the open-domain data, e.g., the masked language modeling loss for BERT, LMLM. 2) The Transformer distillation losses. Specifically, we penalize the discrepancy between the teacher's and the student's hidden representations at both the intermediate and embedding layers, and the attention scores at the intermediate layers. We denote the hidden t ∈ R|x|×dt and representations at the k-th intermediate layer of the teacher and the student as H k s ∈ R|x|×ds, where dt and ds denote the hidden dimension and |x| denotes the sequence length. H k The distillation loss of the hidden representations at the intermediate layers is defined as: Lhidn(θs, θt) = K (cid:88) k=1 MSE(H k t , H k s W k hidn). Here MSE(*, *) is the mean-squared error, and W k able linear projection that projects H k the hidden representations at the embedding layer is defined as s into the same space as H k hidn ∈ Rds×dt is a randomly initialized and learn- t . Similarly, the distillation loss of Lemb(θs, θt) = MSE(Et, EsWemb), where Et ∈ R|x|×dt and Es ∈ R|x|×ds are the hidden representations at the embedding layer and Wemb ∈ Rds×dt is for dimension matching. Finally, the attention distillation loss is defined as Lattn(θs, θt) = K (cid:88) k=1 MSE(Ak t , Ak s ), t ∈ R|x|×|x| and Ak s ∈ R|x|×|x| are the attention score matrices averaged by the number where Ak of heads at the k-th layer. These transformer distillation losses aim to capture the rich semantic and syntactic knowledge from the teacher's layers and improve the generalization performance of the student. In summary, the student is optimized based on the weighted sum of all losses, i.e., Ltotal = LMLM + α1DKL + α2Lhidden + α3Lemb + α4Lattn, (5) where α1, α2, α3, α4 ≥ 0 are hyper-parameters. Iterative Neuron Pruning. We initialize the student model from a pre-trained teacher model as θ(0) s = θt. At the t-th training iteration, we update the student model based on Ltotal defined in Eq 5 using an SGD-type algorithm, e.g., − η∇θ(t−1) where η is the step size. Then we compute the importance score for all parameters following Eq 2: , θt), s ← θ(t−1) θ(t) Ltotal(θ(t−1) s s s S(t) j = |θ(t) s (cid:62) j,−j∇θ(t) s Ltotal(θ(t) s , θt)| ∀j = 1, ..., J. (6) For any weight matrix W (t) ∈ Rdin tance score as S(t) N (t) W ∈ Rds , where W ∈ Rdin s ×ds in the student model, we denote its corresponding impor- s ×ds. We then define the importance score for individual columns as N (t) W i = (cid:107)S(t) W [:,i](cid:107)1 ∀i = 1, ..., ds. (7) Notice that the score is computed based on Ltotal, which consists of both the distillation and training losses. This is to ensure that we only prune the columns whose removal would lead to the least increment in both the prediction discrepancy and the training loss. 4 Published as a conference paper at ICLR 2023 We then compute the binary mask M (t) as W ∈ Rdin s ×ds associated with the weight matrix following Eq 4 (cid:26) M (t) W [:,i] = 1 if N (t) 0 W i is in the top r(t) of N (t) W , otherwise, ∀i = 1, ..., ds, (8) where r(t) is the scheduled sparsity determined by a commonly used cubically decreasing function (Zhu & Gupta, 2017; Sanh et al., 2020; Zafrir et al., 2021): r(t) =  1  rf + (1 − rf ) rf  (cid:16) 1 − t−ti tf −ti (cid:17)3 0 ≤ t < ti ti ≤ t < tf tf ≤ t < T. Here rf is the final sparsity, T is the number of total training iterations and 0 ≤ ti < tf ≤ T are hyper-parameters. Such a schedule ensures that the sparsity is slowly increasing and the columns are gradually pruned. This prevents a sudden drop in the student's prediction performance, which effectively controls the expansion of prediction discrepancy. Finally, we prune the weight matrix as W (t) (cid:12) M (t) W . We also prune the corresponding rows of the next weight matrix in the forward computation, including {W k k=1 and Wemb. The same pruning procedure is applied to all weight matrices in the model. The complete algorithm is shown in Alg. 1. hidn}K Algorithm 1 HomoDistil: Homotopic Distillation 1: Input: θt: the teacher model. T, ti, tf , rf , α1, α2, α3, α4: Hyper-parameters. 2: Output: θ(T ) 3: θ(0) s = θt. 4: for t = 1, ..., T do 5: s . Compute loss Ltotal following Eq 5. s ← θ(t−1) θ(t) Compute importance score S(t) following Eq 6. for all W (t) ∈ θ(t) − η∇θ(t−1) Ltotal. s do s s Compute importance score for individual columns, N (t) Compute binary mask M (t) W (t) ←− W (t) (cid:12) M (t) W . W following Eq 8. W , following Eq 7. 6: 7: 8: 9: 10: 11: 12: 13: end for end for Why do we impose sparsity requirements on individual weight matrices? Traditional pruning imposes requirements on the global sparsity of the model instead of the local sparsity of the indi- vidual matrices. As a result, some matrices have much larger widths than the others. These wide matrices can be the memory bottlenecks for commonly used computational hardware. Furthermore, it requires re-configurations of the pre-defined model architectures in deep learning software pack- ages to achieve the desired inference speedup. In contrast, controlling the local sparsity is more friendly to both hardware and software. 4 EXPERIMENTS We evaluate HomoDistil on BERT-base (Devlin et al., 2018) on natural language understanding (NLU) and question answering tasks. 4.1 DATA Continual Pre-training. We distill the student using the open-domain corpus for BERT pre-training (Devlin et al., 2018), i.e., Wikipedia 3, an English Wikipedia corpus containing 2500M words, and 3https://dumps.wikimedia.org/enwiki/ 5 Published as a conference paper at ICLR 2023 Toronto BookCorpus (Zhu et al., 2015), containing 800M words. We clean the corpus by removing tables, lists and references following BERT. We then pre-process the cleaned corpus by concatenat- ing all sentences in a paragraph and truncating the concatenated passage by length of 128 following TinyBERT (Jiao et al., 2019). We tokenize the corpus with the vocabulary of BERT (30k). Fine-tuning. We fine-tune the student model on both NLU and question answering tasks. For NLU tasks, we adopt the commonly used General Language Understanding Evaluation (GLUE) bench- mark (Wang et al., 2018), which contains nine tasks, e.g., textual entailment, semantic similarity, etc. For question answering tasks, we adopt the SQuAD v1.1 and v2.0 (Rajpurkar et al., 2016a; 2018). Details about the datasets are deferred to Appendix A.1. 4.2 MODEL We evaluate HomoDistil on pre-trained BERT-base (Devlin et al., 2018), which contains 12 Trans- former layers with hidden dimension 768. BERT-base is pre-trained with masked language modeling and next sentence prediction tasks on Wikipedia and Toronto BookCorpus (16GB). We use BERT- base as the teacher model and as the initialization of the student model. We produce multiple student models at several sparsity ratios. Table 1 lists the architectures of the teacher and the student models. Table 1: Architectures of the teacher and the student models. Model BERT-base (Teacher) HomoBERT-base HomoBERT-small HomoBERT-xsmall HomoBERT-tiny Params (million) Embedding Backbone Total dhidn dffn 23.4 17.6 7.8 7.3 7.2 85.5 47.8 9.4 8.3 6.8 109 65 17.3 15.6 14.5 768 576 256 240 224 3072 2304 1024 960 896 4.3 BASELINES We compare HomoDistil with the state-of-the-art task-agnostic distillation baselines.4 These meth- ods initialize the student directly as the target size and fix its size during distillation. For example, to obtain a shallow model, the student is often initialized from a subset of teacher's layers. DistilBERT (Sanh et al., 2019) considers the vanilla distillation by penalizing the final layer predic- tion discrepancy using Eq 1. TinyBERT-GD (General Distillation) (Jiao et al., 2019) extends DistilBERT by exploiting the knowledge in the intermediate Transformer layers using Eq 5. MiniLM (Wang et al., 2020b) penalizes the discrepancy between the queries-keys scaled dot prod- uct and values-values scaled dot product in the final layer self-attention module. MiniLMv2 (Wang et al., 2020a) extends MiniLM by encouraging the student to mimic the attention head relations of the teacher. 4.4 IMPLEMENTATIONS DETAILS Continual Pre-training. For all experiments, we use a max sequence length of 128 and a batch size of 4k. We train the student model for T = 28k steps (3 epochs). We use Adam (Kingma & Ba, 2014) as the optimizer with β = (0.9, 0.999), (cid:15) = 1 × 10−6. We use a learning rate of 3 × 10−4 for HomoBERT-base and 6 × 10−4 for HomoBERT-small/xsmall/tiny. We adopt a linear decay learning rate schedule with a warmup ratio of 0.1. For distillation, we share all weights of Whidn and {W k k=1. We set α1, α2, α3, α4 to be 1 for all experiments. For importance score computation, we select neurons based on the exponential moving average of the importance score for stability. For pruning schedule, we set the initial iteration ti as 0 and select the final iteration tf from {0.5, 0.7, 0.9} × T . Full implementation details are deferred to Appendix A.2. Fine-tuning. We drop the masked language modeling prediction head and Whidn and {W k k=1 from the continual pre-training stage, and randomly initialize a task-specific classification head for emb}K emb}K 4We mainly compare with baselines that use BERT-base as the teacher model for a fair comparison. We also present a comprehensive comparison with task-specific distillation baselines in Appendix A.4. 6 Published as a conference paper at ICLR 2023 the student model. For NLU tasks, we select the training epochs from {3, 6}, batch size from {16, 32} and learning rate from {2, 3, 4, 5, 6, 7} × 10−5. For RTE, MRPC and STS-B, we initialize the student from a MNLI-fine-tuned student to further improve the performance for all baselines. For question answering tasks, we fine-tune the student for 2 epochs with a batch size of 12, and adopt a learning rate of 1 × 10−4. For all tasks, we use Adam as the optimizer with with β = (0.9, 0.999), (cid:15) = 1 × 10−6. Full implementation details are deferred to Appendix A.3. 4.5 MAIN RESULTS Table 2 show the fine-tuning results of HomoDistil on the GLUE development set. We report the median over five random seeds for all experiments in this paper 5. HomoBERT-base consistently outperforms existing state-of-the-art baselines over six out of eight tasks, and achieves significant gains on MNLI, SST-2 and CoLA. The margins of gains become much more prominent for students with 10 ∼ 20M parameters: HomoBERT-tiny (14.1M) significantly outperforms TinyBERT4×312 (14.5M) by 3.3 points in terms of task-average score, and outperforms BERT-small, which is twice of the scale, by 1.0 point. Table 3 show the fine-tuning results of HomoDistil on SQuAD v1.1/v2.0. All HomoBERT stu- dents outperform the best baseline, MiniLM3 (17.3M), by over 3 points of margin on SQuAD v2.0. Especially, HomoBERT-xsmall (15.6M) obtains 3.8 points of gain. Table 2: The accuracy of fine-tuning distilled BERT models on GLUE development set. The results of MiniLM3/6 are reported from (Wang et al., 2020b). The rest are fine-tuned from the officially released checkpoints (Devlin et al., 2018; Sanh et al., 2019; Wang et al., 2020a; Jiao et al., 2019). Model Params (million) MNLI Acc QQP Acc/F1 QNLI Acc SST-2 CoLA RTE MRPC Acc/F1 Acc Acc Acc STS-B P/S Avg Score BERT-base (Teacher) 109 84.5/84.6 91.1/88.1 DistilBERT6 TinyBERT6-GD MiniLM6 MiniLMv26 HomoBERT-base BERT-small TinyBERT3×384-GD MiniLM3 TinyBERT4×312-GD HomoBERT-tiny HomoBERT-xsmall HomoBERT-small 66 66 66 66 65 28.6 17.0 17.0 14.5 14.1 15.6 17.3 82.4/82.5 83.5/- 84.0/- 84.0/- 90.4/87.1 90.6/- 91.0/- 91.1/- 84.2/84.3 91.2/87.9 78.8/78.9 77.4/- 78.8/- 80.4/80.9 81.2/81.3 81.5/81.8 81.8/81.8 89.9/86.5 -/- 88.8/85.0 88.7/85.3 89.9/86.6 90.0/86.7 90.1/86.9 91.2 89.2 90.5 91.0 90.8 90.7 87.0 - 84.7 85.7 87.8 88.0 88.5 92.9 90.9 91.6 92.0 92.4 92.7 88.2 88.4 89.3 89.7 90.1 90.3 91.1 58.7 53.5 42.8 49.2 52.5 55.9 36.1 - 15.8 18.6 37.0 40.8 42.1 79.8 75.5 77.3 - 78.0 77.6 70.8 - 66.4 71.1 70.8 71.5 72.6 89.5/92.4 89.3/89.2 86.5/90.5 88.5/91.6 -/- 88.7/92.0 87.9/87.8 89.0/88.9 -/- 89.3/89.2 89.0/91.9 89.5/89.2 85.8/90.1 -/- 81.9/88.2 84.6/89.1 87.3/90.7 87.7/91.0 88.0/91.4 87.7/87.7 - 85.4/85.5 87.0/87.2 87.6/87.5 88.3/88.0 88.3/88.1 84.6 82.1 81.7 - 83.4 83.8 78.0 - 73.9 75.7 79.0 79.7 80.3 Table 3: The accuracy of fine-tuning distilled models on SQuAD v1.1/2.0 validation set. The results of TinyBERT3-GD and MiniLM3 are reported from (Wang et al., 2020b). The rest are fine-tuned from the officially released checkpoints (Devlin et al., 2018; Jiao et al., 2019). Model Params (million) SQuAD v1.1 EM/F1 SQuAD v2.0 Avg F1 EM/F1 BERT-base (Teacher) BERT-small TinyBERT3-GD MiniLM3 TinyBERT4-GD HomoBERT-tiny HomoBERT-xsmall HomoBERT-small 109 28.6 17.0 17.0 14.5 14.1 15.6 17.3 81.7/88.9 72.5/81.5 -/- -/- 60.8/72.3 75.5/84.1 76.2/84.5 76.5/84.8 73.4/76.7 61.3/64.8 -/63.6 -/66.2 58.9/63.3 66.1/69.5 66.5/70.0 66.6/69.8 82.8 73.2 - - 67.8 76.8 77.2 77.3 5 ANALYSIS We verify that HomoDistil maintains a small prediction discrepancy throughout the distillation pro- cess, leading to a better-generalized student model. 5The standard deviations are reported in Appendix A.7. 7 Published as a conference paper at ICLR 2023 5.1 HOMODISTIL MAINTAINS A SMALL PREDICTION DISCREPANCY Figure 2 shows the prediction discrepancy, DKL, under different schedules of sparsity throughout the distillation process. When the student is directly initialized with a single-shot pruned subnetwork at the target sparsity (i.e., tf = 0), the initial prediction discrepancy is large. In contrast, when the student is initialized with the full model and is iteratively pruned through longer iterations (i.e., tf = 0.5T, 0.7T and 0.9T ), the initial discrepancy is small. The discrepancy then gradually increases due to pruning, but the increment remains small due to distillation. Figure 2: The prediction discrepancy during the distillation of HomoBERT models under different schedules of sparsity. Figure 3 shows the accuracy of task-specific fine-tuning of the student distilled with different sched- ules of sparsity. The student that is initialized with the full model and is pruned iteratively achieves a significantly better generalization performance on the downstream tasks than the one initialized to be the target-size subnetwork. Figure 3: The accuracy of fine-tuning HomoBERT-small distilled with different schedules of sparsity on the development set of GLUE benchmark. 5.2 DISTILLATION BENEFITS ITERATIVE PRUNING Table 4 compares the student trained with and without distillation losses (i.e., Ltotal defined in Eq 5 and LMLM only). The task-specific fine-tuning performance of the student trained with distillation losses consistently outperforms the one without distillation losses over multiple model scales. This suggests that teacher's knowledge is essential to recover the performance degradation due to pruning, and minimizing distillation loss is an important criteria to select important neurons. 5.3 IMPORTANCE METRIC MATTERS Table 5 investigates the student performance under different importance metrics: 1) Magnitude Pruning (Han et al., 2015b), where Sj = |Θj,−j|; 2) Movement Pruning (Sanh et al., 2020), where Sj = Θ(cid:62) j,−j∇ΘL(Θ); 3) PLATON(Zhang et al., 2022): Sj = Ij * Uj, where Ij is the sensitivity score as defined in Eq 2 and Uj is the uncertainty estimation of Ij. For all methods, we use the exponential moving average of score for stability. Using sensitivity and PLATON as the importance score significantly outperforms the baseline. In contrast, the weight magnitude, which may not correctly quantify the neuron's contribution to the loss in the large and complex models, achieves 8 01020Training Steps (k)0.40.50.60.7DKLHomoBERT-base01020Training Steps (k)0.500.751.001.251.501.75HomoBERT-smalltf00.5T0.7T0.9T0.00.50.70.9tf8082Accuracy (%)80.081.781.681.8MNLI0.00.50.70.9tf909190.190.791.191.1SST-20.00.50.70.9tf70727470.872.272.272.6RTE Published as a conference paper at ICLR 2023 Table 4: The accuracy of fine-tuning HomoBERT models trained with and without distillation losses ("Ltotal" and "LMLM") on the development set of GLUE benchmark. Importance Score Params (million) Loss Objective MNLI Acc SST-2 RTE Acc Acc Avg Score BERT-base (Teacher) 109 HomoBERT-base HomoBERT-small HomoBERT-tiny 65 17.3 14.5 - Ltotal LMLM Ltotal LMLM Ltotal LMLM 84.5/84.6 84.2/84.3 82.8/83.0 81.8/81.8 79.3/80.1 81.2/81.3 78.7/79.5 92.9 92.7 91.6 91.1 88.5 90.1 87.7 79.8 77.6 75.1 72.6 71.8 70.8 69.7 85.7 84.8 83.2 81.8 79.9 80.7 78.7 only comparable performance to the baseline. Movement pruning, which is mainly designed for task-specific fine-tuning, diverges. Table 5: The accuracy of fine-tuning HomoBERT-small pruned under different importance metrics on the development set of GLUE benchmark. Importance Score BERT-base (Teacher) TinyBERT4×32-GD Magnitude(Han et al., 2015b) Movement(Sanh et al., 2020) Sensitivity(LeCun et al., 1990) PLATON(Zhang et al., 2022) Params (million) MNLI Acc SST-2 RTE Acc Acc Avg Score 109 17.0 17.3 17.3 17.3 17.3 84.5/84.6 80.4/80.9 92.9 89.7 79.8 71.1 79.7/80.4 81.8/81.8 81.6/81.9 90.3 70.4 Does not converge 72.6 73.6 91.1 90.6 85.7 80.4 80.1 81.8 81.9 6 DISCUSSION Combining pruning and distillation. While we are the first work to combine pruning with dis- tillation in task-agnostic setting, there have been similar explorations in task-specific setting. One stream of explorations first prune the model to the target size and then distill the subnetwork (Hou et al., 2020; Lagunas et al., 2021). In this case, pruning solely serves as an architecture selection strategy independent of distillation. Another stream simultaneously prunes and distills the model (Xu et al., 2021; Xia et al., 2022), which is more comparable to ours. The main differences are that they do not initialize the student with the teacher and often prune at a large granularity, e.g., a Trans- former layer. In task-agnostic setting, however, an undesirable initialization and a large granularity will induce a huge discrepancy, which is difficult to minimize on large amount of open-domain data. Furthermore, after each layer pruning, the remaining layers need to match a different set of teacher layers to ensure the learning of comprehensive knowledge. However, suddenly switching the layer to learn from can be difficult on large amount of open-domain data. How to prune the student's height in task-agnostic setting remains an interesting open problem. A comprehensive comparison of these methods is deferred to Appendix A.5. Resolving prediction discrepancy. Recent research has shown that distillation from a large teacher to a small student has only marginal benefits (Jin et al., 2019; Cho & Hariharan, 2019), mainly due to the large prediction discrepancy (Guo et al., 2020). Traditional solutions have resorted to introducing auxiliary teacher assistant models (Mirzadeh et al., 2020; Rezagholizadeh et al., 2021; Li et al., 2021), but training and storing auxiliary models can be memory and computational costly. 7 CONCLUSION We propose a novel task-agnostic distillation approach equipped with iterative pruning – HomoDis- til. We demonstrate that HomoDistil can maintain a small prediction discrepancy and can achieve promising benefits over existing task-agnostic distillation baselines. 9 Published as a conference paper at ICLR 2023 REFERENCES Gustavo Aguilar, Yuan Ling, Yu Zhang, Benjamin Yao, Xing Fan, and Chenlei Guo. Knowledge distillation from internal representations. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 7350–7357, 2020. Roy Bar-Haim, Ido Dagan, Bill Dolan, Lisa Ferro, and Danilo Giampiccolo. The second PASCAL In Proceedings of the Second PASCAL Challenges recognising textual entailment challenge. Workshop on Recognising Textual Entailment, 01 2006. Luisa Bentivogli, Ido Dagan, Hoa Trang Dang, Danilo Giampiccolo, and Bernardo Magnini. The In In Proc Text Analysis Conference fifth pascal recognizing textual entailment challenge. (TAC'09), 2009. Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. Daniel Cer, Mona Diab, Eneko Agirre, I ̃nigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pp. 1–14, 2017. Cheng Chen, Yichun Yin, Lifeng Shang, Zhi Wang, Xin Jiang, Xiao Chen, and Qun Liu. Extract then distill: Efficient and effective task-agnostic bert distillation. arXiv preprint arXiv:2104.11928, 2021. Jang Hyun Cho and Bharath Hariharan. On the efficacy of knowledge distillation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4794–4802, 2019. Ido Dagan, Oren Glickman, and Bernardo Magnini. The pascal recognising textual entailment chal- lenge. In Proceedings of the First International Conference on Machine Learning Challenges: Evaluating Predictive Uncertainty Visual Object Classification, and Recognizing Textual Entail- ment, MLCW'05, pp. 177–190, Berlin, Heidelberg, 2006. Springer-Verlag. ISBN 3-540-33427- 0, 978-3-540-33427-9. doi: 10.1007/11736790 9. URL http://dx.doi.org/10.1007/ 11736790_9. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. Xiaohan Ding, Guiguang Ding, Xiangxin Zhou, Yuchen Guo, Jungong Han, and Ji Liu. Global sparse momentum SGD for pruning very deep neural networks. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d'Alch ́e-Buc, Emily B. Fox, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 32: Annual Conference on Neural Informa- tion Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 6379–6391, 2019. William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005), 2005. Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and Bill Dolan. The third PASCAL recognizing textual entailment challenge. In Proceedings of the ACL-PASCAL Workshop on Textual Entail- ment and Paraphrasing, pp. 1–9, Prague, June 2007. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/W07-1401. Jia Guo, Minghao Chen, Yao Hu, Chen Zhu, Xiaofei He, and Deng Cai. Reducing the teacher- student gap via spherical knowledge disitllation. arXiv preprint arXiv:2010.07485, 2020. Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015a. Song Han, Jeff Pool, John Tran, and William J Dally. Learning both weights and connections for efficient neural networks. arXiv preprint arXiv:1506.02626, 2015b. 10 Published as a conference paper at ICLR 2023 Pengcheng He, Jianfeng Gao, and Weizhu Chen. Debertav3: Improving deberta using electra-style pre-training with gradient-disentangled embedding sharing. arXiv preprint arXiv:2111.09543, 2021. Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. Lu Hou, Zhiqi Huang, Lifeng Shang, Xin Jiang, Xiao Chen, and Qun Liu. Dynabert: Dynamic bert with adaptive width and depth. arXiv preprint arXiv:2004.04037, 2020. Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. Tinybert: Distilling bert for natural language understanding. arXiv preprint arXiv:1909.10351, 2019. Xiao Jin, Baoyun Peng, Yichao Wu, Yu Liu, Jiaheng Liu, Ding Liang, Junjie Yan, and Xiaolin Hu. Knowledge distillation via route constrained optimization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1345–1354, 2019. Simran Khanuja, Melvin Johnson, and Partha Talukdar. Mergedistill: Merging pre-trained language models using distillation. arXiv preprint arXiv:2106.02834, 2021. Young Jin Kim and Hany Hassan Awadalla. Fastformers: Highly efficient transformer models for natural language understanding. arXiv preprint arXiv:2010.13382, 2020. Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. Franc ̧ois Lagunas, Ella Charlaix, Victor Sanh, and Alexander M Rush. Block pruning for faster transformers. arXiv preprint arXiv:2109.04838, 2021. Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Advances in neural information processing systems, pp. 598–605, 1990. Namhoon Lee, Thalaiyasingam Ajanthan, and Philip H. S. Torr. Snip: single-shot network pruning based on connection sensitivity. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. Lei Li, Yankai Lin, Shuhuai Ren, Peng Li, Jie Zhou, and Xu Sun. Dynamic knowledge distillation for pre-trained language models. arXiv preprint arXiv:2109.11295, 2021. Chen Liang, Simiao Zuo, Minshuo Chen, Haoming Jiang, Xiaodong Liu, Pengcheng He, Tuo Zhao, and Weizhu Chen. Super tickets in pre-trained language models: From model compression to improving generalization. arXiv preprint arXiv:2105.12002, 2021. Kevin J Liang, Weituo Hao, Dinghan Shen, Yufan Zhou, Weizhu Chen, Changyou Chen, and Lawrence Carin. Mixkd: Towards efficient distillation of large-scale language models. arXiv preprint arXiv:2011.00593, 2020. Ekdeep Singh Lubana and Robert P Dick. A gradient flow framework for analyzing network pruning. arXiv preprint arXiv:2009.11839, 2020. Paul Michel, Omer Levy, and Graham Neubig. Are sixteen heads really better than one? arXiv preprint arXiv:1905.10650, 2019. Seyed Iman Mirzadeh, Mehrdad Farajtabar, Ang Li, Nir Levine, Akihiro Matsukawa, and Hassan Ghasemzadeh. Improved knowledge distillation via teacher assistant. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 5191–5198, 2020. Pavlo Molchanov, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz. Pruning convolutional In 5th International Conference on Learning neural networks for resource efficient inference. Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. 11 Published as a conference paper at ICLR 2023 Pavlo Molchanov, Arun Mallya, Stephen Tyree, Iuri Frosio, and Jan Kautz. Importance estimation for neural network pruning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11264–11272, 2019. Michael C Mozer and Paul Smolensky. Skeletonization: A technique for trimming the fat from a In Advances in neural information processing systems, pp. network via relevance assessment. 107–115, 1989. Michela Paganini and Jessica Forde. On iterative neural network pruning, reinitialization, and the similarity of masks. arXiv preprint arXiv:2001.05050, 2020. Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100,000+ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250, 2016a. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2383–2392, Austin, Texas, November 2016b. Association for Computational Linguistics. doi: 10.18653/v1/D16-1264. URL https://www.aclweb. org/anthology/D16-1264. Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don't know: Unanswerable questions for squad. arXiv preprint arXiv:1806.03822, 2018. Alex Renda, Jonathan Frankle, and Michael Carbin. Comparing rewinding and fine-tuning in neural In 8th International Conference on Learning Representations, ICLR 2020, network pruning. Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. Mehdi Rezagholizadeh, Aref Jafari, Puneeth Salad, Pranav Sharma, Ali Saheb Pasand, and Ali Ghodsi. Pro-kd: Progressive distillation by following the footsteps of the teacher. arXiv preprint arXiv:2110.08532, 2021. Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550, 2014. Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019. Victor Sanh, Thomas Wolf, and Alexander M Rush. Movement pruning: Adaptive sparsity by fine- tuning. arXiv preprint arXiv:2005.07683, 2020. Wenxian Shi, Yuxuan Song, Hao Zhou, Bohan Li, and Lei Li. Follow your path: a progressive In Joint European Conference on Machine Learning and method for knowledge distillation. Knowledge Discovery in Databases, pp. 596–611. Springer, 2021. Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language pro- cessing, pp. 1631–1642, 2013. Siqi Sun, Yu Cheng, Zhe Gan, and Jingjing Liu. Patient knowledge distillation for bert model compression. arXiv preprint arXiv:1908.09355, 2019. Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou. Mobile- bert: a compact task-agnostic bert for resource-limited devices. arXiv preprint arXiv:2004.02984, 2020. 12 Published as a conference paper at ICLR 2023 Raphael Tang, Yao Lu, Linqing Liu, Lili Mou, Olga Vechtomova, and Jimmy Lin. Distilling task- specific knowledge from bert into simple neural networks. arXiv preprint arXiv:1903.12136, 2019. Lucas Theis, Iryna Korshunova, Alykhan Tejani, and Ferenc Husz ́ar. Faster gaze prediction with dense networks and fisher pruning. arXiv preprint arXiv:1801.05787, 2018. Iulia Turc, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Well-read students learn better: On the importance of pre-training compact models. arXiv preprint arXiv:1908.08962, 2019. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural informa- tion processing systems, 30, 2017. Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461, 2018. Wenhui Wang, Hangbo Bao, Shaohan Huang, Li Dong, and Furu Wei. Minilmv2: Multi- head self-attention relation distillation for compressing pretrained transformers. arXiv preprint arXiv:2012.15828, 2020a. Wenhui Wang, Furu Wei, Li Dong, Hangbo Bao, Nan Yang, and Ming Zhou. Minilm: Deep self- attention distillation for task-agnostic compression of pre-trained transformers. arXiv preprint arXiv:2002.10957, 2020b. Ziheng Wang, Jeremy Wohlwend, and Tao Lei. Structured pruning of large language models. arXiv preprint arXiv:1910.04732, 2019. Alex Warstadt, Amanpreet Singh, and Samuel R Bowman. Neural network acceptability judgments. Transactions of the Association for Computational Linguistics, 7:625–641, 2019. Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sen- tence understanding through inference. In Proceedings of the 2018 Conference of the North Amer- ican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 1112–1122. Association for Computational Linguistics, 2018. URL http://aclweb.org/anthology/N18-1101. Mengzhou Xia, Zexuan Zhong, and Danqi Chen. Structured pruning learns compact and accurate models. arXiv preprint arXiv:2204.00408, 2022. Xia Xiao, Zigeng Wang, and Sanguthevar Rajasekaran. Autoprune: Automatic network pruning by regularizing auxiliary parameters. Advances in neural information processing systems, 32, 2019. Canwen Xu, Wangchunshu Zhou, Tao Ge, Furu Wei, and Ming Zhou. Bert-of-theseus: Compressing bert by progressive module replacing. arXiv preprint arXiv:2002.02925, 2020. Dongkuan Xu, Ian EH Yen, Jinxi Zhao, and Zhibin Xiao. Rethinking network pruning–under the pre-train and fine-tune paradigm. arXiv preprint arXiv:2104.08682, 2021. Ofir Zafrir, Ariel Larey, Guy Boudoukh, Haihao Shen, and Moshe Wasserblat. Prune once for all: Sparse pre-trained language models. Advances in Neural Information Processing Systems, 2021. Qingru Zhang, Simiao Zuo, Chen Liang, Alexander Bukharin, Pengcheng He, Weizhu Chen, and Tuo Zhao. Platon: Pruning large transformer models with upper confidence bound of weight importance. In International Conference on Machine Learning, pp. 26809–26823. PMLR, 2022. Wangchunshu Zhou, Canwen Xu, and Julian McAuley. Bert learns to teach: Knowledge distillation with meta learning. In Proceedings of the 60th Annual Meeting of the Association for Computa- tional Linguistics (Volume 1: Long Papers), pp. 7037–7049, 2022. 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. 13 Published as a conference paper at ICLR 2023 Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In The IEEE International Conference on Computer Vision (ICCV), December 2015. 14 Published as a conference paper at ICLR 2023 A APPENDIX A.1 DATA Continual Pre-training. We use the same pre-training data as BERT: Wikipedia (English Wikipedia dump8 ; 12GB) and BookCorpus ((Zhu et al., 2015)) (6GB). We clean the corpus by removing ta- bles, lists and references following BERT. We then pre-process the cleaned corpus by concatenating all sentences in a paragraph and truncating the concatenated passage by length of 128 following TinyBERT (Jiao et al., 2019)6. We tokenize the corpus with the vocabulary of BERT (30k). Fine-tuning. GLUE is a commonly used natural language understanding benchmark containing nine tasks. The benchmark includes question answering (Rajpurkar et al., 2016b), linguistic accept- ability (CoLA, Warstadt et al. 2019), sentiment analysis (SST, Socher et al. 2013), text similarity (STS-B, Cer et al. 2017), paraphrase detection (MRPC, Dolan & Brockett 2005), and natural lan- guage inference (RTE & MNLI, Dagan et al. 2006; Bar-Haim et al. 2006; Giampiccolo et al. 2007; Bentivogli et al. 2009; Williams et al. 2018) tasks. Details of the GLUE benchmark, including tasks, statistics, and evaluation metrics, are summarized in Table 16. SQuAD v1.1/v2.0 are the Stan- ford Question Answering Datasets (Rajpurkar et al., 2018; 2016a), two popular machine reading comprehension benchmarks from approximately 500 Wikipedia articles with questions and answers obtained by crowdsourcing. The SQuAD v2.0 dataset includes unanswerable questions about the same paragraphs. A.2 CONTINUAL PRE-TRAINING IMPLEMENTATIONS Table 6 presents the hyper-parameter configurations for continual pre-training HomoBERT models on the open-domain data. We set the distillation temperature as 2. We empirically observe setting tf within the range of 0.5T ∼ 0.9T can achieve similarly good downstream performances. Fur- thermore, we observe that different weight modules may prefer different tf s: 1) it is better to finish the pruning of output projection matrices in the attention module, the feed-forward module and the embedding module early, because pruning them late will induce a large increment in distillation loss and the student performance is difficult to recover. 2) the student performance is less sensitive to the pruning of key and query projection matrices in the attention module and the input projection matrix in the feed-forward module, and can often easily recover. Based on this observation, we set tf = 0.5 for the output projection matrices in the attention module, the feed-forward module and the embedding module. For key and query projection matrices in the attention module and the input projection matrix in the feed-forward module, we set tf = 0.9. For other matrices, we set tf = 0.7. This configuration brings around a small and consistent gain of 0.05 ∼ 0.08 on GLUE. The continual pre-training experiment runs for around 13 hours on 8 Nvidia A100 GPUs. Table 6: Hyper-parameter configurations for task-agnostic distillation of HomoBERT models. Hyper-parameters HomoBERT-base HomoBERT-s HomoBERT-xs HomoBERT-tiny Learning Rates Batch Size Training Epochs Learning Rate Decay Learning Rate Warmup Max Sequence Length Weight Decay Adam β1 Adam β2 Adam (cid:15) Gradient Clipping α1, α2, α3, α4 ti 3 × 10−4 6 × 10−4 6 × 10−4 6 × 10−4 4000 3 Linear 0.1 128 0.01 0.9 0.999 1 × 10−6 None 1 0 6https://github.com/yinmingjun/TinyBERT/blob/master/pregenerate training data.py 15 Published as a conference paper at ICLR 2023 A.3 FINE-TUNING IMPLEMENTATIONS Table 7 presents the hyper-parameter configurations for fine-tuning HomoBERT models on the GLUE benchmark. We fine-tune the MRPC, RTE and STS-B from a fine-tuned MNLI student. All experiments are conducted on 1 Nvidia A100 GPU. Table 7: Hyper-parameter configurations for fine-tuning HomoBERT models on the GLUE bench- mark. "Epoch" refers to the total training epochs; we adopt early-stopping strategy in practice. Hyper-parameters Learning Rates Batch Size Training Epochs Learning Rate Decay Learning Rate Warmup Max Sequence Length Dropout of Task Layer Weight Decay Adam β1 Adam β2 Adam (cid:15) Gradient Clipping HomoBERT-base {2, 3, 4, 5} × 10−5 HomoBERT-s {4, 5, 6, 7} × 10−5 HomoBERT-xs HomoBERT-tiny {6, 7} × 10−5 {6, 7} × 10−5 16 for RTE and MRPC; 32 for the others. 3 for MNLI and QNLI; 6 for the others. Linear 0.05 128 0.1 0 0.9 0.999 1 × 10−6 1 Table 8 presents the hyper-parameter configurations for fine-tuning HomoBERT models on the SQuAD v1.1/2.0. All experiments are conducted on 1 Nvidia A100 GPU. Table 8: Hyper-parameter configurations for fine-tuning HomoBERT models on SQuAD v1.1/2.0. Hyper-parameters Learning Rates Batch Size Training Epochs Learning Rate Decay Learning Rate Warmup Max Sequence Length Dropout of Task Layer Weight Decay Adam β1 Adam β2 Adam (cid:15) Gradient Clipping HomoBERT-s/xs/tiny 1 × 10−4 12 2 Linear 0.2 384 0 0 0.9 0.999 1 × 10−6 1 A.4 COMPARISON WITH TASK-SPECIFIC DISTILLATION METHODS Table 9 compares HomoDistil with commonly used task-specific distillation baseline methods: PKD (Sun et al., 2019), BERT-of-Theseus (Xu et al., 2020), MixKD (Liang et al., 2020), DynaBERT (Hou et al., 2020), ProKT (Shi et al., 2021) and MetaDistil (Zhou et al., 2022). All baseline methods use a BERT-base fine-tuned on the target task as the teacher model, and a 6-layer pre-trained BERT-base as the initialization of the student model. The student model is then distilled with the target task data. As shown in the Table 9, HomoDistil demonstrates a prominent margin over the commonly used task-specific methods. A.5 A COMPARISON WITH "PRUNING+DISTILLATION" METHODS We elaborate our discussion in Section 6 by comparing HomoDistil and the existing methods that combining pruning and distillation in more details. Table 10 and Table 11 present the detailed comparison among HomoDistil, DynaBERT (Hou et al., 2020), SparseBERT (Xu et al., 2021) and CoFi (Xia et al., 2022). We also list the major differences below: HomoDistil focuses on the task-agnostic setting. In the task-specific setting, pruning incurs an inevitable loss of task-relevant pre-training knowledge that may not be present in the fine-tuning data. Therefore, existing works leave the word embeddings untouched (e.g., take up around 20 In contrast, this problem does not exist in the task-agnostic million parameters in BERT-base). 16 Published as a conference paper at ICLR 2023 Table 9: The evaluation performance of HomoDistil and the commonly used task-specific distillation baseline methods on the GLUE development set. The results of PKD (Sun et al., 2019) and ProKT (Shi et al., 2021) are from our implementation. The rest results are from the original papers. STS-B Spearman SST-2 CoLA RTE MRPC Acc MNLI-m/mm QQP QNLI Acc Params (million) Avg Score Model Acc Acc Acc Acc Acc PKD6 (Sun et al., 2019) BERT-of-Theseus6 (Xu et al., 2020) MixKD6 (Liang et al., 2020) DynaBERT6 (Hou et al., 2020) ProKT6 (Shi et al., 2021) MetaDistil6 (Zhou et al., 2022) HomoBERT-base 66 66 66 66 66 66 65 81.3/- 82.3/- 82.5/- 83.7/84.6 82.8/83.2 83.5/83.8 84.2/84.3 88.4 89.6 90.8 91.1 90.9 91.0 91.2 88.4 89.5 88.8 90.6 89.7 90.4 90.7 91.3 91.5 92.1 92.7 91.3 92.3 92.7 45.5 51.1 - 54.6 54.3 58.6 55.9 66.5 68.2 67.9 66.1 68.4 69.4 77.6 85.7 89.0 84.1 85.0 86.3 86.8 89.0 86.2 88.7 - 88.6 88.9 89.1 89.2 79.2 81.2 - 81.6 81.6 82.6 83.8 Table 10: Comparison of HomoDistil and the existing "Pruning+Distillation" methods from the distillation perspective. Method Distillation Setting Teacher Model Student Initialization DynaBERT (Hou et al., 2020) CoFi (Xia et al., 2022) SparseBERT (Xu et al., 2021) Task-specific Task-specific Task-specific Fine-tuned weights Fine-tuned weights Fine-tuned weights Pruned, pre-trained weights Pre-trained weights Pre-trained weights HomoDistil Task-agnostic Pre-trained weights Pre-trained weights Table 11: A comparison of HomoDistil and the existing "Pruning+Distillation" methods from the pruning perspective. Method Pruning Setting Pruning Criterion Pruning Granularity Controllable Layer Width DynaBERT CoFi SparseBERT First prune then distill Head and FFN sensitivity Prune while distill Prune while distill (cid:96)0 regularization Weight magnitude Head, FFN Layer, head, FFN, weight Weight HomoDistil Prune while distill Column sensitivity Row, column No No No Yes setting. This allows us to prune the word embeddings and produce a smaller model more suitable for edge devices (e.g., around 15 million parameters). Furthermore, a task-specific model needs to be specifically pruned for each individual task, while a task-agnostic model can be fine-tuned for any task with a low cost. HomoDistil initializes the student with the teacher. To maintain a small discrepancy in the early stage, HomoDistil initializes the student with the teacher. In contrast, DynaBERT initializes the student with a target-size subnetwork. SparseBERT and CoFi initialize the student with pre-trained weights while the teacher with fine-tuned weights. HomoDistil simultaneously prunes and distills and allows interactions between them. To main- tain a small discrepancy throughout distillation, HomoDistil prunes based on the sensitivity to make the pruning operation "distillation-aware". Specifically, HomoDistil selects the columns and rows to prune based on their contributions to the distillation loss. In contrast, DynaBERT treats pruning and distillation as two independent operations by first pruning then distilling the subnetwork. Sparse- BERT prunes based on the weight magnitude without considering the influence on the distillation loss. HomoDistil prunes rows and columns. The granularity of rows and columns is sufficiently small to control the increment in discrepancy while maintaining the practical benefits of structured pruning. HomoDistil can control the layer width. HomoDistil enforces a local sparsity constraint for each matrix, producing a model with consistent width in each layer. In contrast, SparseBERT and CoFi have no control over the layer width, which might result in wide matrices as the memory bottlenecks. Table 12 shows the evaluation performance of HomoDistil, CoFi and SparseBERT on the GLUE benchmark (DynaBERT results are presented in Table 9). We can see that HomoDistil achieves a noticeable gain over CoFi and a comparable performance with SparseBERT with nearly half of their sizes. 17 Published as a conference paper at ICLR 2023 Table 12: The performance comparison with the existing "Pruning+Distillation" methods. All re- sults are reported by their papers. Params (million) SST-2 CoLA RTE MRPC Acc MNLI-m/mm QQP QNLI Acc STS-B Spearman Avg Score Model Acc Acc Acc Acc Acc CoFi5% (Xia et al., 2022) SparseBERT5% (Xu et al., 2021) HomoBERT-xsmall 28.4 28.4 15.6 80.6/- -/- 81.5/81.8 90.1 - 90.0 86.1 90.6 88.0 90.6 - 90.3 35.6 52.1 40.8 64.7 69.1 71.5 82.6 88.5 87.7 83.1 - 88.0 76.7 - 79.7 A.6 COMPUTATIONAL COSTS Table 13 compares the computational costs of HomoDistil and the baseline methods during infer- ence. We profile the inference time and the number of FLOPs (embedding excluded) during the forward pass using the profiler package released by pytorch 7. We conduct the measurements on the GLUE development set with a batch size of 128 and a maximum sequence length of 128 on one Nvidia A100 GPU. We compute the averaged time and FLOPs over all batches. The speedup is computed with respect to BERT-base. For a fair comparison, we only compare with compact models. As can be observed, HomoDistil achieves some inference speedup and FLOPs reduction, but not as much as the other models under a similar parameter budget. This is because HomoDistil allocates a higher budget to the backbone parameters and a lower budget to the embedding parameters. How- ever, we remark that HomoDistil achieves a better accuracy and enjoys the same (or more) storage benefits than the distilled (or structured pruned) models. Table 13: The inference speedup and the number of FLOPs (embedding excluded) of HomoDistil and the baseline methods. The speedup is computed with respect to BERT-base. Params (million) # FLOPs (non-embedding) Inference Speedup Model BERT-base DistilBERT6 TinyBERT6-GD MiniLMv16 MiniLMv26 HomoBERT-base BERT-small CoFi5% TinyBERT3×384-GD MiniLMv13 TinyBERT4×312-GD HomoBERT-small HomoBERT-xsmall HomoBERT-tiny 109 66 66 66 66 65 28.6 28.4 17.0 17.0 14.5 17.1 15.6 14.1 1.00× 1.98× 1.98× 1.98× 1.98× 1.30× 4.77× 5.16× 7.34× 7.34× 6.28× 2.40× 2.51× 2.55× 1.00× 0.50× 0.50× 0.50× 0.50× 0.56× 0.15× 0.05× 0.06× 0.06× 0.07× 0.11× 0.10× 0.09× A.7 STATISTICS OF EXPERIMENTAL RESULTS All experimental results of HomoDistil presented in this paper are the median of five random seeds. Table 14 and Table 15 show the standard deviations of the experimental results on the GLUE bench- mark (Table 2) and on the SQuAD v1.1/2.0 datasets (Table 3), respectively. Table 14: The standard deviation of the experimental results on GLUE development set in Table 2. QNLI Acc SST-2 CoLA RTE MRPC Acc MNLI-m/mm Acc QQP Acc/F1 STS-B P/S Model Acc Acc Acc HomoBERT-base HomoBERT-small HomoBERT-xsmall HomoBERT-tiny 0.13/0.20 0.23/0.14 0.14/0.12 0.16/0.29 0.09/0.12 0.08/0.20 0.08/0.10 0.11/0.13 0.34 0.14 0.24 0.29 0.24 0.27 0.61 0.16 1.72 2.49 1.32 1.26 0.93 1.29 1.29 1.26 1.17/0.83 0.25/1.43 0.95/0.66 1.05/0.62 0.15/0.18 0.23/0.25 0.27/0.28 0.19/0.22 7https://pytorch.org/tutorials/recipes/recipes/profiler recipe.html 18 Published as a conference paper at ICLR 2023 Table 15: The standard deviation of the experimental results on SQuAD v1.1/2.0 in Table 3. Model SQuAD v1.1 EM SQuAD v1.1 F1 SQuAD v2.0 EM SQuAD v2.0 F1 HomoBERT-small HomoBERT-xsmall HomoBERT-tiny 0.24 0.15 0.29 0.19 0.19 0.31 0.37 0.62 0.78 0.37 0.59 0.72 Table 16: Summary of the GLUE benchmark. Corpus Task #Train #Dev #Test #Label Metrics Single-Sentence Classification (GLUE) CoLA Acceptability SST Sentiment 8.5k 67k 1k 872 1k 1.8k 2 2 Matthews corr Accuracy Pairwise Text Classification (GLUE) MNLI RTE QQP NLI NLI Paraphrase MRPC Paraphrase QNLI QA/NLI 393k 2.5k 364k 3.7k 108k 20k 276 40k 408 5.7k 20k 3k 391k 1.7k 5.7k 3 2 2 2 2 Accuracy Accuracy Accuracy/F1 Accuracy/F1 Accuracy Text Similarity (GLUE) STS-B Similarity 7k 1.5k 1.4k 1 Pearson/Spearman corr 19
http://arxiv.org/abs/2302.09629v2
2023-07-24T12:33:09
2023-02-19T17:15:56
BiofilmScanner: A Computational Intelligence Approach to Obtain Bacterial Cell Morphological Attributes from Biofilm Image
Desulfovibrio alaskensis G20 (DA-G20) is utilized as a model for sulfate-reducing bacteria (SRB) that are associated with corrosion issues caused by microorganisms. SRB-based biofilms are thought to be responsible for the billion-dollar-per-year bio-corrosion of metal infrastructure. Understanding the extraction of the bacterial cells' shape and size properties in the SRB-biofilm at different growth stages will assist with the design of anti-corrosion techniques. However, numerous issues affect current approaches, including time-consuming geometric property extraction, low efficiency, and high error rates. This paper proposes BiofilScanner, a Yolact-based deep learning method integrated with invariant moments to address these problems. Our approach efficiently detects and segments bacterial cells in an SRB image while simultaneously invariant moments measure the geometric characteristics of the segmented cells with low errors. The numerical experiments of the proposed method demonstrate that the BiofilmScanner is 2.1x and 6.8x faster than our earlier Mask-RCNN and DLv3+ methods for detecting, segmenting, and measuring the geometric properties of the cell. Furthermore, the BiofilmScanner achieved an F1-score of 85.28% while Mask-RCNN and DLv3+ obtained F1-scores of 77.67% and 75.18%, respectively.
[ "Md Hafizur Rahman", "Md Ali Azam", "Md Abir Hossen", "Shankarachary Ragi", "Venkataramana Gadhamshetty" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.09629v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.09629v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.LG" ]
IEEE TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS 1 BiofilmScanner: A Computational Intelligence Approach to Obtain Bacterial Cell Morphological Attributes from Biofilm Image Md Hafizur Rahman, Md Ali Azam, Md Abir Hossen, Shankarachary Ragi, and Venkataramana Gadhamshetty 3 2 0 2 l u J 4 2 ] V C . s c [ 2 v 9 2 6 9 0 . 2 0 3 2 : v i X r a Abstract-Desulfovibrio alaskensis G20 (DA-G20) is utilized as a model for sulfate-reducing bacteria (SRB) that are associated with corrosion issues caused by microorganisms. SRB-based biofilms are thought to be responsible for the billion-dollar-per-year bio-corrosion of metal infrastructure. Understanding the extraction of the bacterial cells' shape and size properties in the SRB-biofilm at different growth stages will assist with the design of anti-corrosion techniques. However, numerous issues affect current approaches, including time-consuming geometric property extraction, low efficiency, and high error rates. This paper proposes BiofilScanner, a Yolact-based deep learning method integrated with invariant moments to address these problems. Our approach efficiently detects and segments bacterial cells in an SRB image while simultaneously invariant moments measure the geometric characteristics of the segmented cells with low errors. The numerical experiments of the proposed method demonstrate that the BiofilmScanner is 2.1x and 6.8x faster than our earlier Mask-RCNN and DLv3+ methods for detecting, segmenting, and measuring the geometric properties of the cell. Furthermore, the BiofilmScanner achieved an F1-score of 85.28% while Mask-RCNN and DLv3+ obtained F1-scores of 77.67% and 75.18%, respectively. Index Terms-Deep learning, biofilm, image analysis, computer vision, sulfate-reducing bacteria. ✦ 1 INTRODUCTION M ICROBIOLOGICALLY influenced corrosion (MIC) is a complex interplay of electrochemical, environmental, operational, and biological elements that frequently leads to significant material deterioration and corrosion in mili- tary applications, the marine sector, the oil industry, utili- ties, and transportation [2] [3] [4]. Combining information from market evaluations, academic studies, and industry publications, it is estimated that biofilms generate over US$4,000 billion a year, with around two-thirds of that amount expected to be damaged to corrosion worldwide in 2019 [5] [6] [7]. MIC of metals is frequently attributed to sulfate-reducing bacteria (SRB) of the biofilm. Corrosion- resistant alloys, organic coatings, corrosion inhibitors, Q235 carbon steel produced through biomineralization, and an- odic/cathodic protection are all used to prevent corrosion [8]. Still, their drawbacks, such as high cost, significant con- tamination, and operational challenges, have not yet been fully overcome [8]. Therefore, designing and developing fur- ther corrosion prevention strategies requires understanding the phenotypical growth characteristics of biofilms at differ- ent stages, specifically the size and geometry of the bacterial • M.H. Rahman is with GM Core System Tools & Automation, 29755 Louis Chevrolet Road, Warren, MI 48093 E-mail: [email protected] • M.A. Azam with GE HealthCare, 9900 W Innovation Dr, Wauwatosa, WI 53226, USA. • M.A. Hossen is with the Department of Computer Science, University of • South Carolina, Columbia, SC 29208, USA. S. Ragi was with the Department of Electrical Engineering, South Dakota Mines, Rapid City, SD 57701, USA. • V. Gadhamshetty is with the Department of Civil and Environmental Engineering, South Dakota Mines, Rapid City, SD 57701, USA. cells in biofilms on metal surfaces and how they adapt in hazardous situations associated with corrosion. Our objec- tive in this study is to automatically extract the geometric characteristics (shape, number of cells, etc.) of SRB cells from images of the SRB-biofilm taken under a scanning electron microscope (SEM) at various growth phases. These geomet- ric features are frequently extracted and measured using deep learning techniques or traditional image processing techniques, which are labor-intensive, prone to errors, and have low rates of efficiency. In order to efficiently automate this process [9] [10] [11], our proposed algorithm makes use of computer vision and deep learning techniques to automatically extract each cell's geometric properties from images of biofilms. Microscopy image feature extraction and measuring the geometric properties of objects in the image have been suc- cessfully accomplished in the past using conventional image analysis tools for microscopy analysis, such as BiofilmQ [12], ImageJ [13], BioFilm Analyzer [14], Imaris [15], etc. While the objects in microscope images are heterogeneous and have overlapping features, as they do in our case, traditional image analysis algorithms have a tendency to result in significant error rates. Additionally, the geometric computing steps of these methods are not entirely auto- mated. As an alternative, deep learning approaches can be used to get beyond the shortcomings of conventional image processing methods [16]. Deep learning-enhanced technologies offer a learning strategy that directly processes raw data and automatically learns representations while requiring fewer human interventions. The foundation of deep learning is a deep artificial neural network framework with multiple layers that can learn the high-dimensional IEEE TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS 2 Fig. 1. (a) Dataset generation process at various growth stages of SRB biofilms with multiple scales; (b) Image pre-processing via CLAHE to increase the number of detecting bacterial cells; (c) Data augmentation to increase data volume and avoid overfitting; (d) Yolact-based deep learning model, for instance, segmentation of bacterial cells (e) learning curves for ResNet-101, ResNet-50, Darknet-53 (The presentation formation of the graphic was adapted from [1]) hierarchical features of objects from training datasets using a backpropagation algorithm, typically used to train the network while minimizing the error between the predicted and actual labels [17]. Due to these distinct and reliable characteristics, deep learning-assisted solutions are being developed in application fields such as medical image anal- ysis [18], speech recognition [19], self-driving cars [20] [21], object detection [22], semantic segmentation [23], instance IEEE TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS 3 Fig. 2. From left to right column: raw SEM images of biofilm, ground truth for cell segmentation (manually labeled), automatic segmentation from DLv3+, instance segmentation via MRCNN, instance segmentation with image preprocessing via Yolact, and instance segmentation without image preprocessing via Yolact. 'Test Image X' refers to the SEM images generated in identical experimental conditions, where X is the image index. Fig. 3. Geometric properties of the segmented cells estimated via different segmentation approaches (color bars represent a row of Figure 4). (a) the number of cells; (b) the average area of the cells; (c) the average length of the cells; (d) the average width of the cells; (e) the average perimeter of the cells. The error bars represent the "one" standard deviation of the mean. Acronyms GT, DLv3+, MRCNN, and Yolact represent ground truth, DeepLabV3+, MRCNN, and Yolact respectively. segmentation [24] [25], and image generation [26]. Thus, deep learning methods such as MRCNN [1], DLv3+ [25], and others [27] have also been used for microscopy image analysis. These approaches, however, continue to be ineffi- cient, have greater error rates, and are not time efficient. The goal of this article is to develop an efficient deep learning-based model called BiofilmScanner to extract the geometric characteristics of the individual bacterial cells in an SEM biofilm image. We demonstrate that the mi- croscale geometric properties of biofilms can be extracted IEEE TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS 4 Fig. 4. Performance of Mask-RCNN, and Yolact for cell segmentation and cell size estimation on a biofilm system where images were captured on DA-G20 formed on 56.2% cold-worked copper (a) From left to right: Raw SEM image of the biofilm after 70 days of growth; Instance segmentation of bacterial cells from MRCNN approach; Instance segmentation of bacterial cells from Yolact approach; (b) (c) (d) Estimation of size properties from - the moment invariants method applied on the segmented images from the ground truth, MRCNN, and Yolact (error bars represent standard deviation). with high accuracy using deep learning in combination with computer vision technologies. For challenges like bacterial cell segmentation, we use a deep learning technique called Yolact [28] (Fig. 1). The moment invariants approach [29] is merged with the Yolact algorithm to extract the segmented cells' geometrical characteristics. Finally, we evaluate how well the BiofilmScanner tool performs in comparison to two commercial microscopy tools: MRCNN [1] and a DLv3+- based model [25]. 2 METHOD We adopt a State-of-the-Art deep learning model called Yolact [28] (based on instant segmentation) to segment bacterial cells in the SEM images. Yolact was then combined with the moment invariants method [29] to automatically extract the geometric size attributes of the segmented bac- terial cells, such as area, length, width, and perimeter of the cells, as shown in Fig. 1(d). Next, we compare the effectiveness of our approaches to our earlier research on MRCNN [1] and DLv3+ [25]. At the Two-Dimensional Mate- rials for Biofilm Engineering, Science, and Technology (2D- BEST) center, which is researching MIC prevention on tech- nologically significant metals such as polymers [30], poly- mer composites [31], graphene [32], and hexagonal boron nitride [33], we compare the effectiveness of our approach to the ground-truth data, which is manually measured by subject-matter specialists. We assess the performance of our Yolact-based model [28] for cell segmentation, extraction of cell size, and execution time on a new microbial corrosion system where DA-G20 cells are grown on copper material in order to further verify its resilience and efficacy. 2.1 Yolact YOLACT [28] (You Only Look At Coefficients) is a real-time instance segmentation algorithm that uses a single convolu- tional neural network (CNN) to predict both object bound- ing boxes and class-specific masks. The model is designed to be fast and efficient, making it suitable for use in real- time applications such as video surveillance, robotics, image analysis, and autonomous vehicles. YOLACT is a single- stage detector, which means that it does not require a sep- arate region proposal network like other instance segmen- tation methods such as MRCNN. Instead, YOLACT uses a single CNN to predict both object locations and masks. The network is trained to predict a set of class-specific mask coefficients, which are then combined to generate the final masks. This approach reduces the computational complexity and improves the real-time performance of the model. The structure of the YOLACT [28] network is shown in Fig. 1(d) and the network consists of several key compo- nents. First, the feature extractor is a pre-trained CNN, such as ResNet-101 [34], that is used to extract features from the input image. The feature maps generated by the feature ex- tractor are used as input to the rest of the network. Second, the base feature pyramid [35] is a set of feature maps that are shared by all object instances. These feature maps are used to predict the mask coefficients, which are then combined with the instance-specific feature maps to generate the final masks. Third, class-specific Mask Coefficients: the network is trained to predict a set of class-specific mask coefficients for each object instance. These coefficients are then used to generate the final masks. Fourth, instance-specific Feature Maps: the network also generates a set of instance-specific IEEE TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS 5 feature maps for each object instance. These feature maps are used in combination with the class-specific mask co- efficients to generate the final masks. Fifth, the detection head is used to predict the object bounding boxes. It takes the base feature pyramid and the instance-specific feature maps as input and generates the bounding box coordinates. Finally, the mask head takes the base feature pyramid and the instance-specific feature maps as input and generates the class-specific mask coefficients. The Yolact model is trained using three different types of loss: classification loss, box regression loss, and mask loss. Both the classification loss and box regression loss are calculated in the same way as outlined in the reference [36]. To compute the mask loss, the pixel-wise binary cross- entropy between the predicted masks and the ground truth masks was calculated [28]. 2.2 Extraction of Geometric Properties As shown in Figure, the Yolact [28] is utilized to create a unique mask for each bacterial cell, which is then trans- formed into a binary image to extract the number of cells, area, length, and width. Moment Invariant [29] is a tech- nique to extract the global features for form recognition and identification analysis. We employ the moment of invariant approach to extract the geometric properties of the individ- ual bacterial cells from the binary image of segmented cells. A flowchart of this process is shown in Fig. 1(d). Given a pixel intensity of an image array f (x, y) with an image dimension of w × h pixels, moment invariants are defined by [37] [38]: mpq = w (cid:88) h (cid:88) x=1 y=1 xpyqf (x, y), (1) The order of the moment is (p + q) where p and q are both natural numbers. In the case of the binary image, the pixel intensity is either 0 or 1. The area of a segmented cell in the binary image is given by the zeroth moment (m00) of equation 1 is given by [37] [39], w (cid:88) m00 = h (cid:88) (x)0(y)0f (x, y) x=1 y=1 w (cid:88) h (cid:88) x=1 y=1 = f (x, y), (2) where m00 is the area of the object. The first-order and the second-order moments are described in m10 = w (cid:88) h (cid:88) x=1 y=1 xf (x, y), m01 = m11 = w (cid:88) h (cid:88) x=1 y=1 xyf (x, y), m20 = w (cid:88) h (cid:88) x=1 y=1 yf (x, y), w (cid:88) h (cid:88) x=1 y=1 x2f (x, y), m02 = w (cid:88) h (cid:88) x=1 y=1 y2f (x, y), where m10, m01, and m11 are the first order moment and m20 and m20 are the second order moment of equation 1. The above equations are used to determine the length and width of each bacterial cell. However, the cells in a binary image have unusual shapes, making it challenging to determine the object's length and width. Moment invariants provide us the ability to construct the equivalent ellipse that fits these objects the best, as shown in Figure. We then calculate the semi-major axis (a) and semi-minor axis (b) of the ellipse by the following equations [39] [39], (cid:115) (cid:115) a = b = m20 + m02 + (cid:112)(m20 − m02)2 + 4m2 m00/2 11 , m20 + m02 − (cid:112)(m20 − m02)2 + 4m2 m00/2 11 , (3) (4) The length and width of each cell are 2a and 2b, respectively. We can calculate the perimeter of the object in the binary image using the following formula [40], (cid:114) 2π a2 + b2 2 . (5) 3 RESULTS AND DISCUSSION 3.1 Key Findings Compared to our previous Mask-RCNN approach, the DLv3+ method, and manual measurement by domain ex- perts, the Yolact-based model executes the geometric shape extraction of the bacterial cells 2.1x, 6.8x, and 446x faster. Furthermore, our numerical results show that the Yolact model greatly outperforms MRCNN and DLv3+ in measur- ing geometric features such as area, length, width, and the number of bacterial cells in biofilm microscope images. 3.2 Data Generation and Collection The 2D-BEST center provides the biofilm microscopy image datasets (SEM images). On the surfaces of mild steel and copper materials, SEM imaging was used to characterize the biofilm and corrosion products of DA-G20. The following ingredients were used to establish DA-G20 axenic cultures: sodium lactate (6.8%), dehydrated calcium chloride (0.06%), sodium citrate (0.3), sodium sulfate (4.5), magnesium sulfate (2), ammonium chloride (1), potassium phosphate monoba- sic (0.5), and yeast extract (1). Sterile N2 gas was used to deoxygenate the sterile lactate media for 20 minutes at 15 psi and cultures were grown at 30 °C under shaking conditions for 48 hours at 125 rpm. Mild steel samples covered in the biofilm were subsequently soaked in 3 percent glutaralde- hyde in cacodylate buffer (0.1 M, pH 7.2) for two hours. On samples of 56.2% cold-worked copper that were exposed to corrosion cells, we grew DA-G20 cells. The samples were also cultured at the same time as the testing, which lasted 70 days. With sodium cacodylate buffer and distilled water, the treated samples were washed. Fig. 1(a) shows the image generation process. The anaerobic chamber was used to grow biofilm on the mild steel and copper surfaces. After different days of exposure to the bacterial cells, the images were captured by a scanning electron microscope. We used IEEE TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS 6 66 SEM images of the biofilm to train and test the deep- learning models, which are discussed next. The biofilm images have dimensions of 229 pixels in height and 256 pixels in width. TABLE 3 Computing the number of bacterial cells without or with CLAHE using Yolact with ResNet-101. T1, T2, and T3 represent Test Image 1, Test Image 2, and Test Image 3, respectively. GT= Ground Truth 3.3 Dataset Preprocessing On a variety of computer vision tasks [41] [42] [43], deep convolutional neural networks have exhibited astounding performance. However, these networks significantly rely on large datasets and the quality of the datasets. Our biofilm dataset only contains 66 SEM images; some have blurred borders between bacterial cells and the background, which may lead to the overfitting of the deep learning mod- els. Overfitting [44] is a phenomenon that occurs when a network learns a function from smaller and poor-quality datasets that gives accurate predictions for the training data but not for the unseen data. Therefore, the volume and quality of the dataset determine how well a deep-learning neural network performs. Due to the small volume of the biofilm dataset and the "blurred" borders in some of the images (shown in Fig. 1(a)), the deep learning model's ability to recognize and segment cells may suffer. In order to tackle these issues, we apply data augmentation techniques [45], a data-space solution to the problem of the small size of datasets, like rotation, mirror, vertical flipping, image cropping, and image scale, to increase the data volume and prevent the model from becoming overfit to the training dataset, as shown in Fig. 1(c). In this study, image scale augmentation was used to randomly select a short image within a dimension range, crop patches from the original images randomly, mirror the image with a probability of 1/2, flip it vertically with a probability of 1/2, and rotate it 90 and 180 degrees. TABLE 1 The training parameters used for Yolact. Parameter Value Initial learning rate Learning momentum Weight decay Learning steps Min-batch size Maximum iterations Iterations per training epoch 0.0001 0.9 0.0005 28000, 36000, 50000 4 50000 10 As well, the Contrast Limited Adaptive Histogram Equalization (CLAHE) algorithm [46] is applied for contrast enhancement to detect more bacterial cells. Contrast Lim- ited Adaptive Histogram Equalization (CLAHE) is based TABLE 2 Average Precision(AP in %) on validation dataset with and without data augmentation during training. Without box data augmentation mask AP 7.23 8.41 With box data augmentation mask 26.78 27.19 AP50 AP75 16.61 18.09 58.35 60.03 9.72 10.95 32.61 33.63 Number of Cells Test Image GT Without CLAHE With CLAHE T1 T2 T3 63 55 50 44 45 41 49 50 48 on adaptive histogram equalization, where two primary parameters: the block size (N) and clip limit (CL), are chosen by users to influence image quality. The flow of CLAHE is started by dividing an input image into small blocks, and the pixel's context of the small region is taken into account when calculating the histogram. Thus, the intensity of the pixel is changed to a value corresponding to its rank in the local intensity histogram and placed inside the display range to get enhanced images. 3.4 Bacterial Cell Segmentation via Yolact The Yolact model was trained on a total of 66 images. The DA-G20 biofilms that were formed on mild steel surfaces provided 45 training images, 15 validation images, and 3 test images referred to as Test Image 1 (T1), Test Image 2 (T2), and Test Image 3(T3). The 3 more test images (referred to as Test Image 4 (T4), Test Image 5 (T5), and Test Image 6 (T6)) were obtained from copper-surfaced DA-G20 biofilms. It should be noted that the training stage of the deep learning models does not use images from copper-surfaced DA-G20 biofilms in order to evaluate their robustness. With the help of subject matter experts at the 2D-BEST center, we label the bacterial cells and backdrop in the biofilm picture datasets using the COCO Annotator tool [47]. Then, we used that labeling dataset for training, validating, and testing the model. On the same machine that we used for MRCNN and DLv3+, we trained the Yolact model using an onboard GPU (NVIDIA GTX 16 Series, 6 GB memory), enabling GPU-based acceleration with CUDA to reduce the training period. During the training process, we chose dif- ferent hyperparameter values to train the model. Hyperpa- rameters are variables whose values influence the learning process and define the model parameter values such as the number of iterations, learning rate, batch size, etc that a learning algorithm ultimately learns. The training process didn't take much longer since we used a small dataset with pre-trained weights. We tuned the hyperparameters of the Yolact model via trial and error with different values along with the ResNet-50 [34], ResNet-101 [34], and DarkNet-53 [48] backbone networks. We got our best accuracy for the following values of the hyperparameter as shown in Table 1. Every 1000 iterations, the model's weights were saved, and they were subsequently utilized to analyze the performance results on the test datasets. We trained the network with a batch size of 4, a learning rate of 1 × 10−3, and 50, 000 iterations. The loss function curves of the training process for bounding box, segmentation (mask loss), and classification IEEE TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS 7 TABLE 4 Estimated average size characteristics of bacterial cells. T1, T2, T3, T4, T5, and T6 represent Test Image 1, Test Image 2, Test Image 3, Test Image 4, Test Image 5, and Test Image 6, respectively. GT= Ground Truth, DLv3+= DeepLabv3+, MCNN= MRCNN. (Best results are in bold. The results are presented in the format of (mean ± std)) Test Images Method No. of Cells Avg. Area (μm2) Avg. Perimeter (μm) Avg. Length (μm) Avg. Width (μm) Results from DA-G20 biofilm images developed on mild steel surfaces T1 T2 T3 T4 T5 T6 GT DLv3+ MRCNN Yolact GT DLv3+ MRCNN Yolact GT DLv3+ MRCNN Yolact 63 48 49 49 55 45 52 50 50 34 57 48 0.89 ± 0.30 0.63 ± 0.21 0.95 ± 0.28 0.91 ± 0.31 1.01 ± 0.40 0.74 ± 0.23 1.15 ± 0.52 1.07 ± 0.42 1.15 ± 0.41 0.64 ± 0.32 1.10 ± 0.40 1.28 ± 0.42 4.32 ± 1.05 3.35 ± 0.76 4.31 ± 1.02 4.48 ± 1.05 4.57 ± 1.34 3.64 ± 0.78 4.23 ± 1.39 4.63 ± 1.35 4.91 ± 1.27 3.11 ± 1.01 4.24 ± 1.14 4.94 ± 1.29 1.62 ± 0.45 1.40 ± 0.41 1.56 ± 0.42 1.65 ± 0.44 1.70 ± 0.48 1.53 ± 0.40 1.62 ± 0.64 1.76 ± 0.50 1.81 ± 0.45 1.28 ± 0.51 1.52 ± 0.50 1.82 ± 0.44 Results from DA-G20 biofilm images developed on copper surfaces GT MRCNN Yolact GT MRCNN Yolact GT MRCNN Yolact 44 42 48 55 53 49 64 58 61 0.74 ± 0.31 0.80 ± 0.35 0.70 ± 0.33 0.55 ± 0.28 0.63 ± 0.41 0.56 ± 0.31 0.76 ± 0.33 0.72 ± 0.23 0.62 ± 0.30 3.91 ± 1.15 3.93 ± 1.22 4.01 ± 1.26 3.27 ± 1.11 3.51 ± 1.46 3.50 ± 1.27 4.23 ± 1.53 3.67 ± 1.08 3.71 ± 1.28 1.76 ± 0.57 1.49 ± 0.48 1.56 ± 0.52 1.46 ± 0.56 1.28 ± 0.42 1.36 ± 0.51 1.94 ± 0.79 1.41 ± 0.50 1.45 ± 0.51 0.69 ± 0.13 0.64 ± 0.11 0.75 ± 0.14 0.73 ± 0.14 0.74 ± 0.16 0.69 ± 0.10 0.76 ± 0.22 0.79 ± 0.16 0.80 ± 0.13 0.67 ± 0.10 0.81 ± 0.20 0.92 ± 0.13 0.59 ± 0.14 0.67 ± 0.24 0.61 ± 0.22 0.53 ± 0.12 0.63 ± 0.27 0.56 ± 0.20 0.59 ± 0.14 0.62 ± 0.17 0.57 ± 0.16 TABLE 5 Segmentation efficiency (F1 Score in %) evaluation performance. T1, T2, T3, T4, T5, and T6 represent Test Image 1, Test Image 2, Test Image 3, Test Image 4, Test Image 5, and Test Image 6, respectively. DLv3+= DeepLabv3+, MCNN= MRCNN. (Best results are in bold. The results are presented in the format of (mean ± std)) Method Backbone T1 T2 T3 T4 T5 T6 Overall DLv3+ ResNet-50 MRCNN ResNet-101 Yolact Darknet-53 ResNet-50 ResNet-101 76.29 ± 0.56 74.97 ± 0.36 83.15 ± 0.26 81.83 ± 0.17 83.88 ± 0.13 80.84 ± 0.24 76.37 ± 0.49 85.74 ± 0.03 86.97 ± 0.27 86.83 ± 0.35 67.89 ± 0.29 80.33 ± 0.11 85.02 ± 0.13 84.36 ± 0.15 84.52 ± 0.18 76.19 ± 0.41 82.63 ± 0.91 88.37 ± 0.21 89.56 ± 0.20 90.52 ± 0.09 77.33 ± 0.19 75.57 ± 0.75 83.94 ± 0.09 82.63 ± 0.22 83.67 ± 0.11 72.56 ± 0.36 76.14 ± 0.31 80.41 ± 0.35 81.69 ± 0.03 82.23 ± 0.23 75.18 ± 0.34 77.67 ± 0.49 84.44 ± 0.18 84.50 ± 0.17 85.28 ± 0.18 are shown in Fig. 1(e). Our dataset was increased by using data augmentation methods, as previously discussed. The Yolact model was trained and evaluated without and with data augmentation methods. To quantitatively verify the im- pact of data augmentation on unseen data (validation data), average precision (AP) [49] is used to evaluate the model's efficiency with and without data augmentation. Average Precision (AP) of validation results on training dataset with and without data augmentation as shown in Table 2. From Table 2, the average precision of the segmented mask and the bounding box without data augmentation on validation data is 8.41% and 7.23%, respectively, whereas these values increase to 26.76% and 27.19% with data augmentation. This result suggests that the validation efficiencies are signifi- cantly increased with the data augmentation methods that overcome the model's overfitting issue. Next, we prepro- cessed the training dataset using the CLAHE approach to determine how CLAHE affected the Yolact network's ability to count bacterial cells. We trained the deep neural network (Yolact) both with and without CLAHE and the results are shown in Table3. From Table3, the number of bacterial cells with CLAHE is higher than without CLAHE. Subject matter experts at the 2D-BEST center tallied the number of bacterial cells in T1, T2, and T3 and found that there were 44, 45, and 41, respectively which we considered as ground truth. The Yolact model counts the number of bacterial cells in T1, T2, and T3 as 44, 45, and 41 without CLAHE, while with the CLAHE method, these numbers are 49, 50, and 48, respectively. The results with the CLAHE method are closer to ground truth. The ground truths and the cell segmentation results from the deep learning techniques are shown in Fig. 2 and Fig. 3(a). 3.5 Estimated Geometric Properties The measurement of bacterial cell sizes is important since the size of a bacterial cell varies depending on the growth IEEE TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS 8 TABLE 6 The execution time of each method for extracting geometric properties from the test images where m is minute and s is seconds. T1, T2, T3, T4, T5, and T6 represent Test Image 1, Test Image 2, Test Image 3, Test Image 4, Test Image 5, and Test Image 6, respectively. DLv3+= DeepLabv3+, MCNN= MRCNN. (Best results are in bold. The results are presented in the format of (mean ± std)) Method Backbone T1 T2 T3 T4 T5 T6 Overall - - - 23m 34s ± 4m 20m 15s ± 3m 18m 54s ± 2m 16m 30s ± 3m 19m 49s ± 2m 22m 11s ± 4m 20m 12s ± 3m Manual (18.46 ± 1.86)s (18.33 ± 1.44)s (18.97 ± 1.51)s DLv3+ ResNet-50 (5.56 ± 1.26)s (5.07 ± 1.27)s MRCNN ResNet-101 (5.68 ± 1.11)s (2.87 ± 1.07)s (2.69 ± 1.77)s Darknet-53 (2.91 ± 1.26)s (2.76 ± 1.37)s (2.81 ± 1.56)s (3.01 ± 1.77)s ResNet-50 (2.72 ± 1.16)s (2.71 ± 1.15)s ResNet-101 (2.56 ± 0.96)s (19.61 ± 2.36)s (6.02 ± 1.29)s (2.91 ± 1.84)s (2.39 ± 1.47)s (2.88 ± 1.55)s (17.08 ± 1.89)s (5.48 ± 1.01)s (2.81 ± 0.13)s (2.37 ± 1.09)s (2.59 ± 1.26)s (18.89 ± 1.96)s (5.67 ± 1.31)s (3.05 ± 1.38)s (3.31 ± 1.07)s (2.89 ± 1.02)s (17.87 ± 2.01)s (5.50 ± 1.57)s (2.83 ± 0.03)s (2.77 ± 1.23)s (2.67 ± 1.03)s Yolact conditions. However, their various phenotypes are caused by their diverse gene expression, which determines the mechanism of their different cell sizes. These ambigu- ous genotypical and phenotypic changes at the materials- microbe interface are reliant on the interaction of microbial biofilms. We use the moment of invariants method to de- termine the size parameters of the segmented bacterial cells, including their area, length, width, and perimeter. Three test images (T1, T2, T3) of DA-G20 biofilms developed on mild steel surfaces from related MIC studies were used to assess the effectiveness of all the techniques covered in this study. We additionally examine the model's effectiveness for cell segmentation and cell size estimate on the microbial cor- rosion system where DA-G20 cells are cultured on copper substrates. The results of the geometric feature extraction are presented in Table 4. The findings in Table 4 show that Yolact's performance in estimating the size properties of bacterial cells on biofilm images of both mild steel surfaces and copper surfaces is close to ground truth. Fig. 3 is a visual representation of the average values and the corresponding error bars (standard deviation) for the estimated geometric properties of all the segmented cells from T1, T2, and T3. The error bars indicate the degree of un- certainty or variability in the data. The geometric properties depicted in the figure include the characteristics such as the number of bacterial cells, area, length, width, and perimeter of the segmented cells. Based on Figures 3(b), 3(c), 3(d), and 3(e), it appears that the MRCNN and DLv3+ models have a large degree of variability in their estimates of the area, length, width, and perimeter of segmented bacterial cells, which is not present in the actual measurements. This suggests that the MRCNN and DLv3+ models may not be as accurate as other methods such as Yolact. However, when counting the number of cells, MRCNN and Yolact have similar performance levels compared to the ground truth measurements while results from the DLv3+ technique are unsatisfactory as shown in Figure 3(a). Overall, the Yolact method appears to be the most accurate for estimating both the geometric properties of cells and counting their number as shown in Fig. 3. As discussed earlier, DA-G20 cells grown on copper surfaces were used for cell segmentation and size estimation to assess the robustness of our proposed model. The raw SEM images (T4, T5, and T6) from copper surfaces, cell segmentation results from the MRCNN and Yolact approaches, and the cell size estimation results are shown in Table 4 and Figures 3(b), 3(c), and 3(d). It is important to point out that we have only evaluated the MRCNN model with Yolact for test images 4, 5, and 6, as MRCNN demonstrated the best performance compared to DLv3+. The outcomes in Figures 3(b), 3(c), and 3(d) show that Yolact works rather well when estimating the size properties of bacterial cells compared to the results of MRCNN. In conclusion, Fig. 3 and Table 4's data show that Yolact is effective at segmenting and measuring the size of cells in biofilms formed on diverse metal surfaces. These various metal systems provide proof-of-concept that the Yolact method can be used to analyze the structural relationships in different bacterial systems by displaying the adaptability of this method. 3.6 Model Performance It is essential to determine the level of trustworthiness of a trained model when making predictions on unseen data. In this case, we apply a cross-validation technique known as the Dice similarity coefficient (F1 − Score) to evaluate the model's segmentation accuracy of bacterial cells on the test images. As well as, we also evaluate the time taken for cell segmentation and extraction of size properties for each method discussed, including manually, DLv3+, MRCNN, and Yolact. The F1 − score [50] is a measure of a model's accuracy that balances precision and recall. It is a commonly used metric in the field of machine learning and is particularly useful for binary classification problems. The F1 − score is the harmonic mean of precision and recall, where the best score is 100% and the worst is 0%. Precision is the proportion of true positive predictions (i.e. the number of times the model correctly predicted a positive outcome) out of all positive predictions made by the model. The recall is the proportion of true positive predictions out of all actual positive outcomes. A high F1 − score indicates that the model has high accuracy and is able to balance precision and recall well. In a binary classification problem, it means that the model is able to correctly identify the positive instances (True positive) and also able to minimize the false positives. We evaluate the F1−score [50] using the following equation: F1 − score = 2 × precision × recall precision + recall , (6) where prcision and recall are calculated by the following equations: precision = T P T P + F P , (7) IEEE TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS 9 recall = T P T P + F N , (8) where True Positive (T P ) is the number of bacterial cells that were correctly identified by the model, a False Negative (F N ) is the number of bacterial cells that were not identified by the model, and a False Positive (F P ) is the number of cells that were incorrectly identified by the model. These values of T P , F N , and F P are calculated by using Python programming and are determined by averaging the results over each test image. The results of each method applied to T1, T2, T3, T4, T5, and T6 are presented in Table 5. These results indicate that Yolact has a better performance than the other methods considered in this study. The F1 − Score of Yolact with ResNet-101 backbone network achieves 85.28% where DLv3+ with ResNet-50 and MRCNN with ResNet- 101 are 75.56% and 77.67%, respectively. Next, we measure the execution times for the manual measurement method used by domain experts at the 2D- BEST center, as well as the geometric properties measured by them. On the same system, we utilize the 'timeit' library for MRCNN and Yolact and the 'timeElapsed' function for DeepLabv3+ to calculate the execution timings. The results are summarized in Table 6, which shows the average time taken to complete the experiment for all cells in each of the six test images. According to the results, Yolact models outperform the manual method, DLv3+, and MRCNN not only for D20 biofilm images on mild steel surfaces but also for D20 biofilm images on copper surfaces. Particularly, the Yolact model outperforms the MRCNN, DLv3+, and manual process by 2.1×, 6.8×, and 246×, respectively. In conclusion, the Yolact approach is the best choice (among the methods considered here) both in terms of segmentation accuracy and execution time. 4 CONCLUSION In summary, we developed the BioflimScanner tool which is a deep learning-based image segmentation approach using the Yolact architectures with the moment invariants method to automate the extraction of geometric size properties of bacterial cells in biofilms. To automate the process of evaluating structural changes in the biofilms in response to the coatings, high-throughput microscopy image character- ization methods are needed for fast and efficient screening and selection of protective coatings against the MIC effects of biofilms. To help automate the process of measuring structural changes in biofilms, we used a neural network ar- chitecture (Yolact) with moment invariants, BiofilmScanner, to segment bacterial cells and extract geometric properties of segmented cells in microscopy images of biofilms. The study showed that BiofilmScanner outperforms both DeepLabV3+ and Mask R-CNN in terms of estimation accuracy and faster. More particularly, the F1-Score of the BiofilmScanner using the ResNet-101 backbone network was found to be 85.28%, which is higher than the scores of the DeepLabv3+ model with ResNet-50 and the Mask R-CNN model with ResNet-101, which were 75.56% and 77.67% respectively. Additionally, the BiofilmScanner tool is 2.1x, 6.8x, and 246x, respectively, faster than our earlier Mask-RCNN, DLv3+, and manual measurement by the domain experts. Our research has shown that the methods we developed for segmenting and measuring bacterial cells in biofilms can be applied to other types of biofilms as well. Specifically, we have demonstrated that, without any additional training, our methods can be used to analyze biofilms of other types of bacteria, such as E. Coli, P. aeruginosa, and B. subtilis, as long as the shape and structure of the bacterial cells in those biofilms are similar to that of the DA-G20 biofilm that we used in our study. ACKNOWLEDGMENTS The authors acknowledge funding support from NSF RII T-2 FEC award #1920954. S. Ragi would like to acknowl- edge NSF RII T-1 FEC award #1849206 for a seed grant that partially supported this study. V. Gadhamshetty would like to acknowledge partial support from NSF CAREER award #1454102. Dr. Gadhamshetty's group is thankful to Dr. Bharat Jasthi, Materials and Metallurgical Engineering (MET), SD Mines for providing copper samples for the dislocation experiments. DATA AVAILABILITY The data that support the findings of this study are available from the corresponding author upon request. CODE AVAILABILITY The source code, the trained network weights, and the train- ing data are available at https://github.com/hafizur-r/ BiofilmScanner-v0.2 CORRESPONDING AUTHOR Md Hafizur Rahman – Embedded Engineer, GM Global Technical Center, Cole Engineering Center Tower, 29755 48093; Phone: Louis Chevrolet Road, Warren, MI (605) 391-0506; Email: [email protected] or md- [email protected] REFERENCES [1] S. Ragi, M. H. Rahman, J. Duckworth, J. Kalimuthu, P. Chundi, and V. Gadhamshetty, "Artificial intelligence-driven image analysis of bacterial cells and biofilms," IEEE/ACM Transactions on Computa- tional Biology and Bioinformatics, 2021. [2] B. Hou, X. Li, X. Ma, C. Du, D. Zhang, M. Zheng, W. Xu, D. Lu, and F. Ma, "The cost of corrosion in china," npj Materials Degradation, vol. 1, no. 1, pp. 1–10, 2017. [3] X. Li, D. Zhang, Z. Liu, Z. Li, C. Du, and C. Dong, "Materials science: Share corrosion data," Nature, vol. 527, no. 7579, pp. 441– 442, 2015. [4] M. W. LeChevallier, C. D. Lowry, and R. G. Lee, "Disinfecting biofilms in a model distribution system," Journal-American Water Works Association, vol. 82, no. 7, pp. 87–99, 1990. [5] U. Hofer, "The cost of biofilms," Nature Reviews Microbiology, [6] vol. 20, no. 8, pp. 445–445, 2022. S. Jacobs, S. Reiber, and M. Edwards, "Sulfide-induced copper corrosion," Journal-American Water Works Association, vol. 90, no. 7, pp. 62–73, 1998. [7] M. C ́amara, W. Green, C. E. MacPhee, P. D. Rakowska, R. Raval, M. C. Richardson, J. Slater-Jefferies, K. Steventon, and J. S. Webb, "Economic significance of biofilms: a multidisciplinary and cross- sectoral challenge," npj Biofilms and Microbiomes, vol. 8, no. 1, pp. 1–8, 2022. IEEE TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS 10 N. Koratkar, "Superiority of graphene over polymer coatings for prevention of microbially induced corrosion," Scientific reports, vol. 5, no. 1, pp. 1–12, 2015. [31] G. Chilkoor, R. Sarder, J. Islam, K. ArunKumar, I. Ratnayake, S. Star, B. K. Jasthi, G. Sereda, N. Koratkar, M. Meyyappan et al., "Maleic anhydride-functionalized graphene nanofillers ren- der epoxy coatings highly resistant to corrosion and microbial attack," Carbon, vol. 159, pp. 586–597, 2020. [32] G. Chilkoor, N. Shrestha, A. Kutana, M. Tripathi, F. C. Rob- les Hern ́andez, B. I. Yakobson, M. Meyyappan, A. B. Dalton, P. M. Ajayan, M. M. Rahman et al., "Atomic layers of graphene for microbial corrosion prevention," ACS nano, vol. 15, no. 1, pp. 447– 454, 2020. [33] G. Chilkoor, K. Jawaharraj, B. Vemuri, A. Kutana, M. Tripathi, D. Kota, T. Arif, T. Filleter, A. B. Dalton, B. I. Yakobson et al., "Hexagonal boron nitride for sulfur corrosion inhibition," ACS nano, vol. 14, no. 11, pp. 14 809–14 819, 2020. [34] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 770–778. [35] T.-Y. Lin, P. Doll ́ar, R. Girshick, K. He, B. Hariharan, and S. Be- longie, "Feature pyramid networks for object detection," in Pro- ceedings of the IEEE conference on computer vision and pattern recogni- tion, 2017, pp. 2117–2125. [36] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.-Y. Fu, and A. C. Berg, "Ssd: Single shot multibox detector," in European conference on computer vision. Springer, 2016, pp. 21–37. [37] B. Horn, B. Klaus, and P. Horn, Robot vision. MIT press, 1986. [38] L. Rocha, L. Velho, and P. C. P. Carvalho, "Image moments-based structuring and tracking of objects," in Proceedings. XV Brazilian Symposium on Computer Graphics and Image Processing. IEEE, 2002, pp. 99–105. [39] M. R. Teague, "Image analysis via the general theory of moments," Josa, vol. 70, no. 8, pp. 920–930, 1980. [40] H. Tomkys, "Formula for the perimeter of an ellipse," Nature, vol. 65, no. 1693, pp. 536–536, 1902. [41] B. G. Baumgart, "A polyhedron representation for computer vi- sion," in Proceedings of the May 19-22, 1975, national computer conference and exposition, 1975, pp. 589–596. [42] L. G. Shapiro, G. C. Stockman et al., Computer vision. Prentice Hall New Jersey, 2001, vol. 3. [43] D. A. Forsyth and J. Ponce, Computer vision: a modern approach. prentice hall professional technical reference, 2002. [44] T. Dietterich, "Overfitting and undercomputing in machine learn- ing," ACM computing surveys (CSUR), vol. 27, no. 3, pp. 326–327, 1995. [45] C. Shorten and T. M. Khoshgoftaar, "A survey on image data augmentation for deep learning," Journal of big data, vol. 6, no. 1, pp. 1–48, 2019. [46] S. M. Pizer, E. P. Amburn, J. D. Austin, R. Cromartie, A. Geselowitz, T. Greer, B. ter Haar Romeny, J. B. Zimmerman, and K. Zuiderveld, "Adaptive histogram equalization and its variations," Computer vision, graphics, and image processing, vol. 39, no. 3, pp. 355–368, 1987. [47] J. Brooks, "COCO Annotator," https://github.com/jsbroks/ coco-annotator/, 2019. [48] J. Redmon and A. Farhadi, "Yolov3: An incremental improve- ment," arXiv preprint arXiv:1804.02767, 2018. [49] K. Kishida, Property of average precision and its generalization: An ex- amination of evaluation indicator for information retrieval experiments. National Institute of Informatics Tokyo, Japan, 2005. [50] N. Chinchor and B. M. Sundheim, "Muc-5 evaluation metrics," in Fifth Message Understanding Conference (MUC-5): Proceedings of a Conference Held in Baltimore, Maryland, August 25-27, 1993, 1993. [8] Y. Lou, W. Chang, T. Cui, H. Qian, L. Huang, L. Ma, X. Hao, and D. Zhang, "Microbiologically influenced corrosion inhibition of carbon steel via biomineralization induced by shewanella putrefa- ciens," npj Materials Degradation, vol. 5, no. 1, pp. 1–11, 2021. [9] M. A. Hossen, E. Zahir, H. Ata-E-Rabbi, M. A. Azam, and M. H. Rahman, "Developing a mobile automated medical assistant for hospitals in bangladesh," in 2021 IEEE World AI IoT Congress (AIIoT). IEEE, 2021, pp. 0366–0372. [10] M. Hasan, M. Rahman et al., "Smart phone based sensor fusion by using madgwick filter for 3d indoor navigation," Wireless Personal Communications, vol. 113, no. 4, pp. 2499–2517, 2020. [11] A. A. Chowdhury, M. A. Hossen, M. A. Azam, and M. H. Rahman, "Deepqgho: Quantized greedy hyperparameter optimization in deep neural networks for on-the-fly learning," IEEE Access, vol. 10, pp. 6407–6416, 2022. [12] R. Hartmann, H. Jeckel, E. Jelli, P. K. Singh, S. Vaidya, M. Bayer, J. C. Fong, A. Dragos et al., L. Vidakovic, F. D ́ıaz-Pascual, "Biofilmq, a software tool for quantitative image analysis of mi- crobial biofilm communities," BioRxiv, p. 735423, 2019. [13] D. Prodanov and K. Verstreken, "Automated segmentation and morphometry of cell and tissue structures. selected algorithms in imagej," Molecular Imaging, pp. 183–208, 2012. [14] M. I. Bogachev, V. Y. Volkov, O. A. Markelov, E. Y. Trizna, D. R. Baydamshina, V. Melnikov, R. R. Murtazina, P. V. Zelenikhin, I. S. Sharafutdinov, and A. R. Kayumov, "Fast and simple tool for the quantification of biofilm-embedded cells sub-populations from fluorescent microscopic images," PloS one, vol. 13, no. 5, 2018. [15] O. I. plc, "Imaris v9.5," https://imaris.oxinst.com/downloads, 2019. [16] K. Gopalakrishnan, A. Adhikari, N. Pallipamu, M. Singh, T. Nus- rat, S. Gaddam, P. Samaddar, A. Rajagopal, A. S. S. Cherukuri, A. Yadav et al., "Applications of microwaves in medicine leverag- ing artificial intelligence: Future perspectives," Electronics, vol. 12, no. 5, p. 1101, 2023. [17] J. D. Paola and R. A. Schowengerdt, "A review and analysis of backpropagation neural networks for classification of remotely- sensed multi-spectral imagery," International Journal of remote sens- ing, vol. 16, no. 16, pp. 3033–3058, 1995. [18] M. A. Hossen, P. K. Diwakar, and S. Ragi, "Total nitrogen estima- tion in agricultural soils via aerial multispectral imaging and libs," Scientific Reports, vol. 11, no. 1, pp. 1–11, 2021. [19] L. Rabiner and B.-H. Juang, Fundamentals of speech recognition. Prentice-Hall, Inc., 1993. [20] S. Dey and H. Xu, "Intelligent distributed swarm control for large-scale multi-uav systems: A hierarchical learning approach," Electronics, vol. 12, no. 1, p. 89, 2023. [21] M. A. Azam, H. D. Mittelmann, and S. Ragi, "Uav formation shape control via decentralized markov decision processes," Algorithms, vol. 14, no. 3, p. 91, 2021. [22] Z.-Q. Zhao, P. Zheng, S.-t. Xu, and X. Wu, "Object detection with deep learning: A review," IEEE transactions on neural networks and learning systems, vol. 30, no. 11, pp. 3212–3232, 2019. [23] P. Wang, P. Chen, Y. Yuan, D. Liu, Z. Huang, X. Hou, and G. Cot- trell, "Understanding convolution for semantic segmentation," in 2018 IEEE winter conference on applications of computer vision (WACV). Ieee, 2018, pp. 1451–1460. [24] P. L. Correia and F. Pereira, "Objective evaluation of video seg- mentation quality," IEEE Transactions on Image Processing, vol. 12, no. 2, pp. 186–200, 2003. [25] M. H. Rahman, J. Duckworth, S. Ragi, P. Chundi, V. R. Gad- hamshetty, and G. Chilkoor, "Deep learning approach to extract geometric features of bacterial cells in biofilms," in Advances in Data Science and Information Engineering. Springer, 2021, pp. 359– 368. [26] B. Zhao, L. Meng, W. Yin, and L. Sigal, "Image generation from layout," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019, pp. 8584–8593. [27] J. T. Sauls, J. W. Schroeder, S. D. Brown, G. Le Treut, F. Si, D. Li, J. D. Wang, and S. Jun, "Mother machine image analysis with mm3," bioRxiv, p. 810036, 2019. [28] D. Bolya, C. Zhou, F. Xiao, and Y. J. Lee, "Yolact: Real-time instance segmentation," in Proceedings of the IEEE/CVF international conference on computer vision, 2019, pp. 9157–9166. [29] R. Mukundan and K. Ramakrishnan, Moment functions in image analysis: theory and applications. World scientific, 1998. [30] A. Krishnamurthy, V. Gadhamshetty, R. Mukherjee, B. Natarajan, O. Eksik, S. Ali Shojaee, D. A. Lucca, W. Ren, H.-M. Cheng, and IEEE TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS 11 Md Hafizuar Rahman has completed his M.S. in Electrical Engineering at South Dakota Mines and his B.Sc. in Electrical and Electronic En- gineering at Pabna University of Science and Technology, Bangladesh. During his M.S., he worked on data-driven models for biofilm pheno- type prediction on metal surfaces modified with 2D coatings. Currently, he is working as an Em- bedded Engineer (Contractual) at General Mo- tors. His current research interests include deep learning, DL model quantization, and computer vision for autonomous vehicles. Shankarachary Ragi was an assistant profes- sor in the Electrical Engineering Department at South Dakota Mines, USA. He earned his Ph.D. degree in Electrical and Computer Engineering at Colorado State University, USA in 2014, and his B.Tech. and M.Tech. degrees in Electrical Engineering at the Indian Institute of Technol- ogy Madras, India in 2009. Before joining South Dakota Mines, Ragi has worked as a postdoc- toral researcher in the mathematics department at Arizona State University, and prior to that, he worked as a Senior Controls Engineer at Cummins Emission Solutions. He is currently serving as senior personnel at the 2D-Materials for Biofilm Engineering, Science and Technology (2D-BEST) center funded by the National Science Foundation. His current research interests include machine learning, image analysis, robotics, and optimal control. Ragi has served as an Associate Editor for IEEE Access during 2017- 2020. He has authored or co-authored over 26 peer-reviewed publica- tions in various journals and conference proceedings. He is a senior member of the IEEE. Md Ali Azam (Student Member, IEEE) was born in Tarabaria, Chartarapur, Pabna, Bangladesh, in 1992. He received the B.Sc. degree in elec- tronics and telecommunication engineering from the Rajshahi University of Engineering and Tech- nology, Bangladesh, in 2014, and the M.S. de- gree in electrical engineering from the South Dakota School of Mines and Technology, Rapid City, SD, USA, in 2020. From 2018 to 2020, he was a Graduate Assistant at SDSMT, where he worked as a Graduate Teaching Assistant and a Graduate Research Assistant during his M.S. studies. He worked as a System Engineer at a Telecommunication Company in Bangladesh, before attending SDSMT. During his M.S. studies, he published several papers. Md Abir Hossen received the B.S. degree in Electrical and Electronics Engineering from American International University-Bangladesh, Dhaka, Bangladesh, in 2017 and the M.S. de- gree in Electrical Engineering from South Dakota School of Mines and Technology, Rapid City, SD, USA in 2021. During his B.S. studies, he devel- oped delivery robots with autonomous naviga- tion capability to be deployed in hospitals on an a2i (a Bangladesh government program run from the Prime Minister's office supported by UNDP and USAID) funded project. He was a graduate research assistant at the Unmanned and Swarm System (USS) laboratory during his M.S. studies from 2019-2021, where he developed AI-driven UAV-based multispectral sensing solution for agricultural soil monitoring. He is currently pursuing the Ph.D. degree in Computer Science at University of South Carolina, SC, USA. He is also working as a graduate research assistant at Artificial Intelligence and Systems Laboratory (AISys) and conducting research on finding root causes of functional faults in highly-configurable robotic systems through the lens of causality, and optimizing DNNs for the Europa Space Lander in collaboration with NASA. His research interest includes Autonomous and adaptive systems and Machine learn- ing systems. Venkataramana Gadhamshetty earned a Ph.D. degree in Civil and Environmental Engineering from New Mexico State University, an MS degree in Environmental Engineering from the National University of Singapore, and a BS degree in Chemical Technology from Osmania University. He is currently a Professor in the Civil and Environmental Engineering department at South Dakota Mines, USA. He has over a decade of teaching and research experience from South Dakota Mines, Rensselaer Polytechnic Institute, Florida Gulf Coast University, Air Force Research Laboratory, and industrial experience from Dupont Singapore Pte Ltd. He is a Board-Certified Environmental Engineer, a licensed Professional Engineer, and the chair of the ASCE EWRI Water Pollution Engineering Committee. He is a recipient of the National Science Foundation CAREER award (2015), South Dakota Mines Research Award (2016), and an invited Tedxtalk speaker for Rapid City in 2017. His research on bioelectrochemistry was featured by BBC, CNN, American Chemical Society, History Now, and 350 other large media outlets. He is a thrust area lead and core investigator (co-I) at the 2D-Materials for Biofilm Engineering, Science and Technology (2D- BEST) center and for other projects funded by NSF, NASA EPSCoR, and Electric Power Research Institute. He has served as an investigator or senior personnel for projects worth $32 MM. His ongoing projects interrogate the fundamental phenomena at the interface of 2D materials and biofilms. Examples of practical outcomes from these projects include NASA microbial fuel cells and infinitesimally thin coatings for corrosion applications.